Bug 14678 - [arm] Mixing between FPA libraries and non-FPA, hardware FPU and software FPU
Summary: [arm] Mixing between FPA libraries and non-FPA, hardware FPU and software FPU
Status: NEW
Alias: None
Product: liboil
Classification: Unclassified
Component: unknown (show other bugs)
Version: unspecified
Hardware: Other All
: medium blocker
Assignee: David Schleef
QA Contact: David Schleef
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-26 02:07 UTC by Sebastian Dröge (slomo)
Modified: 2010-02-04 12:23 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Sebastian Dröge (slomo) 2008-02-26 02:07:14 UTC
Hi,
liboil 0.3.13 fails to build on Debian/arm as there is mixing between libraries that use FPA and ones that don't use FPA and mixing between libraries that use hardware FPU and software FPU.

This makes ld explode when linking:

cc -shared  .libs/liboiltmp.o -Wl,--whole-archive ./.libs/liboilfunctions.a -Wl,--no-whole-archive  -lm -lrt  -Wl,-soname -Wl,liboiltmp1.so.0 -Wl,-version-script -Wl,.libs/liboiltmp1.ver -o .libs/liboiltmp1.so.0.0.0
/usr/bin/ld: ERROR: ./.libs/liboilfunctions.a(math_vfp_asm.o) uses FPA instructions, whereas .libs/liboiltmp1.so.0.0.0 does not
/usr/bin/ld: ERROR: ./.libs/liboilfunctions.a(math_vfp_asm.o) uses hardware FP, whereas .libs/liboiltmp1.so.0.0.0 uses software FP
/usr/bin/ld: failed to merge target specific data of file ./.libs/liboilfunctions.a(math_vfp_asm.o)
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/../../../libm.so uses FPA instructions, whereas .libs/liboiltmp1.so.0.0.0 does not
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/../../../libm.so uses hardware FP, whereas .libs/liboiltmp1.so.0.0.0 uses software FP
/usr/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-linux-gnu/4.2.3/../../../libm.so
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/../../../librt.so uses FPA instructions, whereas .libs/liboiltmp1.so.0.0.0 does not
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/../../../librt.so uses hardware FP, whereas .libs/liboiltmp1.so.0.0.0 uses software FP
/usr/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-linux-gnu/4.2.3/../../../librt.so
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/libgcc.a(_divsi3.o) uses FPA instructions, whereas .libs/liboiltmp1.so.0.0.0 does not
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/libgcc.a(_divsi3.o) uses hardware FP, whereas .libs/liboiltmp1.so.0.0.0 uses software FP
/usr/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-linux-gnu/4.2.3/libgcc.a(_divsi3.o)
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/libgcc.a(_dvmd_lnx.o) uses FPA instructions, whereas .libs/liboiltmp1.so.0.0.0 does not
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/libgcc.a(_dvmd_lnx.o) uses hardware FP, whereas .libs/liboiltmp1.so.0.0.0 uses software FP
/usr/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-linux-gnu/4.2.3/libgcc.a(_dvmd_lnx.o)
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/libgcc_s.so uses FPA instructions, whereas .libs/liboiltmp1.so.0.0.0 does not
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/libgcc_s.so uses hardware FP, whereas .libs/liboiltmp1.so.0.0.0 uses software FP
/usr/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-linux-gnu/4.2.3/libgcc_s.so
/usr/bin/ld: ERROR: /lib/libc.so.6 uses FPA instructions, whereas .libs/liboiltmp1.so.0.0.0 does not
/usr/bin/ld: ERROR: /lib/libc.so.6 uses hardware FP, whereas .libs/liboiltmp1.so.0.0.0 uses software FP
/usr/bin/ld: failed to merge target specific data of file /lib/libc.so.6
/usr/bin/ld: ERROR: /lib/ld-linux.so.2 uses FPA instructions, whereas .libs/liboiltmp1.so.0.0.0 does not
/usr/bin/ld: ERROR: /lib/ld-linux.so.2 uses hardware FP, whereas .libs/liboiltmp1.so.0.0.0 uses software FP
/usr/bin/ld: failed to merge target specific data of file /lib/ld-linux.so.2
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/libgcc_s.so uses FPA instructions, whereas .libs/liboiltmp1.so.0.0.0 does not
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/libgcc_s.so uses hardware FP, whereas .libs/liboiltmp1.so.0.0.0 uses software FP
/usr/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-linux-gnu/4.2.3/libgcc_s.so
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/crtendS.o uses FPA instructions, whereas .libs/liboiltmp1.so.0.0.0 does not
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/crtendS.o uses hardware FP, whereas .libs/liboiltmp1.so.0.0.0 uses software FP
/usr/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-linux-gnu/4.2.3/crtendS.o
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/../../../crtn.o uses FPA instructions, whereas .libs/liboiltmp1.so.0.0.0 does not
/usr/bin/ld: ERROR: /usr/lib/gcc/arm-linux-gnu/4.2.3/../../../crtn.o uses hardware FP, whereas .libs/liboiltmp1.so.0.0.0 uses software FP
/usr/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-linux-gnu/4.2.3/../../../crtn.o
collect2: ld returned 1 exit status
Comment 1 Sebastian Dröge (slomo) 2008-02-26 02:09:43 UTC
Probably relevant part of configure output:

checking to see if compiler understands "-Wa,-mfpu=vfp"... yes
checking to see if compiler understands "-Wa,-mfloat-abi=softfp"... yes



And everything is compiled with "-mfpu=vfp -mfloat-abi=softfp".
Comment 2 Sebastian Dröge (slomo) 2008-02-26 02:34:37 UTC
Also the arm check in m4/as-host-defines.m4 is a bit too specific. It should
check at least armel too if I'm not mistaken...
Comment 3 Sebastian Dröge (slomo) 2008-02-26 23:08:31 UTC
Ok, so configure needs to check, additional to the check if the compiler supports these flags, that the system libraries are EABI and what else is required.
Comment 4 David Schleef 2008-03-13 14:42:50 UTC
I think using either the -mfpu=vfp or -mfloat-abi=softfp flags is incorrect, except maybe for compiling some VFP code.  Have to ping Josep Torra about this, as he wrote the VFP code.
Comment 5 Josep Torra 2008-03-13 14:58:59 UTC
Those flags should be used when liboil is crosscompiled for a target hardware that provides the vfp coprocessor, examples are TI OMAP 2420 used on nokia IT n8x0 or freescale MX.31. Adding those flags are also intended for the scalar floating point operations being done on the VFP coprocessor.



Comment 6 David Schleef 2008-03-13 19:19:36 UTC
The VFP cflags are only used for compiling VFP code now.  Should be more like x86 does things.

According to scratchbox, the ARM code compiles.  Dunno if it works, as qemu fails on liboil code.
Comment 7 Sebastian Dröge (slomo) 2008-03-14 02:44:24 UTC
Still fails on plain arm with old abi: math_vfp.c can't be compiled because -mfloat-abi=hard && -mfpu=vfp are not compatible, -mfloat-abi=hard is set implicitely by the toolchain.

What about this patch: http://svn.debian.org/viewsvn/pkg-gstreamer/unstable/liboil/debian/patches/01_arm-vfp.patch?rev=1443&view=auto


The check should maybe be "x${host_os}" != "xlinux-gnu" or contain all known ${host_os} variables that are eabi.
Comment 8 David Schleef 2010-02-04 12:23:33 UTC
Could you recheck this with git master?


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.