gcc on Solaris - SUN

This is a discussion on gcc on Solaris - SUN ; Hi all, I'm wanting to test a program for its portability, but i find that there are no decent packages of gcc for Solaris. The page that's linked to from the gcc homepage doesn't even provide 4.x packages. Are there ...

+ Reply to Thread
Results 1 to 12 of 12

Thread: gcc on Solaris

  1. gcc on Solaris

    Hi all,

    I'm wanting to test a program for its portability, but i find that
    there are no decent packages of gcc for Solaris. The page that's
    linked to from the gcc homepage doesn't even provide 4.x packages.
    Are there maybe instructions on building gcc on solaris right? Most of
    what i've seen and tried suffered from screwy paths so that libs were
    not found, or headers or things like that.

    I'm really wanting to have a "reference" installation of each gcc 3.x
    and 4.x so I can make decent statements about the portability.

    TIA,
    ~Mik


  2. Re: gcc on Solaris

    Michael BŁker wrote:
    > Hi all,
    >
    > I'm wanting to test a program for its portability, but i find that
    > there are no decent packages of gcc for Solaris. The page that's
    > linked to from the gcc homepage doesn't even provide 4.x packages.
    > Are there maybe instructions on building gcc on solaris right? Most of
    > what i've seen and tried suffered from screwy paths so that libs were
    > not found, or headers or things like that.


    Give it a better try. All versions of gcc are available one way or the
    other. I've built gcc on SunOS since the early 90's and it's really
    easy. It was actually the development platform once.

    Blastwave.org has 2.95.3, 3.4.5, and 4.0.2 versions today.

    > I'm really wanting to have a "reference" installation of each gcc 3.x
    > and 4.x so I can make decent statements about the portability.


    ? That would be a lot of versions...

  3. Re: gcc on Solaris

    On Oct 27, 1:04 pm, "Thommy M." wrote:
    > Michael BŁker wrote:
    > > Most of what i've seen and tried suffered from screwy paths so that
    > > libs were not found, or headers or things like that.

    >
    > Give it a better try. All versions of gcc are available one way or the
    > other. I've built gcc on SunOS since the early 90's and it's really
    > easy. It was actually the development platform once.


    I'd appreciate some pointers to help or docs about how to do that. I'm
    willing to compile gcc myself if that's possible, although that would
    be a lenghty excercise at best, given the speed of my Sun

    > Blastwave.org has 2.95.3, 3.4.5, and 4.0.2 versions today.


    Thanks very much for the hint, I'll check those out.

    > > I'm really wanting to have a "reference" installation of each gcc 3.x
    > > and 4.x so I can make decent statements about the portability.

    >
    > ? That would be a lot of versions...


    I really only meant the latest versions of each tree

    ~Mik


  4. Re: gcc on Solaris

    Michael BŁker wrote:
    > Hi all,
    >
    > I'm wanting to test a program for its portability, but i find that
    > there are no decent packages of gcc for Solaris. The page that's
    > linked to from the gcc homepage doesn't even provide 4.x packages.
    > Are there maybe instructions on building gcc on solaris right? Most of
    > what i've seen and tried suffered from screwy paths so that libs were
    > not found, or headers or things like that.
    >
    > I'm really wanting to have a "reference" installation of each gcc 3.x
    > and 4.x so I can make decent statements about the portability.
    >
    > TIA,
    > ~Mik
    >

    As others have said, you can get gcc pre-built on Solaris easily.

    For portability, it is far more of a challenge to make code work on
    different operating systems + hardware than it is on different versions
    of gcc. One program of mine:

    http://atlc.sourceforge.net/

    has been run on a Sony Playstation and a Cray supercomputer. It has also
    been tested on Debian Linux, Slackware Linux, Gentoo Linux, Redhat
    Linux, Suse Linux, IBM's AIX, Apples's OS X for Mac, HP's HP-UX (both
    PA-RISC and Itanium), SGI's IRIX, Sun's Solaris, SCO's UNIXWare, HP's
    Tru64, Cray's UNICOS, NetBSD, OpenBSD and FreeBSD.


    The Cray was quite a challange, due to the fact

    sizeof(short)==8

    It's those annoyances that cause far more problems than differences in
    gcc versions.

    I've also found it is quite easy to write code that works with one
    compiler but not another. The autoconf/automake can be really helpful to
    write portable code on UNIX systems.

  5. Re: gcc on Solaris

    In <1193480782.950880.18050@d55g2000hsg.googlegroups.c om> =?iso-8859-1?q?Michael_B=FCker?= writes:

    >I'm wanting to test a program for its portability, but i find that
    >there are no decent packages of gcc for Solaris.


    It's not portable if you're using gcc everywhere.

    >The page that's
    >linked to from the gcc homepage doesn't even provide 4.x packages.
    >Are there maybe instructions on building gcc on solaris right? Most of
    >what i've seen and tried suffered from screwy paths so that libs were
    >not found, or headers or things like that.


    There's this one on Solaris 10:

    $ whence gcc
    /usr/sfw/bin/gcc
    $ gcc -v
    Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/specs
    Configured with: /gates/sfw10/builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --enable-shared
    Thread model: posix
    gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)

    --
    -Gary Mills- -Unix Support- -U of M Academic Computing and Networking-

  6. Re: gcc on Solaris

    Michael BŁker wrote:

    > I'd appreciate some pointers to help or docs about how to do that. I'm
    > willing to compile gcc myself if that's possible, although that would
    > be a lenghty excercise at best, given the speed of my Sun


    Usually, I don't compile programs if there is package, but yesterday I
    had to compile new mplayer. It is PITA. GNU C "standard" and bunch of
    ASM code. Old /usr/sfw/bin/gcc was not suitable for getting stable final
    binary. So, today I have compiled gcc 4.2.1 and installed in /opt/gcc4,
    and then finally compiled mplayer with it.

    Hints: download, compile and install libiconv. Gcc 4 needs it, but
    configure script doesn't detect this.

    This was my compile environment:

    CC=/usr/sfw/bin/gcc
    CXX=/usr/sfw/bin/g++
    LDFLAGS="-R/opt/gcc4/2.1/lib"
    CONFIG_SHELL=/usr/bin/bash

    ../configure --prefix=/opt/gcc4/2.1 \
    --mandir=/opt/gcc4/2.1/share/man \
    --infodir=/opt/gcc4/2.1/share/info \
    --sysconfdir=/etc/opt/gcc4/2.1 --with-gnu-as \
    --with-as=/usr/sfw/bin/gas --without-gnu-ld \
    --with-ld=/usr/ccs/bin/ld \
    --disable-nls --enable-languages=c,c++

    gmake

    Even if you have stronger machine - go someware; in caffe bar, nature,
    long walk ... compile process can do it without you watching it on the
    screen.


    --
    Miroslav

  7. Re: gcc on Solaris

    ["Followup-To:" header set to comp.unix.solaris.]
    On Sat, 27 Oct 2007 03:26:22 -0700, Michael BŁker wrote:
    > Hi all,
    >
    > I'm wanting to test a program for its portability, but i find that
    > there are no decent packages of gcc for Solaris. The page that's


    How hard did you look? Your hard disk, and web sites like sunfreeware and
    blastwave? Doesn't seem like you did!

    GCC is not too strict at enforcing the C and C++ standards. It also adds
    lots of extensions (some of which are available with other compilers).
    If you want have maximum portability with GCC, then you'll also need to
    use GNU binutils. My experience on Solaris is that this means making a
    big sacrifice in performance and features.

    A bientot
    Paul


  8. Re: gcc on Solaris

    In Miroslav Zubcic writes:

    >Michael BŁker wrote:


    >> I'd appreciate some pointers to help or docs about how to do that. I'm
    >> willing to compile gcc myself if that's possible, although that would
    >> be a lenghty excercise at best, given the speed of my Sun


    >Hints: download, compile and install libiconv. Gcc 4 needs it, but
    >configure script doesn't detect this.


    You don't need libiconv. All of the functions are already present
    in libc. I suppose Solaris should ship with an empty libiconv to
    make this clear.

    --
    -Gary Mills- -Unix Support- -U of M Academic Computing and Networking-

  9. Re: gcc on Solaris

    [Gary Mills]:
    >
    > You don't need libiconv. All of the functions are already present
    > in libc. I suppose Solaris should ship with an empty libiconv to
    > make this clear.


    I think that's a great idea. please file a RFE :-)

    --
    Kjetil T.

  10. Re: gcc on Solaris

    Gary Mills wrote:

    > You don't need libiconv.


    In theory, you are right, but gcc 4.2.1 build process barks on me if it
    doesn't find it together with header file.

    $ ldd /opt/gcc4/2.1/bin/gcc
    libiconv.so.2 => /opt/gcc4/2.1/lib/libiconv.so.2
    libc.so.1 => /lib/libc.so.1
    libgcc_s.so.1 => /usr/sfw/lib/libgcc_s.so.1
    libm.so.2 => /lib/libm.so.2

    > All of the functions are already present in libc.


    I belive you. I know Solaris has iconv but, that's gcc.


    --
    Miroslav

  11. Re: gcc on Solaris

    In Miroslav Zubcic writes:

    >Gary Mills wrote:


    >> You don't need libiconv.


    >In theory, you are right, but gcc 4.2.1 build process barks on me if it
    >doesn't find it together with header file.


    The header is iconv.h . That's certainly present in /usr/include .

    >$ ldd /opt/gcc4/2.1/bin/gcc
    > libiconv.so.2 => /opt/gcc4/2.1/lib/libiconv.so.2
    > libc.so.1 => /lib/libc.so.1
    > libgcc_s.so.1 => /usr/sfw/lib/libgcc_s.so.1
    > libm.so.2 => /lib/libm.so.2


    >> All of the functions are already present in libc.


    >I belive you. I know Solaris has iconv but, that's gcc.


    If gcc insists on the library, gcc is broken. At the very least,
    the default configuration is broken.

    --
    -Gary Mills- -Unix Support- -U of M Academic Computing and Networking-

  12. Re: gcc on Solaris

    In article ,
    Gary Mills wrote:

    > In <1193480782.950880.18050@d55g2000hsg.googlegroups.c om>
    > =?iso-8859-1?q?Michael_B=FCker?= writes:
    >
    > >I'm wanting to test a program for its portability, but i find that
    > >there are no decent packages of gcc for Solaris.

    >
    > It's not portable if you're using gcc everywhere.
    >
    > >The page that's
    > >linked to from the gcc homepage doesn't even provide 4.x packages.
    > >Are there maybe instructions on building gcc on solaris right? Most of
    > >what i've seen and tried suffered from screwy paths so that libs were
    > >not found, or headers or things like that.

    >
    > There's this one on Solaris 10:
    >
    > $ whence gcc
    > /usr/sfw/bin/gcc
    > $ gcc -v
    > Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/specs
    > Configured with:
    > /gates/sfw10/builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/configure
    > --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as
    > --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++
    > --enable-shared
    > Thread model: posix
    > gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)



    I have been using the cooltools packages. They have dtrace support
    for Solaris 10 and there are packages for Solaris 9 (no dtrace).

    The cooltools is a port that gives you a good frontend
    compiler environment with lots of control over optimisation
    specifically for sparcs:

    http://cooltools.sunsource.net/gcc/



    rachel

+ Reply to Thread