public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/95244] New: GCC 10 no longer builds on RHEL5 [trivial patch]
@ 2020-05-20 19:00 lopresti at gmail dot com
  2020-05-21  8:05 ` [Bug sanitizer/95244] " marxin at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: lopresti at gmail dot com @ 2020-05-20 19:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95244

            Bug ID: 95244
           Summary: GCC 10 no longer builds on RHEL5 [trivial patch]
           Product: gcc
           Version: 10.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lopresti at gmail dot com
  Target Milestone: ---

I still compile GCC on Red Hat Enterprise Linux 5. It is an EoL platform, so
maybe you do not care... But the only problem (introduced with GCC 10) is the
lack of O_CLOEXEC. The following patch fixes my build:

diff --git a/libsanitizer/sanitizer_common/sanitizer_posix.cpp
b/libsanitizer/sanitizer_common/sanitizer_posix.cpp
index d890a3a3177..6ba525d1811 100644
--- a/libsanitizer/sanitizer_common/sanitizer_posix.cpp
+++ b/libsanitizer/sanitizer_common/sanitizer_posix.cpp
@@ -347,8 +347,14 @@ int GetNamedMappingFd(const char *name, uptr size, int
*flags) {
   CHECK(internal_strlen(name) < sizeof(shmname) - 10);
   internal_snprintf(shmname, sizeof(shmname), "/dev/shm/%zu [%s]",
                     internal_getpid(), name);
+#if defined O_CLOEXEC
   int fd = ReserveStandardFds(
       internal_open(shmname, O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC,
S_IRWXU));
+#else
+  int fd = ReserveStandardFds(
+      internal_open(shmname, O_RDWR | O_CREAT | O_TRUNC, S_IRWXU));
+  fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif

I would be happy to make this a pull request if there is any chance it would
get accepted. Thanks.

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

end of thread, other threads:[~2023-07-07  8:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20 19:00 [Bug bootstrap/95244] New: GCC 10 no longer builds on RHEL5 [trivial patch] lopresti at gmail dot com
2020-05-21  8:05 ` [Bug sanitizer/95244] " marxin at gcc dot gnu.org
2020-05-21 17:06 ` lopresti at gmail dot com
2021-08-15 20:35 ` nightstrike at gmail dot com
2021-08-15 20:53 ` [Bug sanitizer/95244] [10 Regression] " pinskia at gcc dot gnu.org
2022-06-28 10:40 ` jakub at gcc dot gnu.org
2023-07-07  8:53 ` rguenth at gcc dot gnu.org

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).