Skip to contentSkip to conversation

opensbi: force gcc toolchain

PATCH In review [email protected] 2 participants 3 messages Jan 22 – Feb 3

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 opensbi: force gcc toolchain

From: Thomas Perrot <[email protected]>

OpenSBI requires the gcc toolchain to build correctly. Set TOOLCHAIN explicitly to prevent build failures when using alternative toolchains.

---
 meta/recipes-bsp/opensbi/opensbi_1.8.1.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-bsp/opensbi/opensbi_1.8.1.bb +2 -0
index 0a9652c2831e..52d7b38ff2ba 100644
@@ -15,6 +15,8 @@ TARGET_DBGSRC_DIR = "/share/opensbi/*/generic/firmware/"
 
 TARGET_CC_ARCH += "${LDFLAGS}"
 
+TOOLCHAIN = "gcc"
+
 RISCV_SBI_FW_TEXT_START ??= "0x80000000"
 EXTRA_OEMAKE += "REPRODUCIBLE=y CROSS_COMPILE=${HOST_PREFIX} ELFFLAGS="${LDFLAGS}" PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_TEXT_START=${RISCV_SBI_FW_TEXT_START}"
 EXTRA_OEMAKE:append:toolchain-clang = " LLVM=y"
Signature · 1 line
2.52.0
#1 lore raw
Quoted 6 lines · Thomas Perrot via lists.openembedded.org

From: Thomas Perrot <[email protected]>

OpenSBI requires the gcc toolchain to build correctly. Set TOOLCHAIN explicitly to prevent build failures when using alternative toolchains.

I am assuming you are having issues compiling it with clang, it would be good to document whats going wrong.
Since it's a bug to address, openSBI does not intend to use a particular compiler.

Quoted 37 lines
---
 meta/recipes-bsp/opensbi/opensbi_1.8.1.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-bsp/opensbi/opensbi_1.8.1.bb +2 -0
index 0a9652c2831e..52d7b38ff2ba 100644
@@ -15,6 +15,8 @@ TARGET_DBGSRC_DIR = "/share/opensbi/*/generic/firmware/"
 
 TARGET_CC_ARCH += "${LDFLAGS}"
 
+TOOLCHAIN = "gcc"
+
 RISCV_SBI_FW_TEXT_START ??= "0x80000000"
 EXTRA_OEMAKE += "REPRODUCIBLE=y CROSS_COMPILE=${HOST_PREFIX}
 ELFFLAGS="${LDFLAGS}" PLATFORM=${RISCV_SBI_PLAT} I=${D}

FW_TEXT_START=${RISCV_SBI_FW_TEXT_START}"
EXTRA_OEMAKE:append:toolchain-clang = " LLVM=y"
--
2.52.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#229847):
https://lists.openembedded.org/g/openembedded-core/message/229847
Mute This Topic: https://lists.openembedded.org/mt/117401535/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

Hello Khem,

Quoted 14 lines · Khem Raj via lists.openembedded.org
Quoted 7 lines · Thomas Perrot via lists.openembedded.org

From: Thomas Perrot <[email protected]>

OpenSBI requires the gcc toolchain to build correctly. Set TOOLCHAIN
explicitly to prevent build failures when using alternative toolchains.

Quoted 5 lines

I am assuming you are having issues compiling it with clang, it would be good to document whats going wrong.
Since it's a bug to address, openSBI does not intend to use a particular compiler.

We are figuring out the linker issue when Clang is used as the default toolchain. We haven't taken the time to figure it out yet.

Kind regards,
Thomas Perrot

Quoted 36 lines
Quoted 36 lines

---
 meta/recipes-bsp/opensbi/opensbi_1.8.1.bb | 2 ++

 1 file changed, 2 insertions(+)
meta/recipes-bsp/opensbi/opensbi_1.8.1.bb +0 -0
index 0a9652c2831e..52d7b38ff2ba 100644
@@ -15,6 +15,8 @@ TARGET_DBGSRC_DIR =

"/share/opensbi/*/generic/firmware/"

 TARGET_CC_ARCH += "${LDFLAGS}"

meta/recipes-bsp/opensbi/opensbi_1.8.1.bb +2 -0
+TOOLCHAIN = "gcc"
+

 RISCV_SBI_FW_TEXT_START ??= "0x80000000" EXTRA_OEMAKE += "REPRODUCIBLE=y CROSS_COMPILE=${HOST_PREFIX} ELFFLAGS="${LDFLAGS}" PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_TEXT_START=${RISCV_SBI_FW_TEXT_START}" EXTRA_OEMAKE:append:toolchain-clang = " LLVM=y"

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#229853):
https://lists.openembedded.org/g/openembedded-core/message/229853
Mute This Topic:
https://lists.openembedded.org/mt/117401535/5443093
Group Owner: [email protected] Unsubscribe:
https://lists.openembedded.org/g/openembedded-core/unsub [
[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Thomas Perrot, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com