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 | |
hp.com!davidm | def37e7 | 2005-05-03 09:13:17 +0000 | [diff] [blame^] | 3 | This is version 0.99 of the unwind library. This library supports |
| 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/IA-64: Fully tested and supported. |
| 7 | Linux/x86-64: Works well. |
| 8 | Linux/x86: Works well, but C library is missing some unwind-info. |
| 9 | Linux/PARISC: Works well, but C library missing unwind-info. |
| 10 | HP-UX/IA-64: Mostly works but known to have some serious limitations. |
(none)!davidm | e9892bb | 2004-04-23 01:32:43 +0000 | [diff] [blame] | 11 | |
(none)!davidm | e9892bb | 2004-04-23 01:32:43 +0000 | [diff] [blame] | 12 | |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 13 | * General Build Instructions |
| 14 | |
| 15 | In general, this library can be built and installed with the following |
| 16 | commands: |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 17 | |
mostang.com!davidm | 354f1c7 | 2002-02-23 20:27:03 +0000 | [diff] [blame] | 18 | $ ./configure |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 19 | $ make |
| 20 | $ make install prefix=PREFIX |
| 21 | |
mostang.com!davidm | 354f1c7 | 2002-02-23 20:27:03 +0000 | [diff] [blame] | 22 | where PREFIX is the installation prefix. By default, a prefix of |
| 23 | /usr/local is used, such that libunwind.a is installed in |
| 24 | /usr/local/lib and unwind.h is installed in /usr/local/include. For |
| 25 | 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] | 26 | |
hp.com!davidm | 3f9c0bc | 2003-09-24 21:51:53 +0000 | [diff] [blame] | 27 | |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 28 | * Building with Intel compiler |
| 29 | |
hp.com!davidm | 75b6719 | 2004-10-15 13:37:27 +0000 | [diff] [blame] | 30 | ** Version 8 and later |
| 31 | |
| 32 | Starting with version 8, the preferred name for the IA-64 Intel |
| 33 | compiler is "icc" (same name as on x86). Thus, the configure-line |
| 34 | should look like this: |
| 35 | |
| 36 | $ ./configure CC=icc CFLAGS="-g -O3 -ip" CXX=icc CCAS=gcc CCASFLAGS=-g \ |
| 37 | LDFLAGS="-L$PWD/src/.libs" |
| 38 | |
| 39 | ** Version 7 |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 40 | |
| 41 | To build libunwind with the Intel Electron compiler (ECC), it is |
| 42 | recommended to run configure like this: |
| 43 | |
(none)!davidm | e9892bb | 2004-04-23 01:32:43 +0000 | [diff] [blame] | 44 | $ ./configure CC=ecc CXX=ecc CCAS=gcc CCASFLAGS=-g \ |
| 45 | LDFLAGS="-L$PWD/src/.libs" |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 46 | |
| 47 | The reason for this is that ECC uses the Intel assembler, which |
| 48 | doesn't grok some of the IA-64 assembly code in the "tests" directory. |
| 49 | |
| 50 | For an ECC-built version of libunwind to work properly, you also need |
| 51 | to ensure that /usr/include/asm/fpu.h contains a "long double" member |
| 52 | called "__dummy" in the declaration of "struct ia64_fpreg". Without |
| 53 | that member, variables of type unw_context_t won't be aligned |
| 54 | properly. |
| 55 | |
hp.com!davidm | def37e7 | 2005-05-03 09:13:17 +0000 | [diff] [blame^] | 56 | |
mostang.com!davidm | 8d057cb | 2003-04-03 07:59:15 +0000 | [diff] [blame] | 57 | * Building on HP-UX |
| 58 | |
| 59 | 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] | 60 | |
| 61 | libunwind should be configured and installed on HP-UX like this: |
| 62 | |
| 63 | $ ./configure CFLAGS="-g -O2 -mlp64" CXXFLAGS="-g -O2 -mlp64" |
| 64 | |
| 65 | Caveat: Unwinding of 32-bit (ILP32) binaries is not supported |
| 66 | at the moment. |
| 67 | |
| 68 | ** Workaround for older versions of GCC |
| 69 | |
| 70 | GCC v3.0 and GCC v3.2 ship with a bad version of sys/types.h. The |
| 71 | workaround is to issue the following commands before running |
| 72 | "configure": |
mostang.com!davidm | 8d057cb | 2003-04-03 07:59:15 +0000 | [diff] [blame] | 73 | |
| 74 | $ mkdir $top_dir/include/sys |
| 75 | $ cp /usr/include/sys/types.h $top_dir/include/sys |
| 76 | |
mostang.com!davidm | f2b4060 | 2004-05-04 22:24:50 +0000 | [diff] [blame] | 77 | GCC v3.3.2 or later have been fixed and do not require this |
| 78 | workaround. |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 79 | |
hp.com!davidm | def37e7 | 2005-05-03 09:13:17 +0000 | [diff] [blame^] | 80 | |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 81 | * Regression Testing |
| 82 | |
| 83 | After building the library, you can run a set of regression tests with: |
| 84 | |
| 85 | $ make check |
| 86 | |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 87 | ** Expected results on IA-64 Linux |
| 88 | |
hp.com!davidm | b8e952c | 2003-11-19 23:15:58 +0000 | [diff] [blame] | 89 | 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] | 90 | 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] | 91 | |
hp.com!davidm | b8e952c | 2003-11-19 23:15:58 +0000 | [diff] [blame] | 92 | Gtest-init (should pass starting with glibc-2.3.x/gcc-3.4) |
| 93 | Ltest-init (should pass starting with glibc-2.3.x/gcc-3.4) |
| 94 | test-ptrace (should pass starting with glibc-2.3.x/gcc-3.4) |
| 95 | run-ia64-test-dyn1 (should pass starting with glibc-2.3.x) |
| 96 | |
| 97 | This does not mean that libunwind cannot be used with older compilers |
| 98 | or C libraries, it just means that for certain corner cases, unwinding |
| 99 | will fail. Since they're corner cases, it is not likely for |
| 100 | applications to trigger them. |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 101 | |
hp.com!davidm | 75b6719 | 2004-10-15 13:37:27 +0000 | [diff] [blame] | 102 | Note: If you get lots of errors in Gia64-test-nat and Lia64-test-nat, it's |
| 103 | almost certainly a sign of an old assembler. The GNU assembler used |
| 104 | to encode previous-stack-pointer-relative offsets incorrectly. |
| 105 | This bug was fixed on 21-Sep-2004 so any later assembler will be |
| 106 | fine. |
| 107 | |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 108 | ** Expected results on x86 Linux |
| 109 | |
| 110 | The following tests are expected to fail on x86 Linux: |
| 111 | |
hp.com!davidm | def37e7 | 2005-05-03 09:13:17 +0000 | [diff] [blame^] | 112 | Gtest-bt (see http://sources.redhat.com/bugzilla/show_bug.cgi?id=595) |
| 113 | Ltest-bt (likewise) |
| 114 | Gtest-resume-sig (likewise) |
| 115 | Ltest-resume-sig (likewise) |
| 116 | Gtest-dyn1 (no dynamic unwind info support yet) |
| 117 | Ltest-dyn1 (no dynamic unwind info support yet) |
| 118 | test-setjmp (longjmp() not implemented yet) |
| 119 | run-check-namespace (no _Ux86_getcontext yet) |
| 120 | |
| 121 | In addition, the following are failing on Debian (Sarge): |
| 122 | |
| 123 | Gtest-init (lack of unwind info for __libc_start_main, |
| 124 | libc ought to be compiled without |
| 125 | -fno-frame-pointer or with -fexceptions) |
| 126 | Ltest-init (likewise) |
| 127 | test-ptrace (likewise?) |
| 128 | |
| 129 | ** Expected results on x86-64 Linux |
| 130 | |
| 131 | The following tests are expected to fail on x86-64 Linux: |
| 132 | |
| 133 | Gtest-dyn1 (no dynamic unwind info support yet) |
| 134 | Ltest-dyn1 (no dynamic unwind info support yet) |
| 135 | Gtest-init (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18743) |
| 136 | Ltest-init (likewise) |
| 137 | test-async-sig (crashes due to bad unwind-info?) |
| 138 | test-setjmp (longjmp() not implemented yet) |
| 139 | run-check-namespace (no _Ux86_64_getcontext yet) |
| 140 | run-ptrace-mapper (??? investigate) |
| 141 | run-ptrace-misc (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18748 |
| 142 | and http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18749) |
| 143 | |
| 144 | ** Expected results on PARISC Linux |
| 145 | |
| 146 | Caveat: GCC v3.4 or newer is needed on PA-RISC Linux. Earlier |
| 147 | versions of the compiler failed to generate the exception-handling |
| 148 | program header (GNU_EH_FRAME) needed for unwinding. |
| 149 | |
| 150 | The following tests are expected to fail on x86-64 Linux: |
| 151 | |
| 152 | Gtest-bt (backtrace truncated at kill() due to lack of unwind-info) |
| 153 | Ltest-bt (likewise) |
| 154 | Gtest-resume-sig (Gresume.c:my_rt_sigreturn() is wrong somehow) |
| 155 | Ltest-resume-sig (likewise) |
| 156 | Gtest-init (likewise) |
| 157 | Ltest-init (likewise) |
| 158 | Gtest-dyn1 (no dynamic unwind info support yet) |
| 159 | Ltest-dyn1 (no dynamic unwind info support yet) |
| 160 | test-setjmp (longjmp() not implemented yet) |
| 161 | run-check-namespace (toolchain doesn't support HIDDEN yet) |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 162 | |
| 163 | ** Expected results on HP-UX |
| 164 | |
mostang.com!davidm | f2b4060 | 2004-05-04 22:24:50 +0000 | [diff] [blame] | 165 | "make check" is currently unsupported for HP-UX. You can try to run |
| 166 | it, but most tests will fail (and some may fail to terminate). The |
| 167 | only test programs that are known to work at this time are: |
| 168 | |
| 169 | tests/bt |
| 170 | tests/Gperf-simple |
| 171 | tests/test-proc-info |
| 172 | tests/test-static-link |
| 173 | tests/Gtest-init |
| 174 | tests/Ltest-init |
| 175 | tests/Gtest-resume-sig |
| 176 | tests/Ltest-resume-sig |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 177 | |
mostang.com!davidm | 065d455 | 2004-01-21 06:36:35 +0000 | [diff] [blame] | 178 | * Performance Testing |
| 179 | |
| 180 | This distribution includes a few simple performance tests which give |
| 181 | some idea of the basic cost of various libunwind operations. After |
| 182 | building the library, you can run these tests with the following |
| 183 | commands: |
| 184 | |
| 185 | $ cd tests |
| 186 | $ make perf |
| 187 | |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 188 | * Contacting the Developers |
| 189 | |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 190 | Please direct all questions regarding this library to: |
| 191 | |
| 192 | libunwind@linux.hpl.hp.com |
| 193 | |
| 194 | For spam protection, you'll have to subscribe to this list before |
| 195 | posting a question. You can do this by sending a mail to |
| 196 | libunwind-request@linux.hpl.hp.com with a body of: |
| 197 | |
| 198 | subscribe libunwind |
| 199 | |
| 200 | Note: the host that is running this list is behind a firewall, so |
| 201 | you'll not be able to use the Web interface to manage your |
| 202 | subscription. Send a mail containing "help" to |
| 203 | libunwind-request@linux.hpl.hp.com for information on how to manage |
| 204 | your subscription via email. |