Hello everyone! How do I get rid of in GDB from glibc sources? I am used to the -O0 compiler flag in this case, but the libc-symbols.h file blocks non-optimized build. For what reason? I have built glibc with CFLAGS='-ggdb3 -Og' but they still do too many optimizations so the debugger cannot see local variables. And there is a similar bug report in GCC, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78685 Can we fix this on glibc side? I am attaching a work-in-progress patch that removes an #error directive and adds some __always_inline optimizations to strictly necessary functions. Unfortunately, I don't fully understand which consequences it may imply. But if glibc developers are interested, I'll be happy to putt the patch in order. Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7fd6b1c in elf_machine_rela (skip_ifunc=0, reloc_addr_arg=0x7ffff7fb9fe0, version=0x18, sym=0x7ffff7fb6330, reloc=0x7ffff7fb64b0, scope=0x7ffff7fbc148, map=0x7ffff7fbbdc0) at ../sysdeps/x86_64/dl-machine.h:280 (gdb) i locals _lr = _tc = 4 v = 0x0 refsym = 0x7ffff7fb6330 sym_map = value = reloc_addr = 0x7ffff7fb9fe0 r_type = 6 reloc_addr = r_type = print_err = refsym = sym_map = value = _lr = _tc = v = strtab = fmt = td = strtab = (gdb) bt #0 0x00007ffff7fd6b1c in elf_machine_rela (skip_ifunc=0, reloc_addr_arg=0x7ffff7fb9fe0, version=0x18, sym=0x7ffff7fb6330, reloc=0x7ffff7fb64b0, scope=0x7ffff7fbc148, map=0x7ffff7fbbdc0) at ../sysdeps/x86_64/dl-machine.h:280 #1 0x00007ffff7fd6b1c in elf_dynamic_do_Rela (skip_ifunc=, lazy=, nrelative=, relsize=, reladdr=, scope=, map=0x7ffff7fbbdc0) at /home/mymedia/код/система/glibc/elf/do-rel.h:147 #2 0x00007ffff7fd6b1c in _dl_relocate_object (l=, scope=, reloc_mode=, consider_profiling=) at dl-reloc.c:288 #3 0x00007ffff7fe8450 in dl_main (phdr=, phnum=, user_entry=, auxv=) at rtld.c:2288 #4 0x00007ffff7fe32c5 in _dl_sysdep_start (start_argptr=, dl_main=0x7ffff7fe60df ) at ../sysdeps/unix/sysv/linux/dl-sysdep.c:140 #5 0x00007ffff7fe5ffe in _dl_start_final (arg=0x7fffffffd7c0) at rtld.c:510 #6 0x00007ffff7fe5ffe in _dl_start (arg=0x7fffffffd7c0) at rtld.c:597 #7 0x00007ffff7fe3bd8 in _start () from /home/mymedia/код/система/glibc/build/elf/ld.so Nicholas Guriev (1): draft: Make non-optimized build possible include/alloc_buffer.h | 76 ++++++++++++++++-------------- include/libc-symbols.h | 6 +-- include/rtld-malloc.h | 8 ++-- locale/programs/locfile.h | 2 +- nscd/nscd-client.h | 2 +- resolv/gai_misc.c | 2 +- rt/aio_misc.c | 2 +- sysdeps/nptl/gai_misc.h | 4 +- sysdeps/unix/sysv/linux/aio_misc.h | 4 +- 9 files changed, 56 insertions(+), 50 deletions(-) -- 2.32.0