public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: Jonathan Yong <10walls@gmail.com>, Jan Hubicka <hubicka@ucw.cz>,
	Richard Biener <richard.guenther@gmail.com>,
	Alexander Monakov <amonakov@ispras.ru>
Subject: [PATCH] libgcov: Call __builtin_fork instead of fork
Date: Sat, 02 Dec 2023 13:43:22 +0100	[thread overview]
Message-ID: <87edg4epw5.fsf@oldenburg.str.redhat.com> (raw)

Some targets do not provide a prototype for fork, and compilation now
fails with an implicit-function-declaration error.

libgcc/

	* libgcov-interface.c (__gcov_fork):

Generated code is the same on x86_64-linux-gnu.  Okay for trunk?

Thanks,
Florian
---
 libgcc/libgcov-interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgcc/libgcov-interface.c b/libgcc/libgcov-interface.c
index b2ee9308641..d166e98510d 100644
--- a/libgcc/libgcov-interface.c
+++ b/libgcc/libgcov-interface.c
@@ -182,7 +182,7 @@ pid_t
 __gcov_fork (void)
 {
   pid_t pid;
-  pid = fork ();
+  pid = __builtin_fork ();
   if (pid == 0)
     {
       __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_mx);

base-commit: 193ef02a7f4f3e5349ad9cf8d3d4df466a99b677


             reply	other threads:[~2023-12-02 12:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-02 12:43 Florian Weimer [this message]
2023-12-08 14:07 ` Jakub Jelinek
2023-12-08 15:28   ` Florian Weimer

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=87edg4epw5.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=10walls@gmail.com \
    --cc=amonakov@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=richard.guenther@gmail.com \
    /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).