zlib를 arm-elf-gcc로 크로스 컴파일 하였는데
글쓴이: bakdorazi / 작성시간: 화, 2010/06/01 - 2:36오후
1. 환경 : 페도라 11
2. zlib : zlib-1.2.3
3. cross-compiler : arm-elf-gcc, arm-uclibc-gcc
A. cross-compiler : arm-uclibc-gcc 로 했을 때 에러
[root@localhost zlib-1.2.3]# CC=arm-uclibc-gcc ./configure --prefix=/home/test/zlib Building static library libz.a version 1.2.3 with arm-uclibc-gcc. Checking for unistd.h... Yes. Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf() Checking for vsnprintf() in stdio.h... No. WARNING: vsnprintf() not found, falling back to vsprintf(). zlib can build but will be open to possible buffer-overflow security vulnerabilities. Checking for return value of vsprintf()... Yes. Checking for errno.h... Yes. Checking for mmap support... Yes. [root@localhost zlib-1.2.3]# make arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o example.o example.c arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o adler32.o adler32.c arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o compress.o compress.c arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o crc32.o crc32.c arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o gzio.o gzio.c arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o uncompr.o uncompr.c arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o deflate.o deflate.c arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o trees.o trees.c arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o zutil.o zutil.c arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o inflate.o inflate.c arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o infback.o infback.c arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o inftrees.o inftrees.c arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o inffast.o inffast.c ar rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o arm-uclibc-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -o example example.o -L. libz.a /usr/local/lib/gcc-lib/arm-elf/2.95.3/libgcc.a(__main.o)(.text+0xc4): In function `__do_global_ctors': : undefined reference to `__CTOR_LIST__' /usr/local/lib/gcc-lib/arm-elf/2.95.3/libgcc.a(__main.o)(.data+0x0): undefined reference to `__DTOR_LIST__' collect2: ld returned 1 exit status make: *** [example] 오류 1
B. 컴파일러 : arm-elf-gcc 로 컴파일 했을 때 에러
[root@localhost zlib-1.2.3]# CC=arm-elf-gcc ./configure --prefix=/home/test/zlib Building static library libz.a version 1.2.3 with arm-elf-gcc. Checking for unistd.h... Yes. Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf() Checking for vsnprintf() in stdio.h... No. WARNING: vsnprintf() not found, falling back to vsprintf(). zlib can build but will be open to possible buffer-overflow security vulnerabilities. Checking for return value of vsprintf()... Yes. Checking for errno.h... Yes. Checking for mmap support... Yes. [root@localhost zlib-1.2.3]# make arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o example.o example.c arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o adler32.o adler32.c arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o compress.o compress.c arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o crc32.o crc32.c arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o gzio.o gzio.c arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o uncompr.o uncompr.c arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o deflate.o deflate.c arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o trees.o trees.c arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o zutil.o zutil.c arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o inflate.o inflate.c arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o infback.o infback.c arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o inftrees.o inftrees.c arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o inffast.o inffast.c ar rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -o example example.o -L. libz.a /usr/local/lib/gcc-lib/arm-elf/2.95.3/libgcc.a(__main.o)(.text+0xc4): In function `__do_global_ctors': : undefined reference to `__CTOR_LIST__' /usr/local/lib/gcc-lib/arm-elf/2.95.3/libgcc.a(__main.o)(.data+0x0): undefined reference to `__DTOR_LIST__' collect2: ld returned 1 exit status make: *** [example] 오류 1
위의 두 에러를 보시면 아시겠지만 에러 내용이 같습니다.
arm-uclibc-gcc 는 uClibc를 깔고 나니까 이와 같은 컴파일러가 생겼습니다. uClibc를 깔 때 arm-elf-gcc 로 cross-compile 하였습니다.
C. 다른 방법으로 configure 한 경우
[root@localhost zlib-1.2.3]# CC=arm-elf-gcc CXX=arm-elf-g++ AR=arm-elf-ar RANLIB=arm-elf-ranlib LD=arm-elf-ld ./configure --prefix=/home/test/zlib
Building static library libz.a version 1.2.3 with arm-elf-gcc.
Checking for unistd.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()
Checking for vsnprintf() in stdio.h... No.
WARNING: vsnprintf() not found, falling back to vsprintf(). zlib
can build but will be open to possible buffer-overflow security
vulnerabilities.
Checking for return value of vsprintf()... Yes.
Checking for errno.h... Yes.
Checking for mmap support... Yes.
[root@localhost zlib-1.2.3]# make
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o example.o example.c
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o adler32.o adler32.c
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o compress.o compress.c
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o crc32.o crc32.c
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o gzio.o gzio.c
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o uncompr.o uncompr.c
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o deflate.o deflate.c
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o trees.o trees.c
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o zutil.o zutil.c
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o inflate.o inflate.c
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o infback.o infback.c
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o inftrees.o inftrees.c
arm-elf-gcc -O3 -DNO_vsnprintf -DUSE_MMAP -c -o inffast.o inffast.c
arm-elf-ar libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
arm-elf-ar: illegal option -- z
Usage: arm-elf-ar [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...
arm-elf-ar -M [<mri-script]
commands:
d - delete file(s) from the archive
m[ab] - move file(s) in the archive
p - print file(s) found in the archive
q[f] - quick append file(s) to the archive
r[ab][f][u] - replace existing or insert new file(s) into the archive
t - display contents of archive
x[o] - extract file(s) from the archive
command specific modifiers:
[a] - put file(s) after [member-name]
[b] - put file(s) before [member-name] (same as [i])
[N] - use instance [count] of name
[f] - truncate inserted file names
[P] - use full path names when matching
[o] - preserve original dates
[u] - only replace files that are newer than current archive contents
generic modifiers:
[geshifilter-c] - do not warn if the library had to be created [s] - create an archive index (cf. ranlib) [S] - do not build a symbol table [v] - be verbose [V] - display the version number emulation options: No emulation specific options arm-elf-ar: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big srec symbolsrec tekhex binary ihex make: *** [libz.a] 오류 1 Forums:


댓글 달기