#1128874 firefox: FTBFS with glibc 2.43 due to ONCE_FLAG_INIT redefinition

Package:
src:firefox
Source:
src:firefox
Submitter:
Aurelien Jarno
Date:
2026-02-23 20:39:03 UTC
Severity:
normal
Tags:
#1128874#5
Date:
2026-02-23 20:36:42 UTC
From:
To:
Dear maintainer(s),

firefox fails to build from source with glibc 2.43, currently in
experimental. From the build log:

| [glslopt 0.1.12] cargo:warning=In file included from src/compiler/glsl/glcpp/glcpp-parse.y:32:
| [glslopt 0.1.12] cargo:warning=In file included from glsl-optimizer/src/mesa/main/mtypes.h:39:
| [glslopt 0.1.12] cargo:warning=In file included from glsl-optimizer/include/c11/threads.h:66:
| [glslopt 0.1.12] cargo:warning=glsl-optimizer/include/c11/threads_posix.h:54:9: warning: 'ONCE_FLAG_INIT' macro redefined [-Wmacro-redefined]
| [glslopt 0.1.12] cargo:warning=   54 | #define ONCE_FLAG_INIT PTHREAD_ONCE_INIT
| [glslopt 0.1.12] cargo:warning=      |         ^
| [glslopt 0.1.12] cargo:warning=/usr/include/aarch64-linux-gnu/bits/types/once_flag.h:25:9: note: previous definition is here
| [glslopt 0.1.12] cargo:warning=   25 | #define ONCE_FLAG_INIT __ONCE_FLAG_INIT
| [glslopt 0.1.12] cargo:warning=      |         ^
| [glslopt 0.1.12] cargo:warning=In file included from src/compiler/glsl/glcpp/glcpp-parse.y:32:
| [glslopt 0.1.12] cargo:warning=In file included from glsl-optimizer/src/mesa/main/mtypes.h:39:
| [glslopt 0.1.12] cargo:warning=In file included from glsl-optimizer/include/c11/threads.h:66:
| [glslopt 0.1.12] cargo:warning=glsl-optimizer/include/c11/threads_posix.h:69:25: error: typedef redefinition with different types ('pthread_once_t' (aka 'int') vs '__once_flag')
| [glslopt 0.1.12] cargo:warning=   69 | typedef pthread_once_t  once_flag;
| [glslopt 0.1.12] cargo:warning=      |                         ^
| [glslopt 0.1.12] cargo:warning=/usr/include/aarch64-linux-gnu/bits/types/once_flag.h:24:21: note: previous definition is here
| [glslopt 0.1.12] cargo:warning=   24 | typedef __once_flag once_flag;
| [glslopt 0.1.12] cargo:warning=      |                     ^
| [glslopt 0.1.12] cargo:warning=In file included from src/compiler/glsl/glcpp/glcpp-parse.y:32:
| [glslopt 0.1.12] cargo:warning=In file included from glsl-optimizer/src/mesa/main/mtypes.h:39:
| [glslopt 0.1.12] cargo:warning=In file included from glsl-optimizer/include/c11/threads.h:66:
| [glslopt 0.1.12] cargo:warning=glsl-optimizer/include/c11/threads_posix.h:94:1: error: static declaration of 'call_once' follows non-static declaration
| [glslopt 0.1.12] cargo:warning=   94 | call_once(once_flag *flag, void (*func)(void))
| [glslopt 0.1.12] cargo:warning=      | ^
| [glslopt 0.1.12] cargo:warning=/usr/include/stdlib.h:1195:13: note: previous declaration is here
| [glslopt 0.1.12] cargo:warning= 1195 | extern void call_once (once_flag *__flag, void (*__func)(void));
| [glslopt 0.1.12] cargo:warning=      |             ^
| [glslopt 0.1.12] cargo:warning=In file included from src/compiler/glsl/glcpp/glcpp-parse.y:32:
| [glslopt 0.1.12] cargo:warning=In file included from glsl-optimizer/src/mesa/main/mtypes.h:39:
| [glslopt 0.1.12] cargo:warning=In file included from glsl-optimizer/include/c11/threads.h:66:
| [glslopt 0.1.12] cargo:warning=glsl-optimizer/include/c11/threads_posix.h:96:18: warning: incompatible pointer types passing 'once_flag *' (aka '__once_flag *') to parameter of type 'pthread_once_t *' (aka 'int *') [-Wincompatible-pointer-types]
| [glslopt 0.1.12] cargo:warning=   96 |     pthread_once(flag, func);
| [glslopt 0.1.12] cargo:warning=      |                  ^~~~
| [glslopt 0.1.12] cargo:warning=/usr/include/pthread.h:509:42: note: passing argument to parameter '__once_control' here
| [glslopt 0.1.12] cargo:warning=  509 | extern int pthread_once (pthread_once_t *__once_control,
| [glslopt 0.1.12] cargo:warning=      |                                          ^

...

| dh_auto_build: error: cd build-browser && make -j128 returned exit code 2
| make[3]: *** [debian/rules:250: stamps/build-browser] Error 25
| make[3]: Leaving directory '/build/reproducible-path/firefox-147.0.4'
| make[2]: *** [debian/rules:336: build] Error 2
| make[2]: Leaving directory '/build/reproducible-path/firefox-147.0.4'
| make[1]: *** [debian/rules:336: install] Error 2
| make[1]: Leaving directory '/build/reproducible-path/firefox-147.0.4'
| make: *** [debian/rules:336: binary] Error 2
| dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2

The full build log is available here [1].

The issue is due to the definition of ONCE_FLAG_INIT in stdlib.h in
addition to threads.h as part of ISO C23 [2]. I believe that the issue
is fixed upstream [3], but I haven't tested the patch.

I would like to thanks Emanuele Rocca for doing the archive rebuild on a
fast arm64 server.

Regards
Aurelien

[1] https://people.debian.org/~ema/glibc-2.43-rebuilds/output-1/firefox_arm64.build
[2] https://sourceware.org/git/?p=glibc.git;a=commit;h=a7ddbf456d97ac8d1aa7afd735e196a1488bd874
[3] https://github.com/jamienicol/glsl-optimizer/commit/9913c27419488217cb3e9aa18dcda41c8dee1284