Hi Harris,

First some words of caution: whatever problem you're trying to solve, this
isn't the solution. We killed static libraries for some excellent reasons
not the least of which was that users were linking in the static version of
libc "to make their programs faster", and then complaining that their binaries
linked against libc.a from Solaris 2.5.1 sucked on Solaris 10.

Nevertheless. One of the problems you're seeing is that some of the component
object files in libc.so.1 are post-processed by dtrace(1M) with the -G option
to eliminate those references to __dtrace_plockstat_* (and to add the
plockstat provider). You need to invoke dtrace as the Makefile does on those
object files, and include the resulting object file in your archive.

... and then there appear to be some other issues on which I assume people are
loath to comment since you probably don't mean to be doing this at all...

Adam

On Mon, Jan 22, 2007 at 02:41:01PM -0800, Haris wrote:
> Hi -
> 
> I am trying to build a static version of the C library by following the 
> directions in README.makefile found in /lib directory. That is I am defining 
> LIBS = $(LIBRARY). I know that some of you would say that it is not 
> recommended to build static versions of libraries, but the reason I want to 
> do it is strictly for research purposes (actually I am doing something with a 
> simulator, and having dynamic libraries is pain). 
> 
> Thanks
> 
> PS: The error message that I get while trying to link against the generated 
> libc.a is the following:
> 
> Undefined                       first referenced
>  symbol                             in file
> __dtrace_plockstat___rw__blocked    ./libc.a(rwlock.o)
> __dtrace_plockstat___rw__acquire    ./libc.a(rwlock.o)
> _ld_libc                            ./libc.a(thr.o)
> _mbtowc                             ./libc.a(doprnt.o)
> _dlsym                              ./libc.a(unwind.o)
> _wctomb                             ./libc.a(doprnt.o)
> __dtrace_plockstat___mutex__release ./libc.a(synch.o)
> localeconv                          ./libc.a(doprnt.o)
> __dtrace_plockstat___mutex__error   ./libc.a(synch.o)
> __dtrace_plockstat___mutex__block   ./libc.a(synch.o)
> __dtrace_plockstat___mutex__blocked ./libc.a(synch.o)
> __dtrace_plockstat___mutex__acquire ./libc.a(synch.o)
> _mbstowcs                           ./libc.a(doprnt.o)
> _scrwidth                           ./libc.a(doprnt.o)
> _wcswidth                           ./libc.a(doprnt.o)
> tolower                             ./libc.a(doprnt.o)
> toupper                             ./libc.a(doprnt.o)
> __dtrace_plockstat___rw__error      ./libc.a(rwlock.o)
> __dtrace_plockstat___rw__block      ./libc.a(rwlock.o)
> __dtrace_plockstat___mutex__spin    ./libc.a(synch.o)
> __dtrace_plockstat___mutex__spun    ./libc.a(synch.o)
> __dtrace_plockstat___rw__release    ./libc.a(rwlock.o)
>  
>  
> This message posted from opensolaris.org
> _______________________________________________
> opensolaris-code mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

-- 
Adam Leventhal, Solaris Kernel Development       http://blogs.sun.com/ahl
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to