Skip to content

Commit b76620c

Browse files
gh-144942: Fix macOS dylib build by adding $(MODLIBS) and removing -undefined dynamic_lookup
1 parent 1ac9d13 commit b76620c

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ libpython3.so: libpython$(LDVERSION).so
10341034
$(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
10351035

10361036
libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
1037-
$(CC) -dynamiclib $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
1037+
$(CC) -dynamiclib $(PY_CORE_LDFLAGS) -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
10381038

10391039

10401040
libpython$(VERSION).sl: $(LIBRARY_OBJS)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Correctly link with $(MODLIBS) when building the macOS dylib and remove the -undefined dynamic_lookup linker flag.

0 commit comments

Comments
 (0)