This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Linux->Solaris2.6 cross compiler shared libs problem.
- From: Joshua Kessinger <jkessing_1113 at yahoo dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 20 Nov 2002 11:30:09 -0800 (PST)
- Subject: Linux->Solaris2.6 cross compiler shared libs problem.
After a modest amount of pain I built GCC 3.2.1 with
Binutils 2.13 sparc-solaris26 targeted linux x86
hosted cross compiler. Code compiles and links, but
the first time I tried to use a shared lib I get a
SIGSEGV.
I built a c based app using the following code:
#include <stdio.h>
#include <dlfcn.h>
#include <link.h>
int main (int argc, char ** argv)
{
printf("hello\n");
fflush(stdout);
void * d = dlopen("./libgcc_s.so", RTLD_NOW);
if (dlerror())
{
printf("%s\n", dlerror());
}
return 0;
}
which compiles and links a-ok from the Linux box. When
I reach the dlopen() I get a SIGSEGV with the
following backtrace.
#0 __register_frame_info_bases (begin=0xff260000,
ob=0xff260000, tbase=0x0,
dbase=0x0) at
../../gcc-3.1.1/gcc/unwind-dw2-fde.c:83
#1 0xff2616b0 in frame_dummy () from
/tools_solaris/lib/libgcc_s.so.1
#2 0xff261598 in _init () from
/tools_solaris/lib/libgcc_s.so.1
#3 0xff3bc1ec in ?? ()
#4 0xff3c0d34 in ?? ()
#5 0xff3c0e5c in ?? ()
#6 0x00010748 in main ()
I encountered the exact same issue with GCC 3.1.1
Binutils 2.13. Any ideas where I went wrong?
libgcc_s.so.1 is the gcc_s from the cross-compiler
build.
I configured the cross-compiler with
../gcc-3.2.1/configure --with-thread=solaris
--prefix=/tools_x_solaris/
--target=sparc-sun-solaris2.6 --with-gnu-as
--with-gnu-ld --with-libs=/tools_x_solaris/lib
--with-headers=/tools_x_solaris/include/
--enable-languages=c,c++,f77,objc --enable-shared -v
Thread model: posix
gcc version 3.2.1
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com