summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Hundven <bryanhundven@gmail.com>2015-11-10 22:41:33 (GMT)
committerBryan Hundven <bryanhundven@gmail.com>2015-11-13 00:15:41 (GMT)
commit21a448516e2585d581f9dd90c566600831d7c86b (patch)
tree100764a657eed18b474499befbf4d51dda311398
parent1c924f06fa2890b40d1716564c83aac644392c65 (diff)
uClibc: Add support for uClibc-ng
This commit adds uClibc-ng 1.0.8. Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
-rw-r--r--config/libc/uClibc.in18
-rw-r--r--config/libc/uClibc.in.21
-rw-r--r--patches/uClibc-ng/1.0.8/001-unistd-fix-if-condition.patch34
-rw-r--r--scripts/build/libc/uClibc.sh27
4 files changed, 70 insertions, 10 deletions
diff --git a/config/libc/uClibc.in b/config/libc/uClibc.in
index d7ac3af..dc37f84 100644
--- a/config/libc/uClibc.in
+++ b/config/libc/uClibc.in
@@ -26,6 +26,11 @@ choice
# Don't remove next line
# CT_INSERT_VERSION_BELOW
+config LIBC_UCLIBC_NG_V_1_0_8
+ bool
+ prompt "1.0.8"
+ select LIBC_UCLIBC_NG_1_0_8_or_later
+
config LIBC_UCLIBC_V_0_9_33_2
bool
prompt "0.9.33.2"
@@ -55,8 +60,18 @@ config LIBC_VERSION
string
# Don't remove next line
# CT_INSERT_VERSION_STRING_BELOW
+ default "1.0.8" if LIBC_UCLIBC_NG_V_1_0_8
default "0.9.33.2" if LIBC_UCLIBC_V_0_9_33_2
+config LIBC_UCLIBC_NG_1_0_8_or_later
+ bool
+ select LIBC_UCLIBC_NG_1_0_0_or_later
+
+config LIBC_UCLIBC_NG_1_0_0_or_later
+ bool
+ select LIBC_UCLIBC_NG
+ select LIBC_UCLIBC_0_9_33_2_or_later
+
config LIBC_UCLIBC_0_9_33_2_or_later
bool
select LIBC_SUPPORT_THREADS_NATIVE
@@ -65,6 +80,9 @@ config LIBC_UCLIBC_0_9_33_2_or_later
config LIBC_UCLIBC_PARALLEL
bool
+config LIBC_UCLIBC_NG
+ bool
+
choice
bool
prompt "uClibc verbosity:"
diff --git a/config/libc/uClibc.in.2 b/config/libc/uClibc.in.2
index 6660c43..1e33db4 100644
--- a/config/libc/uClibc.in.2
+++ b/config/libc/uClibc.in.2
@@ -50,6 +50,7 @@ config LIBC_UCLIBC_LOCALES_PREGEN_DATA
bool
prompt "Use pregen locales"
depends on LIBC_UCLIBC_LOCALES
+ depends on ! LIBC_UCLIBC_NG
default y
help
If you see issues with using pre-generated locales data,
diff --git a/patches/uClibc-ng/1.0.8/001-unistd-fix-if-condition.patch b/patches/uClibc-ng/1.0.8/001-unistd-fix-if-condition.patch
new file mode 100644
index 0000000..c321f4e
--- /dev/null
+++ b/patches/uClibc-ng/1.0.8/001-unistd-fix-if-condition.patch
@@ -0,0 +1,34 @@
+From 1e85892911bf016e9bb2a647b6584cdd806706f8 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Tue, 3 Nov 2015 15:32:23 +0100
+Subject: [PATCH] unistd: fix #if condition
+
+Commit dfa593d4d881116723a4401b466ea964fb12327b ("syncfs: add system
+call support") modified the #if condition around the definition of the
+syncfs() prototype in a way that doesn't build, causing build failures
+of any file including <unistd.h>:
+
+output/host/usr/powerpc-buildroot-linux-uclibc/sysroot/usr/include/unistd.h:988:14: error: #if with no expression
+ #if __USE_GNU
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ include/unistd.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/unistd.h b/include/unistd.h
+index 4701dab..40d6abd 100644
+--- a/include/unistd.h
++++ b/include/unistd.h
+@@ -1073,7 +1073,7 @@ extern char *getpass (const char *__prompt) __nonnull ((1));
+ extern int fsync (int __fd);
+ #endif /* Use BSD || X/Open || Unix98. */
+
+-#if __USE_GNU
++#if defined __USE_GNU
+ /* Make all changes done to all files on the file system associated
+ * with FD actually appear on disk. */
+ extern int syncfs (int __fd) __THROW;
+--
+2.6.2
+
diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh
index 0836552..0f7db19 100644
--- a/scripts/build/libc/uClibc.sh
+++ b/scripts/build/libc/uClibc.sh
@@ -7,15 +7,22 @@
uclibc_locales_version=030818
uclibc_local_tarball="uClibc-locale-${uclibc_locales_version}"
-# Download uClibc
-do_libc_get() {
+if [ "${CT_LIBC_UCLIBC_NG}" = "y" ]; then
+ uclibc_name="uClibc-ng"
+ libc_src="http://downloads.uclibc-ng.org/releases/${CT_LIBC_VERSION}"
+else
+ uclibc_name="uClibc"
libc_src="http://www.uclibc.org/downloads
http://www.uclibc.org/downloads/old-releases"
+fi
+
+# Download uClibc
+do_libc_get() {
if [ "${CT_LIBC_UCLIBC_CUSTOM}" = "y" ]; then
- CT_GetCustom "uClibc" "${CT_LIBC_VERSION}" \
+ CT_GetCustom "${uclibc_name}" "${CT_LIBC_VERSION}" \
"${CT_LIBC_UCLIBC_CUSTOM_LOCATION}"
else
- CT_GetFile "uClibc-${CT_LIBC_VERSION}" ${libc_src}
+ CT_GetFile "${uclibc_name}-${CT_LIBC_VERSION}" ${libc_src}
fi
# uClibc locales
if [ "${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" = "y" ]; then
@@ -33,9 +40,9 @@ do_libc_extract() {
# custom location directory. Just use negate the whole test,
# to keep it the same as for other components.
if ! [ "${CT_LIBC_UCLIBC_CUSTOM}" = "y" \
- -a -d "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}" ]; then
- CT_Extract "uClibc-${CT_LIBC_VERSION}"
- CT_Patch "uClibc" "${CT_LIBC_VERSION}"
+ -a -d "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}" ]; then
+ CT_Extract "${uclibc_name}-${CT_LIBC_VERSION}"
+ CT_Patch "${uclibc_name}" "${CT_LIBC_VERSION}"
fi
# uClibc locales
@@ -43,7 +50,7 @@ do_libc_extract() {
# broken, so just link it in place...
if [ "${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" = "y" \
-a ! -f "${CT_SRC_DIR}/.${uclibc_local_tarball}.extracted" ]; then
- CT_Pushd "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}/extra/locale"
+ CT_Pushd "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}/extra/locale"
CT_DoExecLog ALL ln -s "${CT_TARBALLS_DIR}/${uclibc_local_tarball}.tgz" .
CT_Popd
touch "${CT_SRC_DIR}/.${uclibc_local_tarball}.extracted"
@@ -77,7 +84,7 @@ do_libc_start_files() {
# Simply copy files until uClibc has the ability to build out-of-tree
CT_DoLog EXTRA "Copying sources to build dir"
- CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}" \
+ CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}" \
"${CT_BUILD_DIR}/build-libc-headers"
cd "${CT_BUILD_DIR}/build-libc-headers"
@@ -161,7 +168,7 @@ do_libc() {
# Simply copy files until uClibc has the ability to build out-of-tree
CT_DoLog EXTRA "Copying sources to build dir"
- CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}" \
+ CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}" \
"${CT_BUILD_DIR}/build-libc"
cd "${CT_BUILD_DIR}/build-libc"