Anyone have a correct check to see if the compiler needs/accepts
-rdynamic or maybe -Wl,--export-dynamic?
We were using a test like:
AC_MSG_CHECKING([If the compiler accepts -rdynamic])
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -rdynamic"
AC_LINK_IFELSE([int main(){}],
[AC_MSG_RESULT([yes])],
[LDFLAGS="$old_LDFLAGS"
AC_MSG_RESULT([no])
])
unfortunately, while this seems to work with gcc, it does not work with
SunPRO. Here are some examples of how this test might play out.
> cc -rdynamic -o foo foo.c
cc: Warning: illegal option -dynamic
> echo $?
0
so configure thinks rdynamic is ok however, foo is not ok:
> file foo
foo: ELF 32-bit MSB relocatable SPARC32PLUS Version 1, V8+
Required
> ls -l foo
-rw-r--r-- 1 yyyyy yyyyy 429116 Oct 16 22:12 foo
note that foo is not an executible, it is a relocatable.
Without -rdynamic, things are ok:
> cc -o foo foo.c
> file foo
foo: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+
Required, dynamically linked, not stripped
> ls -l foo
-rwxr-xr-x 1 yyyyy yyyyy 6984 Oct 16 22:12 foo
> cc -V
cc: Sun C 5.8 2005/10/13
usage: cc [ options] files. Use 'cc -flags' for details
I actually don't think you need any sort of -rdynamic or
-Wl,--export-dynamic with SunPRO, but I really don't know about some of
the other compilers out there (MipsPRO for example).
Suggestions?
Thanks
-Dan
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf