xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.82k stars 774 forks source link

flto 对静态库使用时出错 #5015

Closed ririyeye closed 4 months ago

ririyeye commented 4 months ago

Xmake 版本

v2.8.5+master

操作系统版本和架构

ubuntu23.10

描述问题

使用老版本gcc工具并且开启 set_policy("build.optimization.lto", true)时编译静态库时链接出错 而高版本gcc没有这个问题

期待的结果

1.如果手动执行ar -cr 会得到警告 /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar -cr build/linux/x86_64/release/libtest.a build/.objs/test/linux/x86_64/release/test.cpp.o /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar: build/.objs/test/linux/x86_64/release/test.cpp.o: plugin needed to handle lto object 2.这里的ar应该用gcc-ar替代 https://stackoverflow.com/questions/48777554/what-is-the-difference-between-ar-nm-and-gcc-ar-gcc-nm 老版本的ar对flto有问题需 要用gcc-ar替代 ranlib应该用gcc-ranlib替代

工程配置

wine.tar.gz

附加信息和错误日志

[ 37%]: cache compiling.release test.cpp /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -c -flto -o build/.objs/test/linux/x86_64/release/test.cpp.o test.cpp [ 50%]: cache compiling.release main.cpp /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -c -flto -o build/.objs/main/linux/x86_64/release/main.cpp.o main.cpp checking for flags (-MMD -MF) ... ok arm-linux-gnueabihf-gcc "-MMD" "-MF" "/dev/null" checking for flags (-fdiagnostics-color=always) ... ok arm-linux-gnueabihf-gcc "-fdiagnostics-color=always" [ 62%]: archiving.release libtest.a /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar -cr build/linux/x86_64/release/libtest.a build/.objs/test/linux/x86_64/release/test.cpp.o [ 87%]: linking.release main /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -o build/linux/x86_64/release/main build/.objs/main/linux/x86_64/release/main.cpp.o -Lbuild/linux/x86_64/release -ltest -flto /tmp/cccyE1T6.ltrans0.ltrans.o: In function `main':

:(.text+0x4): undefined reference to `test()' collect2: error: ld returned 1 exit status error: @programdir/core/main.lua:329: @programdir/actions/build/main.lua:148: @programdir/modules/async/runjobs.lua:322: @programdir/actions/build/kinds/binary.lua:53: @programdir/core/sandbox/modules/os.lua:378: execv(/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -o build/linux/x86_64/release/main build/.objs/main/linux/x86_64/release/main.cpp.o -Lbuild/linux/x86_64/release -ltest -flto) failed(1) stack traceback:
Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: flto Error when using static library

waruqi commented 4 months ago

try it again. xmake update dev

ririyeye commented 4 months ago

ranlib也要更新下 用gcc-ranlib替换 很多库用cmake编译用到ranlib

[ 54%] Linking CXX static library lib/libhv_static.a /usr/bin/cmake -P CMakeFiles/hv_static.dir/cmake_clean_target.cmake /usr/bin/cmake -E cmake_link_script CMakeFiles/hv_static.dir/link.txt --verbose=1 /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-ar qc lib/libhv_static.a CMakeFiles/hv_static.dir/base/hbase.c.o CMakeFiles/hv_static.dir/base/herr.c.o CMakeFiles/hv_static.dir/base/hlog.c.o CMakeFiles/hv_static.dir/base/hmain.c.o CMakeFiles/hv_static.dir/base/hsocket.c.o CMakeFiles/hv_static.dir/base/htime.c.o CMakeFiles/hv_static.dir/base/hversion.c.o CMakeFiles/hv_static.dir/base/rbtree.c.o CMakeFiles/hv_static.dir/ssl/appletls.c.o CMakeFiles/hv_static.dir/ssl/gnutls.c.o CMakeFiles/hv_static.dir/ssl/hssl.c.o CMakeFiles/hv_static.dir/ssl/mbedtls.c.o CMakeFiles/hv_static.dir/ssl/nossl.c.o CMakeFiles/hv_static.dir/ssl/openssl.c.o CMakeFiles/hv_static.dir/ssl/wintls.c.o CMakeFiles/hv_static.dir/event/epoll.c.o CMakeFiles/hv_static.dir/event/evport.c.o CMakeFiles/hv_static.dir/event/hevent.c.o CMakeFiles/hv_static.dir/event/hloop.c.o CMakeFiles/hv_static.dir/event/iocp.c.o CMakeFiles/hv_static.dir/event/kqueue.c.o CMakeFiles/hv_static.dir/event/nio.c.o CMakeFiles/hv_static.dir/event/nlog.c.o CMakeFiles/hv_static.dir/event/noevent.c.o CMakeFiles/hv_static.dir/event/overlapio.c.o CMakeFiles/hv_static.dir/event/poll.c.o CMakeFiles/hv_static.dir/event/rudp.c.o CMakeFiles/hv_static.dir/event/select.c.o CMakeFiles/hv_static.dir/event/unpack.c.o CMakeFiles/hv_static.dir/util/base64.c.o CMakeFiles/hv_static.dir/util/md5.c.o CMakeFiles/hv_static.dir/util/sha1.c.o CMakeFiles/hv_static.dir/cpputil/RAII.cpp.o CMakeFiles/hv_static.dir/cpputil/ThreadLocalStorage.cpp.o CMakeFiles/hv_static.dir/cpputil/hasync.cpp.o CMakeFiles/hv_static.dir/cpputil/hdir.cpp.o CMakeFiles/hv_static.dir/cpputil/hpath.cpp.o CMakeFiles/hv_static.dir/cpputil/hstring.cpp.o CMakeFiles/hv_static.dir/cpputil/hurl.cpp.o CMakeFiles/hv_static.dir/cpputil/ifconfig.cpp.o CMakeFiles/hv_static.dir/cpputil/iniparser.cpp.o CMakeFiles/hv_static.dir/http/Http1Parser.cpp.o CMakeFiles/hv_static.dir/http/Http2Parser.cpp.o CMakeFiles/hv_static.dir/http/HttpMessage.cpp.o CMakeFiles/hv_static.dir/http/HttpParser.cpp.o CMakeFiles/hv_static.dir/http/WebSocketChannel.cpp.o CMakeFiles/hv_static.dir/http/WebSocketParser.cpp.o CMakeFiles/hv_static.dir/http/http_content.cpp.o CMakeFiles/hv_static.dir/http/http_parser.c.o CMakeFiles/hv_static.dir/http/httpdef.c.o CMakeFiles/hv_static.dir/http/multipart_parser.c.o CMakeFiles/hv_static.dir/http/websocket_parser.c.o CMakeFiles/hv_static.dir/http/wsdef.c.o CMakeFiles/hv_static.dir/http/server/FileCache.cpp.o CMakeFiles/hv_static.dir/http/server/HttpHandler.cpp.o CMakeFiles/hv_static.dir/http/server/HttpMiddleware.cpp.o CMakeFiles/hv_static.dir/http/server/HttpResponseWriter.cpp.o CMakeFiles/hv_static.dir/http/server/HttpServer.cpp.o CMakeFiles/hv_static.dir/http/server/HttpService.cpp.o CMakeFiles/hv_static.dir/http/server/http_page.cpp.o CMakeFiles/hv_static.dir/http/client/AsyncHttpClient.cpp.o CMakeFiles/hv_static.dir/http/client/HttpClient.cpp.o CMakeFiles/hv_static.dir/http/client/WebSocketClient.cpp.o /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib lib/libhv_static.a /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: hbase.c.o: plugin needed to handle lto object /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: herr.c.o: plugin needed to handle lto object /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: hlog.c.o: plugin needed to handle lto object /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: hmain.c.o: plugin needed to handle lto object /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: hsocket.c.o: plugin needed to handle lto object

waruqi commented 4 months ago

加了

ririyeye commented 4 months ago

👌

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


add

ririyeye commented 4 months ago

我把环境清理了下 然后链接又报错了

checking for arm-linux-gnueabihf-gcc ... /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc checking for the c++ compiler (cxx) ... arm-linux-gnueabihf-gcc checking for arm-linux-gnueabihf-g++ ... /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ checking for the linker (ld) ... arm-linux-gnueabihf-g++ configure { network = private target_os = linux sdk = /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf mode = release buildir = build proxy_pac = pac.lua kind = static theme = default ndk_stdcxx = true ccache = true host = linux plat = linux arch = x86_64 } checking for /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc ... ok checking for flags (-fPIC) ... ok arm-linux-gnueabihf-gcc "-fPIC" checking for flags (-flto) ... ok arm-linux-gnueabihf-gcc "-flto" [ 50%]: cache compiling.release test.cpp /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -c -flto -o build/.objs/test/linux/x86_64/release/test.cpp.o test.cpp checking for flags (-MMD -MF) ... ok arm-linux-gnueabihf-gcc "-MMD" "-MF" "/dev/null" checking for flags (-fdiagnostics-color=always) ... ok arm-linux-gnueabihf-gcc "-fdiagnostics-color=always" checking for rustc ... /usr/bin/rustc checking for the rust static library archiver (rcar) ... rustc [ 62%]: archiving.release libtest.a [ 62%]: cache compiling.release main.cpp /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -c -flto -o build/.objs/main/linux/x86_64/release/main.cpp.o main.cpp error: @programdir/core/main.lua:329: @programdir/actions/build/main.lua:148: @programdir/modules/async/runjobs.lua:322: @programdir/core/tool/linker.lua:228: method 'linkargv' is not callable (a nil value) stack traceback: [@programdir/core/tool/linker.lua:228]: in function 'linkargv' [@programdir/core/tool/linker.lua:233]: in function 'linkcmd' [@programdir/actions/build/kinds/static.lua:49]: in function 'callback' [@programdir/modules/core/project/depend.lua:217]: in function 'on_changed' [@programdir/actions/build/kinds/static.lua:41]: in function '_do_link_target' [@programdir/actions/build/kinds/static.lua:84]: [@programdir/actions/build/kinds/static.lua:111]: in function '_link_target' [@programdir/actions/build/kinds/static.lua:139]: in function 'jobfunc' [@programdir/modules/async/runjobs.lua:238]:

stack traceback: [C]: in function 'error' @programdir/core/base/os.lua:973: in function 'os.raiselevel' (...tail calls...) @programdir/core/main.lua:329: in upvalue 'cotask' @programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399> error: please run $xmake build [target] to build the following targets first: -> main -> test

waruqi commented 4 months ago

再试下, https://github.com/xmake-io/xmake/pull/5024

xmake update -s dev
Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


Try again

xmake update -s dev
ririyeye commented 4 months ago

这下可以了👌

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


It’s okay now 👌

waruqi commented 4 months ago

用 gcc-ar 也有很多问题,会 break 其他用户的一些项目。。https://github.com/xmake-io/xmake/issues/5051

waruqi commented 4 months ago

另外一种方案就是用回 ar ,然后参考 gcc-ar 的实现,当开启 lto 时候,xmake 内部自己找 liblto_plugin.so 然后传入 ar 中去。

但不知道对高版本是否兼容,你可以先手动测试验证下,如果ok,我可以尝试这么改下

ar rcsT --plugin /usr/libexec/gcc/x86_64-redhat-linux/5.3.1/liblto_plugin.so library.a library.o 
Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


Another solution is to use ar, and then refer to the implementation of gcc-ar. When lto is turned on, xmake internally finds liblto_plugin.so and passes it to ar.

ar rcsT --plugin /usr/libexec/gcc/x86_64-redhat-linux/5.3.1/liblto_plugin.so library.a library.o
ririyeye commented 4 months ago

另外一种方案就是用回 ar ,然后参考 gcc-ar 的实现,当开启 lto 时候,xmake 内部自己找 liblto_plugin.so 然后传入 ar 中去。

但不知道对高版本是否兼容,你可以先手动测试验证下,如果ok,我可以尝试这么改下

ar rcsT --plugin /usr/libexec/gcc/x86_64-redhat-linux/5.3.1/liblto_plugin.so library.a library.o 

手动加可以的 生成是正常的 就是这个库找起来麻烦 /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar -cr \ build/cross/armv7/releasedbg/libdev8030.a build/.objs/dev8030/cross/armv7/releasedbg/daemon/dev8030/dev8030.c.o \ build/.objs/dev8030/cross/armv7/releasedbg/daemon/dev8030/hotplug_rpc.c.o \ --plug=/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/libexec/gcc/arm-linux-gnueabihf/5.4.1/liblto_plugin.so

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


Another solution is to use ar, and then refer to the implementation of gcc-ar. When lto is turned on, xmake internally finds liblto_plugin.so and passes it to ar.

But I don’t know if it is compatible with higher versions. You can manually test and verify it first. If it is ok, I can try to change it like this.

ar rcsT --plugin /usr/libexec/gcc/x86_64-redhat-linux/5.3.1/liblto_plugin.so library.a library.o

You can add it manually. The generation is normal. It’s just that this library is troublesome to find. /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar -cr \ build/cross/armv7/releasedbg/libdev8030.a build/.objs/dev8030/cross/armv7/releasedbg/daemon/dev8030/dev8030.c.o \ build/.objs/dev8030/cross/armv7/releasedbg/daemon/dev8030/hotplug_rpc.c.o \ --plug=/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/libexec/gcc/arm-linux-gnueabihf/5.4.1/liblto_plugin.so

ririyeye commented 4 months ago

还有一点不太确定是cmake类型的包 怎么去传递这个--plug

waruqi commented 4 months ago

路径是能找到了,你可以试试 https://github.com/xmake-io/xmake/pull/5087

不过目前只能对 target 生效,不支持 package 和 ranlib 。。还得想办法再改进

waruqi commented 4 months ago

还有一点不太确定是cmake类型的包 怎么去传递这个--plug

能传,得包里面处理,不过暂时还没空弄

ririyeye commented 4 months ago

target 是正常的 如果没时间弄 package那就先把 package 的 -flto传递关掉 不然package会出问题

configure
{
    network = private
    proxy_pac = pac.lua
    theme = default
}
checking for architecture ... arm
checking for unzip ... /usr/bin/unzip
checking for git ... /usr/bin/git
checking for gzip ... /usr/bin/gzip
checking for tar ... /usr/bin/tar
finding local_libusb from xmake ..
checking for xmake::local_libusb ... no
finding local_libusb from vcpkg ..
checking for brew ... no
finding local_libusb from conan ..
checking for local_libusb ... no
checking for 7z ... /usr/bin/7z
/usr/bin/7z x -y libusb-cmake.7z -osource.tmp

7-Zip 23.01 (x64) : Copyright (c) 1999-2023 Igor Pavlov : 2023-06-20
 64-bit locale=en_US.UTF-8 Threads:4 OPEN_MAX:1048576

Scanning the drive for archives:
1 file, 836124 bytes (817 KiB)

Extracting archive: libusb-cmake.7z
--
Path = libusb-cmake.7z
Type = 7z
Physical Size = 836124
Headers Size = 2796
Method = LZMA2:3m
Solid = +
Blocks = 1

Everything is Ok

Folders: 38
Files: 178
Size:       2351452
Compressed: 836124
  => download /home/wangyang/wine/libusb-cmake.7z .. ok
checking for arm-linux-gnueabihf-gcc ... /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
checking for the c compiler (cc) ... arm-linux-gnueabihf-gcc
checking for arm-linux-gnueabihf-gcc ... /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
checking for the c++ compiler (cxx) ... arm-linux-gnueabihf-gcc
checking for arm-linux-gnueabihf-gcc ... /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
checking for the assember (as) ... arm-linux-gnueabihf-gcc
checking for arm-linux-gnueabihf-ar ... /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar
checking for the static library archiver (ar) ... arm-linux-gnueabihf-ar
checking for arm-linux-gnueabihf-g++ ... /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
checking for the linker (ld) ... arm-linux-gnueabihf-g++
checking for arm-linux-gnueabihf-ranlib ... /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib
checking for the archive index generator (ranlib) ... arm-linux-gnueabihf-ranlib
checking for /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc ... ok
checking for flags (-fPIC) ... ok
> arm-linux-gnueabihf-gcc "-fPIC"
checking for flags (-fPIC) ... ok
> arm-linux-gnueabihf-gcc "-fPIC"
checking for flags (-fPIC) ... ok
> arm-linux-gnueabihf-gcc "-fPIC"
checking for /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ ... ok
checking for flags (-fPIC) ... ok
> arm-linux-gnueabihf-g++ "-fPIC"
checking for arm-linux-gnueabihf-g++ ... /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
checking for the shared library linker (sh) ... arm-linux-gnueabihf-g++
checking for flags (-fPIC) ... ok
> arm-linux-gnueabihf-g++ "-fPIC" "-shared"
checking for cmake ... /usr/bin/cmake
/usr/bin/cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DLIBUSB_ENABLE_UDEV=OFF -DCMAKE_INSTALL_PREFIX=/home/wangyang/wine/cache/.xmake/packages/l/local_libusb/1.0.26/57dc0af2bc7743caa1159de1558bf9c5 -DCMAKE_INSTALL_LIBDIR:PATH=lib -G "Unix Makefiles" -DCMAKE_STATIC_LINKER_FLAGS= -DCMAKE_CXX_COMPILER=/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -DCMAKE_C_FLAGS=-flto -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH -DCMAKE_FIND_USE_CMAKE_SYSTEM_PATH=0 -DCMAKE_ASM_COMPILER=/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -DCMAKE_FIND_ROOT_PATH=/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf -DCMAKE_SHARED_LINKER_FLAGS=-flto -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_EXE_LINKER_FLAGS=-flto -DCMAKE_C_COMPILER=/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -DCMAKE_FIND_USE_INSTALL_PREFIX=0 -DCMAKE_CXX_FLAGS=-flto -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH -DCMAKE_OSX_SYSROOT= -DCMAKE_RANLIB=/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib "-DCMAKE_CXX_LINK_EXECUTABLE=/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>" -DCMAKE_AR=/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar "-DCMAKE_C_FLAGS_RELEASE=-flto -O3 -DNDEBUG" -DCMAKE_STATIC_LINKER_FLAGS_RELEASE= -DCMAKE_EXE_LINKER_FLAGS_RELEASE=-flto -DCMAKE_SHARED_LINKER_FLAGS_RELEASE=-flto "-DCMAKE_CXX_FLAGS_RELEASE=-flto -O3 -DNDEBUG" /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source
-- The C compiler identification is GNU 5.4.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for pthread_condattr_setclock
-- Looking for pthread_condattr_setclock - not found
-- Looking for pthread_setname_np
-- Looking for pthread_setname_np - not found
-- Looking for pthread_threadid_np
-- Looking for pthread_threadid_np - not found
-- Looking for eventfd
-- Looking for eventfd - found
-- Looking for pipe2
-- Looking for pipe2 - found
-- Looking for syslog
-- Looking for syslog - found
-- Looking for include file asm/types.h
-- Looking for include file asm/types.h - found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for timerfd_create
-- Looking for timerfd_create - found
-- Looking for nfds_t
-- Looking for nfds_t - not found
-- Performing Test HAVE_STRUCT_TIMESPEC
-- Performing Test HAVE_STRUCT_TIMESPEC - Success
-- Performing Test HAVE_VISIBILITY
-- Performing Test HAVE_VISIBILITY - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done (2.2s)
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_ASM_COMPILER
    CMAKE_CXX_COMPILER
    CMAKE_CXX_FLAGS
    CMAKE_CXX_FLAGS_RELEASE
    CMAKE_CXX_LINK_EXECUTABLE
    CMAKE_FIND_ROOT_PATH
    CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
    HAVE_FLAG_SEARCH_PATHS_FIRST

-- Build files have been written to: /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2
make -j6 VERBOSE=1
/usr/bin/cmake -S/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source -B/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/CMakeFiles /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2//CMakeFiles/progress.marks
make  -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2'
make  -f CMakeFiles/usb-1.0.dir/build.make CMakeFiles/usb-1.0.dir/depend
make[2]: Entering directory '/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2'
cd /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2 /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2 /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/CMakeFiles/usb-1.0.dir/DependInfo.cmake "--color="
make[2]: Leaving directory '/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2'
make  -f CMakeFiles/usb-1.0.dir/build.make CMakeFiles/usb-1.0.dir/build
make[2]: Entering directory '/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2'
[  9%] Building C object CMakeFiles/usb-1.0.dir/libusb/libusb/core.c.o
[ 18%] Building C object CMakeFiles/usb-1.0.dir/libusb/libusb/io.c.o
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -D_GNU_SOURCE -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/gen_include -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os -isystem /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb -flto -flto -O3 -DNDEBUG -MD -MT CMakeFiles/usb-1.0.dir/libusb/libusb/core.c.o -MF CMakeFiles/usb-1.0.dir/libusb/libusb/core.c.o.d -o CMakeFiles/usb-1.0.dir/libusb/libusb/core.c.o -c /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/core.c
[ 27%] Building C object CMakeFiles/usb-1.0.dir/libusb/libusb/hotplug.c.o
[ 36%] Building C object CMakeFiles/usb-1.0.dir/libusb/libusb/descriptor.c.o
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -D_GNU_SOURCE -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/gen_include -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os -isystem /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb -flto -flto -O3 -DNDEBUG -MD -MT CMakeFiles/usb-1.0.dir/libusb/libusb/io.c.o -MF CMakeFiles/usb-1.0.dir/libusb/libusb/io.c.o.d -o CMakeFiles/usb-1.0.dir/libusb/libusb/io.c.o -c /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/io.c
[ 45%] Building C object CMakeFiles/usb-1.0.dir/libusb/libusb/sync.c.o
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -D_GNU_SOURCE -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/gen_include -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os -isystem /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb -flto -flto -O3 -DNDEBUG -MD -MT CMakeFiles/usb-1.0.dir/libusb/libusb/descriptor.c.o -MF CMakeFiles/usb-1.0.dir/libusb/libusb/descriptor.c.o.d -o CMakeFiles/usb-1.0.dir/libusb/libusb/descriptor.c.o -c /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/descriptor.c
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -D_GNU_SOURCE -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/gen_include -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os -isystem /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb -flto -flto -O3 -DNDEBUG -MD -MT CMakeFiles/usb-1.0.dir/libusb/libusb/hotplug.c.o -MF CMakeFiles/usb-1.0.dir/libusb/libusb/hotplug.c.o.d -o CMakeFiles/usb-1.0.dir/libusb/libusb/hotplug.c.o -c /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/hotplug.c
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -D_GNU_SOURCE -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/gen_include -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os -isystem /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb -flto -flto -O3 -DNDEBUG -MD -MT CMakeFiles/usb-1.0.dir/libusb/libusb/sync.c.o -MF CMakeFiles/usb-1.0.dir/libusb/libusb/sync.c.o.d -o CMakeFiles/usb-1.0.dir/libusb/libusb/sync.c.o -c /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/sync.c
[ 54%] Building C object CMakeFiles/usb-1.0.dir/libusb/libusb/strerror.c.o
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -D_GNU_SOURCE -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/gen_include -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os -isystem /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb -flto -flto -O3 -DNDEBUG -MD -MT CMakeFiles/usb-1.0.dir/libusb/libusb/strerror.c.o -MF CMakeFiles/usb-1.0.dir/libusb/libusb/strerror.c.o.d -o CMakeFiles/usb-1.0.dir/libusb/libusb/strerror.c.o -c /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/strerror.c
[ 63%] Building C object CMakeFiles/usb-1.0.dir/libusb/libusb/os/events_posix.c.o
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -D_GNU_SOURCE -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/gen_include -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os -isystem /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb -flto -flto -O3 -DNDEBUG -MD -MT CMakeFiles/usb-1.0.dir/libusb/libusb/os/events_posix.c.o -MF CMakeFiles/usb-1.0.dir/libusb/libusb/os/events_posix.c.o.d -o CMakeFiles/usb-1.0.dir/libusb/libusb/os/events_posix.c.o -c /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os/events_posix.c
[ 72%] Building C object CMakeFiles/usb-1.0.dir/libusb/libusb/os/threads_posix.c.o
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -D_GNU_SOURCE -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/gen_include -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os -isystem /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb -flto -flto -O3 -DNDEBUG -MD -MT CMakeFiles/usb-1.0.dir/libusb/libusb/os/threads_posix.c.o -MF CMakeFiles/usb-1.0.dir/libusb/libusb/os/threads_posix.c.o.d -o CMakeFiles/usb-1.0.dir/libusb/libusb/os/threads_posix.c.o -c /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os/threads_posix.c
[ 81%] Building C object CMakeFiles/usb-1.0.dir/libusb/libusb/os/linux_usbfs.c.o
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -D_GNU_SOURCE -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/gen_include -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os -isystem /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb -flto -flto -O3 -DNDEBUG -MD -MT CMakeFiles/usb-1.0.dir/libusb/libusb/os/linux_usbfs.c.o -MF CMakeFiles/usb-1.0.dir/libusb/libusb/os/linux_usbfs.c.o.d -o CMakeFiles/usb-1.0.dir/libusb/libusb/os/linux_usbfs.c.o -c /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os/linux_usbfs.c
[ 90%] Building C object CMakeFiles/usb-1.0.dir/libusb/libusb/os/linux_netlink.c.o
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -D_GNU_SOURCE -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/gen_include -I/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os -isystem /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb -flto -flto -O3 -DNDEBUG -MD -MT CMakeFiles/usb-1.0.dir/libusb/libusb/os/linux_netlink.c.o -MF CMakeFiles/usb-1.0.dir/libusb/libusb/os/linux_netlink.c.o.d -o CMakeFiles/usb-1.0.dir/libusb/libusb/os/linux_netlink.c.o -c /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/libusb/libusb/os/linux_netlink.c
[100%] Linking C static library libusb-1.0.a
/usr/bin/cmake -P CMakeFiles/usb-1.0.dir/cmake_clean_target.cmake
/usr/bin/cmake -E cmake_link_script CMakeFiles/usb-1.0.dir/link.txt --verbose=1
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar qc libusb-1.0.a "CMakeFiles/usb-1.0.dir/libusb/libusb/core.c.o" "CMakeFiles/usb-1.0.dir/libusb/libusb/descriptor.c.o" "CMakeFiles/usb-1.0.dir/libusb/libusb/hotplug.c.o" "CMakeFiles/usb-1.0.dir/libusb/libusb/io.c.o" "CMakeFiles/usb-1.0.dir/libusb/libusb/strerror.c.o" "CMakeFiles/usb-1.0.dir/libusb/libusb/sync.c.o" "CMakeFiles/usb-1.0.dir/libusb/libusb/os/events_posix.c.o" "CMakeFiles/usb-1.0.dir/libusb/libusb/os/threads_posix.c.o" "CMakeFiles/usb-1.0.dir/libusb/libusb/os/linux_usbfs.c.o" "CMakeFiles/usb-1.0.dir/libusb/libusb/os/linux_netlink.c.o"
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar: CMakeFiles/usb-1.0.dir/libusb/libusb/core.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar: CMakeFiles/usb-1.0.dir/libusb/libusb/descriptor.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar: CMakeFiles/usb-1.0.dir/libusb/libusb/hotplug.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar: CMakeFiles/usb-1.0.dir/libusb/libusb/io.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar: CMakeFiles/usb-1.0.dir/libusb/libusb/strerror.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar: CMakeFiles/usb-1.0.dir/libusb/libusb/sync.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar: CMakeFiles/usb-1.0.dir/libusb/libusb/os/events_posix.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar: CMakeFiles/usb-1.0.dir/libusb/libusb/os/threads_posix.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar: CMakeFiles/usb-1.0.dir/libusb/libusb/os/linux_usbfs.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar: CMakeFiles/usb-1.0.dir/libusb/libusb/os/linux_netlink.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib libusb-1.0.a
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: core.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: descriptor.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: hotplug.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: io.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: strerror.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: sync.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: events_posix.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: threads_posix.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: linux_usbfs.c.o: plugin needed to handle lto object
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib: linux_netlink.c.o: plugin needed to handle lto object
make[2]: Leaving directory '/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2'
[100%] Built target usb-1.0
make[1]: Leaving directory '/home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2'
/usr/bin/cmake -E cmake_progress_start /home/wangyang/wine/cache/.xmake/cache/packages/2405/l/local_libusb/1.0.26/source/build_57dc0af2/CMakeFiles 0
make install
[100%] Built target usb-1.0
Install the project...
-- Install configuration: "Release"
-- Installing: /home/wangyang/wine/cache/.xmake/packages/l/local_libusb/1.0.26/57dc0af2bc7743caa1159de1558bf9c5/lib/libusb-1.0.a
-- Installing: /home/wangyang/wine/cache/.xmake/packages/l/local_libusb/1.0.26/57dc0af2bc7743caa1159de1558bf9c5/include/libusb-1.0/libusb.h
finding local_libusb from xmake ..
checking for xmake::local_libusb ... local_libusb 1.0.26
{ 
  sysincludedirs = { 
    "/home/wangyang/wine/cache/.xmake/packages/l/local_libusb/1.0.26/57dc0af2bc7743caa1159de1558bf9c5/include",
    "/home/wangyang/wine/cache/.xmake/packages/l/local_libusb/1.0.26/57dc0af2bc7743caa1159de1558bf9c5/include/libusb-1.0" 
  },
  linkdirs = { 
    "/home/wangyang/wine/cache/.xmake/packages/l/local_libusb/1.0.26/57dc0af2bc7743caa1159de1558bf9c5/lib" 
  },
  links = { 
    "usb-1.0" 
  },
  syslinks = "pthread",
  static = true,
  libfiles = { 
    "/home/wangyang/wine/cache/.xmake/packages/l/local_libusb/1.0.26/57dc0af2bc7743caa1159de1558bf9c5/lib/libusb-1.0.a" 
  },
  version = "1.0.26" 
}

patching /home/wangyang/wine/cache/.xmake/packages/l/local_libusb/1.0.26/57dc0af2bc7743caa1159de1558bf9c5/lib/pkgconfig/local_libusb.pc ..
  => install local_libusb 1.0.26 .. ok
configure
{
    proxy_pac = pac.lua
    sdk = /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf
    network = private
    mode = release
    kind = static
    host = linux
    arch = arm
    buildir = build
    theme = default
    ccache = true
    ndk_stdcxx = true
    plat = cross
    target_os = linux
}
checking for flags (-flto) ... ok
> arm-linux-gnueabihf-gcc "-flto"
[ 50%]: cache compiling.release test.cpp
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -c -flto -o build/.objs/test/cross/arm/release/test.cpp.o test.cpp
checking for flags (-MMD -MF) ... ok
> arm-linux-gnueabihf-gcc "-MMD" "-MF" "/dev/null"
checking for flags (-fdiagnostics-color=always) ... ok
> arm-linux-gnueabihf-gcc "-fdiagnostics-color=always"
checking for the static library archiver (ar) ... arm-linux-gnueabihf-ar
[ 62%]: archiving.release libtest.a
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar -cr --plugin /home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/5.4.1/liblto_plugin.so build/cross/arm/release/libtest.a build/.objs/test/cross/arm/release/test.cpp.o
[ 75%]: cache compiling.release main.cpp
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -c -isystem /home/wangyang/wine/cache/.xmake/packages/l/local_libusb/1.0.26/57dc0af2bc7743caa1159de1558bf9c5/include -isystem /home/wangyang/wine/cache/.xmake/packages/l/local_libusb/1.0.26/57dc0af2bc7743caa1159de1558bf9c5/include/libusb-1.0 -flto -o build/.objs/main/cross/arm/release/main.cpp.o main.cpp
checking for flags (-flto) ... ok
> arm-linux-gnueabihf-g++ "-flto"
[ 87%]: linking.release main
/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -o build/cross/arm/release/main build/.objs/main/cross/arm/release/main.cpp.o -L/home/wangyang/wine/cache/.xmake/packages/l/local_libusb/1.0.26/57dc0af2bc7743caa1159de1558bf9c5/lib -Lbuild/cross/arm/release -lusb-1.0 -ltest -lpthread -flto
/tmp/ccne2hBK.ltrans0.ltrans.o: In function `main':
<artificial>:(.text+0xa): undefined reference to `libusb_init'
collect2: error: ld returned 1 exit status
error: @programdir/core/main.lua:329: @programdir/actions/build/main.lua:148: @programdir/modules/async/runjobs.lua:322: @programdir/actions/build/kinds/binary.lua:53: @programdir/core/sandbox/modules/os.lua:378: execv(/home/wangyang/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -o build/cross/arm/release/main build/.objs/main/cross/arm/release/main.cpp.o -L/home/wangyang/wine/cache/.xmake/packages/l/local_libusb/1.0.26/57dc0af2bc7743caa1159de1558bf9c5/lib -Lbuild/cross/arm/release -lusb-1.0 -ltest -lpthread -flto) failed(1)
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:973]:
    [@programdir/core/sandbox/modules/os.lua:378]: in function 'execv'
    [@programdir/modules/core/tools/gcc.lua:565]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]:
    [@programdir/core/tool/linker.lua:221]: in function 'link'
    [@programdir/actions/build/kinds/binary.lua:53]: in function 'callback'
    [@programdir/modules/core/project/depend.lua:217]: in function 'on_changed'
    [@programdir/actions/build/kinds/binary.lua:41]: in function '_do_link_target'
    [@programdir/actions/build/kinds/binary.lua:83]:
    [@programdir/actions/build/kinds/binary.lua:110]: in function '_link_target'
    [@programdir/actions/build/kinds/binary.lua:138]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:238]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [@programdir/modules/async/runjobs.lua:220]: in function 'cotask'
    [@programdir/core/base/scheduler.lua:406]:

stack traceback:
        [C]: in function 'error'
        @programdir/core/base/os.lua:973: in function 'base/os.raiselevel'
        (...tail calls...)
        @programdir/core/main.lua:329: in upvalue 'cotask'
        @programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399>
error: please run `$xmake build [target]` to build the following targets first:
  -> main
Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


Another thing I'm not sure about is the cmake type package. How to pass this --plug

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


The path can be found, you can try https://github.com/xmake-io/xmake/pull/5087

However, it currently only takes effect on target, and package and ranlib are not supported. . We still have to think of ways to improve it.

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


Another thing I'm not sure about is the cmake type package. How to pass this --plug

It can be transferred, but it needs to be processed in the package, but I haven’t had time to do it yet.

waruqi commented 4 months ago

老版本的ar对flto有问题需 要用gcc-ar替代 ranlib应该用gcc-ranlib替代

你能确定是哪个版本以下才开始有这个问题的么。

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


Old versions of ar have problems with flto and need to use gcc-ar instead of ranlib. gcc-ranlib should be used instead.

Can you determine which version this problem started to occur from?

ririyeye commented 4 months ago

老版本的ar对flto有问题需 要用gcc-ar替代 ranlib应该用gcc-ranlib替代

你能确定是哪个版本以下才开始有这个问题的么。

手里的arm-none-linux-eabihf 从5.4 到10.3版本都不行... 手里没有更高版本了

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


The old version of ar has problems with flto and needs to be replaced by gcc-ar. Ranlib should be replaced by gcc-ranlib.

Can you determine which version or later this problem started to occur?

The arm-none-linux-eabihf in my hand does not work with versions 5.4 to 10.3... There is no updated version in my hand.

waruqi commented 4 months ago

现在这个 patch 应该差不多了。。https://github.com/xmake-io/xmake/pull/5087

ririyeye commented 4 months ago

现在这个 patch 应该差不多了。。#5087

试过了 可以package都正常了

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


The patch should be almost ready now. . #5087

I tried it and the package works fine.