summaryrefslogtreecommitdiff
path: root/doc/todo/Build_for_Synology_DSM/comment_15_9525cd0d75ff4c15182d10a855774b69._comment
blob: c3edf99e25670fcf24de87da2ad53f1cc63e3d28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[[!comment format=mdwn
 username="lorenzo"
 ip="84.75.27.69"
 subject="Running Debian squeeze binaries on libc 2.5 based NAS"
 date="2013-10-27T23:56:26Z"
 content="""
Following the suggestions in this page I tried to run the binaries that debian provides on my Lacie NetworkSpace which is another one of these NAS devices with old libc. After uploading the binaries and required libraries and using `LD_LIBRARY_PATH` to force the loader to use the version I uploaded of the libraries I was still having a segfault (similar to what Franck was experiencing) while running git-annex in a chroot was working.

It turns out that it is possible to solve the problem without having to use chroot by not loading the binary directly but by substituting it with a  script that calls the correct `ld-linux.so.3`. Assume you have uncompressed the files from the deb packages in `/opt/git-annex`. 

First create a directory `/opt/git-annex/usr/bin/git-annex.exec` and copy the executable `/opt/git-annex/usr/bin/git-annex` there.

Then create script `/opt/git-annex/usr/bin/git-annex` with the following contents:

    #!/bin/bash
    
    PREFIX=/opt/git-annex
    
    export GCONV_PATH=$PREFIX/usr/lib/gconv 
        
    exec $PREFIX/lib/ld-linux.so.3 --library-path $PREFIX/lib/:$PREFIX/usr/lib/ $PREFIX/usr/bin/git-annex.exec/git-annex \"$@\"

The `GCONV_PATH` setting is important to prevent the app from failing with the message:

    git-annex.exec: mkTextEncoding: invalid argument (Invalid argument)
   
The original executable is moved to a different directory instead of being simply renamed to make sure that `$0` is correct when the executable starts. The parameter for the linker `--library-path` is used instead of the environment variable `LD_LIBRARY_PATH` to make sure that the programs exec'ed by git-annex do not have the variable set.

Some more info about the approach: [[http://www.novell.com/coolsolutions/feature/11775.html]]
"""]]