Author Topic: Updated GCC Builds  (Read 15091 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Updated GCC Builds
« on: May 02, 2021, 10:43:13 am »
Hi All,

I got a announcement email for GCC 11.1.0 last week, which reminded me I hadn't produced any GCC builds for some time..

Anyhow, with not too many brain cells burned out, I ended up with:

https://smedley.id.au/tmp/gcc-10.3.0-os2-20210502.zip
https://smedley.id.au/tmp/gcc-11.1.0-os2-20210502.zip

Both have been tested only as far as being able to build themselves.

No gccenv.cmd or anything included, it's expected if you want to play with these, you know what you're doing :)

Cheers,

Paul

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Updated GCC Builds
« Reply #1 on: May 02, 2021, 05:24:36 pm »
Tried building FFmpeg with GCC 11.1.0, didn't get too far. I have a trp file but without any debug info or xqs files it is pretty useless. Need at least the map files.
Code: [Select]
Killed by SIGSEGV
pid=0x325d ppid=0x325c tid=0x0001 slot=0x00ea pri=0x0200 mc=0x0001 ps=0x0010
W:\USR\LOCAL111\LIBEXEC\GCC\I686-PC-OS2-EMX\11.1.0\CC1.EXE
CC1 0:010b24e7
cs:eip=005b:010c24e7      ss:esp=0053:0219f540      ebp=0219f598
 ds=0053      es=0053      fs=150b      gs=0000     efl=00010202
eax=2095e208 ebx=fffdffff ecx=00000004 edx=00000000 edi=213a6da0 esi=2039f4e0
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,

BTW, trying to use the script that KOMH posted years ago fails as it doesn't like localxx instead of localxxx. I set things up manually and hopefully didn't screw up.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Updated GCC Builds
« Reply #2 on: May 02, 2021, 07:14:06 pm »
OK, that seemed to be user error, needed to do s/i386//i686/g in my script to set up the environment.
edit: Or maybe not as I ended up with the same crash
« Last Edit: May 02, 2021, 07:15:49 pm by Dave Yeo »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Updated GCC Builds
« Reply #3 on: May 02, 2021, 07:36:43 pm »
10.3.0 succeeded at compiling FFmpeg, I'll have to double check my 11.1.0 install and retest later.

Rob

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Updated GCC Builds
« Reply #4 on: May 03, 2021, 04:20:40 am »
Thanks Paul.  Really cool to see a GCC 11 on here!


I grabbed the 11.1 build and tried to get it to work with cmake, and ran into an error in the "trycompile" phase where cmake introspects the compiler by building things.

Here's how to reproduce it:
https://github.com/wwiv/os2/blob/main/tests/cmake/readme.txt

Hope this helps.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Updated GCC Builds
« Reply #5 on: May 03, 2021, 04:40:29 am »
Thanks Paul.  Really cool to see a GCC 11 on here!


I grabbed the 11.1 build and tried to get it to work with cmake, and ran into an error in the "trycompile" phase where cmake introspects the compiler by building things.

Here's how to reproduce it:
https://github.com/wwiv/os2/blob/main/tests/cmake/readme.txt

Hope this helps.

I tried this, keep getting errors involving the environment. I'm not used to cmake and did try setting these environment variables
Code: [Select]
[K:\work\os2\tests\cmake\_b]cmake --debug-trycompile  ..
debug trycompile on
CMake Error at W:/usr/share/cmake/Modules/CMakeDetermineCCompiler.cmake:49 (mess
age):
  Could not find compiler set in environment variable CC:

  C:\usr\local11\bin\gcc.
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "K:/work/os2/tests/cmake/_b/CMakeFiles/CMakeOutput.log".


Rob

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Updated GCC Builds
« Reply #6 on: May 03, 2021, 04:49:50 am »

I tried this, keep getting errors involving the environment. I'm not used to cmake and did try setting these environment variables


Thanks. Here's what I tried with the cc11.cmd to set CC and CXX (so cmake can find it).  This assumes the GCC 11.1 stayed in \usr\local11

Code: [Select]
set CXX=C:\usr\local11\bin\g++
set CC=C:\usr\local11\bin\gcc

cmake --debug-trycompile  ..
« Last Edit: May 03, 2021, 04:52:09 am by Rob »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Updated GCC Builds
« Reply #7 on: May 03, 2021, 05:01:09 am »
Tried building SeaMonkey with 10.3.0. made it to linking xul.dll where it died with,
Code: [Select]
82:56.24 weakld: error: Unresolved symbol (UNDEF) '__ZN7gfxFont13GetShapedWordIhEEP13gfxShapedWordP10gfxContextPKT_jjibijP18gfxTextPerfMetrics'.
82:56.24 weakld: info: The symbol is referenced by:
82:56.24     Y:\work\cc45-git\obj-sm\gfx\thebes\Unified_cpp_gfx_thebes1.obj
82:56.24 Ignoring unresolved externals reported from weak prelinker.
82:56.24 Error! E2028: __ZN7gfxFont13GetShapedWordIhEEP13gfxShapedWordP10gfxContextPKT_jjibijP18gfxTextPerfMetrics is an undefined reference
82:56.25 file Y:\work\cc45-git\obj-sm\gfx\thebes\Unified_cpp_gfx_thebes1.obj(Y:\work\cc45-git\obj-sm\gfx\thebes\Unified_cpp_gfx_thebes1.cpp): undefined symbol __ZN7gfxFont13GetShapedWordIhEEP13gfxShapedWordP10gfxContextPKT_jjibijP18gfxTextPerfMetrics
82:56.25 make.EXE[4]: *** [xul.dll] Error 1

Gcc 9.2.0 seems to produce and link
Code: [Select]
0001:011aadb0* __ZN7gfxFont13GetShapedWordIhEEP13gfxShapedWordP10gfxContextPKT_jjibijP18gfxTextPerfMetrics$w$JhD8ijzLgS70u5P91

in both
Code: [Select]
\gfx\thebes\Unified_cpp_gfx_thebes0.obj
\gfx\thebes\Unified_cpp_gfx_thebes1.obj

whereas 10.3.0 only has the symbol in thebes0.obj

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Updated GCC Builds
« Reply #8 on: May 03, 2021, 05:09:34 am »

I tried this, keep getting errors involving the environment. I'm not used to cmake and did try setting these environment variables


Thanks. Here's what I tried with the cc11.cmd to set CC and CXX (so cmake can find it).  This assumes the GCC 11.1 stayed in \usr\local11

Code: [Select]
set CXX=C:\usr\local11\bin\g++
set CC=C:\usr\local11\bin\gcc

cmake --debug-trycompile  ..

OK, that works fine. For 11.1.0,
Code: [Select]
[K:\work\os2\tests\cmake\_b]cmake --debug-trycompile ..
debug trycompile on
-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0
-- Check for working C compiler: W:/usr/local11/bin/gcc.exe
-- Check for working C compiler: W:/usr/local11/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: W:/usr/local11/bin/g++.exe
-- Check for working CXX compiler: W:/usr/local11/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: K:/work/os2/tests/cmake/_b

With similar output for 10.3.0. My guess is that you didn't set up your environment correctly. Here's my gcc11env.cmd.
Code: [Select]
set PATH=W:\usr\local11\libexec\gcc\i686-pc-os2-emx\11.1.0;W:\usr\local11\bin;%PATH%
set BEGINLIBPATH=W:\usr\local11\lib;W:\usr\lib;%BEGINLIBPATH%
set LIBPATHSTRICT=T
set C_INCLUDE_PATH=W:/usr/local11/lib/gcc/i686-pc-os2-emx/11.1.0/include;W:/usr/local11/include;W:/usr/include;%C_INCLUDE_PATH%
set CPLUS_INCLUDE_PATH=W:/usr/local11/include/c++/11.1.0;W:/usr/local11/include/c++/11.1.0/i686-pc-os2-emx;W:/usr/local11/include/c++/11.1.0/backward;W:/usr/local11/include;W:/usr/include;%CPLUS_INCLUDE_PATH%
set LIBRARY_PATH=W:/usr/local11/lib/gcc/i686-pc-os2-emx/11.1.0;W:/usr/local11/lib;W:/usr/lib;%LIBRARY_PATH%
edit, fixed gcc11env.
« Last Edit: May 03, 2021, 05:13:51 am by Dave Yeo »

Rob

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Updated GCC Builds
« Reply #9 on: May 03, 2021, 05:26:12 am »
With similar output for 10.3.0. My guess is that you didn't set up your environment correctly. Here's my gcc11env.cmd.

Your guess was spot on.  I missed that step since I didn't need it for the built-in GCC didn't think to setup the environment for 11.  Thanks for the help!

-r

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Updated GCC Builds
« Reply #10 on: May 03, 2021, 10:23:03 am »
Hey Dave,


Tried building FFmpeg with GCC 11.1.0, didn't get too far. I have a trp file but without any debug info or xqs files it is pretty useless. Need at least the map files.
Code: [Select]
Killed by SIGSEGV
pid=0x325d ppid=0x325c tid=0x0001 slot=0x00ea pri=0x0200 mc=0x0001 ps=0x0010
W:\USR\LOCAL111\LIBEXEC\GCC\I686-PC-OS2-EMX\11.1.0\CC1.EXE
CC1 0:010b24e7
cs:eip=005b:010c24e7      ss:esp=0053:0219f540      ebp=0219f598
 ds=0053      es=0053      fs=150b      gs=0000     efl=00010202
eax=2095e208 ebx=fffdffff ecx=00000004 edx=00000000 edi=213a6da0 esi=2039f4e0
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,

BTW, trying to use the script that KOMH posted years ago fails as it doesn't like localxx instead of localxxx. I set things up manually and hopefully didn't screw up.

This is ffmpeg from https://github.com/FFmpeg/FFmpeg? I'll try reproduce/fix when I get a chance....

Cheers,

Paul

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Updated GCC Builds
« Reply #11 on: May 03, 2021, 10:28:31 am »
Hi Dave,

Tried building SeaMonkey with 10.3.0. made it to linking xul.dll where it died with,
Code: [Select]
82:56.24 weakld: error: Unresolved symbol (UNDEF) '__ZN7gfxFont13GetShapedWordIhEEP13gfxShapedWordP10gfxContextPKT_jjibijP18gfxTextPerfMetrics'.
82:56.24 weakld: info: The symbol is referenced by:
82:56.24     Y:\work\cc45-git\obj-sm\gfx\thebes\Unified_cpp_gfx_thebes1.obj
82:56.24 Ignoring unresolved externals reported from weak prelinker.
82:56.24 Error! E2028: __ZN7gfxFont13GetShapedWordIhEEP13gfxShapedWordP10gfxContextPKT_jjibijP18gfxTextPerfMetrics is an undefined reference
82:56.25 file Y:\work\cc45-git\obj-sm\gfx\thebes\Unified_cpp_gfx_thebes1.obj(Y:\work\cc45-git\obj-sm\gfx\thebes\Unified_cpp_gfx_thebes1.cpp): undefined symbol __ZN7gfxFont13GetShapedWordIhEEP13gfxShapedWordP10gfxContextPKT_jjibijP18gfxTextPerfMetrics
82:56.25 make.EXE[4]: *** [xul.dll] Error 1

Gcc 9.2.0 seems to produce and link
Code: [Select]
0001:011aadb0* __ZN7gfxFont13GetShapedWordIhEEP13gfxShapedWordP10gfxContextPKT_jjibijP18gfxTextPerfMetrics$w$JhD8ijzLgS70u5P91

in both
Code: [Select]
\gfx\thebes\Unified_cpp_gfx_thebes0.obj
\gfx\thebes\Unified_cpp_gfx_thebes1.obj

whereas 10.3.0 only has the symbol in thebes0.obj

I guess I'd need to try a local build to work out what's happening. gcc -S output from 9.2.0 and 11.1.0 might be interesting, as would gcc -E output of \gfx\thebes\Unified_cpp_gfx_thebes1.obj - as that might allow me to compile it locally....

Cheers,

Paul

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Updated GCC Builds
« Reply #12 on: May 03, 2021, 11:52:10 am »
Hi Dave,

Tried building FFmpeg with GCC 11.1.0, didn't get too far. I have a trp file but without any debug info or xqs files it is pretty useless. Need at least the map files.
Code: [Select]
Killed by SIGSEGV
pid=0x325d ppid=0x325c tid=0x0001 slot=0x00ea pri=0x0200 mc=0x0001 ps=0x0010
W:\USR\LOCAL111\LIBEXEC\GCC\I686-PC-OS2-EMX\11.1.0\CC1.EXE
CC1 0:010b24e7
cs:eip=005b:010c24e7      ss:esp=0053:0219f540      ebp=0219f598
 ds=0053      es=0053      fs=150b      gs=0000     efl=00010202
eax=2095e208 ebx=fffdffff ecx=00000004 edx=00000000 edi=213a6da0 esi=2039f4e0
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,

BTW, trying to use the script that KOMH posted years ago fails as it doesn't like localxx instead of localxxx. I set things up manually and hopefully didn't screw up.

This is ffmpeg from https://github.com/FFmpeg/FFmpeg? I'll try reproduce/fix when I get a chance....


This is my version of the trap:
Code: [Select]
CC      libavcodec/qpeldsp.o
Creating 7033_01.TRP

Killed by SIGSEGV
pid=0x7033 ppid=0x7032 tid=0x0001 slot=0x00a1 pri=0x0200 mc=0x0001 ps=0x0010
U:\USR\LOCAL11\LIBEXEC\GCC\I686-PC-OS2-EMX\11.1.0\CC1.EXE
CC1 0:00112346
cs:eip=005b:00122346      ss:esp=0053:0219f2e0      ebp=0219f428
 ds=0053      es=0053      fs=150b      gs=0000     efl=00012202
eax=00000001 ebx=00000004 ecx=00000003 edx=200c226c edi=00000004 esi=00000001
Process dumping was disabled, use DUMPPROC / PROCDUMP to enable it.
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
make: *** [libavcodec/qpeldsp.o] Error 4

Will investigate when I get time...

Cheers,

Paul

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Updated GCC Builds
« Reply #13 on: May 03, 2021, 05:29:18 pm »
Yes, it looks similar. I went on to build FFmpeg with 10.3.0 so overwrote my trp.
As for SeaMonkey and 10.3.0, I found this in the log,
Code: [Select]
32:51.04 Y:/work/cc45-git/mozilla/gfx/thebes/gfxFont.h: In constructor 'gfxShapedWord::gfxShapedWord(const uint8_t*, uint32_t, int32_t, int32_t, uint32_t)':
32:51.04 Y:/work/cc45-git/mozilla/gfx/thebes/gfxFont.h:1277:72: warning: 'void*memset(void*, int, size_t)' clearing an object of non-trivial type 'class gfxShapedText::CompressedGlyph'; use assignment or value-initialization instead [-Wclass-memaccess]

So I added -Wclass-memaccess to CXXFLAGS (actually the optimize parameter) and that fixed the missing symbol.
Now the compile dies while linking xul.dll with a Python OSError (Errno 22), which I believe is a failure to pass the list file to emxomfld. We're linking over a 1000 object files.
Had the same or similar problem with GCC 9.2.0 and I worked around by creating my own list(response) file and manually calling emxomfld until Dmitriy fixed it sometime later.
IIRC, the problem with 9.2.0 was actually nested response files and was one of the last fixes for 9.2.0

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Updated GCC Builds
« Reply #14 on: May 03, 2021, 08:44:07 pm »
Ok, more investigation into the SM linking issue. I rebuilt with GCC 9.9.2 and then compared the linking between 9.9.2 and 10.3.0. As far as I can make out, the difference is 9.9.2 just passes the list file to the linker while 10.3.0 passes the list file and the list of obj files to the linker, which pukes on such a long command line. The list files produced by both the compilers are identical at 53777 bytes and 1204 lines (obj and lib files).
I'll attach the xul build logs from both, both done after a make clean.
edit: added list file with txt extension for completeness
« Last Edit: May 03, 2021, 08:53:22 pm by Dave Yeo »