[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/51] configure: create native file with contents of $host_cc
From: |
Paolo Bonzini |
Subject: |
[PULL 23/51] configure: create native file with contents of $host_cc |
Date: |
Thu, 7 Sep 2023 14:59:32 +0200 |
The argument of --host-cc is not obeyed when cross compiling. To avoid
this issue, place it in a configuration file and pass it to meson
with --native-file.
While at it, clarify that --host-cc is not obeyed anyway when _not_
cross compiling, because cc="$host_cc" is placed before --host-cc is
processed.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index 7743c18f2fe..378a0de9fb6 100755
--- a/configure
+++ b/configure
@@ -288,7 +288,7 @@ static="no"
# ${cross_prefix}gcc (if cross-prefix specified)
# system compiler
if test -z "${CC}${cross_prefix}"; then
- cc="$host_cc"
+ cc="cc"
else
cc="${CC-${cross_prefix}gcc}"
fi
@@ -927,8 +927,8 @@ Advanced options (experts only):
-Dmesonoptname=val passthrough option to meson unmodified
--cross-prefix=PREFIX use PREFIX for compile tools, PREFIX can be blank
[$cross_prefix]
--cc=CC use C compiler CC [$cc]
- --host-cc=CC use C compiler CC [$host_cc] for code run at
- build time
+ --host-cc=CC when cross compiling, use C compiler CC for code run
+ at build time [$host_cc]
--cxx=CXX use C++ compiler CXX [$cxx]
--objcc=OBJCC use Objective-C compiler OBJCC [$objcc]
--extra-cflags=CFLAGS append extra C compiler flags CFLAGS
@@ -1892,7 +1892,6 @@ if test "$skip_meson" = no; then
echo "windres = [$(meson_quote $windres)]" >> $cross
echo "windmc = [$(meson_quote $windmc)]" >> $cross
if test "$cross_compile" = "yes"; then
- cross_arg="--cross-file config-meson.cross"
echo "[host_machine]" >> $cross
echo "system = '$targetos'" >> $cross
case "$cpu" in
@@ -1909,6 +1908,14 @@ if test "$skip_meson" = no; then
else
echo "endian = 'little'" >> $cross
fi
+ cross_arg="--cross-file config-meson.cross"
+
+ native="config-meson.native.new"
+ echo "# Automatically generated by configure - do not modify" > $native
+ echo "[binaries]" >> $native
+ echo "c = [$(meson_quote $host_cc)]" >> $native
+ mv $native config-meson.native
+ cross_arg="$cross_arg --native-file config-meson.native"
else
cross_arg="--native-file config-meson.cross"
fi
--
2.41.0
- Re: [PULL 24/51] meson: compile bundled device trees, (continued)
- Re: [PULL 24/51] meson: compile bundled device trees, BALATON Zoltan, 2023/09/08
- Re: [PULL 24/51] meson: compile bundled device trees, Michael Tokarev, 2023/09/08
- Re: [PULL 24/51] meson: compile bundled device trees, BALATON Zoltan, 2023/09/08
- Re: [PULL 24/51] meson: compile bundled device trees, Philippe Mathieu-Daudé, 2023/09/11
- Re: [PULL 24/51] meson: compile bundled device trees, Peter Maydell, 2023/09/11
[PULL 13/51] util/async-teardown.c: move to softmmu/, only build it when system build is requested, Paolo Bonzini, 2023/09/07
[PULL 18/51] contrib/plugins/lockstep: Fix string format, Paolo Bonzini, 2023/09/07
[PULL 19/51] contrib/plugins: add Darwin support, Paolo Bonzini, 2023/09/07
[PULL 22/51] configure: remove HOST_CC, Paolo Bonzini, 2023/09/07
[PULL 26/51] configure: move --enable-debug-tcg to meson, Paolo Bonzini, 2023/09/07
[PULL 23/51] configure: create native file with contents of $host_cc,
Paolo Bonzini <=
[PULL 27/51] contrib/plugins: use an independent makefile, Paolo Bonzini, 2023/09/07
[PULL 30/51] configure, meson: remove CONFIG_SOLARIS from config-host.mak, Paolo Bonzini, 2023/09/07
[PULL 32/51] meson: list leftover CONFIG_* symbols, Paolo Bonzini, 2023/09/07
[PULL 29/51] configure, meson: move --enable-plugins to meson, Paolo Bonzini, 2023/09/07
[PULL 31/51] configure, meson: remove target OS symbols from config-host.mak, Paolo Bonzini, 2023/09/07
[PULL 35/51] mkvenv: assume presence of importlib.metadata, Paolo Bonzini, 2023/09/07
[PULL 34/51] Python: Drop support for Python 3.7, Paolo Bonzini, 2023/09/07
[PULL 33/51] configure: remove dead code, Paolo Bonzini, 2023/09/07
[PULL 39/51] hw/i386/fw_cfg: Include missing 'cpu.h' header, Paolo Bonzini, 2023/09/07
[PULL 38/51] hw/i386/pc: Include missing 'cpu.h' header, Paolo Bonzini, 2023/09/07