Bug 272806 - aarch64's -m32 for system-clang uses -triple armv7-unknown-freebsd14.0 instead of -target armv7-unknown-freebsd14.0-gnueabihf (now worded for stable/14 and releng/14.?)
Summary: aarch64's -m32 for system-clang uses -triple armv7-unknown-freebsd14.0 instea...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 14.0-STABLE
Hardware: arm64 Any
: --- Affects Some People
Assignee: freebsd-toolchain (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-30 03:03 UTC by Mark Millard
Modified: 2023-10-01 14:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Millard 2023-07-30 03:03:47 UTC
-m32 using -triple armv7-unknown-freebsd14.0 leads to attempted usage that
involves floating point getting build problems like:

ld.lld: error: undefined symbol: __muldf3
. . .
did you mean: __muldc3
defined in: /usr/lib32/libgcc_s.so

ld.lld: error: undefined symbol: __divdf3
. . .
did you mean: __divdc3
defined in: /usr/lib32/libgcc_s.so

ld.lld: error: undefined symbol: __ltdf2
. . .

devel/llvm* ( or, at least, devel/llvm16+ ) likely should use the
correct target for FreeBSD by default as well. For 14.0 that would
be -m32 for aarch64 using:

-target armv7-unknown-freebsd14.0-gnueabihf

Of course, this will generalize to FreeBSD 14.1+ and 15+ as well and
to llvm17+ for them.

[It may be less certain what should be done for aarch64 FreeBSD
versions that do not have lib32. (Less reason to be using -m32.)]


I'll note that I would argue that requiring explicit

-m32 -target armv7-unknown-freebsd14.0-gnueabihf

like notation adds the the using code needing to track 14.x/15+/...
as things progress, even when not trying to do a cross build. Even
if made automatic, making it so ends up being explicit in more
places.
Comment 1 Mark Millard 2023-09-09 23:54:50 UTC
It is probably too late for releng/14.0 to have -m32 automatically
use armv7-unknown-freebsd14.0-gnueabihf .
Comment 2 Mark Millard 2023-09-09 23:58:00 UTC
armv7-unknown-freebsd15.0-gnueabihf has the same sort of
lack of default use for main as stable/14 and releng/14.?
do for armv7-unknown-freebsd14.0-gnueabihf at this point.