Skip to content

Use -fno-common to avoid linker warnings#13

Merged
pepone merged 1 commit intozeroc-ice:masterfrom
pepone:no-common
Dec 2, 2025
Merged

Use -fno-common to avoid linker warnings#13
pepone merged 1 commit intozeroc-ice:masterfrom
pepone:no-common

Conversation

@pepone
Copy link
Copy Markdown
Member

@pepone pepone commented Dec 2, 2025

With master:

jose@mac swift % make
Fetching https://github.com/zeroc-ice/mcpp.git from cache
Fetched https://github.com/zeroc-ice/mcpp.git from cache (0.79s)
Creating working copy for https://github.com/zeroc-ice/mcpp.git
Working copy of https://github.com/zeroc-ice/mcpp.git resolved at master (bb55f00)
ld: warning: reducing alignment of section __DATA,__common from 0x8000 to 0x4000 because it exceeds segment maximum alignment
Building for production...
ld: warning: reducing alignment of section __DATA,__common from 0x8000 to 0x4000 because it exceeds segment maximum alignment

With this branch:

jose@mac swift % make
Fetching https://github.com/pepone/mcpp.git from cache
Fetched https://github.com/pepone/mcpp.git from cache (0.56s)
Creating working copy for https://github.com/pepone/mcpp.git
Working copy of https://github.com/pepone/mcpp.git resolved at no-common (2ad505e)
Building for production...
[200/200] Linking TestDriver
Build complete! (48.55s)

See also https://mplayerhq.hu/pipermail/ffmpeg-devel/2025-May/343062.html

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the -fno-common compiler flag to resolve linker warnings about section alignment reduction that occur when building mcpp on macOS. The flag tells the compiler to place uninitialized global variables in the BSS section rather than as common symbols, which prevents the __DATA,__common section alignment issues.

Key Changes

  • Added -fno-common compiler flag to the Swift Package Manager build configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pepone pepone merged commit 4137e39 into zeroc-ice:master Dec 2, 2025
7 checks passed
pepone pushed a commit to pepone/mcpp that referenced this pull request Jan 19, 2026
…r overflow in the do_msg() function

https://sourceforge.net/p/mcpp/bugs/13/ and CVE-2019-14274

Description: Fix for a bug reported to sourceforge.net zeroc-ice#13
   by fixing error messages.
   Also, fix erroneous messages.
Author: NIIBE Yutaka

The buffer overflow was caused by do_msg() treating illegal control characters
in the error message output as tokenized macros that needed to be expanded for
printing.

This fixes the problem by just not printing the preprocessed source code which
contains those illegal control characters.

The patch has been reworked to change the error messages to better match those
that are output when unterminated strings are encountered. It also changes the
other patched messages to restore the 'l' in "%02lx" because do_msg() passes a
long integer to mcpp_fprintf().
pepone added a commit that referenced this pull request Jan 19, 2026
…r overflow in the do_msg() function (#15)

https://sourceforge.net/p/mcpp/bugs/13/ and CVE-2019-14274

Description: Fix for a bug reported to sourceforge.net #13
   by fixing error messages.
   Also, fix erroneous messages.
Author: NIIBE Yutaka

The buffer overflow was caused by do_msg() treating illegal control characters
in the error message output as tokenized macros that needed to be expanded for
printing.

This fixes the problem by just not printing the preprocessed source code which
contains those illegal control characters.

The patch has been reworked to change the error messages to better match those
that are output when unterminated strings are encountered. It also changes the
other patched messages to restore the 'l' in "%02lx" because do_msg() passes a
long integer to mcpp_fprintf().

Co-authored-by: John Brandwood <john.brandwood@telzey.com>
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.

4 participants