• David Daney's avatar
    perf tools: Fix broken build by defining _GNU_SOURCE in Makefile · 2ef1ea38
    David Daney authored
    When building on my Debian/mips system, util/util.c fails to build
    because commit 1aed2671 (perf kvm: Do
    guest-only counting by default) indirectly includes stdio.h before the
    feature selection in util.h is done.  This prevents _GNU_SOURCE in
    util.h from enabling the declaration of getline(), from now second
    inclusion of stdio.h, and the build is broken.
    
    There is another breakage in util/evsel.c caused by include ordering,
    but I didn't fully track down the commit that caused it.
    
    The root cause of all this is an inconsistent definition of _GNU_SOURCE,
    so I move the definition into the Makefile so that it is passed to all
    invocations of the compiler and used uniformly for all system header
    files.  All other #define and #undef of _GNU_SOURCE are removed as they
    cause conflicts with the definition passed to the compiler.
    
    All the features.h definitions (_LARGEFILE64_SOURCE _FILE_OFFSET_BITS=64
    and _GNU_SOURCE) a...
    2ef1ea38
Makefile 29.6 KB