Skip to content

Commit

Permalink
Merge pull request iovisor#2410 from joelagnel/bcc-headers
Browse files Browse the repository at this point in the history
build: Rename kheaders location from proc to sys
  • Loading branch information
4ast authored Jun 13, 2019
2 parents e8dd701 + 0797d4a commit c5f55f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cc/frontends/clang/kbuild_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <errno.h>
#include <ftw.h>

#define PROC_KHEADERS_PATH "/proc/kheaders.tar.xz"
#define PROC_KHEADERS_PATH "/sys/kernel/kheaders.tar.xz"

namespace ebpf {

Expand Down
8 changes: 6 additions & 2 deletions src/cc/frontends/clang/loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,15 @@ int ClangLoader::parse(unique_ptr<llvm::Module> *mod, TableStorage &ts,
kpath = kdir + "/" + kernel_path_info.second;
}

// If all attempts to obtain kheaders fail, check for /proc/kheaders.tar.xz
// If all attempts to obtain kheaders fail, check for kheaders.tar.xz in sysfs
if (!is_dir(kpath)) {
int ret = get_proc_kheaders(tmpdir);
if (!ret)
if (!ret) {
kpath = tmpdir;
} else {
std::cout << "Unable to find kernel headers. ";
std::cout << "Try rebuilding kernel with CONFIG_IKHEADERS=m (module)\n";
}
}

if (flags_ & DEBUG_PREPROCESSOR)
Expand Down

0 comments on commit c5f55f0

Please sign in to comment.