I can't find any similar option that would include all the function names into the final release binary. Or does clang
do it by default?
3 Answers
The correct answer to this question is -Wl,-export_dynamic
and not -Wl,--export-dynamic
.
-Wl,--export-dynamic
is only correct if you are using the GNU linker on ELF platforms.
This question is about OS X.
Source: http://www.opensource.apple.com/source/ld64/ld64-236.3/src/ld/Options.cpp
...
else if ( strcmp(arg, "-export_dynamic") == 0 ) {
fExportDynamic = true;
}
...
-
This should be the accepted answer. (Tested with AppleClang on Catalina)– ProfFanJan 31, 2020 at 21:14
At least clang 3.3 seems to support -rdynamic
though neither clang --help
nor the manpage documents it. (If you are on OSX, -rdynamic isn't needed)
gcc -rdynamic
says "-rdynamic
Pass the flag --export-dynamic to the ELF linker, on targets that support it."
So clang should also be able to do the same with -Wl,--export-dynamic
.
-
My bad, should have added that I specifically mean OS X. Why is it not needed? Jan 22, 2014 at 10:00
-
-
5
My Google-fu is telling me you can replace that by
-Wl,--export-dynamic
Which is what GCC usually passes to the linker when it is passed -rdynamic
. I would first try it without anything, and see if the flag was necessary.