Page MenuHomeFreeBSD

arm64 lib32: change clang to allow -m32 on arm64
ClosedPublic

Authored by karels on Jul 8 2023, 10:18 PM.
Tags
None
Referenced Files
F112211375: D40943.diff
Fri, Mar 14, 9:51 AM
F112200335: D40943.id124511.diff
Fri, Mar 14, 5:51 AM
Unknown Object (File)
Mon, Feb 24, 1:42 AM
Unknown Object (File)
Jan 18 2025, 4:26 AM
Unknown Object (File)
Jan 17 2025, 2:24 PM
Unknown Object (File)
Jan 16 2025, 8:06 AM
Unknown Object (File)
Jan 15 2025, 3:03 PM
Unknown Object (File)
Dec 5 2024, 11:59 PM
Subscribers
None

Details

Summary

The FreeBSD driver support for clang tested explicitly for 32-bit
Intel, MIPS, or PowerPC targets where /usr/lib32/libcrt1.o was
present to decide whether -m32 should use /usr/lib32. At jrtc27's
suggestion, simply test for a 32-bit platform rather than adding
arm to the list. This is one step in adding support for -m32 on
arm64.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

karels created this revision.

@dim, we need a way to force the make system to bootstrap a compiler with this change, or the lib32 build breaks. Can we change the version string, etc?

Bump lib/clang/freebsd_cc_version.h

Indeed, bumping lib/clang/freebsd_cc_version.h is the way to force a bootstrap clang rebuild. The change to clang/lib/Driver/ToolChains/FreeBSD.cpp should also be upstreamed.

This revision is now accepted and ready to land.Jul 9 2023, 10:03 PM
In D40943#932160, @dim wrote:

Indeed, bumping lib/clang/freebsd_cc_version.h is the way to force a bootstrap clang rebuild. The change to clang/lib/Driver/ToolChains/FreeBSD.cpp should also be upstreamed.

Thanks, I didn't realize that there is a FreeBSD-specific version; that helps.

How do we go about upstreaming?

In D40943#932160, @dim wrote:

Indeed, bumping lib/clang/freebsd_cc_version.h is the way to force a bootstrap clang rebuild. The change to clang/lib/Driver/ToolChains/FreeBSD.cpp should also be upstreamed.

Thanks, I didn't realize that there is a FreeBSD-specific version; that helps.

How do we go about upstreaming?

It's trivial enough I just committed it directly: https://github.com/llvm/llvm-project/commit/3450272fc281979388bb845a9fffb59b42cc2e7e

This revision now requires review to proceed.Jul 11 2023, 7:51 PM
This revision is now accepted and ready to land.Jul 11 2023, 7:53 PM

I've merged this back through llvm13. I'll let the changes settle for a day and then merge to quarterly so CI can use them.

Please add a pointer to the upstream commit when committing this so it's clear this isn't a downstream diff

Please add a pointer to the upstream commit when committing this so it's clear this isn't a downstream diff

Already done in my copy.