Hi Patrick,

I don't have any ideas for how to solve your problems with uClibc, but
if you just want a toolchain to compile Linux programs you could
perhaps try the one based on musl instead. I believe that one has been
used a lot more recently, so it might work better. There are some
instructions for how to build the musl toolchain here
http://www.openwall.com/lists/musl/2014/07/19/5 Not sure however if
this is the preferred way to do it. Stefan would know more about that

//Olof

On Tue, Jan 20, 2015 at 8:58 PM, Ziqiang Patrick Huang
<[email protected]> wrote:
> Hi Andrey
>
> Thanks for your reply ! I tried what you mentioned, also your config file,
> still does not work for me. Can I ask when were you able to build uclib-or1k
> ? Did you follow the instructions here
> http://opencores.org/or1k/OpenRISC_GNU_tool_chain ?
> I noticed your first note is under "Hints when cross compiling with the
> or1k-linux-uclibc toolchain" on the above link, however it does not mention
> where to run that command.
>
> Also I'm not sure about the following command mentioned there:
>
> "Building with the following commands will work in a number of situations"
>
> ./configure --host=or1k-linux-uclibc
> --prefix=/opt/or1k-toolchain/or1k-linux-uclibc/sys-root/usr
>
> Since there is no configure under uclibc-or1k directory ...
>
> I do receive your email about whetstone, thanks ! But I haven't had a chance
> to look at it, since I was trying to get the toolchain ready so I can run
> programs in linux from or1ksim.
>
> Thanks again for your help.
> Patrick
>
> 2015-01-20 14:01 GMT-05:00 BAndViG <[email protected]>:
>
>> Some time ago I build the uClibc-or1k tool chain.  I checked my notes and
>> I’ve found the following differences with official guide from OpenCores:
>>
>> 1) Just after cloning linux kernel it is useful to replace any obsolete
>> occurrences of or32 by or1k:
>> $ cd linux
>> $ find ./ -type f -name '*' -print | xargs sed -i 's/or32/or1k/'
>>
>> 2) Just after cloning uClibc-or1k  check simlink “Config” in the root
>> folder of uClibc-or1k. Git often replaces simlinks by text files (the file
>> contains link point). Perhaps you have to restore the simlink by hand in
>> your working copy.
>> Alternatively. I’ve attached  my configuration file for uClibc-or1k. You
>> can try to copy the file into root folder of uClibc-or1k, rename it to
>> “.config” and run make. The configuration was successfully for me.
>>
>> PS. Patrick, did you receive my e-mal with Whetstone port I sent you on 16
>> January?
>>
>>
>> From: Ziqiang Patrick Huang
>> Sent: Tuesday, January 20, 2015 9:07 PM
>> To: Stefan Kristiansson
>> Cc: openrisc ; [email protected]
>> Subject: Re: [OpenRISC] Building uClibc-or1k failed: storage size unknown
>>
>> Stefan,
>>
>> I did  installed with ARCH=openrisc make INSTALL_HDR_PATH=${SYSROOT}/usr
>> headers_install
>> and have $SYSROOT set to /opt/or1k-toolchain/or1k-linux-uclibc/sys-root as
>> suggested by the instruction.
>> And I did installed the headers from
>> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>
>> I double checked everything again, and rebuild after make distclean, sill
>> getting the same error. Is it possible that the upstream linux version is
>> not compatible with the upstream uclibc version ? Or is there anything else
>> I can check to know if I did anything wrong ?
>>
>> Thanks
>> Patrick
>>
>>
>> 2015-01-20 10:42 GMT-05:00 Stefan Kristiansson
>> <[email protected]>:
>>>
>>> On Tue, Jan 20, 2015 at 4:59 PM, Ziqiang Patrick Huang
>>> <[email protected]> wrote:
>>>>
>>>> Stefan,
>>>>
>>>> I'm not sure where went wrong, I just tried again, start from beginning,
>>>> following the exact instruction from the website, still ends up in the same
>>>> place.
>>>>
>>>> Here is the  libc/sysdeps/linux/common/posix_fadvise.c where it failed,
>>>>
>>>> #ifdef __NR_arm_fadvise64_64
>>>> /* We handle the 64bit alignment issue which is why the arm guys renamed
>>>> their
>>>> * syscall in the first place.  So rename it back.
>>>> */
>>>> # define __NR_fadvise64_64 __NR_arm_fadvise64_64
>>>> #endif
>>>>
>>>> #if defined(__NR_fadvise64) || defined(__NR_fadvise64_64)
>>>> # include <fcntl.h>
>>>> # include <endian.h>
>>>> # include <bits/wordsize.h>
>>>>
>>>> # ifdef __NR_fadvise64_64
>>>> int posix_fadvise64(int fd, off64_t offset, off64_t len, int advice);
>>>> # endif
>>>>
>>>> int posix_fadvise(int fd, off_t offset, off_t len, int advice)
>>>> {
>>>> # ifdef __NR_fadvise64_64
>>>>         return posix_fadvise64(fd, offset, len, advice);
>>>> # else
>>>>         int ret;
>>>>         INTERNAL_SYSCALL_DECL(err);
>>>> #  if __WORDSIZE == 64
>>>>         ret = INTERNAL_SYSCALL(fadvise64, err, 4, fd, offset, len,
>>>> advice);
>>>> #  else
>>>> #   if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__)
>>>>         ret = INTERNAL_SYSCALL(fadvise64, err, 6, fd, /*unused*/0,
>>>> #   else
>>>>         ret = INTERNAL_SYSCALL(fadvise64, err, 5, fd,
>>>> #   endif
>>>>                         OFF_HI_LO (offset), len, advice);
>>>> #  endif
>>>>         if (INTERNAL_SYSCALL_ERROR_P (ret, err))
>>>>                 return INTERNAL_SYSCALL_ERRNO (ret, err);
>>>>         return 0;
>>>> #  endif
>>>> }
>>>> # if defined __UCLIBC_HAS_LFS__ && (!defined __NR_fadvise64_64 ||
>>>> __WORDSIZE == 64)
>>>> strong_alias(posix_fadvise,posix_fadvise64)
>>>> # endif
>>>> #endif
>>>>
>>>>
>>>
>>>
>>> I don't know where it goes wrong for you, but you definitely end up with
>>> the wrong kernel headers.
>>> The code path with the 'strong_alias(posix_fadvise,posix_fadvise64)'
>>> shouldn't be reached with the upstrean openrisc ones,
>>> since we do define __NR_fadvise64_64 (and __WORDSIZE should not be 64).
>>>
>>> Some sanity checks, you are installing the headers with:
>>> ARCH=openrisc make INSTALL_HDR_PATH=${SYSROOT}/usr headers_install
>>> right?
>>> And you do have $SYSROOT set to something?
>>>
>>> After you've made sure of that, try doing a 'make distclean' and then try
>>> to build again.
>>>
>>> Stefan
>>
>>
>>
>>
>> --
>> Ziqiang Huang
>> Electrical and Computer Engineering
>> Hudson 213c, Duke University
>> Tel: 919-491-3677
>> Email: [email protected]
>>
>> ________________________________
>> _______________________________________________
>> OpenRISC mailing list
>> [email protected]
>> http://lists.openrisc.net/listinfo/openrisc
>
>
>
>
> --
> Ziqiang Huang
> Electrical and Computer Engineering
> Hudson 213c, Duke University
> Tel: 919-491-3677
> Email: [email protected]
>
> _______________________________________________
> OpenRISC mailing list
> [email protected]
> http://lists.openrisc.net/listinfo/openrisc
>
_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to