Skip to content

Commit 2985b80

Browse files
authored
Merge pull request #9019 from bwbarrett/bugfix/wrapper-dash-L-ordering
Ensure that libdir is always first in search path
2 parents e26592e + bed9f20 commit 2985b80

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

config/opal_setup_wrappers.m4

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ dnl and Technology (RIST). All rights reserved.
1717
dnl Copyright (c) 2016 IBM Corporation. All rights reserved.
1818
dnl Copyright (c) 2020 Triad National Security, LLC. All rights
1919
dnl reserved.
20+
dnl Copyright (c) 2021 Amazon.com, Inc. or its affiliates.
21+
dnl All Rights reserved.
2022
dnl $COPYRIGHT$
2123
dnl
2224
dnl Additional copyrights may follow
@@ -291,9 +293,11 @@ AC_DEFUN([RPATHIFY_LDFLAGS_INTERNAL],[
291293
esac
292294
done
293295

294-
# Now add in the RPATH args for @{libdir}, and the RUNPATH args
296+
# add in the RPATH args for @{libdir}, and the RUNPATH
297+
# args. The install libdir goes first, so that we prefer
298+
# our libmpi over any imposter libmpi we might find.
295299
rpath_tmp=`echo ${$2} | sed -e s/LIBDIR/@{libdir}/`
296-
$1="${$1} $rpath_out $rpath_tmp ${$3}"
300+
$1="${$1} $rpath_tmp $rpath_out ${$3}"
297301
])
298302
OPAL_VAR_SCOPE_POP
299303
])

opal/tools/wrappers/opal_wrapper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
1616
* Copyright (c) 2015 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
18-
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
18+
* Copyright (c) 2018-2021 Amazon.com, Inc. or its affiliates. All Rights reserved.
1919
* $COPYRIGHT$
2020
*
2121
* Additional copyrights may follow
@@ -359,7 +359,7 @@ static void data_callback(const char *key, const char *value)
359359
char *line;
360360
opal_asprintf(&line, OPAL_INCLUDE_FLAG "%s",
361361
options_data[parse_options_idx].path_includedir);
362-
opal_argv_append_nosize(&options_data[parse_options_idx].preproc_flags, line);
362+
opal_argv_prepend_nosize(&options_data[parse_options_idx].preproc_flags, line);
363363
free(line);
364364
}
365365
}
@@ -371,7 +371,7 @@ static void data_callback(const char *key, const char *value)
371371
char *line;
372372
opal_asprintf(&line, OPAL_LIBDIR_FLAG "%s",
373373
options_data[parse_options_idx].path_libdir);
374-
opal_argv_append_nosize(&options_data[parse_options_idx].link_flags, line);
374+
opal_argv_prepend_nosize(&options_data[parse_options_idx].link_flags, line);
375375
free(line);
376376
}
377377
} else if (0 == strcmp(key, "opalincludedir")) {

0 commit comments

Comments
 (0)