aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Fabrice Fontaine <fontaine.fabrice@gmail.com>2018-11-20 19:52:37 +0100
committerGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2018-11-21 20:58:51 +0100
commit9ea1179eb5eece404a17cf5d313b05f303ae18e2 (patch)
tree2cebfc53008ef3ab35bfd02f392e5563392c6cf4
parente00369fa84ecd32edf1738255d394b16785034ee (diff)
downloadbuildroot-9ea1179eb5eece404a17cf5d313b05f303ae18e2.tar.gz
buildroot-9ea1179eb5eece404a17cf5d313b05f303ae18e2.tar.bz2
mtd: fix build on riscv
Define _REENTRANT otherwise pthread detection will fail Fixes: - http://autobuild.buildroot.org/results/b0e7978a997a2aae383161455b5d898b8c28e2e1 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
-rw-r--r--package/mtd/mtd.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/package/mtd/mtd.mk b/package/mtd/mtd.mk
index 13e501fc33..2d627ffa3d 100644
--- a/package/mtd/mtd.mk
+++ b/package/mtd/mtd.mk
@@ -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