This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Checking for -rdynamic flag in gcc/configure
- From: Ian Lance Taylor <iant at google dot com>
- To: sje at cup dot hp dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 28 Aug 2009 17:47:54 -0700
- Subject: Re: Checking for -rdynamic flag in gcc/configure
- References: <200908282349.n7SNnK301767@lucas.cup.hp.com>
Steve Ellcey <sje@cup.hp.com> writes:
> I have a question about the check for -rdynamic in gcc/configure.
> What we have in configure.ac is:
>
> # Check -rdynamic
> LDFLAGS="$LDFLAGS -rdynamic"
> AC_MSG_CHECKING([for -rdynamic])
> AC_TRY_LINK([],[return 0;],
> [AC_MSG_RESULT([yes]); have_rdynamic=yes],
> [AC_MSG_RESULT([no])])
> if test x"$have_rdynamic" = x"yes" ; then
> pluginlibs="-rdynamic"
> fi
>
> The problem I have is that on HP-UX this test will set have_rdynamic
> to yes even though the HP linker doesn't understand the option.
> The AC_TRY_LINK works because the linker prints a warning message
> about not understanding -rdynamic but still runs and creates an
> object file. Thus the configure script thinks the HP linker does
> know about the -rdynamic flag and continues to use it (resulting
> in more warnings during the GCC build).
>
> Any ideas on how to address this?
Link a small program with -rdynamic, one which defines a globally
visible function which is not called. Run objdump -T and see if you can
see that symbol in the output.
If you follow this path you must do the in_tree_ld/ld_ver dance so that
cross-compilers continue to work.
Or, run ld --help and look for --export-dynamic.
Ian