# gnattools2 make -C ../gcc/ada/tools -f ../Makefile \ "CC=../../xgcc -B../../" "CFLAGS=-g -O2" "ADAFLAGS=-gnatpg -gnata" "IN CLUDES=-I. -I.. -I../.. -I/home/dave/gcc-4.1/gcc/gcc/ada -I/home/dave/gcc-4.1/gc c/gcc/ada/../config -I/home/dave/gcc-4.1/gcc/gcc/ada/../../include -I/home/dave/ gcc-4.1/gcc/gcc/ada/.." "ADA_INCLUDES=-I../rts -I. -I/home/dave/gcc-4.1/gcc/gcc/ ada" "exeext=" "fsrcdir=/home/dave/gcc-4.1/gcc/gcc/ada" "srcdir=/home/dave/gcc-4 .1/gcc/gcc/ada" "GNATMAKE=../../gnatmake" "GNATLINK=../../gnatlink" "GNATBIND=.. /../gnatbind" "TOOLSCASE=native" \ ../../gnatchop ../../gnat ../../gnatkr ../../gnatls ../../gnatprep ../ ../gnatxref ../../gnatfind ../../gnatname ../../gnatclean ../../gprmake make[4]: Entering directory `/home/dave/gcc-4.1/objdir/gcc/ada/tools' ../../gnatmake -c -I../rts -I. -I/home/dave/gcc-4.1/gcc/gcc/ada gnatchop --GCC=" ../../xgcc -B../../ -g -O2 -gnatpg -gnata" ../../gnatmake: error while loading shared libraries: libgcc_s.so.4: cannot open shared object file: No such file or directory make[4]: *** [../../gnatchop] Error 127 This is a result of a change yesterday which bumped the libgcc_s version. Obviously, the GCC build machinary doesn't set LD_LIBRARY_PATH so that the newly built tools use the new version of libgcc_s. This doesn't happen on the trunk.
Subject: Re: New: gnatmake: error while loading shared libraries: libgcc_s.so.4: cannot open > This doesn't happen on the trunk. The following from ada/Makefile.in is supposed to take care of that: GCC_LINK="$(CC) -static-libgcc $(ADA_INCLUDES)" (and uses of $(GCC_LINK) elsewhere in the tools). Basically we certainly do *not* want to link with libgcc_s, in particular to avoid this kind of nightmare. This was fixed as part of: 2005-02-09 Arnaud Charlet <charlet@adacore.com> PR ada/16592 * Makefile.in: Link all gnat tools with -static-libgcc, since -shared-libgcc is now used by default on some systems (e.g. linux with recent binutils). I am surprised that there's a regression between 4.1 and trunk here. Arno
Subject: Re: New: gnatmake: error while loading shared libraries: libgcc_s.so.4: cannot open > ../../gnatmake: error while loading shared libraries: libgcc_s.so.4: cannot > open > shared object file: No such file or directory A work around is to export an appropriate LD_LIBRARY_PATH in the build script, or add it to the environment variables passed to make. Dave
Subject: Re: gnatmake: error while loading shared libraries: libgcc_s.so.4: cannot open > ------- Comment #1 from charlet at adacore dot com 2006-01-19 15:53 ------- > Subject: Re: New: gnatmake: error while loading shared libraries: > libgcc_s.so.4: cannot open > > > This doesn't happen on the trunk. > > The following from ada/Makefile.in is supposed to take care of that: > > GCC_LINK="$(CC) -static-libgcc $(ADA_INCLUDES)" > > (and uses of $(GCC_LINK) elsewhere in the tools). For some reason, the above doesn't seem to have been used in linking gnatmake: ../../xgcc -B../../ -DIN_GCC `echo -g -O2 -W -Wall -Wwrite-strings -Wstrict-pr ototypes -Wmissing-prototypes |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -o ../../gnatmake b_gnatm.o a-except.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 interfac.o i-c.o i-cstrin.o krunch.o lib.o make.o makeusg.o makeutl.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-attr-pm.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 s-exctab.o s-secsta.o s-stalib.o s-stoele.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 system.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 link.o ../../../libiberty/libiberty.a Possibly, this is the reason: # Likewise for the tools ../../gnatmake$(exeext): $(P) b_gnatm.o link.o $(GNATMAKE_OBJS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \ $(TOOLS_LIBS) Dave
Subject: Re: gnatmake: error while loading shared libraries: libgcc_s.so.4: cannot open > For some reason, the above doesn't seem to have been used in linking gnatmake: Indeed, gnatmake has to be handled specially. So I guess the gnatmake rule needs to use $(GCC_LINK) one way or another (although there should be no difference between trubk and 4.1 in that respect). Same for gnatlink. Arno
Subject: Re: gnatmake: error while loading shared libraries: libgcc_s.so.4: cannot open > So I guess the gnatmake rule needs to use $(GCC_LINK) I'll try the above change > one way or another (although there should be no difference between > trubk and 4.1 in that respect). In the trunk, I see the following in the build log: export GMPINC; LD_LIBRARY_PATH=`echo "$r/hppa-linux/libstdc++-v3/.libs:$r/hppa-linux/libmudflap/.libs:$r/hppa-linux/libssp/.libs:$r/./gcc:$r/./prev-gcc:$LD_LIBRARY_PATH" | sed 's,::*,:,g;s,^:*,,;s,:*$,,'`; export LD_LIBRARY_PATH; LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed 's,::*,:,g;s,^:*,,;s,:*$,,'`; export LD_LIBRARY_PATH; \ echo Configuring stage 1 in ./gcc ; \ Dave
Subject: Re: gnatmake: error while loading shared libraries: libgcc_s.so.4: cannot open > Indeed, gnatmake has to be handled specially. > > So I guess the gnatmake rule needs to use $(GCC_LINK) > one way or another (although there should be no difference between > trubk and 4.1 in that respect). It's not possible to use $(GCC_LINK) directly because of the quotes in the define of GCC_LINK. It might be best to remove them and modify each use as necessary. However, the following change is less invasive and fixes the problem. Thoughts. Dave
Created attachment 10686 [details] Makefile.in.d
Subject: Bug 25859 Author: ebotcazou Date: Wed Jan 25 23:02:55 2006 New Revision: 110229 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110229 Log: PR bootstrap/25859 * Makefile.in (GCC_LINK): Remove quotes. (tools targets): Link with either $(GNATLINK) --GCC="$(GCC_LINK)" or $(GCC_LINK). (powerpc-darwin): Pass -shared-libgcc when building shared library. Modified: trunk/gcc/ada/ChangeLog trunk/gcc/ada/Makefile.in
Subject: Bug 25859 Author: ebotcazou Date: Wed Jan 25 23:03:55 2006 New Revision: 110230 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110230 Log: PR bootstrap/25859 * Makefile.in (GCC_LINK): Remove quotes. (tools targets): Link with either $(GNATLINK) --GCC="$(GCC_LINK)" or $(GCC_LINK). (powerpc-darwin): Pass -shared-libgcc when building shared library. Modified: branches/gcc-4_1-branch/gcc/ada/ChangeLog branches/gcc-4_1-branch/gcc/ada/Makefile.in
Should be fixed now.