From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id DADAB3858438; Tue, 24 Jan 2023 08:56:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DADAB3858438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674550575; bh=yvWsLT/MSDJJRLdH04zA+mlEeqTz9E/pSta+bFZUPio=; h=From:To:Subject:Date:From; b=p4S0g5u2S972kn4ao+0JH/OysGLsLUwX1fVgp8MpnBXN0DrEN70Wv8ybBqDpr1UAq qHUi7d9mD6beWgiftu2/fsmmUUEnB61Dy5lok/yD4elGp7Cpb0kvlV1iANmk0PxTGa iTnh1rS4UTIONG29RJr82xEYFgeDp6qM6YgxvCtQ= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/omp/gcc-12] Make 'libgcc/config/nvptx/crt0.c' build '--without-headers' X-Act-Checkin: gcc X-Git-Author: Thomas Schwinge X-Git-Refname: refs/heads/devel/omp/gcc-12 X-Git-Oldrev: 7bffe9d3e0cd91ccf3ccff9fa71a1d24faae047a X-Git-Newrev: d90a8a5685c8bd3657892feac01739fe87a457a5 Message-Id: <20230124085615.DADAB3858438@sourceware.org> Date: Tue, 24 Jan 2023 08:56:15 +0000 (GMT) List-Id: https://gcc.gnu.org/g:d90a8a5685c8bd3657892feac01739fe87a457a5 commit d90a8a5685c8bd3657892feac01739fe87a457a5 Author: Thomas Schwinge Date: Tue Jan 24 09:49:34 2023 +0100 Make 'libgcc/config/nvptx/crt0.c' build '--without-headers' ..., where it currently fails: [...]/libgcc/config/nvptx/crt0.c:22:10: fatal error: stdlib.h: No such file or directory 22 | #include | ^~~~~~~~~~ Fix-up for "nvptx: Support global constructors/destructors via 'collect2'". libgcc/ * config/nvptx/crt0.c [!HAVE_STDLIB_H]: Don't '#include '. (atexit): Prototype. Diff: --- libgcc/ChangeLog.omp | 5 +++++ libgcc/config/nvptx/crt0.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libgcc/ChangeLog.omp b/libgcc/ChangeLog.omp index c46f49bf5b7..cf509a70d61 100644 --- a/libgcc/ChangeLog.omp +++ b/libgcc/ChangeLog.omp @@ -1,3 +1,8 @@ +2023-01-24 Thomas Schwinge + + * config/nvptx/crt0.c [!HAVE_STDLIB_H]: Don't '#include '. + (atexit): Prototype. + 2023-01-20 Thomas Schwinge Andrew Stubbs diff --git a/libgcc/config/nvptx/crt0.c b/libgcc/config/nvptx/crt0.c index 860e2bfacad..02648bef84b 100644 --- a/libgcc/config/nvptx/crt0.c +++ b/libgcc/config/nvptx/crt0.c @@ -19,11 +19,16 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -#include +#include "auto-target.h" + +#ifdef HAVE_STDLIB_H +# include +#endif #include "gbl-ctors.h" int *__exitval_ptr; +extern int atexit (void (*function) (void)); extern void __attribute__((noreturn)) exit (int status); extern int main (int, void **);