public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] ada: Fix Ada bootstrap on FreeBSD
@ 2023-12-11 10:30 Rainer Orth
  2023-12-11 10:32 ` Marc Poulhiès
  0 siblings, 1 reply; 2+ messages in thread
From: Rainer Orth @ 2023-12-11 10:30 UTC (permalink / raw)
  To: gcc-patches; +Cc: Arnaud Charlet, Marc Poulhiès

[-- Attachment #1: Type: text/plain, Size: 1427 bytes --]

Ada bootstrap on FreeBSD/amd64 was also broken by the recent warning
changes:

terminals.c: In function 'allocate_pty_desc':
terminals.c:1200:12: error: implicit declaration of function 'openpty'; did you
mean 'openat'? [-Wimplicit-function-declaration]
 1200 |   status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
      |            ^~~~~~~
      |            openat

terminals.c: At top level:
terminals.c:1268:9: warning: "TABDLY" redefined
 1268 | #define TABDLY 0
      |         ^~~~~~
In file included from /usr/include/termios.h:38,
                 from terminals.c:1109:
/usr/include/sys/_termios.h:111:9: note: this is the location of the previous definition
  111 | #define TABDLY          0x00000004      /* tab delay mask */
      |         ^~~~~~
make[7]: *** [../gcc-interface/Makefile:302: terminals.o] Error 1

Fixed by including the necessary header and guarding the fallback
definition of TABDLY.

This allowed a 64-bit-only bootstrap on x86_64-unknown-freebsd14.0 to
complete successfully.  Multilibbed bootstrap is still broken for
unrelated reasons, cf. PR ada/ada/112958.

Ok for trunk?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2023-12-11  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc/ada:
	* terminals.c [__FreeBSD__]: Include <libutil.h>.
	(TABDLY): Only define if missing.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: local.patch --]
[-- Type: text/x-patch, Size: 569 bytes --]

diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
--- a/gcc/ada/terminals.c
+++ b/gcc/ada/terminals.c
@@ -1125,6 +1125,9 @@ void
 #if defined (__APPLE__)
 #   include <util.h>
 #endif
+#if defined (__FreeBSD__)
+#   include <libutil.h>
+#endif
 
 #define CDISABLE _POSIX_VDISABLE
 
@@ -1265,11 +1268,13 @@ allocate_pty_desc (pty_desc **desc) {
 #ifndef NLDLY
 #define NLDLY 0
 #define CRDLY 0
-#define TABDLY 0
 #define BSDLY 0
 #define VTDLY 0
 #define FFDLY 0
 #endif
+#ifndef TABDLY
+#define TABDLY 0
+#endif
 
 /* child_setup_tty - set terminal properties
  *

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ada: Fix Ada bootstrap on FreeBSD
  2023-12-11 10:30 [PATCH] ada: Fix Ada bootstrap on FreeBSD Rainer Orth
@ 2023-12-11 10:32 ` Marc Poulhiès
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Poulhiès @ 2023-12-11 10:32 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, Arnaud Charlet


Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> Ada bootstrap on FreeBSD/amd64 was also broken by the recent warning
> changes:
>
> terminals.c: In function 'allocate_pty_desc':
> terminals.c:1200:12: error: implicit declaration of function 'openpty'; did you
> mean 'openat'? [-Wimplicit-function-declaration]
>  1200 |   status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
>       |            ^~~~~~~
>       |            openat
>
> terminals.c: At top level:
> terminals.c:1268:9: warning: "TABDLY" redefined
>  1268 | #define TABDLY 0
>       |         ^~~~~~
> In file included from /usr/include/termios.h:38,
>                  from terminals.c:1109:
> /usr/include/sys/_termios.h:111:9: note: this is the location of the previous definition
>   111 | #define TABDLY          0x00000004      /* tab delay mask */
>       |         ^~~~~~
> make[7]: *** [../gcc-interface/Makefile:302: terminals.o] Error 1
>
> Fixed by including the necessary header and guarding the fallback
> definition of TABDLY.
>
> This allowed a 64-bit-only bootstrap on x86_64-unknown-freebsd14.0 to
> complete successfully.  Multilibbed bootstrap is still broken for
> unrelated reasons, cf. PR ada/ada/112958.

Hello Rainer,

> Ok for trunk?

OK !

Thanks,
Marc

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-11 10:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11 10:30 [PATCH] ada: Fix Ada bootstrap on FreeBSD Rainer Orth
2023-12-11 10:32 ` Marc Poulhiès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).