Open GoogleCodeExporter opened 9 years ago
config.log中关于出错的记载:
configure:3682: checking for C compiler default output file name
configure:3704: arm-openwrt-linux-gnueabi-gcc -O2 -pipe -march=armv7-a
-mtune=cortex-a8 -funit-at-a-time -mfpu=vfp -mfloat-abi=softfp -fhonour-copts
-msoft-float -fpic
-I./staging_dir/target-arm_v7-a_glibc-2.6.1_eabi/usr/include
-I./staging_dir/target-arm_v7-a_glibc-2.6.1_eabi/include
-I./staging_dir/toolchain-arm_v7-a_gcc-4.3.3+cs_glibc-2.6.1_eabi/usr/include
-I./staging_dir/toolchain-arm_v7-a_gcc-4.3.3+cs_glibc-2.6.1_eabi/include
-I./staging_dir/target-arm_v7-a_glibc-2.6.1_eabi/usr/include/uClibc++
-L./staging_dir/target-arm_v7-a_glibc-2.6.1_eabi/usr/lib
-L./staging_dir/target-arm_v7-a_glibc-2.6.1_eabi/lib
-L./staging_dir/toolchain-arm_v7-a_gcc-4.3.3+cs_glibc-2.6.1_eabi/usr/lib
-L./staging_dir/toolchain-arm_v7-a_gcc-4.3.3+cs_glibc-2.6.1_eabi/lib
conftest.c -nodefaultlibs -luClibc++ -lm
-L./staging_dir/toolchain-arm_v7-a_gcc-4.3.3+cs_glibc-2.6.1_eabi/lib -lgcc_s >&5
./staging_dir/toolchain-arm_v7-a_gcc-4.3.3+cs_glibc-2.6.1_eabi/usr/lib/gcc/arm-o
penwrt-linux-gnueabi/4.3.3/../../../../arm-openwrt-linux-gnueabi/lib/crt1.o: In
function `_start':
init.c:(.text+0x2c): undefined reference to `__libc_csu_fini'
init.c:(.text+0x34): undefined reference to `__libc_csu_init'
collect2: ld returned 1 exit status
configure:3708: $? = 1
configure:3746: result:
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "MySQL Server"
| #define PACKAGE_TARNAME "mysql"
| #define PACKAGE_VERSION "5.1.53"
| #define PACKAGE_STRING "MySQL Server 5.1.53"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "mysql"
| #define VERSION "5.1.53"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3752: error: in
`./build_dir/target-arm_v7-a_glibc-2.6.1_eabi/mysql-5.1.53':
configure:3755: error: C compiler cannot create executables
See `config.log' for more details.
Original comment by richard....@gmail.com
on 1 Jun 2012 at 2:45
[deleted comment]
[deleted comment]
[deleted comment]
在build_dir/toolchain-arm_v7-a_gcc-4.3.3+cs_eglibc-2.8_eabi下:
grep -r "__libc_csu_fini" ./
查找相关信息。
1. 下面是有关于__libc_csu_fini的定义,它是个全局变量?!:
./eglibc-2.8-r8587/libc/sysdeps/sh/elf/start.S: .long __libc_csu_fini
2. arm中有使用:
./eglibc-2.8-r8587/libc/ports/sysdeps/arm/elf/start.S: ldr ip, =__libc_csu_fini
./eglibc-2.8-r8587/ports/sysdeps/arm/elf/start.S: ldr ip, =__libc_csu_fini
3. 关于__libc_csu_fini的说明
./eglibc-2.8-r8587/libc/ChangeLog.14: and __libc_csu_fini in place of _fini.
./eglibc-2.8-r8587/libc/ChangeLog.16: * csu/elf-init.c (__libc_csu_fini):
Pretty printing.
./eglibc-2.8-r8587/libc/ChangeLog.16: * csu/elf-init.c (__libc_csu_fini):
Enable if LIBC_NONSHARED
./eglibc-2.8-r8587/libc/ChangeLog.16: * csu/elf-init.c (__libc_csu_fini): Don't
do anything here.
Original comment by richard....@gmail.com
on 1 Jun 2012 at 5:58
编译sdlpal仙剑游戏时用到了__libc_csu_fini:(build_dir/target-xx目�
��下)
./sdlpal-61376/dist/Debug/GNU-Linux-arm/sdlpal.map:
/home/richardnee/2.OpenWRT/0-OpenWRT-for-Embedded/trunk-10.03.1/staging_dir/tool
chain-arm_v7-a_gcc-4.3.3+cs_eglibc-2.8_eabi/usr/lib/gcc/arm-openwrt-linux-gnueab
i/4.3.3/../../../../arm-openwrt-linux-gnueabi/lib/crt1.o (__libc_csu_fini)
./sdlpal-61376/dist/Debug/GNU-Linux-arm/sdlpal.map: 0x0005de84
__libc_csu_fini
Original comment by richard....@gmail.com
on 1 Jun 2012 at 6:01
编译busybox时也用到了__libc_csu_fini:(build_dir/target-xx目录下)
./busybox-1.15.3/busybox_unstripped.map:
/home/richardnee/2.OpenWRT/0-OpenWRT-for-Embedded/trunk-10.03.1/staging_dir/tool
chain-arm_v7-a_gcc-4.3.3+cs_eglibc-2.8_eabi/usr/lib/gcc/arm-openwrt-linux-gnueab
i/4.3.3/../../../../arm-openwrt-linux-gnueabi/lib/crt1.o (__libc_csu_fini)
./busybox-1.15.3/busybox_unstripped.map: 0x00064ce8
__libc_csu_fini
Original comment by richard....@gmail.com
on 1 Jun 2012 at 6:02
详见:http://www.linuxquestions.org/questions/linux-general-1/undefined-refer
ence-to-%60__libc_csu_fini-849247/
TOOLCHAINDIR/usr/lib/crt1.o中的__libc_csu_fini,__libc_csu_init函数没有��
�义(是引用外部函数的)
使用objdump -x crt1.o命令可以查看的到:
00000000 l .text 00000000 $a
00000000 l .data 00000000 $d
0000002c l .text 00000000 $d
00000000 l df *ABS* 00000000 init.c
00000000 l .rodata.cst4 00000000 $d
00000000 *UND* 00000000 __libc_csu_fini
00000000 *UND* 00000000 abort
00000000 g F .text 00000000 _start
00000000 *UND* 00000000 __libc_csu_init
00000000 *UND* 00000000 main
00000000 w .data 00000000 data_start
00000000 g O .rodata.cst4 00000004 _IO_stdin_used
00000000 *UND* 00000000 __libc_start_main
00000000 g .data 00000000 __data_start
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
00000024 UNKNOWN __libc_start_main
00000028 UNKNOWN abort
0000002c UNKNOWN __libc_csu_fini
00000030 UNKNOWN main
00000034 UNKNOWN __libc_csu_init
实际上他们最终是要使用应该定义在TOOLCHAINDIR/usr/lib/libc.so(该
文件定义了这两个函数),
而实际上eglibc/glibc中的TOOLCHAINDIR/usr/lib/libc.so是一个文本文件�
��
cat TOOLCHAINDIR/usr/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-littlearm)
GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.3 ) )
而uClibc使用的是链接到../../lib/libc.so,而又再链接到../../lib/li
buClibc-0.9.30.1.so,所以在uClibc中会成功编译!!!!!!!!�
��(eglibc/glibc的../../lib/libc.so仍为内容相同的文本文件!!)
实际上下面两个静态库定义了这两个函数:(从libc.so文本文�
��中也可以看得出!)
TOOLCHAINDIR/usr/lib/libc_nonshared.a
TOOLCHAINDIR/usr/lib/libc.a
所以,解决办法:
1 使用-L$TOOLCHAINDIR/usr/lib/libc.a -L$TOOLCHAINDIR/usr/lib/libc_nonshared.a
2 把libc_nonshared.a,libc.a,链接出.so的软链接?
Original comment by richard....@gmail.com
on 4 Jun 2012 at 1:42
[deleted comment]
1 使用判断语句,是否是真的二进制库?
如果是,不动,如果不是则链接!
2 或者判断使用的是uClibc还是eglibc/glibc来解决这个问题
Original comment by richard....@gmail.com
on 4 Jun 2012 at 3:07
1 之后又出现ld:cannot found
uClibc++.so(因为它依赖uClibc++,先make下把uClibc++编译了就行)�
��
2 libc.so这个脚本是用来链接到libc.so.6 libc_nonshared.a!
Original comment by richard....@gmail.com
on 4 Jun 2012 at 4:28
我擦,网友在尝试各种方法后,该网友尝试加了
-lc(指定使用libc.so或者libc.a),编译成功!!!!!!!!!��
�!
详见:http://sourceware.org/ml/libc-help/2009-12/msg00017.html
我尝试了下,可以通过编译!!!!!!!!!
不知运行是不是也可以?理论上应该可以(虽说不是使用的��
�态libc.so,是使用的静态libc.a)
Original comment by richard....@gmail.com
on 4 Jun 2012 at 5:25
Original issue reported on code.google.com by
richard....@gmail.com
on 1 Jun 2012 at 2:39