From patchwork Fri Dec 1 15:14:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 81118 X-Patchwork-Delegate: dkm@kataplop.net Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F820385C6E2 for ; Fri, 1 Dec 2023 15:14:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 58F913858415 for ; Fri, 1 Dec 2023 15:14:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 58F913858415 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cebitec.uni-bielefeld.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 58F913858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=129.70.160.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701443670; cv=none; b=sH60JAAmDuP2zTkfUEZCmfr77Nz+maNIlXQ2RK7FafEtSn4XBBmI8GwR2kva6RSYxHY9nimWDXIkJB+H84/pYnAVA7XC/Jrb4aEZp4QK4i+rN4ORy6wpLwT+gDPytMRw7/0ndUdAHhA0FMja31Je7xKdGTl/0imGIcvfrBpg9YE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701443670; c=relaxed/simple; bh=/0Yr8DZ1aKaPRgkivEvxdGcgwg5pvwjvNLTxGz9wGIE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=iL+E3ipjC5V6ldw4YCpec6IlX01gipOUllJncWBKhbBibHNqymVFam3iSl0l/9H8ENeKMgZudxEHSgV9ka3uhQC8G2dJ+eR/sJ29kG9yC1PwWY5EV4PSqUzk3yt0P+SeBaeQkq7bGIUWth+j5fFyp6bnvtP7YQMr13zNcFtMiAw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 356C8C9700; Fri, 1 Dec 2023 16:14:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= cebitec.uni-bielefeld.de; h=content-type:content-type :mime-version:user-agent:message-id:date:date:subject:subject :from:from:received:received; s=20200306; t=1701443667; bh=/0Yr8 DZ1aKaPRgkivEvxdGcgwg5pvwjvNLTxGz9wGIE=; b=jzr1cvabSXqXr55Zjs18j pcXvYrdBIvDIsa/IfVlFtcxsP1fOq0nywdp7+MQHeIHVzFaz7FARuAdm7zuKMcyn 34BkJXG/8hRHgMt9Patf/H5QIgepzY0DQZzQCoPUJOEa9I3TIhDKQx6WHCf53rFW wd+a5gSZa1C5Xv3+ohNbMmUaKDzIeEbKWXAS9NnUkg/09PqE7hTOj8t8/nU+taG5 ILPcGMsO88lhnzTg3TMVjZBqlhGWRcshJ92qvN7a8m+NnA56GvaRxqxmXQnW31nK LdTPlS8MRVnhqsuGFyPTwQKtpkxPHddxo2Gc006ZrjnN45FsTKYHytnDFbrvhrtC w== X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IbSHGeNBtpJF; Fri, 1 Dec 2023 16:14:27 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p4fddb508.dip0.t-ipconnect.de [79.221.181.8]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 91E9DC9396; Fri, 1 Dec 2023 16:14:27 +0100 (CET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Arnaud Charlet , Marc =?utf-8?b?UG91bGhpw6hz?= , Iain Sandoe Subject: [PATCH] ada: Fix Ada bootstrap on macOS Date: Fri, 01 Dec 2023 16:14:27 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 X-Spam-Status: No, score=-3791.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org 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). Ok for trunk? Rainer diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c --- 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 --- 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 @@ void { } -#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 @@ void #include #include #include +#include #include #include #include @@ -1121,6 +1122,9 @@ void #if defined (__hpux__) # include #endif +#if defined (__APPLE__) +# include +#endif #define CDISABLE _POSIX_VDISABLE