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
gcc 4.6.0 #11216
Comments
From @nwc10gcc 4.6.0 was released on March 25, 2011 It would be embarrassing if perl 5.14.0 didn't build and pass tests on it. Nicholas Clark |
From @dglI had a go at setting up a smoker using gcc 4.6.0 (basically by using I then thought I'd try link time optimisation, that didn't go so well, I wonder if it would be worth having support in Configure for not running the David PS: This feels more like a known issue than a 5.14.0 blocker to me. $ cat try.c |
From @dglMessage RFC822: Automated smoke report for 5.13.11 patch Summary: PASS O = OK F = Failure(s), extended report at the bottom
O O O O Testsuite was run only with 'harness' and HARNESS_OPTIONS=j4 MANIFEST did not declare '.git/FETCH_HEAD' Compiler messages(gcc): -- |
From @dglAutomated smoke report for 5.13.11 patch Summary: PASS O = OK F = Failure(s), extended report at the bottom Configuration (common) -Doptimize=-O3 Testsuite was run only with 'harness' and HARNESS_OPTIONS=j4 MANIFEST did not declare '.git/FETCH_HEAD' Compiler messages(gcc): -- |
The RT System itself - Status changed from 'new' to 'open' |
From @nwc10On Tue, Mar 29, 2011 at 01:24:45PM +0100, David Leadbeater wrote:
Yes, me too. I've fixed the compile time warnings that are easy to fix in the branch Some of the others will be harder as they're variables within macros, and As far as I can tell [ie just gcc 4.6.0 and 4.3.2 :-)] removing the dead Given that we can't eliminate all these warnings right now, and as long as Nicholas Clark |
From rmbarker.cpan@btinternet.comOn Tue, 2011-03-29 at 13:24 +0100, David Leadbeater wrote:
Patch to hv.c and pp_sys.c to fix some variable-set-but-not-used Patch to cflags.SH to suppress unused-but-set-variable warning Robin |
From rmbarker.cpan@btinternet.com0001-avoid-unused-but-set.patchFrom 186c1e57281e7b185a6217f8e4157f35af386511 Mon Sep 17 00:00:00 2001
From: Robin Barker <rmbarker@cpan.org>
Date: Tue, 29 Mar 2011 22:57:32 +0100
Subject: [PATCH 1/2] avoid unused-but-set
---
hv.c | 8 ++------
pp_sys.c | 6 ++----
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/hv.c b/hv.c
index ed5061f..0864265 100644
--- a/hv.c
+++ b/hv.c
@@ -904,7 +904,6 @@ S_hv_delete_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
register XPVHV* xhv;
register HE *entry;
register HE **oentry;
- HE *const *first_entry;
bool is_utf8 = (k_flags & HVhek_UTF8) ? TRUE : FALSE;
int masked_flags;
@@ -983,7 +982,7 @@ S_hv_delete_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
masked_flags = (k_flags & HVhek_MASK);
- first_entry = oentry = &(HvARRAY(hv))[hash & (I32) HvMAX(hv)];
+ oentry = &(HvARRAY(hv))[hash & (I32) HvMAX(hv)];
entry = *oentry;
for (; entry; oentry = &HeNEXT(entry), entry = *oentry) {
SV *sv;
@@ -1606,7 +1605,6 @@ S_clear_placeholders(pTHX_ HV *hv, U32 items)
i = HvMAX(hv);
do {
/* Loop down the linked list heads */
- bool first = TRUE;
HE **oentry = &(HvARRAY(hv))[i];
HE *entry;
@@ -1628,7 +1626,6 @@ S_clear_placeholders(pTHX_ HV *hv, U32 items)
}
} else {
oentry = &HeNEXT(entry);
- first = FALSE;
}
}
} while (--i >= 0);
@@ -2631,7 +2628,6 @@ S_unshare_hek_or_pvn(pTHX_ const HEK *hek, const char *str, I32 len, U32 hash)
register XPVHV* xhv;
HE *entry;
register HE **oentry;
- HE **first;
bool is_utf8 = FALSE;
int k_flags = 0;
const char * const save = str;
@@ -2672,7 +2668,7 @@ S_unshare_hek_or_pvn(pTHX_ const HEK *hek, const char *str, I32 len, U32 hash)
} */
xhv = (XPVHV*)SvANY(PL_strtab);
/* assert(xhv_array != 0) */
- first = oentry = &(HvARRAY(PL_strtab))[hash & (I32) HvMAX(PL_strtab)];
+ oentry = &(HvARRAY(PL_strtab))[hash & (I32) HvMAX(PL_strtab)];
if (he) {
const HE *const he_he = &(he->shared_he_he);
for (entry = *oentry; entry; oentry = &HeNEXT(entry), entry = *oentry) {
diff --git a/pp_sys.c b/pp_sys.c
index 3c42133..2ee1ad5 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -419,7 +419,6 @@ PP(pp_warn)
{
dVAR; dSP; dMARK;
SV *exsv;
- const char *pv;
STRLEN len;
if (SP - MARK > 1) {
dTARGET;
@@ -436,7 +435,7 @@ PP(pp_warn)
exsv = TOPs;
}
- if (SvROK(exsv) || (pv = SvPV_const(exsv, len), len)) {
+ if (SvROK(exsv) || ((void)SvPV_const(exsv, len), len)) {
/* well-formed exception supplied */
}
else if (SvROK(ERRSV)) {
@@ -459,7 +458,6 @@ PP(pp_die)
{
dVAR; dSP; dMARK;
SV *exsv;
- const char *pv;
STRLEN len;
#ifdef VMS
VMSISH_HUSHED = VMSISH_HUSHED || (PL_op->op_private & OPpHUSH_VMSISH);
@@ -474,7 +472,7 @@ PP(pp_die)
exsv = TOPs;
}
- if (SvROK(exsv) || (pv = SvPV_const(exsv, len), len)) {
+ if (SvROK(exsv) || ((void)SvPV_const(exsv, len), len)) {
/* well-formed exception supplied */
}
else if (SvROK(ERRSV)) {
--
1.7.0.4
|
From rmbarker.cpan@btinternet.com0002-suppress-unused-but-set-variable-warning.patchFrom a4dfe1a7878f15a51b5d5e59ddfcfc1e8848d008 Mon Sep 17 00:00:00 2001
From: Robin Barker <rmbarker@cpan.org>
Date: Tue, 29 Mar 2011 22:58:11 +0100
Subject: [PATCH 2/2] suppress unused-but-set-variable warning
---
cflags.SH | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cflags.SH b/cflags.SH
index f57cf2f..39ac77d 100755
--- a/cflags.SH
+++ b/cflags.SH
@@ -135,7 +135,8 @@ case "$gccversion" in
[12]*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
Intel*) ;; # # Is that you, Intel C++?
*) for opt in -ansi -std=c89 -W -Wextra -Wdeclaration-after-statement \
- -Wendif-labels -Wc++-compat -Wwrite-strings
+ -Wendif-labels -Wc++-compat -Wwrite-strings \
+ -Wno-unused-but-set-variable
do
case " $ccflags " in
*" $opt "*) ;; # Skip if already there.
--
1.7.0.4
|
From @nwc10On Mon, Mar 28, 2011 at 07:31:14AM -0700, Nicholas Clark wrote:
Seems to build and pass all tests on x86 and x86_64 Linux, albeit with It won't build on OS X without patching, something like this: Inline Patchdiff --git a/hints/darwin.sh b/hints/darwin.sh
index dab0607..95dc549 100644
--- a/hints/darwin.sh
+++ b/hints/darwin.sh
@@ -126,11 +126,13 @@ case "$(grep '^#define INT32_MIN' /usr/include/stdint.h)"
esac
# Avoid Apple's cpp precompiler, better for extensions
-cppflags="${cppflags} -no-cpp-precomp"
+if [ "X`echo | ${cc} -no-cpp-precomp -E - 2>&1 >/dev/null`" = "X" ]; then
+ cppflags="${cppflags} -no-cpp-precomp"
-# This is necessary because perl's build system doesn't
-# apply cppflags to cc compile lines as it should.
-ccflags="${ccflags} ${cppflags}"
+ # This is necessary because perl's build system doesn't
+ # apply cppflags to cc compile lines as it should.
+ ccflags="${ccflags} ${cppflags}"
+fi
# Known optimizer problems.
case "`cc -v 2>&1`" in
$ echo | gcc-mp-4.6 -no-cpp-precomp -E - It was only a warning with gcc 4.5 from macports: $ echo | gcc-mp-4.5 -no-cpp-precomp -E - I'm not sure if this is the right thing to apply. [Note, much to my pleasant surprise, macports builds gcc-4.6 in about an hour Nicholas Clark |
From @nwc10On Wed, Mar 30, 2011 at 10:46:41PM +0100, Nicholas Clark wrote:
I applied this as e727fa2 Nicholas Clark |
From @nwc10On Tue, Mar 29, 2011 at 04:45:44PM +0100, Nicholas Clark wrote:
On Tue, Mar 29, 2011 at 11:12:33PM +0100, Robin Barker wrote:
It happened that I'd already committed fixes for them to my branch (with analysis in the commit message for 9029c9aff9243ad7 about how the
I think that, long term, having warning is useful, and something we should Nicholas Clark |
From @obra
I'm 100% ok with leaving and documenting these warnings for post-5.14. Can I get a volunteer
|
From @obraHey folks, Nick has recently (I believe) integrated the patches needed to get Perl I'd like to see GCC 4.6.0 smoke reports for (at least): Linux x86 Anybody who can contribute one of those gets a gold star. Thanks! |
From @doughera88On Fri, 8 Apr 2011, Jesse Vincent wrote:
I'm currently building on SPARC to try gcc-4.6.0 with Solaris 8. 5 hours I'm also hoping to get to fixing the Ubuntu library bug. -- |
From @nwc10On Fri, Apr 08, 2011 at 03:53:57PM -0400, Andy Dougherty wrote:
Tony Cook found that we can't build on NetBSD with gcc 4.6.0 without some commit 85d72428d557be653f234a70b9d1395014e36599 check --whole-archive is supported before using it Inline Patchdiff --git a/hints/netbsd.sh b/hints/netbsd.sh
index d812f60..c64be44 100644
--- a/hints/netbsd.sh
+++ b/hints/netbsd.sh
@@ -35,7 +35,15 @@ case "$osvers" in
d_dlopen=$define
d_dlerror=$define
cccdlflags="-DPIC -fPIC $cccdlflags"
- lddlflags="--whole-archive -shared $lddlflags"
+ lddlflags="-shared $lddlflags"
+ # gcc 4.6 doesn't support --whole-archive, but check for it
+ # if the user chooses a new compiler later, this is pointless
+ echo 'int f(void) { return 0; }' >try.c
+ if ${cc:-cc} $cccdlflags -c try.c -otry.o 2>&1 &&
+ ${cc:-cc} --whole-archive $lddlflags try.o -otry.so 2>&1 ; t
+ lddlflags="--whole-archive $lddlflags"
+ fi
+ rm try.c try.o try.so 2>/dev/null
rpathflag="-Wl,-rpath,"
case "$osvers" in
1.[0-5]*)
Whilst the above works, I was wondering, how general are Configure's Call Back Nicholas Clark |
From @doughera88On Fri, 8 Apr 2011, Nicholas Clark wrote:
They are inconsistently and only occasionally implemented (i.e. not all . ./cc.cbu In this case, putting that stuff in a cc.cbu call-back unit should work. -- |
From @tonycozOn Fri, Apr 08, 2011 at 04:33:28PM -0400, Andy Dougherty wrote:
I'll have a fiddle with that today. Tony |
From @tonycozOn Fri, Apr 08, 2011 at 04:33:28PM -0400, Andy Dougherty wrote:
Replaced tonyc/gcc460 with the cbu version of the change. Configured/built/tested with gcc 4.6.0 and the system cc. Tony |
From @tonycoz0001-check-whole-archive-is-supported-in-cc.cbu-before-us.patchFrom fd6343662ee257267cfe8571c39010cf51d7a182 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Sat, 9 Apr 2011 10:45:37 +1000
Subject: [PATCH] check --whole-archive is supported (in cc.cbu) before using it
netbsd for pre 4.6 gcc requires --whole-archive to build shared
libraries, but this is rejected and not required in 4.6.0.
---
hints/netbsd.sh | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/hints/netbsd.sh b/hints/netbsd.sh
index d812f60..4ecd181 100644
--- a/hints/netbsd.sh
+++ b/hints/netbsd.sh
@@ -35,7 +35,17 @@ case "$osvers" in
d_dlopen=$define
d_dlerror=$define
cccdlflags="-DPIC -fPIC $cccdlflags"
- lddlflags="--whole-archive -shared $lddlflags"
+ lddlflags="-shared $lddlflags"
+ cat >UU/cc.cbu <<'EOCBU'
+# gcc 4.6 doesn't support --whole-archive, but it's required for the
+# system gcc to build correctly, so check for it
+echo 'int f(void) { return 0; }' >try.c
+if ${cc:-cc} $cccdlflags -c try.c -otry.o 2>&1 &&
+ ${cc:-cc} --whole-archive $lddlflags try.o -otry.so 2>&1 ; then
+ lddlflags="--whole-archive $lddlflags"
+fi
+rm try.c try.o try.so 2>/dev/null
+EOCBU
rpathflag="-Wl,-rpath,"
case "$osvers" in
1.[0-5]*)
--
1.7.3.4
|
From @doughera88On Fri, 8 Apr 2011, Andy Dougherty wrote:
Good news: I had no new problems on Solaris 8/SPARC with gcc-4.6.0. -- |
From @greergaOn Fri, 8 Apr 2011, Jesse Vincent wrote:
My $WORK Fedora 14 Linux x86_64 machine using Fedora 15 gcc 4.6.0 packages -- |
From @greergaSmoke logs available at http://m-l.org/~perl/smoke/perl/ Automated smoke report for 5.14.0 patch f580a93 v5.13.11-409-gf580a93 Summary: FAIL(XF) O = OK F = Failure(s), extended report at the bottom v5.13.11-409-gf580a93 Configuration (common) -Dcc=g++ Locally applied patches: Failures: (common-args) -Dcc=g++ [perlio] -Duseithreads -Dusemorebits Compiler messages(gcc): |
From @greergaSmoke logs available at http://m-l.org/~perl/smoke/perl/ Automated smoke report for 5.14.0 patch f580a93 v5.13.11-409-gf580a93 Summary: FAIL(F) O = OK F = Failure(s), extended report at the bottom v5.13.11-409-gf580a93 Configuration (common) -Dcc=gcc Locally applied patches: Failures: (common-args) -Dcc=gcc Compiler messages(gcc): |
From @nwc10On Fri, Apr 08, 2011 at 03:53:57PM -0400, Andy Dougherty wrote:
On my laptop I found that I could build gcc 4.6 in one hour, whereas gcc 4.5 Compile time and memory usage improvements Datastructures used by the dataflow framework in GCC were and that seems to have paid off nicely, in my case because my machine is Nicholas Clark |
From @obraWith Tony's fixes for NetBSD and GCC 4.6 today, I'm declaring this one |
@obra - Status changed from 'open' to 'resolved' |
From @rurbanNicholas Clark schrieb:
Looks good to me. I also suggest -- |
Migrated from rt.perl.org#87184 (status was 'resolved')
Searchable as RT87184$
The text was updated successfully, but these errors were encountered: