Hi all


This is the first mail After i subscribed the mailing list.


I want to know the method cross-compile dropbear on uclinux with arm-elf-gcc


sorry for poor englisth...



<Enviroment>

1. OS : Fedora 11

2. Zlib : zlib-1.2.3

3. dropbear : dropbear -0.52

4. Target : kernel 2.4.x uclinux

5. uClibc : uClibc-0.9.27


<Install process>


1. I cross-compiled uClibc with arm-elf-gcc, As a result, i got "arm-uclibc-gcc"

2. I cross-compiled zlib-1.2.3 


A. cross-compiler : arm-uclibc-gcc 


==========================================================================

[r...@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.

[r...@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

========================================================================================



B. cross-compiler : arm-elf-gcc 


===================================================================================

[r...@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.

[r...@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] error 1

=======================================================================================


As you see, each of case error is same


 

C. the other way


=====================================================================================================

[r...@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.

[r...@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:

  [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] error1

=====================================================================================================


so i couldn't cross-compile zlib yet.

Is there any zlib package for uclinux or for arm-elf-gcc.

I can't fix the error 


3. I compiled dropbear-0.52 with arm-elf-gcc without zlib, absolutely i use "--disable-zlib"

====================================================================================================


[r...@localhost dropbear-arm-elf]# ../dropbear-0.52/configure --prefix=/home/test/dropbear-arm-elf/elf --disable-zlib CC=arm-elf-gcc --build=arm

checking for gcc... arm-elf-gcc

checking for C compiler default output file name... 

configure: error: C compiler cannot create executables

See `config.log' for more details.


=====================================================================================================


I attached 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 http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)

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.


=================================================================================================


what shall i do fix this problem...


Is there any package of dropbear for uclinux?

or did I something wrong?


I'm searching  package of zlib and uclibc for uclinx

I can't find the answer to fix the problem..


please help me...





Reply via email to