RFR(XS): 8146425: After change 8142907 'EXCLUDE_FILE' is wrongly interpreted as pattern

Erik Joelsson erik.joelsson at oracle.com
Tue Jan 5 08:51:19 UTC 2016

Hello Volker,

I believe this change in behavior was intended at the time. In an 
internal situation where the same thing hit us, we changed the exclude 
pattern in question by adding a slash at the front: '/NativeThread.c'.

I should also inform you that I'm currently working on a major overhaul 
of all the INCLUDE/EXCLUDE file finding mechanisms in the build so that 
SetupNativeCompilation, SetupJavaCompilation, SetupCopyFiles etc all use 
the same semantics (and same implementation) for finding source files. 
I'm doing the work in the sandbox forest in a branch named 
erikj-makefilesets-branch if you are interested in checking it out. So 
far I've converted SetupCopyFiles and SetupTextFileProcessing. The 
common source file definitions can be found in the new FileSet.gmk:



On 2016-01-04 20:26, Volker Simonis wrote:
> Hi,
> could someone please review the following small fix:
> http://cr.openjdk.java.net/~simonis/webrevs/2016/8146425/
> https://bugs.openjdk.java.net/browse/JDK-8146425
> Change "8142907: Integration of minor fixes from the build-infra
> project" has introduced a new parameter called EXCLUDE_PATTERN for
> calls to SetupNativeCompilation.
> Unfortunately this change also altered the semantics of EXCLUDE_FILE
> which is now interpreted as a pattern of the form "*EXCLUDE_FILE".
> This is because of the following code:
>     ifneq ($$($1_ALL_EXCLUDE_FILES),)
>           $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_ALL_EXCLUDE_FILES)))
>       $1_EXCLUDE_FILES_PAT := $$(addprefix %,$$($1_EXCLUDE_FILES_PAT))
>       $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PAT),$$($1_SRCS))
> $1_EXCLUDE_FILES_PAT is initialized to contain all the simple file
> names which are to be excluded plus all of these file names prefixed
> with each src path. In the next step, all the entries in
> $1_EXCLUDE_FILES_PAT are converted to patterns by prefixing them with
> the wildcard character "%". Finally, the patterns are matched against
> all the existing source files. This leads to the problem that every
> file which was given as EXCLUDE_FILES will be converted into a
> "%EXCLUDE_FILES" pattern thus effectively excluding not just files
> with the name EXCLUDE_FILES but actually all files ending in
> This hit us badly on AIX where we have the implementation file
> AixNativeThread.c and the exclude NativeThread.c. After change 8142907
> AixNativeThread.c was silently excluded from the compilation leading
> to errors during runtime because the file contained some native
> methods from sun.nio.ch which are not always used.
> Thank you and best regards,
> Volker

More information about the build-dev mailing list