public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/ffcall/files/, dev-libs/ffcall/
@ 2025-10-09  7:41 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2025-10-09  7:41 UTC (permalink / raw
  To: gentoo-commits

commit:     339cd8ea9eeccb01d66044ac201c5fb2e61638a7
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Fri Jun 13 03:54:54 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct  9 07:40:36 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=339cd8ea

dev-libs/ffcall: revert patch of support for clang

which is a problem for release 2.4 but fixed in 2.5.

The bug is:

> libtool: compile:  clang -O2 -pipe -g -fPIC -x none -c avcall-x86_64.s -fPIC -DPIC -o .libs/avcall-x86_64.o
> avcall-x86_64.s:591:2: error: changed section flags for .eh_frame, expected: 0x2
>  .section .eh_frame,"aw",@progbits

Which is fixed by change flags "aw" to "a" on all platforms, see commit below:
> https://git.savannah.gnu.org/cgit/libffcall.git/commit/?id=580f0bb144c0d63560c61229291e172e55971437

So the old patch (add "-no-integrated-as" for clang) is reverted:
> https://git.savannah.gnu.org/cgit/libffcall.git/commit/?id=fe6d9f089d8326b077420c10fec8c2174557be30

Fixes: 5b89df93ef88388f452bf3d2caf6337c5314395d
Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42572
Closes: https://github.com/gentoo/gentoo/pull/42572
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/ffcall/ffcall-2.5.ebuild                  |  7 +--
 .../files/ffcall-2.5-add-support-for-clang.patch   | 53 ----------------------
 2 files changed, 1 insertion(+), 59 deletions(-)

diff --git a/dev-libs/ffcall/ffcall-2.5.ebuild b/dev-libs/ffcall/ffcall-2.5.ebuild
index 0b840ffa2e98..2613cf395d73 100644
--- a/dev-libs/ffcall/ffcall-2.5.ebuild
+++ b/dev-libs/ffcall/ffcall-2.5.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit autotools dot-a flag-o-matic libtool
+inherit dot-a flag-o-matic libtool
 
 MY_PV="libffcall-${PV}"
 
@@ -19,10 +19,6 @@ LICENSE="GPL-2+"
 SLOT="0"
 KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~mips ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
 
-PATCHES=(
-	"${FILESDIR}"/ffcall-2.5-add-support-for-clang.patch
-)
-
 src_prepare() {
 	# The build system is a strange mix of autogenerated
 	# files and manual tweaks on top. Uses $CFLAGS / $LDFLAGS randomly.
@@ -38,7 +34,6 @@ src_prepare() {
 	done
 
 	default
-	eautoreconf
 	elibtoolize
 
 	if use kernel_linux ; then

diff --git a/dev-libs/ffcall/files/ffcall-2.5-add-support-for-clang.patch b/dev-libs/ffcall/files/ffcall-2.5-add-support-for-clang.patch
deleted file mode 100644
index 2a8cc2676401..000000000000
--- a/dev-libs/ffcall/files/ffcall-2.5-add-support-for-clang.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-https://git.savannah.gnu.org/cgit/libffcall.git/commit/?id=fe6d9f089d8326b077420c10fec8c2174557be30
-
-From fe6d9f089d8326b077420c10fec8c2174557be30 Mon Sep 17 00:00:00 2001
-From: Bruno Haible <bruno@clisp.org>
-Date: Tue, 20 Aug 2024 13:38:19 +0200
-Subject: [PATCH] Add support for Android.
-
-* m4/cc-gcc.m4 (CL_CC_GCC): If using clang as compiler, add the option
--no-integrated-as to GCC_X_NONE.
-* NEWS: Mention Android as supported.
-
-diff --git a/m4/cc-gcc.m4 b/m4/cc-gcc.m4
-index 1e12d8e..97c2dac 100644
---- a/m4/cc-gcc.m4
-+++ b/m4/cc-gcc.m4
-@@ -1,5 +1,5 @@
- dnl -*- Autoconf -*-
--dnl Copyright (C) 1993-2017 Free Software Foundation, Inc.
-+dnl Copyright (C) 1993-2024 Free Software Foundation, Inc.
- dnl This file is free software, distributed under the terms of the GNU
- dnl General Public License as published by the Free Software Foundation;
- dnl either version 2 of the License, or (at your option) any later version.
-@@ -27,6 +27,27 @@ AC_DEFUN([CL_CC_GCC],
-   if test $cl_cv_prog_cc_gcc = yes; then
-     CC_GCC=true
-     GCC_X_NONE='-x none'
-+
-+    dnl On arm, there are two slightly different syntaxes for assembly language:
-+    dnl The "divided" syntax (standard since ca. 2000) and the "unified" syntax
-+    dnl (supported by GNU binutils since 2009).  See
-+    dnl https://sourceware.org/binutils/docs/as/ARM_002dInstruction_002dSet.html
-+    dnl While GNU as and thus GCC supports both, clang by default uses an
-+    dnl "integrated" assembler that supports only the "unified" syntax, leading
-+    dnl to errors "error: invalid instruction" on instructions such as stmeqia.
-+    dnl We therefore need to tell clang to use the external assembler.
-+    AC_CACHE_CHECK([whether using clang], [cl_cv_prog_cc_clang],
-+      [AC_EGREP_CPP([yes],
-+         [#ifdef __clang__
-+          yes
-+          #endif
-+         ],
-+         [cl_cv_prog_cc_clang=yes],
-+         [cl_cv_prog_cc_clang=no])
-+      ])
-+    if test $cl_cv_prog_cc_clang = yes; then
-+      GCC_X_NONE="$GCC_X_NONE -no-integrated-as"
-+    fi
-   else
-     CC_GCC=false
-     GCC_X_NONE=''
--- 
-2.45.2
-


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

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/ffcall/files/, dev-libs/ffcall/
@ 2025-10-09  7:41 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2025-10-09  7:41 UTC (permalink / raw
  To: gentoo-commits

commit:     2e3cc0b99dbeabd39abda0ee063760a6434ed060
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Fri Jun 13 04:27:31 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct  9 07:40:35 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e3cc0b9

dev-libs/ffcall: fix compilation with clang

patch from upstream

Closes: https://bugs.gentoo.org/829663
Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42572
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/ffcall/ffcall-2.4-r2.ebuild               | 69 ++++++++++++++++++++++
 ...te-a-read-only-.eh_frame-section-on-all-p.patch | 65 ++++++++++++++++++++
 2 files changed, 134 insertions(+)

diff --git a/dev-libs/ffcall/ffcall-2.4-r2.ebuild b/dev-libs/ffcall/ffcall-2.4-r2.ebuild
new file mode 100644
index 000000000000..66c961625fe8
--- /dev/null
+++ b/dev-libs/ffcall/ffcall-2.4-r2.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic libtool
+
+MY_PV="libffcall-${PV}"
+
+DESCRIPTION="Build foreign function call interfaces in embedded interpreter"
+HOMEPAGE="https://www.gnu.org/software/libffcall/"
+SRC_URI="mirror://gnu/libffcall/${MY_PV}.tar.gz"
+S="${WORKDIR}"/${MY_PV}
+
+# "Ffcall is under GNU GPL. As a special exception, if used in GNUstep
+# or in derivate works of GNUstep, the included parts of ffcall are
+# under GNU LGPL." -ffcall author
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+
+PATCHES=(
+	# bug 842915, drop on next version bump
+	"${FILESDIR}"/${PN}-2.4-vacall-riscv-pic.patch
+	"${FILESDIR}"/${PN}-2.4-slibtool.patch # 776976
+	"${FILESDIR}"/${PN}-2.4-create-a-read-only-.eh_frame-section-on-all-p.patch # 829663
+)
+
+src_prepare() {
+	# The build system is a strange mix of autogenerated
+	# files and manual tweaks on top. Uses $CFLAGS / $LDFLAGS randomly.
+	# We are adding them consistently here and a bit over the top:
+	# bugs: #334581
+	local mfi
+	for mfi in {,*/,*/*/,}Makefile.in ; do
+		einfo "Patching '${mfi}'"
+		# usually uses only assembler here, but -march=
+		# and -Wa, are a must to pass here.
+		sed -e 's/$(CC) /&$(CFLAGS) /g' \
+			-i "${mfi}" || die
+	done
+
+	default
+	elibtoolize
+}
+
+src_configure() {
+	append-flags -fPIC
+
+	# Doc goes in datadir
+	econf \
+		--datadir="${EPREFIX}"/usr/share/doc/${PF} \
+		--enable-shared \
+		--disable-static
+}
+
+src_compile() {
+	# TODO. Remove -j1
+	emake -j1
+}
+
+src_install() {
+	dodoc NEWS README
+	dodir /usr/share/man
+
+	default
+
+	find "${ED}" -name '*.la' -delete || die
+}

diff --git a/dev-libs/ffcall/files/ffcall-2.4-create-a-read-only-.eh_frame-section-on-all-p.patch b/dev-libs/ffcall/files/ffcall-2.4-create-a-read-only-.eh_frame-section-on-all-p.patch
new file mode 100644
index 000000000000..1eb9fb2ee759
--- /dev/null
+++ b/dev-libs/ffcall/files/ffcall-2.4-create-a-read-only-.eh_frame-section-on-all-p.patch
@@ -0,0 +1,65 @@
+https://git.savannah.gnu.org/cgit/libffcall.git/commit/?id=580f0bb144c0d63560c61229291e172e55971437
+
+From 580f0bb144c0d63560c61229291e172e55971437 Mon Sep 17 00:00:00 2001
+From: Bruno Haible <bruno@clisp.org>
+Date: Sat, 26 Jun 2021 18:19:21 +0200
+Subject: [PATCH] x86_64: Create a read-only .eh_frame section on all
+ platforms.
+
+Reported by Thomas Klausner <tk@giga.or.at> at
+<https://savannah.gnu.org/bugs/?60815>.
+
+* common/asm-x86_64.h (EH_FRAME_SECTION): Use flags "a" (instead of
+"aw") on all platforms.
+
+diff --git a/ChangeLog b/ChangeLog
+index 1e87b99..d2bde2a 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,11 @@
++2021-06-26  Bruno Haible  <bruno@clisp.org>
++
++	x86_64: Create a read-only .eh_frame section on all platforms.
++	Reported by Thomas Klausner <tk@giga.or.at> at
++	<https://savannah.gnu.org/bugs/?60815>.
++	* common/asm-x86_64.h (EH_FRAME_SECTION): Use flags "a" (instead of
++	"aw") on all platforms.
++
+ 2021-06-13  Bruno Haible  <bruno@clisp.org>
+ 
+ 	maint: Don't require an internet connection for running autogen.sh.
+diff --git a/common/asm-x86_64.h b/common/asm-x86_64.h
+index b4713d7..edb1ea5 100644
+--- a/common/asm-x86_64.h
++++ b/common/asm-x86_64.h
+@@ -279,11 +279,24 @@
+ // Solaris/ELF
+ #define EH_FRAME_SECTION .eh_frame,"aL",link=.text,@unwind
+ #else
+-#if defined __FreeBSD__
+-// FreeBSD/ELF
++// The eh_frame section was usually writable (flags "aw") in older OS versions,
++// but can be made read-only (flags "a") under specific conditions, depending
++// on the assembler's behaviour (look for EH_TABLES_CAN_BE_READ_ONLY in
++// gcc-11.1.0/gcc/defaults.h).
++// To determine whether the eh_frame section is writable or read-only by
++// default, compile a simple program:
++//   gcc -S -fno-dwarf2-cfi-asm hello.c  (GCC >= 4.4)
++// or
++//   gcc -S hello.c                      (GCC < 4.4)
++// The result is that all modern systems (at least Ubuntu >= 16.04,
++// Red Hat Enterprise Linux >= 5, Fedora >= 13, Alpine Linux >= 3.7,
++// FreeBSD >= 11, DragonFly BSD >= 6, NetBSD >= 7, OpenBSD >= 6)
++// use a read-only eh_frame section.
++#if 1
++// all modern systems
+ #define EH_FRAME_SECTION .eh_frame,"a",@progbits
+ #else
+-// Linux/ELF
++// only very old systems
+ #define EH_FRAME_SECTION .eh_frame,"aw",@progbits
+ #endif
+ #endif
+-- 
+2.45.2
+


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

end of thread, other threads:[~2025-10-09  7:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-09  7:41 [gentoo-commits] repo/gentoo:master commit in: dev-libs/ffcall/files/, dev-libs/ffcall/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2025-10-09  7:41 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox