https://bugs.llvm.org/show_bug.cgi?id=45458

            Bug ID: 45458
           Summary: omp_target_alloc link errors
           Product: OpenMP
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: Runtime Library
          Assignee: unassignedb...@nondot.org
          Reporter: tom.dea...@bristol.ac.uk
                CC: llvm-bugs@lists.llvm.org

Created attachment 23318
  --> https://bugs.llvm.org/attachment.cgi?id=23318&action=edit
Source code reproducer

The attached code does not link with LLVM 10.0.

Build:
    $ clang -O3 omp_target_alloc.c -fopenmp

Compiler output:
    /tmp/omp_target_alloc-875632.o: In function `main':
    omp_target_alloc.c:(.text+0xe): undefined reference to `omp_target_alloc'
    clang-10: error: linker command failed with exit code 1 (use -v to see
invocation)

The code simply tries to allocate data on the default target device.

The following compiler flag makes the code link:
    -fopenmp-targets=x86_64

However, the binary returns a null pointer at runtime.

If a GPU target is specified by instead adding this flag, a null pointer is
still returned.
    -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_75

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to