diff options
author | Hegedüs Márton Csaba <[email protected]> | 2018-06-11 17:43:14 +0200 |
---|---|---|
committer | Hegedüs Márton Csaba <[email protected]> | 2018-06-11 17:43:14 +0200 |
commit | 3cd24636f2ab1bf3da3d05d275eec8f0ae99c8ff (patch) | |
tree | 127890f130daa495e287fade0985e88f78b74538 | |
parent | 5c905339f858e0658cc2057d95beb01114b5972b (diff) |
Required changes according to the code review
-rwxr-xr-x | configure.py | 11 | ||||
-rw-r--r-- | src/build-data/cc/clang.txt | 2 | ||||
-rw-r--r-- | src/build-data/cc/gcc.txt | 2 | ||||
-rw-r--r-- | src/build-data/makefile.in | 6 |
4 files changed, 16 insertions, 5 deletions
diff --git a/configure.py b/configure.py index 77743d417..cb2b158f2 100755 --- a/configure.py +++ b/configure.py @@ -1064,7 +1064,7 @@ class CompilerInfo(InfoObject): # pylint: disable=too-many-instance-attributes 'output_to_exe': '-o ', 'add_include_dir_option': '-I', 'add_lib_dir_option': '-L', - 'add_sysroot_option': '--sysroot=', + 'add_sysroot_option': '', 'add_lib_option': '-l', 'add_framework_option': '-framework ', 'preproc_flags': '-E', @@ -1767,6 +1767,13 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch, def cmake_escape(s): return s.replace('(', '\\(').replace(')', '\\)') + def sysroot_option(): + if options.with_sysroot_dir == '': + return '' + if cc.add_sysroot_option == '': + logging.error('This compiler doesn''t support --sysroot option') + return cc.add_sysroot_option + options.with_sysroot_dir + def ar_command(): if options.ar_command: return options.ar_command @@ -1915,7 +1922,7 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch, 'dash_c': cc.compile_flags, 'cc_lang_flags': cc.cc_lang_flags(), - 'cc_sysroot': cc.add_sysroot_option + options.with_sysroot_dir, + 'cc_sysroot': sysroot_option(), 'cc_compile_flags': options.cxxflags or cc.cc_compile_flags(options), 'ldflags': options.ldflags or '', 'cc_warning_flags': cc.cc_warning_flags(options), diff --git a/src/build-data/cc/clang.txt b/src/build-data/cc/clang.txt index 65586088b..d46c26446 100644 --- a/src/build-data/cc/clang.txt +++ b/src/build-data/cc/clang.txt @@ -11,6 +11,8 @@ optimization_flags "-O3" sanitizer_optimization_flags "-O1 -fno-optimize-sibling-calls -fno-omit-frame-pointer" size_optimization_flags "-Os" +add_sysroot_option "--sysroot=" + <sanitizers> default -> address,undefined diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt index a1e45b428..98f1a2167 100644 --- a/src/build-data/cc/gcc.txt +++ b/src/build-data/cc/gcc.txt @@ -17,6 +17,8 @@ shared_flags "-fPIC" coverage_flags "--coverage" stack_protector_flags "-fstack-protector" +add_sysroot_option "--sysroot=" + <sanitizers> default -> iterator,address diff --git a/src/build-data/makefile.in b/src/build-data/makefile.in index 04aa9f461..7cd04360f 100644 --- a/src/build-data/makefile.in +++ b/src/build-data/makefile.in @@ -7,12 +7,12 @@ PYTHON_EXE = %{python_exe} # Compiler Flags -ABI_FLAGS = %{cxx_abi_flags} +ABI_FLAGS = %{cc_sysroot} %{cxx_abi_flags} LANG_FLAGS = %{cc_lang_flags} -CXXFLAGS = %{cc_sysroot} %{cc_compile_flags} +CXXFLAGS = %{cc_compile_flags} WARN_FLAGS = %{cc_warning_flags} SO_OBJ_FLAGS = %{shared_flags} -LDFLAGS = %{cc_sysroot} %{ldflags} +LDFLAGS = %{ldflags} EXE_LINK_CMD = %{exe_link_cmd} POST_LINK_CMD = %{post_link_cmd} |