Bug 282574 - lang/gcc13-devel: aarch64 output files do not have ELFOSABI_FREEBSD set
Summary: lang/gcc13-devel: aarch64 output files do not have ELFOSABI_FREEBSD set
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Lorenzo Salvadore
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-05 21:44 UTC by John F. Carr
Modified: 2024-11-14 08:26 UTC (History)
0 users

See Also:
salvadore: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John F. Carr 2024-11-05 21:44:05 UTC
On 64 bit ARM (but not amd64) a program or shared library built with gcc13 from gcc13-devel does not have ELFOSABI_FREEBSD set in the e_ident field of the ELF header.  This upsets ldd, which complains

ldd: lib/libclang.so.18.1.8: not a FreeBSD ELF shared object

The difference can be observed with file, which reports (FreeBSD) or (SYSV) depending on compiler used.

ELF 64-bit LSB shared object, ARM aarch64, version 1 (FreeBSD), dynamically linked, with debug_info, not stripped
ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, with debug_info, not stripped

The difference can be observed with elfdump -e, which reports ELFOSABI_FREEBSD or ELFOSABI_NONE.

	e_ident: ELFCLASS64 ELFDATA2LSB ELFOSABI_FREEBSD
	e_ident: ELFCLASS64 ELFDATA2LSB ELFOSABI_NONE

This also affects gcc14-devel and perhaps all gcc packages.
Comment 1 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-11-14 08:26:51 UTC
Thanks for reporting.

I will try to look into this as soon as possible. However, unfortunately, we have many open issues with GCC ports (including an exp run to update default version), so it might take some time...

I am going to try to speed up all of this.