Skip to content

Commit ec268bf

Browse files
committed
Patch configure to support PowerPC little endian
The earliest libtool release that supports PowerPC little endian is 2.4.3. Patch configure to enable support for this architecture. (cherry picked from commit open-mpi/ompi@12c5063d58d3)
1 parent ac58b53 commit ec268bf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

autogen.pl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
# Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
88
# Copyright (c) 2015 Research Organization for Information Science
99
# and Technology (RIST). All rights reserved.
10+
# Copyright (c) 2015 IBM Corporation. All rights reserved.
11+
#
1012
# $COPYRIGHT$
1113
#
1214
# Additional copyrights may follow
@@ -980,6 +982,19 @@ sub patch_autotools_output {
980982
push(@verbose_out, $indent_str . "Patching configure for IBM xlf libtool bug\n");
981983
$c =~ s/(\$LD -shared \$libobjs \$deplibs \$)compiler_flags( -soname \$soname)/$1linker_flags$2/g;
982984

985+
#Check if we are using a recent enough libtool that supports PowerPC little endian
986+
if(index($c, 'powerpc64le-*linux*)') == -1) {
987+
push(@verbose_out, $indent_str . "Patching configure for PowerPC little endian support\n");
988+
my $replace_string = "x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*|";
989+
$c =~ s/x86_64-\*kfreebsd\*-gnu\|x86_64-\*linux\*\|ppc\*-\*linux\*\|powerpc\*-\*linux\*\|/$replace_string/g;
990+
$replace_string =
991+
"powerpc64le-*linux*)\n\t LD=\"\${LD-ld} -m elf32lppclinux\"\n\t ;;\n\t powerpc64-*linux*)";
992+
$c =~ s/ppc64-\*linux\*\|powerpc64-\*linux\*\)/$replace_string/g;
993+
$replace_string =
994+
"powerpcle-*linux*)\n\t LD=\"\${LD-ld} -m elf64lppc\"\n\t ;;\n\t powerpc-*linux*)";
995+
$c =~ s/ppc\*-\*linux\*\|powerpc\*-\*linux\*\)/$replace_string/g;
996+
}
997+
983998
# Fix consequence of broken libtool.m4
984999
# see http://lists.gnu.org/archive/html/bug-libtool/2015-07/msg00002.html and
9851000
# https://github.com/open-mpi/ompi/issues/751

0 commit comments

Comments
 (0)