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

Commit 924ee63

Browse files
Force the use of Gold when going LTO Linux builds
1 parent 43df0a6 commit 924ee63

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
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 -fuse-ld=bfd}
327+
ANDROID_LINK=${LINK:-${ANDROID_TOOLCHAIN}clang++ -target arm-linux-androideabi -march=armv6 -integrated-as}
328328
ANDROID_OBJCOPY=${OBJCOPY:-${ANDROID_TOOLCHAIN}objcopy}
329329
ANDROID_OBJDUMP=${OBJDUMP:-${ANDROID_TOOLCHAIN}objdump}
330330
ANDROID_STRIP=${STRIP:-${ANDROID_TOOLCHAIN}strip}

config/linux-settings.gypi

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@
2626
'../thirdparty/libcairo/src', # Required by the GDK headers
2727
'../thirdparty/libfreetype/include', # Required by the Pango headers
2828
],
29+
30+
'conditions':
31+
[
32+
[
33+
# For consistency, we should use the same linker in both Debug and Release builds
34+
'supports_lto != 0',
35+
{
36+
'ldflags':
37+
[
38+
'-fuse-ld=gold',
39+
],
40+
},
41+
],
42+
],
2943

3044
# Static libraries that are to be included into dynamic libraries
3145
# need to be compiled with the correct compilation flags
@@ -142,13 +156,15 @@
142156
'cflags':
143157
[
144158
'-flto',
159+
'-ffunction-sections',
145160
],
146161

147162
'ldflags':
148163
[
149164
'-flto',
150-
'-O3',
151-
'-g3',
165+
'-Wl,--icf=all',
166+
'>@(_cflags)',
167+
'>@(_cflags_cc)',
152168
],
153169
},
154170
],

0 commit comments

Comments
 (0)