#1011260 simgear: ftbfs on riscv64 arch

#1011260#5
Date:
2022-05-19 03:24:45 UTC
From:
To:
Dear Maintainer,

The simgear packages has a ftbfs issue on riscv64 arch:

```
[ 77%] Linking CXX executable test_embedded_resources
cd /<<PKGBUILDDIR>>/build/simgear/embedded_resources && /usr/bin/cmake -E cmake_link_script CMakeFiles/test_embedded_resources.dir/link.txt --verbose=1
/usr/bin/c++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fno-strict-aliasing   -Wall -fPIC -Wno-unused-local-typedefs  -DBOOST_BIMAP_DISABLE_SERIALIZATION -DBOOST_NO_STDLIB_CONFIG -O3 -g -DNDEBUG  -Wl,-z,relro -Wl,-z,now  -rdynamic CMakeFiles/test_embedded_resources.dir/embedded_resources_test.cxx.o -o test_embedded_resources  ../libSimGearScene.a -lGL -lGLU ../libSimGearCore.a -lpthread -lz -lrt -ldl -lcurl -lexpat -ludns -losgText -losgSim -losgDB -losgParticle -losgGA -losgViewer -losgUtil -losg -lOpenThreads -lz -lopenal -lGL -lGLU
/usr/bin/ld: ../libSimGearCore.a(SGThread.cxx.o): in function `SGExclusiveThread::release()':
./build/simgear/./simgear/threads/SGThread.cxx:202: undefined reference to `__atomic_exchange_1'
/usr/bin/ld: ./build/simgear/./simgear/threads/SGThread.cxx:202: undefined reference to `__atomic_exchange_1'
/usr/bin/ld: ../libSimGearCore.a(SGThread.cxx.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(unsigned long, unsigned long, char const*, unsigned long)':
/usr/include/c++/10/bits/basic_string.h:1939: undefined reference to `__atomic_exchange_1'
/usr/bin/ld: /usr/include/c++/10/bits/basic_string.h:1939: undefined reference to `__atomic_exchange_1'
/usr/bin/ld: ../libSimGearCore.a(SGThread.cxx.o): in function `SGExclusiveThread::setCompletion()':
./build/simgear/./simgear/threads/SGThread.cxx:249: undefined reference to `__atomic_exchange_1'
collect2: error: ld returned 1 exit status
make[3]: *** [simgear/embedded_resources/CMakeFiles/test_embedded_resources.dir/build.make:127: simgear/embedded_resources/test_embedded_resources] Error 1
make[3]: Leaving directory '/<<PKGBUILDDIR>>/build'
make[2]: *** [CMakeFiles/Makefile2:1893: simgear/embedded_resources/CMakeFiles/test_embedded_resources.dir/all] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/build'
make[1]: *** [Makefile:185: all] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>/build'
dh_auto_build: error: cd build && make -j4 "INSTALL=install --strip-program=true" VERBOSE=1 returned exit code 2
make: *** [debian/rules:42: binary-arch] Error 25
dpkg-buildpackage: error: debian/rules binary-arch subprocess returned exit status 2
...
```

The full buildd log is here:

https://buildd.debian.org/status/fetch.php?pkg=simgear&arch=riscv64&ver=1%3A2020.3.6%2Bdfsg-1&stamp=1621459083&raw=0

And the attached patch is to fix the issue on riscv64 arch:

```
...
Build Architecture: riscv64
Build Type: binary
Build-Space: 1390036
Build-Time: 2905
Distribution: unstable
Host Architecture: riscv64
Install-Time: 164
Job: /home/vimer/05/22_simgear/simgear_2020.3.6+dfsg-1.dsc
Lintian: warn
Machine Architecture: riscv64
Package: simgear
Package-Time: 3175
Source-Version: 1:2020.3.6+dfsg-1
Space: 1390036
Status: successful
Version: 1:2020.3.6+dfsg-1
```

Please consider to apply it in next upload, thank you:)

BR,
Bo

#1011260#10
Date:
2022-06-01 13:43:32 UTC
From:
To:
Hi,
Sorry, this is a bug for cmake.

Before the glibc 2.34, this patch is work. But glibc 2.34 will break
again, so we have to close it and find solution to solve it in feature.
More infos detailed please refer to[0].

Bo
[0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1012058