Enable PIE for CloudABI.
authorEd Schouten <ed@nuxi.nl>
Wed, 6 Apr 2016 15:37:06 +0000 (15:37 +0000)
committerEd Schouten <ed@nuxi.nl>
Wed, 6 Apr 2016 15:37:06 +0000 (15:37 +0000)
commit506f295a109918ae7449688e5d6eb0c024f895d0
treedfc1ddd6edd93baceeb06e3f10bf2bd13eb83728
parent406094728964cfdef630d25f6034c25175841870
Enable PIE for CloudABI.

As we're currently working on making CloudABI executables easier to
emulate in userspace (e.g., on OS X and Windows), it makes a whole lot
of sense to build these using PIE. By using PIE, they can simply be
loaded into the existing process address space without clashes.

PIE support got added to CloudABI's C library and seems to work pretty
well. CloudABI does not make use of an ld.so, so the binary's _start()
has all the logic in it to do the relocations.

Now that all but one bug in LLD relating to PIE support have been
squashed (and a patch for that is already in code review), I'd like to
go ahead and force the use of PIE for Clang 3.9. When released, we'll
also switch over to using LLD exclusively.

llvm-svn: 265546
clang/lib/Driver/ToolChains.h
clang/lib/Driver/Tools.cpp
clang/test/Driver/cloudabi.c
clang/test/Driver/cloudabi.cpp