cross-compilation with scratchbox is broken

Bug #889495 reported by Miika Komu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HIPL
Fix Committed
Undecided
Unassigned

Bug Description

Autobuilder cought a problem with scratchbox compilation (see the log below). It appears that -z muldefs option has broken this in revision 6122.

branch: trunk
revision: 6129
configuration: Scratchbox ARM crosscompile
command: /opt/scratchbox/login -d hipl-[0-9.]* make deb
compiler output:

./packaging/create-package.sh deb
......
  CC test/firewall/rewrite.o
gcc -DHAVE_CONFIG_H -I. -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=500 -std=c99 -Wall -Wextra -Werror -Wredundant-decls -Wdisabled-optimization -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wno-deprecated-declarations -Wpointer-arith -Wwrite-strings -Wshadow -Winline -Wcast-qual -Wno-missing-field-initializers -fno-strict-aliasing -g -O2 -c -o test/firewall/rewrite.o test/firewall/rewrite.c
  CCLD test/check_firewall
sbox-arm-none-linux-gnueabi-gcc: muldefs: No such file or directory
make[4]: *** [test/check_firewall] Error 1
make[4]: Leaving directory `/home/pisa.auto/hipl-1.0.6'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/home/pisa.auto/hipl-1.0.6'
make[2]: *** [check] Error 2
make[2]: Leaving directory `/home/pisa.auto/hipl-1.0.6'
dh_auto_test: make -j1 check returned exit code 2
make[1]: *** [build] Error 9
make[1]: Leaving directory `/home/pisa.auto/hipl-1.0.6'
make: *** [deb] Error 2

Revision history for this message
Miika Komu (miika-iki) wrote :

Workaround from Rene:

=== modified file 'debian/rules'
--- debian/rules 2011-02-15 17:48:50 +0000
+++ debian/rules 2011-11-12 13:13:17 +0000
@@ -13,4 +13,4 @@
  dh $@ --parallel

 override_dh_pysupport:
-
+override_dh_auto_test:

Revision history for this message
Christof Mroz (christof-mroz) wrote :

Just guessing: does GCC try to consume LDFLAGS itself?
Because for some flags, like -l, this works automagically while for "-z muldefs" I think you'd need to specify '-Wl,-z muldefs' (as one parameter).

http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

Revision history for this message
Christof Mroz (christof-mroz) wrote : Re: [hipl-dev] Re: [Bug 889495] Re: cross-compilation with scratchbox is broken

On 12.11.2011 16:06, René Hummen wrote:
> On 12.11.2011, at 15:48, Christof Mroz wrote:
>> Just guessing: does GCC try to consume LDFLAGS itself?
>> Because for some flags, like -l, this works automagically while for "-z muldefs" I think you'd need to specify '-Wl,-z muldefs' (as one parameter).
>>
>> http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
>
> Seems like it. Anyway, if you are suggesting the following patch, that does not work:
> === modified file 'Makefile.am'
> --- Makefile.am 2011-11-11 17:15:35 +0000
> +++ Makefile.am 2011-11-12 15:02:27 +0000
> @@ -247,7 +247,7 @@
>
> ### dynamic library dependencies ###
>
> -test_check_firewall_LDFLAGS = -ldl -z muldefs
> +test_check_firewall_LDFLAGS = -ldl -Wl,-z muldefs

Yes, because AFAIK the linker does not understand -Wl. As I said, -l is
special in that both gcc and ld understand it, so it would explain why
-ldl doesn't seem to cause problems in the cross-compile config.

But without more debug output of the cross-compile config (at least the
exact executed command line that actually contains "-z muldefs") this is
just guesswork.

Revision history for this message
Diego Biurrun (diego-biurrun) wrote : Re: [hipl-dev] [Bug 889495] Re: cross-compilation with scratchbox is broken

On Sat, Nov 12, 2011 at 02:48:01PM +0000, Christof Mroz wrote:
> Just guessing: does GCC try to consume LDFLAGS itself?
> Because for some flags, like -l, this works automagically while for
> "-z muldefs" I think you'd need to specify '-Wl,-z muldefs' (as one
> parameter).
>
> http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

You slightly misunderstood the syntax description there. You have to
replace spaces in the option by commas, i.e. 'Wl,-z,muldefs' and not
'Wl,-z muldefs'.

Unfortunately the regression tests still fail in another place.

Diego

Revision history for this message
René Hummen (rene-hummen) wrote :

Yes, they still fail. However, this is due to a different bug: https://bugs.launchpad.net/hipl/+bug/889491

Changed in hipl:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.