Hi Helmut,

On 2015-08-25 15:18, Helmut Grohne wrote:
> 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.

I just now applied the patch, and extended debian/rules to export
BUILD_{LDFLAGS,CPPFLAGS} as per your example above.

Thank you for resolving this issue!

> 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).

Yes, this was an oversight on my part.

Regards,
Christian

Reply via email to