<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I believe the issue is probably not related so much to LLVM_ENABLE_PROJECTS vs LLVM_ENABLE_RUNTIMES, but rather to the fact that LLVM_ENABLE_RUNTIMES uses per-target runtime directories now (hasn't always been the case), which basically means that libc++ ends up in `<prefix>/lib/<target-triple>/libc++.so` instead of `<prefix>/lib/libc++.so`.<div class=""><br class=""></div><div class="">I think you either want to specify the per-target library dir when running against libc++, or you want to disable that and use `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF` when configuring the runtimes. In all cases, you want to be using `LLVM_ENABLE_RUNTIMES` and not `LLVM_ENABLE_PROJECTS`, since the latter is deprecated now.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Louis<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 25, 2021, at 13:57, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><a class="gmail_plusreply" id="plusReplyChip-1" href="mailto:ldionne@apple.com" tabindex="-1">+Louis Dionne</a> - perhaps the libcxx and lldb folks would be interesting in finding a suitable way to address this issue, since currently either option (using libcxx in ENABLE_PROJECTS or using it in ENABLE_RUNTIMES) is incomplete - if I use ENABLE_RUNTIMES I get the libcxx testing run against the just-built clang and generally this is the "supported" configuration, but then some lldb tests fail because they can't find libcxx.so.1 (on Linux) - and using ENABLE_PROJECTS means not using the just-built clang for libcxx tests (so missing the libcxx breakages caused by my array name change) but do use the just-built libcxx in lldb tests and find failures there... <br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 20, 2021 at 1:57 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div dir="ltr" class="">On Tue, Oct 19, 2021 at 4:55 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</a>> wrote:<br class=""></div><div dir="ltr" class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div dir="ltr" class="">On Tue, Oct 19, 2021 at 9:08 AM Raphael Isemann <<a href="mailto:teemperor@gmail.com" target="_blank" class="">teemperor@gmail.com</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Actually the RPATH theory is wrong, but the LLVM_ENABLE_PROJECT<br class="">
workaround *should* still work.<br class=""></blockquote><div class=""><br class="">I'll give that a go (it's running at the moment) though I guess this is inconsistent with the direction libcxx is moving in for building, re: <a href="https://groups.google.com/g/llvm-dev/c/tpuLxk_ipLw" target="_blank" class="">https://groups.google.com/g/llvm-dev/c/tpuLxk_ipLw</a></div></div></div></blockquote><div class=""><br class="">Yep, it does work with LLVM_ENABLE_PROJECT rather than LLVM_ENABLE_RUNTIME.<br class=""><br class="">Specifically the test binary is linked with an rpath to the just-built lib directory that ensures the just-built libc++.so is found:<br class=""><br class=""><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">/usr/local/google/home/blaikie/dev/llvm/build/release/bin/clang main.o -g -O0 -fno-builtin -m64<span class="">  </span>-I/usr/local/google/home/blaikie/dev/llvm/src/lldb/packages/Python/lldbsuite/test/make/../../../../../include -I/usr/local/google/home/blaikie/dev/llvm/src/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/list -I/usr/local/google/home/blaikie/dev/llvm/src/lldb/packages/Python/lldbsuite/test/make -include /usr/local/google/home/blaikie/dev/llvm/src/lldb/packages/Python/lldbsuite/test/make/test_common.h -fno-limit-debug-info<span class="">  </span>-gsplit-dwarf<span class="">    </span>-stdlib=libc++ -Wl,-rpath,/usr/local/google/home/blaikie/dev/llvm/build/release/./lib --driver-mode=g++ -o "a.out"</span></div> </div><div class="">Oh, actually it passes the same rpath when using LLVM_ENABLE_RUNTIME, but the libc++.so.1 is in a different place: <span style="font-variant-ligatures: no-common-ligatures; font-family: Menlo; font-size: 11px;" class="">./lib/x86_64-unknown-linux-gnu/libc++.so.1</span><br class=""><br class="">Looks like this rpath setting happens here: (changing this to a junk argument causes the test to fail to build as expected)<br class=""><a href="https://github.com/llvm/llvm-project/blob/618583565687f5a494066fc902a977f6057fc93e/lldb/packages/Python/lldbsuite/test/make/Makefile.rules#L400" target="_blank" class="">https://github.com/llvm/llvm-project/blob/618583565687f5a494066fc902a977f6057fc93e/lldb/packages/Python/lldbsuite/test/make/Makefile.rules#L400</a><br class=""><br class="">And it gets the LLVM_LIBS_DIR from here: <a href="https://github.com/llvm/llvm-project/blob/207998c242c8c8a270ff22a5136da87338546725/lldb/test/API/lit.cfg.py#L163" target="_blank" class="">https://github.com/llvm/llvm-project/blob/207998c242c8c8a270ff22a5136da87338546725/lldb/test/API/lit.cfg.py#L163</a><br class=""><br class="">So maybe we need to pass down the default target triple too, since that seems to be how libc++ is deciding where to put the library? ( <a href="https://github.com/llvm/llvm-project/blob/207998c242c8c8a270ff22a5136da87338546725/libcxx/CMakeLists.txt#L424" target="_blank" class="">https://github.com/llvm/llvm-project/blob/207998c242c8c8a270ff22a5136da87338546725/libcxx/CMakeLists.txt#L424</a> ) at least on non-apple :/ (or maybe there's some way to make the connection between the two less brittle - for libc++'s build to export some variable that lldb can use, or for LLVM to provide something for both to use?)<br class=""><br class="">Yeah, applying this change does work for me, but wouldn't work on Apple for instance (where libcxx doesn't add the default target triple to the path):<br class=""><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">$ git diff</span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><b class="">diff --git lldb/test/API/<a href="http://lit.site.cfg.py.in/" target="_blank" class="">lit.site.cfg.py.in</a> lldb/test/API/<a href="http://lit.site.cfg.py.in/" target="_blank" class="">lit.site.cfg.py.in</a></b></span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><b class="">index 987078a53edb..e327429b7ff9 100644</b></span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><b class="">--- lldb/test/API/<a href="http://lit.site.cfg.py.in/" target="_blank" class="">lit.site.cfg.py.in</a></b></span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><b class="">+++ lldb/test/API/<a href="http://lit.site.cfg.py.in/" target="_blank" class="">lit.site.cfg.py.in</a></b></span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(56, 185, 199);" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">@@ -3,7 +3,7 @@</span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><span class=""> </span>config.llvm_src_root = "@LLVM_SOURCE_DIR@"</span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><span class=""> </span>config.llvm_obj_root = "@LLVM_BINARY_DIR@"</span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><span class=""> </span>config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"</span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(202, 51, 35);" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">-config.llvm_libs_dir = "@LLVM_LIBS_DIR@"</span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(57, 192, 38);" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">+config.llvm_libs_dir = "@LLVM_LIBS_DIR@/@LLVM_DEFAULT_TARGET_TRIPLE@"</span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><span class=""> </span>config.llvm_shlib_dir = "@SHLIBDIR@"</span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><span class=""> </span>config.llvm_build_mode = "@LLVM_BUILD_MODE@"</span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><span class=""> </span>config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"<br class=""><br class=""><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;font-variant-ligatures:normal" class="">Thoughts?</span><br class=""></span></div></div></div></div>
</div>
</blockquote></div>
</div></blockquote></div><br class=""></div></body></html>