<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Courier;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Andale Mono";
        panose-1:2 11 5 9 0 0 0 0 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span style='font-size:12.0pt'>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:12.0pt;font-family:Courier'>-isysroot</span><span style='font-size:12.0pt'>  argument. It appears that the build process locates SDK via<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:.5in'><span style='font-size:12.0pt;font-family:Courier'>xcrun --sdk macosx –show-sdk-path<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>that returns </span><span style='font-size:12.0pt;font-family:Courier'>MacOSX11.3.sdk</span><span style='font-size:12.0pt'>, while <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal style='text-indent:.5in'><span style='font-size:12.0pt;font-family:Courier'>xcrun --show-sdk-path<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>returns </span><span style='font-size:12.0pt;font-family:Courier'>MacOSX.sdk</span><span style='font-size:12.0pt'>.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>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">https://trac.macports.org/ticket/63038#comment:39</a>). It fails to locate an SDK-provided header file.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Here’s what the problem/error looks like:<o:p></o:p></span></p><div style='mso-element:para-border-div;border:solid #D7D7D7 1.0pt;padding:3.0pt 3.0pt 3.0pt 3.0pt;background:#F7F7F7;margin-left:21.0pt;margin-right:21.0pt'><p class=MsoNormal style='mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;background:#F7F7F7;border:none;padding:0in'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>:info:build [ 11%] Building CXX object lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64TargetMachine.cpp.o<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;background:#F7F7F7;border:none;padding:0in'><span style='font-size:10.0pt;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<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;background:#F7F7F7;border:none;padding:0in'><span style='font-size:10.0pt;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:<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;background:#F7F7F7;border:none;padding:0in'><span style='font-size:10.0pt;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:<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;background:#F7F7F7;border:none;padding:0in'><span style='font-size:10.0pt;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:<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;background:#F7F7F7;border:none;padding:0in'><span style='font-size:10.0pt;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:<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;background:#F7F7F7;border:none;padding:0in'><span style='font-size:10.0pt;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:<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;background:#F7F7F7;border:none;padding:0in'><span style='font-size:10.0pt;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:<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;background:#F7F7F7;border:none;padding:0in'><span style='font-size:10.0pt;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<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;background:#F7F7F7;border:none;padding:0in'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>:info:build #include <assert.h><o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;background:#F7F7F7;border:none;padding:0in'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>:info:build          ^~~~~~~~~~<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:12.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left:0in;background:#F7F7F7;border:none;padding:0in'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>:info:build 1 error generated.<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>The workaround for this problem is removing the </span><span style='font-size:12.0pt;font-family:Courier'>--sdk macosx</span><span style='font-size:12.0pt'>  flag. Then </span><span style='font-size:12.0pt;font-family:Courier'>xcrun</span><span style='font-size:12.0pt'> 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.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Therefore, I’d like to request the maintainers to remove the “</span><span style='font-size:12.0pt;font-family:Courier'>--sdk macosx”</span><span style='font-size:12.0pt'>   flag from the build config.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Thank you!<o:p></o:p></span></p><div><div><p class=MsoNormal><span style='color:black'>--</span><span style='font-size:12.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'>Regards,</span><span style='font-size:12.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'>Uri Blumenthal                              Voice: (781) 981-1638 </span><span style='font-size:12.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'>Secure Resilient Systems and Technologies   Cell:  (339) 223-5363</span><span style='font-size:12.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'>MIT Lincoln Laboratory                      </span><span style='font-size:12.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'>244 Wood Street, Lexington, MA  02420-9108      </span><span style='font-size:12.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Andale Mono";color:black'> </span><span style='font-size:12.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;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"><span style='color:#713C56'>https://www.ll.mit.edu/biographies/uri-blumenthal</span></a></span><span style='font-size:12.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;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"><span style='color:#713C56'>https://www.ll.mit.edu/llrca2.pem</span></a></span><span style='font-size:12.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> </span><span style='font-size:12.0pt;color:black'><o:p></o:p></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:12.0pt;color:black'><o:p></o:p></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:12.0pt;color:black'><o:p></o:p></span></p><p class=MsoNormal><i><span style='color:black'>                                                                                                                                     -  C. A. R. Hoare</span></i><span style='font-size:12.0pt;color:black'><o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>