This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[csl-arm] Allow building arm unwind library without target headers.
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 19 Nov 2004 19:51:33 +0000
- Subject: [csl-arm] Allow building arm unwind library without target headers.
- Organization: CodeSourcery
The attached patch adds a definition for abort() to unwind-arm.h. This allows
building the unwind library without target libc headers. I've also removed a
use of NULL from unwind-arm.c for the same reason.
Tested with cross to arm-none-eabi.
Applied to csl-arm-branch.
Paul
2004-11-19 Paul Brook <paul@codesourcery.com>
* unwind-arm.h: Don't include stdio.h. Add prototype for abort().
* config/arm/unwind-arm.c: Don't include stdio.h. Don't use NULL.
Index: gcc/unwind-arm.h
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/Attic/unwind-arm.h,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 unwind-arm.h
--- gcc/unwind-arm.h 22 Sep 2004 15:40:27 -0000 1.1.2.1
+++ gcc/unwind-arm.h 19 Nov 2004 19:09:25 -0000
@@ -31,13 +31,14 @@
#ifndef UNWIND_ARM_H
#define UNWIND_ARM_H
-#include <stdlib.h>
-
#define __ARM_EABI_UNWINDER__ 1
#ifdef __cplusplus
extern "C" {
#endif
+ /* We add a prototype for abort here to avoid creating a dependency on
+ target headers. */
+ extern void abort();
typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
typedef signed _Unwind_Sword __attribute__((__mode__(__word__)));
Index: gcc/config/arm/unwind-arm.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/Attic/unwind-arm.c,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 unwind-arm.c
--- gcc/config/arm/unwind-arm.c 17 Nov 2004 21:40:15 -0000 1.1.2.2
+++ gcc/config/arm/unwind-arm.c 19 Nov 2004 19:06:55 -0000
@@ -25,7 +25,6 @@
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdlib.h>
#include "unwind-arm.h"
/* Definitions for C++ runtime support routines. We make these weak
@@ -375,7 +374,7 @@ get_eit_entry (_Unwind_Control_Block *uc
eitp = (const __EIT_entry *) bsearch (&return_address, &__exidx_start,
nrec, sizeof (__EIT_entry), EIT_comparator);
- if (eitp == NULL)
+ if (!eitp)
{
UCB_PR_ADDR (ucbp) = 0;
return _URC_FAILURE;
@@ -968,7 +967,7 @@ __gnu_unwind_pr_common (_Unwind_State st
rtti = _Unwind_decode_target2 ((_uw) &data[1]);
if (!__cxa_type_match (ucbp, (type_info *) rtti,
&matched))
- matched = NULL;
+ matched = (void *)0;
}
if (matched)