FS#73409 - [erlang] strips symbols in static archives with LTO compiled objects that result in linking errors
Attached to Project:
Community Packages
Opened by Serge A (saleyn) - Tuesday, 18 January 2022, 14:39 GMT
Last edited by Alexander F. Rødseth (xyproto) - Wednesday, 26 January 2022, 11:27 GMT
Opened by Serge A (saleyn) - Tuesday, 18 January 2022, 14:39 GMT
Last edited by Alexander F. Rødseth (xyproto) - Wednesday, 26 January 2022, 11:27 GMT
|
Details
Description:
After the addition of mandatory stripping of symbols to makepkg in (https://lists.archlinux.org/pipermail/pacman-dev/2021-March/024911.html), the makepkg occasionally produces archives of LTO-compiled object files, in which the linker fails to resolve symbols. This issue was encountered in the `erlang 24.2-1` package. When built manually without applying the strip command, the produced `libei.a` works fine, and when installing it from the Arch archive, linking with `libei.a` reports unresolved symbols. See this thread, which discussed this issue: https://github.com/erlang/otp/issues/5609 Perhaps the solution would be to add an option to `makepkg` to exclude given libraries from stripping symbols? Additional info: * package version(s): erlang 24.2-1 * config and/or log files etc. This illustrates that libei.a is stripped: $ sudo pacman -U https://archive.archlinux.org/packages/e/erlang/erlang-24.2-1-x86_64.pkg.tar.zst $ du -sb /usr/lib/erlang/usr/lib/libei* 74254 /usr/lib/erlang/usr/lib/libei.a 74254 /usr/lib/erlang/usr/lib/libei_st.a Linking of a local project with it results in errors: $ g++ c_src/ei++.o c_src/exec.o c_src/exec_impl.o -lcap -L"/usr/lib/erlang/lib/erl_interface-5.1/lib" -lei -o /home/serge/projects/erl-libs/erlexec/priv/x86_64-pc-linux-gnu/exec-port) failed with return code 1 and the following output: /usr/bin/ld: c_src/ei++.o: in function `ei::Serializer::print(std::ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': /home/serge/projects/erl-libs/erlexec/c_src/ei++.cpp:62: undefined reference to `ei_s_print_term' /usr/bin/ld: c_src/ei++.o: in function `ei::Serializer::read()': /home/serge/projects/erl-libs/erlexec/c_src/ei++.cpp:145: undefined reference to `ei_decode_version' /usr/bin/ld: c_src/exec.o: in function `ei::Serializer::decodeTupleSize()': This works fine when fetching the previous version of the package which doesn't strip symbols from libei.a: $ sudo pacman -U https://archive.archlinux.org/packages/e/erlang/erlang-24.1.7-1-x86_64.pkg.tar.zst $ du -sb /usr/lib/erlang/usr/lib/libei* 282530 /usr/lib/erlang/usr/lib/libei.a 278736 /usr/lib/erlang/usr/lib/libei_st.a * link to upstream bug report, if any Steps to reproduce: 1. Install latest erlang package 2. Install rebar3: $ cd /tmp $ git clone https://github.com/erlang/rebar3.git $ cd rebar3 $ ./bootstrap $ PATH=/tmp/rebar3:$PATH 3. Try to build erlexec: $ git clone https://github.com/saleyn/erlexec.git $ make |
This task depends upon
Closed by Alexander F. Rødseth (xyproto)
Wednesday, 26 January 2022, 11:27 GMT
Reason for closing: Fixed
Wednesday, 26 January 2022, 11:27 GMT
Reason for closing: Fixed
https://lists.archlinux.org/pipermail/arch-dev-public/2021-December/030598.html
I'm able to reproduce the issue. When adding "!strip" to the PKGBUILD, the steps to reproduce works again.
The updated package will appear in [community] shortly.