Page MenuHomeFreeBSD

Consolidate duplicated logic in csu Makefiles to lib/csu/

Authored by jhb on Jul 1 2020, 5:13 PM.


Test Plan
  • make tinderbox, readelf -n of resulting /bin/sh,

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

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 in lib/csu/Makefile itself where the MD Makefiles become so it's more like how libc's Makefile works, but I think this is a useful checkpoint before doing that.

8 ↗(On Diff #73975)

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.
8 ↗(On Diff #73975)

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, 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.