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

`UnexportMainSymbol` may overwrite same name object file from subdirectory #1000

Open lacasseio opened 5 years ago

lacasseio commented 5 years ago

The UnexportMainSymbol uses outputDirectory.file(object.getName()).get().getAsFile(); to create the unexported main symbol object file path. It has the potential of colliding two object files with the same name from different subdirectories. Given the following object files:

<object-dir>/foo/collision.o
<object-dir>/bar/collision.o

The collision.o would end up in the same directory overwriting one of the two files. This bug needs to be confirmed before proceeding to a fix as it was only noticed while reading the code.