Skip to content

Commit 138c5b0

Browse files
author
Release Manager
committed
sagemathgh-40116: try to fix build on some arm64 macOS systems as reported on sagemath#40106 ~Proposed~ Merged upstream as https://github.com/gap- system/gap/pull/5992 <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#40116 Reported by: Dima Pasechnik Reviewer(s): John H. Palmieri
2 parents 5566539 + 6237142 commit 138c5b0

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 52621bc6bf24fca2b1d8c1ef3c10ddf4fb9c52bd Mon Sep 17 00:00:00 2001
2+
From: Dima Pasechnik <[email protected]>
3+
Date: Mon, 26 May 2025 04:03:40 -0500
4+
Subject: [PATCH] Fixing darwin headerpad issue (#5992)
5+
6+
---
7+
Makefile.rules | 7 ++++---
8+
1 file changed, 4 insertions(+), 3 deletions(-)
9+
10+
diff --git a/Makefile.rules b/Makefile.rules
11+
index 670e7d3f57..47dffbaae6 100644
12+
--- a/Makefile.rules
13+
+++ b/Makefile.rules
14+
@@ -431,7 +431,7 @@ build/obj/%.c.o: %.c cnf/GAP-CFLAGS cnf/GAP-CPPFLAGS $(obj_deps)
15+
########################################################################
16+
17+
LINK=$(CC)
18+
-
19+
+GAP_INSTALL_EXTRAFLAGS =
20+
SHLIB_MAJOR = $(GAP_KERNEL_MAJOR_VERSION)
21+
ifneq (,$(findstring cygwin,$(host_os)))
22+
SHLIB_EXT=.dll
23+
@@ -447,7 +447,8 @@ else ifneq (,$(findstring darwin,$(host_os)))
24+
LINK_SHLIB_FLAGS += -compatibility_version $(LIBGAP_COMPAT_VER)
25+
LINK_SHLIB_FLAGS += -current_version $(LIBGAP_CURRENT_VER)
26+
LINK_SHLIB_FLAGS += -Wl,-single_module
27+
- LINK_SHLIB_FLAGS += -headerpad_max_install_names
28+
+ LINK_SHLIB_FLAGS += -Wl,-headerpad_max_install_names
29+
+ GAP_INSTALL_EXTRAFLAGS = -Wl,-headerpad_max_install_names
30+
31+
GAP_CPPFLAGS += -DPIC
32+
GAP_CFLAGS += -fno-common
33+
@@ -519,7 +520,7 @@ build/main.c: src/main.c config.status
34+
35+
# build rule for the gap executable used by the `install-bin` target
36+
build/gap-install: build/obj/build/main.c.o libgap$(SHLIB_EXT) cnf/GAP-LDFLAGS cnf/GAP-LIBS cnf/GAP-OBJS
37+
- $(QUIET_LINK)$(LINK) $(GAP_LDFLAGS) $< $(GAP_LIBS) -L${abs_builddir} -lgap -o $@
38+
+ $(QUIET_LINK)$(LINK) $(GAP_LDFLAGS) $(GAP_INSTALL_EXTRAFLAGS) $< $(GAP_LIBS) -L${abs_builddir} -lgap -o $@
39+
$(INSTALL_NAME_TOOL) -change $(LIBGAP_FULL) $(libdir)/$(LIBGAP_FULL) $@
40+
41+
endif

0 commit comments

Comments
 (0)