New issue
Advanced search Search tips

Issue 794838 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 3
Type: Bug

Blocking:
issue 495204
issue 764576



Sign in to add a comment

win/cross/32-bit build doesn't work on mac hosts

Project Member Reported by thakis@chromium.org, Dec 14 2017

Issue description

That's because

a) we don't support 32-bit builds on mac
b) tools/v8_context_snapshot means we need base and blink for both target and host (i.e. we have to build blink twice for cross builds :-/), and they need matching bitness for snapshot building
 
Cc: peria@chromium.org yukishiino@chromium.org
Status: Available (was: Untriaged)
Peria, do you have any ideas/thoughts?

Note that Peria is OOO til next year.

Comment 2 by thakis@chromium.org, Dec 14 2017

One idea would be to only build do v8_context_snapshot in is_official_build modes. Then builds of chrome/android and chrome/win would be much faster in non-official mode (since we only need to build blink + deps once), and most people probably don't need the v8 context snapshot for development. It'd be a workaround, but maybe a good one. (official 32-bit builds still wouldn't build on mac, but that's a much smaller limitation.)
Project Member

Comment 3 by bugdroid1@chromium.org, Dec 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ce96b47065492432a419a12ee14ed2bf3ee59084

commit ce96b47065492432a419a12ee14ed2bf3ee59084
Author: Nico Weber <thakis@chromium.org>
Date: Thu Dec 14 18:52:31 2017

win/cross: Allow building 64-bit chrome/win on Mac hosts.

64-bit builds have been working for a while now.
32-bit chrome/win still cannot build on Mac hosts due to  bug 794838 .

TBR=brettw

Bug:  774209 , 794838 
Change-Id: I762853e7e5d2b4470642402e8b585dfe8f84b53e
Reviewed-on: https://chromium-review.googlesource.com/826010
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524129}
[modify] https://crrev.com/ce96b47065492432a419a12ee14ed2bf3ee59084/build/config/BUILDCONFIG.gn
[modify] https://crrev.com/ce96b47065492432a419a12ee14ed2bf3ee59084/docs/win_cross.md

Comment 4 by thakis@chromium.org, Dec 14 2017

here are some actual errors:

$ ninja -C out/gnwin -k 0 clang_x86/obj/base/base/base_jumbo_S.o^

[1/5] ASM clang_x86/obj/base/base/base_jumbo_S.o
FAILED: clang_x86/obj/base/base/base_jumbo_S.o ./../../base/mac/call_with_eh_frame_asm.S:25:9: error: register %rbp is only available in 64-bit mode
  pushq %rbp
        ^~~~
./../../base/mac/call_with_eh_frame_asm.S:27:19: error: register %rbp is only available in 64-bit mode
  .cfi_offset %rbp, -16
                  ^
./../../base/mac/call_with_eh_frame_asm.S:28:8: error: register %rsp is only available in 64-bit mode
  movq %rsp, %rbp
       ^~~~
./../../base/mac/call_with_eh_frame_asm.S:29:29: error: register %rbp is only available in 64-bit mode
  .cfi_def_cfa_register %rbp
                            ^
./../../base/mac/call_with_eh_frame_asm.S:32:11: error: register %rdi is only available in 64-bit mode
  movq 16(%rdi), %rax
          ^~~~
./../../base/mac/call_with_eh_frame_asm.S:36:10: error: register %rax is only available in 64-bit mode
  callq *%rax
         ^~~~
./../../base/mac/call_with_eh_frame_asm.S:38:8: error: register %rbp is only available in 64-bit mode
  popq %rbp
       ^~~~
./../../base/mac/call_with_eh_frame_asm.S:45:8: error: register %rax is only available in 64-bit mode
  movq %rax, %rdi
       ^~~~
./../../base/mac/call_with_eh_frame_asm.S:46:3: error: instruction requires: 64-bit mode
  callq ___cxa_begin_catch
  ^
[2/5] OBJCXX clang_x86/obj/base/base/base_jumbo_mm.o
FAILED: clang_x86/obj/base/base/base_jumbo_mm.o
In file included from ./../../base/mac/mac_util.mm:23:
../../base/mac/sdk_forward_declarations.h:99:12: error: cannot define category for undefined class 'NSUserActivity'
@interface NSUserActivity (YosemiteSDK)
           ^
../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:23:8: note: forward declaration of class here
@class NSUserActivity;
       ^
[3/5] CXX clang_x86/obj/base/base/base_jumbo_4.o
FAILED: clang_x86/obj/base/base/base_jumbo_4.o
In file included from clang_x86/gen/base/base_jumbo_4.cc:28:
./../../base/profiler/native_stack_sampler_mac.cc:130:3: error: no matching function for call to 'getsegmentdata'
  getsegmentdata(mach_header, SEG_TEXT, &module_size);
  ^~~~~~~~~~~~~~
../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/mach-o/getsect.h:70:17: note: candidate function not viable: no known conversion from 'const mach_header_64 *' to 'const struct mach_header *' for 1st argument
extern uint8_t *getsegmentdata(
                ^
[4/5] CXX clang_x86/obj/base/base/base_jumbo_7.o
FAILED: clang_x86/obj/base/base/base_jumbo_7.o
./../../base/time/time_exploded_posix.cc:28:1: error: static_assert failed "Y2038 problem!"
static_assert(sizeof(time_t) >= 8, "Y2038 problem!");
^             ~~~~~~~~~~~~~~~~~~~

Comment 5 by peria@chromium.org, Jan 22 2018

Re #2:
As a workaround, I agree to limit V8Context snapshot feature
  is_official_build || host_os == target_os || some_exceptional_states
but it must be independent from this issue.

According to the errors in #4, v8_snapshot_toolchain seems wrong for this situation. Let me investigate the root cause for this issue itself.
And let us discuss which platform we should enable/disable the feature separately.

Comment 6 by peria@chromium.org, Jan 24 2018

Blocking: 764576
Project Member

Comment 7 by bugdroid1@chromium.org, Jan 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d963b389afe33d3b40f96ab47ee8ec81fa4daca5

commit d963b389afe33d3b40f96ab47ee8ec81fa4daca5
Author: Hitoshi Yoshida <peria@chromium.org>
Date: Wed Jan 24 05:49:16 2018

cleanup: clean up v8_context_snapshot.gni

V8 context snapshot feature is enabled on complex conditions.
This CL make the flag clear what can be opt-in/opt-out and
what can't be controlled.


Bug: 764576,  794838 
Change-Id: Ie531a5fa689bfed5b6c02906124ba68bd503411b
Reviewed-on: https://chromium-review.googlesource.com/882624
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531447}
[modify] https://crrev.com/d963b389afe33d3b40f96ab47ee8ec81fa4daca5/tools/v8_context_snapshot/v8_context_snapshot.gni

Comment 8 by peria@chromium.org, Jan 31 2018

Status: Fixed (was: Available)
Now we can build Chromium for Windows on 32bit MacOS w/o "v8_use_snapshot=false".
My CL in #7 made it not to create the snapshot for Blink. It uses a snapshot for V8 as we did in past / we are doing on Android/ChromeOS.


The key issue is that we cannot build Blink for 32bit MacOSX. Some code is written in assembly only for x64.
e.g. https://cs.chromium.org/chromium/src/base/mac/call_with_eh_frame_asm.S

Sign in to add a comment