Jump to content

GemRB-git with Clang 3.1


Recommended Posts



[ 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

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

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

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


This topic is now archived and is closed to further replies.

  • Create New...