Skip to content

Commit

Permalink
[build] fix powerpc --m=64 GH #1110
Browse files Browse the repository at this point in the history
ppc64 can run on powerpc 32bit OS with a ppc64 CPU, and needs -m64 then.
-mabi=64 does not work there.
  • Loading branch information
Reini Urban committed Oct 23, 2014
1 parent 8fc1305 commit 37ed548
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
@@ -1,7 +1,7 @@
2014-11-18 release 6.10.0
- Core
- Build
+ Set -mabi=64 for gcc --m=64 on mips or ppc #1110
+ Set -mabi=64 for gcc --m=64 on mips, -m64 on powerpc #1110
+ Add --{en,dis}able-static #1104
- Documentation
- Tests
Expand Down
12 changes: 7 additions & 5 deletions config/auto/gcc.pm
@@ -1,4 +1,4 @@
# Copyright (C) 2001-2012, Parrot Foundation.
# Copyright (C) 2001-2014, Parrot Foundation.

=head1 NAME
Expand Down Expand Up @@ -90,10 +90,11 @@ sub _evaluate_gcc {
if ($m) {
my $archname = $conf->data->get('archname');
# other multilib platforms usually default to 32bit. untested: sparc64, arm64
if ( $archname =~ /^(mips|ppc)64/ && $m eq '32' ) {
if ( $archname =~ /^(mips|powerpc)64/ && $m eq '32' ) {
my $abi = $1 eq 'mips' ? '-mabi=32' : '-m32';
$archname =~ s/64//;
for my $cc (qw(cc cxx link ld)) {
$conf->data->add( ' ', $cc, '-mabi=32' );
$conf->data->add( ' ', $cc, $abi );
}
# and lib flags
for my $lib (qw(ld_load_flags ld_share_flags ldflags linkflags)) {
Expand All @@ -102,10 +103,11 @@ sub _evaluate_gcc {
$conf->data->set( $lib, $ni );
}
}
elsif ( $archname =~ /^(mips|ppc)/ && $m eq '64' ) {
elsif ( $archname =~ /^(mips|powerpc)/ && $m eq '64' ) {
my $abi = $1 eq 'mips' ? '-mabi=64' : '-m64';
$archname =~ s/(s|c)$/$164/;
for my $cc (qw(cc cxx link ld)) {
$conf->data->add( ' ', $cc, '-mabi=64' );
$conf->data->add( ' ', $cc, $abi );
}
# and lib flags
for my $lib (qw(ld_load_flags ld_share_flags ldflags linkflags)) {
Expand Down

0 comments on commit 37ed548

Please sign in to comment.