最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】gen_uuid.c:153: undefined reference to `__aeabi_read_tp’

工作和技术 crifan 2732浏览 0评论

交叉编译e2fsprogs,配置了:

../configure –host=arm-linux –prefix=/home/crifan/rootfs-2007/root/usr –exec-prefix=/home/crifan/rootfs-2007/root/usr –includedir=/root/buildroot/buildroot/build_arm/staging_dir/usr/include –libdir=/root/buildroot/buildroot/build_arm/staging_dir/lib   –enable-fsck –with-cc=/root/buildroot/buildroot/build_arm/staging_dir/usr/bin/arm-linux-uclibc-gcc

然后make,在ld的时候出现错误:

        LD tst_uuid
../../lib/libuuid.a(gen_uuid.o): In function `get_random_fd’:
/home/crifan/tmp/e2fsprogs-1.41.3/build/lib/uuid/../../../lib/uuid/gen_uuid.c:153: undefined reference to `__aeabi_read_tp’
../../lib/libuuid.a(gen_uuid.o): In function `get_random_bytes’:
/home/crifan/tmp/e2fsprogs-1.41.3/build/lib/uuid/../../../lib/uuid/gen_uuid.c:198: undefined reference to `__aeabi_read_tp’
/home/crifan/tmp/e2fsprogs-1.41.3/build/lib/uuid/../../../lib/uuid/gen_uuid.c:202: undefined reference to `__aeabi_read_tp’
/home/crifan/tmp/e2fsprogs-1.41.3/build/lib/uuid/../../../lib/uuid/gen_uuid.c:198: undefined reference to `__aeabi_read_tp’
../../lib/libuuid.a(gen_uuid.o): In function `get_clock’:
/home/crifan/tmp/e2fsprogs-1.41.3/build/lib/uuid/../../../lib/uuid/gen_uuid.c:315: undefined reference to `__aeabi_read_tp’
../../lib/libuuid.a(gen_uuid.o):/home/crifan/tmp/e2fsprogs-1.41.3/build/lib/uuid/../../../lib/uuid/gen_uuid.c:331: more undefined references to `__aeabi_read_tp’ follow
collect2: ld returned 1 exit status
make[2]: *** [tst_uuid] Error 1
make[2]: Leaving directory `/home/crifan/tmp/e2fsprogs-1.41.3/build/lib/uuid’

【解决办法】

google了下,说是:

http://lists.cross-lfs.org/pipermail/clfs-support-cross-lfs.org/2009-June/000628.html

“Yes, you need to disable threading for e2fsprogs when you’re using
uClibc. I believe the option is –disable-tls.”

即,交叉编译,用的uClibc的话,要禁用tls,去

configure –help里面能找到此选项的说明:

–disable-tls           disable use of thread local support

所以,在配置的时候,加上参数–disable-tls即可:

../configure –host=arm-linux –prefix=/home/crifan/rootfs-2007/root/usr –exec-prefix=/home/crifan/rootfs-2007/root/usr –includedir=/root/buildroot/buildroot/build_arm/staging_dir/usr/include –libdir=/root/buildroot/buildroot/build_arm/staging_dir/lib   –enable-fsck –with-cc=/root/buildroot/buildroot/build_arm/staging_dir/usr/bin/arm-linux-uclibc-gcc –disable-tls

然后make就可以顺利编译过了,然后make check 后,make install即可。

转载请注明:在路上 » 【已解决】gen_uuid.c:153: undefined reference to `__aeabi_read_tp’

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
79 queries in 0.170 seconds, using 22.08MB memory