Re: Libgloss build issue with GCC16 for arc target

Yuriy Kolerov <[email protected]> Sun, 24 May 2026 16:56:33 +0000
Newsgroups gmane.comp.lib.newlib
Message-ID <CY8PR12MB7516FDEDD47DB9B55A221E0AA80D2@CY8PR12MB7516.namprd12.prod.outlook.com>
--_000_CY8PR12MB7516FDEDD47DB9B55A221E0AA80D2CY8PR12MB7516namp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi Nik,

Please create a GitHub issue for this bug in this repository for Synopsys t=
ools for ARC Classic:

https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain

I will take care of it. Most likely it's an issue with GCC or Binutils.

Regards,
Yuriy Kolerov

________________________________
From: Nik Spaun <[email protected]>
Sent: Monday, May 4, 2026 21:58
To: [email protected] <[email protected]>
Subject: Libgloss build issue with GCC16 for arc target

Hello,

The crosstool-ng project is adding GCC16 support and has encountered an iss=
ue with the newlib build for the arc target (arc-multilib-elf32).
The problem is the generated assembly instructions:
GCC 16 can compile the hostlink buffer copy in _hl_pack_ptr into an ARC unc=
ached byte store with a register-indexed address:

    stb.di r2,[r13,r1]

binutils rejects that instruction for ARC EM/HS targets, breaking the
arc-multilib-elf32 build while compiling libgloss/arc/hl/hl_api.c.

The attached patch fixes the issue, but I'm not sure if it's the best solut=
ion.

The failing crosstool-ng CI job is here https://github.com/crosstool-ng/cro=
sstool-ng/actions/runs/25193796890/job/74152179593?pr=3D2502<https://urldef=
ense.com/v3/__https://github.com/crosstool-ng/crosstool-ng/actions/runs/251=
93796890/job/74152179593?pr=3D2502__;!!A4F2R9G_pg!YMRMPmPzCSvAsZ3JtgNghDga_=
KqnIr3-zruGc9NC2Xq0ecGLsNEIgZcJPXRWmAzuxhadx5RKI93JvK9KxHI7iLokR-V3$>

WBR,
Nik

--_000_CY8PR12MB7516FDEDD47DB9B55A221E0AA80D2CY8PR12MB7516namp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
Hi Nik,</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
Please create a GitHub issue for this bug in this repository for Synopsys t=
ools for ARC Classic:</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
<a href=3D"https://github.com/foss-for-synopsys-dwc-arc-processors/toolchai=
n">https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain</a></d=
iv>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
I will take care of it. Most likely it's an issue with GCC or Binutils.</di=
v>
<div id=3D"Signature" class=3D"elementToProof">
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
Regards,</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
Yuriy Kolerov</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; c=
olor: rgb(0, 0, 0);">
&nbsp;</div>
</div>
<div id=3D"appendonsend"></div>
<hr style=3D"display:inline-block;width:98%" tabindex=3D"-1">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st=
yle=3D"font-size:11pt" color=3D"#000000"><b>From:</b> Nik Spaun &lt;spaun20=
[email protected]&gt;<br>
<b>Sent:</b> Monday, May 4, 2026 21:58<br>
<b>To:</b> [email protected] &lt;[email protected]&gt;<br>
<b>Subject:</b> Libgloss build issue with GCC16 for arc target</font>
<div>&nbsp;</div>
</div>
<style type=3D"text/css" style=3D"display:none">
<!--
p
	{margin-top:0;
	margin-bottom:0}
-->
</style>
<div dir=3D"ltr">
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
Hello,&nbsp;</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
The crosstool-ng project is adding GCC16 support and has encountered&nbsp;a=
n issue with the newlib build for the arc target (arc-multilib-elf32).</div=
>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
The problem is the generated assembly instructions:</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
GCC 16 can compile the hostlink buffer copy in _hl_pack_ptr into an ARC unc=
ached byte store with a register-indexed address:</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
&nbsp; &nbsp; stb.di r2,[r13,r1]</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
binutils rejects that instruction for ARC EM/HS targets, breaking the</div>
<div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali=
bri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
arc-multilib-elf32 build while compiling libgloss/arc/hl/hl_api.c.</div>
<div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali=
bri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
The attached patch fixes the issue, but I'm not sure if it's&nbsp;the best =
solution.</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
The failing crosstool-ng CI job is here <a href=3D"https://urldefense.com/v=
3/__https://github.com/crosstool-ng/crosstool-ng/actions/runs/25193796890/j=
ob/74152179593?pr=3D2502__;!!A4F2R9G_pg!YMRMPmPzCSvAsZ3JtgNghDga_KqnIr3-zru=
Gc9NC2Xq0ecGLsNEIgZcJPXRWmAzuxhadx5RKI93JvK9KxHI7iLokR-V3$">
https://github.com/crosstool-ng/crosstool-ng/actions/runs/25193796890/job/7=
4152179593?pr=3D2502</a></div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
<br>
</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
WBR,</div>
<div class=3D"x_elementToProof" style=3D"font-family:Aptos,Aptos_EmbeddedFo=
nt,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:=
rgb(0,0,0)">
Nik</div>
</div>
</body>
</html>

--_000_CY8PR12MB7516FDEDD47DB9B55A221E0AA80D2CY8PR12MB7516namp_--