Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ditch not recommended -Wp prefixes preventing default gcc flag overwrite (backport #3119) #3122

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 14, 2025

While building for Ubuntu >=24.04, noticed loads of the following:

<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition

Which can also be seen on GitHub action runs, for example here:
https://github.com/Exiv2/exiv2/actions/runs/12740529422/job/35505851531#step:5:122

Apparently, Ubuntu switched to adding _FORTIFY_SOURCE=3 by default, and extra -Wp prefix on Exiv2 code-base was preventing those defaults being overwritten.

Running on Ubuntu 24.04:

$ gcc -dM -E -O3 - < /dev/null | grep FORTIFY
#define _FORTIFY_SOURCE 3

Also, according to GCC docs, -Wp prefix is not recommended:

-Wp,option

You can use -Wp,option to bypass the compiler driver and pass option directly through to the preprocessor.
If option contains commas, it is split into multiple options at the commas. However, many options are
modified, translated or interpreted by the compiler driver before being passed to the preprocessor,
and -Wp forcibly bypasses this phase. The preprocessor’s direct interface is undocumented and
subject to change, so whenever possible you should avoid using -Wp and let the driver handle
the options instead.

https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-Wp

TL;DR: removing directive which supposed to be avoided for easier integration and cleaner build on Ubuntu >=24.04 machines (or whatever going to be crazy enough to add defaults of _FORTIFY_SOURCE=3 on distro level.


This is an automatic backport of pull request #3119 done by Mergify.

@kmilos kmilos added the CMake Configuration issues related with CMake label Jan 14, 2025
@kmilos kmilos added this to the v0.28.4 milestone Jan 14, 2025
@kmilos kmilos merged commit 9c5d75d into 0.28.x Jan 14, 2025
62 checks passed
@mergify mergify bot deleted the mergify/bp/0.28.x/pr-3119 branch January 14, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake Configuration issues related with CMake
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants