]> xenbits.xensource.com Git - people/liuw/stubdom.git/commitdiff
stubdom: fix -Wextra usage in vtpm_emulator
authorOlaf Hering <olaf@aepfle.de>
Tue, 22 Jul 2014 07:19:17 +0000 (09:19 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 24 Jul 2014 15:23:18 +0000 (16:23 +0100)
If -Wextra is appended to CFLAGS it will enable all warnings. Previous
options such as -Wno-unused-parameters have no effect anymore. As a
result compilation will fail with gcc-4.3. Newer versions of gcc will
appearently remember -Wno-* options before -Wextra.
Rearrange warning options for gcc so that -Wextra comes before other -W
options. This fixes compilation of stubdom in SLES11.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Makefile
vtpm-cmake-Wextra.patch [new file with mode: 0644]

index c41de274867b270437dd0b7be24079d01d11d6df..6bea68b1d381cca3c7c38ed83d0b4fb8562cb855 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -210,6 +210,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
        patch -d $@ -p1 < vtpm-locality.patch
        patch -d $@ -p1 < vtpm-parent-sign-ek.patch
        patch -d $@ -p1 < vtpm-deepquote.patch
+       patch -d $@ -p1 < vtpm-cmake-Wextra.patch
        mkdir $@/build
        cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
        touch $@
diff --git a/vtpm-cmake-Wextra.patch b/vtpm-cmake-Wextra.patch
new file mode 100644 (file)
index 0000000..a603654
--- /dev/null
@@ -0,0 +1,21 @@
+---
+ CMakeLists.txt |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: tpm_emulator-x86_64/CMakeLists.txt
+===================================================================
+--- tpm_emulator-x86_64.orig/CMakeLists.txt
++++ tpm_emulator-x86_64/CMakeLists.txt
+@@ -40,10 +40,11 @@ set(TPM_STORAGE_NAME "/var/lib/tpm/tpm_e
+ set(TPM_DEVICE_NAME "/dev/tpm")
+ endif()
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+-add_definitions(-Wall -Werror -Wno-unused-parameter -Wpointer-arith -Wcast-align -Wwrite-strings)
++add_definitions(-Wall -Werror)
+ if("${CMAKE_SYSTEM}" MATCHES "Linux")
+     add_definitions(-Wextra)
+ endif()
++add_definitions(-Wno-unused-parameter -Wpointer-arith -Wcast-align -Wwrite-strings)
+ if(USE_OPENSSL)
+     add_definitions(-DUSE_OPENSSL)
+ endif()