busybox-1.14.3 compilation with uClibc

Sushil Kumar sushil_tux at yahoo.com
Fri Oct 9 14:55:50 UTC 2009


Hi Walter Harms/vda,

Thanks for your reply.
Took the latest uClibc-0.9.30.1 tar and successfully compiled it is using the native glibc.

I made some changes in the busybox/Makefile.flags to include uClib library path and compiled the busybox using the latest uClibc-0.9.30.1 C library and I got lots of erreor as can be seen below.  
Thinking, error in my approach, I wrote a simple "hello world" program and tried to compile this using uClibc library.  I got the similar error related to the uClibc/include headers while compiling the busybox.
I have used the following command to compile my test program.
gcc -nostdlib -I../uClibc-0.9.30.1/include -I/usr/lib/gcc/i386-redhat-linux/4.1.1/include/  test.c

as suggested I followed the approach given at  tldp.org/Glibc-HOWTO.html#toc10, to compile a program with C library, other than glibc.

Please let me know what I am doing wrong.  Further, in the latest busybox (1.14.3), the linking of files are done using scripts/trylink.  Can we not link the program using any direct command. 
Thanks 
Sushil

Included below are some lines of compilation error of my test program
==========================================

busybox-1.14.3]#gcc -nostdlib -I../uClibc-0.9.30.1/include -I/usr/lib/gcc/i386-redhat-linux/4.1.1/include/  test.c
In file included from ../uClibc-0.9.30.1/include/pthread.h:21,
                 from ../uClibc-0.9.30.1/include/bits/uClibc_mutex.h:15,
                 from ../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:119,
                 from ../uClibc-0.9.30.1/include/stdio.h:72,
                 from test.c:1:
../uClibc-0.9.30.1/include/time.h: In function ‘libc_hidden_proto’:
../uClibc-0.9.30.1/include/time.h:346: error: storage class specified for parameter ‘clock_gettime’
../uClibc-0.9.30.1/include/time.h:346: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/time.h:350: error: storage class specified for parameter ‘clock_settime’
../uClibc-0.9.30.1/include/time.h:350: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/time.h:372: error: storage class specified for parameter ‘timer_create’
../uClibc-0.9.30.1/include/time.h:372: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/time.h:375: error: storage class specified for parameter ‘timer_delete’
../uClibc-0.9.30.1/include/time.h:375: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/time.h:380: error: storage class specified for parameter ‘timer_settime’
../uClibc-0.9.30.1/include/time.h:380: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/time.h:384: error: storage class specified for parameter ‘timer_gettime’
../uClibc-0.9.30.1/include/time.h:384: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/time.h:387: error: storage class specified for parameter ‘timer_getoverrun’
../uClibc-0.9.30.1/include/time.h:387: warning: ‘__nothrow__’ attribute ignored
In file included from ../uClibc-0.9.30.1/include/signal.h:33,
                 from ../uClibc-0.9.30.1/include/pthread.h:24,
                 from ../uClibc-0.9.30.1/include/bits/uClibc_mutex.h:15,
                 from ../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:119,
                 from ../uClibc-0.9.30.1/include/stdio.h:72,
                 from test.c:1:
../uClibc-0.9.30.1/include/bits/sigset.h:23: error: storage class specified for parameter ‘__sig_atomic_t’
../uClibc-0.9.30.1/include/bits/sigset.h:31: error: storage class specified for parameter ‘__sigset_t’
In file included from ../uClibc-0.9.30.1/include/pthread.h:24,
                 from ../uClibc-0.9.30.1/include/bits/uClibc_mutex.h:15,
                 from ../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:119,
                 from ../uClibc-0.9.30.1/include/stdio.h:72,
                 from test.c:1:
../uClibc-0.9.30.1/include/signal.h:50: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘sigset_t’
In file included from ../uClibc-0.9.30.1/include/bits/uClibc_mutex.h:15,
                 from ../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:119,
                 from ../uClibc-0.9.30.1/include/stdio.h:72,
                 from test.c:1:
../uClibc-0.9.30.1/include/pthread.h:65: warning: empty declaration
../uClibc-0.9.30.1/include/pthread.h:73: warning: empty declaration
../uClibc-0.9.30.1/include/pthread.h:81: warning: empty declaration
../uClibc-0.9.30.1/include/pthread.h:100: warning: empty declaration
../uClibc-0.9.30.1/include/pthread.h:108: warning: empty declaration
../uClibc-0.9.30.1/include/pthread.h:137: warning: empty declaration
../uClibc-0.9.30.1/include/pthread.h:147: warning: empty declaration
../uClibc-0.9.30.1/include/pthread.h:154: warning: empty declaration
../uClibc-0.9.30.1/include/pthread.h:166: error: storage class specified for parameter ‘pthread_create’
../uClibc-0.9.30.1/include/pthread.h:166: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/pthread.h:169: error: storage class specified for parameter ‘pthread_self’
../uClibc-0.9.30.1/include/pthread.h:169: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/pthread.h:172: error: storage class specified for parameter ‘pthread_equal’
../uClibc-0.9.30.1/include/pthread.h:172: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/pthread.h:175: error: storage class specified for parameter ‘pthread_exit’
../uClibc-0.9.30.1/include/pthread.h:180: error: storage class specified for parameter ‘pthread_join’
../uClibc-0.9.30.1/include/pthread.h:186: error: storage class specified for parameter ‘pthread_detach’
../uClibc-0.9.30.1/include/pthread.h:186: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/pthread.h:194: error: storage class specified for parameter ‘pthread_attr_init’
../uClibc-0.9.30.1/include/pthread.h:194: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/pthread.h:197: error: storage class specified for parameter ‘pthread_attr_destroy’
../uClibc-0.9.30.1/include/pthread.h:197: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/pthread.h:201: error: storage class specified for parameter ‘pthread_attr_setdetachstate’
../uClibc-0.9.30.1/include/pthread.h:201: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/pthread.h:205: error: storage class specified for parameter ‘pthread_attr_getdetachstate’
../uClibc-0.9.30.1/include/pthread.h:205: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/pthread.h:210: error: storage class specified for parameter ‘pthread_attr_setschedparam’

In file included from ../uClibc-0.9.30.1/include/pthread.h:668,
                 from ../uClibc-0.9.30.1/include/bits/uClibc_mutex.h:15,
                 from ../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:119,
                 from ../uClibc-0.9.30.1/include/stdio.h:72,
                 from test.c:1:
../uClibc-0.9.30.1/include/bits/sigthread.h:32: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
../uClibc-0.9.30.1/include/bits/sigthread.h:36: error: storage class specified for parameter ‘pthread_kill’
../uClibc-0.9.30.1/include/bits/sigthread.h:36: warning: ‘__nothrow__’ attribute ignored
In file included from ../uClibc-0.9.30.1/include/bits/uClibc_mutex.h:15,
                 from ../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:119,
                 from ../uClibc-0.9.30.1/include/stdio.h:72,
                 from test.c:1:
../uClibc-0.9.30.1/include/pthread.h:686: error: storage class specified for parameter ‘pthread_atfork’
../uClibc-0.9.30.1/include/pthread.h:686: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/pthread.h:691: error: storage class specified for parameter ‘pthread_kill_other_threads_np’
../uClibc-0.9.30.1/include/pthread.h:691: warning: ‘__nothrow__’ attribute ignored
In file included from ../uClibc-0.9.30.1/include/stdio.h:72,
                 from test.c:1:
../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:178: error: storage class specified for parameter ‘__STDIO_fpos_t’
../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:189: error: storage class specified for parameter ‘__STDIO_fpos64_t’
../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:194: error: storage class specified for parameter ‘__offmax_t’
../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:284: warning: empty declaration
../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:384: error: storage class specified for parameter ‘__fgetc_unlocked’
../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:385: error: storage class specified for parameter ‘__fputc_unlocked’
../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:404: error: storage class specified for parameter ‘__stdin’
../uClibc-0.9.30.1/include/bits/uClibc_stdio.h:463: error: storage class specified for parameter ‘__stdout’
In file included from ../uClibc-0.9.30.1/include/stdio.h:76,

./uClibc-0.9.30.1/include/stdio.h:402: error: storage class specified for parameter ‘sscanf’
../uClibc-0.9.30.1/include/stdio.h:402: warning: ‘__nothrow__’ attribute ignored
../uClibc-0.9.30.1/include/stdio.h:435: error: storage class specified for parameter ‘fgetc’
../uClibc-0.9.30.1/include/stdio.h:436: error: storage class specified for parameter ‘getc’
../uClibc-0.9.30.1/include/stdio.h:442: error: storage class specified for parameter ‘getchar’
../uClibc-0.9.30.1/include/stdio.h:454: error: storage class specified for parameter ‘getc_unlocked’
../uClibc-0.9.30.1/include/stdio.h:455: error: storage class specified for parameter ‘getchar_unlocked’
../uClibc-0.9.30.1/include/stdio.h:468: error: storage class specified for parameter ‘fgetc_unlocked’
../uClibc-0.9.30.1/include/stdio.h:480: error: storage class specified for parameter ‘fputc’
../uClibc-0.9.30.1/include/stdio.h:481: error: storage class specified for parameter ‘putc’
../uClibc-0.9.30.1/include/stdio.h:487: error: storage class specified for parameter ‘putchar’
../uClibc-0.9.30.1/include/stdio.h:501: error: storage class specified for parameter ‘fputc_unlocked’
../uClibc-0.9.30.1/include/stdio.h:509: error: storage class specified for parameter ‘putc_unlocked’
../uClibc-0.9.30.1/include/stdio.h:510: error: storage class specified for parameter ‘putchar_unlocked’
../uClibc-0.9.30.1/include/stdio.h:520: error: storage class specified for parameter ‘getw’
../uClibc-0.9.30.1/include/stdio.h:523: error: storage class specified for parameter ‘putw’
../uClibc-0.9.30.1/include/stdio.h:533: error: storage class specified for parameter ‘fgets’
../uClibc-0.9.30.1/include/stdio.h:540: error: storage class specified for parameter ‘gets’
../uClibc-0.9.30.1/include/stdio.h:592: error: storage class specified for parameter ‘fputs’
../uClibc-0.9.30.1/include/stdio.h:598: error: storage class specified for parameter ‘puts’
../uClibc-0.9.30.1/include/stdio.h:605: error: storage class specified for parameter ‘ungetc’
../uClibc-0.9.30.1/include/stdio.h:613: error: storage class specified for parameter ‘fread’
../uClibc-0.9.30.1/include/stdio.h:619: error: storage class specified for parameter ‘fwrite’
../uClibc-0.9.30.1/include/stdio.h:641: error: storage class specified for parameter ‘fread_unlocked’
../uClibc-0.9.30.1/include/stdio.h:643: error: storage class specified for parameter ‘fwrite_unlocked’
../uClibc-0.9.30.1/include/stdio.h:652: error: storage class specified for parameter ‘fseek’
../uClibc-0.9.30.1/include/stdio.h:657: error: storage class specified for parameter ‘ftell’
../uClibc-0.9.30.1/include/stdio.h:662: error: storage class specified for parameter ‘rewind’
../uClibc-0.9.30.1/include/stdio.h:701: error: expected declaration specifiers or ‘...’ before ‘fpos_t’
../uClibc-0.9.30.1/include/stdio.h:701: error: storage class specified for parameter ‘fgetpos’
../uClibc-0.9.30.1/include/stdio.h:706: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token

./uClibc-0.9.30.1/include/pthread.h:186: error: declaration for parameter ‘pthread_detach’ but no such parameter
../uClibc-0.9.30.1/include/pthread.h:180: error: declaration for parameter ‘pthread_join’ but no such parameter
../uClibc-0.9.30.1/include/pthread.h:175: error: declaration for parameter ‘pthread_exit’ but no such parameter
../uClibc-0.9.30.1/include/pthread.h:172: error: declaration for parameter ‘pthread_equal’ but no such parameter
../uClibc-0.9.30.1/include/pthread.h:169: error: declaration for parameter ‘pthread_self’ but no such parameter
../uClibc-0.9.30.1/include/pthread.h:166: error: declaration for parameter ‘pthread_create’ but no such parameter
../uClibc-0.9.30.1/include/bits/sigset.h:31: error: declaration for parameter ‘__sigset_t’ but no such parameter
../uClibc-0.9.30.1/include/bits/sigset.h:23: error: declaration for parameter ‘__sig_atomic_t’ but no such parameter
../uClibc-0.9.30.1/include/time.h:387: error: declaration for parameter ‘timer_getoverrun’ but no such parameter
../uClibc-0.9.30.1/include/time.h:384: error: declaration for parameter ‘timer_gettime’ but no such parameter
../uClibc-0.9.30.1/include/time.h:380: error: declaration for parameter ‘timer_settime’ but no such parameter
../uClibc-0.9.30.1/include/time.h:375: error: declaration for parameter ‘timer_delete’ but no such parameter
../uClibc-0.9.30.1/include/time.h:372: error: declaration for parameter ‘timer_create’ but no such parameter
../uClibc-0.9.30.1/include/time.h:350: error: declaration for parameter ‘clock_settime’ but no such parameter
../uClibc-0.9.30.1/include/time.h:346: error: declaration for parameter ‘clock_gettime’ but no such parameter
test.c:5: error: expected ‘{’ at end of input








--- On Wed, 10/7/09, Sushil Kumar <sushil_tux at yahoo.com> wrote:

From: Sushil Kumar <sushil_tux at yahoo.com>
Subject: busybox-1.14.3 compilation with uClibc
To: busybox at busybox.net
Date: Wednesday, October 7, 2009, 3:52 PM

GCC Version             :       4.1.1
Busybox                 :       Busybox-1.14.3
uClibc                  :       uClibc-0.9.29

My requirement is to compile the above busybox using the uClibc
C library instead of native glibc.I have compiled uClibc with native native 
gcc toolchain but not installed.

In the earlier version of Busybox-1.01, I changed the variable
LIBCDIR:=../../uCibc-0.9.29 (that's where my uclibc is relative
to busybox directory, in the Rules.mak file and it compiled successfully.

However, in
 the Busybox-1.14.3, the Makefile is more complex and I
am unable to find the relevant places where I should make changes to
include the uClibc directory so that busybox should compile using it.

What I have found that at the time of linking, the busybox uses
scripts/trylink to find which C Library it should use to produce the
busybox library.

I need to know which files/variable needs to be changed to use uClibc as
the C library to link with instead of native glibc in /usr/lib.

Please let me know if you need any more information about my setup to resolve 
the isssue.  (I do not want to go through "buildroot" tool)
.


      


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20091009/6b0fc31c/attachment-0001.htm>


More information about the busybox mailing list