Hi guys-
So I've run into a strange problem in a somewhat complicated situation:
First, I'm trying to cross compile
mono 2.6.4 so that it will run on Freescale Embedded Linux for a PowerPC CPU. My host machine is running Fedora 13 on an x86. Freescale
provides a copy of the Linux Target Image Builder (LTIB) that has been pre-configured for the particular board I'm using, and LTIB seems to be able to help with the cross compilation of other stuff--you can add in your own packages to be built and included in your newly-built Linux image.
Mono depends on pkg-config and glib-2, so I have selected them in the LTIB package selection config. I've also added a new package for mono that builds mono-2.6.4 from the source tar (after the other deps have also been built).
I'm having a problem getting the glib-2.24.0 package libraries created. Basically they appear to build and link ok, but then libtool runs and errors out claiming it has a syntax error! (numerous wths followed...)
Here is LTIB's temporary build script for only the glib2 package:
Code:
#!/bin/sh
RPM_SOURCE_DIR="/home/Mike/ltib-mpc8572ds-20100115/rpm/SOURCES"
RPM_BUILD_DIR="/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD"
RPM_OPT_FLAGS="-O2 -fsigned-char"
RPM_ARCH="i386"
RPM_OS="linux"
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
RPM_DOC_DIR="/opt/freescale/ltib/usr/doc"
export RPM_DOC_DIR
RPM_PACKAGE_NAME="glib2"
RPM_PACKAGE_VERSION="2.24.0"
RPM_PACKAGE_RELEASE="1"
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
RPM_BUILD_ROOT="/home/Mike/ltib-mpc8572ds-20100115/tmp/glib2"
export RPM_BUILD_ROOT
set -x
umask 022
cd /home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD
cd glib-2.24.0
# prevent configure from trying to compile and
# run test binaries for the target.
glib_cv_stack_grows=no \
glib_cv_uscore=no \
ac_cv_func_posix_getpwuid_r=yes \
ac_cv_func_posix_getgrgid_r=yes \
./configure --prefix=/usr --host=$CFGHOST --build=i686-pc-linux-gnu
make
exit 0
Here is the output when building the glib2 package (configure + make):
Code:
[Mike@dev-vm-mbuilder3 ltib-mpc8572ds-20100115]$ ./ltib -m scbuild -p glib2
Processing: glib2
===================
Build path taken because: directory build, build key set, no prebuilt rpm,
rpmbuild --dbpath /home/Mike/ltib-mpc8572ds-20100115/rootfs//var/lib/rpm --target ppc --define '_unpackaged_files_terminate_build 0' --define '_target_cpu ppc' --define '__strip strip' --define '_topdir /home/Mike/ltib-mpc8572ds-20100115/rpm' --define '_prefix /usr' --define '_tmppath /home/Mike/ltib-mpc8572ds-20100115/tmp' --define '_rpmdir /home/Mike/ltib-mpc8572ds-20100115/rpm/RPMS' --define '_mandir /usr/share/man' --define '_sysconfdir /etc' --define '_localstatedir /var' -bc --short-circuit /home/Mike/ltib-mpc8572ds-20100115/dist/lfs-5.1/glib2/glib2.spec
Building target platforms: ppc
Building for target ppc
Executing(%build): /bin/sh -e /home/Mike/ltib-mpc8572ds-20100115/tmp/rpm-tmp.14713
+ umask 022
+ cd /home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD
+ cd glib-2.24.0
+ glib_cv_stack_grows=no
+ glib_cv_uscore=no
+ ac_cv_func_posix_getpwuid_r=yes
+ ac_cv_func_posix_getgrgid_r=yes
+ ./configure --prefix=/usr --host=powerpc-linux --build=i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for powerpc-linux-strip... no
checking for strip... strip
configure: WARNING: using cross tools not prefixed with host triplet
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... i686-pc-linux-gnu
checking host system type... powerpc-unknown-linux-gnu
checking for the BeOS... no
checking for Win32... no
checking for Mac OS X Carbon support... checking for style of include used by make... GNU
checking for powerpc-linux-gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
no
checking whether to enable garbage collector friendliness... no
checking whether to disable memory pools... no
checking for powerpc-linux-gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for powerpc-linux-c++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for powerpc-linux-gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking whether gcc and cc understand -c and -o together... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for pkg-config... /opt/freescale/ltib/usr/bin/pkg-config
checking for gawk... (cached) gawk
checking for perl5... no
checking for perl... perl
checking for indent... indent
checking for perl... /usr/bin/perl
checking for a Python interpreter with version >= 2.4... python
checking for python... /usr/bin/python
checking for python version... 2.6
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.6/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.6/site-packages
checking for iconv_open... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether we are using the GNU C Library 2.1 or newer... yes
checking Whether to cache iconv descriptors... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for inflate in -lz... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for LC_MESSAGES... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for ngettext in libc... yes
checking for dgettext in libc... yes
checking for bind_textdomain_codeset... yes
checking for msgfmt... /usr/bin/msgfmt
checking for dcgettext... yes
checking if msgfmt accepts -c... yes
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for catalogs to be installed... af am ar as ast az be be@latin bg bn bn_IN bs ca ca@valencia cs cy da de dz el en_CA en_GB en@shaw eo es et eu fa fi fr ga gl gu he hi hr hu hy id is it ja ka kn ko ku lt lv mai mg mk ml mn mr ms nb nds ne nl nn oc or pa pl ps pt pt_BR ro ru rw si sk sl sq sr sr@latin sr@ije sv ta te th tl tr tt uk vi wa xh yi zh_CN zh_HK zh_TW
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... ld
checking if the linker (ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... no
checking for powerpc-linux-dumpbin... no
checking for powerpc-linux-link... no
checking for dumpbin... no
checking for link... link -dump -symbols
checking the name lister (link -dump -symbols) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1966080
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for ld option to reload object files... -r
checking for powerpc-linux-objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for powerpc-linux-ar... ar
checking for powerpc-linux-strip... strip
checking for powerpc-linux-ranlib... no
checking for ranlib... ranlib
checking command to parse link -dump -symbols output from gcc object... failed
checking for dlfcn.h... yes
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking how to run the C++ preprocessor... g++ -E
checking for objdir... .libs
{ ... some configure output removed to save space ... }
configure: creating ./config.status
config.status: creating glib-2.0.pc
config.status: creating glib-2.0-uninstalled.pc
config.status: creating gmodule-2.0.pc
config.status: creating gmodule-export-2.0.pc
config.status: creating gmodule-no-export-2.0.pc
config.status: creating gmodule-2.0-uninstalled.pc
config.status: creating gmodule-no-export-2.0-uninstalled.pc
config.status: creating gthread-2.0.pc
config.status: creating gthread-2.0-uninstalled.pc
config.status: creating gobject-2.0.pc
config.status: creating gobject-2.0-uninstalled.pc
config.status: creating gio-2.0.pc
config.status: creating gio-unix-2.0.pc
config.status: creating gio-2.0-uninstalled.pc
config.status: creating gio-unix-2.0-uninstalled.pc
config.status: creating glib-zip
config.status: creating glib-gettextize
config.status: creating Makefile
config.status: creating build/Makefile
config.status: creating build/win32/Makefile
config.status: creating build/win32/dirent/Makefile
config.status: creating build/win32/vs9/Makefile
config.status: creating glib/Makefile
config.status: creating glib/libcharset/Makefile
config.status: creating glib/gnulib/Makefile
config.status: creating glib/pcre/Makefile
config.status: creating glib/update-pcre/Makefile
config.status: creating glib/tests/Makefile
config.status: creating gmodule/Makefile
config.status: creating gmodule/gmoduleconf.h
config.status: creating gobject/Makefile
config.status: creating gobject/glib-mkenums
config.status: creating gobject/tests/Makefile
config.status: creating gthread/Makefile
config.status: creating gthread/tests/Makefile
config.status: creating gio/Makefile
config.status: creating gio/xdgmime/Makefile
config.status: creating gio/inotify/Makefile
config.status: creating gio/libasyncns/Makefile
config.status: creating gio/fen/Makefile
config.status: creating gio/fam/Makefile
config.status: creating gio/win32/Makefile
config.status: creating gio/tests/Makefile
config.status: creating po/Makefile.in
config.status: creating docs/Makefile
config.status: creating docs/reference/Makefile
config.status: creating docs/reference/glib/Makefile
config.status: creating docs/reference/glib/version.xml
config.status: creating docs/reference/gobject/Makefile
config.status: creating docs/reference/gobject/version.xml
config.status: creating docs/reference/gio/Makefile
config.status: creating docs/reference/gio/version.xml
config.status: creating tests/Makefile
config.status: creating tests/gobject/Makefile
config.status: creating tests/refcount/Makefile
config.status: creating m4macros/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing default-1 commands
config.status: executing libtool commands
config.status: executing glibconfig.h commands
config.status: glibconfig.h is unchanged
config.status: executing chmod-scripts commands
+ make
cd . && /bin/sh ./config.status glibconfig.h
config.status: executing glibconfig.h commands
config.status: glibconfig.h is unchanged
echo timestamp > stamp-gc-h
make all-recursive
make[1]: Entering directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0'
Making all in .
make[2]: Entering directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0'
make[2]: Leaving directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0'
Making all in m4macros
make[2]: Entering directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/m4macros'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/m4macros'
Making all in glib
make[2]: Entering directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib'
make all-recursive
make[3]: Entering directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib'
Making all in libcharset
make[4]: Entering directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib/libcharset'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib/libcharset'
Making all in gnulib
make[4]: Entering directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib/gnulib'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib/gnulib'
Making all in pcre
make[4]: Entering directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib/pcre'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib/pcre'
Making all in update-pcre
make[4]: Entering directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib/update-pcre'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib/update-pcre'
Making all in .
make[4]: Entering directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib'
/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -version-info 2400:0:2400 -export-dynamic -export-symbols-regex "^g.*" -o libglib-2.0.la -rpath /usr/lib garray.lo gasyncqueue.lo gatomic-gcc.lo gbacktrace.lo gbase64.lo gbitlock.lo gbookmarkfile.lo gbuffer.lo gcache.lo gchecksum.lo gcompletion.lo gconvert.lo gdataset.lo gdate.lo gdir.lo gerror.lo gfileutils.lo ghash.lo ghook.lo ghostutils.lo giochannel.lo gkeyfile.lo glist.lo gmain.lo gmappedfile.lo gmarkup.lo gmem.lo gmessages.lo gnode.lo goption.lo gpattern.lo gpoll.lo gprimes.lo gqsort.lo gqueue.lo grel.lo grand.lo gregex.lo gscanner.lo gsequence.lo gshell.lo gslice.lo gslist.lo gstdio.lo gstrfuncs.lo gstring.lo gtestutils.lo gthread.lo gthreadpool.lo gtimer.lo gtree.lo guniprop.lo gutf8.lo gunibreak.lo gunicollate.lo gunidecomp.lo gurifuncs.lo gutils.lo gvariant.lo gvariant-core.lo gvariant-parser.lo gvariant-serialiser.lo gvarianttypeinfo.lo gvarianttype.lo gprintf.lo libcharset/libcharset.la gnulib/libgnulib.la giounix.lo gspawn.lo pcre/libpcre.la
libtool: link: link -dump -symbols .libs/garray.o .libs/gasyncqueue.o .libs/gatomic-gcc.o .libs/gbacktrace.o .libs/gbase64.o .libs/gbitlock.o .libs/gbookmarkfile.o .libs/gbuffer.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/ghostutils.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/gpoll.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/gvariant.o .libs/gvariant-core.o .libs/gvariant-parser.o .libs/gvariant-serialiser.o .libs/gvarianttypeinfo.o .libs/gvarianttype.o .libs/gprintf.o .libs/giounix.o .libs/gspawn.o libcharset/.libs/libcharset.a gnulib/.libs/libgnulib.a pcre/.libs/libpcre.a | | /bin/sed 's/.* //' | sort | uniq > .libs/libglib-2.0.exp
../libtool: eval: line 964: syntax error near unexpected token `|'
../libtool: eval: line 964: `link -dump -symbols .libs/garray.o .libs/gasyncqueue.o .libs/gatomic-gcc.o .libs/gbacktrace.o .libs/gbase64.o .libs/gbitlock.o .libs/gbookmarkfile.o .libs/gbuffer.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/ghostutils.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/gpoll.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/gvariant.o .libs/gvariant-core.o .libs/gvariant-parser.o .libs/gvariant-serialiser.o .libs/gvarianttypeinfo.o .libs/gvarianttype.o .libs/gprintf.o .libs/giounix.o .libs/gspawn.o libcharset/.libs/libcharset.a gnulib/.libs/libgnulib.a pcre/.libs/libpcre.a | | /bin/sed 's/.* //' | sort | uniq > .libs/libglib-2.0.exp'
../libtool: line 964: warning: syntax errors in . or eval will cause future versions of the shell to abort as Posix requires
make[4]: *** [libglib-2.0.la] Error 1
make[4]: Leaving directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/glib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/Mike/ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0'
make: *** [all] Error 2
error: Bad exit status from /home/Mike/ltib-mpc8572ds-20100115/tmp/rpm-tmp.14713 (%build)
RPM build errors:
Bad exit status from /home/Mike/ltib-mpc8572ds-20100115/tmp/rpm-tmp.14713 (%build)
Build time for glib2: 92 seconds
Failed building glib2
f_scbuild() returned an error, exiting
traceback:
main:560
Exiting on error or interrupt
Specifically:
../libtool: eval: line 964: syntax error near unexpected token `|'
and
../libtool: line 964: warning: syntax errors in . or eval will cause future versions of the shell to abort as Posix requires
Line 964 of ltib-mpc8572ds-20100115/rpm/BUILD/glib-2.24.0/libtool is the one below that reads
eval "$my_cmd"
Code:
...
# func_show_eval cmd [fail_exp]
# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it.
func_show_eval ()
{
my_cmd="$1"
my_fail_exp="${2-:}"
${opt_silent-false} || {
func_quote_for_expand "$my_cmd"
eval "func_echo $func_quote_for_expand_result"
}
if ${opt_dry_run-false}; then :; else
eval "$my_cmd"
my_status=$?
if test "$my_status" -eq 0; then :; else
eval "(exit $my_status); $my_fail_exp"
fi
fi
}
...
Any advice on why I'm running into this problem and how I might resolve it would be most appreciated. If there is other relevant info I can pass along, just ask.
-Mike