1 ################################################################################
5 ################################################################################
8 MUSL_SITE
= http
://www.musl-libc.org
/releases
10 MUSL_LICENSE_FILES
= COPYRIGHT
12 # Before musl is configured, we must have the first stage
13 # cross-compiler and the kernel headers
14 MUSL_DEPENDENCIES
= host-gcc-initial linux-headers
16 # musl does not provide an implementation for sys/queue.h or sys/cdefs.h.
17 # So, add the musl-compat-headers package that will install those files,
18 # into the staging directory:
19 # sys/queue.h: header from NetBSD
20 # sys/cdefs.h: minimalist header bundled in Buildroot
21 MUSL_DEPENDENCIES
+= musl-compat-headers
23 # musl is part of the toolchain so disable the toolchain dependency
24 MUSL_ADD_TOOLCHAIN_DEPENDENCY
= NO
26 MUSL_INSTALL_STAGING
= YES
28 # Thumb build is broken, build in ARM mode, since all architectures
29 # that support Thumb1 also support ARM.
30 ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB
),y
)
31 MUSL_EXTRA_CFLAGS
+= -marm
34 define MUSL_CONFIGURE_CMDS
36 $(TARGET_CONFIGURE_OPTS
) \
37 CFLAGS
="$(filter-out -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS)) $(MUSL_EXTRA_CFLAGS)" \
38 CPPFLAGS
="$(filter-out -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))" \
40 --target
=$(GNU_TARGET_NAME
) \
41 --host
=$(GNU_TARGET_NAME
) \
44 --disable-gcc-wrapper \
46 $(if
$(BR2_STATIC_LIBS
),--disable-shared
,--enable-shared
))
49 define MUSL_BUILD_CMDS
50 $(TARGET_MAKE_ENV
) $(MAKE
) -C
$(@D
)
53 define MUSL_INSTALL_STAGING_CMDS
54 $(TARGET_MAKE_ENV
) $(MAKE
) -C
$(@D
) \
55 DESTDIR
=$(STAGING_DIR
) install-libs install-tools install-headers
58 define MUSL_INSTALL_TARGET_CMDS
59 $(TARGET_MAKE_ENV
) $(MAKE
) -C
$(@D
) \
60 DESTDIR
=$(TARGET_DIR
) install-libs
61 $(RM
) $(addprefix $(TARGET_DIR
)/lib
/,crt1.o crtn.o crti.o Scrt1.o
)
64 $(eval
$(generic-package
))