Skip to content
  • Philippe Mathieu-Daudé's avatar
    configure: Really use local libfdt if the system one is too old · 8a99e9a3
    Philippe Mathieu-Daudé authored
    
    
    QEMU requires libfdt version >= 1.4.2.
    If the host has an older libfdt installed, the configure script will use
    a (git cloned) local version.
    
    Example with Debian 8:
        $ dpkg-query --showformat='${Version}\n' --show libfdt-dev
        1.4.0+dfsg-1
        $ ./configure
        [...]
        fdt support       yes          # from git submodule 'dtc'
    
    If this case occurs, the linker will have 2 different libfdt available in
    the library search path. The default behavior is to search the system path
    first, then the local path.
    
    Even if the configure script noticed the libfdt is too old and clone a more
    recent locally, when linking the system library is selected first, and the
    link process eventually fails:
    
          LINK    mips64el-softmmu/qemu-system-mips64el
        ../hw/core/loader-fit.o: In function `load_fit':
        /root/src/github.com/philmd/qemu/hw/core/loader-fit.c:278: undefined reference to `fdt_first_subnode'
        /root/src/github.com/philmd/qemu/hw/core/loader-fit.c:286: undefined reference to `fdt_next_subnode'
        /root/src/github.com/philmd/qemu/hw/core/loader-fit.c:277: undefined reference to `fdt_first_subnode'
        collect2: error: ld returned 1 exit status
        Makefile:201: recipe for target 'qemu-system-mips64el' failed
        make[1]: *** [qemu-system-mips64el] Error 1
    
    QEMU already uses a kludge to enforce local CFLAGS before system ones for
    libpixman and libfdt, add a similar kludge for the LDFLAGS to enforce using
    the local libfdt.
    
    Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20180415230522.24404-2-f4bug@amsat.org>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
    8a99e9a3