mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 1 | -*- mode: Outline -*- |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 2 | |
Arun Sharma | 8ab8863 | 2011-08-15 21:02:26 -0700 | [diff] [blame] | 3 | This is version 1.0 of the unwind library. This library supports |
hp.com!davidm | def37e7 | 2005-05-03 09:13:17 +0000 | [diff] [blame] | 4 | several architecture/operating-system combinations: |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 5 | |
hp.com!davidm | def37e7 | 2005-05-03 09:13:17 +0000 | [diff] [blame] | 6 | Linux/x86-64: Works well. |
Arun Sharma | 8ab8863 | 2011-08-15 21:02:26 -0700 | [diff] [blame] | 7 | Linux/x86: Works well. |
| 8 | Linux/ARM: Works well. |
| 9 | Linux/IA-64: Fully tested and supported. |
hp.com!davidm | def37e7 | 2005-05-03 09:13:17 +0000 | [diff] [blame] | 10 | Linux/PARISC: Works well, but C library missing unwind-info. |
| 11 | HP-UX/IA-64: Mostly works but known to have some serious limitations. |
Yvan Roux | ac6c0a6 | 2013-05-11 09:18:23 -0600 | [diff] [blame] | 12 | Linux/AArch64: Newly added. |
David Mosberger-Tang | 955d127 | 2007-08-06 20:26:50 -0600 | [diff] [blame] | 13 | Linux/PPC64: Newly added. |
Tommi Rantala | 8d5b1ae | 2012-08-16 13:10:29 +0300 | [diff] [blame] | 14 | Linux/SuperH: Newly added. |
Konstantin Belousov | 7169958 | 2010-04-04 12:03:15 +0300 | [diff] [blame] | 15 | FreeBSD/i386: Newly added. |
| 16 | FreeBSD/x86-64: Newly added (FreeBSD architecture is known as amd64). |
(none)!davidm | e9892bb | 2004-04-23 01:32:43 +0000 | [diff] [blame] | 17 | |
(none)!davidm | e9892bb | 2004-04-23 01:32:43 +0000 | [diff] [blame] | 18 | |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 19 | * General Build Instructions |
| 20 | |
| 21 | In general, this library can be built and installed with the following |
| 22 | commands: |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 23 | |
Arun Sharma | 46ea106 | 2010-03-02 21:18:57 -0800 | [diff] [blame] | 24 | $ autoreconf -i # Needed only for building from git. Depends on libtool. |
mostang.com!davidm | 354f1c7 | 2002-02-23 20:27:03 +0000 | [diff] [blame] | 25 | $ ./configure |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 26 | $ make |
| 27 | $ make install prefix=PREFIX |
| 28 | |
mostang.com!davidm | 354f1c7 | 2002-02-23 20:27:03 +0000 | [diff] [blame] | 29 | where PREFIX is the installation prefix. By default, a prefix of |
| 30 | /usr/local is used, such that libunwind.a is installed in |
| 31 | /usr/local/lib and unwind.h is installed in /usr/local/include. For |
| 32 | testing, you may want to use a prefix of /usr/local instead. |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 33 | |
hp.com!davidm | 3f9c0bc | 2003-09-24 21:51:53 +0000 | [diff] [blame] | 34 | |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 35 | * Building with Intel compiler |
| 36 | |
hp.com!davidm | 75b6719 | 2004-10-15 13:37:27 +0000 | [diff] [blame] | 37 | ** Version 8 and later |
| 38 | |
| 39 | Starting with version 8, the preferred name for the IA-64 Intel |
| 40 | compiler is "icc" (same name as on x86). Thus, the configure-line |
| 41 | should look like this: |
| 42 | |
| 43 | $ ./configure CC=icc CFLAGS="-g -O3 -ip" CXX=icc CCAS=gcc CCASFLAGS=-g \ |
| 44 | LDFLAGS="-L$PWD/src/.libs" |
| 45 | |
hp.com!davidm | def37e7 | 2005-05-03 09:13:17 +0000 | [diff] [blame] | 46 | |
mostang.com!davidm | 8d057cb | 2003-04-03 07:59:15 +0000 | [diff] [blame] | 47 | * Building on HP-UX |
| 48 | |
| 49 | For the time being, libunwind must be built with GCC on HP-UX. |
mostang.com!davidm | f2b4060 | 2004-05-04 22:24:50 +0000 | [diff] [blame] | 50 | |
| 51 | libunwind should be configured and installed on HP-UX like this: |
| 52 | |
| 53 | $ ./configure CFLAGS="-g -O2 -mlp64" CXXFLAGS="-g -O2 -mlp64" |
| 54 | |
| 55 | Caveat: Unwinding of 32-bit (ILP32) binaries is not supported |
| 56 | at the moment. |
| 57 | |
| 58 | ** Workaround for older versions of GCC |
| 59 | |
| 60 | GCC v3.0 and GCC v3.2 ship with a bad version of sys/types.h. The |
| 61 | workaround is to issue the following commands before running |
| 62 | "configure": |
mostang.com!davidm | 8d057cb | 2003-04-03 07:59:15 +0000 | [diff] [blame] | 63 | |
| 64 | $ mkdir $top_dir/include/sys |
| 65 | $ cp /usr/include/sys/types.h $top_dir/include/sys |
| 66 | |
mostang.com!davidm | f2b4060 | 2004-05-04 22:24:50 +0000 | [diff] [blame] | 67 | GCC v3.3.2 or later have been fixed and do not require this |
| 68 | workaround. |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 69 | |
Jose Flavio Aguilar Paulino | 3e24581 | 2007-08-24 10:54:00 -0600 | [diff] [blame] | 70 | * Building for PowerPC64 / Linux |
| 71 | |
| 72 | For building for power64 you should use: |
| 73 | |
| 74 | $ ./configure CFLAGS="-g -O2 -m64" CXXFLAGS="-g -O2 -m64" |
| 75 | |
| 76 | If your power support altivec registers: |
| 77 | $ ./configure CFLAGS="-g -O2 -m64 -maltivec" CXXFLAGS="-g -O2 -m64 -maltivec" |
| 78 | |
| 79 | To check if your processor has support for vector registers (altivec): |
| 80 | cat /proc/cpuinfo | grep altivec |
| 81 | and should have something like this: |
| 82 | cpu : PPC970, altivec supported |
| 83 | |
| 84 | If libunwind seems to not work (backtracing failing), try to compile |
| 85 | it with -O0, without optimizations. There are some compiler problems |
| 86 | depending on the version of your gcc. |
| 87 | |
Konstantin Belousov | 7169958 | 2010-04-04 12:03:15 +0300 | [diff] [blame] | 88 | * Building on FreeBSD |
| 89 | |
| 90 | General building instructions apply. To build and execute several tests, |
| 91 | you need libexecinfo library available in ports as devel/libexecinfo. |
| 92 | |
Konstantin Belousov | 601919e | 2010-04-04 12:39:16 +0300 | [diff] [blame] | 93 | Development of the port was done of FreeBSD 8.0-STABLE. The library |
| 94 | was build with the system compiler that is modified version of gcc 4.2.1, |
| 95 | as well as the gcc 4.4.3. |
hp.com!davidm | def37e7 | 2005-05-03 09:13:17 +0000 | [diff] [blame] | 96 | |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 97 | * Regression Testing |
| 98 | |
| 99 | After building the library, you can run a set of regression tests with: |
| 100 | |
| 101 | $ make check |
| 102 | |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 103 | ** Expected results on IA-64 Linux |
| 104 | |
hp.com!davidm | b8e952c | 2003-11-19 23:15:58 +0000 | [diff] [blame] | 105 | Unless you have a very recent C library and compiler installed, it is |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 106 | currently expected to have the following tests fail on IA-64 Linux: |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 107 | |
hp.com!davidm | b8e952c | 2003-11-19 23:15:58 +0000 | [diff] [blame] | 108 | Gtest-init (should pass starting with glibc-2.3.x/gcc-3.4) |
| 109 | Ltest-init (should pass starting with glibc-2.3.x/gcc-3.4) |
| 110 | test-ptrace (should pass starting with glibc-2.3.x/gcc-3.4) |
| 111 | run-ia64-test-dyn1 (should pass starting with glibc-2.3.x) |
| 112 | |
| 113 | This does not mean that libunwind cannot be used with older compilers |
| 114 | or C libraries, it just means that for certain corner cases, unwinding |
| 115 | will fail. Since they're corner cases, it is not likely for |
| 116 | applications to trigger them. |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 117 | |
hp.com!davidm | 75b6719 | 2004-10-15 13:37:27 +0000 | [diff] [blame] | 118 | Note: If you get lots of errors in Gia64-test-nat and Lia64-test-nat, it's |
| 119 | almost certainly a sign of an old assembler. The GNU assembler used |
| 120 | to encode previous-stack-pointer-relative offsets incorrectly. |
| 121 | This bug was fixed on 21-Sep-2004 so any later assembler will be |
| 122 | fine. |
| 123 | |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 124 | ** Expected results on x86 Linux |
| 125 | |
| 126 | The following tests are expected to fail on x86 Linux: |
| 127 | |
David Mosberger-Tang | 955d127 | 2007-08-06 20:26:50 -0600 | [diff] [blame] | 128 | Gtest-resume-sig (fails to get SIGUSR2) |
| 129 | Ltest-resume-sig (likewise) |
hp.com!davidm | def37e7 | 2005-05-03 09:13:17 +0000 | [diff] [blame] | 130 | Gtest-dyn1 (no dynamic unwind info support yet) |
| 131 | Ltest-dyn1 (no dynamic unwind info support yet) |
| 132 | test-setjmp (longjmp() not implemented yet) |
| 133 | run-check-namespace (no _Ux86_getcontext yet) |
David Mosberger-Tang | 955d127 | 2007-08-06 20:26:50 -0600 | [diff] [blame] | 134 | test-ptrace |
hp.com!davidm | def37e7 | 2005-05-03 09:13:17 +0000 | [diff] [blame] | 135 | |
| 136 | ** Expected results on x86-64 Linux |
| 137 | |
| 138 | The following tests are expected to fail on x86-64 Linux: |
| 139 | |
| 140 | Gtest-dyn1 (no dynamic unwind info support yet) |
| 141 | Ltest-dyn1 (no dynamic unwind info support yet) |
| 142 | Gtest-init (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18743) |
| 143 | Ltest-init (likewise) |
| 144 | test-async-sig (crashes due to bad unwind-info?) |
| 145 | test-setjmp (longjmp() not implemented yet) |
| 146 | run-check-namespace (no _Ux86_64_getcontext yet) |
| 147 | run-ptrace-mapper (??? investigate) |
| 148 | run-ptrace-misc (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18748 |
| 149 | and http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18749) |
| 150 | |
| 151 | ** Expected results on PARISC Linux |
| 152 | |
| 153 | Caveat: GCC v3.4 or newer is needed on PA-RISC Linux. Earlier |
| 154 | versions of the compiler failed to generate the exception-handling |
| 155 | program header (GNU_EH_FRAME) needed for unwinding. |
| 156 | |
| 157 | The following tests are expected to fail on x86-64 Linux: |
| 158 | |
| 159 | Gtest-bt (backtrace truncated at kill() due to lack of unwind-info) |
| 160 | Ltest-bt (likewise) |
| 161 | Gtest-resume-sig (Gresume.c:my_rt_sigreturn() is wrong somehow) |
| 162 | Ltest-resume-sig (likewise) |
| 163 | Gtest-init (likewise) |
| 164 | Ltest-init (likewise) |
| 165 | Gtest-dyn1 (no dynamic unwind info support yet) |
| 166 | Ltest-dyn1 (no dynamic unwind info support yet) |
| 167 | test-setjmp (longjmp() not implemented yet) |
| 168 | run-check-namespace (toolchain doesn't support HIDDEN yet) |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 169 | |
| 170 | ** Expected results on HP-UX |
| 171 | |
mostang.com!davidm | f2b4060 | 2004-05-04 22:24:50 +0000 | [diff] [blame] | 172 | "make check" is currently unsupported for HP-UX. You can try to run |
| 173 | it, but most tests will fail (and some may fail to terminate). The |
| 174 | only test programs that are known to work at this time are: |
| 175 | |
| 176 | tests/bt |
| 177 | tests/Gperf-simple |
| 178 | tests/test-proc-info |
| 179 | tests/test-static-link |
| 180 | tests/Gtest-init |
| 181 | tests/Ltest-init |
| 182 | tests/Gtest-resume-sig |
| 183 | tests/Ltest-resume-sig |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 184 | |
Jose Flavio Aguilar Paulino | 32e2187 | 2007-08-27 09:11:37 -0600 | [diff] [blame] | 185 | ** Expected results on PPC64 Linux |
| 186 | |
| 187 | "make check" should run with no more than 10 out of 24 tests failed. |
| 188 | |
| 189 | |
mostang.com!davidm | 065d455 | 2004-01-21 06:36:35 +0000 | [diff] [blame] | 190 | * Performance Testing |
| 191 | |
| 192 | This distribution includes a few simple performance tests which give |
| 193 | some idea of the basic cost of various libunwind operations. After |
| 194 | building the library, you can run these tests with the following |
| 195 | commands: |
| 196 | |
| 197 | $ cd tests |
| 198 | $ make perf |
| 199 | |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 200 | * Contacting the Developers |
| 201 | |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 202 | Please direct all questions regarding this library to: |
| 203 | |
David Mosberger-Tang | 8724722 | 2007-10-15 17:48:26 -0600 | [diff] [blame] | 204 | libunwind-devel@nongnu.org |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 205 | |
David Mosberger-Tang | 8724722 | 2007-10-15 17:48:26 -0600 | [diff] [blame] | 206 | You can do this by sending a mail to libunwind-request@nongnu.org with |
| 207 | a body of: |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 208 | |
David Mosberger-Tang | 8724722 | 2007-10-15 17:48:26 -0600 | [diff] [blame] | 209 | subscribe libunwind-devel |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 210 | |
David Mosberger-Tang | 8724722 | 2007-10-15 17:48:26 -0600 | [diff] [blame] | 211 | or you can subscribe and manage your subscription via the |
| 212 | web-interface at: |
| 213 | |
| 214 | https://savannah.nongnu.org/mail/?group=libunwind |