From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dandelion.mymedia.su (dandelion.mymedia.su [107.191.98.137]) by sourceware.org (Postfix) with ESMTPS id 2A5B83858C50 for ; Mon, 2 May 2022 14:20:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A5B83858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=guriev.su Authentication-Results: sourceware.org; spf=none smtp.mailfrom=dandelion.mymedia.su Received: by dandelion.mymedia.su (Postfix, from userid 1000) id 95722C00B3; Mon, 2 May 2022 17:20:28 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=guriev.su; s=bvj00itehu6icf4; t=1651501228; bh=rou/cjdOUPqFwX2vvTLUy5kqvEnndAoc39eVkvpLAH4=; h=Message-Id:From:Date:Subject:To:From; b=vKvv1ouAeDfuVdH9+5tRMFAYefDwqfyubkGFhuMSWxbMi+2pAtwAsBBGz+116jrtR a+hn5x9bEHj6s3u8HscaB/SMMQ67BRiZGL9YN/iaXrJfAbSyvHMpmKG/zMoo8n4Yp5 AUxpK5pTEzTMlIp6nPJp4/eqLJG2Y4cUisayAqjblEnH+qi5EfSTzpo4DdUsJAUyQs 5r1TzgxC/yXaHlQUdVPWFhEDEVfU8kPf6pO2qRt0ZNe/6eMd/AJjB4AuS0zw/IiuCq I7NxEJGbngKXu3XlsCbyrGjzIu3iBO1OQ9MVicTS0gVJj8eWuF0UC0bukfcOcVGWJg 1voSGrnhyyjcw== Message-Id: From: Nicholas Guriev Date: Mon, 2 May 2022 17:11:57 +0300 Subject: [RFC PATCH v1 0/1] Debug build? To: libc-help@sourceware.org X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, KAM_SHORT, PP_MIME_FAKE_ASCII_TEXT, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2022 14:20:31 -0000 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