Bug#1143851: hppa-linux-gnu-gcc does not honor -ffreestanding, generating referencs to memset

Helge Deller <[email protected]>
Newsgroups gmane.linux.debian.devel.gcc
Message-ID <7890640c-b231-4221-859e-661d194529e6__24057.9673949227$1786570286$gmane$org@gmx.de>
On 8/12/26 23:08, John David Anglin wrote:
> On 2026-08-12 3:45 p.m., Michael Tokarev wrote:
>>> At the moment, I would say hppa is not compatible with -fwhole-program.  The
>>> simplest fix might be to add "_attribute__((used, externally_visible))" to the memcpy
>>> declaration in your code.
>>
>> And this one helps to finish the build, and it finishes successfully.
> 
> Excellent!
>>> This what google said about this:
>>> [...]
>> I see. It's a fun stuff.
>>
>> So, for the time being, I'm including this workaround.  For the future, I
>> guess something has to be done with the build system to avoid -fwhole-program
>> (Cc'ing Helge Deller).
> 
> When I get a chance, I will look at making memcpy and millicode calls externally visible.
> 
> It would be useful to know what code results in the call to memcpy.  This seems a bug in
> gcc's -fwhole-program support.
> 
> Avoiding millicode calls is likely tricky as they are used for integer multiplication
> and division.

They are ok, even in SeaBIOS.
  
> I'm not sure why -mdisable-fpregs option is used.  This will make integer multiplication
> slower.  All machines of interest have floating-point hardware.
We are not saving the FP regs when entering the SeaBIOS firmware. That's why I want
to avoid FP regs.

Helge
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.