gradle / gradle-native

The home of Gradle's support for natively compiled languages
https://blog.gradle.org/introducing-the-new-cpp-plugins
Apache License 2.0
92 stars 8 forks source link

Bug - Inputs to linker are duplicated #935

Open amz-shahji opened 5 years ago

amz-shahji commented 5 years ago

When building for both static and shared, followed by only shared, the link inputs are duplicated resulting in link errors. A clean build however succeeds.

Expected Behavior

Link inputs wouldn't be duplicated and the build would succeed without an intermediate explicit clean step.

Current Behavior

An explicit clean is required if linkage is changed from [ Linkage.STATIC, Linkage.SHARED ] to [Linkage.SHARED]

Steps to Reproduce (for bugs)

  1. Build a library with both linkage options
  2. Update the DSL to shared linkage only i.e. remove static as an option
  3. The build would fail with duplicate symbols

A quick glance at generated options file show that the object files previous run were included in the build.