Re: memcpy issue with arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf

2025-04-17 Thread Richard Earnshaw (lists) via Gcc
On 17/04/2025 07:49, Wasim Khan via Gcc wrote:
> Hi,
> 
> I have a custom implementation of memcpy() function and don't want to use 
> implementation provided by libc.a.
> Things works fine with toolchain version 12.3 and my local implementation in 
> utils.c is considered.
> But when I move to toolchain version 14.2 , I am getting below error.
> 
> 
> Linking ...
> /opt/arm-gnu-toolchain-*-aarch64-none-elf/bin/aarch64-none-elf-gcc \
>     -nodefaultlibs \
>     -nostartfiles \
>     -mcpu=cortex-a55 \
>     -Wl,--gc-sections \
>     -Wl,--build-id=none \
>     -T /opt/test.lds \
>     -Wl,-Map=/opt/test.map \
>     -Wl,--no-warn-rwx-segments \
>  /opt/test.o /opt/utils.o \
>     -L /opt/arm-gnu-toolchain-*-aarch64-none-elf/aarch64-none-elf/lib \
>     -Wl,--start-group -l:libc.a -l:libgcc.a -Wl,--end-group \
>     -o /opt/test.elf
>   
> /opt/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/../lib/gcc/aarch64-none-elf/14.2.1/../../../../aarch64-none-elf/bin/ld:
>  
> /opt/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/aarch64-none-elf/lib/libc.a(libc_a-memcpy.o):
>  in function `memcpy':
> /data/jenkins/workspace/GNU-toolchain/arm-14/src/newlib-cygwin/newlib/libc/machine/aarch64/memcpy.S:60:
>  multiple definition of `memcpy'; /opt/utils.o:/opt/utils.c:247: first 
> defined here
> collect2: error: ld returned 1 exit status
> make: *** [Makefile:282: linkobj] Error 1
> 
> 
> 
> Need help on how to use custom implementation of memcpy() (but use all other 
> standard functions from libc.a).
> Also, any idea on why the issue is with 14.2 and not with earlier versions 
> (like 12.3) ?
> 
> Regards,
> 

Perhaps your code is calling memmove() as well?  The two functions are 
generally tightly integrated in the C library, especially when memmove() is 
assuming particular properties of the memcpy implementation.

For example, you can't override free without also overriding all the other 
functions that go with heap management (malloc, realloc, etc).

BTW, if you generate a linker map, it should tell you why the libc 
implementation of memcpy is being pulled in as well.

R.


Re: memcpy issue with arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf

2025-04-17 Thread Levente via Gcc
I recommend creating a different name for your own memcpy() implementation,
and use that. You may also make it configurable which implementation to use.

On Thu, Apr 17, 2025, 08:51 Wasim Khan via Gcc-help 
wrote:

> Hi,
>
> I have a custom implementation of memcpy() function and don't want to use
> implementation provided by libc.a.
> Things works fine with toolchain version 12.3 and my local implementation
> in utils.c is considered.
> But when I move to toolchain version 14.2 , I am getting below error.
>
>
> Linking ...
> /opt/arm-gnu-toolchain-*-aarch64-none-elf/bin/aarch64-none-elf-gcc \
> -nodefaultlibs \
> -nostartfiles \
> -mcpu=cortex-a55 \
> -Wl,--gc-sections \
> -Wl,--build-id=none \
> -T /opt/test.lds \
> -Wl,-Map=/opt/test.map \
> -Wl,--no-warn-rwx-segments \
>  /opt/test.o /opt/utils.o \
> -L /opt/arm-gnu-toolchain-*-aarch64-none-elf/aarch64-none-elf/lib \
> -Wl,--start-group -l:libc.a -l:libgcc.a -Wl,--end-group \
> -o /opt/test.elf
>
> /opt/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/bin/../lib/gcc/aarch64-none-elf/14.2.1/../../../../aarch64-none-elf/bin/ld:
> /opt/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/aarch64-none-elf/lib/libc.a(libc_a-memcpy.o):
> in function `memcpy':
> /data/jenkins/workspace/GNU-toolchain/arm-14/src/newlib-cygwin/newlib/libc/machine/aarch64/memcpy.S:60:
> multiple definition of `memcpy'; /opt/utils.o:/opt/utils.c:247: first
> defined here
> collect2: error: ld returned 1 exit status
> make: *** [Makefile:282: linkobj] Error 1
>
>
>
> Need help on how to use custom implementation of memcpy() (but use all
> other standard functions from libc.a).
> Also, any idea on why the issue is with 14.2 and not with earlier versions
> (like 12.3) ?
>
> Regards,
>
>


RE: GCOV issue with GCC-14.2

2025-04-17 Thread Wasim Khan via Gcc
++ gcc@gcc.gnu.org

> -Original Message-
> From: Wasim Khan
> Sent: 15 April 2025 12:41
> To: gcc-h...@gcc.gnu.org
> Subject: GCOV issue with GCC-14.2
> 
> Hi,
> 
> I am using GCOV for test coverage in a project using instructions for
> freestanding environment
> 
> Below are the flags i use.
> 
> CFLAGS +=  -fprofile-arcs -ftest-coverage -fprofile-info-section LFLAGS += 
> -lgcov
> --coverage
> 
> With these flags, thigs works fine with toolchain version 12.3 but i am facing
> below error if i upgrade to toolchain version 14.2 (AArch32 bare-metal 
> target).
> 
> /opt/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-
> none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: /opt//arm-gnu-toolchain-
> 14.2.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-
> eabi/14.2.1/thumb/v8-m.main+fp/softfp/libgcov.a(_gcov.o): in function
> `gcov_read_bytes':
> libgcov-driver.c:(.text.gcov_read_bytes+0x10): undefined reference to `fread'
> 
> 
> 
> I found that if i pass '-lgcov --coverage' before '-lc' in linking, then my 
> problem is
> fixed.
> 
> + LFLAGS += -lgcov --coverage
> LFLAGS += -lc
> -  LFLAGS += -lgcov --coverage
> 
> Need help to understand why such changes/library order is are not required for
> toolchain version 12.3 ?
> 
> 
> Regards,
> Wasim


RE: memcpy issue with arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf

2025-04-17 Thread Wasim Khan via Gcc



> -Original Message-
> From: Richard Earnshaw (lists) 
> Sent: 17 April 2025 14:57
> To: Wasim Khan ; gcc-h...@gcc.gnu.org;
> gcc@gcc.gnu.org
> Subject: Re: memcpy issue with arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-
> none-elf
> 
> [You don't often get email from richard.earns...@arm.com. Learn why this is
> important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> On 17/04/2025 07:49, Wasim Khan via Gcc wrote:
> > Hi,
> >
> > I have a custom implementation of memcpy() function and don't want to use
> implementation provided by libc.a.
> > Things works fine with toolchain version 12.3 and my local implementation in
> utils.c is considered.
> > But when I move to toolchain version 14.2 , I am getting below error.
> >
> >
> > Linking ...
> > /opt/arm-gnu-toolchain-*-aarch64-none-elf/bin/aarch64-none-elf-gcc \
> > -nodefaultlibs \
> > -nostartfiles \
> > -mcpu=cortex-a55 \
> > -Wl,--gc-sections \
> > -Wl,--build-id=none \
> > -T /opt/test.lds \
> > -Wl,-Map=/opt/test.map \
> > -Wl,--no-warn-rwx-segments \
> >  /opt/test.o /opt/utils.o \
> > -L /opt/arm-gnu-toolchain-*-aarch64-none-elf/aarch64-none-elf/lib \
> > -Wl,--start-group -l:libc.a -l:libgcc.a -Wl,--end-group \
> > -o /opt/test.elf
> >
> > /opt/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-
> elf/bin/../lib/gcc/aarch64-none-elf/14.2.1/../../../../aarch64-none-elf/bin/ld:
> /opt/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-elf/aarch64-none-
> elf/lib/libc.a(libc_a-memcpy.o): in function `memcpy':
> > /data/jenkins/workspace/GNU-toolchain/arm-14/src/newlib-
> cygwin/newlib/libc/machine/aarch64/memcpy.S:60: multiple definition of
> `memcpy'; /opt/utils.o:/opt/utils.c:247: first defined here
> > collect2: error: ld returned 1 exit status
> > make: *** [Makefile:282: linkobj] Error 1
> >
> >
> >
> > Need help on how to use custom implementation of memcpy() (but use all
> other standard functions from libc.a).
> > Also, any idea on why the issue is with 14.2 and not with earlier versions 
> > (like
> 12.3) ?
> >
> > Regards,
> >
> 
> Perhaps your code is calling memmove() as well?  The two functions are
> generally tightly integrated in the C library, especially when memmove() is
> assuming particular properties of the memcpy implementation.
> 
> For example, you can't override free without also overriding all the other
> functions that go with heap management (malloc, realloc, etc).
> 
> BTW, if you generate a linker map, it should tell you why the libc 
> implementation
> of memcpy is being pulled in as well.
> 
> R.


I am not using memove() anywhere in my code. However, defining custom memove() 
solves the problem with 14.2. Thanks!!
I wonder why it is not required with 12.3 , because as per linker map, memcpy() 
is coming from my custom implementation and memmove() is coming from libc for 
12.3.

.text.memcpy   0x2048d1d0   0x20 /opt/test.o
   0x2048d1d0memcpy
   
.text  0x2049b240   0xac 
/opt/arm-gnu-toolchain-12.3.rel1-x86_64-aarch64-none-elf/aarch64-none-elf/lib/libc.a(libc_a-memmove.o)
   0x2049b240memmove


This dependency is something introduced after 12.3 ? 
Also, is there any way to know about such dependencies of such functions? 
Because compiler does not complaints if custom definitions are ignored . 




GCC 15.0.1 Status Report (2025-04-17), branch frozen for release

2025-04-17 Thread Richard Biener via Gcc
We have branched for the GCC 15 release.  All changes on the releases/gcc-15
branch require release manager approval now.


Quality Data


Priority  #   Change from last report
---   ---
P1 -  17
P2  580-  24
P3  101-  46
P4  239+  10
P5   23-   1
---   ---
Total P1-P3 681-  87
Total   943-  78


Previous Report
===

https://gcc.gnu.org/pipermail/gcc/2025-February/245593.html


GCC 16.0.0 Status Report (2025-04-17)

2025-04-17 Thread Richard Biener via Gcc
Status
==

We have reached zero P1 regressions and branched for the GCC 15
release.  This leaves trunk which is to become GCC 16 next year
open for general development, Stage 1, again.  Please refrain
from disrupting git master too much so that last-minute fixes
for GCC 15.1 can be staged there.


Quality Data


Priority  #   Change from last report
---   ---
P11-  16
P2  587-  17
P3  102-  45
P4  239+  10
P5   23-   1
---   ---
Total P1-P3 690-  78
Total   952-  69


Previous Report
===

https://gcc.gnu.org/pipermail/gcc/2025-February/245593.html