summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/NetBSD.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Default to -fuse-init-arrayFangrui Song2019-12-121-3/+3
| | | | | | | | | | | | | | | | | | | Very few ELF platforms still use .ctors/.dtors now. Linux (glibc: 1999-07), DragonFlyBSD, FreeBSD (2012-03) and Solaris have supported .init_array for many years. Some architectures like AArch64/RISC-V default to .init_array . GNU ld and gold can even convert .ctors to .init_array . It makes more sense to flip the CC1 default, and only uses -fno-use-init-array on platforms that don't support .init_array . For example, OpenBSD did not support DT_INIT_ARRAY before Aug 2016 (https://github.com/openbsd/src/commit/86fa57a2792c6374b0849dd7b818a11e676e60ba) I may miss some ELF platforms that still use .ctors, but their maintainers can easily diagnose such problems. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D71393
* Fix -fuse-init-array decision logic on NetBSDJoerg Sonnenberger2019-10-211-1/+14
| | | | | | | For NetBSD 9 and later, it is the default. On older versions, only ARM and AArch64 use it by default. llvm-svn: 375468
* [Driver] Add -static-openmp driver optionPirama Arumuga Nainar2019-09-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | Summary: For Gnu, FreeBSD and NetBSD, this option forces linking with the static OpenMP host runtime (similar to -static-libgcc and -static-libstdcxx). Android's NDK will start the shared OpenMP runtime in addition to the static libomp. In this scenario, the linker will prefer to use the shared library by default. Add this option to enable linking with the static libomp. Reviewers: Hahnfeld, danalbert, srhines, joerg, jdoerfert Subscribers: guansong, cfe-commits Tags: #clang Fixes https://github.com/android-ndk/ndk/issues/1028 Differential Revision: https://reviews.llvm.org/D67200 llvm-svn: 371437
* [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
* [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
* Remove esan.Nico Weber2019-03-111-1/+0
| | | | | | | | | | | It hasn't seen active development in years, and it hasn't reached a state where it was useful. Remove the code until someone is interested in working on it again. Differential Revision: https://reviews.llvm.org/D59133 llvm-svn: 355862
* [clang] [ToolChains/NetBSD] Support relative libc++ header pathMichal Gorny2019-03-031-2/+18
| | | | | | | | | | | | | | | | | | | Support locating the libc++ header files relatively to the clang executable, in addition to the default system path. This is meant to cover two use cases: running just-built clang from the install directory, and running installed clang from non-standard location (e.g. /usr/local). This is the first step towards ensuring that tests of more LLVM projects can work out-of-the-box within the build tree, and use the correct set of headers (rather than e.g. mixing just-built clang+libcxx with system install of libcxx). It avoids requiring the user to hack around missing include paths, or LLVM build system to replicate system-specific C++ library defaults in order to append appropriate paths implicitly. Differential Revision: https://reviews.llvm.org/D58592 llvm-svn: 355282
* [clang] [Driver] [NetBSD] Append -rpath for shared compiler-rt runtimesMichal Gorny2019-01-301-0/+7
| | | | | | | | | | | | Append appropriate -rpath when using shared compiler-rt runtimes, e.g. '-fsanitize=address -shared-libasan'. There's already a similar logic in CommonArgs.cpp but it uses non-standard arch-suffixed installation directory while we want our driver to work with standard installation paths. Differential Revision: https://reviews.llvm.org/D57303 llvm-svn: 352610
* 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
* [NetBSD] Enable additional sanitizer typesMichal Gorny2019-01-121-0/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D56607 llvm-svn: 351002
* [Driver] [NetBSD] Add -D_REENTRANT when using sanitizersMichal Gorny2018-12-191-0/+8
| | | | | | | | | | | | | | | NetBSD intends to support only reentrant interfaces in interceptors. When -lpthread is used without _REENTRANT defined, things are not guaranteed to work. This is especially important for <stdio.h> and sanitization of interfaces around FILE. Some APIs have alternative modes depending on the _REENTRANT definition, and NetBSD intends to support sanitization of the _REENTRANT ones. Differential Revision: https://reviews.llvm.org/D55654 llvm-svn: 349650
* [ARM][AArch64] Pass through endian flags to assembler and linker.Peter Smith2018-10-161-1/+1
| | | | | | | | | | | | | | | | | The big-endian arm32 Linux builds are currently failing when the -mbig-endian flag is used but the binutils default on the system is little endian. This also holds when -mlittle-endian is used and the binutils default is big endian. The patch always passes through -EL or -BE to the assembler and linker, taking into account the target and the -mbig-endian and -mlittle-endian flag. Fixes pr38770 Differential Revision: https://reviews.llvm.org/D52784 llvm-svn: 344597
* Support linking static PIE binaries on NetBSDJoerg Sonnenberger2018-07-121-0/+4
| | | | llvm-svn: 336947
* Use Triple::isMIPS() instead of enumerating all Triples. NFCAlexander Richardson2018-06-251-4/+3
| | | | | | | | Reviewed By: atanasyan Differential Revision: https://reviews.llvm.org/D48549 llvm-svn: 335495
* Support XRay in the NetBSD driverKamil Rytarowski2018-05-111-20/+25
| | | | | | | | | | | | | | | | | | | | Summary: While there, perform a small cleanup, reducing delta with drivers for other OSes. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, dberris Reviewed By: dberris Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D46721 llvm-svn: 332071
* [Driver] Allow drivers to add multiple libc++ include pathsPetr Hosek2018-04-101-2/+4
| | | | | | | | | | | This allows toolchain drivers to add multiple libc++ include paths akin to libstdc++. This is useful in multiarch setup when some headers might be in target specific include directory. There should be no functional change. Differential Revision: https://reviews.llvm.org/D45422 llvm-svn: 329748
* Toolchain: Normalize dwarf, sjlj and seh ehMartell Malone2017-11-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a re-apply of r319294. adds -fseh-exceptions and -fdwarf-exceptions flags clang will check if the user has specified an exception model flag, in the absense of specifying the exception model clang will then check the driver default and append the model flag for that target to cc1 -fno-exceptions has a higher priority then specifying the model move __SEH__ macro definitions out of Targets into InitPreprocessor behind the -fseh-exceptions flag move __ARM_DWARF_EH__ macrodefinitions out of verious targets and into InitPreprocessor behind the -fdwarf-exceptions flag and arm|thumb check remove unused USESEHExceptions from the MinGW Driver fold USESjLjExceptions into a new GetExceptionModel function that gives the toolchain classes more flexibility with eh models Reviewers: rnk, mstorsjo Differential Revision: https://reviews.llvm.org/D39673 llvm-svn: 319297
* Revert "Toolchain: Normalize dwarf, sjlj and seh eh"Martell Malone2017-11-291-8/+0
| | | | | | | | This reverts rL319294. The windows sanitizer does not like seh on x86. Will re apply with None type for x86 llvm-svn: 319295
* Toolchain: Normalize dwarf, sjlj and seh ehMartell Malone2017-11-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | adds -fseh-exceptions and -fdwarf-exceptions flags clang will check if the user has specified an exception model flag, in the absense of specifying the exception model clang will then check the driver default and append the model flag for that target to cc1 clang cc1 assumes dwarf is the default if none is passed and -fno-exceptions has a higher priority then specifying the model move __SEH__ macro definitions out of Targets into InitPreprocessor behind the -fseh-exceptions flag move __ARM_DWARF_EH__ macrodefinitions out of verious targets and into InitPreprocessor behind the -fdwarf-exceptions flag and arm|thumb check remove unused USESEHExceptions from the MinGW Driver fold USESjLjExceptions into a new GetExceptionModel function that gives the toolchain classes more flexibility with eh models Reviewers: rnk, mstorsjo Differential Revision: https://reviews.llvm.org/D39673 llvm-svn: 319294
* Enable additonal features in NetBSDKamil Rytarowski2017-11-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Enable for x86_64: - ESan, - KASan, - MSan. Enable for x86_64 and i386: - Scudo. These features are under active development and in various level of completeness. Sponsored by <The NetBSD Foundation> Reviewers: dvyukov, joerg, vitalybuka, eugenis Reviewed By: eugenis Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40456 llvm-svn: 319007
* Enable libfuzzer on NetBSD/amd64Kamil Rytarowski2017-08-211-0/+2
| | | | | | | | | | | | | | | | | | | Summary: Enable SanitizerKind::Fuzzer and SanitizerKind::FuzzerNoLink on x86_64. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, vitalybuka, george.karpenkov Reviewed By: vitalybuka Subscribers: cfe-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36935 llvm-svn: 311365
* Enable bunch of sanitizers on NetBSD/X86 and X86_64Kamil Rytarowski2017-08-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Enable more sanitizers: - i386 and amd64: * SanitizerKind::Vptr; * SanitizerKind::Leak; * SanitizerKind::SafeStack; * SanitizerKind::Function; - amd64 only: * SanitizerKind::Thread; These sanitizers are in the process of upstreaming to LLVM projects. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dim, vitalybuka, kcc, filcab, fjricci Reviewed By: vitalybuka Subscribers: #sanitizers, cfe-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36482 llvm-svn: 310649
* Enable LLVM asan support for NetBSD/i386Kamil Rytarowski2017-08-071-1/+2
| | | | | | | | | | | | | | | | | | | Summary: Verified to work and useful to run check-asan, as this target tests 32-bit and 64-bit execution. Sponsored by <The NetBSD Foundation> Reviewers: joerg, filcab, dim, vitalybuka Reviewed By: vitalybuka Subscribers: #sanitizers, cfe-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36378 llvm-svn: 310245
* Introduce -nostdlib++ flag to disable linking the C++ standard library.Nico Weber2017-07-251-1/+2
| | | | | | | | | | | | | | | 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
* Remove Driver::UseStdLib.Nico Weber2017-07-231-1/+1
| | | | | | | | | All but one place are checking options::OPT_nostdlib instead of looking at this field, so convert that one other place to doing that as well. No behavior change. llvm-svn: 308848
* Enable LLVM asan support for NetBSD/amd64Kamil Rytarowski2017-07-041-0/+13
| | | | | | | | | | | | | | | | | | | | | | Summary: Enable LLVM asan sanitizer for NetBSD/amd64. Don't generate -ldl for dlopen(3)-like functions on NetBSD. These features are available in libc on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, kcc, dim Reviewed By: dim Subscribers: #clang, #sanitizers Tags: #clang, #sanitizers Differential Revision: https://reviews.llvm.org/D34960 llvm-svn: 307104
* [Driver] Consolidate tools and toolchains by target platform. (NFC)David L. Jones2017-03-081-0/+412
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