j4x*_*j4x 6 c gcc powerpc cross-compiling embedded-linux
我在一个Ubuntu盒子里安装了ELDK-3.1,效果很好.
在另一台运行64位OpenSuse 12.1的机器上,我克隆了ELDK安装,并且有一段时间它运行良好.
现在,当我尝试配置我的项目时,我看到:
configure: error: C compiler cannot create executables
See `config.log' for more details
Run Code Online (Sandbox Code Playgroud)
日志显示:
configure:3411: ppc-linux-gcc conftest.c >&5
/opt/ELDK-3.1/usr/bin/../lib/gcc-lib/ppc-linux/3.3.3/../../../../ppc-linux/bin/ld: warning: ld.so.1, needed by /opt/ELDK-3.1//usr/../ppc_8xx/lib/libc.so.6, not found (try using -rpath or -rpath-link)
/opt/ELDK-3.1//usr/../ppc_8xx/lib/libc.so.6: undefined reference to `_dl_lookup_versioned_symbol_skip@GLIBC_PRIVATE'
...
Run Code Online (Sandbox Code Playgroud)
该文件ld.so.1与目录位于同一目录中libc.so.6.
s -l /opt/ELDK-3.1//usr/../ppc_8xx/lib/ld.so.1
lrwxrwxrwx 1 root root 11 Jan 31 11:43 /opt/ELDK-3.1//usr/../ppc_8xx/lib/ld.so.1 -> ld-2.3.1.so
Run Code Online (Sandbox Code Playgroud)
据我所知,我正确地定义了所有需要的环境,并尝试使用与Ubuntu框中完全相同的构建系统构建(项目是"自动化").
所以我写了一个脚本试图模仿我的automaked configure所做的一切:
#!/bin/bash
if [ ! -f confdefs.c ]; then
cat > confdefs.c << EOF
/* confdefs.h */
#define PACKAGE_NAME "xyz"
#define PACKAGE_TARNAME "xyz"
#define PACKAGE_VERSION "1.00"
#define PACKAGE_STRING "xyz 1.00"
#define PACKAGE_BUGREPORT "<contact@company>"
#define PACKAGE_URL ""
#define PACKAGE "xyz"
#define VERSION "1.00"
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
EOF
fi
ARCH=powerpc
export CROSS_COMPILE=ppc_8xx
TOOLCHAIN=ppc-linux-
TOOLCHAIN_ROOT=/opt/ELDK
LD=`which ${TOOLCHAIN}ld`
CC=`which ${TOOLCHAIN}gcc`
GCC=$CC
export CFLAGS="-Wall -g -I${TOOLCHAIN_ROOT}/ppc_8xx/usr/include/"
export CPPFLAGS=$CFLAGS
# export LDFLAGS="-shared"
$CC $CFLAGS $LDFLAGS confdefs.c -o confdefs
Run Code Online (Sandbox Code Playgroud)
这给了我完全相同的错误configure.
如果我取消注释该线export LDFLAGS="-shared",另一方面,它构建完美!
> ls -l confdefs
-rwxr-xr-x 1 myself users 16136 Fev 1 09:52 confdefs
> file confdefs
confdefs: ELF 32-bit MSB shared object, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked, not stripped
Run Code Online (Sandbox Code Playgroud)
请问这里的任何人请告诉我我所缺少的任何线索,以便我的项目在一个盒子上工作得很好而在另一个盒子里没有?
谢谢!
我不是百分百肯定它解决了所有问题,但它对我们有用.
我们发现symlink"ld.so.1 - > ../../../ppc_8xx/lib/ld.so.1"到eldk-3.1/usr/ppc-linux/lib解决了链接错误.
我怀疑F15和F16之间的环境发生了变化.对于OpenSUSE(11-> 12)也是如此.此外bug已被提交针对Fedora的https://bugzilla.redhat.com/show_bug.cgi?id=754695其终止为故意ABI的变化.
| 归档时间: |
|
| 查看次数: |
1941 次 |
| 最近记录: |