Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#58604 - [compiler-rt] do not strip libraries
Attached to Project:
Arch Linux
Opened by Peter Wu (Lekensteyn) - Tuesday, 15 May 2018, 09:40 GMT
Last edited by Evangelos Foutras (foutrelis) - Thursday, 17 May 2018, 08:09 GMT
Opened by Peter Wu (Lekensteyn) - Tuesday, 15 May 2018, 09:40 GMT
Last edited by Evangelos Foutras (foutrelis) - Thursday, 17 May 2018, 08:09 GMT
|
DetailsDescription:
compiler-rt provides the runtime library for ASAN which also contains functions for debuggers. Due to stripping its symbols, this happens though: $ echo 'int main(int argc, char *argv[]) {}' > main.c $ clang -fsanitize=address -g main.c $ gdb -q -batch -ex start -ex 'call __asan_describe_address(argv)' ./a.out '__asan_describe_address' has unknown return type; cast the call to its declared return type Linking against libasan.so from GCC or against a local compiler-rt build with symbols gives the expected result: $ clang -fsanitize=address -g main.c -c $ clang main.o /usr/lib/libasan.so.5 -pthread -ldl -lrt $ gdb -q -batch -ex start -ex 'call __asan_describe_address(argv)' ./a.out Address 0x7fffffffe398 is located in stack of thread T0 Current workaround is to cast the result: (gdb) call (void)__asan_describe_address(argv) Additional info: * compiler-rt 6.0.0-1 |
This task depends upon
Closed by Evangelos Foutras (foutrelis)
Thursday, 17 May 2018, 08:09 GMT
Reason for closing: Deferred
Additional comments about closing: Changed behavior in GDB 8.1 which now requires specifying return type of called function when no debug information is available. This might be resolved in the future if Arch ships debugging symbols as supplemental split packages.
Thursday, 17 May 2018, 08:09 GMT
Reason for closing: Deferred
Additional comments about closing: Changed behavior in GDB 8.1 which now requires specifying return type of called function when no debug information is available. This might be resolved in the future if Arch ships debugging symbols as supplemental split packages.
If you know of another way to implement this, I'm open to suggestions.
Previously I looked at stripping the library and played with "-K" (--keep-symbol), but it did have the intended effect.
Other ideas:
- somehow compress the debug section
- provide a split -dbg package
Looking at what others distro do, they seem to rely on a separate debug package:
https://src.fedoraproject.org/rpms/compiler-rt/blob/master/f/compiler-rt.spec
Debian/Ubuntu however do not include symbols either.
https://packages.debian.org/stretch/amd64/libclang-common-3.9-dev/filelist
(I checked libclang-common-5.0-dev 1:5.0-3~16.04.1 on Ubuntu 16.04)
Upon further investigation, it might be an issue with GDB. Test program:
#include <stdio.h>
void foo(){puts("foo");}
int main(){}
make foo.c && strip --strip-debug foo.c
Then "p foo()" executed "foo" successfully on 7.11.1-0ubuntu1~16.5,
but not on Arch gdb 8.1 (same error as with __asan_describe_address)
Seems like your observation is spot-on: https://sourceware.org/ml/gdb-patches/2017-07/msg00137.html
The new behavior appears to be documented at: https://sourceware.org/gdb/onlinedocs/gdb/Calling.html (under "Calling functions with no debug info")
I guess there is not much to do here, other than Arch packaging debugging symbols separately sometime in the future (AFAIK there are no such plans yet).
Thanks for following up on this.