Ticket #1862: auto.warnings.visibility.patch

File auto.warnings.visibility.patch, 1.7 KB (added by jkeenan, 4 years ago)

patch requiring gcc >=4.0 for -fvisibility=hidden

  • config/auto/warnings.pm

    diff --git a/config/auto/warnings.pm b/config/auto/warnings.pm
    index 52a6068..8fef467 100644
    a b  
    100100 
    101101    my @gcc_or_gpp = qw( 
    102102        -falign-functions=16 
    103         -fvisibility=hidden 
    104103        -funit-at-a-time 
    105104        -maccumulate-outgoing-args 
    106105        -W 
     
    150149        -Wvariadic-macros 
    151150        -Wwrite-strings 
    152151    ); 
     152#    push @gcc_or_gpp, '-fvisibility=hidden' 
     153#        if (  $conf->data->get('gccversion') >= 4.0 and 
     154#            ! $conf->data->get('sym_export') ); 
    153155 
    154156    $gcc->{'basic'} = [ @gcc_or_gpp ]; 
    155157    $gpp->{'basic'} = [ @gcc_or_gpp ]; 
     
    292294        return 1; 
    293295    } 
    294296 
     297    if ( 
     298        ( $compiler eq 'gcc' or $compiler eq 'g++' ) and 
     299        ( $conf->data->get('gccversion') >= 4.0    ) and 
     300        ( ! $conf->data->get('sym_export') ) 
     301    ) {  
     302        push @{$self->{'warnings'}{$compiler}{'basic'}}, 
     303            '-fvisibility=hidden'; 
     304    }; 
    295305    # standard warnings. 
    296306    my @warnings = grep {$self->valid_warning($conf, $_)} 
    297307        @{$self->{'warnings'}{$compiler}{'basic'}}; 
  • t/steps/auto/warnings-01.t

    diff --git a/t/steps/auto/warnings-01.t b/t/steps/auto/warnings-01.t
    index 1810348..50a8d07 100644
    a b  
    7070# Simulate case where --cage warnings are requested 
    7171$conf->options->set( verbose => undef ); 
    7272$step = test_step_constructor_and_description($conf); 
    73 $conf->data->set( gccversion => 'defined' ); 
     73$conf->data->set( gccversion => '4.0' ); 
    7474$conf->data->set( 'g++' => undef ); 
    7575$conf->options->set( cage => 1 ); 
    7676ok($step->runstep($conf), "runstep() returned true value");