Partial component-build

82 views
Skip to first unread message

M.Y

unread,
Aug 23, 2016, 8:51:09 AM8/23/16
to Chromium-dev
Hi forks,

I'm trying to build the partial component-build with GYP on ubuntu.
That means all of sub components' build option is non-component but the specific component such as blink is component-build.

For this, I added gyp files in blink like below

  'variables': {
    'component': "shared_library", # added by force
  },


Then, I got a few of shared library(so) from blink and there wasn't any linking error.
 i.e) libblink_web.so, libmodules.so, libwtf.so ...


But I had a crash as doubtful sandbox issue when running chrome I built.


The crash occurred at sys_info_linux.cc

/// NOTREACHED(); in AmountOfMemory function

Because sysconf(_SC_PAGESIZE); returned -1 and errorno was ENOSYS (38).
It worked fine for a while at the first time, but suddenly return value was changed & crash happened.

By googling, I found some document.

SECCOMP_RET_TRACE:
	When returned, this value will cause the kernel to attempt to
	notify a ptrace()-based tracer prior to executing the system
	call.  If there is no tracer present, -ENOSYS is returned to
	userland and the system call is not executed.

so, I changed /base to component build, then this crash disappeared, but I had the next crash issue.


My question is, 
Is there any way to run partial component ?
Is there anything I missed?
Do you have any idea about the partial component build ?

Thanks,
M.Y.





Torne (Richard Coles)

unread,
Aug 23, 2016, 8:55:52 AM8/23/16
to jop...@gmail.com, Chromium-dev

gyp is no longer supported and the gyp build might just be broken. You need to move to building with GN, as we will be removing all the gyp files soon :)


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

M.Y

unread,
Aug 23, 2016, 9:15:07 AM8/23/16
to Chromium-dev, jop...@gmail.com
Thanks, Torne,
Then... can I run partial component build with GN ?

Torne (Richard Coles)

unread,
Aug 23, 2016, 9:38:21 AM8/23/16
to jop...@gmail.com, Chromium-dev
I'm not aware of any such thing being supported in either case, which is probably why it's not working. The component build requires API calls between components to be properly annotated, but whether these annotations are present or not is determined by the component build settings - it's likely that setting most of the build to be static is turning some of this off?

I suggest you try looking at doing it in GN, and if you still have problems, explain what you've done then and what the issue is, in terms of the GN build.

Antoine Labour

unread,
Aug 23, 2016, 2:49:41 PM8/23/16
to jop...@gmail.com, Chromium-dev
On Tue, Aug 23, 2016 at 6:15 AM, M.Y <jop...@gmail.com> wrote:
Thanks, Torne,
Then... can I run partial component build with GN ?

I suspect this is not a thing you can do.
Anything component can only be used statically in a single executable or shared library (module), otherwise globals get duplicated. Take base for example, it's pulled by a bunch of libraries. Either all these libraries are in the same module (non-component build) or base must be in its own shared library.

So if you want to make blink a shared library, all its dependencies (that are used by more than blink) must be shared libraries too, then so must all of their dependencies, etc. and you end up with virtually everything as a shared library, aka the component build.

Antoine
 
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

Dirk Pranke

unread,
Aug 23, 2016, 3:50:45 PM8/23/16
to Antoine Labour, jop...@gmail.com, Chromium-dev
On Tue, Aug 23, 2016 at 11:48 AM, 'Antoine Labour' via Chromium-dev <chromi...@chromium.org> wrote:


On Tue, Aug 23, 2016 at 6:15 AM, M.Y <jop...@gmail.com> wrote:
Thanks, Torne,
Then... can I run partial component build with GN ?

I suspect this is not a thing you can do.
Anything component can only be used statically in a single executable or shared library (module), otherwise globals get duplicated. Take base for example, it's pulled by a bunch of libraries. Either all these libraries are in the same module (non-component build) or base must be in its own shared library.

So if you want to make blink a shared library, all its dependencies (that are used by more than blink) must be shared libraries too, then so must all of their dependencies, etc. and you end up with virtually everything as a shared library, aka the component build.

Taking libraries that are currently built as individual shared libraries and combining them is somewhat doable, but probably requires some changes to sources as well as changing build files (see, e.g., what we do for content). Taking existing shared libraries and splitting them up would be substantially harder, since you'd have to identify new things to export.

Really, trying to do either thing is probably more pain than is worth it, so it would be interesting to know why you're trying to do this.

-- Dirk

Holger

unread,
Aug 23, 2016, 7:04:04 PM8/23/16
to Chromium-dev
It's definitely doable (both in gyp and GN)
The base idea would be to make sure symbols are visible (defines += [ "HAVE_VISIBILITY_ATTRIBUTE" ])
You could then for example define a custom dependency type that forces a separate .so to be build, and replace all its deps dynamically with your core libchrome target
Silk is doing something like that as well (legal reasons)

That being said, this might get ugly depending on your use case. Blink is pretty far down the build chain, so that would probably require a lot of changes.
Reply all
Reply to author
Forward
0 new messages