summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2013-08-12 14:32:28 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2013-08-12 14:32:28 +0200
commitf04227421063498a88707c43ec80b2b70d9b8d83 (patch)
tree189393a32f3af46500594d744010913ebebc1f2b
parent7a8e9c0ea181628555861fb4bbd3760ed1ca80e2 (diff)
complete musl support, tested with qemu-arm
-rw-r--r--package/Makefile4
-rw-r--r--package/busybox/Makefile1
-rw-r--r--package/busybox/patches/009-extra-flags.patch9
-rw-r--r--package/busybox/patches/013-musl.patch11
-rw-r--r--package/musl/Config.in.manual17
-rw-r--r--package/musl/Makefile45
6 files changed, 81 insertions, 6 deletions
diff --git a/package/Makefile b/package/Makefile
index 9cf448ff8..85321f9ee 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -13,6 +13,10 @@ ifeq (${ADK_TARGET_LIB_EGLIBC},y)
package-$(ADK_PACKAGE_EGLIBC) += eglibc
gcc-compile: eglibc-compile
endif
+ifeq (${ADK_TARGET_LIB_MUSL},y)
+package-$(ADK_PACKAGE_MUSL) += musl
+gcc-compile: musl-compile
+endif
ifeq (${ADK_NATIVE},y)
package-$(ADK_PACKAGE_LIBC) += libc
endif
diff --git a/package/busybox/Makefile b/package/busybox/Makefile
index 7ab3da9db..4a8e8ea68 100644
--- a/package/busybox/Makefile
+++ b/package/busybox/Makefile
@@ -9,7 +9,6 @@ PKG_RELEASE:= 2
PKG_MD5SUM:= e025414bc6cd79579cc7a32a45d3ae1c
PKG_DESCR:= Core utilities for embedded systems
PKG_SECTION:= base
-PKG_BUILDDEP:= libtirpc
PKG_URL:= http://www.busybox.net/
PKG_SITES:= http://www.busybox.net/downloads/
diff --git a/package/busybox/patches/009-extra-flags.patch b/package/busybox/patches/009-extra-flags.patch
index f440d4380..00671a0f4 100644
--- a/package/busybox/patches/009-extra-flags.patch
+++ b/package/busybox/patches/009-extra-flags.patch
@@ -1,7 +1,7 @@
-diff -Nur busybox-1.19.4.orig/Makefile busybox-1.19.4/Makefile
---- busybox-1.19.4.orig/Makefile 2012-02-04 20:34:24.000000000 +0100
-+++ busybox-1.19.4/Makefile 2012-03-22 19:17:49.099007985 +0100
-@@ -318,10 +318,10 @@
+diff -Nur busybox-1.20.2.orig/Makefile busybox-1.20.2/Makefile
+--- busybox-1.20.2.orig/Makefile 2012-07-02 16:20:27.000000000 +0200
++++ busybox-1.20.2/Makefile 2013-08-12 13:36:00.000000000 +0200
+@@ -318,10 +318,9 @@
CFLAGS := $(CFLAGS)
# Added only to final link stage of busybox binary
CFLAGS_busybox := $(CFLAGS_busybox)
@@ -11,7 +11,6 @@ diff -Nur busybox-1.19.4.orig/Makefile busybox-1.19.4/Makefile
-LDFLAGS := $(LDFLAGS)
-LDLIBS :=
+LDFLAGS := $(LDFLAGS) $(EXTRA_LDFLAGS)
-+LDLIBS := tirpc
# Read KERNELRELEASE from .kernelrelease (if it exists)
KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null)
diff --git a/package/busybox/patches/013-musl.patch b/package/busybox/patches/013-musl.patch
new file mode 100644
index 000000000..af3d05141
--- /dev/null
+++ b/package/busybox/patches/013-musl.patch
@@ -0,0 +1,11 @@
+diff -Nur busybox-1.20.2.orig/networking/libiproute/iplink.c busybox-1.20.2/networking/libiproute/iplink.c
+--- busybox-1.20.2.orig/networking/libiproute/iplink.c 2012-06-26 15:35:45.000000000 +0200
++++ busybox-1.20.2/networking/libiproute/iplink.c 2013-08-12 13:00:33.000000000 +0200
+@@ -5,7 +5,6 @@
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+ #include <net/if.h>
+-#include <net/if_packet.h>
+ #include <netpacket/packet.h>
+ #include <netinet/if_ether.h>
+
diff --git a/package/musl/Config.in.manual b/package/musl/Config.in.manual
new file mode 100644
index 000000000..19f590e61
--- /dev/null
+++ b/package/musl/Config.in.manual
@@ -0,0 +1,17 @@
+config ADK_PACKAGE_MUSL
+ prompt "musl................. embedded C library"
+ bool
+ default y if ADK_TARGET_LIB_MUSL && !ADK_TOOLCHAIN_ONLY
+ default n
+ depends on ADK_TARGET_LIB_MUSL
+ help
+ Embedded C library.
+
+config ADK_PACKAGE_MUSL_DEV
+ prompt "musl-dev............. development files"
+ tristate
+ default n
+ depends on ADK_TARGET_LIB_MUSL && ADK_PACKAGE_MUSL
+ help
+ C library header files.
+
diff --git a/package/musl/Makefile b/package/musl/Makefile
new file mode 100644
index 000000000..f37fd2eb2
--- /dev/null
+++ b/package/musl/Makefile
@@ -0,0 +1,45 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/toolchain/musl/Makefile.inc
+
+PKG_DESCR:= embedded C library
+PKG_SECTION:= base
+PKG_OPTS:= noremove
+
+PKG_SUBPKGS:= MUSL MUSL_DEV
+PKGSD_MUSL_DEV:= development files for musl
+PKGSC_MUSL_DEV:= devel
+
+NO_DISTFILES:= 1
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,MUSL,musl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
+$(eval $(call PKG_template,MUSL_DEV,musl-dev,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_MUSL_DEV},${PKGSC_MUSL_DEV},${PKG_OPTS}))
+
+CONFIG_STYLE:= manual
+BUILD_STYLE:= manual
+INSTALL_STYLE:= manual
+
+# do nothing, musl is already build in toolchain directory
+do-install:
+ ${INSTALL_DIR} $(IDIR_MUSL)/$(ADK_TARGET_LIBC_PATH)
+ $(CP) $(STAGING_TARGET_DIR)/usr/lib/libc.so $(IDIR_MUSL)/$(ADK_TARGET_LIBC_PATH)
+ (cd $(IDIR_MUSL)/$(ADK_TARGET_LIBC_PATH) && \
+ ln -sf libc.so ld-musl-$(ARCH).so.1)
+
+
+musl-dev-install:
+ ${INSTALL_DIR} ${IDIR_MUSL_DEV}/usr/lib
+ ${CP} ${STAGING_TARGET_DIR}/usr/lib/crt*.o ${IDIR_MUSL_DEV}/usr/lib
+ $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) ARCH=$(ARCH) V=1 \
+ INSTALL_HDR_PATH=$(IDIR_MUSL_DEV)/usr \
+ headers_install
+ $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION} \
+ install_headers
+ @find $(IDIR_MUSL_DEV) -name .install -exec rm {} \;
+ @find $(IDIR_MUSL_DEV) -name ..install.cmd -exec rm {} \;
+
+include ${TOPDIR}/mk/pkg-bottom.mk