Message ID | 20230814063639.1145396-1-thomas@devoogdt.com |
---|---|
State | Accepted |
Headers | show |
Series | [v2,next] package/llvm-project/compiler-rt: fix circular dependency warning | expand |
Thomas, All, On 2023-08-14 08:36 +0200, Thomas Devoogdt spake thusly: > make[4]: Circular include/sanitizer/allocator_interface.h <- include/sanitizer/allocator_interface.h dependency dropped. > make[4]: Circular include/sanitizer/asan_interface.h <- include/sanitizer/asan_interface.h dependency dropped. [--SNIP--] > It's not clear why this cycle happens, Well, it is rather easy to understand: - include/CMakeLists.txt unconditionally declares dependency rules between header files in ${output_dir} and ${CMAKE_CURRENT_SOURCE_DIR} without provision for them to be the same directories; - this triggers the above warnings from make, hich arbitrarily breaks circular dependencies, which in our case happens to be OK. See how I extended the commit log for more details. And this is actually a fix for an issue that already happens on master. So: applied to master, thanks. Regards, Yann E. MORIN. > but compiler-rt also proposes to > create a separate build folder on their site: https://compiler-rt.llvm.org/. > > Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com> > --- > v2: > - This patch was orignally submitted to fix the ninja build, which does a hard assert on circular dependencies. > Make is less strict on it, and retries with arbitrary dropping dependencies. The oringal git message was wrong > to mention that it fixes the ninja build since ninja is not enabled by default anyway. So in v2, I just > changed the git message to only mention the circular dependency warning. > > - Original Ninja error: > > ninja: error: dependency cycle: include/sanitizer/allocator_interface.h -> include/sanitizer/allocator_interface.h > > --- > package/llvm-project/compiler-rt/compiler-rt.mk | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/package/llvm-project/compiler-rt/compiler-rt.mk b/package/llvm-project/compiler-rt/compiler-rt.mk > index 03dc76eaea..5d9c3d8fa8 100644 > --- a/package/llvm-project/compiler-rt/compiler-rt.mk > +++ b/package/llvm-project/compiler-rt/compiler-rt.mk > @@ -11,6 +11,7 @@ COMPILER_RT_LICENSE = NCSA MIT > COMPILER_RT_LICENSE_FILES = LICENSE.TXT > COMPILER_RT_CPE_ID_VENDOR = llvm > COMPILER_RT_DEPENDENCIES = host-clang llvm > +COMPILER_RT_SUPPORTS_IN_SOURCE_BUILD = NO > > COMPILER_RT_INSTALL_STAGING = YES > COMPILER_RT_INSTALL_TARGET = NO > -- > 2.34.1 > > _______________________________________________ > buildroot mailing list > buildroot@buildroot.org > https://lists.buildroot.org/mailman/listinfo/buildroot
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes: > Thomas, All, > On 2023-08-14 08:36 +0200, Thomas Devoogdt spake thusly: >> make[4]: Circular include/sanitizer/allocator_interface.h <- include/sanitizer/allocator_interface.h dependency dropped. >> make[4]: Circular include/sanitizer/asan_interface.h <- include/sanitizer/asan_interface.h dependency dropped. > [--SNIP--] >> It's not clear why this cycle happens, > Well, it is rather easy to understand: > - include/CMakeLists.txt unconditionally declares dependency rules > between header files in ${output_dir} and ${CMAKE_CURRENT_SOURCE_DIR} > without provision for them to be the same directories; > - this triggers the above warnings from make, hich arbitrarily breaks > circular dependencies, which in our case happens to be OK. > See how I extended the commit log for more details. > And this is actually a fix for an issue that already happens on master. > So: applied to master, thanks. Committed to 2023.02.x and 2023.05.x, thanks. Luckily git is smart enough to notice that those don't have the llvm-project/ sub directory and do the right thing.
diff --git a/package/llvm-project/compiler-rt/compiler-rt.mk b/package/llvm-project/compiler-rt/compiler-rt.mk index 03dc76eaea..5d9c3d8fa8 100644 --- a/package/llvm-project/compiler-rt/compiler-rt.mk +++ b/package/llvm-project/compiler-rt/compiler-rt.mk @@ -11,6 +11,7 @@ COMPILER_RT_LICENSE = NCSA MIT COMPILER_RT_LICENSE_FILES = LICENSE.TXT COMPILER_RT_CPE_ID_VENDOR = llvm COMPILER_RT_DEPENDENCIES = host-clang llvm +COMPILER_RT_SUPPORTS_IN_SOURCE_BUILD = NO COMPILER_RT_INSTALL_STAGING = YES COMPILER_RT_INSTALL_TARGET = NO
make[4]: Circular include/sanitizer/allocator_interface.h <- include/sanitizer/allocator_interface.h dependency dropped. make[4]: Circular include/sanitizer/asan_interface.h <- include/sanitizer/asan_interface.h dependency dropped. make[4]: Circular include/sanitizer/common_interface_defs.h <- include/sanitizer/common_interface_defs.h dependency dropped. make[4]: Circular include/sanitizer/coverage_interface.h <- include/sanitizer/coverage_interface.h dependency dropped. make[4]: Circular include/sanitizer/dfsan_interface.h <- include/sanitizer/dfsan_interface.h dependency dropped. make[4]: Circular include/sanitizer/hwasan_interface.h <- include/sanitizer/hwasan_interface.h dependency dropped. make[4]: Circular include/sanitizer/linux_syscall_hooks.h <- include/sanitizer/linux_syscall_hooks.h dependency dropped. make[4]: Circular include/sanitizer/lsan_interface.h <- include/sanitizer/lsan_interface.h dependency dropped. make[4]: Circular include/sanitizer/msan_interface.h <- include/sanitizer/msan_interface.h dependency dropped. make[4]: Circular include/sanitizer/netbsd_syscall_hooks.h <- include/sanitizer/netbsd_syscall_hooks.h dependency dropped. make[4]: Circular include/sanitizer/scudo_interface.h <- include/sanitizer/scudo_interface.h dependency dropped. make[4]: Circular include/sanitizer/tsan_interface.h <- include/sanitizer/tsan_interface.h dependency dropped. make[4]: Circular include/sanitizer/tsan_interface_atomic.h <- include/sanitizer/tsan_interface_atomic.h dependency dropped. make[4]: Circular include/sanitizer/ubsan_interface.h <- include/sanitizer/ubsan_interface.h dependency dropped. make[4]: Circular include/fuzzer/FuzzedDataProvider.h <- include/fuzzer/FuzzedDataProvider.h dependency dropped. make[4]: Circular include/sanitizer/memprof_interface.h <- include/sanitizer/memprof_interface.h dependency dropped. make[4]: Circular include/profile/MemProfData.inc <- include/profile/MemProfData.inc dependency dropped. make[4]: Circular include/xray/xray_interface.h <- include/xray/xray_interface.h dependency dropped. make[4]: Circular include/xray/xray_log_interface.h <- include/xray/xray_log_interface.h dependency dropped. make[4]: Circular include/xray/xray_records.h <- include/xray/xray_records.h dependency dropped. make[4]: Circular include/orc/c_api.h <- include/orc/c_api.h dependency dropped. make[4]: Circular include/profile/InstrProfData.inc <- include/profile/InstrProfData.inc dependency dropped. It's not clear why this cycle happens, but compiler-rt also proposes to create a separate build folder on their site: https://compiler-rt.llvm.org/. Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com> --- v2: - This patch was orignally submitted to fix the ninja build, which does a hard assert on circular dependencies. Make is less strict on it, and retries with arbitrary dropping dependencies. The oringal git message was wrong to mention that it fixes the ninja build since ninja is not enabled by default anyway. So in v2, I just changed the git message to only mention the circular dependency warning. - Original Ninja error: ninja: error: dependency cycle: include/sanitizer/allocator_interface.h -> include/sanitizer/allocator_interface.h --- package/llvm-project/compiler-rt/compiler-rt.mk | 1 + 1 file changed, 1 insertion(+)