Skip to content

Commit 49fe4d9

Browse files
committed
Set up x64 build
1 parent bae37a9 commit 49fe4d9

File tree

4 files changed

+40
-12
lines changed

4 files changed

+40
-12
lines changed

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/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/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/latest/repos/standard/packages'
148+
unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest/repos/{}/packages'.format(
149+
target)
150+
else:
151+
base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Base/latest/repos/standard/packages'.format(
152+
api_version, api_version)
153+
unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Unified/latest/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)