Re: [PATCH pahole 1/2] libbpf: pull latest libbpf and build libbpf as shared lib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Sun, Feb 17, 2019 at 12:20:17AM -0800, Andrii Nakryiko escreveu:
> Bring in latest changes from libbpf which allow to use btf__dedup() for
> big binaries (e.g., linux kernel image).

I'm splitting this patch into two, one for the above part and another
for the part in the end of this commit message.

Thanks,
 
> This patch also changes CMakeLists.txt to build libbpf as shared
> library to satisfy libdwarves shared library compilation.
> 
> Signed-off-by: Andrii Nakryiko <andriin@xxxxxx>
> ---
>  CMakeLists.txt | 13 +++++++++----
>  lib/bpf        |  2 +-
>  2 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 0cc383a..d6929b4 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -72,9 +72,14 @@ if (NOT HAVE_REALLOCARRAY_SUPPORT)
>  endif()
>  
>  file(GLOB libbpf_sources "lib/bpf/src/*.c")
> -add_library(bpf STATIC ${libbpf_sources})
> -set_target_properties(bpf PROPERTIES OUTPUT_NAME bpf)
> -target_include_directories(bpf PRIVATE
> +add_library(bpf-static STATIC ${libbpf_sources})
> +set_target_properties(bpf-static PROPERTIES OUTPUT_NAME bpf)
> +target_include_directories(bpf-static PRIVATE
> +			   ${CMAKE_CURRENT_SOURCE_DIR}/lib/bpf/include
> +			   ${CMAKE_CURRENT_SOURCE_DIR}/lib/bpf/include/uapi)
> +add_library(bpf-shared SHARED ${libbpf_sources})
> +set_target_properties(bpf-shared PROPERTIES OUTPUT_NAME bpf)
> +target_include_directories(bpf-shared PRIVATE
>  			   ${CMAKE_CURRENT_SOURCE_DIR}/lib/bpf/include
>  			   ${CMAKE_CURRENT_SOURCE_DIR}/lib/bpf/include/uapi)
>  
> @@ -84,7 +89,7 @@ set(dwarves_LIB_SRCS dwarves.c dwarves_fprintf.c gobuffer strings
>  add_library(dwarves SHARED ${dwarves_LIB_SRCS})
>  set_target_properties(dwarves PROPERTIES VERSION 1.0.0 SOVERSION 1)
>  set_target_properties(dwarves PROPERTIES INTERFACE_LINK_LIBRARIES "")
> -target_link_libraries(dwarves ${DWARF_LIBRARIES} ${ZLIB_LIBRARIES} bpf)
> +target_link_libraries(dwarves ${DWARF_LIBRARIES} ${ZLIB_LIBRARIES} bpf-shared)
>  
>  set(dwarves_emit_LIB_SRCS dwarves_emit.c)
>  add_library(dwarves_emit SHARED ${dwarves_emit_LIB_SRCS})
> diff --git a/lib/bpf b/lib/bpf
> index b19c6dc..d5fa415 160000
> --- a/lib/bpf
> +++ b/lib/bpf
> @@ -1 +1 @@
> -Subproject commit b19c6dcf623a7adc9e538ddbe2964c2f58dd2417
> +Subproject commit d5fa4150f0c3a36e3ce458e1301531bd2edbf74d
> -- 
> 2.17.1

-- 

- Arnaldo



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux