Re: [patch 2.6.12] Add -Wno-pointer-sign to HOSTCFLAGS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> >cc-option checks to see if the flag is supported by $(CC) which could
> >be a completely different compiler from $(HOSTCC).  Hence the above
> >can incorrectly supply/fail to supply the argument.
> 
> Good point.  New patch.

I am having this patch queued:

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/04/03 22:26:47+02:00 [email protected] 
#   kbuild: Use -Wno-pointer-sign when building for host
#   
#   Avoid lot's of useless warning when building host utilities.
#   A brave sould may take a look sometime - but not all warnings are correct.
#   
#   From: Pawel Sikora <[email protected]>
#   Signed-off-by: Sam Ravnborg <[email protected]>
# 
# Makefile
#   2005/04/03 22:26:24+02:00 [email protected] +12 -4
#   -Wno-pointer-sign for gcc 4.xx when compiling host programs
# 
diff -Nru a/Makefile b/Makefile
--- a/Makefile	2005-04-30 00:35:17 +02:00
+++ b/Makefile	2005-04-30 00:35:17 +02:00
@@ -201,10 +201,10 @@
 	  else if [ -x /bin/bash ]; then echo /bin/bash; \
 	  else echo sh; fi ; fi)
 
-HOSTCC  	= gcc
-HOSTCXX  	= g++
-HOSTCFLAGS	= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-HOSTCXXFLAGS	= -O2
+HOSTCC  	:= gcc
+HOSTCXX  	:= g++
+HOSTCFLAGS	:= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCXXFLAGS	:= -O2
 
 # 	Decide whether to build built-in, modular, or both.
 #	Normally, just do built-in.
@@ -538,6 +538,14 @@
 
 # disable pointer signedness warnings in gcc 4.0
 CFLAGS += $(call cc-option,-Wno-pointer-sign,)
+
+HOSTCFLAGS += $(shell if $(HOSTCC) $(HOSTCFLAGS) -Wno-pointer-sign -S \
+              -o /dev/null -xc /dev/null > /dev/null 2>&1; then \
+               echo "-Wno-pointer-sign"; fi ;)
+
+HOSTCXXFLAGS += $(shell if $(HOSTCXX) $(HOSTCXXFLAGS) -Wno-pointer-sign -S \
+              -o /dev/null -xc /dev/null > /dev/null 2>&1; then \
+               echo "-Wno-pointer-sign"; fi ;)
 
 # Default kernel image to build when no specific target is given.
 # KBUILD_IMAGE may be overruled on the commandline or
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux