Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between CROSSTOOL and CROSSTOOL.tpl #2381

Closed
aardeb opened this issue Jan 20, 2017 · 10 comments
Closed

Difference between CROSSTOOL and CROSSTOOL.tpl #2381

aardeb opened this issue Jan 20, 2017 · 10 comments
Assignees
Labels
P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) team-Rules-CPP Issues for C++ rules type: bug

Comments

@aardeb
Copy link

aardeb commented Jan 20, 2017

Hi

What is the difference between /usr/local/src/bazel/tools/cpp/CROSSTOOL and /usr/local/src/bazel/tools/cpp/CROSSTOOL.tpl files ?

Which one should I modify to change my tool chain i.e to cross compile a solution building in bazel to another platform ?

Thanks

@hlopko hlopko self-assigned this Jan 20, 2017
@hlopko hlopko added category: rules > C++ P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) type: bug labels Jan 20, 2017
@hlopko
Copy link
Member

hlopko commented Jan 20, 2017

Hi @fieldtest,

you almost definitely want to edit cc_configure.bzl and CROSSTOOL.tpl. I'm not sure CROSSTOOL is used for anything outside of tests. I'll take a look next week.

@aardeb
Copy link
Author

aardeb commented Jan 20, 2017

Hi

Thanks for your reply. To give some further background on my approach

  1. I downloaded the latest bazel version and built it from source

  2. Since I am interested in ARM Cross Compilation I installed arm-linux-gnueabuhf tools through apt-get for Ubuntu 16.04 LTS.

  3. I then built a simple Hello World Program

https://github.com/fieldtest/bazel_example

  1. trying to compile using Bazel

bazel build --spawn_strategy=standalone --verbose_failures :hw
INFO: Found 1 target...
Target //:hw up-to-date:
bazel-bin/hw
INFO: Elapsed time: 0.519s, Critical Path: 0.31s

on the other hand running

bazel build --spawn_strategy=standalone --verbose_failures --cpu=armeabi-v7a :hw
INFO: Found 1 target...
ERROR: /usr/local/src/examples_PORT/BUILD:1:1: C++ compilation of rule '//:hw' failed: false failed: error executing command
(cd /home/fieldtest85/.cache/bazel/_bazel_root/6633de190a698b4224df2363f1b52550/execroot/examples_PORT &&
exec env -
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
/bin/false -MD -MF bazel-out/stub_armeabi-v7a-fastbuild/bin/_objs/hw/hw.pic.d '-frandom-seed=bazel-out/stub_armeabi-v7a-fastbuild/bin/_objs/hw/hw.pic.o' -fPIC -iquote . -iquote bazel-out/stub_armeabi-v7a-fastbuild/genfiles -iquote external/bazel_tools -iquote bazel-out/stub_armeabi-v7a-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -c hw.cc -o bazel-out/stub_armeabi-v7a-fastbuild/bin/_objs/hw/hw.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //:hw failed to build
INFO: Elapsed time: 0.231s, Critical Path: 0.01s

Hope this helps to clarify. I tried playing with the CROSSTOOL file but to no success.

Thanks

@hlopko
Copy link
Member

hlopko commented Jan 23, 2017

Hi @fieldtest,

so you downloaded latest bazel, then updated cc_configure.bzl and CROSSTOOL.tpl to add armeabi-v7a toolchain, then compiled bazel, and you still see the error? You can see that the toolchain uses /bin/false instead of a compiler, so you want to fix that. Note that in order to use builtin auto-detection, you always have to recompile bazel. What you might find faster for debugging is to create your own CROSSTOOL or a repository similar to cc_configure.bzl.

We have some instructions here:
https://github.com/bazelbuild/bazel/wiki/Building-with-a-custom-toolchain

and there is a very similar issue being investigated over at:
#1353 (comment)

Let me know if you get stuck somewhere.
Cheers!

@madhutummi
Copy link

@mhlopko are u in slack Tensorflow group?

I need some help regarding TF Build, I am using bazel-0.3.2 from sources and getting following eror

"ERROR: tensorflow/core/BUILD:853:1: undeclared inclusion(s) in rule '//tensorflow/core:lib_internal':
this rule is missing dependency declarations for the following files included by 'tensorflow/core/lib/png/png_io.cc':
~/.cache/bazel/_bazel_madhu/a9aabe45cf3d94341ef4fb777deb58c5/external/zlib_archive/zlib.h'
~/.cache/bazel/_bazel_madhu/a9aabe45cf3d94341ef4fb777deb58c5/external/zlib_archive/zconf.h'."

@hlopko
Copy link
Member

hlopko commented Apr 5, 2017

Nope, but feel free to ask the question on StackOverflow, both Bazel and Tensorflow teams monitor StackOverflow and answer questions there. And you'll help building user knowledge base.

@madhutummi
Copy link

@mhlopko did u get a chance to look into my issue?

@hlopko
Copy link
Member

hlopko commented Apr 5, 2017

Nope, will eventually do once you post it to StackOverflow. But I would start by upgrading bazel, 0.3.2 is quite old.

@madhutummi
Copy link

Hi Yes with latest Bazel version I am getting the error as ERROR: /tensorflow/tensorflow.bzl:528:19: name 'DATA_CFG' is not defined.
When I stared debugging found it to be bazel issue, then I tried with older version then this error got fixed but above mentioned issues are occurring.

@madhutummi
Copy link

This issue got fixed.

@hlopko hlopko added team-Rules-CPP Issues for C++ rules and removed category: rules > C++ labels Oct 11, 2018
@hlopko
Copy link
Member

hlopko commented Jun 6, 2019

The static crosstool will be removed by #8546, so the confusion will be gone :)

@hlopko hlopko closed this as completed Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) team-Rules-CPP Issues for C++ rules type: bug
Projects
None yet
Development

No branches or pull requests

3 participants