<pre style='margin:0'>
Chris Jones (cjones051073) pushed a commit to branch master
in repository macports-legacy-support.

</pre>
<p><a href="https://github.com/macports/macports-legacy-support/commit/834c79180070f0472e7f9593b7b99e1e7958ab4b">https://github.com/macports/macports-legacy-support/commit/834c79180070f0472e7f9593b7b99e1e7958ab4b</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 834c79180070f0472e7f9593b7b99e1e7958ab4b
</span>Author: Marcus Calhoun-Lopez <marcuscalhounlopez@gmail.com>
AuthorDate: Thu Apr 7 12:35:23 2022 -0700

<span style='display:block; white-space:pre;color:#404040;'>    add support for MACOSX_DEPLOYMENT_TARGET
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    rust-bootstrap runs on a system that is older than the one on which
</span><span style='display:block; white-space:pre;color:#404040;'>    it was built.
</span><span style='display:block; white-space:pre;color:#404040;'>    So `rustc` from rust-bootstrap needs to know to look in
</span><span style='display:block; white-space:pre;color:#404040;'>    libMacportsLegacySystem.B.dylib for symbols even if they are provided
</span><span style='display:block; white-space:pre;color:#404040;'>    by the system on which it was built.
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    Use the `__asm("$ld$add$os10.x$...")` trick, which respects
</span><span style='display:block; white-space:pre;color:#404040;'>    `MACOSX_DEPLOYMENT_TARGET`.
</span>---
 Makefile          |  9 +++++++--
 src/add_symbols.c | 31 +++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 2 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/Makefile b/Makefile
</span><span style='display:block; white-space:pre;color:#808080;'>index e7dccaf..952e9c3 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/Makefile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/Makefile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -85,7 +85,8 @@ LIBHEADERS      := $(shell $(FIND_LIBHEADERS))
</span> ALLHEADERS      := $(LIBHEADERS) $(wildcard $(SRCDIR)/*.h)
 
 MULTISRCS       := $(SRCDIR)/fdopendir.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-LIBSRCS         := $(filter-out $(MULTISRCS),$(wildcard $(SRCDIR)/*.c))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ADDSRCS         := $(SRCDIR)/add_symbols.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+LIBSRCS         := $(filter-out $(MULTISRCS) $(ADDSRCS),$(wildcard $(SRCDIR)/*.c))
</span> 
 DLIBOBJEXT       = .dl.o
 SLIBOBJEXT       = .o
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -93,6 +94,7 @@ DLIBOBJS        := $(patsubst %.c,%$(DLIBOBJEXT),$(LIBSRCS))
</span> MULTIDLIBOBJS   := $(patsubst %.c,%$(DLIBOBJEXT),$(MULTISRCS))
 SLIBOBJS        := $(patsubst %.c,%$(SLIBOBJEXT),$(LIBSRCS))
 MULTISLIBOBJS   := $(patsubst %.c,%$(SLIBOBJEXT),$(MULTISRCS))
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ADDOBJS         := $(patsubst %.c,%$(SLIBOBJEXT),$(ADDSRCS))
</span> 
 TESTDIR          = test
 TESTNAMEPREFIX   = $(TESTDIR)/test_
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -240,6 +242,9 @@ $(DLIBOBJS): %$(DLIBOBJEXT): %.c $(ALLHEADERS)
</span> $(SLIBOBJS): %$(SLIBOBJEXT): %.c $(ALLHEADERS)
        $(CC) -c -I$(SRCINCDIR) $(CFLAGS) $(SLIBCFLAGS) $< -o $@
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+$(ADDOBJS): %$(SLIBOBJEXT): %.c $(ALLHEADERS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   $(CC) -c -I$(SRCINCDIR) $(CFLAGS) $(SLIBCFLAGS) $< -o $@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> $(TESTOBJS_C): %.o: %.c $(ALLHEADERS)
        $(CC) -c -std=c99 -I$(SRCINCDIR) $(CFLAGS) $< -o $@
 
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -251,7 +256,7 @@ $(BUILDDLIBPATH): $(DLIBOBJS) $(MULTIDLIBOBJS)
</span>   $(CC) $(BUILDDLIBFLAGS) $(LDFLAGS) $^ -o $@
 
 # Wrapped libSystem relies on reexport which does not work on Darwin20+
<span style='display:block; white-space:pre;background:#ffe0e0;'>-$(BUILDSYSLIBPATH): $(DLIBOBJS) $(MULTIDLIBOBJS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+$(BUILDSYSLIBPATH): $(DLIBOBJS) $(MULTIDLIBOBJS) $(ADDOBJS)
</span> ifeq ($(shell test $(PLATFORM) -le $(MAX_DARWIN_REEXPORT); echo $$?),0)
        $(MKINSTALLDIRS) $(BUILDDLIBDIR)
        $(CC) $(BUILDSYSLIBFLAGS) $(LDFLAGS) $(SYSREEXPORTFLAG) $^ -o $@
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/add_symbols.c b/src/add_symbols.c
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..ac754d7
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/add_symbols.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,31 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include "MacportsLegacySupport.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if !(__MP_LEGACY_SUPPORT_POSIX_MEMALIGN__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char posix_memalign_tmp4 __asm("$ld$add$os10.4$_posix_memalign"); __attribute__((visibility("default"))) const char posix_memalign_tmp4 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char posix_memalign_tmp5 __asm("$ld$add$os10.5$_posix_memalign"); __attribute__((visibility("default"))) const char posix_memalign_tmp5 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if !(__MP_LEGACY_SUPPORT_REALPATH_WRAP__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char realpath_tmp4 __asm("$ld$add$os10.4$_realpath"); __attribute__((visibility("default"))) const char realpath_tmp4 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char realpath_tmp5 __asm("$ld$add$os10.5$_realpath$DARWIN_EXTSN"); __attribute__((visibility("default"))) const char realpath_tmp5 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if !(__MP_LEGACY_SUPPORT_SYSCONF_WRAP__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char sysconf_tmp4 __asm("$ld$add$os10.4$_sysconf"); __attribute__((visibility("default"))) const char sysconf_tmp4 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char sysconf_tmp5 __asm("$ld$add$os10.5$_sysconf"); __attribute__((visibility("default"))) const char sysconf_tmp5 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char sysconf_tmp6 __asm("$ld$add$os10.6$_sysconf"); __attribute__((visibility("default"))) const char sysconf_tmp6 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char sysconf_tmp7 __asm("$ld$add$os10.7$_sysconf"); __attribute__((visibility("default"))) const char sysconf_tmp7 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char sysconf_tmp8 __asm("$ld$add$os10.8$_sysconf"); __attribute__((visibility("default"))) const char sysconf_tmp8 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char sysconf_tmp9 __asm("$ld$add$os10.9$_sysconf"); __attribute__((visibility("default"))) const char sysconf_tmp9 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char sysconf_tmp10 __asm("$ld$add$os10.10$_sysconf"); __attribute__((visibility("default"))) const char sysconf_tmp10 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if !(__MP_LEGACY_SUPPORT_PTHREAD_SETNAME_NP__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char pthread_setname_np_tmp4 __asm("$ld$add$os10.4$_pthread_setname_np"); __attribute__((visibility("default"))) const char pthread_setname_np_tmp4 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char pthread_setname_np_tmp5 __asm("$ld$add$os10.5$_pthread_setname_np"); __attribute__((visibility("default"))) const char pthread_setname_np_tmp5 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if !(__MP_LEGACY_SUPPORT_COPYFILE_WRAP__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* extern const char copyfile_state_get_tmp4 __asm("$ld$add$os10.4$_copyfile_state_get"); __attribute__((visibility("default"))) const char copyfile_state_get_tmp4 = 0; */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern const char copyfile_state_get_tmp5 __asm("$ld$add$os10.5$_copyfile_state_get"); __attribute__((visibility("default"))) const char copyfile_state_get_tmp5 = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span></pre><pre style='margin:0'>

</pre>