From 780572ec4b21e3c2a6fa86af9287ca1156d1ff21 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Tue, 11 Jun 2024 16:43:59 +0900 Subject: [PATCH] Support x64 build --- .github/workflows/build.yml | 8 +++++++- ci/tizen/build_llvm.sh | 1 + ci/tizen/generate_sysroot.py | 19 ++++++++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c0a75291e67f2..5cae3d3ead4b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - arch: [arm, arm64, x86] + arch: [arm, arm64, x86, x64] mode: [debug, release, profile] include: - arch: arm @@ -22,11 +22,17 @@ jobs: triple: aarch64-linux-gnu - arch: x86 triple: i686-linux-gnu + - arch: x64 + triple: x86_64-linux-gnu exclude: - arch: x86 mode: release - arch: x86 mode: profile + - arch: x64 + mode: release + - arch: x64 + mode: profile steps: - uses: actions/checkout@v4 diff --git a/ci/tizen/build_llvm.sh b/ci/tizen/build_llvm.sh index 507395cea8363..8c0cf22a6dcd7 100755 --- a/ci/tizen/build_llvm.sh +++ b/ci/tizen/build_llvm.sh @@ -42,4 +42,5 @@ for name in ar readelf nm strip; do ln -sf llvm-$name arm-linux-gnueabi-$name ln -sf llvm-$name aarch64-linux-gnu-$name ln -sf llvm-$name i686-linux-gnu-$name + ln -sf llvm-$name x86_64-linux-gnu-$name done diff --git a/ci/tizen/generate_sysroot.py b/ci/tizen/generate_sysroot.py index c40bc6a449eb7..3ab0d712897a6 100755 --- a/ci/tizen/generate_sysroot.py +++ b/ci/tizen/generate_sysroot.py @@ -37,6 +37,8 @@ def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False): tizen_arch = 'aarch64' elif arch == 'x86': tizen_arch = 'i686' + elif arch == 'x64': + tizen_arch = 'x86_64' else: sys.exit('Unknown arch: ' + arch) @@ -87,14 +89,17 @@ def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False): # Create symbolic links. asm = sysroot / 'usr' / 'include' / 'asm' - if not asm.exists(): - os.symlink('asm-' + arch, asm) + if (arch == 'x64'): + os.symlink('asm-generic', asm) + else: + if not asm.exists(): + os.symlink('asm-' + arch, asm) pkgconfig = sysroot / 'usr' / 'lib' / 'pkgconfig' - if arch == 'arm64' and not pkgconfig.exists(): + if (arch == 'arm64' or arch == 'x64') and not pkgconfig.exists(): os.symlink('../lib64/pkgconfig', pkgconfig) # Copy objects required by the linker, such as crtbeginS.o and libgcc.a. - if arch == 'arm64': + if arch == 'arm64' or arch == 'x64': libpath = sysroot / 'usr' / 'lib64' else: libpath = sysroot / 'usr' / 'lib' @@ -122,9 +127,9 @@ def main(): parser.add_argument( '--api-version', metavar='VER', - default=5.5, + default=6.0, type=float, - help='Target API version (defaults to 5.5)' + help='Target API version (defaults to 6.0)' ) args = parser.parse_args() @@ -134,7 +139,7 @@ def main(): outpath = Path(__file__).parent / 'sysroot' outpath.mkdir(exist_ok=True) - for arch in ['arm', 'arm64', 'x86']: + for arch in ['arm', 'arm64', 'x86', 'x64']: sysroot = outpath / arch if args.force and sysroot.is_dir(): shutil.rmtree(sysroot)