0

We have a Solaris 11 system with gcc 7.3, we need to install the Ada package. On Linux gcc 7 came with the Ada/GNAT as part of the gcc install:

 apt install gcc

I visited AdaCore looks like Solaris (SPARC) is not longer on the list. I need to use Ada95 and we want the same compiler on both Linux and Solaris in any case.

pkg install gcc

Only installed various C++ commands and Fortran.

pkg install gcc-ada

And variants like gcc7ada, found nothing to install.

If must, we can rebuild the Ada component of GCC 7, however I haven't found a clear cood-book style "How To ..."for that (yet).

Hopefully you can point me to these items in order of preference to help us get back-on-track.

  1. Solaris 11 gcc-ada package for gcc7/Solaris 11 spark, and the package repository.
  2. An 'alternative' package repository were I can retrieve the GCC Ada tooling.
  3. Pre-build GCC 7 Ada module that we can copy to the right places.
  4. Ready-rolled Build Ada/GNAT project for Solaris and how to download and get start building.
  5. Instructions to download and build gcc-ada with gcc 7 on Solaris (or Unix).

From th epast few days searching about on Gnu Compiler Collection, Oracle, the package manager searches, google and so forth ... It really seems like there's next to no support for CGG Ada on Solaris these days.

I very interested in other solutions beyond that list. For instance, has anyone cross-compiled from Linux to Solaris? Would that work with GDB on the Solaris machine anyway?

Looking forward to your suggestions.

will
  • 4,799
  • 8
  • 54
  • 90

2 Answers2

1

Please note that I don't know much about Solaris, but a quick search on Google gave me the website OpenCSW. This website provides the packages gcc4ada and gcc5ada.

It appears that gcc5ada is build using a makefile (as found here, in particular notice line 424). A similar makefile exists for gcc7ada (as found here, in particular notice line 426). However, while it seems that the package "gcc7ada" can be created with the latter makefile, it is not published on the OpenCSW.org website (website is no longer updated?).

You could try to install gcc5ada first and then use this old GCC/GNAT compiler as a bootstrapper for compiling the required version (using the GCC 7 makefile).

DeeDee
  • 5,654
  • 7
  • 14
  • Yes, thank you @DeeDee -- I am looking for GCC v7 (or 8) Ada build. I found those older versions a while back. In looking at that package makefile, Does GCC require Ada to build Ada, I didn't see the makefile calling up gnat or gnatmake(???). – will Sep 03 '19 at 02:25
  • Yes, you need a working compiler. See also “Building the Ada compiler” on [this](https://gcc.gnu.org/install/build.html) page. GNAT itself (the front-end) is written in Ada. – DeeDee Sep 03 '19 at 05:52
  • I had a quick look but also could not locate the line where the GCC build is actually initiated. However, these Makefiles are part of a complete build system. If you consider proceeding in this direction, then you might want to ask a new question on SO specifically on how to use a Makefile from the GAR Solaris Package Build System to build packages from sources. – DeeDee Sep 03 '19 at 06:10
1

I've successfully built gcc 7.50 (x86_64 native with i386 cross-compiler) with GNAT on OpenIndiana (Hipster 2020/10) using the following procedure.

  1. Download the bootstrap compiler from Dragonlace at http://downloads.dragonlace.net/src/ada-bootstrap.x86_64.solaris.511.tar.bz2

  2. Get the illumos gcc 7.5.0 source from https://github.com/illumos/gcc/tree/il-7_5_0

  3. Put the bootstrap compiler's bin directory at the front of $PATH, replace /usr/bin/gcc /usr/bin/cpp /usr/bin/g++ with symlinks to their counterparts in the bootstrap compiler directory (see note below re g++ and c++)

  4. Make sure you've got gnu-binutils and gmake; then run contrib/download_prerequisites

  5. Configure with --enable-languages='c ada c++' --build=x86_64-aux-solaris2.11 --enable-threads=posix --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-nls --disable-shared --disable-lto --disable-libstdcxx-pch --enable-multilib --with-gnu-as --with-as=/usr/bin/gas --without-gnu-ld --with-ld=/usr/bin/ld

  6. gmake and then gmake install

NOTES: This setup should be close enough to Solaris 11 to work. If it doesn't, try using the regular gcc 7.5.0 release rather than the illumos-modified branch.

If you get stuck at a linking stage, try using a gcc ld, but you should definitely try to use the Solaris ld first. The gnu as (gas) makes the build go much more smoothly. I didn't have any problems, but if you get stuck at the end of stage 1 or the beginning of stage 2, try setting $CONFIG_SHELL=/usr/bin/ksh -- I think it has been fixed, but at least with older gcc releases one needed to specify ksh because the built-in sh had some non-POSIX peculiarities that didn't work with some of the components' makefiles

I couldn't get one of the support libs for gnat to compile easily without building gcc c++ and using g++ with a full bootstrap. You might be able to figure it out, but the path of least resistance is likely to build gcc c++ and put the g++ symlink in /usr/bin, which is where the makefile wanted to find it.

Dharman
  • 30,962
  • 25
  • 85
  • 135
ds_j2
  • 98
  • 3