Page MenuHomeFreeBSD

stand: fix build with xtoolchain-llvm90
ClosedPublic

Authored by kevans on Aug 16 2019, 1:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 3:07 AM
Unknown Object (File)
Mar 19 2024, 4:17 AM
Unknown Object (File)
Jan 15 2024, 3:43 AM
Unknown Object (File)
Jan 13 2024, 4:50 AM
Unknown Object (File)
Dec 22 2023, 11:02 PM
Unknown Object (File)
Dec 4 2023, 12:45 AM
Unknown Object (File)
Nov 26 2023, 3:33 PM
Unknown Object (File)
Nov 3 2023, 11:51 PM
Subscribers
None

Details

Summary

ufsread.c grows a dependency on __ashldi3 with llvm90. This exposes itself primarily in gptboot and i386/boot2.

For gptboot, just start pulling in ashldi3.c ashrdi3.c lshrdi3.c into libsa for all archs as the number of archs requiring one or more of them keeps growing. qdivrem.c and quad.h can be trivially kicked out of libsa if we start pulling these from compiler-rt as qdivrem was only used to implement umoddi3, divdi3, moddi3 (also in qdivrem.c).

For boot2, grab ashldi3.c out of compiler-rt as well rather than trying to link against libsa (for now). -Wno-missing-prototypes is necessary to compile ashldi3.c standalone.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

stand/i386/boot2/Makefile
83 ↗(On Diff #60891)

in the past when we've grown these dependencies, it's blow the size limits out of the water so we've done other things to work around them. How much does this add to boot2? And what happens with gcc (either in-tree or out-of-tree) or old-clang when this is brought in? Listing it as a .o means it's always included in the binary output adding too the size.

stand/libsa/Makefile
31 ↗(On Diff #60891)

this whole chunk is orthogonal.

But same questions about size. how much does this affect the size? For a .a it's less of a big deal to include too much because the loader won't pull in .o's from the .a it doesn't need.

In either case, I'd do this change separately.

stand/i386/boot2/Makefile
83 ↗(On Diff #60891)

Old clang output w/ ashldi3:

-rw-r--r--  1 root  wheel   3088 Aug 16 08:29 ashldi3.o
-rwxr-xr-x  1 root  wheel  38216 Aug 16 09:07 boot2.out

Without:

-rwxr-xr-x  1 root  wheel  37068 Aug 16 09:09 boot2.out
stand/libsa/Makefile
31 ↗(On Diff #60891)

"kind of" orthogonal... there's conflicts between filenames in lib/libc/quad and compiler-rt; the former have qdivrem dependencies, the latter don't. We need to make sure we don't accidentally get lib/libc/quad versions.

stand/i386/boot2/Makefile
83 ↗(On Diff #60891)

boot2 has to fit in 7.5k... 38k is way beyond that... but there's headers and symbols there.

So can you give 'size' output?

stand/libsa/Makefile
31 ↗(On Diff #60891)

We can make this change without the change to boot2, and it is applicable to today's compilers.

stand/i386/boot2/Makefile
83 ↗(On Diff #60891)

Whoops, sorry.

Pre-ashldi3:

text   data    bss     dec      hex   filename
5197     12   5273   10482   0x28f2   /usr/obj/usr/home/kevans/dev/base/head/amd64.amd64/stand/i386/boot2/boot2.out

Post-ashldi3:

text   data    bss     dec      hex   filename
5197     12   5273   10482   0x28f2   /usr/obj/usr/home/kevans/dev/base/head/amd64.amd64/stand/i386/boot2/boot2.out
kevans edited the summary of this revision. (Show Details)

looks great to me.

stand/i386/boot2/Makefile
84 ↗(On Diff #60894)

that reminds me... this makefile needs to be rototilled extensively... but that's for another day.

This revision is now accepted and ready to land.Aug 16 2019, 4:03 PM