Description of problem: I am working on packaging mozjs128, a dependency of gjs (GNOME). The upstream prefers clang tooling, but Fedora and el builds have historically used gcc. The build fails on: error: ‘static void js::gc::Cell::operator delete(void*)’ is private within this context where clang doesn't complain and builds an usable binary. Version-Release number of selected component (if applicable): gcc-14.2.1-1.fc40.x86_64 gcc-14.1.1-7.fc41.x86_64 (Latest in rawhide as gcc is FTBFS there) How reproducible: Always Steps to Reproduce: The buildsys is a bit complicated, I'll upload a tarball archive as an attachment (as this is an upcoming package). 1. Untar, git init, git checkout -b rawhide, spectool -g mozjs128.spec, fedpkg srpm 2. mock build 3. Actual results: A spam of: error: ‘static void js::gc::Cell::operator delete(void*)’ is private within this context Expected results: Working build. Additional info:
Created attachment 2044180 [details] build log
Created attachment 2044181 [details] dist-git tarball
FYI, I've left commented out '%global toolchain clang' to experiment with, the clang build fails too at a later point (due to packaging in progress, on brp-mangle-shebangs ).
As for the steps how to reproduce, the first one should be with git add mozjs128.spec & git commit, sorry.
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle. Changing version to 42.
When I work on another distro I found the same symptom is triggered by "-fexception" in the default CXXFLAGS setting of that distro. The mozjs build system appends the CXXFLAGS from environment after the flags set on its own, and this -fexception overrides the -fno-exception set by the mozjs build system then things can go wrong. But I've not figured out the full event of chain how this leads to the cryptic "error: ‘static void js::gc::Cell::operator delete(void*)’ is private within this context."
I can confirm that adding: %global optflags %(echo %{optflags} | sed -e 's/-fexceptions//g') Resolves compilation error with toolchain is GCC.