[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 07/28] build-sys: must link with -fstack-protecto
From: |
Alon Levy |
Subject: |
[Qemu-devel] [PATCH v3 07/28] build-sys: must link with -fstack-protector |
Date: |
Mon, 22 Apr 2013 18:04:37 +0300 |
From: Marc-André Lureau <address@hidden>
It is needed to give that flag to the linker as well, but latest
libtool 2.4.2 still swallows that argument, so let's pass it with
libtool -Wc argument.
qemu-1.4.0/stubs/arch-query-cpu-def.c:6: undefined reference to
`__stack_chk_guard'
Signed-off-by: Marc-André Lureau <address@hidden>
---
configure | 8 +++++++-
rules.mak | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index ed49f91..dcc4767 100755
--- a/configure
+++ b/configure
@@ -1238,7 +1238,7 @@ fi
gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
$gcc_flags"
gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
-gcc_flags="-fstack-protector-all -Wendif-labels $gcc_flags"
+gcc_flags="-Wendif-labels $gcc_flags"
gcc_flags="-Wno-initializer-overrides $gcc_flags"
# Note that we do not add -Werror to gcc_flags here, because that would
# enable it for all configure tests. If a configure test failed due
@@ -1257,6 +1257,11 @@ for flag in $gcc_flags; do
fi
done
+if compile_prog "-Werror -fstack-protector-all" "" ; then
+ QEMU_CFLAGS="$QEMU_CFLAGS -fstack-protector-all"
+ LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,-fstack-protector-all"
+fi
+
# Workaround for http://gcc.gnu.org/PR55489. Happens with -fPIE/-fPIC and
# large functions that use global variables. The bug is in all releases of
# GCC, but it became particularly acute in 4.6.x and 4.7.x. It is fixed in
@@ -4068,6 +4073,7 @@ else
echo "AUTOCONF_HOST := " >> $config_host_mak
fi
echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
+echo "LIBTOOLFLAGS=$LIBTOOLFLAGS" >> $config_host_mak
echo "LIBS+=$LIBS" >> $config_host_mak
echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
echo "EXESUF=$EXESUF" >> $config_host_mak
diff --git a/rules.mak b/rules.mak
index edc2552..36aba2d 100644
--- a/rules.mak
+++ b/rules.mak
@@ -36,6 +36,7 @@ LINK = $(call quiet-command,\
$(if $(filter %.lo %.la,$^),$(LIBTOOL) --mode=link --tag=CC \
)$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
$(sort $(filter %.o, $1)) $(filter-out %.o, $1) $(version-obj-y) \
+ $(if $(filter %.lo %.la,$^),$(LIBTOOLFLAGS)) \
$(LIBS),$(if $(filter %.lo %.la,$^),"lt LINK ", " LINK
")"$(TARGET_DIR)$@")
endif
--
1.8.2
- [Qemu-devel] [PATCH v3 00/28] ccid and libcacard fixes for windows/mingw, Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 02/28] ccid-card-emul: do not crash if backend is not provided, Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 01/28] libcacard: correct T0 historical bytes size, Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 04/28] ccid: declare DEFAULT_ATR table to be "static const", Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 03/28] ccid: make backend_enum_table "static const" and adjust users, Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 07/28] build-sys: must link with -fstack-protector,
Alon Levy <=
- [Qemu-devel] [PATCH v3 08/28] libcacard: fix mingw64 cross-compilation, Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 06/28] util: move socket_init() to osdep.c, Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 05/28] libcacard: use system config directory for nss db on win32, Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 09/28] libcacard: split vscclient main() from socket reading, Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 13/28] libcacard: remove default libcoolkey loading, Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 12/28] libcacard: remove sql: prefix, Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 11/28] libcacard: teach vscclient to use GMainLoop for portability, Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 15/28] dev-smartcard-reader: nicer debug messages, Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 16/28] dev-smartcard-reader: remove aborts (never triggered, but just in case), Alon Levy, 2013/04/22
- [Qemu-devel] [PATCH v3 17/28] dev-smartcard-reader: support windows guest, Alon Levy, 2013/04/22