gcc-4.6.x generate buggy code and other debug and build problems
by Farkas Levente
hi,
after a few years or rebuild, debugging i find a serious problem.
the short story gcc-4.6.1 and even the trunk 4.6.2 generate code which
segfault while gcc-4.5.3 generate good.
the long story:
i like to build cross compiler environment for rhel-6 and the final goal
to build gstreamer for windows on linux. after fix and port a few things
from the fedora mingw project everything seems to build properly. the
only problem is that gstreamer-ffmpeg always segfault:-(
here comes the harder part to find the reason why?
to rebuild everything it's always takes a day or night:-(
then i reduce the problem to libav (which is behind gstreamer-ffmpeg).
it's also always segfault (eg a ffplay on a h264 or mpeg4 file). and i'm
not able to debug in mingw-w64 but it's another story at the of this mail.
i try ot rebuild everything with gcc-4.6.1 and with gcc-4.6.2 (and also
bootstrap with both) also try with mingw-w64 1.0, 1.0 daily snaphost and
2.0rc1 too. none of them working.
while the downloadable windows binary at libav.org is working. at the
same time the mingw32 build also working (but mingw32 is not good for us
since it's missing directx and direct3d support).
then i recognized that almost everybody else use gcc-4.5.x (cygwin, and
other linux distro) and also libav use it to produce the good binaries.
so i bootstrap and rebuild everything with gcc-4.5.3 and it's finally
working.
my conclusion is to suggest everybody to use gcc-4.5.3 until find the
reason what's the problem.
anybody can easily test the problem:
- checkout the latest git of libav.org (0.7.1 can't build on windows:-)
- build it and try ffplay any mpeg4 or h264 file.
about the debugging.
i try to debug with gdb on windows (after cross compile gdb too).
there're mainly 2 problems (even on windows or on linux with wine)
1. sometimes i've got CRC mismatch even when i 100% sure that the debug
info is extracted from the right file and install it (i rebuild and
double check it many times):
------------------------------
warning: the debug information found in "c:\Program
Files\foo\gstreamer\lib\gstreamer-0.10\libgstffmpeg.dll.debug" does
not match "c:\Program
Files\foo\gstreamer\lib\gstreamer-0.10\libgstffmpeg.dll" (CRC mismatch).
------------------------------
when this is not happened i've got "section .gnu_debuglink not found"
----------------------------------------------
$ export WINEDLLPATH=/usr/i686-w64-mingw32/sys-root/mingw/bin; wine
/usr/i686-w64-mingw32/sys-root/mingw/bin/gdb.exe --args
/usr/i686-w64-mingw32/sys-root/mingw/bin/ffplay.exe ./mpeg4.mkv
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-w64-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/usr/i686-w64-mingw32/sys-root/mingw/bin/ffplay.exe...Reading symbols
from /usr/i686-w64-mingw32/sys-root/mingw/bin/ffplay.exe.debug...
warning: section .gnu_debuglink not found in
/usr/i686-w64-mingw32/sys-root/mingw/bin/ffplay.exe.debug
done.
done.
(gdb) Exception condition detected on fd 0
error detected on stdin
----------------------------------------------
so what is the proper way to generate and extract debug info?
after we build binaries we extract debuginfo (similar as in linux)
----------------------------------------------
mingw-objcopy --only-keep-debug $f $f.debug
mingw-objcopy --add-gnu-debuglink=`basename $f.debug` --strip-unneeded
`basename $f`
----------------------------------------------
where this is the multilib version of the binutils programs.
regards.
--
Levente "Si vis pacem para bellum!"
12 years, 7 months
Broken dependencies in EPEL - 2011-08-28
by Fedora Koji Build System
Your following packages in the repository suffer from broken dependencies:
======================================================================
The results in this summary consider Test Updates!
======================================================================
package: mingw32-libpng-1.2.37-3.el6.noarch from fedora-epel-6-ppc64
unresolved deps:
mingw32(msvcrt.dll)
mingw32(zlib1.dll)
mingw32(kernel32.dll)
mingw32-filesystem >= 0:63
mingw32-runtime
12 years, 7 months
[Bug 721311] New: CVE-2011-2690 libpng: buffer overwrite in png_rgb_to_gray [fedora-all]
by Red Hat Bugzilla
Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.
Summary: CVE-2011-2690 libpng: buffer overwrite in png_rgb_to_gray [fedora-all]
https://bugzilla.redhat.com/show_bug.cgi?id=721311
Summary: CVE-2011-2690 libpng: buffer overwrite in
png_rgb_to_gray [fedora-all]
Product: Fedora
Version: 14
Platform: All
OS/Version: Linux
Status: NEW
Keywords: Security, SecurityTracking
Severity: medium
Priority: medium
Component: mingw32-libpng
AssignedTo: rjones(a)redhat.com
ReportedBy: huzaifas(a)redhat.com
QAContact: extras-qa(a)fedoraproject.org
CC: lfarkas(a)lfarkas.org, rjones(a)redhat.com,
erik-fedora(a)vanpienbroek.nl,
fedora-mingw(a)lists.fedoraproject.org
Blocks: 720607
Classification: Fedora
Story Points: ---
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected Fedora
versions.
For comments that are specific to the vulnerability please use bugs filed
against "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When creating a Bodhi update request, please include the bug IDs of the
respective parent bugs filed against the "Security Response" product.
Please mention CVE ids in the RPM changelog when available.
Bodhi update submission link:
https://admin.fedoraproject.org/updates/new/?type_=security&bugs=720607
Please note: this issue affects multiple supported versions of Fedora.
Only one tracking bug has been filed; please only close it when all
affected versions are fixed.
[bug automatically created by: add-tracking-bugs]
--
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
12 years, 7 months
[mingw32-gcc] Fix float.h inclusion when gcc's headers precede mingrt in include path
by Kalev Lember
commit 4b93699fea98cc2b21b87b8dbc591b53fc223a2c
Author: Kalev Lember <kalevlember(a)gmail.com>
Date: Fri Aug 26 14:55:57 2011 +0300
Fix float.h inclusion when gcc's headers precede mingrt in include path
The other part of the change is in mingw32-runtime 3.18-4.
gcc-1-mingw-float.patch | 18 ++++++++++++++++++
mingw32-gcc.spec | 9 +++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/gcc-1-mingw-float.patch b/gcc-1-mingw-float.patch
new file mode 100644
index 0000000..5f171d4
--- /dev/null
+++ b/gcc-1-mingw-float.patch
@@ -0,0 +1,18 @@
+This file is part of mingw-cross-env.
+See doc/index.html for further information.
+
+This patch has been taken from:
+http://gcc.gnu.org/ml/gcc-patches/2010-06/msg00387.html
+http://sourceforge.net/tracker/?func=detail&atid=302435&aid=3011968&group_id=2435
+
+diff -urN a/gcc/ginclude/float.h b/gcc/ginclude/float.h
+--- a/gcc/ginclude/float.h 2009-04-09 17:00:19.000000000 +0200
++++ b/gcc/ginclude/float.h 2010-06-05 12:03:41.887724045 +0200
+@@ -275,3 +275,7 @@
+ #endif /* __STDC_WANT_DEC_FP__ */
+
+ #endif /* _FLOAT_H___ */
++
++#ifdef __MINGW32__
++#include_next<float.h>
++#endif
diff --git a/mingw32-gcc.spec b/mingw32-gcc.spec
index 1e8230b..29f514f 100644
--- a/mingw32-gcc.spec
+++ b/mingw32-gcc.spec
@@ -2,19 +2,20 @@
Name: mingw32-gcc
Version: 4.6.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: MinGW Windows cross-compiler (GCC) for C
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions
Group: Development/Languages
URL: http://gcc.gnu.org
Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{version}/gcc-%{version}.tar.bz2
+Patch0: gcc-1-mingw-float.patch
BuildRequires: texinfo
BuildRequires: mingw32-filesystem >= 68
# Need mingw32-binutils which support %gnu_unique_object >= 2.19.51.0.14
BuildRequires: mingw32-binutils >= 2.19.51.0.14
-BuildRequires: mingw32-runtime
+BuildRequires: mingw32-runtime >= 3.18-4
BuildRequires: mingw32-w32api
BuildRequires: mingw32-pthreads
BuildRequires: gmp-devel
@@ -83,6 +84,7 @@ MinGW Windows cross-compiler for FORTRAN.
%prep
%setup -q -n gcc-%{version}
+%patch0 -p1 -b .float
echo 'Fedora MinGW %{version}-%{release}' > gcc/DEV-PHASE
# Install python files into _mingw32_datadir
@@ -249,6 +251,9 @@ popd
%changelog
+* Fri Aug 26 2011 Kalev Lember <kalevlember(a)gmail.com> - 4.6.1-3
+- Fix float.h inclusion when gcc's headers precede mingrt in include path
+
* Fri Aug 19 2011 Erik van Pienbroek <epienbro(a)fedoraproject.org> - 4.6.1-2
- Build against ppl and cloog
12 years, 7 months
[mingw32-gcc] Build against ppl and cloog
by Kalev Lember
commit c467d3ae3ef87cd6ba27671552865bfdb6d6a662
Author: Erik van Pienbroek <epienbro(a)fedoraproject.org>
Date: Sat Aug 20 08:42:51 2011 +0300
Build against ppl and cloog
mingw32-gcc.spec | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/mingw32-gcc.spec b/mingw32-gcc.spec
index a439b07..1e8230b 100644
--- a/mingw32-gcc.spec
+++ b/mingw32-gcc.spec
@@ -2,7 +2,7 @@
Name: mingw32-gcc
Version: 4.6.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: MinGW Windows cross-compiler (GCC) for C
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions
@@ -22,6 +22,8 @@ BuildRequires: mpfr-devel
BuildRequires: libmpc-devel
BuildRequires: zlib-devel
BuildRequires: libgomp
+BuildRequires: ppl-devel
+BuildRequires: cloog-ppl-devel
BuildRequires: flex
# Need mingw32-binutils which support %gnu_unique_object
@@ -111,6 +113,7 @@ CC="%{__cc} ${RPM_OPT_FLAGS}" \
--disable-multilib \
--disable-plugin \
--enable-libgomp \
+ --with-ppl --with-cloog \
--with-system-zlib \
--disable-nls --without-included-gettext \
--disable-win32-registry \
@@ -246,6 +249,9 @@ popd
%changelog
+* Fri Aug 19 2011 Erik van Pienbroek <epienbro(a)fedoraproject.org> - 4.6.1-2
+- Build against ppl and cloog
+
* Mon Jun 27 2011 Kalev Lember <kalev(a)smartlink.ee> - 4.6.1-1
- Update to 4.6.1
12 years, 7 months
[mingw32-runtime] GCC 4.6 compatibility patch from upstream
by Kalev Lember
commit 301153195afae02e77811376ec9b916d6ba09452
Author: Kalev Lember <kalevlember(a)gmail.com>
Date: Fri Aug 26 14:53:44 2011 +0300
GCC 4.6 compatibility patch from upstream
mingw32-runtime.spec | 6 ++++
mingwrt-gcc46.patch | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+), 0 deletions(-)
---
diff --git a/mingw32-runtime.spec b/mingw32-runtime.spec
index 837593f..4b03ca2 100644
--- a/mingw32-runtime.spec
+++ b/mingw32-runtime.spec
@@ -18,6 +18,10 @@ Source0: http://downloads.sourceforge.net/mingw/mingwrt-%{version}-mingw3
# fix float.h when gcc's float.h precedes it in the include path.
Patch0: mingwrt-float.patch
+# Backported from upstream,
+# http://sourceforge.net/tracker/?func=detail&aid=3105314&group_id=2435&ati...
+Patch1: mingwrt-gcc46.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -39,6 +43,7 @@ MinGW Windows cross-compiler runtime, base libraries.
%prep
%setup -q -n mingwrt-%{version}-mingw32
%patch0 -p1 -b .float
+%patch1 -p1 -b .gcc46
%build
@@ -76,6 +81,7 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Fri Aug 26 2011 Kalev Lember <kalevlember(a)gmail.com> - 3.18-4
- Fix float.h when gcc's float.h precedes it in the include path
+- GCC 4.6 compatibility patch from upstream
* Tue May 10 2011 Kalev Lember <kalev(a)smartlink.ee> - 3.18-3
- Build without -fexceptions (#629209)
diff --git a/mingwrt-gcc46.patch b/mingwrt-gcc46.patch
new file mode 100644
index 0000000..1a3d0e1
--- /dev/null
+++ b/mingwrt-gcc46.patch
@@ -0,0 +1,76 @@
+From ee45e1e97ae69c66cd261dc8c4e2e4640238a34b Mon Sep 17 00:00:00 2001
+From: ironhead <ironhead>
+Date: Mon, 27 Dec 2010 21:01:13 +0000
+Subject: [PATCH] 2010-11-08 Rodrigo Rivas Costa <rodrigorivascosta(a)gmail.com>
+
+ * tlssup.c (__dyn_tls_init): Use an integer variable to iterate between
+ __xd_a and __xd_z.
+---
+ ChangeLog | 5 +++++
+ tlssup.c | 21 ++++++++++++---------
+ 2 files changed, 17 insertions(+), 9 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index e90df7c..bc65b26 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,8 @@
++2010-11-08 Rodrigo Rivas Costa <rodrigorivascosta(a)gmail.com>
++
++ * tlssup.c (__dyn_tls_init): Use an integer variable to iterate between
++ __xd_a and __xd_z.
++
+ 2010-07-25 Keith Marshall <keithmarshall(a)users.sourceforge.net>
+
+ Accept that mingwrt headers are not guaranteed to precede GCC's in the
+diff --git a/tlssup.c b/tlssup.c
+index b101d11..660d098 100644
+--- a/tlssup.c
++++ b/tlssup.c
+@@ -94,6 +94,7 @@ BOOL WINAPI
+ __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
+ {
+ _PVFV *pfunc;
++ int nfuncs, ifunc;
+
+ #ifndef _WIN64
+ if (_winmajor < 4)
+@@ -107,13 +108,13 @@ __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
+ }
+ if (__mingw_mthread_hdll == NULL || !__mingw_gMTRemoveKeyDtor || !__mingw_gMTKeyDtor)
+ {
+- __mingw_gMTKeyDtor = NULL;
+- __mingw_gMTRemoveKeyDtor = NULL;
+- if (__mingw_mthread_hdll)
+- FreeLibrary (__mingw_mthread_hdll);
+- __mingw_mthread_hdll = NULL;
+- _CRT_MT = 0;
+- return TRUE;
++ __mingw_gMTKeyDtor = NULL;
++ __mingw_gMTRemoveKeyDtor = NULL;
++ if (__mingw_mthread_hdll)
++ FreeLibrary (__mingw_mthread_hdll);
++ __mingw_mthread_hdll = NULL;
++ _CRT_MT = 0;
++ return TRUE;
+ }
+ _CRT_MT = 1;
+ return TRUE;
+@@ -130,10 +131,12 @@ __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
+ return TRUE;
+ }
+
+- for (pfunc = &__xd_a + 1; pfunc != &__xd_z; ++pfunc)
++ nfuncs = &__xd_z - (&__xd_a + 1);
++ for (ifunc = 0; ifunc < nfuncs; ++ifunc)
+ {
++ pfunc = (&__xd_a + 1) + ifunc;
+ if (*pfunc != NULL)
+- (*pfunc)();
++ (*pfunc)();
+ }
+ return TRUE;
+ }
+--
+1.7.6
+
12 years, 7 months
[mingw32-runtime] Fix float.h when gcc's float.h precedes it in the include path
by Kalev Lember
commit 2ab1639460f4427ca6dafcba4bd7a314ccc20b88
Author: Kalev Lember <kalevlember(a)gmail.com>
Date: Fri Aug 26 14:39:49 2011 +0300
Fix float.h when gcc's float.h precedes it in the include path
mingw32-runtime.spec | 11 +++++-
mingwrt-float.patch | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 107 insertions(+), 1 deletions(-)
---
diff --git a/mingw32-runtime.spec b/mingw32-runtime.spec
index aaecd6e..837593f 100644
--- a/mingw32-runtime.spec
+++ b/mingw32-runtime.spec
@@ -6,13 +6,18 @@
Name: mingw32-runtime
Version: 3.18
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: MinGW Windows cross-compiler runtime
License: Public Domain
Group: Development/Libraries
URL: http://www.mingw.org/
Source0: http://downloads.sourceforge.net/mingw/mingwrt-%{version}-mingw32-src.tar.gz
+
+# Backported from upstream,
+# fix float.h when gcc's float.h precedes it in the include path.
+Patch0: mingwrt-float.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -33,6 +38,7 @@ MinGW Windows cross-compiler runtime, base libraries.
%prep
%setup -q -n mingwrt-%{version}-mingw32
+%patch0 -p1 -b .float
%build
@@ -68,6 +74,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Fri Aug 26 2011 Kalev Lember <kalevlember(a)gmail.com> - 3.18-4
+- Fix float.h when gcc's float.h precedes it in the include path
+
* Tue May 10 2011 Kalev Lember <kalev(a)smartlink.ee> - 3.18-3
- Build without -fexceptions (#629209)
diff --git a/mingwrt-float.patch b/mingwrt-float.patch
new file mode 100644
index 0000000..d9253b9
--- /dev/null
+++ b/mingwrt-float.patch
@@ -0,0 +1,97 @@
+From 295d06c847db4db6ca71463d9da6f6436eec1c3f Mon Sep 17 00:00:00 2001
+From: keithmarshall <keithmarshall>
+Date: Sun, 25 Jul 2010 20:20:46 +0000
+Subject: [PATCH] Accept that mingwrt headers are not guaranteed to precede
+ GCC's in the system include search path; (issue reported by
+ Mark Brand).
+
+---
+ ChangeLog | 14 ++++++++++++++
+ include/float.h | 36 ++++++++++++++++++++++++++----------
+ 2 files changed, 40 insertions(+), 10 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index fe84a51..5f106e6 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,17 @@
++2010-07-25 Keith Marshall <keithmarshall(a)users.sourceforge.net>
++
++ Accept that mingwrt headers are not guaranteed to precede GCC's in the
++ system include search path; (issue reported by Mark Brand).
++
++ * include/float.h: Add multiple inclusion guard around...
++ [! defined _FLOAT_H___]: ...include_next <float.h> for GCC's version,
++ only when this define does not indicate that it has already been seen;
++ update comments to document rationale; move it within the scope of...
++ [! defined _MINGW_FLOAT_H_]: ...this multiple inclusion guard, so that
++ GCC's float.h, after an appropriate complementary modification, need
++ not perform a further include path search when this implementation
++ specific extension has already been processed.
++
+ 2010-03-06 Chris Sutcliffe <ir0nh34d(a)users.sourceforge.net>
+
+ * include/_mingw.h: Increment version to 3.18.
+diff --git a/include/float.h b/include/float.h
+index 97a2c1c..d5f2215 100644
+--- a/include/float.h
++++ b/include/float.h
+@@ -1,5 +1,7 @@
++#ifndef _MINGW_FLOAT_H_
+ /*
+ * float.h
++ *
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is a part of the mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within the package.
+@@ -9,17 +11,31 @@
+ * Also included here are some non-ANSI bits for accessing the floating
+ * point controller.
+ *
+- * NOTE: GCC provides float.h, but it doesn't include the non-standard
+- * stuff for accessing the fp controller. We include_next the
+- * GCC-supplied header and just define the MS-specific extensions
+- * here.
+- *
+ */
+-
+-#include_next<float.h>
+-
+-#ifndef _MINGW_FLOAT_H_
+ #define _MINGW_FLOAT_H_
++/*
++ * NOTE:
++ *
++ * GCC provides float.h, but it doesn't include the non-standard stuff for
++ * accessing the fp controller. We parse the GCC-supplied header, for its
++ * standard content, and then define the MS-specific extensions here.
++ *
++ * In a MinGW standard Win32 hosted environment, this should be the float.h
++ * found by a system include path search, but this can't be guaranteed; for
++ * a cross-compiler setup, the GCC-supplied header, which is guarded by the
++ * _FLOAT_H___ macro, may be found first, thus...
++ *
++ */
++#ifndef _FLOAT_H___
++ /*
++ * ...when we didn't find the GCC-supplied header first, we want to pull
++ * it in now; include_next should achieve this, (and we must rely on the
++ * GCC header maintainers to extend us the same courtesy, to get this one
++ * pulled in, when the GCC-supplied header is found first).
++ *
++ */
++# include_next <float.h>
++#endif
+
+ /* All the headers include this file. */
+ #include <_mingw.h>
+@@ -148,5 +164,5 @@ _CRTIMP int __cdecl __MINGW_NOTHROW _isnan (double);
+
+ #endif /* Not __STRICT_ANSI__ */
+
+-#endif /* _FLOAT_H_ */
++#endif /* _MINGW_FLOAT_H_ */
+
+--
+1.7.6
+
12 years, 7 months