public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/33637]  New: "checking for nm: test: too many arguments" causes "Undefined symbol: __gxx_personality_v0"
@ 2007-10-03 12:42 haubi at gentoo dot org
  2007-10-03 15:38 ` [Bug regression/33637] " pinskia at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 19+ messages in thread
From: haubi at gentoo dot org @ 2007-10-03 12:42 UTC (permalink / raw)
  To: gcc-bugs

Sorry for the details - might not be required as I already tracked down the
problem to the source line...

When NM_FOR_TARGET requires arguments (fex "-B -X32_64" for aix), checking for
nm in gcc/configure{,.ac} is broken:

Assume 
*) source is /source/gcc-4.2.0
*) builddir is /build
*) configured --prefix=/prefix (and others, but irrelevant)

checking what assembler to use... /usr/ccs/bin/as
checking what linker to use... /usr/ccs/bin/ld
/source/gcc-4.2.0/gcc/configure: line 13513: test: too many arguments
checking for powerpc-ibm-aix5.3.0.0-nm... /usr/bin/nm
checking what nm to use... /usr/bin/nm
checking for objdump... no

This only becomes a real problem, when there is some symlink or wrapper
available as "/prefix/${target}/bin/nm", or somehow else NM_FOR_TARGET already
contains full path.

checking what assembler to use... /prefix/powerpc-ibm-aix5.3.0.0/bin/as
checking what linker to use... /prefix/powerpc-ibm-aix5.3.0.0/bin/ld
/source/gcc-4.2.0/gcc/configure: line 13513: test: too many arguments
checking for /prefix/powerpc-ibm-aix5.3.0.0/bin/nm... no
checking what nm to use...
checking for objdump... no

So it ends up with no nm at all.

The follow-up problems are:

1) generated builddir/gcc/nm is (missing /path/to/nm)
    #!/bin/sh
    exec  "$@"

2) while configuring powerpc-ibm-aix5.3.0.0/libstdc++-v3:

checking dynamic linker characteristics... aix5.3.0.0 ld.so
checking command to parse /build/./gcc/nm -B -X32_64 output... /build/./gcc/nm:
line 2: exec: -B: invalid option
exec: usage: exec [-cl] [-a name] file [redirection ...]
/build/./gcc/nm: line 2: exec: -B: invalid option
exec: usage: exec [-cl] [-a name] file [redirection ...]
failed
checking if libtool supports shared libraries... yes

3) The generated libstdc++.a does not export any symbols, because nm fails to
create a list of symbols due to 2).

4) When using g++, the simplest resulting linker error is

    ld: 0711-317 ERROR: Undefined symbol: __gxx_personality_v0

'-bnoquiet' linker-output contains this line:

    LIBRARY: Shared object libstdc++.a[libstdc++.so.6]: 0 symbols imported.

Looks like the same problem was here:
http://gcc.gnu.org/ml/gcc-help/2007-09/msg00100.html

The code around line 13513 in gcc-4.2.0/gcc/configure is:

13507 if test -f $gcc_cv_binutils_srcdir/configure.in \
13508      && test -f ../binutils/Makefile \
13509      && test x$build = x$host; then
13510     gcc_cv_nm=../binutils/nm-new$build_exeext
13511 elif test -x nm$build_exeext; then
13512     gcc_cv_nm=./nm$build_exeext
13513 elif test -x $NM_FOR_TARGET; then
           ^^^^^^^ broken ^^^^^^^
13514         gcc_cv_nm="$NM_FOR_TARGET"
13515 else
13516         # Extract the first word of "$NM_FOR_TARGET", so it can be a
program name with args.
13517 set dummy $NM_FOR_TARGET; ac_word=$2
13518 echo "$as_me:$LINENO: checking for $ac_word" >&5

This problem came up with gentoo-alt/prefix - still using native toolchain. but
wrapped with binutils-config - thus /prefix/${target}/bin/nm is available
(actually gentoo-alt/prefix configures with --prefix=/prefix/usr and builds
within some longer builddir - have it shortened here for readability).

Have already searched in gcc-svn:
This problem was introduced in revision 110266 of trunk/gcc/configure.ac, being
both in gcc-4.2-branch and trunk, but not gcc-4.1-branch.

What I'm unable to say is how to fix this correctly.


-- 
           Summary: "checking for nm: test: too many arguments" causes
                    "Undefined symbol: __gxx_personality_v0"
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: haubi at gentoo dot org
 GCC build triplet: powerpc-ibm-aix5.3.0.0
  GCC host triplet: powerpc-ibm-aix5.3.0.0
GCC target triplet: powerpc-ibm-aix5.3.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33637


^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <bug-33637-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2010-11-26  9:54 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-03 12:42 [Bug regression/33637] New: "checking for nm: test: too many arguments" causes "Undefined symbol: __gxx_personality_v0" haubi at gentoo dot org
2007-10-03 15:38 ` [Bug regression/33637] " pinskia at gcc dot gnu dot org
2007-10-08 14:17 ` haubi at gentoo dot org
2007-10-10 20:40 ` haubi at gentoo dot org
2007-10-31 18:21 ` dje at gcc dot gnu dot org
2007-11-01 20:19 ` haubi at gentoo dot org
2008-07-04 23:51 ` [Bug target/33637] [4.2/4.3/4.4 Regression] " jsm28 at gcc dot gnu dot org
2008-07-10 14:33 ` rguenth at gcc dot gnu dot org
2008-12-31 22:18 ` pinskia at gcc dot gnu dot org
2009-03-31 20:12 ` [Bug target/33637] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-08-04 12:37 ` rguenth at gcc dot gnu dot org
2009-09-29  8:09 ` michael dot haubenwallner at salomon dot at
2010-05-04 11:41 ` [Bug target/33637] [4.3/4.4/4.5/4.6 " dje at gcc dot gnu dot org
2010-07-22  9:42 ` rguenth at gcc dot gnu dot org
2010-07-22  9:42 ` rguenth at gcc dot gnu dot org
     [not found] <bug-33637-4@http.gcc.gnu.org/bugzilla/>
2010-11-23 12:25 ` jakub at gcc dot gnu.org
2010-11-23 13:01 ` bonzini at gnu dot org
2010-11-23 17:01 ` jakub at gcc dot gnu.org
2010-11-26 10:10 ` jakub at gcc dot gnu.org

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