[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LDFLAGS going missing?

From: Greg Troxel
Subject: Re: LDFLAGS going missing?
Date: Thu, 20 Aug 2020 19:48:04 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (berkeley-unix)

Bernd Zeimetz <> writes:

> On 8/19/20 3:56 PM, Greg Troxel wrote:
>> I have updated pkgsrc to 3.21.  Someone in pkgsrc-land tried to build
>> with the hardening technique RELRO, which pkgsrc supports and most
>> packages are ok with:
> I had the same issue in Debian, but I thought I had fixed those issues with

> commit d0e0864c2802860ff561fe0b39939b63d38b8c70
> Author: Bernd Zeimetz <>
> Date:   Sun Jul 28 20:46:35 2019 +0200

I suspect that your change did help a lot.

> What I'm doing in debian/rules is
> cflags := $(shell dpkg-buildflags --get CFLAGS)
> cppflags := $(shell dpkg-buildflags --get CPPFLAGS)
> cxxflags := $(shell dpkg-buildflags --get CXXFLAGS)
> ldflags := $(shell dpkg-buildflags --get LDFLAGS)
> SCONS_ENV := set -e ;\
>                 export LDFLAGS="$(ldflags)" ;\
>                 export CFLAGS="$(cflags)" ;\
>                 export CXXFLAGS="$(cxxflags)" ;\
>                 export CPPFLAGS="$(cppflags)";
> ...
> $(SCONS_ENV) $${py} /usr/bin/scons $(SCONSOPTS) target_python=$${py}
> So I've exported all flags - maybe this helps?
> Probably scons is messing with the environment somewhere internally?

My issue turned out to be a combination of

  LDFLAGS (and the rest) was only set during the scons build, but not
  scons install

  gpsd's build links programs again during install

With your recipe, the env vars were probably set during install, so the
2nd build would get done the same way and things would work.

>> I haven't been able to figure out in SConstruct why there are two builds
>> (smells like the libtool relink before install to allow testing with not
>> isntalled libs?), and more importantly why user-specified LDFLAGS are
>> ignored.
> So far this works as expected in 3.20. Did not yet give 3.21 a try.

Do you mean that there is no re-link at install, or just that you set
the env vars and it is ok?

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]