configure: do not clobber environment CFLAGS/CXXFLAGS/LDFLAGS
commit5770e8afd629cc8a83dc41e2524258c73c1b301e
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 23 Sep 2020 09:26:15 +0000 (23 05:26 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 6 Oct 2020 06:34:49 +0000 (6 08:34 +0200)
treec912fcfd6231656f52996a14c7460e27c580dd82
parentfbb4121d5921feecf07751a6351c69fa46798596
configure: do not clobber environment CFLAGS/CXXFLAGS/LDFLAGS

If the CFLAGS, CXXFLAGS or LDFLAGS variables are present in the environment,
any modification made within the configure script is passed down to Meson.
This is particularly undesirable for the "-pie" option, since it overrides
"-shared" and thus messes up the linker flags for shared modules.

Using a separate variable therefore fixes the bug, while clarifying that
the scope of these CFLAGS is just the configure script.

We also do not need to pass those variables in config-host.mak; they
were only used for printing the summary now that all submodules are
built with handwritten Meson rules).  For now synthesize CFLAGS in the
configuration summary, the next patch will also pass them in a cleaner
way using the cross file.

Reported-by: Frederic Bezies
Analyzed-by: Toolybird
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200923092617.1593722-4-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
configure
meson.build