On Sep 2, 2014, at 9:15 AM, Olivier Martin <[email protected]> wrote:

> So there are two solutions. Either we do not support GCC 3.4.2 (and RHEL 5.8) 
> or we add a build condition into the makefile to select the appropriate set 
> of flags.
> I personally do not have any preference as soon as the message is clear.
>  

Olivier,

Does this patch work for your test case?

Thanks,

Andrew Fish

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Andrew Fish <[email protected]>


diff --git a/BaseTools/Source/C/Makefiles/header.makefile 
b/BaseTools/Source/C/Makefiles/header.makefile
index 3049587..54d3c78 100644
--- a/BaseTools/Source/C/Makefiles/header.makefile
+++ b/BaseTools/Source/C/Makefiles/header.makefile
@@ -41,7 +41,12 @@ endif
 
 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I 
$(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I 
$(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) 
 CPPFLAGS = $(INCLUDE)
+ifeq ($(DARWIN),Darwin)
+# assume clang or clang compatible flags on OS X
 CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror 
-Wno-deprecated-declarations -Wno-self-assign -nostdlib -c -g
+else
+CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror 
-Wno-deprecated-declarations -nostdlib -c -g
+endif
 LFLAGS =
 
 ifeq ($(ARCH), IA32)
@@ -50,8 +55,7 @@ ifeq ($(ARCH), IA32)
 #  to x86_64. So make sure tools match uname -m. You can manual have a 64-bit 
kernal on Snow Leopard
 #  so only do this is uname -m returns i386.
 #
-uname_s = $(shell uname -s)
-ifeq ($(uname_s),Darwin)
+ifeq ($(DARWIN),Darwin)
   CFLAGS   += -arch i386
   CPPFLAGS += -arch i386
   LFLAGS   += -arch i386


> From: Andrew Fish [mailto:[email protected]] 
> Sent: 02 September 2014 17:08
> To: Olivier Martin
> Cc: [email protected]; [email protected]
> Subject: Re: [PATCH] BaseTools/Source/C: Removed '-Wno-self-assign' from 
> Makefile
>  
>  
> On Sep 2, 2014, at 3:45 AM, Olivier Martin <[email protected]> wrote:
> 
> 
> Dear BaseTools maintainer,
>  
> GCC 3.4.2 does not support this compiler flag.
> It prevents to build BaseTools on RHEL 5.8.
>  
>  
> Olivier,
>  
> Clang will not compile the tools without -Wno-self-assign, so this change 
> will break clang. 
>  
> gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror 
> -Wno-deprecated-declarations -nostdlib -c -g  -I .. -I ../Include/Common -I 
> ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I 
> ../Include/X64/  LzmaCompress.c -o LzmaCompress.o
> LzmaCompress.c:46:48: error: explicitly assigning a variable of type 'void *' 
> to itself [-Werror,-Wself-assign]
> static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
>                                              ~ ^ ~
> LzmaCompress.c:47:48: error: explicitly assigning a variable of type 'void *' 
> to itself [-Werror,-Wself-assign]
> static void SzFree(void *p, void *address) { p = p; MyFree(address); }
>  
> Thanks,
>  
> Andrew Fish
>  
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Olivier Martin <[email protected]>
>  
> Regards,
> Olivier
> <BaseTools-Source-C-Removed-Wno-self-assign-from-Makefile.patch>


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to