[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 25/30] configure: Really use local libfdt if the syst
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 25/30] configure: Really use local libfdt if the system one is too old |
Date: |
Wed, 9 May 2018 00:14:42 +0200 |
From: Philippe Mathieu-Daudé <address@hidden>
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: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
---
configure | 6 +++++-
rules.mak | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 3ff4d77..43756dc 100755
--- a/configure
+++ b/configure
@@ -3800,7 +3800,8 @@ EOF
symlink "$source_path/dtc/scripts" "dtc/scripts"
fi
fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt"
- fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs"
+ fdt_ldflags="-L\$(BUILD_DIR)/dtc/libfdt"
+ fdt_libs="$fdt_libs"
elif test "$fdt" = "yes" ; then
# Not a git build & no libfdt found, prompt for system install
error_exit "DTC (libfdt) version >= 1.4.2 not present." \
@@ -5742,6 +5743,7 @@ echo_version() {
# prepend pixman and ftd flags after all config tests are done
QEMU_CFLAGS="$pixman_cflags $fdt_cflags $QEMU_CFLAGS"
+QEMU_LDFLAGS="$fdt_ldflags $QEMU_LDFLAGS"
libs_softmmu="$pixman_libs $libs_softmmu"
echo "Install prefix $prefix"
@@ -5772,6 +5774,7 @@ echo "ARFLAGS $ARFLAGS"
echo "CFLAGS $CFLAGS"
echo "QEMU_CFLAGS $QEMU_CFLAGS"
echo "LDFLAGS $LDFLAGS"
+echo "QEMU_LDFLAGS $QEMU_LDFLAGS"
echo "make $make"
echo "install $install"
echo "python $python"
@@ -6706,6 +6709,7 @@ else
fi
echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak
+echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
echo "LD_REL_FLAGS=$LD_REL_FLAGS" >> $config_host_mak
echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
echo "LIBS+=$LIBS" >> $config_host_mak
diff --git a/rules.mak b/rules.mak
index 93a0702..04c7f74 100644
--- a/rules.mak
+++ b/rules.mak
@@ -73,7 +73,7 @@ expand-objs = $(strip $(sort $(filter %.o,$1)) \
# must link with the C++ compiler, not the plain C compiler.
LINKPROG = $(or $(CXX),$(CC))
-LINK = $(call quiet-command, $(LINKPROG) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS)
-o $@ \
+LINK = $(call quiet-command, $(LINKPROG) $(QEMU_LDFLAGS) $(QEMU_CFLAGS)
$(CFLAGS) $(LDFLAGS) -o $@ \
$(call process-archive-undefs, $1) \
$(version-obj-y) $(call extract-libs,$1)
$(LIBS),"LINK","$(TARGET_DIR)$@")
--
1.8.3.1
- [Qemu-devel] [PULL 13/30] accel: use g_strsplit for parsing accelerator names, (continued)
- [Qemu-devel] [PULL 13/30] accel: use g_strsplit for parsing accelerator names, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 14/30] opts: don't silently truncate long parameter keys, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 17/30] qemu-options: Mark -virtioconsole as deprecated, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 18/30] qemu-options: Remove remainders of the -tdf option, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 19/30] qemu-options: Bail out on unsupported options instead of silently ignoring them, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 20/30] qemu-options: Remove deprecated -no-kvm-pit-reinjection, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 16/30] target/i386: sev: fix memory leaks, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 15/30] opts: don't silently truncate long option values, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 21/30] qemu-options: Remove deprecated -no-kvm-irqchip, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 25/30] configure: Really use local libfdt if the system one is too old,
Paolo Bonzini <=
- [Qemu-devel] [PULL 22/30] qemu-doc: provide details of supported build platforms, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 23/30] glib: bump min required glib library version to 2.42, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 27/30] shippable: Remove Debian 8 libfdt kludge, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 26/30] configure: Display if libfdt is from system or git, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 24/30] i386/kvm: add support for Hyper-V reenlightenment MSRs, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 28/30] build: Silence dtc directory creation, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 29/30] pc-dimm: fix error messages if no slots were defined, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 30/30] rename included C files to foo.inc.c, remove osdep.h, Paolo Bonzini, 2018/05/08
- Re: [Qemu-devel] [PULL 00/30] Misc patches for 2018-05-09, Peter Maydell, 2018/05/11