<div dir="auto">This is not related to MacPorts really. I would strongly not suggest attempting to pull in MacPorts-built libs into your app you plan to distribute. MacPorts libs can really only be trusted to work with MacPorts packages that use them.<div dir="auto"><br></div><div dir="auto">You either have to build the libs yourself or use something like Carthage.<br><div dir="auto"><div dir="auto"><div dir="auto"><div dir="auto"><br></div><div dir="auto">The reason you get this issue is because those dylibs from MacPorts contain definitions of sprintf_chk which is a private symbol to Apple (already defined in their own lib or possibly just because it starts with __). Clang/GCC usually generates this code when you use sprintf as part of source fortification (-D_FORTIFY_SOURCE). You have to build those libs without such features. You can try <span style="font-family:sans-serif">-D_FORTIFY_SOURCE=0 and every library you want to use must be built with this. Carthage packages probably have this fixed.</span></div><div dir="auto"><br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 2, 2021, 13:46 Adrian Georgescu <<a href="mailto:ag@ag-projects.com">ag@ag-projects.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">After rebuilding a lot of port libs until I obtained the LC_VERSION_MIN_MACOSX, I ran into this new Apple rejection reason:<div><br></div><div><h3 style="color:rgb(102,102,102);font-family:Helvetica,"Lucida Grande",Arial,sans-serif;text-align:justify">Guideline 2.5.1 - Performance</h3><div>Your app links against the following non-public framework(s):</div></div><div><br></div><div><div>• Contents/Frameworks/libcrypto.1.1.dylib/___sprintf_chk</div><div>• Contents/Frameworks/libp11-kit.0.dylib/___sprintf_chk</div><div>• Contents/Frameworks/libmpfr.6.dylib/___sprintf_chk</div><div>• Contents/Frameworks/libgnutls.30.dylib/___sprintf_chk</div><div>• Contents/Frameworks/libgnutls.30.dylib/_p11_kit_space_strdup</div><div>• Contents/Frameworks/libgnutls.30.dylib/_p11_kit_space_strlen</div><div>• Contents/Frameworks/libidn2.0.dylib/_sprintf</div><div>• Contents/Frameworks/libx264.157.dylib/___sprintf_chk</div><div>• Contents/Frameworks/libssl.1.1.dylib/___sprintf_chk</div><div>• Contents/Frameworks/libxml2.2.dylib/___sprintf_chk</div><div><br></div><div><b style="color:rgb(102,102,102);font-family:Helvetica,"Lucida Grande",Arial,sans-serif;font-size:14px;text-align:justify">Next Steps</b></div><div><br style="color:rgb(102,102,102);font-family:Helvetica,"Lucida Grande",Arial,sans-serif;font-size:14px;text-align:justify"><span style="color:rgb(102,102,102);font-family:Helvetica,"Lucida Grande",Arial,sans-serif;font-size:14px;text-align:justify;background-color:rgb(255,255,255)">The use of non-public APIs is not permitted on the App Store as it can lead to a poor user experience should these APIs change.</span></div><div><span style="color:rgb(102,102,102);font-family:Helvetica,"Lucida Grande",Arial,sans-serif;font-size:14px;text-align:justify;background-color:rgb(255,255,255)"><br></span></div><div>Is it possible to rebuild those libs without those symbols?</div><div><br></div><div>I found this link which may be relevant (I am not a C developer)</div><div><br></div><div><a href="https://stackoverflow.com/questions/12201625/disable-using-sprintf-chk#12203365" target="_blank" rel="noreferrer">https://stackoverflow.com/questions/12201625/disable-using-sprintf-chk#12203365</a></div><div><br></div><div>Regards,</div><div>Adrian</div><div><br></div><div><div><br><blockquote type="cite"><div>On 2 Mar 2021, at 07:14, Ryan Schmidt <<a href="mailto:ryandesign@macports.org" target="_blank" rel="noreferrer">ryandesign@macports.org</a>> wrote:</div><br><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!important">On Mar 1, 2021, at 17:16, Adrian Georgescu wrote:</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">I am just a new user so bear with me.<br><br>It seems that now Apple rejects any library part of a notarised application (and Mac App Store) if it does not comply with certain rules.<br><br>One of this rules is that each binary or library must indicate the minimum OS version is suppose to run on.<br><br>This can be checked with otool like in this example:<br><br>otool -l libvpx.dylib |grep -A 2 -B 3 LC_VERSION_MIN_MACOSX<br>cmdsize 24<br>  uuid 1EDC0CF1-9D58-30B4-AF67-A0DEEAF3BAF4<br>Load command 8<br>    cmd LC_VERSION_MIN_MACOSX<br>cmdsize 16<br>version 10.11<br><br>If your app depends on 3rd party libs you can install them using Mac Ports. But the default built binaries do not always work.<br><br>The only way to obtain this flag set while using port is to install from source using -s parameter<span> </span><br><br>But for some libraries even this is not enough (libvpx and libsdl are some examples I ran into).<br><br>The option for generating this flag is at linking stage and the option for creating this flag must be passed to the linker for this and this is not always possible by just using port install -s command.<br><br>For example installing libvpx library (and many others) was not possible using -s because the library was not ready to use this flag.<br><br>I have to edit the Makefiles and pass this flag to the linking stage:<br><br>-mmacosx-version-min=10.11<br><br>10.11 or whatever minimum version the lib or app is suppose to run on.<br><br>May I suggest that this must be documented somehow in the port recipes.<br></blockquote><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!important">I am not aware of Apple's increasingly inconvenient requirements in this regard.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!important">MacPorts adopted the strategy of setting the MACOSX_DEPLOYMENT_TARGET environment variable in all phases. It was our understanding that this was equivalent to setting -mmacosx-version-min, therefore we make no effort to set -mmacosx-version-min and have not had any qualms in removing conflicting -mmacosx-version-min directives when we encounter them.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!important">If this is not longer satisfactory to Apple, then we will need to change how MacPorts works and fix all ports (a huge undertaking, of course).</span></div></blockquote></div><br></div></div></div></blockquote></div>