aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java
Commit message (Collapse)AuthorAge
...
* Cleanup CppLinkActionBuilderGravatar Marcel Hlopko2017-01-24
| | | | | | | | | Remove (output != null) check which is always true and cleanup dependent conditionals. -- PiperOrigin-RevId: 145409269 MOS_MIGRATED_REVID=145409269
* Expose type of library_to_link in CROSSTOOLGravatar Marcel Hlopko2017-01-23
| | | | | | | | | | This cl relieves us from hard-coding -l and -l: flags in Bazel. To be able to express the behavior in CROSSTOOL, we need to know what type of library are we dealing with. -- PiperOrigin-RevId: 145271426 MOS_MIGRATED_REVID=145271426
* Expose thinlto_params_file and linker_param_file as build variablesGravatar Marcel Hlopko2017-01-17
| | | | | | | | | | | This cl exposes param files that were hard-coded before. This enables more precise placement on the link command line. This is a roll-forward of commit db7a9ea7f6b2af3c4c1f43ad4aa50cd4eca02921 -- PiperOrigin-RevId: 144708270 MOS_MIGRATED_REVID=144708270
* Rollback of commit 1da8ac3a8bb0780251976e0dbcfebd3a7ba6a066.Gravatar Pedro Liberal Fernandez2017-01-12
| | | | | | -- PiperOrigin-RevId: 144207746 MOS_MIGRATED_REVID=144207746
* Expose thinlto_params_file and linker_param_file as build variablesGravatar Marcel Hlopko2017-01-10
| | | | | | | | | This cl exposes param files that were hard-coded before. This enables more precise placement on the link command line. -- PiperOrigin-RevId: 144069927 MOS_MIGRATED_REVID=144069927
* Introduce is_cc_test_link_action build variableGravatar Marcel Hlopko2017-01-05
| | | | | | -- PiperOrigin-RevId: 143664295 MOS_MIGRATED_REVID=143664295
* Rename toolchain_flags to legacy_link_flags build variableGravatar Marcel Hlopko2016-12-22
| | | | | | -- PiperOrigin-RevId: 142767245 MOS_MIGRATED_REVID=142767245
* Move hardcoded toolchain linker flags to CROSSTOOLGravatar Marcel Hlopko2016-12-22
| | | | | | | | | | | | | This cl introduces another build variable: toolchain_flags and updates all the affected crosstools (those which started using action_configs, because the defaults from CppLinkActionConfigs are not applied then). This build variable is a requirement for follow-up refactoring exposing param_files build variable. With toolchain_flags and param_files we will have full control over flags placement on the link command line. -- PiperOrigin-RevId: 142741060 MOS_MIGRATED_REVID=142741060
* Move hardcoded -L linker flags to CROSSTOOLGravatar Marcel Hlopko2016-12-22
| | | | | | | | | | | This cl introduces another build variable: library_search_directories, removes hardcoded -L generation from blaze and updates all the affected crosstools (those which started using action_configs, because the defaults from CppLinkActionConfigs are not applied then). -- PiperOrigin-RevId: 142738674 MOS_MIGRATED_REVID=142738674
* Rollback of commit 52b34308428cfd117470c966d8df329f686fb9ed.Gravatar Marcel Hlopko2016-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rolling forward, cl fixing underlying issue is uploaded, will land this one as soon as I get lgtm to the fix from emscripten crosstool owners. *** Original change description *** Automated [] rollback of commit 2d87bf1937c81ef84358fd5f6a372875f6c6fabf. *** Reason for rollback *** We have to roll back unknown commit, on which this one depends. Will resubmit after I fix the underlying issue. *** Original change description *** Support versioned shared library targets for cc_binary linkshared=1 This change allows versioned shared libraries (e.g. "libfoo.so.1.2") to be built and linked. -- PiperOrigin-RevId: 142263653 MOS_MIGRATED_REVID=142263653
* Rollback of commit 2d87bf1937c81ef84358fd5f6a372875f6c6fabf.Gravatar Marcel Hlopko2016-12-16
| | | | | | | | | | | | | | | | | *** Reason for rollback *** We have to roll back unknown commit, on which this one depends. Will resubmit after I fix the underlying issue. *** Original change description *** Support versioned shared library targets for cc_binary linkshared=1 This change allows versioned shared libraries (e.g. "libfoo.so.1.2") to be built and linked. -- PiperOrigin-RevId: 142240145 MOS_MIGRATED_REVID=142240145
* Support versioned shared library targets for cc_binary linkshared=1Gravatar Googler2016-12-16
| | | | | | | | | This change allows versioned shared libraries (e.g. "libfoo.so.1.2") to be built and linked. -- PiperOrigin-RevId: 142193230 MOS_MIGRATED_REVID=142193230
* Simplify propagation of linker params by replacing global_whole_archive withGravatar Marcel Hlopko2016-12-09
| | | | | | | | individual --whole_archive/--no_whole_archive blocks. -- PiperOrigin-RevId: 141555295 MOS_MIGRATED_REVID=141555295
* Add --ltoindexopt to pass options to LTO indexing stepGravatar Googler2016-12-02
| | | | | | | This makes it much easier to pass options just to the LTO indexing. Previously these had to be passed via --linkopt, but that also passed the options to the final native link, which causes issues since most useful ThinLTO indexing options are plugin options and gold gives an error when these are passed to native links not involving a plugin. -- MOS_MIGRATED_REVID=140735846
* 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
* Improve memory footprint of CcToolchainFeatures.Variables.Gravatar Marcel Hlopko2016-11-24
| | | | | -- MOS_MIGRATED_REVID=140131142
* Simplify Crosstool Build Variables contextGravatar Marcel Hlopko2016-11-16
| | | | | | | | | | | | | | This cl merges two classes used to hold build variables context into one. Those classes are (previously top-level) jcgd.build.lib.rules.cpp.Variables, and its inner class View. Both represent a collection of build variables and imo it makes sense to merge them to make the code simpler. Also, I cleaned up the build variables api to use primitive strings or instances of VariableValueBuilders, and I've hidden subclasses of VariableValues. Last but not least, I refactored the code to use immutable collections exclusively. That revealed that 'module_files' variable is sometimes registered twice. I want to clean this eventually ([]). -- MOS_MIGRATED_REVID=139329823
* Implement basic objc executable linking in the CROSSTOOL.Gravatar Cal Peyser2016-11-16
| | | | | | | | | | | | | | The following link features are *not* implemented yet: 1) Objc++ linking semantics 2) Dead stripping 3) --should_prioritize_static_libs 4) DSYM generation 5) Coverage support 6) Swift interop 7) Linkmap -- MOS_MIGRATED_REVID=139232434
* Rollback of commit abb0b633339ef76bf19a1e5af8477d42d13151d8.Gravatar Peter Schmitt2016-10-25
| | | | | | | | | | | | | | | | | | *** Reason for rollback *** breaks bazel linux sandbox *** Original change description *** Move -l/-L link opts to FeatureConfiguration This cl moves -l/-L link opts generation from Java to FeatureConfiguration making it possible to alter the flags in CROSSTOOL. Change-Id: I1ea7501435ab7e62992e1e9b0cb7f5e22d52c521 -- MOS_MIGRATED_REVID=137184226
* Move -l/-L link opts to FeatureConfigurationGravatar Marcel Hlopko2016-10-24
| | | | | | | | | | This cl moves -l/-L link opts generation from Java to FeatureConfiguration making it possible to alter the flags in CROSSTOOL. Change-Id: I1ea7501435ab7e62992e1e9b0cb7f5e22d52c521 -- MOS_MIGRATED_REVID=137004610
* Add type arguments for JDK7 build.Gravatar Janak Ramakrishnan2016-10-19
| | | | | -- MOS_MIGRATED_REVID=136575806
* Fix ThinLTO indexing linkstamp handlingGravatar Googler2016-10-19
| | | | | | | | | | | | | | | | | | We were including the linkstamp object file in the linker inputs on the command line for the LTO indexing step, despite not adding the linkstamp compile command or the files to the inputs and outputs, causing an error. The linkstamp file is not compiled in ThinLTO mode. The linkstamp is correctly added to the final native link. The fix is to not pass the linkstampMap to the CppLinkVariablesExtension for the LTO indexing step. Passing in the map causes the linkstamp outputs to be added to the buildVariables, resulting in the outputs being added to the command line via the featureConfiguration. Added linkstamps to several of the ThinLTO tests. -- MOS_MIGRATED_REVID=136480400
* 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
* Move interface so building to action configsGravatar Marcel Hlopko2016-10-12
| | | | | | | | | This cl moves the conditional building of interface libraries from LinkCommandLine to action configs and features. It provides link_dynamic_library.sh to keep blaze backwards compatible. The script and related code can be deleted once all crosstools are updated. RELNOTES: No. -- MOS_MIGRATED_REVID=135799041
* 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
* Don't use link action feature configuration in LTO Backend command lineGravatar Googler2016-09-23
| | | | | | | | | | | | | | The link action feature configuration command line options aren't needed in the LTO Backend compile command line. This additionally causes a failure when trying to compile ThinLTO and FDO, as the build variables for the FDO link options in the feature configuration are not set. Confirmed that this is a no-op for non-FDO builds (there are no c++-link* features), which is probably why I didn't notice this and remove it earlier. We add the lto-backend features later in LTOBackendArtifacts.scheduleLTOBackendAction() -- MOS_MIGRATED_REVID=134076174
* Move ThinLTO indexing and backend options to Crosstool feature configurationGravatar Googler2016-09-20
| | | | | -- MOS_MIGRATED_REVID=133609638
* Description redacted.Gravatar Googler2016-09-19
| | | | | -- MOS_MIGRATED_REVID=133442221
* Implement the fully link action in the OSX crosstool.Gravatar Cal Peyser2016-08-18
| | | | | -- MOS_MIGRATED_REVID=130547971
* Remove the awkward logic that used to look at the string form at a command ↵Gravatar Lukacs Berki2016-08-18
| | | | | | | line option to determine if it should be a whole archive one and use the artifact category in LinkerInput to make that decision instead. -- MOS_MIGRATED_REVID=130508699
* Differentiate between regular and alwayslink static libraries in ↵Gravatar Lukacs Berki2016-08-17
| | | | | | | LinkerInput#getArtifactCategory() and use this information to remove one use of LINK_LIBRARY_FILETYPES. -- MOS_MIGRATED_REVID=130400793
* Use the the artifact category in LinkerInput to determine if it's a dynamic ↵Gravatar Lukacs Berki2016-08-17
| | | | | | | library. -- MOS_MIGRATED_REVID=130394540
* Allow Skyframe graph lookups and value retrievals to throw InterruptedException.Gravatar Janak Ramakrishnan2016-08-16
| | | | | | | The only place we now don't handle InterruptedException is in the action graph created after analysis, since I'm not sure that will be around for that much longer. -- MOS_MIGRATED_REVID=130327770
* Record the category of the artifact to be linked in LinkerInput.Gravatar Lukacs Berki2016-08-12
| | | | | | | | | It's currently only used for sanity checks, but the idea is that we'll use this field to decide what to do with a given linker input instead of inferring things from its file name. Also make artifact name creation a bit simpler by using the same set of variables for compiler and linker outputs. -- MOS_MIGRATED_REVID=129990944
* Add the repository name as a parameter to the output path functionsGravatar Kristina Chodorow2016-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't do anything yet, it's in preparation for the execroot rearranging change. The execroot will have one bazel-out per repo, so it'll look like: execroot/ repo1/ bazel-out/ local-fastbuild/ bin/ repo2/ bazel-out/ local-fastbuild/ bin/ genfiles/ repo3/ bazel-out/ local-fastbuild/ testlogs/ and so on. Thus, any output path (getBinDirectory() & friends) needs to know what the repo name is. This changes so many places in the code I thought it would be good to do separately, then just flip the functionality in the execroot-rearranging commit. While I was poking around, I changed all of the refs I could from getPackageRelativeArtifact() to getBin/GenfilesArtifact(), so that 1) rule implementation don't have to know as much about roots and 2) they'll be more isolated from other output dir changes. `bazel info` and similar just return roots for the main repository. The only "change" is passing around a target label in the Java rules. Continues work on #1262. -- MOS_MIGRATED_REVID=129985336
* Store non-code inputs to link actions separately.Gravatar Lukacs Berki2016-08-11
| | | | | | | | | | | | This is a re-submission of commit 99de0d07574f808fee36826289cb1f5c83e3b3e0 (rolled back in commit eff8b365c172b7e904ac6f7bba0c893fed7c91a8) and a few tweaks: - The fix for the bug that caused the rollback (see line 888 in CppModel.java -- we now use addNonCodeInputs() instead of addObjectFiles() to pass in the processed header tokens) - A few extra assertions - A test case - The re-submission of the parts of commit 603b540bbcd7414cd3e2c0b92c1c8985b035e41b that were also rolled back as collateral damage. The bug report didn't contain a precise reproduction, but the bug is trivial enough that I'm comfortable with things this way. -- MOS_MIGRATED_REVID=129872117
* Rollback of commit 99de0d07574f808fee36826289cb1f5c83e3b3e0.Gravatar Googler2016-08-10
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Makes blaze unable to build //third_party/stl IllegalArgumentException: complex.h.processed at com.google.common.base.Preconditions.checkArgument(Preconditions.java:127) at com.google.devtools.build.lib.util.Preconditions.checkArgument(Preconditions.java:38) at com.google.devtools.build.lib.rules.cpp.CppLinkActionBuilder.addObjectFile(CppLinkActionBuilder.java:831) NOT a clean rollback; conflict in one file (CppCompilationContext.java). So this also partially rolls back commit 603b540bbcd7414cd3e2c0b92c1c8985b035e41b (just the change in that file). *** Original change description *** Cleanup: store non-code inputs to link actions separately. -- MOS_MIGRATED_REVID=129798636
* Allow extra action inputs and variables extensions to boe propagated to theGravatar Cal Peyser2016-08-10
| | | | | | | CppLinkAction. -- MOS_MIGRATED_REVID=129753508
* Cleanup: store non-code inputs to link actions separately.Gravatar Lukacs Berki2016-08-10
| | | | | -- MOS_MIGRATED_REVID=129743936
* Refactor C++ rules so that CcLinkingOutputs.libraryIdentifierOf() gets ↵Gravatar Lukacs Berki2016-08-09
| | | | | | | called at places where a CcToolchainProvider is near so that we can use information in it to infer how each input file is linked. -- MOS_MIGRATED_REVID=129729628
* Only send a cc_toolchain's linker_files to link actions. Previously, theGravatar Googler2016-08-08
| | | | | | | | | compiler_files were also added to support link stamping. However, if a toolchain is used for link stamping, the linker_files should contain the necessary tools for that. -- MOS_MIGRATED_REVID=129616826
* Refactor CppLinkAction to construct its command line using the crosstool ↵Gravatar Cal Peyser2016-08-03
| | | | | | | instead of a hardcoded switch. Add action configs to CppConfiguration for each link type. -- MOS_MIGRATED_REVID=129221108
* Rollback of commit f61d12e9e4f940810efbaf244911a94830ba6c05.Gravatar Lukacs Berki2016-08-02
| | | | | | | *** Reason for rollback *** -- MOS_MIGRATED_REVID=129078102
* Refactor CppLinkAction to construct its command line using the crosstool ↵Gravatar Cal Peyser2016-07-27
| | | | | | | instead of a hardcoded switch. Add action configs to CppConfiguration for each link type. -- MOS_MIGRATED_REVID=128470872
* Rollback of commit b669406789dd452161875d407d0ce6a3502de5f6.Gravatar Damien Martin-Guillerez2016-07-25
| | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks TensorFlow and rules_go on ci.bazel.io Fixes #1562. Fixes #1558. *** Original change description *** Refactor CppLinkAction to construct its command line using the crosstool instead of a hardcoded switch. Add action configs to CppConfiguration for each link type. -- MOS_MIGRATED_REVID=128352435
* Refactor CppLinkAction to construct its command line using the crosstool ↵Gravatar Cal Peyser2016-07-25
| | | | | | | instead of a hardcoded switch. Add action configs to CppConfiguration for each link type. -- MOS_MIGRATED_REVID=128298069
* Extract CppLinkAction.Builder to its own top level class.Gravatar Cal Peyser2016-07-13
-- MOS_MIGRATED_REVID=127221256