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

--- Comment #23 from Richard Nolde <richard.nolde at cybox dot com> 2011-02-25 
00:20:54 UTC ---
On 02/24/2011 01:42 PM, michael.haubenwallner at salomon dot at wrote:

Progress report on building Gcc 4.5.0 on AIX 6.0:

Using your suggestion for gmake bootstrap STAGE1_FLAGS=-0 gets me much 
further in the build. The problem has moved to building libgomp, and the 
failure appears to be due to the fact that AIX nm needs nm -B to be 
compatible with the AIX ld. The top level configure scripts seem to deal 
with this fine, but in the libgomp directory, configure builds a 
makefile that invokes
   /devel/opensource/gcc/gcc-4.5.0/host-powerpc-ibm-aix6.1.0.0/gcc/nm 
and bombs.

If NM is defined/exported as NM="/usr/bin/nm -B", or "/usr/bin/nm -B 
-X32_64", the script:

errors out a line 83.
[83]: /usr/bin/nm -B -X32_64:  not found

I believe the command   on line 83:      exec "$original" ${1+"$@"} is 
looking for a file named "-B" or "-B -X32_64" depending on how you 
define NM.  It would seem that we need an NM_FLAGS variable comparable 
to LD_FLAGS in which to pass the extra flags required to make AIX do the 
right thing here. The question is why do the other makefiles built by 
configure not have the same problem? If you don't define NM="/usr/bin/nm 
-B" at least, the top level configure reports that you cannot build 
shared libraries, which is not true on AIX. AIX shared libraries contain 
both 32 bit and 64 bit objects and can use .a or .so for a suffix.

It appears that the case statement at the top of the file is going to 
fall through without matching nm since basename returns nm -B and we 
then fall through the second case statement and invoke /usr/bin/nm such 
that it looks for the file -B. I not quite sure on this one.
...
      55 case "$original" in
      56   ../*)
      57     # compute absolute path of the location of this script
      58     tdir=`dirname "$0"`
      59     scriptdir=`cd "$tdir" && pwd`
      60
      61     if test -x $scriptdir/../$dir/$prog; then
      62       test "$fast_install" = yes || exec 
$scriptdir/../$dir/$prog ${1+"$@"}
      63
      64       # if libtool did everything it needs to do, there's a 
fast path
      65       lt_prog=$scriptdir/../$dir/$objdir/lt-$prog
      66       test -x $lt_prog && exec $lt_prog ${1+"$@"}
      67
      68       # libtool has not relinked ld-new yet, but we cannot just 
use the
      69       # previous stage (because then the relinking would just 
never happen!).
      70       # So we take extra care to use prev-ld/ld-new *on 
recursive calls*.
      71       test x"$LT_RCU" = x"1" && exec 
$scriptdir/../prev-$dir/$prog ${1+"$@"}
      72
      73       LT_RCU=1; export LT_RCU
      74       $scriptdir/../$dir/$prog ${1+"$@"}
      75       result=$?
      76       exit $result
      77
      78     else
      79       exec $scriptdir/../prev-$dir/$prog ${1+"$@"}
      80     fi
      81     ;;
      82   *)
      83     exec "$original" ${1+"$@"}
      84     ;;
      85 esac
      86

Adding a few echo statements to send current values to a log file before 
line 55 and at line 83 and then resuming the make from the last 
invocation produces the following:

invoked is set to nm
prog is set to %{prog}
dir is set to binutils
original is set to /usr/bin/nm -B -X32_64
Calling exec /usr/bin/nm -B -X32_64 -B -X32_64 -BCpg .libs/alloc.o 
.libs/barrier.o .libs/critical.o .libs/env.o .libs/error.o .libs/iter.o 
.libs/iter_ull.o .libs/loop.o .libs/loop_ull.o .libs/ordered.o 
.libs/parallel.o .libs/sections.o .libs/single.o .libs/task.o 
.libs/team.o .libs/work.o .libs/lock.o .libs/mutex.o .libs/proc.o 
.libs/sem.o .libs/bar.o .libs/ptrlock.o .libs/time.o .libs/fortran.o 
.libs/affinity.o

Let me know if I can provide further debugging information.

Thanks,
    Richard Nolde

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46655
>
> --- Comment #20 from Michael Haubenwallner<michael.haubenwallner at salomon 
> dot at>  2011-02-24 20:42:46 UTC ---
> (In reply to comment #19)
>    
>>> /usr/bin/gcc -c  -g -fkeep-inline-functions -DIN_GCC ...
>>>        
>> This is a problem in /usr/bin/gcc, not in the GCC sources you're compiling.
>>      
> (In reply to comment #1)
>    
>> $ gmake bootstrap STAGE1_CFLAGS=-O
>>      
> Richard, does this workaround work for you?
>
>

Reply via email to