Skip to contentSkip to conversation

python3-matplotlib: Disable LTO for clang/riscv

PATCH In review Khem Raj 2 participants 2 messages Nov 30, 2020 – Dec 2, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 python3-matplotlib: Disable LTO for clang/riscv

LTO fails to link on RV32/RV64

| Hard-float 'd' ABI can't be used for a target that doesn't support the D instruction set extension ( ignoring target-abi)
| riscv64-yoe-linux-ld.lld: error: lto.tmp: cannot link object files with different floating-point ABI

---
 .../recipes-devtools/python/python3-matplotlib_3.3.2.bb        | 3 +++
 1 file changed, 3 insertions(+)
meta-python/recipes-devtools/python/python3-matplotlib_3.3.2.bb +3 -0
index a2e7074d78..3cfa3f31f4 100644
@@ -38,9 +38,12 @@ RDEPENDS_${PN} = "\
     python3-pytz \
 "
 
+ENABLELTO_toolchain-clang_riscv64 = "echo enable_lto = False >> ${S}/setup.cfg"
+ENABLELTO_toolchain-clang_riscv32 = "echo enable_lto = False >> ${S}/setup.cfg"
 do_compile_prepend() {
     echo [libs] > ${S}/setup.cfg
     echo system_freetype = true >> ${S}/setup.cfg
+    ${ENABLELTO}
 }
 
 BBCLASSEXTEND = "native"
Signature · 1 line
2.29.2
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Khem Raj

[Please note this e-mail is from an EXTERNAL e-mail address]

LTO fails to link on RV32/RV64

| Hard-float 'd' ABI can't be used for a target that doesn't support the D instruction set extension ( ignoring target-abi)
| riscv64-yoe-linux-ld.lld: error: lto.tmp: cannot link object files with different floating-point ABI

Quoted 27 lines
---
  .../recipes-devtools/python/python3-matplotlib_3.3.2.bb        | 3 +++
  1 file changed, 3 insertions(+)
meta-python/recipes-devtools/python/python3-matplotlib_3.3.2.bb +3 -1
index a2e7074d78..3cfa3f31f4 100644
@@ -38,9 +38,12 @@ RDEPENDS_${PN} = "\
      python3-pytz \
  "
 
+ENABLELTO_toolchain-clang_riscv64 = "echo enable_lto = False >> ${S}/setup.cfg"
+ENABLELTO_toolchain-clang_riscv32 = "echo enable_lto = False >> ${S}/setup.cfg"
  do_compile_prepend() {
      echo [libs] > ${S}/setup.cfg
      echo system_freetype = true >> ${S}/setup.cfg
+    ${ENABLELTO}
  }
 
  BBCLASSEXTEND = "native"
--

2.29.2