Skip to content

Commit 4dba278

Browse files
committed
configure, meson: move CPU_CFLAGS out of QEMU_CFLAGS
Flags that choose the target architecture, such as -m32 on x86, affect all invocations of the compiler driver, for example including options such as --print-search-dirs. To ensure that they are treated as such, place them in the cross file in the [binaries] section instead of including them in QEMU_CFLAGS. Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 93ddefb commit 4dba278

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

configure

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ lines: ${BASH_LINENO[*]}"
142142
}
143143

144144
do_cc() {
145-
do_compiler "$cc" "$@"
145+
do_compiler "$cc" $CPU_CFLAGS "$@"
146146
}
147147

148148
do_cxx() {
149-
do_compiler "$cxx" "$@"
149+
do_compiler "$cxx" $CPU_CFLAGS "$@"
150150
}
151151

152152
# Append $2 to the variable named $1, with space separation
@@ -1688,7 +1688,6 @@ esac
16881688

16891689
eval "cross_cc_${cpu}=\$cc"
16901690
cross_cc_vars="$cross_cc_vars cross_cc_${cpu}"
1691-
QEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS"
16921691

16931692
# For user-mode emulation the host arch has to be one we explicitly
16941693
# support, even if we're using TCI.
@@ -5114,9 +5113,9 @@ if test "$skip_meson" = no; then
51145113
echo "c_link_args = [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross
51155114
echo "cpp_link_args = [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross
51165115
echo "[binaries]" >> $cross
5117-
echo "c = [$(meson_quote $cc)]" >> $cross
5118-
test -n "$cxx" && echo "cpp = [$(meson_quote $cxx)]" >> $cross
5119-
test -n "$objcc" && echo "objc = [$(meson_quote $objcc)]" >> $cross
5116+
echo "c = [$(meson_quote $cc $CPU_CFLAGS)]" >> $cross
5117+
test -n "$cxx" && echo "cpp = [$(meson_quote $cxx $CPU_CFLAGS)]" >> $cross
5118+
test -n "$objcc" && echo "objc = [$(meson_quote $objcc $CPU_CFLAGS)]" >> $cross
51205119
echo "ar = [$(meson_quote $ar)]" >> $cross
51215120
echo "nm = [$(meson_quote $nm)]" >> $cross
51225121
echo "pkgconfig = [$(meson_quote $pkg_config_exe)]" >> $cross

0 commit comments

Comments
 (0)