Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 266581 - net-proxy/squid-3.0.13: fix cross compilation
Summary: net-proxy/squid-3.0.13: fix cross compilation
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Network Proxy Developers (OBSOLETE)
URL:
Whiteboard:
Keywords:
: 266418 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-17 21:12 UTC by Bertrand Jacquin
Modified: 2009-04-25 11:43 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build cf_gen with HOSTCC (squid-3.0.13-BJA-cf_gen-HOSTCXX.diff,718 bytes, patch)
2009-04-17 21:13 UTC, Bertrand Jacquin
Details | Diff
avoid gcc-4.3 errors (squid-3.0.13-BJA-util-cast-xstr.diff,787 bytes, patch)
2009-04-17 21:13 UTC, Bertrand Jacquin
Details | Diff
net-proxy/squid-3.0.13.ebuild (squid-3.0.13.diff,562 bytes, patch)
2009-04-17 21:15 UTC, Bertrand Jacquin
Details | Diff
build cf_gen with HOSTCC (squid-3.0.13-BJA-cf_gen-HOSTCXX.diff,992 bytes, patch)
2009-04-22 20:49 UTC, Bertrand Jacquin
Details | Diff
net-proxy/squid-3.0.13.ebuild.diff (squid-3.0.13.diff,504 bytes, patch)
2009-04-22 20:50 UTC, Bertrand Jacquin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Jacquin 2009-04-17 21:12:44 UTC
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.

Patch have been reported upstream.


Reproducible: Always

Steps to Reproduce:
1. crossdev -t i586-geode-linux-uclibc
2. emerge-wrapper --init
3. i586-geode-linux-uclibc -vat squid
Comment 1 Bertrand Jacquin 2009-04-17 21:13:32 UTC
Created attachment 188726 [details, diff]
build cf_gen with HOSTCC
Comment 2 Bertrand Jacquin 2009-04-17 21:13:58 UTC
Created attachment 188727 [details, diff]
avoid gcc-4.3 errors
Comment 3 Bertrand Jacquin 2009-04-17 21:15:13 UTC
Created attachment 188728 [details, diff]
net-proxy/squid-3.0.13.ebuild
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-04-17 21:20:11 UTC
*** Bug 266418 has been marked as a duplicate of this bug. ***
Comment 5 Amos Jeffries 2009-04-21 12:32:54 UTC
From upstream:

No sign of the mentioned report arriving.

Anyways...
 + gcc char*/void* fixes merged upstream for next releases.
 - gcc PRId64 fix needs more work for upstream use
    ('long' cast not guaranteed portable)
 - cf_gen requires Makefile.am fix for upstream use

Thank you.
Comment 6 Bertrand Jacquin 2009-04-21 22:01:18 UTC
My email is still in moderation upstream. thanks you for the feeback.
Comment 7 Bertrand Jacquin 2009-04-22 20:49:17 UTC
Created attachment 189192 [details, diff]
build cf_gen with HOSTCC

Second try for HOSTCXX correction, this time it imply src/Makefile.am and configure.in and I think/hope is a bit sexyer.

This doesn't break compatibily with existant.
Comment 8 Bertrand Jacquin 2009-04-22 20:50:25 UTC
Created attachment 189193 [details, diff]
net-proxy/squid-3.0.13.ebuild.diff
Comment 9 Alin Năstac (RETIRED) gentoo-dev 2009-04-25 11:43:21 UTC
Fixed in 3.0.14-r1, thanks!