Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 290307 - x11-libs/libXt-1.0.6 fails to crosscompile when CFLAGS contains march or mtune options not valid for the host architecture
Summary: x11-libs/libXt-1.0.6 fails to crosscompile when CFLAGS contains march or mtun...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-23 21:26 UTC by Andrei Slavoiu
Modified: 2009-11-09 10:06 UTC (History)
0 users

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


Attachments
libXt-1.0.6.ebuild.patch (libXt-1.0.6.ebuild.patch,397 bytes, patch)
2009-10-23 21:46 UTC, Andrei Slavoiu
Details | Diff
build.log (build.log,9.08 KB, text/plain)
2009-11-05 21:53 UTC, Andrei Slavoiu
Details
libXt-1.0.7-r1-build_dir.tar.bz2 (libXt-1.0.7-r1-build_dir.tar.bz2,760.08 KB, application/x-bzip2)
2009-11-07 09:26 UTC, Andrei Slavoiu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Slavoiu 2009-10-23 21:26:09 UTC
make -j5 --load-average=8                                                                                                                      
make  all-recursive                                                                                                                            
make[1]: Entering directory `/var/tmp/portage/x11-libs/libXt-1.0.6/work/libXt-1.0.6'                                                           
Making all in util                                                                                                                             
make[2]: Entering directory `/var/tmp/portage/x11-libs/libXt-1.0.6/work/libXt-1.0.6/util'                                                      
gcc -DHAVE_CONFIG_H -I. -I..    -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -I/usr/armv4tl-softfloat-linux-gnueabi/usr/include    -march=armv4t -mtune=arm920t -Os -pipe -MT makestrs-makestrs.o -MD -MP -MF .deps/makestrs-makestrs.Tpo -c -o makestrs-makestrs.o `test -f 'makestrs.c' || echo './'`makestrs.c                                                                                                                   
sed -e 's|__xorgversion__|"libXt 1.0.6" "X Version 11"|' < makestrs.man > makestrs.1                                                           
makestrs.c:1: error: bad value (armv4t) for -march= switch                                                                                     
makestrs.c:1: error: bad value (arm920t) for -mtune= switch                                                                                    
make[2]: *** [makestrs-makestrs.o] Error 1                                                                                                     
make[2]: Leaving directory `/var/tmp/portage/x11-libs/libXt-1.0.6/work/libXt-1.0.6/util'                                                       
make[1]: *** [all-recursive] Error 1                                                                                                           
make[1]: Leaving directory `/var/tmp/portage/x11-libs/libXt-1.0.6/work/libXt-1.0.6'                                                            
make: *** [all] Error 2                                                                                                                        
 * ERROR: x11-libs/libXt-1.0.6 failed:                                                                                                         
 *   emake failed                                                                                                                              

Reproducible: Always

Steps to Reproduce:
Comment 1 Sebastian Luther (few) 2009-10-23 21:29:53 UTC
That looks like you are using a compiler that doesn't know these -march values. Which gcc version do you use?
Comment 2 Andrei Slavoiu 2009-10-23 21:46:28 UTC
Created attachment 208068 [details, diff]
libXt-1.0.6.ebuild.patch

Copy CFLAGS to CFLAGS_FOR_BUILD and filter -march=* and -mtune=* out of it
Comment 3 Andrei Slavoiu 2009-10-23 21:50:17 UTC
(In reply to comment #1)
> That looks like you are using a compiler that doesn't know these -march values.
> Which gcc version do you use?
> 

/usr/portage/x11-libs/libXt/files/libXt-1.0.6-cross.patch adds a hack for this package to use the native compiler for building some tools that are required at build time. And of course my native amd64 compiler does not understand -march values for arm.
Comment 4 Rémi Cardona (RETIRED) gentoo-dev 2009-11-05 11:42:28 UTC
Ok, so I've committed a better patch to 1.0.7-r1 which should work with crossdev-wrappers.

Please _TEST_ it so I can commit the configure patch to upstream and not look like a fool.

Thanks
Comment 5 Andrei Slavoiu 2009-11-05 21:53:50 UTC
Created attachment 209376 [details]
build.log

Build log for x11-libs/libXt-1.0.7-r1. Same problem a before.
Comment 6 Andrei Slavoiu 2009-11-05 21:54:50 UTC
See attachment above.
Comment 7 Rémi Cardona (RETIRED) gentoo-dev 2009-11-05 22:43:21 UTC
What do you use to cross-compile? What command do you run?

Thanks
Comment 8 Andrei Slavoiu 2009-11-06 10:52:44 UTC
(In reply to comment #7)
> What do you use to cross-compile? What command do you run?
> 
> Thanks
> 

I added "=x11-libs/libXt-1.0.7-r1" to /usr/armv4tl-softfloat-linux-gnueabi/etc/portage/package.keywords and then I ran `emerge-armv4tl-softfloat-linux-gnueabi -NDatuv world`. emerge-armv4tl-softfloat-linux-gnueabi is generated by crossdev-wrappers.
Comment 9 Rémi Cardona (RETIRED) gentoo-dev 2009-11-06 14:40:14 UTC
Hum, ok, so something I intended isn't working. Could you tar.bz2 up the libXt build dir from /var/tmp/portage and attach it here (or upload it somewhere else if bugzilla yells)?

It'll be faster that way, instead of going back and forth :)

Thanks
Comment 10 Andrei Slavoiu 2009-11-07 09:26:28 UTC
Created attachment 209515 [details]
libXt-1.0.7-r1-build_dir.tar.bz2
Comment 11 Rémi Cardona (RETIRED) gentoo-dev 2009-11-07 22:26:17 UTC
Could you modify the ebuild like so and run "ebuild libXt-1.0.7-r1.ebuild digest" in the correct directory?

Thanks

--- libXt-1.0.7-r1.ebuild       5 Nov 2009 11:41:08 -0000       1.1
+++ libXt-1.0.7-r1.ebuild       7 Nov 2009 22:04:03 -0000
@@ -29,6 +29,6 @@
        filter-ldflags -Wl,-Bdirect
 
        if tc-is-cross-compiler; then
-               CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
+               export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
        fi
 }
Comment 12 rkan63 2009-11-09 04:21:49 UTC
tried the change as suggested and was successful in cross compiling.
My CFLAGS"-march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe".

Thanks
Comment 13 Rémi Cardona (RETIRED) gentoo-dev 2009-11-09 10:06:10 UTC
Thanks for testing. The patch is now in portage and will soon be in the overlay.

Cheers