libglib2 on buildroot_v2.2.0rc5 failed

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

compiling libglib2 in buildroot-avr32-v2.2.0-rc5/ failed with following error:

 /home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/build_avr32/staging_dir/usr/bin/avr32-linux-uclibc-gcc -Os -I/home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/build_avr32/staging_dir/usr/include -I/home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/build_avr32/staging_dir/include -msoft-float -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../glib -DG_LOG_DOMAIN=\"GLib\" -DG_ENABLE_DEBUG -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -pthread -g -O2 -Wall -MT vasnprintf.lo -MD -MP -MF .deps/vasnprintf.Tpo -c vasnprintf.c  -fPIC -DPIC -o .libs/vasnprintf.o
vasnprintf.c: In function '_g_gnulib_vasnprintf':
vasnprintf.c:576: error: 'MB_CUR_MAX' undeclared (first use in this function)
vasnprintf.c:576: error: (Each undeclared identifier is reported only once
vasnprintf.c:576: error: for each function it appears in.)

There is one link related to this error. There it could be a problem with the toolchain.
http://blackfin.uclinux.org/gf/project/toolchain/forum/?action=ForumBrowse&forum_id=44&_forum_thread_total=50&_forum_thread_page=3&_forum_action=ForumMessageBrowse&thread_id=23408

The MB_CUR_MAX macro is defined in stdlib.h,
any ideas how to solve this problem?
Thank you very much.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you enable wide char? Perhaps that is the reason it does not work? It might also be that uClibc AVR32 port miss this define for some reason.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I enabled wchar support in buidroot, thanks for the tip.

The macro __UCLIBC_HAS_WCHAR__ in staging_dir/include/stdlib.h is not defined after enabled wchar support!
(Is it necessary to rebuild the whole toolchain to enable wchar?
How to rebuild the toolchain only?)

....

I build the whole stuff again and get following error now:

/home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/build_avr32/staging_dir/usr/bin/avr32-linux-uclibc-nm  .libs/garray.o .libs/gasyncqueue.o .libs/gatomic.o .libs/gbacktrace.o .libs/gbase64.o .libs/gbookmarkfile.o .libs/gcache.o .libs/gchecksum.o .libs/gcompletion.o .libs/gconvert.o .libs/gdataset.o .libs/gdate.o .libs/gdir.o .libs/gerror.o .libs/gfileutils.o .libs/ghash.o .libs/ghook.o .libs/giochannel.o .libs/gkeyfile.o .libs/glist.o .libs/gmain.o .libs/gmappedfile.o .libs/gmarkup.o .libs/gmem.o .libs/gmessages.o .libs/gnode.o .libs/goption.o .libs/gpattern.o .libs/gprimes.o .libs/gqsort.o .libs/gqueue.o .libs/grel.o .libs/grand.o .libs/gregex.o .libs/gscanner.o .libs/gsequence.o .libs/gshell.o .libs/gslice.o .libs/gslist.o .libs/gstdio.o .libs/gstrfuncs.o .libs/gstring.o .libs/gtestutils.o .libs/gthread.o .libs/gthreadpool.o .libs/gtimer.o .libs/gtree.o .libs/guniprop.o .libs/gutf8.o .libs/gunibreak.o .libs/gunicollate.o .libs/gunidecomp.o .libs/gurifuncs.o .libs/gutils.o .libs/gprintf.o .libs/giounix.o .libs/gspawn.o  libcharset/.libs/libcharset.a gnulib/.libs/libgnulib.a pcre/.libs/libpcre.a | sed -n -e 's/^.*[ 	]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ 	][ 	]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | /home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/toolchain_build_avr32/bin/sed 's/.* //' | sort | uniq > .libs/libglib-2.0.exp
/bin/grep -E -e "^g.*" ".libs/libglib-2.0.exp" > ".libs/libglib-2.0.expT"
mv -f ".libs/libglib-2.0.expT" ".libs/libglib-2.0.exp"
echo "{ global:" > .libs/libglib-2.0.ver
 cat .libs/libglib-2.0.exp | sed -e "s/\(.*\)/\1;/" >> .libs/libglib-2.0.ver
 echo "local: *; };" >> .libs/libglib-2.0.ver
 /home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/build_avr32/staging_dir/usr/bin/avr32-linux-uclibc-gcc -Os  -I/home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/build_avr32/staging_dir/usr/include -I/home/lumax/avr32/buildroot/buildroot-avr32-v2.2.0-rc5/build_avr32/staging_dir/include -msoft-float -shared  .libs/garray.o .libs/gasyncqueue.o .libs/gatomic.o .libs/gbacktrace.o .libs/gbase64.o .libs/gbookmarkfile.o .libs/gcache.o .libs/gchecksum.o .libs/gcompletion.o .libs/gconvert.o .libs/gdataset.o .libs/gdate.o .libs/gdir.o .libs/gerror.o .libs/gfileutils.o .libs/ghash.o .libs/ghook.o .libs/giochannel.o .libs/gkeyfile.o .libs/glist.o .libs/gmain.o .libs/gmappedfile.o .libs/gmarkup.o .libs/gmem.o .libs/gmessages.o .libs/gnode.o .libs/goption.o .libs/gpattern.o .libs/gprimes.o .libs/gqsort.o .libs/gqueue.o .libs/grel.o .libs/grand.o .libs/gregex.o .libs/gscanner.o .libs/gsequence.o .libs/gshell.o .libs/gslice.o .libs/gslist.o .libs/gstdio.o .libs/gstrfuncs.o .libs/gstring.o .libs/gtestutils.o .libs/gthread.o .libs/gthreadpool.o .libs/gtimer.o .libs/gtree.o .libs/guniprop.o .libs/gutf8.o .libs/gunibreak.o .libs/gunicollate.o .libs/gunidecomp.o .libs/gurifuncs.o .libs/gutils.o .libs/gprintf.o .libs/giounix.o .libs/gspawn.o -Wl,--whole-archive libcharset/.libs/libcharset.a gnulib/.libs/libgnulib.a pcre/.libs/libpcre.a -Wl,--no-whole-archive  /usr/local/lib/libiconv.so -lintl  -msoft-float -Wl,-soname -Wl,libglib-2.0.so.0 -Wl,-version-script -Wl,.libs/libglib-2.0.ver -o .libs/libglib-2.0.so.0.1504.0
/usr/local/lib/libiconv.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status

The path /usr/local/lib/libiconv.so points to the host system, i think there has to be something like ...buildroot/build_avr32/staging_dir/lib/libiconv.so !

How to manipulate the Makefile or libglib2.mk or whatever to link to the proper library?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
(Is it necessary to rebuild the whole toolchain to enable wchar?

Yes
Quote:
How to rebuild the toolchain only?)

You don't, you have to rebuild everything after tinkering with WCHAR and locale, remove all the _avr32 directories and binaries and do a new make from scratch.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
How to manipulate the Makefile or libglib2.mk or whatever to link to the proper library?

I do not know this!

A workaround seems to be to put the staging_dir/lib/libiconv.so.2.4.0 temporary in the /usr/local/lib folder for that compile session.

Furthermore glib-genmarshal is required. Packet libglib2.0-dev (ubuntu) contains this tool.