我的最终目标是使用DSM 6.0.1-7393 Update 1在我的Synology DiskStation DS1813 +上安装Nagios.但我甚至无法开始编译软件包......
当我尝试在Synology DiskStation上使用gcc时,我总是收到以下错误消息:
$ gcc hello.c -o hello.o
/lib/libc.so.6: file not recognized: File format not recognized
collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
这是我的shell环境.我已尝试使用不同的LD_LIBRARY_PATH设置,但即使省略它也没有什么区别.
$ env
TERM=xterm-256color
SHELL=/bin/sh
SSH_CLIENT=192.168.2.110 51079 22
OLDPWD=/var/services/homes/egi
SSH_TTY=/dev/pts/7
LC_ALL=en_US.utf8
USER=egi
LD_LIBRARY_PATH=/opt/lib:
PAGER=more
MAIL=/var/mail/egi
PATH=/opt/sbin:/opt/bin:/sbin:/bin:/usr/sbin:/usr/bin
PWD=/var/services/homes/egi/exer
LANG=en_US.utf8
PS1=[\u@\h \W]$
SHLVL=1
HOME=/var/services/homes/egi
TERMINFO=/usr/share/terminfo
LOGNAME=shunyam
SSH_CONNECTION=xxx.xxx.xxx.xxx 51079 yyy.yyy.yyy.yyy 22
PGDATA=/var/services/pgsql
CC=gcc
_=/opt/bin/env
Run Code Online (Sandbox Code Playgroud)
编译器已经安装了ipkg,其规格如下所示:
$ gcc --verbose
Using built-in specs.
Target: i686-linux-gnu
Configured with: ../gcc-4.2.1/configure --build=i386-pc-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu --prefix=/opt --disable-nls --disable-static --with-as=/home/slug/optware/syno-i686/toolchain/gcc-4.2.1-glibc-2.3.6/i686-linux-gnu/bin/i686-linux-gnu-as --with-ld=/home/slug/optware/syno-i686/toolchain/gcc-4.2.1-glibc-2.3.6/i686-linux-gnu/bin/i686-linux-gnu-ld --enable-languages=c,c++ --disable-multilib
Thread model: posix
gcc version 4.2.1
Run Code Online (Sandbox Code Playgroud)
导致该问题的库将返回以下信息:
$ /lib/libc.so.6
GNU C Library (crosstool-NG 1.20.0) stable release version 2.20-2014.11, by Roland McGrath et al.
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.9.3 20150311 (prerelease).
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
Run Code Online (Sandbox Code Playgroud)
/opt/lib/libc.so上还有一个链接描述文件:
$ cat /opt/lib/libc.so
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-i386)
GROUP ( /lib/libc.so.6 /opt/lib/libc_nonshared.a )
Run Code Online (Sandbox Code Playgroud)
图书馆实际上不会被打破,否则什么都行不通.
除了gcc之外,所有其他必需的软件包也已经安装了ipkg.
奇怪的是,我似乎是唯一一个有这个问题的人,因为我在Google上找不到相关的帖子.Synology的支持告诉我他们不支持安装命令行命令行包.
大约两年前,当我第一次在这个Diskstation上安装gcc时,一切正常.几个月前我已经注意到了这个问题(可能是在DSM更新之后).
有没有人也遇到过这个问题,或者有关于如何让它再次运作的线索?谢谢!
小智 7
我有同样的问题.海湾合作委员会使用工作,现在与DSM 6.1打破了.我认为这是在他们用DSM 6.0切换到64位之后我相信的.你的问题实际上给了我答案,所以我想在这里分享.我改/lib/libc.so.6到/lib32/libc.so.6文件中/opt/lib/libc.so.
$ cat /opt/lib/libc.so
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-i386)
GROUP ( /lib32/libc.so.6 /opt/lib/libc_nonshared.a )
Run Code Online (Sandbox Code Playgroud)
在进行上述更改后,optware GCC编译了我的测试文件,没有设置任何环境变量就像你在普通Linux系统上所期望的那样.