Message ID | yddk1f1tl0a.fsf@CeBiTec.Uni-Bielefeld.DE |
---|---|
State | New |
Headers | show |
Series | [ada,build] Avoid cp -p failures during Ada make install | expand |
> Tested on x86_64-pc-linux-gnu installing both to a local filesystem and > an NFSv3 filesystem. > > Ok for mainline (and the gcc-9 and gcc-8 branches eventually)? No, this is not OK. I'd rather keep the simple current logic and either stick to cp -p, or use a proper $(INSTALL_whatever) as done elsewhere rather than adding more kludges. Also, standard.ads.h is a valid file, so the reference shouldn't be removed. I'll add it to the repository, this was an oversight, thanks for noticing. Arno
> Also, standard.ads.h is a valid file, so the reference shouldn't be removed. > > I'll add it to the repository, this was an oversight, thanks for noticing. I've added it now. 2019-05-08 Arnaud Charlet <charlet@adacore.com> * standard.ads.h: New file.
Hi Arnaud, >> Tested on x86_64-pc-linux-gnu installing both to a local filesystem and >> an NFSv3 filesystem. >> >> Ok for mainline (and the gcc-9 and gcc-8 branches eventually)? > > No, this is not OK. > > I'd rather keep the simple current logic and either stick to cp -p, or > use a proper $(INSTALL_whatever) as done elsewhere rather than adding more > kludges. how do you mean, `proper $(INSTALL_whatever)'? I've run the cp -p under strace, which shows fgetxattr(3, "system.posix_acl_access", 0x7fff96829fd0, 132) = -1 ENODATA (No data available) fstat(3, {st_mode=S_IFREG|0644, st_size=35368, ...}) = 0 fsetxattr(4, "system.posix_acl_access", "\2\0\0\0\1\0\6\0\377\377\377\377\4\0\4\0\377\377\377\377 \0\4\0\377\377\377\377", 28, 0) = -1 EOPNOTSUPP (Operation not supported) i.e. it tries to determine an extended attribute, is told there's none, tries to set that none on the destination and chokes if that doesn't work. Seems pretty insane to me. This is cp from coreutils 8.30 on Fedora 29, btw., not same ancient prehistoric software. Rainer
> > No, this is not OK. > > > > I'd rather keep the simple current logic and either stick to cp -p, or > > use a proper $(INSTALL_whatever) as done elsewhere rather than adding more > > kludges. > > how do you mean, `proper $(INSTALL_whatever)'? Using e.g. INSTALL_DATA from configure. > I've run the cp -p under strace, which shows > > fgetxattr(3, "system.posix_acl_access", 0x7fff96829fd0, 132) = -1 ENODATA (No data available) > fstat(3, {st_mode=S_IFREG|0644, st_size=35368, ...}) = 0 > fsetxattr(4, "system.posix_acl_access", "\2\0\0\0\1\0\6\0\377\377\377\377\4\0\4\0\377\377\377\377 \0\4\0\377\377\377\377", 28, 0) = -1 EOPNOTSUPP (Operation not supported) > > i.e. it tries to determine an extended attribute, is told there's none, > tries to set that none on the destination and chokes if that doesn't > work. Seems pretty insane to me. > > This is cp from coreutils 8.30 on Fedora 29, btw., not same ancient > prehistoric software. Did someone file a bug report there BTW? Arno
# HG changeset patch # Parent 53354151a0c54f05832420ddfa64adf8e22f6251 Avoid cp -p failures during Ada make install diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -2610,7 +2610,7 @@ LIBGNAT_OBJS = adadecode.o adaint.o argv # from ADA_INCLUDE_SRCS. LIBGNAT_SRCS = $(patsubst %.o,%.c,$(LIBGNAT_OBJS)) \ - adadecode.h adaint.h env.h gsocket.h raise.h standard.ads.h \ + adadecode.h adaint.h env.h gsocket.h raise.h \ tb-gcc.c libgnarl/thread.c $(EXTRA_LIBGNAT_SRCS) # memtrack.o is special as not put into libgnat. diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -98,7 +98,7 @@ COMPILER_FLAGS = $(CFLAGS) SHELL = @SHELL@ PWD_COMMAND = $${PWDCMD-pwd} # How to copy preserving the date -INSTALL_DATA_DATE = cp -p +INSTALL_DATA_DATE = cp $(1) $(2) && touch -r $(1) $(2) MAKEINFO = makeinfo TEXI2DVI = texi2dvi TEXI2PDF = texi2pdf @@ -502,26 +502,31 @@ gnatlink-re: ../stamp-tools gnatmake-re true; \ fi +# Used as line separator to avoid overflowing command lines. +define NL + + +endef + install-gcc-specs: # Install all the requested GCC spec files. - $(foreach f,$(GCC_SPEC_FILES), \ - $(INSTALL_DATA_DATE) $(srcdir)/ada/$(f) $(DESTDIR)$(libsubdir)/;) + $(foreach f, $(GCC_SPEC_FILES), \ + $(call INSTALL_DATA_DATE, $(srcdir)/ada/$(f), $(libsubdir))/$(notdir $(f));) install-gnatlib: ../stamp-gnatlib-$(RTSDIR) install-gcc-specs $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR) $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR) -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR) -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR) - for file in $(RTSDIR)/*.ali; do \ - $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \ - done + $(foreach file, $(wildcard $(RTSDIR)/*.ali), \ + $(call INSTALL_DATA_DATE, $(file), $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$(notdir $(file)))$(NL)) -cd $(RTSDIR); for file in *$(arext);do \ $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \ $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \ done -$(foreach file, $(EXTRA_ADALIB_OBJS), \ - $(INSTALL_DATA_DATE) $(RTSDIR)/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \ + $(call INSTALL_DATA_DATE,$(RTSDIR)/$(file),$(DESTDIR)$(ADA_RTL_OBJ_DIR)/$(notdir $(file))$(NL)) && \ ) true # Install the shared libraries, if any, using $(INSTALL) instead # of $(INSTALL_DATA). The latter may force a mode inappropriate @@ -544,9 +549,8 @@ install-gnatlib: ../stamp-gnatlib-$(RTSD fi; \ done # This copy must be done preserving the date on the original file. - for file in $(RTSDIR)/*.ad[sb]*; do \ - $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \ - done + $(foreach file, $(wildcard $(RTSDIR)/*.ad[sb]*), \ + $(call INSTALL_DATA_DATE, $(file), $(DESTDIR)$(ADA_INCLUDE_DIR)/$(notdir $(file)))$(NL)) cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads