diff mbox

[v6,4/6] libselinux: bump to version 2.5

Message ID 1466980753-667-5-git-send-email-Aduskett@gmail.com
State Accepted, archived
Headers show

Commit Message

Adam Duskett June 26, 2016, 10:39 p.m. UTC
In addition, if a user is using glibc 2.22, the default CFLAG
D_FILE_OFFSET_BITS=64 will cause a compile error.  This flag is now
removed from the CFLAGS in the make file to ensure that toolchains
compiled against glibc 2.22 will build the new version of the package
properly.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
Changes v3 - v6:
 - Patch series version bump.

Changes v2 -> v3:
 - Changed logic to use filter-out instead of specifying cflags manually.

Changes v1 -> v2:
 - Reverted depends on in the config file.
 - Added manual cflags.


 package/libselinux/libselinux.hash | 2 +-
 package/libselinux/libselinux.mk   | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

Comments

Yann E. MORIN June 30, 2016, 10:38 p.m. UTC | #1
Adam, All,

On 2016-06-26 18:39 -0400, Adam Duskett spake thusly:
> In addition, if a user is using glibc 2.22, the default CFLAG
> D_FILE_OFFSET_BITS=64 will cause a compile error.  This flag is now
> removed from the CFLAGS in the make file to ensure that toolchains
> compiled against glibc 2.22 will build the new version of the package
> properly.
> 
> Signed-off-by: Adam Duskett <Aduskett@gmail.com>
> ---
[--SNIP--]
> diff --git a/package/libselinux/libselinux.mk b/package/libselinux/libselinux.mk
> index d4b96c4..6f94173 100644
> --- a/package/libselinux/libselinux.mk
> +++ b/package/libselinux/libselinux.mk
> @@ -4,8 +4,8 @@
>  #
>  ################################################################################
>  
> -LIBSELINUX_VERSION = 2.1.13
> -LIBSELINUX_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20130423
> +LIBSELINUX_VERSION = 2.5
> +LIBSELINUX_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20160223
>  LIBSELINUX_LICENSE = Public Domain
>  LIBSELINUX_LICENSE_FILES = LICENSE
>  
> @@ -13,8 +13,10 @@ LIBSELINUX_DEPENDENCIES = libsepol pcre
>  
>  LIBSELINUX_INSTALL_STAGING = YES
>  
> +# Filter out D_FILE_OFFSET_BITS=64. This fixes errors caused by glibc 2.22.
>  LIBSELINUX_MAKE_OPTS = \
>  	$(TARGET_CONFIGURE_OPTS) \
> +	CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \

I was a bit unsure about that one. Discussing with Thomas just confirmed
what I was thinking: this means that this package will not be able to
use 64-bit offset, and thus won't be able to deal with files greater
than 2GiB in size.

On the other hand, this program can *not* handle such files anyway,
since fts in not 64-bit aware anyway.

And we are already using this kind of hack in other packages.

So:

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

>  	LDFLAGS="$(TARGET_LDFLAGS) -lpcre -lpthread" \
>  	ARCH=$(KERNEL_ARCH)
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Thomas Petazzoni July 1, 2016, 9:10 a.m. UTC | #2
Hello,

On Sun, 26 Jun 2016 18:39:11 -0400, Adam Duskett wrote:
> In addition, if a user is using glibc 2.22, the default CFLAG
> D_FILE_OFFSET_BITS=64 will cause a compile error.  This flag is now
> removed from the CFLAGS in the make file to ensure that toolchains
> compiled against glibc 2.22 will build the new version of the package
> properly.
> 
> Signed-off-by: Adam Duskett <Aduskett@gmail.com>
> ---
> Changes v3 - v6:
>  - Patch series version bump.

fts() is only available in glibc:

 - It is not available at all in musl

 - It is only available optionally in uClibc, and our default uClibc
   configuration does not have it enabled.

Since it's anyway not available in musl, I've decided to add a
dependency of libselinux on glibc.

In addition, I've sent a mail to the SELinux guys to ask them to move
from the fts() interface to the POSIX-compliant nftw() interface. Of
course, if you are interested in submitting a patch that changes
libselinux to use nftw() instead of fts(), it would be more than
welcome.

Applied with the glibc dependency added (and propagated to all
libselinux reverse dependencies). Thanks!

Thomas
diff mbox

Patch

diff --git a/package/libselinux/libselinux.hash b/package/libselinux/libselinux.hash
index 861c327..a4c3440 100644
--- a/package/libselinux/libselinux.hash
+++ b/package/libselinux/libselinux.hash
@@ -1,2 +1,2 @@ 
 # Locally computed
-sha256 57aad47c06b7ec18a76e8d9870539277a84cb40109cfdcf70ed3260bdb04447a libselinux-2.1.13.tar.gz
+sha256 94c9e97706280bedcc288f784f67f2b9d3d6136c192b2c9f812115edba58514f libselinux-2.5.tar.gz
diff --git a/package/libselinux/libselinux.mk b/package/libselinux/libselinux.mk
index d4b96c4..6f94173 100644
--- a/package/libselinux/libselinux.mk
+++ b/package/libselinux/libselinux.mk
@@ -4,8 +4,8 @@ 
 #
 ################################################################################
 
-LIBSELINUX_VERSION = 2.1.13
-LIBSELINUX_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20130423
+LIBSELINUX_VERSION = 2.5
+LIBSELINUX_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20160223
 LIBSELINUX_LICENSE = Public Domain
 LIBSELINUX_LICENSE_FILES = LICENSE
 
@@ -13,8 +13,10 @@  LIBSELINUX_DEPENDENCIES = libsepol pcre
 
 LIBSELINUX_INSTALL_STAGING = YES
 
+# Filter out D_FILE_OFFSET_BITS=64. This fixes errors caused by glibc 2.22.
 LIBSELINUX_MAKE_OPTS = \
 	$(TARGET_CONFIGURE_OPTS) \
+	CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \
 	LDFLAGS="$(TARGET_LDFLAGS) -lpcre -lpthread" \
 	ARCH=$(KERNEL_ARCH)