<div dir="ltr">On the Apple side I filed this a few years ago as FB7253366<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">--<br>Keith Smiley<br></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 21, 2021 at 10:52 AM Blumenthal, Uri - 0553 - MITLL via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</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 lang="EN-US" style="overflow-wrap: break-word;"><div class="gmail-m_153845952368278331WordSection1"><p class="MsoNormal"><span style="font-size:12pt">This is about building Clang-12 on MacOS (Big Sur 11.4, in case it matters). Some machines have a problem with how LLVM selects the SDK to use and pass to compiler as </span><span style="font-size:12pt;font-family:Courier">-isysroot</span><span style="font-size:12pt"> argument. It appears that the build process locates SDK via<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p><p class="MsoNormal" style="text-indent:0.5in"><span style="font-size:12pt;font-family:Courier">xcrun --sdk macosx –show-sdk-path<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12pt">that returns </span><span style="font-size:12pt;font-family:Courier">MacOSX11.3.sdk</span><span style="font-size:12pt">, while <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p><p class="MsoNormal" style="text-indent:0.5in"><span style="font-size:12pt;font-family:Courier">xcrun --show-sdk-path<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12pt">returns </span><span style="font-size:12pt;font-family:Courier">MacOSX.sdk</span><span style="font-size:12pt">.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12pt">I’m bringing this up to your attention, because MacOSX11.3.sdk (that is symlink’ed to MacOSX.sdk) seems to fail the build (see <a href="https://trac.macports.org/ticket/63038#comment:39" target="_blank">https://trac.macports.org/ticket/63038#comment:39</a>). It fails to locate an SDK-provided header file.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12pt">Here’s what the problem/error looks like:<u></u><u></u></span></p><div style="border:1pt solid rgb(215,215,215);padding:3pt;background:rgb(247,247,247);margin-left:21pt;margin-right:21pt"><p class="MsoNormal" style="margin-right:0in;margin-bottom:12pt;margin-left:0in;background:rgb(247,247,247);border:none;padding:0in"><span style="font-size:10pt;font-family:"Courier New";color:black">:info:build [ 11%] Building CXX object lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64TargetMachine.cpp.o<u></u><u></u></span></p><p class="MsoNormal" style="margin-right:0in;margin-bottom:12pt;margin-left:0in;background:rgb(247,247,247);border:none;padding:0in"><span style="font-size:10pt;font-family:"Courier New";color:black">:info:build cd opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-12/clang-12/work/build/lib/Target/AArch64 && /usr/bin/clang++ -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-12/clang-12/work/build/lib/Target/AArch64 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.0.src/llvm/lib/Target/AArch64 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-12/clang-12/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.0.src/llvm/include -isystem /opt/local/include -pipe -Os -DNDEBUG -I/opt/local/include -stdlib=libc++ -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -O3 -DNDEBUG -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -mmacosx-version-min=11.0 -fno-exceptions -std=c++14 -o CMakeFiles/LLVMAArch64CodeGen.dir/AArch64TargetMachine.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.0.src/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp<u></u><u></u></span></p><p class="MsoNormal" style="margin-right:0in;margin-bottom:12pt;margin-left:0in;background:rgb(247,247,247);border:none;padding:0in"><span style="font-size:10pt;font-family:"Courier New";color:black">:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.0.src/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp:12:<u></u><u></u></span></p><p class="MsoNormal" style="margin-right:0in;margin-bottom:12pt;margin-left:0in;background:rgb(247,247,247);border:none;padding:0in"><span style="font-size:10pt;font-family:"Courier New";color:black">:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.0.src/llvm/lib/Target/AArch64/AArch64TargetMachine.h:16:<u></u><u></u></span></p><p class="MsoNormal" style="margin-right:0in;margin-bottom:12pt;margin-left:0in;background:rgb(247,247,247);border:none;padding:0in"><span style="font-size:10pt;font-family:"Courier New";color:black">:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.0.src/llvm/lib/Target/AArch64/AArch64InstrInfo.h:16:<u></u><u></u></span></p><p class="MsoNormal" style="margin-right:0in;margin-bottom:12pt;margin-left:0in;background:rgb(247,247,247);border:none;padding:0in"><span style="font-size:10pt;font-family:"Courier New";color:black">:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.0.src/llvm/lib/Target/AArch64/AArch64.h:17:<u></u><u></u></span></p><p class="MsoNormal" style="margin-right:0in;margin-bottom:12pt;margin-left:0in;background:rgb(247,247,247);border:none;padding:0in"><span style="font-size:10pt;font-family:"Courier New";color:black">:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-12/clang-12/work/llvm-project-12.0.0.src/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.h:18:<u></u><u></u></span></p><p class="MsoNormal" style="margin-right:0in;margin-bottom:12pt;margin-left:0in;background:rgb(247,247,247);border:none;padding:0in"><span style="font-size:10pt;font-family:"Courier New";color:black">:info:build In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/memory:688:<u></u><u></u></span></p><p class="MsoNormal" style="margin-right:0in;margin-bottom:12pt;margin-left:0in;background:rgb(247,247,247);border:none;padding:0in"><span style="font-size:10pt;font-family:"Courier New";color:black">:info:build /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/cassert:20:10: fatal error: 'assert.h' file not found<u></u><u></u></span></p><p class="MsoNormal" style="margin-right:0in;margin-bottom:12pt;margin-left:0in;background:rgb(247,247,247);border:none;padding:0in"><span style="font-size:10pt;font-family:"Courier New";color:black">:info:build #include <assert.h><u></u><u></u></span></p><p class="MsoNormal" style="margin-right:0in;margin-bottom:12pt;margin-left:0in;background:rgb(247,247,247);border:none;padding:0in"><span style="font-size:10pt;font-family:"Courier New";color:black">:info:build ^~~~~~~~~~<u></u><u></u></span></p><p class="MsoNormal" style="margin-right:0in;margin-bottom:12pt;margin-left:0in;background:rgb(247,247,247);border:none;padding:0in"><span style="font-size:10pt;font-family:"Courier New";color:black">:info:build 1 error generated.<u></u><u></u></span></p></div><p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12pt">The workaround for this problem is removing the </span><span style="font-size:12pt;font-family:Courier">--sdk macosx</span><span style="font-size:12pt"> flag. Then </span><span style="font-size:12pt;font-family:Courier">xcrun</span><span style="font-size:12pt"> locates the “main” MacOSX.sdk rather a symlink to it, and everything works fine. This flag is unnecessary to begin with, and harmful on some machines.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12pt">Therefore, I’d like to request the maintainers to remove the “</span><span style="font-size:12pt;font-family:Courier">--sdk macosx”</span><span style="font-size:12pt"> flag from the build config.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12pt">Thank you!<u></u><u></u></span></p><div><div><p class="MsoNormal"><span style="color:black">--</span><span style="font-size:12pt;color:black"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Andale Mono";color:black">Regards,</span><span style="font-size:12pt;color:black"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Andale Mono";color:black">Uri Blumenthal Voice: (781) 981-1638 </span><span style="font-size:12pt;color:black"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Andale Mono";color:black">Secure Resilient Systems and Technologies Cell: (339) 223-5363</span><span style="font-size:12pt;color:black"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Andale Mono";color:black">MIT Lincoln Laboratory </span><span style="font-size:12pt;color:black"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Andale Mono";color:black">244 Wood Street, Lexington, MA 02420-9108 </span><span style="font-size:12pt;color:black"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Andale Mono";color:black"> </span><span style="font-size:12pt;color:black"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Andale Mono";color:black">Web: <a href="https://www.ll.mit.edu/biographies/uri-blumenthal" title="https://www.ll.mit.edu/biographies/uri-blumenthal" target="_blank"><span style="color:rgb(113,60,86)">https://www.ll.mit.edu/biographies/uri-blumenthal</span></a></span><span style="font-size:12pt;color:black"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Andale Mono";color:black">Root CA: <a href="https://www.ll.mit.edu/llrca2.pem" title="https://www.ll.mit.edu/llrca2.pem" target="_blank"><span style="color:rgb(113,60,86)">https://www.ll.mit.edu/llrca2.pem</span></a></span><span style="font-size:12pt;color:black"><u></u><u></u></span></p><p class="MsoNormal"><span style="color:black"> </span><span style="font-size:12pt;color:black"><u></u><u></u></span></p><p class="MsoNormal"><i><span style="color:black">There are two ways to design a system. One is to make is so simple there are obviously no deficiencies.</span></i><span style="font-size:12pt;color:black"><u></u><u></u></span></p><p class="MsoNormal"><i><span style="color:black">The other is to make it so complex there are no obvious deficiencies.</span></i><span style="font-size:12pt;color:black"><u></u><u></u></span></p><p class="MsoNormal"><i><span style="color:black"> - C. A. R. Hoare</span></i><span style="font-size:12pt;color:black"><u></u><u></u></span></p></div></div><p class="MsoNormal"><u></u> <u></u></p></div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>