Hello,

VarDeps breaks when a file with overridden CFLAGS has the same name as the library.

SetupNativeCompilation(FOO,
    LIBRARY:=foo,
    foo_CFLAGS := -DmakeItBreak)

We then get the vardeps file for linking the library and the vardeps file for the specific CFLAGS ending up with the same name: "foo.vardeps"

I chose to fix this by not stripping off the object extension from the filename when generating the vardeps file for specific object files. This also aligns better with other files we generate next to the objects, like foo.o.cmdline and foo.o.log, and now foo.o.vardeps.

Bug: https://bugs.openjdk.java.net/browse/JDK-8170862

Patch:

diff -r ef056360ddf3 make/common/NativeCompilation.gmk
--- a/make/common/NativeCompilation.gmk
+++ b/make/common/NativeCompilation.gmk
@@ -288,8 +288,7 @@
         $$($1_$(notdir $2)_OPTIMIZATION)), )
$1_$2_VARDEPS := $$($1_$(notdir $2)_CFLAGS) $$($1_$(notdir $2)_CXXFLAGS) \
           $$($1_$(notdir $2)_OPT_CFLAGS) $$($1_$(notdir $2)_OPT_CXXFLAGS)
-      $1_$2_VARDEPS_FILE := $$(call DependOnVariable, $1_$2_VARDEPS, \
-          $$(patsubst %$(OBJ_SUFFIX),%.vardeps,$$($1_$2_OBJ)))
+ $1_$2_VARDEPS_FILE := $$(call DependOnVariable, $1_$2_VARDEPS, $$($1_$2_OBJ).vardeps)
     endif

$$($1_$2_OBJ) : $2 $$($1_COMPILE_VARDEPS_FILE) $$($1_$2_VARDEPS_FILE) | $$($1_BUILD_INFO)


/Erik

Reply via email to