Skip to content

Commit a76fb56

Browse files
firefox: remove hard clang dependency
Firefox compiles with gcc - remove the hardcoded clang dependency. New patch: a component is trying to remove some gcc warnings. OE adds -Wformat-security by default, but the component also adds -Wno-format, which cancels it out, but generates a warning (which is turned into an error): cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security] To avoid this, the patch adds also -Wno-format-security explicitly. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
1 parent 24108b8 commit a76fb56

3 files changed

Lines changed: 25 additions & 4 deletions

File tree

meta-firefox/recipes-browser/firefox/firefox.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ SRC_URI += "https://ftp.mozilla.org/pub/firefox/releases/${PV}/source/firefox-${
5454
file://0001-Add-option-to-disable-arm-hw-crypto-engine.patch \
5555
file://0001-Fix-conflicting-types-for-once_flag-and-call_once-wi.patch \
5656
file://fix-glibc-2.43-compilation.patch \
57-
file://freebl-ignore-unused-arguments-during-configure.patch \
5857
file://debian-hacks/Add-another-preferences-directory-for-applications-p.patch \
5958
file://debian-hacks/Avoid-using-vmrs-vmsr-on-armel.patch \
6059
file://debian-hacks/Avoid-wrong-sessionstore-data-to-keep-windows-out-of.patch \
@@ -73,6 +72,9 @@ SRC_URI += "https://ftp.mozilla.org/pub/firefox/releases/${PV}/source/firefox-${
7372
file://prefs/Set-DPI-to-system-settings.patch \
7473
"
7574

75+
SRC_URI:append:toolchain-gcc = " file://fix-gcc-compilation.patch"
76+
SRC_URI:append:toolchain-clang = " file://freebl-ignore-unused-arguments-during-configure.patch"
77+
7678
SRCREV_FORMAT = "default"
7779

7880
# Add a config file to enable GPU acceleration by default.
@@ -92,8 +94,6 @@ SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'forbid-multiple-compositors',
9294
file://fixes/0001-Enable-to-suppress-multiple-compositors.patch \
9395
', '', d)}"
9496

95-
TOOLCHAIN:pn-firefox = "clang"
96-
9797
DISABLE_STATIC = ""
9898

9999
PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "alsa", "alsa", "", d)} \
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
By default, OE sets "-Wformat-security" in the CFLAGS variable.
2+
One particular module in the Firefox tree is trying to disable all
3+
such warnings, however it doesn't disable the -Wformat-security
4+
flag in particular, and due to this, compilation fails with the
5+
following error:
6+
7+
cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security]
8+
9+
Add this missing warning removal to the list of ignored warnings.
10+
11+
Upstream-Status: Inappropriate [oe-specific]
12+
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
13+
14+
--- ./js/src/xsum/moz.build.orig 2026-05-29 10:18:14.888226193 +0200
15+
+++ ./js/src/xsum/moz.build 2026-05-29 10:18:29.490810894 +0200
16+
@@ -17,4 +17,4 @@
17+
]
18+
19+
# Suppress warnings in third-party code.
20+
-SOURCES['xsum.cpp'].flags += ['-Wno-implicit-fallthrough', '-Wno-format', '-Wno-unused-value']
21+
+SOURCES['xsum.cpp'].flags += ['-Wno-implicit-fallthrough', '-Wno-format', '-Wno-unused-value', '-Wno-format-security']

meta-firefox/recipes-browser/firefox/firefox/freebl-ignore-unused-arguments-during-configure.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Clang sends warnings about unsued command line arguments to stderr during configuring
1+
Clang sends warnings about unused command line arguments to stderr during configuring
22
freebl (which is enabled for targets without hw crypto support). Gyp only checks
33
if there is anything on stderr, but not the content - it throws an error like this:
44

0 commit comments

Comments
 (0)