Hi Maciej,

On 1/6/20 4:25 PM, Maciej W. Rozycki wrote:
Without the patch, the compiler is found (with [find_gcc] I suppose) and
invoked as x86_64-none-linux-gnu-gcc. That works fine for us, but we do
(I think) "installed testing", which IIUC is atypical.
[…]
However before I make any definite conclusion I would like to understand
how things are supposed to work with an offload-enabled compiler.
[…]
As I recall there is a separate compiler invoked for the offload target.
I don't have a suitable setup available to handnor an easy way to make
one.  Can you therefore please figure out and tell me how this is
arranged?  Also where does the libgomp.spec file come from?

The main compiler, targetting the host, splits off the device functions – and those are processed via lto-wrapper (for each device target) – and then at the end, the host and device parts are combined, cf. https://gcc.gnu.org/wiki/Offloading – search for "mkoffload".

In terms of directory structure, one has something like:

./libexec/gcc/x86_64-none-linux-gnu/10.0.0/lto1
./libexec/gcc/x86_64-none-linux-gnu/10.0.0/accel/nvptx-none/lto1
./libexec/gcc/x86_64-none-linux-gnu/10.0.0/accel/nvptx-none/mkoffload
./nvptx-none/lib/libgomp.spec
./x86_64-none-linux-gnu/lib64/libgomp.spec

And the compiler is configured to know which accelerators are available because it has been configured such. See for instance https://sources.debian.org/src/gcc-10/10-20200107-1/debian/rules2/ for how building an offload compiler (nvptx + [new with GCC 10:] gcn) works.

2. The definition of GCC_UNDER_TEST in libgomp-test-support.exp is only
    made if inexistent, and then you can predefine the variable in site.exp
    however you find appropriate.

I think that's sounds like a reasonable approach. However, I believe others (including you) know much more about sysroot etc. than I do. (I either do in-build-tree testing (w/o offloading, w/o sysroot) on x86-linux or simply run a run-testsuite script as a black box.)

Tobias

Reply via email to