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

File fix-Apple-clang-version-detection.patch, 9.2 KB (added by neverpanic (Clemens Lang), 9 years ago)
  • ./crypto/aes/asm/aesni-mb-x86_64.pl

    old new  
    6363        $avx = ($1>=10) + ($1>=11);
    6464}
    6565
    66 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
     66if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:clang|LLVM) version) ([2-9]\.[0-9]+)/) {
     67        # Apple clang versions 2.1 and 3.0 correspond to LLVM 3.0
     68        # Apple clang versions 3.1 and 4.1 correspond to LLVM 3.1
     69        # see http://trac.macports.org/wiki/XcodeVersionInfo
     70        $avx = ($2>=2.1) + ($2>=3.1);
     71}
     72
     73if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
    6774        $avx = ($2>=3.0) + ($2>3.0);
    6875}
    6976
  • ./crypto/aes/asm/aesni-sha1-x86_64.pl

    old new  
    9494$avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
    9595           `ml64 2>&1` =~ /Version ([0-9]+)\./ &&
    9696           $1>=10);
    97 $avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0);
     97# Apple clang 2.1 and 3.0 correspond to LLVM 3.0, see http://trac.macports.org/wiki/XcodeVersionInfo
     98$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:^clang|LLVM) version) ([2-9]\.[0-9]+)/ && $2>=2.1);
     99$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0);
    98100
    99101$shaext=1;      ### set to zero if compiling for 1.0.1
    100102
  • ./crypto/aes/asm/aesni-sha256-x86_64.pl

    old new  
    5959        $avx = ($1>=10) + ($1>=12);
    6060}
    6161
    62 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
     62if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:clang|LLVM) version) ([2-9]\.[0-9]+)/) {
     63        # Apple clang versions 2.1 and 3.0 correspond to LLVM 3.0
     64        # Apple clang versions 3.1 and 4.1 correspond to LLVM 3.1
     65        # see http://trac.macports.org/wiki/XcodeVersionInfo
     66        $avx = ($2>=2.1) + ($2>=3.1);
     67}
     68
     69if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
    6370        $avx = ($2>=3.0) + ($2>3.0);
    6471}
    6572
  • ./crypto/bn/asm/rsaz-x86_64.pl

    old new  
    113113        $addx = ($1>=12);
    114114}
    115115
    116 if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
     116if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:clang|LLVM) version) ([5-9])\.([0-9]+)/) {
     117        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
     119}
     120
     121if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
    117122        my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
    118123        $addx = ($ver>=3.03);
    119124}
  • ./crypto/bn/asm/x86_64-mont.pl

    old new  
    6868        $addx = ($1>=12);
    6969}
    7070
    71 if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
     71if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:clang|LLVM) version) ([5-9])\.([0-9]+)/) {
     72        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
     74}
     75
     76if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
    7277        my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
    7378        $addx = ($ver>=3.03);
    7479}
  • ./crypto/bn/asm/x86_64-mont5.pl

    old new  
    5353        $addx = ($1>=12);
    5454}
    5555
    56 if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
     56if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:clang|LLVM) version) ([5-9])\.([0-9]+)/) {
     57        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
     59}
     60
     61if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
    5762        my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
    5863        $addx = ($ver>=3.03);
    5964}
  • ./crypto/ec/asm/ecp_nistz256-x86_64.pl

    old new  
    8181        $addx = ($1>=12);
    8282}
    8383
    84 if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
     84if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:clang|LLVM) version) ([2-9])\.([0-9]+)/) {
     85        my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
     86        # Apple clang versions 2.1 and 3.0 correspond to LLVM 3.0
     87        # Apple clang versions 3.1 and 4.1 correspond to LLVM 3.1
     88        $avx = ($ver>=2.01) + ($ver>=3.01);
     89        # Apple LLVM version 5.0 corresponds to LLVM 3.3
     90        $addx = ($ver>=5.00);           
     91}
     92
     93if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
    8594        my $ver = $2 + $3/100.0;        # 3.1->3.01, 3.10->3.10
    8695        $avx = ($ver>=3.0) + ($ver>=3.01);
    8796        $addx = ($ver>=3.03);
  • ./crypto/modes/asm/aesni-gcm-x86_64.pl

    old new  
    5656        $avx = ($1>=10) + ($1>=11);
    5757}
    5858
    59 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
     59if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:^clang|LLVM) version) ([2-9]\.[0-9]+)/) {
     60        # Apple clang versions 2.1 and 3.0 correspond to LLVM 3.0
     61        # Apple clang versions 3.1 and 4.1 correspond to LLVM 3.1
     62        $avx = ($2>=2.1) + ($2>=3.1);
     63}
     64
     65if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
    6066        $avx = ($2>=3.0) + ($2>3.0);
    6167}
    6268
  • ./crypto/modes/asm/ghash-x86_64.pl

    old new  
    105105        $avx = ($1>=10) + ($1>=11);
    106106}
    107107
    108 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
     108if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:^clang|LLVM) version) ([2-9]\.[0-9]+)/) {
     109        # Apple clang versions 2.1 and 3.0 correspond to LLVM 3.0
     110        # Apple clang versions 3.1 and 4.1 correspond to LLVM 3.1
     111        $avx = ($2>=2.1) + ($2>=3.1);
     112}
     113
     114if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
    109115        $avx = ($2>=3.0) + ($2>3.0);
    110116}
    111117
  • ./crypto/sha/asm/sha1-mb-x86_64.pl

    old new  
    5858        $avx = ($1>=10) + ($1>=11);
    5959}
    6060
    61 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
     61if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:^clang|LLVM) version) ([2-9]\.[0-9]+)/) {
     62        # Apple clang versions 2.1 and 3.0 correspond to LLVM 3.0
     63        # Apple clang versions 3.1 and 4.1 correspond to LLVM 3.1
     64        $avx = ($2>=2.1) + ($2>=3.1);
     65}
     66
     67if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
    6268        $avx = ($2>=3.0) + ($2>3.0);
    6369}
    6470
  • ./crypto/sha/asm/sha1-x86_64.pl

    old new  
    107107        $avx = ($1>=10) + ($1>=11);
    108108}
    109109
    110 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([2-9]\.[0-9]+)/) {
     110if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:^clang|LLVM) version) ([2-9]\.[0-9]+)/) {
     111        # Apple clang versions 2.1 and 3.0 correspond to LLVM 3.0
     112        # Apple clang versions 3.1 and 4.1 correspond to LLVM 3.1
     113        $avx = ($2>=2.1) + ($2>=3.1);
     114}
     115
     116if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
    111117        $avx = ($2>=3.0) + ($2>3.0);
    112118}
    113119
  • ./crypto/sha/asm/sha256-mb-x86_64.pl

    old new  
    5959        $avx = ($1>=10) + ($1>=11);
    6060}
    6161
    62 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
     62if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:^clang|LLVM) version) ([2-9]\.[0-9]+)/) {
     63        # Apple clang versions 2.1 and 3.0 correspond to LLVM 3.0
     64        # Apple clang versions 3.1 and 4.1 correspond to LLVM 3.1
     65        $avx = ($2>=2.1) + ($2>=3.1);
     66}
     67
     68if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
    6369        $avx = ($2>=3.0) + ($2>3.0);
    6470}
    6571
  • ./crypto/sha/asm/sha512-x86_64.pl

    old new  
    124124        $avx = ($1>=10) + ($1>=11);
    125125}
    126126
    127 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
     127if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^Apple (?:^clang|LLVM) version) ([2-9]\.[0-9]+)/) {
     128        # Apple clang versions 2.1 and 3.0 correspond to LLVM 3.0
     129        # Apple clang versions 3.1 and 4.1 correspond to LLVM 3.1
     130        $avx = ($2>=2.1) + ($2>=3.1);
     131}
     132
     133if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
    128134        $avx = ($2>=3.0) + ($2>3.0);
    129135}
    130136