m68k-linux-gnu-gcc/php-5.3.5 cross compiling problem
El Topo
cameos at gmail.com
Thu Feb 24 21:57:44 UTC 2011
Hi,
I am using codesourcery's Sourcery G++ Lite 2010.09-40 for ColdFire
GNU/Linux (build system: i686-pc-linux-gnu, host system:
m68k-linux-gnu):
=================== m68k-linux-gnu-gcc version ====================
# m68k-linux-gnu-gcc --version
m68k-linux-gnu-gcc (Sourcery G++ Lite 2010.09-40) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# m68k-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=m68k-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/lxl/freescale-coldfire-2010.09/bin/../libexec/gcc/m68k-linux-gnu/4.5.1/lto-wrapper
Target: m68k-linux-gnu
Configured with:
/scratch/sandra/cf-linux-lite/src/gcc-4.5-2010.09/configure
--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu
--target=m68k-linux-gnu --enable-threads --disable-libmudflap
--disable-libssp --disable-libstdcxx-pch --with-arch=cf --with-gnu-as
--with-gnu-ld --with-specs='%{save-temps: -fverbose-asm}
-D__CS_SOURCERYGXX_MAJ__=2010 -D__CS_SOURCERYGXX_MIN__=9
-D__CS_SOURCERYGXX_REV__=40 %{O2:%{!fno-remove-local-statics:
-fremove-local-statics}}
%{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics:
-fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared
--enable-lto --enable-symvers=gnu --enable-__cxa_atexit
--with-pkgversion='Sourcery G++ Lite 2010.09-40'
--with-bugurl=https://support.codesourcery.com/GNUToolchain/
--disable-nls --prefix=/opt/freescale/usr/local/gcc-4.5.40-eglibc-2.11.40/m68k-linux
--with-sysroot=/opt/freescale/usr/local/gcc-4.5.40-eglibc-2.11.40/m68k-linux/m68k-linux-gnu/libc
--with-build-sysroot=/scratch/sandra/cf-linux-lite/install/m68k-linux-gnu/libc
--with-gmp=/scratch/sandra/cf-linux-lite/obj/host-libs-2010.09-40-m68k-linux-gnu-i686-pc-linux-gnu/usr
--with-mpfr=/scratch/sandra/cf-linux-lite/obj/host-libs-2010.09-40-m68k-linux-gnu-i686-pc-linux-gnu/usr
--with-mpc=/scratch/sandra/cf-linux-lite/obj/host-libs-2010.09-40-m68k-linux-gnu-i686-pc-linux-gnu/usr
--with-ppl=/scratch/sandra/cf-linux-lite/obj/host-libs-2010.09-40-m68k-linux-gnu-i686-pc-linux-gnu/usr
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic
-lm' --with-cloog=/scratch/sandra/cf-linux-lite/obj/host-libs-2010.09-40-m68k-linux-gnu-i686-pc-linux-gnu/usr
--with-libelf=/scratch/sandra/cf-linux-lite/obj/host-libs-2010.09-40-m68k-linux-gnu-i686-pc-linux-gnu/usr
--enable-libgomp --enable-poison-system-directories
--with-build-time-tools=/scratch/sandra/cf-linux-lite/install/m68k-linux-gnu/bin
--with-build-time-tools=/scratch/sandra/cf-linux-lite/install/m68k-linux-gnu/bin
Thread model: posix
gcc version 4.5.1 (Sourcery G++ Lite 2010.09-40)
=================== m68k-linux-gnu-gcc version ====================
When try to compile php-5.3.5, I have got the following error:
============== php 5.3.5 cross compiling error ======================
# make
......
/bin/sh /home/lxl/php-5.3.5/cpibuild/libtool --silent
--preserve-dup-deps --mode=compile m68k-linux-gnu-gcc -Iext/date/lib
-Iext/date/ -I/home/lxl/php-5.3.5/ext/date/ -DPHP_ATOM_INC
-I/home/lxl/php-5.3.5/cpibuild/include
-I/home/lxl/php-5.3.5/cpibuild/main -I/home/lxl/php-5.3.5
-I/home/lxl/php-5.3.5/cpibuild/ext/date/lib
-I/home/lxl/php-5.3.5/ext/date/lib
-I/home/lxl/php-5.3.5/ext/ereg/regex -I/usr/local/include/libxml2
-I/home/lxl/php-5.3.5/ext/sqlite3/libsqlite
-I/home/lxl/php-5.3.5/cpibuild/TSRM
-I/home/lxl/php-5.3.5/cpibuild/Zend -I/home/lxl/php-5.3.5/main
-I/home/lxl/php-5.3.5/Zend -I/home/lxl/php-5.3.5/TSRM
-I/home/lxl/php-5.3.5/cpibuild/ -mcpu=54418 -c
/home/lxl/php-5.3.5/ext/date/lib/parse_date.c -o
ext/date/lib/parse_date.lo
/tmp/cc4YYDBL.s: Assembler messages:
/tmp/cc4YYDBL.s:102080: Fatal error: Tried to convert PC relative
branch to absolute jump
make: *** [ext/date/lib/parse_date.lo] Error 1
make: Leaving directory `/home/lxl/php-5.3.5/cpibuild'
failed to make!
============== php 5.3.5 cross compiling error ======================
the file ext/date/lib/parse_date.c has a huge function scan() (23793
lines!), which causes "Fatal error: Tried to convert PC relative
branch to absolute jump".
Here's my configure settings for php-5.3.5:
=================== my php configure & make script =====================
#!/bin/sh
export CROSS_COMPILE=m68k-linux-gnu-
export CONFIG_GUESS=`sh config.guess`
export CC=${CROSS_COMPILE}gcc
export CXX=${CROSS_COMPILE}g++
export CFLAGS="-mcpu=54418 -fPIC"
BUILDDIR=cpibuild
# clean up
rm -rf $BUILDDIR
mkdir -p $BUILDDIR
cd $BUILDDIR
../configure -build=${CONFIG_GUESS} --host=m68k-linux-gnu
--prefix=/usr/local --without-aolserver --without-apache
--disable-mod-charset --without-apxs2 --without-apache-hooks
--without-apache-hooks-static --without-caudium --without-continuity
--enable-embed=shared --disable-fpm --without-isapi
--without-litespeed --without-nsapi --without-phttpd --without-pi3web
--without-roxen --disable-roxen-zts --without-thttpd --without-tux
--without-webjames --enable-cgi --disable-gcov --disable-debug
--enable-ipv6 --without-iconv
--with-libxml-dir=/home/lxl/libxml2/usr/local
make
=================== my php configure & make script =====================
Here are my questions:
1. are there any options of m68k-linux-gnu-gcc/-as that can get around
of the problem? I know that scan() should not be that big but it's
fine with i686-pc-linux-gnu-gcc;
2. has anyone successfully cross compiled php-5.3.5 for m68k-linux-gnu-gcc?
Thanks,
cameos
More information about the coldfire-gnu-discuss
mailing list