RESOLVED FIXED 56088
cti_vm_throw gets kicked out by gcc 4.6 -flto
https://bugs.webkit.org/show_bug.cgi?id=56088
Summary cti_vm_throw gets kicked out by gcc 4.6 -flto
Bernhard Rosenkraenzer
Reported 2011-03-10 03:31:14 PST
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))
Attachments
Patch (19.16 KB, patch)
2012-03-07 09:10 PST, Allan Sandfeld Jensen
no flags
Patch (5.80 KB, patch)
2012-05-23 05:39 PDT, Allan Sandfeld Jensen
no flags
Patch (5.75 KB, patch)
2012-05-23 10:00 PDT, Allan Sandfeld Jensen
no flags
stormbyte
Comment 1 2011-07-28 06:39:37 PDT
I can confirm this one failing with LTO with gcc 4.6.1
Allan Sandfeld Jensen
Comment 2 2012-03-07 09:10:27 PST
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.
Allan Sandfeld Jensen
Comment 3 2012-05-21 08:27:23 PDT
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.
Filip Pizlo
Comment 4 2012-05-21 13:47:00 PDT
Comment on attachment 130635 [details] Patch This looks fine in principle, but can you rebase your patch?
Allan Sandfeld Jensen
Comment 5 2012-05-23 05:39:33 PDT
Allan Sandfeld Jensen
Comment 6 2012-05-23 05:42:02 PDT
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.
WebKit Review Bot
Comment 7 2012-05-23 05:43:27 PDT
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.
Darin Adler
Comment 8 2012-05-23 08:27:02 PDT
Comment on attachment 143544 [details] Patch I’m not sure about the name FUNCTION_USED.
Darin Adler
Comment 9 2012-05-23 08:27:43 PDT
Comment on attachment 143544 [details] Patch Wait, shouldn’t FUNCTION_USED go into Compiler.h instead of Platform.h?
Allan Sandfeld Jensen
Comment 10 2012-05-23 08:44:55 PDT
(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.
Allan Sandfeld Jensen
Comment 11 2012-05-23 10:00:19 PDT
Created attachment 143584 [details] Patch Renamed FUNCTION_USED to REFERENCED_FROM_ASM and moved its definition to Compiler.h
WebKit Review Bot
Comment 12 2012-05-24 03:49:55 PDT
Comment on attachment 143584 [details] Patch Clearing flags on attachment: 143584 Committed r118344: <http://trac.webkit.org/changeset/118344>
WebKit Review Bot
Comment 13 2012-05-24 03:50:00 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.