From nobody Mon Feb 9 16:01:50 2026 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523833635923205.5267940878732; Sun, 15 Apr 2018 16:07:15 -0700 (PDT) Received: from localhost ([::1]:50325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f7qjm-0007vN-Qm for importer@patchew.org; Sun, 15 Apr 2018 19:07:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f7qiL-0007BN-NY for qemu-devel@nongnu.org; Sun, 15 Apr 2018 19:05:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f7qiK-00034Z-Pa for qemu-devel@nongnu.org; Sun, 15 Apr 2018 19:05:41 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:34647) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f7qiK-00034J-KQ for qemu-devel@nongnu.org; Sun, 15 Apr 2018 19:05:40 -0400 Received: by mail-qt0-x243.google.com with SMTP id a25so7222703qtm.1 for ; Sun, 15 Apr 2018 16:05:40 -0700 (PDT) Received: from x1.local ([138.117.48.212]) by smtp.gmail.com with ESMTPSA id 1sm9303173qtr.85.2018.04.15.16.05.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Apr 2018 16:05:39 -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=6ixix/PYllXoG6um6eJWBmeKpFCRUBproFDuyCG3tR8=; b=KLr4UjfxB3LL2WaeJige/kf8UF1nrWGkd1Jse4Y/NGXsfh0DJvktO0zFxNPj1HLilh UsgE3WRqAO/EYkhsDy0AIOH/Wnx/V9AjYy3sHK5rGV7TfiDQ1+iDCDjWmzg3dgHeWb23 QMTLYcNls6/HY2H6ugg+XKAaVVAI1W9YEvcVLX7/TDWizq1LCjjW3WhI/q856l/3IlDy ENUtQkWiQuYy6WSWmzh1Z5y7gfVj3SDUiJBfUNlAhTi6FXhU10RLkFJhK/Us2isjAQ5c ooCX2lPjkmkusZ5ZDC1E207AOxtDyrH4mz9fyCJ9AOzY+ebOQHuaKtqVOgbhmF6iuW8Z sDqA== 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=6ixix/PYllXoG6um6eJWBmeKpFCRUBproFDuyCG3tR8=; b=nNxGb9IQb7hAglP9SS3nR07QrW2/1NUWvByF0/lD03IpvWZhpSTM/D1x0OWeFTzADW OuE9hJu7PI3gybUzHGfldQySvQb1wfa+R7IiTal1aYQ4BoHFoRyp6vvgWadZhIwQzP7g AAp6pjOPCJko0YBf8OMlXrDiTj2vJilBQGa7uqnhLQKM3UWvUkXHmVIPZNJ3qwZBiuhb PuF8yd//vTfS73FzHSvrgMYwPlDr5fViIesVqjJUqt74KhbMOlgc+UzUCL7MPgFo/Gry Z+7bNgoL1we16zOtCOBe5/AhFFi8LOcuQ4S/P/xOPutd7RQI3nNCcZTpvy0dCGExQ4HO +EpQ== X-Gm-Message-State: ALQs6tDGh63Ab2OyPmPvczdUO3WyLxieB+ZkzQK9H7W4p9OQInLzanyF pBGKhbJo3ietDGyn0cmGJ44= X-Google-Smtp-Source: AIpwx4+Su4afAhYnYI82kVrrjDurSRaFwVJ+O6/pAHPjxP5LHP4GGTH+pTZvjY1C+J/cwtB1+n0Ulw== X-Received: by 10.237.53.161 with SMTP id c30mr14063059qte.203.1523833540079; Sun, 15 Apr 2018 16:05:40 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Peter Maydell , Stefan Hajnoczi , Eric Blake , Thomas Huth , Michael Tokarev Date: Sun, 15 Apr 2018 20:05:19 -0300 Message-Id: <20180415230522.24404-2-f4bug@amsat.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180415230522.24404-1-f4bug@amsat.org> References: <20180415230522.24404-1-f4bug@amsat.org> 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: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH for-2.12? 1/4] 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?Marc-Andr=C3=A9=20Lureau?= , YunQiang Su , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org 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 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 Reviewed-by: Thomas Huth --- configure | 6 +++++- rules.mak | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 0a19b033bc..162e804b49 100755 --- a/configure +++ b/configure @@ -3773,7 +3773,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." \ @@ -5715,6 +5716,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" @@ -5745,6 +5747,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" @@ -6679,6 +6682,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 93a07027b0..04c7f74d07 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 2.17.0