Package installs static libraries with bitcode
Description:
Some of the libraries installed by protobuf seem to be static archives (.a
) containing only GCC bitcode (presumably from option=(lto)
used for builds in Arch), making parts of the library unusable for non-LTO environment:
$ pacman -Qql protobuf | grep '\.a$' | xargs readelf -s
File: /usr/lib/libutf8_range.a(naive.c.o)
Symbol table '.symtab' contains 2 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000001 1 OBJECT GLOBAL DEFAULT COM __gnu_lto_slim
File: /usr/lib/libutf8_range.a(range2-neon.c.o)
Symbol table '.symtab' contains 2 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000001 1 OBJECT GLOBAL DEFAULT COM __gnu_lto_slim
File: /usr/lib/libutf8_range.a(range2-sse.c.o)
Symbol table '.symtab' contains 2 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000001 1 OBJECT GLOBAL DEFAULT COM __gnu_lto_slim
File: /usr/lib/libutf8_validity.a(utf8_validity.cc.o)
Symbol table '.symtab' contains 2 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000001 1 OBJECT GLOBAL DEFAULT COM __gnu_lto_slim
Sample build log:
$ cmake --build build -v
Change Dir: '/home/intelfx/protobuf-issue-2/build'
Run Build Command(s): /home/intelfx/bin/wrappers/ninja -v
[1/2] /usr/lib/ccache/bin/c++ -MD -MT CMakeFiles/hello.dir/main.cpp.o -MF CMakeFiles/hello.dir/main.cpp.o.d -o CMakeFiles/hello.dir/main.cpp.o -c /home/intelfx/protobuf-issue-2/main.cpp
[2/2] : && /usr/lib/ccache/bin/c++ CMakeFiles/hello.dir/main.cpp.o -o hello -lutf8_validity && :
FAILED: hello
: && /usr/lib/ccache/bin/c++ CMakeFiles/hello.dir/main.cpp.o -o hello -lutf8_validity && :
/usr/bin/ld: CMakeFiles/hello.dir/main.cpp.o: in function `main':
main.cpp:(.text+0xb2): undefined reference to `utf8_range::IsStructurallyValid(std::basic_string_view<char, std::char_traits<char> >)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Suggest applying https://github.com/protocolbuffers/protobuf/pull/14867.
Additional info:
- package version(s): protobuf 25.3-1
- config and/or log files: above
- link to upstream bug report, if any: N/A
- sample project: protobuf-issue-2.tar.zst
Steps to reproduce:
- Build the attached sample project