MIPS64 build questions

Steve Ellcey sellcey at mips.com
Fri Jan 24 18:45:24 UTC 2014


On Fri, 2014-01-24 at 12:27 +0100, Waldemar Brodkorb wrote:
> Hi Steve,
> Steve Ellcey  wrote,
> > 
> > For MIPS64 and the N32 ABI my build dies with:
> > 
> > libc/sysdeps/linux/mips/pread_write.c:23:32: error: '__NR_pwrite' undeclared (first use in this function)
> >  # define __NR___syscall_pwrite __NR_pwrite
> >                                 ^
> > /local/home/sellcey/gcc/uclibc/obj-mips-mti-linux-uclibc/uclibc/obj_mips64/include/bits/syscalls.h:157:4: note: in definition of macro 'internal_syscall4'
> >   : input, "r" (__a0), "r" (__a1), "r" (__a2)   \
> >     ^
> > /local/home/sellcey/gcc/uclibc/obj-mips-mti-linux-uclibc/uclibc/obj_mips64/include/bits/syscalls-common.h:15:33: note: in expansion of macro '__NR___syscall_pwrite'
> >  # define SYS_ify(syscall_name) (__NR_##syscall_name)
> 
> Same here. I just changed __NR_pwrite/__NR_pread to
> __NR_pread64/__NR_pwrite64 to get beyond this. I already sent an
> email to the list last year:
> http://lists.uclibc.org/pipermail/uclibc/2013-November/048100.html
> 
> Bernhard told me in a private mail he wants to verify this, but he
> didn't get back to me since then.

Yes, that change fixed things for me too.


> > On MIPS64 with the N64 ABI it dies with:
> > 
> > /local/home/sellcey/gcc/uclibc/obj-mips-mti-linux-uclibc/uclibc/obj_mips64_64/libc/libc_so.a(lockf64.os): In function `lockf64':
> > lockf64.c:(.text+0x88): undefined reference to `fcntl64'
> > collect2: error: ld returned 1 exit status
> > make: *** [/local/home/sellcey/gcc/uclibc/obj-mips-mti-linux-uclibc/uclibc/obj_mips64_64/lib/libc.so] Error 1
> 
> I do not see this second error in my build. Just verified a few
> minutes ago with latest uclibc git master. How does your
> configuration looks like? Mine is here:
> http://www.openadk.org/uclibc-mips64.config

I don't see any significant differences in our config files.  It looks
like the problem is that when lockf64 is being compiled for the N64 ABI
it tries to call fcntl64 and there is no fcntl64 in the libc.a being
built.  Does your library have fcntl64?  If not, does it have lockf64?
I can workaround it by having lockf64 call fcntl instead of fcntl64
(should be the same thing in LP64 mode) but I am not sure if that is the
right fix or not.

> > Steve Ellcey
> > sellcey at mips.com
> 
> Nice to see others are using uclibc on mips64 (n32/n64).
> 
> There is still another issue I found with mips64 n64 and
> setjmp/longjmp. Reproducible with executing $(pwd) in ash,
> which exits with a failure and a segmentation fault.
> 
> I have found a solution, but it breaks mips32 support and triggers
> the same issue. May be you want to have a look on my patch?
> 
> best regards
>  Waldemar

Sure, I would be happy to look at your patch.  I haven't started running
any N32/N64 tests yet, just O32 ones.

Steve Ellcey
sellcey at mips.com





More information about the uClibc mailing list