summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-05-02 12:46:44 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-05-02 12:46:55 -0700
commit6abe1c3084798d3e5f32926c352643e557073e01 (patch)
tree2c0efa69af61cc41cbef8d5c69a4537d033a6101
parent7df457899078c5889194c1736cffcfd4d50f5305 (diff)
gfortran: Get asan library from TEST_ALWAYS_FLAGS
Update gfortran_target_compile to get the newly built asan library from TEST_ALWAYS_FLAGS to avoid: /usr/bin/ld: cannot find libasan_preinit.o: No such file or directory /usr/bin/ld: cannot find -lasan collect2: error: ld returned 1 exit status compiler exited with status 1 FAIL: gfortran.dg/asan/pointer_assign_16.f90 -fsanitize=address -O0 (test for excess errors) PR fortran/94788 * lib/gfortran.exp (gfortran_target_compile): Get asan library from TEST_ALWAYS_FLAGS.
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/lib/gfortran.exp8
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a9c72f982fe..b0c6f9a8cef 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2020-05-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR fortran/94788
+ * lib/gfortran.exp (gfortran_target_compile): Get asan library
+ from TEST_ALWAYS_FLAGS.
+
2020-05-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/94788
diff --git a/gcc/testsuite/lib/gfortran.exp b/gcc/testsuite/lib/gfortran.exp
index 016d77ca4f8..fe99111788f 100644
--- a/gcc/testsuite/lib/gfortran.exp
+++ b/gcc/testsuite/lib/gfortran.exp
@@ -234,6 +234,7 @@ proc gfortran_target_compile { source dest type options } {
global gluefile wrap_flags
global ALWAYS_GFORTRANFLAGS
global GFORTRAN_UNDER_TEST
+ global TEST_ALWAYS_FLAGS
global flags_to_postpone
global board_info
@@ -242,6 +243,13 @@ proc gfortran_target_compile { source dest type options } {
lappend options "ldflags=${wrap_flags}"
}
+ # TEST_ALWAYS_FLAGS are flags that should be passed to every
+ # compilation. They are passed first to allow individual
+ # tests to override them.
+ if [info exists TEST_ALWAYS_FLAGS] {
+ set options [concat "{additional_flags=$TEST_ALWAYS_FLAGS}" $options]
+ }
+
# bind_pic_locally adds -fpie/-fPIE flags to flags_to_postpone and it is
# appended here to multilib_flags as it can be overridden by the latter
# if it was added earlier. After the target_compile, multilib_flags is