|
| 1 | +From 34ab13b7d8e3e723adb60be8142e38b7c9cd382a Mon Sep 17 00:00:00 2001 |
| 2 | +From: Andy Polyakov <appro@openssl.org> |
| 3 | +Date: Sun, 5 May 2019 18:25:50 +0200 |
| 4 | +Subject: [PATCH] crypto/perlasm/ppc-xlate.pl: add linux64v2 flavour |
| 5 | +MIME-Version: 1.0 |
| 6 | +Content-Type: text/plain; charset=UTF-8 |
| 7 | +Content-Transfer-Encoding: 8bit |
| 8 | + |
| 9 | +This is a big endian ELFv2 configuration. ELFv2 was already being |
| 10 | +used for little endian, and big endian was traditionally ELFv1 |
| 11 | +but there are practical configurations that use ELFv2 with big |
| 12 | +endian nowadays (Adélie Linux, Void Linux, possibly Gentoo, etc.) |
| 13 | + |
| 14 | +Reviewed-by: Paul Dale <paul.dale@oracle.com> |
| 15 | +Reviewed-by: Richard Levitte <levitte@openssl.org> |
| 16 | +(Merged from https://github.com/openssl/openssl/pull/8883) |
| 17 | +--- |
| 18 | + crypto/perlasm/ppc-xlate.pl | 8 ++++---- |
| 19 | + 1 file changed, 4 insertions(+), 4 deletions(-) |
| 20 | + |
| 21 | +diff --git a/crypto/perlasm/ppc-xlate.pl b/crypto/perlasm/ppc-xlate.pl |
| 22 | +index e52f2f6ea62..5fcd0526dff 100755 |
| 23 | +--- crypto/perlasm/ppc-xlate.pl |
| 24 | ++++ crypto/perlasm/ppc-xlate.pl |
| 25 | +@@ -49,7 +49,7 @@ |
| 26 | + /osx/ && do { $name = "_$name"; |
| 27 | + last; |
| 28 | + }; |
| 29 | +- /linux.*(32|64le)/ |
| 30 | ++ /linux.*(32|64(le|v2))/ |
| 31 | + && do { $ret .= ".globl $name"; |
| 32 | + if (!$$type) { |
| 33 | + $ret .= "\n.type $name,\@function"; |
| 34 | +@@ -80,7 +80,7 @@ |
| 35 | + }; |
| 36 | + my $text = sub { |
| 37 | + my $ret = ($flavour =~ /aix/) ? ".csect\t.text[PR],7" : ".text"; |
| 38 | +- $ret = ".abiversion 2\n".$ret if ($flavour =~ /linux.*64le/); |
| 39 | ++ $ret = ".abiversion 2\n".$ret if ($flavour =~ /linux.*64(le|v2)/); |
| 40 | + $ret; |
| 41 | + }; |
| 42 | + my $machine = sub { |
| 43 | +@@ -186,7 +186,7 @@ |
| 44 | + |
| 45 | + # Some ABIs specify vrsave, special-purpose register #256, as reserved |
| 46 | + # for system use. |
| 47 | +-my $no_vrsave = ($flavour =~ /aix|linux64le/); |
| 48 | ++my $no_vrsave = ($flavour =~ /aix|linux64(le|v2)/); |
| 49 | + my $mtspr = sub { |
| 50 | + my ($f,$idx,$ra) = @_; |
| 51 | + if ($idx == 256 && $no_vrsave) { |
| 52 | +@@ -318,7 +318,7 @@ sub vfour { |
| 53 | + if ($label) { |
| 54 | + my $xlated = ($GLOBALS{$label} or $label); |
| 55 | + print "$xlated:"; |
| 56 | +- if ($flavour =~ /linux.*64le/) { |
| 57 | ++ if ($flavour =~ /linux.*64(le|v2)/) { |
| 58 | + if ($TYPES{$label} =~ /function/) { |
| 59 | + printf "\n.localentry %s,0\n",$xlated; |
| 60 | + } |
| 61 | + |
| 62 | +From 098404128383ded87ba390dd74ecd9e2ffa6f530 Mon Sep 17 00:00:00 2001 |
| 63 | +From: Andy Polyakov <appro@openssl.org> |
| 64 | +Date: Sun, 5 May 2019 18:30:55 +0200 |
| 65 | +Subject: [PATCH] Configure: use ELFv2 ABI on some ppc64 big endian systems |
| 66 | + |
| 67 | +If _CALL_ELF is defined to be 2, it's an ELFv2 system. |
| 68 | +Conditionally switch to the v2 perlasm scheme. |
| 69 | + |
| 70 | +Reviewed-by: Paul Dale <paul.dale@oracle.com> |
| 71 | +Reviewed-by: Richard Levitte <levitte@openssl.org> |
| 72 | +(Merged from https://github.com/openssl/openssl/pull/8883) |
| 73 | +--- |
| 74 | + Configure | 10 +++++++--- |
| 75 | + 1 file changed, 7 insertions(+), 3 deletions(-) |
| 76 | + |
| 77 | +diff --git a/Configure b/Configure |
| 78 | +index 22082deb4c7..e303d98deb3 100755 |
| 79 | +--- Configure |
| 80 | ++++ Configure |
| 81 | +@@ -1402,8 +1402,15 @@ |
| 82 | + my %predefined_C = compiler_predefined($config{CROSS_COMPILE}.$config{CC}); |
| 83 | + my %predefined_CXX = $config{CXX} |
| 84 | + ? compiler_predefined($config{CROSS_COMPILE}.$config{CXX}) |
| 85 | + : (); |
| 86 | + |
| 87 | ++unless ($disabled{asm}) { |
| 88 | ++ # big endian systems can use ELFv2 ABI |
| 89 | ++ if ($target eq "linux-ppc64") { |
| 90 | ++ $target{perlasm_scheme} = "linux64v2" if ($predefined_C{_CALL_ELF} == 2); |
| 91 | ++ } |
| 92 | ++} |
| 93 | ++ |
| 94 | + # Check for makedepend capabilities. |
| 95 | + if (!$disabled{makedepend}) { |
| 96 | + if ($config{target} =~ /^(VC|vms)-/) { |
0 commit comments