[llvm-dev] Improving x32 support

Harald van Dijk via llvm-dev llvm-dev at lists.llvm.org
Sat Oct 24 08:52:00 PDT 2020


Hi Adrian,

On 24/10/2020 16:30, John Paul Adrian Glaubitz wrote:
> Hi Harald!
> 
> On 10/24/20 5:15 PM, Harald van Dijk via llvm-dev wrote:
>> I have been working on improving the x32 support in LLVM.
> 
> I haven't checked your changes yet, hence I'm asking right away: Do you also have a fix
> for the search paths for the driver? [1] I tried to contribute that change back then but
> somehow the discussion ceased at some point.

I merely added x86_64-pc-linux-gnux32 to X86_64Triples, sorry. The 
/usr/include/x86_64-linux-gnux32 and /usr/lib/x86_64-linux-gnux32 
directories are specific to Debian and not present on my system, so I 
did not need to make changes to support them to get things to work.

>> I have patched LLVM 11.0.0 to a good enough state where the tests that do not make sense
>> are disabled, and the rest of the tests pass when built for x32. Additionally, when those
>> same changes are applied to Rust's LLVM, they allow building Rust for x32 as well (after also
>> fixing some non-LLVM portability issues in Rust).
> 
> Ah, that's nice. Then we can finally bootstrap Rust for Debian/x32. Great work!
> 
> Do you have the fixes for Rust somewhere accessible?

I have not pushed these anywhere, but I went over my list of changes for 
Rust 1.47.0, and actually all of them are just changing 
#[cfg(target_arch = "x86_64")] to
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] in 
checks for various structure sizes, where the values being checked are 
only meant to apply to x86_64-linux-gnu, not x86_64-linux-gnux32.

>> For the moment, I have put this up as a single massive commit,
>> <https://github.com/hvdijk/llvm-project/commit/07c7cd28df079c6dce02f5d7ebba58c8f85039b7>.
> 
> I'll have a look and see if we can already use it in Debian.
> 
> In any case, thanks a lot for fixing this! Much appreciated!
> 
> Adrian
> 
>> [1] https://reviews.llvm.org/D52050
> 


More information about the llvm-dev mailing list