Author Topic: Test build of GCC 4.7.3 available  (Read 35001 times)

Andy Willis

  • Sr. Member
  • ****
  • Posts: 292
  • Karma: +7/-0
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #15 on: September 08, 2013, 03:14:23 am »
Thank you...
Built nasm, glibidl, and mzftcfg and used these to build Seamonkey (esr10 build) with 4.7.3 and binutils 2.23... posting from said Seamonkey now.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #16 on: September 08, 2013, 04:28:58 am »
fate tests fail here with:
Test eval failed. Look at tests/data/fate/eval.err for details.

http://smedley.id.au/tmp/eval.err

That'll be the FPU exception bug where the Presentation Manager re-enables FPU exceptions without saving state and restoring state, my V4+free updates install doesn't have it.
Easiest fix is to add
 
Code: [Select]
#ifdef __i386
    short fcr;
    __asm__ volatile ("fstcw        %0 \n"
                      "or      $63, %0 \n"
                      "fldcw        %0 \n"
                      : "=m"(fcr));
#endif
or from Cairo,
Code: [Select]
static inline void
DisableFPUException (void)
{
    unsigned short usCW;

    /* Some OS/2 PM API calls modify the FPU Control Word,
     * but forget to restore it.
     *
     * This can result in XCPT_FLOAT_INVALID_OPCODE exceptions,
     * so to be sure, we disable Invalid Opcode FPU exception
     * before using FPU stuffs.
     */
    usCW = _control87 (0, 0);
    usCW = usCW | EM_INVALID | 0x80;
    _control87 (usCW, MCW_EM | 0x80);
}
after main() in all executables.
Plan9 has a similar bug and there is an alternative main() in compat/plan9/main.c where main() is undefined and replaced but I never could get it to work on OS/2, multiple symbol errors, I guess it would be needed to be added to crt0.obj and perhaps used with another flag much like -Zbin-args.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #17 on: September 08, 2013, 01:05:00 pm »
fate tests fail here with:
Test eval failed. Look at tests/data/fate/eval.err for details.

http://smedley.id.au/tmp/eval.err

That'll be the FPU exception bug where the Presentation Manager re-enables FPU exceptions without saving state and restoring state, my V4+free updates install doesn't have it.
Easiest fix is to add

OK will try it tomorrow - too many beers tonight - had an engagement party this afternoon :)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #18 on: November 09, 2013, 09:51:21 am »
GCC 4.7.x is likely to be the last release of GCC I will build, as with GCC 4.8.x they moved to a C++ implementation for the compiler, so the patches would need to be completely rewritten for GCC 4.8.  Based on the levels of interest in the OS and developer tools....... I will continue to investigate bugs in this and other GCC releases I've done, as well as bump the version for any further GCC minor releases (ie GCC 4.7.4)

Seems I was wrong about GCC 4.8.x

I downloaded the sources this evening and applied the 4.7.3 patches fairly cleanly. Now will see if it builds....

mickhead

  • Guest
Re: Test build of GCC 4.7.3 available
« Reply #19 on: November 10, 2013, 11:38:16 pm »
That's good news, indeed  :)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #20 on: November 11, 2013, 12:03:27 pm »
4.8.2 is built, however it currently has issues compiling apps that use API's declaring using _System - ie most/all OS/2 api's declared in os2emx.h.

dllexport is not (yet) tested.  Will try get this sorted out in the next week or so, but running short on spare time recently....

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #21 on: November 20, 2013, 11:11:15 am »
4.8.2 is built, however it currently has issues compiling apps that use API's declaring using _System - ie most/all OS/2 api's declared in os2emx.h.

dllexport is not (yet) tested.  Will try get this sorted out in the next week or so, but running short on spare time recently....

GCC 4.8.2 seems to be working pretty well now :) Qt4 builds ok and seems to work, trying to build Firefox 17 with it now.  Those two are pretty robust c++ test cases :)

Alex Taylor

  • Sr. Member
  • ****
  • Posts: 387
  • Karma: +5/-0
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #22 on: November 21, 2013, 10:04:01 am »
GCC 4.8.2 seems to be working pretty well now :) Qt4 builds ok and seems to work, trying to build Firefox 17 with it now.  Those two are pretty robust c++ test cases :)

That's great news! Thanks for all the amazing work, Paul!

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #23 on: December 14, 2013, 09:20:24 am »
GCC 4.8.2 seems to be working pretty well now :) Qt4 builds ok and seems to work, trying to build Firefox 17 with it now.  Those two are pretty robust c++ test cases :)

That's great news! Thanks for all the amazing work, Paul!

GCC 4.8.2 binaries now at http://os2ports.smedley.id.au

I'll get the source up at github when i get a spare afternoon

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #24 on: December 21, 2013, 06:58:39 am »

GCC 4.8.2 binaries now at http://os2ports.smedley.id.au

I'll get the source up at github when i get a spare afternoon

Finally tested the C part by running the FFmpeg FATE suit which consists of about 2000 tests.  http://ffmpeg.org/fate.html.
While GCC 4.4.6 usually passes all tests (I get failures on 2 HEVC (H265) compliance tests after a few days of up time, see http://fate.ffmpeg.org/history.cgi?slot=x86.os2.446 and for comparison fate.ffmpeg.org), 4.8.2 failed between 24 and 30 tests and ffmpeg.exe and especially ffprobe.exe froze multiple times forcing me to kill them. There's still something wrong, I'd guess alignment issues.
If you want to test, you need to configure with cpu=i486 or higher to pull in the GCC atomics (could they be broken?) and I'll attach a patch for eCS to work around the buggy PMSHELL. Note this also tests your environment as things like diff not supporting stdin or a bad bc will cause falures. Need to use [k]sh to run configure as well due to buggy ash (doesn't set CWD).
Anyways thanks for the great work and I wish I knew how to debug some of this stuff.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #25 on: December 22, 2013, 09:28:25 am »

GCC 4.8.2 binaries now at http://os2ports.smedley.id.au

I'll get the source up at github when i get a spare afternoon

Finally tested the C part by running the FFmpeg FATE suit which consists of about 2000 tests.  http://ffmpeg.org/fate.html.
While GCC 4.4.6 usually passes all tests (I get failures on 2 HEVC (H265) compliance tests after a few days of up time, see http://fate.ffmpeg.org/history.cgi?slot=x86.os2.446 and for comparison fate.ffmpeg.org), 4.8.2 failed between 24 and 30 tests and ffmpeg.exe and especially ffprobe.exe froze multiple times forcing me to kill them. There's still something wrong, I'd guess alignment issues.
If you want to test, you need to configure with cpu=i486 or higher to pull in the GCC atomics (could they be broken?) and I'll attach a patch for eCS to work around the buggy PMSHELL. Note this also tests your environment as things like diff not supporting stdin or a bad bc will cause falures. Need to use [k]sh to run configure as well due to buggy ash (doesn't set CWD).
Anyways thanks for the great work and I wish I knew how to debug some of this stuff.

Hi Dave - were you able to test with 4.7.3 at al? I'm curious when the regression started as it may help in the debugging.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #26 on: December 23, 2013, 03:37:50 am »

Hi Dave - were you able to test with 4.7.3 at al? I'm curious when the regression started as it may help in the debugging.

Hi Paul, tested 4.7.3 and had similar results.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #27 on: December 29, 2013, 11:27:37 pm »

Hi Dave - were you able to test with 4.7.3 at al? I'm curious when the regression started as it may help in the debugging.

Hi Paul, tested 4.7.3 and had similar results.

I will have to get this replicated locally when step through 4.4.6 -> 4.5.4 -> 4.6.x -> 4.7.x and see where the failed tests started from

Another one for the todo list

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #28 on: December 30, 2013, 10:00:34 am »
fate tests fail here with:
Test eval failed. Look at tests/data/fate/eval.err for details.

http://smedley.id.au/tmp/eval.err

That'll be the FPU exception bug where the Presentation Manager re-enables FPU exceptions without saving state and restoring state, my V4+free updates install doesn't have it.
Easiest fix is to add
 
Code: [Select]
#ifdef __i386
    short fcr;
    __asm__ volatile ("fstcw        %0 \n"
                      "or      $63, %0 \n"
                      "fldcw        %0 \n"
                      : "=m"(fcr));
#endif
or from Cairo,
Code: [Select]
static inline void
DisableFPUException (void)
{
    unsigned short usCW;

    /* Some OS/2 PM API calls modify the FPU Control Word,
     * but forget to restore it.
     *
     * This can result in XCPT_FLOAT_INVALID_OPCODE exceptions,
     * so to be sure, we disable Invalid Opcode FPU exception
     * before using FPU stuffs.
     */
    usCW = _control87 (0, 0);
    usCW = usCW | EM_INVALID | 0x80;
    _control87 (usCW, MCW_EM | 0x80);
}
after main() in all executables.
Plan9 has a similar bug and there is an alternative main() in compat/plan9/main.c where main() is undefined and replaced but I never could get it to work on OS/2, multiple symbol errors, I guess it would be needed to be added to crt0.obj and perhaps used with another flag much like -Zbin-args.

Don't suppose you have a diff with this already in place? I don't fancy modifying multiple source files due to time constraints...

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Test build of GCC 4.7.3 available
« Reply #29 on: December 30, 2013, 05:19:49 pm »
Don't suppose you have a diff with this already in place? I don't fancy modifying multiple source files due to time constraints...

I posted a patch here on the 21st. Here it is again freshly rebased. If you have problems with git, eg complaining about not being able to merge when pulling or cloning try
git fetch --force && git reset --hard origin/master
BTW I tested 4.5.4 and had the same failures even with optimizations turned off. Just tried 3.3.5, had to use pthreads as GCC is too old to have atomics and disable sse and mmx but it actually passed. I'll do some more experimenting later today.