Forum Discussion
Altera_Forum
Honored Contributor
20 years agoThis is about how to update uClibc to 0.9.28 stable release.
http://www.uclibc.org/downloads/uclibc-0.9.28.tar.bz2 (http://www.uclibc.org/downloads/uclibc-0.9.28.tar.bz2) You should config the lib install dir to a new place. And change the UCLIBC_PLUGIN for busybox and apps to this new place. You should turn on "wide char support" in "string and stdio support" for busybox to work. After installed the new uclibc, make clean and rebuild busybox and apps. Then update kernel image with initramfs. The daily snapshot of uClibc is still broken for nios2. Patch,--- Rules.mak 2005/12/29 07:20:49 1.1
+++ Rules.mak 2005/12/30 01:43:32
@@ -266,7 +266,9 @@
# If -msoft-float isn't supported, we want an error anyway.
# Hmm... might need to revisit this for arm since it has 2 different
# soft float encodings.
+ifneq ($(strip $(TARGET_ARCH)),nios2)
CPU_CFLAGS += -msoft-float
+endif
ifeq ($(strip $(TARGET_ARCH)),arm)
# No longer needed with current toolchains, but leave it here for now.
# If anyone is actually still using gcc 2.95 (say), they can uncomment it.
--- libc/sysdeps/linux/nios2/crt0.S 2005/12/29 07:03:01 1.1
+++ libc/sysdeps/linux/nios2/crt0.S 2005/12/30 03:07:54
@@ -6,7 +6,8 @@
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License. See the file COPYING.LIB in the main
* directory of this archive for more details.
*
* Written by Wentao Xu <wentao@microtronix.com>
+ * udpated by hippo for uClibc 0.9.28 and newer
*
*/
@@ -18,7 +19,8 @@
.type __start,@function
.weak _init
.weak _fini
- .type __uClibc_start_main,@function
+ .type main,@function
+ .type __uClibc_main,@function
.type __h_errno_location, @function
.type _stdio_init, @function
.type _stdio_term, @function
@@ -36,9 +38,10 @@
addi gp, gp, %lo(_gp)
/* load argc, argv, envp from stack */
- ldw r4, 0(sp)
- ldw r5, 4(sp)
- ldw r6, 8(sp)
+ movhi r4, %hi(main)
+ ori r4, r4, %lo(main) /* main */
+ ldw r5, 0(sp) /* argc */
+ ldw r6, 4(sp) /* argv */
/* load the 4th arg */
movhi r7, %hi(_init)
@@ -48,17 +51,19 @@
movhi r8, %hi(_fini)
ori r8, r8, %lo(_fini)
stw r8, 0(sp)
-
+ stw r2, 4(sp) /* rtld_fini */
+ stw sp, 8(sp) /* stack_end */
+
/* call uClibc_main, shouldn't return */
# ifdef __PIC__
/* just pray 16 bit offset is enough */
- br __uClibc_start_main
+ br __uClibc_main
# else
- call __uClibc_start_main
+ call __uClibc_main
# endif
/* crash in the event of return */
__exit:
movui r2, TRAP_ID_SYSCALL
movui r3, __NR_exit
- trap
+ trap Run, #fix for autoconf.h
make ARCH_CFLAGS="-I(your kernel build/include)" menuconfig
make ARCH_CFLAGS="-I(your kernel build/include)"
make ARCH_CFLAGS="-I(your kernel build/include)" install The .config must have, ## Target Architecture Features and Options#
KERNEL_SOURCE="your kernel source linux-2.6.x"# # uClibc development/debugging options#
CROSS_COMPILER_PREFIX="nios2-elf-"