]> git.ipfire.org Git - thirdparty/openssl.git/blob - Configurations/10-main.conf
Add linux-x86-latomic target
[thirdparty/openssl.git] / Configurations / 10-main.conf
1 ## -*- mode: perl; -*-
2 ## Standard openssl configuration targets.
3
4 # Helper functions for the Windows configs
5 my $vc_win64a_info = {};
6 sub vc_win64a_info {
7 unless (%$vc_win64a_info) {
8 if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
9 $vc_win64a_info = { AS => "nasm",
10 ASFLAGS => "-g",
11 asflags => "-Ox -f win64 -DNEAR",
12 asoutflag => "-o " };
13 } elsif ($disabled{asm}) {
14 # assembler is still used to compile uplink shim
15 $vc_win64a_info = { AS => "ml64",
16 ASFLAGS => "/nologo /Zi",
17 asflags => "/c /Cp /Cx",
18 asoutflag => "/Fo" };
19 } else {
20 $die->("NASM not found - make sure it's installed and available on %PATH%\n");
21 $vc_win64a_info = { AS => "{unknown}",
22 ASFLAGS => "",
23 asflags => "",
24 asoutflag => "" };
25 }
26 }
27 return $vc_win64a_info;
28 }
29
30 my $vc_win32_info = {};
31 sub vc_win32_info {
32 unless (%$vc_win32_info) {
33 my $ver=`nasm -v 2>NUL`;
34 my $vew=`nasmw -v 2>NUL`;
35 if ($ver ne "" || $vew ne "") {
36 $vc_win32_info = { AS => $ver ge $vew ? "nasm" : "nasmw",
37 ASFLAGS => "",
38 asflags => "-f win32",
39 asoutflag => "-o ",
40 perlasm_scheme => "win32n" };
41 } elsif ($disabled{asm}) {
42 # not actually used, uplink shim is inlined into C code
43 $vc_win32_info = { AS => "ml",
44 ASFLAGS => "/nologo /Zi",
45 asflags => "/Cp /coff /c /Cx",
46 asoutflag => "/Fo",
47 perlasm_scheme => "win32" };
48 } else {
49 $die->("NASM not found - make sure it's installed and available on %PATH%\n");
50 $vc_win32_info = { AS => "{unknown}",
51 ASFLAGS => "",
52 asflags => "",
53 asoutflag => "",
54 perlasm_scheme => "win32" };
55 }
56 }
57 return $vc_win32_info;
58 }
59
60 my $vc_wince_info = {};
61 sub vc_wince_info {
62 unless (%$vc_wince_info) {
63 # sanity check
64 $die->('%OSVERSION% is not defined') if (!defined(env('OSVERSION')));
65 $die->('%PLATFORM% is not defined') if (!defined(env('PLATFORM')));
66 $die->('%TARGETCPU% is not defined') if (!defined(env('TARGETCPU')));
67
68 #
69 # Idea behind this is to mimic flags set by eVC++ IDE...
70 #
71 my $wcevers = env('OSVERSION'); # WCENNN
72 my $wcevernum;
73 my $wceverdotnum;
74 if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
75 $wcevernum = "$1$2";
76 $wceverdotnum = "$1.$2";
77 } else {
78 $die->('%OSVERSION% value is insane');
79 $wcevernum = "{unknown}";
80 $wceverdotnum = "{unknown}";
81 }
82 my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
83 my $wcelflag = "/subsystem:windowsce,$wceverdotnum"; # ...,N.NN
84
85 my $wceplatf = env('PLATFORM');
86
87 $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
88 $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
89
90 my $wcetgt = env('TARGETCPU'); # just shorter name...
91 SWITCH: for($wcetgt) {
92 /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
93 $wcelflag.=" /machine:X86"; last; };
94 /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
95 $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
96 $wcecdefs.=" -QRarch4T -QRinterwork-return";
97 $wcelflag.=" /machine:THUMB"; last; };
98 /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
99 $wcelflag.=" /machine:ARM"; last; };
100 /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
101 $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
102 $wcelflag.=" /machine:MIPSFPU"; last; };
103 /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
104 $wcecdefs.=" -DMIPSII -QMmips16";
105 $wcelflag.=" /machine:MIPS16"; last; };
106 /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
107 $wcecdefs.=" -QMmips2";
108 $wcelflag.=" /machine:MIPS"; last; };
109 /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
110 $wcelflag.=" /machine:MIPS"; last; };
111 /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
112 $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
113 $wcelflag.=" /machine:$wcetgt"; last; };
114 { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
115 $wcelflag.=" /machine:$wcetgt"; last; };
116 }
117
118 $vc_wince_info = { cppflags => $wcecdefs,
119 lflags => $wcelflag };
120 }
121 return $vc_wince_info;
122 }
123
124 # Helper functions for the VMS configs
125 my $vms_info = {};
126 sub vms_info {
127 my $pointer_size_str = $config{target} =~ m|-p(\d+)$| ? $1 : "";
128
129 # For the case where Configure iterate through all config targets, such
130 # as when listing them and their details, we reset info if the pointer
131 # size changes.
132 if (%$vms_info && $vms_info->{pointer_size} ne $pointer_size_str) {
133 $vms_info = {};
134 }
135
136 unless (%$vms_info) {
137 $vms_info->{disable_warns} = [
138 "CXXPRAGMANA", # Shut up about unknown / unsupported pragmas
139 ];
140 $vms_info->{pointer_size} = $pointer_size_str;
141 if ($pointer_size_str eq "64") {
142 `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
143 if ($? == 0) {
144 push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
145 }
146 }
147
148 unless ($disabled{zlib}) {
149 my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
150 if (defined($disabled{"zlib-dynamic"})) {
151 $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
152 } else {
153 $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
154 # In case the --with-zlib-lib value contains something like
155 # /SHARE or /LIB or so at the end, remove it.
156 $vms_info->{def_zlib} =~ s|/.*$||g;
157 }
158 }
159
160 if ($config{target} =~ /-ia64/) {
161 `PIPE ias -H 2> NL:`;
162 if ($? == 0) {
163 $vms_info->{AS} = "ias";
164 $vms_info->{ASFLAGS} = '-d debug';
165 $vms_info->{asflags} = '"-N" vms_upcase';
166 $vms_info->{asoutflag} = "-o ";
167 $vms_info->{perlasm_scheme} = "ias";
168 }
169 }
170 }
171 return $vms_info;
172 }
173
174 my %targets = (
175
176 #### Basic configs that should work on any 32-bit box
177 "gcc" => {
178 inherit_from => [ "BASE_unix" ],
179 CC => "gcc",
180 CFLAGS => picker(debug => "-O0 -g",
181 release => "-O3"),
182 thread_scheme => "(unknown)",
183 bn_ops => "BN_LLONG",
184 },
185 "cc" => {
186 inherit_from => [ "BASE_unix" ],
187 CC => "cc",
188 CFLAGS => "-O",
189 thread_scheme => "(unknown)",
190 },
191
192 #### VOS Configurations
193 "vos-gcc" => {
194 inherit_from => [ "BASE_unix" ],
195 CC => "gcc",
196 CFLAGS => picker(default => "-Wall",
197 debug => "-O0 -g",
198 release => "-O3"),
199 cppflags => "-D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES",
200 lib_cppflags => "-DB_ENDIAN",
201 thread_scheme => "(unknown)",
202 sys_id => "VOS",
203 lflags => add("-Wl,-map"),
204 bn_ops => "BN_LLONG",
205 shared_extension => ".so",
206 },
207
208 #### Solaris configurations
209 "solaris-common" => {
210 inherit_from => [ "BASE_unix" ],
211 template => 1,
212 lib_cppflags => "-DFILIO_H",
213 ex_libs => add("-lsocket -lnsl -ldl"),
214 dso_scheme => "dlfcn",
215 thread_scheme => "pthreads",
216 },
217 #### Solaris common with Sun C setups
218 "solaris-common-cc" => {
219 inherit_from => [ "solaris-common" ],
220 template => 1,
221 shared_target => "solaris",
222 shared_ldflag => "-Wl,-Bsymbolic",
223 shared_defflag => "-Wl,-M,",
224 shared_sonameflag=> "-Wl,-h,",
225 },
226 #### Solaris common with GNU C setups
227 "solaris-common-gcc" => {
228 inherit_from => [ "solaris-common" ],
229 template => 1,
230 shared_target => "solaris-gcc-shared", # The rest is on shared_info.pl
231 },
232 #### Solaris x86 with GNU C setups
233 "solaris-x86-gcc" => {
234 # NB. GNU C has to be configured to use GNU assembler, and not
235 # /usr/ccs/bin/as. Failure to comply will result in compile
236 # failures [at least] in 32-bit build.
237 inherit_from => [ "solaris-common-gcc" ],
238 CC => "gcc",
239 CFLAGS => add_before(picker(default => "-Wall",
240 debug => "-O0 -g",
241 release => "-O3 -fomit-frame-pointer")),
242 lib_cppflags => add("-DL_ENDIAN"),
243 bn_ops => "BN_LLONG",
244 shared_cflag => "-fPIC",
245 shared_ldflag => add_before("-shared -static-libgcc"),
246 asm_arch => 'x86',
247 perlasm_scheme => 'elf',
248 },
249 "solaris64-x86_64-gcc" => {
250 # -shared -static-libgcc might appear controversial, but modules
251 # taken from static libgcc do not have relocations and linking
252 # them into our shared objects doesn't have any negative side
253 # effects. On the contrary, doing so makes it possible to use
254 # gcc shared build with Sun C. Given that gcc generates faster
255 # code [thanks to inline assembler], I would actually recommend
256 # to consider using gcc shared build even with vendor compiler:-)
257 # -- <appro@openssl.org>
258 inherit_from => [ "solaris-common-gcc" ],
259 CC => "gcc",
260 CFLAGS => add_before(picker(default => "-Wall",
261 debug => "-O0 -g",
262 release => "-O3")),
263 cflags => add("-m64"),
264 lib_cppflags => add("-DL_ENDIAN"),
265 bn_ops => "SIXTY_FOUR_BIT_LONG",
266 asm_arch => 'x86_64',
267 perlasm_scheme => "elf",
268 shared_cflag => "-fPIC",
269 shared_ldflag => add_before("-shared -static-libgcc"),
270 multilib => "/64",
271 },
272
273 #### Solaris x86 with Sun C setups
274 # There used to be solaris-x86-cc target, but it was removed,
275 # primarily because vendor assembler can't assemble our modules
276 # with -KPIC flag. As result it, assembly support, was not even
277 # available as option. But its lack means lack of side-channel
278 # resistant code, which is incompatible with security by today's
279 # standards. Fortunately gcc is readily available prepackaged
280 # option, which we can firmly point at...
281 #
282 # On related note, solaris64-x86_64-cc target won't compile code
283 # paths utilizing AVX and post-Haswell instruction extensions.
284 # Consider switching to solaris64-x86_64-gcc even here...
285 #
286 "solaris64-x86_64-cc" => {
287 inherit_from => [ "solaris-common-cc" ],
288 CC => "cc",
289 CFLAGS => add_before(picker(debug => "-g",
290 release => "-xO5 -xdepend -xbuiltin")),
291 cflags => add_before("-xarch=generic64 -xstrconst -Xa"),
292 cppflags => add(threads("-D_REENTRANT")),
293 lib_cppflags => add("-DL_ENDIAN"),
294 thread_scheme => "pthreads",
295 lflags => add(threads("-mt")),
296 bn_ops => "SIXTY_FOUR_BIT_LONG",
297 asm_arch => 'x86_64',
298 perlasm_scheme => "elf",
299 shared_cflag => "-KPIC",
300 shared_ldflag => add_before("-G -dy -z text"),
301 multilib => "/64",
302 },
303
304 #### SPARC Solaris with GNU C setups
305 "solaris-sparcv7-gcc" => {
306 inherit_from => [ "solaris-common-gcc" ],
307 CC => "gcc",
308 CFLAGS => add_before(picker(default => "-Wall",
309 debug => "-O0 -g",
310 release => "-O3")),
311 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
312 bn_ops => "BN_LLONG RC4_CHAR",
313 shared_cflag => "-fPIC",
314 shared_ldflag => add_before("-shared -static-libgcc"),
315 },
316 "solaris-sparcv8-gcc" => {
317 inherit_from => [ "solaris-sparcv7-gcc" ],
318 cflags => add_before("-mcpu=v8"),
319 asm_arch => 'sparcv8',
320 perlasm_scheme => 'void',
321 },
322 "solaris-sparcv9-gcc" => {
323 # -m32 should be safe to add as long as driver recognizes
324 # -mcpu=ultrasparc
325 inherit_from => [ "solaris-sparcv7-gcc" ],
326 cflags => add_before("-m32 -mcpu=ultrasparc"),
327 asm_arch => 'sparcv9',
328 perlasm_scheme => 'void',
329 },
330 "solaris64-sparcv9-gcc" => {
331 inherit_from => [ "solaris-sparcv9-gcc" ],
332 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
333 bn_ops => "BN_LLONG RC4_CHAR",
334 multilib => "/64",
335 },
336
337 #### SPARC Solaris with Sun C setups
338 # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
339 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
340 # SC5.0 note: Compiler common patch 107357-01 or later is required!
341 "solaris-sparcv7-cc" => {
342 inherit_from => [ "solaris-common-cc" ],
343 CC => "cc",
344 CFLAGS => add_before(picker(debug => "-g",
345 release => "-xO5 -xdepend")),
346 cflags => add_before("-xstrconst -Xa"),
347 cppflags => add(threads("-D_REENTRANT")),
348 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
349 lflags => add(threads("-mt")),
350 bn_ops => "BN_LLONG RC4_CHAR",
351 shared_cflag => "-KPIC",
352 shared_ldflag => add_before("-G -dy -z text"),
353 },
354 ####
355 "solaris-sparcv8-cc" => {
356 inherit_from => [ "solaris-sparcv7-cc" ],
357 cflags => add_before("-xarch=v8"),
358 asm_arch => 'sparcv8',
359 perlasm_scheme => 'void',
360 },
361 "solaris-sparcv9-cc" => {
362 inherit_from => [ "solaris-sparcv7-cc" ],
363 cflags => add_before("-xarch=v8plus"),
364 asm_arch => 'sparcv9',
365 perlasm_scheme => 'void',
366 },
367 "solaris64-sparcv9-cc" => {
368 inherit_from => [ "solaris-sparcv7-cc" ],
369 cflags => add_before("-m64 -xarch=sparc"),
370 bn_ops => "BN_LLONG RC4_CHAR",
371 asm_arch => 'sparcv9',
372 perlasm_scheme => 'void',
373 multilib => "/64",
374 },
375
376 #### IRIX 6.x configs
377 # Only N32 and N64 ABIs are supported.
378 "irix-common" => {
379 inherit_from => [ "BASE_unix" ],
380 template => 1,
381 cppflags => threads("-D_SGI_MP_SOURCE"),
382 lib_cppflags => "-DB_ENDIAN",
383 ex_libs => add(threads("-lpthread")),
384 thread_scheme => "pthreads",
385 dso_scheme => "dlfcn",
386 shared_target => "self",
387 shared_ldflag => "-shared -Wl,-Bsymbolic",
388 shared_sonameflag=> "-Wl,-soname,",
389 },
390 "irix-mips3-gcc" => {
391 inherit_from => [ "irix-common" ],
392 CC => "gcc",
393 CFLAGS => picker(debug => "-g -O0",
394 release => "-O3"),
395 LDFLAGS => "-static-libgcc",
396 cflags => "-mabi=n32",
397 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
398 asm_arch => 'mips64',
399 perlasm_scheme => "n32",
400 multilib => "32",
401 },
402 "irix-mips3-cc" => {
403 inherit_from => [ "irix-common" ],
404 CC => "cc",
405 CFLAGS => picker(debug => "-g -O0",
406 release => "-O2"),
407 cflags => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
408 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
409 asm_arch => 'mips64',
410 perlasm_scheme => "n32",
411 multilib => "32",
412 },
413 # N64 ABI builds.
414 "irix64-mips4-gcc" => {
415 inherit_from => [ "irix-common" ],
416 CC => "gcc",
417 CFLAGS => picker(debug => "-g -O0",
418 release => "-O3"),
419 LDFLAGS => "-static-libgcc",
420 cflags => "-mabi=64 -mips4",
421 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
422 asm_arch => 'mips64',
423 perlasm_scheme => "64",
424 multilib => "64",
425 },
426 "irix64-mips4-cc" => {
427 inherit_from => [ "irix-common" ],
428 CC => "cc",
429 CFLAGS => picker(debug => "-g -O0",
430 release => "-O2"),
431 cflags => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
432 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
433 asm_arch => 'mips64',
434 perlasm_scheme => "64",
435 multilib => "64",
436 },
437
438 #### Unified HP-UX ANSI C configs.
439 # Special notes:
440 # - Originally we were optimizing at +O4 level. It should be noted
441 # that the only difference between +O3 and +O4 is global inter-
442 # procedural analysis. As it has to be performed during the link
443 # stage the compiler leaves behind certain pseudo-code in lib*.a
444 # which might be release or even patch level specific. Generating
445 # the machine code for and analyzing the *whole* program appears
446 # to be *extremely* memory demanding while the performance gain is
447 # actually questionable. The situation is intensified by the default
448 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
449 # which is way too low for +O4. In other words, doesn't +O3 make
450 # more sense?
451 # - Keep in mind that the HP compiler by default generates code
452 # suitable for execution on the host you're currently compiling at.
453 # If the toolkit is meant to be used on various PA-RISC processors
454 # consider './Configure hpux-parisc-[g]cc +DAportable'.
455 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
456 # 32-bit message digests. (For the moment of this writing) HP C
457 # doesn't seem to "digest" too many local variables (they make "him"
458 # chew forever:-). For more details look-up MD32_XARRAY comment in
459 # crypto/sha/sha_local.h.
460 # - originally there were 32-bit hpux-parisc2-* targets. They were
461 # scrapped, because a) they were not interchangeable with other 32-bit
462 # targets; b) performance-critical 32-bit assembly modules implement
463 # even PA-RISC 2.0-specific code paths, which are chosen at run-time,
464 # thus adequate performance is provided even with PA-RISC 1.1 build.
465 "hpux-common" => {
466 inherit_from => [ "BASE_unix" ],
467 template => 1,
468 defines => add("_XOPEN_SOURCE", "_XOPEN_SOURCE_EXTENDED",
469 "_HPUX_ALT_XOPEN_SOCKET_API"),
470 lib_cppflags => "-DB_ENDIAN",
471 thread_scheme => "pthreads",
472 dso_scheme => "dlfcn", # overridden in 32-bit PA-RISC builds
473 shared_target => "self",
474 bin_lflags => "-Wl,+s,+cdp,../:,+cdp,./:",
475 shared_ldflag => "-Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+cdp,../:,+cdp,./:",
476 shared_sonameflag=> "-Wl,+h,",
477 },
478 "hpux-parisc-gcc" => {
479 inherit_from => [ "hpux-common" ],
480 CC => "gcc",
481 CFLAGS => picker(debug => "-O0 -g",
482 release => "-O3"),
483 cflags => add(threads("-pthread")),
484 lib_cppflags => add("-DBN_DIV2W"),
485 ex_libs => add("-ldld", threads("-pthread")),
486 bn_ops => "BN_LLONG RC4_CHAR",
487 dso_scheme => "dl",
488 shared_cflag => "-fPIC",
489 shared_ldflag => add_before("-shared"),
490 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
491 },
492 "hpux-parisc1_1-gcc" => {
493 inherit_from => [ "hpux-parisc-gcc" ],
494 asm_arch => 'parisc11',
495 perlasm_scheme => "32",
496 multilib => "/pa1.1",
497 },
498 "hpux64-parisc2-gcc" => {
499 inherit_from => [ "hpux-common" ],
500 CC => "gcc",
501 CFLAGS => combine(picker(debug => "-O0 -g",
502 release => "-O3")),
503 cflags => add(threads("-pthread")),
504 ex_libs => add("-ldl", threads("-pthread")),
505 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
506 asm_arch => 'parisc20_64',
507 perlasm_scheme => "64",
508 shared_cflag => "-fpic",
509 shared_ldflag => add_before("-shared"),
510 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
511 multilib => "/pa20_64",
512 },
513
514 # More attempts at unified 10.X and 11.X targets for HP C compiler.
515 "hpux-parisc-cc" => {
516 inherit_from => [ "hpux-common" ],
517 CC => "cc",
518 CFLAGS => picker(debug => "+O0 +d -g",
519 release => "+O3"),
520 cflags => "+Optrs_strongly_typed -Ae +ESlit",
521 cppflags => threads("-D_REENTRANT"),
522 lib_cppflags => add("-DBN_DIV2W -DMD32_XARRAY"),
523 ex_libs => add("-ldld", threads("-lpthread")),
524 bn_ops => "RC4_CHAR",
525 dso_scheme => "dl",
526 shared_cflag => "+Z",
527 shared_ldflag => add_before("-b"),
528 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
529 },
530 "hpux-parisc1_1-cc" => {
531 inherit_from => [ "hpux-parisc-cc" ],
532 cflags => add_before("+DA1.1"),
533 asm_arch => 'parisc11',
534 perlasm_scheme => "32",
535 multilib => "/pa1.1",
536 },
537 "hpux64-parisc2-cc" => {
538 inherit_from => [ "hpux-common" ],
539 CC => "cc",
540 CFLAGS => picker(debug => "+O0 +d -g",
541 release => "+O3") ,
542 cflags => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
543 cppflags => threads("-D_REENTRANT") ,
544 lib_cppflags => add("-DMD32_XARRAY"),
545 ex_libs => add("-ldl", threads("-lpthread")),
546 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
547 asm_arch => 'parisc20_64',
548 perlasm_scheme => "64",
549 shared_cflag => "+Z",
550 shared_ldflag => add_before("-b"),
551 shared_extension => ".sl.\$(SHLIB_VERSION_NUMBER)",
552 multilib => "/pa20_64",
553 },
554
555 # HP/UX IA-64 targets
556 "hpux-ia64-cc" => {
557 inherit_from => [ "hpux-common" ],
558 CC => "cc",
559 CFLAGS => picker(debug => "+O0 +d -g",
560 release => "+O2"),
561 cflags => "-Ae +DD32 +Olit=all -z",
562 cppflags => add(threads("-D_REENTRANT")),
563 ex_libs => add("-ldl", threads("-lpthread")),
564 bn_ops => "SIXTY_FOUR_BIT",
565 asm_arch => 'ia64',
566 perlasm_scheme => 'void',
567 shared_cflag => "+Z",
568 shared_ldflag => add_before("-b"),
569 multilib => "/hpux32",
570 },
571 "hpux64-ia64-cc" => {
572 inherit_from => [ "hpux-common" ],
573 CC => "cc",
574 CFLAGS => picker(debug => "+O0 +d -g",
575 release => "+O3"),
576 cflags => "-Ae +DD64 +Olit=all -z",
577 cppflags => threads("-D_REENTRANT"),
578 ex_libs => add("-ldl", threads("-lpthread")),
579 bn_ops => "SIXTY_FOUR_BIT_LONG",
580 asm_arch => 'ia64',
581 perlasm_scheme => 'void',
582 shared_cflag => "+Z",
583 shared_ldflag => add_before("-b"),
584 multilib => "/hpux64",
585 },
586 # GCC builds...
587 "hpux-ia64-gcc" => {
588 inherit_from => [ "hpux-common" ],
589 CC => "gcc",
590 CFLAGS => picker(debug => "-O0 -g",
591 release => "-O3"),
592 cflags => add(threads("-pthread")),
593 ex_libs => add("-ldl", threads("-pthread")),
594 bn_ops => "SIXTY_FOUR_BIT",
595 asm_arch => 'ia64',
596 perlasm_scheme => 'void',
597 shared_cflag => "-fpic",
598 shared_ldflag => add_before("-shared"),
599 multilib => "/hpux32",
600 },
601 "hpux64-ia64-gcc" => {
602 inherit_from => [ "hpux-common" ],
603 CC => "gcc",
604 CFLAGS => picker(debug => "-O0 -g",
605 release => "-O3"),
606 cflags => combine("-mlp64", threads("-pthread")),
607 ex_libs => add("-ldl", threads("-pthread")),
608 bn_ops => "SIXTY_FOUR_BIT_LONG",
609 asm_arch => 'ia64',
610 perlasm_scheme => 'void',
611 shared_cflag => "-fpic",
612 shared_ldflag => add_before("-shared"),
613 multilib => "/hpux64",
614 },
615
616 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
617 "MPE/iX-gcc" => {
618 inherit_from => [ "BASE_unix" ],
619 CC => "gcc",
620 CFLAGS => "-O3",
621 cppflags => "-D_POSIX_SOURCE -D_SOCKET_SOURCE",
622 includes => [ "/SYSLOG/PUB" ],
623 lib_cppflags => "-DBN_DIV2W",
624 sys_id => "MPE",
625 lflags => add("-L/SYSLOG/PUB"),
626 ex_libs => add("-lsyslog -lsocket -lcurses"),
627 thread_scheme => "(unknown)",
628 bn_ops => "BN_LLONG",
629 },
630
631 #### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
632 #### and forward. In reality 'uname -s' still returns "OSF1". Originally
633 #### there were even osf1-* configs targeting prior versions provided,
634 #### but not anymore...
635 "tru64-alpha-gcc" => {
636 inherit_from => [ "BASE_unix" ],
637 CC => "gcc",
638 CFLAGS => "-O3",
639 cflags => add("-std=c9x", threads("-pthread")),
640 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
641 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
642 bn_ops => "SIXTY_FOUR_BIT_LONG",
643 asm_arch => 'alpha',
644 perlasm_scheme => "void",
645 thread_scheme => "pthreads",
646 dso_scheme => "dlfcn",
647 shared_target => "alpha-osf1-shared",
648 shared_extension => ".so",
649 },
650 "tru64-alpha-cc" => {
651 inherit_from => [ "BASE_unix" ],
652 CC => "cc",
653 CFLAGS => "-tune host -fast",
654 cflags => add("-std1 -readonly_strings",
655 threads("-pthread")),
656 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
657 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
658 bn_ops => "SIXTY_FOUR_BIT_LONG",
659 asm_arch => 'alpha',
660 perlasm_scheme => "void",
661 thread_scheme => "pthreads",
662 dso_scheme => "dlfcn",
663 shared_target => "alpha-osf1-shared",
664 shared_ldflag => "-msym",
665 shared_extension => ".so",
666 },
667
668 ####
669 #### Variety of LINUX:-)
670 ####
671 # *-generic* is endian-neutral target, but ./config is free to
672 # throw in -D[BL]_ENDIAN, whichever appropriate...
673 "linux-generic32" => {
674 inherit_from => [ "BASE_unix" ],
675 CC => "gcc",
676 CXX => "g++",
677 CFLAGS => picker(default => "-Wall",
678 debug => "-O0 -g",
679 release => "-O3"),
680 CXXFLAGS => picker(default => "-Wall",
681 debug => "-O0 -g",
682 release => "-O3"),
683 cflags => threads("-pthread"),
684 cxxflags => combine("-std=c++11", threads("-pthread")),
685 lib_cppflags => "-DOPENSSL_USE_NODELETE",
686 ex_libs => add("-ldl", threads("-pthread")),
687 bn_ops => "BN_LLONG RC4_CHAR",
688 thread_scheme => "pthreads",
689 dso_scheme => "dlfcn",
690 shared_target => "linux-shared",
691 shared_cflag => "-fPIC",
692 shared_ldflag => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
693 enable => [ "afalgeng" ],
694 },
695 "linux-latomic" => {
696 inherit_from => [ "linux-generic32" ],
697 ex_libs => add(threads("-latomic")),
698 },
699 "linux-generic64" => {
700 inherit_from => [ "linux-generic32" ],
701 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
702 },
703
704 "linux-ppc" => {
705 inherit_from => [ "linux-latomic" ],
706 asm_arch => 'ppc32',
707 perlasm_scheme => "linux32",
708 lib_cppflags => add("-DB_ENDIAN"),
709 },
710 "linux-ppc64" => {
711 inherit_from => [ "linux-generic64" ],
712 cflags => add("-m64"),
713 cxxflags => add("-m64"),
714 lib_cppflags => add("-DB_ENDIAN"),
715 asm_arch => 'ppc64',
716 perlasm_scheme => "linux64",
717 multilib => "64",
718 },
719 "linux-ppc64le" => {
720 inherit_from => [ "linux-generic64" ],
721 cflags => add("-m64"),
722 cxxflags => add("-m64"),
723 lib_cppflags => add("-DL_ENDIAN"),
724 asm_arch => 'ppc64',
725 perlasm_scheme => "linux64le",
726 },
727
728 "linux-armv4" => {
729 ################################################################
730 # Note that -march is not among compiler options in linux-armv4
731 # target description. Not specifying one is intentional to give
732 # you choice to:
733 #
734 # a) rely on your compiler default by not specifying one;
735 # b) specify your target platform explicitly for optimal
736 # performance, e.g. -march=armv6 or -march=armv7-a;
737 # c) build "universal" binary that targets *range* of platforms
738 # by specifying minimum and maximum supported architecture;
739 #
740 # As for c) option. It actually makes no sense to specify
741 # maximum to be less than ARMv7, because it's the least
742 # requirement for run-time switch between platform-specific
743 # code paths. And without run-time switch performance would be
744 # equivalent to one for minimum. Secondly, there are some
745 # natural limitations that you'd have to accept and respect.
746 # Most notably you can *not* build "universal" binary for
747 # big-endian platform. This is because ARMv7 processor always
748 # picks instructions in little-endian order. Another similar
749 # limitation is that -mthumb can't "cross" -march=armv6t2
750 # boundary, because that's where it became Thumb-2. Well, this
751 # limitation is a bit artificial, because it's not really
752 # impossible, but it's deemed too tricky to support. And of
753 # course you have to be sure that your binutils are actually
754 # up to the task of handling maximum target platform. With all
755 # this in mind here is an example of how to configure
756 # "universal" build:
757 #
758 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
759 #
760 inherit_from => [ "linux-latomic" ],
761 asm_arch => 'armv4',
762 perlasm_scheme => "linux32",
763 },
764 "linux-aarch64" => {
765 inherit_from => [ "linux-generic64" ],
766 asm_arch => 'aarch64',
767 perlasm_scheme => "linux64",
768 },
769 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
770 inherit_from => [ "linux-generic32" ],
771 cflags => add("-mabi=ilp32"),
772 cxxflags => add("-mabi=ilp32"),
773 bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
774 asm_arch => 'aarch64',
775 perlasm_scheme => "linux64",
776 },
777
778 "linux-mips32" => {
779 # Configure script adds minimally required -march for assembly
780 # support, if no -march was specified at command line.
781 inherit_from => [ "linux-latomic" ],
782 cflags => add("-mabi=32"),
783 cxxflags => add("-mabi=32"),
784 asm_arch => 'mips32',
785 perlasm_scheme => "o32",
786 },
787 # mips32 and mips64 below refer to contemporary MIPS Architecture
788 # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
789 "linux-mips64" => {
790 inherit_from => [ "linux-latomic" ],
791 cflags => add("-mabi=n32"),
792 cxxflags => add("-mabi=n32"),
793 bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
794 asm_arch => 'mips64',
795 perlasm_scheme => "n32",
796 multilib => "32",
797 },
798 "linux64-mips64" => {
799 inherit_from => [ "linux-generic64" ],
800 cflags => add("-mabi=64"),
801 cxxflags => add("-mabi=64"),
802 asm_arch => 'mips64',
803 perlasm_scheme => "64",
804 multilib => "64",
805 },
806
807 # riscv below refers to contemporary RISCV Architecture
808 # specifications,
809 "linux64-riscv64" => {
810 inherit_from => [ "linux-generic64"],
811 perlasm_scheme => "linux64",
812 asm_arch => 'riscv64',
813 },
814
815 "linux32-riscv32" => {
816 inherit_from => [ "linux-generic32"],
817 perlasm_scheme => "linux32",
818 asm_arch => 'riscv32',
819 },
820
821 # loongarch64 below refers to contemporary LOONGARCH Architecture
822 # specifications,
823 "linux64-loongarch64" => {
824 inherit_from => [ "linux-generic64"],
825 perlasm_scheme => "linux64",
826 asm_arch => 'loongarch64',
827 },
828
829 #### IA-32 targets...
830 #### These two targets are a bit aged and are to be used on older Linux
831 #### machines where gcc doesn't understand -m32 and -m64
832 "linux-elf" => {
833 inherit_from => [ "linux-generic32" ],
834 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
835 lib_cppflags => add("-DL_ENDIAN"),
836 bn_ops => "BN_LLONG",
837 asm_arch => 'x86',
838 perlasm_scheme => "elf",
839 },
840 "linux-aout" => {
841 inherit_from => [ "BASE_unix" ],
842 CC => "gcc",
843 CFLAGS => add(picker(default => "-Wall",
844 debug => "-O0 -g",
845 release => "-O3 -fomit-frame-pointer")),
846 lib_cppflags => add("-DL_ENDIAN"),
847 bn_ops => "BN_LLONG",
848 thread_scheme => "(unknown)",
849 asm_arch => 'x86',
850 perlasm_scheme => "a.out",
851 },
852
853 #### X86 / X86_64 targets
854 "linux-x86" => {
855 inherit_from => [ "linux-generic32" ],
856 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
857 cflags => add("-m32"),
858 cxxflags => add("-m32"),
859 lib_cppflags => add("-DL_ENDIAN"),
860 bn_ops => "BN_LLONG",
861 asm_arch => 'x86',
862 perlasm_scheme => "elf",
863 },
864 "linux-x86-latomic" => {
865 inherit_from => [ "linux-x86" ],
866 ex_libs => add(threads("-latomic")),
867 },
868 "linux-x86-clang" => {
869 inherit_from => [ "linux-x86" ],
870 CC => "clang",
871 CXX => "clang++",
872 ex_libs => add(threads("-latomic")),
873 },
874 "linux-x86_64" => {
875 inherit_from => [ "linux-generic64" ],
876 cflags => add("-m64"),
877 cxxflags => add("-m64"),
878 lib_cppflags => add("-DL_ENDIAN"),
879 bn_ops => "SIXTY_FOUR_BIT_LONG",
880 asm_arch => 'x86_64',
881 perlasm_scheme => "elf",
882 multilib => "64",
883 },
884 "linux-x86_64-clang" => {
885 inherit_from => [ "linux-x86_64" ],
886 CC => "clang",
887 CXX => "clang++",
888 },
889 "linux-x32" => {
890 inherit_from => [ "linux-generic32" ],
891 cflags => add("-mx32"),
892 cxxflags => add("-mx32"),
893 lib_cppflags => add("-DL_ENDIAN"),
894 bn_ops => "SIXTY_FOUR_BIT",
895 asm_arch => 'x86_64',
896 perlasm_scheme => "elf32",
897 multilib => "x32",
898 },
899
900 "linux-ia64" => {
901 inherit_from => [ "linux-generic64" ],
902 bn_ops => "SIXTY_FOUR_BIT_LONG",
903 asm_arch => 'ia64',
904 perlasm_scheme => 'void',
905 },
906
907 "linux64-s390x" => {
908 inherit_from => [ "linux-generic64" ],
909 cflags => add("-m64"),
910 cxxflags => add("-m64"),
911 lib_cppflags => add("-DB_ENDIAN"),
912 asm_arch => 's390x',
913 perlasm_scheme => "64",
914 multilib => "64",
915 },
916 "linux32-s390x" => {
917 #### So called "highgprs" target for z/Architecture CPUs
918 # "Highgprs" is kernel feature first implemented in Linux
919 # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
920 # significant bits of general purpose registers not only
921 # upon 32-bit process context switch, but even on
922 # asynchronous signal delivery to such process. This makes
923 # it possible to deploy 64-bit instructions even in legacy
924 # application context and achieve better [or should we say
925 # adequate] performance. The build is binary compatible with
926 # linux-generic32, and the idea is to be able to install the
927 # resulting libcrypto.so alongside generic one, e.g. as
928 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
929 # linker to autodiscover. Unfortunately it doesn't work just
930 # yet, because of couple of bugs in glibc
931 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
932 #
933 inherit_from => [ "linux-generic32" ],
934 cflags => add("-m31 -Wa,-mzarch"),
935 cxxflags => add("-m31 -Wa,-mzarch"),
936 lib_cppflags => add("-DB_ENDIAN"),
937 asm_arch => 's390x',
938 perlasm_scheme => "31",
939 multilib => "/highgprs",
940 },
941
942 #### SPARC Linux setups
943 "linux-sparcv8" => {
944 inherit_from => [ "linux-latomic" ],
945 cflags => add("-mcpu=v8"),
946 cxxflags => add("-mcpu=v8"),
947 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
948 asm_arch => 'sparcv8',
949 perlasm_scheme => 'void',
950 },
951 "linux-sparcv9" => {
952 # it's a real mess with -mcpu=ultrasparc option under Linux,
953 # but -Wa,-Av8plus should do the trick no matter what.
954 inherit_from => [ "linux-latomic" ],
955 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
956 cxxflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
957 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
958 asm_arch => 'sparcv9',
959 perlasm_scheme => 'void',
960 },
961 "linux64-sparcv9" => {
962 # GCC 3.1 is a requirement
963 inherit_from => [ "linux-generic64" ],
964 cflags => add("-m64 -mcpu=ultrasparc"),
965 cxxflags => add("-m64 -mcpu=ultrasparc"),
966 lib_cppflags => add("-DB_ENDIAN"),
967 ex_libs => add(threads("-latomic")),
968 bn_ops => "BN_LLONG RC4_CHAR",
969 asm_arch => 'sparcv9',
970 perlasm_scheme => 'void',
971 multilib => "64",
972 },
973
974 "linux-alpha-gcc" => {
975 inherit_from => [ "linux-generic64" ],
976 lib_cppflags => add("-DL_ENDIAN"),
977 bn_ops => "SIXTY_FOUR_BIT_LONG",
978 asm_arch => 'alpha',
979 perlasm_scheme => "void",
980 },
981 "linux-c64xplus" => {
982 inherit_from => [ "BASE_unix" ],
983 # TI_CGT_C6000_7.3.x is a requirement
984 CC => "cl6x",
985 CFLAGS => "-o2 -ox -ms",
986 cflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
987 cxxflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
988 cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
989 threads("-D_REENTRANT")),
990 bn_ops => "BN_LLONG",
991 thread_scheme => "pthreads",
992 asm_arch => 'c64xplus',
993 perlasm_scheme => "void",
994 dso_scheme => "dlfcn",
995 shared_target => "linux-shared",
996 shared_cflag => "--pic",
997 shared_ldflag => add("-z --sysv --shared"),
998 ranlib => "true",
999 },
1000
1001 #### *BSD
1002 "BSD-generic32" => {
1003 # As for thread cflag. Idea is to maintain "collective" set of
1004 # flags, which would cover all BSD flavors. -pthread applies
1005 # to them all, but is treated differently. OpenBSD expands is
1006 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
1007 # expands it as -lc_r, which has to be accompanied by explicit
1008 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
1009 # expands it as -lc_r, which seems to be sufficient?
1010 inherit_from => [ "BASE_unix" ],
1011 CC => "cc",
1012 CFLAGS => picker(default => "-Wall",
1013 debug => "-O0 -g",
1014 release => "-O3"),
1015 cflags => threads("-pthread"),
1016 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
1017 ex_libs => add(threads("-pthread")),
1018 enable => add("devcryptoeng"),
1019 bn_ops => "BN_LLONG",
1020 thread_scheme => "pthreads",
1021 dso_scheme => "dlfcn",
1022 shared_target => "bsd-gcc-shared",
1023 shared_cflag => "-fPIC",
1024 },
1025 "BSD-generic64" => {
1026 inherit_from => [ "BSD-generic32" ],
1027 bn_ops => "SIXTY_FOUR_BIT_LONG",
1028 },
1029
1030 "BSD-x86" => {
1031 inherit_from => [ "BSD-generic32" ],
1032 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1033 lib_cppflags => add("-DL_ENDIAN"),
1034 bn_ops => "BN_LLONG",
1035 asm_arch => 'x86',
1036 perlasm_scheme => "a.out",
1037 },
1038 "BSD-x86-elf" => {
1039 inherit_from => [ "BSD-x86" ],
1040 perlasm_scheme => "elf",
1041 },
1042
1043 "BSD-sparcv8" => {
1044 inherit_from => [ "BSD-generic32" ],
1045 cflags => add("-mcpu=v8"),
1046 lib_cppflags => add("-DB_ENDIAN"),
1047 asm_arch => 'sparcv8',
1048 perlasm_scheme => 'void',
1049 },
1050 "BSD-sparc64" => {
1051 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1052 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1053 # triggered by RIPEMD160 code.
1054 inherit_from => [ "BSD-generic64" ],
1055 lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1056 bn_ops => "BN_LLONG",
1057 asm_arch => 'sparcv9',
1058 perlasm_scheme => 'void',
1059 },
1060
1061 "BSD-ia64" => {
1062 inherit_from => [ "BSD-generic64" ],
1063 lib_cppflags => add("-DL_ENDIAN"),
1064 bn_ops => "SIXTY_FOUR_BIT_LONG",
1065 asm_arch => 'ia64',
1066 perlasm_scheme => 'void',
1067 },
1068
1069 "BSD-x86_64" => {
1070 inherit_from => [ "BSD-generic64" ],
1071 lib_cppflags => add("-DL_ENDIAN"),
1072 bn_ops => "SIXTY_FOUR_BIT_LONG",
1073 asm_arch => 'x86_64',
1074 perlasm_scheme => "elf",
1075 },
1076
1077 "BSD-aarch64" => {
1078 inherit_from => [ "BSD-generic64" ],
1079 lib_cppflags => add("-DL_ENDIAN"),
1080 bn_ops => "SIXTY_FOUR_BIT_LONG",
1081 asm_arch => 'aarch64',
1082 perlasm_scheme => "linux64",
1083 },
1084
1085 "BSD-ppc" => {
1086 inherit_from => [ "BSD-generic32" ],
1087 asm_arch => 'ppc32',
1088 perlasm_scheme => "linux32",
1089 lib_cppflags => add("-DB_ENDIAN"),
1090 },
1091
1092 "BSD-ppc64" => {
1093 inherit_from => [ "BSD-generic64" ],
1094 cflags => add("-m64"),
1095 cxxflags => add("-m64"),
1096 lib_cppflags => add("-DB_ENDIAN"),
1097 asm_arch => 'ppc64',
1098 perlasm_scheme => "linux64",
1099 },
1100
1101 "BSD-ppc64le" => {
1102 inherit_from => [ "BSD-generic64" ],
1103 cflags => add("-m64"),
1104 cxxflags => add("-m64"),
1105 lib_cppflags => add("-DL_ENDIAN"),
1106 asm_arch => 'ppc64',
1107 perlasm_scheme => "linux64le",
1108 },
1109
1110 # riscv below refers to contemporary RISCV Architecture
1111 # specifications,
1112 "BSD-riscv64" => {
1113 inherit_from => [ "BSD-generic64"],
1114 perlasm_scheme => "linux64",
1115 asm_arch => 'riscv64',
1116 },
1117
1118 "BSD-riscv32" => {
1119 inherit_from => [ "BSD-generic32"],
1120 perlasm_scheme => "linux32",
1121 asm_arch => 'riscv32',
1122 },
1123
1124 "BSD-armv4" => {
1125 ################################################################
1126 # Note that -march is not among compiler options in linux-armv4
1127 # target description. Not specifying one is intentional to give
1128 # you choice to:
1129 #
1130 # a) rely on your compiler default by not specifying one;
1131 # b) specify your target platform explicitly for optimal
1132 # performance, e.g. -march=armv6 or -march=armv7-a;
1133 # c) build "universal" binary that targets *range* of platforms
1134 # by specifying minimum and maximum supported architecture;
1135 #
1136 # As for c) option. It actually makes no sense to specify
1137 # maximum to be less than ARMv7, because it's the least
1138 # requirement for run-time switch between platform-specific
1139 # code paths. And without run-time switch performance would be
1140 # equivalent to one for minimum. Secondly, there are some
1141 # natural limitations that you'd have to accept and respect.
1142 # Most notably you can *not* build "universal" binary for
1143 # big-endian platform. This is because ARMv7 processor always
1144 # picks instructions in little-endian order. Another similar
1145 # limitation is that -mthumb can't "cross" -march=armv6t2
1146 # boundary, because that's where it became Thumb-2. Well, this
1147 # limitation is a bit artificial, because it's not really
1148 # impossible, but it's deemed too tricky to support. And of
1149 # course you have to be sure that your binutils are actually
1150 # up to the task of handling maximum target platform. With all
1151 # this in mind here is an example of how to configure
1152 # "universal" build:
1153 #
1154 # ./Configure BSD-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
1155 #
1156 inherit_from => [ "BSD-generic32" ],
1157 asm_arch => 'armv4',
1158 perlasm_scheme => "linux32",
1159 },
1160
1161 "bsdi-elf-gcc" => {
1162 inherit_from => [ "BASE_unix" ],
1163 CC => "gcc",
1164 CFLAGS => "-fomit-frame-pointer -O3 -Wall",
1165 lib_cppflags => "-DPERL5 -DL_ENDIAN",
1166 ex_libs => add("-ldl"),
1167 bn_ops => "BN_LLONG",
1168 asm_arch => 'x86',
1169 perlasm_scheme => "elf",
1170 thread_scheme => "(unknown)",
1171 dso_scheme => "dlfcn",
1172 shared_target => "bsd-gcc-shared",
1173 shared_cflag => "-fPIC",
1174 },
1175 #### *BSD-nodef
1176 "BSD-nodef-generic32" => {
1177 # As for thread cflag. Idea is to maintain "collective" set of
1178 # flags, which would cover all BSD flavors. -pthread applies
1179 # to them all, but is treated differently. OpenBSD expands is
1180 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
1181 # expands it as -lc_r, which has to be accompanied by explicit
1182 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
1183 # expands it as -lc_r, which seems to be sufficient?
1184 inherit_from => [ "BASE_unix" ],
1185 CC => "cc",
1186 CFLAGS => picker(default => "-Wall",
1187 debug => "-O0 -g",
1188 release => "-O3"),
1189 cflags => threads("-pthread"),
1190 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
1191 ex_libs => add(threads("-pthread")),
1192 enable => add("devcryptoeng"),
1193 bn_ops => "BN_LLONG",
1194 thread_scheme => "pthreads",
1195 dso_scheme => "dlfcn",
1196 shared_target => "bsd-gcc-nodef-shared",
1197 shared_cflag => "-fPIC",
1198 },
1199 "BSD-nodef-generic64" => {
1200 inherit_from => [ "BSD-nodef-generic32" ],
1201 bn_ops => "SIXTY_FOUR_BIT_LONG",
1202 },
1203
1204 "BSD-nodef-x86" => {
1205 inherit_from => [ "BSD-nodef-generic32" ],
1206 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1207 lib_cppflags => add("-DL_ENDIAN"),
1208 bn_ops => "BN_LLONG",
1209 asm_arch => 'x86',
1210 perlasm_scheme => "a.out",
1211 },
1212 "BSD-nodef-x86-elf" => {
1213 inherit_from => [ "BSD-nodef-x86" ],
1214 perlasm_scheme => "elf",
1215 },
1216
1217 "BSD-nodef-sparcv8" => {
1218 inherit_from => [ "BSD-nodef-generic32" ],
1219 cflags => add("-mcpu=v8"),
1220 lib_cppflags => add("-DB_ENDIAN"),
1221 asm_arch => 'sparcv8',
1222 perlasm_scheme => 'void',
1223 },
1224 "BSD-nodef-sparc64" => {
1225 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1226 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1227 # triggered by RIPEMD160 code.
1228 inherit_from => [ "BSD-nodef-generic64" ],
1229 lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1230 bn_ops => "BN_LLONG",
1231 asm_arch => 'sparcv9',
1232 perlasm_scheme => 'void',
1233 },
1234
1235 "BSD-nodef-ia64" => {
1236 inherit_from => [ "BSD-nodef-generic64" ],
1237 lib_cppflags => add("-DL_ENDIAN"),
1238 bn_ops => "SIXTY_FOUR_BIT_LONG",
1239 asm_arch => 'ia64',
1240 perlasm_scheme => 'void',
1241 },
1242
1243 "BSD-nodef-x86_64" => {
1244 inherit_from => [ "BSD-nodef-generic64" ],
1245 lib_cppflags => add("-DL_ENDIAN"),
1246 bn_ops => "SIXTY_FOUR_BIT_LONG",
1247 asm_arch => 'x86_64',
1248 perlasm_scheme => "elf",
1249 },
1250
1251 #### SCO/Caldera targets.
1252 #
1253 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1254 # Now we only have blended unixware-* as it's the only one used by ./config.
1255 # If you want to optimize for particular microarchitecture, bypass ./config
1256 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1257 # Note that not all targets include assembler support. Mostly because of
1258 # lack of motivation to support out-of-date platforms with out-of-date
1259 # compiler drivers and assemblers.
1260 #
1261 # UnixWare 2.0x fails destest with -O.
1262 "unixware-2.0" => {
1263 inherit_from => [ "BASE_unix" ],
1264 CC => "cc",
1265 cflags => threads("-Kthread"),
1266 lib_cppflags => "-DFILIO_H -DNO_STRINGS_H",
1267 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1268 thread_scheme => "uithreads",
1269 },
1270 "unixware-2.1" => {
1271 inherit_from => [ "BASE_unix" ],
1272 CC => "cc",
1273 CFLAGS => "-O",
1274 cflags => threads("-Kthread"),
1275 lib_cppflags => "-DFILIO_H",
1276 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1277 thread_scheme => "uithreads",
1278 },
1279 "unixware-7" => {
1280 inherit_from => [ "BASE_unix" ],
1281 CC => "cc",
1282 CFLAGS => "-O",
1283 cflags => combine("-Kalloca", threads("-Kthread")),
1284 lib_cppflags => "-DFILIO_H",
1285 ex_libs => add("-lsocket -lnsl"),
1286 thread_scheme => "uithreads",
1287 bn_ops => "BN_LLONG",
1288 asm_arch => 'x86',
1289 perlasm_scheme => "elf-1",
1290 dso_scheme => "dlfcn",
1291 shared_target => "svr5-shared",
1292 shared_cflag => "-Kpic",
1293 },
1294 "unixware-7-gcc" => {
1295 inherit_from => [ "BASE_unix" ],
1296 CC => "gcc",
1297 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1298 cppflags => add(threads("-D_REENTRANT")),
1299 lib_cppflags => add("-DL_ENDIAN -DFILIO_H"),
1300 ex_libs => add("-lsocket -lnsl"),
1301 bn_ops => "BN_LLONG",
1302 thread_scheme => "pthreads",
1303 asm_arch => 'x86',
1304 perlasm_scheme => "elf-1",
1305 dso_scheme => "dlfcn",
1306 shared_target => "gnu-shared",
1307 shared_cflag => "-fPIC",
1308 },
1309 # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
1310 "sco5-cc" => {
1311 inherit_from => [ "BASE_unix" ],
1312 cc => "cc",
1313 cflags => "-belf",
1314 ex_libs => add("-lsocket -lnsl"),
1315 thread_scheme => "(unknown)",
1316 asm_arch => 'x86',
1317 perlasm_scheme => "elf-1",
1318 dso_scheme => "dlfcn",
1319 shared_target => "svr3-shared",
1320 shared_cflag => "-Kpic",
1321 },
1322 "sco5-gcc" => {
1323 inherit_from => [ "BASE_unix" ],
1324 cc => "gcc",
1325 cflags => "-O3 -fomit-frame-pointer",
1326 ex_libs => add("-lsocket -lnsl"),
1327 bn_ops => "BN_LLONG",
1328 thread_scheme => "(unknown)",
1329 asm_arch => 'x86',
1330 perlasm_scheme => "elf-1",
1331 dso_scheme => "dlfcn",
1332 shared_target => "svr3-shared",
1333 shared_cflag => "-fPIC",
1334 },
1335
1336 #### IBM's AIX.
1337 # Below targets assume AIX >=5. Caveat lector. If you are accustomed
1338 # to control compilation "bitness" by setting $OBJECT_MODE environment
1339 # variable, then you should know that in OpenSSL case it's considered
1340 # only in ./config. Once configured, build procedure remains "deaf" to
1341 # current value of $OBJECT_MODE.
1342 "aix-common" => {
1343 inherit_from => [ "BASE_unix" ],
1344 template => 1,
1345 sys_id => "AIX",
1346 lib_cppflags => "-DB_ENDIAN",
1347 lflags => "-Wl,-bsvr4",
1348 thread_scheme => "pthreads",
1349 dso_scheme => "dlfcn",
1350 shared_target => "aix",
1351 module_ldflags => "-Wl,-G,-bsymbolic,-bnoentry",
1352 shared_ldflag => "-Wl,-G,-bsymbolic,-bnoentry",
1353 shared_defflag => "-Wl,-bE:",
1354 shared_fipsflag => "-Wl,-binitfini:_init:_cleanup",
1355 perl_platform => 'AIX',
1356 },
1357 "aix-gcc" => {
1358 inherit_from => [ "aix-common" ],
1359 CC => "gcc",
1360 CFLAGS => picker(debug => "-O0 -g",
1361 release => "-O"),
1362 cflags => add(threads("-pthread")),
1363 ex_libs => add(threads("-pthread")),
1364 bn_ops => "BN_LLONG RC4_CHAR",
1365 asm_arch => 'ppc32',
1366 perlasm_scheme => "aix32",
1367 shared_ldflag => add_before("-shared -static-libgcc"),
1368 AR => add("-X32"),
1369 RANLIB => add("-X32"),
1370 },
1371 "aix64-gcc" => {
1372 inherit_from => [ "aix-common" ],
1373 CC => "gcc",
1374 CFLAGS => picker(debug => "-O0 -g",
1375 release => "-O"),
1376 cflags => combine("-maix64", threads("-pthread")),
1377 ex_libs => add(threads("-pthread")),
1378 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1379 asm_arch => 'ppc64',
1380 perlasm_scheme => "aix64",
1381 shared_ldflag => add_before("-shared -static-libgcc"),
1382 shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
1383 AR => add("-X64"),
1384 RANLIB => add("-X64"),
1385 },
1386 "aix64-gcc-as" => {
1387 inherit_from => [ "aix64-gcc" ],
1388 perlasm_scheme => "aix64-as",
1389 },
1390 "aix-cc" => {
1391 inherit_from => [ "aix-common" ],
1392 CC => "cc",
1393 CFLAGS => picker(debug => "-O0 -g",
1394 release => "-O"),
1395 cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
1396 threads("-qthreaded")),
1397 cppflags => threads("-D_THREAD_SAFE"),
1398 ex_libs => add(threads("-lpthreads")),
1399 bn_ops => "BN_LLONG RC4_CHAR",
1400 asm_arch => 'ppc32',
1401 perlasm_scheme => "aix32",
1402 shared_cflag => "-qpic",
1403 AR => add("-X32"),
1404 RANLIB => add("-X32"),
1405 },
1406 "aix64-cc" => {
1407 inherit_from => [ "aix-common" ],
1408 CC => "cc",
1409 CFLAGS => picker(debug => "-O0 -g",
1410 release => "-O"),
1411 cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
1412 threads("-qthreaded")),
1413 cppflags => threads("-D_THREAD_SAFE"),
1414 ex_libs => add(threads("-lpthreads")),
1415 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1416 asm_arch => 'ppc64',
1417 perlasm_scheme => "aix64",
1418 dso_scheme => "dlfcn",
1419 shared_cflag => "-qpic",
1420 shared_extension => "64.so.\$(SHLIB_VERSION_NUMBER)",
1421 AR => add("-X64"),
1422 RANLIB => add("-X64"),
1423 },
1424
1425 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1426 "BS2000-OSD" => {
1427 inherit_from => [ "BASE_unix" ],
1428 CC => "c89",
1429 CFLAGS => "-O",
1430 cflags => "-XLLML -XLLMK -XL",
1431 cppflags => "-DCHARSET_EBCDIC",
1432 lib_cppflags => "-DB_ENDIAN",
1433 ex_libs => add("-lsocket -lnsl"),
1434 bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
1435 thread_scheme => "(unknown)",
1436 },
1437
1438 #### Visual C targets
1439 #
1440 # Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
1441 #
1442 # Note about /wd4090, disable warning C4090. This warning returns false
1443 # positives in some situations. Disabling it altogether masks both
1444 # legitimate and false cases, but as we compile on multiple platforms,
1445 # we rely on other compilers to catch legitimate cases.
1446 #
1447 # Also note that we force threads no matter what. Configuring "no-threads"
1448 # is ignored.
1449 #
1450 # UNICODE is defined in VC-common and applies to all targets. It used to
1451 # be an opt-in option for VC-WIN32, but not anymore. The original reason
1452 # was because ANSI API was *native* system interface for no longer
1453 # supported Windows 9x. Keep in mind that UNICODE only affects how
1454 # OpenSSL libraries interact with underlying OS, it doesn't affect API
1455 # that OpenSSL presents to application.
1456
1457 "VC-common" => {
1458 inherit_from => [ "BASE_Windows" ],
1459 template => 1,
1460 CC => "cl",
1461 CPP => '$(CC) /EP /C',
1462 CFLAGS => "/W3 /wd4090 /nologo",
1463 coutflag => "/Fo",
1464 LD => "link",
1465 LDFLAGS => "/nologo /debug",
1466 ldoutflag => "/out:",
1467 ldpostoutflag => "",
1468 ld_resp_delim => "\n",
1469 bin_lflags => "setargv.obj",
1470 makedepcmd => '$(CC) /Zs /showIncludes',
1471 makedep_scheme => 'VC',
1472 AR => "lib",
1473 ARFLAGS => "/nologo",
1474 aroutflag => "/out:",
1475 ar_resp_delim => "\n",
1476 RC => "rc",
1477 rcoutflag => "/fo",
1478 defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
1479 "UNICODE", "_UNICODE",
1480 "_CRT_SECURE_NO_DEPRECATE",
1481 "_WINSOCK_DEPRECATED_NO_WARNINGS"),
1482 lib_cflags => add("/Zi /Fdossl_static.pdb"),
1483 lib_defines => add("L_ENDIAN"),
1484 dso_cflags => "/Zi /Fddso.pdb",
1485 bin_cflags => "/Zi /Fdapp.pdb",
1486 # def_flag made to empty string so a .def file gets generated
1487 shared_defflag => '',
1488 shared_ldflag => "/dll",
1489 shared_target => "win-shared", # meaningless except it gives Configure a hint
1490 lddefflag => "/def:",
1491 ldresflag => " ",
1492 ld_implib_flag => "/implib:",
1493 thread_scheme => "winthreads",
1494 dso_scheme => "win32",
1495 perl_platform => 'Windows::MSVC',
1496 # additional parameter to build_scheme denotes install-path "flavour"
1497 build_scheme => add("VC-common", { separator => undef }),
1498 },
1499 "VC-noCE-common" => {
1500 inherit_from => [ "VC-common" ],
1501 template => 1,
1502 CFLAGS => add(picker(debug => '/Od',
1503 release => '/O2')),
1504 cflags => add(picker(default => '/Gs0 /GF /Gy',
1505 debug =>
1506 sub {
1507 ($disabled{shared} ? "" : "/MDd");
1508 },
1509 release =>
1510 sub {
1511 ($disabled{shared} ? "" : "/MD");
1512 })),
1513 defines => add(picker(default => [], # works as type cast
1514 debug => [ "DEBUG", "_DEBUG" ])),
1515 lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
1516 # Following might/should appears controversial, i.e. defining
1517 # /MDd without evaluating $disabled{shared}. It works in
1518 # non-shared build because static library is compiled with /Zl
1519 # and bares no reference to specific RTL. And it works in
1520 # shared build because multiple /MDd options are not prohibited.
1521 # But why /MDd in static build? Well, basically this is just a
1522 # reference point, which allows to catch eventual errors that
1523 # would prevent those who want to wrap OpenSSL into own .DLL.
1524 # Why not /MD in release build then? Well, some are likely to
1525 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1526 # redistributable.
1527 bin_cflags => add(picker(debug => "/MDd",
1528 release => sub { $disabled{shared} ? "/MT" : () },
1529 )),
1530 bin_lflags => add("/subsystem:console /opt:ref"),
1531 ex_libs => add(sub {
1532 my @ex_libs = ();
1533 push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
1534 push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
1535 return join(" ", @ex_libs);
1536 }),
1537 },
1538 "VC-WIN64-common" => {
1539 inherit_from => [ "VC-noCE-common" ],
1540 template => 1,
1541 ex_libs => add(sub {
1542 my @ex_libs = ();
1543 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1544 return join(" ", @_, @ex_libs);
1545 }),
1546 bn_ops => add("SIXTY_FOUR_BIT"),
1547 },
1548 "VC-WIN64I" => {
1549 inherit_from => [ "VC-WIN64-common" ],
1550 AS => "ias",
1551 ASFLAGS => "-d debug",
1552 asoutflag => "-o ",
1553 sys_id => "WIN64I",
1554 uplink_arch => 'ia64',
1555 asm_arch => 'ia64',
1556 perlasm_scheme => "ias",
1557 multilib => "-ia64",
1558 },
1559 "VC-WIN64A" => {
1560 inherit_from => [ "VC-WIN64-common" ],
1561 AS => sub { vc_win64a_info()->{AS} },
1562 ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} },
1563 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1564 asflags => sub { vc_win64a_info()->{asflags} },
1565 sys_id => "WIN64A",
1566 uplink_arch => 'x86_64',
1567 asm_arch => 'x86_64',
1568 perlasm_scheme => "auto",
1569 multilib => "-x64",
1570 },
1571 "VC-WIN32" => {
1572 inherit_from => [ "VC-noCE-common" ],
1573 AS => sub { vc_win32_info()->{AS} },
1574 ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
1575 asoutflag => sub { vc_win32_info()->{asoutflag} },
1576 asflags => sub { vc_win32_info()->{asflags} },
1577 sys_id => "WIN32",
1578 bn_ops => add("BN_LLONG"),
1579 uplink_arch => 'common',
1580 asm_arch => 'x86',
1581 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1582 # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
1583 # some installation path heuristics in windows-makefile.tmpl...
1584 build_scheme => add("VC-WOW", { separator => undef }),
1585 },
1586 "VC-CE" => {
1587 inherit_from => [ "VC-common" ],
1588 CFLAGS => add(picker(debug => "/Od",
1589 release => "/O1i")),
1590 CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
1591 LDFLAGS => add("/nologo /opt:ref"),
1592 cflags =>
1593 combine('/GF /Gy',
1594 sub { vc_wince_info()->{cflags}; },
1595 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1596 ? ($disabled{shared} ? " /MT" : " /MD")
1597 : " /MC"; }),
1598 cppflags => sub { vc_wince_info()->{cppflags}; },
1599 lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
1600 lib_cppflags => sub { vc_wince_info()->{cppflags}; },
1601 includes =>
1602 add(combine(sub { defined(env('WCECOMPAT'))
1603 ? '$(WCECOMPAT)/include' : (); },
1604 sub { defined(env('PORTSDK_LIBPATH'))
1605 ? '$(PORTSDK_LIBPATH)/../../include'
1606 : (); })),
1607 lflags => add(combine(sub { vc_wince_info()->{lflags}; },
1608 sub { defined(env('PORTSDK_LIBPATH'))
1609 ? "/entry:mainCRTstartup" : (); })),
1610 sys_id => "WINCE",
1611 bn_ops => add("BN_LLONG"),
1612 ex_libs => add(sub {
1613 my @ex_libs = ();
1614 push @ex_libs, 'ws2.lib' unless $disabled{sock};
1615 push @ex_libs, 'crypt32.lib';
1616 if (defined(env('WCECOMPAT'))) {
1617 my $x = '$(WCECOMPAT)/lib';
1618 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
1619 $x .= '/$(TARGETCPU)/wcecompatex.lib';
1620 } else {
1621 $x .= '/wcecompatex.lib';
1622 }
1623 push @ex_libs, $x;
1624 }
1625 push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
1626 if (defined(env('PORTSDK_LIBPATH')));
1627 push @ex_libs, '/nodefaultlib coredll.lib corelibc.lib'
1628 if (env('TARGETCPU') =~ /^X86|^ARMV4[IT]/);
1629 return join(" ", @ex_libs);
1630 }),
1631 },
1632
1633 #### MinGW
1634 "mingw-common" => {
1635 inherit_from => [ 'BASE_unix' ],
1636 template => 1,
1637 CC => "gcc",
1638 CFLAGS => picker(default => "-Wall",
1639 debug => "-g -O0",
1640 release => "-O3"),
1641 cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
1642 threads("-D_MT")),
1643 lib_cppflags => "-DL_ENDIAN",
1644 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1645 thread_scheme => "winthreads",
1646 dso_scheme => "win32",
1647 shared_target => "mingw-shared",
1648 shared_cppflags => add("_WINDLL"),
1649 shared_ldflag => "-static-libgcc",
1650
1651 perl_platform => 'mingw',
1652 },
1653 "mingw" => {
1654 inherit_from => [ "mingw-common" ],
1655 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1656 cflags => "-m32",
1657 sys_id => "MINGW32",
1658 bn_ops => add("BN_LLONG"),
1659 asm_arch => 'x86',
1660 uplink_arch => 'x86',
1661 perlasm_scheme => "coff",
1662 shared_rcflag => "--target=pe-i386",
1663 multilib => "",
1664 },
1665 "mingw64" => {
1666 # As for uplink_arch. Applink makes it possible to use
1667 # .dll compiled with one compiler with application compiled with
1668 # another compiler. It's possible to engage Applink support in
1669 # mingw64 build, but it's not done, because until mingw64
1670 # supports structured exception handling, one can't seriously
1671 # consider its binaries for using with non-mingw64 run-time
1672 # environment. And as mingw64 is always consistent with itself,
1673 # Applink is never engaged and can as well be omitted.
1674 inherit_from => [ "mingw-common" ],
1675 cflags => "-m64",
1676 sys_id => "MINGW64",
1677 bn_ops => add("SIXTY_FOUR_BIT"),
1678 asm_arch => 'x86_64',
1679 uplink_arch => undef,
1680 perlasm_scheme => "mingw64",
1681 shared_rcflag => "--target=pe-x86-64",
1682 multilib => "64",
1683 },
1684
1685 #### UEFI
1686 "UEFI" => {
1687 inherit_from => [ "BASE_unix" ],
1688 CC => "cc",
1689 CFLAGS => "-O",
1690 lib_cppflags => "-DL_ENDIAN",
1691 sys_id => "UEFI",
1692 },
1693 "UEFI-x86" => {
1694 inherit_from => [ "UEFI" ],
1695 asm_arch => 'x86',
1696 perlasm_scheme => "win32n",
1697 },
1698 "UEFI-x86_64" => {
1699 inherit_from => [ "UEFI" ],
1700 asm_arch => 'x86_64',
1701 perlasm_scheme => "nasm",
1702 },
1703
1704 #### UWIN
1705 "UWIN" => {
1706 inherit_from => [ "BASE_unix" ],
1707 CC => "cc",
1708 CFLAGS => "-O -Wall",
1709 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1710 sys_id => "UWIN",
1711 bn_ops => "BN_LLONG",
1712 dso_scheme => "win32",
1713 },
1714
1715 #### Cygwin
1716 "Cygwin-common" => {
1717 inherit_from => [ "BASE_unix" ],
1718 template => 1,
1719
1720 CC => "gcc",
1721 CFLAGS => picker(default => "-Wall",
1722 debug => "-g -O0",
1723 release => "-O3"),
1724 ex_libs => add("-lcrypt32"),
1725 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1726 sys_id => "CYGWIN",
1727 thread_scheme => "pthread",
1728 dso_scheme => "dlfcn",
1729 shared_target => "cygwin-shared",
1730 shared_cppflags => "-D_WINDLL",
1731
1732 perl_platform => 'Cygwin',
1733 },
1734 "Cygwin-x86" => {
1735 inherit_from => [ "Cygwin-common" ],
1736 CFLAGS => add(picker(release => "-O3 -fomit-frame-pointer")),
1737 bn_ops => "BN_LLONG",
1738 asm_arch => 'x86',
1739 perlasm_scheme => "coff",
1740 },
1741 "Cygwin-x86_64" => {
1742 inherit_from => [ "Cygwin-common" ],
1743 CC => "gcc",
1744 bn_ops => "SIXTY_FOUR_BIT_LONG",
1745 asm_arch => 'x86_64',
1746 perlasm_scheme => "mingw64",
1747 },
1748 # Backward compatibility for those using this target
1749 "Cygwin" => {
1750 inherit_from => [ "Cygwin-x86" ]
1751 },
1752 # In case someone constructs the Cygwin target name themself
1753 "Cygwin-i386" => {
1754 inherit_from => [ "Cygwin-x86" ]
1755 },
1756 "Cygwin-i486" => {
1757 inherit_from => [ "Cygwin-x86" ]
1758 },
1759 "Cygwin-i586" => {
1760 inherit_from => [ "Cygwin-x86" ]
1761 },
1762 "Cygwin-i686" => {
1763 inherit_from => [ "Cygwin-x86" ]
1764 },
1765
1766 ##### MacOS X (a.k.a. Darwin) setup
1767 "darwin-common" => {
1768 inherit_from => [ "BASE_unix" ],
1769 template => 1,
1770 CC => "cc",
1771 CFLAGS => picker(debug => "-g -O0",
1772 release => "-O3"),
1773 cppflags => threads("-D_REENTRANT"),
1774 lflags => add("-Wl,-search_paths_first"),
1775 sys_id => "MACOSX",
1776 bn_ops => "BN_LLONG RC4_CHAR",
1777 thread_scheme => "pthreads",
1778 perlasm_scheme => "osx32",
1779 dso_scheme => "dlfcn",
1780 ranlib => "ranlib -c",
1781 shared_target => "darwin-shared",
1782 shared_cflag => "-fPIC",
1783 shared_extension => ".\$(SHLIB_VERSION_NUMBER).dylib",
1784 },
1785 # Option "freeze" such as -std=gnu9x can't negatively interfere
1786 # with future defaults for below two targets, because MacOS X
1787 # for PPC has no future, it was discontinued by vendor in 2009.
1788 "darwin-ppc-cc" => { inherit_from => [ "darwin-ppc" ] }, # Historic alias
1789 "darwin-ppc" => {
1790 inherit_from => [ "darwin-common" ],
1791 cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
1792 lib_cppflags => add("-DB_ENDIAN"),
1793 shared_cflag => add("-fno-common"),
1794 asm_arch => 'ppc32',
1795 perlasm_scheme => "osx32",
1796 },
1797 "darwin64-ppc-cc" => { inherit_from => [ "darwin64-ppc" ] }, # Historic alias
1798 "darwin64-ppc" => {
1799 inherit_from => [ "darwin-common" ],
1800 cflags => add("-arch ppc64 -std=gnu9x"),
1801 lib_cppflags => add("-DB_ENDIAN"),
1802 bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
1803 asm_arch => 'ppc64',
1804 perlasm_scheme => "osx64",
1805 },
1806 "darwin-i386-cc" => { inherit_from => [ "darwin-i386" ] }, # Historic alias
1807 "darwin-i386" => {
1808 inherit_from => [ "darwin-common" ],
1809 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1810 cflags => add("-arch i386"),
1811 lib_cppflags => add("-DL_ENDIAN"),
1812 bn_ops => "BN_LLONG RC4_INT",
1813 asm_arch => 'x86',
1814 perlasm_scheme => "macosx",
1815 },
1816 "darwin64-x86_64-cc" => { inherit_from => [ "darwin64-x86_64" ] }, # Historic alias
1817 "darwin64-x86_64" => {
1818 inherit_from => [ "darwin-common" ],
1819 CFLAGS => add("-Wall"),
1820 cflags => add("-arch x86_64"),
1821 lib_cppflags => add("-DL_ENDIAN"),
1822 bn_ops => "SIXTY_FOUR_BIT_LONG",
1823 asm_arch => 'x86_64',
1824 perlasm_scheme => "macosx",
1825 },
1826 "darwin64-arm64-cc" => { inherit_from => [ "darwin64-arm64" ] }, # "Historic" alias
1827 "darwin64-arm64" => {
1828 inherit_from => [ "darwin-common" ],
1829 CFLAGS => add("-Wall"),
1830 cflags => add("-arch arm64"),
1831 lib_cppflags => add("-DL_ENDIAN"),
1832 bn_ops => "SIXTY_FOUR_BIT_LONG",
1833 asm_arch => 'aarch64',
1834 perlasm_scheme => "ios64",
1835 },
1836
1837 ##### GNU Hurd
1838 "hurd-x86" => {
1839 inherit_from => [ "BASE_unix" ],
1840 CC => "gcc",
1841 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1842 cflags => threads("-pthread"),
1843 lib_cppflags => "-DL_ENDIAN",
1844 ex_libs => add("-ldl", threads("-pthread")),
1845 bn_ops => "BN_LLONG",
1846 asm_arch => 'x86',
1847 perlasm_scheme => 'elf',
1848 thread_scheme => "pthreads",
1849 dso_scheme => "dlfcn",
1850 shared_target => "linux-shared",
1851 shared_cflag => "-fPIC",
1852 },
1853
1854 ##### VxWorks for various targets
1855 "vxworks-ppc60x" => {
1856 inherit_from => [ "BASE_unix" ],
1857 CC => "ccppc",
1858 CFLAGS => "-O2 -Wall -fstrength-reduce",
1859 cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-aliasing",
1860 cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
1861 "_DTOOL_FAMILY=gnu -DTOOL=gnu",
1862 "-I\$(WIND_BASE)/target/usr/h",
1863 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1864 sys_id => "VXWORKS",
1865 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1866 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1867 },
1868 "vxworks-ppcgen" => {
1869 inherit_from => [ "BASE_unix" ],
1870 CC => "ccppc",
1871 CFLAGS => "-O1 -Wall",
1872 cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
1873 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
1874 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1875 "-I\$(WIND_BASE)/target/usr/h",
1876 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1877 sys_id => "VXWORKS",
1878 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1879 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1880 },
1881 "vxworks-ppc405" => {
1882 inherit_from => [ "BASE_unix" ],
1883 CC => "ccppc",
1884 CFLAGS => "-g",
1885 cflags => "-msoft-float -mlongcall",
1886 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
1887 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1888 "-I\$(WIND_BASE)/target/h"),
1889 sys_id => "VXWORKS",
1890 lflags => add("-r"),
1891 },
1892 "vxworks-ppc750" => {
1893 inherit_from => [ "BASE_unix" ],
1894 CC => "ccppc",
1895 CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
1896 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1897 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1898 "-I\$(WIND_BASE)/target/h"),
1899 sys_id => "VXWORKS",
1900 lflags => add("-r"),
1901 },
1902 "vxworks-ppc750-debug" => {
1903 inherit_from => [ "BASE_unix" ],
1904 CC => "ccppc",
1905 CFLAGS => "-ansi -fvolatile -Wall -g",
1906 cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1907 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1908 "-DPEDANTIC -DDEBUG",
1909 "-I\$(WIND_BASE)/target/h"),
1910 sys_id => "VXWORKS",
1911 lflags => add("-r"),
1912 },
1913 "vxworks-ppc860" => {
1914 inherit_from => [ "BASE_unix" ],
1915 CC => "ccppc",
1916 cflags => "-nostdinc -msoft-float",
1917 cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
1918 "-I\$(WIND_BASE)/target/h"),
1919 sys_id => "VXWORKS",
1920 lflags => add("-r"),
1921 },
1922 "vxworks-simlinux" => {
1923 inherit_from => [ "BASE_unix" ],
1924 CC => "ccpentium",
1925 cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-pop",
1926 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1927 "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
1928 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1929 "-DOPENSSL_NO_HW_PADLOCK",
1930 "-I\$(WIND_BASE)/target/h",
1931 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1932 sys_id => "VXWORKS",
1933 lflags => add("-r"),
1934 ranlib => "ranlibpentium",
1935 },
1936 "vxworks-mips" => {
1937 inherit_from => [ "BASE_unix" ],
1938 CC => "ccmips",
1939 CFLAGS => "-O -G 0",
1940 cflags => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno-branch-likely -fno-builtin -fno-defer-pop",
1941 cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1942 "-DCPU=MIPS32 -DNO_STRINGS_H",
1943 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1944 "-DOPENSSL_NO_HW_PADLOCK",
1945 threads("-D_REENTRANT"),
1946 "-I\$(WIND_BASE)/target/h",
1947 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1948 sys_id => "VXWORKS",
1949 lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1950 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1951 thread_scheme => "pthreads",
1952 asm_arch => 'mips32',
1953 perlasm_scheme => "o32",
1954 ranlib => "ranlibmips",
1955 },
1956
1957 #### uClinux
1958 "uClinux-dist" => {
1959 inherit_from => [ "BASE_unix" ],
1960 CC => sub { env('CC') },
1961 cppflags => threads("-D_REENTRANT"),
1962 ex_libs => add("\$(LDLIBS)"),
1963 bn_ops => "BN_LLONG",
1964 thread_scheme => "pthreads",
1965 dso_scheme => sub { env('LIBSSL_dlfcn') },
1966 shared_target => "linux-shared",
1967 shared_cflag => "-fPIC",
1968 ranlib => sub { env('RANLIB') },
1969 },
1970 "uClinux-dist64" => {
1971 inherit_from => [ "BASE_unix" ],
1972 CC => sub { env('CC') },
1973 cppflags => threads("-D_REENTRANT"),
1974 ex_libs => add("\$(LDLIBS)"),
1975 bn_ops => "SIXTY_FOUR_BIT_LONG",
1976 thread_scheme => "pthreads",
1977 dso_scheme => sub { env('LIBSSL_dlfcn') },
1978 shared_target => "linux-shared",
1979 shared_cflag => "-fPIC",
1980 ranlib => sub { env('RANLIB') },
1981 },
1982
1983 ##### VMS
1984 # Most things happen in vms-generic.
1985 # Note that vms_info extracts the pointer size from the end of
1986 # the target name, and will assume that anything matching /-p\d+$/
1987 # indicates the pointer size setting for the desired target.
1988 "vms-generic" => {
1989 inherit_from => [ "BASE_VMS" ],
1990 template => 1,
1991 CC => "CC/DECC",
1992 CPP => '$(CC)/PREPROCESS_ONLY=SYS$OUTPUT:',
1993 CFLAGS =>
1994 combine(picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
1995 debug => "/NOOPTIMIZE/DEBUG",
1996 release => "/OPTIMIZE/NODEBUG"),
1997 sub { my @warnings =
1998 @{vms_info()->{disable_warns}};
1999 @warnings
2000 ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
2001 cflag_incfirst => '/FIRST_INCLUDE=',
2002 lib_defines =>
2003 add("OPENSSL_USE_NODELETE",
2004 sub {
2005 return vms_info()->{def_zlib}
2006 ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
2007 }),
2008 lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'",
2009 debug => "/DEBUG/TRACEBACK",
2010 release => "/NODEBUG/NOTRACEBACK"),
2011 # Because of dso_cflags below, we can't set the generic |cflags| here,
2012 # as it can't be overridden, so we set separate C flags for libraries
2013 # and binaries instead.
2014 bin_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
2015 lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
2016 # Strictly speaking, DSOs should not need to have name shortening,
2017 # as all their exported symbols should be short enough to fit the
2018 # linker's 31 character per symbol name limit. However, providers
2019 # may be composed of more than one object file, and internal symbols
2020 # may and do surpass the 31 character limit.
2021 dso_cflags => add("/NAMES=(SHORTENED)"),
2022 ex_libs => add(sub { return vms_info()->{zlib} || (); }),
2023 shared_target => "vms-shared",
2024 # def_flag made to empty string so a .opt file gets generated
2025 shared_defflag => '',
2026 dso_scheme => "vms",
2027 thread_scheme => "pthreads",
2028
2029 makedep_scheme => 'VMS C',
2030 AS => sub { vms_info()->{AS} },
2031 ASFLAGS => sub { vms_info()->{ASFLAGS} },
2032 asoutflag => sub { vms_info()->{asoutflag} },
2033 asflags => sub { vms_info()->{asflags} },
2034 perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
2035
2036 disable => add('pinshared', 'loadereng'),
2037
2038 },
2039
2040 # From HELP CC/POINTER_SIZE:
2041 #
2042 # ----------
2043 # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
2044 # LONG or 64 is present, the main argument argv will be an
2045 # array of long pointers instead of an array of short pointers.
2046 #
2047 # 64[=ARGV] Same as LONG.
2048 # ----------
2049 #
2050 # We don't want the hassle of dealing with 32-bit pointers with argv, so
2051 # we force it to have 64-bit pointers, see the added cflags in the -p64
2052 # config targets below.
2053
2054 "vms-alpha" => {
2055 inherit_from => [ "vms-generic" ],
2056 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
2057 pointer_size => "",
2058 },
2059 "vms-alpha-p32" => {
2060 inherit_from => [ "vms-alpha" ],
2061 cflags => add("/POINTER_SIZE=32"),
2062 pointer_size => "32",
2063 },
2064 "vms-alpha-p64" => {
2065 inherit_from => [ "vms-alpha" ],
2066 cflags => add("/POINTER_SIZE=64=ARGV"),
2067 pointer_size => "64",
2068 },
2069 "vms-ia64" => {
2070 inherit_from => [ "vms-generic" ],
2071 bn_ops => "SIXTY_FOUR_BIT RC4_INT",
2072 asm_arch => sub { vms_info()->{AS} ? 'ia64' : undef },
2073 perlasm_scheme => 'ias',
2074 pointer_size => "",
2075
2076 },
2077 "vms-ia64-p32" => {
2078 inherit_from => [ "vms-ia64" ],
2079 cflags => add("/POINTER_SIZE=32"),
2080 pointer_size => "32",
2081 },
2082 "vms-ia64-p64" => {
2083 inherit_from => [ "vms-ia64" ],
2084 cflags => add("/POINTER_SIZE=64=ARGV"),
2085 pointer_size => "64",
2086 },
2087 "vms-x86_64" => {
2088 inherit_from => [ "vms-generic" ],
2089 bn_ops => "SIXTY_FOUR_BIT",
2090 pointer_size => "",
2091 }
2092 );