Hi,
After speaking a bit with jackdaniel on irc, it seems that the issue is correctly writing the .a files? If so, since it's a simple ar archive, this could be done in Lisp. I wrote an ar writer in less than 100 lines with some hard coded values: https://github.com/ralt/deb-packager/blob/master/src/ar.lisp
The format is basically: a global header followed by the entries. (Entries format is relatively straightforward, I invite you to look at the code.)
I think it would be pretty straightforward to implement the reader in Lisp to manually add .o files to the end of the .a archive. (Basically, add new entries at the end of the archive.)
Maybe I haven't fully understood the issue though. In that case, you can fully ignore me :-)
Regards,
Florian
Le 6 oct. 2015 07:50, "Daniel Kochmański" <daniel@turtleware.eu> a écrit :
>
>
> Faré writes:
>
> > On Tue, Oct 6, 2015 at 1:18 AM, Daniel Kochmański <daniel@turtleware.eu> wrote:
> >>
> >> Faré writes:
> >>
> >>> Difficulties making monolithic-lib-op portable suggest that it (and
> >>> maybe also lib-op) should output an object file as if by ld -r rather
> >>> than a static library. Indeed, there is no *portable* way to combine
> >>> several .a files into a single one on a BSD system (including MacOS
> >>> X). Or should that be the case only on said systems?
> >>
> >> We have currently bug regarding combining static libraries[1], but doesn't
> >> BSD nor OSX support libtool? If yes, then we can just extract all
> >> objects from static archive and combine them again.
> >>
> >> [1] https://gitlab.com/embeddable-common-lisp/ecl/issues/177
> >>
> >> In one of the comments @Whimse provides a working solution using
> >> libtool.
> >>
> > Do you require libtool to be installed on BSD (including OSX)?
> > It certainly doesn't come standard, not even on Linux.
>
> It is at least dependency at ECL compilation time (bdwgc requires
> it). It isn't that unreasonable to require it for C backend.
> > Also, I could never get libtool to work correctly, even on Linux,
> > despite having alleged cut-and-paste recipes and a man page.
>
> @Whimse claims it works just OK for him. I'll have to adjust it to play
> nice with cross-compilation framework I'm working on now.
> >
> > I was thinking about MRI scripts, but they are also a GNUism not
> > supported on BSD.
> >
> > Why do we need a .a rather than a .o, anyway?
> > For the proposed use case, a .o seems more reasonable.
>
> That's what we do - we combine .o files. But Sometimes we want to
> combine with already built static libraries. That's when such approach
> would be necessary. Mentioned bug affects only such situations. If you
> just do monolithic build from lisp lisp sources then there's not a
> problem.
> >
> > —♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
> > Director is a misnomer. You're a hoper. You put all these people together and
> > you hope it all works out. — Frank Oz, director of "Dirty Rotten Scoundrels"
>
> --
> Daniel Kochmański | Poznań, Poland
> ;; aka jackdaniel
>
> "Be the change that you wish to see in the world." - Mahatma Gandhi
>