As many of you no doubt know, GCC recently released 4.8.0. This new version introduces a new optimization level enabled by -Og with the following description (from the man page):
"Optimize debugging experience. -Og enables optimizations that do not interfere with debugging. It should be the optimization level of choice for the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience."
Of course I had to try it out. I found that building Wine lead to GCC dieing with
... dlls/kernel32/console.c:1691:1: internal compiler error: Segmentation fault
I also found
... dlls/kernel32/computername.c:701:1: internal compiler error: Segmentation fault
I eventually stumbled my way into the enclosed patch which lets GCC build Wine with -Og.
I'm not sure if this change (or something similar) makes sense for Wine. I'm fairly certain some changes make sense for GCC (I suspect that GCC should not segfault).
I haven't submitted a bug for GCC because I suspect they'll want me to provide something simpler to compile than the Wine source tree. I certainly won't be upset if someone beats me too it. I'm not sure how much time in the near future I'll spend on it. "Eventually" is probably the word that fits.
At any rate, I wanted to at least share my experiences in case anyone is interested in heading down the same path.
On Mon, Apr 15, 2013 at 02:37:27PM -0600, James Eder wrote:
As many of you no doubt know, GCC recently released 4.8.0. This new version introduces a new optimization level enabled by -Og with the following description (from the man page):
"Optimize debugging experience. -Og enables optimizations that do not interfere with debugging. It should be the optimization level of choice for the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience."
Of course I had to try it out. I found that building Wine lead to GCC dieing with
... dlls/kernel32/console.c:1691:1: internal compiler error: Segmentation fault
I also found
... dlls/kernel32/computername.c:701:1: internal compiler error: Segmentation fault
I eventually stumbled my way into the enclosed patch which lets GCC build Wine with -Og.
I'm not sure if this change (or something similar) makes sense for Wine. I'm fairly certain some changes make sense for GCC (I suspect that GCC should not segfault).
I haven't submitted a bug for GCC because I suspect they'll want me to provide something simpler to compile than the Wine source tree. I certainly won't be upset if someone beats me too it. I'm not sure how much time in the near future I'll spend on it. "Eventually" is probably the word that fits.
At any rate, I wanted to at least share my experiences in case anyone is interested in heading down the same path.
You copy and paste the failing commandline and add --save-temps, like e.g.:
gcc -c -I/home/marcus/projects/wine/dlls/kernel32 -I. -I/home/marcus/projects/wine/include -I../../include -D__WINESRC__ -D_KERNEL32_ -D_NORMALIZE_ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Wstrict-prototypes -Wtype-limits -Wunused-but-set-parameter -Wwrite-strings -gdwarf-2 -gstrict-dwarf -Wpointer-arith -Wlogical-op -I/usr/include/freetype2 -Wall -g -fstack-protector -o console.o /home/marcus/projects/wine/dlls/kernel32/console.c -Og --save-temps
it will generate a console.i file in the currenct directory.
The console.i file and above commandline are a start for the gcc bug.
Ciao, Marcus
On Mon, Apr 15, 2013 at 3:58 PM, Marcus Meissner marcus@jet.franken.dewrote:
On Mon, Apr 15, 2013 at 02:37:27PM -0600, James Eder wrote:
As many of you no doubt know, GCC recently released 4.8.0. This new version introduces a new optimization level enabled by -Og with the following description (from the man page):
"Optimize debugging experience. -Og enables optimizations that do not interfere with debugging. It should be the optimization level of choice
for
the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience."
Of course I had to try it out. I found that building Wine lead to GCC dieing with
... dlls/kernel32/console.c:1691:1: internal compiler error:
Segmentation
fault
I also found
... dlls/kernel32/computername.c:701:1: internal compiler error: Segmentation fault
I eventually stumbled my way into the enclosed patch which lets GCC build Wine with -Og.
I'm not sure if this change (or something similar) makes sense for Wine. I'm fairly certain some changes make sense for GCC (I suspect that GCC should not segfault).
I haven't submitted a bug for GCC because I suspect they'll want me to provide something simpler to compile than the Wine source tree. I certainly won't be upset if someone beats me too it. I'm not sure how
much
time in the near future I'll spend on it. "Eventually" is probably the word that fits.
At any rate, I wanted to at least share my experiences in case anyone is interested in heading down the same path.
You copy and paste the failing commandline and add --save-temps, like e.g.:
gcc -c -I/home/marcus/projects/wine/dlls/kernel32 -I.
-I/home/marcus/projects/wine/include -I../../include -D__WINESRC__ -D_KERNEL32_ -D_NORMALIZE_ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Wstrict-prototypes -Wtype-limits -Wunused-but-set-parameter -Wwrite-strings -gdwarf-2 -gstrict-dwarf -Wpointer-arith -Wlogical-op -I/usr/include/freetype2 -Wall -g -fstack-protector -o console.o /home/marcus/projects/wine/dlls/kernel32/console.c -Og --save-temps
it will generate a console.i file in the currenct directory.
The console.i file and above commandline are a start for the gcc bug.
Ciao, Marcus
Looks like the bug is fixed and should be in for GCC 4.8.1. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56992
On Thu, Apr 18, 2013 at 1:32 AM, James Eder jimportal@gmail.com wrote:
On Mon, Apr 15, 2013 at 3:58 PM, Marcus Meissner marcus@jet.franken.dewrote:
On Mon, Apr 15, 2013 at 02:37:27PM -0600, James Eder wrote:
As many of you no doubt know, GCC recently released 4.8.0. This new version introduces a new optimization level enabled by -Og with the following description (from the man page):
"Optimize debugging experience. -Og enables optimizations that do not interfere with debugging. It should be the optimization level of choice
for
the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience."
Of course I had to try it out. I found that building Wine lead to GCC dieing with
... dlls/kernel32/console.c:1691:1: internal compiler error:
Segmentation
fault
I also found
... dlls/kernel32/computername.c:701:1: internal compiler error: Segmentation fault
I eventually stumbled my way into the enclosed patch which lets GCC
build
Wine with -Og.
I'm not sure if this change (or something similar) makes sense for Wine. I'm fairly certain some changes make sense for GCC (I suspect that GCC should not segfault).
I haven't submitted a bug for GCC because I suspect they'll want me to provide something simpler to compile than the Wine source tree. I certainly won't be upset if someone beats me too it. I'm not sure how
much
time in the near future I'll spend on it. "Eventually" is probably the word that fits.
At any rate, I wanted to at least share my experiences in case anyone is interested in heading down the same path.
You copy and paste the failing commandline and add --save-temps, like e.g.:
gcc -c -I/home/marcus/projects/wine/dlls/kernel32 -I.
-I/home/marcus/projects/wine/include -I../../include -D__WINESRC__ -D_KERNEL32_ -D_NORMALIZE_ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Wstrict-prototypes -Wtype-limits -Wunused-but-set-parameter -Wwrite-strings -gdwarf-2 -gstrict-dwarf -Wpointer-arith -Wlogical-op -I/usr/include/freetype2 -Wall -g -fstack-protector -o console.o /home/marcus/projects/wine/dlls/kernel32/console.c -Og --save-temps
it will generate a console.i file in the currenct directory.
The console.i file and above commandline are a start for the gcc bug.
Ciao, Marcus
Looks like the bug is fixed and should be in for GCC 4.8.1. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56992
-- Jim
FWIW, this is separate from http://bugs.winehq.org/show_bug.cgi?id=33307,
which is still present in gcc trunk (both master and the gcc_48 branch.