[vlc-devel] [PATCH v2 2/2] contrib: Clear HOSTVARS_MESON when cross-compiling
Steve Lhomme
robux4 at ycbcr.xyz
Fri Dec 20 09:02:35 CET 2019
As it is this patch doesn't work. In the current master with Meson
0.51.1 I get this error:
The Meson build system
Version: 0.51.1
Source dir:
/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/contrib/contrib-win64/dav1d
Build dir:
/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/contrib/contrib-win64/dav1d/build
Build type: cross build
WARNING: Unknown options: "win32_ver"
Project name: dav1d
Project version: 0.5.1
Traceback (most recent call last):
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/mesonmain.py",
line 127, in run
return options.run_func(options)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/msetup.py",
line 240, in run
app.generate()
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/msetup.py",
line 158, in generate
self._generate(env)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/msetup.py",
line 174, in _generate
intr = interpreter.Interpreter(b)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/interpreter.py",
line 2070, in __init__
self.parse_project()
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/interpreterbase.py",
line 392, in parse_project
self.evaluate_codeblock(self.ast, end=1)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/interpreterbase.py",
line 431, in evaluate_codeblock
raise e
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/interpreterbase.py",
line 425, in evaluate_codeblock
self.evaluate_statement(cur)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/interpreterbase.py",
line 436, in evaluate_statement
return self.function_call(cur)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/interpreterbase.py",
line 773, in function_call
return func(node, posargs, kwargs)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/interpreterbase.py",
line 143, in wrapped
return f(*wrapped_args, **wrapped_kwargs)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/interpreterbase.py",
line 174, in wrapped
return f(*wrapped_args, **wrapped_kwargs)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/interpreter.py",
line 2718, in func_project
self.add_languages(proj_langs, True)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/interpreter.py",
line 2777, in add_languages
success = self.add_languages_for(args, required, MachineChoice.BUILD)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/interpreter.py",
line 2791, in add_languages_for
comp = self.environment.detect_compiler_for(lang, for_machine)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/environment.py",
line 1159, in detect_compiler_for
comp = self.compiler_from_language(lang, for_machine)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/environment.py",
line 1131, in compiler_from_language
comp = self.detect_c_compiler(for_machine)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/environment.py",
line 817, in detect_c_compiler
return self._detect_c_or_cpp_compiler('c', for_machine)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/environment.py",
line 651, in _detect_c_or_cpp_compiler
compilers, ccache, exe_wrap = self._get_compilers(lang, for_machine)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/environment.py",
line 625, in _get_compilers
compilers, ccache = BinaryTable.parse_entry(value)
File
"/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/extras/tools/meson/mesonbuild/envconfig.py",
line 314, in parse_entry
if compiler[0] == 'ccache':
IndexError: list index out of range
make: *** [../../../../vlc/contrib/src/dav1d/rules.mak:31: .dav1d] Error 2
With 0.52.1 I get this:
The Meson build system
Version: 0.52.1
Source dir:
/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/contrib/contrib-win64/libplacebo
Build dir:
/mnt/c/Users/robux/Documents/Programs/Videolabs/build/win64-pdb/contrib/contrib-win64/libplacebo/build
Build type: cross build
Project name: libplacebo
Project version: 1.18.0
C compiler for the build machine: cc (gcc 7.4.0 "cc (Debian 7.4.0-4) 7.4.0")
C linker for the build machine: GNU ld.bfd 2.31.1meson.build:1:0: ERROR:
Unknown linker(s): [[]]
The follow exceptions were encountered:
Running "--version" gave "[Errno 2] No such file or directory:
'--version': '--version'"
It works fine without the CC="" CXX="" LD="" AR=""
Both in 0.51 and 0.52
On 2019-12-17 15:33, Marvin Scholz wrote:
> ---
> contrib/src/main.mak | 21 +++++++++++----------
> 1 file changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/contrib/src/main.mak b/contrib/src/main.mak
> index 740bf3e336..88069185f1 100644
> --- a/contrib/src/main.mak
> +++ b/contrib/src/main.mak
> @@ -337,16 +337,18 @@ HOSTVARS_PIC := $(HOSTTOOLS) \
> LDFLAGS="$(LDFLAGS)"
>
> # For cross-compilation with meson, do not set compiler and flags
> -# in HOSTVARS as meson will always use them for the BUILD machine compiler!
> -MESON_HOST_FLAGS := \
> - CPPFLAGS="$(CPPFLAGS)" \
> - CFLAGS="$(CFLAGS)" \
> - CXXFLAGS="$(CXXFLAGS)" \
> - LDFLAGS="$(LDFLAGS)"
> +# as meson will always use them for the BUILD machine compiler!
> ifdef HAVE_CROSS_COMPILE
> -HOSTVARS_MESON := PATH="$(PREFIX)/bin:$(PATH)"
> +HOSTVARS_MESON := \
> + CC="" CXX="" LD="" \
> + AR="" CCAS="" RANLIB="" STRIP="" \
> + PATH="$(PREFIX)/bin:$(PATH)" \
> + CPPFLAGS="" \
> + CFLAGS="" \
> + CXXFLAGS="" \
> + LDFLAGS=""
> else
> -HOSTVARS_MESON := $(HOSTTOOLS) $(MESON_HOST_FLAGS)
> +HOSTVARS_MESON := $(HOSTVARS)
> endif
>
> download_git = \
> @@ -648,8 +650,7 @@ endif
> endif
>
> crossfile.meson: $(SRC)/gen-meson-crossfile.py
> - $(HOSTTOOLS) \
> - $(MESON_HOST_FLAGS) \
> + $(HOSTVARS) \
> WINDRES="$(WINDRES)" \
> PKG_CONFIG="$(PKG_CONFIG)" \
> HOST_SYSTEM="$(MESON_SYSTEM_NAME)" \
> --
> 2.20.1 (Apple Git-117)
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list