On Friday 2026-01-16 00:24, Florian Weimer wrote:
>>>
>>>https://bugs.debian.org/1125323
>>>ld: -f may not be used without -shared
>>
>> -fcf-protection is not a linker flag and does not belong into LDFLAGS.
>
>LDFLAGS are linker flags for the compiler driver (with -Wl, escaping
>etc.).
autoconf.info mentions the word "driver" just twice,
and not in regards to LD/LDFLAGS.
automake.info only knows drivers with "test drivers"
otherwise does not use the term.
>LDFLAGS must contain -fcf-protection when using LTO.
I guess you meant -flto / -flto=auto.
>[...] the make manual [...] even document[s] as such:
>
>| 'LDFLAGS'
>| Extra flags to give to compilers when they are supposed to invoke
>| the linker, 'ld', such as '-L'. Libraries ('-lfoo') should be
>| added to the 'LDLIBS' variable instead.
>
>LDFLAGS doesn't [have an ambiguity like ASFLAGS],
>it's always for the compiler driver (unless the build
>system is really buggy).
Quite the contrary. The very same make manual you are citing is also
is *very explicit* about that LDFLAGS is *not* exclusively for
compilers/drivers:
| use 'LDFLAGS' in any compilation
| command that does linking as well as in any direct use of 'ld'.
>ASFLAGS has the ambiguity because the default make rules use it with
>both AS (for .s) and CC and (.S), which makes ASFLAGS rather useless.
I have seen traces of "CCASFLAGS" in automake, so I guess someone thought of
that already. And that would speak towards getting a CCLDFLAGS variable.