[zlib] Check for target_cpu instead of only current_cpu |
||||
Issue descriptionIt is a common pattern to use an Intel computer to perform a build for an ARM device. Adding this debugging message (attached patch) will print: adenilson@p700:~/chromium/src$ gn gen out/optimized/ ### Current cpu is: arm target cpu is: arm ### Current cpu is: x64 target cpu is: arm Done. Made 16960 targets from 1312 files in 4192ms That is using the following configuration (gn args out/optimized): # Build arguments go here. # See "gn args <out_dir> --list" for available build arguments. target_os = "android" target_cpu = "arm" # (default) is_debug = false # (default) # Other args you may want to set: #is_component_build = true is_clang = true symbol_level = 1 # Faster build with fewer symbols. -g1 rather than -g2 #enable_incremental_javac = true # Much faster; experimental A check on config scripts seems to point that the compiler file name is being used to identify the current_cpu (https://cs.chromium.org/chromium/src/build/config/v8_target_cpu.gni?l=36). But it seems that now we use ../../third_party/llvm-build/Release+Asserts/bin/clan to build for all targets.
,
Jan 10 2018
So it seems that we got verify what is the **target_cpu** instead of **current_cpu** for defining macros that will change the code used in zlib. I wonder how widespread this issue is (i.e. other libs/code affected?).
,
Jan 10 2018
,
Jan 10 2018
Re #1, That example should only effect v8 builds, right? The rest of Chromium is probably not using that value? Is there a place where it is set for non-v8 builds?
,
Jan 11 2018
That rule seems to be imported by the arm build script: https://cs.chromium.org/chromium/src/build/config/arm.gni?l=5
,
Jan 11 2018
So, a priori, anyone importing arm.gni would potentially be affected.
,
Jan 11 2018
It looks like this is expected. But I have no idea why. There are 3 variables of interest: host_cpu, current_cpu, and target_cpu. host_cpu is what you are compiling on. target_cpu is the platform the code should run on. This might involve cross compiling like we typically do here. current_cpu is GN-generated and expected to cause multiple compiles: https://cs.chromium.org/chromium/src/build/config/BUILDCONFIG.gn?l=29&rcl=242b78c83ad56851fb49f0f9e2001cdeecebd935 I am not entirely sure why this is. The v8 build file mentions that we might be running on x64 but want to emulate arm. Maybe that is why? Part of the build might involve emulating as if we were building from those other cpus?
,
Jan 12 2018
I'm unsure really. Will reassign to a lower priority and look on it later.
,
Feb 7 2018
|
||||
►
Sign in to add a comment |
||||
Comment 1 by cavalcantii@chromium.org
, Jan 10 2018