Created attachment 851226 [details] log emerge boost for 32bit ARM emerging dev-libs/boost for an ARM 32 bit users space (chromeos kukui): - default address-model : 32-bit [1] - default architecture : arm [1] At configuration, large file support is detected: ... - Has Large File Support : yes [2] ... But when checking for large file support in the produced library with https://chromium.googlesource.com/chromiumos/platform/crosutils/+/main/hooks/install/large-file-support.sh, All the objects are not compiled with LFS option: The following patch addresses the problem. Both C and C++ flags need to be modified to ensure LFS is compiled even on 32bit architecture. diff -u /tmp/portage/dev-libs/boost/boost-1.81.0-r1.ebuild dev-libs/boost/boost-1.81.0-r2.ebuild --- /tmp/portage/dev-libs/boost/boost-1.81.0-r1.ebuild 2023-02-08 11:05:29.875500624 -0800 +++ dev-libs/boost/boost-1.81.0-r2.ebuild 2023-02-15 01:44:45.732290829 -0800 @@ -194,6 +194,10 @@ # Use C++17 globally as of 1.80 append-cxxflags -std=c++17 + + # Append LFS flags for both C++ and C code. + append-cxxflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE + append-cflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE } multilib_src_compile() {
Created attachment 851228 [details, diff] Patch to add LFS options
Please use the append-lfs-flags function instead.
Created attachment 851840 [details] dev-libs/boost emerge with append-lfs-flags set I tried to use `append-lfs-flags` at first, but it does not work. `append-lfs-flags` set the CPPFLAGS which is not taken into account when compiling boost files.
can you check the ABI of the installed libs to see if they change ? it might be easier with these as `readelf -sW ... | c++filt` on C++ libs includes typing info in the func signatures. at a glance, i don't see off_t or struct stat in any headers. but boost is large and full of C++ metaprogramming, so manual audit is hard.
Created attachment 854414 [details] ABI comparison There is a ABI difference between LFS and non LFS dev-boost: boost::interprocess::shared_memory_object::truncate use offset_t so it is compiled as `long long` with LFS option. Same for the constructor of mapped_region in boost_1_81_0/boost/interprocess/mapped_region.hpp. Having said that, readelf reports the bidding as local and visibility as hidden, so it is only exported through inline function in the .hpp that are compiled with the applications. ``` grep -A1 boost::interprocess::shared_memory_object::truncate /tmp/new_typing_info.txt 6090: 0005a5f5 244 FUNC LOCAL HIDDEN 15 boost::interprocess::shared_memory_object::truncate(long long) 6091: 0005a6e9 544 FUNC LOCAL HIDDEN 15 boost::interprocess::mapped_region::mapped_region<boost::interprocess::shared_memory_object>(boost::interprocess::shared_memory_object const&, boost::interprocess::mode_t, long long, unsigned int, void const*, int) ``` For comparison, I compiled with (new) and without (old) LFS option and using cd .../tmp/portage/dev-libs/boost-1.81.0-*/work for i in $(find . -name \*so | sort) ; do echo $i ; readelf -sW $i | c++filt ; done > .._typing_info.txt Removing index and UNDEF (we know the new version will call 64 version for mmap, ftruncate, ...) cut -c '18-' .._typing_info.txt | grep UNDEF > .._typing_info_tr.txt vimdiff /tmp/new_typing_info_tr.txt /tmp/old_typing_info_tr.txt
abidiff did not find any difference: for i in $(find .../tmp/portage/dev-libs/boost-1.81.0-r2/work/*arm -name \*so) ; do echo $(basename $i) --- ; ./tools/abidiff $i ${i/-r2/-r1} done libboost_unit_test_framework.so --- libboost_contract.so --- libboost_random.so --- libboost_math_tr1l.so --- libboost_chrono.so --- libboost_filesystem.so --- libboost_graph.so --- libboost_math_tr1f.so --- libboost_math_c99.so --- libboost_program_options.so --- libboost_math_c99f.so --- libboost_type_erasure.so --- libboost_atomic.so --- libboost_thread.so --- libboost_math_c99l.so --- libboost_wave.so --- libboost_serialization.so --- libboost_nowide.so --- libboost_timer.so --- libboost_regex.so --- libboost_date_time.so --- libboost_url.so --- libboost_log.so --- libboost_math_tr1.so --- libboost_json.so --- libboost_wserialization.so --- libboost_iostreams.so --- libboost_log_setup.so --- libboost_container.so --- libboost_prg_exec_monitor.so --- libboost_system.so ---
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2000752e4e7a8d2859e2b63f39f1184c2711a4da commit 2000752e4e7a8d2859e2b63f39f1184c2711a4da Author: David Seifert <soap@gentoo.org> AuthorDate: 2023-04-14 23:07:03 +0000 Commit: David Seifert <soap@gentoo.org> CommitDate: 2023-04-14 23:07:03 +0000 dev-libs/boost: add 1.82.0 Bug: https://bugs.gentoo.org/894564 Signed-off-by: David Seifert <soap@gentoo.org> dev-libs/boost/Manifest | 1 + dev-libs/boost/boost-1.82.0.ebuild | 343 +++++++++++++++++++++++++++++++++++++ 2 files changed, 344 insertions(+)
commit ef13a50657cbdafc4f0d1ce332b597ba6c0c5110 Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: Sat Jun 10 10:57:11 2023 +0200 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: Sat Jun 10 11:38:36 2023 +0200 dev-libs/boost: drop 1.81.0-r1 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>