Skip to content

Commit

Permalink
Pull in r336008 from upstream clang trunk:
Browse files Browse the repository at this point in the history
  Request init/fini array on FreeBSD 12 and later

  Summary:

  It seems a bad idea to change the default in the middle of a release
  branch due to possible changes in global ctor / dtor ordering between
  .ctors and .init_array. With FreeBSD 11.0's release imminent lets
  change the default now for FreeBSD 12 (the current development
  stream) and later.

  FreeBSD rtld has supported .init_array / .fini_array for many years.
  As of Jan 1 2017 all supported FreeBSD releases and branches will
  have support.

  Reviewers: dim, brooks, arichardson

  Reviewed By: dim, brooks, arichardson

  Subscribers: bsdjhb, krytarowski, emaste, cfe-commits

  Differential Revision: https://reviews.llvm.org/D24867

Requested by:	jhb
MFC after:	3 days
  • Loading branch information
DimitryAndric committed Jul 12, 2018
1 parent b027d65 commit 8c44114
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contrib/llvm/tools/clang/lib/Driver/ToolChains/Gnu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2375,6 +2375,8 @@ void Generic_ELF::addClangTargetOptions(const ArgList &DriverArgs,
bool UseInitArrayDefault =
getTriple().getArch() == llvm::Triple::aarch64 ||
getTriple().getArch() == llvm::Triple::aarch64_be ||
(getTriple().getOS() == llvm::Triple::FreeBSD &&
getTriple().getOSMajorVersion() >= 12) ||
(getTriple().getOS() == llvm::Triple::Linux &&
((!GCCInstallation.isValid() || !V.isOlderThan(4, 7, 0)) ||
getTriple().isAndroid())) ||
Expand Down

0 comments on commit 8c44114

Please sign in to comment.