summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini2020-09-23 11:26:15 +0200
committerPaolo Bonzini2020-10-06 08:34:49 +0200
commit5770e8afd629cc8a83dc41e2524258c73c1b301e (patch)
treec912fcfd6231656f52996a14c7460e27c580dd82 /meson.build
parentdtc: Convert Makefile bits to meson bits (diff)
downloadqemu-5770e8afd629cc8a83dc41e2524258c73c1b301e.tar.gz
qemu-5770e8afd629cc8a83dc41e2524258c73c1b301e.tar.xz
qemu-5770e8afd629cc8a83dc41e2524258c73c1b301e.zip
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>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build3
1 files changed, 2 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 0b8ec210f0..8904f7d79b 100644
--- a/meson.build
+++ b/meson.build
@@ -1771,7 +1771,8 @@ if targetos == 'darwin'
summary_info += {'Objective-C compiler': meson.get_compiler('objc').cmd_array()[0]}
endif
summary_info += {'ARFLAGS': config_host['ARFLAGS']}
-summary_info += {'CFLAGS': config_host['CFLAGS']}
+summary_info += {'CFLAGS': '-O' + get_option('optimization')
+ + (get_option('debug') ? ' -g' : '')}
summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']}
summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']}
summary_info += {'make': config_host['MAKE']}