Page MenuHomeFreeBSD

Consolidate duplicated logic in csu Makefiles to lib/csu/Makefile.inc.
ClosedPublic

Authored by jhb on Jul 1 2020, 5:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 23 2024, 10:56 PM
Unknown Object (File)
Feb 23 2024, 10:55 PM
Unknown Object (File)
Feb 23 2024, 10:55 PM
Unknown Object (File)
Feb 23 2024, 12:08 PM
Unknown Object (File)
Dec 30 2023, 11:20 PM
Unknown Object (File)
Dec 20 2023, 2:14 AM
Unknown Object (File)
Dec 7 2023, 6:00 AM
Unknown Object (File)
Dec 3 2023, 12:30 PM
Subscribers

Details

Test Plan
  • make tinderbox, readelf -n of resulting /bin/sh, libc.so.7

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32095
Build 29613: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Jul 1 2020, 5:13 PM

I got tired of reworking the crt changes with lots of conflicts as I moved the ABI tag note around, so wanted to pause and simplify the build glue first so that the diffs would be smaller and more obvious.

The next step after this I think is to switch to having most of Makefile.inc in lib/csu/Makefile itself where the MD Makefiles become Makefile.inc so it's more like how libc's Makefile works, but I think this is a useful checkpoint before doing that.

lib/csu/amd64/Makefile
8

crtbrand.o is surely MI, but I'm not sure if ignore_init is MI as well or if it should remain MD (all arch do it, but I'm not sure if that's by design).

kib added inline comments.
lib/csu/amd64/Makefile
8

In theory it is up to the compiler (i.e. not even part of the ABI). Practically, I remember that gcc auto-detects where the constructors are called, from crt1 or by ld-elf.so, and adapts to the platform. And glibc was converted to contructors from ld-elf, which was the reason why we followed the suit.

I think we can claim that not calling constructors from crt is no longer MD.

This revision is now accepted and ready to land.Jul 2 2020, 3:02 AM
  • Centralize MI CTRT1OBJS.
This revision now requires review to proceed.Jul 2 2020, 11:11 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jul 3 2020, 12:09 AM
This revision was automatically updated to reflect the committed changes.