<div dir="ltr"><div>Hi,</div><div><br></div><div>I installed postgresql13 the same way. I then copied the files to macOS Catalina and here is the output:</div><div><br></div><div><b>on macOS Big Sur arm64:</b></div><div>% sw_vers | grep ProductVersion<br>ProductVersion:  11.0.1<br></div><div><br></div><div>% otool -l /opt/local/lib/postgresql13/libpq.dylib| grep minos<br>    minos 11.0<br></div><div><br></div><div>% md5 /opt/local/lib/postgresql13/libpq.dylib<br></div><div>MD5 (/opt/local/lib/postgresql13/libpq.dylib) = b0bae706c59a99ddbb40bb6fe3e3ea66<br></div><div><br></div><div><b>on macOS Catalina x86_64:</b></div><div>$ sw_vers | grep ProductVersion<br>ProductVersion:   10.15.7<br></div><div><br></div><div>$ md5 /tmp/opt/local/lib/postgresql13/libpq.dylib<br>MD5 (/tmp/opt/local/lib/postgresql13/libpq.dylib) = b0bae706c59a99ddbb40bb6fe3e3ea66<br></div><div><br></div><div>$ otool -l /tmp/opt/local/lib/postgresql13/libpq.dylib | grep minos<br>     minos 10.14<br></div><div><br></div>So, it seems the build is fine. The otool is correctly returning the macosx-version-min for that Arch which seems fine. <div><br></div><div>Thank you for your responses and sorry for the noise.</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 31, 2021 at 12:30 AM Ken Cunningham <<a href="mailto:ken.cunningham.webuse@gmail.com">ken.cunningham.webuse@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><blockquote type="cite"><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">and the command I used is:
*% sudo port install llvm-10 +universal*

But, what I see is:
*% otool -l /opt/local/libexec/llvm-10/lib/libLLVM.dylib| grep "minos\|sdk"*
    minos 11.0
      sdk 11.1

The sdk version looks fine, but why the minos is 11.0? shouldn't it be
10.14 as expected? What am I missing?
</pre></blockquote><div><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"><br></pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">Well, you’re the first person I know of who has tried this, but I get what you’re up to — here are my thoughts:</pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"><br></pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">When you try to build things universal, it happens in one of two ways. Either MacOS can build it as universal “in one go” with multiple arch flags, or MacOS cannot build it like that and you need to build it twice, once with each arch, and lipo them together.</pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"><br></pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">MacPorts does the automatic lipoing together using a mechanism set up in the “muniversal” PortGroup.</pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"><br></pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">When you build llvm-10, it’s a “one go” multiarch build.</pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"><br></pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">I don’t think that the compiler would know exactly what to do with a build line like this:</pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"><br></pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">clang++ -arch arm64 -arch x86_64 -macosx-version-min=10.14 … </pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"><br></pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">There is no way you can hope to build arm64 for a macosx-version-min of 10.14 (arm64 requires a version min of 11.0 I imagine). So, it is quite possible that to be helpful, it ignores your macosx-version-min=10.14 as being a likely “mistake” and bumps your macosx-version-min to something reasonable, like minos 11.0.</pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"><br></pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">If, however, you built it separately and lipo’d them together yourself (or using the muniversal PG) something might be built that has one macosx-version-min for arm64 and a different macosx-version-min for x86_64.</pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"><br></pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">I would say — Yuk. </pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"><br></pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">Are you sure you want to build this exactly? If you did want to build a univeral binary that runs on x86_64 from 10.14 up, and on arm64, you might well have to build them separately and lipo them together, either manually or using the muniversal PG to do it for you.</pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"><br></pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">Best,</pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)"><br></pre><pre style="white-space:pre-wrap;background-color:rgb(255,255,255)">Ken</pre></div></div></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font color="#000000" size="2">Sandeep Thakkar</font><div><br><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div>