On Fri, Oct 02, 2020 at 05:33:13PM +0000, Joseph Myers wrote:
> On Fri, 2 Oct 2020, Tobias Burnus wrote:
> 
> > However, this flag can be added into the offload-target's libgomp.spec,
> > which avoids all kind of issues. That's what this patch now does.
> > 
> > I tested it with x86_64-gnu-linux w/o + w/ nvptx-none. Result:
> > * x86_64-gnu-linux's libgomp.spec:
> >   "*link_gomp: -lgomp %{static: -ldl } --as-needed -latomic --no-as-needed"
> > * nvptx-none's libgomp.spec:
> >   "*link_gomp: -lgomp  -latomic"
> > 
> > On x86-64, a simple test program did not use and also did not link 
> > libatomic.
> > 
> > OK?
> 
> Do all testsuites that link using libgomp.spec also use the testsuite 
> logic from atomic-dg.exp to locate libatomic for build-tree testing 
> (otherwise -latomic will fail if it can't be found and there isn't an 
> installed system copy that the driver might fall back on, even with 
> --as-needed)?

The only testsuite that uses libgomp.spec is libgomp/testsuite/, the
gcc/testsuite/ tests if they test -fopenmp must be only dg-do compile tests,
all the link and runtime tests are in libgomp.
There is no ordering between libatomic and libgomp build, so we shouldn't be
querying libatomic in libgomp configury.  Not sure if we can rely on if
libatomic is among configdirs then libatomic will be actually built.

        Jakub

Reply via email to