mistydemeo / tigerbrew

Experimental fork of homebrew for PPC Macs on Tiger
Other
539 stars 129 forks source link

Clang-5.0 / libc++ and supporting toolchain software (cctools, ld64, etc) for Tiger i386. #666

Open kencu opened 4 years ago

kencu commented 4 years ago

Hello. I made up an installer for clang-5.0 (with llvm-5.0 plus the supporting software for Tiger i386. It includes a version of libc++ that installs on Tiger as well. At present there is no version for Tiger PPC, but I'm working on that idea.

It has been modified from the llvm defaults in two ways; it includes an implementation of thread_local storage culled from the linux world that works on Tiger, and it also can accept a newer -stdlib argument -stdlib=macports-libstdc++ that allows it to link against a newer libstdc++.dylib from gcc 7.4.0.

I'd like to make it available for anyone interested to test. https://drive.google.com/open?id=1vO-Sasqn_I-gvjbFN1u6cZQeQsseqCVT. It installs into /opt/local -- which is not necessarily ideal, as that is where MacPorts installs into as well, but for the moment at least, that is the installer I have available.

kencu commented 4 years ago

I'm not sure if this installer will go ahead and install the libc++.dylib parts into /usr/lib. I don't believe it will do that. After you install this software, you can decompress that from

/opt/local/var/system_roots/libcxx-5.0.1-4.tgz

and install it manually (clang-5.0 will need it to run).

kencu commented 4 years ago

I'm happy to report that clang-7.1.0 / llvm-7.1.0 are also building and appear to be working well on 10.4 Tiger Intel. That is useful, as llvm-7 is quite close to producing workable PPC code as well, and with some enhancements, might be a good cross-compiler until clang-7 for 10.4 PPC is available.

I can make that compiler available if there is interest.

programmingkidx commented 4 years ago

Yes, please make Clang 7.1 available :)

programmingkidx commented 4 years ago

I tried your link above for Clang 5. I can confirm that libc++.1.dylib is not installed. When I did manually install it with the directions above, I was able to build a simple test program with clang++-mp-5.0.

I have a few suggestions on a better installer. First I would update the PATH variable to point to the location of the bin folder. This can be done by updating the file ~.bash_profile with this line: PATH=$PATH:/opt/local/bin/. That way the user can immediately start using the programs installed. Next I would include a clang symbolic link so the user can use this compiler by just typing 'clang' at the terminal. The last change needed would be to automatically install the libc++.dylib file.

Thank you very much for this installer. Please let me know if there is anthing I can do to help.

kencu commented 4 years ago

Thanks for your look-over. Please try to break it, I would like to know what warts it might have! My next step would be to see if I can run the entire llvm/clang test suite. Let's hope you and others find this in some way useful.

programmingkidx commented 4 years ago

This is exactly what I was looking for. I was even thinking about making my own installer package for llvm 4.0. Glad I found your post! Long live Mac OS 10.4.

On Apr 13, 2020, at 3:57 PM, Ken notifications@github.com wrote:

Thanks for your look-over. Please try to break it, I would like to know what warts it might have! My next step would be to see if I can run the entire llvm/clang test suite. Let's hope you and others find this in some way useful.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

mistydemeo commented 4 years ago

This is amazing. 🙌 Thanks for putting this together.

kencu commented 4 years ago

Some benefits from coronavirus :> Have to stay home, nothing better to do!

pk2061 commented 4 years ago

Can you also make an Installer for PPC, please? That would be really great! :-)

programmingkidx commented 4 years ago

Also could the "mp-5.0" suffix be removed from all the commands' name. It interferes with various scripts that depend on the standard name.

kencu commented 4 years ago

I would love to make a PPC version, as soon as a few final bits are worked out. There is an issue still getting the llvm PPC backend to output the proper Darwin PowerPC ABI (it was just never finished, and still isn't). The Intel architecture ABI was properly finished, though.

programmingkidx commented 4 years ago

I tried my best to build the CLang test-suite but couldn't. There were so many problems. Maybe someone else will have better luck.

https://llvm.org/docs/TestSuiteGuide.html

pepas-everly commented 1 year ago

Hi @kencu, thanks for this thread, I wanted to ask you what the current state of Darwin/PPC was for clang? Was the Darwin PowerPC ABI ever supported?

kencu commented 1 year ago

At present, we do not have a lot of progress to report.

There is really only one qualified compiler-level developer who is interested, Iain Sandoe, and he has a lot of other work to do. He maintains the entire gcc toolchain for Darwin, for one, which is a big job right now due to the move to arm on MacOS. All this is charity unpaid work, and he has a real job to make a living.

He has put together some updated tools (cctools, ld64, etc) and in particular his ld64 additions for PowerPC are unique. He has been working on making the last LLVM version that supported Darwin PowerPC, llvm-7.1, work properly for PPC Darwin by adding in the missing parts to generate the properly-configured ABI.

His work on that is here: https://github.com/iains/LLVM-7-branch

I see the last commit was in January 2020, however. A working version of that branch that supports the Darwin PowerPC ABI is not yet in that branch/repo, however.

So for now, we have only gcc as a viable compiler on Darwin PowerPC, but at least we have that. I have built up to gcc11 on Leopard PPC, and it works great. I think gcc12 is also working well there. The last gcc that can be bootstrapped with the system toolchain is gcc10, so you need to build something in the gcc7-gcc10 range first, then use that to build gcc11 or gcc12.

pepas-everly commented 1 year ago

Thanks so much for the status update!

Dumping a few other links here which I came across in case others stumble upon this and want additional context: