1
1

autogen: patch config/ltmain.sh in order to make NAG compiler pass the -pthread option to the linker

Этот коммит содержится в:
Gilles Gouaillardet 2016-01-12 14:33:01 +09:00
родитель 544a2f1631
Коммит 20bfc6b3d1
3 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -901,10 +901,15 @@ sub patch_autotools_output {
# enough Libtool that dosn't need this patch. But don't alarm the
# user and make them think that autogen failed if this patch fails --
# make the errors be silent.
# Also patch ltmain.sh for NAG compiler
if (-f "config/ltmain.sh") {
verbose "$indent_str"."Patching PGI compiler version numbers in ltmain.sh\n";
system("$patch_prog -N -p0 < $topdir/config/ltmain_pgi_tp.diff >/dev/null 2>&1");
unlink("config/ltmain.sh.rej");
verbose "$indent_str"."Patching \"-pthread\" option for NAG compiler in ltmain.sh\n";
system("$patch_prog -N -p0 < $topdir/config/ltmain_nag_pthread.diff >/dev/null 2>&1");
unlink("config/ltmain.sh.rej");
}
# If there's no configure script, there's nothing else to do.

Просмотреть файл

@ -13,6 +13,8 @@
# Copyright (c) 2010 Oracle and/or its affiliates. All rights
# reserved.
# Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
# Copyright (c) 2016 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -23,6 +25,7 @@
EXTRA_DIST = \
distscript.sh \
opal_get_version.m4sh \
ltmain_nag_pthread.diff \
ltmain_pgi_tp.diff \
opal_mca_priority_sort.pl \
find_common_syms

18
config/ltmain_nag_pthread.diff Обычный файл
Просмотреть файл

@ -0,0 +1,18 @@
--- config/ltmain.sh
+++ config/ltmain.sh
@@ -6417,8 +6417,14 @@
func_source "$lib"
# Convert "-framework foo" to "foo.ltframework"
+ # and "-pthread" to "-Wl,-pthread" if NAG compiler
if test -n "$inherited_linker_flags"; then
- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ case "$CC" in
+ nagfor*)
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g' | $SED 's/-pthread/-Wl,-pthread'`;;
+ *)
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`;;
+ esac
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;