Jdesk / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

Cross compile OpenWrt #123

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to issue configure over the OpenWrt Build System
2. Cross Compile for OpenWrt

What is the expected output? What do you see instead?

successful configure

What version of the product are you using? On what operating system?
1.4.4

Please provide any additional information below.

You can see where the problem is. He is looking for SUNCC. I dont know why. 

make[1]: Entering directory `/extern/openwrt/trunk'
make[2]: Entering directory `/extern/openwrt/trunk/package/memcached'
rm -f
/extern/openwrt/trunk/staging_dir/target-i386_uClibc-0.9.30.1/stamp/.memcached_i
nstalled
rm -f /extern/openwrt/trunk/bin/x86/packages/memcached_*
rm -f
/extern/openwrt/trunk/staging_dir/target-i386_uClibc-0.9.30.1/packages/memcached
.list
/extern/openwrt/trunk/staging_dir/host/packages/memcached.list
rm -rf
/extern/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.4
make[2]: Leaving directory `/extern/openwrt/trunk/package/memcached'
make[1]: Leaving directory `/extern/openwrt/trunk'
make[1]: Entering directory `/extern/openwrt/trunk'
make[2]: Entering directory `/extern/openwrt/trunk/package/libtool'
make[2]: Leaving directory `/extern/openwrt/trunk/package/libtool'
make[2]: Entering directory `/extern/openwrt/trunk/package/libtool'
make[2]: Leaving directory `/extern/openwrt/trunk/package/libtool'
make[2]: Entering directory
`/extern/openwrt/trunk/feeds/packages/libs/libevent'
make[2]: Leaving directory `/extern/openwrt/trunk/feeds/packages/libs/libevent'
make[2]: Entering directory `/extern/openwrt/trunk/package/memcached'
gzip -dc /extern/openwrt/trunk/dl/memcached-1.4.4.tar.gz | /bin/tar -C
/extern/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.4/..
-xf -
touch
/extern/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.4/.pre
pared_9bf2d19c462e7624d0e4983ae21f79c4
(cd
/extern/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.4/./;
if [ -x ./configure ]; then /usr/bin/find
/extern/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.4/ 
-name
config.guess | xargs -r chmod u+w; /usr/bin/find
/extern/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.4/ 
-name
config.guess | xargs -r -n1 cp /extern/openwrt/trunk/scripts/config.guess;
/usr/bin/find
/extern/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.4/ 
-name
config.sub | xargs -r chmod u+w; /usr/bin/find
/extern/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.4/ 
-name
config.sub | xargs -r -n1 cp /extern/openwrt/trunk/scripts/config.sub;
AR=i486-openwrt-linux-uclibc-ar AS="i486-openwrt-linux-uclibc-gcc -c -O2
-pipe -march=i486 -funit-at-a-time -fhonour-copts"
LD=i486-openwrt-linux-uclibc-ld NM=i486-openwrt-linux-uclibc-nm
CC="i486-openwrt-linux-uclibc-gcc" GCC="i486-openwrt-linux-uclibc-gcc"
CXX="i486-openwrt-linux-uclibc-g++" RANLIB=i486-openwrt-linux-uclibc-ranlib
STRIP=i486-openwrt-linux-uclibc-strip
OBJCOPY=i486-openwrt-linux-uclibc-objcopy
OBJDUMP=i486-openwrt-linux-uclibc-objdump
SIZE=i486-openwrt-linux-uclibc-size CFLAGS="-O2 -pipe -march=i486
-funit-at-a-time -fhonour-copts " CXXFLAGS="-O2 -pipe -march=i486
-funit-at-a-time -fhonour-copts "
CPPFLAGS="-I/extern/openwrt/trunk/staging_dir/target-i386_uClibc-0.9.30.1/usr/in
clude
-I/extern/openwrt/trunk/staging_dir/target-i386_uClibc-0.9.30.1/include
-I/extern/openwrt/trunk/staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.30.1/usr
/include
-I/extern/openwrt/trunk/staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.30.1/inc
lude
"
LDFLAGS="-L/extern/openwrt/trunk/staging_dir/target-i386_uClibc-0.9.30.1/usr/lib
-L/extern/openwrt/trunk/staging_dir/target-i386_uClibc-0.9.30.1/lib
-L/extern/openwrt/trunk/staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.30.1/usr
/lib
-L/extern/openwrt/trunk/staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.30.1/lib
"   ./configure --target=i486-openwrt-linux --host=i486-openwrt-linux
--build=x86_64-linux-gnu --program-prefix="" --program-suffix=""
--prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share
--localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls 
--disable-ipv6 --disable-docs --disable-dtrace --disable-sasl ; fi; )
configure: WARNING: unrecognized options: --disable-nls, --disable-ipv6
configure: loading site script
/extern/openwrt/trunk/include/site/i486-openwrt-linux-uclibc
checking build system type... x86_64-pc-linux-gnu
checking host system type... i486-openwrt-linux-gnu
checking target system type... i486-openwrt-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for i486-openwrt-linux-strip... i486-openwrt-linux-uclibc-strip
checking for i486-openwrt-linux-gcc... i486-openwrt-linux-uclibc-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i486-openwrt-linux-uclibc-gcc accepts -g... yes
checking for i486-openwrt-linux-uclibc-gcc option to accept ISO C89... none
needed
checking for style of include used by make... GNU
checking dependency style of i486-openwrt-linux-uclibc-gcc... gcc3
checking how to run the C preprocessor... i486-openwrt-linux-uclibc-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for icc in use... no
checking for Sun cc in use... configure: error: in
`/extern/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.4':
configure: error: cannot run test program while cross compiling
See `config.log' for more details.
make[2]: ***
[/extern/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.4/.co
nfigured_]
Error 1
make[2]: Leaving directory `/extern/openwrt/trunk/package/memcached'
make[1]: *** [package/memcached/compile] Error 2
make[1]: Leaving directory `/extern/openwrt/trunk'
make: *** [package/memcached/compile] Error 2

Original issue reported on code.google.com by h...@terminal-consulting.de on 25 Feb 2010 at 5:12

GoogleCodeExporter commented 9 years ago
Can you supply flags, toolchains, etc...  Perhaps a build slave?

Original comment by dsalli...@gmail.com on 25 Feb 2010 at 7:04

GoogleCodeExporter commented 9 years ago
Yes. I'll setup a machine you can login an try to rebuild yourself with the
OpenWrt-SDK-x86.
This includes the toolchain for the release i try to build. 
Is that okay for you ?

Original comment by h...@terminal-consulting.de on 25 Feb 2010 at 7:39

GoogleCodeExporter commented 9 years ago
That's a great start.  I'd love a slave if you can contribute one:

http://code.google.com/p/memcached/wiki/BuildFarm

That way, we can make sure we continue to support your configuration.

Original comment by dsalli...@gmail.com on 25 Feb 2010 at 8:21

GoogleCodeExporter commented 9 years ago
I'll try to setup a buildbot with openwrt trunk. By the way using the sdk needs 
less
work. 

Original comment by h...@terminal-consulting.de on 25 Feb 2010 at 8:48

GoogleCodeExporter commented 9 years ago
Here are the news. 
- 1.28 build without any issue
- 14.x up to 1.4.5 is not ready for cross compile

Have a look
-
mv -f .deps/memcached-memcached.Tpo .deps/memcached-memcached.Po
i486-openwrt-linux-uclibc-gcc -DHAVE_CONFIG_H -I.  -DNDEBUG 
-I/openwrt/trunk/staging_dir/target-i386_uClibc-0.9.30.1/usr/include 
-I/openwrt/trunk/staging_dir/target-i386_uClibc-0.9.30.1/include 
-I/openwrt/trunk/staging_dir/toolchain-i386_gcc-4.4.4_uClibc-0.9.30.1/usr/includ
e -I/openwrt/trunk/staging_dir/toolchain-i386_gcc-4.4.4_uClibc-0.9.30.1/include 
  -O2 -pipe -march=i486 -funit-at-a-time -fhonour-copts  -pthread -Wall 
-pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls 
-fno-strict-aliasing -MT memcached-hash.o -MD -MP -MF .deps/memcached-hash.Tpo 
-c -o memcached-hash.o `test -f 'hash.c' || echo './'`hash.c
In file included from memcached.h:24,
                 from hash.c:12:
sasl_defs.h:4:1: warning: C++ style comments are not allowed in ISO C90
sasl_defs.h:4:1: warning: (this will be reported only once per input file)
In file included from hash.c:12:
memcached.h:305: warning: ISO C90 does not support flexible array members
hash.c:430:2: error: #error Must define HASH_BIG_ENDIAN or HASH_LITTLE_ENDIAN
make[5]: *** [memcached-hash.o] Error 1
make[5]: Leaving directory 
`/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.5'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory 
`/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.5'
make[3]: *** [all] Error 2
make[3]: Leaving directory 
`/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.5'
make[2]: *** 
[/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.5/.built] 
Error 2
make[2]: Leaving directory `/openwrt/packages/net/memcached'
make[1]: *** [package/feeds/packages/memcached/compile] Error 2
make[1]: Leaving directory `/openwrt/trunk'
make: *** [package/memcached/compile] Error 2
-

Also the checks for Cross-Compile are wrong. I still get  messages like
--
checking for Sun cc in use... configure: error: in 
`/openwrt/trunk/build_dir/target-i386_uClibc-0.9.30.1/memcached-1.4.5':
--
Seem to me, you only want to support Sun? Now Oracle ?

To sponsor you a buildbot for this issue is nothing like crap. But please 
correct me.

Original comment by h...@terminal-consulting.de on 8 Aug 2010 at 10:03

GoogleCodeExporter commented 9 years ago
memcached needs a compiler that supports a standard at least 11 years old.  The 
one you're using does not appear to, or is not configured to do so.

I don't suspect many people are going to be going out of their way to create a 
cross-compilation build system for you.  We'd be happy to take your 
well-written contribution to get things building for your system.

Original comment by dsalli...@gmail.com on 9 Aug 2010 at 1:08

GoogleCodeExporter commented 9 years ago
The problem in configure was that it tried to use try_run_ifelese, and that 
don't work for cross compilation. Update your compiler and try again.

fixed in 2176290048d6a9a7292020256400b4cb9d498c7b

Original comment by trond.no...@gmail.com on 11 Nov 2010 at 4:15

GoogleCodeExporter commented 9 years ago
Thank you really much. I can confirm that the issue is fixed.  

Original comment by h...@terminal-consulting.de on 14 Nov 2010 at 10:09