libcxx and gcc11/gcc12 #31
Replies: 11 comments 24 replies
-
From GCC-11 (and earlier with a suitable back port), it is possible to configure the compiler to accept -stdlib=
For earlier systems, IFF one can build a reliable libc++ for the platform, then it will also be possible to use the configuration option there. It will be essential to configure the libc++ build so that it makes use of the libc++abi from the existing libstd++ and also the unwinder from /usr/libSystem (10.6,) or /usr/lib/libgcc_s.1.dylib (10.4 10.5). Actually, on 10.7 there is very little that uses /ust/lib/libstdc++.dylib - it's more likely to be 3rd party stuff than anything on the system), so it will probably be quite smooth there. powerpc-darwin{8,9}: So .. IFF you:
... then I guess it will work... |
Beta Was this translation helpful? Give feedback.
-
@iains -- I did include your nanoseconds patch a few years back in our libc++ v5.0 build (that is currently the one we use on macports): at some future point, and after much discussion, something similar was eventually included upstream, ergo it all works nicely now on debian11 ppc. |
Beta Was this translation helpful? Give feedback.
-
And before anyone pushes to have the libc++ on macports updated to some newer version, the reason it is still at v5.0 is that works great, for years now, offers lots of features not available in MacOS until about MacOS 10.14 or so, and remains very compatible. (At a certain point software built against libc++ seems to lose compatibility with software built against older versions of libc++, so don't go looking for trouble with no good reason I figure). I was personally considering updating that libc++ to v7.0 once llvm/clang-7.0 for PPC was fixed perhaps, as one big upgrade. |
Beta Was this translation helpful? Give feedback.
-
sure gcc11 supports c++14. MacPorts plans to use gcc10-bootstrap as the bootstrap compiler to build everything that requires newer tooling eventually, so we should be very comfortable for the next few years at least. Once we get all the kinks out of problems we're having building gcc10-bootstrap, of course. Gotta keep everyone busy and thinking :> |
Beta Was this translation helpful? Give feedback.
-
@iains Which version of LIBCXX would you recommend to try? For one thing, I could use your from llvm-7 or llvm-8 tree. But I recall you mentioned elsewhere that ppc(64) support was improved in more recent LLVM? Would it be a better pick using libcxx-11 or libcxx-14? (As @catap explained, v. 15 does not build with GCC even for Intel presently, so latest version is off question.) |
Beta Was this translation helpful? Give feedback.
-
UPD. Well, I am trying to build One bug in source code discovered:
See: https://bugs.llvm.org/show_bug.cgi?id=38160 (so actually a bug, but easily fixed). Now need to fix a bunch of undefined symbols in |
Beta Was this translation helpful? Give feedback.
-
there were some changes needed to libcxx to support ppc, especially on darwin9 where there are some system math header issues. (I did pass those onto the libcxx folks, don't know what was incorporated). llvm-14 should build OK with gcc10.4+ at least on intel - but upstream has removed more of the powerpc-darwin code from it, so don't expect anything to work. TBH, I'd say that the llvm-711 branch version of libcxx is most likely to be most compatible with powerpc-darwin9 / rosetta. At some stage (in the not too too distant future) I hope to have an llvm-11 version with the powerpc-darwin port restored there. This is a useful version, since it can be built with cmake-3.9.6 which means that there's a path to building it starting from only gcc-4.2 .. (build cmake 3.9.6, xtools 0.7.0, gcc-10.4, and then llvm-11) .. but, yeah some of that stuff is not yet released ;) .. just pointing out the roadmap. |
Beta Was this translation helpful? Give feedback.
-
@kencu Ken, what would be the preferable way to handle LIBCXX update (I consider updating to v. 7.1 with @iains fixes)?
UPD. Just saw your reply above. From what I understand, |
Beta Was this translation helpful? Give feedback.
-
As far as I tried it, libcxx-5.0 worked OK on 10.5 PPC. It passed lots of the test suite (you can run the test suite for libcxx and libcxxabi yourself, and start to see how well it works). You can just use it right now with gcc10+, after some plan for coherent libc++ headers is sorted out. Regarding updating it to libcxx-7.0, my plan was to wait until @iains libcxx/llvm/clang/etc -7.0 is finished and works and then consider doing an upgrade all in one swoop, once it has been properly tested. |
Beta Was this translation helpful? Give feedback.
-
@barracuda156 answering your "what should i use" question is not so easy. Since llvm-7 (and more so since llvm-5), C++ has changed quite a bit, so that if you want to support modern C++ features [which both GCC and clang do] (from headers and/or the compiler) then you will need a newer set of headers than llvm-5/7 libcxx. If the features you want to support require a newer libc++.dylib than is installed on the system, you are into the "two libc++'s living together" territory and you should approach that with extreme caution and a clear head (i.e. figure out how it is going to work before it gets deployed).. We have an unfixed mess with two libstdc++ versions on earlier Darwin already, let's not make a second one..... which libcxx headers: I have been trying to find a way to figure out (roughly, at least) where the Xcode libcxx headers come from that correspond to each Xcode release. The plan would then be to identify a relevant set for each OS version .. .. I suspect that the minimum version we would want to use with GCC would be from LLVM-9 (if that works) because then we have the headers for C++20 support .. plus the exception specs. It is possible to add a work-around to the llvm-7 libcxx headers to provide the exception spec that GCC needs. So ... as with all toolchain / installed system stuff .. this needs very careful consideration .. it is not a question of "selling:" something - it's a question of making sure that it works properly by design, rather than luck ;) |
Beta Was this translation helpful? Give feedback.
-
@iains Resurrecting the issue since I have written a portfile to build libc++/libc++abi (from your llvm7 branch with a few extra patches) on PowerPC, rebuilt gcc12 to support stdlib flag, and it seems to be functional at least on some basic level. I have two technical questions here:
P. S. If you will consider sharing your work on version 11 (or later), it would be very helpful, and now practically: we have a ready set-up to test it in practice. Just |
Beta Was this translation helpful? Give feedback.
-
@iains Could you please say how
libcxx
can be used withgcc11
? (And will it even work for PowerPC?)@kencu mentions it here: https://trac.macports.org/ticket/64932
I have also found a rather old news referring to your patch: https://www.phoronix.com/scan.php?page=news_item&px=GCC-11-libcpp-LLVM-Support
Beta Was this translation helpful? Give feedback.
All reactions