Ticket #47035: fix-Apple-clang-version-detection2.patch

File fix-Apple-clang-version-detection2.patch, 3.3 KB (added by osth@…, 9 years ago)

additional fix needed for mountain lion

  • bn/asm/rsaz-x86_64.pl

    diff -ur crypto.orig/bn/asm/rsaz-x86_64.pl crypto/bn/asm/rsaz-x86_64.pl
    old new  
    115115
    116116if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:clang|LLVM) version) ([5-9])\.([0-9]+)/) {
    117117        my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
    118         $addx = ($ver>=5.00);           # Apple LLVM version 5.0 corresponds to LLVM 3.3, see http://trac.macports.org/wiki/XcodeVersionInfo
     118        $addx = ($ver>5.00);            # Apple LLVM version 5.0 corresponds to LLVM 3.3, see http://trac.macports.org/wiki/XcodeVersionInfo
    119119}
    120120
    121121if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
    122122        my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
    123         $addx = ($ver>=3.03);
     123        $addx = ($ver>=3.4);
    124124}
    125125
    126126($out, $inp, $mod) = ("%rdi", "%rsi", "%rbp");  # common internal API
  • bn/asm/x86_64-mont.pl

    diff -ur crypto.orig/bn/asm/x86_64-mont.pl crypto/bn/asm/x86_64-mont.pl
    old new  
    7070
    7171if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:clang|LLVM) version) ([5-9])\.([0-9]+)/) {
    7272        my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
    73         $addx = ($ver>=5.00);           # Apple LLVM version 5.0 corresponds to LLVM 3.3, see http://trac.macports.org/wiki/XcodeVersionInfo
     73        $addx = ($ver>5.00);            # Apple LLVM version 5.0 corresponds to LLVM 3.3, see http://trac.macports.org/wiki/XcodeVersionInfo
    7474}
    7575
    7676if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
    7777        my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
    78         $addx = ($ver>=3.03);
     78        $addx = ($ver>=3.4);
    7979}
    8080
    8181# int bn_mul_mont(
  • bn/asm/x86_64-mont5.pl

    diff -ur crypto.orig/bn/asm/x86_64-mont5.pl crypto/bn/asm/x86_64-mont5.pl
    old new  
    5555
    5656if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:clang|LLVM) version) ([5-9])\.([0-9]+)/) {
    5757        my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
    58         $addx = ($ver>=5.00);           # Apple LLVM version 5.0 corresponds to LLVM 3.3, see http://trac.macports.org/wiki/XcodeVersionInfo
     58        $addx = ($ver>5.00);            # Apple LLVM version 5.0 corresponds to LLVM 3.3, see http://trac.macports.org/wiki/XcodeVersionInfo
    5959}
    6060
    6161if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
    6262        my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
    63         $addx = ($ver>=3.03);
     63        $addx = ($ver>=3.4);
    6464}
    6565
    6666# int bn_mul_mont_gather5(
  • ec/asm/ecp_nistz256-x86_64.pl

    diff -ur crypto.orig/ec/asm/ecp_nistz256-x86_64.pl crypto/ec/asm/ecp_nistz256-x86_64.pl
    old new  
    8787        # Apple clang versions 3.1 and 4.1 correspond to LLVM 3.1
    8888        $avx = ($ver>=2.01) + ($ver>=3.01);
    8989        # Apple LLVM version 5.0 corresponds to LLVM 3.3
    90         $addx = ($ver>=5.00);           
     90        $addx = ($ver>5.00);           
    9191}
    9292
    9393if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
    9494        my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
    9595        $avx = ($ver>=3.0) + ($ver>=3.01);
    96         $addx = ($ver>=3.03);
     96        $addx = ($ver>=3.4);
    9797}
    9898
    9999$code.=<<___;