From: "Alex Bennée" <alex.bennee@linaro.org>
To: Romain Naour <romain.naour@smile.fr>
Cc: buildroot@buildroot.org, Joseph Kogut <joseph.kogut@gmail.com>,
Romain Naour <romain.naour@gmail.com>,
Daniel Lang <dalang@gmx.at>,
Valentin Korenblit <valentinkorenblit@gmail.com>
Subject: Re: [Buildroot] [RFC PATCH 3/3] package/llvm-project: reduce the build size of llvm
Date: Fri, 04 Jul 2025 12:37:34 +0100 [thread overview]
Message-ID: <87v7o89og1.fsf@draig.linaro.org> (raw)
In-Reply-To: <204c6146-2b48-43d0-94d4-78f030da1f28@smile.fr> (Romain Naour's message of "Thu, 3 Jul 2025 13:16:18 +0200")
Romain Naour <romain.naour@smile.fr> writes:
> Le 03/07/2025 à 13:09, Romain Naour a écrit :
>> Le 03/07/2025 à 08:44, Alex Bennée a écrit :
>>> Romain Naour <romain.naour@smile.fr> writes:
>>>
>>>> Hello Alex, All,
>>>>
>>>> Le 26/06/2025 à 13:16, Alex Bennée a écrit :
>>>>> Although we request a Release build the default CMAKE flags in
>>>>> toolchain.cmake include -Og -g3 which enables debug symbols for the
>>>>> build inflating the overall size of things.
>>>>
>>>> By default, -O2 -g0 is used by Buildroot. If you have -Og -g3 in toolchain.cmake
>>>> generated by Buildroot, it means that BR2_ENABLE_DEBUG, BR2_DEBUG_3 and
>>>> BR2_OPTIMIZE_G have been selected in the Buildroot configuration (by
>>>> the user).
>>>
>>> Where is the logic that sets this? Because:
>>>
>>> ➜ ag DEBUG .config
>>> 179:BR2_TOOLCHAIN_HAS_THREADS_DEBUG=y
>>> 306:# BR2_ENABLE_DEBUG is not set
>>> 307:# BR2_ENABLE_RUNTIME_DEBUG is not set
>>> 4146:# BR2_PACKAGE_OPENPOWERLINK_DEBUG_LEVEL is not set
>>>
>>> But:
>>>
>>> ➜ ag "Buildroot CFLAGS" ./host/share/buildroot/toolchainfile.cmake
>>> 57: set(CMAKE_C_FLAGS "-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Og -g3 -D_FORTIFY_SOURCE=1" CACHE STRING "Buildroot CFLAGS")
>>
>> It's weird indeed. I had to use BR2_ENABLE_DEBUG, BR2_DEBUG_3 and BR2_OPTIMIZE_G
>> to get the same optimization level than you. Otherwise -O2 -g0 is used.
>>
>> Can you share a Buildroot defconfig able to reproduce this issue?
>
> Note:
> ./host/share/buildroot/toolchainfile.cmake is generated by the toolchain package
> as post install staging hook:
>
> see:
> TOOLCHAIN_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_CMAKE_INSTALL_FILES
>
> If the toolchainfile.cmake file was generated with BR2_ENABLE_DEBUG, BR2_DEBUG_3
> and BR2_OPTIMIZE_G set but this setting was updated after, it means you have to
> do a new build. Buildroot doesn't detect such change and a new build from
> scratch is needed.
Ahh that was indeed it. I can drop these patches. Sorry for the noise.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2025-07-04 11:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 11:16 [Buildroot] [RFC PATCH 0/3] package/llvm-project: drop debug info from the binary Alex Bennée
2025-06-26 11:16 ` [Buildroot] [RFC PATCH 1/3] package/llvm-project: use ninja to build llvm libs Alex Bennée
2025-07-02 21:40 ` Romain Naour via buildroot
2026-02-04 16:11 ` Thomas Devoogdt
2026-02-04 16:35 ` Romain Naour via buildroot
2025-06-26 11:16 ` [Buildroot] [RFC PATCH 2/3] package/llvm-project: drop unused TERMINFO config flags Alex Bennée
2025-07-02 21:42 ` Romain Naour via buildroot
2025-06-26 11:16 ` [Buildroot] [RFC PATCH 3/3] package/llvm-project: reduce the build size of llvm Alex Bennée
2025-07-02 22:37 ` Romain Naour via buildroot
2025-07-03 6:29 ` Alex Bennée
2025-07-03 6:44 ` Alex Bennée
2025-07-03 11:09 ` Romain Naour via buildroot
2025-07-03 11:16 ` Romain Naour via buildroot
2025-07-04 11:37 ` Alex Bennée [this message]
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=87v7o89og1.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=buildroot@buildroot.org \
--cc=dalang@gmx.at \
--cc=joseph.kogut@gmail.com \
--cc=romain.naour@gmail.com \
--cc=romain.naour@smile.fr \
--cc=valentinkorenblit@gmail.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