On Mon, Apr 17, 2023 at 12:11 PM Dridi Boukelmoune
<dridi.boukelmoune(a)gmail.com> wrote:
On Mon, Apr 17, 2023 at 11:38 AM Florian Weimer <fweimer(a)redhat.com> wrote:
>
> * Dridi Boukelmoune:
>
> >> The hare toolchain should not use LDFLAGS if it doesn't use a
> >> GCC-compatible compiler driver.
> >>
> >> But I don't see where it does that. Do you have a more precise
> >> reference?
> >
> > See the man page:
> >
> >
https://git.sr.ht/~sircmpwn/hare/tree/master/item/docs/hare.scd
>
> Ah, looked at the wrong repository. I think we can't use LDFLAGS at all
> with hare. Its startup probably won't support all our hardening.
At least haredoc (built by hare) runs just fine on my machine. And
hare was built with the same %{ld_ldflags}.
Please note that the way my %{ld_ldflags} macro works, only "straight"
arguments are passed and those coming from specs (redhat-hardened-ld
and redhat-annobin-cc1) are simply ignored.
It loos like somebody had already suggested moving away from LDFLAGS,
using LDLINKFLAGS instead, and the patch was merged 2 days after I
started this thread:
https://todo.sr.ht/~sircmpwn/hare/784
So that's one conflict gone, but there is still no RPM macro support for
distro-wide linker flags for toolchains not relying on LDFLAGS in their
current form.
My %{ld_ldflags} macro could be taking the problem from the wrong end: we
could instead have some %{link_ldflags} macro from which %{build_ldflags}
would be derived, turning command line arguments into `-Wl` options and
adding GCC-specific -specs options.
Cheers