lkml.org 
[lkml]   [2020]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2] tools build: Check libasan and libubsan in Makefile.feature
    Date
    When build perf with ASan or UBSan, if libasan or libubsan can not find,
    the feature-glibc is 0 and there exists the following error log which is
    wrong, because we can find gnu/libc-version.h in /usr/include, glibc-devel
    is also installed.

    [yangtiezhu@linux perf]$ make DEBUG=1 EXTRA_CFLAGS='-fno-omit-frame-pointer -fsanitize=address'
    BUILD: Doing 'make -j4' parallel build
    HOSTCC fixdep.o
    HOSTLD fixdep-in.o
    LINK fixdep
    <stdin>:1:0: warning: -fsanitize=address and -fsanitize=kernel-address are not supported for this target
    <stdin>:1:0: warning: -fsanitize=address not supported for this target

    Auto-detecting system features:
    ... dwarf: [ OFF ]
    ... dwarf_getlocations: [ OFF ]
    ... glibc: [ OFF ]
    ... gtk2: [ OFF ]
    ... libaudit: [ OFF ]
    ... libbfd: [ OFF ]
    ... libcap: [ OFF ]
    ... libelf: [ OFF ]
    ... libnuma: [ OFF ]
    ... numa_num_possible_cpus: [ OFF ]
    ... libperl: [ OFF ]
    ... libpython: [ OFF ]
    ... libcrypto: [ OFF ]
    ... libunwind: [ OFF ]
    ... libdw-dwarf-unwind: [ OFF ]
    ... zlib: [ OFF ]
    ... lzma: [ OFF ]
    ... get_cpuid: [ OFF ]
    ... bpf: [ OFF ]
    ... libaio: [ OFF ]
    ... libzstd: [ OFF ]
    ... disassembler-four-args: [ OFF ]

    Makefile.config:393: *** No gnu/libc-version.h found, please install glibc-dev[el]. Stop.
    Makefile.perf:224: recipe for target 'sub-make' failed
    make[1]: *** [sub-make] Error 2
    Makefile:69: recipe for target 'all' failed
    make: *** [all] Error 2
    [yangtiezhu@linux perf]$ ls /usr/include/gnu/libc-version.h
    /usr/include/gnu/libc-version.h

    After install libasan and libubsan, the feature-glibc is 1 and the build
    process is success, so the cause is related with libasan or libubsan, we
    should check them and print an error log to reflect the reality.

    Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
    ---

    v2:
    - Check libasan and libubsan in tools/build/Makefile.feature
    - Modify the patch subject

    tools/build/Makefile.feature | 7 +++++++
    1 file changed, 7 insertions(+)

    diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
    index 3abd431..e147c17 100644
    --- a/tools/build/Makefile.feature
    +++ b/tools/build/Makefile.feature
    @@ -252,3 +252,10 @@ ifeq ($(feature_verbose),1)
    $(foreach feat,$(TMP),$(call feature_print_status,$(feat),))
    $(info )
    endif
    +
    +ifneq ($(shell ldconfig -p | grep libasan >/dev/null 2>&1; echo $$?), 0)
    + msg := $(error No libasan found, please install libasan);
    +endif
    +ifneq ($(shell ldconfig -p | grep libubsan >/dev/null 2>&1; echo $$?), 0)
    + msg := $(error No libubsan found, please install libubsan);
    +endif
    --
    2.1.0
    \
     
     \ /
      Last update: 2020-06-03 08:11    [W:2.971 / U:0.636 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site