From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4D149158087 for ; Sun, 5 Dec 2021 13:47:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 943E0E07C7; Sun, 5 Dec 2021 13:47:35 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CDCD2E07B3 for ; Sun, 5 Dec 2021 13:47:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 85D3F3434F9 for ; Sun, 5 Dec 2021 13:47:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DC09E1A0 for ; Sun, 5 Dec 2021 13:47:31 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1638711664.921da9f661e80c8ef3c07b51b4fb6acee38f62aa.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: sys-devel/gcc/, sys-devel/gcc/files/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: sys-devel/gcc/files/gcc-11-illumnos-o_directory.patch sys-devel/gcc/gcc-11.2.0.ebuild X-VCS-Directories: sys-devel/gcc/files/ sys-devel/gcc/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 921da9f661e80c8ef3c07b51b4fb6acee38f62aa X-VCS-Branch: master Date: Sun, 5 Dec 2021 13:47:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 5831d360-aeba-40a6-b2d7-70092b90a135 X-Archives-Hash: 2fb2a346e90b48ec90513204b76f181a commit: 921da9f661e80c8ef3c07b51b4fb6acee38f62aa Author: Fabian Groffen gentoo org> AuthorDate: Sun Dec 5 13:41:04 2021 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Dec 5 13:41:04 2021 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=921da9f6 sys-devel/gcc-11.2.0: add patch for Solaris Package-Manager: Portage-3.0.21-prefix, Repoman-3.0.3 Signed-off-by: Fabian Groffen gentoo.org> .../gcc/files/gcc-11-illumnos-o_directory.patch | 65 ++++++++++++++++++++++ sys-devel/gcc/gcc-11.2.0.ebuild | 2 + 2 files changed, 67 insertions(+) diff --git a/sys-devel/gcc/files/gcc-11-illumnos-o_directory.patch b/sys-devel/gcc/files/gcc-11-illumnos-o_directory.patch new file mode 100644 index 0000000000..fd212e5f47 --- /dev/null +++ b/sys-devel/gcc/files/gcc-11-illumnos-o_directory.patch @@ -0,0 +1,65 @@ +fix build on non Solaris 11 (including derivatives) + +Solaris 11 got post-release O_DIRECTORY added, so derivatives like +Illumnos-based don't have this yet. Nor does Solaris 10. +Use posix_madvise instead of madvise, because the latter isn't declared +on Solaris. + +--- a/c++tools/resolver.cc ++++ b/c++tools/resolver.cc +@@ -58,6 +58,10 @@ + #define O_CLOEXEC 0 + #endif + ++#ifndef O_DIRECTORY ++# define O_DIRECTORY 0 ++#endif ++ + #ifndef DIR_SEPARATOR + #define DIR_SEPARATOR '/' + #endif +--- a/libcody/resolver.cc ++++ b/libcody/resolver.cc +@@ -22,6 +22,10 @@ + #define HAVE_FSTATAT 0 + #endif + ++#ifndef O_DIRECTORY ++# define O_DIRECTORY 0 ++#endif ++ + // Resolver code + + #if __windows__ +--- a/libsanitizer/sanitizer_common/sanitizer_linux.cpp ++++ b/libsanitizer/sanitizer_common/sanitizer_linux.cpp +@@ -900,6 +900,9 @@ + #endif // !SANITIZER_SOLARIS + + #if !SANITIZER_NETBSD ++#ifndef O_DIRECTORY ++# define O_DIRECTORY 0 ++#endif + // ThreadLister implementation. + ThreadLister::ThreadLister(pid_t pid) : pid_(pid), buffer_(4096) { + char task_directory_path[80]; +--- a/gcc/cp/module.cc ++++ b/gcc/cp/module.cc +@@ -1631,7 +1631,7 @@ + set_error (errno); + else + { +- if (madvise (mapping, hdr.pos, MADV_RANDOM)) ++ if (posix_madvise (mapping, hdr.pos, MADV_RANDOM)) + goto fail; + + /* These buffers are never NULL in this case. */ +@@ -1742,7 +1742,7 @@ + } + /* We'll be hopping over this randomly. Some systems declare the + first parm as char *, and other declare it as void *. */ +- if (madvise (reinterpret_cast (mapping), size, MADV_RANDOM)) ++ if (posix_madvise (reinterpret_cast (mapping), size, MADV_RANDOM)) + goto fail; + + hdr.buffer = (char *)mapping; diff --git a/sys-devel/gcc/gcc-11.2.0.ebuild b/sys-devel/gcc/gcc-11.2.0.ebuild index 05c511d65c..7a6f5581fe 100644 --- a/sys-devel/gcc/gcc-11.2.0.ebuild +++ b/sys-devel/gcc/gcc-11.2.0.ebuild @@ -61,6 +61,8 @@ src_prepare() { eapply -p1 "${FILESDIR}"/${PN}-10.2.0-xcode-12.5.patch # allow building with macOS 12 eapply -p1 "${FILESDIR}"/${PN}-10.3.0-monterey.patch + # allow building on Solaris derivatives + eapply "${FILESDIR}"/${PN}-11-illumnos-o_directory.patch } src_configure() {