Hi!

In dpkg we define several build flags defaults per vendor via
dpkg-buildflags(1) (<https://manpages.debian.org/dpkg-buildflags>),
and increasingly we have been adding options for the linker in LDFLAGS.
The problem is that some (few) projects are using that for direct
calls to ld(1) without going through the compiler. This is causing
build failures now.

(See <https://bugs.debian.org/1125323> for context.)

As part of that report, my current inclination is to perhaps add a new
variable for such direct ld(1) call use, where I'm tentatively naming
it LD_LDFLAGS. I discarded the initially proposed (but arguably better
sounding LDFLAGS_FOR_LD, due to our existing use of LDFLAGS_FOR_BUILD,
which would end up in the I think worse LDFLAGS_FOR_LD_FOR_BUILD).

But before settling on a name, I was wondering if the autotools
maintainers see this being worthwhile, and would be open to add support
for such new flag, even if it's just to standardize on a name, and
document it (w/o actual code changes). So that autotools based projects,
or other projects with their own build systems can use a common variable
for this, with defined semantics.

Arguably another stance, would be to declare that any flags for direct
ld(1) call usage needs to come from a sanitized LDFLAGS, perhaps with
some guidance, such as what I've done with criu and optee-os, where I
allowed -l, -L, and -Wl and mangled the latter. But that is limiting
in that no other ld(1) options are let through.

Thanks,
Guillem

Reply via email to