Closed Abirdcfly closed 3 years ago
# GOOS=linux GOARM=5 CGO_ENABLED=1 GOARCH=arm CC=aarch64-linux-musl-gcc CXX=aarch64-linux-musl-g++ go build -v -ldflags "-linkmode external -extldflags -static" . runtime/cgo # runtime/cgo aarch64-linux-musl-gcc: error: unrecognized command line option '-marm' # aarch64-linux-musl-gcc -v Using built-in specs. COLLECT_GCC=aarch64-linux-musl-gcc COLLECT_LTO_WRAPPER=/usr/local/Cellar/musl-cross/0.9.9/libexec/bin/../libexec/gcc/aarch64-linux-musl/9.2.0/lto-wrapper Target: aarch64-linux-musl Configured with: ../src_gcc/configure --enable-languages=c,c++ --disable-nls --with-debug-prefix-map=/private/tmp/musl-cross-20210302-62088-nfi6zq/musl-cross-make-0.9.9= --disable-libquadmath --disable-decimal-float --disable-libitm --disable-fixed-point CXX='clang++ -fbracket-depth=512' --disable-bootstrap --disable-assembly --disable-werror --target=aarch64-linux-musl --prefix= --libdir=/lib --disable-multilib --with-sysroot=/aarch64-linux-musl --enable-tls --disable-libmudflap --disable-libsanitizer --disable-gnu-indirect-function --disable-libmpx --enable-libstdcxx-time=rt --with-build-sysroot=/private/tmp/musl-cross-20210302-62088-nfi6zq/musl-cross-make-0.9.9/build/local/aarch64-linux-musl/obj_sysroot AR_FOR_TARGET=/private/tmp/musl-cross-20210302-62088-nfi6zq/musl-cross-make-0.9.9/build/local/aarch64-linux-musl/obj_binutils/binutils/ar AS_FOR_TARGET=/private/tmp/musl-cross-20210302-62088-nfi6zq/musl-cross-make-0.9.9/build/local/aarch64-linux-musl/obj_binutils/gas/as-new LD_FOR_TARGET=/private/tmp/musl-cross-20210302-62088-nfi6zq/musl-cross-make-0.9.9/build/local/aarch64-linux-musl/obj_binutils/ld/ld-new NM_FOR_TARGET=/private/tmp/musl-cross-20210302-62088-nfi6zq/musl-cross-make-0.9.9/build/local/aarch64-linux-musl/obj_binutils/binutils/nm-new OBJCOPY_FOR_TARGET=/private/tmp/musl-cross-20210302-62088-nfi6zq/musl-cross-make-0.9.9/build/local/aarch64-linux-musl/obj_binutils/binutils/objcopy OBJDUMP_FOR_TARGET=/private/tmp/musl-cross-20210302-62088-nfi6zq/musl-cross-make-0.9.9/build/local/aarch64-linux-musl/obj_binutils/binutils/objdump RANLIB_FOR_TARGET=/private/tmp/musl-cross-20210302-62088-nfi6zq/musl-cross-make-0.9.9/build/local/aarch64-linux-musl/obj_binutils/binutils/ranlib READELF_FOR_TARGET=/private/tmp/musl-cross-20210302-62088-nfi6zq/musl-cross-make-0.9.9/build/local/aarch64-linux-musl/obj_binutils/binutils/readelf STRIP_FOR_TARGET=/private/tmp/musl-cross-20210302-62088-nfi6zq/musl-cross-make-0.9.9/build/local/aarch64-linux-musl/obj_binutils/binutils/strip-new --build=x86_64-apple-darwin20.3.0 --host=x86_64-apple-darwin20.3.0 Thread model: posix gcc version 9.2.0 (GCC)
I want to cross compile a go project to armv5. but get this error.😭
Can you tell me how do you fix it? 😀
I want to cross compile a go project to armv5. but get this error.😭