This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Fix a build failure on arm-none-eabi due to _uleb128_t


Hi,

Attached is a patch to fix a build failure on arm-none-eabi due to
_uleb128_t that started occuring with

2007-01-24  Andreas Krebbel  <krebbel1@de.ibm.com>

	* unwind-dw2-fde.c (get_cie_encoding): Replaced _Unwind_Word with 
	_uleb128_t and _Unwind_SWord with _sleb128_t.
	* unwind-dw2.c (extract_cie_info, execute_stack_op, execute_cfa_program,
	uw_frame_state_for, uw_update_context_1): Likewise.
	* unwind-c.c (parse_lsda_header, PERSONALITY_FUNCTION): Likewise.
	* unwind-pe.h (read_uleb128, read_sleb128,
	read_encoded_value_with_base): Likewise.
	* unwind-generic.h: Define _sleb128_t and _uleb128_t types.

Note that arm-none-eabi and some of its friends use unwind-arm.h
instead of unwind-generic.h.  The problem is that the above patch
_uleb128_t is defined in unwind-generic.h but not in unwind-arm.h,
causing build errors while compiling files that use the new type.

The patch fixes the problem by defining the two missing types.

Tested by building gcc.  OK to apply?

Kazu Hirata

2007-01-31  Kazu Hirata  <kazu@codesourcery.com>

	* gcc/config/arm/unwind-arm.h (_sleb128_t, _uleb128_t): New.

Index: gcc/config/arm/unwind-arm.h
===================================================================
--- gcc/config/arm/unwind-arm.h	(revision 121370)
+++ gcc/config/arm/unwind-arm.h	(working copy)
@@ -1,5 +1,5 @@
 /* Header file for the ARM EABI unwinder
-   Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2006, 2007  Free Software Foundation, Inc.
    Contributed by Paul Brook
 
    This file is free software; you can redistribute it and/or modify it
@@ -264,6 +264,13 @@ extern "C" {
 #define _Unwind_SetIP(context, val) \
   _Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1))
 
+/* leb128 type numbers have a potentially unlimited size.
+   The target of the following definitions of _sleb128_t and _uleb128_t
+   is to have efficient data types large enough to hold the leb128 type
+   numbers used in the unwind code.  */
+typedef long _sleb128_t;
+typedef unsigned long _uleb128_t;
+
 #ifdef __cplusplus
 }   /* extern "C" */
 #endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]