LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 973 - llvm-gcc4 compiled code lacks static ctors & dtors
Summary: llvm-gcc4 compiled code lacks static ctors & dtors
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Common Code Generator Code (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords: miscompilation
Depends on:
Blocks:
 
Reported: 2006-10-29 06:15 PST by Anton Korobeynikov
Modified: 2010-02-22 12:53 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments
Patch for llvm-gcc4 (2.33 KB, patch)
2006-10-29 09:29 PST, Anton Korobeynikov
Details
Patch for LLVM (3.52 KB, patch)
2006-10-29 09:30 PST, Anton Korobeynikov
Details
Testcase (155 bytes, text/plain)
2006-10-29 09:30 PST, Anton Korobeynikov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Korobeynikov 2006-10-29 06:15:19 PST
llvm-gcc4 code lacks static ctors & dtors at least on Linux (mingw has its own
technique to handle this and everything is ok there). This breaks many apps,
e.q. Qt.

The problem will solved (I hope), when crtstuff.c will be properly compiled with
llvm-gcc4.
Comment 1 Anton Korobeynikov 2006-10-29 09:29:12 PST
Well, It seems, that LLVM is mature enough to compile crtstuff.c properly with
just few minor glitches. Please find attached 2 patches: one for LLVM itself,
one for llvm-gcc4 which enables static ctors & dtors at least on linux platform.

Test .cpp file is also attached.
Comment 2 Anton Korobeynikov 2006-10-29 09:29:51 PST
Created attachment 423 [details]
Patch for llvm-gcc4
Comment 3 Anton Korobeynikov 2006-10-29 09:30:06 PST
Created attachment 424 [details]
Patch for LLVM
Comment 4 Anton Korobeynikov 2006-10-29 09:30:47 PST
Created attachment 425 [details]
Testcase
Comment 5 Chris Lattner 2006-10-29 11:41:36 PST
"Patch for llvm-gcc4" applies, thanks Anton!
Comment 6 Evan Cheng 2006-10-30 19:27:29 PST
"Patch for LLVM" applied. Thanks!