Skip to content

Commit 62085b9

Browse files
authored
Add x64 artifacts for the x64 emulator (#118)
1 parent 58aae46 commit 62085b9

File tree

7 files changed

+64
-39
lines changed

7 files changed

+64
-39
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,28 @@ jobs:
88

99
strategy:
1010
matrix:
11-
api-version: ['6.0', '6.5']
12-
arch: [arm, arm64, x86]
11+
api-version: ["6.0", "6.5", "8.0"]
12+
arch: [arm, arm64, x86, x64]
1313
include:
1414
- arch: arm
1515
triple: arm-linux-gnueabi
1616
- arch: arm64
1717
triple: aarch64-linux-gnu
1818
- arch: x86
1919
triple: i686-linux-gnu
20+
- arch: x64
21+
triple: x86-64-linux-gnu
22+
exclude:
23+
- api-version: "6.0"
24+
arch: x64
25+
- api-version: "6.5"
26+
arch: x64
27+
- api-version: "8.0"
28+
arch: arm
29+
- api-version: "8.0"
30+
arch: arm64
31+
- api-version: "8.0"
32+
arch: x86
2033

2134
steps:
2235
- uses: actions/checkout@v4
@@ -43,32 +56,16 @@ jobs:
4356
gclient config --name=src --unmanaged https://github.com/${{ github.repository }}
4457
gclient sync -v --no-history --shallow
4558
46-
- name: Generate Tizen 6.0 sysroot
47-
if: ${{ matrix.api-version == '6.0' }}
48-
run: src/tools/generate_sysroot.py --out src/sysroot-6.0
59+
- name: Generate Tizen ${{ matrix.api-version }} sysroot
60+
run: src/tools/generate_sysroot.py --api-version ${{ matrix.api-version }} --out src/sysroot-${{ matrix.api-version }}
4961

50-
- name: Generate Tizen 6.5 sysroot
51-
if: ${{ matrix.api-version == '6.5' }}
52-
run: src/tools/generate_sysroot.py --api-version 6.5 --out src/sysroot-6.5
53-
54-
- name: Build for Tizen 6.0
55-
if: ${{ matrix.api-version == '6.0' }}
56-
run: |
57-
src/tools/gn \
58-
--target-cpu ${{ matrix.arch }} \
59-
--target-toolchain /usr/lib/llvm-17 \
60-
--target-sysroot src/sysroot-6.0/${{ matrix.arch }} \
61-
--target-dir build
62-
ninja -C src/out/build
63-
64-
- name: Build for Tizen 6.5
65-
if: ${{ matrix.api-version == '6.5' }}
62+
- name: Build for Tizen ${{ matrix.api-version }}
6663
run: |
6764
src/tools/gn \
6865
--target-cpu ${{ matrix.arch }} \
6966
--target-toolchain /usr/lib/llvm-17 \
70-
--target-sysroot src/sysroot-6.5/${{ matrix.arch }} \
71-
--api-version 6.5 \
67+
--target-sysroot src/sysroot-${{ matrix.api-version }}/${{ matrix.arch }} \
68+
--api-version ${{ matrix.api-version }} \
7269
--target-dir build
7370
ninja -C src/out/build
7471

build/config/BUILD.gn

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ config("compiler") {
4949
cflags += [
5050
"-m64",
5151
"-march=x86-64",
52+
"--target=x86_64-linux-gnu",
53+
]
54+
ldflags += [
55+
"-m64",
56+
"--target=x86_64-linux-gnu",
5257
]
53-
ldflags += [ "-m64" ]
5458
} else if (target_cpu == "x86") {
5559
cflags += [
5660
"-m32",
@@ -115,7 +119,7 @@ config("no_system_cxx") {
115119
config("system_cxx") {
116120
assert(sysroot_path != "")
117121

118-
if (target_cpu == "arm64") {
122+
if (target_cpu == "arm64" || target_cpu == "x64") {
119123
lib_path = "${sysroot_path}/usr/lib64"
120124
} else {
121125
lib_path = "${sysroot_path}/usr/lib"
@@ -127,6 +131,8 @@ config("system_cxx") {
127131
gcc_target_triple = "aarch64-tizen-linux-gnu"
128132
} else if (target_cpu == "x86") {
129133
gcc_target_triple = "i586-tizen-linux-gnu"
134+
} else if (target_cpu == "x64") {
135+
gcc_target_triple = "x86_64-tizen-linux-gnu"
130136
} else {
131137
assert(false, "Unknown target_cpu: " + target_cpu)
132138
}

flutter/shell/platform/tizen/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ template("embedder") {
169169
defines += invoker.defines
170170
defines += [ "FLUTTER_ENGINE_NO_PROTOTYPES" ]
171171

172-
if (api_version == "6.5") {
172+
if (api_version != "6.0") {
173173
sources += [
174174
"flutter_tizen_nui.cc",
175175
"tizen_clipboard.cc",

flutter/third_party/accessibility/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ config("accessibility_config") {
1515
"${sysroot_path}/usr/include/glib-2.0",
1616
]
1717

18-
if (target_cpu == "arm64") {
18+
if (target_cpu == "arm64" || target_cpu == "x64") {
1919
include_dirs += [ "${sysroot_path}/usr/lib64/glib-2.0/include" ]
2020
} else {
2121
include_dirs += [ "${sysroot_path}/usr/lib/glib-2.0/include" ]

tools/download_engine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Downloads the latest engine artifacts for use by the linker.
1515
def main():
1616
engine_dir = Path(__file__).parent.parent / 'engine'
17-
github_url = 'https://github.com/flutter-tizen/engine/releases'
17+
github_url = 'https://github.com/flutter-tizen/flutter/releases'
1818

1919
stamp = ''
2020
stamp_file = engine_dir / 'engine.stamp'
@@ -41,8 +41,8 @@ def main():
4141
shutil.rmtree(engine_dir)
4242
engine_dir.mkdir()
4343

44-
names = ['tizen-arm-release.zip',
45-
'tizen-arm64-release.zip', 'tizen-x86-debug.zip']
44+
names = ['tizen-arm-release.zip', 'tizen-arm64-release.zip',
45+
'tizen-x86-debug.zip', 'tizen-x64-release.zip']
4646
for filename in names:
4747
arch = filename.split('-')[1]
4848
print('Downloading libflutter_engine.so for {}...'.format(arch))

tools/generate_sysroot.py

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,30 @@
128128

129129

130130
def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False):
131+
target = 'standard'
132+
131133
if arch == 'arm':
132134
tizen_arch = 'armv7l'
133135
elif arch == 'arm64':
134136
tizen_arch = 'aarch64'
135137
elif arch == 'x86':
136138
tizen_arch = 'i686'
139+
target = 'emulator'
140+
elif arch == 'x64':
141+
tizen_arch = 'x86_64'
142+
target = 'emulator'
137143
else:
138144
sys.exit('Unknown arch: ' + arch)
139145

140-
base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Base/latest/repos/standard/packages'.format(
141-
api_version, api_version)
142-
unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Unified/latest/repos/standard/packages'.format(
143-
api_version, api_version)
146+
if api_version >= 10.0:
147+
base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Base/reference/repos/standard/packages/'
148+
unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/reference/repos//{}/packages'.format(
149+
target)
150+
else:
151+
base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Base/reference/repos/standard/packages'.format(
152+
api_version, api_version)
153+
unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Unified/reference/repos/{}/packages'.format(
154+
api_version, api_version, target)
144155

145156
# Retrieve html documents.
146157
documents = {}
@@ -189,13 +200,16 @@ def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False):
189200
# Create symbolic links.
190201
asm = sysroot / 'usr' / 'include' / 'asm'
191202
if not asm.exists():
192-
os.symlink('asm-' + arch, asm)
203+
if arch == 'x64':
204+
os.symlink('asm-x86', asm)
205+
else:
206+
os.symlink('asm-' + arch, asm)
193207
pkgconfig = sysroot / 'usr' / 'lib' / 'pkgconfig'
194-
if arch == 'arm64' and not pkgconfig.exists():
208+
if (arch == 'arm64' or arch == 'x64') and not pkgconfig.exists():
195209
os.symlink('../lib64/pkgconfig', pkgconfig)
196210

197211
# Copy objects required by the linker, such as crtbeginS.o and libgcc.a.
198-
if arch == 'arm64':
212+
if arch == 'arm64' or arch == 'x64':
199213
libpath = sysroot / 'usr' / 'lib64'
200214
else:
201215
libpath = sysroot / 'usr' / 'lib'
@@ -228,7 +242,13 @@ def main():
228242
outpath = Path(__file__).parent.parent / 'sysroot'
229243
outpath.mkdir(exist_ok=True)
230244

231-
for arch in ['arm', 'arm64', 'x86']:
245+
arches = ['arm', 'arm64', 'x86']
246+
if args.api_version >= 10.0:
247+
arches = ['arm', 'arm64', 'x64']
248+
elif args.api_version >= 8.0:
249+
arches = ['arm', 'arm64', 'x86', 'x64']
250+
251+
for arch in arches:
232252
sysroot = outpath / arch
233253
if args.force and sysroot.is_dir():
234254
shutil.rmtree(sysroot)

tools/gn

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ def get_target_triple(target_cpu):
4141
return 'aarch64-linux-gnu'
4242
elif target_cpu == 'x86':
4343
return 'i686-linux-gnu'
44+
elif target_cpu == 'x64':
45+
return 'x86_64-linux-gnu'
4446
else:
4547
sys.exit('Unknown target CPU.')
4648

@@ -95,7 +97,7 @@ def parse_args(args):
9597
parser.add_argument('--unoptimized', default=False, action='store_true')
9698

9799
parser.add_argument('--target-cpu', type=str, required=True,
98-
choices=['arm', 'x86', 'arm64'])
100+
choices=['arm', 'x86', 'arm64', 'x64'])
99101

100102
parser.add_argument('--target-toolchain', type=str, required=True)
101103
parser.add_argument('--target-sysroot', type=str)

0 commit comments

Comments
 (0)