On Sep 28, 2015, at 5:35 AM, James Norris <jnor...@codesourcery.com> 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. > > OK for trunk?
I don't think this is appropriate. The design is for remote host testing to have the compete shape of an installed compiler as I recall. When it does, it then is indistinguishable from an installed compiler, and when it is installed, then no -L nor -B flag is necessary for it to work. The link_flags only exists to add these flags, not the -l flag. That is the thing that is wrong. Remove that, and add "libs=-latomic” to someplace that will inject that option. I stole that line from objc.exp: append options "libs=-lobjc” or otherwise unconditionally put -latomic on the link line (some place that isn’t protected by is_remote host).