Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

nvlink error : Undefined reference to '__cxa_pure_virtual' in '/tmp/test2-d01e72.cubin' #43493

Open Quuxplusone opened 4 years ago

Quuxplusone commented 4 years ago
Bugzilla Link PR44523
Status NEW
Importance P normal
Reported by Itaru Kitayama (itaru.kitayama@gmail.com)
Reported on 2020-01-11 22:40:43 -0800
Last modified on 2020-01-14 16:03:28 -0800
Version unspecified
Hardware All Linux
CC hfinkel@anl.gov, jdoerfert@anl.gov, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
The C++ code below doesn't build:

class AbsBase {
    virtual int f() = 0;
};
class Derived : public AbsBase {
private:
    int a;
public:
    int f() { a = 1; return a; }
};

int main() {
#pragma omp target parallel for
    for (int i=0;i<10;i++) {
        Derived d;
    }
}

[kitayama1@juronc12 ~]$ clang++ -fno-rtti -g -fopenmp -fopenmp-targets=nvptx64
test2.cpp
nvlink error   : Undefined reference to '__cxa_pure_virtual' in '/tmp/test2-
ed87e2.cubin'
clang-10: error: nvlink command failed with exit code 255 (use -v to see
invocation)
Quuxplusone commented 4 years ago

Clnag is built based off of the latest trunk, FYI.

Quuxplusone commented 4 years ago

This is observed with the official Clang 9 release on POWER8.

Quuxplusone commented 4 years ago
With the trunk Clang which has Alexey's fix as of this writing, I don't see the
error anymore on POWER8.