CROSSTOOL

106 views
Skip to first unread message

Bela Berde

unread,
May 23, 2017, 8:30:22 AM5/23/17
to bazel-discuss
HI,
I followed the CROSSTOOL explanation.
I have the following error:
Could not read the crosstool configuration file 'CROSSTOOL... because of an incomplete protocol buffer (Message missing required fields: major_version, minor_version, default_target_cpu).
These fields are included of course.
Cheers

Thiago Farina

unread,
May 23, 2017, 10:28:01 AM5/23/17
to Bela Berde, bazel-discuss
What is your Bazel version? What is the command line your are using?

--
Thiago Farina

Bela Berde

unread,
May 23, 2017, 1:02:35 PM5/23/17
to bazel-discuss, bela....@gmail.com
bazel run --crosstool_top=//tools:toolchain --cpu=something --compilation_mode="dbg" --verbose_failures //src:test_lib

Build label: 0.5.0rc9

Thiago Farina

unread,
May 23, 2017, 1:11:06 PM5/23/17
to Bela Berde, bazel-discuss
On Tue, May 23, 2017 at 2:02 PM, Bela Berde <bela....@gmail.com> wrote:
bazel run --crosstool_top=//tools:toolchain --cpu=something --compilation_mode="dbg" --verbose_failures //src:test_lib

Build label: 0.5.0rc9

Do you have a repository we could use to reproduce? Does it work with 0.4.5?

Which platform are you trying this?

--
Thiago Farina

Marcel Hlopko

unread,
May 24, 2017, 3:58:02 AM5/24/17
to Thiago Farina, Bela Berde, bazel-discuss
'because of an incomplete protocol buffer' is interesting there. Is CROSSTOOL in the same folder as BUILD file with cc_toolchain_suite and cc_toolchain rules?

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAFenBsY%2B-ffGmGr5KxmYRMH4q27s_0JCbXb7kXnqhoMBdBe2pA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
-- 
Marcel Hlopko | Software Engineer | hlo...@google.com | 

Google Germany GmbH | Erika-Mann-Str. 33  | 80636 München | Germany | Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle | Registergericht und -nummer: Hamburg, HRB 86891

Bela Berde

unread,
May 31, 2017, 10:25:31 AM5/31/17
to bazel-discuss, tfa...@chromium.org, bela....@gmail.com
The work is progressing.

Is there a specific mechanism to check the location of tool_path? I mean, this works:
#
  tool_path {name: "ar" path     : "/usr/bin/ar" }
  tool_path {name: "cpp" path    : "/usr/bin/cpp" }
  tool_path {name: "dwp" path    : "/usr/bin/dwp" }
  tool_path {name: "gcc" path    : "/usr/bin/gcc" }
  tool_path {name: "gcov" path   : "/usr/bin/gcov" }
  tool_path {name: "ld" path     : "/usr/bin/ld" }
  tool_path {name: "nm" path     : "/usr/bin/nm" }
  tool_path {name: "objcopy" path: "/usr/bin/objcopy" }
  tool_path {name: "objdump" path: "/usr/bin/objdump" }
  tool_path {name: "strip" path  : "/usr/bin/strip" }
  #
I suppose that if I put gcc somewhere else, let's say into /tmp/bin/..., is the tool_path check still Ok?
Is there something checking the available PATH on the system?

I ask this because I have an error message:
fatal error: cannot find 'ld'
for a gcc in a unusual location.
Thanks.

Marcel Hlopko

unread,
May 31, 2017, 10:30:49 AM5/31/17
to Bela Berde, bazel-discuss, tfa...@chromium.org
Are you specifying all dependencies of crosstool in cc_toolchain rule? I assume gcc compains only when executed by bazel, not when executed manually, right?


For more options, visit https://groups.google.com/d/optout.

Bela Berde

unread,
Jun 1, 2017, 2:43:42 AM6/1/17
to Marcel Hlopko, bazel-discuss, tfa...@chromium.org
Right. Manually everything is Ok. 

So, maybe:
1: I do not control via the linear combinaison of tool-chain parameters the execution of gcc + ld
2: a PATH is missing somewhere, so calling directly gcc does not find ld

I want simply enforce the location of gcc etc, like in the k8-gcc tool_chain example, through the exact path provided for gcc etc. 

If you have an example....
Thanks

Sent from my iPhone

Marcel Hlopko

unread,
Jun 2, 2017, 7:09:52 AM6/2/17
to Bela Berde, bazel-discuss, tfa...@chromium.org

Also, gcc can hardcode some paths, and some are found on PATH. Do you know for sure if ld is the latter case? https://stackoverflow.com/questions/7701206/how-does-gcc-find-as-ld-and-other-binutils-executables might help. 
Reply all
Reply to author
Forward
0 new messages