Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-05-23 Thread Ard Biesheuvel
On Tue, 23 May 2023 at 10:50, Gerd Hoffmann wrote: > > Hi, > > > > Works (test patch below for reference). > > > > Excellent, thanks for confirming. > > > > So I think we should add this for all Clang configurations that enable > > PIE codegen. We don't support GCC < 5 anyway so this gives us un

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-05-23 Thread Gerd Hoffmann
Hi, > > Works (test patch below for reference). > > Excellent, thanks for confirming. > > So I think we should add this for all Clang configurations that enable > PIE codegen. We don't support GCC < 5 anyway so this gives us uniform > behavior for all ELF based toolchains used for x86. Which

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-05-23 Thread Ard Biesheuvel
On Mon, 22 May 2023 at 16:31, Gerd Hoffmann wrote: > > Hi, > > > > Recent clang does have a '-fdirect-access-external-data' switch which > > > should suppress these references, maybe in combination with > > > -fvisibility=hidden? > > > > I'll try that. > > Works (test patch below for reference).

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-05-22 Thread Gerd Hoffmann
Hi, > > Recent clang does have a '-fdirect-access-external-data' switch which > > should suppress these references, maybe in combination with > > -fvisibility=hidden? > > I'll try that. Works (test patch below for reference). thanks, Gerd diff --git a/BaseTools/Conf/tools_def.template b/B

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-05-22 Thread Gerd Hoffmann
On Mon, May 22, 2023 at 02:55:43PM +0200, Ard Biesheuvel wrote: > On Mon, 22 May 2023 at 14:28, Gerd Hoffmann wrote: > > > > Hi, > > > > So, after a way to long time gap, I finally found the time to look at > > this again. This time tried both gcc and clang. > > > > Just dropping the visibility

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-05-22 Thread Ard Biesheuvel
On Mon, 22 May 2023 at 14:28, Gerd Hoffmann wrote: > > Hi, > > So, after a way to long time gap, I finally found the time to look at > this again. This time tried both gcc and clang. > > Just dropping the visibility hidden #pragma works fine for gcc. It also > works with clang for DEBUG and RE

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-05-22 Thread Gerd Hoffmann
Hi, So, after a way to long time gap, I finally found the time to look at this again. This time tried both gcc and clang. Just dropping the visibility hidden #pragma works fine for gcc. It also works with clang for DEBUG and RELEASE builds, but not for NOOPT builds. > > Automatically detecti

回复: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-04-20 Thread gaoliming via groups.io
wei Chen ; Leif > Lindholm ; Michael D Kinney > ; Daniel Schaefer ; > Bob Feng ; Oliver Steffen > 主题: Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define > > On Tue, 18 Apr 2023 at 15:20, Gerd Hoffmann wrote: > > > > On Tue, Apr 18, 2023 at 01:59:43PM +

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-04-18 Thread Ard Biesheuvel
On Tue, 18 Apr 2023 at 15:20, Gerd Hoffmann wrote: > > On Tue, Apr 18, 2023 at 01:59:43PM +0200, Ard Biesheuvel wrote: > > On Tue, 18 Apr 2023 at 13:52, Gerd Hoffmann wrote: > > > > > > Seems to work fine on fedora 37, even without adding --relax, maybe this > > > is enabled by default (there is

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-04-18 Thread Marvin Häuser
> On 18. Apr 2023, at 15:20, Gerd Hoffmann wrote: > > On Tue, Apr 18, 2023 at 01:59:43PM +0200, Ard Biesheuvel wrote: >> On Tue, 18 Apr 2023 at 13:52, Gerd Hoffmann wrote: >>> >>> Seems to work fine on fedora 37, even without adding --relax, maybe this >>> is enabled by default (there is a --

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-04-18 Thread Gerd Hoffmann
On Tue, Apr 18, 2023 at 01:59:43PM +0200, Ard Biesheuvel wrote: > On Tue, 18 Apr 2023 at 13:52, Gerd Hoffmann wrote: > > > > Seems to work fine on fedora 37, even without adding --relax, maybe this > > is enabled by default (there is a --no-relax switch after all). I'll go > > try older distros /

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-04-18 Thread Ard Biesheuvel
On Tue, 18 Apr 2023 at 13:52, Gerd Hoffmann wrote: > > Hi, > > > > Underlying problem is that x64 ProcessorBind.h sets visibility to > > > hidden (anyone knows why?). > > > > Yes. Toolchains tend to assume that you are generating code for a > > shared library once you enabled -fpic, and this res

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-04-18 Thread Gerd Hoffmann
Hi, > > Underlying problem is that x64 ProcessorBind.h sets visibility to > > hidden (anyone knows why?). > > Yes. Toolchains tend to assume that you are generating code for a > shared library once you enabled -fpic, and this results in lots of > pointless indirections via the GOT. (This has to

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-04-14 Thread Marvin Häuser
> On 14. Apr 2023, at 16:57, Ard Biesheuvel wrote: > > On Fri, 14 Apr 2023 at 16:37, Gerd Hoffmann wrote: >> >>> On Fri, Apr 14, 2023 at 12:29:21PM +, Marvin Häuser wrote: >>> Hi Gerd, >>> >>> Thanks for your effort! >>> >>> Sorry, but I *really* dislike this “BASETOOLS” notion. There

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-04-14 Thread Ard Biesheuvel
On Fri, 14 Apr 2023 at 16:37, Gerd Hoffmann wrote: > > On Fri, Apr 14, 2023 at 12:29:21PM +, Marvin Häuser wrote: > > Hi Gerd, > > > > Thanks for your effort! > > > > Sorry, but I *really* dislike this “BASETOOLS” notion. There might be > > external tools that also want to use the header (like

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-04-14 Thread Marvin Häuser
> On 14. Apr 2023, at 16:37, Gerd Hoffmann wrote: > > On Fri, Apr 14, 2023 at 12:29:21PM +, Marvin Häuser wrote: >> Hi Gerd, >> >> Thanks for your effort! >> >> Sorry, but I *really* dislike this “BASETOOLS” notion. There might be >> external tools that also want to use the header (like

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-04-14 Thread Gerd Hoffmann
On Fri, Apr 14, 2023 at 12:29:21PM +, Marvin Häuser wrote: > Hi Gerd, > > Thanks for your effort! > > Sorry, but I *really* dislike this “BASETOOLS” notion. There might be > external tools that also want to use the header (like we do with AUDK) > and also edk2 supports host-based unit tests.

Re: [edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-04-14 Thread Marvin Häuser
Hi Gerd, Thanks for your effort! Sorry, but I *really* dislike this “BASETOOLS” notion. There might be external tools that also want to use the header (like we do with AUDK) and also edk2 supports host-based unit tests. Imo the macro name should be generic, like “HOST_OS” or “USERLAND” or some

[edk2-devel] [PATCH v4 01/10] BaseTools: add BASETOOLS define

2023-04-14 Thread Gerd Hoffmann
Allows for BaseTools-specific tweaks in include files. Signed-off-by: Gerd Hoffmann --- BaseTools/Source/C/Makefiles/header.makefile | 3 +++ BaseTools/Source/C/Makefiles/ms.common | 4 ++-- BaseTools/Source/C/VfrCompile/GNUmakefile| 1 + 3 files changed, 6 insertions(+), 2 deletions(-