Page MenuHomeFreeBSD

Allow bootstrapping elftoolchain on MacOS and Linux
ClosedPublic

Authored by arichardson on Aug 17 2018, 2:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 16 2024, 2:09 PM
Unknown Object (File)
Jan 13 2024, 7:48 PM
Unknown Object (File)
Dec 20 2023, 12:53 AM
Unknown Object (File)
Dec 19 2023, 4:50 AM
Unknown Object (File)
Dec 11 2023, 1:32 AM
Unknown Object (File)
Nov 26 2023, 7:34 PM
Unknown Object (File)
Oct 10 2023, 8:27 PM
Unknown Object (File)
Sep 6 2023, 4:46 AM

Details

Summary

This is required in order to build on non-FreeBSD systems without setting
all the XAR/XSTRINGS/etc. variables

Test Plan

Builds on Linux/Mac

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Generally looks fine to me.

lib/libelf/Makefile
84 ↗(On Diff #46841)

Only style suggestion I have here is that a tab after the '+=' seems to be the style used in this file. I suspect Ed probably better understands if always using this on Linux is correct since he wrote the script, so I'll give him a chance to speak up before digging to understand why we only need this for Linux and not for other platforms.

emaste added inline comments.
contrib/elftoolchain/common/_elftc.h
375–380 ↗(On Diff #49874)

We will want to coordinate with upstream ELF Tool Chain for these - CC @kaiw and @jkoshy_users.sourceforge.net

lib/libelf/Makefile
84 ↗(On Diff #46841)

For Apple, FreeBSD, etc. in _libelf_config.h we have a #if defined(__amd64__) ... #elif defined(__aarch64__) ... tree to #define LIBELF_ARCH and such. This is not done for Linux; I'm not sure why.

lib/libelf/Makefile
84 ↗(On Diff #46841)

Actually, let's start fixing this in the in-tree FreeBSD headers and we can move this upstream after.

There are only three variables that need to be set, and only three known architectures in native-elf-format so we should be able to use an #if defined() tree for Linux also with equivalent functionality.

lib/libelf/Makefile
81 ↗(On Diff #49874)

Stock Elftoolchain sources should build out of the box on Linux though.

lib/libelf/Makefile
81 ↗(On Diff #49874)

Indeed, but (as with all contrib software in FreeBSD) we have bespoke Makefiles and don't use the upstream build infrastructure. native-elf-format.h is only needed when building on Linux I believe, and other archs use #ifdef (__x86_64__) etc. I don't object to the change here but think it would be better to just avoid needing native-elf-format.h altogether.

lib/libelf/Makefile
81 ↗(On Diff #49874)

I will look at moving to a #ifdef based scheme for Linux based hosts (elftoolchain ticket #563).

@arichardson I'm fine with this change in FreeBSD (if we end up with a different approach upstream we can just migrate to it on the next elftoolchain update).

This revision is now accepted and ready to land.Nov 23 2018, 1:56 AM