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

John David Anglin <[email protected]>
Newsgroups gmane.linux.debian.devel.gcc
Message-ID <ce891470-dd80-459f-ad12-99eeffb38636__6398.81974072836$1786571726$gmane$org@bell.net>
On 2026-08-12 5:44 p.m., John David Anglin wrote:
> On 2026-08-12 5:36 p.m., John David Anglin wrote:
>> On 2026-08-12 5:29 p.m., Helge Deller wrote:
>>>> 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 wonder why they aren't munged by -fwhole-program.
> 
> Maybe it's only the declarations in the code that are munged.

The following routines in libgcc on hppa are provided by glibc:
dave@mx3210:~/gnu/gcc/objdir/hppa-linux-gnu/libgcc$ nm libgcc_s.so.4|grep " U "
         U abort@GLIBC_2.2
         U calloc@GLIBC_2.2
         U _dl_find_object@GLIBC_2.35
         U free@GLIBC_2.2
         U malloc@GLIBC_2.2
         U memcpy@GLIBC_2.2
         U memmove@GLIBC_2.2
         U memset@GLIBC_2.2
         U pthread_cond_broadcast@GLIBC_2.3.2
         U pthread_cond_wait@GLIBC_2.3.2
         U pthread_getspecific@GLIBC_2.34
         U pthread_key_create@GLIBC_2.34
         U pthread_mutex_lock@GLIBC_2.2
         U pthread_mutex_unlock@GLIBC_2.2
         U pthread_once@GLIBC_2.34
         U pthread_setspecific@GLIBC_2.34
         U realloc@GLIBC_2.2
         U strlen@GLIBC_2.2

If any of these are implemented in qemu, they also may need the attribute fix.

Dave
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.