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
F81650392: D26199.id.diff
Fri, Apr 19, 11:31 AM
Unknown Object (File)
Dec 11 2023, 12:45 AM
Unknown Object (File)
Dec 4 2023, 7:12 AM
Unknown Object (File)
Nov 6 2023, 10:29 AM
Unknown Object (File)
Nov 4 2023, 8:08 PM
Unknown Object (File)
Sep 15 2023, 2:24 AM
Unknown Object (File)
Sep 6 2023, 9:25 AM
Unknown Object (File)
Sep 4 2023, 1:47 AM
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.