From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F3E0C3870C0C; Wed, 29 May 2024 08:20:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3E0C3870C0C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716970828; bh=YOCI3+vKV//SseC8Dzg3hgQZWFPc4L2DTzSBKVBwMaY=; h=From:To:Subject:Date:From; b=b+wf0zBLebHecnlMchn9EqhaVI/wKo2EkdGMEbjjKRv2onFp2XavcNc5NDnCWPsQk rGTaGh741S5T2HWk0hO/n2H3LEJ9CFqc5do8QvqiW4/D3ZZyK38Hk178e9q3KEvQg4 cYjgX6m5vNEUvg+ftVJShsUZhKTsfcdB5MpFWauM= From: "ro at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/115270] New: gnat doesn't link on 32-bit Linux/sparc Date: Wed, 29 May 2024 08:20:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ro at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone cf_gcctarget Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115270 Bug ID: 115270 Summary: gnat doesn't link on 32-bit Linux/sparc Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: ro at gcc dot gnu.org CC: dkm at gcc dot gnu.org, ebotcazou at gcc dot gnu.org Target Milestone: --- Target: sparc-unknown-linux-gnu When trying to build trunk on 32-bit Linux/sparc for comparison with 32-bit Solaris/SPARC, the build failed because gnat didn't link: /vol/gcc/bin/sparc/gld-2.42: ../rts/s-atopri.o: in function `system__atomic_primitives__lock_free_try_write_64': /var/gcc/regression/master/6.8.9-gcc-gas-gld-32/build/gcc/ada/rts/s-atopri.= adb:67:(.text+0x250): undefined reference to `__atomic_compare_exchange_8' collect2: error: ld returned 1 exit status gnatlink: error when calling /var/gcc/regression/master/6.8.9-gcc-gas-gld-32/build/gcc/xg++ make[3]: *** [../gcc-interface/Makefile:464: common-tools] Error 4 make[3]: Leaving directory '/var/gcc/regression/master/6.8.9-gcc-gas-gld-32/build/gcc/ada/tools' make[2]: *** [Makefile:201: gnattools-native] Error 2 make[2]: Leaving directory '/var/gcc/regression/master/6.8.9-gcc-gas-gld-32/build/gnattools' This happened both when configuring with --with-cpu-32=3Dultrasparc and --with-cpu=3Dv9. In hindsight, that's obvious because __atomic_compare_exchange_8 requires -mv8plus, which AFAICS isn't enabled on 32-bit Linux/sparc and I found no way to do so. This is unlike 32-bit Solaris/SPARC, where TARGET_DEFAULT includes MASK_V8PLUS. While it's clear the Linux/sparc cannot move to the Solaris default since it still supports the V8 Leon CPUs, I wonder if it wouldn't be possible to allow for V8+ with --with-cpu=3Dv9? There are other possible hacks, like explicitly passing -mv8plus for libgnat or linking with -latomic, but those would be just that: hacks.=