Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

object filename clashes



-----BEGIN PGP SIGNED MESSAGE-----

When a module is being linked in when dynamic module loading is available,
it is still built as a module.  (This is a feature.)  Both the normal zsh
build process and the module build process try to use the same filenames
for the intermediate object files.  This can cause object files compiled
with the wrong flags to be used, and in a parallel make two compiles
could try to write to the same file at the same time.

This patch makes the object files for modules use a different set of
names.  The trick I use -- a suffix of `..o' instead of `.o' -- is
portable as far as I know, and causes no extra overhead.

 -zefram

      *** configure.in	1996/12/22 04:50:02	1.26
      --- configure.in	1996/12/24 05:03:53
      ***************
      *** 774,780 ****
              solaris*|sysv4*|esix*) DLCFLAGS="${DLCFLAGS=-Kpic}" ;;
            esac
          fi
      -   DLCFLAGS="-DMODULE $DLCFLAGS"
          case "$host_os" in
            hpux*)        DLLDFLAGS="${DLLDFLAGS=-b}" ;;
            linux*|irix*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;;
      --- 774,779 ----
      *** Src/Makefile.in	1996/12/24 03:45:30	1.22
      --- Src/Makefile.in	1996/12/24 05:07:30
      ***************
      *** 77,110 ****
        
        MODBINS = modules-bltin
        
      - DLEXT=.$(DL_EXT)
      - NLEXT=._foobarbaz_
      - 
        KNR_OBJ=.o
        KNROBJ=._foo_
        
        ANSIOBJ=.o
        ANSI_OBJ=._foo_
        
      - KNR_DOBJ=$(@D@LEXT)
      - KNRDOBJ=._bar_
      - 
      - ANSIDOBJ=$(@D@LEXT)
      - ANSI_DOBJ=._bar_
      - 
        .SUFFIXES:
      ! .SUFFIXES: .c $(ANSI@U@DOBJ) $(KNR@U@DOBJ) $(ANSI@U@OBJ) $(KNR@U@OBJ) .pro
      ! 
      ! .c$(ANSI@U@DOBJ):
      ! 	$(COMPILE) $(DLCFLAGS) -o $@.o $<
      ! 	$(DLLD) $(LDFLAGS) $(DLLDFLAGS) -o $@ $@.o
      ! 	rm -f $@.o
      ! 
      ! .c$(KNR@U@DOBJ):
      ! 	./ansi2knr $< > $@.c
      ! 	$(COMPILE) $(DLCFLAGS) -o $@.o $@.c
      ! 	$(DLLD) $(LDFLAGS) $(DLLDFLAGS) -o $@ $@.o
      ! 	rm -f $@.[oc]
        
        .c$(ANSI@U@OBJ):
        	$(COMPILE) -o $@ $<
      --- 77,90 ----
        
        MODBINS = modules-bltin
        
        KNR_OBJ=.o
        KNROBJ=._foo_
        
        ANSIOBJ=.o
        ANSI_OBJ=._foo_
        
        .SUFFIXES:
      ! .SUFFIXES: .c .o ._foo_ .pro
        
        .c$(ANSI@U@OBJ):
        	$(COMPILE) -o $@ $<
      *** Src/Modules/Makefile.in	1996/12/24 03:27:34	1.9
      --- Src/Modules/Makefile.in	1996/12/24 05:04:35
      ***************
      *** 55,62 ****
        
        INCLUDES = -I../.. -I. -I.. -I$(srcdir) -I$(srcdir)/..
        
      ! COMPILE = $(CC) -c $(INCLUDES) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(DLCFLAGS)
      ! LINK    = $(DLLD) $(LDFLAGS) $(DLLDFLAGS) -o $@
        
        INSTALL         = @INSTALL@
        INSTALL_PROGRAM = @INSTALL_PROGRAM@
      --- 55,63 ----
        
        INCLUDES = -I../.. -I. -I.. -I$(srcdir) -I$(srcdir)/..
        
      ! COMPILE = $(CC) -c $(INCLUDES) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(D@L@CFLAGS)
      ! DLCOMPILE = $(CC) -c $(INCLUDES) $(CPPFLAGS) $(DEFS) -DMODULE $(CFLAGS) $(DLCFLAGS)
      ! DLLINK    = $(DLLD) $(LDFLAGS) $(DLLDFLAGS) -o $@
        
        INSTALL         = @INSTALL@
        INSTALL_PROGRAM = @INSTALL_PROGRAM@
      ***************
      *** 70,76 ****
        ANSI_OBJ=._foo_
        
        .SUFFIXES:
      ! .SUFFIXES: .c .$(DL_EXT) $(ANSI@U@OBJ) $(KNR@U@OBJ) .pro
        
        .c$(ANSI@U@OBJ):
        	$(COMPILE) -o $@ $<
      --- 71,77 ----
        ANSI_OBJ=._foo_
        
        .SUFFIXES:
      ! .SUFFIXES: .c .$(DL_EXT) ..o .._foo_ .o ._foo_ .pro
        
        .c$(ANSI@U@OBJ):
        	$(COMPILE) -o $@ $<
      ***************
      *** 80,87 ****
        	$(COMPILE) -o $@ $@.c
        	rm -f $@.c
        
      ! .o.$(DL_EXT):
      ! 	$(LINK) $<
        
        .c.pro:
        	$(SED) -n -f $(srcdir)/../makepro.sed $< > $@
      --- 81,96 ----
        	$(COMPILE) -o $@ $@.c
        	rm -f $@.c
        
      ! .c.$(ANSI@U@OBJ):
      ! 	$(DLCOMPILE) -o $@ $<
      ! 
      ! .c.$(KNR@U@OBJ):
      ! 	../ansi2knr $< > $@.c
      ! 	$(DLCOMPILE) -o $@ $@.c
      ! 	rm -f $@.c
      ! 
      ! ..o.$(DL_EXT):
      ! 	$(DLLINK) $<
        
        .c.pro:
        	$(SED) -n -f $(srcdir)/../makepro.sed $< > $@
      *** Src/Zle/Makefile.in	1996/12/24 03:27:34	1.8
      --- Src/Zle/Makefile.in	1996/12/24 05:04:59
      ***************
      *** 55,62 ****
        
        INCLUDES = -I../.. -I. -I.. -I$(srcdir) -I$(srcdir)/..
        
      ! COMPILE = $(CC) -c $(INCLUDES) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(DLCFLAGS)
      ! LINK    = $(DLLD) $(LDFLAGS) $(DLLDFLAGS) -o $@
        
        INSTALL         = @INSTALL@
        INSTALL_PROGRAM = @INSTALL_PROGRAM@
      --- 55,63 ----
        
        INCLUDES = -I../.. -I. -I.. -I$(srcdir) -I$(srcdir)/..
        
      ! COMPILE = $(CC) -c $(INCLUDES) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(D@L@CFLAGS)
      ! DLCOMPILE = $(CC) -c $(INCLUDES) $(CPPFLAGS) $(DEFS) -DMODULE $(CFLAGS) $(DLCFLAGS)
      ! DLLINK    = $(DLLD) $(LDFLAGS) $(DLLDFLAGS) -o $@
        
        INSTALL         = @INSTALL@
        INSTALL_PROGRAM = @INSTALL_PROGRAM@
      ***************
      *** 70,76 ****
        ANSI_OBJ=._foo_
        
        .SUFFIXES:
      ! .SUFFIXES: .c .$(DL_EXT) $(ANSI@U@OBJ) $(KNR@U@OBJ) .pro
        
        .c$(ANSI@U@OBJ):
        	$(COMPILE) -o $@ $<
      --- 71,77 ----
        ANSI_OBJ=._foo_
        
        .SUFFIXES:
      ! .SUFFIXES: .c .$(DL_EXT) ..o .._foo_ .o ._foo_ .pro
        
        .c$(ANSI@U@OBJ):
        	$(COMPILE) -o $@ $<
      ***************
      *** 80,87 ****
        	$(COMPILE) -o $@ $@.c
        	rm -f $@.c
        
      ! .o.$(DL_EXT):
      ! 	$(LINK) $<
        
        .c.pro:
        	$(SED) -n -f $(srcdir)/../makepro.sed $< > $@
      --- 81,96 ----
        	$(COMPILE) -o $@ $@.c
        	rm -f $@.c
        
      ! .c.$(ANSI@U@OBJ):
      ! 	$(DLCOMPILE) -o $@ $<
      ! 
      ! .c.$(KNR@U@OBJ):
      ! 	../ansi2knr $< > $@.c
      ! 	$(DLCOMPILE) -o $@ $@.c
      ! 	rm -f $@.c
      ! 
      ! ..o.$(DL_EXT):
      ! 	$(DLLINK) $<
        
        .c.pro:
        	$(SED) -n -f $(srcdir)/../makepro.sed $< > $@
      ***************
      *** 94,101 ****
        # object files
        ZLEOBJS = zle_bindings.o zle_hist.o zle_main.o zle_misc.o zle_move.o \
        zle_refresh.o zle_tricky.o zle_utils.o zle_vi.o zle_word.o
        
      ! OBJS = $(ZLEOBJS) compctl.o deltochar.o
        HDRS = zle.h
        
        # target modules
      --- 103,114 ----
        # object files
        ZLEOBJS = zle_bindings.o zle_hist.o zle_main.o zle_misc.o zle_move.o \
        zle_refresh.o zle_tricky.o zle_utils.o zle_vi.o zle_word.o
      + ZLEDOBJS = zle_bindings..o zle_hist..o zle_main..o zle_misc..o zle_move..o \
      + zle_refresh..o zle_tricky..o zle_utils..o zle_vi..o zle_word..o
      + OTHEROBJS = compctl.o deltochar.o
      + OTHERDOBJS = compctl..o deltochar..o
        
      ! ALLOBJS = $(ZLEOBJS) $(OTHEROBJS) $(ZLEDOBJS) $(OTHERDOBJS)
        HDRS = zle.h
        
        # target modules
      ***************
      *** 109,118 ****
        modules: proto
        	@$(MAKE) $(MAKEDEFS) $(MODULES)
        
      ! zle.so: $(ZLEOBJS)
      ! 	$(LINK) $(ZLEOBJS)
        
      ! $(OBJS): $(HDRS)
        
        proto: $(PROTO)
        
      --- 122,131 ----
        modules: proto
        	@$(MAKE) $(MAKEDEFS) $(MODULES)
        
      ! zle.so: $(ZLEDOBJS)
      ! 	$(DLLINK) $(ZLEDOBJS)
        
      ! $(ALLOBJS): $(HDRS)
        
        proto: $(PROTO)
        

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMr9qNXD/+HJTpU/hAQFmZQP9Gtax8ZE/2RmZLJXBfpGFl3W4lCo7oZFg
sWpS4c1DRW/FLC6pheohYrFe1KDu+qJqbs9XEVpXvrOm4Y3WM4rWye3VC5HRNYDA
aDylHz/iQ2M5scfKEuEFwCtnjsdHax9T0M/7W7bY5pxsBDtcxHK16rgIgRfXhN1B
NSbM6f7yOHs=
=7zy5
-----END PGP SIGNATURE-----



Messages sorted by: Reverse Date, Date, Thread, Author