klzgrad / naiveproxy

Make a fortune quietly
BSD 3-Clause "New" or "Revised" License
6.67k stars 885 forks source link

Failed to build on a few openwrt targets #235

Closed moetayuko closed 3 years ago

moetayuko commented 3 years ago
2021-10-22T19:51:46.8316225Z FAILED: obj/base/third_party/symbolize/symbolize/symbolize.o 
2021-10-22T19:51:46.8333547Z ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/base/third_party/symbolize/symbolize/symbolize.o.d -DOFFICIAL_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -D_LIBCPP_HAS_MUSL_LIBC -D__UCLIBC__ -D__MUSL__ -DCR_CLANG_REVISION=\"llvmorg-14-init-3191-g0e03450a-1\" -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -DCR_LIBCXX_REVISION=79a2e924d96e2fc1e4b937c42efd08898fa472d7 -DCR_SYSROOT_HASH=11d6f690ca49e8ba01a1d8c5346cedad2cf308fd -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../.. -Igen -I../../buildtools/third_party/libc++ -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -flto=thin -fsplit-lto-unit -fwhole-program-vtables -fcomplete-member-pointers --target=arm-openwrt-linux-muslgnueabi -march= -mfloat-abi=hard -mcpu=arm1176jzf-s -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -mfpu=vfp -mthumb -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-omit-frame-pointer -g0 -ftrivial-auto-var-init=pattern -fprofile-instr-use=../../chrome/build/pgo_profiles/chrome-linux-4638-1634308623-72bf2d0e0b11b9cb785718016169434ba1d25ee3.profdata -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date -Wno-backend-plugin -fvisibility=hidden -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang raw-ptr-template-as-trivial-member -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wall -Wno-unused-variable -Wno-c++11-narrowing -Wno-misleading-indentation -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-builtin-assume-aligned-alignment -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../../../../../staging_dir/toolchain-arm_arm1176jzf-s+vfp_gcc-8.4.0_musl_eabi -fvisibility-inlines-hidden -c ../../base/third_party/symbolize/symbolize.cc -o obj/base/third_party/symbolize/symbolize/symbolize.o
2021-10-22T19:51:46.8348571Z In file included from ../../base/third_party/symbolize/symbolize.cc:61:
2021-10-22T19:51:46.8349350Z In file included from ../../buildtools/third_party/libc++/trunk/include/algorithm:653:
2021-10-22T19:51:46.8350154Z In file included from ../../buildtools/third_party/libc++/trunk/include/memory:690:
2021-10-22T19:51:46.8351083Z In file included from ../../buildtools/third_party/libc++/trunk/include/__memory/shared_ptr.h:30:
2021-10-22T19:51:46.8352485Z ../../buildtools/third_party/libc++/trunk/include/atomic:2796:16: error: use of undeclared identifier '__libcpp_signed_lock_free'; did you mean '__libcpp_aligned_free'?
2021-10-22T19:51:46.8353475Z typedef atomic<__libcpp_signed_lock_free> atomic_signed_lock_free;
2021-10-22T19:51:46.8353981Z                ^
2021-10-22T19:51:46.8354796Z ../../buildtools/third_party/libc++/trunk/include/new:324:6: note: '__libcpp_aligned_free' declared here
2021-10-22T19:51:46.8355516Z void __libcpp_aligned_free(void* __ptr) {
2021-10-22T19:51:46.8355910Z      ^
2021-10-22T19:51:46.8356429Z In file included from ../../base/third_party/symbolize/symbolize.cc:61:
2021-10-22T19:51:46.8357554Z In file included from ../../buildtools/third_party/libc++/trunk/include/algorithm:653:
2021-10-22T19:51:46.8358352Z In file included from ../../buildtools/third_party/libc++/trunk/include/memory:690:
2021-10-22T19:51:46.8359176Z In file included from ../../buildtools/third_party/libc++/trunk/include/__memory/shared_ptr.h:30:
2021-10-22T19:51:46.8360160Z ../../buildtools/third_party/libc++/trunk/include/atomic:2796:16: error: template argument for template type parameter must be a type
2021-10-22T19:51:46.8361061Z typedef atomic<__libcpp_signed_lock_free> atomic_signed_lock_free;
2021-10-22T19:51:46.8361572Z                ^~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-22T19:51:46.8362226Z ../../buildtools/third_party/libc++/trunk/include/atomic:1779:17: note: template parameter is declared here
2021-10-22T19:51:46.8362905Z template <class _Tp>
2021-10-22T19:51:46.8363268Z                 ^
2021-10-22T19:51:46.8364337Z ../../buildtools/third_party/libc++/trunk/include/atomic:2797:16: error: use of undeclared identifier '__libcpp_unsigned_lock_free'; did you mean '__libcpp_aligned_free'?
2021-10-22T19:51:46.8365355Z typedef atomic<__libcpp_unsigned_lock_free> atomic_unsigned_lock_free;
2021-10-22T19:51:46.8365884Z                ^
2021-10-22T19:51:46.8366670Z ../../buildtools/third_party/libc++/trunk/include/new:324:6: note: '__libcpp_aligned_free' declared here
2021-10-22T19:51:46.8367370Z void __libcpp_aligned_free(void* __ptr) {
2021-10-22T19:51:46.8367773Z      ^
2021-10-22T19:51:46.8368287Z In file included from ../../base/third_party/symbolize/symbolize.cc:61:
2021-10-22T19:51:46.8369059Z In file included from ../../buildtools/third_party/libc++/trunk/include/algorithm:653:
2021-10-22T19:51:46.8369849Z In file included from ../../buildtools/third_party/libc++/trunk/include/memory:690:
2021-10-22T19:51:46.8370658Z In file included from ../../buildtools/third_party/libc++/trunk/include/__memory/shared_ptr.h:30:
2021-10-22T19:51:46.8371638Z ../../buildtools/third_party/libc++/trunk/include/atomic:2797:16: error: template argument for template type parameter must be a type
2021-10-22T19:51:46.8372557Z typedef atomic<__libcpp_unsigned_lock_free> atomic_unsigned_lock_free;
2021-10-22T19:51:46.8373097Z                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-10-22T19:51:46.8373754Z ../../buildtools/third_party/libc++/trunk/include/atomic:1779:17: note: template parameter is declared here
2021-10-22T19:51:46.8374424Z template <class _Tp>
2021-10-22T19:51:46.8374781Z                 ^
2021-10-22T19:51:46.8375136Z 4 errors generated.
2021-10-22T19:51:47.7872332Z make[3]: *** [Makefile:135: /tmp/tmp.ACcl5hEl7M/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/naiveproxy-95.0.4638.54-1/.built] Error 1
2021-10-22T19:51:47.7873446Z [8/2141] CC obj/base/third_party/libevent/libevent/log.o
2021-10-22T19:51:47.7875591Z make[2]: *** [package/Makefile:114: package/feeds/passwall/naiveproxy/compile] Error 1
2021-10-22T19:51:47.7876757Z [9/2141] CC obj/base/third_party/libevent/libevent/http.o
2021-10-22T19:51:47.7878353Z make[2]: *** Waiting for unfinished jobs....
2021-10-22T19:51:47.7878990Z ninja: build stopped: subcommand failed.
2021-10-22T19:51:47.7880279Z make[3]: Leaving directory '/home/runner/cache/feeds/passwall/naiveproxy'
2021-10-22T19:51:47.7881290Z time: package/feeds/passwall/naiveproxy/compile#5.80#2.19#26.48
2021-10-22T19:51:47.7882377Z     ERROR: package/feeds/passwall/naiveproxy failed to build.

A solution was proposed https://github.com/klzgrad/naiveproxy/commit/3697f68d214ad6bca24bea014cb37bcfff584418 but dropped in current rebase for unknown reason, maybe add it back?

Affected targets, they're all marked as not supported in https://github.com/klzgrad/naiveproxy/wiki/OpenWrt-Support, but at least arm_xscale does compile with the patch mentioned above: target sdk
arm_arm1176jzf-s_vfp https://downloads.openwrt.org/releases/21.02.0/targets/bcm27xx/bcm2708/openwrt-sdk-21.02.0-bcm27xx-bcm2708_gcc-8.4.0_musl_eabi.Linux-x86_64.tar.xz
arm_xscale https://downloads.openwrt.org/releases/21.02.0/targets/kirkwood/generic/openwrt-sdk-21.02.0-kirkwood_gcc-8.4.0_musl_eabi.Linux-x86_64.tar.xz
arm_mpcore https://downloads.openwrt.org/releases/21.02.0/targets/oxnas/ox820/openwrt-sdk-21.02.0-oxnas-ox820_gcc-8.4.0_musl_eabi.Linux-x86_64.tar.xz
klzgrad commented 3 years ago

It was dropped because there were other compile errors beyond this that couldn't be fixed.

Maybe it is different for openwrt 21.02. But does a 21.02 binary work on 19 or older openwrt?

klzgrad commented 3 years ago

arm_xscale doesn't build with 21.02 with the patch

Some warnings

[44/2141] CXX obj/buildtools/third_party/libc++abi/libc++abi/cxa_handlers.o
In file included from ../../buildtools/third_party/libc++abi/trunk/src/cxa_handlers.cpp:20:
../../buildtools/third_party/libc++abi/trunk/src/include/atomic_support.h:78:12: warning: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Watomic-alignment]
    return __atomic_load_n(__val, __order);
           ^
../../buildtools/third_party/libc++abi/trunk/src/include/atomic_support.h:94:12: warning: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Watomic-alignment]
    return __atomic_exchange_n(__target, __value, __order);
           ^
2 warnings generated.

Other errors:

[469/2141] CXX obj/base/base/push_registers_asm.o
error: registers must be in range r0-r7 or lr
  push {r3-r11, lr}                                  
       ^
error: instruction variant requires ARMv6 or later
  mov r3, r2                                         
  ^
error: registers must be in range r0-r7 or lr
  push {r3-r11, lr}                                  
       ^
error: instruction variant requires ARMv6 or later
  mov r3, r2                                         
  ^
...
ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qadd r0, r0, r1
        ^

<inline asm>:1:2: instruction requires: arm-mode
        qadd r0, r0, r1
        ^

<inline asm>:1:2: instruction requires: dsp thumb2
        qadd r0, r0, r1
moetayuko commented 3 years ago

Can you please double-check? I tried again with the patch on all 3 targets and they all build fine. Here're the ipks: naive.zip

btw I use makefile from https://github.com/xiaorouji/openwrt-passwall/tree/main/naiveproxy

moetayuko commented 3 years ago

Meanwhile, arm_arm926ej-s build is also fixed with that commit. sdk: https://openwrt.proxy.ustclug.org/releases/21.02.0/targets/mxs/generic/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64.tar.xz

klzgrad commented 3 years ago
tar xf openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64.tar.xz 
cd openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/
./scripts/feeds update base packages
echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall.git^2ef23d007b18b15fc18ec901b7d501d0bb69671a' >>feeds.conf.default 
./scripts/feeds update passwall
./scripts/feeds install naiveproxy
make menuconfig
make -j1 V=s
...
ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qadd r0, r0, r1
...
    ERROR: package/feeds/passwall/naiveproxy failed to build.
moetayuko commented 3 years ago

Our workflows are slightly different.

tar -xf openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64.tar.xz 
cd openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64
echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall' >> feeds.conf.default
scripts/feeds update -a
scripts/feeds install -a -p passwall
make defconfig
# disable CONFIG_AUTOREBUILD and CONFIG_AUTOREMOVE .config for easier patch work
make -j$(nproc) package/feeds/passwall/naiveproxy/compile
# it'll download source and build until errors. apply the patch and make again
moetayuko commented 3 years ago
tar xf openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64.tar.xz 
cd openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/
./scripts/feeds update base packages
echo 'src-git passwall https://github.com/xiaorouji/openwrt-passwall.git^2ef23d007b18b15fc18ec901b7d501d0bb69671a' >>feeds.conf.default 
./scripts/feeds update passwall
./scripts/feeds install naiveproxy
make menuconfig
make -j1 V=s
...
ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qadd r0, r0, r1
...
    ERROR: package/feeds/passwall/naiveproxy failed to build.

Just tried with your commands, still built fine here. Would this be relevant to the host environment? My host os is Debian 11 and I build in this Debian 10 based docker image, Ubuntu 20.04 should be fine as well.

klzgrad commented 3 years ago

obj/base/base/push_registers_asm.o的编译指令是否如下:

../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/base/base/push_registers_asm.o.d -DPA_PCSCAN_STACK_SUPPORTED -DUSE_SYMBOLIZE -DOFFICIAL_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -D_LIBCPP_HAS_MUSL_LIBC -D__UCLIBC__ -D__MUSL__ -DCR_CLANG_REVISION=\"llvmorg-14-init-3191-g0e03450a-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -DCR_LIBCXX_REVISION=79a2e924d96e2fc1e4b937c42efd08898fa472d7 -DCR_SYSROOT_HASH=11d6f690ca49e8ba01a1d8c5346cedad2cf308fd -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBASE_IMPLEMENTATION -I../.. -Igen -I../../buildtools/third_party/libc++ -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -flto=thin -fsplit-lto-unit -fwhole-program-vtables -fcomplete-member-pointers --target=arm-openwrt-linux-muslgnueabi -march= -mfloat-abi=soft -mcpu=arm926ej-s -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -mthumb -Wall -Wextra -Wimplicit-fallthrough -Wunreachable-code-aggressive -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-builtin-assume-aligned-alignment -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -fno-omit-frame-pointer -g0 -ftrivial-auto-var-init=pattern -fprofile-instr-use=../../chrome/build/pgo_profiles/chrome-linux-4638-1634308623-72bf2d0e0b11b9cb785718016169434ba1d25ee3.profdata -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date -Wno-backend-plugin -fvisibility=hidden -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang raw-ptr-template-as-trivial-member -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -Wshadow -Wglobal-constructors -Wexit-time-destructors -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../../../../../staging_dir/toolchain-arm_arm926ej-s_gcc-8.4.0_musl_eabi -fvisibility-inlines-hidden -c ../../base/allocator/partition_allocator/starscan/stack/asm/arm/push_registers_asm.cc -o obj/base/base/push_registers_asm.o

moetayuko commented 3 years ago

好迷啊,刚-j1 V=s重新试了下,第一次编译link时失败了(以前没有发现:

[2141/2141] python "../../build/toolchain/gcc_link_wrapper.py" --output="./naive" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -fuse-ld=lld -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -flto=thin -Wl,--thinlto-jobs=all -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy=cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -Wl,-mllvm,-import-instr-limit=5 -fwhole-program-vtables -march= --target=arm-openwrt-linux-muslgnueabi -mfloat-abi=soft -no-canonical-prefixes -Wl,-O2 -Wl,--gc-sections -rdynamic -nostdlib++ --sysroot=../../../../../../staging_dir/toolchain-arm_arm926ej-s_gcc-8.4.0_musl_eabi -Wl,--lto-O0 -Wl,-z,defs -Wl,--as-needed -pie -Wl,--disable-new-dtags -o "./naive" -Wl,--start-group @"./naive.rsp"  -Wl,--end-group  -ldl -lpthread -lrt -lresolv -latomic
FAILED: naive 
python "../../build/toolchain/gcc_link_wrapper.py" --output="./naive" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -fuse-ld=lld -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -flto=thin -Wl,--thinlto-jobs=all -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy=cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -Wl,-mllvm,-import-instr-limit=5 -fwhole-program-vtables -march= --target=arm-openwrt-linux-muslgnueabi -mfloat-abi=soft -no-canonical-prefixes -Wl,-O2 -Wl,--gc-sections -rdynamic -nostdlib++ --sysroot=../../../../../../staging_dir/toolchain-arm_arm926ej-s_gcc-8.4.0_musl_eabi -Wl,--lto-O0 -Wl,-z,defs -Wl,--as-needed -pie -Wl,--disable-new-dtags -o "./naive" -Wl,--start-group @"./naive.rsp"  -Wl,--end-group  -ldl -lpthread -lrt -lresolv -latomic
ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qadd r0, r0, r2
        ^

<inline asm>:1:2: instruction requires: arm-mode
        qadd r0, r0, r2
        ^

<inline asm>:1:2: instruction requires: thumb2
        qadd r0, r0, r2
        ^

ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qadd r0, r0, r1
        ^

<inline asm>:1:2: instruction requires: arm-mode
        qadd r0, r0, r1
        ^

<inline asm>:1:2: instruction requires: thumb2
        qadd r0, r0, r1
        ^

ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qadd r0, r0, r1
        ^

<inline asm>:1:2: instruction requires: arm-mode
        qadd r0, r0, r1
        ^

<inline asm>:1:2: instruction requires: thumb2
        qadd r0, r0, r1
        ^

ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qadd r0, r0, r1
        ^

<inline asm>:1:2: instruction requires: arm-mode
        qadd r0, r0, r1
        ^

<inline asm>:1:2: instruction requires: thumb2
        qadd r0, r0, r1
        ^

ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qadd r2, r2, r3
        ^

<inline asm>:1:2: instruction requires: arm-mode
        qadd r2, r2, r3
        ^

<inline asm>:1:2: instruction requires: thumb2
        qadd r2, r2, r3
        ^

ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qadd r5, r5, r3
        ^

<inline asm>:1:2: instruction requires: arm-mode
        qadd r5, r5, r3
        ^

<inline asm>:1:2: instruction requires: thumb2
        qadd r5, r5, r3
        ^

ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qadd r3, r3, r5
        ^

<inline asm>:1:2: instruction requires: arm-mode
        qadd r3, r3, r5
        ^

<inline asm>:1:2: instruction requires: thumb2
        qadd r3, r3, r5
        ^

ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        usat r0, #31, r0
        ^

<inline asm>:1:2: instruction requires: arm-mode
        usat r0, #31, r0
        ^

<inline asm>:1:2: instruction requires: thumb2
        usat r0, #31, r0
        ^

ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        usat r1, #31, r1
        ^

<inline asm>:1:2: instruction requires: arm-mode
        usat r1, #31, r1
        ^

<inline asm>:1:2: instruction requires: thumb2
        usat r1, #31, r1
        ^

ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qsub r4, r0, r1
        ^

<inline asm>:1:2: instruction requires: arm-mode
        qsub r4, r0, r1
        ^

<inline asm>:1:2: instruction requires: thumb2
        qsub r4, r0, r1
        ^

ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qadd r4, r4, r0
        ^

<inline asm>:1:2: instruction requires: arm-mode
        qadd r4, r4, r0
        ^

<inline asm>:1:2: instruction requires: thumb2
        qadd r4, r4, r0
        ^

ld.lld: error: <inline asm>:1:2: invalid instruction, any one of the following would fix this:
        qsub r0, r4, r0
        ^

<inline asm>:1:2: instruction requires: arm-mode
        qsub r0, r4, r0
        ^

<inline asm>:1:2: instruction requires: thumb2
        qsub r0, r4, r0
        ^

ld.lld: error: <inline asm>:2:1: invalid instruction, any one of the following would fix this:
mov r7, #384
^

<inline asm>:2:9: operand must be a register in range [r0, r15]
mov r7, #384
        ^

<inline asm>:2:1: instruction requires: thumb2
mov r7, #384
^

<inline asm>:2:1: instruction requires: armv8m.base
mov r7, #384
^

clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
make[2]: Leaving directory '/home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/feeds/passwall/naiveproxy'
time: package/feeds/passwall/naiveproxy/compile#949.48#75.96#964.42
    ERROR: package/feeds/passwall/naiveproxy failed to build.
make[1]: Leaving directory '/home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64'

但什么都不改,直接重新make,然后就没报错,并且确实生成了binary,不过不知道能不能用就是

MAKEFLAGS="" /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/staging_dir/hostpkg/bin/ninja -v -j1 -C "/home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/src/out/Release" naive
ninja: Entering directory `/home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/src/out/Release'
[1/1] python "../../build/toolchain/gcc_link_wrapper.py" --output="./naive" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -fuse-ld=lld -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -flto=thin -Wl,--thinlto-jobs=all -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy=cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -Wl,-mllvm,-import-instr-limit=5 -fwhole-program-vtables -march= --target=arm-openwrt-linux-muslgnueabi -mfloat-abi=soft -no-canonical-prefixes -Wl,-O2 -Wl,--gc-sections -rdynamic -nostdlib++ --sysroot=../../../../../../staging_dir/toolchain-arm_arm926ej-s_gcc-8.4.0_musl_eabi -Wl,--lto-O0 -Wl,-z,defs -Wl,--as-needed -pie -Wl,--disable-new-dtags -o "./naive" -Wl,--start-group @"./naive.rsp"  -Wl,--end-group  -ldl -lpthread -lrt -lresolv -latomic
touch /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/.built
rm -rf /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/.pkgdir/naiveproxy.installed /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/.pkgdir/naiveproxy
mkdir -p /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/.pkgdir/naiveproxy
install -d -m0755 /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/.pkgdir/naiveproxy/usr/bin
install -m0755 /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/src/out/Release/naive /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/.pkgdir/naiveproxy/usr/bin/naive
touch /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/.pkgdir/naiveproxy.installed
mkdir -p /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/staging_dir/target-arm_arm926ej-s_musl_eabi/root-mxs/stamp
SHELL= flock /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/tmp/.root-copy.flock -c 'cp -fpR /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/.pkgdir/naiveproxy/. /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/staging_dir/target-arm_arm926ej-s_musl_eabi/root-mxs/'
touch /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/staging_dir/target-arm_arm926ej-s_musl_eabi/root-mxs/stamp/.naiveproxy_installed
mkdir -p /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/bin/targets/mxs/generic/packages /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/ipkg-arm_arm926ej-s/naiveproxy/CONTROL /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/staging_dir/target-arm_arm926ej-s_musl_eabi/pkginfo
install -d -m0755 /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/ipkg-arm_arm926ej-s/naiveproxy/usr/bin
install -m0755 /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/src/out/Release/naive /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/ipkg-arm_arm926ej-s/naiveproxy/usr/bin/naive
find /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/ipkg-arm_arm926ej-s/naiveproxy -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
export CROSS="arm-openwrt-linux-muslgnueabi-"   ; NM="arm-openwrt-linux-muslgnueabi-nm" STRIP="/home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/staging_dir/host/bin/sstrip -z" STRIP_KMOD="/home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/scripts/strip-kmod.sh" PATCHELF="/home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/staging_dir/host/bin/patchelf" /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/scripts/rstrip.sh /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/ipkg-arm_arm926ej-s/naiveproxy
rstrip.sh: /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/ipkg-arm_arm926ej-s/naiveproxy/usr/bin/naive: shared object
(cd /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/ipkg-arm_arm926ej-s/naiveproxy/CONTROL; ( echo "$CONTROL"; printf "Description: "; echo "$DESCRIPTION" | sed -e 's,^[[:space:]]*, ,g'; ) > control; chmod 644 control; ( echo "#!/bin/sh"; echo "[ \"\${IPKG_NO_SCRIPT}\" = \"1\" ] && exit 0"; echo "[ -s "\${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; echo ". \${IPKG_INSTROOT}/lib/functions.sh"; echo "default_postinst \$0 \$@"; ) > postinst; ( echo "#!/bin/sh"; echo "[ -s "\${IPKG_INSTROOT}/lib/functions.sh" ] || exit 0"; echo ". \${IPKG_INSTROOT}/lib/functions.sh"; echo "default_prerm \$0 \$@"; ) > prerm; chmod 0755 postinst prerm;  )
install -d -m0755 /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/bin/packages/arm_arm926ej-s/passwall
/home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/staging_dir/host/bin/fakeroot /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/scripts/ipkg-build -m "" /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/ipkg-arm_arm926ej-s/naiveproxy /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/bin/packages/arm_arm926ej-s/passwall
Packaged contents of /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm926ej-s_musl_eabi/naiveproxy-95.0.4638.54-1/ipkg-arm_arm926ej-s/naiveproxy into /home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/bin/packages/arm_arm926ej-s/passwall/naiveproxy_95.0.4638.54-1-2_arm_arm926ej-s.ipk
make[2]: Leaving directory '/home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64/feeds/passwall/naiveproxy'
time: package/feeds/passwall/naiveproxy/compile#2.65#1.33#2.67
make[1]: Leaving directory '/home/user/openwrt-sdk-21.02.0-mxs_gcc-8.4.0_musl_eabi.Linux-x86_64'
❯ file staging_dir/target-arm_arm926ej-s_musl_eabi/root-mxs/usr/bin/naive
staging_dir/target-arm_arm926ej-s_musl_eabi/root-mxs/usr/bin/naive: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-arm.so.1, BuildID[sha1]=20d9a217b62bde64d352b5662fb69250eaf3df32, with debug_info, not stripped

所以最终生成的玩意是个啥

klzgrad commented 3 years ago

这块我会重新弄一下

moetayuko commented 3 years ago

这块我会重新弄一下

可否说明一下大致的原因?

klzgrad commented 3 years ago

https://github.com/klzgrad/naiveproxy/releases/tag/v95.0.4638.54-2