This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATH 4/4] add uClibc NPTL support


add uClibc NPTL support

Recent uClibc snapshots support NPTL.
For bulding uClibc with NPTL support we need to build
lib/crt1.o lib/crti.o lib/crtn.o and a dummy libc.so
during the libc_headers step, otherwise the
cc_core_pass_2 step fails.

Signed-off-by: Johannes Stezenbach <js@sig21.net>

diff -r 9bc0f0e412d0 config/libc/uClibc.in
--- a/config/libc/uClibc.in	Fri Jun 25 11:11:41 2010 +0200
+++ b/config/libc/uClibc.in	Fri Jul 09 15:04:50 2010 +0200
@@ -48,11 +48,15 @@
 config LIBC_V_snapshot
     bool
     prompt "latest snapshot (EXPERIMENTAL)"
+    select LIBC_SUPPORT_NPTL
+    select LIBC_UCLIBC_0_9_30_or_later
     depends on EXPERIMENTAL
 
 config LIBC_V_specific_date
     bool
     prompt "<specific date> (EXPERIMENTAL)"
+    select LIBC_SUPPORT_NPTL
+    select LIBC_UCLIBC_0_9_30_or_later
     depends on EXPERIMENTAL
 
 endchoice
diff -r 9bc0f0e412d0 scripts/build/libc/uClibc.sh
--- a/scripts/build/libc/uClibc.sh	Fri Jun 25 11:11:41 2010 +0200
+++ b/scripts/build/libc/uClibc.sh	Fri Jul 09 15:04:50 2010 +0200
@@ -54,7 +54,7 @@
 
 # This functions installs uClibc's headers
 do_libc_headers() {
-    local install_rule
+    local install_rule cross
 
     CT_DoStep INFO "Installing C library headers"
 
@@ -70,12 +70,15 @@
     # uClibc uses the CROSS environment variable as a prefix to the
     # compiler tools to use.  Setting it to the empty string forces
     # use of the native build host tools, which we need at this
-    # stage, as we don't have target tools yet.
+    # stage, as we don't have target tools yet -- unless we build with NPTL support.
+    if [ "${CT_THREADS}" = "nptl" ]; then
+         cross=${CT_TARGET}-
+    fi
     CT_DoLog EXTRA "Applying configuration"
-    CT_DoYes "" |CT_DoExecLog ALL make CROSS= PREFIX="${CT_SYSROOT_DIR}/" oldconfig
+    CT_DoYes "" |CT_DoExecLog ALL make CROSS=${cross} PREFIX="${CT_SYSROOT_DIR}/" oldconfig
 
     CT_DoLog EXTRA "Building headers"
-    CT_DoExecLog ALL make ${CT_LIBC_UCLIBC_VERBOSITY} CROSS= PREFIX="${CT_SYSROOT_DIR}/" headers
+    CT_DoExecLog ALL make ${CT_LIBC_UCLIBC_VERBOSITY} CROSS=${cross} PREFIX="${CT_SYSROOT_DIR}/" headers
 
     if [ "${CT_LIBC_UCLIBC_0_9_30_or_later}" = "y" ]; then
         install_rule=install_headers
@@ -84,7 +87,16 @@
     fi
 
     CT_DoLog EXTRA "Installing headers"
-    CT_DoExecLog ALL make ${CT_LIBC_UCLIBC_VERBOSITY} CROSS= PREFIX="${CT_SYSROOT_DIR}/" "${install_rule}"
+    CT_DoExecLog ALL make ${CT_LIBC_UCLIBC_VERBOSITY} CROSS=${cross} PREFIX="${CT_SYSROOT_DIR}/" "${install_rule}"
+
+    if [ "${CT_THREADS}" = "nptl" ]; then
+        # lib/crt1.o lib/crti.o lib/crtn.o are needed to build libgcc_s.so
+        CT_DoLog EXTRA "Building crt[1in].o"
+        CT_DoExecLog ALL make ${CT_LIBC_UCLIBC_VERBOSITY} CROSS=${cross} PREFIX="${CT_SYSROOT_DIR}/" lib/crt1.o lib/crti.o lib/crtn.o
+        CT_DoExecLog ALL cp lib/crt[1in].o "${CT_SYSROOT_DIR}/usr/lib"
+        CT_DoExecLog ALL ${cross}gcc -nostdlib -nostartfiles -shared -x c /dev/null \
+                                      -o "${CT_SYSROOT_DIR}/usr/lib/libc.so"
+    fi
 
     CT_EndStep
 }

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]