Skip to content

Commit d3e9159

Browse files
committed
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. Signed-off-by: Peter Korsgaard <[email protected]>
1 parent c559c0b commit d3e9159

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

package/exfat/exfat.mk

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,24 @@ EXFAT_SOURCE = fuse-exfat-$(EXFAT_VERSION).tar.gz
1010
EXFAT_DEPENDENCIES = host-scons libfuse
1111
EXFAT_LICENSE = GPLv3+
1212
EXFAT_LICENSE_FILES = COPYING
13+
EXFAT_CFLAGS = $(TARGET_CFLAGS) -std=c99
14+
15+
# The endianness handling functions in platform.h are protected behind
16+
# ifdef __GLIBC__ which musl doesn't define even though it does
17+
# provide the endianness handling interface. Work around it by
18+
# ensuring __GLIBC__ is defined.
19+
ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
20+
EXFAT_CFLAGS += -D__GLIBC__
21+
endif
1322

1423
define EXFAT_BUILD_CMDS
1524
(cd $(@D); \
16-
$(TARGET_CONFIGURE_OPTS) CCFLAGS="$(TARGET_CFLAGS) -std=c99" $(SCONS))
25+
$(TARGET_CONFIGURE_OPTS) CCFLAGS="$(EXFAT_CFLAGS)" $(SCONS))
1726
endef
1827

1928
define EXFAT_INSTALL_TARGET_CMDS
2029
(cd $(@D); \
21-
$(TARGET_CONFIGURE_OPTS) CCFLAGS="$(TARGET_CFLAGS) -std=c99" $(SCONS) \
30+
$(TARGET_CONFIGURE_OPTS) CCFLAGS="$(EXFAT_CFLAGS)" $(SCONS) \
2231
DESTDIR=$(TARGET_DIR)/usr/sbin install)
2332
endef
2433

0 commit comments

Comments
 (0)