Bug 2134146
Summary: | relocation R_X86_64_32S when mixing clang++ with gfortran | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Christoph Junghans <junghans> |
Component: | llvm | Assignee: | Tom Stellard <tstellar> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | aoliva, dmalcolm, fweimer, jakub, jchecahi, jistone, jwakely, kkleine, law, mcermak, mpolacek, msebor, nickc, npopov, scottt.tw, serge.guelton, siddharth.kde, sipoyare, tbaeder, tstellar |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2022-10-17 13:52:32 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Christoph Junghans
2022-10-12 15:26:36 UTC
This is a user error. If you want to make a PIE, you should request it explicitly (so link with -pie). No, this is an inconsistency between GCC and Clang that needs to be fixed. Either both should default to PIE, nor neither should. I agree with Florian, we should make this consistent. Or patch CMake to take care of it. GCC is intentionally not configured with --enable-default-pie or similar significant behavior changing options by default, because then users simply have no idea what the compiler will do, they can't rely on anything and so if they care, they need to disable or enable all these options explicitly. While if the default isn't changing, they can rely on it, it isn't a moving target. It is like all of sudden changing the default to be -O2 instead of -O0... So not a GCC bug. Why did it work on F36? Did the clang default change? Most likely. Note, not having -fpie for compiling and -pie for linking by default doesn't mean Fedora isn't built with PIE, the options are added explicitly in %{optflags} etc. Yes, clang's default changed to ON: https://releases.llvm.org/15.0.0/tools/clang/docs/ReleaseNotes.html#build-system-changes and we don't set that option in the spec file. > Note, not having -fpie for compiling and -pie for linking by default doesn't mean Fedora isn't built with PIE, the options are added explicitly in %{optflags} etc. This is true for GCC, but for clang only -fPIE gets added to CFLAGS, but not -pie to LDFLAGS (https://bugzilla.redhat.com/show_bug.cgi?id=2084460). I'm not really clear on why this is the case though. The situation here is somewhat ugly because gcc and clang now have different upstream defaults (the bug for changing gcc defaults is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103398, which makes the incorrect claim that Fedora already enables this by default -- I guess there is confusion there between enabling something for RPM packages, and enabling it for end users). But anyway, given that GCC is the primary toolchain for Fedora, we should follow whatever it does, so I've put up https://src.fedoraproject.org/rpms/clang/pull-request/183. FEDORA-2022-7011f92b71 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-7011f92b71 FEDORA-2022-7011f92b71 has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report. Update for f37: https://bodhi.fedoraproject.org/updates/FEDORA-2022-9dcdd39f09 |