This provides additional compiler builtins divmoddi4, udivmoddi4,
and __floatundidf required by GCC.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 52365 Build 49256: arc lint + arc unit
Event Timeline
This change combined with the previous two in the stack are enough to build and link an i386 kernel with GCC 12. (World already builds.)
sys/conf/Makefile.i386 | ||
---|---|---|
37 | A bare /usr/lib? Isn't there some symbol for this? And doesn't this pollute the kernel build with whatever is on the host? We've often put things like this in libkern.a to avoid this issue. |
sys/conf/Makefile.i386 | ||
---|---|---|
37 | The = means "use sysroot", so =/usr/lib is not the same thing as /usr/lib. I don't think we have macros anywhere for the string "/usr/lib". It's hardcoded that way in ldscripts, compiler sources, etc. Normally your compiler driver passes it, but we still link the kernel with ld rather than cc. We don't currently have libkern variants of these builtins, and I wasn't sure if it was worth adding them just for i386 kernels built with GCC (I'm also not even sure what these builtins do). For rtld we linked with libcompiler_rt as well. The root issue being that clang is happy to generate a short sequence of instructions for certain operations whereas GCC always wants to call out to an intrinsic. |
sys/conf/Makefile.i386 | ||
---|---|---|
37 | Humm, so divmoddi4 and udivmoddi4 are in fact not too hard, they are just like [u]divdi3 except they also return the remainder. __floatundidf is more of a pain. It needs to convert a quad to a double. It turns out there's one place in the kernel we are using floating point (sys/kern/subr_clockcalib.c) and GCC emits calls to this for the conversions from uint64_t to double. :( |