[tlbuild] Older Mac systems

Mojca Miklavec mojca.miklavec.lists at gmail.com
Fri Jan 19 06:56:49 CET 2018


On 19 January 2018 at 00:57, Karl Berry wrote:
>     The idea is to use the system libc++ library
>     whenever one is available and to fall back to the one shipped with TeX
>     Live whenever it is not.
>
> As far as distribution goes, I don't mind if you want to put shared libs
> in x86_64-darwinlegacy/ or wherever. Assuming it is legal, that is.
> I have no idea what Apple allows or forbids.

I would either put libc++ (which, from what I understand, should be
pretty liberal) or libstdc++ 3 (GPL 3).

> But how can you "fall back" to a different shared lib?  Can the Mac load
> a shared lib from a relative path, or the same directory as the binary
> (like Windows does), or some such?

A binary always hardcodes the path to the library, but one way of
"hardcoding" it is to say "@rpath/libc++.dylib" and then define @rpath
to be the following list: "/usr/lib/;../lib/". The the system will
first check for /usr/lib/libc++.dylib and in case that fails, check
for ../lib/libc++.dylib which could be shipped with TL.

Actually, I have three different options:

1.) Compile everything against libc++ using clang 5.0 and use the
above mentioned @rpath trick. This could be better for the newer
computers, but it would require shipping an additional library.

2.) Compile everything against gcc's libstdc++3 with
"-D_GLIBCXX_USE_CXX11_ABI=0" using clang 5.0 and then "relink" all the
binaries to use /usr/lib/libstdc++.dylib (libstdc++2 provided by the
OS) instead of /opt/local/lib/libgcc/libstdc++.dylib (libstdc++3
provided by the latest gcc). That way there would be no need for an
additional library.

3.) Compile everything against gcc's libstdc++3 and provide a copy of
libstdc++3 as in option 1.

Given the complaints about reduced speed (two fold) it might be best
to actually test how these different binaries perform before deciding.
Option 2 compiles without any issues.

>     PPC is slightly more challenging and cross-compiling will almost
>     certainly no longer work.
>
> As far as I'm concerned, it is totally fine to drop support for anything
> which cannot be reasonably achieved. Preferable to jumping through a lot
> of hoops. --karl

I need a bit more time to contemplate about which platforms make sense
to keep and it's a pity that we cannot get any numbers. Supporting
x86_64 down to 10.6 is the most useful one in my opinion, i386 is
probably the least useful one, but not that hard to support. PPC is
older than i386 and has its own charm (but one can also install TL via
MacPorts for example).

Mojca


More information about the tlbuild mailing list