Fix squid 3.0.13 cross compilation

From: Beber <beber_at_meleeweb.net>
Date: Fri, 17 Apr 2009 23:09:54 +0200

Hi,

Here are some tiny patch to fix cross-compilation of squid 3.0.13. Here
host is x86_64-pc-linux-gnu and dest is i586-geode-linux-uclibc.

There is a first issue with cf_gen. cf_gen is generated with TARGETCXX
and should be build with HOSTCXX as it is used on runtime compilation.
squid-3.0.13-BJA-cf_gen-HOSTCXX.diff :

libtool: link: ( cd ".libs" && rm -f "libauth.la" && ln -s "../libauth.la" "libauth.la" )
/bin/sh ../libtool --tag=CXX --mode=link i586-geode-linux-uclibc-g++ -Wall -Wpointer-arith -Wwrite-strings -fhuge-objects -D_REENTRANT -Os -pipe -march=k6-2 -fomit-frame-pointer -I/usr/i586-geode-linux-uclibc/usr/include/ -I/usr/i586-geode-linux-uclibc/include/ -o cf_gen cf_gen.o debug.o time.o globals.o libsquid.la libauth.la -L../lib -lmiscutil -lpthread -lm -lresolv -lnsl -ldl
libtool: link: i586-geode-linux-uclibc-g++ -Wall -Wpointer-arith -Wwrite-strings -fhuge-objects -D_REENTRANT -Os -pipe -march=k6-2 -fomit-frame-pointer -I/usr/i586-geode-linux-uclibc/usr/include/ -I/usr/i586-geode-linux-uclibc/include/ -o cf_gen cf_gen.o debug.o time.o globals.o ./.libs/libsquid.a -L/usr/i586-geode-linux-uclibc/bin ./.libs/libauth.a /usr/lib/gcc/i586-geode-linux-uclibc/3.4.6/libstdc++.so -L/usr/i586-geode-linux-uclibc/lib -L/usr/lib/gcc/i586-geode-linux-uclibc/3.4.6 -L/usr/lib/gcc/i586-geode-linux-uclibc/3.4.6/../../../../i586-geode-linux-uclibc/lib -L/usr/i586-geode-linux-uclibc/usr/lib -lgcc_s -lc -L/usr/i586-geode-linux-uclibc/tmp/portage/net-proxy/squid-3.0.13/work/squid-3.0.STABLE13/lib -lmiscutil -lpthread -lm -lresolv -lnsl -ldl -Wl,-rpath -Wl,/usr/lib/gcc/i586-geode-linux-uclibc/3.4.6 -Wl,-rpath -Wl,/usr/lib/gcc/i586-geode-linux-uclibc/3.4.6
./cf_gen cf.data ./cf.data.depend
make[1]: ./cf_gen: Command not found
make[1]: *** [cf_parser.h] Error 127
make[1]: Leaving directory `/usr/i586-geode-linux-uclibc/tmp/portage/net-proxy/squid-3.0.13/work/squid-3.0.STABLE13/src'
make: *** [all-recursive] Error 1

I did patch src/Makefile.in which is not the perfect way to do that. I
failed to implement that in src/Makefile.am.

Then, I got many errors about xstr* which are not totaly cast
compliant. squid-3.0.13-BJA-util-cast-xstr.diff correct it :

x86_64-pc-linux-gnu-g++ -I. -I. -I../include -I../include -I../lib/libTrie/include -DNDEBUG -DBUILD_HOST_TOOL -o cf_gen \
                ./cf_gen.cc ../lib/util.c ../lib/assert.c
../lib/util.c: In function 'char* xstrdup(const char*)':
../lib/util.c:758: error: invalid conversion from 'void*' to 'char*'
../lib/util.c: In function 'char* xstrndup(const char*, size_t)':
../lib/util.c:777: error: invalid conversion from 'void*' to 'char*'
../lib/util.c:777: error: initializing argument 1 of 'char* xstrncpy(char*, const char*, size_t)'
../lib/util.c:781: error: invalid conversion from 'void*' to 'char*'
../lib/util.c: In function 'const char* xint64toa(int64_t)':
../lib/util.c:926: warning: format '%lld' expects type 'long long int', but argument 4 has type 'int64_t'
../lib/util.c:926: warning: format '%lld' expects type 'long long int', but argument 4 has type 'int64_t'
make[1]: *** [cf_gen] Error 1
make[1]: Leaving directory `/usr/i586-geode-linux-uclibc/tmp/portage/net-proxy/squid-3.0.13/work/squid-3.0.STABLE13/src'
make: *** [all-recursive] Error 1

You can see that correct HOSTCXX is used. But my HOSTCXX is gcc 4.3.3
which is a bit less compliant.

PS: Could you CC me it there is any reply as I'm not subscribe to the
list.

Thanks,
Bertrand Jacquin

-- 
Beber


Received on Wed Jun 17 2009 - 20:39:54 MDT

This archive was generated by hypermail 2.2.0 : Thu Jun 18 2009 - 12:00:05 MDT