~ubuntu-branches/ubuntu/raring/libunwind/raring-proposed

« back to all changes in this revision

Viewing changes to .pc/20120704_fix_arm_ftbfs.patch/src/arm/Gglobal.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-04 12:00:55 UTC
  • Revision ID: package-import@ubuntu.com-20120704120055-t1j4xcr04b1w8tkm
Tags: 1.0.1-1ubuntu2
* Enable binary packages for armel and armhf:
  - d/patches/20120704_fix_arm_ftbfs.patch: Cherry picked patch from upstream
    VCS to resolve FTBFS on arm based architectures.
  - d/control: Drop BD on libatomic-ops-dev; its not required as libunwind
    will use compiler provided functions, upstream never actually link
    against it and it confuses the arm build.
  - d/control: Target armhf architecture.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* libunwind - a platform-independent unwind library
 
2
   Copyright (C) 2008 CodeSourcery
 
3
 
 
4
This file is part of libunwind.
 
5
 
 
6
Permission is hereby granted, free of charge, to any person obtaining
 
7
a copy of this software and associated documentation files (the
 
8
"Software"), to deal in the Software without restriction, including
 
9
without limitation the rights to use, copy, modify, merge, publish,
 
10
distribute, sublicense, and/or sell copies of the Software, and to
 
11
permit persons to whom the Software is furnished to do so, subject to
 
12
the following conditions:
 
13
 
 
14
The above copyright notice and this permission notice shall be
 
15
included in all copies or substantial portions of the Software.
 
16
 
 
17
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
18
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
19
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
20
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 
21
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 
22
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 
23
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
 
24
 
 
25
#include <ucontext.h>
 
26
#include "unwind_i.h"
 
27
#include "dwarf_i.h"
 
28
 
 
29
HIDDEN pthread_mutex_t arm_lock = PTHREAD_MUTEX_INITIALIZER;
 
30
HIDDEN int tdep_needs_initialization = 1;
 
31
 
 
32
/* Unwinding methods to use. See UNW_METHOD_ enums */
 
33
HIDDEN int unwi_unwind_method = UNW_ARM_METHOD_ALL;
 
34
 
 
35
/* FIXME: I'm pretty sure we don't need this at all for ARM, but "generic"
 
36
   code (include/dwarf_i.h) seems to expect it to be here at present.  */
 
37
 
 
38
HIDDEN uint8_t dwarf_to_unw_regnum_map[16] =
 
39
  {
 
40
    R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15
 
41
  };
 
42
 
 
43
HIDDEN void
 
44
tdep_init (void)
 
45
{
 
46
  intrmask_t saved_mask;
 
47
 
 
48
  sigfillset (&unwi_full_mask);
 
49
 
 
50
  lock_acquire (&arm_lock, saved_mask);
 
51
  {
 
52
    if (!tdep_needs_initialization)
 
53
      /* another thread else beat us to it... */
 
54
      goto out;
 
55
 
 
56
    /* read ARM unwind method setting */
 
57
    const char* str = getenv ("UNW_ARM_UNWIND_METHOD");
 
58
    if (str)
 
59
      {
 
60
        unwi_unwind_method = atoi (str);
 
61
      }
 
62
 
 
63
    mi_init ();
 
64
 
 
65
    dwarf_init ();
 
66
 
 
67
#ifndef UNW_REMOTE_ONLY
 
68
    arm_local_addr_space_init ();
 
69
#endif
 
70
    tdep_needs_initialization = 0;      /* signal that we're initialized... */
 
71
  }
 
72
 out:
 
73
  lock_release (&arm_lock, saved_mask);
 
74
}