Browse Source

shadowsocks-libev: fix build on riscv

Define _REENTRANT otherwise pthread detection will fail

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

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Fabrice Fontaine 6 years ago
parent
commit
ebffca8ba4
1 changed files with 7 additions and 0 deletions
  1. 7 0
      package/shadowsocks-libev/shadowsocks-libev.mk

+ 7 - 0
package/shadowsocks-libev/shadowsocks-libev.mk

@@ -14,4 +14,11 @@ SHADOWSOCKS_LIBEV_CONF_OPTS = \
 	--with-pcre=$(STAGING_DIR)/usr \
 	--disable-ssp
 
+# gcc on riscv doesn't define _REENTRANT when -pthread is passed while
+# it should. Compensate this deficiency here otherwise shadowsocks-libev
+# configure script doesn't find that thread support is enabled.
+ifeq ($(BR2_riscv),y)
+SHADOWSOCKS_LIBEV_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -D_REENTRANT"
+endif
+
 $(eval $(autotools-package))