This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH] Fix the glibc profiling issue on arm-unknown-linux-gnueabi.
- From: Manjunath Matti <manjunath81 at gmail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Andreas Schwab <schwab at redhat dot com>, libc-ports at sourceware dot org, philb at gnu dot org, ryosei dot takagi at ap dot sony dot com, madhvesh dot s at ap dot sony dot com
- Date: Wed, 16 Feb 2011 13:00:30 +0530
- Subject: Re: [PATCH] Fix the glibc profiling issue on arm-unknown-linux-gnueabi.
- References: <AANLkTikDh1HO-k0hqT0XcNJNnMSg9aZh1OTHTDw5TD9E@mail.gmail.com> <m3oc7e8hig.fsf@redhat.com> <AANLkTinfHjWSm5pwZ2ABW+0XV=C7ww2=qg9NALfmddw8@mail.gmail.com> <m3bp3d8d47.fsf@redhat.com> <AANLkTimBwPfcRCgQsMu2P_56kVgmxrafVAeVZ5UXXTPY@mail.gmail.com> <Pine.LNX.4.64.1101251755420.29909@digraph.polyomino.org.uk> <AANLkTinmvj1ktO-9vcLxrWW5Ma5e3G+sNVN5QuYEMVRJ@mail.gmail.com> <Pine.LNX.4.64.1101281343590.19302@digraph.polyomino.org.uk> <AANLkTimQ2qgs41BAKhLK_Xpf5Ts_Kz=G=UyvY63QbMVp@mail.gmail.com> <Pine.LNX.4.64.1102082016310.23870@digraph.polyomino.org.uk> <AANLkTimzD3or3Os1K+cW9SpCmKNnbtz_PfvAuz7fDSGs@mail.gmail.com> <Pine.LNX.4.64.1102152048270.27714@digraph.polyomino.org.uk>
Hi Joseph,
> Although it looks correct, it does not apply cleanly.
>
> patching file sysdeps/arm/sysdep.h
> Hunk #2 FAILED at 93.
> Hunk #3 succeeded at 101 with fuzz 2.
> Hunk #4 FAILED at 111.
> 2 out of 4 hunks FAILED -- saving rejects to file sysdeps/arm/sysdep.h.rej
>
> It appears you may have cut-and-pasted the patch in a way that removes
> trailing whitespace and converts tabs to spaces. ?If you cannot include it
> in the body of your email in a way that avoids these problems, could you
> send it as an attachment?
Yes, I had copied the patch from the vim editor, my mistake. This may have
caused the problem. Now I have attached the patch, please let me know if
there are any issues.
Regards,
Manjunath S Matti
Sony India Software Centre.
--- a/glibc-ports-2.13/sysdeps/arm/sysdep.h 2011-01-26 02:30:16.000000000 +0530
+++ b/glibc-ports-2.13/sysdeps/arm/sysdep.h 2011-02-15 15:55:07.000000000 +0530
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include <sysdeps/generic/sysdep.h>
+#include <features.h>
#if (!defined (__ARM_ARCH_2__) && !defined (__ARM_ARCH_3__) \
&& !defined (__ARM_ARCH_3M__) && !defined (__ARM_ARCH_4__))
@@ -92,6 +93,16 @@
/* If compiled for profiling, call `mcount' at the start of each function. */
#ifdef PROF
+/* Call __gnu_mcount_nc if GCC > 4.4 and abi = EABI */
+#if __GNUC_PREREQ(4,4) && defined(__ARM_EABI__)
+#define CALL_MCOUNT \
+ str lr,[sp, #-4]!; \
+ cfi_adjust_cfa_offset (4); \
+ cfi_rel_offset (lr, 0); \
+ bl PLTJMP(mcount); \
+ cfi_adjust_cfa_offset (-4); \
+ cfi_restore (lr)
+#else /* else call _mcount */
#define CALL_MCOUNT \
str lr,[sp, #-4]!; \
cfi_adjust_cfa_offset (4); \
@@ -100,6 +111,7 @@
ldr lr, [sp], #4; \
cfi_adjust_cfa_offset (-4); \
cfi_restore (lr)
+#endif
#else
#define CALL_MCOUNT /* Do nothing. */
#endif
@@ -109,8 +121,12 @@
on this system, the asm identifier `syscall_error' intrudes on the
C name space. Make sure we use an innocuous name. */
#define syscall_error __syscall_error
+#if __GNUC_PREREQ(4,4) && defined(__ARM_EABI__)
+#define mcount __gnu_mcount_nc
+#else
#define mcount _mcount
#endif
+#endif
#if defined(__ARM_EABI__)
/* Tag_ABI_align8_preserved: This code preserves 8-byte