summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorPeter Maydell2014-02-26 22:53:30 +0100
committerPeter Maydell2014-03-06 22:26:44 +0100
commit4c288acbd6b9eccb13076103e59a426af3d15030 (patch)
tree36fcc396244295d58562c1c07b76217a3300554a /configure
parentconfigure: Make C++ test work with --enable-werror (diff)
downloadqemu-4c288acbd6b9eccb13076103e59a426af3d15030.tar.gz
qemu-4c288acbd6b9eccb13076103e59a426af3d15030.tar.xz
qemu-4c288acbd6b9eccb13076103e59a426af3d15030.zip
configure: Always build with -fno-common
MacOSX doesn't pull .o files from .a archives if the symbol that it requires is one which the .o file defines as a common symbol. (Common symbols are those declared without "extern"; the linker will merge together common symbols with the same name, so redeclaring the same variable in two compilation units results in them referring to the same symbol rather than a compilation error). This MacOSX difference from traditional linker behaviour means that "make check" produces link errors: Undefined symbols for architecture x86_64: "_cur_mon", referenced from: _error_vprintf in libqemuutil.a(qemu-error.o) _error_printf in libqemuutil.a(qemu-error.o) _error_printf_unless_qmp in libqemuutil.a(qemu-error.o) _error_print_loc in libqemuutil.a(qemu-error.o) _error_report in libqemuutil.a(qemu-error.o) ld: symbol(s) not found for architecture x86_64 in this case because "cur_mon" is a common symbol in libqemustub.a(mon-set-error.o). In QEMU we don't make any use at all of the common symbol functionality, so we can avoid this problem entirely simply by compiling with -fno-common. Enable this option for all builds, not just MacOSX, so that if we ever inadvertently introduce multiple definitions of some variable that will be immediately spotted as a build error rather than only breaking the MacOSX build. Suggested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Message-id: 1393451610-24617-1-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure2
1 files changed, 1 insertions, 1 deletions
diff --git a/configure b/configure
index b5dcfbde85..1212d2dd6c 100755
--- a/configure
+++ b/configure
@@ -400,7 +400,7 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
ARFLAGS="${ARFLAGS-rv}"
# default flags for all hosts
-QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
+QEMU_CFLAGS="-fno-strict-aliasing -fno-common $QEMU_CFLAGS"
QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"