<pre style='margin:0'>
Perry E. Metzger (pmetzger) pushed a commit to branch master
in repository macports-ports.

</pre>
<p><a href="https://github.com/macports/macports-ports/commit/656932616eebe60f4e8cfd96d8268801dad8224d">https://github.com/macports/macports-ports/commit/656932616eebe60f4e8cfd96d8268801dad8224d</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'>     new 656932616ee cdrtools: fix arm64 build by explicitly disabling stack scanning
</span>656932616ee is described below

<span style='display:block; white-space:pre;color:#808000;'>commit 656932616eebe60f4e8cfd96d8268801dad8224d
</span>Author: Mark Mentovai <mark@chromium.org>
AuthorDate: Mon Jan 3 10:58:27 2022 -0500

<span style='display:block; white-space:pre;color:#404040;'>    cdrtools: fix arm64 build by explicitly disabling stack scanning
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    avoffset, a helper program run during the cdrtools build, was crashing
</span><span style='display:block; white-space:pre;color:#404040;'>    on arm64 when built with optimization, with EXC_BREAKPOINT (SIGTRAP),
</span><span style='display:block; white-space:pre;color:#404040;'>    triggered by a brk instruction inserted by the compiler in a code path
</span><span style='display:block; white-space:pre;color:#404040;'>    that was provably attempting to dereference a null pointer. Under the
</span><span style='display:block; white-space:pre;color:#404040;'>    same conditions on x86_64, the compiler inserted a ud2 instruction
</span><span style='display:block; white-space:pre;color:#404040;'>    resulting in EXC_BAD_INSTRUCTION (SIGILL). On either architecture, when
</span><span style='display:block; white-space:pre;color:#404040;'>    not under optimization, the null pointer dereference resulted in
</span><span style='display:block; white-space:pre;color:#404040;'>    EXC_BAD_ACCESS (SIGSEGV). avoffset has signal handlers for both SIGILL
</span><span style='display:block; white-space:pre;color:#404040;'>    and SIGSEGV, and recovered "gracefully" by configuring the build to
</span><span style='display:block; white-space:pre;color:#404040;'>    disable stack scanning and exiting cleanly. Without a SIGTRAP handler,
</span><span style='display:block; white-space:pre;color:#404040;'>    the avoffset crash results in a failed build on arm64 under
</span><span style='display:block; white-space:pre;color:#404040;'>    optimization.
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    It would be easy to add a SIGTRAP handler, but a more direct approach is
</span><span style='display:block; white-space:pre;color:#404040;'>    to explicitly disable stack scanning by defining NO_SCANSTACK during the
</span><span style='display:block; white-space:pre;color:#404040;'>    build. The stack scanning concept and implementation are both
</span><span style='display:block; white-space:pre;color:#404040;'>    ill-advised, and none of it was working on any architecture or any build
</span><span style='display:block; white-space:pre;color:#404040;'>    configuration on macOS anyway. Even with avoffset "working" (not
</span><span style='display:block; white-space:pre;color:#404040;'>    crashing), all it did on macOS was detect the failure and disable stack
</span><span style='display:block; white-space:pre;color:#404040;'>    scanning for the rest of the build.
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    Closes: https://trac.macports.org/ticket/63062
</span>---
 sysutils/cdrtools/Portfile | 1 +
 1 file changed, 1 insertion(+)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/sysutils/cdrtools/Portfile b/sysutils/cdrtools/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index b97e12ebe54..d5979bfe327 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/sysutils/cdrtools/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/sysutils/cdrtools/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -52,6 +52,7 @@ use_configure       no
</span> compiler.blacklist  llvm-gcc-4.2 macports-llvm-gcc-4.2 {clang < 300}
 
 configure.cflags-append \
<span style='display:block; white-space:pre;background:#e0ffe0;'>+                    -DNO_SCANSTACK \
</span>                     -Wno-error=implicit-function-declaration
 
 build.cmd           smake
</pre><pre style='margin:0'>

</pre>