On Fri, 27 Feb 2015, Janne Grunau wrote:

From: Janne Grunau <[email protected]>

---8<---
This is not as nice as one would hope. Another option would be
using a flags filter for -march. That would leave LD in the dark
about crosscompiling though.
I'm also not sure if -arch has the same meaning as -march=. Judging
from the compiler defines it does though:

'clang -arch armv7 -dM -E -x c /dev/null' differs from
'clang -arch armv7s ...'

So this ugly if in probe_cc is the best option I see.

Janne

---
configure | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/configure b/configure
index 59c19a8..7e4f169 100755
--- a/configure
+++ b/configure
@@ -2911,6 +2911,13 @@ probe_cc(){
        _depflags='-MMD -MF $(@:.o=.d) -MT $@'
        _cflags_speed='-O3'
        _cflags_size='-Os'
+       # handle cross compilation for Apple's clang
+       if enabled cross_compile && [ $(expr "$_ident" : "Apple LLVM") = 10 ] ; 
then
+           case $pfx in
+               as|cc|ld) _flags="-arch $arch";;
+               *)        ;;
+           esac
+       fi

FWIW, this breaks existing configure setups (e.g. a setup like "--enable-cross-compile --arch=arm --target-os=darwin --cc='clang -arch armv7 -isysroot /...'" will end up adding an extra -arch arm to the clang command line, which breaks things).

In general though, I do like the patchset, but it'd be nice if it didn't break existing setups.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to