From ab182a6ed683f3c8a5f2319caa2c8a58a6e0608d Mon Sep 17 00:00:00 2001
From: Vishwanath Martur <64204611+vishwamartur@users.noreply.github.com>
Date: Fri, 1 Nov 2024 13:04:32 +0530
Subject: [PATCH] Fix PIE support for baremetal RISC-V

Related to #345

Override the `GCCPIE` flag to an empty string in `conf/machine/baremetal-riscv64.conf`.

* Add a comment explaining the reason for the override to support PIE with the elf toolchain.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/riscv/meta-riscv/issues/345?shareId=XXXX-XXXX-XXXX-XXXX).
---
 conf/machine/baremetal-riscv64.conf | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/conf/machine/baremetal-riscv64.conf b/conf/machine/baremetal-riscv64.conf
index 7ee34e1a..d2e99e32 100644
--- a/conf/machine/baremetal-riscv64.conf
+++ b/conf/machine/baremetal-riscv64.conf
@@ -4,3 +4,6 @@
 
 require include/baremetal-riscv.inc
 DEFAULTTUNE = "riscv64"
+
+# Override the GCCPIE flag to an empty string to support PIE with the elf toolchain
+GCCPIE = ""