libc++ & compiling C++ sources on 10.6 for non-macports users
Sergey Fedorov
vital.had at gmail.com
Fri Apr 4 22:54:31 UTC 2025
If the question is whether it is possible to compile for 10.6 x86_64, then certainly yes.
However, you seem to be doing rather non-trivial thing: compiling on 10.6 with libc++ from 10.7 and intention to have binaries working on 10.6+.
If you do not have to build texlive often and have some space on a drive, won’t it be easier to just use a native C++ runtime, libstdc++, for 10.6? Of course, that means that you will need two set-ups, for 10.6 builds and 10.7+.
On the other hand, you may try using a set-up which I used on powerpc to build against libc++. Since it works on 10.6 ppc, there are no reasons for it not to work on 10.7+ on Intel. However, that gonna require a custom set-up, obviously.
(Sorry, this may not be an answer you wanted.)
Serge
On Apr 5, 2025 at 06:33 +0800, grey <artkiver at gmail.com>, wrote:
> I'm not too sure since you didn't specify how legacy for older OS X
> systems you are intending?
>
> Since MacPorts deprecated Tiger and we lost kencu earlier this year;
> maybe this blog post from Dr. Brian Robert Callahan will be helpful?
>
> https://briancallahan.net/blog/20250329.html
>
> Admittedly, it looks as if he is making use of Tigerbrew
> (https://github.com/mistydemeo/tigerbrew) and using GCC not LLVM/Clang
> but it's relatively recent and about the best reference I can think of
> off the top of my head as far as individuals toiling in similar
> realms. I realize it's not really helpful with your specific questions
> about static compilation.
>
> Doubtlessly others might have better suggestions.
>
>
> On Fri, Apr 4, 2025 at 9:51 PM Mojca Miklavec <mojca at macports.org> wrote:
> >
> > Hi,
> >
> > I've been using the latest clang++-mp-xx compiler (whatever the latest
> > happened to be in a particular year) on 10.6 for ages, in order to
> > compile TeX Live for non-macports users.
> >
> > If I remember correctly, I usually took libc++ from 10.7 SDK in order
> > to ensure that the resulting binaries would work out of the box for
> > any >= Lion user, and on 10.6 for anyone who happened to have libc++
> > installed. Sometimes libc++ got overwritten by MacPorts without me
> > noticing, and then some Lions users would complain, I would install an
> > old version of libc++ again, and things started working for everyone
> > again.
> >
> > This year I switched to clang 17 and a user of macOS 10.13 started
> > complaining about
> >
> > dyld: Symbol not found: ___emutls_get_address
> > Referenced from: /LocalApps/texlive/bin/x86_64-darwinlegacy/luajithbtex
> > Expected in: /usr/lib/libc++.1.dylib
> >
> > https://tug.org/pipermail/tlbuild/2025q2/005706.html
> >
> > An older binary that was compiled last year with an older clang works
> > for that user.
> >
> > I did try to copy Lion's libc++ to /usr/lib again, but this time the
> > compilation no longer works:
> >
> > > /opt/local/bin/clang++-mp-17 a.cpp -o ./a
> > dyld: Library not loaded: /usr/lib/libc++.1.dylib
> > Referenced from: /opt/local/libexec/llvm-17/bin/clang++
> > Reason: no suitable image found. Did find:
> > /usr/lib/libc++.1.dylib: can't map
> > /usr/lib/libc++.1.dylib: can't map
> >
> > Most likely because libc++ was meant to be modernised in order to be
> > able to support newer C++ standards.
> >
> > https://trac.macports.org/ticket/62426
> >
> > Ken was hinting that static compilation might be feasible, but I'm
> > unable to figure out how exactly.
> >
> > Does anyone know if compiling on 10.6 for other legacy macOS versions
> > is still feasible, and if so, what should I modify?
> >
> > Thank you very much,
> > Mojca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20250405/b57188d9/attachment.htm>
More information about the macports-dev
mailing list