Bug 2304756 - gcc fails to build mozjs128 where clang succeeds
Summary: gcc fails to build mozjs128 where clang succeeds
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 45
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-08-13 23:40 UTC by František Zatloukal
Modified: 2026-08-17 13:19 UTC (History)
14 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
build log (69.05 KB, application/x-xz)
2024-08-13 23:40 UTC, František Zatloukal
no flags Details
dist-git tarball (8.86 KB, application/x-xz)
2024-08-13 23:41 UTC, František Zatloukal
no flags Details

Description František Zatloukal 2024-08-13 23:40:15 UTC
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:

Comment 1 František Zatloukal 2024-08-13 23:40:58 UTC
Created attachment 2044180 [details]
build log

Comment 2 František Zatloukal 2024-08-13 23:41:31 UTC
Created attachment 2044181 [details]
dist-git tarball

Comment 3 František Zatloukal 2024-08-13 23:42:48 UTC
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 ).

Comment 4 František Zatloukal 2024-08-13 23:45:46 UTC
As for the steps how to reproduce, the first one should be with git add mozjs128.spec & git commit, sorry.

Comment 5 Aoife Moloney 2025-02-26 13:11:00 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 6 Xi Ruoyao 2025-08-29 19:05:03 UTC
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."

Comment 7 David Abdurachmanov 2025-11-12 16:40:30 UTC
I can confirm that adding:

%global optflags %(echo %{optflags} | sed -e 's/-fexceptions//g')

Resolves compilation error with toolchain is GCC.

Comment 8 Aoife Moloney 2026-08-17 13:19:21 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 45 development cycle.
Changing version to 45.


Note You need to log in before you can comment on or make changes to this bug.