LDFLAGS/BOOT_LDFLAGS Installation question

Geoff Alexander/Raleigh/IBM gdlxn@us.ibm.com
Wed Sep 20 07:34:00 GMT 2000


I'm getting the following error when installing gcc 2.95.2 on AIX 4.3.3:

   stage1/xgcc -Bstage1/
   -B/projects/bps/tools/gcc-2.95.2/powerpc-ibm-aix4.3.3.0/bin/ -c
   -DIN_GCC -DHAIFA    -O2 -g  -DHAVE_CONFIG_H    -I.
   -I../../gcc-2.95.2/gcc -I../../gcc-2.95.2/gcc/config
   -I../../gcc-2.95.2/gcc/../include \
     ../../gcc-2.95.2/gcc/gencheck.c
   stage1/xgcc -Bstage1/
   -B/projects/bps/tools/gcc-2.95.2/powerpc-ibm-aix4.3.3.0/bin/  -DIN_GCC
   -DHAIFA    -O2 -g  -DHAVE_CONFIG_H -Wl,-bbigtoc -o gencheck \
    gencheck.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case
   "alloca.o" in ?*) echo alloca.o ;; esac ` ` case "" in ?*) echo  ;; esac
   `  ` case "" in ?*) echo  ;; esac ` ` case "" in ?*) echo  ;; esac `
   -lld
   ./gencheck > tmp-check.h
   Could not load program ./gencheck:
      Dependent module libc.a(shr.o) could not be loaded.
   Could not load module libc.a(shr.o).
   Error was: No such file or directory

I do the install as follows:

   export CC=/usr/bin/cc
   export LDFLAGS=-blibpath:/usr/lib:/lib
   export MAKE=/projects/bps/tools/bin/gmake
   ../gcc-2.95.2/configure --prefix=/projects/bps/tools/gcc-2.95.2 >
   configure.out 2>&1 &
   /projects/bps/tools/bin/gmake bootstrap > make1.out 2>&1 &

I believe the problem is in _objdir_/gcc/Makefile which builds stage1 and
stage2 as follows:

   bootstrap bootstrap-lean: force
   # Only build the C compiler for stage1, because that is the only one
   that
   # we can guarantee will build with the native compiler, and also it is
   the
   # only thing useful for building stage2.
      $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)"
      $(MAKE) stage1
   # This used to define ALLOCA as empty, but that would lead to bad
   results
   # for a subsequent `make install' since that would not have ALLOCA
   empty.
   # To prevent `make install' from compiling alloca.o and then relinking
   cc1
   # because alloca.o is newer, we permit these recursive makes to compile
   # alloca.o.  Then cc1 is newer, so it won't have to be relinked.
      $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/"
   CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir
   =$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
      $(MAKE) stage2
      -if test $@ = bootstrap-lean; then rm -rf stage1; else true; fi
      $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/"
   CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir
   =$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"

Note that LDFLAGS is set to $(BOOT_LDFLAGS) in the recursive call to
$(MAKE).  BOOT_LDFLAFGS is set earlier in the Makefile:

   # f771 and cc1plus overflow the AIX TOC
   BOOT_LDFLAGS=-Wl,-bbigtoc

Note that the value of BOOT_LDFLAGS doesn't include LDFLAGS.  I would think
that it should, as the setting of BOOT_CFLAGS includes CFLAGS:

   BOOT_CFLAGS = -O2 $(CFLAGS)

What is the proper way to apend additional flags to BOOT_LDFLAGS?

Thanks,
Geoff Alexander, Ph.D.
919/254-5216 T/L 444-5216
Build Processing Teamlead, SDWB/BPS
IBM Corporation
RTP, NC



More information about the Gcc-help mailing list