SFOS IDE link error: hidden symbol '__gnu_f2h_ieee' is referenced by DSO

asked 2016-10-11 10:06:04 +0200

aimless gravatar image

updated 2016-11-23 10:32:24 +0200

Hi all

In a new app I use the opencv library (opencv.org) for image processing. I compiled the library in the MerSDK VM once for the i486 as well as for the arm processor. For that I used the commands:

  • sb2 -t SailfishOS-armv7hl -m sdk-build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/mersdk/ocv/ocv-inst-arm -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF –DBUILD_opencv_apps=OFF ../opencv
  • sb2 -t SailfishOS-armv7hl -m sdk-build make
  • sb2 -t SailfishOS-armv7hl -m sdk-build make install
  • sb2 -t SailfishOS-i486 -m sdk-build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/mersdk/ocv/ocv-inst-i386 -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF – DBUILD_opencv_apps =OFF ../opencv

When I compile the application for the i486 processor, i.e. for the emulator, it compiles pretty fine and everything operates as expected. But, when I switch to the arm processor, I get the following linker error:

/opt/cross/bin/armv7hl-meego-linux-gnueabi-ld: harbour-myproject: hidden symbol `__gnu_f2h_ieee' in /opt/cross/lib/gcc/armv7hl-meego-linux-gnueabi/4.8.3/libgcc.a(fp16.o) is referenced by DSO
/opt/cross/bin/armv7hl-meego-linux-gnueabi-ld: final link failed: Bad value

With other words, it means that the symbol ‘__gnu_f2h_ieee’ indeed could be found in libgcc.a, but it is declared as hidden. It seems to me as would it be a compiler error, but I’m not sure and I’ve as well absolutely no clue how it can be solved. A research on the internet yielded a possible solution where the missing functions are added to the project by means of an additional file created by yourself (http://stackoverflow.com/questions/24561863/after-update-to-xcode-6-undefined-symbols-for-architecture-armv7-gnu-f2h and https://reviews.llvm.org/D4927). The same symbol also generated errors by compiling the opencv library. That, however, could be solved by omitting certain parts.

I really appreciate any input or advice on possible solutions of that issue.

Thanks in advance! Regards, aimless


EDIT:

Welll, after all I modified the cmake file for the compilation of the opencv sources. Thereby, I reset the option BUILD_SHARED_LIBS and changed many others in order to get working static libraries that can successfully be linked for the arm processor.

Note: In common it is not useful to link shared libraries (xxx.so) that aren't permitted on the harbour (allowed libraries are listed here). Otherwise, your app can not be published on the harbour.

For further details on how to build the opencv libraries for SFOS see my other post How-to build opencv libraries for SFOS.

edit retag flag offensive close delete