mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	Makefile: Build with -Werror=date-time if the compiler supports it
GCC 4.9 and newer have a new warning -Wdate-time, which warns on any use of __DATE__, __TIME__, or __TIMESTAMP__, which would make the build non-deterministic. Now that the kernel does not use any of those macros, turn on -Werror=date-time if available, to keep it that way. The kernel already (optionally) records this information at build time in a single place; other kernel code should not duplicate that. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
This commit is contained in:
		
							parent
							
								
									f9d7f7778c
								
							
						
					
					
						commit
						fe7c36c7bd
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		
							
								
								
									
										3
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								Makefile
									
									
									
									
									
								
							| 
						 | 
					@ -682,6 +682,9 @@ KBUILD_CFLAGS   += $(call cc-option,-Werror=implicit-int)
 | 
				
			||||||
# require functions to have arguments in prototypes, not empty 'int foo()'
 | 
					# require functions to have arguments in prototypes, not empty 'int foo()'
 | 
				
			||||||
KBUILD_CFLAGS   += $(call cc-option,-Werror=strict-prototypes)
 | 
					KBUILD_CFLAGS   += $(call cc-option,-Werror=strict-prototypes)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Prohibit date/time macros, which would make the build non-deterministic
 | 
				
			||||||
 | 
					KBUILD_CFLAGS   += $(call cc-option,-Werror=date-time)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# use the deterministic mode of AR if available
 | 
					# use the deterministic mode of AR if available
 | 
				
			||||||
KBUILD_ARFLAGS := $(call ar-option,D)
 | 
					KBUILD_ARFLAGS := $(call ar-option,D)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue