user/llvm14: (32-bit) FTPFS: scanelf: mmap on './usr/lib/libLLVM-14.so' of -1586318716 bytes failed :(
On 32-bit architectures, libLLVM-14.so
is too large. Seems to be a regression since 14.0.2
.
Found first on pmmx:
...
make: Leaving directory '/root/packages/user/llvm14/src/llvm-14.0.6.src/build'
>>> llvm14-static*: Running split function static...
>>> llvm14-static*: Preparing subpackage llvm14-static...
>>> llvm14-static*: Stripping binaries
>>> llvm14-static*: Running postcheck for llvm14-static
>>> llvm14-libs*: Running split function libs...
>>> llvm14-libs*: Preparing subpackage llvm14-libs...
>>> llvm14-libs*: Stripping binaries
scanelf: mmap on './usr/lib/libLLVM-14.so' of -1586318716 bytes failed :(
scanelf: mmap on '/root/packages/user/llvm14/pkg/llvm14-libs/usr/lib/libLLVM-14.so' of -1586318716 bytes failed :(
scanelf: mmap on '/root/packages/user/llvm14/pkg/llvm14-libs/usr/lib/libLLVM-14.so' of -1586318716 bytes failed :(
>>> WARNING: llvm14-libs*: No arch specific binaries found so arch should probably be set to "noarch"
>>> llvm14-libs*: Running postcheck for llvm14-libs
scanelf: mmap on '/root/packages/user/llvm14/pkg/llvm14-libs/usr/lib/libLLVM-14.so' of -1586318716 bytes failed :(
>>> llvm14-dev*: Running split function dev...
>>> llvm14-dev*: Preparing subpackage llvm14-dev...
>>> llvm14-dev*: Stripping binaries
>>> llvm14-dev*: Running postcheck for llvm14-dev
>>> llvm14-test-utils*: Running split function _test_utils...
...
>>> llvm14-libs*: Scanning shared objects
scanelf: mmap on '/root/packages/user/llvm14/pkg/llvm14-libs/usr/lib/libLLVM-14.so' of -1586318716 bytes failed :(
scanelf: mmap on '/root/packages/user/llvm14/pkg/llvm14-libs/usr/lib/libLLVM-14.so' of -1586318716 bytes failed :(
>>> llvm14-static*: Scanning shared objects
>>> llvm14-test-utils*: Scanning shared objects
>>> llvm14*: Scanning shared objects
>>> llvm14-dev*: Tracing dependencies...
>>> ERROR: llvm14-dev*: libLLVM-14.so: path not found
llvm14=14.0.6-r0
libexecinfo-dev
libxml2-dev
llvm14-libs=14.0.6-r0
so:libc.musl-pmmx.so.1
so:libexecinfo.so.1
so:libgcc_s.so.1
so:libstdc++.so.6
>>> llvm14-dev*: Package size: 21.8 MB
...
>>> llvm14*: Tracing dependencies...
>>> ERROR: llvm14*: libLLVM-14.so: path not found
so:libc.musl-pmmx.so.1
so:libexecinfo.so.1
so:libgcc_s.so.1
so:libstdc++.so.6
so:libz.so.1
>>> llvm14*: Package size: 56.5 MB
>>> llvm14*: Compressing data...
>>> llvm14*: Create checksum...
>>> llvm14*: Create llvm14-14.0.6-r0.apk
>>> llvm14: Build complete at Wed, 17 Aug 2022 09:52:51 +0000 elapsed time 0h 4m 44s
>>> llvm14: Updating the user/pmmx repository index...
>>> llvm14: Signing the index...
The issue is in scanelf
:
builder on powerhouse ~/packages/user/llvm14 $ scanelf ./pkg/llvm14-libs/usr/lib/libLLVM-14.so
scanelf: mmap on './pkg/llvm14-libs/usr/lib/libLLVM-14.so' of -1586318716 bytes failed :(
See also:
builder on powerhouse ~/packages/user/llvm14 $ ls -l $(find . -type f -name libLLVM-14.so)
-rwxr-xr-x 1 builder abuild 2708648580 Aug 17 09:52 ./pkg/llvm14-libs/usr/lib/libLLVM-14.so
-rwxr-xr-x 1 builder abuild 2708648580 Aug 17 09:50 ./src/llvm-14.0.6.src/build/lib/libLLVM-14.so
With strip
, comparison:
builder on powerhouse ~/packages/user/llvm14 $ strip ./src/llvm-14.0.6.src/build/lib/libLLVM-14.so
builder on powerhouse ~/packages/user/llvm14 $ ls -l $(find . -type f -name libLLVM-14.so)
-rwxr-xr-x 1 builder abuild 2708648580 Aug 17 09:52 ./pkg/llvm14-libs/usr/lib/libLLVM-14.so
-rwxr-xr-x 1 builder abuild 111864656 Aug 17 09:57 ./src/llvm-14.0.6.src/build/lib/libLLVM-14.so
Some commentary from IRC:
--- Day changed Tue Feb 01 2022
00:47 <@zv> >>> llvm13-libs*: Compressing data...
00:47 <@zv> tar: Write error
00:48 <@zv> this is certainly interesting
00:58 <@Sheila> oh dear.
01:06 <~awilfox> That means that a file was >2GB, I believe tar chokes on a single file being over 2GB
01:06 <~awilfox> the X.org thing is interesting, sounds like I finally have a reason to put on my hat - I have a newport machine and the inclination to try and port it out of XAA.
01:10 <@zv> ah scanelf: mmap on '/root/packages/user/llvm13/pkg/llvm13-libs/usr/lib/libLLVM-13.so' ...
01:12 <@zv> what is the solution, fix scanelf, tar, compress (strip?) libLLVM-13.so before?
01:14 <@zv> -rwxr-xr-x 1 builder abuild 2.4G Feb 1 01:05 libLLVM-13.so
01:15 <@zv> libLLVM-13.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, with debug_info, not stripped
01:15 <@zv> I guess stripping
01:15 <@zv> 96MB lol
01:19 <@zv> next test will be MinSizeRel
01:24 <@zv> I wonder why Release (current setting) leaves debug info in place?
02:04 <@zv> cmake(lists.txt) bug? MinSizeRel is >>> llvm13-libs*: Package size: 66.0 MB
02:05 <@zv> but Release is hughe
and
--- Day changed Thu Aug 04 2022
...
02:42 <~awilfox> meanwhile the 'mesa cannot find llvm' bug on pmmx is because the .so file is too big.
02:43 <~awilfox> >>> llvm14-libs*: Scanning shared objects
02:43 <~awilfox> scanelf: mmap on '/usr/src/packages/user/llvm14/pkg/llvm14-libs/usr/lib/libLLVM-14.so' of -1586246532 bytes failed :(
02:43 <~awilfox> >>> llvm14-libs*: Package size: 2.5 GB
02:43 <~awilfox> >>> llvm14-libs*: Compressing data...
02:43 <~awilfox> tar: Write error
02:43 <~awilfox> like, literally. no tooling can handle a single .so >2GB on 32-bit systems.
02:43 <~awilfox> it's already MinSizeRel, so this is going to need quite a thinking
02:44 <~awilfox> we may need to disable multi-targeting support on 32-bit systems at this point. as in llvm becomes 'native only', not supporting builds to foreign arches
...
However I'm not sure how accurate "it's already MinSizeRel" is? Looks like we use Release
?
Changing that to MinSizeRel
produces:
builder on powerhouse ~/packages/user/llvm14 $ ls -l $(find . -type f -name libLLVM-14.so)
-rwxr-xr-x 1 builder abuild 2163434928 Aug 17 10:15 ./pkg/llvm14-libs/usr/lib/libLLVM-14.so
-rwxr-xr-x 1 builder abuild 2163434928 Aug 17 10:12 ./src/llvm-14.0.6.src/build/lib/libLLVM-14.so
So it's still just slightly over 2GB, down from 2.5GB.
And I see that when I did LLVM13, it was indeed MinSizeRel
too:
https://cgit.adelielinux.org/packages/tree/user/llvm13/APKBUILD?h=zv-next
This fixes it:
+ # 32-bit archs cannot handle >2GB .so files
+ strip "$subpkgdir"/usr/lib/$ver_soname
Is that not an acceptable approach?