Skip to contentSkip to conversation

exfat: fix build with musl

PATCH New Peter Korsgaard 1 participant 2 messages Aug 31, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 exfat: fix build with musl

Fixes:
http://autobuild.buildroot.net/results/e1d/e1db07f0ea1e70c62f3294016c1b3a094de71d12/

The endianness handling functions in platform.h are protected behind ifdef __GLIBC__ which musl doesn't define even though it does provide the endianness handling interface. Work around it by ensuring __GLIBC__ is defined.

---
 package/exfat/exfat.mk | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
package/exfat/exfat.mk +11 -2
index 097c3ac..5508ec3 100644
@@ -10,15 +10,24 @@ EXFAT_SOURCE = fuse-exfat-$(EXFAT_VERSION).tar.gz
 EXFAT_DEPENDENCIES = host-scons libfuse
 EXFAT_LICENSE = GPLv3+
 EXFAT_LICENSE_FILES = COPYING
+EXFAT_CFLAGS = $(TARGET_CFLAGS) -std=c99
+
+# The endianness handling functions in platform.h are protected behind
+# ifdef __GLIBC__ which musl doesn't define even though it does
+# provide the endianness handling interface. Work around it by
+# ensuring __GLIBC__ is defined.
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+EXFAT_CFLAGS += -D__GLIBC__
+endif
 
 define EXFAT_BUILD_CMDS
 	(cd $(@D); \
-		$(TARGET_CONFIGURE_OPTS) CCFLAGS="$(TARGET_CFLAGS) -std=c99" $(SCONS))
+		$(TARGET_CONFIGURE_OPTS) CCFLAGS="$(EXFAT_CFLAGS)" $(SCONS))
 endef
 
 define EXFAT_INSTALL_TARGET_CMDS
 	(cd $(@D); \
-		$(TARGET_CONFIGURE_OPTS) CCFLAGS="$(TARGET_CFLAGS) -std=c99" $(SCONS) \
+		$(TARGET_CONFIGURE_OPTS) CCFLAGS="$(EXFAT_CFLAGS)" $(SCONS) \
 		DESTDIR=$(TARGET_DIR)/usr/sbin install)
 endef
 
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 exfat: fix build with musl

Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

Fixes:
http://autobuild.buildroot.net/results/e1d/e1db07f0ea1e70c62f3294016c1b3a094de71d12/

The endianness handling functions in platform.h are protected behind ifdef __GLIBC__ which musl doesn't define even though it does provide the endianness handling interface. Work around it by ensuring __GLIBC__ is defined.

Committed, thanks.

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard