about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/foundationdb/patches/suppress-clang-warnings.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/foundationdb/patches/suppress-clang-warnings.patch')
-rw-r--r--nixpkgs/pkgs/servers/foundationdb/patches/suppress-clang-warnings.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/foundationdb/patches/suppress-clang-warnings.patch b/nixpkgs/pkgs/servers/foundationdb/patches/suppress-clang-warnings.patch
new file mode 100644
index 000000000000..9d1ae992efc9
--- /dev/null
+++ b/nixpkgs/pkgs/servers/foundationdb/patches/suppress-clang-warnings.patch
@@ -0,0 +1,34 @@
+commit 8076537a52bb026941f13f5542395aac69ef0825
+Author: Austin Seipp <aseipp@pobox.com>
+Date:   Sat May 4 17:34:51 2019 -0500
+
+    cmake: add workarounds for NixOS-specific deficiencies [NixOS]
+    
+    The NixOS debug builder hook adds '-Wa,--compress-debug-sections' to the
+    link flags (it actually adds it to the compiler flags, but the compiler
+    is used for linking, so...). This makes the compiler angry when -Werror
+    is passed, because it's unused at link-time (-Wa applies to the
+    assembler). Suppress this warning with -Wno-unused-command-line-argument
+    
+    NB: we *could* use -Wno-error=unused-command-line-argument, but that
+    still results in warnings anyway, just not fatal ones. We'd like to
+    remove them all for the sake of the build output.
+    
+    Signed-off-by: Austin Seipp <aseipp@pobox.com>
+
+diff --git a/cmake/ConfigureCompiler.cmake b/cmake/ConfigureCompiler.cmake
+index 03af9c10..7d059375 100644
+--- a/cmake/ConfigureCompiler.cmake
++++ b/cmake/ConfigureCompiler.cmake
+@@ -119,6 +119,11 @@ else()
+   else()
+     add_compile_options(-Werror)
+   endif()
++  if (CLANG)
++    # aseipp: NixOS hack
++    add_compile_options(-Wno-unused-command-line-argument)
++    add_link_options(-Wno-unused-command-line-argument)
++  endif()
+   add_compile_options($<$<BOOL:${GCC}>:-Wno-pragmas>)
+   add_compile_options(-Wno-error=format
+     -Wunused-variable