Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 413429

Summary: media-libs/opencv: cross-compiling fails due to cmake unable to properly test compiler settings
Product: Gentoo Linux Reporter: SpanKY <vapier>
Component: [OLD] DevelopmentAssignee: Andreas K. Hüttel <dilfridge>
Status: RESOLVED FIXED    
Severity: normal CC: embedded, guileone, kde, morozov.andrey.vmk
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge build log
strace log

Description SpanKY gentoo-dev 2012-04-24 23:07:37 UTC
Created attachment 309977 [details]
emerge build log

i have cross-compile settings like so:
 CHOST=armv7a-cros-linux-gnueabi
 CFLAGS="-O2 -pipe -g -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp"
 CXXFLAGS="${CFLAGS}"

when i emerge opencv for that, it fails.  see the attached log -- this is after adding --trace to cmake-utils.eclass.

i also ran it through strace, and it seems that gcc/g++ is being tested with the target CFLAGS/CXXFLAGS instead of using the compiler values that were setup in the gentoo cmake config override.  i don't know if this is a failing in cmake or opencv, but i'd believe either.

simply adding `tc-export CC CXX` before calling cmake "fixed" things -- the right compilers get tested with the right flags and the build succeeds.
Comment 1 SpanKY gentoo-dev 2012-04-24 23:21:48 UTC
Created attachment 309979 [details]
strace log

log has been edited & truncated to make it fit in the upload limit, but i think you should still be able to pick out the failing pieces
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2013-06-11 21:08:42 UTC
I've added the workaround with tc-export in 2.4.5; I can't see how it would hurt anything. 

If you want a better solution on the long run just re-open the bug please, but I can't really promise anything...
Comment 3 Andreas K. Hüttel archtester gentoo-dev 2013-06-11 21:12:35 UTC
*** Bug 443498 has been marked as a duplicate of this bug. ***