Page MenuHomeFreeBSD

GCC 9 require builtins from libcompiler_rt for i386 rtld.
AbandonedPublic

Authored by jhb on Aug 26 2020, 6:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 4, 10:31 PM
Unknown Object (File)
Mon, Nov 25, 2:13 AM
Unknown Object (File)
Thu, Nov 14, 1:44 PM
Unknown Object (File)
Nov 3 2024, 10:56 AM
Unknown Object (File)
Oct 7 2024, 8:07 AM
Unknown Object (File)
Oct 7 2024, 8:07 AM
Unknown Object (File)
Oct 7 2024, 7:34 AM
Unknown Object (File)
Oct 2 2024, 3:54 PM
Subscribers

Details

Reviewers
emaste
dim
Test Plan
  • build i386 with the i386-gcc9 toolchain

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 33175
Build 30524: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Aug 26 2020, 6:44 PM

Which builtins are those? As far as I know with rtld we should be careful not to just pull in external dependencies. @kib is usually guarding against that sort of stuff. :)

Indeed, it would be even useful to note that symbol names in the comment.

Can you show the output of size ld-elf.so.1 built this way with gcc 9 ?

> size ld-elf.so.1
    text   data    bss      dec       hex   filename
  124102    964   2992   128058   0x1f43a   ld-elf.so.1

Symbols I could find:

rtld_printf.o:
         U __udivmoddi4

I wonder if instead rtld-libc/Makefile.inc shouldn't be patched. We seem to pull in some individual intrinsics there for other platforms already (with rtld_printf as a common offender)

In D26199#582284, @jhb wrote:
> size ld-elf.so.1
    text   data    bss      dec       hex   filename
  124102    964   2992   128058   0x1f43a   ld-elf.so.1

Symbols I could find:

rtld_printf.o:
         U __udivmoddi4

I wonder if instead rtld-libc/Makefile.inc shouldn't be patched. We seem to pull in some individual intrinsics there for other platforms already (with rtld_printf as a common offender)

Yes, I think this is the right or at least consistent, approach.
There is a reason why we prefer not to link with libc. But for libgcc.a/compiler_rt, we might reconsider.

In D26199#582293, @kib wrote:
In D26199#582284, @jhb wrote:
> size ld-elf.so.1
    text   data    bss      dec       hex   filename
  124102    964   2992   128058   0x1f43a   ld-elf.so.1

Symbols I could find:

rtld_printf.o:
         U __udivmoddi4

I wonder if instead rtld-libc/Makefile.inc shouldn't be patched. We seem to pull in some individual intrinsics there for other platforms already (with rtld_printf as a common offender)

Yes, I think this is the right or at least consistent, approach.
There is a reason why we prefer not to link with libc. But for libgcc.a/compiler_rt, we might reconsider.

Hmm, so the other symbols like qdivrem.c we have in libc, but udivmoddi4 is only in compiler_rt sources, not libc sources. I also can't find where we have a .PATH to libc/quad anywhere in rtld which is where qdivrem.c lives which is even more confusing. arm already links in libcompiler_rt directly for rtld FWIW.