Sontichai.s
Posts: 6
Joined: Thu Feb 01, 2018 3:29 pm

VFP register arguments error C++

Thu Feb 01, 2018 3:55 pm

Hi

I try to build project finger print scan project file received from finger print vendor develop by use QT creator and C++ on Linux fedora 32 bit
when i test on raspberry pi 3 while building project got error message at below.
Every one can help me for this error ?


15:42:47: Running steps for project rtdemo...
15:42:47: Configuration unchanged, skipping qmake step.
15:42:47: Starting: "/usr/bin/make"
g++ -march=armv7-a -mfloat-abi=hard -o rtdemo main.o MainDialog.o moc_Maindialog.o -L/usr/lib/arm-linux-gnueabihf -L/home/pi/32bit/rtdemo/ -lfpengine -lQtGui -lQtCore -lpthread
/usr/bin/ld: error: rtdemo uses VFP register arguments, /usr/lib/arm-linux-gnueabihf/libfpengine.a(fpengine.o) does not
/usr/bin/ld: failed to merge target specific data of file /usr/lib/arm-linux-gnueabihf/libfpengine.a(fpengine.o)
/usr/bin/ld: error: rtdemo uses VFP register arguments, /usr/lib/arm-linux-gnueabihf/libfpengine.a(fprotocol.o) does not
/usr/bin/ld: failed to merge target specific data of file /usr/lib/arm-linux-gnueabihf/libfpengine.a(fprotocol.o)
/usr/bin/ld: error: rtdemo uses VFP register arguments, /usr/lib/arm-linux-gnueabihf/libfpengine.a(fpdevice.o) does not
/usr/bin/ld: failed to merge target specific data of file /usr/lib/arm-linux-gnueabihf/libfpengine.a(fpdevice.o)
/usr/bin/ld: error: rtdemo uses VFP register arguments, /usr/lib/arm-linux-gnueabihf/libfpengine.a(pusb-linux.o) does not
/usr/bin/ld: failed to merge target specific data of file /usr/lib/arm-linux-gnueabihf/libfpengine.a(pusb-linux.o)
/usr/bin/ld: error: rtdemo uses VFP register arguments, /usr/lib/arm-linux-gnueabihf/libfpengine.a(serial.o) does not
/usr/bin/ld: failed to merge target specific data of file /usr/lib/arm-linux-gnueabihf/libfpengine.a(serial.o)
/usr/bin/ld: error: rtdemo uses VFP register arguments, /usr/lib/arm-linux-gnueabihf/libfpengine.a(sync.o) does not
/usr/bin/ld: failed to merge target specific data of file /usr/lib/arm-linux-gnueabihf/libfpengine.a(sync.o)
/usr/bin/ld: error: rtdemo uses VFP register arguments, /usr/lib/arm-linux-gnueabihf/libfpengine.a(core.o) does not
/usr/bin/ld: failed to merge target specific data of file /usr/lib/arm-linux-gnueabihf/libfpengine.a(core.o)
/usr/bin/ld: error: rtdemo uses VFP register arguments, /usr/lib/arm-linux-gnueabihf/libfpengine.a(descriptor.o) does not
/usr/bin/ld: failed to merge target specific data of file /usr/lib/arm-linux-gnueabihf/libfpengine.a(descriptor.o)
/usr/bin/ld: error: rtdemo uses VFP register arguments, /usr/lib/arm-linux-gnueabihf/libfpengine.a(io.o) does not
/usr/bin/ld: failed to merge target specific data of file /usr/lib/arm-linux-gnueabihf/libfpengine.a(io.o)
/usr/bin/ld: error: rtdemo uses VFP register arguments, /usr/lib/arm-linux-gnueabihf/libfpengine.a(linux_usbfs.o) does not
/usr/bin/ld: failed to merge target specific data of file /usr/lib/arm-linux-gnueabihf/libfpengine.a(linux_usbfs.o)
collect2: error: ld returned 1 exit status
make: *** [rtdemo] Error 1
Makefile:105: recipe for target 'rtdemo' failed
15:42:48: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project rtdemo (kit: Qt 4.8.7 in PATH (qt4))
When executing step "Make"
15:42:48: Elapsed time: 00:02.

[email protected]:~ $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 6.3.0-18+rpi1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 6.3.0 20170516 (Raspbian 6.3.0-18+rpi1)
[email protected]:~ $


#############################################################################
# Makefile for building: rtdemo
# Generated by qmake (2.01a) (Qt 4.8.7) on: Fri Jan 26 13:39:38 2018
# Project: rtdemo.pro
# Template: app
# Command: /usr/lib/arm-linux-gnueabihf/qt4/bin/qmake -spec /usr/share/qt4/mkspecs/linux-g++ -o Makefile rtdemo.pro
#############################################################################

####### Compiler, tools and options

CC = gcc
CXX = g++
DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS = -march=armv7-a -mfloat-abi=hard -D_REENTRANT $(DEFINES)
CXXFLAGS = -march=armv7-a -mfloat-abi=hard -D_REENTRANT $(DEFINES)
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I.
LINK = g++
LFLAGS = -march=armv7-a -mfloat-abi=hard
LIBS = $(SUBLIBS) -L/usr/lib/arm-linux-gnueabihf -L/home/pi/32bit/rtdemo/ -lfpengine -lQtGui -lQtCore -lpthread
AR = ar cqs
RANLIB =
QMAKE = /usr/lib/arm-linux-gnueabihf/qt4/bin/qmake
TAR = tar -cf
COMPRESS = gzip -9f
COPY = cp -f
SED = sed
COPY_FILE = $(COPY)
COPY_DIR = $(COPY) -r
STRIP = strip
INSTALL_FILE = install -m 644 -p
INSTALL_DIR = $(COPY_DIR)
INSTALL_PROGRAM = install -m 755 -p
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p

####### Output directory

OBJECTS_DIR = ./

####### Files

SOURCES = main.cpp \
MainDialog.cpp moc_Maindialog.cpp
OBJECTS = main.o \
MainDialog.o \
moc_Maindialog.o
DIST = /usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/common/gcc-base.conf \
/usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
/usr/share/qt4/mkspecs/common/g++-base.conf \
/usr/share/qt4/mkspecs/common/g++-unix.conf \
/usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
/usr/share/qt4/mkspecs/features/default_pre.prf \
/usr/share/qt4/mkspecs/features/release.prf \
/usr/share/qt4/mkspecs/features/default_post.prf \
/usr/share/qt4/mkspecs/features/shared.prf \
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
/usr/share/qt4/mkspecs/features/warn_on.prf \
/usr/share/qt4/mkspecs/features/qt.prf \
/usr/share/qt4/mkspecs/features/unix/thread.prf \
/usr/share/qt4/mkspecs/features/moc.prf \
/usr/share/qt4/mkspecs/features/resources.prf \
/usr/share/qt4/mkspecs/features/uic.prf \
/usr/share/qt4/mkspecs/features/yacc.prf \
/usr/share/qt4/mkspecs/features/lex.prf \
/usr/share/qt4/mkspecs/features/include_source_dir.prf \
rtdemo.pro
QMAKE_TARGET = rtdemo
DESTDIR =
TARGET = rtdemo

first: all
####### Implicit rules

.SUFFIXES: .o .c .cpp .cc .cxx .C

.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "[email protected]" "$<"

.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "[email protected]" "$<"

.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "[email protected]" "$<"

.C.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "[email protected]" "$<"

.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o "[email protected]" "$<"

####### Build rules

all: Makefile $(TARGET)

$(TARGET): /home/pi/32bit/rtdemo/libfpengine.a ui_maindialog.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)

Makefile: rtdemo.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/common/gcc-base.conf \
/usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
/usr/share/qt4/mkspecs/common/g++-base.conf \
/usr/share/qt4/mkspecs/common/g++-unix.conf \
/usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
/usr/share/qt4/mkspecs/features/default_pre.prf \
/usr/share/qt4/mkspecs/features/release.prf \
/usr/share/qt4/mkspecs/features/default_post.prf \
/usr/share/qt4/mkspecs/features/shared.prf \
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
/usr/share/qt4/mkspecs/features/warn_on.prf \
/usr/share/qt4/mkspecs/features/qt.prf \
/usr/share/qt4/mkspecs/features/unix/thread.prf \
/usr/share/qt4/mkspecs/features/moc.prf \
/usr/share/qt4/mkspecs/features/resources.prf \
/usr/share/qt4/mkspecs/features/uic.prf \
/usr/share/qt4/mkspecs/features/yacc.prf \
/usr/share/qt4/mkspecs/features/lex.prf \
/usr/share/qt4/mkspecs/features/include_source_dir.prf \
/usr/lib/arm-linux-gnueabihf/libQtGui.prl \
/usr/lib/arm-linux-gnueabihf/libQtCore.prl
$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -o Makefile rtdemo.pro
/usr/share/qt4/mkspecs/common/unix.conf:
/usr/share/qt4/mkspecs/common/linux.conf:
/usr/share/qt4/mkspecs/common/gcc-base.conf:
/usr/share/qt4/mkspecs/common/gcc-base-unix.conf:
/usr/share/qt4/mkspecs/common/g++-base.conf:
/usr/share/qt4/mkspecs/common/g++-unix.conf:
/usr/share/qt4/mkspecs/qconfig.pri:
/usr/share/qt4/mkspecs/features/qt_functions.prf:
/usr/share/qt4/mkspecs/features/qt_config.prf:
/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
/usr/share/qt4/mkspecs/features/default_pre.prf:
/usr/share/qt4/mkspecs/features/release.prf:
/usr/share/qt4/mkspecs/features/default_post.prf:
/usr/share/qt4/mkspecs/features/shared.prf:
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
/usr/share/qt4/mkspecs/features/warn_on.prf:
/usr/share/qt4/mkspecs/features/qt.prf:
/usr/share/qt4/mkspecs/features/unix/thread.prf:
/usr/share/qt4/mkspecs/features/moc.prf:
/usr/share/qt4/mkspecs/features/resources.prf:
/usr/share/qt4/mkspecs/features/uic.prf:
/usr/share/qt4/mkspecs/features/yacc.prf:
/usr/share/qt4/mkspecs/features/lex.prf:
/usr/share/qt4/mkspecs/features/include_source_dir.prf:
/usr/lib/arm-linux-gnueabihf/libQtGui.prl:
/usr/lib/arm-linux-gnueabihf/libQtCore.prl:
qmake: FORCE
@$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -o Makefile rtdemo.pro

dist:
@$(CHK_DIR_EXISTS) .tmp/rtdemo1.0.0 || $(MKDIR) .tmp/rtdemo1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/rtdemo1.0.0/ && $(COPY_FILE) --parents Maindialog.h fpengine.h .tmp/rtdemo1.0.0/ && $(COPY_FILE) --parents main.cpp MainDialog.cpp .tmp/rtdemo1.0.0/ && $(COPY_FILE) --parents maindialog.ui .tmp/rtdemo1.0.0/ && (cd `dirname .tmp/rtdemo1.0.0` && $(TAR) rtdemo1.0.0.tar rtdemo1.0.0 && $(COMPRESS) rtdemo1.0.0.tar) && $(MOVE) `dirname .tmp/rtdemo1.0.0`/rtdemo1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/rtdemo1.0.0


clean:compiler_clean
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core


####### Sub-libraries

distclean: clean
-$(DEL_FILE) $(TARGET)
-$(DEL_FILE) Makefile


check: first

mocclean: compiler_moc_header_clean compiler_moc_source_clean

mocables: compiler_moc_header_make_all compiler_moc_source_make_all

compiler_moc_header_make_all: moc_Maindialog.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_Maindialog.cpp
moc_Maindialog.cpp: Maindialog.h
/usr/lib/arm-linux-gnueabihf/qt4/bin/moc $(DEFINES) $(INCPATH) Maindialog.h -o moc_Maindialog.cpp

compiler_rcc_make_all:
compiler_rcc_clean:
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_maindialog.h
compiler_uic_clean:
-$(DEL_FILE) ui_maindialog.h
ui_maindialog.h: maindialog.ui
/usr/lib/arm-linux-gnueabihf/qt4/bin/uic maindialog.ui -o ui_maindialog.h

compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_uic_clean

####### Compile

main.o: main.cpp Maindialog.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp

MainDialog.o: MainDialog.cpp Maindialog.h \
ui_maindialog.h \
fpengine.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o MainDialog.o MainDialog.cpp

moc_Maindialog.o: moc_Maindialog.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_Maindialog.o moc_Maindialog.cpp

####### Install

install: FORCE

uninstall: FORCE

FORCE:

User avatar
Paeryn
Posts: 2114
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: VFP register arguments error C++

Fri Feb 02, 2018 1:13 am

The linker is telling you that you are compiling for hardfp (floating point values are passed between functions using the floating point registers and the stack) whereas libfpengine.a contains code compiled with softfp (floating point values are passed using integer registers and the stack) or possibly even softfloat (similar to softfp but code compiled with no use of floating point instructions, any floating point operations will make function calls for the C library to handle).

You need a hardfp version of libfpengine.a to link against.
She who travels light — forgot something.

Sontichai.s
Posts: 6
Joined: Thu Feb 01, 2018 3:29 pm

Re: VFP register arguments error C++

Fri Feb 02, 2018 2:46 pm

Thank you very much for your reply.

File libfpengine.a i received from vendor. Last time i contact them for make new library.
Finger print vendor said library can't run on raspberry PI 3 just for linux Fedora 32 bit only.
Can i config C++ Complier before build this project ? If it possible. How to config ?
Please recommend me step by step.

User avatar
Paeryn
Posts: 2114
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: VFP register arguments error C++

Fri Feb 02, 2018 11:09 pm

You can't mix hardfp with softfp, everything has to use the same abi. The abi specifies exactly how data is passed between functions, e.g. if a function compiled with hardfp makes a function call passing a single float parameter it will store that value in the first floating point register, if the function being called was compiled with softfp then it will be expecting the value to be in the first integer register, things would go south very quickly as you will be effectively passing random values.

All libraries that are used must match, including any shared libraries, so the only effective way to use a softfp or soft float library is to have the entire system compiled the same way.

If the vendor is unwilling to provide a hardfp version then your only options are to find another vendor that will or switch to a distro that is compiled for softfp. Though I'd want to know why they say the RPi3 is unable to run it, the only reason I can think of would be if it relied on x86 assembly and they were unwilling to re-write that part in Arm or even C) but if they have supplied you with an Arm compiled library...
She who travels light — forgot something.

jahboater
Posts: 2858
Joined: Wed Feb 04, 2015 6:38 pm

Re: VFP register arguments error C++

Sat Feb 03, 2018 8:25 am

Also for interest, I don't think the Pi3 even supports VFP - it is NEON only.

User avatar
Paeryn
Posts: 2114
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: VFP register arguments error C++

Sat Feb 03, 2018 11:22 am

jahboater wrote:
Sat Feb 03, 2018 8:25 am
Also for interest, I don't think the Pi3 even supports VFP - it is NEON only.
I didn't think of that, they could have optimised their code to use the vector abilities (the VFP was rarely used in vector mode). The floating point unit is still called VFP even on modern CPUs with NEON, though it can only be configured for vectors of length 1 as all vectored maths code should be done with NEON on these CPUs. I'm not sure if they merged the two units into one but the early NEON was separate from the VFP (I know the Cortex A8 had a non-pipelined VFP but a pipelined NEON).
She who travels light — forgot something.

Sontichai.s
Posts: 6
Joined: Thu Feb 01, 2018 3:29 pm

Re: VFP register arguments error C++

Sun Feb 04, 2018 2:06 am

Hi,
Look like some one found same the problem.
https://www.raspberrypi.org/forums/ ... 3&t=79988
I tried change C flags before Complie project follow link but dit not help.

User avatar
Paeryn
Posts: 2114
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: VFP register arguments error C++

Sun Feb 04, 2018 3:55 am

Sontichai.s wrote:
Sun Feb 04, 2018 2:06 am
Hi,
Look like some one found same the problem.
https://www.raspberrypi.org/forums/ ... 3&t=79988
I tried change C flags before Complie project follow link but dit not help.
You cannot link a softfp library into your program if your program and all the libraries (including system libraries) that it relies on are compiled for hardfp, the two are incompatible.

As jahboater reminded me in the post or two previous, if the library is compiled to explicitly use the vector capabilities of the VFP then that library won't even work on an RPi 2 or 3 as the VFP hardware in the processors those use don't support the old vector mode (which is one possible explanation as to why the vendor stated it wouldn't work on an RPi 3).
She who travels light — forgot something.

Sontichai.s
Posts: 6
Joined: Thu Feb 01, 2018 3:29 pm

Re: VFP register arguments error C++

Sun Feb 25, 2018 2:13 pm

Hi,

Thank you very much for reply.
Now vendor complied new library and send back to me.
library for raspberry pi 3 CPU arm it working.

Return to “C/C++”

Who is online

Users browsing this forum: No registered users and 6 guests