Skip to content

Commit bec959e

Browse files
jesectargos
authored andcommitted
tools: disable LTO for "v8_cppgc_shared" target
"PushAllRegistersAndIterateStack" is implemented in assembly and called from "stack.cc" via 'extern "C"'. [1] However, LTO does not work well with symbol usage from assembly. [2] This change workarounds the issue by disabling LTO for the target. With GCC 10 and "./configure --enable-lto", compilation succeeds after this change. [1] v8/v8@c10863153 [2] https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ#Symbol_usage_from_assembly_language Refs: #35957 Refs: #38335 Signed-off-by: Jesse Chan <[email protected]> PR-URL: #38346 Refs: #35957 Refs: #38335 Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Jiawen Geng <[email protected]>
1 parent 3cbfde1 commit bec959e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/v8_gypfiles/v8.gyp

+3
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,9 @@
13781378
'<(V8_ROOT)/src/heap/base/worklist.h',
13791379
],
13801380
'conditions': [
1381+
['enable_lto=="true"', {
1382+
'cflags_cc': [ '-fno-lto' ],
1383+
}],
13811384
['clang or OS!="win"', {
13821385
'conditions': [
13831386
['_toolset == "host" and host_arch == "x64" or _toolset == "target" and target_arch=="x64"', {

0 commit comments

Comments
 (0)