Source: libcap2
Version: 1:2.24-10
Tags: patch
User: [email protected]
Usertags: rebootstrap

The 1:2.24-10 upload introduced a regression with cross building. (I
accidentally deleted the build log, sorry.) At some point it compiles
_makenames.c with $(BUILD_CC) (which is correct), but it now passes
$(LDFLAGS) which can only be used for the host architecture compiler.
Since $(LDFLAGS) contains -lattr linking fails.

The attached patch resolves that problem by replacing LDFLAGS with
BUILD_LDFLAGS in this case. Note that BUILD_LDFLAGS is never set, so
this is equivalent to removing LDFLAGS. It will of course regress in
terms of blhc and you will receive a (wrong) report of missing
hardening. If you wish to avoid that as well, you can set

export BUILD_LDFLAGS=$(shell dpkg-architecture -a$(DEB_BUILD_ARCH) -c 
dpkg-buildflags --get LDFLAGS)

and the CPPFLAGS counterpart in debian/rules.

In general, one must not reuse any host architecture build flags for
build architecture compiler invocations, because build flags can differ
per architecture. In particular, host architecture build flags can be
unrecognized by the build architecture compiler (e.g. amd64 vs alpha).

Please consider applying the patch or a variant of it.

Helmut
--- a/debian/patches/0004-Don-t-hardcode-build-flags.patch
+++ b/debian/patches/0004-Don-t-hardcode-build-flags.patch
@@ -46,7 +46,7 @@
  
  _makenames: _makenames.c cap_names.list.h
 -	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
-+	$(BUILD_CC) $(BUILD_CFLAGS) $(LDFLAGS) $(CPPFLAGS) $< -o $@
++	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) $(BUILD_CPPFLAGS) $< -o $@
  
  cap_names.h: _makenames
  	./_makenames > cap_names.h

Reply via email to