From nobody Thu Oct 30 15:31:13 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525819501350992.0341595298319; Tue, 8 May 2018 15:45:01 -0700 (PDT) Received: from localhost ([::1]:53670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGBLr-0004kO-BK for importer@patchew.org; Tue, 08 May 2018 18:44:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGAtG-0003H4-5c for qemu-devel@nongnu.org; Tue, 08 May 2018 18:15:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGAtE-0001bM-LT for qemu-devel@nongnu.org; Tue, 08 May 2018 18:15:22 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:53768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGAtE-0001ad-Fh for qemu-devel@nongnu.org; Tue, 08 May 2018 18:15:20 -0400 Received: by mail-wm0-x244.google.com with SMTP id a67so21143935wmf.3 for ; Tue, 08 May 2018 15:15:20 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-189-60.clienti.tiscali.it. [78.12.189.60]) by smtp.gmail.com with ESMTPSA id c15-v6sm14020129edr.78.2018.05.08.15.15.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 May 2018 15:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=htQUR9b3kdjx3UODSzNRmd2xyHubaSPg8c7E/j7ZS+4=; b=C/lT/bwzL3Myt/0xALodunvZFijY5WKu1RaUOA7AESBvBBzoUqvksRuO4hvTrmozR3 XQ6lEIvlW6CGGmqV9Wo+nIsu9zYV6znzK+CohOL+DBWe+kTaKVfxqqVanWktuAA+vOQc Z9rWnYpWA0Fie4sL02Evj/5B9e6xvF9HBpvEIKOfLzvyhODzCPmNgP5FqGssZawsR8Va ueFyL/LQqiyV7vY/7F4VDkVKkth9YfPLpsCRDhUlxlQYNXByUhCisfKQXTX5fBc3Crp0 KAQTPUlMcpGTkRTFGd6m3zJimqUUxg0dkHLJo24egVjLMJPBaOd+zWN3d361xiIC3w6R bj0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=htQUR9b3kdjx3UODSzNRmd2xyHubaSPg8c7E/j7ZS+4=; b=fJEP5RRF5VL2Y1+m+lvGpqkOnDzgoMWTfNHw5vaxONBlXQuLjsLpHcpp/kW53gOj6G q143NVeD401s+AwsDNPERpJCWHHlUCIJSOUG5xF437KEFHci2UvS1kZ+j6WF/SroCf/3 7ocS/tildX9/+lOTrR4cJTblJQERovYaPKXdp3Ydh3jnShiu3cAv+0ZsF+yMWzudYeI3 fcQnAgTjfgSY1veqieZa5HBae1ACu+7H9HcjBXL0v94sZmzzB1J5wmOSqgYGDSnlhULv Ahrif0dH6U02l4V9BAh4jctdsvAkNvZrWcDiuvy30LuhepsmXmHUGWzInozWAq53zShM c+6A== X-Gm-Message-State: ALQs6tD3Fmb7nhBVdAez+rpIoDul8KTrOLyEo4RNS9zye6ljGQLk2AYL BuyGj4GKWht+32r2wb3DsbGe1/Iz X-Google-Smtp-Source: AB8JxZob6hPt0wS5z8+uKrk9Jp4g5P+DPAike0T4CXXTjVDF72U5lmJgCHPmnWt/XEtKDItADeVX4Q== X-Received: by 2002:a50:a5f6:: with SMTP id b51-v6mr56734003edc.147.1525817719157; Tue, 08 May 2018 15:15:19 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 May 2018 00:14:42 +0200 Message-Id: <1525817687-34620-26-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1525817687-34620-1-git-send-email-pbonzini@redhat.com> References: <1525817687-34620-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 25/30] configure: Really use local libfdt if the system one is too old X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Philippe Mathieu-Daud=C3=A9 QEMU requires libfdt version >=3D 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=3D'${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 re= ference to `fdt_first_subnode' /root/src/github.com/philmd/qemu/hw/core/loader-fit.c:286: undefined re= ference to `fdt_next_subnode' /root/src/github.com/philmd/qemu/hw/core/loader-fit.c:277: undefined re= ference 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=C3=A9 Message-Id: <20180415230522.24404-2-f4bug@amsat.org> Signed-off-by: Paolo Bonzini Reviewed-by: Thomas Huth --- 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=3D"-I\$(SRC_PATH)/dtc/libfdt" - fdt_libs=3D"-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs" + fdt_ldflags=3D"-L\$(BUILD_DIR)/dtc/libfdt" + fdt_libs=3D"$fdt_libs" elif test "$fdt" =3D "yes" ; then # Not a git build & no libfdt found, prompt for system install error_exit "DTC (libfdt) version >=3D 1.4.2 not present." \ @@ -5742,6 +5743,7 @@ echo_version() { =20 # prepend pixman and ftd flags after all config tests are done QEMU_CFLAGS=3D"$pixman_cflags $fdt_cflags $QEMU_CFLAGS" +QEMU_LDFLAGS=3D"$fdt_ldflags $QEMU_LDFLAGS" libs_softmmu=3D"$pixman_libs $libs_softmmu" =20 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=3D$LDFLAGS" >> $config_host_mak echo "LDFLAGS_NOPIE=3D$LDFLAGS_NOPIE" >> $config_host_mak +echo "QEMU_LDFLAGS=3D$QEMU_LDFLAGS" >> $config_host_mak echo "LD_REL_FLAGS=3D$LD_REL_FLAGS" >> $config_host_mak echo "LD_I386_EMULATION=3D$ld_i386_emulation" >> $config_host_mak echo "LIBS+=3D$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 =3D $(strip $(sort $(filter %.o,$1)) \ # must link with the C++ compiler, not the plain C compiler. LINKPROG =3D $(or $(CXX),$(CC)) =20 -LINK =3D $(call quiet-command, $(LINKPROG) $(QEMU_CFLAGS) $(CFLAGS) $(LDFL= AGS) -o $@ \ +LINK =3D $(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_D= IR)$@") =20 --=20 1.8.3.1