Patchwork fix libbacktrace build failure on arm-linux

login
register
mail settings
Submitter Matthias Klose
Date Oct. 6, 2012, 3:09 p.m.
Message ID <5070499D.2060001@ubuntu.com>
Download mbox | patch
Permalink /patch/189713/
State New
Headers show

Comments

Matthias Klose - Oct. 6, 2012, 3:09 p.m.
current trunk fails to build on arm-linux with:

In file included from ../../../../src/libbacktrace/backtrace.c:35:0:
../libgcc/unwind.h: In function '_Unwind_decode_typeinfo_ptr':
../libgcc/unwind.h:42:45: error: unused parameter 'base' [-Werror=unused-parameter]
   _Unwind_decode_typeinfo_ptr (_Unwind_Word base, _Unwind_Word ptr)
                                             ^
../libgcc/unwind.h: In function '__gnu_unwind_24bit':
../libgcc/unwind.h:68:41: error: unused parameter 'context'
[-Werror=unused-parameter]
   __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact)
                                         ^
../libgcc/unwind.h:68:54: error: unused parameter 'data' [-Werror=unused-parameter]
   __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact)
                                                      ^
../libgcc/unwind.h:68:64: error: unused parameter 'compact'
[-Werror=unused-parameter]
   __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact)
                                                                ^
cc1: all warnings being treated as errors
make[8]: *** [backtrace.lo] Error 1

the immediate fix is to mark all arguments as unused, however I don't know if
this function should be used by libbacktrace, if it returns _URC_FAILURE
unconditionally.

	* config/arm/unwind-arm.h (__gnu_unwind_24bit): Mark parameters
	as unused.
Ian Taylor - Oct. 6, 2012, 8:46 p.m.
On Sat, Oct 6, 2012 at 8:09 AM, Matthias Klose <doko@ubuntu.com> wrote:
> current trunk fails to build on arm-linux with:
>
> In file included from ../../../../src/libbacktrace/backtrace.c:35:0:
> ../libgcc/unwind.h: In function '_Unwind_decode_typeinfo_ptr':
> ../libgcc/unwind.h:42:45: error: unused parameter 'base' [-Werror=unused-parameter]
>    _Unwind_decode_typeinfo_ptr (_Unwind_Word base, _Unwind_Word ptr)
>                                              ^
> ../libgcc/unwind.h: In function '__gnu_unwind_24bit':
> ../libgcc/unwind.h:68:41: error: unused parameter 'context'
> [-Werror=unused-parameter]
>    __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact)
>                                          ^
> ../libgcc/unwind.h:68:54: error: unused parameter 'data' [-Werror=unused-parameter]
>    __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact)
>                                                       ^
> ../libgcc/unwind.h:68:64: error: unused parameter 'compact'
> [-Werror=unused-parameter]
>    __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact)
>                                                                 ^
> cc1: all warnings being treated as errors
> make[8]: *** [backtrace.lo] Error 1
>
> the immediate fix is to mark all arguments as unused, however I don't know if
> this function should be used by libbacktrace, if it returns _URC_FAILURE
> unconditionally.

The function is not used by libbacktrace.  It's an inline function
defined in the header file, and the warning is about the inline
function definition.  That is, this is a libgcc bug, not a
libbacktrace bug, it just happens to show up when compiling
libbacktrace for ARM


>         * config/arm/unwind-arm.h (__gnu_unwind_24bit): Mark parameters
>         as unused.
>
>
> --- libgcc/config/arm/unwind-arm.h      (revision 192162)
> +++ libgcc/config/arm/unwind-arm.h      (working copy)
> @@ -64,8 +64,11 @@
>        return tmp;
>      }
>
> +#define __unused __attribute__((unused))
> +
>    static inline _Unwind_Reason_Code
> -  __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact)
> +  __gnu_unwind_24bit (_Unwind_Context * context __unused, _uw data __unused,
> +                      int compact __unused)
>      {
>        return _URC_FAILURE;
>      }

Don't #define __unused.  Just write __attribute__ ((unused)) on the
parameters.  Break the lines as needed.

This is OK with that change.

Thanks.

Ian

Patch

--- libgcc/config/arm/unwind-arm.h      (revision 192162)
+++ libgcc/config/arm/unwind-arm.h      (working copy)
@@ -64,8 +64,11 @@ 
       return tmp;
     }

+#define __unused __attribute__((unused))
+
   static inline _Unwind_Reason_Code
-  __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact)
+  __gnu_unwind_24bit (_Unwind_Context * context __unused, _uw data __unused,
+                      int compact __unused)
     {
       return _URC_FAILURE;
     }