Hi,
Current uclibc svn can't be used unmodified to build
uClinux-dist-2008R1-RC8 on blackfin. One problem is that
uClinux-dist-2008R1-RC8 requires fork(), as a bare minimum,
a stub which always fails.
I propose the following patch (adapted from ADI's uclibc tree)
which make it an option in uclibc svn.
Mike, do you like this patch?
--
vda
diff -d -urpN -U5 uClibc.0/extra/Configs/Config.in uClibc.1/extra/Configs/Config.in
--- uClibc.0/extra/Configs/Config.in 2008-06-28 08:32:57.000000000 +0200
+++ uClibc.1/extra/Configs/Config.in 2008-07-07 01:04:18.000000000 +0200
@@ -513,10 +513,27 @@ config UCLIBC_SUSV3_LEGACY_MACROS
help
Enable this option if you want to have SuSv3 LEGACY macros.
Currently applies to bcopy/bzero/bcmp/index/rindex et al.
WARNING! ABI incompatibility.
+config UCLIBC_HAS_STUBS
+ bool "Provide stubs for unavailable functionality"
+ default n
+ help
+ With this option uClibc provides non-functional stubs for
+ functions which are impossible to implement on the target
+ architecture. Otherwise, such functions are simply omitted.
+
+ As of 2008-07, this option makes uClibc provide fork() stub
+ on NOMMU targets. It always sets errno to ENOSYS and returns -1.
+
+ This may be useful if you port a lot of software and cannot
+ audit all of it and replace or disable fork() usage.
+ With this option, a program which uses fork() will build
+ successfully. Of course, it may be useless if fork()
+ is essential for its operation.
+
config UCLIBC_HAS_SHADOW
bool "Shadow Password Support"
default y
help
Answer N if you do not need shadow password support.
diff -d -urpN -U5 uClibc.0/include/unistd.h uClibc.1/include/unistd.h
--- uClibc.0/include/unistd.h 2008-06-05 18:32:06.000000000 +0200
+++ uClibc.1/include/unistd.h 2008-07-07 00:51:26.000000000 +0200
@@ -715,11 +715,11 @@ extern int setresuid (__uid_t __ruid, __
extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
__THROW;
#endif
-#ifdef __ARCH_USE_MMU__
+#if defined __UCLIBC_HAS_STUBS__ || defined __ARCH_USE_MMU__
/* Clone the calling process, creating an exact copy.
Return -1 for errors, 0 to the new process,
and the process ID of the new process to the old process. */
extern __pid_t fork (void) __THROW;
#endif
diff -d -urpN -U5 uClibc.0/libc/sysdeps/linux/common/fork.c uClibc.1/libc/sysdeps/linux/common/fork.c
--- uClibc.0/libc/sysdeps/linux/common/fork.c 2008-06-01 17:21:39.000000000 +0200
+++ uClibc.1/libc/sysdeps/linux/common/fork.c 2008-07-07 00:52:14.000000000 +0200
@@ -9,14 +9,28 @@
#include <sys/syscall.h>
#include <unistd.h>
#ifdef __ARCH_USE_MMU__
+
#ifdef __NR_fork
extern __typeof(fork) __libc_fork;
#define __NR___libc_fork __NR_fork
_syscall0(pid_t, __libc_fork);
libc_hidden_proto(fork)
weak_alias(__libc_fork,fork)
libc_hidden_weak(fork)
#endif
+
+#elif defined __UCLIBC_HAS_STUBS__
+
+pid_t __libc_fork(void)
+{
+ __set_errno(ENOSYS);
+ return -1;
+}
+libc_hidden_proto(fork)
+weak_alias(__libc_fork,fork)
+libc_hidden_weak(fork)
+link_warning(fork, "fork: this function is not implemented on no-mmu systems")
+
#endif
_______________________________________________
uClibc mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/uclibc