crti.o를 찾을 수 없습니다 : 해당 파일이나 디렉토리가 없습니다

내 gcc 4.1.2 ( ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.1.2/gcc-4.1.2.tar.bz2 ) 를 만들고 싶을 때 우분투 12.04 (x86_64). 현재 활성 gcc는 4.6.2입니다. 나는했다 :

./configure

그때

make

그러나이 오류가 발생합니다

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

웹을 검색하면의 위치에 문제가있는 것 같습니다 crti. 이 파일들은 시스템에서 사용 가능합니다

# 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

또한 libc6 devel 패키지가 설치되었습니다

# 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

어떻게 고칠 수 있습니까?

최신 정보:

이것들을 추가 한 후

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

그 문제는 해결되었습니다. 그러나 지금 나는 얻는다

/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



답변

이것은 런치 패드에보고 된 버그 이며 해결 방법이 있습니다.

32 비트 플랫폼에서 64 비트 프로그램 컴파일 :

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

32 비트 네이티브 :

LIBRARY_PATH=/usr/lib32:$LIBRARY_PATH
export LIBRARY_PATH

.bashrc 파일 (또는 콘솔에서 실행)에서 GCC가 라이브러리의 새로운 위치를 찾기에 충분합니다.

고마워. Iain Buclaw (ibuclaw)에게 올바른 방향을 가리 키십시오.

12.10 32 비트

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 비트

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


답변

내 경우 Ubuntu 16.04에는 전혀 없다 crti.o.

$ find /usr/ -name crti*

그래서 개발자 패키지를 설치합니다.

sudo apt-get install libc6-dev


답변

업스트림 소스에서 x86-64에 GCC 4.8을 빌드하면 32 비트 및 64 비트 라이브러리를 모두 빌드해야합니다 (multi-lib가 비활성화되지 않은 경우). 이 경우 경로 /usr/lib/x86_64-linux-gnu와를 모두 추가해야합니다 /usr/lib32.


답변

또한 우분투 컴퓨터 (4.6.3 컴퓨터에서 3.4.6)에 이전 버전의 gcc를 빌드하고 있습니다.
@ mahmood의 –disable-multilib 솔루션을 시도했지만 gcc 3.4.6을 사용해야하는 패키지도 보였습니다. 32 비트 라이브러리도 필요합니다.

따라서 64 비트 및 32 비트 라이브러리를 LIBRARY_PATH에 추가했습니다.

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

아 그리고 난 우분투 12.04 64 비트에있어


답변