Re: False positive in skalibs system feature test

From: Jens Rehsack <rehsack_at_gmail.com>
Date: Wed, 23 Oct 2019 12:07:40 +0200

> Am 23.10.2019 um 11:50 schrieb Laurent Bercot <ska-skaware_at_skarnet.org>:
>
>> /usr/bin/ld: src/librandom/random_string.lo: in function `random_string':
>> ./src/librandom/random_string.c:26: warning: getrandom is not
>> implemented and will always fail
>
> And this, ladies and gentlemen, is why 'choose clr' is more reliable
> than 'choose cl'.
> Unfortunately, the former isn't cross-friendly, while the latter is.
> And *some* people insisted on making the build more cross-friendly, so
> here we are.

Choosing cl over clr is not the only option to make something cross-friendly.
Making the command overrideable to use qemu to execute a test or making
each test result overridable is cross-friendly, too.

Do not blame requests for more cross-friendlyness to choose wrong weapon ;)

>> ld returns zero, even it knows "xxx is not implemented and will always fail".
>
> That, on the other hand, is completely insane. Why the heck isn't it
> an error? It's *precisely* the kind of thing I want ld to error out on!
>
>
>> I think the LDFLAGS should be appended with "-Wl,--fatal-warnings", so
>> that ld returns non-zero in such case.
>
> Yeah, so we have to bully ld for it to do its job. Nice.
> Are there cases where we could get a false negative, though? Are there
> legitimate ld warnings that _should not_ error out? I don't want to make
> a change to accommodate an exotic system if it risks breaking others.

Overridable for the win ;)

>> I only observe such case on GNU Hurd/K*BSD actually. I'm thinking if
>> only these non-linux systems have such confused behaviour(why it links
>> successfully at all...)
>
> That would be interesting to explore, yes. What version of ld do they
> they use? Is that GNU binutils or something else? And it may be more
> beneficial align ld's behaviour to other systems: skalibs can't be the
> only piece of software that relies on ld to test sysdeps. Starting with
> autoconf. Hm, does autoconf use -Wl,--fatal-warnings ?

Not by default.

But the issue smells more as a glibc issue than an ld issue.
Just the first shot I'd follow when encountering such a one ...

Cheers
--
Jens Rehsack - rehsack_at_gmail.com



Received on Wed Oct 23 2019 - 10:07:40 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC