h2olog: resolve H2O_ROOT for BCC
@@ -368,8 +368,11 @@ int main(int argc, char **argv)
const char *h2o_root = getenv("H2O_ROOT");
if (h2o_root == NULL)
h2o_root = H2O_TO_STR(H2O_ROOT);
+ // BCC does not resolve a relative path, so h2olog does resolve it as an absolute path.
+ char h2o_root_resolved[PATH_MAX];
+ realpath(h2o_root, h2o_root_resolved);
std::vector<std::string> cflags({
- std::string("-I") + std::string(h2o_root) + "/include",
+ std::string("-I") + std::string(h2o_root_resolved) + "/include",
build_cc_macro_expr("H2OLOG_H2O_PID", h2o_pid),
CC_MACRO_EXPR(H2O_EBPF_RETURN_MAP_SIZE),
});
