[PR #6283] [MERGED] build: fix "warning: "_FORTIFY_SOURCE" redefined" #5929

Closed
opened 2026-05-05 10:47:33 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/6283
Author: @kmk3
Created: 3/19/2024
Status: Merged
Merged: 3/20/2024
Merged by: @kmk3

Base: masterHead: build-fix-fortify-warn


📝 Commits (1)

  • bce208d build: fix "warning: "_FORTIFY_SOURCE" redefined"

📊 Changes

3 files changed (+48 additions, -1 deletions)

View changed files

📝 config.mk.in (+1 -1)
📝 configure (+43 -0)
📝 configure.ac (+4 -0)

📄 Description

The warning is being produced on Arch since pacman 6.1, which changed
-D_FORTIFY_SOURCE=2 to -D_FORTIFY_SOURCE=3 in CFLAGS in
makepkg.conf:

$ pacman -Q gcc pacman
gcc 13.2.1-5
pacman 6.1.0-3
$ makepkg
[...]
make -C src/lib
gcc [...] -D_FORTIFY_SOURCE=2 [...] -Wp,-D_FORTIFY_SOURCE=3 [...] -c ../../src/lib/common.c -o ../../src/lib/common.o
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition

To fix this, only add -D_FORTIFY_SOURCE to EXTRA_CFLAGS if it does not
cause any warnings with CFLAGS and CPPFLAGS during compilation.

The effect remains the same: The build system still defines the macro by
default (if there are no warnings) and the user/distribution can still
override it through CFLAGS/CPPFLAGS.

Fixes #6282.

Reported-by: @glitsj16


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/6283 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 3/19/2024 **Status:** ✅ Merged **Merged:** 3/20/2024 **Merged by:** [@kmk3](https://github.com/kmk3) **Base:** `master` ← **Head:** `build-fix-fortify-warn` --- ### 📝 Commits (1) - [`bce208d`](https://github.com/netblue30/firejail/commit/bce208de5a9dc20aea02bbeaeb9a8ad2103b71ed) build: fix "warning: "_FORTIFY_SOURCE" redefined" ### 📊 Changes **3 files changed** (+48 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `config.mk.in` (+1 -1) 📝 `configure` (+43 -0) 📝 `configure.ac` (+4 -0) </details> ### 📄 Description The warning is being produced on Arch since pacman 6.1, which changed `-D_FORTIFY_SOURCE=2` to `-D_FORTIFY_SOURCE=3` in CFLAGS in makepkg.conf: $ pacman -Q gcc pacman gcc 13.2.1-5 pacman 6.1.0-3 $ makepkg [...] make -C src/lib gcc [...] -D_FORTIFY_SOURCE=2 [...] -Wp,-D_FORTIFY_SOURCE=3 [...] -c ../../src/lib/common.c -o ../../src/lib/common.o <command-line>: warning: "_FORTIFY_SOURCE" redefined <command-line>: note: this is the location of the previous definition To fix this, only add `-D_FORTIFY_SOURCE` to EXTRA_CFLAGS if it does not cause any warnings with CFLAGS and CPPFLAGS during compilation. The effect remains the same: The build system still defines the macro by default (if there are no warnings) and the user/distribution can still override it through CFLAGS/CPPFLAGS. Fixes #6282. Reported-by: @glitsj16 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:47:33 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#5929
No description provided.