Lines Matching +full:gcc +full:- +full:mips +full:- +full:linux +full:- +full:gnu
1 ## -*- mode: perl; -*-
8 if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
10 ASFLAGS => "-g",
11 asflags => "-Ox -f win64 -DNEAR",
12 asoutflag => "-o " };
20 $die->("NASM not found - make sure it's installed and available on %PATH%\n");
33 my $ver=`nasm -v 2>NUL`;
34 my $vew=`nasmw -v 2>NUL`;
38 asflags => "-f win32",
39 asoutflag => "-o ",
49 $die->("NASM not found - make sure it's installed and available on %PATH%\n");
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')));
74 if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
78 $die->('%OSVERSION% value is insane');
82 my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
87 $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
88 $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
92 /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
94 /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
95 $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
96 $wcecdefs.=" -QRarch4T -QRinterwork-return";
98 /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
100 /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
101 $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
103 /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
104 $wcecdefs.=" -DMIPSII -QMmips16";
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/);
114 { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
127 my $pointer_size_str = $config{target} =~ m|-p(\d+)$| ? $1 : "";
132 if (%$vms_info && $vms_info->{pointer_size} ne $pointer_size_str) {
137 $vms_info->{disable_warns} = [
140 $vms_info->{pointer_size} = $pointer_size_str;
144 push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
150 if (defined($disabled{"zlib-dynamic"})) {
151 $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
153 $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
154 # In case the --with-zlib-lib value contains something like
156 $vms_info->{def_zlib} =~ s|/.*$||g;
160 if ($config{target} =~ /-ia64/) {
161 `PIPE ias -H 2> NL:`;
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";
176 #### Basic configs that should work on any 32-bit box
177 "gcc" => {
179 CC => "gcc",
180 CFLAGS => picker(debug => "-O0 -g",
181 release => "-O3"),
188 CFLAGS => "-O",
193 "vos-gcc" => {
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",
203 lflags => add("-Wl,-map"),
209 "solaris-common" => {
212 lib_cppflags => "-DFILIO_H",
213 ex_libs => add("-lsocket -lnsl -ldl"),
218 "solaris-common-cc" => {
219 inherit_from => [ "solaris-common" ],
222 shared_ldflag => "-Wl,-Bsymbolic",
223 shared_defflag => "-Wl,-M,",
224 shared_sonameflag=> "-Wl,-h,",
226 #### Solaris common with GNU C setups
227 "solaris-common-gcc" => {
228 inherit_from => [ "solaris-common" ],
230 shared_target => "solaris-gcc-shared", # The rest is on shared_info.pl
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
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 cflags => add(threads("-pthread")),
243 lib_cppflags => add("-DL_ENDIAN"),
244 ex_libs => add(threads("-pthread")),
246 shared_cflag => "-fPIC",
247 shared_ldflag => add_before("-shared -static-libgcc"),
251 "solaris64-x86_64-gcc" => {
252 # -shared -static-libgcc might appear controversial, but modules
256 # gcc shared build with Sun C. Given that gcc generates faster
258 # to consider using gcc shared build even with vendor compiler:-)
259 # -- <appro@openssl.org>
260 inherit_from => [ "solaris-common-gcc" ],
261 CC => "gcc",
262 CFLAGS => add_before(picker(default => "-Wall",
263 debug => "-O0 -g",
264 release => "-O3")),
265 cflags => add_before("-m64", threads("-pthread")),
266 lib_cppflags => add("-DL_ENDIAN"),
267 ex_libs => add(threads("-pthread")),
271 shared_cflag => "-fPIC",
272 shared_ldflag => add_before("-shared -static-libgcc"),
277 # There used to be solaris-x86-cc target, but it was removed,
279 # with -KPIC flag. As result it, assembly support, was not even
280 # available as option. But its lack means lack of side-channel
282 # standards. Fortunately gcc is readily available prepackaged
285 # On related note, solaris64-x86_64-cc target won't compile code
286 # paths utilizing AVX and post-Haswell instruction extensions.
287 # Consider switching to solaris64-x86_64-gcc even here...
289 "solaris64-x86_64-cc" => {
290 inherit_from => [ "solaris-common-cc" ],
292 CFLAGS => add_before(picker(debug => "-g",
293 release => "-xO5 -xdepend -xbuiltin")),
294 cflags => add_before("-xarch=generic64 -xstrconst -Xa"),
295 cppflags => add(threads("-D_REENTRANT")),
296 lib_cppflags => add("-DL_ENDIAN"),
298 lflags => add(threads("-mt")),
299 ex_libs => add(threads("-lpthread")),
303 shared_cflag => "-KPIC",
304 shared_ldflag => add_before("-G -dy -z text"),
308 #### SPARC Solaris with GNU C setups
309 "solaris-sparcv7-gcc" => {
310 inherit_from => [ "solaris-common-gcc" ],
311 CC => "gcc",
312 CFLAGS => add_before(picker(default => "-Wall",
313 debug => "-O0 -g",
314 release => "-O3")),
315 cflags => add(threads("-pthread")),
316 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
317 ex_libs => add(threads("-pthread")),
319 shared_cflag => "-fPIC",
320 shared_ldflag => add_before("-shared"),
322 "solaris-sparcv8-gcc" => {
323 inherit_from => [ "solaris-sparcv7-gcc" ],
324 cflags => add_before("-mcpu=v8"),
328 "solaris-sparcv9-gcc" => {
329 # -m32 should be safe to add as long as driver recognizes
330 # -mcpu=ultrasparc
331 inherit_from => [ "solaris-sparcv7-gcc" ],
332 cflags => add_before("-m32 -mcpu=ultrasparc"),
336 "solaris64-sparcv9-gcc" => {
337 inherit_from => [ "solaris-sparcv9-gcc" ],
338 cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
345 # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
346 # SC5.0 note: Compiler common patch 107357-01 or later is required!
347 "solaris-sparcv7-cc" => {
348 inherit_from => [ "solaris-common-cc" ],
350 CFLAGS => add_before(picker(debug => "-g",
351 release => "-xO5 -xdepend")),
352 cflags => add_before("-xstrconst -Xa"),
353 cppflags => add(threads("-D_REENTRANT")),
354 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
355 lflags => add(threads("-mt")),
356 ex_libs => add(threads("-lpthread")),
358 shared_cflag => "-KPIC",
359 shared_ldflag => add_before("-G -dy -z text"),
362 "solaris-sparcv8-cc" => {
363 inherit_from => [ "solaris-sparcv7-cc" ],
364 cflags => add_before("-xarch=v8"),
368 "solaris-sparcv9-cc" => {
369 inherit_from => [ "solaris-sparcv7-cc" ],
370 cflags => add_before("-xarch=v8plus"),
374 "solaris64-sparcv9-cc" => {
375 inherit_from => [ "solaris-sparcv7-cc" ],
376 cflags => add_before("-m64 -xarch=sparc"),
385 "irix-common" => {
388 cppflags => threads("-D_SGI_MP_SOURCE"),
389 lib_cppflags => "-DB_ENDIAN",
390 ex_libs => add(threads("-lpthread")),
394 shared_ldflag => "-shared -Wl,-Bsymbolic",
395 shared_sonameflag=> "-Wl,-soname,",
397 "irix-mips3-gcc" => {
398 inherit_from => [ "irix-common" ],
399 CC => "gcc",
400 CFLAGS => picker(debug => "-g -O0",
401 release => "-O3"),
402 LDFLAGS => "-static-libgcc",
403 cflags => "-mabi=n32",
409 "irix-mips3-cc" => {
410 inherit_from => [ "irix-common" ],
412 CFLAGS => picker(debug => "-g -O0",
413 release => "-O2"),
414 cflags => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared",
421 "irix64-mips4-gcc" => {
422 inherit_from => [ "irix-common" ],
423 CC => "gcc",
424 CFLAGS => picker(debug => "-g -O0",
425 release => "-O3"),
426 LDFLAGS => "-static-libgcc",
427 cflags => "-mabi=64 -mips4",
433 "irix64-mips4-cc" => {
434 inherit_from => [ "irix-common" ],
436 CFLAGS => picker(debug => "-g -O0",
437 release => "-O2"),
438 cflags => "-64 -mips4 -use_readonly_const -G0 -rdata_shared",
445 #### Unified HP-UX ANSI C configs.
447 # - Originally we were optimizing at +O4 level. It should be noted
448 # that the only difference between +O3 and +O4 is global inter-
450 # stage the compiler leaves behind certain pseudo-code in lib*.a
455 # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
458 # - Keep in mind that the HP compiler by default generates code
460 # If the toolkit is meant to be used on various PA-RISC processors
461 # consider './Configure hpux-parisc-[g]cc +DAportable'.
462 # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
463 # 32-bit message digests. (For the moment of this writing) HP C
465 # chew forever:-). For more details look-up MD32_XARRAY comment in
467 # - originally there were 32-bit hpux-parisc2-* targets. They were
468 # scrapped, because a) they were not interchangeable with other 32-bit
469 # targets; b) performance-critical 32-bit assembly modules implement
470 # even PA-RISC 2.0-specific code paths, which are chosen at run-time,
471 # thus adequate performance is provided even with PA-RISC 1.1 build.
472 "hpux-common" => {
477 lib_cppflags => "-DB_ENDIAN",
479 dso_scheme => "dlfcn", # overridden in 32-bit PA-RISC builds
481 bin_lflags => "-Wl,+s,+cdp,../:,+cdp,./:",
482 shared_ldflag => "-Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+cdp,../:,+cdp,./:",
483 shared_sonameflag=> "-Wl,+h,",
485 "hpux-parisc-gcc" => {
486 inherit_from => [ "hpux-common" ],
487 CC => "gcc",
488 CFLAGS => picker(debug => "-O0 -g",
489 release => "-O3"),
490 cflags => add(threads("-pthread")),
491 lib_cppflags => add("-DBN_DIV2W"),
492 ex_libs => add("-ldld", threads("-pthread")),
495 shared_cflag => "-fPIC",
496 shared_ldflag => add_before("-shared"),
499 "hpux-parisc1_1-gcc" => {
500 inherit_from => [ "hpux-parisc-gcc" ],
505 "hpux64-parisc2-gcc" => {
506 inherit_from => [ "hpux-common" ],
507 CC => "gcc",
508 CFLAGS => combine(picker(debug => "-O0 -g",
509 release => "-O3")),
510 cflags => add(threads("-pthread")),
511 ex_libs => add("-ldl", threads("-pthread")),
515 shared_cflag => "-fpic",
516 shared_ldflag => add_before("-shared"),
522 "hpux-parisc-cc" => {
523 inherit_from => [ "hpux-common" ],
525 CFLAGS => picker(debug => "+O0 +d -g",
527 cflags => "+Optrs_strongly_typed -Ae +ESlit",
528 cppflags => threads("-D_REENTRANT"),
529 lib_cppflags => add("-DBN_DIV2W -DMD32_XARRAY"),
530 ex_libs => add("-ldld", threads("-lpthread")),
534 shared_ldflag => add_before("-b"),
537 "hpux-parisc1_1-cc" => {
538 inherit_from => [ "hpux-parisc-cc" ],
544 "hpux64-parisc2-cc" => {
545 inherit_from => [ "hpux-common" ],
547 CFLAGS => picker(debug => "+O0 +d -g",
549 cflags => "+DD64 +Optrs_strongly_typed -Ae +ESlit",
550 cppflags => threads("-D_REENTRANT") ,
551 lib_cppflags => add("-DMD32_XARRAY"),
552 ex_libs => add("-ldl", threads("-lpthread")),
557 shared_ldflag => add_before("-b"),
562 # HP/UX IA-64 targets
563 "hpux-ia64-cc" => {
564 inherit_from => [ "hpux-common" ],
566 CFLAGS => picker(debug => "+O0 +d -g",
568 cflags => "-Ae +DD32 +Olit=all -z",
569 cppflags => add(threads("-D_REENTRANT")),
570 ex_libs => add("-ldl", threads("-lpthread")),
575 shared_ldflag => add_before("-b"),
578 "hpux64-ia64-cc" => {
579 inherit_from => [ "hpux-common" ],
581 CFLAGS => picker(debug => "+O0 +d -g",
583 cflags => "-Ae +DD64 +Olit=all -z",
584 cppflags => threads("-D_REENTRANT"),
585 ex_libs => add("-ldl", threads("-lpthread")),
590 shared_ldflag => add_before("-b"),
593 # GCC builds...
594 "hpux-ia64-gcc" => {
595 inherit_from => [ "hpux-common" ],
596 CC => "gcc",
597 CFLAGS => picker(debug => "-O0 -g",
598 release => "-O3"),
599 cflags => add(threads("-pthread")),
600 ex_libs => add("-ldl", threads("-pthread")),
604 shared_cflag => "-fpic",
605 shared_ldflag => add_before("-shared"),
608 "hpux64-ia64-gcc" => {
609 inherit_from => [ "hpux-common" ],
610 CC => "gcc",
611 CFLAGS => picker(debug => "-O0 -g",
612 release => "-O3"),
613 cflags => combine("-mlp64", threads("-pthread")),
614 ex_libs => add("-ldl", threads("-pthread")),
618 shared_cflag => "-fpic",
619 shared_ldflag => add_before("-shared"),
624 "MPE/iX-gcc" => {
626 CC => "gcc",
627 CFLAGS => "-O3",
628 cppflags => "-D_POSIX_SOURCE -D_SOCKET_SOURCE",
630 lib_cppflags => "-DBN_DIV2W",
632 lflags => add("-L/SYSLOG/PUB"),
633 ex_libs => add("-lsyslog -lsocket -lcurses"),
639 #### and forward. In reality 'uname -s' still returns "OSF1". Originally
640 #### there were even osf1-* configs targeting prior versions provided,
642 "tru64-alpha-gcc" => {
644 CC => "gcc",
645 CFLAGS => "-O3",
646 cflags => add("-std=c9x", threads("-pthread")),
647 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
648 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
654 shared_target => "alpha-osf1-shared",
657 "tru64-alpha-cc" => {
660 CFLAGS => "-tune host -fast",
661 cflags => add("-std1 -readonly_strings",
662 threads("-pthread")),
663 cppflags => "-D_XOPEN_SOURCE=500 -D_OSF_SOURCE",
664 ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
670 shared_target => "alpha-osf1-shared",
671 shared_ldflag => "-msym",
676 #### Variety of LINUX:-)
678 # *-generic* is endian-neutral target, but ./config is free to
679 # throw in -D[BL]_ENDIAN, whichever appropriate...
680 "linux-generic32" => {
682 CC => "gcc",
684 CFLAGS => picker(default => "-Wall",
685 debug => "-O0 -g",
686 release => "-O3"),
687 CXXFLAGS => picker(default => "-Wall",
688 debug => "-O0 -g",
689 release => "-O3"),
690 cflags => threads("-pthread"),
691 cxxflags => combine("-std=c++11", threads("-pthread")),
692 lib_cppflags => "-DOPENSSL_USE_NODELETE",
693 ex_libs => add("-ldl", threads("-pthread")),
697 shared_target => "linux-shared",
698 shared_cflag => "-fPIC",
699 shared_ldflag => sub { $disabled{pinshared} ? () : "-Wl,-znodelete" },
702 "linux-latomic" => {
703 inherit_from => [ "linux-generic32" ],
704 ex_libs => add(threads("-latomic")),
706 "linux-generic64" => {
707 inherit_from => [ "linux-generic32" ],
711 "linux-ppc" => {
712 inherit_from => [ "linux-latomic" ],
715 lib_cppflags => add("-DB_ENDIAN"),
717 "linux-ppc64" => {
718 inherit_from => [ "linux-generic64" ],
719 cflags => add("-m64"),
720 cxxflags => add("-m64"),
721 lib_cppflags => add("-DB_ENDIAN"),
726 "linux-ppc64le" => {
727 inherit_from => [ "linux-generic64" ],
728 cflags => add("-m64"),
729 cxxflags => add("-m64"),
730 lib_cppflags => add("-DL_ENDIAN"),
735 "linux-armv4" => {
737 # Note that -march is not among compiler options in linux-armv4
743 # performance, e.g. -march=armv6 or -march=armv7-a;
749 # requirement for run-time switch between platform-specific
750 # code paths. And without run-time switch performance would be
754 # big-endian platform. This is because ARMv7 processor always
755 # picks instructions in little-endian order. Another similar
756 # limitation is that -mthumb can't "cross" -march=armv6t2
757 # boundary, because that's where it became Thumb-2. Well, this
765 # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
767 inherit_from => [ "linux-latomic" ],
771 "linux-aarch64" => {
772 inherit_from => [ "linux-generic64" ],
776 "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
777 inherit_from => [ "linux-generic32" ],
778 cflags => add("-mabi=ilp32"),
779 cxxflags => add("-mabi=ilp32"),
785 "linux-mips32" => {
786 # Configure script adds minimally required -march for assembly
787 # support, if no -march was specified at command line.
788 inherit_from => [ "linux-latomic" ],
789 cflags => add("-mabi=32"),
790 cxxflags => add("-mabi=32"),
794 # mips32 and mips64 below refer to contemporary MIPS Architecture
796 "linux-mips64" => {
797 inherit_from => [ "linux-latomic" ],
798 cflags => add("-mabi=n32"),
799 cxxflags => add("-mabi=n32"),
805 "linux64-mips64" => {
806 inherit_from => [ "linux-generic64" ],
807 cflags => add("-mabi=64"),
808 cxxflags => add("-mabi=64"),
816 "linux64-riscv64" => {
817 inherit_from => [ "linux-generic64"],
823 "linux64-loongarch64" => {
824 inherit_from => [ "linux-generic64"],
827 lib_cppflags => add("-DL_ENDIAN"),
830 #### IA-32 targets...
831 #### These two targets are a bit aged and are to be used on older Linux
832 #### machines where gcc doesn't understand -m32 and -m64
833 "linux-elf" => {
834 inherit_from => [ "linux-generic32" ],
835 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
836 lib_cppflags => add("-DL_ENDIAN"),
841 "linux-aout" => {
843 CC => "gcc",
844 CFLAGS => add(picker(default => "-Wall",
845 debug => "-O0 -g",
846 release => "-O3 -fomit-frame-pointer")),
847 lib_cppflags => add("-DL_ENDIAN"),
855 "linux-x86" => {
856 inherit_from => [ "linux-generic32" ],
857 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
858 cflags => add("-m32"),
859 cxxflags => add("-m32"),
860 lib_cppflags => add("-DL_ENDIAN"),
865 "linux-x86-clang" => {
866 inherit_from => [ "linux-x86" ],
869 ex_libs => add(threads("-latomic")),
871 "linux-x86_64" => {
872 inherit_from => [ "linux-generic64" ],
873 cflags => add("-m64"),
874 cxxflags => add("-m64"),
875 lib_cppflags => add("-DL_ENDIAN"),
881 "linux-x86_64-clang" => {
882 inherit_from => [ "linux-x86_64" ],
886 "linux-x32" => {
887 inherit_from => [ "linux-generic32" ],
888 cflags => add("-mx32"),
889 cxxflags => add("-mx32"),
890 lib_cppflags => add("-DL_ENDIAN"),
897 "linux-ia64" => {
898 inherit_from => [ "linux-generic64" ],
904 "linux64-s390x" => {
905 inherit_from => [ "linux-generic64" ],
906 cflags => add("-m64"),
907 cxxflags => add("-m64"),
908 lib_cppflags => add("-DB_ENDIAN"),
913 "linux32-s390x" => {
915 # "Highgprs" is kernel feature first implemented in Linux
918 # upon 32-bit process context switch, but even on
920 # it possible to deploy 64-bit instructions even in legacy
923 # linux-generic32, and the idea is to be able to install the
925 # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
928 # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
930 inherit_from => [ "linux-generic32" ],
931 cflags => add("-m31 -Wa,-mzarch"),
932 cxxflags => add("-m31 -Wa,-mzarch"),
933 lib_cppflags => add("-DB_ENDIAN"),
939 #### SPARC Linux setups
940 "linux-sparcv8" => {
941 inherit_from => [ "linux-latomic" ],
942 cflags => add("-mcpu=v8"),
943 cxxflags => add("-mcpu=v8"),
944 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
948 "linux-sparcv9" => {
949 # it's a real mess with -mcpu=ultrasparc option under Linux,
950 # but -Wa,-Av8plus should do the trick no matter what.
951 inherit_from => [ "linux-latomic" ],
952 cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
953 cxxflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus"),
954 lib_cppflags => add("-DB_ENDIAN -DBN_DIV2W"),
958 "linux64-sparcv9" => {
959 # GCC 3.1 is a requirement
960 inherit_from => [ "linux-generic64" ],
961 cflags => add("-m64 -mcpu=ultrasparc"),
962 cxxflags => add("-m64 -mcpu=ultrasparc"),
963 lib_cppflags => add("-DB_ENDIAN"),
964 ex_libs => add(threads("-latomic")),
971 "linux-alpha-gcc" => {
972 inherit_from => [ "linux-generic64" ],
973 lib_cppflags => add("-DL_ENDIAN"),
978 "linux-c64xplus" => {
982 CFLAGS => "-o2 -ox -ms",
983 cflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
984 cxxflags => "--linux -ea=.s -eo=.o -mv6400+ -pden",
985 cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT",
986 threads("-D_REENTRANT")),
992 shared_target => "linux-shared",
993 shared_cflag => "--pic",
994 shared_ldflag => add("-z --sysv --shared"),
999 "BSD-generic32" => {
1001 # flags, which would cover all BSD flavors. -pthread applies
1003 # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
1004 # expands it as -lc_r, which has to be accompanied by explicit
1005 # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
1006 # expands it as -lc_r, which seems to be sufficient?
1009 CFLAGS => picker(default => "-Wall",
1010 debug => "-O0 -g",
1011 release => "-O3"),
1012 cflags => threads("-pthread"),
1013 cppflags => threads("-D_THREAD_SAFE -D_REENTRANT"),
1014 ex_libs => add(threads("-pthread")),
1019 shared_target => "bsd-gcc-shared",
1020 shared_cflag => "-fPIC",
1022 "BSD-generic64" => {
1023 inherit_from => [ "BSD-generic32" ],
1027 "BSD-x86" => {
1028 inherit_from => [ "BSD-generic32" ],
1029 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1030 lib_cppflags => add("-DL_ENDIAN"),
1035 "BSD-x86-elf" => {
1036 inherit_from => [ "BSD-x86" ],
1040 "BSD-sparcv8" => {
1041 inherit_from => [ "BSD-generic32" ],
1042 cflags => add("-mcpu=v8"),
1043 lib_cppflags => add("-DB_ENDIAN"),
1047 "BSD-sparc64" => {
1048 # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
1049 # simply *happens* to work around a compiler bug in gcc 3.3.3,
1051 inherit_from => [ "BSD-generic64" ],
1052 lib_cppflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
1058 "BSD-ia64" => {
1059 inherit_from => [ "BSD-generic64" ],
1060 lib_cppflags => add("-DL_ENDIAN"),
1066 "BSD-x86_64" => {
1067 inherit_from => [ "BSD-generic64" ],
1068 lib_cppflags => add("-DL_ENDIAN"),
1074 "BSD-aarch64" => {
1075 inherit_from => [ "BSD-generic64" ],
1076 lib_cppflags => add("-DL_ENDIAN"),
1084 "BSD-riscv64" => {
1085 inherit_from => [ "BSD-generic64"],
1089 "bsdi-elf-gcc" => {
1091 CC => "gcc",
1092 CFLAGS => "-fomit-frame-pointer -O3 -Wall",
1093 lib_cppflags => "-DPERL5 -DL_ENDIAN",
1094 ex_libs => add("-ldl"),
1100 shared_target => "bsd-gcc-shared",
1101 shared_cflag => "-fPIC",
1106 # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
1107 # Now we only have blended unixware-* as it's the only one used by ./config.
1109 # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
1111 # lack of motivation to support out-of-date platforms with out-of-date
1114 # UnixWare 2.0x fails destest with -O.
1115 "unixware-2.0" => {
1118 cflags => threads("-Kthread"),
1119 lib_cppflags => "-DFILIO_H -DNO_STRINGS_H",
1120 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1123 "unixware-2.1" => {
1126 CFLAGS => "-O",
1127 cflags => threads("-Kthread"),
1128 lib_cppflags => "-DFILIO_H",
1129 ex_libs => add("-lsocket -lnsl -lresolv -lx"),
1132 "unixware-7" => {
1135 CFLAGS => "-O",
1136 cflags => combine("-Kalloca", threads("-Kthread")),
1137 lib_cppflags => "-DFILIO_H",
1138 ex_libs => add("-lsocket -lnsl"),
1142 perlasm_scheme => "elf-1",
1144 shared_target => "svr5-shared",
1145 shared_cflag => "-Kpic",
1147 "unixware-7-gcc" => {
1149 CC => "gcc",
1150 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1151 cppflags => add(threads("-D_REENTRANT")),
1152 lib_cppflags => add("-DL_ENDIAN -DFILIO_H"),
1153 ex_libs => add("-lsocket -lnsl"),
1157 perlasm_scheme => "elf-1",
1159 shared_target => "gnu-shared",
1160 shared_cflag => "-fPIC",
1162 # SCO 5 - Ben Laurie says the -O breaks the SCO cc.
1163 "sco5-cc" => {
1166 cflags => "-belf",
1167 ex_libs => add("-lsocket -lnsl"),
1170 perlasm_scheme => "elf-1",
1172 shared_target => "svr3-shared",
1173 shared_cflag => "-Kpic",
1175 "sco5-gcc" => {
1177 cc => "gcc",
1178 cflags => "-O3 -fomit-frame-pointer",
1179 ex_libs => add("-lsocket -lnsl"),
1183 perlasm_scheme => "elf-1",
1185 shared_target => "svr3-shared",
1186 shared_cflag => "-fPIC",
1195 "aix-common" => {
1199 lib_cppflags => "-DB_ENDIAN",
1200 lflags => "-Wl,-bsvr4",
1204 module_ldflags => "-Wl,-G,-bsymbolic,-bnoentry",
1205 shared_ldflag => "-Wl,-G,-bsymbolic,-bnoentry",
1206 shared_defflag => "-Wl,-bE:",
1207 shared_fipsflag => "-Wl,-binitfini:_init:_cleanup",
1210 "aix-gcc" => {
1211 inherit_from => [ "aix-common" ],
1212 CC => "gcc",
1213 CFLAGS => picker(debug => "-O0 -g",
1214 release => "-O"),
1215 cflags => add(threads("-pthread")),
1216 ex_libs => add(threads("-pthread")),
1220 shared_ldflag => add_before("-shared -static-libgcc"),
1221 AR => add("-X32"),
1222 RANLIB => add("-X32"),
1224 "aix64-gcc" => {
1225 inherit_from => [ "aix-common" ],
1226 CC => "gcc",
1227 CFLAGS => picker(debug => "-O0 -g",
1228 release => "-O"),
1229 cflags => combine("-maix64", threads("-pthread")),
1230 ex_libs => add(threads("-pthread")),
1234 shared_ldflag => add_before("-shared -static-libgcc"),
1236 AR => add("-X64"),
1237 RANLIB => add("-X64"),
1239 "aix64-gcc-as" => {
1240 inherit_from => [ "aix64-gcc" ],
1241 perlasm_scheme => "aix64-as",
1243 "aix-cc" => {
1244 inherit_from => [ "aix-common" ],
1246 CFLAGS => picker(debug => "-O0 -g",
1247 release => "-O"),
1248 cflags => combine("-q32 -qmaxmem=16384 -qro -qroconst",
1249 threads("-qthreaded")),
1250 cppflags => threads("-D_THREAD_SAFE"),
1251 ex_libs => add(threads("-lpthreads")),
1255 shared_cflag => "-qpic",
1256 AR => add("-X32"),
1257 RANLIB => add("-X32"),
1259 "aix64-cc" => {
1260 inherit_from => [ "aix-common" ],
1262 CFLAGS => picker(debug => "-O0 -g",
1263 release => "-O"),
1264 cflags => combine("-q64 -qmaxmem=16384 -qro -qroconst",
1265 threads("-qthreaded")),
1266 cppflags => threads("-D_THREAD_SAFE"),
1267 ex_libs => add(threads("-lpthreads")),
1272 shared_cflag => "-qpic",
1274 AR => add("-X64"),
1275 RANLIB => add("-X64"),
1278 # SIEMENS BS2000/OSD: an EBCDIC-based mainframe
1279 "BS2000-OSD" => {
1282 CFLAGS => "-O",
1283 cflags => "-XLLML -XLLMK -XL",
1284 cppflags => "-DCHARSET_EBCDIC",
1285 lib_cppflags => "-DB_ENDIAN",
1286 ex_libs => add("-lsocket -lnsl"),
1293 # Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
1300 # Also note that we force threads no matter what. Configuring "no-threads"
1303 # UNICODE is defined in VC-common and applies to all targets. It used to
1304 # be an opt-in option for VC-WIN32, but not anymore. The original reason
1310 "VC-common" => {
1342 shared_target => "win-shared", # meaningless except it gives Configure a hint
1349 # additional parameter to build_scheme denotes install-path "flavour"
1350 build_scheme => add("VC-common", { separator => undef }),
1352 "VC-noCE-common" => {
1353 inherit_from => [ "VC-common" ],
1371 # non-shared build because static library is compiled with /Zl
1378 # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
1391 "VC-WIN64-common" => {
1392 inherit_from => [ "VC-noCE-common" ],
1396 push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
1401 "VC-WIN64I" => {
1402 inherit_from => [ "VC-WIN64-common" ],
1404 ASFLAGS => "-d debug",
1405 asoutflag => "-o ",
1410 multilib => "-ia64",
1412 "VC-WIN64A" => {
1413 inherit_from => [ "VC-WIN64-common" ],
1414 AS => sub { vc_win64a_info()->{AS} },
1415 ASFLAGS => sub { vc_win64a_info()->{ASFLAGS} },
1416 asoutflag => sub { vc_win64a_info()->{asoutflag} },
1417 asflags => sub { vc_win64a_info()->{asflags} },
1422 multilib => "-x64",
1424 "VC-WIN32" => {
1425 inherit_from => [ "VC-noCE-common" ],
1426 AS => sub { vc_win32_info()->{AS} },
1427 ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
1428 asoutflag => sub { vc_win32_info()->{asoutflag} },
1429 asflags => sub { vc_win32_info()->{asflags} },
1434 perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
1435 # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
1436 # some installation path heuristics in windows-makefile.tmpl...
1437 build_scheme => add("VC-WOW", { separator => undef }),
1439 "VC-CE" => {
1440 inherit_from => [ "VC-common" ],
1447 sub { vc_wince_info()->{cflags}; },
1448 sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
1451 cppflags => sub { vc_wince_info()->{cppflags}; },
1453 lib_cppflags => sub { vc_wince_info()->{cppflags}; },
1460 lflags => add(combine(sub { vc_wince_info()->{lflags}; },
1471 if (-f "$x/env('TARGETCPU')/wcecompatex.lib") {
1487 "mingw-common" => {
1490 CC => "gcc",
1491 CFLAGS => picker(default => "-Wall",
1492 debug => "-g -O0",
1493 release => "-O3"),
1494 cppflags => combine("-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN",
1495 threads("-D_MT")),
1496 lib_cppflags => "-DL_ENDIAN",
1497 ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1500 shared_target => "mingw-shared",
1502 shared_ldflag => "-static-libgcc",
1507 inherit_from => [ "mingw-common" ],
1508 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1509 cflags => "-m32",
1515 shared_rcflag => "--target=pe-i386",
1524 # consider its binaries for using with non-mingw64 run-time
1527 inherit_from => [ "mingw-common" ],
1528 cflags => "-m64",
1534 shared_rcflag => "--target=pe-x86-64",
1542 CFLAGS => "-O",
1543 lib_cppflags => "-DL_ENDIAN",
1546 "UEFI-x86" => {
1551 "UEFI-x86_64" => {
1561 CFLAGS => "-O -Wall",
1562 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1569 "Cygwin-common" => {
1573 CC => "gcc",
1574 CFLAGS => picker(default => "-Wall",
1575 debug => "-g -O0",
1576 release => "-O3"),
1577 lib_cppflags => "-DTERMIOS -DL_ENDIAN",
1581 shared_target => "cygwin-shared",
1582 shared_cppflags => "-D_WINDLL",
1586 "Cygwin-x86" => {
1587 inherit_from => [ "Cygwin-common" ],
1588 CFLAGS => add(picker(release => "-O3 -fomit-frame-pointer")),
1593 "Cygwin-x86_64" => {
1594 inherit_from => [ "Cygwin-common" ],
1595 CC => "gcc",
1602 inherit_from => [ "Cygwin-x86" ]
1605 "Cygwin-i386" => {
1606 inherit_from => [ "Cygwin-x86" ]
1608 "Cygwin-i486" => {
1609 inherit_from => [ "Cygwin-x86" ]
1611 "Cygwin-i586" => {
1612 inherit_from => [ "Cygwin-x86" ]
1614 "Cygwin-i686" => {
1615 inherit_from => [ "Cygwin-x86" ]
1619 "darwin-common" => {
1623 CFLAGS => picker(debug => "-g -O0",
1624 release => "-O3"),
1625 cppflags => threads("-D_REENTRANT"),
1626 lflags => add("-Wl,-search_paths_first"),
1632 ranlib => "ranlib -c",
1633 shared_target => "darwin-shared",
1634 shared_cflag => "-fPIC",
1637 # Option "freeze" such as -std=gnu9x can't negatively interfere
1640 "darwin-ppc-cc" => { inherit_from => [ "darwin-ppc" ] }, # Historic alias
1641 "darwin-ppc" => {
1642 inherit_from => [ "darwin-common" ],
1643 cflags => add("-arch ppc -std=gnu9x -Wa,-force_cpusubtype_ALL"),
1644 lib_cppflags => add("-DB_ENDIAN"),
1645 shared_cflag => add("-fno-common"),
1649 "darwin64-ppc-cc" => { inherit_from => [ "darwin64-ppc" ] }, # Historic alias
1650 "darwin64-ppc" => {
1651 inherit_from => [ "darwin-common" ],
1652 cflags => add("-arch ppc64 -std=gnu9x"),
1653 lib_cppflags => add("-DB_ENDIAN"),
1658 "darwin-i386-cc" => { inherit_from => [ "darwin-i386" ] }, # Historic alias
1659 "darwin-i386" => {
1660 inherit_from => [ "darwin-common" ],
1661 CFLAGS => add(picker(release => "-fomit-frame-pointer")),
1662 cflags => add("-arch i386"),
1663 lib_cppflags => add("-DL_ENDIAN"),
1668 "darwin64-x86_64-cc" => { inherit_from => [ "darwin64-x86_64" ] }, # Historic alias
1669 "darwin64-x86_64" => {
1670 inherit_from => [ "darwin-common" ],
1671 CFLAGS => add("-Wall"),
1672 cflags => add("-arch x86_64"),
1673 lib_cppflags => add("-DL_ENDIAN"),
1678 "darwin64-arm64-cc" => { inherit_from => [ "darwin64-arm64" ] }, # "Historic" alias
1679 "darwin64-arm64" => {
1680 inherit_from => [ "darwin-common" ],
1681 CFLAGS => add("-Wall"),
1682 cflags => add("-arch arm64"),
1683 lib_cppflags => add("-DL_ENDIAN"),
1689 ##### GNU Hurd
1690 "hurd-x86" => {
1692 CC => "gcc",
1693 CFLAGS => "-O3 -fomit-frame-pointer -Wall",
1694 cflags => threads("-pthread"),
1695 lib_cppflags => "-DL_ENDIAN",
1696 ex_libs => add("-ldl", threads("-pthread")),
1702 shared_target => "linux-shared",
1703 shared_cflag => "-fPIC",
1707 "vxworks-ppc60x" => {
1710 CFLAGS => "-O2 -Wall -fstrength-reduce",
1711 …cflags => "-mrtp -mhard-float -mstrict-align -fno-implicit-fp -fno-builtin -fno-strict-a…
1712 cppflags => combine("-D_REENTRANT -DPPC32_fp60x -DCPU=PPC32",
1713 "_DTOOL_FAMILY=gnu -DTOOL=gnu",
1714 "-I\$(WIND_BASE)/target/usr/h",
1715 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1717 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
1718 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1720 "vxworks-ppcgen" => {
1723 CFLAGS => "-O1 -Wall",
1724 cflags => "-mrtp -msoft-float -mstrict-align -fno-builtin -fno-strict-aliasing",
1725 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC32",
1726 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1727 "-I\$(WIND_BASE)/target/usr/h",
1728 "-I\$(WIND_BASE)/target/usr/h/wrn/coreip"),
1730 lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
1731 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1733 "vxworks-ppc405" => {
1736 CFLAGS => "-g",
1737 cflags => "-msoft-float -mlongcall",
1738 cppflags => combine("-D_REENTRANT -DPPC32 -DCPU=PPC405",
1739 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1740 "-I\$(WIND_BASE)/target/h"),
1742 lflags => add("-r"),
1744 "vxworks-ppc750" => {
1747 CFLAGS => "-ansi -fvolatile -Wall \$(DEBUG_FLAG)",
1748 … cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1749 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1750 "-I\$(WIND_BASE)/target/h"),
1752 lflags => add("-r"),
1754 "vxworks-ppc750-debug" => {
1757 CFLAGS => "-ansi -fvolatile -Wall -g",
1758 … cflags => "-nostdinc -fno-builtin -fno-for-scope -fsigned-char -msoft-float -mlongcall",
1759 cppflags => combine("-DPPC750 -D_REENTRANT -DCPU=PPC604",
1760 "-DPEDANTIC -DDEBUG",
1761 "-I\$(WIND_BASE)/target/h"),
1763 lflags => add("-r"),
1765 "vxworks-ppc860" => {
1768 cflags => "-nostdinc -msoft-float",
1769 cppflags => combine("-DCPU=PPC860 -DNO_STRINGS_H",
1770 "-I\$(WIND_BASE)/target/h"),
1772 lflags => add("-r"),
1774 "vxworks-simlinux" => {
1777 …cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -fno-builtin -fno-defer-…
1778 …cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1779 "-DL_ENDIAN -DCPU=SIMLINUX -DNO_STRINGS_H",
1780 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1781 "-DOPENSSL_NO_HW_PADLOCK",
1782 "-I\$(WIND_BASE)/target/h",
1783 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1785 lflags => add("-r"),
1788 "vxworks-mips" => {
1791 CFLAGS => "-O -G 0",
1792 … => "-mrtp -mips2 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -msoft-float -mno…
1793 …cppflags => combine("-D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\"",
1794 "-DCPU=MIPS32 -DNO_STRINGS_H",
1795 "-DTOOL_FAMILY=gnu -DTOOL=gnu",
1796 "-DOPENSSL_NO_HW_PADLOCK",
1797 threads("-D_REENTRANT"),
1798 "-I\$(WIND_BASE)/target/h",
1799 "-I\$(WIND_BASE)/target/h/wrn/coreip"),
1801 lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
1802 ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"),
1810 "uClinux-dist" => {
1813 cppflags => threads("-D_REENTRANT"),
1818 shared_target => "linux-shared",
1819 shared_cflag => "-fPIC",
1822 "uClinux-dist64" => {
1825 cppflags => threads("-D_REENTRANT"),
1830 shared_target => "linux-shared",
1831 shared_cflag => "-fPIC",
1836 # Most things happen in vms-generic.
1838 # the target name, and will assume that anything matching /-p\d+$/
1840 "vms-generic" => {
1850 @{vms_info()->{disable_warns}};
1857 return vms_info()->{def_zlib}
1858 ? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
1874 ex_libs => add(sub { return vms_info()->{zlib} || (); }),
1875 shared_target => "vms-shared",
1882 AS => sub { vms_info()->{AS} },
1883 ASFLAGS => sub { vms_info()->{ASFLAGS} },
1884 asoutflag => sub { vms_info()->{asoutflag} },
1885 asflags => sub { vms_info()->{asflags} },
1886 perlasm_scheme => sub { vms_info()->{perlasm_scheme} },
1894 # ----------
1895 # LONG[=ARGV] The compiler assumes 64-bit pointers. If the ARGV option to
1900 # ----------
1902 # We don't want the hassle of dealing with 32-bit pointers with argv, so
1903 # we force it to have 64-bit pointers, see the added cflags in the -p64
1906 "vms-alpha" => {
1907 inherit_from => [ "vms-generic" ],
1911 "vms-alpha-p32" => {
1912 inherit_from => [ "vms-alpha" ],
1916 "vms-alpha-p64" => {
1917 inherit_from => [ "vms-alpha" ],
1921 "vms-ia64" => {
1922 inherit_from => [ "vms-generic" ],
1924 asm_arch => sub { vms_info()->{AS} ? 'ia64' : undef },
1929 "vms-ia64-p32" => {
1930 inherit_from => [ "vms-ia64" ],
1934 "vms-ia64-p64" => {
1935 inherit_from => [ "vms-ia64" ],
1939 "vms-x86_64" => {
1940 inherit_from => [ "vms-generic" ],