Bug 28851 - ar: add 'L' modifier as a shortcut for ADDLIB
Summary: ar: add 'L' modifier as a shortcut for ADDLIB
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-02 03:23 UTC by Fangrui Song
Modified: 2022-02-02 03:23 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fangrui Song 2022-02-02 03:23:43 UTC
`ar r a.a b.a` adds b.a as a member. Sometimes the user wants to add the members of an archive into another archive.

https://sources.debian.org/src/x265/3.5-2/build/linux/multilib.sh/?hl=29#L27 uses the following to merge several archives into one:

ar -M <<EOF
CREATE libx265.a
ADDLIB libx265_main.a
ADDLIB libx265_main10.a
ADDLIB libx265_main12.a
SAVE
END
EOF

Using MRI is inconvenient. In 2018, llvm-ar added 'L' as a shortcut for ADDLIB (https://reviews.llvm.org/D53332). It'd be nice if binutils ar supports 'L' as well.