[vlc-commits] [Git][videolan/vlc][master] contrib: lame: Don't use -mtune=native/-march=native

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Jul 5 21:29:04 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
bd553fbb by Martin Storsjö at 2021-07-05T19:24:14+00:00
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.

- - - - -


2 changed files:

- contrib/src/lame/lame-fix-i386-on-aarch64.patch
- contrib/src/lame/rules.mak


Changes:

=====================================
contrib/src/lame/lame-fix-i386-on-aarch64.patch
=====================================
@@ -1,21 +1,40 @@
-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
+ 


=====================================
contrib/src/lame/rules.mak
=====================================
@@ -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



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bd553fbb542ec3e5bbab0aac94b03a893af819a6

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bd553fbb542ec3e5bbab0aac94b03a893af819a6
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list