New issue
Advanced search Search tips

Issue 618797 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Mac GN target //chrome/browser:browser doesn't work as a static library

Project Member Reported by brettw@chromium.org, Jun 9 2016

Issue description

This target is being made a static library for linking performance.

On Mac, the renderer fails to start with this change. The error is


2016-06-09 13:27:01.704 Chromium Helper[46718:469692] -[NSProcessInfo cr_isMainBrowserOrTestProcess]: unrecognized selector sent to instance 0x7ff4d8614d90

2016-06-09 13:27:01.731 Chromium Helper[46718:469692] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSProcessInfo cr_isMainBrowserOrTestProcess]: unrecognized selector sent to instance 0x7ff4d8614d90'

*** First throw call stack:
(
0   CoreFoundation                      0x00007fff955274f2 __exceptionPreprocess + 178
1   libobjc.A.dylib                     0x00007fff97b0773c objc_exception_throw + 48
2   CoreFoundation                      0x00007fff955911ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3   CoreFoundation                      0x00007fff95497571 ___forwarding___ + 1009
4   CoreFoundation                      0x00007fff954970f8 _CF_forwarding_prep_0 + 120
5   Chromium Framework                  0x00000001079fbb39 +[ChromeSwizzleServicesMenuUpdater load] + 41
6   libobjc.A.dylib                     0x00007fff97afc67f call_load_methods + 731
7   libobjc.A.dylib                     0x00007fff97afbfea load_images + 123
8   ???                                 0x00007fff672a6de1 0x0 + 140734924221921
9   ???                                 0x00007fff672b478a 0x0 + 140734924277642
10  ???                                 0x00007fff672b4623 0x0 + 140734924277283
11  ???                                 0x00007fff672b4893 0x0 + 140734924277907
12  ???                                 0x00007fff672a9eb0 0x0 + 140734924234416
13  ???                                 0x00007fff672b11e8 0x0 + 140734924263912
14  libdyld.dylib                       0x00007fff9c0a679c dlopen + 59
15  Chromium Helper                     0x00000001022d3ce0 main + 400
16  Chromium Helper                     0x00000001022d3b44 start + 52
)

Probably there is an important static initializer in an object file with no other external linkage that does some important initialization. Currently, I am making the type of this object be source set on Mac and static library elsewhere to work around this problem.
 
Owner: rsesek@chromium.org
Status: Assigned (was: Untriaged)
Assigning to resesk@ who is working on Mac GN.

Comment 2 by rsesek@chromium.org, Jun 10 2016

This probably requires the -ObjC ldflag on the static_library target.

Comment 3 by rsesek@chromium.org, Jun 10 2016

Labels: Proj-GN-Migration

Comment 4 by brettw@chromium.org, Jun 13 2016

Labels: -Proj-GN-Migration
Also chrome/browser/ui

Change referencing this bug: https://codereview.chromium.org/2063483002/

Removing gn migration tag. This doesn't block removing GYP.

Comment 5 by brettw@chromium.org, Jun 13 2016

I actually exempted mac from my static library change in https://codereview.chromium.org/2043873004/ due to persistent problems with this kind of thing. Hopefully it's all one problem.
Project Member

Comment 6 by bugdroid1@chromium.org, Jun 29 2016

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

commit d4ee99258720a95788c8465aef4562c479872f03
Author: rsesek <rsesek@chromium.org>
Date: Wed Jun 29 16:44:32 2016

[Mac/GN] Let //chrome/browser:browser be a static library.

This requires //chrome:chrome_framework to link with -ObjC to force categories
to load from static archives.

BUG= 618797 
R=brettw@chromium.org

Review-Url: https://codereview.chromium.org/2083153002
Cr-Commit-Position: refs/heads/master@{#402836}

[modify] https://crrev.com/d4ee99258720a95788c8465aef4562c479872f03/build/config/mac/BUILD.gn
[modify] https://crrev.com/d4ee99258720a95788c8465aef4562c479872f03/chrome/browser/BUILD.gn

Comment 7 by rsesek@chromium.org, Jun 29 2016

Labels: Build-Tools-GN
Project Member

Comment 8 by bugdroid1@chromium.org, Jul 1 2016

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

commit 10dc9985f86b376124173a2967c7b2830a40792a
Author: rsesek <rsesek@chromium.org>
Date: Fri Jul 01 21:16:02 2016

Change the x86{,_64} intrinsic targets in //third_party/libvpx to be source_sets.

libvpx indirects exposure to the intrinsic implementations through function
pointer symbols, which on Mac creates an indirect dependency between the
archives. If an executable does not directly reference the libvpx symbols, and
neither -Wl,-all_load (to force the linker to load the objects) nor
-Wl,-dead_strip (to remove the unused objects) are present, then the linker
will complain about undefined symbols in the intrinsic targets referenced
from the libvpx target.

BUG= 618797 
R=tomfinegan@chromium.org

Review-Url: https://codereview.chromium.org/2113333002
Cr-Commit-Position: refs/heads/master@{#403532}

[modify] https://crrev.com/10dc9985f86b376124173a2967c7b2830a40792a/third_party/libvpx/BUILD.gn

Project Member

Comment 9 by bugdroid1@chromium.org, Jul 6 2016

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

commit b8adea3236abf4f866ea1265e279d5520b8a9fd0
Author: brettw <brettw@chromium.org>
Date: Wed Jul 06 23:28:14 2016

Remove mac condition for component target types.

The limitation that static libraries can't be used in various targets on Mac has been lifted. Now components can unconditionally be static libraries on non-component builds.

BUG= 618797 

Review-Url: https://codereview.chromium.org/2111683002
Cr-Commit-Position: refs/heads/master@{#403974}

[modify] https://crrev.com/b8adea3236abf4f866ea1265e279d5520b8a9fd0/build/config/BUILDCONFIG.gn

Status: Fixed (was: Assigned)

Sign in to add a comment