[Buildroot] [PATCH v7 2/9] support/scripts: add fix-rpath script to sanitize the rpath
Arnout Vandecappelle
arnout at mind.be
Thu Jul 20 13:45:01 UTC 2017
On 20-07-17 11:03, Wolfgang Grandegger wrote:
> case "${tree}" in
> host)
> ...
> # we always want $ORIGIN-based rpaths to make it relocatable.
Perfect. Just please start the sentence with a capital (it ends with a .)
> sanitize_extra_args+=( "--relative-to-file" )
> ;;
>
> staging)
> ...
> # should be like for the target tree below
s/like/the same as/
> sanitize_extra_args+=( "--no-standard-lib-dirs" )
> ;;
>
> target)
> ...
> # we don't want $ORIGIN-based rpaths but absolute paths without rootdir.
> # we also want to remove rpaths pointing to /lib or /usr/lib.
Capitalization, otherwise perfect.
[snip]
> As I said, the execution time comes form scanning for ELF files. The rest doesn't
> matter a lot.
Instead of the patch you attached, it might actually make more sense to create
a tiny C file that does this, and execute that as part of the find command. Or
you could just create support/scripts/elfmagic with those 4 bytes and use "cmp
-n 4 {} ${0%/*}/elfmagic".
By the way, I believe filtering with -exec is much faster than doing it with
while/if. Unfortunately you can't use that with patchelf --print-rpath because
the output of patchelf would be mixed up with the find output.
Regards,
Arnout
> The attached patch speeds up ELF file checking. As said, readelf
> is still faster even with that patch.
[snip]
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
More information about the buildroot
mailing list