From d8464d7d2b03206edb75cf961a83d6cc5327be1b Mon Sep 17 00:00:00 2001 From: Sebastien Duthil Date: Fri, 7 Oct 2022 11:47:30 -0400 Subject: [PATCH] Homogenize paths for source files during compilation Why: * Compiling a .o file alone will compile with "-c file.c" * Compiling a .lo file alone will create the corresponding .o files with "-c ./file.c" * Building with "make -j1" will only execute the .lo rules; the .o rules will be skipped since the .o files are already created from the .lo rules with option "-c ./file.c" * Building with "make -j2" will execute the .lo rules and the .o rules in parallel with option "-c file.c" * assert() captures the path of the source file (taken from the -c option) in the compiled binary in order to display the source of the assertion error * Hence the compiled binaries are not reproducible depending on the number of make parallel jobs Example: * when compiling examples/ldns-dane with "make -j1", the binary contains the string "./examples/ldns-dane.c" * when compiling examples/ldns-dane with "make -j2", the binary contains the string "examples/ldns-dane.c" --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 6cffefa7..9d1ba20f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -137,7 +137,7 @@ all: setup-builddir lib linktest manpages @P5_DNS_LDNS@ @PYLDNS@ @DRILL@ @EXAMPL $(COMP_LIB) $(LIBSSL_CPPFLAGS) -c $< -o $@ $(LDNS_LOBJS) $(LIBLOBJS) $(DRILL_LOBJS) $(EXAMPLE_LOBJS): - $(COMP_LIB) $(LIBSSL_CPPFLAGS) -c $(srcdir)/$(@:.lo=.c) -o $@ + $(COMP_LIB) $(LIBSSL_CPPFLAGS) -c $(@:.lo=.c) -o $@ setup-builddir: @if test ! -d compat ; then mkdir compat ; fi