https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100160
--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> --- (In reply to Tom de Vries from comment #1) > ... > $ ./install/bin/g++ test-1.cpp -fopenmp -foffload=nvptx-none > lto-wrapper: fatal error: could not find accel/nvptx-none/mkoffload in > /home/vries/oacc/trunk/install/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/ > :/home/vries/oacc/trunk/install/bin/../libexec/gcc/ (consider using ‘-B’) > compilation terminated. > /usr/bin/ld: error: lto-wrapper failed > collect2: error: ld returned 1 exit status > ... I can make this work by adding: ... $ ./install/bin/g++ test-1.cpp -fopenmp -foffload=nvptx-none -flto \ -B $(pwd -P)/install/offload-nvptx-none/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/ \ -B $(pwd -P)/install/offload-nvptx-none/bin/ $ LD_LIBRARY_PATH=./install/lib64 ./a.out Threads: 8 Devices: 1 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 ... Hmm, this actually executes on the target, the -fno-lto case executes the host fallback.