Author Topic: Which GCC to run with?  (Read 6991 times)

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1129
  • Karma: +24/-0
    • View Profile
Which GCC to run with?
« on: December 04, 2017, 09:43:06 pm »
Alright...so I never thought I'd have this kind of a problem on our platform: too many versions to pick from!!!

My goal is to be able to build a CPU-family specific version of Firefox. I see that current builds are using 4.9.2 GCC. In the meantime, Paul on his Unix ports page lists a whole whack of GCC versions...right up to 7.1.

As it pertains to our platform, can anyone give me a run-down of why one should build FF with 4.9.2 where (presumably) a better version like 7.1 is available?

FYI, I reviewed the published Change Information, as per the ULRs below:

1) 4=>5 https://gcc.gnu.org/gcc-5/changes.html
2) 5=>6 https://gcc.gnu.org/gcc-6/changes.html
3) 6=>7 https://gcc.gnu.org/gcc-7/changes.html

...but really, unless you know this stuff very well (and I do not), it's hard to make sense of it all.

So does it all come down to something as simple as libstdc++ & libstdc++6 being only available in 4.x level (through official RPM/YUM)? This question only pertains to software that one might produce using GCC7 and distribute w/o the runtime libraries. But if I was to build an optimized version for my local use only, would it not make sense to build using GCC7 and utilize as many of the fixes as have been accumulated since 4.9x?

I realize FF is complex piece of work, but before I blindly jump into this, spending I'm sure a pile of time to get this working, I'd like to better understand some of the fundamental decisions and their impacts.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 3627
  • Karma: +77/-0
    • View Profile
Re: Which GCC to run with?
« Reply #1 on: December 04, 2017, 11:58:51 pm »
Well currently 4.9.2 is the only version that will build Firefox. I did build 45.5 with 5.10 and it worked much the same as 4.9.2 but now the build dies with some unresolved symbols. Seems configure missed something but I haven't got around to tracking it down.
Newer GCC's had all kinds of errors, discussed here in one of the GCC threads, but now I can't find it, probably lost due to the crash.
Anyways you're best starting with the supported environment, getting it actually compiling and then experimenting with other versions of GCC etc.
You should also review the discussion in the how to build SeaMonkey thread (all Mozilla apps basically build the same way) as we rehashed various things I forget and/or dmik hadn't posted.
http://www.os2world.com/forum/index.php/topic,1421.0.html

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1129
  • Karma: +24/-0
    • View Profile
Re: Which GCC to run with?
« Reply #2 on: December 05, 2017, 03:52:23 pm »
Hi Dave!

Well currently 4.9.2 is the only version that will build Firefox...

That is probably the key point, I suspect 3/4 of the challenge will be for me to re-create the whole environment to be able to just build the darn thing in the first place.

...You should also review the discussion in the how to build SeaMonkey thread (all Mozilla apps basically build the same way) as we rehashed various things I forget and/or dmik hadn't posted.
http://www.os2world.com/forum/index.php/topic,1421.0.html

Yup, I had actually bookmarked that thread when it was current given the content and the details, time to start re-reading and digesting.

Alright, thank you.

Any other final pieces of advice? My next step would be to install the RPM/YUM gcc stuff, namely the following packages:

1) gcc
2) gcc-debug
3) gcc-stdc++shared-library
4) gcc-supc++shared-library

Again, this is just regarding what's needed to have a working generic GCC 4.9.2 system.

Thanks,
 -Dariusz

Paul Smedley

  • Hero Member
  • *****
  • Posts: 1000
  • Karma: +94/-0
    • View Profile
Re: Which GCC to run with?
« Reply #3 on: December 18, 2017, 09:08:38 am »
FWIW - a build of GCC 7.2.0 is available - http://smedley.id.au/tmp/gcc-7.2.0-os2-20171216.zip

TeLLie

  • Full Member
  • ***
  • Posts: 128
  • Karma: +3/-0
    • View Profile
Re: Which GCC to run with?
« Reply #4 on: December 18, 2017, 05:16:11 pm »
FWIW - a build of GCC 7.2.0 is available - http://smedley.id.au/tmp/gcc-7.2.0-os2-20171216.zip

Hi Paul,
As always thank you for the new build...

Paul Smedley

  • Hero Member
  • *****
  • Posts: 1000
  • Karma: +94/-0
    • View Profile
Re: Which GCC to run with?
« Reply #5 on: May 06, 2018, 12:54:21 am »
GCC 7.3.0: http://smedley.id.au/tmp/gcc-7.3.0-os2-20180126.zip
GCC 8.1.0: http://smedley.id.au/tmp/gcc-8.1.0-os2-20180505.zip

GCC 7.3.0 has already been tested by several people, 8.1.0 I only built yesterday - I've used it to self build GCC, as well as build apache2 and the necessary Samba 4.8.1 libs for Netdrive.

TeLLie

  • Full Member
  • ***
  • Posts: 128
  • Karma: +3/-0
    • View Profile
Re: Which GCC to run with?
« Reply #6 on: May 06, 2018, 10:17:09 am »
Hi Paul,
I tested v8.1.0 on several progs with Qmake, cmake and make so far all worked ok :)

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1129
  • Karma: +24/-0
    • View Profile
Re: Which GCC to run with?
« Reply #7 on: May 10, 2018, 03:24:00 pm »
Hi Paul,

GCC 7.3.0: http://smedley.id.au/tmp/gcc-7.3.0-os2-20180126.zip
GCC 8.1.0: http://smedley.id.au/tmp/gcc-8.1.0-os2-20180505.zip
...

Is there a general reference for our OS/2 platform on how to setup multiple GCC environments?

I would love to try the 8.1.0 build, but right now I have the RPM/YUM driven 4.9.2 setup in place and quite frankly, I am dreading tossing something else on "top" of it given how problematic it was to just get the 4.9.2 stuff working (for many reasons, some driven by the fact that I have multiple C/C++ compiler toolsets installed on my box here).

Can I follow the widely available on-line walk-throughs of getting this set up? Most of these are really Unix/Linux based...

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1129
  • Karma: +24/-0
    • View Profile
Re: Which GCC to run with?
« Reply #8 on: March 20, 2019, 03:03:52 am »
Bringing this one back from the 'dead', can anyone suggest on how to configure our install to support multiple GCC versions?

Specifically, I am getting myself re-acquainted with C/C++ and wanted to focus on the latest 8.10 release that Paul built last year...but looking at his release I see '/usr/local810/bin/...' which doesn't seem to follow the often encountered on-line references to doing things like:

1) default (4.9.2) GCC /usr/bin/gcc
2) optional versions (8.1.0) /usr/bin/gcc/810
3) additional versions (7.3.0) /usr/bin/gcc/730

I do have the RPM/YUM GCC stuff installed right now, that being the 4.92 version. This works fine.

I assume that the only way to invoke one or the other GCC version on our platform is by playing around with the various GCC & PATH env variables so that only that particular version of GCC is visible.

In my searches I found that update-alternatives is oftentimes used on the Linux platforms to accomplish this type of a switch, however that (if I understand it correctly) relies on symbolic links, which I am not sure our ported stuff supports (I think it does, but not at all sure how to check this). Either way, even with the support being there that package would need to be ported first, I am currently looking at the C code. So maybe that's a longer term strategy?

But, from an immediate perspective, how have you guys gone about this?

Andy Willis

  • Full Member
  • ***
  • Posts: 235
  • Karma: +2/-0
    • View Profile
Re: Which GCC to run with?
« Reply #9 on: March 20, 2019, 03:48:05 am »
I use the rpm installed gcc as the base and install the 8.1.0 in a location other than under \usr but it should be fairly easy to update this as needed:

Code: [Select]
SET GCCVER=8.1.0
SET GVER=810
SET GCCDIR=e:\compilers\gcc440\local%GVER%
SET GCCDIR2=e:/compilers/gcc440/local%GVER%
SET GCCMAIN=e:
set GCCBASE=e:/usr
set USRBASE=e:/usr

SET PATH=%GCCDIR%\bin;%GCCDIR%\libexec\gcc\i386-pc-os2-emx\%GCCVER%;%PATH%
SET BEGINLIBPATH=%GCCDIR%\lib;%BEGINLIBPATH%

SET C_INCLUDE_PATH=%GCCDIR2%/lib/gcc/i386-pc-os2-emx/%GCCVER%/include;%GCCDIR2%/include;%USRBASE%/local/include;%GCCBASE%/include;
SET CPLUS_INCLUDE_PATH=%GCCDIR2%/include/c++/%GCCVER%;%GCCDIR2%/include/c++/%GCCVER%/i386-pc-os2-emx;%GCCDIR2%/lib/gcc/i386-pc-os2-emx/%GCCVER%/include;%USRBASE%/local/include;%GCCBASE%/include;
SET CPLUS_INCLUDE_PATH=%CPLUS_INCLUDE_PATH%;%GCCDIR2%/include;%GCCDIR2%/include/c++/backward;%GCCDIR2%/include/c++/%GCCVER%;%GCCDIR2%/include/c++/%GCCVER%/tr1;%GCCBASE%/include;

SET LIBRARY_PATH=%GCCDIR2%/lib/gcc/i386-pc-os2-emx/%GCCVER%;%GCCDIR2%/lib;%GCCDIR2%/lib/gcc/i386-pc-os2-emx/%GCCVER%;%USRBASE%/local/lib;%GCCBASE%/lib;

SET LIB=%LIBRARY_PATH%
« Last Edit: March 20, 2019, 04:02:33 am by Andy Willis »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 3627
  • Karma: +77/-0
    • View Profile
Re: Which GCC to run with?
« Reply #10 on: March 20, 2019, 04:25:52 am »
I install into \usr\localxxx where xxx is the version, so \usr\local810 in your case. Then modify a version of gccenv.cmd renamed to gccxxxenv.cmd (same xxx as in the above) that KOMH posted many years ago and put it on the PATH. I'll attach, just modify line 74, like so for 810, and rename.
Code: [Select]
--- gcc710env.cmd       2018-11-26 17:03:40.000000000 -0800
+++ gcc810env.cmd       2019-03-19 20:21:30.000000000 -0700
@@ -71,7 +71,7 @@
 do
     sLinker = 'WLINK';
 end
-call GCC322plus sPath, 'gcc710', 0, sLinker;
+call GCC322plus sPath, 'gcc810', 0, sLinker;
 exit 0;
Also patched to use wlink.

Be aware there seems to be a bug where newer GCC's pick up the stdc++ library in \usr\lib, I move the import libs and static lib out of the way.

Edit, actually I meant that the cmd file goes in \usr\bin
« Last Edit: March 20, 2019, 06:44:41 am by Dave Yeo »

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1129
  • Karma: +24/-0
    • View Profile
Re: Which GCC to run with?
« Reply #11 on: March 23, 2019, 11:00:14 pm »
Alright, thanks you guys.

This is very similar to the approach I have taken in setting up my default GCC environment. In my case I use VisualSlickEdit to define 'Project' templates which include everything needed to Compile/Build/Re-Build projects. So even for a default system-wide 4.9.2 installation I do end up setting up all the environments and commands to properly run stuff. That way if I kick off any of the steps from within VSE it knows precisely what to do.

In this case once I install 8.1.0 I will build a matching VSE GCC-810 project definition.

Thank you again!

Paul Smedley

  • Hero Member
  • *****
  • Posts: 1000
  • Karma: +94/-0
    • View Profile
Re: Which GCC to run with?
« Reply #12 on: March 24, 2019, 02:58:17 am »
There's also GCC 8.2.0 at http://smedley.id.au/tmp/gcc-8.2.0-os2-20180805.zip - and I should build 8.3.0

Paul Smedley

  • Hero Member
  • *****
  • Posts: 1000
  • Karma: +94/-0
    • View Profile
Re: Which GCC to run with?
« Reply #13 on: March 24, 2019, 11:20:34 pm »
GCC 8.3.0 is built, I'll try and remember to make a link available this evening.

edit: http://smedley.id.au/tmp/gcc-8.3.0-os2-20190324.zip
« Last Edit: March 25, 2019, 08:52:33 am by Paul Smedley »