Home | History | Annotate | Download | only in release
      1 ############################################################################
      2 # Copyright 2016-2017 Intel Corporation
      3 #
      4 # Licensed under the Apache License, Version 2.0 (the "License");
      5 # you may not use this file except in compliance with the License.
      6 # You may obtain a copy of the License at
      7 #
      8 #     http://www.apache.org/licenses/LICENSE-2.0
      9 #
     10 # Unless required by applicable law or agreed to in writing, software
     11 # distributed under the License is distributed on an "AS IS" BASIS,
     12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 # See the License for the specific language governing permissions and
     14 # limitations under the License.
     15 ############################################################################
     16 # pylint: disable=locally-disabled, invalid-name, missing-docstring
     17 
     18 """gcc compiler configuration for release
     19 """
     20 from parts.config import ConfigValues, configuration
     21 
     22 def map_default_version(env):
     23     return env['GCC_VERSION']
     24 
     25 config = configuration(map_default_version)
     26 
     27 config.VersionRange("3-*",
     28                     append=ConfigValues(
     29                         CCFLAGS=['',
     30                                  # second level optimization
     31                                  '-O2',
     32                                  # treat warnings as errors
     33                                  '-Werror',
     34                                  # enable all warnings
     35                                  '-Wall',
     36                                  # extra warnings
     37                                  '-Wextra',
     38                                  # pedantic warnings
     39                                  # '-Wpedantic',
     40                                  # disable warnings due to gcc 4.8.5 issues
     41                                  '-Wno-missing-braces',
     42                                  '-Wno-missing-field-initializers',
     43                                  '-Wno-unknown-pragmas',
     44                                  '-Wno-unused-function',
     45                                  # do not assume strict aliasing
     46                                  '-fno-strict-aliasing',
     47                                  # do not warn about unused but set variables
     48                                  '-Wno-unused-but-set-variable',
     49                                  # do not warn about multiline comments
     50                                  '-Wno-comment',
     51                                  '-Wformat',
     52                                  '-Wformat-security',
     53                                  '-fstack-protector',
     54                                  '-fPIC'],
     55                         CPPDEFINES=['NDEBUG',
     56                                     '_FORTIFY_SOURCE=2'],
     57                         LINKFLAGS=['-fstack-protector',
     58                                    '-znoexecstack',
     59                                    '-zrelro',
     60                                    '-znow',
     61                                    '-pie'],
     62                     )
     63                    )
     64