adobe / XMP-Toolkit-SDK

The XMP Toolkit allows you to integrate XMP functionality into your product or solution
BSD 3-Clause "New" or "Revised" License
205 stars 83 forks source link

XMPFiles/source/XMPFiles_Impl.cpp: fix arm build with gcc 10 #57

Open ffontaine opened 2 years ago

ffontaine commented 2 years ago

Description

Fix the following build failure with exempi on arm with gcc 10 raised since version 2.6.0 and https://gitlab.freedesktop.org/libopenraw/exempi/-/commit/0872e35a30457d2ecf746a1bebdb7d94636d0e2f and https://github.com/adobe/XMP-Toolkit-SDK/commit/0872e35a30457d2ecf746a1bebdb7d94636d0e2f:

/home/giuliobenetti/autobuild/run/instance-3/output-1/host/lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: ../../XMPFiles/source/.libs/libXMPFiles.a(XMPFiles_Impl.o):(.rodata+0x5c): multiple definition of `typeinfo name for TXMPMeta<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >'; XMPFilesCoverage.o:(.rodata+0x0): first defined here

More information can be found on a similar issue here: https://github.com/OpenKinect/libfreenect2/issues/157

Fixes:

Related Issue

Motivation and Context

This change is needed to avoid build failure with exempi: http://autobuild.buildroot.org/?reason=exempi-2.6.1

How Has This Been Tested?

This has been build-tested with buidlroot.

Screenshots (if appropriate):

Types of changes

Checklist:

hfiguiere commented 1 year ago

Issue also occur on gcc 9.3.0 armhf

SoftAvocado commented 1 year ago

Hello! I've faced the same problem on arm32v7/ubuntu docker container and on Raspberry Pi OS 32-bit. I fixed the source code of XMPFiles_Impl.cpp according to the fixes provided by hfiguiere and now it works fine, thank you! Can you please review this code and merge it to main?