]> git.ipfire.org Git - thirdparty/gcc.git/commit
[WIP] OpenMP 5.0: requires directive: workaround to fix libgomp IntelMIC plugin build
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 3 Mar 2021 21:37:58 +0000 (22:37 +0100)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 21 Jun 2022 13:11:34 +0000 (14:11 +0100)
commit47e5ba646c20fdb64fa233dd570f155880cafd04
tree6f4d8f8f1d59f71d2f456f4cca90e0c8fe9d4684
parentfbf951ba1a0fd92d1195118ca616e7001c7d90b8
[WIP] OpenMP 5.0: requires directive: workaround to fix libgomp IntelMIC plugin build

Fix-up for og10 commit c2e4a17adc0989f216c7fc3f93f150c66adba23a "OpenMP 5.0:
requires directive".

The GCC offloading target configurations don't build/use
'crtoffloadbegin.o'/'crtoffloadtable.o'/'crtoffloadend.o'
('libgcc/offloadstuff.c'), but the libgomp IntelMIC plugin still does link
against libgomp, and the latter unconditionally refers to
'__requires_mask_table', '__requires_mask_table_end':

    make[3]: Entering directory '[...]/build-gcc-offload-x86_64-intelmicemul-linux-gnu/x86_64-intelmicemul-linux-gnu/liboffloadmic/plugin'
    [...]/build-gcc-offload-x86_64-intelmicemul-linux-gnu/./gcc/xg++ [...] -loffloadmic_target -lcoi_device -lgomp -rdynamic ../ofldbegin.o offload_target_main.o ../ofldend.o -o offload_target_main
    ./../../libgomp/.libs/libgomp.so: undefined reference to `__requires_mask_table_end'
    ./../../libgomp/.libs/libgomp.so: undefined reference to `__requires_mask_table'
    collect2: error: ld returned 1 exit status
    Makefile:806: recipe for target 'offload_target_main' failed
    make[3]: *** [offload_target_main] Error 1

I have not researched what a proper fix would look like.

libgomp/
* target.c (__requires_mask_table, __requires_mask_table_end): Add
'__attribute__((weak))'.
libgomp/ChangeLog.omp
libgomp/target.c