Problem with -m64 on Solaris 11

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear gcc community,

I am trying to compile some code on a Solaris 11 server, usinig gcc
version 5.2.0 (GCC) and GNU ar (GNU Binutils) 2.24
. Is is a sparcv9 architecture. Unfortunately I am not the admin of
this server, so I kind of have to live with what is there, or compile a
gcc myself, but this is hard since there is no other building
environment installed on the server. I originally come from a Linux
background, so my knowledge on Solaris is quite limited.


I tried compiling the following file:

$ cat hello.c
#include<stdio.h>

int main() {
        printf("Hello World\n");
        return 0;
}


I tried compiling it as follows:

$ /opt/csw/bin/gcc -o hello hello.c
/opt/csw/lib/gcc/sparc-sun-solaris2.10/5.2.0/../../../../sparc-sun-
solaris2.10/bin/as: unrecognized option `-m32'


Adding -m64 did not help

$ /opt/csw/bin/gcc -m64 -o hello hello.c
/opt/csw/lib/gcc/sparc-sun-solaris2.10/5.2.0/../../../../sparc-sun-
solaris2.10/bin/as: unrecognized option `-m64'


I was not sure the correct assembler was used, so I checked that:
$/opt/csw/lib/gcc/sparc-sun-solaris2.10/5.2.0/../../../../sparc-sun-
solaris2.10/bin/as --version
GNU assembler (GNU Binutils) 2.24
Copyright 2013 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms
of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `sparc-sun-solaris2.10'.

$diff /opt/csw/bin/gas /opt/csw/lib/gcc/sparc-sun-
solaris2.10/5.2.0/../../../../sparc-sun-solaris2.10/bin/as


I tried splitting up the compile, assemble and link process and with
some fiddeling around, I got this working:

$/opt/csw/bin/gcc -S hello.c -mcpu=niagara4 -mtune=niagara4 -m64
$/opt/csw/bin/gas -xarch=v9 -o hello.o
hello.s                            
$/opt/csw/bin/gcc -o hello -mcpu=niagara4 -mtune=niagara4 hello.o -m64
$./hello
Hello World


It seems that the -m64 option, which is necessary for compiling and
linking makes some problems when the assembler is
being started. Is there a way to prevent gcc from adding -m64 to the
assembly process?

I tried stuff like:
$/opt/csw/bin/gcc -o hello hello.c -mcpu=v9 -mcpu=niagara4
-mtune=niagara4 -Xlinker "-m64" -Xpreprocessor "-m64" -Xassembler "-
xarch=v9"


But the compile step needs to have the -m64, which is not working with
the assembler. The assembler on the other hands has an -64 option,
which makes no difference in my case.

Is there som kind of a non documented flag like -Xcompiler "-m64" to
add the flag to the compiling step without adding it do the assembly?
Or any other way to override the assembler options? Of course I can
compile my hello.c now, but as you can imagine this wokaround is not
too easy to apply building a project like hpn-openssh, whis is the main
goal.

I hope somebody can point me in the right direction to get this working
with one gcc call using some more options. Tha
nks for your help! If you need any additional information, don't
hesitate to ask back.

Greetings from Germany,
Sascha Frick


-- 
________________________________________

 Sascha Frick

 HLRN - Supercomputer Systems
 Zuse Institute Berlin (ZIB)
 Room 1301
 Takustrasse 7
 D-14195 Berlin

 Tel: +49-30-84185-552
________________________________________

Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux