Ticket #364: tt364-sparc-memalign.patch

File tt364-sparc-memalign.patch, 2.4 KB (added by rurban, 6 years ago)

warn also at alignment check

  • config/init/hints/solaris.pm

    old new  
    101101        $conf->data->deltrigger( "gccversion", "solaris_ieee" ); 
    102102    }; 
    103103    $conf->data->settrigger( "gccversion", "solaris_ieee", $solaris_ieee_cb ); 
     104 
     105    # Sparc64 Sun Pro cc has a strict default ptr_alignment of 8 
     106    # See TT #364 
     107    my $solaris_memalign_cb = sub { 
     108        my ( $key, $gccversion ) = @_; 
     109 
     110        if ($gccversion) { 
     111            # Don't know how to do this for gcc. 
     112        } 
     113        elsif ($conf->data->get('byteorder') eq '87654321') { # sun pro cc Sparc64 only 
     114            my $linkflags = $conf->data->get('linkflags'); 
     115            $conf->data->add( ' ', linkflags => '-xmemalign=4s' ) 
     116                unless $linkflags =~ /-xmemalign/; 
     117        } 
     118        $conf->data->deltrigger( "gccversion", "solaris_memalign" ); 
     119    }; 
     120    $conf->data->settrigger( "gccversion", "solaris_memalign", $solaris_memalign_cb ); 
    104121} 
    105122 
    1061231; 
  • config/auto/alignptrs.pm

    old new  
    3737        $align = $conf->data->get('ptr_alignment'); 
    3838        $result_str .= "configured: "; 
    3939    } 
    40     elsif ( $conf->data->get_p5('OSNAME') eq 'hpux' && $conf->data->get_p5('ccflags') !~ /DD64/ ) { 
     40    elsif ( $conf->data->get_p5('OSNAME') eq 'hpux' 
     41            && $conf->data->get_p5('ccflags') !~ /DD64/ ) { 
    4142 
    4243        # HP-UX 10.20/32 hangs in this test. 
    4344        $align = 4; 
     
    9495sub _finalize_result_str { 
    9596    my $self = shift; 
    9697    my ($align, $result_str) = @_; 
    97     $result_str .= " $align byte"; 
    98     $result_str .= "s" unless $align == 1; 
     98    # On 8-byte ptr_alignment we cannot read 4-byte pbc's. Warn the user about it. 
     99    # TODO: inform the user to use --64compat for parrot. Milestone v2.6 
     100    if ($align > 4) { 
     101        $result_str .= " $align byte"; 
     102        $result_str .= "s (Warning: 4-byte pbc's cannot be read!)"; 
     103    } 
     104    else { 
     105        $result_str .= " $align byte"; 
     106        $result_str .= "s" unless $align == 1; 
     107    } 
    99108    $self->set_result($result_str); 
    100109} 
    101110