This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Error building cross-gcc libgcc_s.so


I'm getting an error while building cross-GCC for i586 with newlib.  I'm
using the current CVS mainline.

My configuration (cross x86 compiler):
./Source/gcc/configure --with-gcc-version-trigger=./Source/gcc/gcc/version.c
  --host=i686-pc-linux-gnu --prefix=./Install --target=i586-hardhat-linux
  --program-prefix=i586- --enable-cross --enable-languages=c
  --with-headers=/opt/hardhat/devkit/i586-hardhat-linux/include --with-newlib
  --norecursion     

The error occurs while trying to build a shared library version of libgcc_s.so:

./Build/GCC-i586-hardhat-linux-20001228/gcc/xgcc
  -B./Build/GCC-i586-hardhat-linux-20001228/gcc/
  -B./Install/i586-hardhat-linux/bin/
  -B./Install/i586-hardhat-linux/lib/ -isystem 
  ./Install/i586-hardhat-linux/include -O2  -DCROSS_COMPILE -DIN_GCC
  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem
  ./include  -fPIC -g1  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc 
  -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.0 -Wl,--version-script=libgcc.map
  -o libgcc_s.so   libgcc/./_muldi3.o libgcc/./_divdi3.o libgcc/./_moddi3.o 
  <lotsa object files>
  -lc                              
./Install/i586-hardhat-linux/bin/ld: cannot open crti.o: No such file or directory 

The specs file contains the following:

	*startfile:
	%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s}
        %{!p:%{profile:gcrt1.o%s} %{!profile:crt1.o%s}}}}    
	crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s} 

	*endfile:
	%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s    

Since crti.o (or crtn.o) isn't built in the current directory, the 
linker cannot find it. 

Why should crti.o and crtn.o be included in a shared library?
Or in libgcc?

Why is libc also linked in with libgcc?  Since newlib hasn't been
built, there isn't one to link with.

Is there something that I'm doing wrong?

--

Michael Eager
Senior Tools Developer	  Phone: (408) 328-8426
MontaVista Software, Inc.   Fax: (408) 328-9204
1237 E. Arques Avenue	    Web: www.hardhatlinux.com
Sunnyvale, CA 94085	  Email: eager@mvista.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]