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

Hugo Beauzée-Luyssen hugo at beauzee.fr
Fri Jun 21 17:51:44 CEST 2019


On Wed, Jun 19, 2019, at 1:33 PM, Marvin Scholz wrote:
> 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
> ---
>  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)" \
> -- 
> 2.19.1
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

LGTM, and actually fixes the build for me with a recent llvm-mingw docker image.

Thanks!

-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list