diff --git a/config/auto/warnings.pm b/config/auto/warnings.pm index 52a6068..8fef467 100644 --- a/config/auto/warnings.pm +++ b/config/auto/warnings.pm @@ -100,7 +100,6 @@ sub _init { my @gcc_or_gpp = qw( -falign-functions=16 - -fvisibility=hidden -funit-at-a-time -maccumulate-outgoing-args -W @@ -150,6 +149,9 @@ sub _init { -Wvariadic-macros -Wwrite-strings ); +# push @gcc_or_gpp, '-fvisibility=hidden' +# if ( $conf->data->get('gccversion') >= 4.0 and +# ! $conf->data->get('sym_export') ); $gcc->{'basic'} = [ @gcc_or_gpp ]; $gpp->{'basic'} = [ @gcc_or_gpp ]; @@ -292,6 +294,14 @@ sub runstep { return 1; } + if ( + ( $compiler eq 'gcc' or $compiler eq 'g++' ) and + ( $conf->data->get('gccversion') >= 4.0 ) and + ( ! $conf->data->get('sym_export') ) + ) { + push @{$self->{'warnings'}{$compiler}{'basic'}}, + '-fvisibility=hidden'; + }; # standard warnings. my @warnings = grep {$self->valid_warning($conf, $_)} @{$self->{'warnings'}{$compiler}{'basic'}}; diff --git a/t/steps/auto/warnings-01.t b/t/steps/auto/warnings-01.t index 1810348..50a8d07 100644 --- a/t/steps/auto/warnings-01.t +++ b/t/steps/auto/warnings-01.t @@ -70,7 +70,7 @@ $conf->replenish($serialized); # Simulate case where --cage warnings are requested $conf->options->set( verbose => undef ); $step = test_step_constructor_and_description($conf); -$conf->data->set( gccversion => 'defined' ); +$conf->data->set( gccversion => '4.0' ); $conf->data->set( 'g++' => undef ); $conf->options->set( cage => 1 ); ok($step->runstep($conf), "runstep() returned true value");