Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 236831 - sys-libs/uclibc support for cris platform
Summary: sys-libs/uclibc support for cris platform
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: Other Linux
: High enhancement
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-06 04:30 UTC by Stefan de Konink
Modified: 2012-04-22 22:24 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Get cris and old pthreads working... (crti.patch,462 bytes, patch)
2008-09-06 23:39 UTC, Stefan de Konink
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan de Konink 2008-09-06 04:30:04 UTC
As discussed in #gentoo-embedded I'm compiling for a new platform.

Uclibc has some problems:

clibc/4.3.1/include -DNDEBUG -fpic -c lckpwdf.c -o lckpwdf.o
In file included from ../../include/asm/sigcontext.h:6,
                 from ../../include/bits/sigcontext.h:28,
                 from ../../include/signal.h:309,
                 from lckpwdf.c:24:
../../include/asm/ptrace.h:4:29: error: asm/arch/ptrace.h: No such file or directory
In file included from ../../include/bits/sigcontext.h:28,
                 from ../../include/signal.h:309,
                 from lckpwdf.c:24:
../../include/asm/sigcontext.h:18: error: field 'regs' has incomplete type
make[2]: *** [lckpwdf.o] Error 1
make[2]: *** Waiting for unfinished jobs....
crisv32-axis-linux-uclibc-strip -x -R .note -R .comment __parsespent.o
make[2]: Leaving directory `/var/tmp/portage/cross-crisv32-axis-linux-uclibc/uclibc-0.9.28.3-r7/work/uClibc-0.9.28.3/libc/pwd_grp'
make[1]: *** [_dir_pwd_grp] Error 2
make[1]: Leaving directory `/var/tmp/portage/cross-crisv32-axis-linux-uclibc/uclibc-0.9.28.3-r7/work/uClibc-0.9.28.3/libc'


With respect to limit.h there are some other include errors, I wonder what the actual problem is in this case. If it is the ptrace.h that is not found or the regs having an incomplete type.

Reproducible: Always
Comment 1 Wormo (RETIRED) gentoo-dev 2008-09-06 07:10:29 UTC
The incomplete type for "regs" is a result of the missing ptrace.h, because ptrace.h defines struct pt_regs. 

Looks like your cris kernel headers have problems, they don't seem quite right in mainline kernels right now http://article.gmane.org/gmane.linux.kernel/721394/match=cris+header+brokenness

I think in your case either asm/arch-v10 or asm/arch-v32 should be linked as /usr/include/asm/arch, so that the proper version of ptrace.h will be found.
Comment 2 Stefan de Konink 2008-09-06 12:05:25 UTC
That patch mentioned there is available in a different form in the current 2.6.26. Now I presume the problem is in tc-arch-kernel (Linux headers).

Since cris is not defined it will go inho the eclass kernel-2 and end up in:

        *)
            dodir ${ddir}/asm
            cp -pPR "${S}"/include/asm/* ${D}/${ddir}/asm
            ;;

Shouldn't that copy everything? The second thing is ofcourse the symlink to 'arch'.
Comment 3 Stefan de Konink 2008-09-06 12:10:29 UTC
Making progress:

make -C ldso
make[2]: Entering directory `/var/tmp/cross/crisv32-axis-linux-uclibc/portage/cross-crisv32-axis-linux-uclibc/uclibc-0.9.28.3-r7/work/uClibc-0.9.28.3/ldso/ldso'
crisv32-axis-linux-uclibc-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-stack-protector -Os -funit-at-a-time -DUCLIBC_LDSO=\"ld-uClibc.so.0\" -mlinux -fpic -DUCLIBC_RUNTIME_PREFIX=\"/\" -fno-builtin -nostdinc -D_LIBC -DLDSO_ELFINTERP=\"cris/elfinterp.c\" -I../../ldso/ldso/cris -I../../ldso/include -I../../ldso/ldso -I../../include -D_GNU_SOURCE -isystem /usr/lib/gcc/crisv32-axis-linux-uclibc/4.3.1/include  -c cris/resolve.S -o cris/resolve.o
crisv32-axis-linux-uclibc-strip -x -R .note -R .comment cris/resolve.o
crisv32-axis-linux-uclibc-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-stack-protector -Os -funit-at-a-time -DUCLIBC_LDSO=\"ld-uClibc.so.0\" -mlinux -fpic -DUCLIBC_RUNTIME_PREFIX=\"/\" -fno-builtin -nostdinc -D_LIBC -DLDSO_ELFINTERP=\"cris/elfinterp.c\" -I../../ldso/ldso/cris -I../../ldso/include -I../../ldso/ldso -I../../include -D_GNU_SOURCE -isystem /usr/lib/gcc/crisv32-axis-linux-uclibc/4.3.1/include -c ldso.c -o ldso.o
In file included from ../../ldso/include/ldso.h:37,
                 from ldso.c:33:
../../ldso/include/dl-syscall.h:144: error: expected declaration specifiers or '...' before '__syscall_mmap2'
../../ldso/include/dl-syscall.h:144: error: expected declaration specifiers or '...' before 'addr'
../../ldso/include/dl-syscall.h:144: error: expected declaration specifiers or '...' before 'len'
../../ldso/include/dl-syscall.h:145: error: expected declaration specifiers or '...' before 'prot'
../../ldso/include/dl-syscall.h:145: error: expected declaration specifiers or '...' before 'flags'
../../ldso/include/dl-syscall.h:145: error: expected declaration specifiers or '...' before 'fd'
../../ldso/include/dl-syscall.h:145: error: expected declaration specifiers or '...' before 'offset'
../../ldso/include/dl-syscall.h:145: warning: type defaults to 'int' in declaration of '_syscall6'
../../ldso/include/dl-syscall.h: In function '_dl_mmap':
../../ldso/include/dl-syscall.h:160: warning: implicit declaration of function '__syscall_mmap2'
../../ldso/include/dl-syscall.h:161: warning: return makes pointer from integer without a cast
make[2]: *** [ldso.o] Error 1
make[2]: Leaving directory `/var/tmp/cross/crisv32-axis-linux-uclibc/portage/cross-crisv32-axis-linux-uclibc/uclibc-0.9.28.3-r7/work/uClibc-0.9.28.3/ldso/ldso'
make[1]: *** [ldso] Error 2
make[1]: Leaving directory `/var/tmp/cross/crisv32-axis-linux-uclibc/portage/cross-crisv32-axis-linux-uclibc/uclibc-0.9.28.3-r7/work/uClibc-0.9.28.3/ldso'
make: *** [_dir_ldso] Fout 2
Comment 4 Stefan de Konink 2008-09-06 21:07:50 UTC
I have made some progress with the daily of uclibc... but I'm stuck at:

/usr/crisv32-axis-linux-uclibc/usr/include/asm/page.h:9:1: warning: this is the location of the previous definition
  STRIP -x -R .note -R .comment libpthread/linuxthreads.old/libpthread_so.a
  AR cr libpthread/linuxthreads.old/libpthread_so.a
  LD libpthread-0.9.29.so
/usr/libexec/gcc/crisv32-axis-linux-uclibc/ld: ./lib/crti.o, section .init:
  relocation R_CRIS_32 should not be used in a shared object; recompile with -fPIC
/usr/libexec/gcc/crisv32-axis-linux-uclibc/ld: ./lib/crti.o, section .fini:
  relocation R_CRIS_32 should not be used in a shared object; recompile with -fPIC
/usr/libexec/gcc/crisv32-axis-linux-uclibc/ld: libpthread/linuxthreads.old/libpthread_so.a(manager.os), section .text:
  relocation R_CRIS_32_PCREL should not be used in a shared object; recompile with -fPIC
/usr/libexec/gcc/crisv32-axis-linux-uclibc/ld: libpthread/linuxthreads.old/libpthread_so.a(manager.os), section .text:
  relocation R_CRIS_32_PCREL should not be used in a shared object; recompile with -fPIC
/usr/libexec/gcc/crisv32-axis-linux-uclibc/ld: libpthread/linuxthreads.old/libpthread_so.a(spinlock.os), section .text:
  relocation R_CRIS_32_PCREL should not be used in a shared object; recompile with -fPIC
./lib/crti.o: In function `_init':
(.init+0xc): undefined reference to `$pc'
/usr/libexec/gcc/crisv32-axis-linux-uclibc/ld: warning: creating a DT_TEXTREL in object.
collect2: ld returned 1 exit status
make: *** [lib/libpthread.so] Fout 1

Without pthread I get a nice library... but that is pretty useless because gcc needs it...
Comment 5 Stefan de Konink 2008-09-06 23:39:05 UTC
Created attachment 164763 [details, diff]
Get cris and old pthreads working...

We need to work on the headers that are included, but this patch is probably fixing the compilation issue.
Comment 6 SpanKY gentoo-dev 2012-04-22 22:24:45 UTC
please submit cris patches upstream.  we'll review+merge them there.