[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1011260: simgear: ftbfs on riscv64 arch



Source: simgear
Version: 1:2020.3.6+dfsg-1
Severity: normal
Tags: ftbfs, patch
User: debian-riscv@lists.debian.org
Usertags: riscv64

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
Link with -pthread instead of -lpthread to fix FTBFS on riscv64

Bo YU <tsu.yubo@gmail.com>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,7 +10,7 @@
    if(POLICY CMP0067)
        cmake_policy(SET CMP0067 NEW)
    endif()
-    
+
   # OpenGL VND policy : use the old definition for now, until we can audit this
   if(POLICY CMP0072)
         cmake_policy(SET CMP0072 OLD)
@@ -229,6 +229,7 @@
 endif()
 
 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+    set(THREADS_PREFER_PTHREAD_FLAG ON)
     find_package(Threads REQUIRED)
 endif()
 

Reply to: