Turn on partial LFS for posix like platforms. 32/291832/1
authorRene Rivera <grafikrobot@gmail.com>
Mon, 27 Sep 2021 13:46:38 +0000 (08:46 -0500)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 24 Apr 2023 02:30:34 +0000 (11:30 +0900)
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

Change-Id: Ibe6f41f1dd67adb15b6c2551229df96357d887b5
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
tools/build/src/engine/config.h

index c995102..8b2e5e1 100644 (file)
@@ -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 <stdint.h>