Cross compiling for 5.8 sparc

Hi all,
is it possible to generate code for solaris 5.8 on a 5.10 machine with sunstudio 12?
I haven't seen any option for this in the manual pages of CC.
regards
Arno

Is there some other stratigie that we can do, to develop on the new machine with the actual SunStudio and also support our customer, which have 5.8 as a target???
I don't want to test to diffrent relesases, for the same platform.
regards
Arno

Similar Messages

  • License for cross-compilation for solaris 10 sparc on Linux x86

    I'd like to do cross-compilation for solaris 10 sparc on Linux x86 using gcc (for linux). To do that, I have to copy libraries (/lib/64) and includes (/usr/include) from a sparc machine to my linux machine.
    The compilation will be run on about (up to) 50 Linux machines (by various developers). We also have 3 solaris-10-SPARC machines.
    I wonder if Solaris license allows me to copy the includes and libs to perform compilation elsewhere.
    I also checked "OTN License Agreement for Oracle Solaris", but it looks like Oracle allows for installing "the programs" on up to 3 machines, but I need it on 50.
    Thanks for any suggestions or redirections to a proper place where I can get an answer.
    Marek

    When installing Solaris 10 01/06 on a Dell 1850 I receive an error message during the install saying "no disk found". I assume that the drive/controller is not recognized. The Dell 1850 is listed under the HCL for Solaris 10 10/06. I don't believe I can use the Solaris(TM) Device Driver for the LSI MegaRAID Adapter floppy with 1/06. I don�t have any other Solaris boxes up so I can�t build a jump start server. Any suggestions?

  • Create a cross compiler for arm

    I am struggling with building a cross toolchain, essentially it boils down to building these packages (in thegiven order):
    binutils gcc-base newlib gcc
    When done I am trying to compile a dummy cpp algorithm (euler gcd/ggT search) with no includes.
    What the cross toolchain spits at me is the following:
    $ arm-unknown-eabi-gcc -march=armv5te ./euklidisch_ggt.c -o ./euklidisch_ggt.bin.armv5te
    /usr/bin/arm-unknown-eabi-ld: skipping incompatible /usr/lib/gcc/arm-unknown-eabi/4.5.2/../../../../arm-unknown-eabi/lib/libc.a when searching for -lc
    /usr/bin/arm-unknown-eabi-ld: skipping incompatible /usr/arm-unknown-eabi/lib/libc.a when searching for -lc
    /usr/bin/arm-unknown-eabi-ld: cannot find -lc
    collect2: ld returned 1 exit status
    I wrote a little script to build it (as I got pretty much fed up doing it all by hund, round #7 just failed again)
    Note: it is semi-automated, you will still be requested to give your passwd to agree with install and blah
    Note: use it with arg "cleanup" to get rid of old installed packages (run as root)
    Note: use it to compile as user
    #!/bin/bash
    BUILDERUSER=buildmonkey
    PREFIX="/usr"
    TARGET="arm-unknown-eabi"
    PKGBUILDDIR="/home/${BUILDERUSER}/PKGBUILD"
    PKGS="binutils gcc-base newlib gcc"
    export PREFIX
    export TARGET
    export BUILDERUSER
    export PKGS
    export PKGBUILDDIR
    function cleanup
    for j in ${PKGS}
    do
    export j
    echo "Removing package ${TARGET}-${j}"
    su -c'pacman -R ${TARGET}-${j}'
    done
    function compile_and_install
    cd ${PKGBUILDDIR}
    echo ""
    echo ""
    echo "Compileing ${TARGET}-${1} ... "
    echo ""
    echo ""
    cd ./${TARGET}-${1}
    rm ./${TARGET}-${1}*
    makepkg -f || return 1
    su -c 'pacman -U ./${TARGET}-${1}*'
    echo ""
    if [ "${1}" == "cleanup" ]; then
    echo "cleanup requested...."
    cleanup
    exit 0
    fi
    if [ "$(id -u)" == "0" ]; then
    echo "This script must not be run as root!!" 1>&2
    exit 1
    fi
    echo ""
    if [ -d "${PKGBUILDDIR}" ]; then
    echo "PKGBUILD directory is ${PKGBUILDDIR}"
    else
    echo "PKGBUILD directory ${PKGBUILDDIR} is missing!!"
    exit 1
    fi
    echo "PKGs are ${PKGS}"
    echo ""
    for i in ${PKGS}
    do
    compile_and_install ${i}
    done
    exit 0
    The packagebuilds are as following (hacked away versions of the ones existing in AUR, which give me linker errors)
    binutils
    pkgname=arm-unknown-eabi-binutils
    pkgver=2.21
    pkgrel=1
    pkgdesc="A set of programs to assemble and manipulate binary and object files"
    arch=(i686 x86_64)
    license=(GPL)
    options=(!libtool)
    url="http://sources.redhat.com/binutils"
    depends=('glibc' 'zlib')
    source=(ftp://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.bz2)
    md5sums=('c84c5acc9d266f1a7044b51c85a823f5')
    build() {
    cd $srcdir/binutils-${pkgver}
    [ $NOEXTRACT -eq 1 ] || ./configure\
    --prefix=${PREFIX} \
    --program-prefix=${TARGET}- \
    --enable-shared \
    --disable-multilib \
    --with-lib-path=${PREFIX}/lib/binutils/{TARGET} \
    --disable-nls \
    --target=${TARGET} \
    --build=${CHOST} \
    --host=${CHOST}
    # mkdir -p $pkgdir/${PREFIX}/lib/binutils
    sed -i 's|know (S_GET_VALUE (frag->tc_frag_data.last_map) < S_GET_VALUE (symbolP));|{know (S_GET_VALUE (frag->tc_frag_data.last_map) < S_GET_VALUE (symbolP));}|' gas/config/tc-arm.c || return 1
    make configure-host
    make tooldir=$pkgdir/${PREFIX}
    make prefix=$pkgdir/${PREFIX} tooldir=$pkgdir/${PREFIX} install
    mkdir -p $pkgdir/${PREFIX}/lib/binutils/${TARGET}
    cp -v include/libiberty.h $pkgdir/${PREFIX}/lib/binutils/${TARGET}
    rm -f $pkgdir/${PREFIX}/man/man1/{dlltool,nlmconv,windres}*
    rm -f $pkgdir/usr/bin/ar
    rm -f $pkgdir/usr/bin/as
    rm -f $pkgdir/usr/bin/ld
    rm -f $pkgdir/usr/bin/nm
    rm -f $pkgdir/usr/bin/objdump
    rm -f $pkgdir/usr/bin/ranlib
    rm -f $pkgdir/usr/bin/strip
    rm -f $pkgdir/usr/bin/objcopy
    rm -f $pkgdir/usr/lib/libiberty.a
    rm -rf $pkgdir/usr/share
    rm -rf $pkgdir/usr/lib/ldscripts
    gcc-base
    pkgname=arm-unknown-eabi-gcc-base
    pkgver=4.5.2
    pkgrel=1
    pkgdesc="The GNU Compiler Collection"
    arch=(i686 x86_64)
    license=('GPL' 'LGPL')
    url="http://gcc.gnu.org"
    depends=('arm-unknown-eabi-binutils' 'libmpc' 'libelf' 'cloog-ppl')
    options=(!libtool !emptydirs zipman docs !strip)
    source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-core-${pkgver}.tar.bz2)
    md5sums=('aa9e36bec080452372bfba793428ee82')
    build() {
    cd $srcdir/gcc-$pkgver
    export CFLAGS="-O2 -pipe"
    export CXXFLAGS="-O2 -pipe"
    [ $NOEXTRACT -eq 1 ] || rm -rf build
    mkdir build
    cd build
    [ $NOEXTRACT -eq 1 ] || ../configure --prefix=${PREFIX} \
    --target=${TARGET} \
    --host=$CHOST \
    --build=$CHOST \
    --enable-shared \
    --disable-nls \
    --enable-languages=c \
    --enable-multilib \
    --with-local-prefix=${PREFIX}/lib/${TARGET} \
    --with-as=${PREFIX}/bin/${TARGET}-as \
    --with-ld=${PREFIX}/bin/${TARGET}-ld \
    --enable-softfloat \
    --with-float=soft \
    --with-newlib
    make all-gcc all-target-libgcc
    make DESTDIR=$pkgdir install-gcc install-target-libgcc
    rm -f $pkgdir/usr/share/man/man7/fsf-funding.7*
    rm -f $pkgdir/usr/share/man/man7/gfdl.7*
    rm -f $pkgdir/usr/share/man/man7/gpl.7*
    rm -rf $pkgdir/usr/share/info
    cp -r $pkgdir/usr/libexec/* $pkgdir/usr/lib/
    rm -rf $pkgdir/usr/libexec
    # strip it manually
    strip $pkgdir/usr/bin/* 2>/dev/null || true
    find $pkgdir/usr/lib -type f -exec arm-none-eabi-strip {} \; 2>/dev/null || true
    newlib
    pkgname=arm-unknown-eabi-newlib
    pkgver=1.19.0
    pkgrel=1
    pkgdesc="Newlib is a C library intended for use on embedded systems."
    arch=('i686' 'x86_64')
    groups=('devel')
    url="http://sourceware.org/newlib/"
    license=('GPL')
    depends=('arm-unknown-eabi-binutils' 'arm-unknown-eabi-gcc-base')
    source=(ftp://sources.redhat.com/pub/newlib/newlib-${pkgver}.tar.gz)
    md5sums=('0966e19f03217db9e9076894b47e6601')
    build() {
    cd ${srcdir}
    rm -rf build
    mkdir build
    cd build
    export CFLAGS="-O2"
    ../newlib-${pkgver}/configure \
    --target=${TARGET} \
    --prefix=${PREFIX} \
    --enable-interwork \
    --enable-multilib \
    --with-gnu-as \
    --with-gnu-ld \
    --with-float=soft \
    --disable-nls || return 1
    make || return 1
    make -j1 DESTDIR=${pkgdir} install || return 1
    rm -rf ${pkgdir}/usr/share/info
    return 0
    gcc:
    pkgname=arm-unknown-eabi-gcc
    pkgver=4.5.2
    pkgrel=1
    pkgdesc="The GNU Compiler Collection - Cross compiler for ARM target"
    arch=(i686 x86_64)
    license=('GPL' 'LGPL')
    url="http://gcc.gnu.org"
    #an installed libc/newlib is needed for libstdc++ compile
    depends=('arm-unknown-eabi-binutils>=2.18' 'cloog-ppl>=0.15.3' 'arm-unknown-eabi-newlib>=1.18.0')
    # cross-arm-none-eabi-gcc is an superset of cross-arm-none-eabi-gcc-base
    conflicts=('arm-unknown-eabi-gcc-base')
    provides=("arm-unknown-eabi-gcc-base=${pkgver}")
    options=(!libtool !emptydirs !strip zipman docs)
    source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2)
    md5sums=('d6559145853fbaaa0fd7556ed93bce9a')
    build() {
    cd ${srcdir}/gcc-$pkgver
    export CFLAGS="-O2 -pipe"
    export CXXFLAGS="-O2 -pipe"
    rm -rf build
    mkdir build
    cd build
    ../configure \
    --prefix=${PREFIX} \
    --target=${TARGET} \
    --build=${CHOST} \
    --host=${CHOST} \
    --disable-nls \
    --enable-multilib \
    --enable-languages=c,c++ \
    --enable-__cxa_atexit \
    --enable-interwork \
    --with-local-prefix=${PREFIX}/lib/${TARGET} \
    --with-as=${PREFIX}/bin/${TARGET}-as \
    --with-ld=${PREFIX}/bin/${TARGET}-ld \
    --with-newlib \
    --with-float=soft
    make all-gcc all-target-libgcc all-target-libstdc++-v3 || return 1
    make DESTDIR=${pkgdir} install-gcc install-target-libgcc install-target-libstdc++-v3 || return 1
    rm -f $pkgdir/usr/share/man/man7/fsf-funding.7*
    rm -f $pkgdir/usr/share/man/man7/gfdl.7*
    rm -f $pkgdir/usr/share/man/man7/gpl.7*
    rm -rf $pkgdir/usr/share/info
    rm -rf $pkgdir/usr/share/gcc-4.5.2
    cp -r $pkgdir/usr/libexec/* $pkgdir/usr/lib/ && \
    rm -rf $pkgdir/usr/libexec
    I already read linux from scratch howto for building cross compilers, though partly it contradicts with AUR comments especially in regard to --with-sysroot and --with-build-sysroot
    If someone can please shed some light on this, the gcc doc is not very helpfull
    Note: I know that a bare metal arm elf cross compiler exisis in the archlinux repository but that is not sufficient as I need different targets with some special options (where can I get the PKGBUILD from packages within the ABS?)

    Current targets are armv7vfpv3 and armv5te softfloat, this compiler(s) (afaik softfloat and hardfloat can not be put into one compiler, correct me if I am wrong) will be used as basis for kernel compileing for these architectures plus the basic packages (afaik called bootstrapping).
    And I knew it was not really newby stuff, but .. well .. after searching like 5 mins for an appropriate subforum I gave up and posted it just here, sorry
    The point is this is the basis for a lot of core packages and I just want to do it right (and atm it ain't working at all )
    Last edited by drahnr (2011-04-05 22:36:11)

  • Where can I get a C compiler for Solaris  10 (sparc)?

    Where can I get a C compiler for Solaris 10 (sparc)?

    Have you tried gcc ?Ok. What kind of GCC compiler for Solaris 10( sparc) can you suggest me?
    The gcc-3.3.2 was compiled on Solaris 9, but i am using it on Solaris 10, that is why(it is my assumption) i have some problems with compilation library files( for example, sys/kstat.h)

  • Trying to cross compile for ARM phone (android galaxy S4)

    i am trying to cross compile for my galaxy S4 on my 64 bit arch install, and ran into a host of issues. Currently at a specific error message in the code box below, after downloading the android NDK at https://developer.android.com/tools/sdk/ndk/index.html and running:
    android-ndk-r9d/build/tools/make-standalone-toolchain.sh
    this gave me android-ndk-gcc (directory)
    so i read up some basics on how to set the compiler via:
    'export CC=/home/earth/android-ndk-gcc/bin/arm-linux-androideabi-gcc'
    then i downloaded Bash's source code and tried to run variations of ./configure with no success until i tried:
    './configure --host=arm-linux --enable-static-link --without-bash-malloc'
    which resulted in successful whatever configure does (sets up make file stuff?)
    the result of 'make' was (only posting the one compile iteration that resulted in an error):
    /home/earth/android-ndk-gcc/bin/arm-linux-androideabi-gcc -c -I. -I../.. -I../.. -I../../lib -I../../include -I. -I../../lib/intl -I/home/earth/project/bash-4.3/lib/intl -DHAVE_CONFIG_H -DSHELL -g -O2 oslib.c
    oslib.c:238:1: error: redefinition of 'mkfifo'
    /home/earth/android-ndk-gcc/bin/../sysroot/usr/include/sys/stat.h:129:23: note: previous definition of 'mkfifo' was here
    oslib.c: In function 'mkfifo':
    oslib.c:239:12: error: argument 'path' doesn't match prototype
    /home/earth/android-ndk-gcc/bin/../sysroot/usr/include/sys/stat.h:129:23: error: prototype declaration
    oslib.c:240:10: error: argument 'mode' doesn't match prototype
    /home/earth/android-ndk-gcc/bin/../sysroot/usr/include/sys/stat.h:129:23: error: prototype declaration
    Makefile:78: recipe for target 'oslib.o' failed
    make[1]: *** [oslib.o] Error 1
    make[1]: Leaving directory '/home/earth/project/bash-4.3/lib/sh'
    Makefile:643: recipe for target 'lib/sh/libsh.a' failed
    make: *** [lib/sh/libsh.a] Error 1
    I am in no way experienced with compiling things, but i did manage to compile a simple helloworld.c program for my phone and run it successfully on the phone, which tells me the compiler works okay.
    Can anyone give me more information on what's happening? Google returns almost nothing on any of these errors, especially the oslib.c errors.

    You should check out the Android NDK documentation.  The NDK comes with a cross compiler specifically for android, with the correct versions of libraries, etc.  It comes with some examples showing how to build stuff for it.
    EDIT: There is also an AUR package for it.
    Last edited by tom5760 (2011-04-04 15:56:25)

  • Using makepkg to cross-compile (for sparc64)

    I recently acquired a Sun Ultra 5 system with a TI UltraSparc IIi CPU (sparc64).  I am in the middle of doing some compiling on it using Debian as the host system while dabbling into cross-compiling for it.  It would be superb to have a sparc64 toolchain installed and in the $PATH on a modern x86_64 system while using makepkg to cross-compile sparc64 packages.  I would copy /etc/makepkg.conf to a working directory, make the necessary changes, and run makepkg --config /working/dir/makepkg.conf.  makepkg would then (theoretically) pick up that I'm cross compiling, see the proper toolchain in the path, and cross compile.
    Is this possible?  If not, what kind of work/patching would be necessary to make it happen?

    cedeel wrote:A Sparc64 chroot isn't possible. The closest thing would be to run a chroot-like environment in QEMU.
    A cross toolchain should be preferred, although I have no idea on how to set it up.
    Yeah.  I'm building a toolchain atm.  As long as the PKGBUILDs know that I'm cross compiling, I should be okay.  There will be a bit of hand-cranking needed since not all sources use autotools.  Not really looking forward to cross-compiling openssl, and the kernel will take a bit of screwing around to work right, but, meh, that's part of the fun, right?  There's only 100-ish packages for a base install, so just getting to a functional system won't be too bad.
    I'm going to experiment with an auto-build system when I have the system running.  I'm very comfortable with bash scripting and am learning c++, so I have some good ideas.  I work as a sysadmin too, so I could even give some of the meatier servers at work an extra job to do.  That is, if all goes well
    Last edited by synthead (2012-01-02 20:18:18)

  • Announcing availability of  x86 hosted cross compiler for SPARC/Solaris

    We are pleased to announce the release for GCC For Sun Systems 4.2.0 cross compilers!
    This is a Solaris/x86 hosted compiler with target code generation for
    SPARC/Solaris systems. If you develop on your OpenSolaris, or Solaris
    x86 laptop or desktop, you can now start compiling your sources for
    SPARC systems. Almost all features available in the
    native SPARC GCC For Sun Systems 4.2.0 compiler are available
    for use in the cross compiler. Please refer to the mini cross compiler howto
    page for additional details on install and usage, and gotchas in cross
    development environment.
    Please continue to provide us your feedback and issues, which helps
    us make the product better.
    Thanks
    GCCFSS team

    Can GCCFSS also cross compile from in reverse - from SPARC to x86/x64?
    Thank you

  • Cross compiling for ARM (Android)

    Hello, everyone. I just rooted my Android phone (an LG Ally), and decided that a fun way to try and use my newfound freedom would be to cross-compile some programs for it like Busybox, Lua, a fresh copy of Python, and possibly even pacman. (Being able to use makepkg to compile phone software would be awesome.)
    I found the cross-arm-elf-binutils and cross-arm-gcc-base packages in community, so now the question is...how do I use them? From what I understand, it essentially comes down to bulding the software like normal, but using the executables from the cross-compiling package instead of the system installed ones. Is that basically right? Can you recommend any articles on cross-compiling in general, and for Android in particular?

    You should check out the Android NDK documentation.  The NDK comes with a cross compiler specifically for android, with the correct versions of libraries, etc.  It comes with some examples showing how to build stuff for it.
    EDIT: There is also an AUR package for it.
    Last edited by tom5760 (2011-04-04 15:56:25)

  • Problems cross compiling for Foxboard (cris-gcc)

    I am trying to compile the Berkeley DB for applications on a Foxboard from ACME and I am running into some problems that I cannot solve. Perhaps someone can help me.
    First problem is the configure. I use the following to configure:
    cd build_unix
    export prefix=/home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu
    export SYSTYPE=FOXBOARD
    export CCFLAGS="-isystem $prefix/include -isystem $prefix/usr/include"
    export CPPFLAGS="-isystem $prefix/include -isystem $prefix/usr/include"
    export RANLIB=ranlib
    export STRCASE="strcasecmp.o"
    export LDFLAGS="-Wl,-rpath-link,$prefix/lib,-rpath-link,$prefix/usr/lib"
    export SYSLIBS="-Wl,-rpath-link,$prefix/lib,-rpath-link,$prefix/usr/lib"
    export AUXLIBS=$AUXLIBS
    export AR=ar-cris
    export ARFL=$ARFL
    export RANLIB=$RANLIB
    export SYSLIBS="$AUXLIBS $SYSLIBS"
    export CC=gcc_cris $CCARGS
    export OPT=$OPT
    export DEBUG=$DEBUG
    export AWK=awk
    ../dist/configure          \
         --disable-largefile     \
         --disable-static     \
         --enable-smallbuild     \
         --host=i386-pc-linux-gnu \
         --target=cris-linux     \
         --enable-uimutexes     \
         --prefix $prefix/mnt/1
    This works, but it produces the following messages:
    configure: WARNING: sys/time.h: present but cannot be compiled
    configure: WARNING: sys/time.h: check for missing prerequisite headers?
    configure: WARNING: sys/time.h: see the Autoconf documentation
    configure: WARNING: sys/time.h: section "Present But Cannot Be Compiled"
    configure: WARNING: sys/time.h: proceeding with the preprocessor's result
    configure: WARNING: sys/time.h: in the future, the compiler will take precedence
    configure: WARNING: ## ---------------------------------------------------------- ##
    configure: WARNING: ## Report this to Oracle Technology Network Berkeley DB forum ##
    configure: WARNING: ## ---------------------------------------------------------- ##
    checking for sys/time.h... yes
    checking sys/fcntl.h usability... no
    checking sys/fcntl.h presence... yes
    configure: WARNING: sys/fcntl.h: present but cannot be compiled
    configure: WARNING: sys/fcntl.h: check for missing prerequisite headers?
    configure: WARNING: sys/fcntl.h: see the Autoconf documentation
    configure: WARNING: sys/fcntl.h: section "Present But Cannot Be Compiled"
    configure: WARNING: sys/fcntl.h: proceeding with the preprocessor's result
    configure: WARNING: sys/fcntl.h: in the future, the compiler will take precedence
    configure: WARNING: ## ---------------------------------------------------------- ##
    configure: WARNING: ## Report this to Oracle Technology Network Berkeley DB forum ##
    configure: WARNING: ## ---------------------------------------------------------- ##
    Because I assume this is the forum they are talking about, I decided to obey the suggestion and report it here.
    Do I need to be worried?
    Laurent-jan

    The problems are in the configure-step. So here is from config.log:
    <pre>
    configure:23212: checking sys/time.h usability
    configure:23229: gcc_cris -c -Os -isystem /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/include -isystem /home/foxboard/devboa
    rd-R2_10/target/cris-axis-linux-gnu/usr/include -D_GNU_SOURCE -D_REENTRANT conftest.c >&5
    In file included from /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/include/sys/time.h:4,
    from conftest.c:44:
    /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/include/linux/types.h:59: conflicting types for `clock_t'
    /usr/local/cris/cris-axis-elf/include/time.h:36: previous declaration of `clock_t'
    configure:23235: $? = 1
    configure: failed program was:
    | /* confdefs.h. */
    | #define PACKAGE_NAME "Berkeley DB"
    | #define PACKAGE_TARNAME "db-4.5.20"
    | #define PACKAGE_VERSION "4.5.20"
    | #define PACKAGE_STRING "Berkeley DB 4.5.20"
    | #define PACKAGE_BUGREPORT "Oracle Technology Network Berkeley DB forum"
    | #define HAVE_SYS_STAT_H 1
    | #define HAVE_STDLIB_H 1
    | #define HAVE_UNISTD_H 1
    | /* end confdefs.h. */
    | #include <stdio.h>
    | #if HAVE_SYS_TYPES_H
    | # include <sys/types.h>
    | #endif
    | #if HAVE_SYS_STAT_H
    | # include <sys/stat.h>
    | #endif
    | #if STDC_HEADERS
    | # include <stdlib.h>
    | # include <stddef.h>
    | #else
    | # if HAVE_STDLIB_H
    | # include <stdlib.h>
    | # endif
    | #endif
    | #if HAVE_STRING_H
    | # if !STDC_HEADERS && HAVE_MEMORY_H
    | # include <memory.h>
    | # endif
    | # include <string.h>
    | #endif
    | #if HAVE_STRINGS_H
    | # include <strings.h>
    | #endif
    | #if HAVE_INTTYPES_H
    | # include <inttypes.h>
    | #endif
    | #if HAVE_STDINT_H
    | # include <stdint.h>
    | #endif
    | #if HAVE_UNISTD_H
    | # include <unistd.h>
    | #endif
    | #include <sys/time.h>
    configure:23266: result: no
    configure:23270: checking sys/time.h presence
    configure:23285: gcc_cris -E -isystem /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/include -isystem /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/usr/include -D_GNU_SOURCE -D_REENTRANT conftest.c
    configure:23291: $? = 0
    configure:23312: result: yes
    configure:23325: WARNING: sys/time.h: present but cannot be compiled
    configure:23327: WARNING: sys/time.h: check for missing prerequisite headers?
    configure:23329: WARNING: sys/time.h: see the Autoconf documentation
    configure:23331: WARNING: sys/time.h: section "Present But Cannot Be Compiled"
    configure:23333: WARNING: sys/time.h: proceeding with the preprocessor's result
    configure:23335: WARNING: sys/time.h: in the future, the compiler will take precedence
    configure:23345: checking for sys/time.h
    configure:23353: result: yes
    configure:23212: checking sys/fcntl.h usability
    configure:23229: gcc_cris -c -Os -isystem /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/include -isystem /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/usr/include -D_GNU_SOURCE -D_REENTRANT conftest.c >&5
    In file included from /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/include/asm-generic/fcntl.h:4,
    from /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/include/asm/fcntl.h:1,
    from /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/include/sys/fcntl.h:4,
    from conftest.c:45:
    /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/include/linux/types.h:59: conflicting types for `clock_t'
    /usr/local/cris/cris-axis-elf/include/time.h:36: previous declaration of `clock_t'
    configure:23235: $? = 1
    configure: failed program was:
    | /* confdefs.h. */
    | #define PACKAGE_NAME "Berkeley DB"
    | #define PACKAGE_TARNAME "db-4.5.20"
    | #define PACKAGE_VERSION "4.5.20"
    | #define PACKAGE_STRING "Berkeley DB 4.5.20"
    | #define PACKAGE_BUGREPORT "Oracle Technology Network Berkeley DB forum"
    | #define HAVE_SYS_STAT_H 1
    | #define HAVE_STDLIB_H 1
    | #define HAVE_UNISTD_H 1
    | #define HAVE_SYS_TIME_H 1
    | /* end confdefs.h. */
    | #include <stdio.h>
    | #if HAVE_SYS_TYPES_H
    | # include <sys/types.h>
    | #endif
    | #if HAVE_SYS_STAT_H
    | # include <sys/stat.h>
    | #endif
    | #if STDC_HEADERS
    | # include <stdlib.h>
    | # include <stddef.h>
    | #else
    | # if HAVE_STDLIB_H
    | # include <stdlib.h>
    | # endif
    | #endif
    | #if HAVE_STRING_H
    | # if !STDC_HEADERS && HAVE_MEMORY_H
    | # include <memory.h>
    | # endif
    | # include <string.h>
    | #endif
    | #if HAVE_STRINGS_H
    | # include <strings.h>
    | #endif
    | #if HAVE_INTTYPES_H
    | # include <inttypes.h>
    | #endif
    | #if HAVE_STDINT_H
    | # include <stdint.h>
    | #endif
    | #if HAVE_UNISTD_H
    | # include <unistd.h>
    | #endif
    | #include <sys/fcntl.h>
    configure:23266: result: no
    configure:23270: checking sys/fcntl.h presence
    configure:23285: gcc_cris -E -isystem /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/include -isystem /home/foxboard/devboard-R2_10/target/cris-axis-linux-gnu/usr/include -D_GNU_SOURCE -D_REENTRANT conftest.c
    configure:23291: $? = 0
    configure:23312: result: yes
    configure:23325: WARNING: sys/fcntl.h: present but cannot be compiled
    configure:23327: WARNING: sys/fcntl.h: check for missing prerequisite headers?
    configure:23329: WARNING: sys/fcntl.h: see the Autoconf documentation
    configure:23331: WARNING: sys/fcntl.h: section "Present But Cannot Be Compiled"
    configure:23333: WARNING: sys/fcntl.h: proceeding with the preprocessor's result
    configure:23335: WARNING: sys/fcntl.h: in the future, the compiler will take precedence
    configure:23345: checking for sys/fcntl.h
    configure:23353: result: yes
    </pre>
    Running the configure again results in the same messages (which is logical) but now fails with:
    <pre>
    checking for unistd.h... (cached) yes
    checking for off_t... no
    configure: error: No off_t type.
    </pre>
    Crosscompiling is not as easy as it looks. Thanks for looking into this.
    Laurent-jan

  • Good instructions for making a GCC cross compiler?

    Hi
    I think this might be the best place to ask this since people probably have been making cross compilers. I am interested in trying to make a cross compiler of GCC targetting Plan9/i386. There is an old 3.0 version of GCC (http://cm.bell-labs.com/sources/extra/gcc/) ported to Plan9.
    The thing that confuses me a bit about cross compilers is the use of binutils for the target architecture. How does that actually work? The host OS/architecture would not be able to execute those binaries. It feels a bit like a chicken-and-egg issure and I am not really sure how to get started. I have been trying to read up a bit on the PKGBUILDs for cross-arm but the whole theoretical issue of how to actually get the thing working in the first place is still a bit unclear to me.
    Some good instructions/links/help would be appreciated
    I could post my temporary PKGBUILD here if people want to help out with the actual build...

    A small update to my attempts:
    This is my binutils package, it has failed at multiple levels during my attempts. The binutils ported to Plan9 are relatively old so some stuff needs to be patched up to build. Now it fails on not being able to recognize arlex.o . This seems a bit odd I think.
    # Adapted from cross-arm-elf, cross-i686-pc-gnu and cross-i686-pc-mingw32
    pkgname=cross-i386-plan9-binutils
    pkgver=2.11.2
    pkgrel=1
    pkgdesc="The GNU Compiler Collection - Cross compiler for Plan9 i386 target"
    arch=('i686' 'x86_64')
    license=('GPL')
    url="http://plan9.bell-labs.com/wiki/plan9/porting_alien_software_to_plan_9/index.html"
    depends=('glibc' 'zlib')
    options=('!libtool' '!distcc' '!ccache')
    source=('http://plan9.bell-labs.com/sources/extra/gcc/gnusrc.tgz' \
    'bucommh.patch')
    md5sums=('39d23b7223b68de4cf333205257112ce' \
    '2945c4e40dbcd966217ed1349195e312')
    _target=i386-lucent-plan9
    _sysroot=/usr/lib/cross-${_target}
    build() {
    rm -rf ${srcdir}/build
    mkdir ${srcdir}/build #starting fresh
    msg "building and packaging binutils"
    cp -ar ${srcdir}/binutils-2.11.2/* ${srcdir}/build/
    cd ${srcdir}/build
    msg "cheating broken references to Plan9-ported GNU binutils"
    ln -s /usr/bin/ar "${_target}-ar"
    ln -s /usr/bin/as "${_target}-as"
    ln -s /usr/bin/ld "${_target}-ld"
    ln -s /usr/bin/ranlib "${_target}-ranlib"
    PATH=${srcdir}/build:$PATH
    CFLAGS='-O2 -static'
    msg "patching up stuff"
    cd ${srcdir}/build/binutils
    patch bucomm.h -i $srcdir/bucommh.patch
    msg "going back to build directory and start configure"
    cd ${srcdir}/build
    ./configure --prefix=${_sysroot} --bindir=/usr/bin \
    --with-sysroot=${_sysroot} \
    --build=$CHOST --host=$CHOST --target=${_target} \
    --with-gcc --with-gnu-as --with-gnu-ld \
    --enable-shared --without-included-gettext \
    --disable-nls --disable-debug
    msg "fixing some corrupt libraries"
    cp /usr/lib/libiberty.a ${srcdir}/build/libiberty/
    msg "finally making the actual binutils"
    cd ${srcdir}/build
    make
    make DESTDIR=$pkgdir/ install
    # clean-up cross compiler root
    rm -r ${pkgdir}/${_sysroot}/share/{info,man}
    # needed for gcc build
    install -dm755 ${pkgdir}/${_sysroot}/include
    this is the bucommh.patch:
    81c81
    < extern char *sbrk ();
    > extern void *sbrk ();
    Last edited by W.F.Cody (2011-09-13 18:57:17)

  • Fortran code for iOS using GCC cross-compiler

    Hello everyone!
    I have some Fortran application, and i want to compile it for iOS. I'm new in iOS development and  as i understand correctly i need to configure GCC (from gcc.gnu.org) with --target=arm-apple-darwin and --enable-languages=c,c++, fortran.
    With --target=arm-elf, --target=arm-apple-darwin i got error, that it's not supported.
    With --target=arm-none-eabi i got cannot compute suffix of object files: cannot compile Maybe is that because i'm setting wrong configure parameters.
    My question is : what is correct ./confgiure parameters to create gcc cross compiler for iOS platform, which supports FORTRAN.
    Is this the only (right?) way to build cross-compiler for iOS platform, or i could use existing LLVM-GCC? Thanks!

    jasonwryan, thanks for the reply,
    I've read the ARM Dev Guide as suggested but I don't believe this will do what I'm aiming to achieve. It seems the ARM Dev Guide will install the arm-linux-gnueabi, which allows cross-compiling applications to run on LINUX built for ARM. I need something like arm-none-eabi (or arm-none-gnueabi - the whole naming scheme is a mess at the moment) which is an ARM compiler for "bare metal" ARM devices. I am aiming to program a simple ARM Cortex M4 microcontroller as opposed to an ARM microprocessor running Linux. Hence arm-linux-gnueabi is quite overkill from my understanding and it might even not work.
    So, if someone could either confirm that what the ARM Dev Guide suggests is indeed what I need to program a bare metal ARM microcontroller, or recommend an alternative path, it would be very appreciated.
    Thanks,
    -Igor

  • Is it possible to use CC 5.7 to compile for Solaris 6/7 platforms?

    Hello,
    we are currently upgrading to the new CC 5.7 from CC5.2 (Forte Update 1). One advantage we notice is the new, simplified licensing scheme, and hence the possibility to get rid of the license server installations. However, we still have to support our product on Solaris 7 (and possibly, though unlikely, Solaris 6).
    Because CC 5.7 only installs on Solaris 8, the question is whether it would be possible to cross-compile for those older platforms (e.g. via -xarch). (And use our Solaris 7 installations only for testing, not compile-purposes anymore.)
    Your help is greatly appreciated!
    Many thanks,
    Andreas

    Programs built on Solaris 8 usually will not run on Solaris 2.6 or 7, no matter what compiler you use. Sun Studio 9 (C++ 5.7) supports only Solaris 8, 9, and 10.
    You need to build your applications on the lowest version of Solaris that they are intended to be run on. Maybe you could build on Solaris 7 using FD6u1, and again on Solaris 8 using Studio 10 for customers using Solaris 8 and later.

  • Binutils and GCC version interdependencies? (cross compiler)

    Hi
    I have started again with trying to set up a cross compiler for the i386-plan9 target.
    There is a very old port of the GNU toolchain to Plan9, which can be found at:
    http://plan9.bell-labs.com/sources/extra/gcc/gnusrc.tgz
    I tried apply the changes made to binutils (the first step in setting up a cross compiler) in a modern release, but during make, there was a complaint about not finding the i386_plan9_vec (I had changed the bfd/config.bfd and all the other stuff I could find by googling).
    Because of this, I have now built the old (2.11.2) binutils from the original port (some cleaning up and minor source changes were needed to build on modern glibc, typedef change of sbrk for example).
    This temporary build can be found at:
    https://aur.archlinux.org/packages/i386-plan9-binutils/
    The purpose of building this old version temporarily was to move on to the next steps and get the compiler and C library working (the two following steps for a cross compiler) to at least have a proof-of-concept cross compiler set up.
    What I wonder now is : What is the newest version of GCC that can be expected to work using binutils 2.11.2?
    I have not found any tables with version dependencies anywhere.
    If anyone is interested in helping out experimenting, a tip for easy testing on Plan9 is to run Plan9 under 9vx
    https://aur.archlinux.org/packages/9vx-hg/
    https://wiki.archlinux.org/index.php/9vx
    and try to execute resulting binaries from the cross compiler (that is at least the way I am going to try it out until I know that it works, and then I plan to take the toolchain native).

    W.F.Cody wrote:What I wonder now is : What is the newest version of GCC that can be expected to work using binutils 2.11.2?
    Hrm...  that is around 2006...  gcc-4.0 was released then.   I'd guess a few version newer would work too.

  • Cross-compiling

    I'm using the Clang compiler (on i686) and would like to cross-compile for x86-64.
    The command I'm using is:
    $ clang -ccc-host-triple x86_64-unknown-linux [...]
    It seems to generate valid 64-bit assembler code but it's compiled in x86 mode.
    /tmp/cc-J3OsmS.s: Assembler messages:
    /tmp/cc-J3OsmS.s:36: Error: bad register name `%rbp'
    /tmp/cc-J3OsmS.s:38: Error: bad register name `%rsp'
    /tmp/cc-J3OsmS.s:40: Error: bad register name `%rdi'
    /tmp/cc-J3OsmS.s:41: Error: bad register name `%rbp)'
    /tmp/cc-J3OsmS.s:186: Error: `movabs' is only supported in 64-bit mode
    What's the recommended way of solving it?
    Clang uses the GCC assembler. Can I specify a different one, say nasm?
    So far, I only managed to find GCC cross-compile packages for ARM and some other architectures but not for x86-64.
    Any help is appreciated.
    Last edited by tindzk (2010-08-01 12:03:27)

    Compiling your PKGBUILD worked perfectly, thanks. I also added "--enable-64-bit-bfd" (cf. http://wiki.osdev.org/GCC_Cross-Compiler_for_x86_64)
    Modifying the PATH variable spawns at least the right "as"...
    export PATH=/usr/lib/cross-x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/bin/:$PATH
    ...but the errors posted above still remain, because "as" is getting passed "--32".
    So after lots of experimenting I came up with the following parameters:
    CC = clang -include config.h
    CC += -ccc-host-triple x86_64-unknown-linux
    CC += -m64
    CC += -Wa,--64
    CC += -Wl,"-L/usr/lib/cross-x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/lib"
    CC += -Wl,"-melf_x86_64"
    CC += -v
    It's very hackish because Clang doesn't support proper cross-compiling on Linux. By the way, other architectures seem to have much more sophisticated heuristics: http://clang.llvm.org/doxygen/ToolChain … ource.html
    This all works fine for the assembler and I also managed to eliminate some errors with "ld" but it's not working completely. "ld" gets called like this:
    /usr/lib/gcc/i686-pc-linux-gnu/4.5.0/collect2 --eh-frame-hdr -m elf_i386 --hash-style=both -dynamic-linker /lib/ld-linux.so.2 -o a.out /usr/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../crt1.o /usr/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../crti.o /usr/lib/gcc/i686-pc-linux-gnu/4.5.0/crtbegin.o -L/usr/lib/gcc/i686-pc-linux-gnu/4.5.0 -L/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/../../.. -L/usr/lib/cross-x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/lib -melf_x86_64 /tmp/cc-AIbI5G.o /tmp/cc-UiUGe7.o /tmp/cc-Kj0Hnx.o /tmp/cc-AIILwX.o /tmp/cc-yj4RFn.o /tmp/cc-6KT0ON.o /tmp/cc-ooccYd.o /tmp/cc-GTVp7D.o /tmp/cc-0DiGg4.o /tmp/cc-C7lZpu.o /tmp/cc-6OUkzU.o /tmp/cc-QwMVIk.o /tmp/cc-cY4MSK.o /tmp/cc-E2WG2a.o /tmp/cc-YwgDcB.o /tmp/cc-SFTBm1.o /tmp/cc-ki0Cwr.o /tmp/cc-IOEGGR.o /tmp/cc-C7CMQh.o /tmp/cc-sCQV0H.o /tmp/cc-cAB7a8.o /tmp/cc-I2Olly.o /tmp/cc-KttCvY.o /tmp/cc-wwrVFo.o /tmp/cc-ujWgQO.o /tmp/cc-gqUE0e.o /tmp/cc-4Ra5aF.o /tmp/cc-24Mxl5.o /tmp/cc-WtH2vv.o /tmp/cc-oeaAGV.o /tmp/cc-KzU9Ql.o /tmp/cc-WheM1L.o /tmp/cc-ONPqcc.o /tmp/cc-AuW8mC.o /tmp/cc-4NYUx2.o /tmp/cc-MujJIs.o /tmp/cc-W5eATS.o /tmp/cc-6UBt4i.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i686-pc-linux-gnu/4.5.0/crtend.o /usr/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../crtn.o
    Interestingly, I'm experiencing exactly the same issue described in the sources:
    // FIXME: Figure out some way to get gcc's libdir
    // (e.g. /usr/lib/gcc/i486-linux-gnu/4.3/ for Ubuntu 32-bit); we need
    // crtbegin.o/crtend.o/etc., and want static versions of various
    // libraries. If we had our own crtbegin.o/crtend.o/etc, we could probably
    // get away with using shared versions in /usr/lib, though.
    // We could fall back to the approach we used for includes (a massive
    // list), but that's messy at best.
    Can I still use the 32-bit crtend.o or will it conflict?
    However, the command fails with:
    /usr/lib/cross-x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/bin/ld: skipping incompatible /usr/lib/gcc/i686-pc-linux-gnu/4.5.0/libgcc.a when searching for -lgcc
    /usr/lib/cross-x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/bin/ld: cannot find -lgcc
    What do I need libgcc for? Can I disable it? Looks like I have to compile the complete GCC toolchain otherwise.
    Last edited by tindzk (2010-08-03 13:13:42)

  • Cross compiling apps on solaris 8 for solaris 10 x86 and x64

    Hi All,
    We have a few applications built on Solaris 8. and we want to build the same apps on Solaris 10 x86 and x64 but the problem is clearcase does not support Solaris 10 yet.
    Can we cross compile the apps on Solaris 8 for Solaris 10 x86 and x64 ? and how ?
    waiting for any info on this.
    TIA,
    warm regards,
    Girish

    FYI, I noticed the reply on Sun Studio General Forum:
    If you build an app on one version of Solaris, the app will run on later Solaris versions. So in particular, you can build an x86 application on Solaris 8 and run it on Solaris 9 and 10.
    Unfortunately, an x64 application must be built on a Solaris x64 system, which first became available with Solaris 10.

Maybe you are looking for