Bug 15712

Summary: Add sanity test for working libstdc++
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Richard Purdie <richard.purdie>
Component: coreAssignee: Christos Gavros <gavrosc>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: gavrosc, mark.asselstine, meta.mr.watcher, meta.watcher, randy.macleod, yoann.congal
Version: 0.0.0   
Target Milestone: 5.2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Richard Purdie 2025-01-09 13:44:55 UTC
On irc we've seen a couple of people report demangling problems in elfutils-native on differing ubuntu versions.

Once I convinced someone to share the config.log, it turned out that linking with -lstdc++ is failing. They were missing the right libstdc++-12-dev for their current c++ lib version (they had older ones).

The best "fix" for this I can see would be to test linking to libstdc++ in sanity.bbclass.
Comment 1 Randy MacLeod 2025-01-09 15:59:34 UTC
basically just need to test by having a hello world that use libstdc++ to add to  sanity.bbclass.
Comment 2 Yoann Congal 2025-01-13 23:21:56 UTC
Christos sent a v1 here: https://lists.openembedded.org/g/openembedded-core/topic/meta_oe_patch_sanity_test/110595436

Looking through the mentioned IRC logs: https://libera.irclog.whitequark.org/yocto/2025-01-06#37555109, it appear that the test to do is:
  gcc -lstdc++ ...
and not a compilation with g++.

The failing line in the logs of the original reporter (https://pastebin.com/HtzCe1vb) is
  configure:8876: checking for __cxa_demangle in -lstdc++
  configure:8905: gcc  -o conftest [...] conftest.c -lstdc++   >&5
  /yoc/test/build/tmp-glibc/hosttools/ld: cannot find -lstdc++: No such file or directory
  collect2: error: ld returned 1 exit status

To trigger the test, maybe removing libstc++-dev suffice?
Comment 3 Christos Gavros 2025-01-15 19:42:09 UTC
I have submitted a patch v2. The use of gcc with lstdc++ sounds advanced case to me.Am I wrong?
Comment 4 Christos Gavros 2025-01-30 14:47:54 UTC
hi

it is merged with the following commit ID:

https://git.openembedded.org/openembedded-core/commit/?id=611c1a26212dfbfe8d0640d9fefe5df49f7b69b8
Comment 5 Randy MacLeod 2025-01-30 16:32:14 UTC
Changed the issue type to an enhancement and also set the Status to resolved/fixed.

Thanks Christos.