[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Make: Obscure bug with wildcards



>>"Richard" == Richard B Kreckel <kreckel@ginac.de> writes:

 Richard> I am not at all sure if this bug is related to make (if it
 Richard> is, the problem is upstream).

        Defintely not upstream; look below to see why I say that. 

 Richard> While on older Debian/potato systems (and Solaris and so on)
 Richard> I get the correct output (using upstream make-3.78.1).
 Richard> Compiling make-3.78.1 on Potato still shows the bug which is
 Richard> why I am so clueless about where it comes from.

        I suggest that this means that older debianized 3.78.1 makes
 worked correctly; and The only changes made in make in this period
 (apart from the changelog, rules, and postinst files) are shown below:
        
Index: Makefile.in
===================================================================
RCS file: /usr/local/src/Master/debian/make/Makefile.in,v
retrieving revision 1.1.1.5
retrieving revision 1.2
diff -u -B -b -w -r1.1.1.5 -r1.2
--- Makefile.in 1999/10/11 16:34:14     1.1.1.5
+++ Makefile.in 1999/12/01 17:48:35     1.2
@@ -543,7 +543,7 @@
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
-           cp -pr $$/$$file $(distdir)/$$file; \
+           cp -pr $$d/$$file $(distdir)/$$file; \
          else \
            test -f $(distdir)/$$file \
            || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
======================================================================

 Richard> Maybe it's glibc.

        Could be.


        BTW, I can reproduce this bug; and if I rm -f test/*; make
 works correctly.

        I'd appreciate it if people could try this out, espescially
 people who still have access to make_3.78.1-1.

        manoj

 Richard> I am having a lot of trouble compiling things and could boil
 Richard> it down to a little setup I am going to describe now.  It
 Richard> would be helpful if some people could try to reproduce it
 Richard> and make suggestions on where it is comes from.  It seems it
 Richard> was introduced in the last couple of weeks into Debian.

 Richard> I have a directory with the following contents:
 Richard> foobar:~/makebug$ find
 Richard> .
 Richard> ./Makefile
 Richard> ./test
 Richard> ./test/cl_spushstring.h
 Richard> ./test/somedir
 Richard> ./test/cl_spushstring_append.cc
 Richard> ./test/cl_spushstring_push.cc
 Richard> ./test/cl_sstring.cc
 Richard> ./test/cl_sstring.h
 Richard> ./test/cl_st_c2.cc
 Richard> ./test/cl_st_concat1.cc
 Richard> ./test/cl_st_concat2.cc
 Richard> ./test/cl_st_concat3.cc
 Richard> ./test/cl_st_debug.cc
 Richard> ./test/cl_st_hashcode.cc
 Richard> ./test/cl_st_make0.cc
 Richard> ./test/cl_st_make1.cc
 Richard> ./test/cl_st_make2.cc
 Richard> ./test/cl_st_null.cc

 Richard> All files are empty, except for the Makefile (see attachment).  When I run 

 Richard> foobar:~/makebug$ /usr/bin/make diversion SUBDIR=test

 Richard> I get the output

 Richard> 1   .
 Richard> 2   test
 Richard> 4   

 Richard> While on older Debian/potato systems (and Solaris and so on) I get the
 Richard> correct output (using upstream make-3.78.1).  Compiling make-3.78.1 on
 Richard> Potato still shows the bug which is why I am so clueless about where it
 Richard> comes from.

 Richard> 1   .
 Richard> 2   test
 Richard> 4   ./test/somedir/.

 Richard> The target diversion was of course deliberately inserted to trace down the
 Richard> problem.  It is simply

 Richard> diversion:
 Richard>         @echo "1   $(srcdir)"
 Richard>         @echo "2   $(SUBDIR)"
 Richard>         @echo -n "4   "
 Richard>         @echo $(wildcard $(srcdir)/$(SUBDIR)/*/.)

 Richard> If I rename some of the files or delete some, the error goes away.  If I
 Richard> strip off stuff from the Makefile, the problem goes away as well.  But I
 Richard> can reproduce it on two up-to-date potato machines and it doesn't seem to
 Richard> be related to the FS, since it happens both on NFS and local ext2.  I have
 Richard> tried strace to track it down but it remains mysterious to me.

 Richard> The bug makes the library cln currently uncompilable on potato, it
 Richard> complains about `no rule to make target...', since it must diverge down 
 Richard> into test/subdir/, which it doesn't want to find. It is rather obscure to
 Richard> me.

 Richard> If you cannot reproduce it, try if you can build cln-1.0.3-2 from the
 Richard> Debian sources.  It will most probably fail to link because of many 
 Richard> missing objects.  If you still cannot reproduce it, please do contact me
 Richard> again!

 Richard> Regards
 Richard>     -rbk.
 Richard> -- 
 Richard> Richard Kreckel
 >> Richard.Kreckel@Uni-Mainz.DE>
 >> http://wwwthep.physik.uni-mainz.de/~kreckel/>
 >> Generated automatically from Makefile.in by configure.
 >> Makefile for cln/src

 >>>>> Start of system configuration section. ####

 >> Directories used by "make":
 Richard> srcdir = .
 Richard> top_srcdir = ..

 >> Directories used by "make install":
 Richard> prefix = /usr
 Richard> local_prefix = /usr/local
 Richard> exec_prefix = $(prefix)
 Richard> datadir = ${prefix}/share
 Richard> libdir = ${exec_prefix}/lib
 Richard> includedir = ${prefix}/include
 Richard> mandir = ${prefix}/man

 >> Programs used by "make":
 >> C compiler
 Richard> CC = gcc -O
 Richard> CFLAGS = 
 Richard> CPP = gcc -O -E -w
 >> C++ compiler
 Richard> CXX = c++
 Richard> CXXFLAGS = -ggdb -Wall
 Richard> CXXCPP = c++ -E
 Richard> INCLUDES = -I../include -I$(top_srcdir)/include
 Richard> GMP_INCLUDES = -I$(top_srcdir)/gmp
 Richard> CPPFLAGS += $(INCLUDES)
 Richard> LIBTOOL = $(SHELL) $(top_builddir)/libtool
 Richard> LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
 Richard> LIBTOOL_LINK = $(LIBTOOL) --mode=link
 Richard> LIBTOOL_INSTALL = $(LIBTOOL) --mode=install
 Richard> LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall
 Richard> AR = ar
 Richard> AR_FLAGS = rc
 Richard> RANLIB = ranlib
 Richard> MV = mv
 Richard> LN = ln
 Richard> RM = rm -f


 >> Programs used by "make install":
 Richard> INSTALL = cp
 Richard> INSTALL_PROGRAM = $(INSTALL)
 Richard> INSTALL_DATA = $(INSTALL)

 >>>>> End of system configuration section. ####

 Richard> SHELL = /bin/sh

 >> Needed by $(LIBTOOL).
 Richard> top_builddir = ..

 >> When this Makefile is called with SUBDIR=some_subdirectory, it builds
 >> only the object files belonging to sources in that subdirectory. The
 >> final library is built only if SUBDIR=.
 Richard> SUBDIR = .

 >> Define the search path for sources.
 >> The ":" below keeps config.status from removing this line.
 Richard> VPATH = $(srcdir)/$(SUBDIR) # :

 Richard> CPPFLAGS += $(SUBDIR_INCLUDES)

 >> Need to know the system name.
 Richard> SYSTEM := $(shell uname -s)

 Richard> FILES_CC := $(notdir $(wildcard $(srcdir)/$(SUBDIR)/*.cc))
 Richard> FILES_CC := $(filter-out %.i.cc, $(FILES_CC))
 Richard> ASMFILES_CC := $(patsubst cl_asm_i386_%.cc,cl_asm_%.cc, $(filter cl_asm_i386_%.cc, $(FILES_CC)))
 Richard> FILES_CC := $(filter-out cl_asm_%.cc, $(FILES_CC))

 Richard> FILES_I_CC := $(patsubst %.cc,%.i.cc,$(FILES_CC))

 Richard> FILES_S := $(patsubst %.cc,%.s,$(FILES_CC))

 Richard> FILES_LO := $(patsubst %.cc,%.lo,$(FILES_CC))

 Richard> ASMFILES_S := $(patsubst %.cc,%.s,$(ASMFILES_CC))

 Richard> ASMFILES_LO := $(patsubst %.cc,%.lo,$(ASMFILES_CC))

 Richard> OBJECTS_LO = $(FILES_LO) $(ASMFILES_LO)

 Richard> SUBDIRS := $(patsubst $(srcdir)/%/.,%,$(wildcard $(srcdir)/$(SUBDIR)/*/.))
 >> Avoid certain subdirectories:
 >> private/ and old/ don't contain valid sources,
 >> CVS/ and RCS/ are created when people put the sources under version control,
 >> ii_files/ is created during "make" by SGI C++.
 Richard> SUBDIRS := $(filter-out old ./old private ./private CVS %/CVS RCS %/RCS ii_files ./ii_files,$(SUBDIRS))

 Richard> SUBDIRS_TARGET := $(patsubst %,%.target,$(SUBDIRS))
 Richard> SUBDIRS_DIRDEP := $(patsubst %,%.dirdep,$(SUBDIRS))

 Richard> ifeq ($(SUBDIR),.)
 Richard> ALLFILES_CC := $(notdir $(wildcard $(srcdir)/*.cc) $(foreach subdir,$(SUBDIRS), $(wildcard $(srcdir)/$(subdir)/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*.cc) $(wildcard $(srcdir)/$(subdir)/*/*/*.cc)))
 Richard> ALLFILES_CC := $(filter-out %.i.cc, $(ALLFILES_CC))
 Richard> ALLASMFILES_CC := $(patsubst cl_asm_i386_%.cc,cl_asm_%.cc, $(filter cl_asm_i386_%.cc, $(ALLFILES_CC)))
 Richard> ALLFILES_CC := $(filter-out cl_asm_%.cc, $(ALLFILES_CC))
 Richard> ALLFILES_LO := $(patsubst %.cc,%.lo,$(ALLFILES_CC))
 Richard> ALLASMFILES_LO := $(patsubst %.cc,%.lo,$(ALLASMFILES_CC))
 Richard> ALLOBJECTS_LO = $(ALLFILES_LO) $(ALLASMFILES_LO)

 Richard> all : diversion $(OBJECTS_LO) $(SUBDIRS_TARGET) libcln.la
 Richard> else
 Richard> all : diversion $(OBJECTS_LO) $(SUBDIRS_TARGET)
 Richard> endif

 Richard> diversion:
 Richard> 	@echo "1   $(srcdir)"
 Richard> 	@echo "2   $(SUBDIR)"
 >> @echo -n "4   "
 >> @echo $(patsubst $(srcdir)/%/.,%,$(wildcard $(srcdir)/$(SUBDIR)/*/.))
 Richard> 	@echo -n "4   "
 Richard> 	@echo $(wildcard $(srcdir)/$(SUBDIR)/*/.)

 Richard> alls : $(FILES_S) $(ASMFILES_S)

 Richard> allo : $(FILES_LO) $(ASMFILES_LO)

 Richard> ASMFLAGS :=
 Richard> ifeq (false,true)
 Richard> ASMFLAGS += -DUNDERSCORE
 Richard> endif

 >> Rules for normal compilation.

 Richard> %.lo : %.c
 Richard> 	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<

 Richard> %.lo : %.cc
 Richard> 	$(LIBTOOL_COMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<

 >> Rules for normal compilation, only needed for debugging.

 Richard> %.s : %.c
 Richard> 	$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@

 Richard> %.s : %.cc
 Richard> 	$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $< -o $@

 >> Rules for preprocessing.

 Richard> %.i : %.c
 Richard> 	$(CPP) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@

 Richard> %.i.cc : %.cc
 Richard> 	$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $< > $@

 >> Rules for assembly language files,

 Richard> ifneq ($(ASMFILES_LO),)

 Richard> ifneq ($(filter i386,sparc sparc64),)
 Richard> $(ASMFILES_S) : %.s : %.cc
 Richard> 	$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $(ASMFLAGS) $< | grep -v '^#' | grep -v '^ *#line' | sed -e 's/\([.%]\) /\1/g' -e 's/ , /,/g' -e 's/ :/:/g' -e 's/\$$/#/g' > $@
 Richard> else
 Richard> ifeq (i386,m68k)
 Richard> $(ASMFILES_S) : %.s : %.cc
 Richard> ifeq (false,true)
 Richard> 	$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$//g' > $@
 Richard> else
 Richard> 	$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< | sed -e 's/\\#/#/g' -e 's/\$$/%/g' > $@
 Richard> endif
 Richard> else
 Richard> ifeq (i386,hppa)
 Richard> $(ASMFILES_S) : %.s : %.cc
 Richard> 	-$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
 Richard> else
 Richard> $(ASMFILES_S) : %.s : %.cc
 Richard> 	$(CXXCPP) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -P $(ASMFLAGS) $< > $@
 Richard> endif
 Richard> endif
 Richard> endif

 Richard> ifeq (i386,hppa)
 >> Only the native as groks the .SHORTDATA statements
 Richard> $(ASMFILES_LO) : %.lo : %.s
 Richard> 	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
 >>> COMPILER_PATH=/usr/ccs/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $< \
 >>> COMPILER_PATH=/bin $(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
 Richard> else
 Richard> $(ASMFILES_LO) : %.lo : %.s
 Richard> 	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(TARGET_ARCH) -c $<
 Richard> endif

 Richard> endif


 >> Recurse into subdirectories
 Richard> $(SUBDIRS_TARGET) : %.target : %.dirdep
 Richard> 	$(MAKE) SUBDIR=$*

 Richard> $(SUBDIRS_DIRDEP) : %.dirdep :


 Richard> ifeq ($(SUBDIR),.)

 Richard> ../gmp/mpn/libmpn.la : $(LIBTOOL)
 Richard> 	cd ../gmp && $(MAKE) mpn/libmpn.la mp_clz_tab.lo


 Richard> libcln.la : $(LIBTOOL) $(ALLOBJECTS_LO) ../gmp/mpn/libmpn.la
 Richard> 	$(LIBTOOL_LINK) $(CC) -o libcln.la -rpath $(libdir) $(ALLOBJECTS_LO) ../gmp/mpn/*.lo ../gmp/*.lo

 Richard> install : all force
 Richard> 	if [ ! -d $(libdir) ] ; then mkdir $(libdir) ; fi
 Richard> 	$(LIBTOOL_INSTALL) $(INSTALL_DATA) libcln.la $(libdir)/libcln.la
 Richard> 	if [ ! -d $(includedir) ] ; then mkdir $(includedir) ; fi
 Richard> 	$(INSTALL_DATA) $(top_srcdir)/include/*.h $(includedir)
 Richard> 	$(INSTALL_DATA) ../include/*.h $(includedir)
 >> if [ ! -d $(mandir) ] ; then mkdir $(mandir) ; fi
 >> if [ ! -d $(mandir)/man3 ] ; then mkdir $(mandir)/man3 ; fi
 >> if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
 >> if [ ! -d $(datadir)/html ] ; then mkdir $(datadir)/html ; fi

 Richard> installdirs : force
 Richard> 	if [ ! -d $(libdir) ] ; then mkdir $(libdir) ; fi
 Richard> 	if [ ! -d $(includedir) ] ; then mkdir $(includedir) ; fi
 >> if [ ! -d $(mandir) ] ; then mkdir $(mandir) ; fi
 >> if [ ! -d $(mandir)/man3 ] ; then mkdir $(mandir)/man3 ; fi
 >> if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
 >> if [ ! -d $(datadir)/html ] ; then mkdir $(datadir)/html ; fi

 Richard> uninstall : force
 Richard> 	$(LIBTOOL_UNINSTALL) $(RM) $(libdir)/libcln.la
 Richard> 	$(RM) $(addprefix $(includedir)/, $(notdir $(wildcard $(top_srcdir)/include/*.h)))
 Richard> 	$(RM) $(addprefix $(includedir)/, $(notdir $(wildcard ../include/*.h)))

 Richard> check : all

 Richard> mostlyclean : clean

 Richard> clean : force
 Richard> 	$(RM) *.s *.o *.lo *.a *.la core
 Richard> 	$(RM) -r .libs _libs

 Richard> distclean : clean
 Richard> 	$(RM) config.status config.log config.cache Makefile

 Richard> maintainer-clean : distclean

 Richard> endif

 Richard> force :

-- 
 Only the fittest survive. The vanquished acknowledge their
 unworthiness by placing a classified ad with the ritual phrase "must
 sell -- best offer," and thereafter dwell in infamy, relegated to
 discussing gas mileage and lawn food.  But if successful, you join
 the elite sodality that spends hours unpurifying the dialect of the
 tribe with arcane talk of bits and bytes, RAMS and ROMS, hard disks
 and baud rates. Are you obnoxious, obsessed?  It's a modest price to
 pay.  For you have tapped into the same awesome primal power that
 produces credit-card billing errors and lost plane reservations.
 Hail, postindustrial warrior, subduer of Bounceoids, pride of the
 cosmos, keeper of the silicone creed: Computo, ergo sum.  The force
 is with you -- at 110 volts. May your RAMS be fruitful and
 multiply. Curt Suplee, "Smithsonian", 4/83
Manoj Srivastava   <srivasta@debian.org>  <http://www.debian.org/%7Esrivasta/>
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C


Reply to: