Building WebKit with gcc 4.6 with -flto enabled results in a linking error: /tmp/ccaOGKiM.ltrans0.ltrans.o: In function `ctiVMThrowTrampoline': ccaOGKiM.ltrans0.o:(.text+0x4c): undefined reference to `cti_vm_throw' The gcc guys say this is not a bug in gcc, since cti_vm_throw is called only by asm code, it needs to be marked with __attribute__((used))
I can confirm this one failing with LTO with gcc 4.6.1
Created attachment 130635 [details] Patch Add __attribute__((used)) to cti_vm_throw and several other functions that needs it to make linking with -flto work.
Comment on attachment 130635 [details] Patch I am not 100% sure this is the right solution, but without review, I will never be told if I wrong.
Comment on attachment 130635 [details] Patch This looks fine in principle, but can you rebase your patch?
Created attachment 143544 [details] Patch
Rebased patch. I should not that I have not succeeded in building WebCore with flto yet, but this patch fixes WTF and JavaScriptCore if build separately.
Attachment 143544 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1 Source/JavaScriptCore/jit/JITStubs.h:466: cti_vm_throw is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 1 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 143544 [details] Patch I’m not sure about the name FUNCTION_USED.
Comment on attachment 143544 [details] Patch Wait, shouldn’t FUNCTION_USED go into Compiler.h instead of Platform.h?
(In reply to comment #8) > (From update of attachment 143544 [details]) > I’m not sure about the name FUNCTION_USED. I am not either, but I don't have a better one. MARK_AS_USED? (In reply to comment #9) > Wait, shouldn’t FUNCTION_USED go into Compiler.h instead of Platform.h? I originally placed it Platform.h because it was were JSC_HOST_CALL was defined which is another flag for JIT-assembler functions, but they may both be misplaced.
Created attachment 143584 [details] Patch Renamed FUNCTION_USED to REFERENCED_FROM_ASM and moved its definition to Compiler.h
Comment on attachment 143584 [details] Patch Clearing flags on attachment: 143584 Committed r118344: <http://trac.webkit.org/changeset/118344>
All reviewed patches have been landed. Closing bug.