From patchwork Fri Dec 1 21:09:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 120382 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1640699qgn; Fri, 1 Dec 2017 13:10:03 -0800 (PST) X-Google-Smtp-Source: AGs4zMbzf39FpCnndhS/C5DLfkxvLwffyYVmZx/ijtVSKkMZ3JDOGHaRL9e+jRV/oVoUuULZ5w9O X-Received: by 10.80.135.26 with SMTP id i26mr19677514edb.31.1512162603130; Fri, 01 Dec 2017 13:10:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512162603; cv=none; d=google.com; s=arc-20160816; b=QRaOcrXwox8lQWMZTFJrGWe4ymK3a/RsaPQbkjlnJqXJNCZzpOsjLMZsDeiuApQTs/ HBOV9UqyFM21OYjFlqOt0QcrjNS10Tydfhn74M9vW3VVmUKgFo9YmeVE2gYd7wl9f+7k YXVcA0mhTzKMWOFv11D7/o5SpwXNLCGp+r+PMutqHGdxOa/oV5UZQPcm2asbmRt4vKts LY7Sog0pP7dC2TZTykzzGblw7Oqnu/KJF3d47IwobydLCPrNcl5bOy1MlmskSWfIw+us wR0N4yIGaU7PgVWaHCxN65/LmUJz8+lr4Ic0z+Fb+IieuZGiZMkwr8iAqA43PlZ2FIFq rolw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :arc-authentication-results; bh=HadOxRsR2fS7YD+XCit2ylxFTsbyYi5l8JkvcjsGC3g=; b=kOrlydf0iVa6e+2C58Q9YM6rUqq5Umb5WhBSlCkxUuGveT3hVlaE7C6rrCnc00ToYc DTX8o8E7ggdTwTlzN23DNeO5cmo20XE5RMH2AEh1uznv2O5soiZxUz9yK4gbeJj+Lmy4 SWFbLLZMUeW3mh8AVtdIWIZsUfsXSna1ujz/CgziUoQgyUFnaH7EXWcxKjmvEs5EXxki gzfMxhC5hZhIOXccfmFyk/p0XirUk/IX2jAvAweaOK/in5tx6T3KlRNotUUQ+SGP5QbL nzScC8pNQSnK3jAt3bAmcUMBrrYg857QUl6VkHDvHXqTNZYKwUdCs7lGD6EDmcocfRiS MyqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id x34si561088edb.125.2017.12.01.13.10.02; Fri, 01 Dec 2017 13:10:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 5954BC21F56; Fri, 1 Dec 2017 21:09:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5DDA5C21D64; Fri, 1 Dec 2017 21:09:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2EC50C21C4B; Fri, 1 Dec 2017 21:09:53 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 8F83EC21D64 for ; Fri, 1 Dec 2017 21:09:52 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 224E9ADDD; Fri, 1 Dec 2017 21:09:52 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Fri, 1 Dec 2017 22:09:50 +0100 Message-Id: <20171201210950.45101-1-agraf@suse.de> X-Mailer: git-send-email 2.12.3 Cc: Heinrich Schuchardt Subject: [U-Boot] [PATCH] efi_loader helloworld.efi: Fix building with -Os X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Depending on your compiler, when compiling the hello world efi binary with -Os, gcc might think it's a smart idea to replace common patterns such as memory copies with explicit calls to memcpy(). While that sounds great at first, we don't have any memcpy() available in our helloworld build target. So let's indicate to gcc that we really do want to have the code be built as freestanding. Fixes: bbf75dd9 ("efi_loader: output load options in helloworld") Signed-off-by: Alexander Graf --- lib/efi_loader/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile index 83d879b686..2722265ee3 100644 --- a/lib/efi_loader/Makefile +++ b/lib/efi_loader/Makefile @@ -7,8 +7,8 @@ # This file only gets included with CONFIG_EFI_LOADER set, so all # object inclusion implicitly depends on it -CFLAGS_helloworld.o := $(CFLAGS_EFI) -CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI) +CFLAGS_helloworld.o := $(CFLAGS_EFI) -Os -ffreestanding +CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI) -Os ifneq ($(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),) always += helloworld.efi