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 <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.
This commit is contained in:
Thomas Schwinge 2023-01-24 09:49:34 +01:00
parent 7bffe9d3e0
commit d90a8a5685
2 changed files with 11 additions and 1 deletions

View 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>

View File

@ -19,11 +19,16 @@
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 **);