On 09/28/2015 02:35 PM, James Norris wrote:
The attached patch fixes a problem when doing remote testing.
Specifically, testing of the atomic tests found in gcc/atomic.
The code in atomic_init precludes the setting of the variable
'link_flags' when doing remote testing. The conditional test
can be safely removed as get_multilibs will return "", and
atomic_link_flags will return the necessary '-latomic' that
will allow the atomic tests to successfully link.
I guess remote host is sufficiently exotic that no one has noticed until
now?
It looks like this pattern occurs across many .exp files, at least:
asan-dg.exp
cilk-plus-dg.exp
mpx-dg.exp
tsan-dg.exp
ubsan-dg.exp
We should check that these don't need fixing (did you only see
unexpected atomic failures?) It looks like they may be ok; for example
-mmpx seems to imply -lmpx at the specs level.
I'm slightly worried about whether the code in atomic_link_flags will
reliably find the right -L options and LD_LIBRARY_PATH on all possible
setups. It looks like it's searching for things on the build machine,
and I expect you have a setup where the host has the build directory
mounted in the same location.
Maybe it's better to just append "-latomic" unconditionally, and remove
it from atomic_link_flags, so that the latter function only sets up
LD_LIBRARY_PATH etc. That would make atomic-dg closer in behaviour to
e.g. mpx-dg. Mike, any thoughts?
Bernd