[PATCH] newlib: libm: workaround ar duplicate member behavior

Mike Frysinger vapier@gentoo.org
Mon Feb 21 22:12:02 GMT 2022


On 21 Feb 2022 14:51, Joel Sherrill wrote:
> Could this be de-duped with the gnu make sort command? That would avoid the
> copy.
> 
> Alternatively, I see some awk one liners on the web to uniq the set. Or
> just invoke uniq.

the inputs need to be deduped based on basename and the order specified.  so
i'd build a hashmap/associative array from the basename to the full path, and
then output the resulting set.

this isn't something sort/uniq can accomplish.

it is possible to do in awk, i've just been a bit shy about using it as i'm
not confident in portability aspects (beyond POSIX).  if we agree POSIX is
fine (which, for newlib, i think is OK), then yes, we can do that.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/newlib/attachments/20220221/5f93f20a/attachment-0001.sig>


More information about the Newlib mailing list