Skip to contentSkip to conversation

package/libtorrent-rasterbar: fix build for host arch = target arch

PATCH New Bernd Kuhls 1 participant 1 message Feb 22

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libtorrent-rasterbar: fix build for host arch = target arch

The following defconfig

BR2_PACKAGE_LIBTORRENT_RASTERBAR=y

is the only broken one according to "utils/test-pkg -a":

bootlin-x86-64-glibc [25/32]: FAILED

32 builds, 4 skipped, 1 build failed, 0 legal-info failed, 0 show-info failed

on a x86_64 host because on all other archs a runtime configure test with a cross-compiled target binary fails:

./configure: line 21141: ./cpp_standard: cannot execute binary file:
Exec format error

and configure in this case continues to assume c++11 support:

checking whether /home/bernd/buildroot/test-libtorrent-rasterbar/bootlin-aarch64-glibc-old/host/bin/aarch64-linux-g++
supports C++11 features with -std=c++11... yes

while on the forementioned x86_64 host the cross-compiled target binary works:

  $ ./cpp_standard
  17

and configure further tests for c++17 which fails due to c++11 being forced by TARGET_CXXFLAGS:

checking whether /home/bernd/buildroot/test-libtorrent-rasterbar/bootlin-x86-64-glibc/host/bin/x86_64-linux-g++
supports C++17 features with -std=c++17... no

The problem occurs since upstream commit
https://github.com/arvidn/libtorrent/commit/b7e02cc700d884f87a18a3bc59f95a66a5cb0209
added to version 1.2.13 which was bumped in buildroot back in 2021 with commit 2cecfe94f889165f3a5169598ed7e0388941a6cd

Fixes:
https://autobuild.buildroot.net/results/8c8/8c8a35052ce03871e94d4fdd3806feeebe61ce40/

The oldest build error dates back to July 2024:
https://autobuild.buildroot.net/results/3ee/3ee7753c2c5522c0075091b1d3c79ed9dffe6f40//

All present build errors occur when host arch = target arch:
https://autobuild.buildroot.net/?reason=libtorrent-rasterbar-1.2.19

---
 package/libtorrent-rasterbar/libtorrent-rasterbar.mk | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
package/libtorrent-rasterbar/libtorrent-rasterbar.mk +9 -1
index 6b497bbe58..e95877d28d 100644
@@ -16,7 +16,15 @@ LIBTORRENT_RASTERBAR_INSTALL_STAGING = YES
 LIBTORRENT_RASTERBAR_CONF_OPTS = \
 	--with-boost-libdir=$(STAGING_DIR)/usr/lib \
 	--disable-invariant-checks
-LIBTORRENT_RASTERBAR_CXXFLAGS = $(TARGET_CXXFLAGS) -std=c++11
+LIBTORRENT_RASTERBAR_CXXFLAGS = $(TARGET_CXXFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_8),y)
+LIBTORRENT_RASTERBAR_CONF_OPTS += --with-cxx-standard=17
+else ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5),y)
+LIBTORRENT_RASTERBAR_CONF_OPTS += --with-cxx-standard=14
+else
+LIBTORRENT_RASTERBAR_CONF_OPTS += --with-cxx-standard=11
+endif
 
 # Internal error, aborting at dwarf2cfi.c:2802 in connect_traces
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58864
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot