ldc-developers / ldc

The LLVM-based D Compiler.
http://wiki.dlang.org/LDC
Other
1.21k stars 261 forks source link

[1.26] Build fails on 32bit architectures (x86, armv7l) #3729

Open susnux opened 3 years ago

susnux commented 3 years ago

Building 1.24 works fine on x86 and armv7l, but 1.26 does not. Building on one of that architectures result in the following error, the issue was introduces when updating this line: https://github.com/ldc-developers/ldc/blob/162ee0cd815ec0e3f8f646f78178833f19c4a657/dmd/sideeffect.d#L84

But dmd 2.096.1 builds fine on x86 and armv7l.

ldc-1.26.0-src/dmd/sideeffect.d(84):

Error: function `dmd.sideeffect.hasSideEffect.LambdaHasSideEffect.visit` cannot access frame of function `dmd.sideeffect.hasSideEffect`
JohanEngelen commented 3 years ago

what compiler are you using to build with?

susnux commented 3 years ago

what compiler are you using to build with?

llvm7 (7.0.1) Then building ldc 0.17.6 (bootstrap), with that ldc 1.12.0 gets built ( See #2926 ) and then finally 1.26.

JohanEngelen commented 3 years ago

I think 1.12 should be recent enough (dlang 2.082, bootstrap appears to be tested with 2.079), but just in case, can you try to build 1.26 with 1.24?

kinke commented 3 years ago

CI builds 2 32-bit compilers (Win32 + Android ARM7), so recent host compilers work.

susnux commented 3 years ago

I think 1.12 should be recent enough (dlang 2.082, bootstrap appears to be tested with 2.079), but just in case, can you try to build 1.26 with 1.24?

Building 1.26 with 1.24 works fine, so a current 32bit bootstrap chain looks like 0.17.6 -> 1.12.0 -> 1.24.0 -> 1.26

JohanEngelen commented 3 years ago

It could be a bug in 1.12 that got fixed somewhere along the way. So perhaps bootstrapping through, say, v1.13 would avoid having to go through 1.24.

susnux commented 3 years ago

FYI: 1.25.1 is the last version working with the 1.12.0 intermediate compiler.

It could be a bug in 1.12 that got fixed somewhere along the way. So perhaps bootstrapping through, say, v1.13 would avoid having to go through 1.24.

Then the chain would still be like 0.17.6 -> 1.12.0 -> 1.13.0 -> 1.26 as 1.13 can not be build without 1.12 (#2926)

JohanEngelen commented 3 years ago

you can also try with 1.10 or 1.11. Regardless, it is good to document this perhaps. I'm thinking about a "requirements" section in the readme. (I.e. what gcc version minimum, minimum python version, minimum D compiler version..)

kinke commented 3 years ago

FWIW, I think cross-compiling the compiler is much simpler than such a tedious multi-step bootstrapping process, especially as soon as master doesn't support the latest LLVM version supported by 0.17.x anymore, and so multiple LLVM builds enter the picture. Cross-compiling the compiler is done for various Azure CI jobs; bootstrapping a 64-bit compiler still works (and is CI-tested) with 0.17.x and GDC.