From patchwork Tue Oct 4 13:01:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 612237 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp177821pvb; Tue, 4 Oct 2022 06:36:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5CsZ5my7dK6vEdCe5XrnZbWBEXgsAV+D3lfcm+BzYw7cv0kij7y5LhLoBlcQeomlxsT1b9 X-Received: by 2002:a05:620a:4382:b0:6ce:2761:28d0 with SMTP id a2-20020a05620a438200b006ce276128d0mr16645074qkp.329.1664890588043; Tue, 04 Oct 2022 06:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664890588; cv=none; d=google.com; s=arc-20160816; b=ehv/iWdVli1IVgF9DH9emj6rU1/7b0FtwUHi0CozmaRSdV3YmHy6DFQr+w3f9NAjg9 /s4EBElguOSiNfE7EJKaCLi17shjQSIxIjUWsH74q+Ysv6ZpJESHFiipwF4YmSwOdbUp 9yWqMhQB4a350hDuHzBOamFQIjY6IaTVaUAl5uzZg5HwUJZnrY1IBmhlIYWUg5BMtTg4 djqmnrUz3cjFfl8oOhanADGJSVnFCdYZqHMe+rMtrQ2AQuGOzY0l+jCdp5t806eMc6WY Hli+6SoyafpEzyCxywlO8VKNyRIW/Z8aMurtImm9P0JwPE2OxRiR3uOQ6I9piemvbvOs BD2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1wbzyVsrNixDoUvL/VKPckTR8bYZ6U3Uq3uU6HTglTE=; b=SNCLTX13C6uVlsQOma9UgAefkGcSJVNlrMlKdIYUODxIsOAtKeYIJNddhJ+t96oGhE Ihcml2oSHOO8cSsUyDfyZR/4pWHBUDL8o4kdwB9TdRErBgjdpnUds4UQRCnDZlQ4bfUH Vr0k+OeLQEmh09TxNnCZwqxbaMGDig1WE7NX/ZkIu1vHAVHjMNxX/XOcVOGSE+++2KHc V6kRvMEt4JJ4H4jN8dqtESI3kXJUqDEz0UQc5U5hkMI/rG3rqTiFstQV94NeUuYdg09D ZWGO2gf3a4b+W6GLmmXWSBx6+QRjAQUswExA485aoyyB2OOCnvAoXuK7ekf5Wp5HWgyB Y8fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=opqKd8Qr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q11-20020ad4574b000000b004b185b6f0d5si989631qvx.265.2022.10.04.06.36.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Oct 2022 06:36:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=opqKd8Qr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofi5z-00022u-HF for patch@linaro.org; Tue, 04 Oct 2022 09:36:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofhgN-0007NU-4X for qemu-devel@nongnu.org; Tue, 04 Oct 2022 09:09:59 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:43631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofhgI-00008H-TD for qemu-devel@nongnu.org; Tue, 04 Oct 2022 09:09:57 -0400 Received: by mail-wr1-x434.google.com with SMTP id n12so1659367wrp.10 for ; Tue, 04 Oct 2022 06:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=1wbzyVsrNixDoUvL/VKPckTR8bYZ6U3Uq3uU6HTglTE=; b=opqKd8QrN8gqA3s+BpAQ5Vf8OEYhgdufMMlr/U3KZwZ87/CYLmx5dozvdF24YjauVO KoCWsagjKItrbpZrXEqessDrGGtKvr32Q4m5hXL6XQuRHbJ4s4UNE+jNHflx7TiREt8x 1DBuxsHN5vggw5KmuQkGZb0fGCrOqhZfwG9LR0QuIY91KIT/QhKkpURqiTbuZOlnW4nc 2JcT4Wqvl6Gey6GF0h2IVAoVDslp2xevgMcLn/k4zEgQ410mp+aIeAabSVKSdgRLiJM/ vyIjCmK3kYDRNpiYFb3swBkGlS8tZkiRN9dPs9mPnYYUuKQ5DyYnAyXYDnHqkjz8PCEd HpZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=1wbzyVsrNixDoUvL/VKPckTR8bYZ6U3Uq3uU6HTglTE=; b=yX7ACRdivicPWxyu2lnW2+LcuEUMWKKRCsvzuq0Ksgh5EMe/tuKTstQ+EzwH33qgtv 3YzJLqnnP3tvz9024arIDlymCS271igL+nUoKQf9XHAh9fYaWBl7mA9Z1J+/GfESZzxf Ep0eioCf0FqrQnLMrnXeGq06shiueFQI8JD4mm0YrLIjA6RCBLWxarg0BNMInMSXQ1uK n9urrNPO5japmqTqyFwS+ouUiKHs6N7/AyVha88p+CvC5ei9EPicWu7DDqFptps88iUQ X7Wdr+43shmXrugpFchpunruwROekUd26F7WjyTg5kbz8Vu5lL0MIo33CjRk9mp8xbbM Zgkw== X-Gm-Message-State: ACrzQf14ZLLenA3NoswgQQlGR0q5uz0WQfrG07H78XJ0kBZjPnP/1vPq /IYavmf/paaZr3WT2rbDMWa3Ew== X-Received: by 2002:a5d:64c7:0:b0:22e:43a6:2801 with SMTP id f7-20020a5d64c7000000b0022e43a62801mr5056523wri.612.1664888992304; Tue, 04 Oct 2022 06:09:52 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id d16-20020adfe890000000b0022e035a4e93sm11819128wrm.87.2022.10.04.06.09.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 06:09:51 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 55B371FFCF; Tue, 4 Oct 2022 14:01:41 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, Paolo Bonzini , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= Subject: [PULL 26/54] configure: unify creation of cross-compilation Makefiles Date: Tue, 4 Oct 2022 14:01:10 +0100 Message-Id: <20221004130138.2299307-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004130138.2299307-1-alex.bennee@linaro.org> References: <20221004130138.2299307-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini Let write_target_makefile handle both host and container cross compilers. Signed-off-by: Paolo Bonzini Signed-off-by: Alex Bennée Message-Id: <20220929114231.583801-27-alex.bennee@linaro.org> diff --git a/configure b/configure index cbeac99b2b..8b495d4453 100755 --- a/configure +++ b/configure @@ -2157,51 +2157,49 @@ probe_target_compiler() { write_target_makefile() { echo "EXTRA_CFLAGS=$target_cflags" - if test -n "$target_cc"; then - echo "CC=$target_cc" - echo "CCAS=$target_ccas" - fi - if test -n "$target_ar"; then - echo "AR=$target_ar" - fi - if test -n "$target_as"; then - echo "AS=$target_as" - fi - if test -n "$target_ld"; then - echo "LD=$target_ld" - fi - if test -n "$target_nm"; then - echo "NM=$target_nm" - fi - if test -n "$target_objcopy"; then - echo "OBJCOPY=$target_objcopy" - fi - if test -n "$target_ranlib"; then - echo "RANLIB=$target_ranlib" - fi - if test -n "$target_strip"; then - echo "STRIP=$target_strip" - fi -} - -write_container_target_makefile() { - echo "$1: docker-image-$container_image" >> Makefile.prereqs - echo "EXTRA_CFLAGS=$target_cflags" - if test -n "$container_cross_cc"; then - echo "CC=$docker_py cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --" - echo "CCAS=$docker_py cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --" + if test -z "$target_cc" && test -z "$target_as"; then + test -z "$container_image" && error_exit "Internal error: could not find cross compiler for $1?" + echo "$1: docker-image-$container_image" >> Makefile.prereqs + if test -n "$container_cross_cc"; then + echo "CC=$docker_py cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --" + echo "CCAS=$docker_py cc --cc $container_cross_cc -i qemu/$container_image -s $source_path --" + fi + echo "AR=$docker_py cc --cc $container_cross_ar -i qemu/$container_image -s $source_path --" + echo "AS=$docker_py cc --cc $container_cross_as -i qemu/$container_image -s $source_path --" + echo "LD=$docker_py cc --cc $container_cross_ld -i qemu/$container_image -s $source_path --" + echo "NM=$docker_py cc --cc $container_cross_nm -i qemu/$container_image -s $source_path --" + echo "OBJCOPY=$docker_py cc --cc $container_cross_objcopy -i qemu/$container_image -s $source_path --" + echo "RANLIB=$docker_py cc --cc $container_cross_ranlib -i qemu/$container_image -s $source_path --" + echo "STRIP=$docker_py cc --cc $container_cross_strip -i qemu/$container_image -s $source_path --" + else + if test -n "$target_cc"; then + echo "CC=$target_cc" + echo "CCAS=$target_ccas" + fi + if test -n "$target_ar"; then + echo "AR=$target_ar" + fi + if test -n "$target_as"; then + echo "AS=$target_as" + fi + if test -n "$target_ld"; then + echo "LD=$target_ld" + fi + if test -n "$target_nm"; then + echo "NM=$target_nm" + fi + if test -n "$target_objcopy"; then + echo "OBJCOPY=$target_objcopy" + fi + if test -n "$target_ranlib"; then + echo "RANLIB=$target_ranlib" + fi + if test -n "$target_strip"; then + echo "STRIP=$target_strip" + fi fi - echo "AR=$docker_py cc --cc $container_cross_ar -i qemu/$container_image -s $source_path --" - echo "AS=$docker_py cc --cc $container_cross_as -i qemu/$container_image -s $source_path --" - echo "LD=$docker_py cc --cc $container_cross_ld -i qemu/$container_image -s $source_path --" - echo "NM=$docker_py cc --cc $container_cross_nm -i qemu/$container_image -s $source_path --" - echo "OBJCOPY=$docker_py cc --cc $container_cross_objcopy -i qemu/$container_image -s $source_path --" - echo "RANLIB=$docker_py cc --cc $container_cross_ranlib -i qemu/$container_image -s $source_path --" - echo "STRIP=$docker_py cc --cc $container_cross_strip -i qemu/$container_image -s $source_path --" } - - ########################################## # check for vfio_user_server @@ -2560,15 +2558,9 @@ for target in $target_list; do ;; esac - probe_target_compiler $target - if test $got_cross_cc = yes; then - write_target_makefile >> "$config_target_mak" - elif test -n "$container_image"; then - build_static=y - write_container_target_makefile build-tcg-tests-$target >> "$config_target_mak" - got_cross_cc=yes - fi - if test $got_cross_cc = yes; then + if probe_target_compiler $target || test -n "$container_image"; then + test -n "$container_image" && build_static=y + write_target_makefile "build-tcg-tests-$target >> "$config_target_mak" mkdir -p "tests/tcg/$target" ln -sf "$source_path/tests/tcg/Makefile.target" "tests/tcg/$target/Makefile" ln -sf "../config-$target.mak" "tests/tcg/$target/config-target.mak"