From 6f2da98c8c7c54e38ed8ba02a86b997d2046289c Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 6 Mar 2003 14:16:36 +0000 Subject: Make profiling on arm work --- libc/sysdeps/linux/arm/Makefile | 11 ++++++++++- libc/sysdeps/linux/arm/crt0.S | 6 +++++- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'libc') diff --git a/libc/sysdeps/linux/arm/Makefile b/libc/sysdeps/linux/arm/Makefile index efb9139e9..02a0cedc1 100644 --- a/libc/sysdeps/linux/arm/Makefile +++ b/libc/sysdeps/linux/arm/Makefile @@ -21,7 +21,8 @@ include $(TOPDIR)Rules.mak ASFLAGS=$(CFLAGS) CRT0_SRC = crt0.S -CRT0_OBJ = crt0.o crt1.o +CRT0_OBJ = crt0.o crt1.o gcrt1.o +CRT0_DEPS=gmon-start.S SSRC=__longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \ bsd-_setjmp.S sigrestorer.S @@ -53,8 +54,16 @@ $(COBJS): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o +ifeq ($(strip $(UCLIBC_PROFILING)),y) +SAFECFLAGS := $(subst -g,,$(CFLAGS)) +gmon-start.S: ../common/gmon-start.c + $(CC) $(SAFECFLAGS) -c $< -S -o $*.S +gcrt1.o: $(CRT0_DEPS) +endif + headers: + clean: rm -f *.[oa] *~ core rm -f bits/sysnum.h diff --git a/libc/sysdeps/linux/arm/crt0.S b/libc/sysdeps/linux/arm/crt0.S index 03a80eaa1..cbf81504b 100644 --- a/libc/sysdeps/linux/arm/crt0.S +++ b/libc/sysdeps/linux/arm/crt0.S @@ -92,7 +92,7 @@ _start: ldr r2,[sp, #8] #endif -#if defined L_crt1 && defined __UCLIBC_CTOR_DTOR__ +#if (defined L_crt1 || defined L_gcrt1 ) && defined __UCLIBC_CTOR_DTOR__ /* Store the address of _init in r3 as an argument to main() */ ldr r3, =_init @@ -123,3 +123,7 @@ _start: .long 2,0,0 3: .align 4 +#if defined L_gcrt1 && defined __UCLIBC_PROFILING__ +# include "./gmon-start.S" +#endif + -- cgit v1.2.3