New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cygwin build failure with v5.27.11-16-g71e845c342 #16532
Comments
From @tonycozA vanilla build of blead on: $ uname -a Fails with: $ make locale.o If I modify locale.c to skip the brokeness that is nostdio.h then tony@phobos ~/dev/perl/git/perl tony@phobos ~/dev/perl/git/perl Inline Patchdiff --git a/locale.c b/locale.c
index 7653340477..f6e946fe15 100644
--- a/locale.c
+++ b/locale.c
@@ -43,6 +43,7 @@
* this end, and is retained, #ifdef'd out.
*/
+#define PERLIO_NOT_STDIO 0
#include "EXTERN.h"
#define PERL_IN_LOCALE_C
#include "perl_langinfo.h"
gcc -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings -DUSEIMPORTLIB -O3 -DVERSION=\"1.84\" -DXS_VERSION=\"1.84\" "-I../.." POSIX.c Tony $ ./miniperl -Ilib -V Characteristics of this binary (from libperl): |
From @khwilliamsonWhat can be done about this? |
The RT System itself - Status changed from 'new' to 'open' |
From @iabynOn Tue, Apr 24, 2018 at 05:18:24PM -0700, Tony Cook (via RT) wrote:
Do you know any of: * what the ssp/ include files are for, -- |
From Stromeko@nexgo.deDave Mitchell writes:
That's an implementation detail of how the fortified versions of those
That's what you get when fortification is requested.
You'd have to ask someone who knows the details of how the feature test Regards, Wavetables for the Terratec KOMPLEXER: |
From @khwilliamsonOn 04/30/2018 12:29 PM, Achim Gratz wrote:
So a potential fix for this is to not fortify the source for this platform? |
From Stromeko@nexgo.deKarl Williamson writes:
No, the platform default is FORTIFY_SOURCE=2 adn I'd not veer from it Regards, Wavetables for the Terratec KOMPLEXER: |
From @tonycozOn Tue, 01 May 2018 11:56:06 -0700, Stromeko@nexgo.de wrote:
There's two issues here: 1) cygwin declares fgetws() when stdlib.h is included, but that name isn't reserved to the implementation unless wchar.h is included (C11 7.1.3) So a C program that defines a fgetws() function but doesn't include wchar.h would be conforming, but this would break if stdlib.h is included, making cygwin non-conforming. But I wouldn't be too surprised to find other implementations leak in similar ways. 2) Perl includes wchar.h which uses the FILE type (you're meant to #include stdio.h to use the I/O functions with the C standard[2], but POSIX requires wchar.h to define the FILE type), but nostdio.h defines a macro FILE, using a named reserved to the implementation[1]. I think the real fix is probably to eliminate nostdio.h - its use of reserved names leads to random issues as we update perl and as platforms update their implementations. The attached patch doesn't remove nostdio.h, it just prevents perlio.h from including it. Tony [1] we use some other names more indirectly reserved, eg. nostdio.h defines _CANNOT and __STDIO_LOADED [2] I couldn't find wording for that, but every I/O function |
From @tonycoz0001-perl-133152-nostdio.h-is-broken-don-t-use-it.patchFrom a1132ca5510c92bb8496e298ceea926f411f8a5d Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Wed, 2 May 2018 11:15:30 +1000
Subject: [PATCH] (perl #133152) nostdio.h is broken, don't use it
---
perlio.h | 40 ----------------------------------------
1 file changed, 40 deletions(-)
diff --git a/perlio.h b/perlio.h
index d515020618..f72945e8a5 100644
--- a/perlio.h
+++ b/perlio.h
@@ -88,46 +88,6 @@ PERL_CALLCONV void PerlIO_clone(pTHX_ PerlInterpreter *proto,
/* ----------- End of implementation choices ---------- */
-/* We now need to determine what happens if source trys to use stdio.
- * There are three cases based on PERLIO_NOT_STDIO which XS code
- * can set how it wants.
- */
-
-#ifdef PERL_CORE
-/* Make a choice for perl core code
- - currently this is set to try and catch lingering raw stdio calls.
- This is a known issue with some non UNIX ports which still use
- "native" stdio features.
-*/
-# ifndef PERLIO_NOT_STDIO
-# define PERLIO_NOT_STDIO 1
-# endif
-#else
-# ifndef PERLIO_NOT_STDIO
-# define PERLIO_NOT_STDIO 0
-# endif
-#endif
-
-#ifdef PERLIO_NOT_STDIO
-#if PERLIO_NOT_STDIO
-/*
- * PERLIO_NOT_STDIO #define'd as 1
- * Case 1: Strong denial of stdio - make all stdio calls (we can think of) errors
- */
-#include "nostdio.h"
-#else /* if PERLIO_NOT_STDIO */
-/*
- * PERLIO_NOT_STDIO #define'd as 0
- * Case 2: Declares that both PerlIO and stdio can be used
- */
-#endif /* if PERLIO_NOT_STDIO */
-#else /* ifdef PERLIO_NOT_STDIO */
-/*
- * PERLIO_NOT_STDIO not defined
- * Case 3: Try and fake stdio calls as PerlIO calls
- */
-#include "fakesdio.h"
-#endif /* ifndef PERLIO_NOT_STDIO */
/* ----------- fill in things that have not got #define'd ---------- */
--
2.17.0
|
From Stromeko@nexgo.de"Tony Cook via RT" writes:
For starters, unless you request strict POSIX/ANSI behaviour from the
What is nostdio.h useful for anyway? Just asking. Regards, Samples for the Waldorf Blofeld: |
From @tonycozOn Wed, 02 May 2018 11:56:02 -0700, Stromeko@nexgo.de wrote:
You're probably right - I only tested within the perl build, and didn't test a strict ANSI build.
From the header itself: /* I assume it was more justifiable when PerlIO was new to enforce perl's implementation using PerlIO rather than stdio. Tony |
From @iabynOn Tue, May 01, 2018 at 06:50:13PM -0700, Tony Cook via RT wrote:
I propose that this ticket be moved from the 5.30.0 to the 5.32.0 blockers -- |
Migrated from rt.perl.org#133152 (status was 'open')
Searchable as RT133152$
The text was updated successfully, but these errors were encountered: