Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpftool: Remove usage of reallocarray() #40

Closed
wants to merge 2 commits into from

Commits on Feb 18, 2022

  1. adding ci files

    Nobody committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    cf7c90a View commit details
    Browse the repository at this point in the history
  2. bpftool: Remove usage of reallocarray()

    This commit fixes a compilation error on systems with glibc < 2.26 [0]:
    
    ```
    In file included from main.h:14:0,
                     from gen.c:24:
    linux/tools/include/tools/libc_compat.h:11:21: error: attempt to use poisoned "reallocarray"
     static inline void *reallocarray(void *ptr, size_t nmemb, size_t size)
    ```
    
    This happens because gen.c pulls <bpf/libbpf_internal.h>, and then
    <tools/libc_compat.h> (through main.h). When
    COMPAT_NEED_REALLOCARRAY is set, libc_compat.h defines reallocarray()
    which libbpf_internal.h poisons with a GCC pragma.
    
    This follows the same approach of libbpf in commit
    029258d ("libbpf: Remove any use of reallocarray() in libbpf").
    
    Reported-by: Quentin Monnet <[email protected]>
    Signed-off-by: Mauricio Vásquez <[email protected]>
    
    [0]: https://lore.kernel.org/bpf/[email protected]/
    mauriciovasquezbernal authored and Nobody committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    1333888 View commit details
    Browse the repository at this point in the history