From patchwork Thu Sep 29 11:41:52 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: 610578 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp866396pvb; Thu, 29 Sep 2022 05:48:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5wXTYL+/FHTdXuME8wcRFEl5feLxkMmkzzOZa8lWWoSXWZmu9k8Ettez6BRY0rXVxmFHVX X-Received: by 2002:a05:6214:29c2:b0:4ad:68be:8c57 with SMTP id gh2-20020a05621429c200b004ad68be8c57mr2290176qvb.3.1664455712851; Thu, 29 Sep 2022 05:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664455712; cv=none; d=google.com; s=arc-20160816; b=rvyegKRYnPWbTDkDLRitVfbNkhxwqo2Jczx0N2uUAp2OlfF5zCIsaSFNPWvkFzPOzo hYhnktA9LJ5RawllJ3KLSWGZqPckeBi4ZdMSLNW6skJDUSK2aRgCRc9uCRjcy/4tqGzg FxLgWwBJIo9p3O5icyQMFNOLVW5Kuin85s3L71mOy2qJbTJfjxaakXpJA6h0cJmoTD33 +ExuMoP56fHY5g5LgMfycXmvu5Y5wgJn2CuuVXcneSuxJ1cH6Hf35cPUvsB9nycMuGW6 Uxt9lfdjpC3oLb+c++W/qqp3sm6WBCvvdexkqyD1X+5zb+AmWnzhwAugxrJuyJos1eBG jpHw== 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=nhWT7dn5jhHKp/a/I3xktJp1WlGBzEtR15pMyKD1w7s=; b=gd2h/QuJuuixcULZfFNcokbdE5ksqEmo/ICPQhkO2JG80sjEWjDncoNIby8Mn10sJY XhYC6DvD3NBU7PAaIUpZhRTGlIJfT2JmhotPEjNUnhNfQBiuzJxsDvU4Lri3ifDHXHZW NqyIBDv23gxzZR6Q+J0RZaSZPyZlaw7jV4z+I4jqJmta1qfdaIKAYEJ93NzLJppzC5Iq mpZ95usOGX3pq/wYA1NDyhqmZlk47Xx9VZ8lGCFffIUnHE7Le0EGoy64yuhrpd6wZFKd oS9RpeGrKd4i41VepF62xDlDwplBMxylxepr3qKsE9N9TZtlE4ugdWArDuoN9URSh5LS QXmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sJDwU4Oi; 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 r136-20020a37a88e000000b006b8e6d7e1edsi1153676qke.261.2022.09.29.05.48.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Sep 2022 05:48:32 -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=sJDwU4Oi; 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]:59116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odsxs-0002RN-9b for patch@linaro.org; Thu, 29 Sep 2022 08:48:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odrw7-0004OJ-Q5 for qemu-devel@nongnu.org; Thu, 29 Sep 2022 07:42:40 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:35781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1odrw5-0001Cy-NX for qemu-devel@nongnu.org; Thu, 29 Sep 2022 07:42:39 -0400 Received: by mail-wr1-x430.google.com with SMTP id u10so1641076wrq.2 for ; Thu, 29 Sep 2022 04:42:36 -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=nhWT7dn5jhHKp/a/I3xktJp1WlGBzEtR15pMyKD1w7s=; b=sJDwU4OivINnhIbUJ6XrelocPypzGM7kWgWQG1YKHetGB3tZSIACOQOpsiyLs7d5aK /+uEGgEhuPzo1nlx9u9QeMRcsw/b1bYC9mEPZnyIa/YUiMqRCA7VeZkY71mdrABf27fz TcymzoWrjOmg6dDKdy7CLh5AjEkEp5xRhVSn5+dSuHcKYCcNCqLt1c82nK4b6RPcXMv1 WQBQ5xDBsXGhB/c3xA0pCggttyxI9bIVXHmRPNRCmzwIvvIzJioNInWQcfqEpMNMnDSi yn3+kAR2yBbB0jpHUy0zSO78qup5hD+kBE5cvKr5NMIMeBzPfHxVhAvs6FNK9+j3YZac ocvQ== 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=nhWT7dn5jhHKp/a/I3xktJp1WlGBzEtR15pMyKD1w7s=; b=7mUxUpyH8oyboun04oyTuU1fZOvh1RRe2e0CAPDEgPeh+SSeLVssPnm9MBnbt1bXa7 bKBXIpC70rq3cqXS9BePLCHzWfRDZ3d8FGTwCcZcff3ECCQgSA5pHLLtSB7Xp0eerALt YK1AtYUBBKQuAZ+uYLidT9KWnku3uY8C9RAxDRdnaBuwRpvapymw3alyK88momC7+IFy yix9NRLEKkUmaNKzx4e8rdMW2H5Y3PE9LKd95spuDRgQX33MylyO8fKgNIhLuSxSp5tC pY0Ei17Hy/4vAATwwwnJak+dXFamjHznko194wO0mVbXf9c8LtFh+KJ3SQrwmSNAL6oQ nU5A== X-Gm-Message-State: ACrzQf2vc1sKz2pDs9ysEV44pCrru1eAOAyC8J48Q+rgiWtDjNPIeG1O YpwTNtc7rdieiQGUYyMVPDJj6g== X-Received: by 2002:adf:fe08:0:b0:22b:311:afcd with SMTP id n8-20020adffe08000000b0022b0311afcdmr1950501wrr.629.1664451756036; Thu, 29 Sep 2022 04:42:36 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id k15-20020adfd22f000000b0021badf3cb26sm6897482wrh.63.2022.09.29.04.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 04:42:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id ACD0F1FFC4; Thu, 29 Sep 2022 12:42:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: fam@euphon.net, berrange@redhat.com, f4bug@amsat.org, aurelien@aurel32.net, pbonzini@redhat.com, stefanha@redhat.com, crosa@redhat.com, minyihh@uci.edu, ma.mandourr@gmail.com, Luke.Craig@ll.mit.edu, cota@braap.org, aaron@os.amperecomputing.com, kuhn.chenqun@huawei.com, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v1 12/51] configure: do not invoke as/ld directly for pc-bios/optionrom Date: Thu, 29 Sep 2022 12:41:52 +0100 Message-Id: <20220929114231.583801-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220929114231.583801-1-alex.bennee@linaro.org> References: <20220929114231.583801-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.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 Just use using the compiler binary, with -nostdlib in the case of the linker; the compiler driver (whether i686-*-gcc, or x86_64-*-gcc with the -m32 option) will then pick the right magic option to as and ld. Signed-off-by: Paolo Bonzini Signed-off-by: Alex Bennée --- configure | 22 +++++----------------- pc-bios/optionrom/Makefile | 12 ++++-------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/configure b/configure index 52ae4adffc..aaa09fb957 100755 --- a/configure +++ b/configure @@ -2298,23 +2298,11 @@ probe_target_compiler i386-softmmu if test -n "$target_cc" && test "$targetos" != "darwin" && test "$targetos" != "sunos" && \ test "$targetos" != "haiku" && test "$softmmu" = yes ; then - # Different host OS linkers have different ideas about the name of the ELF - # emulation. Linux and OpenBSD/amd64 use 'elf_i386'; FreeBSD uses the _fbsd - # variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386pe. - for emu in elf_i386 elf_i386_fbsd elf_i386_obsd i386pe; do - if "$target_ld" -verbose 2>&1 | grep -q "^[[:space:]]*${emu}[[:space:]]*$"; then - ld_i386_emulation="$emu" - break - fi - done - if test -n "$ld_i386_emulation"; then - roms="pc-bios/optionrom" - config_mak=pc-bios/optionrom/config.mak - echo "# Automatically generated by configure - do not modify" > $config_mak - echo "TOPSRC_DIR=$source_path" >> $config_mak - echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_mak - write_target_makefile >> $config_mak - fi + roms="pc-bios/optionrom" + config_mak=pc-bios/optionrom/config.mak + echo "# Automatically generated by configure - do not modify" > $config_mak + echo "TOPSRC_DIR=$source_path" >> $config_mak + write_target_makefile >> $config_mak fi probe_target_compiler ppc-softmmu diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index e90ca2e1c6..3e06c11dea 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -20,28 +20,24 @@ override CFLAGS += $(call cc-option, -fcf-protection=none) # Flags for dependency generation override CPPFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d -override CFLAGS += $(filter -W%, $(QEMU_CFLAGS)) override CFLAGS += $(call cc-option, -fno-pie) +override CFLAGS += $(call cc-option, -no-pie) override CFLAGS += -ffreestanding -I$(TOPSRC_DIR)/include override CFLAGS += $(call cc-option, -fno-stack-protector) override CFLAGS += $(call cc-option, -Wno-array-bounds) -Wa = -Wa, -override ASFLAGS += -32 -override CFLAGS += $(call cc-option, $(Wa)-32) - -override LDFLAGS = -m $(LD_I386_EMULATION) -T $(SRC_DIR)/flat.lds +override LDFLAGS = -nostdlib -Wl,-T,$(SRC_DIR)/flat.lds pvh.img: pvh.o pvh_main.o %.o: %.S - $(call quiet-command,$(CC) $(CPPFLAGS) -E -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$@") + $(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<,"AS","$@") %.o: %.c $(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@,"CC","$@") %.img: %.o - $(call quiet-command,$(LD) $(LDFLAGS) -s -o $@ $^,"BUILD","$@") + $(call quiet-command,$(CC) $(CFLAGS) $(LDFLAGS) -s -o $@ $^,"BUILD","$@") %.raw: %.img $(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"BUILD","$@")