[ada, build] Avoid cp -p failures during Ada make install
Rainer Orth
ro@CeBiTec.Uni-Bielefeld.DE
Wed May 8 08:21:00 GMT 2019
Prompted by a known make install failure on Linux/x86_64, I decided to
finally rework my ancient patch
http://gcc.gnu.org/ml/gcc-patches/2014-04/msg01669.html
along the lines Mike suggested back then, i.e. use cp && touch -r
instead of cp -p. This avoids the failures like
for file in rts/*.ad[sb]*; do \
cp -p $file /vol/gcc/obj/gcc/gcc-10/vol/gcc/lib/gcc/x86_64-pc-linux-gnu/10.0.0/adainclude; \
done
cp: preserving permissions for ‘/vol/gcc/obj/gcc/gcc-10/vol/gcc/lib/gcc/x86_64-pc-linux-gnu/10.0.0/adainclude/a-assert.adb’: Operation not supported
when installing e.g. to an NFSv3 destination which doesn't support POSIX
ACLs from a local filesystem that does.
The fix turned out to be a bit more involved than I initially thought:
* I've changed INSTALL_DATA_DATE to use GNU make's $(call) function
since the args are now needed twice.
* The destination argument now needs to include the filename: while cp
can use a directory as destination, touch -r needs the full filename
to preserve the timestamps.
* In order for $(notdir) to work which operates textually on its args,
the loops had to be changed from shell for loops to make $(foreach)
loops.
* And finally, to avoid exceeding the command line length limit, the
individual commands have been separate by newlines, a trick learned
from https://stackoverflow.com/questions/7039811/how-do-i-process-extremely-long-lists-of-files-in-a-make-recipe
When first testing this, the make install failed trying to install
standard.ads.h: while this gave just a warning with the old code
cp: cannot stat 'rts/standard.ads.h': No such file or directory
it now fails. It turns out this is a dangling symlink
$ ls -l gcc/ada/rts/standard.ads.h
lrwxrwxrwx 1 ro gcc 50 May 7 18:13 gcc/ada/rts/standard.ads.h -> /vol/gcc/src/hg/trunk/local/gcc/ada/standard.ads.h
$ ls -lL gcc/ada/rts/standard.ads.h
ls: cannot access 'gcc/ada/rts/standard.ads.h': No such file or directory
introduced in r260921. This is only present on mainline and the gcc-9
branch and the file seems never to have existed in tree, so I'm just
removing the reference.
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)?
Thanks.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2019-05-04 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* Makefile.rtl (LIBGNAT_SRCS): Remove standard.ads.h.
* gcc-interface/Makefile.in (INSTALL_DATA_DATE): Replace cp -p
with cp && touch -r.
(NL): Define.
(install-gcc-specs, install-gnatlib): Adapt INSTALL_DATA_DATE
uses. Switch to $(foreach). Separate commands by $(NL).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ada-install-cp-p.patch
Type: text/x-patch
Size: 3051 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190508/27280b97/attachment.bin>
More information about the Gcc-patches
mailing list