aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/cpp/cc_configure.bzl
Commit message (Collapse)AuthorAge
...
* Update _get_cpu_value() to fix issue #1264 Gravatar Marcel Hlopko2017-01-24
| | | | | | | | | | | | | I have tested on NVIDA Jetson TK1 and bazel was able to compile. I believe with this quick fix would make bazel installation on Linux ARM devices easier. I have been spending 5 hours to figure out a correct way to install bazel. Closes #2389. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/2389 PiperOrigin-RevId: 145401787 MOS_MIGRATED_REVID=145401787
* Support gold linker in cc_configure.bzlGravatar Marcel Hlopko2017-01-03
| | | | | | | | RELNOTES: Autodetect gold linker in cc_configure.bzl -- PiperOrigin-RevId: 143374572 MOS_MIGRATED_REVID=143374572
* Guard -pass-exit-codes to support clangGravatar Marcel Hlopko2016-12-23
| | | | | | | | | | | | | Currently using CC=clang will fail because -pass-exit-codes is an unsupported option (Github issue #2121). This is a minimal fix to add a guard for this option. -- Change-Id: I86c3415ea7280a3af1d5579c1374bfa74ce31b5d Reviewed-on: https://cr.bazel.build/8070 PiperOrigin-RevId: 142829737 MOS_MIGRATED_REVID=142829737
* Power supportGravatar Nishidha Panpaliya2016-12-21
| | | | | | | | | Closes #2139. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/2139 PiperOrigin-RevId: 142570236 MOS_MIGRATED_REVID=142570236
* Only enable _FORTIFY_SOURCE for opt builds.Gravatar Marcel Hlopko2016-12-16
| | | | | | | | | | | | | | | | | | Prevents warnings like the following under fastbuild/dbg: In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/x86_64-pc-linux-gnu/bits/os_defines.h:39:0, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/x86_64-pc-linux-gnu/bits/c++config.h:482, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/string:38, from third_party/protobuf/3.0.0/src/google/protobuf/empty.pb.h:7, from third_party/protobuf/3.0.0/src/google/protobuf/empty.pb.cc:5: /usr/include/features.h:331:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp] # warning _FORTIFY_SOURCE requires compiling with optimization (-O) -- Change-Id: I364bb2962ef930c9079ebddcc5855a0b4ee5c138 Reviewed-on: https://cr.bazel.build/7050 PiperOrigin-RevId: 142229574 MOS_MIGRATED_REVID=142229574
* pass -fno-canonical-headers only onceGravatar Marcel Hlopko2016-12-15
| | | | | | | | | | | Both compiler_flags and unfiltered_cxx_flags contained "-fno-canonical-headers". We should only need the unfiltered setting. -- Change-Id: I09d99f2bad10774e72745e437ae4900d22b8a723 Reviewed-on: https://cr.bazel.build/7730 PiperOrigin-RevId: 142171553 MOS_MIGRATED_REVID=142171553
* move linker flags from compiler_flags to linker_flags; fix option syntaxGravatar Marcel Hlopko2016-12-07
| | | | | | | | | | | | | | | | | "-Wl,-z,-relro,-z,now" was in compiler_flags, which is not very useful because compiler_flags are not passed to the compilation driver for link commands. "-z -relro" is not even a valid linker flag set because of the spurious leading dash on "relro": $ gold -z -relro gold: -relro: unknown -z option -- Change-Id: Ic987312b7dec5cc68e7195b5ea88945653a93200 Reviewed-on: https://cr.bazel.build/7570 PiperOrigin-RevId: 141282978 MOS_MIGRATED_REVID=141282978
* cc_configure.bzl: Using registry information to find VSGravatar Yun Peng2016-11-28
| | | | | | | | | | | | | This change will find the latest installed VS by using reg.exe Also it gets rid of bash dependency in cc_configure.bzl Fix https://github.com/bazelbuild/bazel/issues/2100 -- Change-Id: I341e89b0d3ee76c39ea69d0e29904a0936d48338 Reviewed-on: https://cr.bazel.build/7533 MOS_MIGRATED_REVID=140201887
* Change handling of LD_LIBRARY_PATH in link actions: instead of passing the ↵Gravatar Lukacs T. Berki2016-11-24
| | | | | | | | | | | directories using a linker option, pass it in the environment instead. Fixes #2099. -- Change-Id: I9bff1888fbb211bc0853a68065b3098c4908c3d9 Reviewed-on: https://cr.bazel.build/7530 MOS_MIGRATED_REVID=140133329
* cc_configure.bzl: On Windows, make sure C:\windows\system32 is in PATHGravatar Yun Peng2016-11-24
| | | | | | | | | | | This change makes VCVARSALL.BAT work even with truncated path. Fixed https://github.com/bazelbuild/bazel/issues/2114 -- Change-Id: Ieaf38f6c5730fd7eeb784898a10746fe0359e81b Reviewed-on: https://cr.bazel.build/7455 MOS_MIGRATED_REVID=140129373
* Add gpu compile support to MSVC wrapper scriptGravatar Yun Peng2016-11-22
| | | | | | | | | | | | | | | | | | | | | | Fix https://github.com/bazelbuild/bazel/issues/2075 The logic for constructing nvcc options is from: third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl in TensorFlow repo. To make things configurable, this change makes cc_configure.bzl depend on more environment variables: CUDA_PATH: This variable points to Cuda installation directory CUDA_COMPUTE_CAPABILITIES: Specifiy cuda compute capabilities NO_WHOLE_ARCHIVE_OPTION: if set to 1, /WHOLEARCHIVE option won't be used. -- Change-Id: Ib1610a6d3423ca55a27c7a0f438703c05630a85c Reviewed-on: https://cr.bazel.build/7351 MOS_MIGRATED_REVID=139903436
* Rollback of commit cc3d79cca775cad9e9193d38bedf4df51a5c8a50.Gravatar Dmitry Lomov2016-11-21
| | | | | | | | | | | | | | *** Reason for rollback *** Breaks bazel: http://ci.bazel.build/job/bazel-tests/329/BAZEL_VERSION=HEAD,PLATFORM_NAME=linux-x86_64/console *** Original change description *** Support gold linker -- MOS_MIGRATED_REVID=139810019
* Support gold linkerGravatar Marcel Hlopko2016-11-17
| | | | | | -- Reviewed-on: https://bazel-review.googlesource.com/c/7372/ MOS_MIGRATED_REVID=139432850
* Reimplement whole archive on WindowsGravatar Yun Peng2016-10-25
| | | | | | | | | | | | Use wrapper script to get object files if /WHOLEARCHIVE is not supported. fix https://github.com/bazelbuild/bazel/issues/1978 work towards https://github.com/bazelbuild/bazel/issues/1918 -- Change-Id: I675311478e65a1e1f3fa963187a5a8da531150d3 Reviewed-on: https://bazel-review.googlesource.com/#/c/6833 MOS_MIGRATED_REVID=137151817
* Rollback of commit ffdc05d2278d7f9c6e299c923019f689cde5fe76.Gravatar Yun Peng2016-10-19
| | | | | | | | | *** Reason for rollback *** Causes huge memory blow-up after the analysis phase in CppLinkAction (LinkCommandLine). -- MOS_MIGRATED_REVID=136467836
* Add global_whole_archive into MSVC CROSSTOOLGravatar Yun Peng2016-10-12
| | | | | | | | | | | | | This feature is needed when linking the _pywrap_tensorflow.dll on Windows. Which will force link all the libraries in deps. I used /WHOLEARCHVIE to implement this, so it only works with Visual Stduio 2015 update 2 or later. -- Change-Id: I0b018d3f4f482e56d1ebf78faa08fa46e1d60bbf Reviewed-on: https://bazel-review.googlesource.com/#/c/6612 MOS_MIGRATED_REVID=135923622
* Add action_config and feature for linking on WindowsGravatar Yun Peng2016-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also implemented whole archive feature on Windows 1. Pulled action_configs and features from CppLinkActionConfigs.java 2. Deleted many features not working on Windows. (AFAIK) including: symbol_counts output_execpath_flags_executable global_whole_archive_open runtime_root_flags global_whole_archive_close force_pic_flags 3. Added c++-link-interface-dynamic-library action config Not sure there is such thing on Windows, but it's currently in MANDATORY_LINK_TARGET_TYPES 4. Added build variable "whole_archive_object_files_params" 5. Automatically detect if linker supports /WHOLEARCHIVE and use the corresponding build variable -- Change-Id: I232798a0eb1a3291f972b313a81e678b0121d58c Reviewed-on: https://bazel-review.googlesource.com/#/c/6414 MOS_MIGRATED_REVID=135342093
* Fix cc_configure on WindowsGravatar Yun Peng2016-09-29
| | | | | | | -- Change-Id: Id359bc6f442f302e3dbaa60cedd6536ecf4f92ec Reviewed-on: https://bazel-review.googlesource.com/#/c/6333 MOS_MIGRATED_REVID=134575379
* Make cc_configure on Windows more robustGravatar Yun Peng2016-09-28
| | | | | | | | | | | | | 1. Throw an error if Bash-on-Windows is found instead of MSYS bash 2. Introduce BAZEL_VS environment variable 3. Output more information Fix https://github.com/bazelbuild/bazel/issues/1847 -- Change-Id: Ic4571c6c792d9b81df4cd800b8f19d121cc44c33 Reviewed-on: https://bazel-review.googlesource.com/#/c/6330 MOS_MIGRATED_REVID=134531295
* Checking BAZEL_SH first when looking for bash on WindowsGravatar Yun Peng2016-09-16
| | | | | | | | | | In case cc_configure finds the wrong bash binary if user is running Windows 10 with bash on Windows. This should help https://github.com/bazelbuild/bazel/issues/1453 -- Change-Id: Iffd365e3e2dd2389882390dffdf6f3a88719530e Reviewed-on: https://bazel-review.googlesource.com/#/c/6072 MOS_MIGRATED_REVID=133270634
* Remove support for thin archives.Gravatar Lukacs Berki2016-08-23
| | | | | -- MOS_MIGRATED_REVID=130938527
* Use -fno-canonical-system-headers when supportedGravatar Brian Silverman2016-08-18
| | | | | | | | | | This makes the same change to cc_configure.bzl made to the hard-coded CROSSTOOL in 763f1397155fc7c12e1f1071a1bc942f91b867c4 to fix #1642 -- Change-Id: Ia05788243d0128ea4921f12c437ef6cebd83a4ff Reviewed-on: https://bazel-review.git.corp.google.com/#/c/5450/ MOS_MIGRATED_REVID=130636065
* cc_configure.bzl: Output error message when executing a command failsGravatar Yun Peng2016-07-20
| | | | | | | -- Change-Id: I9ccc29369a0b3b704b21737127de5744f2a94a59 Reviewed-on: https://bazel-review.googlesource.com/#/c/4102 MOS_MIGRATED_REVID=127945552
* Adding default value for environment variables and python binaryGravatar Yun Peng2016-07-18
| | | | | | | | | Also output more clear and useful information during auto configuration -- Change-Id: I7ea893ce8765d813b026bccc2c86e7aa2106baac Reviewed-on: https://bazel-review.googlesource.com/#/c/4051 MOS_MIGRATED_REVID=127703994
* Fix Windows tests.Gravatar Dmitry Lomov2016-07-15
| | | | | | | -- Change-Id: Ib480661ebbc522007edd77b374d6720d216b4508 Reviewed-on: https://bazel-review.googlesource.com/#/c/4050 MOS_MIGRATED_REVID=127534581
* Fixed repository.which() on WindowsGravatar Yun Peng2016-07-15
| | | | | | | | | Also removed previous workaround in cc_configure.bzl -- Change-Id: I6dcd039fc5e18af8f2d21969641d6bbd05c8badc Reviewed-on: https://bazel-review.googlesource.com/#/c/4034 MOS_MIGRATED_REVID=127518922
* Autoconfigure MSVC CROSSTOOLGravatar Yun Peng2016-07-13
| | | | | | | -- Change-Id: I55b2c567a3fc6be15f29d03c5c6e9891ef540072 Reviewed-on: https://bazel-review.googlesource.com/#/c/4012 MOS_MIGRATED_REVID=127184463
* cc_configure: removes -no-canonical-prefixes from the list of default flagsGravatar Damien Martin-Guillerez2016-05-31
| | | | | | | | | | | | | This might causes problem in a future remote execution services but in that kind of service it would make more sense to not use the auto-configured C++ toolchain. Tested with bazel test //tools/cpp/test:* Fixes #1204. -- MOS_MIGRATED_REVID=123643630
* Add -headerpad_max_install_names to darwin CROSSTOOL linker flags.Gravatar David Chen2016-05-17
| | | | | | | Fixes #1269 -- MOS_MIGRATED_REVID=122502116
* cc_configure: correctly detect 32/64 bits CPU for LinuxGravatar Damien Martin-Guillerez2016-05-11
| | | | | | | | | It is now consistent with CPU.java Fixes #1251. -- MOS_MIGRATED_REVID=122036487
* cc_configure: use the wrapper only if on Darwin and ship the environment ↵Gravatar Damien Martin-Guillerez2016-05-09
| | | | | | | | | | | | | | | | only if in homebrew This will fix the sandboxing issues for rules_rust and rules_go while still allowing to build inside homebrew. Should unblock #1238 Fixes bazelbuild/rules_go#20. Fixes bazelbuild/rules_rust#4. Tested under homebrew + classic tests. -- MOS_MIGRATED_REVID=121834186
* Rollback of commit 5e6218ea4e83a7fadfe54c35488781da550ce13e.Gravatar Damien Martin-Guillerez2016-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Roll-forward with fix: - Previous test did let the all_files group with the wrapper script, and it got removed when creating the actual change. Added it back Tested with `./compile.sh determinism` *** Original change description *** Automated [] rollback of commit 87a58589d6770a6e9a0f998274bfe69f1feb6014. *** Reason for rollback *** The sandbox fix did not fix. More work is needed. Fixes #1239 *** Original change description *** Automated [] rollback of commit b4549fe8dfb29f87fd37b38bf21a5b4bef818b12. *** Reason for rollback *** Rollforward with fixes: - Quote single-quote in the environment exports - Exclude the following environment variables: _ and dotted names - Add the wrapper to the dependency of the crosstool chain so it gets shipped to the sandbox. Hopefu... -- MOS_MIGRATED_REVID=121667505
* Rollback of commit 87a58589d6770a6e9a0f998274bfe69f1feb6014.Gravatar Damien Martin-Guillerez2016-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** The sandbox fix did not fix. More work is needed. Fixes #1239 *** Original change description *** Automated [] rollback of commit b4549fe8dfb29f87fd37b38bf21a5b4bef818b12. *** Reason for rollback *** Rollforward with fixes: - Quote single-quote in the environment exports - Exclude the following environment variables: _ and dotted names - Add the wrapper to the dependency of the crosstool chain so it gets shipped to the sandbox. Hopefully after that we can cut a new release and have a homebrew package again #1177. *** Original change description *** Automated [] rollback of commit f1f24fc4b5aa83b7a4b872ec8f1c3a369799c081. *** Reason... *** -- MOS_MIGRATED_REVID=121665313
* Rollback of commit b4549fe8dfb29f87fd37b38bf21a5b4bef818b12.Gravatar Damien Martin-Guillerez2016-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rollforward with fixes: - Quote single-quote in the environment exports - Exclude the following environment variables: _ and dotted names - Add the wrapper to the dependency of the crosstool chain so it gets shipped to the sandbox. Hopefully after that we can cut a new release and have a homebrew package again #1177. *** Original change description *** Automated [] rollback of commit f1f24fc4b5aa83b7a4b872ec8f1c3a369799c081. *** Reason for rollback *** Broke ci.bazel.io See #1231. *** Original change description *** Ship the environment fixed at configure time to the C++ compiler Use a wrapper script on all platform to ship the environment to the C++ compiler. This should enable building with Homebrew special setup and will likely reduce the number of hard corner cases to solve. Should... *** -- MOS_MIGRATED_REVID=121497195
* Rollback of commit f1f24fc4b5aa83b7a4b872ec8f1c3a369799c081.Gravatar Damien Martin-Guillerez2016-05-04
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Broke ci.bazel.io See #1231. *** Original change description *** Ship the environment fixed at configure time to the C++ compiler Use a wrapper script on all platform to ship the environment to the C++ compiler. This should enable building with Homebrew special setup and will likely reduce the number of hard corner cases to solve. Should unblock #1177. -- MOS_MIGRATED_REVID=121468271
* Ship the environment fixed at configure time to the C++ compilerGravatar Damien Martin-Guillerez2016-05-04
| | | | | | | | | | | | | | Use a wrapper script on all platform to ship the environment to the C++ compiler. This should enable building with Homebrew special setup and will likely reduce the number of hard corner cases to solve. Should unblock #1177. -- Change-Id: I36f09edaf131f65c730bdd626ce521478ff587c7 Reviewed-on: https://bazel-review.googlesource.com/3560 MOS_MIGRATED_REVID=121462120
* cc_configure: add -lm to the default linker flagsGravatar Damien Martin-Guillerez2016-04-28
| | | | | | | | | | | | | | Some C++ toolchain requires -lm when passing -lstdc++. Always add it. We should probably make that depend on what kind of binary we actually want to build but that's beyond the scope of cc_configure. Fixes #1190. -- MOS_MIGRATED_REVID=121015578
* cc_configure: do not assume the message from gcc is in EnglishGravatar Damien Martin-Guillerez2016-04-28
| | | | | | | Fixes #1204. -- MOS_MIGRATED_REVID=120997826
* cc_configure.bzl: support spaces in CC environmentGravatar Damien Martin-Guillerez2016-04-27
| | | | | | | Also support CC to be empty and fallback to gcc. -- MOS_MIGRATED_REVID=120907744
* cc_configure.bzl: Add -Wl,-no-as-needed as default link optionsGravatar Damien Martin-Guillerez2016-04-26
| | | | | -- MOS_MIGRATED_REVID=120791766
* cc_configure: Add -B to compiler flag tooGravatar Damien Martin-Guillerez2016-04-22
| | | | | | | | | On some target platform gcc invokes external tools during compilation, see #1152. Also support absolute path when looking for gcc. This needs to be cherry-picked to fix #1177. -- MOS_MIGRATED_REVID=120581887
* cc_configure.bzl: strip end of line when looking for the cpuGravatar Damien Martin-Guillerez2016-04-20
| | | | | | | As noticed in #1122. -- MOS_MIGRATED_REVID=120315240
* Added configuration for wrapper scripts of msvc toolchainGravatar Yun Peng2016-04-20
| | | | | | | | | Now we only need to specify --cpu=x64_windows_msvc when using msvc toolchain -- Change-Id: Id501dd9ef2fd6553285677605ec75e80499b9ef7 Reviewed-on: https://bazel-review.googlesource.com/#/c/3441 MOS_MIGRATED_REVID=120260588
* cc_configure: uses which on the CC environment variableGravatar Damien Martin-Guillerez2016-04-20
| | | | | | | | | It's wrong to assume it points to an absolute path. Discovered in issue #1152. -- MOS_MIGRATED_REVID=120242469
* cc_configure: Add piii to the list of supported cpu_valueGravatar Damien Martin-Guillerez2016-04-19
| | | | | | | Fixes #1122. -- MOS_MIGRATED_REVID=120223970
* cc_configure: always add -B/usr/bin to the list of gcc optionGravatar Damien Martin-Guillerez2016-04-19
| | | | | | | Fixes #760. -- MOS_MIGRATED_REVID=120217217
* Fix cc_configure include path for Frameworks on OS X.Gravatar Damien Martin-Guillerez2016-04-19
| | | | | | | | | | | | cc_configure assumed the paths returned by $(CC) -E -xc++ -v where not containing any extra information but clang on OS X adds " (framework directory)" for path from Frameworks. This change strip this out. -- Change-Id: I90617e825100f86a1f0991e128755802da2c7afd Reviewed-on: https://bazel-review.googlesource.com/3389 MOS_MIGRATED_REVID=120210800
* Fix issues with cc_configureGravatar Alpha Lam2016-04-01
| | | | | | | | | | | | | | Fixing a few issues with cc_configure that I encountered. * The argument for rpath should be -Wl,-rpath. * cc_configure should consider CPLUS_INCLUDE_PATH. I ran into this problem when using a crosstool gcc which needs -I/usr/include. * Check if -Wunused-but-set-parameter is available. -- Change-Id: I73198b5b17674ecbf1b511e23fcc9331ca96c8e0 Reviewed-on: https://bazel-review.googlesource.com/#/c/3210/ MOS_MIGRATED_REVID=118763218
* cc_configure.bzl: fix path to static crosstoolGravatar Damien Martin-Guillerez2016-03-31
| | | | | | | | | | | | | | | | Static crosstool where copied in the wrong path, leading to not found package and breaking the Windows build. Also the BUILD.bazel file contains now a reference to @cc_configure// package, so we need another copy. Tested: manually patched the change on the Windows slave and ran ./compile.sh Fixes #1101. -- MOS_MIGRATED_REVID=118674922
* Adds Skylark Remote Repository documentationGravatar Damien Martin-Guillerez2016-03-24
| | | | | | | Fixes #1043 -- MOS_MIGRATED_REVID=118039426