[clang] Reland [Driver] Add support for crtbegin.o, crtend.o and libgloss lib to BareMetal toolchain object (PR #144649)

2025-06-26 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/144649 >From e22e920750fa4c5ca98172c2f390640bc42d16ea Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Tue, 17 Jun 2025 21:43:17 +0530 Subject: [PATCH 1/2] Reland [Driver] Add support for GCC installation detec

[clang] Reland [Driver] Add support for crtbegin.o, crtend.o and libgloss lib to BareMetal toolchain object (PR #144649)

2025-06-26 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/144649 >From e22e920750fa4c5ca98172c2f390640bc42d16ea Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Tue, 17 Jun 2025 21:43:17 +0530 Subject: [PATCH 1/2] Reland [Driver] Add support for GCC installation detec

[clang] Reland [Driver] Add support for GCC installation detection in Baremetal toolchain (PR #145390)

2025-06-26 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/145390 >From 20b2dca466710dc44afacd91ea691f3b02137736 Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Tue, 17 Jun 2025 21:43:17 +0530 Subject: [PATCH] Reland [Driver] Add support for GCC installation detection

[clang] Reland [Driver] Add support for GCC installation detection in Baremetal toolchain (PR #145390)

2025-06-26 Thread Garvit Gupta via cfe-commits
quic-garvgupt wrote: > > Triggering a force build will help verify that the fix is effective and > > does not cause any further buildbot failures. Please ensure that PR #145390 > > and PR #144649 are applied in sequence to avoid any merge conflicts > > I couldn't apply the patch for 144649 aft

[clang] [Driver] Add support for GCC installation detection in Baremetal toolchain (PR #121829)

2025-06-12 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/121829 >From f19e2e0abc5e6ad2144772cb654e7b86d28f0efd Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Fri, 13 Dec 2024 05:31:56 -0800 Subject: [PATCH] [Driver] Teach Barmetal toolchain about GCC installation T

[clang] [Driver] Add support for GCC installation detection in Baremetal toolchain (PR #121829)

2025-06-12 Thread Garvit Gupta via cfe-commits
@@ -110,56 +145,113 @@ static std::string computeBaseSysRoot(const Driver &D, bool IncludeTriple) { return std::string(SysRootDir); } -BareMetal::BareMetal(const Driver &D, const llvm::Triple &Triple, - const ArgList &Args) -: ToolChain(D, Triple, Ar

[clang] [llvm] Pass TargetMachine from from Clang to `BitcodeWriter`and `ThinLTOBitcodeWriter` pass for thin and fat LTO respectively. (PR #143692)

2025-06-11 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt edited https://github.com/llvm/llvm-project/pull/143692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Pass TargetMachine from from Clang to `BitcodeWriter`and `ThinLTOBitcodeWriter` pass for thin and fat LTO respectively. (PR #143692)

2025-06-11 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/143692 >From e4902f765b0ef58e015195f2b4974d1f44c6b0c1 Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Mon, 26 May 2025 10:45:37 -0700 Subject: [PATCH] Pass TargetMachine from from Clang to `BitcodeWriter`and `

[clang] [Driver][RISCV] Fix incorrect compiler-rt path override in BareMetal toolchain after RISCVToolChain removal (PR #146849)

2025-07-03 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt edited https://github.com/llvm/llvm-project/pull/146849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][RISCV] Fix incorrect compiler-rt path override in BareMetal toolchain after RISCVToolChain removal (PR #146849)

2025-07-03 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt edited https://github.com/llvm/llvm-project/pull/146849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][RISCV] Fix and print appropriate compiler-rt path when GCCInstallation is valid (PR #146849)

2025-07-03 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt created https://github.com/llvm/llvm-project/pull/146849 Baremetal and RISCVToolchain used different paths for clangrt builtins relative to resource-dir before RISCVToolChain got removed in commit f8cb798 This created a discrepancy in behavior for riscv target wh

[clang] [Driver][RISCV] Fix and print appropriate compiler-rt path when GCCInstallation is valid (PR #146849)

2025-07-03 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt edited https://github.com/llvm/llvm-project/pull/146849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland [Driver] Fix link order of BareMetal toolchain object (PR #146291)

2025-06-29 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt closed https://github.com/llvm/llvm-project/pull/146291 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Integrate RISCV target in baremetal toolchain object and deprecate RISCVToolchain object (PR #121831)

2025-06-30 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt closed https://github.com/llvm/llvm-project/pull/121831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][Driver] Add support for `-m` flag to linker job of Baremetal toolchain (PR #134442)

2025-06-30 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt closed https://github.com/llvm/llvm-project/pull/134442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Integrate RISCV target in baremetal toolchain object and deprecate RISCVToolchain object (PR #121831)

2025-06-30 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt edited https://github.com/llvm/llvm-project/pull/121831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland[Driver] Add option to force undefined symbols during linking in BareMetal toolchain object. (PR #146304)

2025-06-29 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt closed https://github.com/llvm/llvm-project/pull/146304 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Forward sysroot from Driver to linker in BareMetal ToolChain Object (PR #132808)

2025-06-30 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt closed https://github.com/llvm/llvm-project/pull/132808 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][Driver] Add support for `-m` flag to linker job of Baremetal toolchain (PR #134442)

2025-06-30 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt edited https://github.com/llvm/llvm-project/pull/134442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][Driver] Add support for `-m` flag to linker job of Baremetal toolchain (PR #134442)

2025-06-30 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/134442 >From 9d48ea76ef90ac9e76ade4af77667e44652e3408 Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Fri, 4 Apr 2025 12:51:19 -0700 Subject: [PATCH] [RISCV][Driver] Add support for `-m` flag to linker job of

[clang] Reland [Driver] Add support for crtbegin.o, crtend.o and libgloss lib to BareMetal toolchain object (PR #144649)

2025-06-30 Thread Garvit Gupta via cfe-commits
quic-garvgupt wrote: > > Moreover, this patch makes gnuld the default linker for baremetal > > toolchain object. User need to pass -fuse-ld=lld explicitly to driver to > > select > > lld > > This seems like an unrelated change, it was not mentioned in the RFC, and it > breaks things: baremetal

[clang] Reland [Driver] Add support for crtbegin.o, crtend.o and libgloss lib to BareMetal toolchain object (PR #144649)

2025-06-30 Thread Garvit Gupta via cfe-commits
@@ -59,3 +118,39 @@ // CXX-AARCH64-BAREMETAL-NOSYSROOT-LIBCXX: "-internal-isystem" "{{.*}}/Inputs/basic_aarch64_gcc_tree/lib/gcc/aarch64-none-elf/8.2.1/../../../../aarch64-none-elf/include/c++/v1" // CXX-AARCH64-BAREMETAL-NOSYSROOT-LIBCXX: "-internal-isystem" "{{.*}}/Inputs/

[clang] Reland[Driver] Add option to force undefined symbols during linking in BareMetal toolchain object. (PR #146304)

2025-06-29 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt created https://github.com/llvm/llvm-project/pull/146304 Add support for `-u` option to force defined symbols. This option is supported by both lld and gnuld. This is done as a part of the effort to merge RISCVToolchain object into BareMetal toolchain object.

[clang] Reland [Driver] Add support for GCC installation detection in Baremetal toolchain (PR #145390)

2025-06-26 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/145390 >From 296df79cb9e9696daa926267c8a9a853930fdc46 Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Tue, 17 Jun 2025 21:43:17 +0530 Subject: [PATCH] Reland [Driver] Add support for GCC installation detection

[clang] Reland [Driver] Add support for crtbegin.o, crtend.o and libgloss lib to BareMetal toolchain object (PR #144649)

2025-06-26 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/144649 >From 36f8e160dfad059fdada0a00b5cdc20dde0076c0 Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Tue, 17 Jun 2025 22:49:55 +0530 Subject: [PATCH] [Driver] Add support for crtbegin.o, crtend.o and libgloss

[clang] [RISCV] Integrate RISCV target in baremetal toolchain object and deprecate RISCVToolchain object (PR #121831)

2025-06-30 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/121831 >From b9e1db372117d9d418d0812a09874526e88efad4 Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Mon, 6 Jan 2025 10:05:08 -0800 Subject: [PATCH] [RISCV] Integrate RISCV target in baremetal toolchain object

[clang] [RISCV] Integrate RISCV target in baremetal toolchain object and deprecate RISCVToolchain object (PR #121831)

2025-06-30 Thread Garvit Gupta via cfe-commits
@@ -336,6 +336,26 @@ BareMetal::OrderedMultilibs BareMetal::getOrderedMultilibs() const { return llvm::reverse(Default); } +ToolChain::CXXStdlibType BareMetal::GetDefaultCXXStdlibType() const { + if (getTriple().isRISCV() && GCCInstallation.isValid()) +return ToolChain

[clang] [RISCV] Integrate RISCV target in baremetal toolchain object and deprecate RISCVToolchain object (PR #121831)

2025-06-30 Thread Garvit Gupta via cfe-commits
@@ -336,6 +336,26 @@ BareMetal::OrderedMultilibs BareMetal::getOrderedMultilibs() const { return llvm::reverse(Default); } +ToolChain::CXXStdlibType BareMetal::GetDefaultCXXStdlibType() const { + if (getTriple().isRISCV() && GCCInstallation.isValid()) +return ToolChain

[clang] [Driver] Forward sysroot from Driver to linker in BareMetal ToolChain Object (PR #132808)

2025-06-29 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/132808 >From e302490b6e6350951e75bd68578606aa7909692e Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Mon, 24 Mar 2025 07:04:59 -0700 Subject: [PATCH] [Driver] Forward sysroot from Driver to linker in BareMetal

[clang] Reland [Driver] Add support for crtbegin.o, crtend.o and libgloss lib to BareMetal toolchain object (PR #144649)

2025-06-29 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/144649 >From 14a2bb5dead7fa0e3d442e04ba73ad5f98d2e90e Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Tue, 17 Jun 2025 22:49:55 +0530 Subject: [PATCH] [Driver] Add support for crtbegin.o, crtend.o and libgloss

[clang] [RISCV] Merging RISCVToolChain and BareMetal toolchains (PR #118809)

2025-06-29 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt closed https://github.com/llvm/llvm-project/pull/118809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland [Driver] Add support for GCC installation detection in Baremetal toolchain (PR #145390)

2025-06-29 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt closed https://github.com/llvm/llvm-project/pull/145390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland [Driver] Fix link order of BareMetal toolchain object (PR #146291)

2025-06-29 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt created https://github.com/llvm/llvm-project/pull/146291 The linker job in BareMetal toolchain object will be used by GNU ld and lld both. However, gnuld process the arguments in the order in which they appear on command line, whereas there is no such restricti

[clang] Reland [Driver] Add support for crtbegin.o, crtend.o and libgloss lib to BareMetal toolchain object (PR #144649)

2025-06-29 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt closed https://github.com/llvm/llvm-project/pull/144649 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Propogate linker flags when -static-pie is enabled in BareMetal Toolchain (PR #147589)

2025-07-08 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/147589 >From 6f96fc844751a95ee18b69ddb850ddd2fe76a89c Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Tue, 8 Jul 2025 07:21:37 -0700 Subject: [PATCH 1/2] Propogate appropriate linker flags for `-static-pie` in

[clang] [Driver][RISCV] Fix incorrect compiler-rt path override in BareMetal toolchain after RISCVToolChain removal (PR #146849)

2025-07-07 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/146849 >From 3d0220ecce368a481981c414f789d9dbbfc49c81 Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Thu, 3 Jul 2025 02:56:01 -0700 Subject: [PATCH] [Driver][RISCV] Fix and print appropriate compiler-rt path

[clang] [Driver][RISCV] Fix incorrect compiler-rt path override in BareMetal toolchain after RISCVToolChain removal (PR #146849)

2025-07-07 Thread Garvit Gupta via cfe-commits
@@ -206,6 +206,15 @@ std::string BareMetal::computeSysRoot() const { return computeClangRuntimesSysRoot(D, /*IncludeTriple*/ true); } +std::string BareMetal::getCompilerRTPath() const { + if (IsGCCInstallationValid || detectGCCToolchainAdjacent(getDriver())) { +SmallStr

[clang] [Driver][RISCV] Fix incorrect compiler-rt path override in BareMetal toolchain after RISCVToolChain removal (PR #146849)

2025-07-07 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt closed https://github.com/llvm/llvm-project/pull/146849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Propogate linker flags when -static-pie is enabled in BareMetal Toolchain (PR #147589)

2025-07-08 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/147589 >From c6420bc64c2745c49400408ba93afa34eea194e3 Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Tue, 8 Jul 2025 12:44:44 -0700 Subject: [PATCH] Propogate linker flags when `-static-pie` is enabled in Bar

[clang] Add necessary linker flags when -static-pie is enabled in BareMetal Toolchain (PR #147589)

2025-07-08 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt edited https://github.com/llvm/llvm-project/pull/147589 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Propogate linker flags when -static-pie is enabled in BareMetal Toolchain (PR #147589)

2025-07-08 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/147589 >From a1f3797d0acb93e66959c5163aeb49213d2d32a1 Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Tue, 8 Jul 2025 12:44:44 -0700 Subject: [PATCH] Propogate linker flags when `-static-pie` is enabled in Bar

[clang] Propogate linker flags when -static-pie is enabled in BareMetal Toolchain (PR #147589)

2025-07-08 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt created https://github.com/llvm/llvm-project/pull/147589 None >From 6f96fc844751a95ee18b69ddb850ddd2fe76a89c Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Tue, 8 Jul 2025 07:21:37 -0700 Subject: [PATCH 1/2] Propogate appropriate linker flags for `-static-pi

[clang] Add necessary linker flags when -static-pie is enabled in BareMetal Toolchain (PR #147589)

2025-07-10 Thread Garvit Gupta via cfe-commits
@@ -599,11 +599,18 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA, const Driver &D = getToolChain().getDriver(); const llvm::Triple::ArchType Arch = TC.getArch(); const llvm::Triple &Triple = getToolChain().getEffectiveTriple(); + const bool

[clang] Add necessary linker flags when -static-pie is enabled in BareMetal Toolchain (PR #147589)

2025-07-10 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt edited https://github.com/llvm/llvm-project/pull/147589 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add necessary linker flags when -static-pie is enabled in BareMetal Toolchain (PR #147589)

2025-07-15 Thread Garvit Gupta via cfe-commits
@@ -599,11 +599,18 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA, const Driver &D = getToolChain().getDriver(); const llvm::Triple::ArchType Arch = TC.getArch(); const llvm::Triple &Triple = getToolChain().getEffectiveTriple(); + const bool

[clang] Add necessary linker flags when -static-pie is enabled in BareMetal Toolchain (PR #147589)

2025-07-15 Thread Garvit Gupta via cfe-commits
quic-garvgupt wrote: >I don't think that this should necessarily prevent this patch from landing. To >some degree users can just not use the option if the toolchain doesn't support >it. The file names for crt files are borrowed from their linux equivalent. However as already pointed out, if

[clang] Fix extraneous addition of `-X` flag in baremetal toolchain (PR #148855)

2025-07-15 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt created https://github.com/llvm/llvm-project/pull/148855 Commit 597ee88 moved the -X flag to a new position in the baremetal toolchain's linker job, but unintentionally left the original instance in place. This patch removes the redundant flag, ensuring -X is

[clang] Fix adding support for -X flag in Baremetal toolchain (PR #147804)

2025-07-15 Thread Garvit Gupta via cfe-commits
https://github.com/quic-garvgupt updated https://github.com/llvm/llvm-project/pull/147804 >From d92b98015db0e03d1f71658884cd931162835184 Mon Sep 17 00:00:00 2001 From: Garvit Gupta Date: Wed, 9 Jul 2025 11:58:19 -0700 Subject: [PATCH] Fix adding support for -X flag in Baremetal toolchain Commi

[clang] Fix adding support for -X flag in Baremetal toolchain (PR #147804)

2025-07-15 Thread Garvit Gupta via cfe-commits
@@ -613,8 +613,8 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA, return; } + CmdArgs.push_back("-X"); quic-garvgupt wrote: I made a few mistakes in the commit message and title. The intent of this PR is to add support for

<    1   2