From patchwork Tue Sep 5 14:07:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 810182 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xmpTD27r5z9t2R for ; Wed, 6 Sep 2017 00:07:58 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3FF7CC21F5E; Tue, 5 Sep 2017 14:07:47 +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.7 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 72F7CC21C8F; Tue, 5 Sep 2017 14:07:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EEDC1C21C62; Tue, 5 Sep 2017 14:07:42 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lists.denx.de (Postfix) with ESMTPS id A0AA0C21C62 for ; Tue, 5 Sep 2017 14:07:42 +0000 (UTC) Received: from laptop1.fritz.box ([92.40.248.116]) by mail.gmx.com (mrgmx002 [212.227.17.184]) with ESMTPSA (Nemesis) id 0LgIWi-1dANNm3l4O-00nlXq; Tue, 05 Sep 2017 16:07:39 +0200 From: Heinrich Schuchardt To: Alexander Graf Date: Tue, 5 Sep 2017 16:07:16 +0200 Message-Id: <20170905140719.20192-2-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170905140719.20192-1-xypron.glpk@gmx.de> References: <20170905140719.20192-1-xypron.glpk@gmx.de> X-Provags-ID: V03:K0:So93/TVY7W7hBmjChQV06T5UZOAiKaJ12PtzY/EamebL/VLpSO1 Xr6YzOJXWnk1/6z8oAYnPL/qTJJQqUm/LO/vig3QHboqLX1iFKGYSXWmQQF7nFeyFi013Fv uq//5xuoDFhFm9Mny9hYzIDIyxLDhw4hmD+jYrPqwycU7hvi7npfaV4b8qpTc47CDbSBM26 KMoXbuB5FbnRi5suOzKzg== X-UI-Out-Filterresults: notjunk:1; V01:K0:7mp4sABRp9A=:Xjr0GLOJsih58NYetFGwJN PWA6UVedAYHYluvsd3tCyURza5Aqm3ObPWAqogY1przULd/Y+G9mJYXcobVkdgkM+CPTBONxh X260bigdKH+A3E7VsmZPBZVjDkLpG74QgCr+D02s4ffGG31rweNbfVsNqjDJR1//eeHksptr5 F1aZPGWU62H5PlsHctwPBa0WkTQvDFbCuYmppPcuJ1wPVwidF4HC5fPP1vWGBM1k3VOie0Hy6 79KpatP1AwZtQrp9RS7OkexnFaOy5A7JC4MGNklOdjHBxjKAcVh7uawrEH+8SqGpqGfSsKrtT JUvqbkKePoN1EqfJpQbAlbqbWRZAal3A9DzTQkAx56PvQ/48EHGXIuNPrcrxsyIObQx97YtW1 HtGzeDkslI9e+kTyPaWaT2gTw4XqpOPt2qExsRzyFfTqK1BpuoI5EpZdKbM3hChwPHX6prPGI YqXhDCIj2S9D/CIeavbXBfiISLIoMl92S+3eW8QgurP5g2ifzcNuA4ZG+HxfjnXTZ+GCkGlIE WzZADPLnN3a8jXGpXLsdBRD59H85wGJA5S6WRaZcr9qyjBQI8sDnN60xQtE+tbVgGCB0E31/D DIK8o7Makq2l9TQMhQ/WWZKsFQYeMtLYRqAbis22KuC2Li+3e27gaNiuuhNxkAe8pP4ru27Ai hdzRYAayupMXa22V1bAtgOVt2tw28D3xnmxmzc0vv5HjU19PLq7jSkkbANUWuLRA/wYQHhI1d pds/H/c0fgHX1jDMF0UG2mbtTLVONU5cYbQ3QRw/otYmVgg14d3VBVIlJpAJO/3duVe8jHcbU 0/ZFIvDnbEWD6BJWpuRs4HVqjiIKg== Cc: Mark Kettenis , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [U-Boot] [PATCH v2 1/4] efi_loader: rename __efi_hello_world_* 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" In scripts/Makefile.lib we build section including helloworld.efi. This allows to load the EFI binary with command 'bootefi hello'. scripts/Makefile.lib contains explicit references to strings containing helloworld and hello_world. This makes it impossible to generalize the coding to accomodate additional built in EFI binaries. Let us rename the variables __efi_hello_world_* to __efi_helloworld_*. Signed-off-by: Heinrich Schuchardt --- v2 no change --- cmd/bootefi.c | 4 ++-- include/asm-generic/sections.h | 4 ++-- scripts/Makefile.lib | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index a3768158a2..c5bfab1147 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -298,14 +298,14 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return CMD_RET_USAGE; #ifdef CONFIG_CMD_BOOTEFI_HELLO if (!strcmp(argv[1], "hello")) { - ulong size = __efi_hello_world_end - __efi_hello_world_begin; + ulong size = __efi_helloworld_end - __efi_helloworld_begin; saddr = env_get("loadaddr"); if (saddr) addr = simple_strtoul(saddr, NULL, 16); else addr = CONFIG_SYS_LOAD_ADDR; - memcpy((char *)addr, __efi_hello_world_begin, size); + memcpy((char *)addr, __efi_helloworld_begin, size); } else #endif { diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index daf021b647..b6535705a5 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -22,8 +22,8 @@ extern char __kprobes_text_start[], __kprobes_text_end[]; extern char __entry_text_start[], __entry_text_end[]; extern char __initdata_begin[], __initdata_end[]; extern char __start_rodata[], __end_rodata[]; -extern char __efi_hello_world_begin[]; -extern char __efi_hello_world_end[]; +extern char __efi_helloworld_begin[]; +extern char __efi_helloworld_end[]; /* Start and end of .ctors section - used for constructor calls. */ extern char __ctors_start[], __ctors_end[]; diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 7f97e8ebf3..164c234b4c 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -350,11 +350,11 @@ cmd_S_efi= \ ( \ echo '.section .rodata.efi.init,"a"'; \ echo '.balign 16'; \ - echo '.global __efi_hello_world_begin'; \ - echo '__efi_hello_world_begin:'; \ + echo '.global __efi_helloworld_begin'; \ + echo '__efi_helloworld_begin:'; \ echo '.incbin "$<" '; \ - echo '__efi_hello_world_end:'; \ - echo '.global __efi_hello_world_end'; \ + echo '__efi_helloworld_end:'; \ + echo '.global __efi_helloworld_end'; \ echo '.balign 16'; \ ) > $@ From patchwork Tue Sep 5 14:07:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 810184 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xmpW62LNJz9t2R for ; Wed, 6 Sep 2017 00:09:38 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 01F7AC21F7C; Tue, 5 Sep 2017 14:08:17 +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.7 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL 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 18E42C21EFE; Tue, 5 Sep 2017 14:07:50 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C2CEFC21C8F; Tue, 5 Sep 2017 14:07:45 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lists.denx.de (Postfix) with ESMTPS id 8102BC21D64 for ; Tue, 5 Sep 2017 14:07:44 +0000 (UTC) Received: from laptop1.fritz.box ([92.40.248.116]) by mail.gmx.com (mrgmx002 [212.227.17.184]) with ESMTPSA (Nemesis) id 0LdYxu-1d6VlG0yVm-00injc; Tue, 05 Sep 2017 16:07:40 +0200 From: Heinrich Schuchardt To: Alexander Graf Date: Tue, 5 Sep 2017 16:07:17 +0200 Message-Id: <20170905140719.20192-3-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170905140719.20192-1-xypron.glpk@gmx.de> References: <20170905140719.20192-1-xypron.glpk@gmx.de> X-Provags-ID: V03:K0:Dnoo4VxZ3RxNn9anCNHVuTKZNtW3wuMEgAtowxDuTo1s0ShGs5O ZuvPglPQpu8nrpnGVGTYBKAy+59Zpdn1bnuCtib/OXjnthzmlI2wZ+k2lq123f9iB0Y7wc+ BnM9smT7zyQvmSLHw+FHVbDHs7fe9f3ochUriEYmRH6sNmPy783ThmkEnmYELcyXFxAHPTI nYQynLOc8+QHP019YE2Cw== X-UI-Out-Filterresults: notjunk:1; V01:K0:3nXLckmPMUo=:kmilLqrwWcCgZBhHZg06ua j3j02koKiB2q1CrqnQFtOoUqAkXKazIv2yspH8txtG0IOoZMZSyCO9+Cstntjjo+wBo+ZQ1AY 1sxvca+xZmOiNBRCSEVd0bdeDRGfMZoke1MDlUwC7s++3ry+/P2jwWVKCsRWEPQ8A6npgh8/X f+lpbKH2zlnr5XB6/NG5+Kc1IZTeydSm9k8Gobo968N7puS2y6DlrXGPRd6iusC8Gmhh7FF4j PAoBtspR8KXb25SINY1MSpqBoNH51xqoBaZlx0zbfQMVaVUKSXb1bps4PgFTGkIj+qR0JtQ07 5vkrs1Ak/N5Dt95jbX4/PTF86pvtV6xVk5I0r/eVMtR0If+1Hn9eIjKYoZLQV1FU6O1jLDMKK dmDQOSOFdYNK6o7wX5P20W6Rzzg5FmAUWsXIJyj0tr5seumTFAoKE+7TzFzyjQa6RhmUE3uZJ Thk1KM9YhZAisRDY0MB/J73kT54GwTbq8Av68kP7tc+M6zQ7dbWxX7U467UWRx188Qzq6YVnc ntMFCdYPMBe5xYaua84u0Wu+ZBwmur18gQWXbiW17Ab9u9cYxzwS64kW4YEciSgCjOm/+OkQz 4GXGLYC7iRLXSTQvdgarZfFZluC15gyVEAVC1+q39P7kahdSk25cCyy5UTJ4qrvgUpUc7ZVbW 0rOMB1lw0GSzOQW3u6xPxl2y2fCDp55WxjR3BiG3LxtBoMDoY2Ox5+drCvf5l051klwoaGUH+ jbs4U80HAOuv6EikLvBoMsSBMGhEuUYRCLTAJmoBmZuGlKYD9TmNSdtTcOz8Bas0Vjr+rxvbB zCQotZnUqeRDxexYPwp3OS6yMc1mw== Cc: Mark Kettenis , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [U-Boot] [PATCH v2 2/4] scripts/Makefile.lib: generalize building built in EFI app 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" Replace all occurences of helloworld by generalized forms. This allows us to build additional EFI applications that are included into the U-Boot binary without loading scripts/Makefile.lib with specific filenames. Signed-off-by: Heinrich Schuchardt --- v2 Removed superfluous reference to $($*_deps). --- scripts/Makefile.lib | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 164c234b4c..ebc74f8987 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -342,20 +342,22 @@ cmd_S_ttf= \ $(obj)/%.S: $(src)/%.ttf $(call cmd,S_ttf) -# EFI Hello World application +# EFI applications +# A Makefile target *.efi is built as EFI application. +# A Makefile target *_efi.S wraps *.efi as built-in EFI application. # --------------------------------------------------------------------------- # Generate an assembly file to wrap the EFI app -cmd_S_efi= \ -( \ - echo '.section .rodata.efi.init,"a"'; \ - echo '.balign 16'; \ - echo '.global __efi_helloworld_begin'; \ - echo '__efi_helloworld_begin:'; \ - echo '.incbin "$<" '; \ - echo '__efi_helloworld_end:'; \ - echo '.global __efi_helloworld_end'; \ - echo '.balign 16'; \ +cmd_S_efi= \ +( \ + echo '.section .rodata.$*.init,"a"'; \ + echo '.balign 16'; \ + echo '.global __efi_$*_begin'; \ + echo '__efi_$*_begin:'; \ + echo '.incbin "$<" '; \ + echo '__efi_$*_end:'; \ + echo '.global __efi_$*_end'; \ + echo '.balign 16'; \ ) > $@ $(obj)/%_efi.S: $(obj)/%.efi @@ -366,7 +368,7 @@ cmd_efi_objcopy = $(OBJCOPY) -j .header -j .text -j .sdata -j .data -j \ .dynamic -j .dynsym -j .rel* -j .rela* -j .reloc \ $(if $(EFI_TARGET),$(EFI_TARGET),-O binary) $^ $@ -$(obj)/%.efi: $(obj)/%.so +$(obj)/%.efi: $(obj)/%_efi.so $(call cmd,efi_objcopy) quiet_cmd_efi_ld = LD $@ @@ -375,7 +377,7 @@ cmd_efi_ld = $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared \ EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS) -$(obj)/helloworld.so: $(obj)/helloworld.o arch/$(ARCH)/lib/$(EFI_CRT0) \ +$(obj)/%_efi.so: $(obj)/%.o arch/$(ARCH)/lib/$(EFI_CRT0) \ arch/$(ARCH)/lib/$(EFI_RELOC) $(call cmd,efi_ld) From patchwork Tue Sep 5 14:07:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 810186 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xmpWc69Qzz9t2W for ; Wed, 6 Sep 2017 00:10:04 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 80328C21F84; Tue, 5 Sep 2017 14:08:33 +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.7 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 EDC00C21F84; Tue, 5 Sep 2017 14:07:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4134FC21D92; Tue, 5 Sep 2017 14:07:52 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lists.denx.de (Postfix) with ESMTPS id 18C68C21D8B for ; Tue, 5 Sep 2017 14:07:49 +0000 (UTC) Received: from laptop1.fritz.box ([92.40.248.116]) by mail.gmx.com (mrgmx002 [212.227.17.184]) with ESMTPSA (Nemesis) id 0MMBun-1dqbxY2NJt-0083vr; Tue, 05 Sep 2017 16:07:42 +0200 From: Heinrich Schuchardt To: Alexander Graf Date: Tue, 5 Sep 2017 16:07:18 +0200 Message-Id: <20170905140719.20192-4-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170905140719.20192-1-xypron.glpk@gmx.de> References: <20170905140719.20192-1-xypron.glpk@gmx.de> X-Provags-ID: V03:K0:T5QjckNMAzHA7CgyhoWLgnqnnW0PvGKEAzlGKHWCRs7Ot1wnRiU Nx4Q9G/JPol2QqMehHu7zDE+1Qt7fW0X6+XfvIvORud7GWkTAGisO4BKTtFyZ1ClKSbedz6 /VSm6D6oKlSBWeo5cbc0QriXyWaTK16UAF6oLPlFhdTGBK11g2IGTJdyn20q/EpcJcHZSTx 3FNvCIcxQD3U2l9Mka0FQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:PjqV4sP7gPI=:G7T3sE+OE0Ggry2U6WYQFy kKtVP0k0jxjN5WELtFfMW3l5BEYUWqOTkgUo18DgnhpXOdgr0NhCxOCyCPSK+KEcYJKQ4aElV oM0OAuRislbFEJjR0FtEZ2sStbm7A1b6Yfi24wmc7Ul6cJg1On0YnmCIsSYrpMgxyFAc2L2Ws JEGspE31gXSu0IIKXRAaA8eoaglS902e8TEw0nkeslW6+6Y0NV5ibipGbS5eG5Es0oFUlbfbi lHt17R9TbIeDUOlQJDYnjiSEj+ZdkCrLm06Kzh9R3bb12qwRJnsdtRzjNNu2otpcXwQL3qHc5 SOJ+8ijdlcuL8RiUXJuj3eRcbEEWazFc3c5QTdLM9huM8b0p4KDUhdqWYdTIIpsuTYTWrjrXe EV5HVnQsT/mFjDxFB/RZDiWnJR/XVn4rW3xHGJYRND2MQayldB1kzS1JvGHs60jU+mXHd1MgG zdLYDoS0Ai1SrQwMgpq0gB/Vxo/KxdsR8ZEhwsqXW6YNtcAoNFwpYTp6ack8Pb9w7ADVyTd/S yeLnBTVroEdpQ3sTp4u8fFeC32cl7uhPVq8j1lDvwu/kylqAjdi1Nl7bhZbYPvensdP8LbtVA a6TYxtIuRdvghejIyC0RHDXOIbiR+uq7iURbn8DcXUjBlRQ30J48yhTf2o+QnVVy0W9LFFjRr zz6EMr7/9+3yJ396FqtsM3F34ZSa64Zq/eXtFkH9ytvBkJ8wfc1omExNAEMLFyIlV/CCBLGYC qCubSkLNCe7z1JtnucDB340s7E3LC8+HwhEwCyj1NI4eaczUv8PbAoUOMwU4TnjioIuSzjq6P W04G6yjpX/2lqFVvDJq444mw+Sz9w== Cc: Mark Kettenis , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [U-Boot] [PATCH v2 3/4] efi_loader: usage of always in Makefile 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" Variable always should only be appended but not overwritten by lib/efi_loader/Makefile. Remove variable efiprogs which is not otherwise used. Signed-off-by: Heinrich Schuchardt --- v2 no change --- lib/efi_loader/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile index 6bca05aeb4..5200497230 100644 --- a/lib/efi_loader/Makefile +++ b/lib/efi_loader/Makefile @@ -10,8 +10,9 @@ CFLAGS_helloworld.o := $(CFLAGS_EFI) CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI) -efiprogs-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += helloworld.efi -always := $(efiprogs-y) +ifneq ($(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),) +always += helloworld.efi +endif obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o obj-y += efi_image_loader.o efi_boottime.o efi_runtime.o efi_console.o From patchwork Tue Sep 5 14:07:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 810185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xmpWb3d07z9t2R for ; Wed, 6 Sep 2017 00:10:03 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 26C49C21FA6; Tue, 5 Sep 2017 14:08:48 +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.7 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 18DF0C21D95; Tue, 5 Sep 2017 14:08:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 26AD4C21D64; Tue, 5 Sep 2017 14:07:50 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lists.denx.de (Postfix) with ESMTPS id 06900C21E3E for ; Tue, 5 Sep 2017 14:07:46 +0000 (UTC) Received: from laptop1.fritz.box ([92.40.248.116]) by mail.gmx.com (mrgmx002 [212.227.17.184]) with ESMTPSA (Nemesis) id 0Lh7sF-1dA68H41eZ-00oaUX; Tue, 05 Sep 2017 16:07:43 +0200 From: Heinrich Schuchardt To: Alexander Graf Date: Tue, 5 Sep 2017 16:07:19 +0200 Message-Id: <20170905140719.20192-5-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170905140719.20192-1-xypron.glpk@gmx.de> References: <20170905140719.20192-1-xypron.glpk@gmx.de> X-Provags-ID: V03:K0:lTtvjJu1vNBDB4iPZYxL5e5Zx4VpgHEYo74L/PTS7YW1SfOGNCD VM7pLmJTqZ3LM+ZqVmAe6e0zU5m5qhOwCJE/JG7zLLYxLzBRCiHnyzAqIcHbSYKJ2mIWuYG baTVCsjPCi05pAxHBKoeJ+ZPwYRjlNjsNlwxAT7foyUgk1IjU6ndgjAJVH1HjqVUgxQVGjy qUZyeh7Y8mIYMUNOAFE/A== X-UI-Out-Filterresults: notjunk:1; V01:K0:cIXNnRdhoBY=:APcn4hGjDUr48kIv1Kw0kC BcYKTKxvY3BqxKsvw/mvrHnz4rK9kXkkaeA9AevzeFWdkkZryRg4e9/Atxrjupwh/ZwE8E6jW SZ9Zye48MpyIXryAo2DOBvekBbhPv3FoaqG7e7ZJ6G0BPdRJiU1JzCxBHDQ7hf9oQNafUfSwX hmPiGU/XoLT2xeNMWEyZJFEWxslR/pI30KtapIc5/RfY5UF5Pqr0OECyQLO3NDMzijXqTZMR9 7r/V4GoFdqgOISzzpXL6jgijydVZfXagnKbyV4E9prDvxUxg74HPTFaWSKQkmT9lmFrE36wo5 q/5EzbVLJM82GGtYlsTB/zVOpjFOxy1FuD6uVg/tDE4+T68mecs5FEP5HyWyNFnjbLV+KCEUA WPTpkg/kKg8upzWbjaKtNqi6WypBhBXHfqqynvJOmWYdW/90slR9nNOfx6ocTlqkYXsTGKkRg cgsvTZJiA0NcSupOxZ5BFJndaxyE1phuX3dKpr7o9MhGqzrbeuKW11iCnYR2wi0nxy8pHbMDA 3VxOY/4XogJ2bGzDVKv/WL/K207S2B1tsb3CdsY3BxlH0Ni9Prbo5AMDRzh2/0gP2fnAlXeyv nxnNOzVMHn9KDsrop48w0AKRqNeyrcEozQGy+wC/sjPct3Pqeece74xvRR5uNkLh80iRhLn// dEFdvI3zR6S9Tn37ncwPTFH/8SgjzPF7i5lhkazZHqNCIZrfKKH37t4quC5Vk82iOBFkHqYnm uAtjxmjf7cp6EjDI7wIOs1vDS3TEax9KBVZjY9E8yDhOJuHzz/uAxePmgaUuJ697e5pDBHePQ ppLnghtuuDKTR0jBosbMt9f+HTjUw== Cc: Mark Kettenis , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [U-Boot] [PATCH v2 4/4] efi_loader: allow multiple source files for EFI apps 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" With this patch an EFI application can be built out of multiple source files. All object files that are to be included into the EFI application %.efi must be added to variable %-objs. E.g. helloworld-objs = helloworld.o script/Makefile.lib automatically generates file %_efi.d containing the dependency definition. This file is included in the next run of make. From now on all objects in %-objs are built. The %_efi.d file should be included in the source distribution. After adding a new file to %-objs the first make run will fail due to the outdated %_efi.d file. Signed-off-by: Heinrich Schuchardt --- v2 new patch --- lib/efi_loader/Makefile | 3 +++ lib/efi_loader/helloworld_efi.d | 1 + scripts/Makefile.lib | 12 ++++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 lib/efi_loader/helloworld_efi.d diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile index 5200497230..d6a9635cc8 100644 --- a/lib/efi_loader/Makefile +++ b/lib/efi_loader/Makefile @@ -10,6 +10,9 @@ CFLAGS_helloworld.o := $(CFLAGS_EFI) CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI) +helloworld-objs = \ +helloworld.o + ifneq ($(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),) always += helloworld.efi endif diff --git a/lib/efi_loader/helloworld_efi.d b/lib/efi_loader/helloworld_efi.d new file mode 100644 index 0000000000..892db64c8b --- /dev/null +++ b/lib/efi_loader/helloworld_efi.d @@ -0,0 +1 @@ +lib/efi_loader/helloworld_efi.d: lib/efi_loader/helloworld.o diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index ebc74f8987..1a9f32902d 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -373,14 +373,22 @@ $(obj)/%.efi: $(obj)/%_efi.so quiet_cmd_efi_ld = LD $@ cmd_efi_ld = $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared \ - -Bsymbolic $^ -o $@ + -Bsymbolic $(foreach _s, $($*-objs), $(obj)/$(_s)) -o $@ EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS) -$(obj)/%_efi.so: $(obj)/%.o arch/$(ARCH)/lib/$(EFI_CRT0) \ +.PRECIOUS: $(obj)/%_efi.d + +$(obj)/%_efi.so: $(obj)/%.o $(obj)/%.d arch/$(ARCH)/lib/$(EFI_CRT0) \ arch/$(ARCH)/lib/$(EFI_RELOC) + @echo $(obj)/$*_efi.d: $(foreach _s, $($*-objs), $(obj)/$(_s)) \ + > $(obj)/$*_efi.d $(call cmd,efi_ld) +$(obj)/%.d:; + +include $(wildcard $(foreach _s, $(filter %_efi.o, $(obj-y)), $(_s:.o=.d))) + # ACPI # --------------------------------------------------------------------------- quiet_cmd_acpi_c_asl= ASL $<