Skip to content
Snippets Groups Projects
Commit bd553fbb authored by Martin Storsjö's avatar Martin Storsjö Committed by Jean-Baptiste Kempf
Browse files

contrib: lame: Don't use -mtune=native/-march=native

When building a distribution package, tuning specifically for the
system building it is pointless. (If we want to tune specifically
for something else than the compiler's default, we should specify
that and not rely on it being implied from the system doing the
compilation.)

When cross compiling VLC for x86 from a non-x86 system, -mtune=native
and -march=native cause compiler errors (in practice, e.g. for
i686-w64-mingw32 targets built on aarch64, GCC doesn't mind
-mtune=native but errors out for -march=native, while Clang errors
out for -mtune=native too).

This generalizes an existing fix, getting rid of more cases of
-mtune=native/-march=native, applying it for any target, not only
darwin, fixing cross compilation for i686 mingw from aarch64 linux.
parent ee53dc56
No related branches found
No related tags found
Loading
Pipeline #114114 passed with stage
in 21 minutes and 7 seconds
diff -ru lame/configure.in lame/configure.in
--- lame/configure.in 2021-05-07 10:51:04.000000000 +0200
+++ lame-fixed/configure.in 2021-05-07 10:51:26.000000000 +0200
@@ -935,7 +935,7 @@
-mtune=native"
--- lame/configure.in.orig 2021-07-03 17:02:42.240179812 +0300
+++ lame/configure.in 2021-07-03 17:07:38.366445785 +0300
@@ -927,16 +927,12 @@
OPTIMIZATION="${OPTIMIZATION} -march=i486"
;;
*586)
- OPTIMIZATION="${OPTIMIZATION} -march=i586 \
- -mtune=native"
+ OPTIMIZATION="${OPTIMIZATION} -march=i586"
;;
*686)
- OPTIMIZATION="${OPTIMIZATION} -march=i686 \
- -mtune=native"
+ OPTIMIZATION="${OPTIMIZATION} -march=i686"
;;
*86)
- OPTIMIZATION="${OPTIMIZATION} -march=native \
+ OPTIMIZATION="${OPTIMIZATION} -march=i386 \
-mtune=native"
- -mtune=native"
;;
arm*-gnueabi)
@@ -986,7 +986,7 @@
-mtune=native"
if [ -z "$(echo ${GCC_version} | awk '/4\.0/')" ]; then
@@ -978,16 +974,12 @@
OPTIMIZATION="${OPTIMIZATION} -march=i486"
;;
*586)
- OPTIMIZATION="${OPTIMIZATION} -march=i586 \
- -mtune=native"
+ OPTIMIZATION="${OPTIMIZATION} -march=i586"
;;
*686)
- OPTIMIZATION="${OPTIMIZATION} -march=i686 \
- -mtune=native"
+ OPTIMIZATION="${OPTIMIZATION} -march=i686"
;;
*86)
- OPTIMIZATION="${OPTIMIZATION} -march=native \
+ OPTIMIZATION="${OPTIMIZATION} -march=i386 \
-mtune=native"
- -mtune=native"
;;
esac
......@@ -20,9 +20,7 @@ lame: lame-$(LAME_VERSION).tar.gz .sum-lame
ifdef HAVE_VISUALSTUDIO
$(APPLY) $(SRC)/lame/struct-float-copy.patch
endif
ifdef HAVE_DARWIN_OS
$(APPLY) $(SRC)/lame/lame-fix-i386-on-aarch64.patch
endif
# Avoid relying on iconv.m4 from gettext, when reconfiguring.
# This is only used by the frontend which we disable.
cd $(UNPACK_DIR) && sed -i.orig 's/^AM_ICONV/#&/' configure.in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment