Summary: | dev-lang/cfortran-20210827: stablereq | ||||||
---|---|---|---|---|---|---|---|
Product: | Gentoo Linux | Reporter: | Sam James <sam> | ||||
Component: | Stabilization | Assignee: | Gentoo Science Related Packages <sci> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | enhancement | CC: | matoro_gentoo | ||||
Priority: | Normal | Keywords: | CC-ARCHES, PullRequest | ||||
Version: | unspecified | Flags: | nattka:
sanity-check+
|
||||
Hardware: | All | ||||||
OS: | Linux | ||||||
See Also: |
https://github.com/gentoo/gentoo/pull/34143 https://bugs.gentoo.org/show_bug.cgi?id=866560 |
||||||
Whiteboard: | |||||||
Package list: |
=dev-lang/cfortran-20210827
|
Runtime testing required: | --- | ||||
Bug Depends on: | |||||||
Bug Blocks: | 705764 | ||||||
Attachments: |
|
Description
Sam James
![]() ![]() ![]() ![]() x86 done amd64 done ppc done ppc64 done Created attachment 875909 [details]
build.log
One alignment failure on sparc.
Okay...this was tricky and I had to dig into it but the unaligned access is NOT due to incorrect code. It's actually due to a symbol conflict...which is caused by -fno-common! Applying -fcommon solves the issue. Maskray's great writeup at https://maskray.me/blog/2022-02-06-all-about-common-symbols helped me understand this a lot. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42c3c45c2ae81d83676fa8573ee531ae21400fa1 commit 42c3c45c2ae81d83676fa8573ee531ae21400fa1 Author: Matoro Mahri <matoro_gentoo@matoro.tk> AuthorDate: 2023-12-06 06:24:05 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-12-14 04:20:40 +0000 dev-lang/cfortran: add -fcommon to CFLAGS for tests In the failing test, both the Fortran code and the C code have a symbol called _fcb. The test expects it to be in the common section in both objects, such that when it gets linked, they both refer to the same symbol, such that changes on the C side to the variable are reflected on the Fortran side and vice versa. However with -fno-common then it's still placed in the common section in Fortran, but in C it's placed in the BSS section, so now they refer to different objects. The linker actually emits a warning for this, something like "alignment 1 is less than 16". When there are two symbols in different sections with the same name, this is an ODR violation which is UB on all platforms. Bug: https://bugs.gentoo.org/899452 Signed-off-by: Matoro Mahri <matoro_gentoo@matoro.tk> Closes: https://github.com/gentoo/gentoo/pull/34143 Signed-off-by: Sam James <sam@gentoo.org> dev-lang/cfortran/cfortran-20210827.ebuild | 1 + 1 file changed, 1 insertion(+) sparc done all arches done |