Remove FAQ about PKCS12 macros
[openssl-web.git] / docs / faq-4-build.txt
1 Questions on Building and Testing OpenSSL
2
3 * Why does Clang sanitizer give warnings?
4
5 You need to build with -DPEDANTIC to run sanitized tests, otherwise
6 you will get optimized assembler versions of some functions.
7
8 * Why does the linker complain about undefined symbols?
9
10 Maybe the compilation was interrupted, and make doesn't notice that
11 something is missing.  Run "make clean; make".
12
13 If you used ./Configure instead of ./config, make sure that you
14 selected the right target.  File formats may differ slightly between
15 OS versions (for example sparcv8/sparcv9, or a.out/elf).
16
17 In case you get errors about the following symbols, use the config
18 option "no-asm", as described in INSTALL:
19
20 <PRE>
21     BF_cbc_encrypt, BF_decrypt, BF_encrypt, CAST_cbc_encrypt,
22     CAST_decrypt, CAST_encrypt, RC4, RC5_32_cbc_encrypt, RC5_32_decrypt,
23     RC5_32_encrypt, bn_add_words, bn_div_words, bn_mul_add_words,
24     bn_mul_comba4, bn_mul_comba8, bn_mul_words, bn_sqr_comba4,
25     bn_sqr_comba8, bn_sqr_words, bn_sub_words, des_decrypt3,
26     des_ede3_cbc_encrypt, des_encrypt, des_encrypt2, des_encrypt3,
27     des_ncbc_encrypt, md5_block_asm_host_order, sha1_block_asm_data_order
28 </PRE>
29
30 If none of these helps, you may want to try using the current snapshot.
31 If the problem persists, please submit a bug report.
32
33 * Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
34
35 On some Alpha installations running Tru64 Unix and Compaq C, the compilation
36 of crypto/sha/sha_dgst.c fails with the message 'Fatal:  Insufficient virtual
37 memory to continue compilation.'  As far as the tests have shown, this may be
38 a compiler bug.  What happens is that it eats up a lot of resident memory
39 to build something, probably a table.  The problem is clearly in the
40 optimization code, because if one eliminates optimization completely (-O0),
41 the compilation goes through (and the compiler consumes about 2MB of resident
42 memory instead of 240MB or whatever one's limit is currently).
43
44 There are three options to solve this problem:
45
46 1. set your current data segment size soft limit higher.  Experience shows
47 that about 241000 kbytes seems to be enough on an AlphaServer DS10.  You do
48 this with the command 'ulimit -Sd nnnnnn', where 'nnnnnn' is the number of
49 kbytes to set the limit to.
50
51 2. If you have a hard limit that is lower than what you need and you can't
52 get it changed, you can compile all of OpenSSL with -O0 as optimization
53 level.  This is however not a very nice thing to do for those who expect to
54 get the best result from OpenSSL.  A bit more complicated solution is the
55 following:
56
57 <PRE>
58     make DIRS=crypto SDIRS=sha "`grep '^CFLAG=' Makefile.ssl | \
59         sed -e 's/ -O[0-9] / -O0 /'`"
60     rm `ls crypto/*.o crypto/sha/*.o | grep -v 'sha_dgst\.o'`
61     make
62 </PRE>
63
64 This will only compile sha_dgst.c with -O0, the rest with the optimization
65 level chosen by the configuration process.  When the above is done, do the
66 test and installation and you're set.
67
68 3. Reconfigure the toolkit with no-sha0 option to leave out SHA0. It
69 should not be used and is not used in SSL/TLS nor any other recognized
70 protocol in either case.
71
72 * Why does the OpenSSL compilation fail with "ar: command not found"?
73
74 Getting this message is quite usual on Solaris 2, because Sun has hidden
75 away 'ar' and other development commands in directories that aren't in
76 $PATH by default.  One of those directories is '/usr/ccs/bin'.  The
77 quickest way to fix this is to do the following (it assumes you use sh
78 or any sh-compatible shell):
79
80 <PRE>
81     PATH=${PATH}:/usr/ccs/bin; export PATH
82 </PRE>
83
84 and then redo the compilation.  What you should really do is make sure
85 '/usr/ccs/bin' is permanently in your $PATH, for example through your
86 '.profile' (again, assuming you use a sh-compatible shell).
87
88 * Why does the OpenSSL compilation fail on Win32 with VC++?
89
90 Sometimes, you may get reports from VC++ command line (cl) that it
91 can't find standard include files like stdio.h and other weirdnesses.
92 One possible cause is that the environment isn't correctly set up.
93 To solve that problem for VC++ versions up to 6, one should run
94 VCVARS32.BAT which is found in the 'bin' subdirectory of the VC++
95 installation directory (somewhere under 'Program Files').  For VC++
96 version 7 (and up?), which is also called VS.NET, the file is called
97 VSVARS32.BAT instead.
98 This needs to be done prior to running NMAKE, and the changes are only
99 valid for the current DOS session.
100
101 * What is special about OpenSSL on Redhat?
102
103 Red Hat Linux (release 7.0 and later) include a preinstalled limited
104 version of OpenSSL. Red Hat has chosen to disable support for IDEA, RC5 and
105 MDC2 in this version. The same may apply to other Linux distributions.
106 Users may therefore wish to install more or all of the features left out.
107
108 To do this you MUST ensure that you do not overwrite the openssl that is in
109 /usr/bin on your Red Hat machine. Several packages depend on this file,
110 including sendmail and ssh. /usr/local/bin is a good alternative choice. The
111 libraries that come with Red Hat 7.0 onwards have different names and so are
112 not affected. (eg For Red Hat 7.2 they are /lib/libssl.so.0.9.6b and
113 /lib/libcrypto.so.0.9.6b with symlinks /lib/libssl.so.2 and
114 /lib/libcrypto.so.2 respectively).
115
116 Please note that we have been advised by Red Hat attempting to recompile the
117 openssl rpm with all the cryptography enabled will not work. All other
118 packages depend on the original Red Hat supplied openssl package. It is also
119 worth noting that due to the way Red Hat supplies its packages, updates to
120 openssl on each distribution never change the package version, only the
121 build number. For example, on Red Hat 7.1, the latest openssl package has
122 version number 0.9.6 and build number 9 even though it contains all the
123 relevant updates in packages up to and including 0.9.6b.
124
125 A possible way around this is to persuade Red Hat to produce a non-US
126 version of Red Hat Linux.
127
128 * Why does the OpenSSL compilation fail on MacOS X?
129
130 If the failure happens when trying to build the "openssl" binary, with
131 a large number of undefined symbols, it's very probable that you have
132 OpenSSL 0.9.6b delivered with the operating system (you can find out by
133 running '/usr/bin/openssl version') and that you were trying to build
134 OpenSSL 0.9.7 or newer.  The problem is that the loader ('ld') in
135 MacOS X has a misfeature that's quite difficult to go around.
136 Look in the file PROBLEMS for a more detailed explanation and for possible
137 solutions.
138
139 * Why does the OpenSSL test suite fail on MacOS X?
140
141 If the failure happens when running 'make test' and the RC4 test fails,
142 it's very probable that you have OpenSSL 0.9.6b delivered with the
143 operating system (you can find out by running '/usr/bin/openssl version')
144 and that you were trying to build OpenSSL 0.9.6d.  The problem is that
145 the loader ('ld') in MacOS X has a misfeature that's quite difficult to
146 go around and has linked the programs "openssl" and the test programs
147 with /usr/lib/libcrypto.dylib and /usr/lib/libssl.dylib instead of the
148 libraries you just built.
149 Look in the file PROBLEMS for a more detailed explanation and for possible
150 solutions.
151
152 * Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
153
154 Failure in BN_sqr test is most likely caused by a failure to configure the
155 toolkit for current platform or lack of support for the platform in question.
156 Run './config -t' and './apps/openssl version -p'. Do these platform
157 identifiers match? If they don't, then you most likely failed to run
158 ./config and you're hereby advised to do so before filing a bug report.
159 If ./config itself fails to run, then it's most likely problem with your
160 local environment and you should turn to your system administrator (or
161 similar). If identifiers match (and/or no alternative identifier is
162 suggested by ./config script), then the platform is unsupported. There might
163 or might not be a workaround. Most notably on SPARC64 platforms with GNU
164 C compiler you should be able to produce a working build by running
165 './config -m32'. I understand that -m32 might not be what you want/need,
166 but the build should be operational. For further details turn to
167 @@@mailto:openssl-dev@openssl.org@@@
168
169 * Why does the OpenSSL test suite fail in sha512t on x86 CPU?
170
171 If the test program in question fails withs SIGILL, Illegal Instruction
172 exception, then you more than likely to run SSE2-capable CPU, such as
173 Intel P4, under control of kernel which does not support SSE2
174 instruction extensions. See accompanying INSTALL file and
175 OPENSSL_ia32cap(3) documentation page for further information.
176
177 * Why does compiler fail to compile sha512.c?
178
179 OpenSSL SHA-512 implementation depends on compiler support for 64-bit
180 integer type. Few elder compilers [ULTRIX cc, SCO compiler to mention a
181 couple] lack support for this and therefore are incapable of compiling
182 the module in question. The recommendation is to disable SHA-512 by
183 adding no-sha512 to ./config [or ./Configure] command line. Another
184 possible alternative might be to switch to GCC.
185
186 * Test suite still fails, what to do?
187
188 Another common reason for test failures is bugs in the toolchain
189 or run-time environment.  Known cases of this are documented in the
190 PROBLEMS file, please review it before you beat the drum. Even if you
191 don't find anything in that file, please do consider the possibility
192 of a compiler bug. Compiler bugs often appear in rather bizarre ways,
193 they never make sense, and tend to emerge when you least expect
194 them. One thing to try is to reduce the level of optimization (such
195 as by editing the CFLAG variable line in the top-level Makefile),
196 and then recompile and re-run the test.
197
198 * I think I've found a bug, what should I do?
199
200 If you are a new user then it is quite likely you haven't found a bug and
201 something is happening you aren't familiar with. Check this FAQ, the associated
202 documentation and the mailing lists for similar queries. If you are still
203 unsure whether it is a bug or not submit a query to the openssl-users mailing
204 list.
205
206 If you think you have found a bug based on the output of static analysis tools
207 then please manually check the issue is genuine. Such tools can produce a
208 LOT of false positives.
209
210 * I'm SURE I've found a bug, how do I report it?
211
212 Please see @@@https://www.openssl.org/community@@@.
213
214 * I've found a security issue, how do I report it?
215
216 If you think your bug has security implications then please send it to
217 openssl-security@openssl.org if you don't get a prompt reply at least
218 acknowledging receipt then resend or mail it directly to one of the
219 more active team members (e.g. Steve). If you wish to use PGP to send
220 in a report please use one or more of the keys of the OMC listed
221 at @@@https://www.openssl.org/community/omc.html@@@.
222
223 Note that bugs only present in the openssl utility are not in general
224 considered to be security issues.