Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Issue 7800026: Fix nacl_helper argv bug, re-enable, build on linux except ARM (Closed)

Created:
9 years, 3 months ago by Brad Chen
Modified:
9 years, 3 months ago
CC:
chromium-reviews, native-client-reviews_googlegroups.com, bjanakiraman
Visibility:
Public.

Description

Fix nacl_helper argv bug, re-enable nacl_helper, build on linux except ARM. Previously reviewed as http://codereview.chromium.org/7833017; this time ARM build is disabled. TBR=mcgrathr,mseaborn,evanm BUG=92964, nativeclient:480, 95196 TEST=nacl_integration on linux Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=99622

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -7 lines) Patch
M chrome/chrome_exe.gypi View 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/nacl/nacl_fork_delegate_linux.cc View 1 chunk +4 lines, -7 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
commit-bot: I haz the power
No reviewers yet.
9 years, 3 months ago (2011-09-05 05:07:36 UTC) #1
commit-bot: I haz the power
No LGTM from valid reviewers yet.
9 years, 3 months ago (2011-09-05 05:16:41 UTC) #2
Mattias Nissler (ping if slow)
I see several problems due to this commit: - It breaks the build on Chrome ...
9 years, 3 months ago (2011-09-05 09:20:24 UTC) #3
Dmitry Polukhin
Bot that is broken: http://build.chromium.org/p/chromiumos/builders/x86%20generic%20TOT%20chrome%20PFQ/builds/863/steps/BuildTarget/logs/stdio Top build nacl we need bunutils 2.21.1 but it doesn't ...
9 years, 3 months ago (2011-09-05 12:31:11 UTC) #4
Mattias Nissler (ping if slow)
On Mon, Sep 5, 2011 at 2:31 PM, <dpolukhin@chromium.org> wrote: > Bot that is broken: ...
9 years, 3 months ago (2011-09-05 12:45:53 UTC) #5
Mattias Nissler (ping if slow)
On Mon, Sep 5, 2011 at 2:31 PM, <dpolukhin@chromium.org> wrote: > Bot that is broken: ...
9 years, 3 months ago (2011-09-05 12:45:59 UTC) #6
Brad Chen
I think the problem is that this build is trying to link nacl_bootstrap_helper_raw with gold. ...
9 years, 3 months ago (2011-09-05 16:01:48 UTC) #7
Brad Chen
I think the problem is that this build is trying to link nacl_bootstrap_helper_raw with gold. ...
9 years, 3 months ago (2011-09-05 16:01:50 UTC) #8
Brad Chen
It looks like, in the link command for nacl_bootstrap_helper_raw, it is specifying the -B argument ...
9 years, 3 months ago (2011-09-05 16:11:43 UTC) #9
Brad Chen
It looks like, in the link command for nacl_bootstrap_helper_raw, it is specifying the -B argument ...
9 years, 3 months ago (2011-09-05 16:11:43 UTC) #10
raymes
The problem is that the chrome ebuild also uses the -B flag to select gold. ...
9 years, 3 months ago (2011-09-05 17:42:34 UTC) #11
khimg
On Mon, Sep 5, 2011 at 9:42 PM, <raymes@chromium.org> wrote: > The problem is that ...
9 years, 3 months ago (2011-09-05 19:29:05 UTC) #12
khimg
On Mon, Sep 5, 2011 at 9:42 PM, <raymes@chromium.org> wrote: > The problem is that ...
9 years, 3 months ago (2011-09-05 19:29:07 UTC) #13
bjanakiraman
Can you use -fuse-ld=ld-bfd option to force use of ld.bfd, or does this not help? ...
9 years, 3 months ago (2011-09-06 00:57:47 UTC) #14
bjanakiraman
Can you use -fuse-ld=ld-bfd option to force use of ld.bfd, or does this not help? ...
9 years, 3 months ago (2011-09-06 00:57:52 UTC) #15
raymes
-fuse-ld=bfd would allow us to work around the problem by changing the chrome ebuild but ...
9 years, 3 months ago (2011-09-06 01:39:27 UTC) #16
raymes
-fuse-ld=bfd would allow us to work around the problem by changing the chrome ebuild but ...
9 years, 3 months ago (2011-09-06 01:39:30 UTC) #17
Brad Chen
Background: This doesn't have anything to do with the nacl tools. We are using ld.bfd ...
9 years, 3 months ago (2011-09-06 04:45:17 UTC) #18
Brad Chen
Background: This doesn't have anything to do with the nacl tools. We are using ld.bfd ...
9 years, 3 months ago (2011-09-06 04:45:22 UTC) #19
raymes
Thanks for the clarification! > Background: This doesn't have anything to do with the nacl ...
9 years, 3 months ago (2011-09-06 06:35:58 UTC) #20
raymes
Thanks for the clarification! > Background: This doesn't have anything to do with the nacl ...
9 years, 3 months ago (2011-09-06 06:36:12 UTC) #21
raymes
Hi Brad, I discussed this with Bhaskar and we decided that -fuse-ld is the best ...
9 years, 3 months ago (2011-09-06 17:02:21 UTC) #22
raymes
Hi Brad, I discussed this with Bhaskar and we decided that -fuse-ld is the best ...
9 years, 3 months ago (2011-09-06 17:02:25 UTC) #23
Brad Chen
I'm working with Raymes on testing and committing this. On Tue, Sep 6, 2011 at ...
9 years, 3 months ago (2011-09-06 17:34:14 UTC) #24
Brad Chen
I'm working with Raymes on testing and committing this. On Tue, Sep 6, 2011 at ...
9 years, 3 months ago (2011-09-06 17:34:27 UTC) #25
Brad Chen
BTW The Gold patch is linked here: http://sourceware.org/ml/binutils/2011-07/msg00206.html I'm checking with Ian on when it ...
9 years, 3 months ago (2011-09-06 17:52:32 UTC) #26
Brad Chen
9 years, 3 months ago (2011-09-06 17:52:34 UTC) #27
BTW
The Gold patch is linked here:
http://sourceware.org/ml/binutils/2011-07/msg00206.html
I'm checking with Ian on when it should make it into a binutils release.

Brad

On Mon, Sep 5, 2011 at 11:35 PM, Raymes Khoury <raymes@chromium.org> wrote:

> Thanks for the clarification!
>
> > Background: This doesn't have anything to do with the nacl tools. We are
> > using ld.bfd to build a Linux executable with a slightly tweaked memory
> > layout, needed to properly initialize the address space on Chrome OS. We
> > need to use the BFD loader because current releases of gold don't
> implement
> > the -T flag properly. Although Ian Taylor has fixed that bug for us, I
> don't
> > expect the fix has made it into a binutils release yet.
>
> I see and I just took a look at the ld_bfd wrapper script
> (http://src.chromium.org/viewvc/chrome/trunk/src/tools/ld_bfd/ld).
> That wrapper script might fail for ChromeOS anyway, because our linker
> is not installed in /usr/bin/ld. We have cross-compilers and they are
> installed in /usr/bin/[target-arch]-ld. Even worse, it may appear to
> work but use the host-linker instead of the cross-linker.
>
> > Thinking about this while traveling today, I don't understand why the
> Chrome
> > OS build selects gold as it does using all the environment variables plus
> > the -B flag. This seems much more complex and less robust than the common
> > practice of a soft link from /usr/bin/ld to gold. With the common
> approach
> > everything uses gold by default, but the BFD loader is still available as
> > ld.bfd. Since you're building in a chroot environment the soft link from
> > /usr/bin/ld seems that much more practical.
> > Asking myself why you would do something different, I thought perhaps you
> > wanted to avoid replacing /usr/bin/ld, so that the BFD loader would be
> > available in that location.
>
> Yes, we do indeed create a soft-link as you say but the situation is
> more complicated than that. For x86, the file
> /usr/bin/i686-pc-linux-gnu-ld does indeed point to gold, as you
> suggest. For ARM, however, it does not because GNU ld is still the
> default for ARM (but we build chrome with gold). Also a handful of
> other packages fail to build with gold so we need a way to use bfd.
> This is why we use the -B flag in other ebuilds. Basically we face the
> same problem as you, which is that the only supported way of switching
> linkers is with -B and that isn't a very good mechanism (as shown
> here).
>
> > Except what you have achieved instead is the
> > opposite, making it effectively impossible to specify the BFD loader
> during
> > a GYP build.
>
> Yes that is true, but this is a problem with the mechanism for
> selecting a linker and has nothing to do with what the default linker
> is.
>
> > It may be possible to specify a load commend in GYP however this is more
> GYP
> > wizardry than I had at my disposal at the time. Given the way that GYP
> > sometimes seems specific to what Chrome needs, it may be that this
> feature
> > is not yet supported. This and your -fuse= suggestion I will look into
> first
> > thing tomorrow morning. I'm not familiar with -fuse-ld, this is a recent
> gcc
> > option?
>
> -fuse-ld does solve this problem but last time I checked, it was a
> patch that was not comitted upstream (it was still pending). Moreover,
> it had a bug in it. In any case, we can provide a solution to make it
> easy to select ld.bfd in the gyp, if that's what you want to achieve
> (at least for ChromeOS). I'll discuss with the toolchain team tomorrow
> how we want to do this (whether it be to use fuse-ld or some other
> mechanism).
>
> Another thing we may want to do is to backport the patch you need for
> gold, which we can do relatively quickly, but this would only sidestep
> the linker selection issue.
>
> Thanks,
> Raymes
>
>
>
> On Mon, Sep 5, 2011 at 9:45 PM, Brad Chen <bradchen@google.com> wrote:
> > Background: This doesn't have anything to do with the nacl tools. We are
> > using ld.bfd to build a Linux executable with a slightly tweaked memory
> > layout, needed to properly initialize the address space on Chrome OS. We
> > need to use the BFD loader because current releases of gold don't
> implement
> > the -T flag properly. Although Ian Taylor has fixed that bug for us, I
> don't
> > expect the fix has made it into a binutils release yet.
> > Thinking about this while traveling today, I don't understand why the
> Chrome
> > OS build selects gold as it does using all the environment variables plus
> > the -B flag. This seems much more complex and less robust than the common
> > practice of a soft link from /usr/bin/ld to gold. With the common
> approach
> > everything uses gold by default, but the BFD loader is still available as
> > ld.bfd. Since you're building in a chroot environment the soft link from
> > /usr/bin/ld seems that much more practical.
> > Asking myself why you would do something different, I thought perhaps you
> > wanted to avoid replacing /usr/bin/ld, so that the BFD loader would be
> > available in that location. Except what you have achieved instead is the
> > opposite, making it effectively impossible to specify the BFD loader
> during
> > a GYP build.
> > It may be possible to specify a load commend in GYP however this is more
> GYP
> > wizardry than I had at my disposal at the time. Given the way that GYP
> > sometimes seems specific to what Chrome needs, it may be that this
> feature
> > is not yet supported. This and your -fuse= suggestion I will look into
> first
> > thing tomorrow morning. I'm not familiar with -fuse-ld, this is a recent
> gcc
> > option?
> > Brad
> >
> > On Mon, Sep 5, 2011 at 6:39 PM, Raymes Khoury <raymes@chromium.org>
> wrote:
> >>
> >> -fuse-ld=bfd would allow us to work around the problem by changing the
> >> chrome ebuild but there are problems with that approach as well. Last
> >> time I checked, we did not have the patch to allow -fuse-ld in
> >> gcc-4.6.
> >>
> >> There are other workarounds for this (e.g. add a custom flag to the
> >> sysroot wrapper). We need to discuss what the best approach is for
> >> specifying custom linkers.
> >>
> >> Raymes
> >>
> >> On Mon, Sep 5, 2011 at 5:57 PM, Bhaskar Janakiraman
> >> <bjanakiraman@google.com> wrote:
> >> > Can you use -fuse-ld=ld-bfd option to force use of ld.bfd, or does
> this
> >> > not
> >> > help?
> >> > Bhaskar
> >> >
> >> > On Mon, Sep 5, 2011 at 10:42 AM, <raymes@chromium.org> wrote:
> >> >>
> >> >> The problem is that the chrome ebuild also uses the -B flag to select
> >> >> gold.
> >> >>
> >> >> Since the host-built cross-compiler knows nothing about this new
> ld_bfd
> >> >> linker,
> >> >> does it make more sense to invoke the linker directly rather than
> >> >> through
> >> >> the
> >> >> gcc driver? Or is there a nacl gcc driver that should be used to
> invoke
> >> >> this
> >> >> linker?
> >> >>
> >> >> We need to look at the possibility of unifying the NaCl/ChromeOS
> >> >> toolchains in
> >> >> some way.
> >> >>
> >> >> http://codereview.chromium.org/7800026/
> >> >
> >> >
> >
> >
>

Powered by Google App Engine
This is Rietveld 408576698