Lines Matching +full:build +full:- +full:linux +full:- +full:gcc
2 # Copyright 1998-2023 The OpenSSL Project Authors. All Rights Reserved.
47 my @c_compilers = qw(clang gcc cc);
56 my $v = `$CROSS_COMPILE$CC -v 2>&1`;
57 $v =~ m/(?:(?:clang|LLVM) version|.*based on LLVM)\s+([0-9]+\.[0-9]+)/;
62 my $nul = File::Spec->devnull();
63 my $v = `$CROSS_COMPILE$CC -dumpversion 2> $nul`;
66 $v =~ s/^[a-zA-Z]*\-//;
77 [ 'A\/UX:.*', 'm68k-apple-aux3' ],
78 [ 'AIX:[3-9]:4:.*', '${MACHINE}-ibm-aix' ],
79 [ 'AIX:.*?:[5-9]:.*', '${MACHINE}-ibm-aix' ],
80 [ 'AIX:.*', '${MACHINE}-ibm-aix3' ],
81 [ 'HI-UX:.*', '${MACHINE}-hi-hiux' ],
82 [ 'HP-UX:.*',
87 return "${MACHINE}-hp-hpux1x" if $HPUXVER =~ m@1[0-9]@;
88 return "${MACHINE}-hp-hpux";
91 [ 'IRIX:6\..*', 'mips3-sgi-irix' ],
92 [ 'IRIX64:.*', 'mips4-sgi-irix64' ],
93 [ 'Linux:[2-9]\..*', '${MACHINE}-whatever-linux2' ],
94 [ 'Linux:1\..*', '${MACHINE}-whatever-linux1' ],
95 [ 'GNU.*', 'hurd-x86' ],
96 [ 'LynxOS:.*', '${MACHINE}-lynx-lynxos' ],
98 [ 'BSD\/OS:4\..*', 'i486-whatever-bsdi4' ],
102 my $BSDVAR = `/sbin/sysctl -n hw.model`;
103 return "i586-whatever-bsdi" if $BSDVAR =~ m@Pentium@;
104 return "i386-whatever-bsdi";
107 [ 'BSD\/386:.*|BSD\/OS:.*', '${MACHINE}-whatever-bsdi' ],
112 $VERS =~ s/[-(].*//;
113 my $MACH = `sysctl -n hw.model`;
120 $ARCH = "pc" if $MACH =~ m@i[0-9]86@;
121 return "${MACH}-${ARCH}-freebsd${VERS}";
124 [ 'DragonFly:.*', '${MACHINE}-whatever-dragonfly' ],
125 [ 'FreeBSD:.*', '${MACHINE}-whatever-freebsd' ],
126 [ 'Haiku:.*', '${MACHINE}-whatever-haiku' ],
130 my $hw = `/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model`;
131 $hw =~ s@.*(.)86-class.*@i${1}86@;
132 return "${hw}-whatever-netbsd";
135 [ 'NetBSD:.*', '${MACHINE}-whatever-netbsd' ],
136 [ 'OpenBSD:.*', '${MACHINE}-whatever-openbsd' ],
137 [ 'OpenUNIX:.*', '${MACHINE}-unknown-OpenUNIX${VERSION}' ],
141 $OSFMAJOR =~ 's/^V([0-9]*)\..*$/\1/';
142 return "${MACHINE}-dec-tru64" if $OSFMAJOR =~ m@[45]@;
143 return "${MACHINE}-dec-osf";
146 [ 'Paragon.*?:.*', 'i860-intel-osf1' ],
147 [ 'Rhapsody:.*', 'ppc-apple-rhapsody' ],
148 [ 'Darwin:.*?:.*?:Power.*', 'ppc-apple-darwin' ],
149 [ 'Darwin:.*', '${MACHINE}-apple-darwin' ],
150 [ 'SunOS:5\..*', '${MACHINE}-whatever-solaris2' ],
151 [ 'SunOS:.*', '${MACHINE}-sun-sunos4' ],
152 [ 'UNIX_System_V:4\..*?:.*', '${MACHINE}-whatever-sysv4' ],
153 [ 'VOS:.*?:.*?:i786', 'i386-stratus-vos' ],
154 [ 'VOS:.*?:.*?:.*', 'hppa1.1-stratus-vos' ],
155 [ '.*?:4.*?:R4.*?:m88k', '${MACHINE}-whatever-sysv4' ],
156 [ 'DYNIX\/ptx:4.*?:.*', '${MACHINE}-whatever-sysv4' ],
157 [ '.*?:4\.0:3\.0:3[34]..(,.*)?', 'i486-ncr-sysv4' ],
158 [ 'ULTRIX:.*', '${MACHINE}-unknown-ultrix' ],
159 [ 'POSIX-BC.*', 'BS2000-siemens-sysv4' ],
160 [ 'machten:.*', '${MACHINE}-tenon-${SYSTEM}' ],
161 [ 'library:.*', '${MACHINE}-ncr-sysv4' ],
162 [ 'ConvexOS:.*?:11\.0:.*', '${MACHINE}-v11-${SYSTEM}' ],
163 [ 'MINGW64.*?:.*?:.*?:x86_64', '${MACHINE}-whatever-mingw64' ],
164 [ 'MINGW.*', '${MACHINE}-whatever-mingw' ],
165 [ 'CYGWIN.*', '${MACHINE}-pc-cygwin' ],
166 [ 'vxworks.*', '${MACHINE}-whatever-vxworks' ],
172 [ 'OpenVMS:.*', "$Config{archname}-whatever-OpenVMS" ],
175 [ 'NONSTOP_KERNEL:.*:NSE-.*?', 'nse-tandem-nsk${RELEASE}' ],
176 [ 'NONSTOP_KERNEL:.*:NSV-.*?', 'nsv-tandem-nsk${RELEASE}' ],
177 [ 'NONSTOP_KERNEL:.*:NSX-.*?', 'nsx-tandem-nsk${RELEASE}' ],
179 [ sub { -d '/usr/apollo' }, 'whatever-apollo-whatever' ],
193 if ( $WAIT && -t 1 ) {
210 open UNAME, "uname -X 2>/dev/null|" or return '';
229 if ( -f "/etc/kconfig" ) {
230 return "${MACHINE}-whatever-isc4" if $REL eq '4.0' || $REL eq '4.1';
232 return "whatever-whatever-sco3" if $REL eq '3.2v4.2';
233 return "whatever-whatever-sco5" if $REL =~ m@3\.2v5\.0.*@;
235 return "whatever-whatever-unixware20" if $VERSION =~ m@2\.0.*@;
236 return "whatever-whatever-unixware21" if $VERSION =~ m@2\.1.*@;
237 return "whatever-whatever-unixware2" if $VERSION =~ m@2.*@;
239 return "whatever-whatever-unixware1" if $REL eq "4.2";
246 return "i586-sco-unixware7" if $VERSION =~ m@[678].*@;
251 # Return the cputype-vendor-osversion
256 # Special-cases for ISC, SCO, Unixware
263 # Now pattern-match
268 my $check = ref $pat eq 'CODE' ? $pat->($sys) : $sys =~ /^(${pat})$/;
272 $result = $result->() if ref $result eq 'CODE';
277 return "${MACHINE}-whatever-${SYSTEM}";
320 $v = $v->();
324 $v =~ s/[^.]*.0*// if $SYSTEM eq 'HP-UX';
364 ([A-Z]+) # Usually VSI
366 (?:\s+(.*?))? # Possible build arch
367 \s+ [VWXYZ]([0-9\.-]+) # Version
372 ( $version =~ m/^([0-9]+)\.([0-9]+)-0*?(0|[1-9][0-9]*)$/ );
380 # favor vendor cc over gcc
389 # check for Oracle Developer Studio, expected output is "cc: blah-blah C x.x blah-blah"
390 my $v = `(cc -V 2>&1) 2>/dev/null | egrep -e '^cc: .* C [0-9]\.[0-9]'`;
392 ( $v =~ m/^.* C ([0-9]+)\.([0-9]+) .*/ );
408 # favor vendor cl over gcc
415 if ( $v =~ /Microsoft .* Version ([0-9\.]+) for (x86|x64|ARM|ia64)/ ) {
440 if ( $SYSTEM eq "HP-UX" && $CCVENDOR eq 'gnu' ) {
441 # By default gcc is a ILP32 compiler (with long long == 64).
444 # PA64 support only came in with gcc 3.0.x.
447 "$CC -v -E -x c - 2>/dev/null",
458 # 64-bit ABI isn't officially supported in gcc 3.0, but seems
460 if ( okrun("$CC -v -E -x c /dev/null 2>&1",
462 $GCC_ARCH = "-m64"
464 $GCC_ARCH = "-m32"
479 [ [ 'uClinux.*64.*', { target => 'uClinux-dist64' } ],
480 [ 'uClinux.*', { target => 'uClinux-dist' } ],
481 [ 'mips3-sgi-irix', { target => 'irix-mips3' } ],
482 [ 'mips4-sgi-irix64',
485 WARNING! To build 64-bit package, do this:
486 $WHERE/Configure irix64-mips4-$CC
489 return { target => "irix-mips3" };
492 [ 'ppc-apple-rhapsody', { target => "rhapsody-ppc" } ],
493 [ 'ppc-apple-darwin.*',
496 my $ISA64 = `sysctl -n hw.optional.64bitops 2>/dev/null`;
499 WARNING! To build 64-bit package, do this:
500 $WHERE/Configure darwin64-ppc-cc
504 return { target => "darwin64-ppc" }
506 return { target => "darwin-ppc" };
509 [ 'i.86-apple-darwin.*',
512 my $ISA64 = `sysctl -n hw.optional.x86_64 2>/dev/null`;
515 WARNING! To build 64-bit package, do this:
520 return { target => "darwin64-x86_64" }
522 return { target => "darwin-i386" };
525 [ 'x86_64-apple-darwin.*',
528 # macOS >= 10.15 is 64-bit only
529 my $SW_VERS = `sw_vers -productVersion 2>/dev/null`;
532 … die "32-bit applications not supported on macOS 10.15 or later\n" if $KERNEL_BITS eq '32';
533 return { target => "darwin64-x86_64" };
536 return { target => "darwin-i386" } if $KERNEL_BITS eq '32';
539 WARNING! To build 32-bit package, do this:
543 return { target => "darwin64-x86_64" };
546 [ 'arm64-apple-darwin.*', { target => "darwin64-arm64" } ],
547 [ 'armv6\+7-.*-iphoneos',
548 { target => "iphoneos-cross",
549 cflags => [ qw(-arch armv6 -arch armv7) ],
550 cxxflags => [ qw(-arch armv6 -arch armv7) ] }
552 [ 'arm64-.*-iphoneos|.*-.*-ios64',
553 { target => "ios64-cross" }
555 [ '.*-.*-iphoneos',
556 sub { return { target => "iphoneos-cross",
557 cflags => [ "-arch ${MACHINE}" ],
558 cxxflags => [ "-arch ${MACHINE}" ] }; }
560 [ 'alpha-.*-linux2.*',
567 %config = ( cflags => [ '-mcpu=ev5' ],
568 cxxflags => [ '-mcpu=ev5' ] );
570 %config = ( cflags => [ '-mcpu=ev56' ],
571 cxxflags => [ '-mcpu=ev56' ] );
573 %config = ( cflags => [ '-mcpu=ev6' ],
574 cxxflags => [ '-mcpu=ev6' ] );
577 return { target => "linux-alpha",
581 [ 'ppc64-.*-linux2',
586 WARNING! To build 64-bit package, do this:
587 $WHERE/Configure linux-ppc64
591 return { target => "linux-ppc64" } if $KERNEL_BITS eq '64';
595 'gcc -E -x c - 2>/dev/null',
597 %config = ( cflags => [ '-m32' ],
598 cxxflags => [ '-m32' ] );
600 return { target => "linux-ppc",
604 [ 'ppc64le-.*-linux2', { target => "linux-ppc64le" } ],
605 [ 'ppc-.*-linux2', { target => "linux-ppc" } ],
606 [ 'mips64.*-*-linux2',
609 WARNING! To build 64-bit package, do this:
610 $WHERE/Configure linux64-mips64
613 return { target => "linux-mips64" };
616 [ 'mips.*-.*-linux2', { target => "linux-mips32" } ],
617 [ 'ppc60x-.*-vxworks.*', { target => "vxworks-ppc60x" } ],
618 [ 'ppcgen-.*-vxworks.*', { target => "vxworks-ppcgen" } ],
619 [ 'pentium-.*-vxworks.*', { target => "vxworks-pentium" } ],
620 [ 'simlinux-.*-vxworks.*', { target => "vxworks-simlinux" } ],
621 [ 'mips-.*-vxworks.*', { target => "vxworks-mips" } ],
622 [ 'e2k-.*-linux.*', { target => "linux-generic64",
624 [ 'ia64-.*-linux.', { target => "linux-ia64" } ],
625 [ 'sparc64-.*-linux2',
628 WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI and you
629 want to build 64-bit library, do this:
630 $WHERE/Configure linux64-sparcv9
633 return { target => "linux-sparcv9" };
636 [ 'sparc-.*-linux2',
640 return { target => "linux-sparcv9" } if $KARCH =~ 'sun4u.*';
641 return { target => "linux-sparcv8" } if $KARCH =~ 'sun4[md]';
642 return { target => "linux-generic32",
646 [ 'parisc.*-.*-linux2',
648 # 64-bit builds under parisc64 linux are not supported and
649 # compiler is expected to generate 32-bit objects...
657 # will ever be used by GCC.
660 # 2. The variant 64-bit processors cause concern should GCC support
662 # PA7300LC -> 7100LC (1.1)
663 # PA8200 -> 8000 (2.0)
664 # PA8500 -> 8000 (2.0)
665 # PA8600 -> 8000 (2.0)
669 { target => "linux-generic32",
671 cflags => [ "-mschedule=$CPUSCHEDULE", "-march=$CPUARCH" ],
672 cxxflags => [ "-mschedule=$CPUSCHEDULE", "-march=$CPUARCH" ]
676 [ 'armv[1-3].*-.*-linux2', { target => "linux-generic32" } ],
677 [ 'armv[7-9].*-.*-linux2', { target => "linux-armv4",
678 cflags => [ '-march=armv7-a' ],
679 cxxflags => [ '-march=armv7-a' ] } ],
680 [ 'arm.*-.*-linux2', { target => "linux-armv4" } ],
681 [ 'aarch64-.*-linux2', { target => "linux-aarch64" } ],
682 [ 'sh.*b-.*-linux2', { target => "linux-generic32",
684 [ 'sh.*-.*-linux2', { target => "linux-generic32",
686 [ 'm68k.*-.*-linux2', { target => "linux-generic32",
688 [ 's390-.*-linux2', { target => "linux-generic32",
690 [ 's390x-.*-linux2',
694 || okrun('egrep -e \'^features.* highgprs\' /proc/cpuinfo >/dev/null') )
697 WARNING! To build "highgprs" 32-bit package, do this:
698 $WHERE/Configure linux32-s390x
702 return { target => "linux64-s390x" };
705 [ 'x86_64-.*-linux.',
707 return { target => "linux-x32" }
708 if okrun("$CC -dM -E -x c /dev/null 2>&1",
709 'grep -q ILP32 >/dev/null');
710 return { target => "linux-x86_64" };
713 [ '.*86-.*-linux2',
715 # On machines where the compiler understands -m32, prefer a
717 return { target => "linux-x86" }
718 if okrun("$CC -m32 -E -x c /dev/null >/dev/null 2>&1");
719 return { target => "linux-elf" };
722 [ '.*86-.*-linux1', { target => "linux-aout" } ],
723 [ 'riscv64-.*-linux.', { target => "linux64-riscv64" } ],
724 [ '.*-.*-linux.', { target => "linux-generic32" } ],
725 [ 'sun4[uv].*-.*-solaris2',
733 WARNING! To build 32-bit package, do this:
734 $WHERE/Configure solaris-sparcv9-cc
737 } elsif ( $CCVENDOR eq "gnu" && $GCC_ARCH eq "-m64" ) {
741 # and therefore switch over to 64-bit. <appro>
743 WARNING! To build 32-bit package, do this:
744 $WHERE/Configure solaris-sparcv9-gcc
747 return { target => "solaris64-sparcv9-gcc" };
748 } elsif ( $GCC_ARCH eq "-m32" ) {
750 NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI and you wish
751 to build 64-bit library, do this:
752 $WHERE/Configure solaris64-sparcv9-gcc
757 return { target => "solaris64-sparcv9-cc" }
759 return { target => "solaris-sparcv9-cc" };
762 [ 'sun4m-.*-solaris2', { target => "solaris-sparcv8" } ],
763 [ 'sun4d-.*-solaris2', { target => "solaris-sparcv8" } ],
764 [ 'sun4.*-.*-solaris2', { target => "solaris-sparcv7" } ],
765 [ '.*86.*-.*-solaris2',
771 return { target => "solaris64-x86_64-gcc" } if $CCVENDOR eq "gnu";
772 return { target => "solaris64-x86_64-cc" };
774 my $REL = uname('-r');
778 #There is no solaris-x86-cc target
779 return { target => "solaris-x86-gcc",
784 [ '.*-.*-sunos4', { target => "sunos" } ],
785 [ '.*86.*-.*-bsdi4', { target => "BSD-x86-elf",
786 lflags => [ '-ldl' ],
788 [ 'alpha.*-.*-.*bsd.*', { target => "BSD-generic64",
790 [ 'powerpc64-.*-.*bsd.*', { target => "BSD-generic64",
792 [ 'riscv64-.*-.*bsd.*', { target => "BSD-riscv64" } ],
793 [ 'sparc64-.*-.*bsd.*', { target => "BSD-sparc64" } ],
794 [ 'ia64-.*-.*bsd.*', { target => "BSD-ia64" } ],
795 [ 'x86_64-.*-dragonfly.*', { target => "BSD-x86_64" } ],
796 [ 'amd64-.*-.*bsd.*', { target => "BSD-x86_64" } ],
797 [ 'arm64-.*-.*bsd.*', { target => "BSD-aarch64" } ],
798 [ '.*86.*-.*-.*bsd.*',
802 if ( -l "/usr/lib/libc.so" ) {
807 `(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null`;
809 my $what = `file -L $libc 2>/dev/null`;
810 return { target => "BSD-x86-elf" } if $what =~ /ELF/;
811 return { target => "BSD-x86",
815 [ '.*-.*-.*bsd.*', { target => "BSD-generic32" } ],
816 [ 'x86_64-.*-haiku', { target => "haiku-x86_64" } ],
817 [ '.*-.*-haiku', { target => "haiku-x86" } ],
818 [ '.*-.*-osf', { target => "osf1-alpha" } ],
819 [ '.*-.*-tru64', { target => "tru64-alpha" } ],
820 [ '.*-.*-[Uu]nix[Ww]are7',
822 return { target => "unixware-7",
824 return { target => "unixware-7",
828 [ '.*-.*-[Uu]nix[Ww]are20.*', { target => "unixware-2.0",
830 [ '.*-.*-[Uu]nix[Ww]are21.*', { target => "unixware-2.1",
832 [ '.*-.*-vos', { target => "vos",
835 [ 'BS2000-siemens-sysv4', { target => "BS2000-OSD" } ],
836 [ 'i[3456]86-.*-cygwin', { target => "Cygwin-x86" } ],
837 [ '.*-.*-cygwin',
838 sub { return { target => "Cygwin-${MACHINE}" } } ],
839 [ 'x86-.*-android|i.86-.*-android', { target => "android-x86" } ],
840 [ 'armv[7-9].*-.*-android', { target => "android-armeabi",
841 cflags => [ '-march=armv7-a' ],
842 cxxflags => [ '-march=armv7-a' ] } ],
843 [ 'arm.*-.*-android', { target => "android-armeabi" } ],
844 [ '.*-hpux1.*',
852 # IA-64 CPU
853 return { target => "hpux64-ia64",
856 return { target => "hpux-ia64",
860 # PA-RISC 2.x CPU
861 # PA-RISC 2.0 is no longer supported as separate 32-bit
862 # target. This is compensated for by run-time detection
864 # of 2.0 architecture in PA-RISC 1.1 build.
866 ? "hpux64-parisc2"
867 : "hpux-parisc1_1";
870 WARNING! To build 64-bit package, do this:
871 $WHERE/Configure hpux64-parisc2-cc
878 # PA-RISC 1.1+ CPU?
879 return { target => "hpux-parisc1_1",
881 # PA-RISC 1.0 CPU
882 return { target => "hpux-parisc",
889 [ '.*-hpux', { target => "hpux-parisc" } ],
890 [ '.*-aix',
905 WARNING! To build 64-bit package, do this:
906 $WHERE/Configure aix64-cc
912 "(lsattr -E -O -l `lsdev -c processor|awk '{print \$1;exit}'`",
913 'grep -i powerpc) >/dev/null 2>&1') ) {
924 [ '(amd64|ia64|x86|ARM)-.*?-Windows NT',
932 $config = { 'amd64' => { target => 'VC-WIN64A' },
933 'ia64' => { target => 'VC-WIN64I' },
934 'x86' => { target => 'VC-WIN32' },
935 'x64' => { target => 'VC-WIN64A' },
936 'ARM' => { target => 'VC-WIN64-ARM' },
937 } -> {$arch};
953 [ 'VMS_AXP-.*?-OpenVMS', { target => 'vms-alpha' } ],
954 [ 'VMS_IA64-.*?-OpenVMS', { target => 'vms-ia64' } ],
955 [ 'VMS_x86_64-.*?-OpenVMS', { target => 'vms-x86_64' } ],
960 # build options such as data model (ILP32 or LP64), thread support
967 [ 'nse-tandem-nsk.*', { target => 'nonstop-nse' } ],
968 [ 'nsv-tandem-nsk.*', { target => 'nonstop-nsx' } ],
969 [ 'nsx-tandem-nsk.*', { target => 'nonstop-nsx' } ],
985 $result = $result->() if ref $result eq 'CODE';
989 # Last case, return "z" from x-y-z
990 my @fields = split(/-/, $GUESSOS);
994 # gcc < 2.8 does not support -march=ultrasparc
998 if ( $OUT eq 'solaris-sparcv9-gcc' ) {
1000 WARNING! Downgrading to solaris-sparcv8-gcc
1001 Upgrade to gcc-2.8 or later.
1004 return 'solaris-sparcv8-gcc';
1006 if ( $OUT eq "linux-sparcv9" ) {
1008 WARNING! Downgrading to linux-sparcv8
1009 Upgrade to gcc-2.8 or later.
1012 return 'linux-sparcv8';