Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit d78737c

Browse files
livecodepanoslivecodeali
authored andcommitted
[Bug 16793] Disable LTO on Android (for now)
1 parent d439d76 commit d78737c

File tree

6 files changed

+11
-69
lines changed

6 files changed

+11
-69
lines changed

config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ if test "${OS}" = "android" ; then
324324
ANDROID_AR=${AR:-${ANDROID_TOOLCHAIN}ar}
325325
ANDROID_CC=${CC:-${ANDROID_TOOLCHAIN}clang -target arm-linux-androideabi -march=armv6 -integrated-as}
326326
ANDROID_CXX=${CXX:-${ANDROID_TOOLCHAIN}clang++ -target arm-linux-androideabi -march=armv6 -integrated-as}
327-
ANDROID_LINK=${LINK:-${ANDROID_TOOLCHAIN}clang++ -target arm-linux-androideabi -march=armv6 -integrated-as}
327+
ANDROID_LINK=${LINK:-${ANDROID_TOOLCHAIN}clang++ -target arm-linux-androideabi -march=armv6 -integrated-as -fuse-ld=bfd}
328328
ANDROID_OBJCOPY=${OBJCOPY:-${ANDROID_TOOLCHAIN}objcopy}
329329
ANDROID_OBJDUMP=${OBJDUMP:-${ANDROID_TOOLCHAIN}objdump}
330330
ANDROID_STRIP=${STRIP:-${ANDROID_TOOLCHAIN}strip}

config/android-settings.gypi

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,7 @@
4444
],
4545
},
4646
],
47-
[
48-
'supports_lto != 0',
49-
{
50-
'ldflags':
51-
[
52-
'-fuse-ld=gold',
53-
],
54-
55-
'arflags':
56-
[
57-
'--plugin', '<!(echo $(dirname <(ar))/../lib/LLVMgold.so)',
58-
],
59-
},
60-
{
61-
'ldflags':
62-
[
63-
'-fuse-ld=bfd',
64-
],
65-
},
66-
],
47+
6748
],
6849

6950
'configurations':
@@ -90,27 +71,7 @@
9071
'-g3',
9172
],
9273

93-
'conditions':
94-
[
95-
[
96-
'supports_lto != 0',
97-
{
98-
'cflags':
99-
[
100-
'-flto',
101-
'-ffunction-sections',
102-
],
103-
104-
'ldflags':
105-
[
106-
'-Wl,--icf=all',
107-
'>@(_cflags)',
108-
'>@(_cflags_cc)',
109-
110-
],
111-
},
112-
],
113-
],
74+
11475

11576
'defines':
11677
[

config/android.gypi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
'objcopy': '<!(echo ${OBJCOPY:-objcopy})',
2828
'objdump': '<!(echo ${OBJDUMP:-objdump})',
2929
'strip': '<!(echo ${STRIP:-strip})',
30-
'ar': '<!(echo ${AR:-ar})',
30+
#'ar': '<!(echo ${AR:-ar})',
3131
},
3232

3333
'target_defaults':
@@ -41,8 +41,8 @@
4141
'exe_suffix': '',
4242
'debug_info_suffix': '.dbg',
4343

44-
'supports_lto': '<!(if ${CC} -flto -fuse-ld=gold -c -o /dev/null /dev/null 2>/dev/null >/dev/null; then echo 1; else echo 0; fi)',
45-
44+
#'supports_lto': '<!(if ${CC} -flto -fuse-ld=gold -c -o /dev/null /dev/null 2>/dev/null >/dev/null; then echo 1; else echo 0; fi)',
45+
'supports_lto': 0,
4646
'silence_warnings': 0,
4747
},
4848

engine/engine.gyp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -234,28 +234,10 @@
234234
[
235235
# Helpful for catching build problems
236236
'-Wl,-no-undefined',
237+
'-Wl,-T,$(abs_srcdir)/engine/linux.link',
237238
],
238239

239-
'target_conditions':
240-
[
241-
[
242-
'supports_lto != 0',
243-
{
244-
'ldflags':
245-
[
246-
'-Wl,--sort-section=none',
247-
'-Wl,--section-ordering-file,$(abs_srcdir)/engine/linux-section-order.txt',
248-
],
249-
},
250-
{
251-
'ldflags':
252-
[
253-
'-T', '$(abs_srcdir)/engine/linux.link',
254-
],
255-
},
256-
],
257-
],
258-
240+
259241
'actions':
260242
[
261243
{

engine/src/mode_standalone.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ __attribute__((section("__PROJECT,__project"))) volatile MCCapsuleInfo MCcapsule
9797
#elif defined(TARGET_SUBPLATFORM_IPHONE)
9898
__attribute__((section("__PROJECT,__project"))) volatile MCCapsuleInfo MCcapsule = {0};
9999
#elif defined(TARGET_SUBPLATFORM_ANDROID)
100-
extern MCCapsuleInfo MCcapsule;
101-
asm (".section .project, \"aw\", \"nobits\"; .global MCcapsule; MCcapsule: .align 16; .space 16;");
100+
__attribute__((section(".project"))) volatile MCCapsuleInfo MCcapsule = {0};
102101
#elif defined(TARGET_PLATFORM_MOBILE)
103102
MCCapsuleInfo MCcapsule = {0};
104103
#elif defined(__EMSCRIPTEN__)

gyp/pylib/gyp/generator/make.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@ def CalculateGeneratorInputInfo(params):
192192

193193
LINK_COMMANDS_ANDROID = """\
194194
quiet_cmd_alink = AR($(TOOLSET)) $@
195-
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $(ARFLAGS) $@ $(filter %.o,$^)
195+
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
196196
197197
quiet_cmd_alink_thin = AR($(TOOLSET)) $@
198-
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $(ARFLAGS) $@ $(filter %.o,$^)
198+
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
199199
200200
# Due to circular dependencies between libraries :(, we wrap the
201201
# special "figure out circular dependencies" flags around the entire

0 commit comments

Comments
 (0)