[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] 4c288a: configure: Always build with -fno-com
From: |
GitHub |
Subject: |
[Qemu-commits] [qemu/qemu] 4c288a: configure: Always build with -fno-common |
Date: |
Thu, 06 Mar 2014 14:00:04 -0800 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: 4c288acbd6b9eccb13076103e59a426af3d15030
https://github.com/qemu/qemu/commit/4c288acbd6b9eccb13076103e59a426af3d15030
Author: Peter Maydell <address@hidden>
Date: 2014-03-06 (Thu, 06 Mar 2014)
Changed paths:
M configure
Log Message:
-----------
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 <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-id: address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-commits] [qemu/qemu] 4c288a: configure: Always build with -fno-common,
GitHub <=