Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-84746

Create option for building shared libraries that don't propagate link opts transitively

    • Build
    • Fully Compatible

      Problem statement doc: https://docs.google.com/document/d/1xpvQF_h65kJ0O0QUULwyAD5poWK4oKkX2ljM_9PowvM/edit

      We need to solve three problems:
      1. Create a flag that can be used in select statements to determine wether or not the build is linked dynamically. Currently we're using --dynamic_mode which cannot be queried from in bzl files.
      2. cc_library propogates linked opts transitively. For example, if lib_a sets linkopt_123 and lib_b has a dynamic dependency on lib_a, lib_b will inherit linkopt123. This is not desired for dynamic linking and breaks current requirements that the codebase has.
      3. Only build in a single mode. We don't want to compile any objects statically when the final result is dynamic, and we don't want to compile any objects dynamically when the final result is static.

      This can be accomplished with cc_shared_library without replacing cc_library with a custom rule.

            Assignee:
            zack.winter@mongodb.com Zack Winter
            Reporter:
            zack.winter@mongodb.com Zack Winter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: