From 90f93f18f6b385d38c30aa9bb0b7fe7cebba8b65 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Fri, 12 Sep 2025 12:04:41 +0900 Subject: [PATCH 1/5] Set up x64 build --- build/config/BUILD.gn | 10 ++++-- flutter/third_party/accessibility/BUILD.gn | 2 +- tools/generate_sysroot.py | 36 +++++++++++++++++----- tools/gn | 4 ++- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index 1c24b70..4201f02 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn @@ -49,8 +49,12 @@ config("compiler") { cflags += [ "-m64", "-march=x86-64", + "--target=x86_64-linux-gnu", + ] + ldflags += [ + "-m64", + "--target=x86_64-linux-gnu", ] - ldflags += [ "-m64" ] } else if (target_cpu == "x86") { cflags += [ "-m32", @@ -115,7 +119,7 @@ config("no_system_cxx") { config("system_cxx") { assert(sysroot_path != "") - if (target_cpu == "arm64") { + if (target_cpu == "arm64" || target_cpu == "x64") { lib_path = "${sysroot_path}/usr/lib64" } else { lib_path = "${sysroot_path}/usr/lib" @@ -127,6 +131,8 @@ config("system_cxx") { gcc_target_triple = "aarch64-tizen-linux-gnu" } else if (target_cpu == "x86") { gcc_target_triple = "i586-tizen-linux-gnu" + } else if (target_cpu == "x64") { + gcc_target_triple = "x86_64-tizen-linux-gnu" } else { assert(false, "Unknown target_cpu: " + target_cpu) } diff --git a/flutter/third_party/accessibility/BUILD.gn b/flutter/third_party/accessibility/BUILD.gn index 9c569f5..07ccb4c 100644 --- a/flutter/third_party/accessibility/BUILD.gn +++ b/flutter/third_party/accessibility/BUILD.gn @@ -15,7 +15,7 @@ config("accessibility_config") { "${sysroot_path}/usr/include/glib-2.0", ] - if (target_cpu == "arm64") { + if (target_cpu == "arm64" || target_cpu == "x64") { include_dirs += [ "${sysroot_path}/usr/lib64/glib-2.0/include" ] } else { include_dirs += [ "${sysroot_path}/usr/lib/glib-2.0/include" ] diff --git a/tools/generate_sysroot.py b/tools/generate_sysroot.py index d7ee581..755a2e8 100755 --- a/tools/generate_sysroot.py +++ b/tools/generate_sysroot.py @@ -128,19 +128,30 @@ def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False): + target = 'standard' + if arch == 'arm': tizen_arch = 'armv7l' elif arch == 'arm64': tizen_arch = 'aarch64' elif arch == 'x86': tizen_arch = 'i686' + target = 'emulator' + elif arch == 'x64': + tizen_arch = 'x86_64' + target = 'emulator' else: sys.exit('Unknown arch: ' + arch) - base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Base/latest/repos/standard/packages'.format( - api_version, api_version) - unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Unified/latest/repos/standard/packages'.format( - api_version, api_version) + if api_version >= 10.0: + base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Base/latest/repos/standard/packages' + unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest/repos/{}/packages'.format( + target) + else: + base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Base/latest/repos/standard/packages'.format( + api_version, api_version) + unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Unified/latest/repos/{}/packages'.format( + api_version, api_version, target) # Retrieve html documents. documents = {} @@ -189,13 +200,16 @@ 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-x86', asm) + else: + 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' @@ -228,7 +242,13 @@ def main(): outpath = Path(__file__).parent.parent / 'sysroot' outpath.mkdir(exist_ok=True) - for arch in ['arm', 'arm64', 'x86']: + arches = ['arm', 'arm64', 'x86'] + if args.api_version >= 10.0: + arches = ['arm', 'arm64', 'x64'] + elif args.api_version >= 8.0: + arches = ['arm', 'arm64', 'x86', 'x64'] + + for arch in arches: sysroot = outpath / arch if args.force and sysroot.is_dir(): shutil.rmtree(sysroot) diff --git a/tools/gn b/tools/gn index dce2647..7038677 100755 --- a/tools/gn +++ b/tools/gn @@ -41,6 +41,8 @@ def get_target_triple(target_cpu): return 'aarch64-linux-gnu' elif target_cpu == 'x86': return 'i686-linux-gnu' + elif target_cpu == 'x64': + return 'x86_64-linux-gnu' else: sys.exit('Unknown target CPU.') @@ -95,7 +97,7 @@ def parse_args(args): parser.add_argument('--unoptimized', default=False, action='store_true') parser.add_argument('--target-cpu', type=str, required=True, - choices=['arm', 'x86', 'arm64']) + choices=['arm', 'x86', 'arm64', 'x64']) parser.add_argument('--target-toolchain', type=str, required=True) parser.add_argument('--target-sysroot', type=str) From 5fcd9c30ca64099ec8fa95467e3b6c2d83507bc5 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Tue, 16 Sep 2025 14:53:46 +0900 Subject: [PATCH 2/5] Fix ci and download engine script --- .github/workflows/build.yml | 39 +++++++++++++------------------------ tools/download_engine.py | 4 ++-- 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c40e93b..3433e9f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,8 +8,8 @@ jobs: strategy: matrix: - api-version: ['6.0', '6.5'] - arch: [arm, arm64, x86] + api-version: ["6.0", "6.5", "8.0", "10.0"] + arch: [arm, arm64, x86, x64] include: - arch: arm triple: arm-linux-gnueabi @@ -17,6 +17,8 @@ jobs: triple: aarch64-linux-gnu - arch: x86 triple: i686-linux-gnu + - arch: x64 + triple: x86-64-linux-gnu steps: - uses: actions/checkout@v4 @@ -43,56 +45,43 @@ jobs: gclient config --name=src --unmanaged https://github.com/${{ github.repository }} gclient sync -v --no-history --shallow - - name: Generate Tizen 6.0 sysroot - if: ${{ matrix.api-version == '6.0' }} - run: src/tools/generate_sysroot.py --out src/sysroot-6.0 + - name: Generate Tizen ${{ matrix.api-version }} sysroot + run: src/tools/generate_sysroot.py --api-version ${{ matrix.api-version }} --out src/sysroot-${{ matrix.api-version }} - - name: Generate Tizen 6.5 sysroot - if: ${{ matrix.api-version == '6.5' }} - run: src/tools/generate_sysroot.py --api-version 6.5 --out src/sysroot-6.5 - - - name: Build for Tizen 6.0 - if: ${{ matrix.api-version == '6.0' }} - run: | - src/tools/gn \ - --target-cpu ${{ matrix.arch }} \ - --target-toolchain /usr/lib/llvm-17 \ - --target-sysroot src/sysroot-6.0/${{ matrix.arch }} \ - --target-dir build - ninja -C src/out/build - - - name: Build for Tizen 6.5 - if: ${{ matrix.api-version == '6.5' }} + - name: Build for Tizen ${{ matrix.api-version }} + if: ${{ !(matrix.api-version == '6.0' && matrix.arch == 'x64') && !(matrix.api-version == '6.5' && matrix.arch == 'x64') && !(matrix.api-version == '10.0' && matrix.arch == 'x86') }} run: | src/tools/gn \ --target-cpu ${{ matrix.arch }} \ --target-toolchain /usr/lib/llvm-17 \ - --target-sysroot src/sysroot-6.5/${{ matrix.arch }} \ - --api-version 6.5 \ + --target-sysroot src/sysroot-${{ matrix.api-version }}/${{ matrix.arch }} \ + --api-version ${{ matrix.api-version }} \ --target-dir build ninja -C src/out/build - uses: actions/upload-artifact@v4 + if: ${{ !(matrix.api-version == '6.0' && matrix.arch == 'x64') && !(matrix.api-version == '6.5' && matrix.arch == 'x64') && !(matrix.api-version == '10.0' && matrix.arch == 'x86') }} with: name: tizen-${{ matrix.api-version }}-${{ matrix.arch }} path: src/out/build/libflutter_tizen*.so if-no-files-found: error - uses: actions/upload-artifact@v4 + if: ${{ !(matrix.api-version == '6.0' && matrix.arch == 'x64') && !(matrix.api-version == '6.5' && matrix.arch == 'x64') && !(matrix.api-version == '10.0' && matrix.arch == 'x86') }} with: name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}_unittests path: src/out/build/flutter_tizen_unittests if-no-files-found: error - uses: actions/upload-artifact@v4 - if: ${{ github.event_name == 'push' }} + if: ${{ !(matrix.api-version == '6.0' && matrix.arch == 'x64') && !(matrix.api-version == '6.5' && matrix.arch == 'x64') && !(matrix.api-version == '10.0' && matrix.arch == 'x86') && github.event_name == 'push' }} with: name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}_symbols path: src/out/build/so.unstripped/libflutter_tizen*.so if-no-files-found: error - uses: actions/upload-artifact@v4 - if: ${{ matrix.arch == 'arm' && matrix.api-version == '6.0' }} + if: ${{ !(matrix.api-version == '6.0' && matrix.arch == 'x64') && !(matrix.api-version == '6.5' && matrix.arch == 'x64') && !(matrix.api-version == '10.0' && matrix.arch == 'x86') && matrix.arch == 'arm' && matrix.api-version == '6.0' }} with: name: tizen-common path: | diff --git a/tools/download_engine.py b/tools/download_engine.py index f7c9219..05f485f 100755 --- a/tools/download_engine.py +++ b/tools/download_engine.py @@ -41,8 +41,8 @@ def main(): shutil.rmtree(engine_dir) engine_dir.mkdir() - names = ['tizen-arm-release.zip', - 'tizen-arm64-release.zip', 'tizen-x86-debug.zip'] + names = ['tizen-arm-release.zip', 'tizen-arm64-release.zip', + 'tizen-x86-debug.zip', 'tizen-x64-release.zip'] for filename in names: arch = filename.split('-')[1] print('Downloading libflutter_engine.so for {}...'.format(arch)) From aa6e7aa25b33ef92a8aad572006138bce1b184cf Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Tue, 16 Sep 2025 17:22:46 +0900 Subject: [PATCH 3/5] Fix code --- flutter/shell/platform/tizen/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/shell/platform/tizen/BUILD.gn b/flutter/shell/platform/tizen/BUILD.gn index 4a02525..9d26bed 100644 --- a/flutter/shell/platform/tizen/BUILD.gn +++ b/flutter/shell/platform/tizen/BUILD.gn @@ -169,7 +169,7 @@ template("embedder") { defines += invoker.defines defines += [ "FLUTTER_ENGINE_NO_PROTOTYPES" ] - if (api_version == "6.5") { + if (api_version != "6.0") { sources += [ "flutter_tizen_nui.cc", "tizen_clipboard.cc", From 4d14f30249223d2664c832e9a15d809397de9bf0 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Wed, 17 Sep 2025 14:48:14 +0900 Subject: [PATCH 4/5] Fix engine download url --- .github/workflows/build.yml | 20 ++++++++++++++------ tools/download_engine.py | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3433e9f..3c82a74 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - api-version: ["6.0", "6.5", "8.0", "10.0"] + api-version: ["6.0", "6.5", "8.0"] arch: [arm, arm64, x86, x64] include: - arch: arm @@ -19,6 +19,17 @@ jobs: triple: i686-linux-gnu - arch: x64 triple: x86-64-linux-gnu + exclude: + - api-version: "6.0" + arch: x64 + - api-version: "6.5" + arch: x64 + - api-version: "8.0" + arch: arm + - api-version: "8.0" + arch: arm64 + - api-version: "8.0" + arch: x86 steps: - uses: actions/checkout@v4 @@ -49,7 +60,6 @@ jobs: run: src/tools/generate_sysroot.py --api-version ${{ matrix.api-version }} --out src/sysroot-${{ matrix.api-version }} - name: Build for Tizen ${{ matrix.api-version }} - if: ${{ !(matrix.api-version == '6.0' && matrix.arch == 'x64') && !(matrix.api-version == '6.5' && matrix.arch == 'x64') && !(matrix.api-version == '10.0' && matrix.arch == 'x86') }} run: | src/tools/gn \ --target-cpu ${{ matrix.arch }} \ @@ -60,28 +70,26 @@ jobs: ninja -C src/out/build - uses: actions/upload-artifact@v4 - if: ${{ !(matrix.api-version == '6.0' && matrix.arch == 'x64') && !(matrix.api-version == '6.5' && matrix.arch == 'x64') && !(matrix.api-version == '10.0' && matrix.arch == 'x86') }} with: name: tizen-${{ matrix.api-version }}-${{ matrix.arch }} path: src/out/build/libflutter_tizen*.so if-no-files-found: error - uses: actions/upload-artifact@v4 - if: ${{ !(matrix.api-version == '6.0' && matrix.arch == 'x64') && !(matrix.api-version == '6.5' && matrix.arch == 'x64') && !(matrix.api-version == '10.0' && matrix.arch == 'x86') }} with: name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}_unittests path: src/out/build/flutter_tizen_unittests if-no-files-found: error - uses: actions/upload-artifact@v4 - if: ${{ !(matrix.api-version == '6.0' && matrix.arch == 'x64') && !(matrix.api-version == '6.5' && matrix.arch == 'x64') && !(matrix.api-version == '10.0' && matrix.arch == 'x86') && github.event_name == 'push' }} + if: ${{ github.event_name == 'push' }} with: name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}_symbols path: src/out/build/so.unstripped/libflutter_tizen*.so if-no-files-found: error - uses: actions/upload-artifact@v4 - if: ${{ !(matrix.api-version == '6.0' && matrix.arch == 'x64') && !(matrix.api-version == '6.5' && matrix.arch == 'x64') && !(matrix.api-version == '10.0' && matrix.arch == 'x86') && matrix.arch == 'arm' && matrix.api-version == '6.0' }} + if: ${{ matrix.arch == 'arm' && matrix.api-version == '6.0' }} with: name: tizen-common path: | diff --git a/tools/download_engine.py b/tools/download_engine.py index 05f485f..dc559cd 100755 --- a/tools/download_engine.py +++ b/tools/download_engine.py @@ -14,7 +14,7 @@ # Downloads the latest engine artifacts for use by the linker. def main(): engine_dir = Path(__file__).parent.parent / 'engine' - github_url = 'https://github.com/flutter-tizen/engine/releases' + github_url = 'https://github.com/flutter-tizen/flutter/releases' stamp = '' stamp_file = engine_dir / 'engine.stamp' From 0196add85bc557148b054bbaa3e73e7caab536ff Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Thu, 18 Sep 2025 17:07:02 +0900 Subject: [PATCH 5/5] Update sysroot download URL --- tools/generate_sysroot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/generate_sysroot.py b/tools/generate_sysroot.py index 755a2e8..4717332 100755 --- a/tools/generate_sysroot.py +++ b/tools/generate_sysroot.py @@ -144,13 +144,13 @@ def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False): sys.exit('Unknown arch: ' + arch) if api_version >= 10.0: - base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Base/latest/repos/standard/packages' - unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest/repos/{}/packages'.format( + base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Base/reference/repos/standard/packages/' + unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/reference/repos//{}/packages'.format( target) else: - base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Base/latest/repos/standard/packages'.format( + base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Base/reference/repos/standard/packages'.format( api_version, api_version) - unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Unified/latest/repos/{}/packages'.format( + unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Unified/reference/repos/{}/packages'.format( api_version, api_version, target) # Retrieve html documents.