This is needed in order to build various LLVM binutils (e.g. addr2line)
as well as clang/lld/lldb.
Co-authored-by: Jessica Clarke <jrtc27@FreeBSD.org>
Differential D31057
Allow bootstrapping llvm-tblgen on macOS and Linux arichardson on Jul 5 2021, 5:17 PM. Authored by Tags None Referenced Files
Details This is needed in order to build various LLVM binutils (e.g. addr2line) Co-authored-by: Jessica Clarke <jrtc27@FreeBSD.org> compiles on ubuntu 18.04 (and worked on macOS when I last tried)
Diff Detail
Event Timeline
Comment Actions https://reviews.freebsd.org/P512 is a more complete version I wrote, though presumably will fail on Linux currently due to the sysctl and fcntl changes you had to make. __has_include is probably a nicer way to do it than I did, too; I just compared FreeBSD, macOS and Linux config.h files. Comment Actions Ah nice, I didn't think about adding LDFLAGS+= -Wl,-dead_strip. Will try to merge your changes into this. Comment Actions merge @jrtc27's changes to the config file (I didn't include the LLDB changes since we never bootstrap it) Comment Actions Looks OK to me but will defer to @dim for questions about maintainability / expected impact on future clang/llvm updates Comment Actions Yeah, the lldb and lldb-server change aren't needed as those aren't bootstrap tools, but what about lld? Comment Actions I'm not too troubled by the various hacks in the config.h files, as we already have a few of those. On the other hand, if the ifdef maze becomes too large, then it might start to make sense to have different pregenerated .h files for different OS/arch combinations. That said, all the other stuff with sysctl.h and fcntl.h seems very ugly to me, and I'd rather leave it out if at all possible. Or at least, separate it out to a separate commit.
Comment Actions More complete version. Now builds Clang+LLD successfully on Ubuntu and llvm-tblgen on macOS (clang probably works but I don't want to overheat my laptop)
Comment Actions Couple of comments, otherwise looks good from my perspective.
Comment Actions LGTM
|