summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/fuchsia.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Clang] Always set -z now linker option on FuchsiaPetr Hosek2020-01-131-1/+1
| | | | | | This should be the default on Fuchsia. Differential Revision: https://reviews.llvm.org/D70576
* Default to -fuse-init-arrayFangrui Song2019-12-121-1/+1
| | | | | | | | | | | | | | | | | | | 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
* [Clang] Enable RISC-V support for FuchsiaPetr Hosek2019-11-211-3/+18
| | | | | | | | We don't have a full sysroot yet, so for now we only include compiler support and compiler-rt builtins, the rest of the runtimes will get enabled later. Differential Revision: https://reviews.llvm.org/D70477
* [CMake][Fuchsia] Define asan+noexcept multilibPetr Hosek2019-07-131-1/+2
| | | | | | | | | | | | | | | | | | Using noexcept multilib with -fno-exceptions can lead to significant space savings when statically linking libc++abi because we don't need all the unwinding and demangling code. When compiling with ASan, we already get a lot of overhead from the instrumentation itself, when statically linking libc++abi, that overhead is even larger. Having the noexcept variant for ASan can help significantly, we've seen more than 50% size reduction in our system image, which offsets the cost of having to build another multilib. Differential Revision: https://reviews.llvm.org/D64140 llvm-svn: 365994
* [Driver] Change layout of per-target runtimes to resemble multiarchPetr Hosek2019-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This is a follow up to r361432, changing the layout of per-target runtimes to more closely resemble multiarch. While before, we used the following layout: [RESOURCE_DIR]/<target>/lib/libclang_rt.<runtime>.<ext> Now we use the following layout: [RESOURCE_DIR]/lib/<target>/libclang_rt.<runtime>.<ext> This also more closely resembles the existing "non-per-target" layout: [RESOURCE_DIR]/lib/<os>/libclang_rt.<runtime>-<arch>.<ext> This change will enable further simplification of the driver logic in follow up changes. Differential Revision: https://reviews.llvm.org/D62469 llvm-svn: 361784
* [Driver] Update handling of c++ and runtime directoriesPetr Hosek2019-05-261-8/+13
| | | | | | | | | | | | This is a follow up to r361432 and r361504 which addresses issues introduced by those changes. Specifically, it avoids duplicating file and runtime paths in case when the effective triple is the same as the cannonical one. Furthermore, it fixes the broken multilib setup in the Fuchsia driver and deduplicates some of the code. Differential Revision: https://reviews.llvm.org/D62442 llvm-svn: 361709
* [Fuchsia] Support multilib for -fsanitize=address and -fno-exceptionsPetr Hosek2019-04-271-0/+21
| | | | | | | | | | | | | | | This introduces a support for multilibs to Fuchsia driver. Unlike the existing multilibs that are used primarily for handling different architecture variants, we use multilibs to handle different variants of Clang runtime libraries: -fsanitize=address and -fno-exceptions are the two we support initially. This replaces the existing support for sanitized runtimes libraries that was only used by Fuchsia driver and it also refactors some of the logic to allow sharing between GNU and Fuchsia drivers. Differential Revision: https://reviews.llvm.org/D61040 llvm-svn: 359360
* [Driver][Fuchsia] Support -nolibc flagPetr Hosek2019-02-171-0/+6
| | | | | | | | | | | This can be used to disable libc linking. This flag is supported by GCC since version 9 as well as some Clang target toolchains. This change also includes tests for all -no* flags which previously weren't covered. Differential Revision: https://reviews.llvm.org/D58325 llvm-svn: 354208
* [Driver] Use -Bstatic/dynamic for libc++ on FuchsiaPetr Hosek2018-11-041-1/+2
| | | | | | | | | -static relies on lld's behavior, but -Bstatic/dynamic is supported across all linkers. Differential Revision: https://reviews.llvm.org/D54082 llvm-svn: 346107
* [Driver] Always match resource dir in Fuchsia driver testsPetr Hosek2018-11-041-2/+4
| | | | | | | | | This makes the tests stricter by not only matching the runtime file name, but the entire path into the resource directory. Differential Revision: https://reviews.llvm.org/D54064 llvm-svn: 346088
* [Driver] Use -push-/-pop-state and -as-needed for libc++ on FuchsiaPetr Hosek2018-11-031-3/+9
| | | | | | | | | | This avoids introducing unnecessary DT_NEEDED entries when using C++ driver for linking C code or C++ code that doesn't use C++ standard library. Differential Revision: https://reviews.llvm.org/D53854 llvm-svn: 346064
* Force test/Driver/fuchsia.c(pp) to use lldDavid Greene2018-08-061-3/+5
| | | | | | | | | | The Fuchsia driver relies on lld so invoke clang with -fuse-ld=lld. This gets the test passing when the clang default linker is something other than lld. Differential Revision: https://reviews.llvm.org/D49899 llvm-svn: 339036
* Support for multiarch runtimes layoutPetr Hosek2018-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This change adds a support for multiarch style runtimes layout, so in addition to the existing layout where runtimes get installed to: lib/clang/$version/lib/$os Clang now allows runtimes to be installed to: lib/clang/$version/$target/lib This also includes libc++, libc++abi and libunwind; today those are assumed to be in Clang library directory built for host, with the new layout it is possible to install libc++, libc++abi and libunwind into the runtime directory built for different targets. The use of new layout is enabled by setting the LLVM_ENABLE_RUNTIME_TARGET_DIR CMake variable and is supported by both projects and runtimes layouts. The runtimes CMake build has been further modified to use the new layout when building runtimes for multiple targets. Differential Revision: https://reviews.llvm.org/D45604 llvm-svn: 335809
* [Fuchsia] Enable static libc++, libc++abi, libunwindPetr Hosek2018-06-231-2/+2
| | | | | | | | This is needed for building Fuchsia drivers. Differential Revision: https://reviews.llvm.org/D48208 llvm-svn: 335410
* [Driver] Only use -lc++ on FuchsiaPetr Hosek2018-05-111-2/+2
| | | | | | | | | The fact that libc++ depends on libc++abi and libunwind is an internal detail that's captured by the libc++.so linker script. Differential Revision: https://reviews.llvm.org/D46768 llvm-svn: 332138
* [Driver] Use ld.lld directly for Fuchsia rather than passing flavorPetr Hosek2017-10-231-3/+2
| | | | | | | | | | | Passing a flavor to LLD requires command line argument, but if these are being passed through a response file, this will fail because LLD needs to know which driver to use before processing the response file. Use ld.lld directly instead to avoid this issue. Differential Revision: https://reviews.llvm.org/D39176 llvm-svn: 316379
* [Driver] Disable static C++ library support on FuchsiaPetr Hosek2017-08-021-2/+2
| | | | | | | | Don't support or build static C++ libraries for Fuchsia. Differential Revision: https://reviews.llvm.org/D36202 llvm-svn: 309778
* [Driver] Always use -z rodynamic for FuchsiaPetr Hosek2017-07-181-0/+1
| | | | | | | | Fuchsia uses read-only .dynamic section. Differential Revision: https://reviews.llvm.org/D35582 llvm-svn: 308390
* Reland "[Driver] Update Fuchsia driver path handling"Petr Hosek2017-07-121-2/+3
| | | | | | | | | | | | | | | | | Several improvements to the Fuchsia driver: * Search for C++ library headers and libraries in directories that are part of the toolchain distribution rather than sysroot. * Use LLVM support utlities to construct paths to make sure the driver is also usable on Windows for cross-compiling. * Change the driver to inherit directly from ToolChain rather than Generic_GCC since we don't need any of the GCC related multilib logic. Differential Revision: https://reviews.llvm.org/D35328 llvm-svn: 307856
* Revert "[Driver] Update Fuchsia driver path handling"Petr Hosek2017-07-121-2/+1
| | | | | | | | The tests are failing on Windows. This reverts commit 429fe8229496f639df6b0b4734beedb1d4317aa5. llvm-svn: 307845
* [Driver] Update Fuchsia driver path handlingPetr Hosek2017-07-121-1/+2
| | | | | | | | | | | | | | | | | Several improvements to the Fuchsia driver: * Search for C++ library headers and libraries in directories that are part of the toolchain distribution rather than sysroot. * Use LLVM support utlities to construct paths to make sure the driver is also usable on Windows for cross-compiling. * Change the driver to inherit directly from ToolChain rather than Generic_GCC since we don't need any of the GCC related multilib logic. Differential Revision: https://reviews.llvm.org/D32613 llvm-svn: 307830
* Fix tests with CLANG_DEFAULT_LINKERJonas Hahnfeld2017-01-081-1/+1
| | | | | | | | | I originally requested this to be tested in D25263 but in the end forgot to make sure that it was done. Differential Revision: https://reviews.llvm.org/D28289 llvm-svn: 291389
* Add missing -no-canonical-prefixes.Benjamin Kramer2016-10-061-1/+1
| | | | llvm-svn: 283430
* [Driver] Add driver support for FuchsiaPetr Hosek2016-10-061-0/+33
Provide toolchain and tool support for Fuchsia operating system. Fuchsia uses compiler-rt as the runtime library and libc++, libc++abi and libunwind as the C++ standard library. lld is used as a default linker. Differential Revision: https://reviews.llvm.org/D25117 llvm-svn: 283420
OpenPOWER on IntegriCloud