gcc-ar的意思是多包了--plugin=/path/to/liblto_plugin.so
所以 gcc-ar = ar --plugin=/path/to/liblto_plugin.so
這是我在建立openwrt external toolchain時遇到的問題...
發生過程
1. 出現undefined reference issue
/home/XXX/test2/toolchain-aarch64_cortex-a55+neon-vfpv4_gcc-7.5.0_musl/bin/../lib/gcc/aarch64-openwrt-linux-musl/7.5.0/../../../../aarch64-openwrt-linux-musl/bin/ld: /home4/alan/510_1/xs5g/openwrt/tmp/ccYUWq9D.ltrans0.ltrans.o: in function sighup_handler': <artificial>:(.text+0x14): undefined reference to ubusd_acl_load’
2. 往前面看出現plugin needed to handle lto object這其實是一個error,但卻沒顯示error,還把.a建出來他的意思是組libubusd_library.a時找不到liblto_plugin.so
/home4/alan/test2/toolchain-aarch64_cortex-a55+neon-vfpv4_gcc-7.5.0_musl/bin/aarch64-openwrt-linux-ar: CMakeFiles/ubusd_library.dir/ubusd.c.o: plugin needed to handle lto object
3. ar命令少了gcc
正確
/home/XXX/test2/toolchain-aarch64_cortex-a55+neon-vfpv4_gcc-7.5.0_musl/bin/aarch64-openwrt-linux-gcc-ar qc libubusd_library.a CMakeFiles/ubusd_library.dir/ubusd.c.o CMakeFiles/ubusd_library.dir/ubusd_proto.c.o CMakeFiles/ubusd_library.dir/ubusd_id.c.o …
錯誤
/home/XXX/test2/toolchain-aarch64_cortex-a55+neon-vfpv4_gcc-7.5.0_musl/bin/aarch64-openwrt-linux-ar qc libubusd_library.a CMakeFiles/ubusd_library.dir/ubusd.c.o CMakeFiles/ubusd_library.dir/ubusd_proto.c.o CMakeFiles/ubusd_library.dir/ubusd_id.c.o …
此問題官方已經修正:
參考資料:
沒有留言:
張貼留言