https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92553
Bug ID: 92553 Summary: OpenMP offload static linking error Product: gcc Version: 9.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: xw111luoye at gmail dot com CC: marxin at gcc dot gnu.org Target Milestone: --- I have a linking error when building miniQMC. The offload functions are first archived in libqmcwfs.a and then linked to the final binary. Recipe: git clone https://github.com/QMCPACK/miniqmc.git cd miniqmc git co OMP_offload cd build cmake -D CMAKE_CXX_COMPILER=g++ -D ENABLE_OFFLOAD=1 .. make -j32 check_spo /soft/compilers/gcc/9.2.0/linux-rhel7-x86_64/bin/g++ -fopenmp -foffload=nvptx-none -foffload=-lm -fomit-frame-pointer -finline-limit=1000 -fstrict-aliasing -funroll-all-loops -D__forceinline=inline -Wno-deprecated -march=native -O3 -DNDEBUG -ffast-math CMakeFiles/check_spo.dir/check_spo.cpp.o -o ../../bin/check_spo ../../lib/libqmcwfs.a ../../lib/libqmcbase.a ../../lib/libqmcutil.a -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl -L/soft/compilers/intel-2019/compilers_and_libraries/linux/mkl/lib/intel64 -Wl,-rpath,/soft/compilers/intel-2019/compilers_and_libraries/linux/mkl/lib/intel64 during IPA pass: fnsummary lto1: internal compiler error: in inline_read_section, at ipa-fnsummary.c:3332 0x7d3a86 inline_read_section ../../gcc/gcc/ipa-fnsummary.c:3332 0x7d3a86 ipa_fn_summary_read ../../gcc/gcc/ipa-fnsummary.c:3404 0x8d7a31 ipa_read_summaries_1 ../../gcc/gcc/passes.c:2842 0x5af662 read_cgraph_and_symbols ../../gcc/gcc/lto/lto.c:2972 0x5af662 lto_main() ../../gcc/gcc/lto/lto.c:3387 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. mkoffload: fatal error: /soft/compilers/gcc/9.2.0/linux-rhel7-x86_64/bin/x86_64-pc-linux-gnu-accel-nvptx-none-gcc returned 1 exit status compilation terminated. lto-wrapper: fatal error: /soft/compilers/gcc/9.2.0/linux-rhel7-x86_64/libexec/gcc/x86_64-pc-linux-gnu/9.2.0//accel/nvptx-none/mkoffload returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status