All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/libselinux: fix host build
@ 2022-04-24 20:00 Fabrice Fontaine
  2022-04-24 20:00 ` [Buildroot] [PATCH 2/2] package/libselinux: switch to pcre2 Fabrice Fontaine
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2022-04-24 20:00 UTC (permalink / raw)
  To: buildroot; +Cc: Antoine Tenart, Fabrice Fontaine, Marcus Folkesson, Matt Weber

The following build failure is raised since commit
1745fcde740057951dcc5429f3bfabd103b764a1 because
$(HOST_PKG_PYTHON_DISTUTILS_ENV) contains $(HOST_CONFIGURE_OPTS) and so
will override LDFLAGS passed by libselinux.mk:

/usr/bin/gcc -O2 -I/nvmedata/autobuild/instance-11/output-1/host/include -I../include -D_GNU_SOURCE  -DNO_ANDROID_BACKEND  -L/nvmedata/autobuild/instance-11/output-1/host/lib -Wl,-rpath,/nvmedata/autobuild/instance-11/output-1/host/lib -shared -o libselinux.so.1 avc.lo avc_internal.lo avc_sidtab.lo booleans.lo callbacks.lo canonicalize_context.lo checkAccess.lo check_context.lo checkreqprot.lo compute_av.lo compute_create.lo compute_member.lo compute_relabel.lo compute_user.lo context.lo deny_unknown.lo disable.lo enabled.lo fgetfilecon.lo freecon.lo freeconary.lo fsetfilecon.lo get_context_list.lo get_default_type.lo get_initial_context.lo getenforce.lo getfilecon.lo getpeercon.lo init.lo is_customizable_type.lo label.lo label_db.lo label_file.lo label_media.lo label_support.lo label_x.lo lgetfilecon.lo load_policy.lo lsetfilecon.lo mapping.lo matchmediacon.lo matchpathcon.lo policyvers.lo procattr.lo query_user_context.lo regex.lo reject_unknown.lo selinux_check_securetty_context.l
 o selinux_config.lo selinux_restorecon.lo sestatus.lo setenforce.lo setexecfilecon.lo setfilecon.lo setrans_client.lo seusers.lo sha1.lo stringrep.lo validatetrans.lo   -ldl -Wl,-soname,libselinux.so.1,--version-script=libselinux.map,-z,defs,-z,relro
/usr/bin/ld: regex.lo: in function `regex_writef':
regex.c:(.text+0x7c): undefined reference to `pcre_fullinfo'

To fix this build failure, instead of moving LDFLAGS after
$(HOST_PKG_PYTHON_DISTUTILS_ENV), drop LDFLAGS and add host-pkgconf
dependency to retrieve pcre dependencies as pkg-config is supported
since version 3.2 and
https://github.com/SELinuxProject/selinux/commit/74093beab0c605641ec413be81e31e6b2f55d8d4

Dropping LDFLAGS will also drop -lpthread which doesn't seem to raise
any build failures with test-pkg:

                    bootlin-armv5-uclibc [1/6]: OK
                     bootlin-armv7-glibc [2/6]: OK
                   bootlin-armv7m-uclibc [3/6]: SKIPPED
                     bootlin-x86-64-musl [4/6]: OK
                      br-arm-full-static [5/6]: SKIPPED
                            sourcery-arm [6/6]: SKIPPED

Apply the same update to the target variant for consistancy.

Fixes:
 - http://autobuild.buildroot.org/results/d16995f0decef9c9bf58cab4fa30f7daab6918fb

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/libselinux/libselinux.mk | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/package/libselinux/libselinux.mk b/package/libselinux/libselinux.mk
index 5790e79040..c6be8e638a 100644
--- a/package/libselinux/libselinux.mk
+++ b/package/libselinux/libselinux.mk
@@ -10,7 +10,8 @@ LIBSELINUX_LICENSE = Public Domain
 LIBSELINUX_LICENSE_FILES = LICENSE
 LIBSELINUX_CPE_ID_VENDOR = selinuxproject
 
-LIBSELINUX_DEPENDENCIES = $(BR2_COREUTILS_HOST_DEPENDENCY) libsepol pcre
+LIBSELINUX_DEPENDENCIES = \
+	$(BR2_COREUTILS_HOST_DEPENDENCY) host-pkgconf libsepol pcre
 
 LIBSELINUX_INSTALL_STAGING = YES
 
@@ -52,8 +53,7 @@ endif # python3
 # when the python binding is enabled.
 LIBSELINUX_MAKE_OPTS += \
 	CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \
-	CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))" \
-	LDFLAGS="$(TARGET_LDFLAGS) -lpcre -lpthread"
+	CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))"
 
 define LIBSELINUX_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
@@ -76,13 +76,12 @@ define LIBSELINUX_INSTALL_TARGET_CMDS
 endef
 
 HOST_LIBSELINUX_DEPENDENCIES = \
-	host-libsepol host-pcre host-swig host-python3
+	host-pkgconf host-libsepol host-pcre host-swig host-python3
 
 HOST_LIBSELINUX_MAKE_OPTS = \
 	$(HOST_CONFIGURE_OPTS) \
 	PREFIX=$(HOST_DIR) \
 	SHLIBDIR=$(HOST_DIR)/lib \
-	LDFLAGS="$(HOST_LDFLAGS) -lpcre -lpthread" \
 	$(HOST_PKG_PYTHON_DISTUTILS_ENV) \
 	PYTHON=python$(PYTHON3_VERSION_MAJOR)
 
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/2] package/libselinux: switch to pcre2
  2022-04-24 20:00 [Buildroot] [PATCH 1/2] package/libselinux: fix host build Fabrice Fontaine
@ 2022-04-24 20:00 ` Fabrice Fontaine
  2022-04-24 20:57 ` [Buildroot] [PATCH 1/2] package/libselinux: fix host build Yann E. MORIN
  2022-05-27  7:52 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2022-04-24 20:00 UTC (permalink / raw)
  To: buildroot; +Cc: Antoine Tenart, Fabrice Fontaine, Marcus Folkesson, Matt Weber

Switch to pcre2 which is available since version 3.2 and
https://github.com/SELinuxProject/selinux/commit/50f0910cf05bdc1d10710c7c3fb748a178473387
as pcre is EOL

pcre2 is used by default since version 3.4 and
https://github.com/SELinuxProject/selinux/commit/e0da140d82c0ebebf1060ce87d0f11276c7fc59a

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/libselinux/Config.in     |  2 +-
 package/libselinux/libselinux.mk | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/package/libselinux/Config.in b/package/libselinux/Config.in
index 348757abce..3098fe3ea4 100644
--- a/package/libselinux/Config.in
+++ b/package/libselinux/Config.in
@@ -4,7 +4,7 @@ config BR2_PACKAGE_LIBSELINUX
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # libsepol
 	select BR2_PACKAGE_LIBSEPOL
-	select BR2_PACKAGE_PCRE
+	select BR2_PACKAGE_PCRE2
 	select BR2_PACKAGE_MUSL_FTS if !BR2_TOOLCHAIN_USES_GLIBC
 	help
 	  libselinux is the runtime SELinux library that provides
diff --git a/package/libselinux/libselinux.mk b/package/libselinux/libselinux.mk
index c6be8e638a..db35da130f 100644
--- a/package/libselinux/libselinux.mk
+++ b/package/libselinux/libselinux.mk
@@ -11,7 +11,7 @@ LIBSELINUX_LICENSE_FILES = LICENSE
 LIBSELINUX_CPE_ID_VENDOR = selinuxproject
 
 LIBSELINUX_DEPENDENCIES = \
-	$(BR2_COREUTILS_HOST_DEPENDENCY) host-pkgconf libsepol pcre
+	$(BR2_COREUTILS_HOST_DEPENDENCY) host-pkgconf libsepol pcre2
 
 LIBSELINUX_INSTALL_STAGING = YES
 
@@ -20,7 +20,8 @@ LIBSELINUX_INSTALL_STAGING = YES
 LIBSELINUX_MAKE_OPTS = \
 	$(TARGET_CONFIGURE_OPTS) \
 	ARCH=$(NORMALIZED_ARCH) \
-	SHLIBDIR=/usr/lib
+	SHLIBDIR=/usr/lib \
+	USE_PCRE2=y
 
 LIBSELINUX_MAKE_INSTALL_TARGETS = install
 
@@ -76,14 +77,15 @@ define LIBSELINUX_INSTALL_TARGET_CMDS
 endef
 
 HOST_LIBSELINUX_DEPENDENCIES = \
-	host-pkgconf host-libsepol host-pcre host-swig host-python3
+	host-pkgconf host-libsepol host-pcre2 host-swig host-python3
 
 HOST_LIBSELINUX_MAKE_OPTS = \
 	$(HOST_CONFIGURE_OPTS) \
 	PREFIX=$(HOST_DIR) \
 	SHLIBDIR=$(HOST_DIR)/lib \
 	$(HOST_PKG_PYTHON_DISTUTILS_ENV) \
-	PYTHON=python$(PYTHON3_VERSION_MAJOR)
+	PYTHON=python$(PYTHON3_VERSION_MAJOR) \
+	USE_PCRE2=y
 
 define HOST_LIBSELINUX_BUILD_CMDS
 	$(HOST_MAKE_ENV) $(MAKE1) -C $(@D) \
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/libselinux: fix host build
  2022-04-24 20:00 [Buildroot] [PATCH 1/2] package/libselinux: fix host build Fabrice Fontaine
  2022-04-24 20:00 ` [Buildroot] [PATCH 2/2] package/libselinux: switch to pcre2 Fabrice Fontaine
@ 2022-04-24 20:57 ` Yann E. MORIN
  2022-05-27  7:52 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2022-04-24 20:57 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Antoine Tenart, Matt Weber, Marcus Folkesson, buildroot

Fabrice, All,

On 2022-04-24 22:00 +0200, Fabrice Fontaine spake thusly:
> The following build failure is raised since commit
> 1745fcde740057951dcc5429f3bfabd103b764a1 because
> $(HOST_PKG_PYTHON_DISTUTILS_ENV) contains $(HOST_CONFIGURE_OPTS) and so
> will override LDFLAGS passed by libselinux.mk:
> 
> /usr/bin/gcc -O2 -I/nvmedata/autobuild/instance-11/output-1/host/include -I../include -D_GNU_SOURCE  -DNO_ANDROID_BACKEND  -L/nvmedata/autobuild/instance-11/output-1/host/lib -Wl,-rpath,/nvmedata/autobuild/instance-11/output-1/host/lib -shared -o libselinux.so.1 avc.lo avc_internal.lo avc_sidtab.lo booleans.lo callbacks.lo canonicalize_context.lo checkAccess.lo check_context.lo checkreqprot.lo compute_av.lo compute_create.lo compute_member.lo compute_relabel.lo compute_user.lo context.lo deny_unknown.lo disable.lo enabled.lo fgetfilecon.lo freecon.lo freeconary.lo fsetfilecon.lo get_context_list.lo get_default_type.lo get_initial_context.lo getenforce.lo getfilecon.lo getpeercon.lo init.lo is_customizable_type.lo label.lo label_db.lo label_file.lo label_media.lo label_support.lo label_x.lo lgetfilecon.lo load_policy.lo lsetfilecon.lo mapping.lo matchmediacon.lo matchpathcon.lo policyvers.lo procattr.lo query_user_context.lo regex.lo reject_unknown.lo selinux_check_securetty_context
 .l
>  o selinux_config.lo selinux_restorecon.lo sestatus.lo setenforce.lo setexecfilecon.lo setfilecon.lo setrans_client.lo seusers.lo sha1.lo stringrep.lo validatetrans.lo   -ldl -Wl,-soname,libselinux.so.1,--version-script=libselinux.map,-z,defs,-z,relro
> /usr/bin/ld: regex.lo: in function `regex_writef':
> regex.c:(.text+0x7c): undefined reference to `pcre_fullinfo'
> 
> To fix this build failure, instead of moving LDFLAGS after
> $(HOST_PKG_PYTHON_DISTUTILS_ENV), drop LDFLAGS and add host-pkgconf
> dependency to retrieve pcre dependencies as pkg-config is supported
> since version 3.2 and
> https://github.com/SELinuxProject/selinux/commit/74093beab0c605641ec413be81e31e6b2f55d8d4
> 
> Dropping LDFLAGS will also drop -lpthread which doesn't seem to raise
> any build failures with test-pkg:
> 
>                     bootlin-armv5-uclibc [1/6]: OK
>                      bootlin-armv7-glibc [2/6]: OK
>                    bootlin-armv7m-uclibc [3/6]: SKIPPED
>                      bootlin-x86-64-musl [4/6]: OK
>                       br-arm-full-static [5/6]: SKIPPED
>                             sourcery-arm [6/6]: SKIPPED
> 
> Apply the same update to the target variant for consistancy.
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/d16995f0decef9c9bf58cab4fa30f7daab6918fb
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Series of two patches applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  package/libselinux/libselinux.mk | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/package/libselinux/libselinux.mk b/package/libselinux/libselinux.mk
> index 5790e79040..c6be8e638a 100644
> --- a/package/libselinux/libselinux.mk
> +++ b/package/libselinux/libselinux.mk
> @@ -10,7 +10,8 @@ LIBSELINUX_LICENSE = Public Domain
>  LIBSELINUX_LICENSE_FILES = LICENSE
>  LIBSELINUX_CPE_ID_VENDOR = selinuxproject
>  
> -LIBSELINUX_DEPENDENCIES = $(BR2_COREUTILS_HOST_DEPENDENCY) libsepol pcre
> +LIBSELINUX_DEPENDENCIES = \
> +	$(BR2_COREUTILS_HOST_DEPENDENCY) host-pkgconf libsepol pcre
>  
>  LIBSELINUX_INSTALL_STAGING = YES
>  
> @@ -52,8 +53,7 @@ endif # python3
>  # when the python binding is enabled.
>  LIBSELINUX_MAKE_OPTS += \
>  	CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \
> -	CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))" \
> -	LDFLAGS="$(TARGET_LDFLAGS) -lpcre -lpthread"
> +	CPPFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))"
>  
>  define LIBSELINUX_BUILD_CMDS
>  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
> @@ -76,13 +76,12 @@ define LIBSELINUX_INSTALL_TARGET_CMDS
>  endef
>  
>  HOST_LIBSELINUX_DEPENDENCIES = \
> -	host-libsepol host-pcre host-swig host-python3
> +	host-pkgconf host-libsepol host-pcre host-swig host-python3
>  
>  HOST_LIBSELINUX_MAKE_OPTS = \
>  	$(HOST_CONFIGURE_OPTS) \
>  	PREFIX=$(HOST_DIR) \
>  	SHLIBDIR=$(HOST_DIR)/lib \
> -	LDFLAGS="$(HOST_LDFLAGS) -lpcre -lpthread" \
>  	$(HOST_PKG_PYTHON_DISTUTILS_ENV) \
>  	PYTHON=python$(PYTHON3_VERSION_MAJOR)
>  
> -- 
> 2.35.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/libselinux: fix host build
  2022-04-24 20:00 [Buildroot] [PATCH 1/2] package/libselinux: fix host build Fabrice Fontaine
  2022-04-24 20:00 ` [Buildroot] [PATCH 2/2] package/libselinux: switch to pcre2 Fabrice Fontaine
  2022-04-24 20:57 ` [Buildroot] [PATCH 1/2] package/libselinux: fix host build Yann E. MORIN
@ 2022-05-27  7:52 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2022-05-27  7:52 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Antoine Tenart, Matt Weber, Marcus Folkesson, buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > The following build failure is raised since commit
 > 1745fcde740057951dcc5429f3bfabd103b764a1 because
 > $(HOST_PKG_PYTHON_DISTUTILS_ENV) contains $(HOST_CONFIGURE_OPTS) and so
 > will override LDFLAGS passed by libselinux.mk:

 > /usr/bin/gcc -O2 -I/nvmedata/autobuild/instance-11/output-1/host/include -I../include -D_GNU_SOURCE  -DNO_ANDROID_BACKEND  -L/nvmedata/autobuild/instance-11/output-1/host/lib -Wl,-rpath,/nvmedata/autobuild/instance-11/output-1/host/lib -shared -o libselinux.so.1 avc.lo avc_internal.lo avc_sidtab.lo booleans.lo callbacks.lo canonicalize_context.lo checkAccess.lo check_context.lo checkreqprot.lo compute_av.lo compute_create.lo compute_member.lo compute_relabel.lo compute_user.lo context.lo deny_unknown.lo disable.lo enabled.lo fgetfilecon.lo freecon.lo freeconary.lo fsetfilecon.lo get_context_list.lo get_default_type.lo get_initial_context.lo getenforce.lo getfilecon.lo getpeercon.lo init.lo is_customizable_type.lo label.lo label_db.lo label_file.lo label_media.lo label_support.lo label_x.lo lgetfilecon.lo load_policy.lo lsetfilecon.lo mapping.lo matchmediacon.lo matchpathcon.lo policyvers.lo procattr.lo query_user_context.lo regex.lo reject_unknown.lo selinux_check_securetty_contex
 t.l
 >  o selinux_config.lo selinux_restorecon.lo sestatus.lo setenforce.lo setexecfilecon.lo setfilecon.lo setrans_client.lo seusers.lo sha1.lo stringrep.lo validatetrans.lo   -ldl -Wl,-soname,libselinux.so.1,--version-script=libselinux.map,-z,defs,-z,relro
 > /usr/bin/ld: regex.lo: in function `regex_writef':
 > regex.c:(.text+0x7c): undefined reference to `pcre_fullinfo'

 > To fix this build failure, instead of moving LDFLAGS after
 > $(HOST_PKG_PYTHON_DISTUTILS_ENV), drop LDFLAGS and add host-pkgconf
 > dependency to retrieve pcre dependencies as pkg-config is supported
 > since version 3.2 and
 > https://github.com/SELinuxProject/selinux/commit/74093beab0c605641ec413be81e31e6b2f55d8d4

 > Dropping LDFLAGS will also drop -lpthread which doesn't seem to raise
 > any build failures with test-pkg:

 >                     bootlin-armv5-uclibc [1/6]: OK
 >                      bootlin-armv7-glibc [2/6]: OK
 >                    bootlin-armv7m-uclibc [3/6]: SKIPPED
 >                      bootlin-x86-64-musl [4/6]: OK
 >                       br-arm-full-static [5/6]: SKIPPED
 >                             sourcery-arm [6/6]: SKIPPED

 > Apply the same update to the target variant for consistancy.

 > Fixes:
 >  - http://autobuild.buildroot.org/results/d16995f0decef9c9bf58cab4fa30f7daab6918fb

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-27  7:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24 20:00 [Buildroot] [PATCH 1/2] package/libselinux: fix host build Fabrice Fontaine
2022-04-24 20:00 ` [Buildroot] [PATCH 2/2] package/libselinux: switch to pcre2 Fabrice Fontaine
2022-04-24 20:57 ` [Buildroot] [PATCH 1/2] package/libselinux: fix host build Yann E. MORIN
2022-05-27  7:52 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.