diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-08-25 10:45:55 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-08-25 10:45:55 +0100 |
commit | 3cf7c3ef441822c889356fd1812ebf2944a59851 (patch) | |
tree | c513fe68548b40365c1c2ebfe35c58ad431cdd77 /dev-util/bpftrace/files | |
parent | 05b8b0e0af1d72e51a3ee61522941bf7605cd01c (diff) |
gentoo resync : 25.08.2020
Diffstat (limited to 'dev-util/bpftrace/files')
-rw-r--r-- | dev-util/bpftrace/files/bpftrace-0.10_pre20190614-install-libs.patch | 115 | ||||
-rw-r--r-- | dev-util/bpftrace/files/bpftrace-0.11.0-install-libs.patch (renamed from dev-util/bpftrace/files/bpftrace-0.9.4-install-libs.patch) | 49 | ||||
-rw-r--r-- | dev-util/bpftrace/files/bpftrace-0.9.3-install-libs.patch | 129 | ||||
-rw-r--r-- | dev-util/bpftrace/files/bpftrace-0.9.4-llvm-10.patch | 144 |
4 files changed, 32 insertions, 405 deletions
diff --git a/dev-util/bpftrace/files/bpftrace-0.10_pre20190614-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.10_pre20190614-install-libs.patch deleted file mode 100644 index f4483570c996..000000000000 --- a/dev-util/bpftrace/files/bpftrace-0.10_pre20190614-install-libs.patch +++ /dev/null @@ -1,115 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e8870c6..a55385d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -47,9 +47,10 @@ find_package(FLEX REQUIRED) - bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc VERBOSE) - flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc) - add_flex_bison_dependency(flex_lexer bison_parser) --add_library(parser ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS}) --target_compile_options(parser PRIVATE "-w") --target_include_directories(parser PUBLIC src src/ast ${CMAKE_BINARY_DIR}) -+add_library(bpftraceparser ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS}) -+target_compile_options(bpftraceparser PRIVATE "-w") -+target_include_directories(bpftraceparser PUBLIC src src/ast ${CMAKE_BINARY_DIR}) -+install(TARGETS bpftraceparser LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - include(CheckSymbolExists) - set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) -diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt -index b8b0d96..0803c1e 100644 ---- a/resources/CMakeLists.txt -+++ b/resources/CMakeLists.txt -@@ -1,6 +1,7 @@ --add_library(resources headers.cpp) -+add_library(bpftraceresources headers.cpp) - --target_include_directories(resources PUBLIC ../src) -+target_include_directories(bpftraceresources PUBLIC ../src) -+install(TARGETS bpftraceresources LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - function(embed_headers output) - file(WRITE ${output} "#include \"headers.h\"\n\nnamespace bpftrace {\n") -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index e737119..b2b17e2 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -30,7 +30,8 @@ endif(HAVE_BCC_ELF_FOREACH_SYM) - if(HAVE_GET_CURRENT_CGROUP_ID) - target_compile_definitions(bpftrace PRIVATE HAVE_GET_CURRENT_CGROUP_ID) - endif(HAVE_GET_CURRENT_CGROUP_ID) --target_link_libraries(bpftrace arch ast parser resources) -+target_link_libraries(bpftrace bpftracearch bpftraceast bpftraceparser -+ bpftraceresources) - - if (STATIC_LINKING) - target_link_libraries(bpftrace ${LIBBCC_LIBRARIES}) -diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt -index a26f610..53627e2 100644 ---- a/src/arch/CMakeLists.txt -+++ b/src/arch/CMakeLists.txt -@@ -1,5 +1,7 @@ - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") -- add_library(arch aarch64.cpp) -+ add_library(bpftracearch aarch64.cpp) - else() -- add_library(arch x86_64.cpp) -+ add_library(bpftracearch x86_64.cpp) - endif() -+ -+install(TARGETS bpftracearch LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -diff --git a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt -index 4d77c9f..2a00572 100644 ---- a/src/ast/CMakeLists.txt -+++ b/src/ast/CMakeLists.txt -@@ -1,4 +1,4 @@ --add_library(ast -+add_library(bpftraceast - ast.cpp - codegen_llvm.cpp - irbuilderbpf.cpp -@@ -7,15 +7,16 @@ add_library(ast - ) - - if(HAVE_GET_CURRENT_CGROUP_ID) -- target_compile_definitions(ast PRIVATE HAVE_GET_CURRENT_CGROUP_ID) -+ target_compile_definitions(bpftraceast PRIVATE HAVE_GET_CURRENT_CGROUP_ID) - endif(HAVE_GET_CURRENT_CGROUP_ID) - --target_include_directories(ast PUBLIC ${CMAKE_SOURCE_DIR}/src) --target_include_directories(ast PUBLIC ${CMAKE_SOURCE_DIR}/src/ast) --target_include_directories(ast PUBLIC ${CMAKE_BINARY_DIR}) --target_link_libraries(ast arch) -+target_include_directories(bpftraceast PUBLIC ${CMAKE_SOURCE_DIR}/src) -+target_include_directories(bpftraceast PUBLIC ${CMAKE_SOURCE_DIR}/src/ast) -+target_include_directories(bpftraceast PUBLIC ${CMAKE_BINARY_DIR}) -+target_link_libraries(bpftraceast bpftracearch) - --add_dependencies(ast parser) -+add_dependencies(bpftraceast bpftraceparser) -+install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - if (STATIC_LINKING) - set(clang_libs -@@ -35,16 +36,16 @@ if (STATIC_LINKING) - clangSerialization - clangToolingCore) - llvm_map_components_to_libnames(llvm_libs bpfcodegen ipo irreader mcjit orcjit ${LLVM_TARGETS_TO_BUILD}) -- target_link_libraries(ast ${clang_libs}) -- target_link_libraries(ast ${llvm_libs}) -+ target_link_libraries(bpftraceast ${clang_libs}) -+ target_link_libraries(bpftraceast ${llvm_libs}) - else() - find_library(found_LLVM LLVM HINTS ${LLVM_LIBRARY_DIRS}) - if(found_LLVM) -- target_link_libraries(ast LLVM) -+ target_link_libraries(bpftraceast LLVM) - else() - llvm_map_components_to_libnames(_llvm_libs bpfcodegen ipo irreader mcjit orcjit ${LLVM_TARGETS_TO_BUILD}) - llvm_expand_dependencies(llvm_libs ${_llvm_libs}) -- target_link_libraries(ast ${llvm_libs}) -+ target_link_libraries(bpftraceast ${llvm_libs}) - endif() -- target_link_libraries(ast libclang) -+ target_link_libraries(bpftraceast libclang) - endif() diff --git a/dev-util/bpftrace/files/bpftrace-0.9.4-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.11.0-install-libs.patch index fe3fc29fd9b4..a28e37564eae 100644 --- a/dev-util/bpftrace/files/bpftrace-0.9.4-install-libs.patch +++ b/dev-util/bpftrace/files/bpftrace-0.11.0-install-libs.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2b214c1..a787d7d 100644 +index 1bca8d6..1482b29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -85,9 +85,10 @@ find_package(FLEX REQUIRED) +@@ -91,9 +91,10 @@ find_package(FLEX REQUIRED) bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc VERBOSE) flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc) add_flex_bison_dependency(flex_lexer bison_parser) @@ -31,10 +31,10 @@ index a95c60a..f5c4d67 100644 function(embed_headers output) file(WRITE ${output} "#include \"headers.h\"\n\nnamespace bpftrace {\n") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 5b9a95d..b1ccf7a 100644 +index 487fa9b..61b7b38 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -68,7 +68,8 @@ if (ALLOW_UNSAFE_PROBE) +@@ -84,7 +84,8 @@ if (ALLOW_UNSAFE_PROBE) target_compile_definitions(bpftrace PRIVATE HAVE_UNSAFE_PROBE) endif(ALLOW_UNSAFE_PROBE) @@ -42,13 +42,13 @@ index 5b9a95d..b1ccf7a 100644 +target_link_libraries(bpftrace bpftracearch bpftraceast bpftraceparser + bpftraceresources) + target_link_libraries(bpftrace ${LIBBCC_LIBRARIES}) if(STATIC_LINKING) - target_link_libraries(bpftrace ${LIBBCC_LIBRARIES}) diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt -index edb0654..e57c8c5 100644 +index a26c1c8..ffb5900 100644 --- a/src/arch/CMakeLists.txt +++ b/src/arch/CMakeLists.txt -@@ -1,8 +1,10 @@ +@@ -1,13 +1,15 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") - add_library(arch aarch64.cpp) + add_library(bpftracearch aarch64.cpp) @@ -56,25 +56,33 @@ index edb0654..e57c8c5 100644 CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le") - add_library(arch ppc64.cpp) + add_library(bpftracearch ppc64.cpp) - else() + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "s390" OR + CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x") +- add_library(arch s390.cpp) ++ add_library(bpftracearch s390.cpp) + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - add_library(arch x86_64.cpp) + add_library(bpftracearch x86_64.cpp) + else() + message(FATAL_ERROR "Unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}") endif() + +install(TARGETS bpftracearch LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt -index f280f47..5db9246 100644 +index 649bf0a..b969b9c 100644 --- a/src/ast/CMakeLists.txt +++ b/src/ast/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(ast +add_library(bpftraceast ast.cpp + attachpoint_parser.cpp codegen_llvm.cpp - field_analyser.cpp -@@ -7,12 +7,13 @@ add_library(ast +@@ -7,17 +7,18 @@ add_library(ast + printer.cpp semantic_analyser.cpp ) ++install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -target_include_directories(ast PUBLIC ${CMAKE_SOURCE_DIR}/src) -target_include_directories(ast PUBLIC ${CMAKE_SOURCE_DIR}/src/ast) @@ -85,13 +93,17 @@ index f280f47..5db9246 100644 +target_include_directories(bpftraceast PUBLIC ${CMAKE_BINARY_DIR}) +target_link_libraries(bpftraceast bpftracearch) + if (HAVE_BCC_KFUNC) +- target_compile_definitions(ast PRIVATE HAVE_BCC_KFUNC) ++ target_compile_definitions(bpftraceast PRIVATE HAVE_BCC_KFUNC) + endif(HAVE_BCC_KFUNC) + -add_dependencies(ast parser) +add_dependencies(bpftraceast bpftraceparser) -+install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) if (STATIC_LINKING) set(clang_libs -@@ -36,26 +37,26 @@ if (STATIC_LINKING) +@@ -41,17 +42,17 @@ if (STATIC_LINKING) if(EMBED_LIBCLANG_ONLY) unlink_transitive_dependency("${CLANG_EXPORTED_TARGETS}" "LLVM") endif() @@ -105,12 +117,15 @@ index f280f47..5db9246 100644 - target_link_libraries(ast ${LLVM_EMBEDDED_CMAKE_TARGETS}) + target_link_libraries(bpftraceast ${LLVM_EMBEDDED_CMAKE_TARGETS}) else() - llvm_map_components_to_libnames(llvm_libs bpfcodegen ipo irreader mcjit orcjit ${LLVM_TARGETS_TO_BUILD}) + llvm_map_components_to_libnames(llvm_libs bpfcodegen ipo irreader mcjit option orcjit ${LLVM_TARGETS_TO_BUILD}) - target_link_libraries(ast ${clang_libs}) - target_link_libraries(ast ${llvm_libs}) + target_link_libraries(bpftraceast ${clang_libs}) + target_link_libraries(bpftraceast ${llvm_libs}) endif() + + if(STATIC_LIBC) +@@ -60,11 +61,11 @@ if (STATIC_LINKING) else() find_library(found_LLVM LLVM HINTS ${LLVM_LIBRARY_DIRS}) if(found_LLVM) @@ -126,10 +141,10 @@ index f280f47..5db9246 100644 + target_link_libraries(bpftraceast libclang) endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index 211c47b..2fb73ef 100644 +index 4104a57..59486de 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt -@@ -88,7 +88,8 @@ if(HAVE_BFD_DISASM) +@@ -101,7 +101,8 @@ if(HAVE_BFD_DISASM) endif(STATIC_LINKING) endif(HAVE_BFD_DISASM) @@ -137,5 +152,5 @@ index 211c47b..2fb73ef 100644 +target_link_libraries(bpftrace_test bpftracearch bpftraceast bpftraceparser + bpftraceresources) + target_link_libraries(bpftrace_test ${LIBBCC_LIBRARIES}) if (STATIC_LINKING) - if(EMBED_LLVM OR EMBED_CLANG) diff --git a/dev-util/bpftrace/files/bpftrace-0.9.3-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.9.3-install-libs.patch deleted file mode 100644 index 0ddb07b47408..000000000000 --- a/dev-util/bpftrace/files/bpftrace-0.9.3-install-libs.patch +++ /dev/null @@ -1,129 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5e0d770..d51edf6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -51,9 +51,10 @@ find_package(FLEX REQUIRED) - bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc VERBOSE) - flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc) - add_flex_bison_dependency(flex_lexer bison_parser) --add_library(parser ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS}) --target_compile_options(parser PRIVATE "-w") --target_include_directories(parser PUBLIC src src/ast ${CMAKE_BINARY_DIR}) -+add_library(bpftraceparser ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS}) -+target_compile_options(bpftraceparser PRIVATE "-w") -+target_include_directories(bpftraceparser PUBLIC src src/ast ${CMAKE_BINARY_DIR}) -+install(TARGETS bpftraceparser LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - include(CheckSymbolExists) - set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) -diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt -index b8b0d96..0803c1e 100644 ---- a/resources/CMakeLists.txt -+++ b/resources/CMakeLists.txt -@@ -1,6 +1,7 @@ --add_library(resources headers.cpp) -+add_library(bpftraceresources headers.cpp) - --target_include_directories(resources PUBLIC ../src) -+target_include_directories(bpftraceresources PUBLIC ../src) -+install(TARGETS bpftraceresources LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - function(embed_headers output) - file(WRITE ${output} "#include \"headers.h\"\n\nnamespace bpftrace {\n") -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 65f3a34..b001a83 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -56,7 +56,8 @@ if (ALLOW_UNSAFE_UPROBE) - target_compile_definitions(bpftrace PRIVATE HAVE_UNSAFE_UPROBE) - endif(ALLOW_UNSAFE_UPROBE) - --target_link_libraries(bpftrace arch ast parser resources) -+target_link_libraries(bpftrace bpftracearch bpftraceast bpftraceparser -+ bpftraceresources) - - if (STATIC_LINKING) - target_link_libraries(bpftrace ${LIBBCC_LIBRARIES}) -diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt -index a26f610..53627e2 100644 ---- a/src/arch/CMakeLists.txt -+++ b/src/arch/CMakeLists.txt -@@ -1,5 +1,7 @@ - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") -- add_library(arch aarch64.cpp) -+ add_library(bpftracearch aarch64.cpp) - else() -- add_library(arch x86_64.cpp) -+ add_library(bpftracearch x86_64.cpp) - endif() -+ -+install(TARGETS bpftracearch LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -diff --git a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt -index 4d77c9f..2a00572 100644 ---- a/src/ast/CMakeLists.txt -+++ b/src/ast/CMakeLists.txt -@@ -1,4 +1,4 @@ --add_library(ast -+add_library(bpftraceast - ast.cpp - codegen_llvm.cpp - irbuilderbpf.cpp -@@ -7,15 +7,16 @@ add_library(ast - ) - - if(HAVE_GET_CURRENT_CGROUP_ID) -- target_compile_definitions(ast PRIVATE HAVE_GET_CURRENT_CGROUP_ID) -+ target_compile_definitions(bpftraceast PRIVATE HAVE_GET_CURRENT_CGROUP_ID) - endif(HAVE_GET_CURRENT_CGROUP_ID) - --target_include_directories(ast PUBLIC ${CMAKE_SOURCE_DIR}/src) --target_include_directories(ast PUBLIC ${CMAKE_SOURCE_DIR}/src/ast) --target_include_directories(ast PUBLIC ${CMAKE_BINARY_DIR}) --target_link_libraries(ast arch) -+target_include_directories(bpftraceast PUBLIC ${CMAKE_SOURCE_DIR}/src) -+target_include_directories(bpftraceast PUBLIC ${CMAKE_SOURCE_DIR}/src/ast) -+target_include_directories(bpftraceast PUBLIC ${CMAKE_BINARY_DIR}) -+target_link_libraries(bpftraceast bpftracearch) - --add_dependencies(ast parser) -+add_dependencies(bpftraceast bpftraceparser) -+install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - if (STATIC_LINKING) - set(clang_libs -@@ -35,16 +36,16 @@ if (STATIC_LINKING) - clangSerialization - clangToolingCore) - llvm_map_components_to_libnames(llvm_libs bpfcodegen ipo irreader mcjit orcjit ${LLVM_TARGETS_TO_BUILD}) -- target_link_libraries(ast ${clang_libs}) -- target_link_libraries(ast ${llvm_libs}) -+ target_link_libraries(bpftraceast ${clang_libs}) -+ target_link_libraries(bpftraceast ${llvm_libs}) - else() - find_library(found_LLVM LLVM HINTS ${LLVM_LIBRARY_DIRS}) - if(found_LLVM) -- target_link_libraries(ast LLVM) -+ target_link_libraries(bpftraceast LLVM) - else() - llvm_map_components_to_libnames(_llvm_libs bpfcodegen ipo irreader mcjit orcjit ${LLVM_TARGETS_TO_BUILD}) - llvm_expand_dependencies(llvm_libs ${_llvm_libs}) -- target_link_libraries(ast ${llvm_libs}) -+ target_link_libraries(bpftraceast ${llvm_libs}) - endif() -- target_link_libraries(ast libclang) -+ target_link_libraries(bpftraceast libclang) - endif() -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index 2d18277..f66a8b7 100644 ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -76,7 +76,8 @@ if(HAVE_BFD_DISASM) - target_link_libraries(bpftrace_test ${LIBOPCODES_LIBRARIES}) - endif(HAVE_BFD_DISASM) - --target_link_libraries(bpftrace_test arch ast parser resources) -+target_link_libraries(bpftrace_test bpftracearch bpftraceast bpftraceparser -+ bpftraceresources) - - if (STATIC_LINKING) - target_link_libraries(bpftrace_test ${LIBBCC_LIBRARIES}) diff --git a/dev-util/bpftrace/files/bpftrace-0.9.4-llvm-10.patch b/dev-util/bpftrace/files/bpftrace-0.9.4-llvm-10.patch deleted file mode 100644 index c2131cbbc306..000000000000 --- a/dev-util/bpftrace/files/bpftrace-0.9.4-llvm-10.patch +++ /dev/null @@ -1,144 +0,0 @@ -diff --git a/src/ast/codegen_llvm.cpp b/src/ast/codegen_llvm.cpp -index f81906c..bcc2c7d 100644 ---- a/src/ast/codegen_llvm.cpp -+++ b/src/ast/codegen_llvm.cpp -@@ -41,7 +41,7 @@ void CodegenLLVM::visit(PositionalParameter ¶m) - { - Constant *const_str = ConstantDataArray::getString(module_->getContext(), pstr, true); - AllocaInst *buf = b_.CreateAllocaBPF(ArrayType::get(b_.getInt8Ty(), pstr.length() + 1), "str"); -- b_.CreateMemSet(buf, b_.getInt8(0), pstr.length() + 1, 1); -+ b_.CREATE_MEMSET(buf, b_.getInt8(0), pstr.length() + 1, 1); - b_.CreateStore(const_str, buf); - expr_ = buf; - } -@@ -156,7 +156,7 @@ void CodegenLLVM::visit(Builtin &builtin) - { - AllocaInst *buf = b_.CreateAllocaBPF(builtin.type, "comm"); - // initializing memory needed for older kernels: -- b_.CreateMemSet(buf, b_.getInt8(0), builtin.type.size, 1); -+ b_.CREATE_MEMSET(buf, b_.getInt8(0), builtin.type.size, 1); - b_.CreateGetCurrentComm(buf, builtin.type.size); - expr_ = buf; - } -@@ -189,7 +189,7 @@ void CodegenLLVM::visit(Builtin &builtin) - if (builtin.type.type == Type::usym) - { - AllocaInst *buf = b_.CreateAllocaBPF(builtin.type, "func"); -- b_.CreateMemSet(buf, b_.getInt8(0), builtin.type.size, 1); -+ b_.CREATE_MEMSET(buf, b_.getInt8(0), builtin.type.size, 1); - Value *pid = b_.CreateLShr(b_.CreateGetPidTgid(), 32); - Value *addr_offset = b_.CreateGEP(buf, b_.getInt64(0)); - Value *pid_offset = b_.CreateGEP(buf, {b_.getInt64(0), b_.getInt64(8)}); -@@ -444,7 +444,7 @@ void CodegenLLVM::visit(Call &call) - else if (call.func == "str") - { - AllocaInst *strlen = b_.CreateAllocaBPF(b_.getInt64Ty(), "strlen"); -- b_.CreateMemSet(strlen, b_.getInt8(0), sizeof(uint64_t), 1); -+ b_.CREATE_MEMSET(strlen, b_.getInt8(0), sizeof(uint64_t), 1); - if (call.vargs->size() > 1) { - call.vargs->at(1)->accept(*this); - Value *proposed_strlen = b_.CreateAdd(expr_, b_.getInt64(1)); // add 1 to accommodate probe_read_str's null byte -@@ -462,7 +462,7 @@ void CodegenLLVM::visit(Call &call) - b_.CreateStore(b_.getInt64(bpftrace_.strlen_), strlen); - } - AllocaInst *buf = b_.CreateAllocaBPF(bpftrace_.strlen_, "str"); -- b_.CreateMemSet(buf, b_.getInt8(0), bpftrace_.strlen_, 1); -+ b_.CREATE_MEMSET(buf, b_.getInt8(0), bpftrace_.strlen_, 1); - call.vargs->front()->accept(*this); - b_.CreateProbeReadStr(buf, b_.CreateLoad(strlen), expr_); - b_.CreateLifetimeEnd(strlen); -@@ -541,7 +541,7 @@ void CodegenLLVM::visit(Call &call) - { - // store uint64_t[2] with: [0]: (uint64_t)addr, [1]: (uint64_t)pid - AllocaInst *buf = b_.CreateAllocaBPF(call.type, "usym"); -- b_.CreateMemSet(buf, b_.getInt8(0), call.type.size, 1); -+ b_.CREATE_MEMSET(buf, b_.getInt8(0), call.type.size, 1); - Value *pid = b_.CreateLShr(b_.CreateGetPidTgid(), 32); - Value *addr_offset = b_.CreateGEP(buf, b_.getInt64(0)); - Value *pid_offset = b_.CreateGEP(buf, {b_.getInt64(0), b_.getInt64(8)}); -@@ -592,7 +592,7 @@ void CodegenLLVM::visit(Call &call) - b_.CreateStore(af_type, af_offset); - - Value *inet_offset = b_.CreateGEP(buf, {b_.getInt32(0), b_.getInt32(1)}); -- b_.CreateMemSet(inet_offset, b_.getInt8(0), 16, 1); -+ b_.CREATE_MEMSET(inet_offset, b_.getInt8(0), 16, 1); - - inet->accept(*this); - if (inet->type.type == Type::array) -@@ -663,7 +663,7 @@ void CodegenLLVM::visit(Call &call) - auto &map = static_cast<Map&>(arg); - Constant *const_str = ConstantDataArray::getString(module_->getContext(), map.ident, true); - AllocaInst *str_buf = b_.CreateAllocaBPF(ArrayType::get(b_.getInt8Ty(), map.ident.length() + 1), "str"); -- b_.CreateMemSet(str_buf, b_.getInt8(0), map.ident.length() + 1, 1); -+ b_.CREATE_MEMSET(str_buf, b_.getInt8(0), map.ident.length() + 1, 1); - b_.CreateStore(const_str, str_buf); - ArrayType *perfdata_type = ArrayType::get(b_.getInt8Ty(), sizeof(uint64_t) + 2 * sizeof(uint64_t) + map.ident.length() + 1); - AllocaInst *perfdata = b_.CreateAllocaBPF(perfdata_type, "perfdata"); -@@ -707,7 +707,7 @@ void CodegenLLVM::visit(Call &call) - auto &map = static_cast<Map&>(arg); - Constant *const_str = ConstantDataArray::getString(module_->getContext(), map.ident, true); - AllocaInst *str_buf = b_.CreateAllocaBPF(ArrayType::get(b_.getInt8Ty(), map.ident.length() + 1), "str"); -- b_.CreateMemSet(str_buf, b_.getInt8(0), map.ident.length() + 1, 1); -+ b_.CREATE_MEMSET(str_buf, b_.getInt8(0), map.ident.length() + 1, 1); - b_.CreateStore(const_str, str_buf); - ArrayType *perfdata_type = ArrayType::get(b_.getInt8Ty(), sizeof(uint64_t) + map.ident.length() + 1); - AllocaInst *perfdata = b_.CreateAllocaBPF(perfdata_type, "perfdata"); -@@ -1204,7 +1204,7 @@ void CodegenLLVM::visit(FieldAccess &acc) - { - AllocaInst *dst = b_.CreateAllocaBPF(field.type, type.cast_type + "." + acc.field); - // memset so verifier doesn't complain about reading uninitialized stack -- b_.CreateMemSet(dst, b_.getInt8(0), field.type.size, 1); -+ b_.CREATE_MEMSET(dst, b_.getInt8(0), field.type.size, 1); - b_.CreateProbeRead(dst, field.bitfield.read_bytes, src); - Value *raw = b_.CreateLoad(dst); - Value *shifted = b_.CreateLShr(raw, field.bitfield.access_rshift); -@@ -1906,7 +1906,7 @@ void CodegenLLVM::createFormatStringCall(Call &call, int &id, CallArgs &call_arg - } - - AllocaInst *fmt_args = b_.CreateAllocaBPF(fmt_struct, call_name + "_args"); -- b_.CreateMemSet(fmt_args, b_.getInt8(0), struct_size, 1); -+ b_.CREATE_MEMSET(fmt_args, b_.getInt8(0), struct_size, 1); - - Value *id_offset = b_.CreateGEP(fmt_args, {b_.getInt32(0), b_.getInt32(0)}); - b_.CreateStore(b_.getInt64(id + asyncactionint(async_action)), id_offset); -diff --git a/src/ast/irbuilderbpf.cpp b/src/ast/irbuilderbpf.cpp -index eb84f7b..5dd72d0 100644 ---- a/src/ast/irbuilderbpf.cpp -+++ b/src/ast/irbuilderbpf.cpp -@@ -82,7 +82,7 @@ AllocaInst *IRBuilderBPF::CreateAllocaBPFInit(const SizedType &stype, const std: - } - else - { -- CreateMemSet(alloca, getInt64(0), stype.size, 1); -+ CREATE_MEMSET(alloca, getInt64(0), stype.size, 1); - } - - restoreIP(ip); -@@ -226,7 +226,7 @@ Value *IRBuilderBPF::CreateMapLookupElem(int mapfd, AllocaInst *key, SizedType & - - SetInsertPoint(lookup_failure_block); - if (is_array) -- CreateMemSet(value, getInt8(0), type.size, 1); -+ CREATE_MEMSET(value, getInt8(0), type.size, 1); - else - CreateStore(getInt64(0), value); - CreateBr(lookup_merge_block); -diff --git a/src/ast/irbuilderbpf.h b/src/ast/irbuilderbpf.h -index 58e6882..6b2e7f1 100644 ---- a/src/ast/irbuilderbpf.h -+++ b/src/ast/irbuilderbpf.h -@@ -18,6 +18,14 @@ - #error Unsupported LLVM version - #endif - -+#if LLVM_VERSION_MAJOR >= 10 -+#define CREATE_MEMSET(ptr, val, size, align) \ -+ CreateMemSet((ptr), (val), (size), MaybeAlign((align))) -+#else -+#define CREATE_MEMSET(ptr, val, size, align) \ -+ CreateMemSet((ptr), (val), (size), (align)) -+#endif -+ - namespace bpftrace { - namespace ast { - |