summary refs log tree commit diff
path: root/pkgs/os-specific/linux/libselinux
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2016-10-18 23:41:50 +0300
committerTuomas Tynkkynen <tuomas@tuxera.com>2016-10-18 23:54:29 +0300
commitba42683e9afd8f3195d2c9659bb5f9f368ea0560 (patch)
tree988f6446c0e1caa054bdb292b32dfa236d756eeb /pkgs/os-specific/linux/libselinux
parent0240306d01f725a82dfcb6f83d4b9d96ce0b46c8 (diff)
downloadnixpkgs-ba42683e9afd8f3195d2c9659bb5f9f368ea0560.tar
nixpkgs-ba42683e9afd8f3195d2c9659bb5f9f368ea0560.tar.gz
nixpkgs-ba42683e9afd8f3195d2c9659bb5f9f368ea0560.tar.bz2
nixpkgs-ba42683e9afd8f3195d2c9659bb5f9f368ea0560.tar.lz
nixpkgs-ba42683e9afd8f3195d2c9659bb5f9f368ea0560.tar.xz
nixpkgs-ba42683e9afd8f3195d2c9659bb5f9f368ea0560.tar.zst
nixpkgs-ba42683e9afd8f3195d2c9659bb5f9f368ea0560.zip
libselinux: Fix ARM build failure
Avoid this warning (which is in turn an error via -Werror):
````
avc_internal.c: In function 'avc_netlink_receive':
avc_internal.c:105:25: error: cast increases required alignment of target type [-Werror=cast-align]
 struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
                        ^
````

The code allocates abuffer with "__attribute__ ((aligned))",
then passes it via a 'char*' parameter, which is then finally cast,
causing the warning. So the code is ok but compiler is not smart
enough to see it.

It seems that -Wcast-align is a no-op on x86, so this shows up on ARM
only.
Diffstat (limited to 'pkgs/os-specific/linux/libselinux')
-rw-r--r--pkgs/os-specific/linux/libselinux/default.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/libselinux/default.nix b/pkgs/os-specific/linux/libselinux/default.nix
index 1327a349474..c7da0fcca2a 100644
--- a/pkgs/os-specific/linux/libselinux/default.nix
+++ b/pkgs/os-specific/linux/libselinux/default.nix
@@ -19,7 +19,13 @@ stdenv.mkDerivation rec {
   buildInputs = [ pkgconfig libsepol pcre ]
              ++ optionals enablePython [ swig python ];
 
-  NIX_CFLAGS_COMPILE = "-fstack-protector-all -std=gnu89";
+  # Avoid this false warning:
+  # avc_internal.c: In function 'avc_netlink_receive':
+  # avc_internal.c:105:25: error: cast increases required alignment of target type [-Werror=cast-align]
+  #  struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
+  #                         ^
+
+  NIX_CFLAGS_COMPILE = "-std=gnu89 -Wno-error=cast-align";
 
   # Unreleased upstream patch that fixes Python package issue arising
   # from recent SWIG changes.