summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/Solaris.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-2/+2
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368942
* [Driver] Properly use values-X[ca].o, values-xpg[46].o on SolarisRainer Orth2019-08-051-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Builtins-*-sunos :: compiler_rt_logbf_test.c currently FAILs on Solaris, both SPARC and x86, 32 and 64-bit. It turned out that this is due to different behaviour of logb depending on the C standard compiled for, as documented on logb(3M): RETURN VALUES Upon successful completion, these functions return the exponent of x. If x is subnormal: o For SUSv3-conforming applications compiled with the c99 com- piler driver (see standards(7)), the exponent of x as if x were normalized is returned. o Otherwise, if compiled with the cc compiler driver, -1022, -126, and -16382 are returned for logb(), logbf(), and logbl(), respectively. Studio c99 and gcc control this by linking with the appropriate version of values-xpg[46].o, but clang uses neither of those. The following patch fixes this by following what gcc does, as corrected some time ago in Fix use of Solaris values-Xc.o (PR target/40411) https://gcc.gnu.org/ml/gcc-patches/2018-01/msg02350.html and https://gcc.gnu.org/ml/gcc-patches/2018-01/msg02384.html. Tested on x86_64-pc-solaris2.11, sparcv9-sun-solaris2.11, and x86_64-pc-linux-gnu. Differential Revision: https://reviews.llvm.org/D64793 llvm-svn: 367866
* [Driver] Support -fsanitize=function on Solaris/x86Rainer Orth2019-07-301-0/+3
| | | | | | | | | | | | | | | | UBSan-Standalone-x86_64 :: TestCases/TypeCheck/Function/function.cpp currently FAILs on Solaris/x86_64: clang-9: error: unsupported option '-fsanitize=function' for target 'x86_64-pc-solaris2.11' AFAICS, there's nothing more to do then enable that sanitizer in the driver (for x86 only), which is what this patch does, together with updating another testcase. Tested on x86_64-pc-solaris2.11. Differential Revision: https://reviews.llvm.org/D64488 llvm-svn: 367351
* [Driver] Don't pass --dynamic-linker to ld on SolarisRainer Orth2019-07-161-4/+0
| | | | | | | | | | | | | | | | | I noticed that clang currently passes --dynamic-linker to ld. This has been the case since Solaris 11 support was added initially back in 2012 by David Chisnall (r150580). I couldn't find any patch submission, let alone a justification, for this, and it seems completely useless: --dynamic-linker is a gld compatibility form of the option, the native option being -I. First of all, however, the dynamic linker passed is simply the default, so there's no reason at all to specify it in the first place. This patch removes passing the option and adjusts the affected testcase accordingly. Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D64493 llvm-svn: 366202
* [Sanitizers] Don't use clang_rt.sancov_{begin,end} on SolarisRainer Orth2019-07-081-14/+0
| | | | | | | | | | | | | As explained in https://reviews.llvm.org/D63601, there's no point using clang_rt.sancov_{begin,end} on Solaris any longer. This companion patch to the above removes their use from the driver. Tested on amd64-pc-solaris2.11 Differential Revision: https://reviews.llvm.org/D63602 llvm-svn: 365396
* [asan] Add gcc 8's driver option -fsanitize=pointer-compare and ↵Pierre Gousseau2019-04-121-0/+2
| | | | | | | | | | | | -fsanitize=pointer-substract. Disabled by default as this is still an experimental feature. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D59221 llvm-svn: 358285
* [Driver] Don't pass default value to getCompilerRTArgStringPetr Hosek2019-01-211-2/+2
| | | | | | | | Using static library is already a default. Differential Revision: https://reviews.llvm.org/D56043 llvm-svn: 351710
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [Solaris] Silence -pthread warning on SolarisFedor Sergeev2018-02-061-0/+5
| | | | | | | | | | | | | | | | | | | | | Summary: During make check-all on Solaris, I see several instances of this warning: clang-6.0: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument] Since Solaris 10, libpthread has been folded into libc, so there's nothing to do. gcc just ignores -pthread here. Darwin claims the option to silence the warning, and this patch follows that lead. Reviewers: rsmith, fedor.sergeev Reviewed By: fedor.sergeev Subscribers: cfe-commits, fedor.sergeev Differential Revision: https://reviews.llvm.org/D41242 llvm-svn: 324344
* [Sanitizers] Basic Solaris sanitizer support (PR 33274)Alex Shlyapnikov2018-02-051-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch (on top of https://reviews.llvm.org/D35755) provides the clang side necessary to enable the Solaris port of the sanitizers implemented by https://reviews.llvm.org/D40898, https://reviews.llvm.org/D40899, and https://reviews.llvm.org/D40900). A few features of note: * While compiler-rt cmake/base-config-ix.cmake (COMPILER_RT_OS_DIR) places the runtime libs in a tolower(CMAKE_SYSTEM_NAME) directory, clang defaults to the OS part of the target triplet (solaris2.11 in the case at hand). The patch makes them agree on compiler-rt's idea. * While Solaris ld accepts a considerable number of GNU ld options for compatibility, it only does so for the double-dash forms. clang unfortunately is inconsistent here and sometimes uses the double-dash form, sometimes the single-dash one that confuses the hell out of Solaris ld. I've changed the affected places to use the double-dash form that should always work. * As described in https://reviews.llvm.org/D40899, Solaris ld doesn't create the __start___sancov_guards/__stop___sancov_guards labels gld/gold/lld do, so I'm including additional runtime libs into the link that provide them. * One test uses -fstack-protector, but unlike other systems libssp hasn't been folded into Solaris libc, but needs to be linked with separately. * For now, only 32-bit x86 asan is enabled on Solaris. 64-bit x86 should follow, but sparc (which requires additional compiler-rt changes not yet submitted) fails miserably due to a llvmsparc backend limitation: fatal error: error in backend: Function "_ZN7testing8internal16BoolFromGTestEnvEPKcb": over-aligned dynamic alloca not supported. However, inside the gcc tree, Solaris/sparc asan works almost as well as x86. Reviewers: rsmith, alekseyshl Reviewed By: alekseyshl Subscribers: jyknight, fedor.sergeev, cfe-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40903 llvm-svn: 324296
* [Solaris] gcc toolchain handling revampFedor Sergeev2018-01-231-44/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: General idea is to utilize generic (mostly Generic_GCC) code and get rid of Solaris-specific handling as much as possible. In particular: - scanLibDirForGCCTripleSolaris was removed, relying on generic CollectLibDirsAndTriples - findBiarchMultilibs is now properly utilized to switch between m32 and m64 include & lib paths on Solaris - C system include handling copied from Linux (bar multilib hacks) Fixes PR24606. Reviewers: dlj, rafael, jyknight, theraven, tstellar Reviewed By: jyknight Subscribers: aaron.ballman, mgorny, krytarowski, ro, joerg, cfe-commits Differential Revision: https://reviews.llvm.org/D35755 llvm-svn: 323193
* Introduce -nostdlib++ flag to disable linking the C++ standard library.Nico Weber2017-07-251-1/+1
| | | | | | | | | | | | | | | Projects that want to statically link their own C++ standard library currently need to pass -nostdlib or -nodefaultlibs, which also disables linking of the builtins library, -lm, and so on. Alternatively, they could use `clang` instead of `clang++`, but that already disables implicit addition of -lm on some toolchains. Add a dedicated flag -nostdlib++ that disables just linking of libc++ / libstdc++. This is analogous to -nostdinc++. https://reviews.llvm.org/D35780 llvm-svn: 308997
* Unconditionally use .init_array instead of .ctors on Solaris.Aaron Ballman2017-07-141-1/+1
| | | | | | Patch by Fedor Sergeev llvm-svn: 308038
* [Driver] Consolidate tools and toolchains by target platform. (NFC)David L. Jones2017-03-081-0/+193
Summary: (This is a move-only refactoring patch. There are no functionality changes.) This patch splits apart the Clang driver's tool and toolchain implementation files. Each target platform toolchain is moved to its own file, along with the closest-related tools. Each target platform toolchain has separate headers and implementation files, so the hierarchy of classes is unchanged. There are some remaining shared free functions, mostly from Tools.cpp. Several of these move to their own architecture-specific files, similar to r296056. Some of them are only used by a single target platform; since the tools and toolchains are now together, some helpers now live in a platform-specific file. The balance are helpers related to manipulating argument lists, so they are now in a new file pair, CommonArgs.h and .cpp. I've tried to cluster the code logically, which is fairly straightforward for most of the target platforms and shared architectures. I think I've made reasonable choices for these, as well as the various shared helpers; but of course, I'm happy to hear feedback in the review. There are some particular things I don't like about this patch, but haven't been able to find a better overall solution. The first is the proliferation of files: there are several files that are tiny because the toolchain is not very different from its base (usually the Gnu tools/toolchain). I think this is mostly a reflection of the true complexity, though, so it may not be "fixable" in any reasonable sense. The second thing I don't like are the includes like "../Something.h". I've avoided this largely by clustering into the current file structure. However, a few of these includes remain, and in those cases it doesn't make sense to me to sink an existing file any deeper. Reviewers: rsmith, mehdi_amini, compnerd, rnk, javed.absar Subscribers: emaste, jfb, danalbert, srhines, dschuff, jyknight, nemanjai, nhaehnle, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30372 llvm-svn: 297250
OpenPOWER on IntegriCloud