mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	tools/thermal: tmon: use "-fstack-protector" only if supported
Most, but not all, toolchains support the "-fstack-protector" flag. We check if the compiler supports the flag before using it. This allows tmon to be compiled for more environments. Signed-off-by: Markus Mayer <mmayer@broadcom.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
This commit is contained in:
		
							parent
							
								
									2bd6bf03f4
								
							
						
					
					
						commit
						ec04aa3ae8
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -1,8 +1,13 @@
 | 
				
			||||||
 | 
					# We need this for the "cc-option" macro.
 | 
				
			||||||
 | 
					include ../../../scripts/Kbuild.include
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VERSION = 1.0
 | 
					VERSION = 1.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BINDIR=usr/bin
 | 
					BINDIR=usr/bin
 | 
				
			||||||
WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int
 | 
					WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int
 | 
				
			||||||
CFLAGS+= -O1 ${WARNFLAGS} -fstack-protector
 | 
					CFLAGS+= -O1 ${WARNFLAGS}
 | 
				
			||||||
 | 
					# Add "-fstack-protector" only if toolchain supports it.
 | 
				
			||||||
 | 
					CFLAGS+= $(call cc-option,-fstack-protector)
 | 
				
			||||||
CC=$(CROSS_COMPILE)gcc
 | 
					CC=$(CROSS_COMPILE)gcc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CFLAGS+=-D VERSION=\"$(VERSION)\"
 | 
					CFLAGS+=-D VERSION=\"$(VERSION)\"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue