Skip to content
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

Please make ltsmaster build with recent LLVM #3138

Closed
ximion opened this issue Aug 18, 2019 · 5 comments
Closed

Please make ltsmaster build with recent LLVM #3138

ximion opened this issue Aug 18, 2019 · 5 comments

Comments

@ximion
Copy link
Contributor

ximion commented Aug 18, 2019

Hi!
In Debian, we are always bootstrapping LDC from ltsmaster, in order to pick up new architectures and ensure the compiler is built correctly and consistently (there were issues with that in the bast).
Unfortunately, when switching to LLVM 8, the ltsmaster branch will fail to build the bootstrap compiler.
Can the bootstrap compiler be made to work with recent LLVM versions?

@kinke
Copy link
Member

kinke commented Aug 18, 2019

Duplicate of #3109.

ensure the compiler is built correctly and consistently

Then please don't use ltsmaster, but deploy a compiler built with itself (e.g., ltsmaster -> v1.17 -> v1.17). Some features like -lowmem require a recent host compiler.

Can the bootstrap compiler be made to work with recent LLVM versions?

Backporting support for newer LLVM is always a hassle and may easily cause some regressions not caught by CI. This approach of relying on ltsmaster generally isn't scalable; firstly, ltsmaster is on the verge of not being able to bootstrap latest master anymore (and already isn't on 32-bit hosts) - upstream already requires a 2.079 frontend and libs; we are able to still maintain 2.068 support with minor mods, but noone knows for how long. As soon as that point is reached, one would need a multi-step bootstrap (e.g., ltsmaster ->2.087 -> master), in which case we'd have to backport support for newer LLVM versions to ltsmaster and the intermediate versions...
So an iterative approach (using previous version for bootstrapping) would make our lives here considerably easier. gdmd is newly supported as host compiler, so that might be another option for bootstrapping.

As for new platforms, that's the only reason we really need an ltsmaster right now, but that's an unsound approach too (adding compiler+libraries support in ltsmaster first, then porting that to master (with library changes going upstream, to further complicate matters)). We can already easily cross-compile the libs, we 'only' need to make the compiler itself cross-compilable too to overcome the bootstrapping issue on new platforms.

@ximion
Copy link
Contributor Author

ximion commented Aug 18, 2019

Then please don't use ltsmaster, but deploy a compiler built with itself (e.g., ltsmaster -> v1.17 -> v1.17). Some features like -lowmem require a recent host compiler.

We build LDC 4 times: Once the bootstrap compiler, then a regular LDC with the bootstrap compiler, and then once an LDC with static libraries and one with dynamic libraries built with the one from the previous step.

gdmd is newly supported as host compiler, so that might be another option for bootstrapping.

Building LDC with GDC would actually by perfect. That would solve a lot of problems for us. GDMD isn't available (yet) in Debian though, but that's way easier to package than anything else (like DMD itself). Would be super neat if LDC could build without the gdmd wrapper ^^

With that additional information I think it may be sensible to make LDC compile with itself on Debian and hope that it doesn't break like in the past (where LDC was segfaulting when compiling itself due to some LLVM bug, where the only way to get out of that was to re-bootstrap).
In the long run, compiling with GDC would ease the maintenance cost for LDC dramatically (as the GCC team is already handling all the needs and bootstrapping needs of the system compiler)

@kinke
Copy link
Member

kinke commented Aug 18, 2019

We build LDC 4 times

All fine then. 👍

Would be super neat if LDC could build without the gdmd wrapper ^^

Well I surely wouldn't want all that command-line-normalization stuff replicated in CMake. ;) - A recent wrapper is required too, see #3087.

@ximion
Copy link
Contributor Author

ximion commented Aug 31, 2019

Okay, so Debian bootstraps its LDC packages with GDC now :-)
This really reduces the maintenance cost of the LDC package a lot and it also worked without any issue for me, kudos for making this possible!
It also means that we're not dependent on the ltsmaster branch anymore and this bug report is pretty much obsolete unless you actually do want to port ltsmaster to more recent LLVM versions anyway.
From my perspective, you can also just close this issue.

@kinke
Copy link
Member

kinke commented Aug 31, 2019

Nice! As it's a duplicate anyway, I'm going to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants