loader: include bpf_workaround.h header
authorDave Marchevsky <davemarchevsky@fb.com>
Wed, 5 May 2021 04:31:42 +0000 (21:31 -0700)
committeryonghong-song <ys114321@gmail.com>
Wed, 5 May 2021 05:20:20 +0000 (22:20 -0700)
The intent of #3391 was to have `bpf_workaround.h` included after
`bpf.h` when compiling bcc headers. However, that PR only added the file
to the `headers_` map of files that can be included. To actually
include, need to adjust compiler input flags as well.

Fixes: d089013e ("Move HAVE_BUILTIN_BSWAP includes to separate header")
src/cc/frontends/clang/loader.cc

index 9bd8a65044d4c32b9ca3f81aa4f5b077a1a8d57f..7809e45ebafa977cc589899beca7d8f5e176adb0 100644 (file)
@@ -314,6 +314,8 @@ int ClangLoader::do_compile(unique_ptr<llvm::Module> *mod, TableStorage &ts,
     flags_cstr.push_back("-include");
     flags_cstr.push_back("/virtual/include/bcc/bpf.h");
   }
+  flags_cstr.push_back("-include");
+  flags_cstr.push_back("/virtual/include/bcc/bpf_workaround.h");
   flags_cstr.insert(flags_cstr.end(), flags_cstr_rem.begin(),
                     flags_cstr_rem.end());