]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Make 'libgcc/config/nvptx/crt0.c' build '--without-headers'
authorThomas Schwinge <thomas@codesourcery.com>
Tue, 24 Jan 2023 08:49:34 +0000 (09:49 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Tue, 24 Jan 2023 08:55:37 +0000 (09:55 +0100)
..., where it currently fails:

    [...]/libgcc/config/nvptx/crt0.c:22:10: fatal error: stdlib.h: No such file or directory
       22 | #include <stdlib.h>
          |          ^~~~~~~~~~

Fix-up for "nvptx: Support global constructors/destructors via 'collect2'".

libgcc/
* config/nvptx/crt0.c [!HAVE_STDLIB_H]: Don't '#include <stdlib.h>'.
(atexit): Prototype.

libgcc/ChangeLog.omp
libgcc/config/nvptx/crt0.c

index c46f49bf5b7544b2b03269bf7187e65aa3a5a22c..cf509a70d61fec8bb381a6b0ae46907fd7cd9a0a 100644 (file)
@@ -1,3 +1,8 @@
+2023-01-24  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * config/nvptx/crt0.c [!HAVE_STDLIB_H]: Don't '#include <stdlib.h>'.
+       (atexit): Prototype.
+
 2023-01-20  Thomas Schwinge  <thomas@codesourcery.com>
            Andrew Stubbs  <ams@codesourcery.com>
 
index 860e2bfacadd739d2e7f1da57723d28da65fd716..02648bef84bcbf342323eafda0f1e406ef59d27f 100644 (file)
    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <stdlib.h>
+#include "auto-target.h"
+
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#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 **);