• Matheus Marchini's avatar
    resources: generate c++ file instead of c file · 5e1350bb
    Matheus Marchini authored
    If we use clang to build bpftrace instead of GCC, it will complain about
    trying to use the `-std-c++14` flag to comile headers.c. If we force
    cmake to skip this flag on `.c` files, clang is not able to link
    libresources.a correctly.
    
    This patch changes the resources workflow to generate a .cpp file
    instead, and to have a `src/headers.h` with all headers we currently
    use. With this approach we get a safer linkage because the same
    definition for the header strings is being used in clang_parser.cpp and
    in headers.cpp.
    
    Fixes: https://github.com/iovisor/bpftrace/issues/350
    5e1350bb
clang_parser.cpp 6.89 KB