FS#73240 - [erlang] Empty erl-interface library on 24.2-1 build
Attached to Project:
Community Packages
Opened by Jill (KokaKiwi) - Monday, 03 January 2022, 11:05 GMT
Last edited by Alexander F. Rødseth (xyproto) - Wednesday, 23 February 2022, 10:27 GMT
Opened by Jill (KokaKiwi) - Monday, 03 January 2022, 11:05 GMT
Last edited by Alexander F. Rødseth (xyproto) - Wednesday, 23 February 2022, 10:27 GMT
|
Details
Description:
For some reason the package for erlang 24.2 (both erlang-24.2-1 and erlang-nox-24.2-1) contains empty build of the erl-library archives: $ ll */usr/lib/erlang/lib/erl_interface-5.1/lib erlang-24.2-1-x86_64/usr/lib/erlang/lib/erl_interface-5.1/lib: 74k libei.a 74k libei_st.a erlang-nox-24.2-1-x86_64/usr/lib/erlang/lib/erl_interface-5.1/lib: 74k libei.a 74k libei_st.a Which results in build failing for some native erlang/elixir dependencies. I haven't tried many mirrors but it seems to be Additional info: * package versions: erlang{,-nox}-24.2-1 Steps to reproduce: Just install either community/erlang-24.2-1 or community/erlang-nox-24.2-1 |
This task depends upon
Closed by Alexander F. Rødseth (xyproto)
Wednesday, 23 February 2022, 10:27 GMT
Reason for closing: Fixed
Wednesday, 23 February 2022, 10:27 GMT
Reason for closing: Fixed
I haven't tried many mirrors but it seems to be the case for most of them
for 24.2-1
```
$ du -sb $(pacman -Ql erlang | awk '/libei/{print $2}')
74254 /usr/lib/erlang/lib/erl_interface-5.1/lib/libei.a
74254 /usr/lib/erlang/lib/erl_interface-5.1/lib/libei_st.a
74254 /usr/lib/erlang/usr/lib/libei.a
74254 /usr/lib/erlang/usr/lib/libei_st.a
```
At least 24.0.4-1 is not having this issue.
```
282530 /usr/lib/erlang/lib/erl_interface-5.0/lib/libei.a
278736 /usr/lib/erlang/lib/erl_interface-5.0/lib/libei_st.a
282530 /usr/lib/erlang/usr/lib/libei.a
278736 /usr/lib/erlang/usr/lib/libei_st.a
```
https://github.com/erlang/otp/issues/5609
The objects in libei.a are reported to have LTO optimization, and they are not being found by the linker.
Note that the same problem is not found in pre-24.2-1 builds, and when the erlang is built locally from the same sources the issue doesn't show up.
As the result of stripping the produced `libei.a` archive containing object compiled with LTO don't seem to be linkable any more.
I tried to build the package without applying the strip to libei.a, and all symbols resolve successfully, so `strip` is the culprit here.
As it doesn't seem like `makepkg` has any option to exclude stripping of libraries, but it looks like this issue is getting resolved if setting CFLAGS="-ffat-lto-objects" in the configure command when building the erlang package, e.g.:
./configure CFLAGS="-mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -ffat-lto-objects" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" AR=gcc-ar RANLIB=gcc-ranlib
It needs to be addressed by the package maintainer.
286642 /usr/lib/erlang/lib/erl_interface-5.1/lib/libei.a
Can someone please confirm that this is no longer a problem?