* [PATCH v2] gn: remove gcc override
@ 2025-10-04 15:59 Jon Mason
2025-10-06 5:06 ` [OE-core] " Khem Raj
0 siblings, 1 reply; 3+ messages in thread
From: Jon Mason @ 2025-10-04 15:59 UTC (permalink / raw)
To: openembedded-core
When compiling gn with clang, the following errors are being seen (with
qemuarm64-secureboot machine, possibly others):
In file included from /usr/include/c++/12/string:40,
from ../sources/gn-0+git/src/base/strings/string_number_conversions.h:11,
from ../sources/gn-0+git/src/gn/operators.cc:10:
In static member function ‘static constexpr void std::char_traits<char>::assign(char_type&, const char_type&)’,
inlined from ‘static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:421:23,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.tcc:532:22,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::assign(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:1647:19,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:815:28,
inlined from ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’ at ../sources/gn-0+git/src/gn/operators.cc:202:17:
/usr/include/c++/12/bits/char_traits.h:354:16: error: ‘((const std::char_traits<char>::char_type*)((char*)&empty_def + offsetof(std::__cxx11::string, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::<unnamed>)))[2]’ may be used uninitialized [-Werror=maybe-uninitialized]
354 | __c1 = __c2;
| ^~~~
../sources/gn-0+git/src/gn/operators.cc: In function ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’:
../sources/gn-0+git/src/gn/operators.cc:198:15: note: ‘empty_def’ declared here
198 | std::string empty_def;
| ^~~~~~~~~
In static member function ‘static constexpr void std::char_traits<char>::assign(char_type&, const char_type&)’,
inlined from ‘static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:421:23,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.tcc:532:22,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::assign(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:1647:19,
inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:815:28,
inlined from ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’ at ../sources/gn-0+git/src/gn/operators.cc:205:17:
/usr/include/c++/12/bits/char_traits.h:354:16: error: ‘((const std::char_traits<char>::char_type*)((char*)&empty_def + offsetof(std::__cxx11::string, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::<unnamed>)))[2]’ may be used uninitialized [-Werror=maybe-uninitialized]
354 | __c1 = __c2;
| ^~~~
../sources/gn-0+git/src/gn/operators.cc: In function ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’:
../sources/gn-0+git/src/gn/operators.cc:198:15: note: ‘empty_def’ declared here
198 | std::string empty_def;
| ^~~~~~~~~
cc1plus: all warnings being treated as errors
Remove the toolchain-gcc override to allow the cflag
-Wno-error=maybe-uninitialized to be applied.
Signed-off-by: Jon Mason <jon.mason@arm.com>
---
meta/recipes-devtools/gn/gn_git.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/gn/gn_git.bb b/meta/recipes-devtools/gn/gn_git.bb
index d8896609b193..87ccfe370456 100644
--- a/meta/recipes-devtools/gn/gn_git.bb
+++ b/meta/recipes-devtools/gn/gn_git.bb
@@ -49,4 +49,4 @@ BBCLASSEXTEND = "native"
COMPATIBLE_HOST = "^(?!riscv32).*"
-CFLAGS:append:toolchain-gcc = " -Wno-error=maybe-uninitialized"
+CFLAGS += "-Wno-error=maybe-uninitialized"
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH v2] gn: remove gcc override
2025-10-04 15:59 [PATCH v2] gn: remove gcc override Jon Mason
@ 2025-10-06 5:06 ` Khem Raj
2025-10-06 5:10 ` Khem Raj
0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2025-10-06 5:06 UTC (permalink / raw)
To: jdmason; +Cc: openembedded-core
On Sat, Oct 4, 2025 at 9:00 AM Jon Mason via lists.openembedded.org
<jdmason=kudzu.us@lists.openembedded.org> wrote:
>
> When compiling gn with clang, the following errors are being seen (with
> qemuarm64-secureboot machine, possibly others):
>
> In file included from /usr/include/c++/12/string:40,
> from ../sources/gn-0+git/src/base/strings/string_number_conversions.h:11,
> from ../sources/gn-0+git/src/gn/operators.cc:10:
> In static member function ‘static constexpr void std::char_traits<char>::assign(char_type&, const char_type&)’,
> inlined from ‘static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:421:23,
> inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.tcc:532:22,
> inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::assign(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:1647:19,
> inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:815:28,
> inlined from ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’ at ../sources/gn-0+git/src/gn/operators.cc:202:17:
> /usr/include/c++/12/bits/char_traits.h:354:16: error: ‘((const std::char_traits<char>::char_type*)((char*)&empty_def + offsetof(std::__cxx11::string, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::<unnamed>)))[2]’ may be used uninitialized [-Werror=maybe-uninitialized]
> 354 | __c1 = __c2;
> | ^~~~
> ../sources/gn-0+git/src/gn/operators.cc: In function ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’:
> ../sources/gn-0+git/src/gn/operators.cc:198:15: note: ‘empty_def’ declared here
> 198 | std::string empty_def;
> | ^~~~~~~~~
> In static member function ‘static constexpr void std::char_traits<char>::assign(char_type&, const char_type&)’,
> inlined from ‘static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:421:23,
> inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.tcc:532:22,
> inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::assign(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:1647:19,
> inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:815:28,
> inlined from ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’ at ../sources/gn-0+git/src/gn/operators.cc:205:17:
> /usr/include/c++/12/bits/char_traits.h:354:16: error: ‘((const std::char_traits<char>::char_type*)((char*)&empty_def + offsetof(std::__cxx11::string, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::<unnamed>)))[2]’ may be used uninitialized [-Werror=maybe-uninitialized]
> 354 | __c1 = __c2;
> | ^~~~
> ../sources/gn-0+git/src/gn/operators.cc: In function ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’:
> ../sources/gn-0+git/src/gn/operators.cc:198:15: note: ‘empty_def’ declared here
> 198 | std::string empty_def;
> | ^~~~~~~~~
> cc1plus: all warnings being treated as errors
>
> Remove the toolchain-gcc override to allow the cflag
> -Wno-error=maybe-uninitialized to be applied.
>
> Signed-off-by: Jon Mason <jon.mason@arm.com>
> ---
> meta/recipes-devtools/gn/gn_git.bb | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/gn/gn_git.bb b/meta/recipes-devtools/gn/gn_git.bb
> index d8896609b193..87ccfe370456 100644
> --- a/meta/recipes-devtools/gn/gn_git.bb
> +++ b/meta/recipes-devtools/gn/gn_git.bb
> @@ -49,4 +49,4 @@ BBCLASSEXTEND = "native"
>
> COMPATIBLE_HOST = "^(?!riscv32).*"
>
> -CFLAGS:append:toolchain-gcc = " -Wno-error=maybe-uninitialized"
> +CFLAGS += "-Wno-error=maybe-uninitialized"
This is not a valid option with clang, I can see the error in report
is seen with gcc ( cc1plus being called there )
Why is it choosing gcc to compile when you selected clang as your
default compiler ?
. I wonder why it is not getting applied when toolchain-gcc OVERRIDE
is applied ?
> --
> 2.39.5
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#224432): https://lists.openembedded.org/g/openembedded-core/message/224432
> Mute This Topic: https://lists.openembedded.org/mt/115588441/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH v2] gn: remove gcc override
2025-10-06 5:06 ` [OE-core] " Khem Raj
@ 2025-10-06 5:10 ` Khem Raj
0 siblings, 0 replies; 3+ messages in thread
From: Khem Raj @ 2025-10-06 5:10 UTC (permalink / raw)
To: jdmason; +Cc: openembedded-core
On Sun, Oct 5, 2025 at 10:06 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Sat, Oct 4, 2025 at 9:00 AM Jon Mason via lists.openembedded.org
> <jdmason=kudzu.us@lists.openembedded.org> wrote:
> >
> > When compiling gn with clang, the following errors are being seen (with
> > qemuarm64-secureboot machine, possibly others):
> >
> > In file included from /usr/include/c++/12/string:40,
> > from ../sources/gn-0+git/src/base/strings/string_number_conversions.h:11,
> > from ../sources/gn-0+git/src/gn/operators.cc:10:
> > In static member function ‘static constexpr void std::char_traits<char>::assign(char_type&, const char_type&)’,
> > inlined from ‘static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:421:23,
> > inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.tcc:532:22,
> > inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::assign(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:1647:19,
> > inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:815:28,
> > inlined from ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’ at ../sources/gn-0+git/src/gn/operators.cc:202:17:
> > /usr/include/c++/12/bits/char_traits.h:354:16: error: ‘((const std::char_traits<char>::char_type*)((char*)&empty_def + offsetof(std::__cxx11::string, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::<unnamed>)))[2]’ may be used uninitialized [-Werror=maybe-uninitialized]
> > 354 | __c1 = __c2;
> > | ^~~~
> > ../sources/gn-0+git/src/gn/operators.cc: In function ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’:
> > ../sources/gn-0+git/src/gn/operators.cc:198:15: note: ‘empty_def’ declared here
> > 198 | std::string empty_def;
> > | ^~~~~~~~~
> > In static member function ‘static constexpr void std::char_traits<char>::assign(char_type&, const char_type&)’,
> > inlined from ‘static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:421:23,
> > inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.tcc:532:22,
> > inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::assign(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:1647:19,
> > inlined from ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/12/bits/basic_string.h:815:28,
> > inlined from ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’ at ../sources/gn-0+git/src/gn/operators.cc:205:17:
> > /usr/include/c++/12/bits/char_traits.h:354:16: error: ‘((const std::char_traits<char>::char_type*)((char*)&empty_def + offsetof(std::__cxx11::string, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::<unnamed>)))[2]’ may be used uninitialized [-Werror=maybe-uninitialized]
> > 354 | __c1 = __c2;
> > | ^~~~
> > ../sources/gn-0+git/src/gn/operators.cc: In function ‘Err {anonymous}::MakeOverwriteError(const BinaryOpNode*, const Value&)’:
> > ../sources/gn-0+git/src/gn/operators.cc:198:15: note: ‘empty_def’ declared here
> > 198 | std::string empty_def;
> > | ^~~~~~~~~
> > cc1plus: all warnings being treated as errors
> >
> > Remove the toolchain-gcc override to allow the cflag
> > -Wno-error=maybe-uninitialized to be applied.
> >
> > Signed-off-by: Jon Mason <jon.mason@arm.com>
> > ---
> > meta/recipes-devtools/gn/gn_git.bb | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-devtools/gn/gn_git.bb b/meta/recipes-devtools/gn/gn_git.bb
> > index d8896609b193..87ccfe370456 100644
> > --- a/meta/recipes-devtools/gn/gn_git.bb
> > +++ b/meta/recipes-devtools/gn/gn_git.bb
> > @@ -49,4 +49,4 @@ BBCLASSEXTEND = "native"
> >
> > COMPATIBLE_HOST = "^(?!riscv32).*"
> >
> > -CFLAGS:append:toolchain-gcc = " -Wno-error=maybe-uninitialized"
> > +CFLAGS += "-Wno-error=maybe-uninitialized"
>
> This is not a valid option with clang, I can see the error in report
> is seen with gcc ( cc1plus being called there )
> Why is it choosing gcc to compile when you selected clang as your
> default compiler ?
> . I wonder why it is not getting applied when toolchain-gcc OVERRIDE
> is applied ?
So I guess you are seeing it with gc-native ?
in that case your patch should not only add this warning but also
remove it when toolchain is clang
add
CFLAGS:remove:toolchain-clang = "-Wno-error=maybe-uninitialized"
as well. so it works with clang and gcc both
>
> > --
> > 2.39.5
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#224432): https://lists.openembedded.org/g/openembedded-core/message/224432
> > Mute This Topic: https://lists.openembedded.org/mt/115588441/1997914
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-06 5:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-04 15:59 [PATCH v2] gn: remove gcc override Jon Mason
2025-10-06 5:06 ` [OE-core] " Khem Raj
2025-10-06 5:10 ` Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox