public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom de Vries <vries@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] [gdb/testsuite] Add missing include in gdb.base/rtld-step.exp
Date: Thu, 28 Mar 2024 05:52:01 +0000 (GMT)	[thread overview]
Message-ID: <20240328055201.7F15A3858D20@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6ccf769a1790b90a85e0b4912a42117eb7c1e108

commit 6ccf769a1790b90a85e0b4912a42117eb7c1e108
Author: Tom de Vries <tdevries@suse.de>
Date:   Thu Mar 28 06:51:59 2024 +0100

    [gdb/testsuite] Add missing include in gdb.base/rtld-step.exp
    
    On fedora rawhide, with test-case gdb.base/rtld-step.exp I get:
    ...
    static-pie-static-libc.c: In function '_start':^M
    static-pie-static-libc.c:1:22: error: \
      implicit declaration of function '_exit' [-Wimplicit-function-declaration]^M
        1 | void _start (void) { _exit (0); }^M
          |                      ^~~~~^M
    compiler exited with status 1
      ...
    UNTESTED: gdb.base/rtld-step.exp: failed to compile \
      (-static-pie not supported or static libc missing)
    ...
    
    Fix this by adding the missing include.
    
    Tested on aarch64-linux.
    
    Approved-by: Kevin Buettner <kevinb@redhat.com>

Diff:
---
 gdb/testsuite/gdb.base/rtld-step.exp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/rtld-step.exp b/gdb/testsuite/gdb.base/rtld-step.exp
index 53725833aa1..198542886cc 100644
--- a/gdb/testsuite/gdb.base/rtld-step.exp
+++ b/gdb/testsuite/gdb.base/rtld-step.exp
@@ -86,7 +86,10 @@ set rtld_flags [list debug additional_flags=[list -static-pie -fPIE \
 						  -nostdlib -static -lc]]
 
 if { ![gdb_can_simple_compile static-pie-static-libc \
-	   "void _start (void) { _exit (0); }" \
+	   {
+	       #include <unistd.h>
+	       void _start (void) { _exit (0); }
+	   } \
 	   executable $rtld_flags] } {
     set reason "-static-pie not supported or static libc missing"
     untested "failed to compile ($reason)"

                 reply	other threads:[~2024-03-28  5:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240328055201.7F15A3858D20@sourceware.org \
    --to=vries@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).