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)
Mon, Apr 22, 7:15 AM
Unknown Object (File)
Sun, Apr 21, 9:42 PM
Unknown Object (File)
Fri, Apr 19, 7:58 PM
Unknown Object (File)
Wed, Apr 10, 5:32 PM
Unknown Object (File)
Wed, Apr 10, 5:31 PM
Unknown Object (File)
Wed, Apr 10, 5:29 PM
Unknown Object (File)
Wed, Apr 10, 5:29 PM
Unknown Object (File)
Wed, Apr 10, 4:43 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20567
Build 19988: arc lint + arc unit

Event Timeline

Generally looks fine to me.

lib/libelf/Makefile
85

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

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

lib/libelf/Makefile
85

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
85

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

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

lib/libelf/Makefile
81

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

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