VFPv1 Obsolete VFPv2 An optional extension to the ARM instruction set in the ARMv5TE, ARMv5TEJ and ARMv6 architectures. VFPv2 has 16 64bit FPU registers. VFPv3 or VFPv3-D32 Implemented on most Cortex-A8 and A9 ARMv7 processors. It is backwards compatible with VFPv2, except that it cannot trap floating-point exceptions. VFPv3 has 32 64bit FPU registers as standard, adds VCVT instructions to convert between scalar, float and double, adds immediate mode to VMOV such that constants can be loaded into FPU registers. VFPv3-D16 As above, but with only 16 64-bit FPU registers. Implemented on Cortex-R4 and R5 processors and the Tegra 2 (Cortex-A9). VFPv3-F16 Uncommon; it supports IEEE754-2008 half-precision (16-bit) floating point as a storage format. VFPv4 or VFPv4-D32 Implemented on Cortex-A12 and A15 ARMv7 processors, Cortex-A7 optionally has VFPv4-D32 in the case of an FPU with Neon.[110] VFPv4 has 32 64-bit FPU registers as standard, adds both half-precision support as a storage format and fused multiply-accumulate instructions to the features of VFPv3. VFPv4-D16 As above, but it has only 16 64-bit FPU registers. Implemented on Cortex-A5 and A7 processors in the case of an FPU without Neon.[110] VFPv5-D16-M Implemented on Cortex-M7 when single and double-precision floating-point core option exists.
In file included from /usr/include/features.h:448, from /usr/include/arm-linux-gnueabihf/bits/libc-header-start.h:33, from /usr/include/stdlib.h:25, from include/darknet.h:12, from ./src/activations.h:3, from ./src/gemm.h:3, from ./src/gemm.c:1: /usr/include/arm-linux-gnueabihf/gnu/stubs.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory # include <gnu/stubs-soft.h> ^~~~~~~~~~~~~~~~~~ compilation terminated.
warning: ld-linux.so.3, needed by libidontknow.so, not found (try using -rpath or -rpath-link)
정작 실행했을 경우 해결이 되지 않고 특정 라이브러리를 불러오는데 에러가 발생을 했다고만 간략하게 나온다.
./sample: error while loading shared libraries: libidontknow.so: internal error
무슨 문제가 있나 곰곰히 고민을 해보니 softfp와 hardfp의 차이인것 같아서 검색해보니
ABI가 달라서 두개를 혼용할 수 없는게 문제인 것으로 보이는데
그렇게 따지면.. ld-linux.so.3를 찾아서 넣는게 오히려 빠른 해결 책이 아닐까 생각이 된다.
좀 더 근원적으로는, 사용하려는 libidontknow.so를 softfp가 아닌 hardfp로 빌드하는게 가장 좋긴 하겠지만 말이다.
+
호출 규약이 다르다..
soft : floating-point 연산을 위한 라이브러리 콜을 포함하도록 gcc 가 컴파일 결과를 만들어낸다. softfp : hardware floating-point instruction 을 생성하도록 하지만, 여전히 soft-float 호출 규약(calling convention)을 사용한다. hard : floating-point instructions 을 생성하고 FPU 특화된 호출 규약(calling convention)을 사용한다.
Applications, which are built under “hardfp” option, cannot work under Linux, that was compiled under “softfp” – because different ABI conventions; function parameters transfer are different : the soft float conventions assume passing floats through general purpose (integer) registers, but “hardfp” uses the floating point register.
arm
hard-float ABI, BE32: /lib/ld-linux-armhf.so.3
hard-float ABI, BE8: /lib/ld-linux-armhf.so.3
hard-float ABI, LE: /lib/ld-linux-armhf.so.3
soft-float ABI, BE32: /lib/ld-linux.so.3
soft-float ABI, BE8: /lib/ld-linux.so.3
soft-float ABI, LE: /lib/ld-linux.so.3
(The ARM soft-float ABI can be used with both hard and soft-float code. ARM supports two variants of big-endian operation, (on newer processors) BE8 and (on older processors) BE32, which are the same at .o level but incompatible for linked executables and shared libraries.)
softfp는 hardware float point 를 사용하지만 함수 호출 방식은 soft 방식을 쓴다고 보면 될 듯?
-mfloat-abi=name Specifies which floating-point ABI to use. Permissible values are: ‘soft’, ‘softfp’ and ‘hard’.
Specifying ‘soft’ causes GCC to generate output containing library calls for floating-point operations. ‘softfp’ allows the generation of code using hardware floating-point instructions, but still uses the soft-float calling conventions. ‘hard’ allows generation of floating-point instructions and uses FPU-specific calling conventions.
The default depends on the specific target configuration. Note that the hard-float and soft-float ABIs are not link-compatible; you must compile your entire program with the same ABI, and link with a compatible set of libraries.
아무튼 컴파일러가 multilib을 지원하면 softfp를 쓰라는데 반대로 multilib을 지원하지 않으면 soft, hard만 지원한다는 건가?
If the compiler has multilib enabled (you can tell with -print-multi-lib) then you can use -mfloat-abi=softfp, but if not then that option won't help you much: gcc will happily generate softfp code, but then there'll be no compatible libgcc to link against.