[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)
https://github.com/dybv-sc updated https://github.com/llvm/llvm-project/pull/68904 >From 3c33c4b902a41a414769be7079e8847e41fb5912 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Mon, 9 Oct 2023 19:49:09 +0300 Subject: [PATCH] [clang] Add information about lld presence in RISCVToolchain. --- .../lib/Driver/ToolChains/RISCVToolchain.cpp | 4 ++- clang/lib/Driver/ToolChains/RISCVToolchain.h | 3 +++ clang/test/Driver/riscv64-toolchain.c | 25 +++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp index 7e6abd144428783..d87af6b4cb89170 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp @@ -49,7 +49,9 @@ bool RISCVToolChain::hasGCCToolchain(const Driver &D, /// RISC-V Toolchain RISCVToolChain::RISCVToolChain(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) -: Generic_ELF(D, Triple, Args) { +: Generic_ELF(D, Triple, Args), UseLLD{Args.getLastArgValue( + options::OPT_fuse_ld_EQ) + .equals_insensitive("lld")} { GCCInstallation.init(Triple, Args); if (GCCInstallation.isValid()) { Multilibs = GCCInstallation.getMultilibs(); diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.h b/clang/lib/Driver/ToolChains/RISCVToolchain.h index cec817ef7190be5..661bf78ed3f7622 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.h +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.h @@ -35,11 +35,14 @@ class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF { addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + bool HasNativeLLVMSupport() const override { return UseLLD; } + protected: Tool *buildLinker() const override; private: std::string computeSysRoot() const override; + bool UseLLD; }; } // end namespace toolchains diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c index f177bff33dd4d72..cd7d7624c1c5539 100644 --- a/clang/test/Driver/riscv64-toolchain.c +++ b/clang/test/Driver/riscv64-toolchain.c @@ -121,6 +121,31 @@ // C-RV64IMAC-BAREMETAL-MULTI-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" // C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" +// Check that lto works in riscv-toolchain when explicitly specified lld as linker. +// RUN: env "PATH=" %clang -### %s -fuse-ld=lld -flto \ +// RUN: -B%S/Inputs/lld --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}lld" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-m" "elf64lriscv" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib/rv64imac/lp64/crt0.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtbegin.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" + +// Check driver error when lto is used without specified lld linker. +// RUN: not env "PATH=" %clang -### %s -flto \ +// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64: error: 'riscv64-unknown-unknown-elf': unable to pass LLVM bit-code files to linker + // RUN: env "PATH=" %clang -### %s -fuse-ld=ld \ // RUN: --target=riscv64-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \ // RUN: -march=rv64imafdc -mabi=lp64d \ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
@@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-linux -std=c++98 %s -O3 -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck %s dybv-sc wrote: Yes, The matter is that if no llvm passes are run, IR is unoptimized and contains extra load and store instruction that operate with stack (storing and loading params there). Those extra loads should not be considered by the test, because it's goal to check tbaa for specific load and store coming from line 22 and 24. Before I introduced more precise metadata on pointer types, all of that load and stores had same metadata, so test passed even if wrong load was considered. Now, this test should pick only load coming from line 22. So, to make things easier, I just enabled optimization passes and final IR contains only one load and one store instruction. https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
https://github.com/dybv-sc edited https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
@@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-linux -std=c++98 %s -O3 -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck %s dybv-sc wrote: I am sure that level 3 optimization should cut out all stack manipulation here leaving only one necessary load(const int *x = *p) and one necessary store(*q = 0). This test checks only presence of that load/store and metadata information, so I don't think it could be disrupted by unrelated patches. https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
@@ -184,13 +199,24 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) { return getChar(); // Handle pointers and references. - // TODO: Implement C++'s type "similarity" and consider dis-"similar" - // pointers distinct. - if (Ty->isPointerType() || Ty->isReferenceType()) -return createScalarTypeNode("any pointer", getChar(), Size); + // Pointer types never alias if their pointee type is distinct. dybv-sc wrote: I agree that this may be a little bit too strict, but, as far as I could understand, according to C11 standard `void*` and `char*` are not the same (correct me if I am wrong): >From section 6.5 point 7: > an object shall have its stored value accessed only by an lvalue expression > that has one of > the following types:88) > — a type compatible with the effective type of the object, > — a qualified version of a type compatible with the effective type of the > object, > — a type that is the signed or unsigned type corresponding to the effective > type of the > object, > — a type that is the signed or unsigned type corresponding to a qualified > version of the > effective type of the object, > — an aggregate or union type that includes one of the aforementioned types > among its > members (including, recursively, a member of a subaggregate or contained > union), or > — a character type. >From all of above, the only way `void*` and `char*` alias if they are >compatible, but they are not: >From section 6.2.7: > Two types have compatible type if their types are the same. Additional rules > for > determining whether two types are compatible are described in 6.7.2 for type > specifiers, > in 6.7.3 for type qualifiers, and in 6.7.6 for declarators. And from section 6.7.6.1 for pointer declarators: > For two pointer types to be compatible, both shall be identically qualified > and both shall > be pointers to compatible types. `void` and `char` types are not compatible, because they are not the same. That means that `void*` and `char*` are not compatible and thus shall not alias. So, from what I see in standard, pointer types to incompatible types should not alias. May be I got something wrong, so let's discuss it. Also, now after I revisited standard, I see that getPointeeName is really not so accurate - it should consider type compatibility better(not only by exact match). https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm] [clang] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
@@ -4598,8 +4602,7 @@ LValue CodeGenFunction::EmitLValueForField(LValue base, if (base.getTBAAInfo().isMayAlias() || rec->hasAttr() || FieldType->isVectorType()) { FieldTBAAInfo = TBAAAccessInfo::getMayAliasInfo(); - } else if (rec->isUnion()) { -// TODO: Support TBAA for unions. + } else if (rec->isUnion() && !CGM.getCodeGenOpts().UnionTBAA) { dybv-sc wrote: The goal of that patch is to re-utilize existing struct path TBAA metadata and amend it functionality to work for union types. Here I allow for that metadata to be generated for union members accesses, so yes there will be tbaa struct records with all members with offset 0. Later in code I adapted current struct-path-tbaa tree walkers to handle such situations where multiple fields have same offset. https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
@@ -184,13 +199,24 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) { return getChar(); // Handle pointers and references. - // TODO: Implement C++'s type "similarity" and consider dis-"similar" - // pointers distinct. - if (Ty->isPointerType() || Ty->isReferenceType()) -return createScalarTypeNode("any pointer", getChar(), Size); + // Pointer types never alias if their pointee type is distinct. + if ((Ty->isPointerType() || Ty->isReferenceType())) { +llvm::MDNode *AnyPtr = createScalarTypeNode("any pointer", getChar(), Size); +if (!CodeGenOpts.PointerTBAA) + return AnyPtr; +unsigned PtrDepth = 0; +do { + PtrDepth++; + Ty = Ty->getPointeeType().getTypePtr(); +} while (!Ty->getPointeeType().isNull()); dybv-sc wrote: Actually I want to look for member pointers. In [conv.qual] of C++ standard mentioned: > each Pi is “pointer to” (9.3.4.2), “pointer to member of > class Ci of type” (9.3.4.4), “array of Ni”, or “array of unknown bound of” > (9.3.4.5 Where Pi is i-th inderection in qualification decomposition. I want to consider all those types of indirection. I think, all I do if I get rid of getPointeeType() is just move most of it's checks outside. https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
@@ -216,6 +216,9 @@ ENUM_CODEGENOPT(StructReturnConvention, StructReturnConventionKind, 2, SRCK_Defa CODEGENOPT(RelaxAll , 1, 0) ///< Relax all machine code instructions. CODEGENOPT(RelaxedAliasing , 1, 0) ///< Set when -fno-strict-aliasing is enabled. CODEGENOPT(StructPathTBAA, 1, 0) ///< Whether or not to use struct-path TBAA. +CODEGENOPT(UnionTBAA, 1, 0) ///< Whether or not to use struct-path TBAA on unions. +CODEGENOPT(PointerTBAA, 1, 0) ///< Whether or not to generate TBAA on pointers. +CODEGENOPT(ArrayTBAA, 1, 0) ///< Whether or not to generate TBAA on arrays. dybv-sc wrote: fixed https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm] [clang] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
dybv-sc wrote: @rjmccall , I updated part of commit that handles pointers. Added comment with C/C++ standard references to explain my decisions. Could you please review it again? https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm] [clang] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
@@ -105,13 +105,28 @@ static bool isValidBaseType(QualType QTy) { if (RD->hasFlexibleArrayMember()) return false; // RD can be struct, union, class, interface or enum. -// For now, we only handle struct and class. -if (RD->isStruct() || RD->isClass()) +if (RD->isStruct() || RD->isClass() || +(RD->isUnion() && CodeGenOpts.UnionTBAA)) return true; } return false; } +std::string CodeGenTBAA::getPointeeName(const Type *Ty) { + if (isa(Ty)) { +llvm::MDNode *ScalarMD = getTypeInfoHelper(Ty); +auto &Op = ScalarMD->getOperand(CodeGenOpts.NewStructPathTBAA ? 2 : 0); +assert(isa(Op) && "Expected MDString operand"); +return cast(Op)->getString().str(); + } + + if (Ty->isIncompleteType()) +return ""; dybv-sc wrote: Removed. I was uncertain in a moment what to do in that case, but after revisiting C/C++ standard I learned that there is no difference between complete and incomplete types when considering their similarity/compatibility. https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm] [clang] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
dybv-sc wrote: > (As usual, please make any LLVM changes separately from Clang changes, > especially if they affect IR design.) I splitted commit into 2 parts for llvm and clang. Should I make separate PRs for them as well? https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
dybv-sc wrote: I made separate PR for llvm's part: https://github.com/llvm/llvm-project/pull/76356 It should me merged first, because clang's part depends on it. https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
@@ -184,13 +205,59 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) { return getChar(); // Handle pointers and references. - // TODO: Implement C++'s type "similarity" and consider dis-"similar" - // pointers distinct. - if (Ty->isPointerType() || Ty->isReferenceType()) -return createScalarTypeNode("any pointer", getChar(), Size); + // + // In C11 for two pointer type to alias it is required for them to be + // compatible [section 6.5 p7]. dybv-sc wrote: Great idea! Thanks for help with it. Added those comments. https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
dybv-sc wrote: > Thanks for working on this! I think it would be good to split this up into > multiple distinct parts for the different improvements. > > I put up a patch to support distinct metadata for distinct pointers a while > ago, which I just moved to GH: #76261. > > The discussion on Phabricator has some interesting points and one of the > concerns was that it is very difficult already to detect type violations in > source code, which makes adopting more powerful TBAA features quite > difficult. There are some tooling improvements we can make here, including a > sanitizer for types, which would be good to get rolling again, see > https://discourse.llvm.org/t/reviving-typesanitizer-a-sanitizer-to-catch-type-based-aliasing-violations/66092 > > TBAA union support and potential issues have been discussed in detail a > number of years ago on the old mailing list (llvm-dev), did you have a look > at those threads? Hi, Thanks for sharing those materials. Actually I didn't look into any discussions considering standard violations, so I would be glad if you share those threads. Those standard violations worry me too, so as @rjmccall suggested, I put union TBAA under the option that is disabled by default. I am also considering to put pointer TBAA under option too, if it raises enough concerns too. https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm] [clang] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
@@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple x86_64-linux -std=c++98 %s -O3 -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck %s -// RUN: %clang_cc1 -triple x86_64-linux -std=c++11 %s -O3 -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck %s -// RUN: %clang_cc1 -triple x86_64-linux -std=c++14 %s -O3 -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck %s -// RUN: %clang_cc1 -triple x86_64-linux -std=c++1z %s -O3 -disable-llvm-passes -pedantic-errors -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-linux -std=c++98 %s -O3 -pedantic-errors -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-linux -std=c++11 %s -O3 -pedantic-errors -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-linux -std=c++14 %s -O3 -pedantic-errors -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-linux -std=c++1z %s -O3 -pedantic-errors -emit-llvm -o - | FileCheck %s // dr158: yes dybv-sc wrote: As I see it is already mentioned: https://github.com/llvm/llvm-project/blob/114e6d7ba02f090117f2cb1ffeb9027cf80f335b/clang/test/CXX/drs/dr1xx.cpp#L792C1-L792C25 https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm] [clang] [Clang][IR] add TBAA metadata on pointer, union and array types. (PR #75177)
@@ -105,13 +105,34 @@ static bool isValidBaseType(QualType QTy) { if (RD->hasFlexibleArrayMember()) return false; // RD can be struct, union, class, interface or enum. -// For now, we only handle struct and class. -if (RD->isStruct() || RD->isClass()) +if (RD->isStruct() || RD->isClass() || +(RD->isUnion() && CodeGenOpts.UnionTBAA)) return true; } return false; } +// Give unique tag for compatible types. +std::string CodeGenTBAA::getPointeeName(const Type *Ty) { dybv-sc wrote: Changed function to append to raw_ostream. `Ty` here is coming from `getPointeeType()` so it may be not canonical, right? https://github.com/llvm/llvm-project/pull/75177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)
dybv-sc wrote: @MaskRay, could you please look into this? https://github.com/llvm/llvm-project/pull/68904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)
https://github.com/dybv-sc created https://github.com/llvm/llvm-project/pull/68904 When compiling for target riscv64/32-uknown-elf clang assumes that it do not use lld linker even if explicitly told ('-fuse-ld=lld'). >From 8512bbcee108751776591160797af32885377587 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Mon, 9 Oct 2023 19:49:09 +0300 Subject: [PATCH] [clang] Add information about lld presence in RISCVToolchain. --- .../lib/Driver/ToolChains/RISCVToolchain.cpp | 5 +++- clang/lib/Driver/ToolChains/RISCVToolchain.h | 3 +++ clang/test/Driver/riscv64-toolchain.c | 25 +++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp index c98f43f6e05eb4b..b5685eaeed7b275 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp @@ -49,8 +49,11 @@ bool RISCVToolChain::hasGCCToolchain(const Driver &D, /// RISC-V Toolchain RISCVToolChain::RISCVToolChain(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) -: Generic_ELF(D, Triple, Args) { +: Generic_ELF(D, Triple, Args), UseLLD{Args.getLastArgValue( + options::OPT_fuse_ld_EQ) + .equals_insensitive("lld")} { GCCInstallation.init(Triple, Args); + if (GCCInstallation.isValid()) { Multilibs = GCCInstallation.getMultilibs(); SelectedMultilibs.assign({GCCInstallation.getMultilib()}); diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.h b/clang/lib/Driver/ToolChains/RISCVToolchain.h index de6960726f1cd77..afe98968ecd8616 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.h +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.h @@ -35,11 +35,14 @@ class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF { addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + bool HasNativeLLVMSupport() const override { return UseLLD; } + protected: Tool *buildLinker() const override; private: std::string computeSysRoot() const override; + bool UseLLD; }; } // end namespace toolchains diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c index f177bff33dd4d72..275cd8dde419218 100644 --- a/clang/test/Driver/riscv64-toolchain.c +++ b/clang/test/Driver/riscv64-toolchain.c @@ -121,6 +121,31 @@ // C-RV64IMAC-BAREMETAL-MULTI-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" // C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" +// Check that lto works in riscv-toolchain when explicitly specified lld as linker. +// RUN: env "PATH=" %clang -### %s -fuse-ld=lld -flto \ +// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}lld" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-m" "elf64lriscv" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|}}..{{/|}}riscv64-unknown-elf/lib/crt0.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/crtbegin.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|}}..{{/|}}riscv64-unknown-elf/lib" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/crtend.o" + +// Check driver error when lto is used without specified lld linker. +// RUN: env "PATH=" %clang -### %s -flto \ +// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64: clang-16: error: 'riscv64-unknown-unknown-elf': unable to pass LLVM bit-code files to linker + // RUN: env "PATH=" %clang -### %s -fuse-ld=ld \ // RUN: --target=riscv64-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \ // RUN: -march=rv64imafdc -mabi=lp64d \ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)
https://github.com/dybv-sc updated https://github.com/llvm/llvm-project/pull/68904 >From eca69cd54e9f2f68d89787376c603164c2508da1 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Mon, 9 Oct 2023 19:49:09 +0300 Subject: [PATCH] [clang] Add information about lld presence in RISCVToolchain. --- .../lib/Driver/ToolChains/RISCVToolchain.cpp | 4 ++- clang/lib/Driver/ToolChains/RISCVToolchain.h | 3 +++ clang/test/Driver/riscv64-toolchain.c | 25 +++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp index c98f43f6e05eb4b..f235d704c116744 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp @@ -49,7 +49,9 @@ bool RISCVToolChain::hasGCCToolchain(const Driver &D, /// RISC-V Toolchain RISCVToolChain::RISCVToolChain(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) -: Generic_ELF(D, Triple, Args) { +: Generic_ELF(D, Triple, Args), + UseLLD{Args.getLastArgValue(options::OPT_fuse_ld_EQ) + .equals_insensitive("lld")} { GCCInstallation.init(Triple, Args); if (GCCInstallation.isValid()) { Multilibs = GCCInstallation.getMultilibs(); diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.h b/clang/lib/Driver/ToolChains/RISCVToolchain.h index de6960726f1cd77..afe98968ecd8616 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.h +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.h @@ -35,11 +35,14 @@ class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF { addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + bool HasNativeLLVMSupport() const override { return UseLLD; } + protected: Tool *buildLinker() const override; private: std::string computeSysRoot() const override; + bool UseLLD; }; } // end namespace toolchains diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c index f177bff33dd4d72..275cd8dde419218 100644 --- a/clang/test/Driver/riscv64-toolchain.c +++ b/clang/test/Driver/riscv64-toolchain.c @@ -121,6 +121,31 @@ // C-RV64IMAC-BAREMETAL-MULTI-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" // C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" +// Check that lto works in riscv-toolchain when explicitly specified lld as linker. +// RUN: env "PATH=" %clang -### %s -fuse-ld=lld -flto \ +// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}lld" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-m" "elf64lriscv" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|}}..{{/|}}riscv64-unknown-elf/lib/crt0.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/crtbegin.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|}}..{{/|}}riscv64-unknown-elf/lib" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/crtend.o" + +// Check driver error when lto is used without specified lld linker. +// RUN: env "PATH=" %clang -### %s -flto \ +// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64: clang-16: error: 'riscv64-unknown-unknown-elf': unable to pass LLVM bit-code files to linker + // RUN: env "PATH=" %clang -### %s -fuse-ld=ld \ // RUN: --target=riscv64-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \ // RUN: -march=rv64imafdc -mabi=lp64d \ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)
https://github.com/dybv-sc updated https://github.com/llvm/llvm-project/pull/68904 >From 087d22970d1d2eea6dd0dd79eedd49ed69bc49c3 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Mon, 9 Oct 2023 19:49:09 +0300 Subject: [PATCH] [clang] Add information about lld presence in RISCVToolchain. --- .../lib/Driver/ToolChains/RISCVToolchain.cpp | 4 ++- clang/lib/Driver/ToolChains/RISCVToolchain.h | 3 +++ clang/test/Driver/riscv64-toolchain.c | 25 +++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp index c98f43f6e05eb4b..3a784be8e06616f 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp @@ -49,7 +49,9 @@ bool RISCVToolChain::hasGCCToolchain(const Driver &D, /// RISC-V Toolchain RISCVToolChain::RISCVToolChain(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) -: Generic_ELF(D, Triple, Args) { +: Generic_ELF(D, Triple, Args), UseLLD{Args.getLastArgValue( + options::OPT_fuse_ld_EQ) + .equals_insensitive("lld")} { GCCInstallation.init(Triple, Args); if (GCCInstallation.isValid()) { Multilibs = GCCInstallation.getMultilibs(); diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.h b/clang/lib/Driver/ToolChains/RISCVToolchain.h index de6960726f1cd77..afe98968ecd8616 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.h +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.h @@ -35,11 +35,14 @@ class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF { addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + bool HasNativeLLVMSupport() const override { return UseLLD; } + protected: Tool *buildLinker() const override; private: std::string computeSysRoot() const override; + bool UseLLD; }; } // end namespace toolchains diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c index f177bff33dd4d72..275cd8dde419218 100644 --- a/clang/test/Driver/riscv64-toolchain.c +++ b/clang/test/Driver/riscv64-toolchain.c @@ -121,6 +121,31 @@ // C-RV64IMAC-BAREMETAL-MULTI-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" // C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" +// Check that lto works in riscv-toolchain when explicitly specified lld as linker. +// RUN: env "PATH=" %clang -### %s -fuse-ld=lld -flto \ +// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}lld" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-m" "elf64lriscv" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|}}..{{/|}}riscv64-unknown-elf/lib/crt0.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/crtbegin.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|}}..{{/|}}riscv64-unknown-elf/lib" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/crtend.o" + +// Check driver error when lto is used without specified lld linker. +// RUN: env "PATH=" %clang -### %s -flto \ +// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64: clang-16: error: 'riscv64-unknown-unknown-elf': unable to pass LLVM bit-code files to linker + // RUN: env "PATH=" %clang -### %s -fuse-ld=ld \ // RUN: --target=riscv64-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \ // RUN: -march=rv64imafdc -mabi=lp64d \ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)
dybv-sc wrote: Encountered code formatting check failure seems to be not reproducible locally: ``` $ git-clang-format --diff 7025ff6fa3dfe2ce8d3d7fcb0ec9de9a357d2c6f 087d22970d1d2eea6dd0dd79eedd49ed69bc49c3 -- clang/lib/Driver/ToolChains/RISCVToolchain.cpp clang/lib/Driver/ToolChains/RISCVToolchain.h clang/test/Driver/riscv64-toolchain.c $ echo $? 0 ``` https://github.com/llvm/llvm-project/pull/68904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)
https://github.com/dybv-sc updated https://github.com/llvm/llvm-project/pull/68904 >From 0802a4170b6eddd1ae5bd532f90274794b0e00c4 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Mon, 9 Oct 2023 19:49:09 +0300 Subject: [PATCH] [clang] Add information about lld presence in RISCVToolchain. --- .../lib/Driver/ToolChains/RISCVToolchain.cpp | 4 ++- clang/lib/Driver/ToolChains/RISCVToolchain.h | 3 +++ clang/test/Driver/riscv64-toolchain.c | 25 +++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp index c98f43f6e05eb4b..3a784be8e06616f 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp @@ -49,7 +49,9 @@ bool RISCVToolChain::hasGCCToolchain(const Driver &D, /// RISC-V Toolchain RISCVToolChain::RISCVToolChain(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) -: Generic_ELF(D, Triple, Args) { +: Generic_ELF(D, Triple, Args), UseLLD{Args.getLastArgValue( + options::OPT_fuse_ld_EQ) + .equals_insensitive("lld")} { GCCInstallation.init(Triple, Args); if (GCCInstallation.isValid()) { Multilibs = GCCInstallation.getMultilibs(); diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.h b/clang/lib/Driver/ToolChains/RISCVToolchain.h index de6960726f1cd77..afe98968ecd8616 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.h +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.h @@ -35,11 +35,14 @@ class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF { addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + bool HasNativeLLVMSupport() const override { return UseLLD; } + protected: Tool *buildLinker() const override; private: std::string computeSysRoot() const override; + bool UseLLD; }; } // end namespace toolchains diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c index f177bff33dd4d72..161aa9ae4207e14 100644 --- a/clang/test/Driver/riscv64-toolchain.c +++ b/clang/test/Driver/riscv64-toolchain.c @@ -121,6 +121,31 @@ // C-RV64IMAC-BAREMETAL-MULTI-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" // C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" +// Check that lto works in riscv-toolchain when explicitly specified lld as linker. +// RUN: env "PATH=" %clang -### %s -fuse-ld=lld -flto \ +// RUN: -B%S/Inputs/lld --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}lld" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-m" "elf64lriscv" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|}}..{{/|}}riscv64-unknown-elf/lib/crt0.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/crtbegin.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../..{{/|}}..{{/|}}riscv64-unknown-elf/lib" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/crtend.o" + +// Check driver error when lto is used without specified lld linker. +// RUN: env "PATH=" %clang -### %s -flto \ +// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64: clang-16: error: 'riscv64-unknown-unknown-elf': unable to pass LLVM bit-code files to linker + // RUN: env "PATH=" %clang -### %s -fuse-ld=ld \ // RUN: --target=riscv64-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \ // RUN: -march=rv64imafdc -mabi=lp64d \ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)
https://github.com/dybv-sc updated https://github.com/llvm/llvm-project/pull/68904 >From d66ffe242716560408bd314a9725bb49556992e0 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Mon, 9 Oct 2023 19:49:09 +0300 Subject: [PATCH] [clang] Add information about lld presence in RISCVToolchain. --- .../lib/Driver/ToolChains/RISCVToolchain.cpp | 4 ++- clang/lib/Driver/ToolChains/RISCVToolchain.h | 3 +++ clang/test/Driver/riscv64-toolchain.c | 25 +++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp index 7e6abd144428783..d87af6b4cb89170 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp @@ -49,7 +49,9 @@ bool RISCVToolChain::hasGCCToolchain(const Driver &D, /// RISC-V Toolchain RISCVToolChain::RISCVToolChain(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) -: Generic_ELF(D, Triple, Args) { +: Generic_ELF(D, Triple, Args), UseLLD{Args.getLastArgValue( + options::OPT_fuse_ld_EQ) + .equals_insensitive("lld")} { GCCInstallation.init(Triple, Args); if (GCCInstallation.isValid()) { Multilibs = GCCInstallation.getMultilibs(); diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.h b/clang/lib/Driver/ToolChains/RISCVToolchain.h index de6960726f1cd77..afe98968ecd8616 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.h +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.h @@ -35,11 +35,14 @@ class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF { addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + bool HasNativeLLVMSupport() const override { return UseLLD; } + protected: Tool *buildLinker() const override; private: std::string computeSysRoot() const override; + bool UseLLD; }; } // end namespace toolchains diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c index f177bff33dd4d72..c5f142cc876642c 100644 --- a/clang/test/Driver/riscv64-toolchain.c +++ b/clang/test/Driver/riscv64-toolchain.c @@ -121,6 +121,31 @@ // C-RV64IMAC-BAREMETAL-MULTI-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" // C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" +// Check that lto works in riscv-toolchain when explicitly specified lld as linker. +// RUN: env "PATH=" %clang -### %s -fuse-ld=lld -flto \ +// RUN: -B%S/Inputs/lld --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}lld" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-m" "elf64lriscv" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib/rv64imac/lp64/crt0.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtbegin.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" + +// Check driver error when lto is used without specified lld linker. +// RUN: env "PATH=" %clang -### %s -flto \ +// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64: clang-16: error: 'riscv64-unknown-unknown-elf': unable to pass LLVM bit-code files to linker + // RUN: env "PATH=" %clang -### %s -fuse-ld=ld \ // RUN: --target=riscv64-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \ // RUN: -march=rv64imafdc -mabi=lp64d \ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)
https://github.com/dybv-sc updated https://github.com/llvm/llvm-project/pull/68904 >From 51a150e7abd2ff88261f82fc4a4c799f2a1fb11d Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Mon, 9 Oct 2023 19:49:09 +0300 Subject: [PATCH] [clang] Add information about lld presence in RISCVToolchain. --- .../lib/Driver/ToolChains/RISCVToolchain.cpp | 4 ++- clang/lib/Driver/ToolChains/RISCVToolchain.h | 3 +++ clang/test/Driver/riscv64-toolchain.c | 25 +++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp index 7e6abd144428783..d87af6b4cb89170 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp @@ -49,7 +49,9 @@ bool RISCVToolChain::hasGCCToolchain(const Driver &D, /// RISC-V Toolchain RISCVToolChain::RISCVToolChain(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) -: Generic_ELF(D, Triple, Args) { +: Generic_ELF(D, Triple, Args), UseLLD{Args.getLastArgValue( + options::OPT_fuse_ld_EQ) + .equals_insensitive("lld")} { GCCInstallation.init(Triple, Args); if (GCCInstallation.isValid()) { Multilibs = GCCInstallation.getMultilibs(); diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.h b/clang/lib/Driver/ToolChains/RISCVToolchain.h index de6960726f1cd77..afe98968ecd8616 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.h +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.h @@ -35,11 +35,14 @@ class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF { addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + bool HasNativeLLVMSupport() const override { return UseLLD; } + protected: Tool *buildLinker() const override; private: std::string computeSysRoot() const override; + bool UseLLD; }; } // end namespace toolchains diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c index f177bff33dd4d72..663296e7432ea40 100644 --- a/clang/test/Driver/riscv64-toolchain.c +++ b/clang/test/Driver/riscv64-toolchain.c @@ -121,6 +121,31 @@ // C-RV64IMAC-BAREMETAL-MULTI-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" // C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" +// Check that lto works in riscv-toolchain when explicitly specified lld as linker. +// RUN: env "PATH=" %clang -### %s -fuse-ld=lld -flto \ +// RUN: -B%S/Inputs/lld --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}lld" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-m" "elf64lriscv" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib/rv64imac/lp64/crt0.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtbegin.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" + +// Check driver error when lto is used without specified lld linker. +// RUN: env "PATH=" %clang -### %s -flto \ +// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64: error: 'riscv64-unknown-unknown-elf': unable to pass LLVM bit-code files to linker + // RUN: env "PATH=" %clang -### %s -fuse-ld=ld \ // RUN: --target=riscv64-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \ // RUN: -march=rv64imafdc -mabi=lp64d \ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)
https://github.com/dybv-sc updated https://github.com/llvm/llvm-project/pull/68904 >From d61eacc29e0b70dc50ee7eeb96446b7b66dc2e1d Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Mon, 9 Oct 2023 19:49:09 +0300 Subject: [PATCH] [clang] Add information about lld presence in RISCVToolchain. --- .../lib/Driver/ToolChains/RISCVToolchain.cpp | 4 ++- clang/lib/Driver/ToolChains/RISCVToolchain.h | 3 +++ clang/test/Driver/riscv64-toolchain.c | 25 +++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp index 7e6abd144428783..d87af6b4cb89170 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp @@ -49,7 +49,9 @@ bool RISCVToolChain::hasGCCToolchain(const Driver &D, /// RISC-V Toolchain RISCVToolChain::RISCVToolChain(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) -: Generic_ELF(D, Triple, Args) { +: Generic_ELF(D, Triple, Args), UseLLD{Args.getLastArgValue( + options::OPT_fuse_ld_EQ) + .equals_insensitive("lld")} { GCCInstallation.init(Triple, Args); if (GCCInstallation.isValid()) { Multilibs = GCCInstallation.getMultilibs(); diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.h b/clang/lib/Driver/ToolChains/RISCVToolchain.h index de6960726f1cd77..afe98968ecd8616 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.h +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.h @@ -35,11 +35,14 @@ class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF { addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + bool HasNativeLLVMSupport() const override { return UseLLD; } + protected: Tool *buildLinker() const override; private: std::string computeSysRoot() const override; + bool UseLLD; }; } // end namespace toolchains diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c index f177bff33dd4d72..8715dff2171b5ef 100644 --- a/clang/test/Driver/riscv64-toolchain.c +++ b/clang/test/Driver/riscv64-toolchain.c @@ -121,6 +121,31 @@ // C-RV64IMAC-BAREMETAL-MULTI-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" // C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" +// Check that lto works in riscv-toolchain when explicitly specified lld as linker. +// RUN: env "PATH=" %clang -### %s -fuse-ld=lld -flto \ +// RUN: -B%S/Inputs/lld --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}lld" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-m" "elf64lriscv" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib/rv64imac/lp64/crt0.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtbegin.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" + +// Check driver error when lto is used without specified lld linker. +// RUN: env "PATH=" not %clang -### %s -flto \ +// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64: error: 'riscv64-unknown-unknown-elf': unable to pass LLVM bit-code files to linker + // RUN: env "PATH=" %clang -### %s -fuse-ld=ld \ // RUN: --target=riscv64-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \ // RUN: -march=rv64imafdc -mabi=lp64d \ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add information about lld presence in RISCVToolchain. (PR #68904)
https://github.com/dybv-sc updated https://github.com/llvm/llvm-project/pull/68904 >From d1ceb3258b0ade810ebdcb3bf2c5727026bef17f Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Mon, 9 Oct 2023 19:49:09 +0300 Subject: [PATCH] [clang] Add information about lld presence in RISCVToolchain. --- .../lib/Driver/ToolChains/RISCVToolchain.cpp | 4 ++- clang/lib/Driver/ToolChains/RISCVToolchain.h | 3 +++ clang/test/Driver/riscv64-toolchain.c | 25 +++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp index 7e6abd144428783..d87af6b4cb89170 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.cpp +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.cpp @@ -49,7 +49,9 @@ bool RISCVToolChain::hasGCCToolchain(const Driver &D, /// RISC-V Toolchain RISCVToolChain::RISCVToolChain(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) -: Generic_ELF(D, Triple, Args) { +: Generic_ELF(D, Triple, Args), UseLLD{Args.getLastArgValue( + options::OPT_fuse_ld_EQ) + .equals_insensitive("lld")} { GCCInstallation.init(Triple, Args); if (GCCInstallation.isValid()) { Multilibs = GCCInstallation.getMultilibs(); diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.h b/clang/lib/Driver/ToolChains/RISCVToolchain.h index de6960726f1cd77..afe98968ecd8616 100644 --- a/clang/lib/Driver/ToolChains/RISCVToolchain.h +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.h @@ -35,11 +35,14 @@ class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF { addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + bool HasNativeLLVMSupport() const override { return UseLLD; } + protected: Tool *buildLinker() const override; private: std::string computeSysRoot() const override; + bool UseLLD; }; } // end namespace toolchains diff --git a/clang/test/Driver/riscv64-toolchain.c b/clang/test/Driver/riscv64-toolchain.c index f177bff33dd4d72..cd7d7624c1c5539 100644 --- a/clang/test/Driver/riscv64-toolchain.c +++ b/clang/test/Driver/riscv64-toolchain.c @@ -121,6 +121,31 @@ // C-RV64IMAC-BAREMETAL-MULTI-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" // C-RV64IMAC-BAREMETAL-MULTI-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" +// Check that lto works in riscv-toolchain when explicitly specified lld as linker. +// RUN: env "PATH=" %clang -### %s -fuse-ld=lld -flto \ +// RUN: -B%S/Inputs/lld --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}lld" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-m" "elf64lriscv" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib/rv64imac/lp64/crt0.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtbegin.o" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "-L{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc" +// C-RV64IMAC-BAREMETAL-LTO-LP64: "{{.*}}/Inputs/multilib_riscv_elf_sdk/lib/gcc/riscv64-unknown-elf/8.2.0/rv64imac/lp64/crtend.o" + +// Check driver error when lto is used without specified lld linker. +// RUN: not env "PATH=" %clang -### %s -flto \ +// RUN: --target=riscv64-unknown-elf --rtlib=platform --sysroot= \ +// RUN: -march=rv64imac -mabi=lp64\ +// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ +// RUN: | FileCheck -check-prefix=C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64 %s + +// C-RV64IMAC-BAREMETAL-LTO-FAIL-LP64: error: 'riscv64-unknown-unknown-elf': unable to pass LLVM bit-code files to linker + // RUN: env "PATH=" %clang -### %s -fuse-ld=ld \ // RUN: --target=riscv64-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \ // RUN: -march=rv64imafdc -mabi=lp64d \ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits