-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Releases/m71 #3
base: master
Are you sure you want to change the base?
Releases/m71 #3
Changes from all commits
8c55557
de13037
8b4c5bf
29c9904
acffe89
9b0c7e4
b8cc22a
9851a7e
64a61fb
179bc02
6bbd16d
8564530
a1534f6
bb7e263
da87ccc
8057d7a
9603dd0
698ec30
dedb4ef
feea555
751c5ad
e8c23ed
1fc19f3
45c72c4
dfa8786
5b0d5bd
be194b2
fae04de
2e8dba4
c52de61
d5a2139
542b170
497094e
914501a
c835c66
813c5e3
d357f52
3579185
b5211f9
794296b
4557dc7
cba7ef1
f0ce0a7
9941608
170c225
0946a25
f80b444
8ba9407
b32cf47
9407778
ffa7641
a6ce039
4e120bb
4ea2218
0139ca4
916dd19
8d91370
f0e0893
ce61deb
5c4a1bc
495bba6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,11 +54,10 @@ if (current_os == target_os && current_cpu == target_cpu && | |
} else if (_script_arch == "x64") { | ||
_script_arch = "amd64" | ||
} | ||
assert( | ||
exec_script("//build/dir_exists.py", | ||
[ rebase_path(sysroot) ], | ||
"string") == "True", | ||
"Missing sysroot ($sysroot). To fix, run: build/linux/sysroot_scripts/install-sysroot.py --arch=$_script_arch") | ||
if (exec_script("//build/dir_exists.py", [ rebase_path(sysroot) ], "string") != "True") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this something that we'd be able to push back to google? If not, we will need to change this... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is added because of broken preparation for Linux x86. Not sure if this fix is still required. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you see if "official" has resolved this issue? |
||
arch_arg = "--arch=$_script_arch" | ||
exec_script("//build/linux/sysroot_scripts/install-sysroot-alt.py", [ arch_arg ]) | ||
} | ||
} | ||
} else if (is_mac) { | ||
import("//build/config/mac/mac_sdk.gni") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,12 +46,27 @@ declare_args() { | |
# and with this switch, clang emits it like this: | ||
# foo/bar.cc:12:34: error: something went wrong | ||
use_clang_diagnostics_format = false | ||
|
||
# Enable C++17 even on Win32. | ||
# For UWP, C++17 is always enabled because it is needed for C++/WinRT to | ||
# compile the wrappers. | ||
# This is needed to work around the fact that Abseil defines an incompatible | ||
# absl::optional in pre-c++17 mode while std::optional is used in c++17 mode. | ||
# So programs linking against webrtc.lib need to compile with the correct mode. | ||
std_cpp17 = false | ||
} | ||
|
||
# This is included by reference in the //build/config/compiler config that | ||
# is applied to all targets. It is here to separate out the logic that is | ||
# Windows-only. | ||
config("compiler") { | ||
configs = [] | ||
if (current_os == "winuwp") { | ||
std_cpp17 = true | ||
} | ||
if (std_cpp17) { | ||
configs += [ "//build/config/win:cpp17" ] | ||
} | ||
if (current_cpu == "x86") { | ||
asmflags = [ | ||
# When /safeseh is specified, the linker will only produce an image if it | ||
|
@@ -87,7 +102,7 @@ config("compiler") { | |
if (is_clang) { | ||
cflags += [ "-fmsc-version=1911" ] | ||
|
||
if (current_cpu == "x86") { | ||
if (current_cpu == "x86" || current_cpu == "arm") { | ||
cflags += [ "-m32" ] | ||
} else { | ||
cflags += [ "-m64" ] | ||
|
@@ -243,7 +258,7 @@ config("runtime_library") { | |
"_SECURE_ATL", | ||
] | ||
|
||
if (!use_vs_code_analysis) { | ||
if ((!use_vs_code_analysis) && (current_os != "winuwp")) { | ||
# This is required for ATL to use XP-safe versions of its functions. | ||
# However it is prohibited when using /analyze | ||
defines += [ "_USING_V110_SDK71_" ] | ||
|
@@ -281,10 +296,17 @@ config("runtime_library") { | |
} else { | ||
defines += [ "WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP" ] | ||
} | ||
cflags_cc += [ | ||
"/ZW", | ||
"/EHsc", | ||
] | ||
|
||
#TEMPORARY!!! Clang-cl.exe missing unwind support for Windows arm and arm64. This will generate errors in places where try/catch are used | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rephrase in a way that we can push back to google. It's okay to say this can be removed once clang-cl.exe has a feature but better to phrase properly for something we can push as I intend to push it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is something that definitely shouldn't be pushed to Google. Added just to see what other issues exist for arm and arm64. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need it in such a way that I can submit to google. We don't want to have differences we can't submit back. |
||
if (is_clang && (current_cpu == "arm" || current_cpu == "arm64")) { | ||
cflags_cc += [ | ||
"/EHs-c-", | ||
] | ||
} else { | ||
cflags_cc += [ | ||
"/EHsc" | ||
] | ||
} | ||
|
||
# This warning is given because the linker cannot tell the difference | ||
# between consuming WinRT APIs versus authoring WinRT within static | ||
|
@@ -308,6 +330,13 @@ config("runtime_library") { | |
} | ||
} | ||
|
||
config("cpp17") { | ||
cflags_cc = [ | ||
"/std:c++17", | ||
"/Zc:__cplusplus", | ||
] | ||
} | ||
|
||
# Sets the default Windows build version. This is separated because some | ||
# targets need to manually override it for their compiles. | ||
config("winver") { | ||
|
@@ -376,6 +405,20 @@ config("common_linker_setup") { | |
"/DYNAMICBASE", | ||
] | ||
|
||
# ASLR makes debugging with windbg difficult because Chrome.exe and | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How did you find this information about chrome? just wondering where it came from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is Google comment and it was present in older version of that file. I believe that is from m62. |
||
# Chrome.dll share the same base name. As result, windbg will name the | ||
# Chrome.dll module like chrome_<base address>, where <base address> | ||
# typically changes with each launch. This in turn means that breakpoints in | ||
# Chrome.dll don't stick from one launch to the next. For this reason, we | ||
# turn ASLR off in debug builds. | ||
if (is_debug) { | ||
if (current_cpu != "arm" && current_cpu != "arm64") { | ||
ldflags += [ "/DYNAMICBASE:NO" ] | ||
} | ||
} else { | ||
ldflags += [ "/DYNAMICBASE" ] | ||
} | ||
|
||
if (win_linker_timing) { | ||
ldflags += [ | ||
"/time", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,13 @@ if (current_toolchain == default_toolchain) { | |
# You would also define a toolchain_args variable with at least these set: | ||
# current_cpu: current_cpu to pass as a build arg | ||
# current_os: current_os to pass as a build arg | ||
# Some other supported variables are: | ||
# is_clang : flag whether to use or not clang compiler. Used when | ||
# invoking this toolchain not as the default one. | ||
# use_lld : flag whether to use or not lld linker. Used when | ||
# invoking this toolchain not as the default one. Added | ||
# because some runtime issues are discovered when lld is | ||
# used for linking libs and apps build with msvc cl.exe | ||
template("msvc_toolchain") { | ||
toolchain(target_name) { | ||
# When invoking this toolchain not as the default one, these args will be | ||
|
@@ -98,7 +105,14 @@ template("msvc_toolchain") { | |
cl = "${analyzer_prefix} ${cl}" | ||
} | ||
|
||
if (use_lld) { | ||
# Override use_lld value from default toolchain when passed like input argument | ||
if (defined(toolchain_args.use_lld)) { | ||
toolchain_uses_lld = toolchain_args.use_lld | ||
} else { | ||
toolchain_uses_lld = use_lld | ||
} | ||
|
||
if (toolchain_uses_lld) { | ||
if (host_os == "win") { | ||
lld_link = "lld-link.exe" | ||
} else { | ||
|
@@ -138,7 +152,7 @@ template("msvc_toolchain") { | |
if (defined(invoker.sys_lib_flags)) { | ||
linker_wrapper = "" | ||
sys_lib_flags = "${invoker.sys_lib_flags} " # Note trailing space | ||
} else if (use_lld) { | ||
} else if (toolchain_uses_lld) { | ||
# Invoke ninja as wrapper instead of tool wrapper, because python | ||
# invocation requires higher cpu usage compared to ninja invocation, and | ||
# the python wrapper is only needed to work around link.exe problems. | ||
|
@@ -171,8 +185,19 @@ template("msvc_toolchain") { | |
outputs = [ | ||
"$object_subdir/{{source_name_part}}.obj", | ||
] | ||
|
||
command = "$env_wrapper$cl /nologo /showIncludes ${clflags} $sys_include_flags{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" | ||
|
||
rspfile = "{{output}}.rsp" | ||
|
||
if (target_name == "uwp_clang_arm" || target_name == "win_clang_arm") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make it an rspFile for all paths. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, not sure why one path has rspFile and others do not. Original does not have rspPath. |
||
command = "$env_wrapper$cl /nologo /showIncludes ${clflags} @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\" --target=arm-windows-msvc /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -Wno-unknown-argument" | ||
rspfile_content = "$sys_include_flags{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" | ||
} else if (target_name == "uwp_clang_arm64" || target_name == "win_clang_arm64") { | ||
command = "$env_wrapper$cl /nologo /showIncludes ${clflags} @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\" --target=aarch64-windows-msvc /DWindowsSDKDesktopARM64Support=1" | ||
rspfile_content = "$sys_include_flags{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" | ||
} else { | ||
command = "$env_wrapper$cl /nologo /showIncludes ${clflags} @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" | ||
rspfile_content = "$sys_include_flags{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" | ||
} | ||
} | ||
|
||
tool("cxx") { | ||
|
@@ -187,8 +212,19 @@ template("msvc_toolchain") { | |
outputs = [ | ||
"$object_subdir/{{source_name_part}}.obj", | ||
] | ||
|
||
command = "$env_wrapper$cl /nologo /showIncludes ${clflags} $sys_include_flags{{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" | ||
|
||
rspfile = "{{output}}.rsp" | ||
|
||
if (target_name == "uwp_clang_arm" || target_name == "win_clang_arm") { | ||
command = "$env_wrapper$cl /nologo /showIncludes ${clflags} @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\" --target=arm-windows-msvc /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -Wno-unknown-argument" | ||
rspfile_content = "$sys_include_flags{{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}" | ||
} else if (target_name == "uwp_clang_arm64" || target_name == "win_clang_arm64") { | ||
command = "$env_wrapper$cl /nologo /showIncludes ${clflags} @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\" --target=aarch64-windows-msvc /DWindowsSDKDesktopARM64Support=1" | ||
rspfile_content = "$sys_include_flags{{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}" | ||
} else { | ||
command = "$env_wrapper$cl /nologo /showIncludes ${clflags} @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" | ||
rspfile_content = "$sys_include_flags{{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rsp consistency ? |
||
} | ||
} | ||
|
||
tool("rc") { | ||
|
@@ -201,12 +237,31 @@ template("msvc_toolchain") { | |
} | ||
|
||
tool("asm") { | ||
if (toolchain_args.current_cpu == "x64") { | ||
ml = "ml64.exe" | ||
if (!toolchain_uses_clang) { | ||
if (toolchain_args.current_cpu == "x64") { | ||
ml = "ml64.exe" | ||
} else if (toolchain_args.current_cpu == "x86") { | ||
ml = "ml.exe" | ||
} else if (toolchain_args.current_cpu == "arm"){ | ||
ml = "armasm.exe" | ||
} else if (toolchain_args.current_cpu == "arm64"){ | ||
ml = "armasm64.exe" | ||
} else { | ||
assert(false, "Unsupported CPU tartget") | ||
} | ||
} else { | ||
ml = "ml.exe" | ||
ml = "$env_wrapper$cl" | ||
} | ||
command = "$python_path $tool_wrapper_path asm-wrapper $env $ml {{defines}} {{include_dirs}} {{asmflags}} /c /Fo{{output}} {{source}}" | ||
|
||
if (toolchain_args.current_cpu == "x64" || toolchain_args.current_cpu == "x86") { | ||
command = "$python_path $tool_wrapper_path asm-wrapper $env $ml {{defines}} {{include_dirs}} {{asmflags}} /c /Fo{{output}} {{source}}" | ||
} else { | ||
command = "$python_path $tool_wrapper_path asm-wrapper $env $ml -oldit -16 {{include_dirs}} {{source}} -o {{output}}" | ||
if (is_clang && toolchain_args.current_cpu == "arm") { | ||
command += " --target=arm-pc-windows" | ||
} | ||
} | ||
|
||
description = "ASM {{output}}" | ||
outputs = [ | ||
"$object_subdir/{{source_name_part}}.obj", | ||
|
@@ -338,44 +393,39 @@ if (host_os == "win") { | |
clang_cl = "clang-cl" | ||
} | ||
|
||
if (target_cpu == "x86" || target_cpu == "x64") { | ||
win_build_host_cpu = target_cpu | ||
} else { | ||
win_build_host_cpu = host_cpu | ||
} | ||
|
||
# x86, arm and arm64 build cpu toolchains for Windows (not WinUWP). Only | ||
# define when the build cpu is one of these architectures since we don't | ||
# do any cross compiles when targeting x64-bit (the build does generate | ||
# some 64-bit stuff from x86/arm/arm64 target builds). | ||
if (win_build_host_cpu != "x64") { | ||
if (target_cpu != "x64") { | ||
build_cpu_toolchain_data = exec_script("setup_toolchain.py", | ||
[ | ||
visual_studio_path, | ||
windows_sdk_path, | ||
visual_studio_runtime_dirs, | ||
host_os, | ||
win_build_host_cpu, | ||
"environment." + win_build_host_cpu, | ||
target_cpu, | ||
"environment." + target_cpu, | ||
], | ||
"scope") | ||
|
||
msvc_toolchain(win_build_host_cpu) { | ||
environment = "environment." + win_build_host_cpu | ||
msvc_toolchain(target_cpu) { | ||
environment = "environment." + target_cpu | ||
cl = "${goma_prefix}\"${build_cpu_toolchain_data.vc_bin_dir}/cl.exe\"" | ||
if (host_os != "win") { | ||
# For win cross build. | ||
sys_lib_flags = "${build_cpu_toolchain_data.libpath_flags}" | ||
} | ||
toolchain_args = { | ||
current_os = "win" | ||
current_cpu = win_build_host_cpu | ||
current_cpu = target_cpu | ||
is_clang = false | ||
use_lld = false | ||
} | ||
} | ||
|
||
msvc_toolchain("win_clang_" + win_build_host_cpu) { | ||
environment = "environment." + win_build_host_cpu | ||
msvc_toolchain("win_clang_" + target_cpu) { | ||
environment = "environment." + target_cpu | ||
prefix = rebase_path("$clang_base_path/bin", root_build_dir) | ||
cl = "${goma_prefix}$prefix/${clang_cl}" | ||
sys_include_flags = "${build_cpu_toolchain_data.include_flags_imsvc}" | ||
|
@@ -386,8 +436,9 @@ if (win_build_host_cpu != "x64") { | |
|
||
toolchain_args = { | ||
current_os = "win" | ||
current_cpu = win_build_host_cpu | ||
current_cpu = target_cpu | ||
is_clang = true | ||
use_lld = true | ||
} | ||
} | ||
} | ||
|
@@ -420,6 +471,7 @@ template("win_x64_toolchains") { | |
is_clang = false | ||
current_os = "win" | ||
current_cpu = "x64" | ||
use_lld = false | ||
} | ||
} | ||
|
||
|
@@ -440,6 +492,7 @@ template("win_x64_toolchains") { | |
is_clang = true | ||
current_os = "win" | ||
current_cpu = "x64" | ||
use_lld = true | ||
} | ||
} | ||
} | ||
|
@@ -484,6 +537,20 @@ if (target_os == "winuwp") { | |
current_os = "winuwp" | ||
current_cpu = target_cpu | ||
is_clang = false | ||
use_lld = false | ||
} | ||
} | ||
msvc_toolchain("uwp_clang_" + target_cpu) { | ||
environment = "environment.store_" + target_cpu | ||
prefix = rebase_path("$clang_base_path/bin", root_build_dir) | ||
cl = "${goma_prefix}$prefix/${clang_cl}" | ||
sys_include_flags = "${store_cpu_toolchain_data.include_flags_imsvc}" | ||
|
||
toolchain_args = { | ||
current_os = "winuwp" | ||
current_cpu = target_cpu | ||
is_clang = true | ||
use_lld = true | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -276,7 +276,8 @@ def q(s): # Quote s if it contains spaces or other weird characters. | |
print 'vc_lib_path = ' + gn_helpers.ToGNString(vc_lib_path) | ||
if (target_store != True): | ||
# Path is assumed not to exist for desktop applications | ||
assert vc_lib_atlmfc_path | ||
if (cpu != 'arm' and cpu != 'arm64'): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sure this is ok for other non uwp builds. |
||
assert vc_lib_atlmfc_path | ||
# Possible atlmfc library path gets introduced in the future for store thus | ||
# output result if a result exists. | ||
if (vc_lib_atlmfc_path != ''): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about the "arm" -- seems to me this should only be arm64.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was added because of compiler warning 4267 (conversion from 'size_t' to 'type', possible loss of data). Warning is generated for arm and arm64 builds, so it should be added. It could be put in another config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but does it apply to arm? seems to me this is only arm64, no?