Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
18
rated 0 times [  18] [ 0]  / answers: 1 / hits: 143281  / 2 Years ago, wed, july 27, 2022, 4:09:34

When I want to make gcc 4.1.2 (ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.1.2/gcc-4.1.2.tar.bz2) on my ubuntu 12.04 (x86_64). The current active gcc is 4.6.2.
I did:



./configure


then



make


However I get this error



/usr/bin/ld: cannot find crti.o: No such file or directory
collect2: ld returned 1 exit status


Searching the web it seems that there is a problem with the location of crti. These files are available on the system



# find /usr/ -name crti*
/usr/lib32/crti.o
/usr/lib/x86_64-linux-gnu/crti.o
/usr/lib/debug/usr/lib/x86_64-linux-gnu/crti.o


Also the libc6 devel package is installed



# dpkg -l | grep libc6
ii libc6 2.15-0ubuntu10.3 Embedded GNU C Library: Shared libraries
ii libc6-dbg 2.15-0ubuntu10.3 Embedded GNU C Library: detached debugging symbols
ii libc6-dev 2.15-0ubuntu10.3 Embedded GNU C Library: Development Libraries and Header Files
ii libc6-dev-i386 2.15-0ubuntu10.3 Embedded GNU C Library: 32-bit development libraries for AMD64
ii libc6-i386 2.15-0ubuntu10.3 Embedded GNU C Library: 32-bit shared libraries for AMD64
ii libc6-pic 2.15-0ubuntu10.3 Embedded GNU C Library: PIC archive library


How can I fix that?



UPDATE:



After adding these



LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH 
export LIBRARY_PATH


That problem is solved. However now I get



/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.a when searching for -lc
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/x86_64-linux-gnu/crti.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/x86_64-linux- gnu/crtn.o' is incompatible with i386 output
collect2: ld returned 1 exit status

More From » 12.04

 Answers
0

This is a BUG reported in launchpad, byt there is a workaround :



compiling 64 bits program in 32 bits platform :



LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH 
export LIBRARY_PATH


for 32 bits native :



LIBRARY_PATH=/usr/lib32:$LIBRARY_PATH
export LIBRARY_PATH


That in your .bashrc file (or ran from a console) is enough for GCC to find the new location of library.



thx. to Iain Buclaw (ibuclaw) to point out in the right direction.



12.10 32 bits



hhlp@hhlp:~$ sudo find /usr/ -name crti*
/usr/lib/i386-linux-gnu/crti.o
hhlp@hhlp:~$

LIBRARY_PATH=/usr/lib/i386-linux-gnu:$LIBRARY_PATH
export LIBRARY_PATH


12.10 64 bits



hhlp@hhlp:~$ sudo find /usr/ -name crti*
/usr/lib/x86_64-linux-gnu/crti.o
hhlp@hhlp:~$

LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH
export LIBRARY_PATH

[#32816] Thursday, July 28, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rinstracte

Total Points: 221
Total Questions: 114
Total Answers: 120

Location: France
Member since Fri, Jan 28, 2022
2 Years ago
rinstracte questions
Wed, Jun 15, 22, 02:09, 2 Years ago
Tue, Jan 24, 23, 01:39, 1 Year ago
Wed, Jun 9, 21, 04:34, 3 Years ago
Sun, Apr 17, 22, 11:38, 2 Years ago
;