Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Thomas Devoogdt <thomas@devoogdt.com>
Cc: Daniel Lang <dalang@gmx.at>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v1, next] package/llvm-project/compiler-rt: fix build with Ninja
Date: Tue, 8 Aug 2023 20:02:00 +0200	[thread overview]
Message-ID: <20230808180200.GB421096@scaer> (raw)
In-Reply-To: <CACXRmJhaDgbsEhKC+m60ifiv0bPd8rC10OmAN8pqi=RBs_vtJw@mail.gmail.com>

Thomas D., All,

On 2023-08-08 13:22 +0200, Thomas Devoogdt spake thusly:
> > Not sure to understand: the default backend for CMake is still
> > makefiles, and compiler-rt was not switched to using ninja. So?
> 
> No, ninja is not yet the default.
> Yann did some tests to find out if it makes sense to make ninja the default.
> If only a few packages break on it, then we can force them to use make.
> But if there are too many of them, then we can just keep make as the default.
> 
> Either way, see this mail:
> https://lore.kernel.org/buildroot/20230806205447.GW421096@scaer/,
> where Yann told me that compiler-rt fails on ninja, so that's the
> reason for the patch.

Yes, but as Thomas P. explains, we only need to fix compiler-rt with
ninja if it is actually switched over to using ninja, which your patch
does not do.

Presumably, the build of compiler-rt succeeds now, so if it ain't
broken, so why would we need to fix it by building out-of-source?

But if you had tested, you'd have noticed that the build *is* already
broken even with makefiles. But make is (insanely) forgiving about
circular dependencies, and just arbitrarily drops a circular dependency:

    >>> compiler-rt 15.0.3 Building
    PATH="..." /home/ymorin/dev/buildroot/O/next/per-package/compiler-rt/host/bin/cmake --build /home/ymorin/dev/buildroot/O/next/build/compiler-rt-15.0.3/ -j9 -- 
    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.

In this case, this is OK because the file depends on itself, so breaking
the circular dependency actually removes the spurious dependency.

However, this is not correct, and thus we do need to build compiler-rt
with out-of-source, even with makefile, because it *is* broken.

So, the rationale is wrong: it is not broken because of ninja. It is
broken despite ninja, but ninja exposes the breakage.

Really, when we have a patch that fixes something, what is broken and
why it is broken, is of the utmost most importance; the explanations for
the technical fix is important too, but it only comes second, with the
code actually being the less interesting thing.

Can you please resubmit the patch, but with a corrected commit log that
summarises the above explanations, please?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2023-08-08 18:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08  9:04 [Buildroot] [PATCH v1, next] package/llvm-project/compiler-rt: fix build with Ninja Thomas Devoogdt
2023-08-08  9:20 ` Thomas Petazzoni via buildroot
2023-08-08 11:22   ` Thomas Devoogdt
2023-08-08 14:23     ` Thomas Petazzoni via buildroot
2023-08-08 18:02     ` Yann E. MORIN [this message]
2023-08-14  6:36       ` [Buildroot] [PATCH v2, next] package/llvm-project/compiler-rt: fix circular dependency warning Thomas Devoogdt
2023-08-14 11:23         ` Yann E. MORIN
2023-09-12 18:28           ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230808180200.GB421096@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=dalang@gmx.at \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=thomas@devoogdt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox