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: nm detects memmem, but headers don't expose it, leading to tests crashing #15390
Comments
From @dcollinsnIn my cygwin system, the declaration for memmem in included in string.h, with #include guards: #if __GNU_VISIBLE __GNU_VISIBLE is in turn defined in sys/features.h: #ifdef _GNU_SOURCE However, ./Configure with the Cygwin hints will not set _GNU_SOURCE. So, nm detects memmem, util.c uses it, and nothing declares it, leading to this warning: gcc -c -DPERL_CORE -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -std=c89 -O3 -g -Wall -Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings util.c Failed 25 tests out of 2359, 98.94% okay. ../dist/Time-HiRes/t/ualarm.t Summary of my perl5 (revision 5 version 25 subversion 2) configuration: Characteristics of this binary (from libperl): |
From @dcollinsn0001-Cygwin-headers-don-t-declare-memmem-without-_GNU_SOU.patchFrom 031834dba0bb43bac07fa27f0af85d908e03fb09 Mon Sep 17 00:00:00 2001
From: Dan Collins <dcollinsn@gmail.com>
Date: Thu, 9 Jun 2016 18:29:51 -0400
Subject: [PATCH] Cygwin headers don't declare memmem() without _GNU_SOURCE
As a result, while nm detected memmem in libc, it was not present
in the system headers as preprocessed using Perl's ccflags, causing
gcc to treat it as an implicit definition, guessing the wrong
return type, generating compiler warnings and worse whereever it
was used. This patch gets my clean Cygwin 2.5.1 install from 25
failing test scripts to 2.
---
hints/cygwin.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hints/cygwin.sh b/hints/cygwin.sh
index 21997db..20e0e58 100644
--- a/hints/cygwin.sh
+++ b/hints/cygwin.sh
@@ -31,7 +31,7 @@ test -z "$optimize" && optimize='-O3'
man3ext='3pm'
test -z "$use64bitint" && use64bitint='define'
test -z "$useithreads" && useithreads='define'
-ccflags="$ccflags -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__"
+ccflags="$ccflags -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE"
# - otherwise i686-cygwin
archname='cygwin'
--
2.8.3
|
From @dcollinsn |
From Stromeko@nexgo.deDan Collins (via RT) writes:
FWIW, here's my patch for the Perl that comes with Cygwin (and don't use --- buildperl/hints/cygwin.sh.orig @@ -62,6 +71,13 @@ +case "$osvers" in Regards Factory and User Sound Singles for Waldorf rackAttack: |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#128358 (status was 'open')
Searchable as RT128358$
The text was updated successfully, but these errors were encountered: