On 08/19/2013 12:07 PM, Guido Günther wrote:
>> + NO_INDIRECT_LDFLAGS=
>> + `$LD --help 2>&1 | grep -- "--no-copy-dt-needed-entries"
>/dev/null` && \
>
> Doesn't do what you think (it tries to execute the output of grep -
> which is thankfully empty on both success and failure). Also wastes a
> fork on grep, compared to the simpler:
I was looking following virt-linker-relro.m4 and I'm getting the correct
result since the output is always empty but for the non matching case
grep exits with 1. However
>
> case `$LD --help 2>&1` in
> *--no-copy-dt-needed-entries*) NO_INDIRECT_LDFLAGS=... ;;
> esac
this looks nicer.
Oh sure - blame copy-and-paste of bad habits :)
> Why aren't you building this directly into $(AM_LDFLAGS)
once, rather
> than having to copy it into each and every library recipe?
>
> Why only src/ and tests/? What about tools/ and daemon/?
Again following the above example. I'll come up with a v3.
For a v3, it might be nice to have two patches - one that cleans up the
bad habits of RELRO handling, and the second that extends it with the
cleaner idioms. Thanks for putting up with me :)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org