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