From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1147) id 53C6B385841F; Fri, 1 Dec 2023 15:47:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53C6B385841F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701445673; bh=UrDJKfdIzfKaJKNQWAGPfplwrMK/OuVIIE0NWLs/NGs=; h=From:To:Subject:Date:From; b=sugCI373hkvUyC1lHtcXeSwSerD6igRs8ziP4YEuiHt0oKG/YiirfUllXNZuD/ifd e60v1l8B6mYJS+83Fnz4GAux5s+WbfPAEbZqy+YKZchVgPFW5YEMKUMCMmCPrgfNke 7h6xz3L7RbZFpciI1fkEeG0Ms0fc2UDzxP+N+6c0= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Rainer Orth To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-6058] ada: Fix Ada bootstrap on macOS X-Act-Checkin: gcc X-Git-Author: Rainer Orth X-Git-Refname: refs/heads/master X-Git-Oldrev: 12b67d1e13b3cf14fb24cf2a1c008b73d377ff6d X-Git-Newrev: c55c2ac8db2a6447db4dd6fa8ad5c2b2ebcba298 Message-Id: <20231201154753.53C6B385841F@sourceware.org> Date: Fri, 1 Dec 2023 15:47:53 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c55c2ac8db2a6447db4dd6fa8ad5c2b2ebcba298 commit r14-6058-gc55c2ac8db2a6447db4dd6fa8ad5c2b2ebcba298 Author: Rainer Orth Date: Fri Dec 1 16:47:28 2023 +0100 ada: Fix Ada bootstrap on macOS The recent warning changes broke Ada bootstrap on macOS: adaint.c: In function '__gnat_copy_attribs': adaint.c:3336:10: error: implicit declaration of function 'utimes'; did you mean 'utime'? [-Wimplicit-function-declaration] 3336 | if (utimes (to, tbuf) == -1) { | ^~~~~~ | utime adaint.c: In function '__gnat_kill': adaint.c:3597:3: error: implicit declaration of function 'kill' [-Wimplicit-function-declaration] 3597 | kill (pid, sig); | ^~~~ terminals.c: In function 'allocate_pty_desc': terminals.c:1196:12: error: implicit declaration of function 'openpty'; did you mean 'openat'? [-Wimplicit-function-declaration] 1196 | status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL); | ^~~~~~~ | openat terminals.c: In function '__gnat_setup_winsize': terminals.c:1392:6: error: implicit declaration of function 'kill' [-Wimplicit-function-declaration] 1392 | kill (desc->child_pid, SIGWINCH); | ^~~~ This patch fixes this by including the necessary headers: for utimes, for kill, and for openpty. With those changes, the build completed on x86_64-apple-darwin2[0-3] (make check still running). 2023-12-01 Rainer Orth gcc/ada: * adaint.c [__APPLE__]: Include , . * terminals.c [!_WIN32]: Include . [__APPLE__]: Include . Fix typos. Diff: --- gcc/ada/adaint.c | 2 ++ gcc/ada/terminals.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 9bb3054d6a3..cbff393258e 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -85,6 +85,8 @@ #if defined (__APPLE__) #include +#include +#include #include #endif diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c index c0ee4a16bb1..14de0feb32a 100644 --- a/gcc/ada/terminals.c +++ b/gcc/ada/terminals.c @@ -31,7 +31,7 @@ #define ATTRIBUTE_UNUSED __attribute__((unused)) -/* First all usupported platforms. Add stubs for exported routines. */ +/* First all unsupported platforms. Add stubs for exported routines. */ #if defined (VMS) || defined (__vxworks) || defined (__Lynx__) \ || defined (__ANDROID__) || defined (__PikeOS__) || defined(__DJGPP__) @@ -1089,7 +1089,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, { } -#else /* defined(_WIN32, implementatin for all UNIXes */ +#else /* defined(_WIN32, implementation for all UNIXes */ /* First defined some macro to identify easily some systems */ #if defined (__FreeBSD__) \ @@ -1104,6 +1104,7 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, #include #include #include +#include #include #include #include @@ -1121,6 +1122,9 @@ __gnat_setup_winsize (void *desc ATTRIBUTE_UNUSED, #if defined (__hpux__) # include #endif +#if defined (__APPLE__) +# include +#endif #define CDISABLE _POSIX_VDISABLE