File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -276,9 +276,14 @@ if (CLR_CMAKE_HOST_UNIX)
276276  #-fms-compatibility      Enable full Microsoft Visual C++ compatibility 
277277  #-fms-extensions         Accept some non-standard constructs supported by the Microsoft compiler 
278278
279-   # Make signed arithmetic overflow of addition, subtraction, and multiplication wrap around 
279+   # Make signed overflow well-defined. Implies the following flags in clang-20 and above. 
280+   # -fwrapv - Make signed arithmetic overflow of addition, subtraction, and multiplication wrap around 
280281  # using twos-complement representation (this is normally undefined according to the C++ spec). 
281-   add_compile_options (-fwrapv)
282+   # -fwrapv-pointer - The same as -fwrapv but for pointers. 
283+   add_compile_options (-fno-strict-overflow)
284+ 
285+   # Suppress C++ strict aliasing rules. This matches our use of MSVC. 
286+   add_compile_options (-fno-strict-aliasing)
282287
283288  if (CLR_CMAKE_HOST_OSX)
284289    # We cannot enable "stack-protector-strong" on OS X due to a bug in clang compiler (current version 7.0.2) 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments