From 26f2dbccbcafd92719ad97e9ac2bb29ab8c05576 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 27 Sep 2021 08:46:38 -0500 Subject: [PATCH] Turn on partial LFS for posix like platforms. When running b2 inside a qemu mixed mode environment (32 inside 64) it errors with some system calls not properly translating from 64 to 32. This works around the problem by making the 32 bit b2 build use 64 bit file system calls in libc. Potentially fix for: * https://github.com/bfgroup/b2/issues/49 * https://github.com/conan-io/conan-center-index/issues/6059 * https://github.com/boostorg/build/issues/663 --- .github/workflows/qemu_multiarch_linux.yml | 2 ++ src/engine/config.h | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/qemu_multiarch_linux.yml b/.github/workflows/qemu_multiarch_linux.yml index 0d93288f1..d32d73c26 100644 --- a/.github/workflows/qemu_multiarch_linux.yml +++ b/.github/workflows/qemu_multiarch_linux.yml @@ -24,6 +24,8 @@ jobs: include: - { name: 'Ubuntu 20.04 Focal (armhf)', image: 'multiarch/ubuntu-debootstrap:armhf-focal', cxx: 'g++', toolset: 'gcc' } - { name: 'Ubuntu 20.04 Focal (arm64)', image: 'multiarch/ubuntu-debootstrap:arm64-focal', cxx: 'g++', toolset: 'gcc' } + - { name: 'Debian 11 Bullseye (armhf)', image: 'multiarch/debian-debootstrap:armhf-bullseye', cxx: 'g++', toolset: 'gcc' } + - { name: 'Debian 11 Bullseye (arm64)', image: 'multiarch/debian-debootstrap:arm64-bullseye', cxx: 'g++', toolset: 'gcc' } name: ${{ matrix.name }} runs-on: ubuntu-latest env: diff --git a/src/engine/config.h b/src/engine/config.h index c99510296..38ee26cbd 100644 --- a/src/engine/config.h +++ b/src/engine/config.h @@ -2,7 +2,7 @@ #define B2_CONFIG_H /* -Copyright 2002-2018 Rene Rivera. +Copyright 2002-2021 Rene Rivera. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt or copy at https://www.bfgroup.xyz/b2/LICENSE.txt) @@ -31,6 +31,14 @@ https://www.bfgroup.xyz/b2/LICENSE.txt) #endif #endif +// To work around QEMU failures on mixed mode situations (32 vs 64) we need to +// enable partial LFS support in system headers. And we need to do this before +// any system headers are included. + +#if !defined(NT) && !defined(VMS) +# define _FILE_OFFSET_BITS 64 +#endif + // Correct missing types in some earlier compilers.. #include