hpcc-systems/HPCC-Platform — Issue #687: Compile error using gcc 4.6
Author: richardkchapman
Created: 2011-10-14 14:23:42+00:00
State: open

Trying to build on gcc 4.6 (i.e. the default compiler on Ubuntu 10.10) I get an error:

c++: error: unrecognized option --export-dynamic

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47390 has some background info on this, including:

'GCC now has stricter checks for invalid command-line options. In particular, when gcc was called to link object files rather than compile source code, it would previously accept and ignore all options starting with --, including linker options such as --as-needed and --export-dynamic, although such options would result in errors if any source code was compiled. Such options, if unknown to the compiler, are now rejected in all cases; if the intent was to pass them to the linker, options such as -Wl,--as-needed should be used.'

'As discussed in PR 46410, the -- versions of linker options were in fact quietly ignored before on link-only command lines, or produced errors on command lines that would actually have resulted in compilation, so --export-dynamic would never have had the intended effect.'

Sounds like we should be using -Wl,-export-dynamic