diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-11-16 18:35:27 +0100 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2012-11-18 19:19:23 +0000 |
commit | 3bc2f570ec9fc930619a8ef26a22dd6d03c25dac (patch) | |
tree | ec92ca7ecc6b9da1c5c8f18e52e6498e42908f50 /osdep.c | |
parent | 2c5c4451e69a69c0fad3303c25cc7eaad6950f79 (diff) |
build: replace weak symbols with a static library
Weak symbols were a nice idea, but they turned out not to be a good one.
Toolchain support is just too sparse, in particular llvm-gcc is totally
broken.
This patch uses a surprisingly low-tech approach: a static library.
Symbols in a static library are always overridden by symbols in an
object file. Furthermore, if you place each function in a separate
source file, object files for unused functions will not be taken in.
This means that each function can use all the dependencies that it needs
(especially QAPI stuff such as error_setg).
Thus, all stubs are placed in separate object files and put together in
a static library. The library then is linked to all programs.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'osdep.c')
-rw-r--r-- | osdep.c | 32 |
1 files changed, 0 insertions, 32 deletions
@@ -54,38 +54,6 @@ static bool fips_enabled = false; static const char *qemu_version = QEMU_VERSION; -static int default_fdset_get_fd(int64_t fdset_id, int flags) -{ - return -1; -} -QEMU_WEAK_ALIAS(monitor_fdset_get_fd, default_fdset_get_fd); -#define monitor_fdset_get_fd \ - QEMU_WEAK_REF(monitor_fdset_get_fd, default_fdset_get_fd) - -static int default_fdset_dup_fd_add(int64_t fdset_id, int dup_fd) -{ - return -1; -} -QEMU_WEAK_ALIAS(monitor_fdset_dup_fd_add, default_fdset_dup_fd_add); -#define monitor_fdset_dup_fd_add \ - QEMU_WEAK_REF(monitor_fdset_dup_fd_add, default_fdset_dup_fd_add) - -static int default_fdset_dup_fd_remove(int dup_fd) -{ - return -1; -} -QEMU_WEAK_ALIAS(monitor_fdset_dup_fd_remove, default_fdset_dup_fd_remove); -#define monitor_fdset_dup_fd_remove \ - QEMU_WEAK_REF(monitor_fdset_dup_fd_remove, default_fdset_dup_fd_remove) - -static int default_fdset_dup_fd_find(int dup_fd) -{ - return -1; -} -QEMU_WEAK_ALIAS(monitor_fdset_dup_fd_find, default_fdset_dup_fd_find); -#define monitor_fdset_dup_fd_find \ - QEMU_WEAK_REF(monitor_fdset_dup_fd_remove, default_fdset_dup_fd_find) - int socket_set_cork(int fd, int v) { #if defined(SOL_TCP) && defined(TCP_CORK) |