All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] ftrace/scripts: Work around for addition of metag magic but not relocations
@ 2016-07-08 19:18 Laura Abbott
  2016-07-08 21:32 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Laura Abbott @ 2016-07-08 19:18 UTC (permalink / raw)
  To: Steven Rostedt (Red Hat); +Cc: Laura Abbott, linux-kernel

glibc recently did a sync up (94e73c95d9b5 "elf.h: Sync with the gabi
webpage") that added a #define for EM_METAG but did not add relocations

This triggers build errors:

scripts/recordmcount.c: In function 'do_file':
scripts/recordmcount.c:466:28: error: 'R_METAG_ADDR32' undeclared (first use in this function)
  case EM_METAG:  reltype = R_METAG_ADDR32;
                            ^~~~~~~~~~~~~~
scripts/recordmcount.c:466:28: note: each undeclared identifier is reported only once for each function it appears in
scripts/recordmcount.c:468:20: error: 'R_METAG_NONE' undeclared (first use in this function)
     rel_type_nop = R_METAG_NONE;
                    ^~~~~~~~~~~~

Work around this change with some more #ifdefery for the relocations.

Signed-off-by: Laura Abbott <labbott@redhat.com>
---
I hit this while testing with a newer glibc. I'm not sure what the policy is
about glibc, so this might just serve as an FYI for anyone else who
is working on the bleeding edge.

Fedora bug is at https://bugzilla.redhat.com/show_bug.cgi?id=1354034 for the
curious.
---
 scripts/recordmcount.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index e1675927..42396a7 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -33,10 +33,17 @@
 #include <string.h>
 #include <unistd.h>
 
+/*
+ * glibc synced up and added the metag number but didn't add the relocations.
+ * Work around this in a crude manner for now.
+ */
 #ifndef EM_METAG
-/* Remove this when these make it to the standard system elf.h. */
 #define EM_METAG      174
+#endif
+#ifndef R_METAG_ADDR32
 #define R_METAG_ADDR32                   2
+#endif
+#ifndef R_METAG_NONE
 #define R_METAG_NONE                     3
 #endif
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC][PATCH] ftrace/scripts: Work around for addition of metag magic but not relocations
  2016-07-08 19:18 [RFC][PATCH] ftrace/scripts: Work around for addition of metag magic but not relocations Laura Abbott
@ 2016-07-08 21:32 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2016-07-08 21:32 UTC (permalink / raw)
  To: Laura Abbott; +Cc: linux-kernel

On Fri,  8 Jul 2016 12:18:50 -0700
Laura Abbott <labbott@redhat.com> wrote:

> glibc recently did a sync up (94e73c95d9b5 "elf.h: Sync with the gabi
> webpage") that added a #define for EM_METAG but did not add relocations
> 
> This triggers build errors:
> 
> scripts/recordmcount.c: In function 'do_file':
> scripts/recordmcount.c:466:28: error: 'R_METAG_ADDR32' undeclared (first use in this function)
>   case EM_METAG:  reltype = R_METAG_ADDR32;
>                             ^~~~~~~~~~~~~~
> scripts/recordmcount.c:466:28: note: each undeclared identifier is reported only once for each function it appears in
> scripts/recordmcount.c:468:20: error: 'R_METAG_NONE' undeclared (first use in this function)
>      rel_type_nop = R_METAG_NONE;
>                     ^~~~~~~~~~~~
> 
> Work around this change with some more #ifdefery for the relocations.

Looks fine to me. I'll pull it in, and this probably should go stable
too.

-- Steve

> 
> Signed-off-by: Laura Abbott <labbott@redhat.com>
> ---
> I hit this while testing with a newer glibc. I'm not sure what the policy is
> about glibc, so this might just serve as an FYI for anyone else who
> is working on the bleeding edge.
> 
> Fedora bug is at https://bugzilla.redhat.com/show_bug.cgi?id=1354034 for the
> curious.
> ---

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-08 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 19:18 [RFC][PATCH] ftrace/scripts: Work around for addition of metag magic but not relocations Laura Abbott
2016-07-08 21:32 ` Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.