This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to make a portable toolchain?


Hi Kai, thanks for your comments.

From: "Kai Ruottu" <kai.ruottu@luukku.com>
To: "Bin Zhou" <binzhou@pop-star.net.cn>
Cc: <crossgcc@sourceware.cygnus.com>; <binzhou@tgivan.com>
Sent: Thursday, November 02, 2000 5:27 AM
Subject: Re: How to make a portable toolchain?


> Bin Zhou wrote:
> >
> > As static libc requires libdl on Solaris, so I put -ldl in the LDFLAGS,
> > but I got linkage error saying "can not find -ldl".
>
>  Are you sure the 'libdl.a' will be needed and is not only a bug in your
> current 'specs' ?
>
> No '-ldl' after the '-lc' needed, the '-rpath-link' in the 'link-spec'
does the
> necessary magic and the 'libdl.so' will be found... Fixing the 'specs' is
quite
> normal with all Linux, Solaris2, SVR4, FreeBSD etc. targets which use
shared
> libs.
>
>  Perhaps you have added the '-ldl' bug there yourself and now blame the
FSF-people
> doing this ;-)
>

Actually, I did not mean that libc.a always requires libdl.a. Sorry for the
misunderstanding.
But in my case, my source code references to system functions iconv(), and
futhermore, iconv() references to dlclose(), dlsym() which is in the library
libdl. See the following error messages I got if I excluded "-ldl" from the
link options.

/public/umolibs/lib/solxgcc/libpmisc.a(platform.o): In function
`msecSleep(int)':
platform.o(.text+0x9e9): undefined reference to `nanosleep'
/usr/lib/libnsl.a(netdir.o): In function `load_xlate':
netdir.o(.text+0x9a4): undefined reference to `dlopen'
netdir.o(.text+0x9ca): undefined reference to `dlsym'
netdir.o(.text+0x9e0): undefined reference to `dlsym'
netdir.o(.text+0x9f7): undefined reference to `dlsym'
netdir.o(.text+0xa0e): undefined reference to `dlsym'
netdir.o(.text+0xa25): undefined reference to `dlsym'
netdir.o(.text+0xa92): undefined reference to `dlclose'
/usr/lib/libnsl.a(netdir.o): In function `netdir_sperror':
netdir.o(.text+0xbd9): undefined reference to `dlerror'
/usr/lib/libc.a(iconv.o): In function `iconv_open_private':
iconv.o(.text+0x233): undefined reference to `_dlopen'
iconv.o(.text+0x25d): undefined reference to `_dlsym'
iconv.o(.text+0x272): undefined reference to `_dlsym'
iconv.o(.text+0x288): undefined reference to `_dlsym'
iconv.o(.text+0x299): undefined reference to `_dlclose'
/usr/lib/libc.a(iconv.o): In function `_iconv_close':
iconv.o(.text+0x308): undefined reference to `_dlclose'
iconv.o(.text+0x32f): undefined reference to `_dlclose'
/usr/lib/libc.a(nss_deffinder.o): In function `SO_per_src_lookup':
nss_deffinder.o(.text+0x68): undefined reference to `_dlopen'
nss_deffinder.o(.text+0x8a): undefined reference to `_dlsym'
nss_deffinder.o(.text+0x97): undefined reference to `_dlclose'
/usr/lib/libc.a(nss_deffinder.o): In function `SO_per_src_delete':
nss_deffinder.o(.text+0xc7): undefined reference to `_dlclose'
collect2: ld returned 1 exit status
../tgt/solig/ffccs: No such file or directory
gmake: *** [../tgt/solig/ffccs] Error 2


>
>  What routines would be needed from the 'libdl.a' ?

Please see above error message for the functions needed from libdl.a, such
as dlclose(), dlsym() etc.

>
>  Please try to wrap the '-ldl' away for using with shared libs only and
then
> send us those undefined symbols-errors from the link (if any).
>

Are you saying I could link to libc/libstdc++ statically, while linking to
libdl dynamically(use libdl.so at running time)? How could I do this? I
guess Rodney is also concerned about this.

Regards,
-Bin




------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]