[Bug lto/85451] New: [offloading] Improve lto-wrapper error message when not finding mkoffload

vries at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 18 12:26:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85451

            Bug ID: 85451
           Summary: [offloading] Improve lto-wrapper error message when
                    not finding mkoffload
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

When using an installed host/offloading compiler, you may run into this error
message:
...
$ ./install/bin/x86_64-pc-linux-gnu-gcc -fopenacc test.c
lto-wrapper: fatal error: problem with building target image for nvptx-none

compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
...

This means that mkoffload could not be found.

By providing -B with the path to accel/nvptx-none/mkoffload, we get past the
rror:
...
$ ./install/bin/x86_64-pc-linux-gnu-gcc -fopenacc test.c \
  -B $(pwd -P)/install/offload-nvptx-none/libexec/gcc/x86_64-pc-linux-gnu/8.0.1
mkoffload: fatal error: offload compiler
x86_64-pc-linux-gnu-accel-nvptx-none-gcc not found
compilation terminated.
lto-wrapper: fatal error:
/home/vries/oacc/trunk/install/offload-nvptx-none/libexec/gcc/x86_64-pc-linux-gnu/8.0.1//accel/nvptx-none/mkoffload
returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
...

And by providing another -B with the path to
x86_64-pc-linux-gnu-accel-nvptx-none-gcc, we finally succeed:
...
$ ./install/bin/x86_64-pc-linux-gnu-gcc -fopenacc test.c \
  -B $(pwd -P)/install/offload-nvptx-none/bin \
  -B$(pwd -P)/install/offload-nvptx-none/libexec/gcc/x86_64-pc-linux-gnu/8.0.1
$
...

From the last error message, it's easy to figure out that
x86_64-pc-linux-gnu-accel-nvptx-none-gcc cannot be found (though it doesn't
suggest using -B to fix that).

But from the first error message, it's impossible to know what's going wrong
without stepping with gdb through lto-wrapper.


More information about the Gcc-bugs mailing list