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

Marvin Scholz git at videolan.org
Fri Jun 21 19:57:16 CEST 2019


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Wed Jun 19 13:32:58 2019 +0200| [3426d7bcf98fee15c239ea2b3d815c613df82efe] | committer: Steve Lhomme

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>

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

 contrib/src/main.mak | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 5ad7ff59a8..b6b0d11d51 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -182,8 +182,8 @@ 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)
 
 ifdef ENABLE_PDB
@@ -192,11 +192,9 @@ CXXFLAGS := $(CXXFLAGS) -gcodeview
 endif
 
 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.
@@ -319,13 +317,13 @@ HOSTTOOLS := \
 	PATH="$(PREFIX)/bin:$(PATH)"
 HOSTVARS := $(HOSTTOOLS) \
 	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)"
 
 # For cross-compilation with meson, do not set compiler and flags
@@ -333,7 +331,11 @@ HOSTVARS_PIC := $(HOSTTOOLS) \
 ifdef HAVE_CROSS_COMPILE
 HOSTVARS_MESON := PATH="$(PREFIX)/bin:$(PATH)"
 else
-HOSTVARS_MESON := $(HOSTVARS)
+HOSTVARS_MESON := $(HOSTTOOLS) \
+	CPPFLAGS="$(CPPFLAGS)" \
+	CFLAGS="$(CFLAGS)" \
+	CXXFLAGS="$(CXXFLAGS)" \
+	LDFLAGS="$(LDFLAGS)"
 endif
 
 download_git = \
@@ -596,7 +598,11 @@ endif
 endif
 
 crossfile.meson:
-	$(HOSTVARS) \
+	$(HOSTTOOLS) \
+	CPPFLAGS="$(CPPFLAGS)" \
+	CFLAGS="$(CFLAGS)" \
+	CXXFLAGS="$(CXXFLAGS)" \
+	LDFLAGS="$(LDFLAGS)" \
 	WINDRES="$(WINDRES)" \
 	PKG_CONFIG="$(PKG_CONFIG)" \
 	HOST_SYSTEM="$(MESON_SYSTEM_NAME)" \



More information about the vlc-commits mailing list