public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Checking for -rdynamic flag in gcc/configure
@ 2009-08-29 11:51 Steve Ellcey
  2009-08-29 15:36 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Ellcey @ 2009-08-29 11:51 UTC (permalink / raw)
  To: gcc


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?

Steve Ellcey
sje@cup.hp.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Checking for -rdynamic flag in gcc/configure
  2009-08-29 11:51 Checking for -rdynamic flag in gcc/configure Steve Ellcey
@ 2009-08-29 15:36 ` Ian Lance Taylor
  2009-08-30  0:13   ` Joseph S. Myers
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2009-08-29 15:36 UTC (permalink / raw)
  To: sje; +Cc: gcc

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Checking for -rdynamic flag in gcc/configure
  2009-08-29 15:36 ` Ian Lance Taylor
@ 2009-08-30  0:13   ` Joseph S. Myers
  2009-08-31 16:41     ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Joseph S. Myers @ 2009-08-30  0:13 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: sje, gcc

On Fri, 28 Aug 2009, Ian Lance Taylor wrote:

> 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.

This is testing properties of the *host* linker (build-x-host in the 
Canadian cross case), so in-tree tools (which will be built as 
host-x-target) are irrelevant, and you can always assume that the host 
tools are already installed (of course you need to make sure you use the 
correct objdump, not that for build or target).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Checking for -rdynamic flag in gcc/configure
  2009-08-30  0:13   ` Joseph S. Myers
@ 2009-08-31 16:41     ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2009-08-31 16:41 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: sje, gcc

"Joseph S. Myers" <joseph@codesourcery.com> writes:

> On Fri, 28 Aug 2009, Ian Lance Taylor wrote:
>
>> 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.
>
> This is testing properties of the *host* linker (build-x-host in the 
> Canadian cross case), so in-tree tools (which will be built as 
> host-x-target) are irrelevant, and you can always assume that the host 
> tools are already installed (of course you need to make sure you use the 
> correct objdump, not that for build or target).

Ah, you're quite right, sorry.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-31 15:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-29 11:51 Checking for -rdynamic flag in gcc/configure Steve Ellcey
2009-08-29 15:36 ` Ian Lance Taylor
2009-08-30  0:13   ` Joseph S. Myers
2009-08-31 16:41     ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).