Skip to contentSkip to conversation

mtd: fix build on riscv

PATCH New Fabrice Fontaine 3 participants 4 messages Nov 20, 2018 – Nov 21, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: fix build on riscv

Define _REENTRANT otherwise pthread detection will fail

Fixes:
- http://autobuild.buildroot.org/results/b0e7978a997a2aae383161455b5d898b8c28e2e1

---
 package/mtd/mtd.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/mtd/mtd.mk +7 -0
index 13e501fc33..2d627ffa3d 100644
@@ -11,6 +11,13 @@ MTD_LICENSE = GPL-2.0
 MTD_LICENSE_FILES = COPYING
 MTD_INSTALL_STAGING = YES
 
+# gcc on riscv doesn't define _REENTRANT when -pthread is passed while
+# it should. Compensate this deficiency here otherwise mtd configure
+# script doesn't find that thread support is enabled.
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS):$(BR2_riscv),y:y)
+MTD_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -D_REENTRANT"
+endif
+
 ifeq ($(BR2_PACKAGE_MTD_JFFS_UTILS),y)
 MTD_DEPENDENCIES += zlib lzo host-pkgconf
 MTD_CONF_OPTS += --with-jffs
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 mtd: fix build on riscv

Quoted 15 lines · Fabrice Fontaine

Define _REENTRANT otherwise pthread detection will fail

Fixes:
- http://autobuild.buildroot.org/results/b0e7978a997a2aae383161455b5d898b8c28e2e1

---
 package/mtd/mtd.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/mtd/mtd.mk +0 -0
index 13e501fc33..2d627ffa3d 100644

package/mtd/mtd.mk MTD_LICENSE = GPL-2.0 · line 18

Quoted 8 lines
package/mtd/mtd.mk +5 -0
@@ -11,6 +11,13 @@ MTD_LICENSE = GPL-2.0
 MTD_LICENSE_FILES = COPYING
 MTD_INSTALL_STAGING = YES
 
+# gcc on riscv doesn't define _REENTRANT when -pthread is passed while
+# it should. Compensate this deficiency here otherwise mtd configure
+# script doesn't find that thread support is enabled.
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS):$(BR2_riscv),y:y)
+MTD_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -D_REENTRANT"

Patching gcc sounds more and more attractive...

Regards,
Arnout

Quoted 6 lines
package/mtd/mtd.mk +2 -0
+endif
+
 ifeq ($(BR2_PACKAGE_MTD_JFFS_UTILS),y)
 MTD_DEPENDENCIES += zlib lzo host-pkgconf
 MTD_CONF_OPTS += --with-jffs
#2 lore raw

PATCH 1/1 mtd: fix build on riscv

Hello,

Quoted 7 lines · Arnout Vandecappelle

package/mtd/mtd.mk MTD_LICENSE = GPL-2.0 · line 18

Quoted 5 lines
package/mtd/mtd.mk +5 -0
+# gcc on riscv doesn't define _REENTRANT when -pthread is passed while
+# it should. Compensate this deficiency here otherwise mtd configure
+# script doesn't find that thread support is enabled.
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS):$(BR2_riscv),y:y)
+MTD_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -D_REENTRANT"  

Patching gcc sounds more and more attractive...

Yes, definitely. We should do that.

Thomas

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

PATCH 1/1 mtd: fix build on riscv

In reply to Fabrice Fontaine

Hello,

Quoted 9 lines · Fabrice Fontaine

Define _REENTRANT otherwise pthread detection will fail

Fixes:
- http://autobuild.buildroot.org/results/b0e7978a997a2aae383161455b5d898b8c28e2e1

---
 package/mtd/mtd.mk | 7 +++++++
 1 file changed, 7 insertions(+)

Applied to master, thanks.

Thomas

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