On 2013-09-20 24:25 +0200, Markus Engel wrote:
+cxxtests_LDFLAGS = -z muldefs
JFYI - this breaks 'make check' on OS X 10.7.5.
1) with llvm-gcc-4.2
CXXLD cxxtests i686-apple-darwin11-llvm-g++-4.2: muldefs: No such file or directory make[3]: *** [cxxtests] Error 1 make[2]: *** [check-am] Error 2 make[1]: *** [check] Error 2 make: *** [check-recursive] Error 1
2) with clang
CXXLD cxxtests clang: error: no such file or directory: 'muldefs' make[3]: *** [cxxtests] Error 1 make[2]: *** [check-am] Error 2 make[1]: *** [check] Error 2 make: *** [check-recursive] Error 1
If I try with
+cxxtests_LDFLAGS = "-Wl,-z,muldefs"
'make check' fails with
CXXLD cxxtests ld: unknown option: -z collect2: ld returned 1 exit status make[3]: *** [cxxtests] Error 1 make[2]: *** [check-am] Error 2 make[1]: *** [check] Error 2 make: *** [check-recursive] Error 1
'make check' also fails if I delete the line with cxxtests_LDFLAGS:
CXXLD cxxtests ld: duplicate symbol xml_quote_strdup(char const*)in xml/quote.o and cxxtests.o for architecture x86_64 collect2: ld returned 1 exit status make[3]: *** [cxxtests] Error 1 make[2]: *** [check-am] Error 2 make[1]: *** [check] Error 2 make: *** [check-recursive] Error 1
Seems that the linker on OS X does not provide an option to ignore multiple definitions (?) - from 'man ld':
-m Don't treat multiple definitions as an error. This is no longer supported. This option is obsolete.