Skip to contentSkip to conversation

Revert "toolchain/toolchain-buildroot: enable uclibc for riscv64"

PATCH New Thomas Petazzoni 2 participants 3 messages Aug 15, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "toolchain/toolchain-buildroot: enable uclibc for riscv64"

This reverts commit bd9810e176273914eca1208bcba23f0de9e446b3. Indeed, while uClibc-ng has support for RISC-V 64-bit, this support lacks the __riscv_flush_icache() function call, which is used by some GCC builtins used for example in libffi.

Due to this missing __riscv_flush_icache(), anything that links against libffi fails to build:

/home/test/autobuild/run/instance-0/output-1/host/bin/riscv64-buildroot-linux-uclibc-gcc -o gobject/gobject-query gobject/gobject-query.p/gobject-query.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -Wl,--start-group glib/libglib-2.0.so.0.6400.4 gobject/libgobject-2.0.so.0.6400.4 -Wl,--end-group -pthread '-Wl,-rpath,$ORIGIN/../glib:$ORIGIN/' -Wl,-rpath-link,/home/test/autobuild/run/instance-0/output-1/build/libglib2-2.64.4/build/glib -Wl,-rpath-link,/home/test/autobuild/run/instance-0/output-1/build/libglib2-2.64.4/build/gobject /home/test/autobuild/run/instance-0/output-1/host/lib/gcc/riscv64-buildroot-linux-uclibc/9.3.0/../../../../riscv64-buildroot-linux-uclibc/bin/ld: /home/test/autobuild/run/instance-0/output-1/host/riscv64-buildroot-linux-uclibc/sysroot/usr/lib64/libffi.so.7: undefined reference to `__riscv_flush_icache'
collect2: error: ld returned 1 exit status

Note that this commit means that support/config-fragments/autobuild/br-riscv64-full-internal.config will be back to using glibc as the C library, but that is OK, until uClibc-ng is fixed to implemented __riscv_flush_icache().

This uClibc-ng issue has been reported upstream at
https://mailman.uclibc-ng.org/pipermail/devel/2020-August/002022.html.

Fixes:

http://autobuild.buildroot.net/results/ec1185ad1fd8863a3990143a0af2ace987761a27/

---
 package/uclibc/Config.in                |  1 -
 toolchain/toolchain-buildroot/Config.in | 13 ++++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)
package/uclibc/Config.in +0 -1
index f4d4f06462..de2885bc92 100644
@@ -101,7 +101,6 @@ config BR2_UCLIBC_TARGET_ARCH
 	default "mips"	   if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
 	default "or1k"     if BR2_or1k
 	default "powerpc"  if BR2_powerpc
-	default "riscv64"  if BR2_RISCV_64
 	default "sh"	   if BR2_sh
 	default "sparc"	   if BR2_sparc
 	default "xtensa"   if BR2_xtensa
toolchain/toolchain-buildroot/Config.in +6 -7
index 068f91c875..418d5cb387 100644
@@ -27,13 +27,12 @@ choice
 
 config BR2_TOOLCHAIN_BUILDROOT_UCLIBC
 	bool "uClibc-ng"
-	depends on BR2_aarch64 || BR2_aarch64_be || BR2_arcle      || BR2_arceb    || \
-		   BR2_arm     || BR2_armeb      || \
-		   BR2_i386    || BR2_m68k       || BR2_microblaze || \
-		   BR2_mips    || BR2_mipsel     || BR2_mips64     || BR2_mips64el || \
-		   BR2_or1k    || BR2_powerpc    || BR2_RISCV_64   || \
-		   BR2_sh2a    || BR2_sh4	 || BR2_sh4eb      || BR2_sparc    || \
-		   BR2_xtensa  || BR2_x86_64
+	depends on BR2_aarch64 || BR2_aarch64_be || BR2_arcle   || BR2_arceb  || \
+		   BR2_arm     || BR2_armeb    || \
+		   BR2_i386    || BR2_m68k   || BR2_microblaze || \
+		   BR2_mips    || BR2_mipsel || BR2_mips64 || BR2_mips64el || \
+		   BR2_or1k    || BR2_powerpc || BR2_sh2a   || BR2_sh4	   || \
+		   BR2_sh4eb   || BR2_sparc   || BR2_xtensa || BR2_x86_64
 	select BR2_TOOLCHAIN_USES_UCLIBC
 	help
 	  This option selects uClibc-ng as the C library for the
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/1 Revert "toolchain/toolchain-buildroot: enable uclibc for riscv64"

Thomas, All,

On 2020-08-15 16:10 +0200, Thomas Petazzoni spake thusly:

Quoted 17 lines

This reverts commit bd9810e176273914eca1208bcba23f0de9e446b3. Indeed, while uClibc-ng has support for RISC-V 64-bit, this support lacks the __riscv_flush_icache() function call, which is used by some GCC builtins used for example in libffi.

Due to this missing __riscv_flush_icache(), anything that links against libffi fails to build:

/home/test/autobuild/run/instance-0/output-1/host/bin/riscv64-buildroot-linux-uclibc-gcc -o gobject/gobject-query gobject/gobject-query.p/gobject-query.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -Wl,--start-group glib/libglib-2.0.so.0.6400.4 gobject/libgobject-2.0.so.0.6400.4 -Wl,--end-group -pthread '-Wl,-rpath,$ORIGIN/../glib:$ORIGIN/' -Wl,-rpath-link,/home/test/autobuild/run/instance-0/output-1/build/libglib2-2.64.4/build/glib -Wl,-rpath-link,/home/test/autobuild/run/instance-0/output-1/build/libglib2-2.64.4/build/gobject /home/test/autobuild/run/instance-0/output-1/host/lib/gcc/riscv64-buildroot-linux-uclibc/9.3.0/../../../../riscv64-buildroot-linux-uclibc/bin/ld: /home/test/autobuild/run/instance-0/output-1/host/riscv64-buildroot-linux-uclibc/sysroot/usr/lib64/libffi.so.7: undefined reference to `__riscv_flush_icache'
collect2: error: ld returned 1 exit status

Note that this commit means that support/config-fragments/autobuild/br-riscv64-full-internal.config will be back to using glibc as the C library, but that is OK, until uClibc-ng is fixed to implemented __riscv_flush_icache().

Quoted 8 lines

This uClibc-ng issue has been reported upstream at
https://mailman.uclibc-ng.org/pipermail/devel/2020-August/002022.html.

Fixes:

http://autobuild.buildroot.net/results/ec1185ad1fd8863a3990143a0af2ace987761a27/

Applied to master, thanks.

OTOH, I was wondering why we were not adding an exclusion in the genrandconfig script, like we do for all the other libffi limitations...

Regards,
Yann E. MORIN.

Quoted 44 lines
---
 package/uclibc/Config.in                |  1 -
 toolchain/toolchain-buildroot/Config.in | 13 ++++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)
package/uclibc/Config.in +0 -1
index f4d4f06462..de2885bc92 100644
@@ -101,7 +101,6 @@ config BR2_UCLIBC_TARGET_ARCH
 	default "mips"	   if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
 	default "or1k"     if BR2_or1k
 	default "powerpc"  if BR2_powerpc
-	default "riscv64"  if BR2_RISCV_64
 	default "sh"	   if BR2_sh
 	default "sparc"	   if BR2_sparc
 	default "xtensa"   if BR2_xtensa
toolchain/toolchain-buildroot/Config.in +6 -7
index 068f91c875..418d5cb387 100644
@@ -27,13 +27,12 @@ choice
 
 config BR2_TOOLCHAIN_BUILDROOT_UCLIBC
 	bool "uClibc-ng"
-	depends on BR2_aarch64 || BR2_aarch64_be || BR2_arcle      || BR2_arceb    || \
-		   BR2_arm     || BR2_armeb      || \
-		   BR2_i386    || BR2_m68k       || BR2_microblaze || \
-		   BR2_mips    || BR2_mipsel     || BR2_mips64     || BR2_mips64el || \
-		   BR2_or1k    || BR2_powerpc    || BR2_RISCV_64   || \
-		   BR2_sh2a    || BR2_sh4	 || BR2_sh4eb      || BR2_sparc    || \
-		   BR2_xtensa  || BR2_x86_64
+	depends on BR2_aarch64 || BR2_aarch64_be || BR2_arcle   || BR2_arceb  || \
+		   BR2_arm     || BR2_armeb    || \
+		   BR2_i386    || BR2_m68k   || BR2_microblaze || \
+		   BR2_mips    || BR2_mipsel || BR2_mips64 || BR2_mips64el || \
+		   BR2_or1k    || BR2_powerpc || BR2_sh2a   || BR2_sh4	   || \
+		   BR2_sh4eb   || BR2_sparc   || BR2_xtensa || BR2_x86_64
 	select BR2_TOOLCHAIN_USES_UCLIBC
 	help
 	  This option selects uClibc-ng as the C library for the
Signature · 1 line
2.26.2
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 Revert "toolchain/toolchain-buildroot: enable uclibc for riscv64"

Hello Yann,

Quoted 4 lines · On Sat, 15 Aug 2020 22:30:14 +0200 "Yann E. MORIN" <[email protected]>…

Applied to master, thanks.

OTOH, I was wondering why we were not adding an exclusion in the genrandconfig script, like we do for all the other libffi limitations...

Our libffi exclusions in genrandconfig are really when there is no support for a given CPU architecture in libffi.

In the situation we're talking about, libffi does have support for RISC-V 64-bit. The limitation is not in libffi, but in uClibc-ng.

We could certainly have handled that by an autobuilder exception, but I've never been a big fan of such autobuilder exceptions. That being said, if the general feeling is that an autobuilder exception is a better way of avoiding those build failures, I'm fine with changing to that solution.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com