[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

Gheorghe-Teodor Bercea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 9 08:52:56 PST 2018

gtbercea added inline comments.

Comment at: test/Driver/openmp-offload-gpu.c:150
+/// bitcode library and add it to the LIBRARY_PATH.
+// RUN:   touch %T/libomptarget-nvptx-sm_60.bc
+// RUN:   env LIBRARY_PATH=%T %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
Hahnfeld wrote:
> gtbercea wrote:
> > gtbercea wrote:
> > > Hahnfeld wrote:
> > > > grokos wrote:
> > > > > ABataev wrote:
> > > > > > Create empty `libomptarget-nvptx-sm_60.bc` in `Driver/lib` directory and use it in the test rather create|delete it dynamically.
> > > > > I'm also in favour of this approach. On some systems /tmp is not accessible and the regression test fails.
> > > > This test doesn't (and shouldn't!) use `/tmp`. The build directory and `%T` are always writable (if not, you have different issues on your system).
> > > > 
> > > > Btw you need to pay attention that the driver now finds files next to the compiler directory. You may want to make sure that the test always passes / doesn't fail for wrong reasons.
> > > Just added this.
> > @Hahnfeld I've used %S instead.
> > 
> > The only way in which the test can be a false positive is when the lib folder contains this .bc file. But there's no way to stop this from happening since we check DefaultLibPath first.
> (My comment was related to @grokos, the usage of `%T` and temporarily creating the bc lib. The current approach with `%S/Inputs` is much cleaner, but you need to create a subdirectory as everbody else did.)
> Then you need to find a way to stop this. There already are some flags to change the sysroot etc., but I don't know if the influence what you use in this patch. In the worst case, you need to add a new flag to disable `DefaultLibPath` and use it in the tests. You can't propose to commit a test that is known to break (although I acknowledge that `libomptarget-nvptx-sm_20.bc` will probably never exist).
I created a lib folder where the empty .bc is present: %S/Inputs/lib

Good point. sm_20.bc cannot be created since libomptarget requires sm_30 at least which means that there can never be an sm_20 in the DefaultLibPath folder so the only way to find it is to follow LIBRARY_PATH. This resolves the issue.

  rC Clang


More information about the cfe-commits mailing list