dropbear를 uclinux용으로 크로스 컴파일 하는 방법
글쓴이: bakdorazi / 작성시간: 수, 2010/06/02 - 1:12오후
<환경>
1. 페도라 : 11
2. zlib : 1.2.3
3. dropbear : 0.52
4. compiler : arm-elf-gcc
5. uclibc : 0.9.27
<설치과정>
1. uclib 를 arm-elg-gcc로 크로스 컴파일 하여 arm-uclibc-gcc 를 만든다.
2. arm-uclibc-gcc를 이용하여 zlib-1.2.3을 크로스 컴파일 한다.
CC=arm-uclibc-gcc ./configure --prefix=/home/test/zlib
이렇게 하면 대략 아래와 같은 에러가 납니다.
[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] error 1
3. dropbear 를 arm-elf-gcc로 크로스 컴파일 한다. 단 "--disable-zlib"라는 옵션을 주어 한다.
CC=arm-elf-gcc ./configure --prefix=/home/test/dropbear-arm-elf/elf --disable-zlib
이렇게 하면 아래와 같은 에러가 납니다. 아래의 내용은 config.log에 있는 내용의 일부입니다.
## ----------- ## ## Core tests. ## ## ----------- ## configure:1766: checking for gcc configure:1793: result: arm-elf-gcc configure:2031: checking for C compiler version configure:2038: arm-elf-gcc --version >&5 2.95.3 configure:2041: $? = 0 configure:2048: arm-elf-gcc -v >&5 Reading specs from /usr/local/lib/gcc-lib/arm-elf/2.95.3/specs gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from <a href="http://fiddes.net/coldfire/" rel="nofollow">http://fiddes.net/coldfire/</a>)(uClinux XIP and shared lib patches from <a href="http://www.snapgear.com/" rel="nofollow">http://www.snapgear.com/</a>) configure:2051: $? = 0 configure:2058: arm-elf-gcc -V >&5 arm-elf-gcc: argument to `-V' is missing configure:2061: $? = 1 configure:2084: checking for C compiler default output file name configure:2111: arm-elf-gcc conftest.c >&5 /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 configure:2114: $? = 1 configure:2152: result: configure: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:2159: error: C compiler cannot create executables See `config.log' for more details.
혹시나 uclinux용 uclibc나 zlib 패키지가 따로 있는 것입니까?
아님 컴파일러 버젼이 맞지 않는 건지...
dropbear를 uclinux용으로 크로스 컴파일 해야 되는데
방법을 알 지 못하겠네요...
제가 혹시 잘못한 것이 있는 지 아시는 분의 도움을 요청합니다...
오늘 선거날인데 투표 잘 하시구요...
오늘도 좋은 하루 되세요.
Forums:
댓글 달기