Skip to contentSkip to conversation

acl: make sure build picks up TARGET_CFLAGS

PATCH New Arnout Vandecappelle (Essensium/Mind) 3 participants 8 messages Mar 17, 2017 – Mar 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 acl: make sure build picks up TARGET_CFLAGS

The acl build system doesn't use automake, therefore it is broken. It doesn't use the CFLAGS passed by configure. Work around this by passing CFLAGS in the environment. The makefiles append to CFLAGS, so this works.

This issue hasn't led to build failures, but it is visible e.g. when stack protector is enabled: the stack protector options are not applied to acl. Also debug and optimisation options aren't applied.

---
v2: new patch

---
 package/acl/acl.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/acl/acl.mk +7 -1
index cbe5e93961..9fd5de18a4 100644
@@ -15,7 +15,13 @@ ACL_LICENSE_FILES = doc/COPYING doc/COPYING.LGPL
 
 # While the configuration system uses autoconf, the Makefiles are
 # hand-written and do not use automake. Therefore, we have to hack
-# around their deficiencies by passing installation paths.
+# around their deficiencies by:
+# - explicitly passing CFLAGS (LDFLAGS are passed on from configure,
+#   CFLAGS are not).
+# - explicitly passing the installation prefix, not using DESTDIR.
+
+ACL_MAKE_ENV = CFLAGS="$(TARGET_CFLAGS)"
+
 ACL_INSTALL_STAGING_OPTS = \
 	prefix=$(STAGING_DIR)/usr \
 	exec_prefix=$(STAGING_DIR)/usr \
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 2/3 acl: add host variant

We need host-acl to fix issues with fakeroot.

Unfortunately, all the hacks (except the .la fixup) have to be repeated.

---
v2: - propagate CFLAGS (Andreas Naumann)
- mention that .la hack isn't needed for host.

---
 package/acl/acl.mk | 11 +++++++++++
 1 file changed, 11 insertions(+)
package/acl/acl.mk +11 -0
index 9fd5de18a4..e1462b60aa 100644
@@ -43,4 +43,15 @@ endef
 
 ACL_POST_INSTALL_STAGING_HOOKS += ACL_FIX_LIBTOOL_LA_LIBDIR
 
+HOST_ACL_DEPENDENCIES = host-attr
+HOST_ACL_CONF_OPTS = --enable-gettext=no
+HOST_ACL_MAKE_ENV = CFLAGS="$(HOST_CFLAGS)"
+HOST_ACL_INSTALL_OPTS = \
+	prefix=$(HOST_DIR)/usr \
+	exec_prefix=$(HOST_DIR)/usr \
+	PKG_DEVLIB_DIR=$(HOST_DIR)/usr/lib \
+	install-dev install-lib
+# For the host, libacl.la is correct, no fixup needed.
+
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.11.0
#2 lore raw

PATCH v2 3/3 fakeroot: depend on acl

In reply to Arnout Vandecappelle (Essensium/Mind)

Recent versions of fakeroot have grown support for acl. We don't really need this since we don't use acls in Buildroot. However, it turns out that "cp -a" does something funky with acls, with the result that fakeroot without acl support looses the ownership and permissions on the copied file. "cp -a" may be (is even likely to be) used in a BR2_ROOTFS_POST_FAKEROOT_SCRIPT, so we need to support this.

Note that host-acl itself depends on host-attr, so this pulls in two extra packages in each build. The impact on build time is about 10s.

---
v2: no change

---
 package/fakeroot/fakeroot.mk | 2 ++
 1 file changed, 2 insertions(+)
package/fakeroot/fakeroot.mk +2 -0
index 168cd13a48..731b06a5f4 100644
@@ -7,6 +7,8 @@
 FAKEROOT_VERSION = 1.20.2
 FAKEROOT_SOURCE = fakeroot_$(FAKEROOT_VERSION).orig.tar.bz2
 FAKEROOT_SITE = http://snapshot.debian.org/archive/debian/20141005T221953Z/pool/main/f/fakeroot
+
+HOST_FAKEROOT_DEPENDENCIES = host-acl
 # Force capabilities detection off
 # For now these are process capabilities (faked) rather than file
 # so they're of no real use
Signature · 1 line
2.11.0
#3 lore raw

PATCH v2 1/3 acl: make sure build picks up TARGET_CFLAGS

In reply to Arnout Vandecappelle (Essensium/Mind)

Hi Arnout,
tested and works :-)

thanks,
Andreas

Am 17.03.2017 um 17:06 schrieb Arnout Vandecappelle (Essensium/Mind):

Quoted 37 lines

The acl build system doesn't use automake, therefore it is broken. It doesn't use the CFLAGS passed by configure. Work around this by passing CFLAGS in the environment. The makefiles append to CFLAGS, so this works.

This issue hasn't led to build failures, but it is visible e.g. when stack protector is enabled: the stack protector options are not applied to acl. Also debug and optimisation options aren't applied.

---
v2: new patch

---
 package/acl/acl.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/acl/acl.mk +7 -1
index cbe5e93961..9fd5de18a4 100644
@@ -15,7 +15,13 @@ ACL_LICENSE_FILES = doc/COPYING doc/COPYING.LGPL
 
 # While the configuration system uses autoconf, the Makefiles are
 # hand-written and do not use automake. Therefore, we have to hack
-# around their deficiencies by passing installation paths.
+# around their deficiencies by:
+# - explicitly passing CFLAGS (LDFLAGS are passed on from configure,
+#   CFLAGS are not).
+# - explicitly passing the installation prefix, not using DESTDIR.
+
+ACL_MAKE_ENV = CFLAGS="$(TARGET_CFLAGS)"
+
 ACL_INSTALL_STAGING_OPTS = \
 	prefix=$(STAGING_DIR)/usr \
 	exec_prefix=$(STAGING_DIR)/usr \
#4 lore raw

PATCH v2 1/3 acl: make sure build picks up TARGET_CFLAGS

Quoted 2 lines · Andreas Naumann

Hi Arnout,
tested and works :-)

You can formalize this by replying with

(but then without a space in front). It gets picked up by Patchwork and it will be added to the git log.

By the way, did you actually test *this patch*, or just that fakeroot works
after the entire series is applied? In the latter case, you should only add your Tested-by to the last patch (and perhaps 2/3). This particular patch has no impact on fakeroot.

Regards,
Arnout

Quoted 42 lines

thanks,
Andreas

Am 17.03.2017 um 17:06 schrieb Arnout Vandecappelle (Essensium/Mind):

Quoted 37 lines

The acl build system doesn't use automake, therefore it is broken. It doesn't use the CFLAGS passed by configure. Work around this by passing CFLAGS in the environment. The makefiles append to CFLAGS, so this works.

This issue hasn't led to build failures, but it is visible e.g. when stack protector is enabled: the stack protector options are not applied to acl. Also debug and optimisation options aren't applied.

---
v2: new patch

---
 package/acl/acl.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/acl/acl.mk +7 -1
index cbe5e93961..9fd5de18a4 100644
@@ -15,7 +15,13 @@ ACL_LICENSE_FILES = doc/COPYING doc/COPYING.LGPL
 
 # While the configuration system uses autoconf, the Makefiles are
 # hand-written and do not use automake. Therefore, we have to hack
-# around their deficiencies by passing installation paths.
+# around their deficiencies by:
+# - explicitly passing CFLAGS (LDFLAGS are passed on from configure,
+#   CFLAGS are not).
+# - explicitly passing the installation prefix, not using DESTDIR.
+
+ACL_MAKE_ENV = CFLAGS="$(TARGET_CFLAGS)"
+
 ACL_INSTALL_STAGING_OPTS = \
     prefix=$(STAGING_DIR)/usr \
     exec_prefix=$(STAGING_DIR)/usr \
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#5 lore raw

PATCH v2 1/3 acl: make sure build picks up TARGET_CFLAGS

Hi,

Am 17.03.2017 um 23:20 schrieb Arnout Vandecappelle:

Quoted 12 lines · Andreas Naumann
Quoted 2 lines

Hi Arnout,
tested and works :-)

You can formalize this by replying with

(but then without a space in front). It gets picked up by Patchwork and it will be added to the git log.

I guess too late now. Will do next time.

Quoted 5 lines

By the way, did you actually test *this patch*, or just that fakeroot works
after the entire series is applied? In the latter case, you should only add your Tested-by to the last patch (and perhaps 2/3). This particular patch has no impact on fakeroot.

I did test this patch in in so far that host-acl successfully builds without the attr/xattr.h header being picked up from the host machine. And of course subsequently that fakeroot with acl works as expected.

regards,
Andreas

Quoted 47 lines

Regards,
Arnout

Quoted 42 lines

thanks,
Andreas

Am 17.03.2017 um 17:06 schrieb Arnout Vandecappelle (Essensium/Mind):

Quoted 37 lines

The acl build system doesn't use automake, therefore it is broken. It doesn't use the CFLAGS passed by configure. Work around this by passing CFLAGS in the environment. The makefiles append to CFLAGS, so this works.

This issue hasn't led to build failures, but it is visible e.g. when stack protector is enabled: the stack protector options are not applied to acl. Also debug and optimisation options aren't applied.

---
v2: new patch

---
 package/acl/acl.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/acl/acl.mk +7 -1
index cbe5e93961..9fd5de18a4 100644
@@ -15,7 +15,13 @@ ACL_LICENSE_FILES = doc/COPYING doc/COPYING.LGPL
 
 # While the configuration system uses autoconf, the Makefiles are
 # hand-written and do not use automake. Therefore, we have to hack
-# around their deficiencies by passing installation paths.
+# around their deficiencies by:
+# - explicitly passing CFLAGS (LDFLAGS are passed on from configure,
+#   CFLAGS are not).
+# - explicitly passing the installation prefix, not using DESTDIR.
+
+ACL_MAKE_ENV = CFLAGS="$(TARGET_CFLAGS)"
+
 ACL_INSTALL_STAGING_OPTS = \
     prefix=$(STAGING_DIR)/usr \
     exec_prefix=$(STAGING_DIR)/usr \
#6 lore raw

PATCH v2 1/3 acl: make sure build picks up TARGET_CFLAGS

Quoted 18 lines · Andreas Naumann

Hi,

Am 17.03.2017 um 23:20 schrieb Arnout Vandecappelle:

Quoted 12 lines · Andreas Naumann
Quoted 2 lines

Hi Arnout,
tested and works :-)

You can formalize this by replying with

(but then without a space in front). It gets picked up by Patchwork and it will be added to the git log.

I guess too late now. Will do next time.

Quoted 1 line
Quoted 7 lines
Quoted 4 lines

By the way, did you actually test *this patch*, or just that fakeroot works
after the entire series is applied? In the latter case, you should only add your Tested-by to the last patch (and perhaps 2/3). This particular patch has no impact on fakeroot.

I did test this patch in in so far that host-acl successfully builds without the attr/xattr.h header being picked up from the host machine. And of course subsequently that fakeroot with acl works as expected.

My point is: this patch is about target-acl, not host-acl, that's why I asked.
So you didn't actually test this patch :-)

Regards,
Arnout

Quoted 52 lines

regards,
Andreas

Quoted 47 lines

Regards,
Arnout

Quoted 42 lines

thanks,
Andreas

Am 17.03.2017 um 17:06 schrieb Arnout Vandecappelle (Essensium/Mind):

Quoted 37 lines

The acl build system doesn't use automake, therefore it is broken. It doesn't use the CFLAGS passed by configure. Work around this by passing CFLAGS in the environment. The makefiles append to CFLAGS, so this works.

This issue hasn't led to build failures, but it is visible e.g. when stack protector is enabled: the stack protector options are not applied to acl. Also debug and optimisation options aren't applied.

---
v2: new patch

---
 package/acl/acl.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/acl/acl.mk +7 -1
index cbe5e93961..9fd5de18a4 100644
@@ -15,7 +15,13 @@ ACL_LICENSE_FILES = doc/COPYING doc/COPYING.LGPL
 
 # While the configuration system uses autoconf, the Makefiles are
 # hand-written and do not use automake. Therefore, we have to hack
-# around their deficiencies by passing installation paths.
+# around their deficiencies by:
+# - explicitly passing CFLAGS (LDFLAGS are passed on from configure,
+#   CFLAGS are not).
+# - explicitly passing the installation prefix, not using DESTDIR.
+
+ACL_MAKE_ENV = CFLAGS="$(TARGET_CFLAGS)"
+
 ACL_INSTALL_STAGING_OPTS = \
     prefix=$(STAGING_DIR)/usr \
     exec_prefix=$(STAGING_DIR)/usr \
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#7 lore raw

PATCH v2 1/3 acl: make sure build picks up TARGET_CFLAGS

In reply to Arnout Vandecappelle (Essensium/Mind)

Hello,

Quoted 9 lines · Arnout Vandecappelle (Essensium/Mind)

The acl build system doesn't use automake, therefore it is broken. It doesn't use the CFLAGS passed by configure. Work around this by passing CFLAGS in the environment. The makefiles append to CFLAGS, so this works.

This issue hasn't led to build failures, but it is visible e.g. when stack protector is enabled: the stack protector options are not applied to acl. Also debug and optimisation options aren't applied.

Quoted 7 lines

---
v2: new patch

---
 package/acl/acl.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Series applied, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com