https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81689
Bug ID: 81689 Summary: libgomp.c/target-link-1.c fails for nvptx: #pragma omp target link not implemented Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- The error looks like: ... ptxas /tmp/ccOmk7fK.o, line 102; error : State space mismatch between instruction and address in instruction 'ld'^M ptxas /tmp/ccOmk7fK.o, line 121; error : State space mismatch between instruction and address in instruction 'ld'^M ptxas /tmp/ccOmk7fK.o, line 126; error : State space mismatch between instruction and address in instruction 'ld'^M ptxas /tmp/ccOmk7fK.o, line 231; error : State space mismatch between instruction and address in instruction 'ld'^M ptxas /tmp/ccOmk7fK.o, line 252; error : State space mismatch between instruction and address in instruction 'ld'^M ptxas /tmp/ccOmk7fK.o, line 289; error : State space mismatch between instruction and address in instruction 'ld'^M ptxas /tmp/ccOmk7fK.o, line 294; error : State space mismatch between instruction and address in instruction 'ld'^M ptxas /tmp/ccOmk7fK.o, line 301; error : State space mismatch between instruction and address in instruction 'ld'^M ptxas /tmp/ccOmk7fK.o, line 102; error : Unknown symbol 'a_linkptr'^M ptxas /tmp/ccOmk7fK.o, line 102; fatal : Label expected for forward reference of 'a_linkptr'^M ptxas fatal : Ptx assembly aborted due to errors^M nvptx-as: ptxas returned 255 exit status^M mkoffload: fatal error: x86_64-none-linux-gnu-accel-nvptx-none-gcc returned 1 exit status^M compilation terminated.^M ... The problem is that #pragma omp target link is not implemented for nvptx, as mentioned before here ( https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00972.html ): ... With OpenMP/PTX offloading there are 5 additional failures in check-target-libgomp: <SNIP> One with 'target link' (not implemented) FAIL: libgomp.c/target-link-1.c (test for excess errors) ...