From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Date: Mon, 06 Aug 2018 21:55:37 +0300 Subject: [U-Boot] [PATCH v1] Makefile: Don't generate position independent code In-Reply-To: References: <20180806160022.43698-1-andriy.shevchenko@linux.intel.com> <97deab69fc2705e77d5741a5431db29c9bcc3e2a.camel@linux.intel.com> Message-ID: <13b1516b08a295dfbbd39f4fbd1f3c42bb233bcc.camel@linux.intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, 2018-08-06 at 19:32 +0200, Heinrich Schuchardt wrote: > On 08/06/2018 07:11 PM, Andy Shevchenko wrote: > > On Mon, 2018-08-06 at 18:56 +0200, Heinrich Schuchardt wrote: > > > On 08/06/2018 06:00 PM, Andy Shevchenko wrote: > > > > Fix all these by disabling PIE on Makefile level. > > > With the patch building with gcc-8.1 works on i386. > > > > Does it mean you are actually run it and it works? Can you confirm that binary you got is working for you? > > > But the interesting > > > question is whether the EFI subsystem will be able to relocate the > > > runtime code when the EFI service SetVirtualAddressMap() is > > > called. > > > > EFI code should have different CFLAGS I suppose. > > This really depends on the architecture: > > On RISC-V EFI specific flags are not defined. > On ARM > CFLAGS_NON_EFI := -fno-pic -ffixed-r9 -ffunction-sections -fdata- > sections > CFLAGS_EFI := -fpic -fshort-wchar > > On x86 > ifeq ($(IS_32BIT),y) > CFLAGS_NON_EFI := -mregparm=3 > endif > CFLAGS_EFI := -fpic -fshort-wchar > > Do you know how -fpic and -fno-PIE work together when both are passed > to > gcc? In all three cases where CONFIG_EFI is used there is no KBUILD_*FLAGS are in use. The special flags are for EFI apps as it supposed to be. > CFLAGS_EFI is only used to compile standalone EFI executables like > helloworld.efi not the EFI runtime. See lib/efi_loader/Makefile. Yes, I see no contradiction here. -- Andy Shevchenko Intel Finland Oy