public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Albert Chin <gcc@mlists.thewrittenword.com>
To: gcc@gcc.gnu.org
Subject: --as-needed problem with gnatmake while building 3.4.2 on RH 7.1/RHEL 2.1
Date: Sun, 05 Sep 2004 10:03:00 -0000	[thread overview]
Message-ID: <20040905100334.GA636@mail1.thewrittenword.com> (raw)

I tried building the 3.4.2 snapshot gcc-3.4.2-20040902.tar.bz2 on
Redhat Linux 7.1 and RHEL 2.1 (glibc-2.2.4 based). I first built
binutils-2.15 per
http://gcc.gnu.org/install/specific.html#ix86-*-linux* and installed
into the same prefix as I would 3.4.2:
  $ cd /opt/build
  $ tar jxf binutils-2.15.tar.bz2
  $ cd binutils-2.15
  $ CC=cc CFLAGS="-O2" ./configure --datadir="/opt/TWWfsw/gcc342/share" \
  --disable-shared --program-prefix=g --with-lib-path=/lib:/usr/lib:\
  /usr/local/lib:/usr/i386-redhat-linux/lib --prefix=/opt/TWWfsw/gcc342
  $ make
  # make install

I then built 3.4.2:
  $ cd /opt/build
  $ gtar jxf gcc-3.4.2-20040902.tar.bz2
  $ cd gcc-3.4.2-20040902
  $ gtar zxf gnat-3.15p-i686-pc-redhat71-gnu-bin.tar.gz
  $ cd gnat-3.15p-i686-pc-linux-gnu-bin
  $ rm -rf /opt/build/gnat
  $ make ins-all prefix=/opt/build/gnat
  $ export PATH=/opt/build/gnat/bin:$PATH
  $ mkdir /opt/build/gcc-3.4.2-20040902-objdir
  $ cd /opt/build/gcc-3.4.2-20040902-objdir
  $ GNATBIND=/opt/build/gnat/bin/gnatbind CC=gcc \
  /opt/build/gcc-3.4.2-20040902/configure --with-included-gettext \
  --enable-libgcj --enable-__cxa_atexit \
  --with-gnu-as --with-as="/opt/TWWfsw/gcc342/i686-pc-linux-gnu/bin/as" \
  --with-gnu-ld --with-ld="/opt/TWWfsw/gcc342/i686-pc-linux-gnu/bin/ld"
  --datadir="/opt/TWWfsw/gcc342/share" \
  --with-local-prefix="/opt/TWWfsw/gcc342" --prefix="/opt/TWWfsw/gcc342"
  $ make bootstrap
  $ cd /opt/build/gcc-3.4.2-20040902-objdir/gcc
  $ make gnatlib_and_tools
  ...
  ../../xgcc -B../../ -DIN_GCC   `echo -g -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes    |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'`  -o ../../gnatmake b_gnatm.o ctrl_c.o ali.o ali-util.o s-casuti.o alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o gnatmake.o gnatvsn.o hostparm.o krunch.o lib.o make.o makeusg.o mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o mlib-utl.o namet.o nlists.o opt.o osint.o osint-m.o output.o prj.o prj-attr.o prj-com.o prj-dect.o prj-env.o prj-err.o prj-ext.o prj-nmsc.o prj-pars.o prj-part.o prj-proc.o prj-strt.o prj-tree.o prj-util.o rident.o scans.o scng.o sdefault.o sfn_scan.o s-purexc.o s-htable.o sinfo.o sinput.o sinput-c.o sinput-p.o snames.o stand.o stringt.o styleg.o stylesw.o validsw.o switch.o switch-m.o table.o targparm.o tempdir.o tree_io.o types.o uintp.o  uname.o urealp.o usage.o widechar.o  \
      ../rts/libgnat.a  ../../prefix.o ../../version.o ../../../libiberty/libiberty.a  
  ...
  rm -f tools/mlib-tgt.adb; ln -s
  /opt/build/gcc-3.4.2-20040902/gcc/ada/5lml-tgt.adb tools/mlib-tgt.adb;
  touch ../stamp-tools
  ../../gnatmake -c -I../rts -I. -I/opt/build/gcc-3.4.2-20040902/gcc/ada gnatchop --GCC="../../xgcc -B../../ -g      -gnatpg -gnata"
  ../../gnatmake: error while loading shared libraries: libgcc_s.so.1:
  cannot open shared object file: No such file or directory
  make[2]: *** [../../gnatchop] Error 127
  $ objdump -p gnatmake | egrep 'NEEDED|RPATH'
    NEEDED      libgcc_s.so.1
    NEEDED      libc.so.6

The problem is that 'ld' from binutils-2.15 supports as-needed and
when gnatmake is built, the link line, using xgcc -Wl,-v, looks like:
  /opt/TWWfsw/gcc342/i686-redhat-linux7.1/bin/ld --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o ../../gnatmake /usr/lib/crt1.o /usr/lib/crti.o ../../crtbegin.o -L../.. -v [objects] ../rts/libgnat.a ../../prefix.o ../../version.o ../../../libiberty/libiberty.a -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed ../../crtend.o /usr/lib/crtn.o

While a dependency to libgcc_s.so.1 is added, no RPATH entry exists to
find it. RH 9 and RHEL 3.0 don't run into a problem because they have
/lib/libgcc_s.so.1.

Should I back down to binutils-2.14 or set LD_LIBRARY_PATH?

-- 
albert chin (china@thewrittenword.com)

             reply	other threads:[~2004-09-05 10:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-05 10:03 Albert Chin [this message]
2004-09-06  8:47 ` Greg Schafer
2004-09-06 14:18   ` H. J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040905100334.GA636@mail1.thewrittenword.com \
    --to=gcc@mlists.thewrittenword.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).