<pre style='margin:0'>
Ken (kencu) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/f1369be4de76379f0ed80509918c2e903e005133">https://github.com/macports/macports-ports/commit/f1369be4de76379f0ed80509918c2e903e005133</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 f1369be4de7 cctools: fix log2 rounding issue in lipo
</span>f1369be4de7 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit f1369be4de76379f0ed80509918c2e903e005133
</span>Author: Ken Cunningham <kencu@macports.org>
AuthorDate: Sat Jul 10 22:26:35 2021 -0700
<span style='display:block; white-space:pre;color:#404040;'> cctools: fix log2 rounding issue in lipo
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> lipo calls log2(x) and then casts that to a uint32_t
</span><span style='display:block; white-space:pre;color:#404040;'> on some systems, this casts away from the correct value
</span><span style='display:block; white-space:pre;color:#404040;'> fix that by rounding the value to the nearest int first,
</span><span style='display:block; white-space:pre;color:#404040;'> then casting.
</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/63164
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> thanks to @bradleyCPA (B. Holder) for sorting this out!
</span>---
devel/cctools/Portfile | 7 +++++--
.../files/cctools-949-lipo-segalign-log2fix.diff | 17 +++++++++++++++++
2 files changed, 22 insertions(+), 2 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/cctools/Portfile b/devel/cctools/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 1b4a10b6c3a..eb59d228574 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/cctools/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/cctools/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -8,7 +8,7 @@ name cctools
</span> # Xcode 11.3.1
version 949.0.1
set ld64_version 530
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span>
categories devel
platforms darwin
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -45,7 +45,10 @@ patchfiles cctools-829-lto.patch \
</span> cctools-949-redo_prebinding-add-segg-addr-table-header.diff \
cctools-949-build-with-SDKs-older-than-1012.diff \
cctools-949-nm-allow-no-lto-support.diff \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- cctools-949-write_object-fix.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cctools-949-write_object-fix.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cctools-949-lipo-segalign-log2fix.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# lipo-segalign-log2fix https://trac.macports.org/ticket/63164
</span>
# small fixes and sdk adjustments made to 949 but
# there is a bug in cctools as/write_object.c in 949 that needs upstreaming
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/cctools/files/cctools-949-lipo-segalign-log2fix.diff b/devel/cctools/files/cctools-949-lipo-segalign-log2fix.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..0dd38a7d7eb
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/cctools/files/cctools-949-lipo-segalign-log2fix.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,17 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+log2 takes a float, and needs to be rounded before being cast to an int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+see: https://trac.macports.org/ticket/63164
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+thanks for detective work: bradleyCPA (B. Holder)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git misc/lipo.c misc/lipo.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index f1e85cc..70357db 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- misc/lipo.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ misc/lipo.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1949,7 +1949,7 @@ cpu_subtype_t cpusubtype)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct arch_flag arch_flag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (get_arch_from_flag((char*)arch_name, &arch_flag)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uint32_t pagesize = get_segalign_from_flag(&arch_flag);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (uint32_t)(log2(pagesize));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (uint32_t)(lround(log2(pagesize)));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span></pre><pre style='margin:0'>
</pre>