From: Mr Dash Four <mr.dash.four@googlemail.com>
To: netfilter@vger.kernel.org
Subject: cross compilation of xtables fails
Date: Fri, 03 Dec 2010 13:54:03 +0000 [thread overview]
Message-ID: <4CF8F67B.8010504@googlemail.com> (raw)
I have tried to compile xtables (1.30) on a x86_64 machine for i686
architecture and that was not successful due to, in my opinion, errors
in the m4-generated gcc statements for compiling/linking when make is
executed. This is the log I get from make which I think causes the error
(./configure passes with flying colours - all dependencies - i686 and
x86_64 alike - are satisfied, I've made sure of that before I began this
process):
gcc -shared -o libxt_CHAOS.so libxt_CHAOS.oo -L/lib -lxtables ;
gcc -shared -o libxt_DELUDE.so libxt_DELUDE.oo -L/lib -lxtables ;
gcc -shared -o libxt_DHCPMAC.so libxt_DHCPMAC.oo -L/lib -lxtables ;
/usr/bin/ld: skipping incompatible /lib/libxtables.so when searching for
-lxtables
/usr/bin/ld: i386 architecture of input file `libxt_CHAOS.oo' is
incompatible with i386:x86-64 output
/usr/bin/ld: final link failed: Invalid operation
collect2: ld returned 1 exit status
make[3]: *** [libxt_CHAOS.so] Error 1
make[3]: *** Waiting for unfinished jobs....
/usr/bin/ld: skipping incompatible /lib/libxtables.so when searching for
-lxtables
/usr/bin/ld: i386 architecture of input file `libxt_DHCPMAC.oo' is
incompatible with i386:x86-64 output
/usr/bin/ld: final link failed: Invalid operation
collect2: ld returned 1 exit status
make[3]: *** [libxt_DHCPMAC.so] Error 1
/usr/bin/ld: skipping incompatible /lib/libxtables.so when searching for
-lxtables
/usr/bin/ld: i386 architecture of input file `libxt_DELUDE.oo' is
incompatible with i386:x86-64 output
/usr/bin/ld: final link failed: Invalid operation
collect2: ld returned 1 exit status
As evident from the above the linker does not like the format of
libxt_CHAOS.so, libxt_DELUDE.so and libxt_DHCPMAC.so as they are for
x86_64 (my build machine architecture).
After examining the above error and investigating further I've noticed
the following: the C/CPPFLAGS I specified during the ./configure process
which are very specific (and vital!) to enable cross compilation (-m32,
-mtune, -march etc) have, seemingly, been ignored for 3 groups of
files/objects:
1. libxt_CHAOS.so, libxt_DELUDE.so, libxt_DHCPMAC.so, libxt_dhcpmac.so,
libxt_IPMARK.so, libxt_LOGMARK.so, libxt_RAWDNAT.so, libxt_RAWSNAT.so,
libxt_STEAL.so, libxt_SYSRQ.so, libxt_TARPIT.so, libxt_condition.so,
libxt_fuzzy.so, libxt_geoip.so, libxt_iface.so, libxt_ipp2p.so,
libxt_ipv4options.so, libxt_length2.so, libxt_lscan.so, libxt_psd.so and
libxt_quota2.so
2. libipset_iphash.so, libipset_ipmap.so, libipset_ipporthash.so,
libipset_ipportiphash.so, libipset_ipportnethash.so, libipset_iptree.so,
libipset_iptreemap.so, libipset_macipmap.so, libipset_nethash.so,
libipset_portmap.so and libipset_setlist.so
3. libxt_pknock.so
Instead of executing gcc with the parameters I specified, for the above
3 groups these are ignored completely and, instead, only the -L
parameter is honoured!
That results in producing object files suitable for the machine on which
xtables is currently compiled (x86_64 in my case) and that is not what I
have requested initially and is the reason why the above errors occur in
my opinion and needs to be corrected
Also, I need to mention that compilation (and linking!) of everything
else is done with the right parameters and passes with flying colours,
so for me, the problem is with the m4 files generating the gcc
statements for make to execute - the full set of flags should be passed
on instead of just '-L'.
next reply other threads:[~2010-12-03 13:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-03 13:54 Mr Dash Four [this message]
2010-12-03 13:58 ` cross compilation of xtables fails Jan Engelhardt
2010-12-03 14:03 ` Mr Dash Four
2010-12-03 14:23 ` Jan Engelhardt
2010-12-03 14:32 ` Mr Dash Four
2010-12-03 14:39 ` Jan Engelhardt
2010-12-03 19:31 ` Mr Dash Four
2010-12-03 19:45 ` Jan Engelhardt
2010-12-03 19:52 ` Mr Dash Four
2010-12-03 19:54 ` Jan Engelhardt
2010-12-03 20:04 ` Mr Dash Four
2010-12-03 20:30 ` Jan Engelhardt
2010-12-03 21:02 ` Mr Dash Four
2010-12-03 21:22 ` Jan Engelhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CF8F67B.8010504@googlemail.com \
--to=mr.dash.four@googlemail.com \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox