[PR #5859] [MERGED] build: remove -mretpoline and NO_EXTRA_CFLAGS #5696

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

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/5859
Author: @kmk3
Created: 6/18/2023
Status: Merged
Merged: 6/20/2023
Merged by: @kmk3

Base: masterHead: build-remove-retpoline


📝 Commits (1)

  • 63f1a04 build: remove -mretpoline and NO_EXTRA_CFLAGS

📊 Changes

5 files changed (+2 additions, -48 deletions)

View changed files

📝 .github/workflows/build-extra.yml (+1 -1)
📝 Makefile (+1 -1)
📝 config.mk.in (+0 -4)
📝 configure (+0 -38)
📝 configure.ac (+0 -4)

📄 Description

The -mretpoline flag is not documented in the current versions of gcc
and clang and it is what causes scan-build to fail:

$ ./configure CC=clang | grep retpoline
checking whether C compiler accepts -mretpoline... yes
   EXTRA_CFLAGS:  -mretpoline -fstack-clash-protection -fstack-protector-strong
$ scan-build --status-bugs make
scan-build: Using '/usr/bin/clang-15' for static analysis
make -C src/lib
make[1]: Entering directory '/tmp/firejail/src/lib'
/usr/bin/../lib/clang/ccc-analyzer [...] -mretpoline [...] -c common.c -o common.o
gcc: error: unrecognized command-line option ‘-mretpoline’
make[1]: *** [../../src/prog.mk:16: common.o] Error 1
make[1]: Leaving directory '/tmp/firejail/src/lib'
make: *** [Makefile:59: src/lib] Error 2
scan-build: Analysis run complete.
scan-build: Removing directory '/tmp/scan-build-[...]' because it contains no reports.
scan-build: No bugs found.

Environment: clang 15.0.7-9 and gcc 13.1.1-1 on Artix Linux.

Note: NO_EXTRA_CFLAGS was added to work around this issue by causing all
of the flags in EXTRA_CFLAGS to be ignored.

Note2: -mretpoline was added on commit 4a99c8aa2 ("spectre support for
clang compiler", 2018-03-30) and NO_EXTRA_CFLAGS was added on commit
490918c35 ("fix make scan-build for debian 10 and arch", 2019-07-22).
See also commit 2c64d1fdd ("use AX_CHECK_COMPILE_FLAG to check for
spectre flags", 2019-06-21).

Closes #5509.

Kind of relates to #2661.

Cc: @netblue30 @reinerh


🔄 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/5859 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 6/18/2023 **Status:** ✅ Merged **Merged:** 6/20/2023 **Merged by:** [@kmk3](https://github.com/kmk3) **Base:** `master` ← **Head:** `build-remove-retpoline` --- ### 📝 Commits (1) - [`63f1a04`](https://github.com/netblue30/firejail/commit/63f1a045ba675568a1e92b204c301359dbccc85b) build: remove -mretpoline and NO_EXTRA_CFLAGS ### 📊 Changes **5 files changed** (+2 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/build-extra.yml` (+1 -1) 📝 `Makefile` (+1 -1) 📝 `config.mk.in` (+0 -4) 📝 `configure` (+0 -38) 📝 `configure.ac` (+0 -4) </details> ### 📄 Description The -mretpoline flag is not documented in the current versions of gcc and clang and it is what causes scan-build to fail: $ ./configure CC=clang | grep retpoline checking whether C compiler accepts -mretpoline... yes EXTRA_CFLAGS: -mretpoline -fstack-clash-protection -fstack-protector-strong $ scan-build --status-bugs make scan-build: Using '/usr/bin/clang-15' for static analysis make -C src/lib make[1]: Entering directory '/tmp/firejail/src/lib' /usr/bin/../lib/clang/ccc-analyzer [...] -mretpoline [...] -c common.c -o common.o gcc: error: unrecognized command-line option ‘-mretpoline’ make[1]: *** [../../src/prog.mk:16: common.o] Error 1 make[1]: Leaving directory '/tmp/firejail/src/lib' make: *** [Makefile:59: src/lib] Error 2 scan-build: Analysis run complete. scan-build: Removing directory '/tmp/scan-build-[...]' because it contains no reports. scan-build: No bugs found. Environment: clang 15.0.7-9 and gcc 13.1.1-1 on Artix Linux. Note: NO_EXTRA_CFLAGS was added to work around this issue by causing all of the flags in EXTRA_CFLAGS to be ignored. Note2: -mretpoline was added on commit 4a99c8aa2 ("spectre support for clang compiler", 2018-03-30) and NO_EXTRA_CFLAGS was added on commit 490918c35 ("fix make scan-build for debian 10 and arch", 2019-07-22). See also commit 2c64d1fdd ("use AX_CHECK_COMPILE_FLAG to check for spectre flags", 2019-06-21). Closes #5509. Kind of relates to #2661. Cc: @netblue30 @reinerh --- <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:43:12 -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#5696
No description provided.