public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] arm: fix cfi errors with newer binutils
@ 2012-01-02 22:45 Mike Frysinger
  2012-01-03 16:37 ` Joseph S. Myers
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2012-01-02 22:45 UTC (permalink / raw)
  To: libc-ports

When building code that uses the PSEUDO() in sysdep-cancel.h with
newer binutils, we hit many failures like this:

../sysdeps/unix/syscall-template.S: Assembler messages:
../sysdeps/unix/syscall-template.S:82: Error: CFI instruction used without previous .cfi_startproc
../sysdeps/unix/syscall-template.S:82: Error: CFI instruction used without previous .cfi_startproc
../sysdeps/unix/syscall-template.S:82: Error: CFI instruction used without previous .cfi_startproc
../sysdeps/unix/syscall-template.S:82: Error: CFI instruction used without previous .cfi_startproc
make[2]: *** [build/misc/select.o] Error 1

Change the local nocancl version to use the ENTRY/END macros rather
than open coding it so we get automatic cfi handling.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

2012-01-02  Mike Frysinger  <vapier@gentoo.org>

	* sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h (PSEUDO): Change
	.type/.globl/label to ENTRY().  Change .size to END().
---
 sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
index 9c80771..76d9677 100644
--- a/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
@@ -28,12 +28,10 @@
 # define PSEUDO(name, syscall_name, args)				\
   .section ".text";							\
     PSEUDO_PROLOGUE;							\
-  .type __##syscall_name##_nocancel,%function;				\
-  .globl __##syscall_name##_nocancel;					\
-  __##syscall_name##_nocancel:						\
+  ENTRY (__##syscall_name##_nocancel);					\
     DO_CALL (syscall_name, args);					\
     PSEUDO_RET;								\
-  .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;	\
+  END (__##syscall_name##_nocancel);					\
   ENTRY (name);								\
     SINGLE_THREAD_P;							\
     DOARGS_##args;							\
-- 
1.7.6.1

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

* Re: [PATCH] arm: fix cfi errors with newer binutils
  2012-01-02 22:45 [PATCH] arm: fix cfi errors with newer binutils Mike Frysinger
@ 2012-01-03 16:37 ` Joseph S. Myers
  2012-01-03 17:31   ` Mike Frysinger
  0 siblings, 1 reply; 6+ messages in thread
From: Joseph S. Myers @ 2012-01-03 16:37 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: libc-ports

On Mon, 2 Jan 2012, Mike Frysinger wrote:

> 2012-01-02  Mike Frysinger  <vapier@gentoo.org>
> 
> 	* sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h (PSEUDO): Change
> 	.type/.globl/label to ENTRY().  Change .size to END().

I have committed this patch and the sigrestorer.S one, but note that it is 
expected that ARM old-ABI support will be removed from GCC after 4.7 
<http://gcc.gnu.org/ml/gcc-patches/2011-12/msg00692.html>, and similarly I 
think it is time to remove that support from the glibc port as well 
(probably in multiple patches: first give an error when configuring for 
old-ABI, then remove all ARM-specific files that aren't used for EABI ARM 
GNU/Linux before simplifying the directory structure).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH] arm: fix cfi errors with newer binutils
  2012-01-03 16:37 ` Joseph S. Myers
@ 2012-01-03 17:31   ` Mike Frysinger
  2012-01-03 17:44     ` Joseph S. Myers
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2012-01-03 17:31 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-ports

[-- Attachment #1: Type: Text/Plain, Size: 900 bytes --]

On Tuesday 03 January 2012 11:37:28 Joseph S. Myers wrote:
> On Mon, 2 Jan 2012, Mike Frysinger wrote:
> > 2012-01-02  Mike Frysinger  <vapier@gentoo.org>
> > 
> > 	* sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h (PSEUDO): Change
> > 	.type/.globl/label to ENTRY().  Change .size to END().
> 
> I have committed this patch and the sigrestorer.S one, but note that it is
> expected that ARM old-ABI support will be removed from GCC after 4.7
> <http://gcc.gnu.org/ml/gcc-patches/2011-12/msg00692.html>, and similarly I
> think it is time to remove that support from the glibc port as well
> (probably in multiple patches: first give an error when configuring for
> old-ABI, then remove all ARM-specific files that aren't used for EABI ARM
> GNU/Linux before simplifying the directory structure).

so ARM cores older than armv4t are no longer supported (e.g. StrongARMs) ? :(
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] arm: fix cfi errors with newer binutils
  2012-01-03 17:31   ` Mike Frysinger
@ 2012-01-03 17:44     ` Joseph S. Myers
  2012-01-06  6:49       ` Mike Frysinger
  0 siblings, 1 reply; 6+ messages in thread
From: Joseph S. Myers @ 2012-01-03 17:44 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: libc-ports

On Tue, 3 Jan 2012, Mike Frysinger wrote:

> so ARM cores older than armv4t are no longer supported (e.g. StrongARMs) ? :(

I believe you can use ARMv4 cores with EABI via the 
--fix-v4bx-interworking linker option (building code that works on v4 and 
is interworking-safe on v4T).  (You may be able to link with plain 
--fix-v4bx, but the resulting binaries and shared libraries then wouldn't 
be interworking safe if run on a newer system, unless that newer system 
is v7.)

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH] arm: fix cfi errors with newer binutils
  2012-01-03 17:44     ` Joseph S. Myers
@ 2012-01-06  6:49       ` Mike Frysinger
  2012-01-06 11:56         ` Joseph S. Myers
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2012-01-06  6:49 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: libc-ports

[-- Attachment #1: Type: Text/Plain, Size: 666 bytes --]

On Tuesday 03 January 2012 12:44:19 Joseph S. Myers wrote:
> On Tue, 3 Jan 2012, Mike Frysinger wrote:
> > so ARM cores older than armv4t are no longer supported (e.g. StrongARMs)
> > ? :(
> 
> I believe you can use ARMv4 cores with EABI via the
> --fix-v4bx-interworking linker option (building code that works on v4 and
> is interworking-safe on v4T).  (You may be able to link with plain
> --fix-v4bx, but the resulting binaries and shared libraries then wouldn't
> be interworking safe if run on a newer system, unless that newer system
> is v7.)

nice.  i wonder if gcc should automatically utilize this when given -march 
armv4 or lower ?
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] arm: fix cfi errors with newer binutils
  2012-01-06  6:49       ` Mike Frysinger
@ 2012-01-06 11:56         ` Joseph S. Myers
  0 siblings, 0 replies; 6+ messages in thread
From: Joseph S. Myers @ 2012-01-06 11:56 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: libc-ports

On Fri, 6 Jan 2012, Mike Frysinger wrote:

> On Tuesday 03 January 2012 12:44:19 Joseph S. Myers wrote:
> > On Tue, 3 Jan 2012, Mike Frysinger wrote:
> > > so ARM cores older than armv4t are no longer supported (e.g. StrongARMs)
> > > ? :(
> > 
> > I believe you can use ARMv4 cores with EABI via the
> > --fix-v4bx-interworking linker option (building code that works on v4 and
> > is interworking-safe on v4T).  (You may be able to link with plain
> > --fix-v4bx, but the resulting binaries and shared libraries then wouldn't
> > be interworking safe if run on a newer system, unless that newer system
> > is v7.)
> 
> nice.  i wonder if gcc should automatically utilize this when given -march 
> armv4 or lower ?

It looks like the relevant assembler spec (so that the instruction is 
accepted and has the R_ARM_V4BX relocation generated that the linker needs 
to fix them up) is already there for all EABI targets (in bpabi.h and not 
overridden by individual targets), but the linker spec is enabled for 
bare-metal but not GNU/Linux (I suppose because there isn't a 
one-size-fits-all answer for which of the two linker options you might 
want to use on GNU/Linux).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

end of thread, other threads:[~2012-01-06 11:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-02 22:45 [PATCH] arm: fix cfi errors with newer binutils Mike Frysinger
2012-01-03 16:37 ` Joseph S. Myers
2012-01-03 17:31   ` Mike Frysinger
2012-01-03 17:44     ` Joseph S. Myers
2012-01-06  6:49       ` Mike Frysinger
2012-01-06 11:56         ` Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).