Skip to contentSkip to conversation

package/apparmor: fix per-package build with apache

PATCH In review Fabrice Fontaine 4 participants 4 messages Nov 17, 2021 – Nov 18, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/apparmor: fix per-package build with apache

Fix the following per-package build failure with apache:

/home/buildroot/autobuild/instance-3/output-1/per-package/apparmor/host/aarch64-buildroot-linux-gnu/sysroot/usr/bin/../../usr/build-1/libtool --silent --mode=link /home/buildroot/autobuild/instance-3/output-1/per-package/apparmor/host/bin/aarch64-linux-gcc -o mod_apparmor.la -rpath /usr/modules -module -avoid-version mod_apparmor.lo -L/home/buildroot/autobuild/instance-3/output-1/per-package/apparmor/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib -lapparmor
/home/buildroot/autobuild/instance-3/output-1/per-package/apache/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: cannot find /lib64/libc.so.6

This build failure is raised because the fix added by commit 3c836e54203b16015c9c52cbe007adc92d293a0d was incomplete as the apr special libtool script was not patched (see commit b747c29c4e8eb89b7b99658dfd34f4a6b6b0744d for a detailled explanation)

Fixes:
- http://autobuild.buildroot.org/results/6747b1cb11b129ea4bcb1ecc9645e94fb8e095e8

---
 package/apparmor/apparmor.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/apparmor/apparmor.mk +2 -1
index 400ea349ae..6f0e59224d 100644
@@ -59,7 +59,8 @@ ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
 define APPARMOR_FIXUP_APXS
 	$(SED) "s@$(PER_PACKAGE_DIR)/[^/]\+/@$(PER_PACKAGE_DIR)/apparmor/@g" \
 		$(STAGING_DIR)/usr/bin/apxs \
-		$(STAGING_DIR)/usr/build/config_vars.mk
+		$(STAGING_DIR)/usr/build/config_vars.mk \
+		$(STAGING_DIR)/usr/build-1/libtool
 endef
 APPARMOR_POST_CONFIGURE_HOOKS += APPARMOR_FIXUP_APXS
 endif
Signature · 6 lines
2.33.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 23 lines · Fabrice Fontaine

Fix the following per-package build failure with apache:

/home/buildroot/autobuild/instance-3/output-1/per-package/apparmor/host/aarch64-buildroot-linux-gnu/sysroot/usr/bin/../../usr/build-1/libtool --silent --mode=link /home/buildroot/autobuild/instance-3/output-1/per-package/apparmor/host/bin/aarch64-linux-gcc -o mod_apparmor.la -rpath /usr/modules -module -avoid-version mod_apparmor.lo -L/home/buildroot/autobuild/instance-3/output-1/per-package/apparmor/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib -lapparmor
/home/buildroot/autobuild/instance-3/output-1/per-package/apache/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: cannot find /lib64/libc.so.6

This build failure is raised because the fix added by commit 3c836e54203b16015c9c52cbe007adc92d293a0d was incomplete as the apr special libtool script was not patched (see commit b747c29c4e8eb89b7b99658dfd34f4a6b6b0744d for a detailled explanation)

Fixes:
- http://autobuild.buildroot.org/results/6747b1cb11b129ea4bcb1ecc9645e94fb8e095e8

---
  package/apparmor/apparmor.mk | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
package/apparmor/apparmor.mk +0 -0
index 400ea349ae..6f0e59224d 100644

package/apparmor/apparmor.mk ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y) · line 63

Quoted 6 lines
package/apparmor/apparmor.mk +2 -1
@@ -59,7 +59,8 @@ ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
  define APPARMOR_FIXUP_APXS
  	$(SED) "s@$(PER_PACKAGE_DIR)/[^/]\+/@$(PER_PACKAGE_DIR)/apparmor/@g" \
  		$(STAGING_DIR)/usr/bin/apxs \
-		$(STAGING_DIR)/usr/build/config_vars.mk
+		$(STAGING_DIR)/usr/build/config_vars.mk \
+		$(STAGING_DIR)/usr/build-1/libtool

I was surprised by the build-1, but it seems to be correct. Apache is weird...

Now I said that: shouldn't all of this move to apache.mk, by adding them to
APACHE_CONFIG_SCRIPTS? Of course, those are assumed to be in $(STAGING_DIR)/usr/bin, so you'd have to put ../build/config_vars.mk and I'm not sure if that won't break the realpath stuff...

So anyway, applied to master, but it would be nice to do this in a cleaner way.

Regards,
Arnout

package/apparmor/apparmor.mk ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y) · line 66

Quoted 4 lines
package/apparmor/apparmor.mk +0 -0
  endef
  APPARMOR_POST_CONFIGURE_HOOKS += APPARMOR_FIXUP_APXS
  endif

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Arnout, All,

On 2021-11-17 21:47 +0100, Arnout Vandecappelle spake thusly:

Quoted 33 lines · Fabrice Fontaine
Quoted 23 lines

Fix the following per-package build failure with apache:

/home/buildroot/autobuild/instance-3/output-1/per-package/apparmor/host/aarch64-buildroot-linux-gnu/sysroot/usr/bin/../../usr/build-1/libtool --silent --mode=link /home/buildroot/autobuild/instance-3/output-1/per-package/apparmor/host/bin/aarch64-linux-gcc -o mod_apparmor.la -rpath /usr/modules -module -avoid-version mod_apparmor.lo -L/home/buildroot/autobuild/instance-3/output-1/per-package/apparmor/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib -lapparmor
/home/buildroot/autobuild/instance-3/output-1/per-package/apache/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: cannot find /lib64/libc.so.6

This build failure is raised because the fix added by commit 3c836e54203b16015c9c52cbe007adc92d293a0d was incomplete as the apr special libtool script was not patched (see commit b747c29c4e8eb89b7b99658dfd34f4a6b6b0744d for a detailled explanation)

Fixes:
- http://autobuild.buildroot.org/results/6747b1cb11b129ea4bcb1ecc9645e94fb8e095e8

---
 package/apparmor/apparmor.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/apparmor/apparmor.mk +0 -0
index 400ea349ae..6f0e59224d 100644

package/apparmor/apparmor.mk ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y) · line 63

Quoted 6 lines
package/apparmor/apparmor.mk +2 -1
@@ -59,7 +59,8 @@ ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
 define APPARMOR_FIXUP_APXS
 	$(SED) "s@$(PER_PACKAGE_DIR)/[^/]\+/@$(PER_PACKAGE_DIR)/apparmor/@g" \
 		$(STAGING_DIR)/usr/bin/apxs \
-		$(STAGING_DIR)/usr/build/config_vars.mk
+		$(STAGING_DIR)/usr/build/config_vars.mk \
+		$(STAGING_DIR)/usr/build-1/libtool

I was surprised by the build-1, but it seems to be correct. Apache is weird...

Quoted 2 lines

Now I said that: shouldn't all of this move to apache.mk, by adding them to
APACHE_CONFIG_SCRIPTS?

In fact, no, becasue FOO_CONFIG_SCRIPTS are fixed at the end of staging-install (even after the hooks).

However, for per-package, STAGING_DIR will change, and we really need to fix the paths for each packages before they are configured... That's why we use PER_PACKAGE_DIR in the fixups...

But ideally, I'd like that a package be able to provide "prepare-hooks" (or some better name) that are executed not in that package context, but in the context all packages that depend on it; that would allow fixing those paths in a single location...

Regards,
Yann E. MORIN.

Quoted 17 lines

Of course, those are assumed to be in
$(STAGING_DIR)/usr/bin, so you'd have to put ../build/config_vars.mk and I'm not sure if that won't break the realpath stuff...

So anyway, applied to master, but it would be nice to do this in a cleaner way.

Regards,
Arnout

package/apparmor/apparmor.mk ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y) · line 66

Quoted 4 lines
package/apparmor/apparmor.mk +0 -0
 endef
 APPARMOR_POST_CONFIGURE_HOOKS += APPARMOR_FIXUP_APXS
 endif

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  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
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw
In reply to Fabrice Fontaine
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Fabrice" == Fabrice Fontaine <[email protected]> writes:

Fix the following per-package build failure with apache:
/home/buildroot/autobuild/instance-3/output-1/per-package/apparmor/host/aarch64-buildroot-linux-gnu/sysroot/usr/bin/../../usr/build-1/libtool --silent --mode=link /home/buildroot/autobuild/instance-3/output-1/per-package/apparmor/host/bin/aarch64-linux-gcc -o mod_apparmor.la -rpath /usr/modules -module -avoid-version mod_apparmor.lo -L/home/buildroot/autobuild/instance-3/output-1/per-package/apparmor/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib -lapparmor
/home/buildroot/autobuild/instance-3/output-1/per-package/apache/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: cannot find /lib64/libc.so.6

This build failure is raised because the fix added by commit 3c836e54203b16015c9c52cbe007adc92d293a0d was incomplete as the apr special libtool script was not patched (see commit b747c29c4e8eb89b7b99658dfd34f4a6b6b0744d for a detailled explanation)

Quoted 4 lines

Fixes:
- http://autobuild.buildroot.org/results/6747b1cb11b129ea4bcb1ecc9645e94fb8e095e8

Committed to 2021.02.x and 2021.08.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot