https://gcc.gnu.org/g:9fbf4a6adf6212cfe762c5ade87e6e5066b5b05b
commit r15-6459-g9fbf4a6adf6212cfe762c5ade87e6e5066b5b05b Author: John David Anglin <dang...@gcc.gnu.org> Date: Sun Dec 29 14:38:09 2024 -0500 Add support to provide libiberty mkstemps in gcc 2024-12-28 John David Anglin <dang...@gcc.gnu.org> gcc/ChangeLog: PR target/118121 * configure.ac: Check for mkstemps declaration. * configure: Regenerate. * config.in: Regenerate. include/ChangeLog: * libiberty.h (mkstemps): Declare Diff: --- gcc/config.in | 7 +++++++ gcc/configure | 2 +- gcc/configure.ac | 2 +- include/libiberty.h | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gcc/config.in b/gcc/config.in index d8145a1453b4..44de5a546116 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1164,6 +1164,13 @@ #endif +/* Define to 1 if we found a declaration for 'mkstemps', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_MKSTEMPS +#endif + + /* Define to 1 if we found a declaration for 'putchar_unlocked', otherwise define to 0. */ #ifndef USED_FOR_TARGET diff --git a/gcc/configure b/gcc/configure index a8b531d8fae0..a495762724d7 100755 --- a/gcc/configure +++ b/gcc/configure @@ -12153,7 +12153,7 @@ _ACEOF for ac_func in getenv atol atoll asprintf sbrk abort atof getcwd getwd \ - madvise stpcpy strnlen strsignal strverscmp \ + madvise mkstemps stpcpy strnlen strsignal strverscmp \ strtol strtoul strtoll strtoull setenv unsetenv \ errno snprintf vsnprintf vasprintf malloc realloc calloc \ free getopt clock getpagesize ffs fmemopen clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked diff --git a/gcc/configure.ac b/gcc/configure.ac index 77fab885a428..5a178e056efb 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1652,7 +1652,7 @@ AC_CHECK_DECLS([basename(const char*), strstr(const char*,const char*)], , ,[ #include "system.h"]) gcc_AC_CHECK_DECLS(getenv atol atoll asprintf sbrk abort atof getcwd getwd \ - madvise stpcpy strnlen strsignal strverscmp \ + madvise mkstemps stpcpy strnlen strsignal strverscmp \ strtol strtoul strtoll strtoull setenv unsetenv \ errno snprintf vsnprintf vasprintf malloc realloc calloc \ free getopt clock getpagesize ffs fmemopen gcc_UNLOCKED_FUNCS, , ,[ diff --git a/include/libiberty.h b/include/libiberty.h index 6259d7d54ca6..174fefb3d759 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -199,6 +199,10 @@ extern int fdmatch (int fd1, int fd2); extern int ffs(int); #endif +#if defined (HAVE_DECL_MKSTEMPS) && !HAVE_DECL_MKSTEMPS +extern int mkstemps(char *, int); +#endif + /* Get the working directory. The result is cached, so don't call chdir() between calls to getpwd(). */