[uClibc] CRIS port

Marc Kleine-Budde kleine-budde at gmx.de
Mon Jul 7 18:53:16 UTC 2003


Hello!

On Mon, Jul 07, 2003 at 04:08:42PM +0200, Peter Kjellerstedt wrote:
> > > Can somebody pleas tell me what is the status of CRIS port 
> > > of uclibc. (Is it stable, is anybody working on it, anybody
> > > using it, etc). Thanks!
> > It should be working.

Hm - here uClibc-0.9.20 doesn't even compile out of the box.

I'm using binutils 2.13.2.1, gcc 3.2.3 with the fixes and patches from
buildroot.

cris-uclibc-linux-gcc  -Wall -Wstrict-prototypes -Wno-trigraphs
-fno-strict-aliasing  -Os    -mlinux -fno-builtin -nostdinc -D_LIBC
-I../../include -I.
-I/home/frogger/ptxdist/xchain-cris/lib/gcc-lib/cris-uclibc-linux/3.2.3/include
-DNDEBUG -fpic -mlinux -DUCLIBC_TARGET_PREFIX=\"/\"
-DUCLIBC_DEVEL_PREFIX=\""/home/frogger/ptxdist/xchain-cris/cris-uclibc-linux"\"
-DUCLIBC_BUILD_DIR=\"/home/frogger/projects/ptxdist/ptxdist-cris/build/uClibc-0.9.20\"
-I. -I./cris -I../libdl -c ldso.c -o ldso.o
In file included from ../../include/sys/syscall.h:23,
                 from cris/ld_syscalls.h:7,
                 from ld_syscall.h:6,
                 from ldso.c:108:
../../include/bits/syscalls.h:9:26: bits/syscall.h: No such file or
directory
In file included from ldso.c:108:
ld_syscall.h: In function `_dl_exit':
ld_syscall.h:47: `__NR_exit' undeclared (first use in this function)
ld_syscall.h:47: (Each undeclared identifier is reported only once
ld_syscall.h:47: for each function it appears in.)
ld_syscall.h: In function `_dl_close':

[many missing __NR_s deleted]

ld_syscall.h:155: `__NR_readlink' undeclared (first use in this
function)
In file included from linuxelf.h:6,
                 from ldso.c:109:
cris/ld_sysdep.h:55:35: warning: multi-line string literals are
deprecated
In file included from ldso.c:159:
cris/boot1_arch.h:5:5: warning: multi-line string literals are
deprecated

after some random hacking and stumbling over another 'bug' [1] it compiles
at least. I had no time to test it on the cris itself......See attached
diff.


Using buildroot, with the uClibc snapshot I get even more strage
errors:

/tmp/buildroot/build_cris/staging_dir/bin/cris-uclibc-gcc  -Wall
-Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing  -Os    -mlinux
-fno-builtin -nostdinc -D_LIBC -I../../include -I.
-I/tmp/buildroot/build_cris/staging_dir/lib/gcc-lib/cris-linux/3.3/include
-DNDEBUG -fpic -mlinux -DUCLIBC_TARGET_PREFIX=\"/\"
-DUCLIBC_DEVEL_PREFIX=\""/tmp/buildroot/build_cris/staging_dir"\"
-DUCLIBC_BUILD_DIR=\"/tmp/buildroot/build_cris/uClibc\" -I. -I./cris
-I../libdl -c ldso.c -o ldso.o
In file included from ../../include/sys/syscall.h:23,
                 from cris/ld_syscalls.h:7,
                 from ld_syscall.h:6,
                 from ldso.c:108:
../../include/bits/syscalls.h:9:26: bits/syscall.h: No such file or
directory
In file included from ldso.c:108:
ld_syscall.h: In function `_dl_exit':
ld_syscall.h:47: error: `__NR_exit' undeclared (first use in this
function)
ld_syscall.h:47: error: (Each undeclared identifier is reported only
once
ld_syscall.h:47: error: for each function it appears in.)
ld_syscall.h: In function `_dl_close':
ld_syscall.h:51: error: `__NR_close' undeclared (first use in this
function)

[many missing __NRs deleted]

ld_syscall.h: In function `_dl_readlink':
ld_syscall.h:155: error: `__NR_readlink' undeclared (first use in this
function)
In file included from linuxelf.h:6,
                 from ldso.c:109:
cris/ld_sysdep.h:55:35: missing terminating " character
In file included from linuxelf.h:6,
                 from ldso.c:109:
cris/ld_sysdep.h: At top level:
cris/ld_sysdep.h:56: error: parse error before "$r8"
cris/ld_sysdep.h:56: warning: type defaults to `int' in declaration of
`$r8'
cris/ld_sysdep.h:56: error: stray '\' in program
cris/ld_sysdep.h:56: warning: type defaults to `int' in declaration of
`$srp'
cris/ld_sysdep.h:56: error: parse error before "n"
cris/ld_sysdep.h:56: error: stray '\' in program
cris/ld_sysdep.h:57: error: stray '\' in program
cris/ld_sysdep.h:57: error: stray '\' in program
cris/ld_sysdep.h:58: error: stray '\' in program
cris/ld_sysdep.h:58: error: stray '\' in program
cris/ld_sysdep.h:58:107: missing terminating " character
cris/ld_sysdep.h:66: warning: `struct elf_resolve' declared inside
parameter list
cris/ld_sysdep.h:66: warning: its scope is only this definition or
declaration, which is probably not what you want
In file included from ldso.c:159:
cris/boot1_arch.h:5:5: missing terminating " character
In file included from ldso.c:159:
cris/boot1_arch.h:7: error: request for member `globl' in something not
a structure or union
cris/boot1_arch.h:7: error: parse error before "_dl_boot"
cris/boot1_arch.h:8: error: syntax error at '@' token
cris/boot1_arch.h:14:1: missing terminating " character
In file included from ldso.h:2,
                 from ldso.c:160:
cris/elfinterp.c:102: error: conflicting types for `_dl_linux_resolver'
cris/ld_sysdep.h:66: error: previous declaration of `_dl_linux_resolver'
cris/elfinterp.c: In function `_dl_linux_resolver':
cris/elfinterp.c:122: error: `_dl_progname' undeclared (first use in
this function)
In file included from ldso.h:2,
                 from ldso.c:160:
cris/elfinterp.c: In function `_dl_parse_lazy_relocation_information':
cris/elfinterp.c:201: error: `_dl_progname' undeclared (first use in
this function)
In file included from ldso.h:2,
                 from ldso.c:160:
cris/elfinterp.c: In function `_dl_parse_relocation_information':
cris/elfinterp.c:265: error: `_dl_progname' undeclared (first use in
this function)
In file included from ldso.h:2,
                 from ldso.c:160:
cris/elfinterp.c: In function `_dl_parse_copy_information':
cris/elfinterp.c:378: error: `_dl_progname' undeclared (first use in
this function)
ldso.c: In function `_dl_boot2':
ldso.c:598: error: `_dl_progname' undeclared (first use in this
function)
ldso.c:635: error: parse error before ';' token
ldso.c:652: error: redeclaration of `goof'
ldso.c:204: error: `goof' previously declared here
ldso.c:723: error: `ppnt' undeclared (first use in this function)
ldso.c:724: warning: value computed is not used
ldso.c: In function `_dl_fixup':
ldso.c:1322: error: `_dl_progname' undeclared (first use in this
function)
In file included from ldso.c:1399:
readelflib1.c: In function `_dl_load_elf_shared_library':
readelflib1.c:380: error: `_dl_progname' undeclared (first use in this
function)
In file included from ldso.c:1399:
readelflib1.c: In function `_dl_malloc':
readelflib1.c:776: error: `_dl_progname' undeclared (first use in this
function)
ld_string.h: At top level:
ldso.c:158: warning: `_dl_get_ready_to_run' declared `static' but never
defined


regards - Marc


[1] http://sources.redhat.com/ml/libc-alpha/2002-06/msg00006.html

-- 
#!/bin/sh
set - `type $0` 'tr "[a-zA-Z]" "[n-za-mN-ZA-M]"';while [ "$2" != "" ];do \
shift;done; echo 'frq -a -rc '`echo "$0"| $1 `'>$UBZR/.`rpub signature|'`\
echo $1|$1`'`;rpub "Jr ner fvtangher bs obet. Erfvfgnapr vf shgvyr!"'|$1|sh
-------------- next part --------------
diff -ur uClibc-0.9.20.orig/include/features.h /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/include/features.h
--- uClibc-0.9.20.orig/include/features.h	Mon Feb 17 15:16:14 2003
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/include/features.h	Mon Jul  7 20:08:14 2003
@@ -386,10 +386,15 @@
 # define weak_const_function __attribute__ ((weak, __const__))
 /* Tacking on "\n\t#" to the section name makes gcc put it's bogus
  * section attributes on what looks like a comment to the assembler. */
+#  ifdef GNU_CRIS
+#   define __as_app_line "#APP\n"
+#  else
+#   define __as_app_line ""
+#  endif
 #  define link_warning(symbol, msg)					      \
 	asm (".section "  ".gnu.warning." #symbol  "\n\t.previous");	      \
 	    static const char __evoke_link_warning_##symbol[]		      \
-	    __attribute__ ((unused, section (".gnu.warning." #symbol "\n\t#"))) = msg;
+	    __attribute__ ((unused, section (".gnu.warning." #symbol "\n" __as_app_line "\t#"))) = msg;
 #else /* !defined __HAVE_ELF__ */
 #  define strong_alias(name, aliasname) _strong_alias (name, aliasname)
 #  define weak_alias(name, aliasname) _strong_alias (name, aliasname)
diff -ur uClibc-0.9.20.orig/ldso/ldso/cris/elfinterp.c /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/ldso/ldso/cris/elfinterp.c
--- uClibc-0.9.20.orig/ldso/ldso/cris/elfinterp.c	Tue Nov  5 19:21:00 2002
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/ldso/ldso/cris/elfinterp.c	Mon Jul  7 20:08:14 2003
@@ -33,6 +33,10 @@
  * SUCH DAMAGE.
  */
 
+#ifndef _dl_debug_file
+#define _dl_debug_file 2
+#endif
+
 /* Support for the LD_DEBUG variable. */
 #if defined (__SUPPORT_LD_DEBUG__)
 static const char *_dl_reltypes_tab[] = {
diff -ur uClibc-0.9.20.orig/ldso/ldso/ldso.c /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/ldso/ldso/ldso.c
--- uClibc-0.9.20.orig/ldso/ldso/ldso.c	Thu Jun 19 00:42:23 2003
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/ldso/ldso/ldso.c	Mon Jul  7 20:08:14 2003
@@ -105,6 +105,7 @@
  * application.
  */
 
+#include <asm/unistd.h>
 #include "ld_syscall.h"
 #include "linuxelf.h"
 #include "ld_hash.h"
diff -ur uClibc-0.9.20.orig/ldso/libdl/dlib.c /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/ldso/libdl/dlib.c
--- uClibc-0.9.20.orig/ldso/libdl/dlib.c	Fri Jun 27 13:45:12 2003
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/ldso/libdl/dlib.c	Mon Jul  7 20:08:14 2003
@@ -4,6 +4,7 @@
  * Functions required for dlopen et. al.
  */
 
+#include <asm/unistd.h>
 #include <stdlib.h>
 #include <features.h>
 #include "dlfcn.h"
diff -ur uClibc-0.9.20.orig/libc/inet/socketcalls.c /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/inet/socketcalls.c
--- uClibc-0.9.20.orig/libc/inet/socketcalls.c	Sun Jul  7 09:27:42 2002
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/inet/socketcalls.c	Mon Jul  7 20:08:14 2003
@@ -1,4 +1,5 @@
 #define __FORCE_GLIBC
+#include <asm/unistd.h>
 #include <features.h>
 #include <errno.h>
 #include <syscall.h>
diff -ur uClibc-0.9.20.orig/libc/misc/sysvipc/msgq.c /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/misc/sysvipc/msgq.c
--- uClibc-0.9.20.orig/libc/misc/sysvipc/msgq.c	Thu May 30 02:41:03 2002
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/misc/sysvipc/msgq.c	Mon Jul  7 20:08:14 2003
@@ -1,3 +1,4 @@
+#include <asm/unistd.h>
 #include <errno.h>
 #include <sys/msg.h>
 #include "ipc.h"
diff -ur uClibc-0.9.20.orig/libc/misc/sysvipc/sem.c /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/misc/sysvipc/sem.c
--- uClibc-0.9.20.orig/libc/misc/sysvipc/sem.c	Sun Aug 25 02:08:23 2002
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/misc/sysvipc/sem.c	Mon Jul  7 20:08:14 2003
@@ -17,6 +17,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <asm/unistd.h>
 #include <errno.h>
 #include <sys/sem.h>
 #include "ipc.h"
diff -ur uClibc-0.9.20.orig/libc/misc/sysvipc/shm.c /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/misc/sysvipc/shm.c
--- uClibc-0.9.20.orig/libc/misc/sysvipc/shm.c	Thu May 30 02:41:03 2002
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/misc/sysvipc/shm.c	Mon Jul  7 20:08:14 2003
@@ -17,6 +17,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <asm/unistd.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <sys/shm.h>
diff -ur uClibc-0.9.20.orig/libc/sysdeps/linux/common/_exit.c /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/sysdeps/linux/common/_exit.c
--- uClibc-0.9.20.orig/libc/sysdeps/linux/common/_exit.c	Mon Jul 22 19:11:58 2002
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/sysdeps/linux/common/_exit.c	Mon Jul  7 20:08:14 2003
@@ -21,6 +21,7 @@
  */
 
 #define _GNU_SOURCE
+#include <asm/unistd.h>
 #include <features.h>
 #include <errno.h>
 #include <sys/types.h>
diff -ur uClibc-0.9.20.orig/libc/sysdeps/linux/common/create_module.c /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/sysdeps/linux/common/create_module.c
--- uClibc-0.9.20.orig/libc/sysdeps/linux/common/create_module.c	Fri Nov 15 15:06:43 2002
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/sysdeps/linux/common/create_module.c	Mon Jul  7 20:08:14 2003
@@ -20,6 +20,7 @@
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
+#include <asm/unistd.h>
 #include <errno.h>
 #include <unistd.h>
 #include <features.h>
diff -ur uClibc-0.9.20.orig/libc/sysdeps/linux/common/getdents.c /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/sysdeps/linux/common/getdents.c
--- uClibc-0.9.20.orig/libc/sysdeps/linux/common/getdents.c	Mon Feb 10 22:15:20 2003
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/sysdeps/linux/common/getdents.c	Mon Jul  7 20:08:14 2003
@@ -16,6 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <asm/unistd.h>
 #include <alloca.h>
 #include <assert.h>
 #include <errno.h>
diff -ur uClibc-0.9.20.orig/libc/sysdeps/linux/common/sync.c /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/sysdeps/linux/common/sync.c
--- uClibc-0.9.20.orig/libc/sysdeps/linux/common/sync.c	Mon Jul 22 19:11:58 2002
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/sysdeps/linux/common/sync.c	Mon Jul  7 20:08:14 2003
@@ -21,6 +21,7 @@
  */
 
 #define _GNU_SOURCE
+#include <asm/unistd.h>
 #include <features.h>
 #include <errno.h>
 #include <sys/types.h>
diff -ur uClibc-0.9.20.orig/libc/sysdeps/linux/common/syscalls.c /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/sysdeps/linux/common/syscalls.c
--- uClibc-0.9.20.orig/libc/sysdeps/linux/common/syscalls.c	Fri Jun 27 09:36:43 2003
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/sysdeps/linux/common/syscalls.c	Mon Jul  7 20:08:14 2003
@@ -32,6 +32,7 @@
 # undef __USE_FILE_OFFSET64
 #endif
 
+#include <asm/unistd.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/syscall.h>
diff -ur uClibc-0.9.20.orig/libc/sysdeps/linux/cris/bits/syscalls.h /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/sysdeps/linux/cris/bits/syscalls.h
--- uClibc-0.9.20.orig/libc/sysdeps/linux/cris/bits/syscalls.h	Fri Sep 20 17:17:16 2002
+++ /home/frogger/ptxdist/ptxdist-cris/build/uClibc-0.9.20/libc/sysdeps/linux/cris/bits/syscalls.h	Mon Jul  7 20:23:14 2003
@@ -6,7 +6,7 @@
 #endif
 
 /* Include the __NR_<name> definitions. */
-#include <bits/syscall.h>
+/*#include <bits/syscall.h>*/
 
 #if 0
 #ifndef __set_errno


More information about the uClibc mailing list