dropbear를 uclinux용으로 크로스 컴파일 하는 방법

bakdorazi의 이미지

<환경>

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용으로 크로스 컴파일 해야 되는데

방법을 알 지 못하겠네요...

제가 혹시 잘못한 것이 있는 지 아시는 분의 도움을 요청합니다...

오늘 선거날인데 투표 잘 하시구요...

오늘도 좋은 하루 되세요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.