Commit Graph

9 Commits

Author SHA1 Message Date
Leonard Chan d2cbaf1755 Fix for the test failues introduced in https://reviews.llvm.org/D74704. 2020-02-26 12:23:15 -08:00
Luís Marques 91f7f0d8e3 [RISCV] Fix sysroot tests without GCC on RISC-V hosts with GCC
D68391 added tests that check scenarios where no RISC-V GCC toolchain is
supposed to be detected. When running the tests on RISC-V hosts the system's
GCC toolchain will be detected, and the tests will fail. This patch adds a
`--gcc-toolchain` option pointing to a path where no GCC toolchain is
present, ensuring that the tests are run under the expected conditions, and
therefore are able to pass in all test environments.

Differential Revision: https://reviews.llvm.org/D75061
2020-02-25 14:17:45 +00:00
Michał Górny 1ab13f8cc3 [clang] [test] Fix riscv-toolchain-extra to be less picky about paths
Fix riscv-toolchain-extra tests to pass when CLANG_RESOURCE_DIR is set
to another value than the default.

Differential Revision: https://reviews.llvm.org/D72591
2020-01-14 04:03:32 +01:00
Fangrui Song b2b5cac3ec Default to -fuse-init-array
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
(86fa57a279)

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
2019-12-12 10:32:56 -08:00
David Zarzycki ed33cb5b14
[RISCV] Add missing REQUIRES to clang tests
Fixes: e0f22fe04a
2019-11-23 14:47:09 +02:00
Edward Jones e0f22fe04a [RISCV] Use compiler-rt if no GCC installation detected
If a GCC installation is not detected, then this attempts to
use compiler-rt and the compiler-rt crtbegin/crtend
implementations as a fallback.

Differential Revision: https://reviews.llvm.org/D68407
2019-11-22 20:05:29 +00:00
Richard Smith aeaddf926a Revert "[RISCV] Use compiler-rt if no GCC installation detected"
This change causes test failures for builds configured with
-DCLANG_DEFAULT_RTLIB=compiler-rt.

This reverts commit 3289352e6b.
2019-11-13 13:14:57 -08:00
Edward Jones 3289352e6b [RISCV] Use compiler-rt if no GCC installation detected
If a GCC installation is not detected, then this attempts to
use compiler-rt and the compiler-rt crtbegin/crtend
implementations as a fallback.

Differential Revision: https://reviews.llvm.org/D68407
2019-11-13 17:18:33 +00:00
Edward Jones de61aa3118 [RISCV] Improve sysroot computation if no GCC install detected
If a GCC installed is not detected, the driver would default to
the root of the filesystem. This is not ideal when this doesn't
match the install directory of the toolchain and can cause
undesireable behavior such as picking up system libraries or
the system linker when cross-compiling.

Differential Revision: https://reviews.llvm.org/D68391
2019-11-07 15:17:40 +00:00