This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Add better testing for the linker wrapper
ClosedPublic

Authored by jhuber6 on Apr 19 2022, 1:31 PM.

Details

Summary

The linker wrapper is used to perform linking and wrapping of embedded
device object files. Currently its internals are not able to be tested
easily. This patch adds the --dry-run and --print-wrapped-module
options to investigate the link jobs that will be run along with the
wrapped code that will be created to register the binaries.

Diff Detail

Event Timeline

jhuber6 created this revision.Apr 19 2022, 1:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2022, 1:31 PM
Herald added a subscriber: guansong. · View Herald Transcript
jhuber6 requested review of this revision.Apr 19 2022, 1:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2022, 1:31 PM
JonChesterfield accepted this revision.Apr 19 2022, 2:37 PM

Nice! I like the strategy.

This revision is now accepted and ready to land.Apr 19 2022, 2:37 PM
jhuber6 updated this revision to Diff 423743.Apr 19 2022, 2:42 PM

Fix test on Windows failing because of ".exe" at the end.

This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Apr 20 2022, 3:47 AM

Looks like this breaks tests on Mac: http://45.33.8.238/macm1/33656/step_7.txt

Please take a look and revert for now if it takes a while to fix. (Maybe just needs an explicit triple?)

Looks like this breaks tests on Mac: http://45.33.8.238/macm1/33656/step_7.txt

Please take a look and revert for now if it takes a while to fix. (Maybe just needs an explicit triple?)

Yeah I probably just need to specify the triple, I forgot that Mach-O doesn't like these section names. I pushed rG1dfe0273fda3 to address this, let me know if it's still broken.

Thanks, that did the trick :)

zibi added a subscriber: zibi.Apr 20 2022, 2:55 PM
zibi added inline comments.
clang/test/Driver/linker-wrapper-image.c
8

On PowerPC I'm seeing the following error: pointing at @ char:
clang/test/Driver/linker-wrapper-image.c:10:12: error: OPENMP: expected string not found in input
// OPENMP: @__start_omp_offloading_entries = external hidden constant %__tgt_offload_entry

Are you aware of this?

clang/test/Driver/linker-wrapper.c
9

Similar error to above, the coordinates are off by 2 because of subsequent changes:

clang/test/Driver/linker-wrapper.c:11:16: error: NVPTX_LINK: expected string not found in input
// NVPTX_LINK: nvlink{{.*}}-m64 -o {{.*}}.out -arch sm_70 {{.*}}.o {{.*}}.o

jhuber6 added inline comments.Apr 20 2022, 3:27 PM
clang/test/Driver/linker-wrapper-image.c
8

Do you have a link to a buildbot with the full error log? I'll try to test it locally by manually setting the triple.

jhuber6 added inline comments.Apr 20 2022, 7:54 PM
clang/test/Driver/linker-wrapper-image.c
8

I tested this on a PPC64LE machine and couldn't reproduce, do you have any more information?

zibi added inline comments.Apr 21 2022, 5:17 AM
clang/test/Driver/linker-wrapper-image.c
8

Yes, those test cases do pass on external bots. At the time of reporting I did not know this affects only the internal builds. We will handle this internally.