public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-cpp/folly/, dev-cpp/folly/files/
Date: Fri, 12 Aug 2022 18:40:37 +0000 (UTC)	[thread overview]
Message-ID: <1660329583.4ad0d9de826a89b6ff0dec451e73bbeecd93e4a8.sam@gentoo> (raw)

commit:     4ad0d9de826a89b6ff0dec451e73bbeecd93e4a8
Author:     brahmajit das <listout <AT> protonmail <DOT> com>
AuthorDate: Wed Aug 10 10:37:58 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 12 18:39:43 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ad0d9de

dev-cpp/folly: Fix musl build

Fixes "ELFCLASSFOLLY_ELF_NATIVE_CLASS was not declared in this scope".

Elf.cpp expects __ELF_NATIVE_CLASS to be defined at least for platforms
besides FreeBSD-based ones, and so it defines FOLLY_ELF_NATIVE_CLASS
with it. Without __ELF_NATIVE_CLASS (and apparently musl does not define
it), FOLLY_ELF_NATIVE_CLASS is also not defined so what was supposed to
be expanded to ELFCLASS32 or ELFCLASS64 ends up being
ELFCLASSFOLLY_ELF_NATIVE_CLASS.

Please refer: https://github.com/facebook/folly/issues/1478#issuecomment-719883898

Closes: https://bugs.gentoo.org/835744
Signed-off-by: brahmajit das <listout <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/26807
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../folly/files/folly-2022.07.04.00-musl-fix.patch | 36 ++++++++++++++++++++++
 dev-cpp/folly/folly-2022.07.04.00.ebuild           |  4 +++
 2 files changed, 40 insertions(+)

diff --git a/dev-cpp/folly/files/folly-2022.07.04.00-musl-fix.patch b/dev-cpp/folly/files/folly-2022.07.04.00-musl-fix.patch
new file mode 100644
index 000000000000..001af39625c5
--- /dev/null
+++ b/dev-cpp/folly/files/folly-2022.07.04.00-musl-fix.patch
@@ -0,0 +1,36 @@
+# Elf.cpp expects __ELF_NATIVE_CLASS to be defined at least for platforms
+# besides FreeBSD-based ones, and so it defines FOLLY_ELF_NATIVE_CLASS with it.
+# Without __ELF_NATIVE_CLASS (and apparently musl does not define it),
+# FOLLY_ELF_NATIVE_CLASS is also not defined so what was supposed to be
+# expanded to ELFCLASS32 or ELFCLASS64 ends up being
+# ELFCLASSFOLLY_ELF_NATIVE_CLASS.
+#
+# Please refer: https://github.com/facebook/folly/issues/1478
+#
+# Closes: https://bugs.gentoo.org/835744
+--- a/folly/experimental/symbolizer/Elf.cpp
++++ b/folly/experimental/symbolizer/Elf.cpp
+@@ -39,12 +39,10 @@
+
+ #if defined(__ELF_NATIVE_CLASS)
+ #define FOLLY_ELF_NATIVE_CLASS __ELF_NATIVE_CLASS
+-#elif defined(__FreeBSD__)
+-#if defined(__LP64__)
++#elif defined(__LP64__)
+ #define FOLLY_ELF_NATIVE_CLASS 64
+ #else
+ #define FOLLY_ELF_NATIVE_CLASS 32
+-#endif
+ #endif // __ELF_NATIVE_CLASS
+
+ namespace folly {
+--- a/folly/experimental/symbolizer/Elf.h
++++ b/folly/experimental/symbolizer/Elf.h
+@@ -24,6 +24,7 @@
+ #include <initializer_list>
+ #include <stdexcept>
+ #include <system_error>
++#include <sys/types.h>
+
+ #include <folly/Conv.h>
+ #include <folly/Likely.h>

diff --git a/dev-cpp/folly/folly-2022.07.04.00.ebuild b/dev-cpp/folly/folly-2022.07.04.00.ebuild
index e4b9470d848e..4107d94ca13b 100644
--- a/dev-cpp/folly/folly-2022.07.04.00.ebuild
+++ b/dev-cpp/folly/folly-2022.07.04.00.ebuild
@@ -39,6 +39,10 @@ DEPEND="${RDEPEND}
 	sys-libs/binutils-libs"
 BDEPEND="test? ( sys-devel/clang )"
 
+PATCHES=(
+	"${FILESDIR}/${PN}"-2022.07.04.00-musl-fix.patch
+)
+
 pkg_setup() {
 	[[ ${BUILD_TYPE} == "binary" ]] && return
 


             reply	other threads:[~2022-08-12 18:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12 18:40 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-11-25  6:21 [gentoo-commits] repo/gentoo:master commit in: dev-cpp/folly/, dev-cpp/folly/files/ Sam James
2024-11-11 22:25 Sam James
2025-04-24 23:33 Sam James
2025-10-30  8:11 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1660329583.4ad0d9de826a89b6ff0dec451e73bbeecd93e4a8.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox