Bug 514259

Summary: link issue if build library & application with different compiler
Product: [Frameworks and Libraries] kldap Reporter: Z. Liu <zhixu.liu>
Component: generalAssignee: kdepim bugs <pim-bugs-null>
Status: REPORTED ---    
Severity: normal CC: aacid, sam
Priority: NOR    
Version First Reported In: git   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Z. Liu 2026-01-07 07:34:55 UTC
see https://bugs.gentoo.org/967872

If kldap is built using clang, and incidenceeditor is then built using gcc, the build fails with the following error:

/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: src/CMakeFiles/KPim6IncidenceEditor.dir/resourceitem.cpp.o: in function `IncidenceEditorNG::ResourceItem::ResourceItem(KLDAPCore::LdapDN const&, QList<QString> const&, KLDAPCore::LdapClient const&, QSharedPointer<IncidenceEditorNG::ResourceItem> const&)':
resourceitem.cpp:(.text+0x1401): undefined reference to `KLDAPCore::LdapServer::setScope(KLDAPCore::LdapUrl::{unnamed type#2})'

The root cause is likely a GCC ABI issue (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123443 & https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99931). Specifically, Scope was changed from typedef to using in commit 3d2613a97e9bb0bdd67d732eb241a50e92fb6153, which appears to trigger this problem when mixing compilers.

Should we consider reverting the using change to restore compatibility?
Comment 1 Albert Astals Cid 2026-01-07 21:49:22 UTC
If the compilers don't promise compatibility when mixing them, then it's not a bug, if they do, it's a bug of the compiler.

I don't really see us chasing this kind of issues, on event less more than 4 years after the commit.
Comment 2 Z. Liu 2026-01-08 02:08:10 UTC
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99931#c4

I think it's a gcc bug.