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)
Thu, Dec 19, 3:35 PM
Unknown Object (File)
Tue, Dec 17, 4:30 PM
Unknown Object (File)
Mon, Dec 16, 3:45 PM
Unknown Object (File)
Fri, Dec 6, 9:50 PM
Unknown Object (File)
Nov 25 2024, 4:11 PM
Unknown Object (File)
Nov 22 2024, 11:23 AM
Unknown Object (File)
Sep 23 2024, 5:55 AM
Unknown Object (File)
Sep 20 2024, 10:16 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 25917

Event Timeline

stand/i386/boot2/Makefile
83

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

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

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

"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

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

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

stand/i386/boot2/Makefile
83

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

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