From nobody Tue Sep 24 16:05:45 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XCl941rVCz5XxPF for ; Tue, 24 Sep 2024 16:06:32 +0000 (UTC) (envelope-from ararslan@comcast.net) Received: from resqmta-h2p-567063.sys.comcast.net (resqmta-h2p-567063.sys.comcast.net [IPv6:2001:558:fd02:2446::b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCl933LjVz4Kt5 for ; Tue, 24 Sep 2024 16:06:31 +0000 (UTC) (envelope-from ararslan@comcast.net) Authentication-Results: mx1.freebsd.org; none Received: from resomta-h2p-555058.sys.comcast.net ([96.102.179.196]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 256/256 bits) (Client did not present a certificate) by resqmta-h2p-567063.sys.comcast.net with ESMTPS id t6gvsHD1BU9Ptt83OszSts; Tue, 24 Sep 2024 16:06:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1727193978; bh=AcaZlgZv/m25fRL36MtjNidIP2+1Xm5Bf272TbNld10=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To:Xfinity-Spam-Result; b=pQzpQ+8HEFDMhAJl4V8Bauo7JwJh4P9PaR0N9L1YgC4xBxd1CfcDjT3U3aBO7R4hM 6rFacwFrHyBP4N1XfJPIAklNvnAL4KAEjYDgfMUKQm+8/WLCe4Npqgw9TFhz651Al6 oZR6Y81Auq674kE+57KqcY6Mmgxx6echJwyxvK1d8R9UuYz4IH20Z5NeW5mmVGdn4t EV4FZcY/+Ok+ypQV7b8PxAfAHphUh1xlyhIVEN9ui8Q4okICt4uOHF+MVkEZYCRi0m Y0ShVGZheIOHfiXMyASJ5EjW/7WCd1jRpuDmZzCyOAj8o5f0s3XaYXM8Ey+erAp3ns mnVwVs8cr3jQw== Received: from smtpclient.apple ([67.160.29.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 256/256 bits) (Client did not present a certificate) by resomta-h2p-555058.sys.comcast.net with ESMTPSA id t831sW40hhyDYt832sHlXv; Tue, 24 Sep 2024 16:05:57 +0000 Content-Type: text/plain; charset=utf-8 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: Wrong OSABI for GCC from Ports From: Alex Arslan In-Reply-To: Date: Tue, 24 Sep 2024 09:05:45 -0700 Cc: FreeBSD Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <52727CFE-BE16-4778-83BD-2EE07B44C9A5@comcast.net> References: To: Lorenzo Salvadore X-Mailer: Apple Mail (2.3776.700.51) X-CMAE-Envelope: MS4xfKML6TGme6y3Gn+BaIu1MxLTHfaw72Dk3w7JqHIZiC1Tfncg7wTvBq4hPQssPV84HXEZIKyYlriUmJBrlfcDibmWzq6FQP3/NkiEych2bx9BBnYf4zNl TwF8W1j5PJg2DovHAlUtNHkynvF/bJWfH1P6x9VjShPrmA2Hik8T+Zxw2/GQOIjCJ3QZBnRP6bogQQ4QM3Xz7YDhCcRqUHaZpmfurnQxZspMe7E8DaVlofWU i868sOunY221BNXpJ8T6ng== X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7922, ipnet:2001:558::/29, country:US] X-Rspamd-Queue-Id: 4XCl933LjVz4Kt5 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated > On Sep 24, 2024, at 4:08=E2=80=AFAM, Lorenzo Salvadore = wrote: >=20 > On Tuesday, September 10th, 2024 at 18:13, Alex Arslan = wrote: >=20 >>=20 >>=20 >> I noticed that GCC and its associated libraries, when installed from = pkg >> on FreeBSD 14.1 AArch64, have an OS/ABI value of NONE (0) rather than >> FreeBSD (9), as reported by readelf --file-header. I also observed = this >> when cross compiling GCC for FreeBSD 13.2 AArch64 on Alpine Linux; I >> assumed it was an issue with the cross compilation setup until I = realized >> that the one from pkg exhibited the same thing. This does not seem to >> occur with x86_64, neither from pkg nor cross compiled. Does anyone = know >> why this would happen and whether it could be addressed with a patch = to >> GCC? Apologies if this is already known and has been discussed = somewhere. >=20 > Hello, >=20 > I am the maintainer for the GCC ports, sorry for the late response. > I have created a bug report to track this issue, so we do not forget > about it: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D281681 Thank you! Mik=C3=A4el Urankar pointed out that what I described sounds = similar to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D252490 and I = believe it is actually the exact same phenomenon as what I described. > Is the bug only about the value reported by readelf? Or is the = compiler > actually broken? If the compiler works, what is the value reported by > readelf for binary compiled by it? The compiler itself works just fine, it's only the OS/ABI in the ELF = file header that isn't set to FreeBSD. It does have a FreeBSD branded ELF = note though. Binaries produced by cc set OS/ABI to FreeBSD and include the = ELF note, whereas binaries produced by the GCC port (13.2.0) have OS/ABI set to NONE but do still include the branded ELF note. The produced binaries are similarly functional. Based on the discussion in Mik=C3=A4el's bug report, it sounds like this behavior is expected, so I guess there's no bug after all? > Thanks for your bug report, >=20 > Lorenzo Salvadore >=20