Traveler Posted July 14, 2012 Share Posted July 14, 2012 Do you care if GemRB compiles with clang or is it non-issue? I needed to delete '-g' flag, as by default unused flags stops clang. http://pastebin.com/3gANtNeD P.S. As a side issue, this forum's textboxes are driving me crazy, apparently middle button paste doesn't work as it should in Opera. Link to comment
lynx Posted July 14, 2012 Share Posted July 14, 2012 heh, blame ffmpeg. And yes, the pasting bug is annoying, though it sometimes works. clang doesn't use -g at all?? Link to comment
SyntaxError Posted July 14, 2012 Share Posted July 14, 2012 We build the mac/ios builds with clang 3.1 and the g option doesnt cause a problem for me. (tho i suppose it may be ignored) Link to comment
Traveler Posted July 14, 2012 Author Share Posted July 14, 2012 Maybe you have -Qunused-arguments added? By default unused flags stops compiling. Link to comment
Traveler Posted July 14, 2012 Author Share Posted July 14, 2012 To clarify, -g is supported by clang, just something within GemRB made clang stop with '-g' unused warning (error in this case). Link to comment
SyntaxError Posted July 14, 2012 Share Posted July 14, 2012 no i have -werror on. I also get no build warnings whatsoever. can you clarify what the error is? (I'm using dwarf with o0 btw) Link to comment
Traveler Posted July 14, 2012 Author Share Posted July 14, 2012 Sure, [ 67%] Building CXX object gemrb/core/CMakeFiles/gemrb_core.dir/System/String.cpp.o Linking CXX shared library libgemrb_core.so c++: error: argument unused during compilation: '-g' *** [gemrb/core/libgemrb_core.so] Error code 1 1 error *** [gemrb/core/CMakeFiles/gemrb_core.dir/all] Error code 2 1 error *** [all] Error code 2 1 error $ clang -v FreeBSD clang version 3.1 (branches/release_31 156863) 20120523 (basically Clang 3.1) It supports -g flag per se. Link to comment
SyntaxError Posted July 14, 2012 Share Posted July 14, 2012 for the -g option to be used dont you also need to supply other options? ill look later to see what options im using. Link to comment
lynx Posted July 15, 2012 Share Posted July 15, 2012 Not for gcc, though you could specify the format you want the debug info in. Looks more like it tried to use it at link time, which makes no sense afaik. Link to comment
Traveler Posted July 15, 2012 Author Share Posted July 15, 2012 The difference could be, that gcc ignores '-g' flag during linking and clang stops if some flag is not recognized (or doubled also? I'm not sure.), and by default the same flags (-O2, -g probably) are using during compiling and linking. Link to comment
Traveler Posted July 15, 2012 Author Share Posted July 15, 2012 wtf? http://llvm.org/bugs/show_bug.cgi?id=8611 Link to comment
lynx Posted July 15, 2012 Share Posted July 15, 2012 Maybe it resurfaced or wasn't fixed for all platforms. Something to ask them about. Link to comment
Traveler Posted July 15, 2012 Author Share Posted July 15, 2012 Ok, to sum up: 1. Clang stops if some flag is not recognized (this is expected and wanted behaviour in Clang). 2. Lots of projects include in one way or another CFLAGS in linking. This wasn't a problem, since GCC usually ignored not recognized flags, and still does so for '-g' stated during linking. 3. While apparently some time ago Clang developers wanted to allow benign -g during linking, FreeBSD clang version 3.1 (which is latest) is still strict here. Probably 'correct' way would be to trace where {$CFLAGS} is included in linking and stop doing it, as it does nothing at best. Link to comment
SyntaxError Posted July 15, 2012 Share Posted July 15, 2012 lynx, good eye on the linking bit i completely missed that. now i suddenly remember having this problem with building on mac using cmake. IIRC I had to monkey with the cflags prior to linking to remove that stuff because cmake uses it for both compiling and linking however i fixed it, it probably is a simple matter of changing if(mac) to if(clang) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.