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,

>
> char *dlopen() { return 0;}
> int dlclose() { return 0;}
> char *dlsym() { return 0;}
> char *dlerror() { return "dynamic linking not loaded";}
> --------------------------
clip -------------------------------------------
>

The 'stubs' approach of libdl could be a solution if all the 'dlxxx'
routines are NOT really referenced by applications. Otherwise the binary
will be segment fault for sure. I tried to use the stubbed libdl.a, in my
case,  I got the segment core error, not to mention the overheads of
maintaining the stubbed libdl in development.

>  The 'stubs'-approach was already mentioned here, but whether the first
> 'mixed' linking works with GNU ld is unclear. Anyway trying something
> like:
>
>   sparc-sun-solaris2.8-gcc -static -o my_exe
<my_objs> -lc -Bdynamic -ldl -Bstatic
>

The mixed linking works if I put -B everywhere with the linking options,
like:

$binzhou>gcc -Bstatic -o my_binary <my_objs> -lc -Bdynamic -ldl -Bstatic

Unfortunately, the size of the target file created in this way is exactly
the same as the size of target created by linking everything dynamically. I
am not sure if this matters. I will get a clean machine to test the target
and see if it asks for libc.so or libstdc++.so etc. If so, it means the
'-Bstatic' did not take effect at all.

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]