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 | 758078f | 2004-04-20 16:53:44 +0000 | [diff] [blame] | 3 | This is version 0.97 of the unwind library. At the moment, only the |
| 4 | IA-64 Linux (IPF Linux) platform is fully supported. Some basic |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 5 | support for x86 and HP-UX/IPF exists also. However, the x86 support |
hp.com!davidm | 758078f | 2004-04-20 16:53:44 +0000 | [diff] [blame] | 6 | is based mostly on the frame-chain and does not reliably use unwind |
| 7 | information yet, so its utility is limited. Similarly, the HP-UX/IPF |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 8 | support is incomplete, though it is sufficient to do a basic |
| 9 | backtrace. unw_resume() is not supported, however. |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 10 | |
hp.com!davidm | 75b6719 | 2004-10-15 13:37:27 +0000 | [diff] [blame^] | 11 | * Important GCC v3.4.[012] Caveat |
(none)!davidm | e9892bb | 2004-04-23 01:32:43 +0000 | [diff] [blame] | 12 | |
hp.com!davidm | 75b6719 | 2004-10-15 13:37:27 +0000 | [diff] [blame^] | 13 | GCC v3.4.[012] break C++ ABI compatibility and because of that, |
| 14 | libunwind cannot easily be used as the unwinder. The GCC developers |
| 15 | are aware of the problem [1] and the the problem has been fixed for |
| 16 | GCC v3.4.3. |
(none)!davidm | e9892bb | 2004-04-23 01:32:43 +0000 | [diff] [blame] | 17 | |
| 18 | [1] http://gcc.gnu.org/ml/gcc/2004-04/msg00989.html |
| 19 | |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 20 | * General Build Instructions |
| 21 | |
| 22 | In general, this library can be built and installed with the following |
| 23 | commands: |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 24 | |
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 | |
| 46 | ** Version 7 |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 47 | |
| 48 | To build libunwind with the Intel Electron compiler (ECC), it is |
| 49 | recommended to run configure like this: |
| 50 | |
(none)!davidm | e9892bb | 2004-04-23 01:32:43 +0000 | [diff] [blame] | 51 | $ ./configure CC=ecc CXX=ecc CCAS=gcc CCASFLAGS=-g \ |
| 52 | LDFLAGS="-L$PWD/src/.libs" |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 53 | |
| 54 | The reason for this is that ECC uses the Intel assembler, which |
| 55 | doesn't grok some of the IA-64 assembly code in the "tests" directory. |
| 56 | |
| 57 | For an ECC-built version of libunwind to work properly, you also need |
| 58 | to ensure that /usr/include/asm/fpu.h contains a "long double" member |
| 59 | called "__dummy" in the declaration of "struct ia64_fpreg". Without |
| 60 | that member, variables of type unw_context_t won't be aligned |
| 61 | properly. |
| 62 | |
mostang.com!davidm | 8d057cb | 2003-04-03 07:59:15 +0000 | [diff] [blame] | 63 | * Building on HP-UX |
| 64 | |
| 65 | 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] | 66 | |
| 67 | libunwind should be configured and installed on HP-UX like this: |
| 68 | |
| 69 | $ ./configure CFLAGS="-g -O2 -mlp64" CXXFLAGS="-g -O2 -mlp64" |
| 70 | |
| 71 | Caveat: Unwinding of 32-bit (ILP32) binaries is not supported |
| 72 | at the moment. |
| 73 | |
| 74 | ** Workaround for older versions of GCC |
| 75 | |
| 76 | GCC v3.0 and GCC v3.2 ship with a bad version of sys/types.h. The |
| 77 | workaround is to issue the following commands before running |
| 78 | "configure": |
mostang.com!davidm | 8d057cb | 2003-04-03 07:59:15 +0000 | [diff] [blame] | 79 | |
| 80 | $ mkdir $top_dir/include/sys |
| 81 | $ cp /usr/include/sys/types.h $top_dir/include/sys |
| 82 | |
mostang.com!davidm | f2b4060 | 2004-05-04 22:24:50 +0000 | [diff] [blame] | 83 | GCC v3.3.2 or later have been fixed and do not require this |
| 84 | workaround. |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 85 | |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 86 | * Regression Testing |
| 87 | |
| 88 | After building the library, you can run a set of regression tests with: |
| 89 | |
| 90 | $ make check |
| 91 | |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 92 | ** Expected results on IA-64 Linux |
| 93 | |
hp.com!davidm | b8e952c | 2003-11-19 23:15:58 +0000 | [diff] [blame] | 94 | 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] | 95 | 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] | 96 | |
hp.com!davidm | b8e952c | 2003-11-19 23:15:58 +0000 | [diff] [blame] | 97 | Gtest-init (should pass starting with glibc-2.3.x/gcc-3.4) |
| 98 | Ltest-init (should pass starting with glibc-2.3.x/gcc-3.4) |
| 99 | test-ptrace (should pass starting with glibc-2.3.x/gcc-3.4) |
| 100 | run-ia64-test-dyn1 (should pass starting with glibc-2.3.x) |
| 101 | |
| 102 | This does not mean that libunwind cannot be used with older compilers |
| 103 | or C libraries, it just means that for certain corner cases, unwinding |
| 104 | will fail. Since they're corner cases, it is not likely for |
| 105 | applications to trigger them. |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 106 | |
hp.com!davidm | 75b6719 | 2004-10-15 13:37:27 +0000 | [diff] [blame^] | 107 | Note: If you get lots of errors in Gia64-test-nat and Lia64-test-nat, it's |
| 108 | almost certainly a sign of an old assembler. The GNU assembler used |
| 109 | to encode previous-stack-pointer-relative offsets incorrectly. |
| 110 | This bug was fixed on 21-Sep-2004 so any later assembler will be |
| 111 | fine. |
| 112 | |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 113 | ** Expected results on x86 Linux |
| 114 | |
| 115 | The following tests are expected to fail on x86 Linux: |
| 116 | |
| 117 | test-proc-info (x86 unwinder doesn't use unwind-info yet) |
| 118 | Gtest-exc (unw_resume() not implmented yet) |
| 119 | Ltest-exc (unw_resume() not implmented yet) |
| 120 | test-setjmp (unw_resume() not implmented yet) |
| 121 | |
| 122 | ** Expected results on HP-UX |
| 123 | |
mostang.com!davidm | f2b4060 | 2004-05-04 22:24:50 +0000 | [diff] [blame] | 124 | "make check" is currently unsupported for HP-UX. You can try to run |
| 125 | it, but most tests will fail (and some may fail to terminate). The |
| 126 | only test programs that are known to work at this time are: |
| 127 | |
| 128 | tests/bt |
| 129 | tests/Gperf-simple |
| 130 | tests/test-proc-info |
| 131 | tests/test-static-link |
| 132 | tests/Gtest-init |
| 133 | tests/Ltest-init |
| 134 | tests/Gtest-resume-sig |
| 135 | tests/Ltest-resume-sig |
hp.com!davidm | ef00f95 | 2003-11-27 07:17:47 +0000 | [diff] [blame] | 136 | |
mostang.com!davidm | 065d455 | 2004-01-21 06:36:35 +0000 | [diff] [blame] | 137 | * Performance Testing |
| 138 | |
| 139 | This distribution includes a few simple performance tests which give |
| 140 | some idea of the basic cost of various libunwind operations. After |
| 141 | building the library, you can run these tests with the following |
| 142 | commands: |
| 143 | |
| 144 | $ cd tests |
| 145 | $ make perf |
| 146 | |
mostang.com!davidm | 594e7eb | 2003-03-28 07:43:22 +0000 | [diff] [blame] | 147 | * Contacting the Developers |
| 148 | |
mostang.com!davidm | 7fbfe0a | 2002-02-15 23:22:05 +0000 | [diff] [blame] | 149 | Please direct all questions regarding this library to: |
| 150 | |
| 151 | libunwind@linux.hpl.hp.com |
| 152 | |
| 153 | For spam protection, you'll have to subscribe to this list before |
| 154 | posting a question. You can do this by sending a mail to |
| 155 | libunwind-request@linux.hpl.hp.com with a body of: |
| 156 | |
| 157 | subscribe libunwind |
| 158 | |
| 159 | Note: the host that is running this list is behind a firewall, so |
| 160 | you'll not be able to use the Web interface to manage your |
| 161 | subscription. Send a mail containing "help" to |
| 162 | libunwind-request@linux.hpl.hp.com for information on how to manage |
| 163 | your subscription via email. |