NMT:cross: Difference between revisions

From Lundman Wiki
No edit summary
No edit summary
Line 1: Line 1:
export CTARGET=mipsel-linux-uclibc
[[Image:synology_logo.gif|Synoogy Inc. logo]] <br>
export ARCH=mips
<p>The Synology NAS can host the [[llink]] media streaming server. If you don't compile it yourself, please note below which binary you should use for your model. The binary packages are not made to be integrated with the admin web interface.</p>
rm -rf build
mkdir build
cd build
../binutils-2.17/configure \
--target=$CTARGET \
--prefix=/usr/local/$ARCH/ \
--with-sysroot=/usr/local/$ARCH/$CTARGET \
--disable-werror
make
make install
# It installs things we don't want (and will fail later)
rm -rf /usr/local/$ARCH/{info,lib,man,share}
export PATH=/usr/local/$ARCH/bin:$PATH
cd ../linux-2.6.15.7
yes "" | make ARCH=$ARCH oldconfig prepare
#With 2.6.x, this will probably end in an error because you don't have a gcc
#cross-compiler yet, but you can ignore that.  Just copy over the headers:
mkdir -p /usr/local/$ARCH/$CTARGET/usr/include/
rsync -arv include/linux include/asm-generic /usr/local/$ARCH/$CTARGET/usr/include/
rsync -arv include/asm-$ARCH/ /usr/local/$ARCH/$CTARGET/usr/include/asm
 
cd ../uClibc-0.9.28.3/
make menuconfig
#Target Architecture: mips
#Target Architecture Features and Options:
#  Target Process Architecture: MIPS I
#  Target Process Endianness: Little Endian
#  Target CPU has a memory management unit (MMU): YES
#  Enable floating point number support: YES
#  Target CPU has a floating point unit: NO
#  (/usr/local/mips/mipsel-linux-uclibc/usr) Linux kernel header location
#
#Library Installation Options
#  (/usr/local/mips/mipsel-linux-uclibc) uClibc runtime library directory
#  (/usr/local/mips/mipsel-linux-uclibc/usr) uClibc development environment
#
#uClibc development/debugging options
#  (mipsel-linux-uclibc-) Cross-compiling toolchain prefix
# This command should fail.
make CROSS=mipsel-linux-uclibc- 
# Copy the new include files
rsync -arvL include/ /usr/local/$ARCH/$CTARGET/sys-include
cd ../build/
rm -rf *
../gcc-4.0.4/configure \
--target=$CTARGET \
--prefix=/usr/local/mips \
--with-sysroot=/usr/local/mips/$CTARGET \
--enable-languages=c \
--disable-shared \
--disable-checking \
--disable-werror \
        --disable-__cxa_atexit \
        --enable-target-optspace \
        --disable-nls \
        --enable-multilib \
        --with-float=soft \
        --enable-sjlj-exceptions \
        --disable-threads
make
make install
# Remove the temporary headers, and compile it properly.
rm -rf /usr/local/$ARCH/$CTARGET/sys-include
cd ../uClibc-0.9.28.3/
make CROSS=mipsel-linux-uclibc-
make install
# This bit fixes the C++ issue. But should not be required. TODO: Figure out why
cd /usr/local/$ARCH/$CTARGET/lib/
ln -s ../usr/lib/crt* .
# Now recompile gcc fully.
cd ../build/
rm -rf *
../gcc-4.0.4/configure \
        --target=$CTARGET \
        --prefix=/usr/local/mips \
        --with-sysroot=/usr/local/mips/$CTARGET \
        --enable-languages=c,c++ \
        --enable-shared \
        --disable-checking \
        --disable-werror \
        --disable-__cxa_atexit \
        --enable-target-optspace \
        --disable-nls \
        --enable-multilib \
        --with-float=soft \
        --enable-sjlj-exceptions \
        --enable-threads=posix
# It is likely it will fail on '''__ctype_touplow_t*''', this is quite easy to fix.
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14939
# I went with the #ifdef changes of ../gcc-4.0.4/libstdc++-v3/config/locale/generic/c_locale.h
# and ../gcc-4.0.4/libstdc++-v3/config/os/gnu-linux/ctype_base.h
make
make install




Unfortunately this will use libc dynamic linker, which is incorrect. So at the moment, use the following line to compile your executables.


# gcc -Wl,--dynamic-linker,/lib/ld-uClibc.so.0 -o hello hello.c
=== Binaries ===


I will attempt to find out how to make it use the correct dynamic linker by default.
'''Latest binaries'''<br>
This contains a [[Llink:synology_autostart|startup script]], a Synology installation guide ([[Llink:synology_readme|README-Synology.txt]]) and a prepared llink.conf that points to the Synology default /volume1/video share. Place this binary in the /volume1 directory, untar and open the <code>README-synology.txt</code> file with a text editor for further assistance. Note: the startup script and the installation guide was written for the synology_x06_ppc in mind.


Thanks to '''emveepee''' we now know one way to fix this, although the source line mentioned only sets it to libc if it is otherwise not specified. So there should be a proper way to specify with linker we want. If someone has time to research this, that would be appreciated. For now:
[http://forum.synology.com/wiki/index.php/Is_my_NAS_an_ARM_or_a_PowerPC_CPU_model] Is_my_NAS_an_ARM_or_a_PowerPC_CPU_model


1. To get around the need to specify the dynamic-linker I found you could be able to modify the default  
The following models uses ''x06_ppc'' version per default: (PowerPC ppc_6xx Freescale MPC8245 603e core MPC8241 603e core)
  dynamic-linker in gcc-4.0.4/gcc/config/mips/linux.h
  DS-101g+, DS-106j, DS-106e, DS-106, DS-106x , CS-406, RS-406 and CS-406e
I just modified line 118 to the proper setting rather than applying the patch discussed in the following
url and the problem goes away.
http://www.busybox.net/lists/uclibc/2004-January/007943.html
2. The soft floating-point functions will not be linked in by default without a patch
http://bugs.busybox.net/view.php?id=1069 which I haven't tried yet but linking in -lgcc_s also
solves the problem.


The following x07-models share the same cpu family as x06 and should also use the ''x06_ppc''-version of llink:
DS-107e, DS-107, DS-207, DS-207.128 and CS-407e


Optware feed: http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/unstable/




=== C200 ===
The following models should use the ''x07_arm'': (ARM armv5tejl Marvell Orion 88F5281)
DS-107+, DS-107+.128, DS-207+, CS-407 and RS-407


Download the source package from [http://www.codesourcery.com/sgpp/lite/mips/portal/release886]
Optware feed: http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/


  export CTARGET=mipsel-linux-gnu
 
  export ARCH=mips-4.3
The following models should use the ''e500_ppc'': (PowerPC ppc_85xx Freescale MPC8543 e500v2 core)
  mkdir build
  DS-508 RS-408 DS-408 DS-209+
  cd build
 
  ../binutils-stable/configure --target=$TARGET --prefix=/usr/local/$ARCH/ --with-sysroot=/usr/local/$ARCH/$CTARGET --disable-werror
 
  make
The following models should use the '''x10_arm''':
  make install
DS210j DS410j DS110j
  export PATH=/usr/local/$ARCH/bin:$PATH
 
  rm -rf *    # Delete everything in build directory
The following models should use the '''D510_x86''':
   
1010+
  ../gmp-stable/configure --target=$TARGET --prefix=/usr/local/$ARCH/ --with-sysroot=/usr/local/$ARCH/$CTARGET --disable-werror --disable-shared --disable-nls
 
make
 
make install
 
'''Download binary'''
  [http://lundman.net/ftp/llink/llink-2.3.2-synology_D510_x86.tar.gz llink-2.3.2-synology_D510_x86.tar.gz] (clinkc) 2011-12-27
  [[Media:Llink-2.2.4-synology_x06_ppc.tar.gz|llink-2.2.4-synology_x06_ppc.tar.gz]] build 1756 (Thu Jul 29 11:50:38 2010) (libdvdnav), added 2010-12-06
  [http://www.lundman.net/ftp/llink/llink-2.2.0-synology_x07_arm.tar.gz llink-2.2.0-synology_x07_arm.tar.gz] build 1305 (libdvdnav)
  [http://www.lundman.net/ftp/llink/llink-2.2.2-synology_e500_ppc.tar.gz llink-2.2.2-synology_e500_ppc.tar.gz] build 1609 (libdvdnav) for x09 models
[http://www.lundman.net/ftp/llink/llink-2.2.3-synology_x10_arm.tar.gz llink-2.2.3-synology_x10_arm.tar.gz] build 1609 (libdvdnav) for x10 models
[http://www.lundman.net/ftp/llink/llink-2.2.4-synology_x10_arm.tar.gz llink-2.2.4-synology_x10_arm.tar.gz] build 1609 (libdvdnav) for x10 models
 
 
'''Older binaries'''
[[Media:Llink-2.2.0-synology_x06_ppc.tar.gz|llink-2.2.0-synology_x06_ppc.tar.gz]] build 1305 (Mon Oct 27 12:30:29 2008) (libdvdnav), added 2008-11-02
[http://www.lundman.net/ftp/llink/llink-2.2.0-synology_e500_ppc.tar.gz llink-2.2.0-synology_e500_ppc.tar.gz] build 1305 (libdvdnav)
[[Media:Llink-2.1.1-synology_x07_arm.tar.gz|llink-2.1.1-synology_x07_arm.tar.gz]] build 1000 (Tue Aug 12 11:09:44 2008) (libdvdread), added 2008-08-08
[[Media:Llink-2.1.2-synology_x06_ppc.tar.gz|llink-2.1.2-synology_x06_ppc.tar.gz]] build 1103 (Fri Aug 29 20:51:03 2008) (libdvdnav), added 2008-09-01
[[Media:Llink-2.1.1-synology_x06_ppc.tar.gz|llink-2.1.1-synology_x06_ppc.tar.gz]] build 1000 (Tue Aug 12 11:09:44 2008) (libdvdread), added 2008-08-08
[[Media:Llink-2.1.0-synology_x06_ppc.tar.gz|llink-2.1.0-synology_x06_ppc.tar.gz]] build 961 (Fri Aug  8 11:09:44 2008) (libdvdread), added 2008-08-08
  [[Media:Llink-2.1.0-synology_x07_arm.tar.gz|llink-2.1.0-synology_x07_arm.tar.gz]] build 961 (Fri Aug  8 11:09:44 2008) (libdvdread), added 2008-08-08
  [http://www.lundman.net/ftp/llink/llink-2.0.6-synology_x07_arm.tar.gz llink-2.0.6-synology_x07_arm.tar.gz] build 750 (Fri May 21 16:17:40 2008), added 2008-05-21
  [http://www.lundman.net/wiki/images/1/1f/Llink-2.0.8-synology_x06_ppc.tar.gz llink-2.0.8-synology_x06_ppc.tar.gz‎]] build 904 (Fri Jun 20 12:40:12 2008) (libdvdread), added 2008-06-20
[[Media:Llink-2.0.7-synology_x06_ppc.tar.gz|llink-2.0.7-synology_x06_ppc.tar.gz]] build 830 (Mon Jun  2 11:09:44 2008) (libdvdread), added 2008-06-06
[[Media:Llink-2.0.6-syno_x06.tar.gz|llink-2.0.6-syno_x06.tar.gz]] build 750 (Fri May 16 16:17:45 2008), added 2008-05-17
[[Media:Llink-2.0.4-syno_x06.tar.gz|llink-2.0.4-syno_x06.tar.gz]] build 709 (Mon Apr 21 10:06:04 2008), added 2008-04-24 
  [[Media:Llink-2.0.3-syno_x06.tar.gz|llink-2.0.3-syno_x06.tar.gz]] build 709 added 2008-04-21
  [[Media:Llink-2.0.2-syno_x06.tar.gz|llink-2.0.2-syno_x06.tar.gz]]
  [http://www.lundman.net/ftp/llink/llink-1.9.2-synology.tar.gz llink-1.9.2-synology.tar.gz]
 
 
Once you've installed the binary you have to update the llink.conf file so it points to your media files, uses the right port etc.
 
=== Installation pre-requisites ===
Telnet/SSH-patch installed on the NAS.
 
If you want to autostart llink from boot, you can use this [[Llink:synology_autostart|script]].<br>
Otherwise you must enter via telnet and start manually after shutdown or restart.
 
If you have ''Optware'' enabled you can use the appropriate feed to automagically download and install llink, from version 2.0.9. See feed links above.
 
=== Toolchains ===
==== x06 ====
For the synology_x06 compiles, the toolchain for the DS1010g has been used successfully, found  at [http://www.nslu2-linux.org/wiki/DS101/HomePage NSLU2-linux.org].
 
==== x07 ====
If you use a Synology NAS from the x07-series there is a toolchain available for compiling source at [http://www.synology.com/wiki/index.php/Mods_for_Marvell_mv5281_ARM-based_Synology_Products#Toolchain Synology.com]
 
Unfortunately, this toolchain is missing the Linux headers required. asm->asm-arm, linux and asm-generic. One way to solve this is go download Linux-2.6.15 linux kernel. (There is one on NMT forum, probably one in my ftp somewhere - anyway, it is GPL and available everywhere).
 
Issue the following commands:
 
# sudo bash
# cd /usr/local/arm-marvell-linux-gnu/arm-marvell-linux-gnu/include/
# rsync -arv $YOUR_PATH/linux-2.6.15/include/asm-arm/ asm/
# rsync -arv $YOUR_PATH/linux-2.6.15/include/asm-generic/ asm-generic/
# rsync -arv $YOUR_PATH/linux-2.6.15/include/linux/ linux/
 
==== e500 ====
 
[http://sourceforge.net/project/downloading.php?group_id=238526&filename=gcc343_glibc234_854x.tar.gz&a=89364623 e500 gcc for toolchain]]
 
==== x10 ====
 
DS410j etc. Toolchain here: [http://downloads.sourceforge.net/project/dsgpl/Tool%20Chain/Marvell%2088F6281%20Linux%202.6.24/gcc421_glibc25_88f6281.tar.gz?use_mirror=jaist]
 
=== Additional resources and references ===
NSLU2-Linux.org [http://www.nslu2-linux.org/wiki/Optware/Packages?from=Unslung.Packages]<br>
flipflip's Diskstation site [http://oinkzwurgl.org/diskstation]<br>
Synology's official forum [http://www.synology.com/enu/forum/]

Revision as of 23:26, 31 December 2011

Synoogy Inc. logo

The Synology NAS can host the llink media streaming server. If you don't compile it yourself, please note below which binary you should use for your model. The binary packages are not made to be integrated with the admin web interface.


Binaries

Latest binaries
This contains a startup script, a Synology installation guide (README-Synology.txt) and a prepared llink.conf that points to the Synology default /volume1/video share. Place this binary in the /volume1 directory, untar and open the README-synology.txt file with a text editor for further assistance. Note: the startup script and the installation guide was written for the synology_x06_ppc in mind.

[1] Is_my_NAS_an_ARM_or_a_PowerPC_CPU_model

The following models uses x06_ppc version per default: (PowerPC ppc_6xx Freescale MPC8245 603e core MPC8241 603e core)

DS-101g+, DS-106j, DS-106e, DS-106, DS-106x , CS-406, RS-406 and CS-406e 

The following x07-models share the same cpu family as x06 and should also use the x06_ppc-version of llink:

DS-107e, DS-107, DS-207, DS-207.128 and CS-407e

Optware feed: http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/unstable/


The following models should use the x07_arm: (ARM armv5tejl Marvell Orion 88F5281)

DS-107+, DS-107+.128, DS-207+, CS-407 and RS-407

Optware feed: http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/


The following models should use the e500_ppc: (PowerPC ppc_85xx Freescale MPC8543 e500v2 core)

DS-508	RS-408	DS-408	DS-209+


The following models should use the x10_arm:

DS210j DS410j DS110j

The following models should use the D510_x86:

1010+


Download binary

llink-2.3.2-synology_D510_x86.tar.gz (clinkc) 2011-12-27
llink-2.2.4-synology_x06_ppc.tar.gz build 1756 (Thu Jul 29 11:50:38 2010) (libdvdnav), added 2010-12-06
llink-2.2.0-synology_x07_arm.tar.gz build 1305 (libdvdnav)
llink-2.2.2-synology_e500_ppc.tar.gz build 1609 (libdvdnav) for x09 models
llink-2.2.3-synology_x10_arm.tar.gz build 1609 (libdvdnav) for x10 models
llink-2.2.4-synology_x10_arm.tar.gz build 1609 (libdvdnav) for x10 models


Older binaries

llink-2.2.0-synology_x06_ppc.tar.gz build 1305 (Mon Oct 27 12:30:29 2008) (libdvdnav), added 2008-11-02
llink-2.2.0-synology_e500_ppc.tar.gz build 1305 (libdvdnav)
llink-2.1.1-synology_x07_arm.tar.gz build 1000 (Tue Aug 12 11:09:44 2008) (libdvdread), added 2008-08-08
llink-2.1.2-synology_x06_ppc.tar.gz build 1103 (Fri Aug 29 20:51:03 2008) (libdvdnav), added 2008-09-01
llink-2.1.1-synology_x06_ppc.tar.gz build 1000 (Tue Aug 12 11:09:44 2008) (libdvdread), added 2008-08-08
llink-2.1.0-synology_x06_ppc.tar.gz build 961 (Fri Aug  8 11:09:44 2008) (libdvdread), added 2008-08-08
llink-2.1.0-synology_x07_arm.tar.gz build 961 (Fri Aug  8 11:09:44 2008) (libdvdread), added 2008-08-08
llink-2.0.6-synology_x07_arm.tar.gz build 750 (Fri May 21 16:17:40 2008), added 2008-05-21
llink-2.0.8-synology_x06_ppc.tar.gz‎] build 904 (Fri Jun 20 12:40:12 2008) (libdvdread), added 2008-06-20
llink-2.0.7-synology_x06_ppc.tar.gz build 830 (Mon Jun  2 11:09:44 2008) (libdvdread), added 2008-06-06
llink-2.0.6-syno_x06.tar.gz build 750 (Fri May 16 16:17:45 2008), added 2008-05-17
llink-2.0.4-syno_x06.tar.gz build 709 (Mon Apr 21 10:06:04 2008), added 2008-04-24  
llink-2.0.3-syno_x06.tar.gz build 709 added 2008-04-21
llink-2.0.2-syno_x06.tar.gz
llink-1.9.2-synology.tar.gz


Once you've installed the binary you have to update the llink.conf file so it points to your media files, uses the right port etc.

Installation pre-requisites

Telnet/SSH-patch installed on the NAS.

If you want to autostart llink from boot, you can use this script.
Otherwise you must enter via telnet and start manually after shutdown or restart.

If you have Optware enabled you can use the appropriate feed to automagically download and install llink, from version 2.0.9. See feed links above.

Toolchains

x06

For the synology_x06 compiles, the toolchain for the DS1010g has been used successfully, found at NSLU2-linux.org.

x07

If you use a Synology NAS from the x07-series there is a toolchain available for compiling source at Synology.com

Unfortunately, this toolchain is missing the Linux headers required. asm->asm-arm, linux and asm-generic. One way to solve this is go download Linux-2.6.15 linux kernel. (There is one on NMT forum, probably one in my ftp somewhere - anyway, it is GPL and available everywhere).

Issue the following commands:

# sudo bash
# cd /usr/local/arm-marvell-linux-gnu/arm-marvell-linux-gnu/include/
# rsync -arv $YOUR_PATH/linux-2.6.15/include/asm-arm/ asm/
# rsync -arv $YOUR_PATH/linux-2.6.15/include/asm-generic/ asm-generic/
# rsync -arv $YOUR_PATH/linux-2.6.15/include/linux/ linux/

e500

e500 gcc for toolchain]

x10

DS410j etc. Toolchain here: [2]

Additional resources and references

NSLU2-Linux.org [3]
flipflip's Diskstation site [4]
Synology's official forum [5]