[vlc-commits] contrib: Do not pass debug/optim flags to meson

Marvin Scholz git at videolan.org
Thu Mar 26 11:29:08 CET 2020


vlc/vlc-3.0 | branch: master | Marvin Scholz <epirat07 at gmail.com> | Wed Jun 19 13:32:58 2019 +0200| [a22ce65307be4713e2fb29d71b559ac50b24ab80] | committer: Hugo Beauzée-Luyssen

contrib: Do not pass debug/optim flags to meson

This fixes the meson underscore prefix test, which misbehaves
when -g is passed, as it would detect the debug string without
underscore first and incorrectly report that no underscore
prefix for symbols is used.

Fixes build issues with dav1d, which relies on the underscore
prefix check.

See: https://github.com/mesonbuild/meson/issues/5482
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
(cherry picked from commit 3426d7bcf98fee15c239ea2b3d815c613df82efe)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=a22ce65307be4713e2fb29d71b559ac50b24ab80
---

 contrib/src/main.mak | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index cbd7a2eba8..f8db7d7656 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -165,16 +165,14 @@ cppcheck = $(shell $(CC) $(CFLAGS) -E -dM - < /dev/null | grep -E $(1))
 
 EXTRA_CFLAGS += -I$(PREFIX)/include
 CPPFLAGS := $(CPPFLAGS) $(EXTRA_CFLAGS)
-CFLAGS := $(CFLAGS) $(EXTRA_CFLAGS) -g
-CXXFLAGS := $(CXXFLAGS) $(EXTRA_CFLAGS) $(EXTRA_CXXFLAGS) -g
+CFLAGS := $(CFLAGS) $(EXTRA_CFLAGS)
+CXXFLAGS := $(CXXFLAGS) $(EXTRA_CFLAGS) $(EXTRA_CXXFLAGS)
 LDFLAGS := $(LDFLAGS) -L$(PREFIX)/lib $(EXTRA_LDFLAGS)
 
 ifndef WITH_OPTIMIZATION
-CFLAGS := $(CFLAGS) -O0
-CXXFLAGS := $(CXXFLAGS) -O0
+DBGOPTIMFLAGS = -g -O0
 else
-CFLAGS := $(CFLAGS) -O2
-CXXFLAGS := $(CXXFLAGS) -O2
+DBGOPTIMFLAGS = -g -O2
 endif
 
 # Do not export those! Use HOSTVARS.
@@ -291,18 +289,26 @@ HOSTTOOLS := \
 	PATH="$(PREFIX)/bin:$(PATH)"
 HOSTVARS := \
 	CPPFLAGS="$(CPPFLAGS)" \
-	CFLAGS="$(CFLAGS)" \
-	CXXFLAGS="$(CXXFLAGS)" \
+	CFLAGS="$(CFLAGS) $(DBGOPTIMFLAGS)" \
+	CXXFLAGS="$(CXXFLAGS) $(DBGOPTIMFLAGS)" \
 	LDFLAGS="$(LDFLAGS)"
 HOSTVARS_PIC := $(HOSTTOOLS) \
 	CPPFLAGS="$(CPPFLAGS) $(PIC)" \
-	CFLAGS="$(CFLAGS) $(PIC)" \
-	CXXFLAGS="$(CXXFLAGS) $(PIC)" \
+	CFLAGS="$(CFLAGS) $(DBGOPTIMFLAGS) $(PIC)" \
+	CXXFLAGS="$(CXXFLAGS) $(DBGOPTIMFLAGS) $(PIC)" \
 	LDFLAGS="$(LDFLAGS)"
 
 # Keep a version of HOSTVARS without the tools, since meson requires the
 # tools variables to point to the native ones
-HOSTVARS_MESON := $(HOSTVARS)
+ifdef HAVE_CROSS_COMPILE
+HOSTVARS_MESON := PATH="$(PREFIX)/bin:$(PATH)"
+else
+HOSTVARS_MESON := $(HOSTTOOLS) \
+	CPPFLAGS="$(CPPFLAGS)" \
+	CFLAGS="$(CFLAGS)" \
+	CXXFLAGS="$(CXXFLAGS)" \
+	LDFLAGS="$(LDFLAGS)"
+endif
 HOSTVARS := $(HOSTTOOLS) $(HOSTVARS)
 
 download_git = \



More information about the vlc-commits mailing list