2010-04-15 07:12:08     Glib cross compilation

Document created by Aaronwu Employee on Aug 21, 2013
Version 1Show Document
  • View in full screen mode

2010-04-15 07:12:08     Glib cross compilation

Parimala Baggiri (INDIA)

Message: 88447   

 

Hello,

 

While cross compiling the glib with FDPIC, I get the following error

 

checking for dlopen... no

checking for NSLinkModule... no

checking for dlopen in -ldl... yes

checking for dlsym in -ldl... yes

/home/parimala/uClinux/build/bfin-linux-uclibc/bin/../bfin-linux-uclibc/runtime/usr/lib/crt1.o: In function `__start':

libc/sysdeps/linux/bfin/crt1.S:141: undefined reference to `_main'

collect2: ld returned 1 exit status

checking for RTLD_GLOBAL brokenness... no

checking for preceeding underscore in symbols... configure: error: in `/home/parimala/downloads/glib-2.23.5':

configure: error: cannot run test program while cross compiling

See `config.log' for more details.

 

 

Why is it giving undefined reference to `_main' ? This problem problem occurs for FDPIC format(bfin-linux-uclibc) not for FLAT format(bfin-uclinux).

 

Processor: ADSP-BF537

 

uclinux-dist: svn 7547

 

toochain: svn 4294

 

Regards,

 

parimala

QuoteReplyEditDelete

 

 

2010-04-15 08:11:16     Re: Glib cross compilation

Parimala Baggiri (INDIA)

Message: 88449   

 

Here is the configuration command I gave

 

./configure --cache-file=bfin.cache --host=bfin-linux-uclibc --prefix=/home/parimala/uClinux/uclinux-dist/staging/usr/ LDFLAGS=-L/home/parimala/uClinux/uclinux-dist/staging/usr/lib CFLAGS=-I/home/parimala/uClinux/uclinux-dist/staging/usr/include

 

bfin.cache includes the following lines

 

glib_cv_stack_grows=no

 

ac_cv_func_posix_getpwuid_r=yes

 

ac_cv_func_posix_getgrgid_r=yes

 

            gt_cv_c_wchar_t=no

QuoteReplyEditDelete

 

 

2010-04-15 12:15:55     Re: Glib cross compilation

Mike Frysinger (UNITED STATES)

Message: 88463   

 

the _main error isnt the problem.  look at the very last lines:

checking for preceeding underscore in symbols... configure: error: in `/home/parimala/downloads/glib-2.23.5':

configure: error: cannot run test program while cross compiling

 

you probably need to add another setting to your config.cache

QuoteReplyEditDelete

 

 

2010-04-16 02:01:03     Re: Glib cross compilation

Parimala Baggiri (INDIA)

Message: 88489   

 

Hello Mike,

 

Thanks for the clue, I have added glib_cv_uscore cache variable. Now configuration is successful. But while compiling glib I get the following error

 

gtester.c:(.text+0xffc): undefined reference to `_g_print'

gtester.c:(.text+0x100a): undefined reference to `_g_print'

gtester.c:(.text+0x1016): undefined reference to `_g_print'

gtester.c:(.text+0x1022): undefined reference to `_g_print'

gtester.c:(.text+0x102e): undefined reference to `_g_print'

gtester.o:gtester.c:(.text+0x103a): more undefined references to `_g_print' follow

gtester.o: In function `_parse_args':

gtester.c:(.text+0x10f4): undefined reference to `_g_log_set_always_fatal'

gtester.c:(.text+0x1106): undefined reference to `_g_log_set_always_fatal'

gtester.c:(.text+0x12d6): undefined reference to `_g_slist_prepend'

gtester.c:(.text+0x1326): undefined reference to `_g_slist_prepend'

gtester.c:(.text+0x13b8): undefined reference to `_g_slist_prepend'

gtester.c:(.text+0x1408): undefined reference to `_g_slist_prepend'

gtester.c:(.text+0x162a): undefined reference to `_g_log'

gtester.o: In function `_main':

gtester.c:(.text+0x18b4): undefined reference to `_g_set_prgname'

gtester.c:(.text+0x1968): undefined reference to `_g_strerror'

gtester.c:(.text+0x198e): undefined reference to `_g_log'

gtester.o: In function `_fixture_setup':

gtester.c:(.text+0x1b18): undefined reference to `_g_assertion_message_cmpnum'

gtester.o: In function `_fixture_test':

gtester.c:(.text+0x1bc2): undefined reference to `_g_assertion_message_cmpnum'

gtester.c:(.text+0x1bce): undefined reference to `_g_test_message'

gtester.c:(.text+0x1bda): undefined reference to `_g_test_bug_base'

gtester.c:(.text+0x1be6): undefined reference to `_g_test_bug'

gtester.c:(.text+0x1bf2): undefined reference to `_g_test_bug_base'

gtester.c:(.text+0x1bfe): undefined reference to `_g_test_bug'

gtester.o: In function `_fixture_teardown':

gtester.c:(.text+0x1c9a): undefined reference to `_g_assertion_message_cmpnum'

gtester.o: In function `_main_selftest':

gtester.c:(.text+0x1cbe): undefined reference to `_g_test_init'

gtester.c:(.text+0x1cc2): undefined reference to `_g_test_add_vtable'

gtester.c:(.text+0x1cf0): undefined reference to `_g_test_run'

collect2: ld returned 1 exit status

make[4]: *** [gtester] Error 1

make[4]: Leaving directory `/home/parimala/downloads/glib-2.23.5/glib'

make[3]: *** [all-recursive] Error 1

make[3]: Leaving directory `/home/parimala/downloads/glib-2.23.5/glib'

make[2]: *** [all] Error 2

make[2]: Leaving directory `/home/parimala/downloads/glib-2.23.5/glib'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/home/parimala/downloads/glib-2.23.5'

make: *** [all] Error 2

 

 

Any idea what is wrong with this?

 

Regards,

 

Parimala

QuoteReplyEditDelete

 

 

2010-04-16 02:47:16     Re: Glib cross compilation

Mike Frysinger (UNITED STATES)

Message: 88492   

 

glib uses a linker version script which you need to add the Blackfin ABI symbol prefix to each symbol (a leading underscore)

QuoteReplyEditDelete

 

 

2010-04-16 03:15:44     Re: Glib cross compilation

Parimala Baggiri (INDIA)

Message: 88497   

 

Hello Mike,

 

Is there any define or a variable which can be used to add a symbol prefix to each symbol?

 

I read in some forums making LIBTOOL_EXPORT_OPTIONS empty in configure.in to allow exporting of symbols.

 

I made this empty instead of regex, but still has some problems

 

libtool: link: bfin-linux-uclibc-gcc -I/uclinux/uclinux-dist/staging/usr/include -Wall -o .libs/gio-querymodules gio-querymodules.o  -L/uclinux/uclinux-dist/staging/usr/lib ../glib/.libs/libglib-2.0.so ../gobject/.libs/libgobject-2.0.so ../gmodule/.libs/libgmodule-2.0.so ./.libs/libgio-2.0.so /uclinux/uclinux-dist/staging/usr/lib/libintl.so /uclinux/uclinux-dist/staging/usr/lib/libiconv.so -Wl,-rpath -Wl,/uclinux/uclinux-dist/staging/usr/lib

./.libs/libgio-2.0.so: warning: the use of LEGACY `utimes' is discouraged, use `utime'

/uclinux/toolchain_build_4294/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.3.4/../../../../bfin-linux-uclibc/bin/ld: warning: libgthread-2.0.so.0, needed by ../gobject/.libs/libgobject-2.0.so, not found (try using -rpath or -rpath-link)

../gobject/.libs/libgobject-2.0.so: undefined reference to `_g_thread_init'

collect2: ld returned 1 exit status

make[4]: *** [gio-querymodules] Error 1

make[4]: Leaving directory `/uclinux/glib/glib-2.23.5/gio'

make[3]: *** [all-recursive] Error 1

make[3]: Leaving directory `/uclinux/glib/glib-2.23.5/gio'

make[2]: *** [all] Error 2

make[2]: Leaving directory `/uclinux/glib/glib-2.23.5/gio'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/uclinux/glib/glib-2.23.5'

make: *** [all] Error 2

 

 

Regards,

 

Parimala

QuoteReplyEditDelete

 

 

2010-04-16 04:55:16     Re: Glib cross compilation

Mike Frysinger (UNITED STATES)

Message: 88514   

 

like i said, you need to edit the version script files.  look at the *.def files.  if you want to pursue a different solution, that's your business.

Attachments

    Outcomes