Skip to content

GCC15 compatibility issues - #513

Merged
pgiffuni merged 3 commits into
apache:trunkfrom
pgiffuni:trunk
Oct 24, 2026
Merged

pgiffuni merged 3 commits into
apache:trunkfrom
pgiffuni:trunk

Conversation

@pgiffuni

Copy link
Copy Markdown
Contributor

While working on another feature, I found these issues on
gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0

There is a buffer overflow with FORTIFY_SOURCE which I worked around, no idea if you want to try something else.

GCC 15's C++ standard library headers (bits/chrono.h) use _CR as an
internal template parameter name. The _CR and _LF macros defined in
tools/solar.h conflict with these internal identifiers, causing
compilation failures in headers that include both solar.h and C++
standard headers.

Rename _CR->_LF to SAL_CR->SAL_LF across the codebase to avoid
conflicts with reserved identifiers in the C++ standard library.
GCC 15+ treats empty parameter lists () as 'no parameters' (C99+
semantics) rather than 'unspecified parameters' (C89 semantics),
causing compile failures when calling these functions with arguments.

Fix all K&R-style function declarations across build tools (soltools,
l10ntools, rsc) by providing explicit parameter types.
1. Fix buffer overflow in SvMemoryStream::PutData: add bounds check
   before memcpy to prevent overflow when buffer reallocation fails.

2. Change RTLD_NOW to RTLD_LAZY in checkdll: GCC 15 with
   _FORTIFY_SOURCE=2 detects issues with eager symbol resolution
   in shared libraries with many undefined symbols.

Source-only fixes; no Makefile changes.
@ardovm

ardovm commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

The edits look good to me, but I don't see the necessity of the additional check against the buffer overflow...? The above if should already set nCount to zero in case of problems, shouldn't it?

However, if you change anything in method SvMemoryStream::PutData() please also delete the "Letzte Aenderung" comment, that means "Last modification". ;-)

@ardovm

ardovm commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Speaking of FORTIFY_SOURCE, PR #504 may also be useful... do you have time to check it out?

@pgiffuni

pgiffuni commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Hmm ... comments are not part of the fix, they should go on another commit.
I do see we should go ahead and do a translation sweep with some of the free AI engines one of these days.

The RTLD_LAZY change is because FORTIFY_SOURCE does a bunch of symbol replacements as part of it's operation. I just needed to get those changes to build fast on WSL/Ubuntu, but we could probably do without that.

About the sanitizers: that is very useful for debug builds, and ideally with fuzzing, but not for production. And I am currently busy with the regular bugs :).

@pgiffuni
pgiffuni merged commit e7bcdde into apache:trunk Oct 24, 2026
1 check passed
@pgiffuni

Copy link
Copy Markdown
Contributor Author

oops.. should have deleted that extra check... will do in another commit :(.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants