Re: link sqlite against dietlibc

Michael Graßl <[email protected]> Tue, 24 Aug 2010 20:18:37 +0200
Newsgroups gmane.linux.lib.dietlibc
Message-ID <[email protected]>
  Hallo again...
> Simply omit -Werror. :-)
>
Yeah that was what i tried and it compiled with warnings but now i have 
the Problem that it want link the whole app togehter because it seems to 
miss libdl and pthread allthough  i add them with "-ldl....". whats 
going wrong at the linking process?


#link sqlite3.c

gcc -include /usr/lib/diet/include/dietref.h -Wall -ggdb3 -c sqlite3.c 
-DPTHREAD_MUTEX_RECURSIVE=PTHREAD_MUTEX_RECURSIVE_NP -isystem 
/usr/lib/diet/include -D__dietlibc__
sqlite3.c: In function 'dotlockLock':
sqlite3.c:24058: warning: implicit declaration of function 'utimes'
sqlite3.c: In function 'unixDlError':
sqlite3.c:27231: warning: assignment discards qualifiers from pointer 
target type


#linking all together now

gcc -nostdlib -static -L/usr/lib/diet/lib-x86_64 
/usr/lib/diet/lib-x86_64/start.o -Wall -ggdb3 -o browse2.cgi browse.o 
sqlite3.o gui.o filter.o content.o render.o -lpthread -ldl -isystem 
/usr/lib/diet/include -D__dietlibc__ /usr/lib/diet/lib-x86_64/libc.a -lgcc
sqlite3.o: In function `closePendingFds':
/var/dev/sqlite3.c:23204: warning: >>> your multithreaded code 
uses errno! <<<
sqlite3.o: In function `unixDlOpen':
/var/dev/sqlite3.c:27217: warning: Using 'dlopen' in statically linked 
applications requires at runtime the shared libraries from the glibc 
version used for linking
/usr/lib/diet/lib-x86_64/libc.a(vfprintf.o): In function `vfprintf':
vfprintf.c:(.text+0x15): warning: warning: the printf functions add 
several kilobytes of bloat.
/usr/lib/diet/lib-x86_64/libc.a(stderr.o): In function `__fflush_stderr':
stderr.c:(.text+0x8): warning: warning: your code uses stdio (7+k bloat).
sqlite3.o: In function `pthreadMutexAlloc':
sqlite3.c:(.text+0x3694): undefined reference to `pthread_mutexattr_settype'
sqlite3.o: In function `dotlockLock':
sqlite3.c:(.text+0xac4c): undefined reference to `utimes'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libdl.a(dlopen.o): 
In function `dlopen':
(.text+0x5): undefined reference to `__dlopen'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libdl.a(dlclose.o): 
In function `dlclose':
(.text+0x1): undefined reference to `__dlclose'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libdl.a(dlsym.o): In 
function `dlsym':
(.text+0x5): undefined reference to `__dlsym'
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libdl.a(dlerror.o): 
In function `dlerror':
(.text+0x1): undefined reference to `__dlerror'
collect2: ld returned 1 exit status
make: *** [all] Fehler 1