-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libc++ on PowerPC: highly experimental, but working setup #4
Comments
Some port are here: http://macos-powerpc.org/packages_libcxx A lot of stuff is unrelated to C++, since MacPorts requires a separate archive per stdlib, so pure C ports cannot be fetched from the regular one, however it has ICU, CMake and darwin-xtools (built against libc++). I am not planning to build thousand of ports here as well in parallel to libstdc++-based ones, but I will likely try some more complex stuff. P. S. @RJVB @catap @Jazzzny @cooljeanius Looks like we can use |
P. S. @RJVB @catap @Jazzzny @cooljeanius Looks like we can use `libc++` on powerpc with minimal tweaks to the setup.
Any idea whether it will take much to upgrade it to a newer one?
No idea.
But what's the point? You observed as well as I did that libc++ requires more ressources to build and mostly runs slower than libstdc++ .
|
Avoid malloc hell where it happens :) |
Avoid malloc hell where it happens :)
? Malloc is not a C++ function...
What I think is that it might work better for a browser, for example, and that can have its bundled library.
Some browsers do bundle libc++ (or rather, link to their own static copy) but that's more so they can support "old" Mac OS versions and still use C++2001+ .
The GCC team strive for backwards compatibility of old OS versions and hardware, the LLVM project is just about the opposite. Both can have errors on platforms that aren't the main ones on which they're used, but unless you're looking for extra work and/or incomprehensible crashes I'd stick with the platform C++ runtime (AFAIK libstdc++ for PPC).
|
Those error happen due to existence of two Recent example of what I am talking about: iains/darwin-xtools#11 |
To be clear, this is not meant for regular users or regular use as the main system. For this reason packaged installers are not provided, so that nobody installs this by accident.
It is still unknown how far this can go, especially given that the current version of
libc++
we have is from LLVM 7, which is old. Still, this is much better than what MacPorts has on Snow Leopard x86 by default. Also, AFAICT, the setup is usable normally, not at “we can compile Hello World” level.Switching to
libc++
does not make the system strictly better off. In fact, 10.6 / libstdc++ on powerpc has arguably more stuff working than 10.6 / libc++ on x86. It does, however, solve some specific issues, and may work better with software which heroically assumes that Apple = libc++.There is no straight-forward way to bootstrap
libc++
-based installation at the moment, since to build againstlibc++
we need gcc supporting-stdlib=
flag, and gcc itself has dependencies which use C++. It seems to work fine, however, to install the basic toolchain and then use it to upgrade its dependencies, and build everything further directly forlibc++
.Very rough sketch of provisionally working procedure:
+stdlib_flag
variant. I have normally been using cctools and ld64 built againstllvm-powerpc
port (LLVM 7 with minor tweaks), which it the default in PowerPC Ports, but it should not matter much, other options should work too.darwin-xtools
can also be used to provide both cctools and ld64 components, though this is far less tested (by me).+default_runtime
. I could not make+emutls
work correctly today, so perhaps for now uselibcxx-powerpc +default_runtime -emutls
.macports.conf
, setdefault_compiler
tomacports-gcc-14
.libc++
. I have useddarwin-xtools
at this stage, because llvm failed to build against its own libraries.darwin-xtools
work fine, at least v. 1.1.0. Do not use mainstream port, use port from here.Known issues:
perl
anddb48
to have bugs breaking compilation with a modern gcc, but here we are.https://trac.macports.org/ticket/71915
https://trac.macports.org/ticket/71913
In such cases compiler can be forced to
gcc-4.2
, which builds them fine.Build error against
libc++
:type_traits: error: forming pointer to reference type 'std::__1::remove_extent<llvm::CHIArg&>::type'
iains/LLVM-7-branch#5The text was updated successfully, but these errors were encountered: