libressl / portable

LibreSSL Portable itself. This includes the build scaffold and compatibility layer that builds portable LibreSSL from the OpenBSD source code. Pull requests or patches sent to tech@openbsd.org are welcome.
https://www.libressl.org
1.37k stars 267 forks source link

Unable to build ARM asm for Thumb-only processor (Cortex A9) #582

Open Ypnose opened 4 years ago

Ypnose commented 4 years ago

Hey, Unfortunately, I cannot build libressl for a Cortex A9 CPU (ARMADA 38x) :

$ export PATH="/build/cross-arm-turomnia/bin:${PATH}"
$ export CFLAGS="-static --static -march=armv7 -mtune=cortex-a9 -mfloat-abi=hard -mfpu=neon-vfpv3"
$ ./configure --host="armv7-linux-musleabihf" --disable-shared --enable-static
$ make

Here the result :

make[2]: Entering directory '/tmp/libressl-3.0.2/crypto'
  CPPAS    aes/libcrypto_la-aes-elf-armv4.lo
aes/aes-elf-armv4.S: Assembler messages:
aes/aes-elf-armv4.S:3: Error: selected processor does not support ARM opcodes
aes/aes-elf-armv4.S:117: Error: attempt to use an ARM instruction on a Thumb-only processor -- `sub r3,pc,#8'
aes/aes-elf-armv4.S:118: Error: attempt to use an ARM instruction on a Thumb-only processor -- `stmdb sp!,{r1,r4-r12,lr}'
aes/aes-elf-armv4.S:119: Error: attempt to use an ARM instruction on a Thumb-only processor -- `mov r12,r0'
aes/aes-elf-armv4.S:120: Error: attempt to use an ARM instruction on a Thumb-only processor -- `mov r11,r2'

The cross compiler was created with musl-cross-make and --with-arch=armv7-a --with-fpu=neon-vfpv3 options :

$ /build/cross-arm-turomnia/bin/armv7-linux-musleabihf-gcc -v
Using built-in specs.
COLLECT_GCC=/build/cross-arm-turomnia/bin/armv7-linux-musleabihf-gcc
COLLECT_LTO_WRAPPER=/build/cross-arm-turomnia/bin/../libexec/gcc/armv7-linux-musleabihf/9.2.0/lto-wrapper
Target: armv7-linux-musleabihf
Configured with: ../src_gcc/configure --enable-languages=c,c++ --with-float=hard --disable-nls --disable-shared --enable-languages=c CC='gcc -static --static' CXX='g++ -static --static' --enable-languages=c --disable-libquadmath --disable-decimal-float --disable-multilib --with-arch=armv7-a --with-fpu=neon-vfpv3 --disable-bootstrap --disable-assembly --disable-werror --target=armv7-linux-musleabihf --prefix= --libdir=/lib --disable-multilib --with-sysroot=/armv7-linux-musleabihf --enable-tls --disable-libmudflap --disable-libsanitizer --disable-gnu-indirect-function --disable-libmpx --enable-libstdcxx-time=rt --with-build-sysroot=/tmp/musl-cross-make/build/local/armv7-linux-musleabihf/obj_sysroot AR_FOR_TARGET=/tmp/musl-cross-make/build/local/armv7-linux-musleabihf/obj_binutils/binutils/ar AS_FOR_TARGET=/tmp/musl-cross-make/build/local/armv7-linux-musleabihf/obj_binutils/gas/as-new LD_FOR_TARGET=/tmp/musl-cross-make/build/local/armv7-linux-musleabihf/obj_binutils/ld/ld-new NM_FOR_TARGET=/tmp/musl-cross-make/build/local/armv7-linux-musleabihf/obj_binutils/binutils/nm-new OBJCOPY_FOR_TARGET=/tmp/musl-cross-make/build/local/armv7-linux-musleabihf/obj_binutils/binutils/objcopy OBJDUMP_FOR_TARGET=/tmp/musl-cross-make/build/local/armv7-linux-musleabihf/obj_binutils/binutils/objdump RANLIB_FOR_TARGET=/tmp/musl-cross-make/build/local/armv7-linux-musleabihf/obj_binutils/binutils/ranlib READELF_FOR_TARGET=/tmp/musl-cross-make/build/local/armv7-linux-musleabihf/obj_binutils/binutils/readelf STRIP_FOR_TARGET=/tmp/musl-cross-make/build/local/armv7-linux-musleabihf/obj_binutils/binutils/strip-new --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
Thread model: posix
gcc version 9.2.0 (GCC)
$ ls -F /build/cross-arm-turomnia/bin/
armv7-linux-musleabihf-addr2line*  armv7-linux-musleabihf-elfedit*     armv7-linux-musleabihf-gcov*       armv7-linux-musleabihf-nm*       armv7-linux-musleabihf-strings*
armv7-linux-musleabihf-ar*         armv7-linux-musleabihf-gcc*         armv7-linux-musleabihf-gcov-dump*  armv7-linux-musleabihf-objcopy*  armv7-linux-musleabihf-strip*
armv7-linux-musleabihf-as*         armv7-linux-musleabihf-gcc-9.2.0*   armv7-linux-musleabihf-gcov-tool*  armv7-linux-musleabihf-objdump*
armv7-linux-musleabihf-c++filt*    armv7-linux-musleabihf-gcc-ar*      armv7-linux-musleabihf-gprof*      armv7-linux-musleabihf-ranlib*
armv7-linux-musleabihf-cc@         armv7-linux-musleabihf-gcc-nm*      armv7-linux-musleabihf-ld*         armv7-linux-musleabihf-readelf*
armv7-linux-musleabihf-cpp*        armv7-linux-musleabihf-gcc-ranlib*  armv7-linux-musleabihf-ld.bfd*     armv7-linux-musleabihf-size*
busterb commented 4 years ago

try adding --disable-asm

Ypnose commented 4 years ago

Yes, sorry for not mentioning it in my first message, I saw it after. My question was more related to supporting Thumb-only CPUs. What is your opinion about it ?