public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Marcin Wojtas <mw@semihalf.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "Gao, Liming" <liming.gao@intel.com>,
	 "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	 "daniel.thompson@linaro.org" <daniel.thompson@linaro.org>,
	 "leif.lindholm@linaro.org" <leif.lindholm@linaro.org>
Subject: Re: [PATCH] BaseTools/tools_def AARCH64 ARM: disable PIE linking for .aslc sources
Date: Tue, 21 Nov 2017 13:06:37 +0100	[thread overview]
Message-ID: <CAPv3WKf9ZEzYLHHy9ju1oCsBuNEj+zN_ap1QRSBj5W1vuBdJHA@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu8B39Fr87376B_c2PRbVgSyTK7ya1-aFOuxR3T9J9OvUA@mail.gmail.com>

Hi Ard,

2017-11-16 16:45 GMT+01:00 Ard Biesheuvel <ard.biesheuvel@linaro.org>:
> On 16 November 2017 at 15:31, Gao, Liming <liming.gao@intel.com> wrote:
>> Ard:
>>   Does this error only happen on ACPI table compiling? But, I see -no-pie is also in normal DLINK flag. Why is the driver not compiled failed?
>>
>
> The main difference is that the ACPI tables don't tolerate any padding
> at the start of the binary image. This is different for ELF binaries
> that are converted to PE/COFF, given that the entry point is exposed
> in the header, so the padding is just ignored. However, we should
> still try to omit those sections if we can.
>
>
>
>>> -----Original Message-----
>>> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
>>> Sent: Thursday, November 16, 2017 11:09 PM
>>> To: Marcin Wojtas <mw@semihalf.com>
>>> Cc: Gao, Liming <liming.gao@intel.com>; edk2-devel@lists.01.org; daniel.thompson@linaro.org; leif.lindholm@linaro.org
>>> Subject: Re: [edk2] [PATCH] BaseTools/tools_def AARCH64 ARM: disable PIE linking for .aslc sources
>>>
>>> On 16 November 2017 at 15:07, Marcin Wojtas <mw@semihalf.com> wrote:
>>> > Hi Ard,
>>> >
>>> > 2017-11-16 15:48 GMT+01:00 Ard Biesheuvel <ard.biesheuvel@linaro.org>:
>>> >> On 16 November 2017 at 14:38, Marcin Wojtas <mw@semihalf.com> wrote:
>>> >>> Hi Ard,
>>> >>>
>>> >>> With both PIE disabling patches for AARCH64, when compiling ACPI tables with
>>> >>> gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
>>> >>> I get following errors:
>>> >>> [...]
>>> >>> aarch64-linux-gnu-gcc: error: unrecognized command line option '-no-pie'
>>> >>> Do I understand correctly, that I should either revert those patches
>>> >>> or upgrade to the newer toolchain?
>>> >>>
>>> >>
>>> >> Ugh.
>>> >>
>>> >> I thought GCC 5 and later implemented -no-pie, but apparently not.
>>> >>
>>> >> Does this fix your build? I will need to check whether it fixes the
>>> >> original issue, but hopefully your toolchain doesn't choke on this:
>>> >>
>>> >> diff --git a/BaseTools/Conf/tools_def.template
>>> >> b/BaseTools/Conf/tools_def.template
>>> >> index aebd7d558633..111fe8da7773 100755
>>> >> --- a/BaseTools/Conf/tools_def.template
>>> >> +++ b/BaseTools/Conf/tools_def.template
>>> >> @@ -4496,10 +4496,10 @@ DEFINE GCC5_AARCH64_CC_FLAGS         =
>>> >> DEF(GCC49_AARCH64_CC_FLAGS)
>>> >>  DEFINE GCC5_AARCH64_CC_XIPFLAGS      = DEF(GCC49_AARCH64_CC_XIPFLAGS)
>>> >>  DEFINE GCC5_ARM_DLINK_FLAGS          = DEF(GCC49_ARM_DLINK_FLAGS) -no-pie
>>> >>  DEFINE GCC5_ARM_DLINK2_FLAGS         = DEF(GCC49_ARM_DLINK2_FLAGS) -Wno-error
>>> >> -DEFINE GCC5_AARCH64_DLINK_FLAGS      = DEF(GCC49_AARCH64_DLINK_FLAGS) -no-pie
>>> >> +DEFINE GCC5_AARCH64_DLINK_FLAGS      = DEF(GCC49_AARCH64_DLINK_FLAGS)
>>> >> -Wl,-no-pie
>>> >>  DEFINE GCC5_AARCH64_DLINK2_FLAGS     =
>>> >> DEF(GCC49_AARCH64_DLINK2_FLAGS) -Wno-error
>>> >>  DEFINE GCC5_ARM_ASLDLINK_FLAGS       = DEF(GCC49_ARM_ASLDLINK_FLAGS) -no-pie
>>> >> -DEFINE GCC5_AARCH64_ASLDLINK_FLAGS   =
>>> >> DEF(GCC49_AARCH64_ASLDLINK_FLAGS) -no-pie
>>> >> +DEFINE GCC5_AARCH64_ASLDLINK_FLAGS   =
>>> >> DEF(GCC49_AARCH64_ASLDLINK_FLAGS) -Wl,-no-pie
>>> >>
>>> >>  ####################################################################################
>>> >>  #
>>> >>
>>> >
>>> > Unfortunately no change, still:
>>> > aarch64-linux-gnu-gcc: error: unrecognized command line option '-no-pie'
>>> > In order to make sure, I double checked twice cleaninig everything and
>>> > rebuilding from scratch.
>>> >
>>>
>>> Thanks, but it doesn't matter anyway: it doesn't fix the original
>>> issues on affected toolchains.
>>>
>>> It appears the only way we can deal with this is introducing GCC6 and
>>> move the workaround there.
>>>

Do you think it would be reasonable to revert:
3380a59 - BaseTools/tools_def AARCH64 ARM: disable PIE linking for .aslc sources
1894a7c - BaseTools/tools_def AARCH64 ARM: disable PIE linking
on the EDK2 master branch, so that the users are not affected before
the actual workaround for problematic builds is moved to GCC6?

Best regards,
Marcin


      reply	other threads:[~2017-11-21 12:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 15:01 [PATCH] BaseTools/tools_def AARCH64 ARM: disable PIE linking for .aslc sources Ard Biesheuvel
2017-11-01 15:13 ` Gao, Liming
2017-11-01 15:18   ` Ard Biesheuvel
2017-11-16 14:38     ` Marcin Wojtas
2017-11-16 14:48       ` Ard Biesheuvel
2017-11-16 15:07         ` Marcin Wojtas
2017-11-16 15:08           ` Ard Biesheuvel
2017-11-16 15:31             ` Gao, Liming
2017-11-16 15:45               ` Ard Biesheuvel
2017-11-21 12:06                 ` Marcin Wojtas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPv3WKf9ZEzYLHHy9ju1oCsBuNEj+zN_ap1QRSBj5W1vuBdJHA@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox