Plus character ('+') in archive name, can't run ar in MRI mode

jyhgekyfbkjsyebf jyhgekyfbkjsyebf@protonmail.ch
Mon Mar 28 08:27:32 GMT 2022


On Sunday, March 27th, 2022 at 11:10 PM, Fangrui Song <i@maskray.me> wrote:

> On Sat, Mar 26, 2022, 09:12 jyhgekyfbkjsyebf via Binutils <binutils@sourceware.org> wrote:
>
> > Hello list,
> >
> > problem: I need to combine multiple static libraries into one. Internet said that I can use ar MRI script. However, it doesn't work with archives that have a '+' character in their name, for example, script:
> >
> > CREATE libfull.a
> >
> > ADDLIB /usr/local/lib/libgrpc.a
> >
> > ADDLIB /usr/local/lib/libgrpc++.a
> >
> > SAVE
> >
> > END
> >
> > results in:
> >
> > ❯ ar -M < ../link_line
> >
> > ar: /usr/local/lib/libgrpc: No such file or directory
> >
> > ++%
> >
> > Looks like it chokes on '+' there. What do you suggest to do?
>
> Seems that + should be accepted.

By that you mean that it is a problem on my side and I'm doing something wrong, or that it is supposed to work, but is a[n] [un]known bug?

> Also hope someone can implement L modifier to combine archives https://sourceware.org/bugzilla/show_bug.cgi?id=28851

Workaround for search engine: create a thin library via cqT: ar cqT result.a a1.a a2.a ... ; then convert thin to normal in MRI:
CREATE result.a
ADDLIB result.a
SAVE
END


More information about the Binutils mailing list