Skip to content

Commit

Permalink
Turn on partial LFS for posix like platforms.
Browse files Browse the repository at this point in the history
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:
* bfgroup#49
* conan-io/conan-center-index#6059
* boostorg/build#663
  • Loading branch information
grafikrobot authored and psandana committed Feb 24, 2022
1 parent 80d7296 commit 2d254ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/qemu_multiarch_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 9 additions & 1 deletion src/engine/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -31,6 +31,14 @@ Distributed under the Boost Software License, Version 1.0.
#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 <stdint.h>
Expand Down

0 comments on commit 2d254ed

Please sign in to comment.