From 106ab15aa0e1f0a5f52347b6601e593e6a5af891 Mon Sep 17 00:00:00 2001 From: naddy Date: Tue, 23 Jul 2019 21:17:47 +0000 Subject: [PATCH] Fix the Ada build now that realpath(3) conforms to POSIX and returns an error if the last component of the path does not exist. This is a bug in libgnat. The System.File_IO.Open function calls full_name -> __gnat_full_name -> realpath on files that have not yet been created. The Linux realpath was considered lacking, so a different approach is used there. We now remove OpenBSD from the #ifdef of operating systems supporting realpath and follow the Linux code path. New Ada bootstraps are required. ok sthen@ pascal@ --- lang/gcc/8/Makefile | 11 ++++++----- lang/gcc/8/distinfo | 8 ++++---- lang/gcc/8/patches/patch-gcc_ada_cstreams_c | 17 +++++++++++++++++ 3 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 lang/gcc/8/patches/patch-gcc_ada_cstreams_c diff --git a/lang/gcc/8/Makefile b/lang/gcc/8/Makefile index 411cc668a60..6a76b9b311b 100644 --- a/lang/gcc/8/Makefile +++ b/lang/gcc/8/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.15 2019/06/13 17:00:47 sthen Exp $ +# $OpenBSD: Makefile,v 1.16 2019/07/23 21:17:47 naddy Exp $ ONLY_FOR_ARCHS = \ aarch64 alpha amd64 arm hppa i386 mips64 mips64el powerpc sparc64 @@ -17,22 +17,23 @@ DPB_PROPERTIES = parallel V = 8.3.0 REVISION = 1 +REVISION-ada = 2 REVISION-libs = 2 FULL_VERSION = $V FULL_PKGVERSION = $V -ADASTRAP_LIBC-amd64 = 95.0 +ADASTRAP_LIBC-amd64 = 95.1 ADASTRAP_LIBM-amd64 = 10.1 -ADASTRAP-amd64 = adastrap-amd64-$V-0.tar.xz +ADASTRAP-amd64 = adastrap-amd64-$V-1.tar.xz ADASTRAP_LIBC-arm = 88.0 ADASTRAP_LIBM-arm = 9.0 ADASTRAP-arm = adastrap-arm-4.9.4-0.tar.xz ADASTRAP_LIBC-hppa = 95.0 ADASTRAP_LIBM-hppa = 10.1 ADASTRAP-hppa = adastrap-hppa-$V-0.tar.xz -ADASTRAP_LIBC-i386 = 93.0 +ADASTRAP_LIBC-i386 = 95.1 ADASTRAP_LIBM-i386 = 10.1 -ADASTRAP-i386 = adastrap-i386-8.2.0-0.tar.xz +ADASTRAP-i386 = adastrap-i386-$V-0.tar.xz ADASTRAP_LIBC-mips64 = 93.0 ADASTRAP_LIBM-mips64 = 10.1 ADASTRAP-mips64 = adastrap-mips64-8.2.0-0.tar.xz diff --git a/lang/gcc/8/distinfo b/lang/gcc/8/distinfo index fc0ff78294c..9332e4428d3 100644 --- a/lang/gcc/8/distinfo +++ b/lang/gcc/8/distinfo @@ -1,15 +1,15 @@ -SHA256 (gcc/adastrap-amd64-8.3.0-0.tar.xz) = zNmbzeDC/+Ge+kfSnrwXcj6ddACsKE1nIC0496gMDM4= +SHA256 (gcc/adastrap-amd64-8.3.0-1.tar.xz) = b93XWt8B21i+HCMuSH1BudFKzPEWuUkKJNzzmTgftZ8= SHA256 (gcc/adastrap-arm-4.9.4-0.tar.xz) = sadBk8tP/65RDDIHlWE1yo9MnSUP/44Ou9064RXonto= SHA256 (gcc/adastrap-hppa-8.3.0-0.tar.xz) = 7iT/rHuqcATOFkGCjuv+05eE8QEYcgfG+R2ccj1skbk= -SHA256 (gcc/adastrap-i386-8.2.0-0.tar.xz) = 29SQJ3MNKGWHanXGcBalVE6aQfitd1pUEIY3OfpNPsk= +SHA256 (gcc/adastrap-i386-8.3.0-0.tar.xz) = sZxOtJU69TSDsjOox7kReCWyiO3+7Ow1/WSoD26i3jE= SHA256 (gcc/adastrap-mips64-8.2.0-0.tar.xz) = XS8T0WqoliUNSDOgJxRCkT6h+O0pujT5pLREohFCwEs= SHA256 (gcc/adastrap-powerpc-8.3.0-0.tar.xz) = EKLohGDrp1icw7P4si70vgu0U58xY2S7lD/MiMQ5a/o= SHA256 (gcc/adastrap-sparc64-6.5.0-0.tar.xz) = cqpGS2beYV+CFf7X+P4voVHHT78v6SCgtksHXjP/B4E= SHA256 (gcc/gcc-8.3.0.tar.xz) = ZLqt/mzA9JR6hMsS1/Dfr0W7WLfpJGFjlZbCHgLZfSw= -SIZE (gcc/adastrap-amd64-8.3.0-0.tar.xz) = 57181344 +SIZE (gcc/adastrap-amd64-8.3.0-1.tar.xz) = 57134060 SIZE (gcc/adastrap-arm-4.9.4-0.tar.xz) = 31142168 SIZE (gcc/adastrap-hppa-8.3.0-0.tar.xz) = 47628912 -SIZE (gcc/adastrap-i386-8.2.0-0.tar.xz) = 58799192 +SIZE (gcc/adastrap-i386-8.3.0-0.tar.xz) = 58988888 SIZE (gcc/adastrap-mips64-8.2.0-0.tar.xz) = 47951224 SIZE (gcc/adastrap-powerpc-8.3.0-0.tar.xz) = 52663400 SIZE (gcc/adastrap-sparc64-6.5.0-0.tar.xz) = 38704976 diff --git a/lang/gcc/8/patches/patch-gcc_ada_cstreams_c b/lang/gcc/8/patches/patch-gcc_ada_cstreams_c new file mode 100644 index 00000000000..441d655f886 --- /dev/null +++ b/lang/gcc/8/patches/patch-gcc_ada_cstreams_c @@ -0,0 +1,17 @@ +$OpenBSD: patch-gcc_ada_cstreams_c,v 1.1 2019/07/23 21:17:47 naddy Exp $ + +System.File_IO.Open calls full_name() for Create. Use getcwd() approach +instead of realpath() since the latter fails if the file doesn't exist. + +Index: gcc/ada/cstreams.c +--- gcc/ada/cstreams.c.orig ++++ gcc/ada/cstreams.c +@@ -190,7 +190,7 @@ __gnat_full_name (char *nam, char *buffer) + *p = '\\'; + } + +-#elif defined (__FreeBSD__) || defined (__DragonFly__) || defined (__OpenBSD__) ++#elif defined (__FreeBSD__) || defined (__DragonFly__) + + /* Use realpath function which resolves links and references to . and .. + on those Unix systems that support it. Note that GNU/Linux provides it but