[Bug c++/54155] New: Newly compiled GCC 4.4.4 on Solaris sparc gives problem with -m32/-m64 flags
dshanke at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Aug 1 14:37:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54155
Bug #: 54155
Summary: Newly compiled GCC 4.4.4 on Solaris sparc gives
problem with -m32/-m64 flags
Classification: Unclassified
Product: gcc
Version: 4.4.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: dshanke@gmail.com
This issue has kept me busy all day long. It started off with openssl
compilation which was giving linking error with following message:
/usr/local/bin/ld: target elf32-sparc not found
collect2: ld returned 1 exit status
I tried every step possible thing that I could think of but was not able to
resolve the issue. Although I came to know that specifying -m32/-m64 flag with
my newly built gcc has started reporting this issue. I have tried to provide
all necessary details below including the test program which when I try to
compile gives the same issue.
Note: I am using GNU binaries(bintuils 2.21)
#############################################################
bash-3.2# uname -a
SunOS CSAPI-DEV-SOL3 5.10 Generic_147440-01 sun4u sparc SUNW,Sun-Fire-V240
#############################################################
bash-3.2# gcc -v
Using built-in specs.
Target: sparc-sun-solaris2.10
Configured with: ../gcc-4.4.4/configure --prefix=/usr/local/gcc-4.4.4
--program-suffix=-4.4.4 --enable-threads=posix --enable-shared
--enable-languages=c,c++ --with-gnu-as --with-as=/usr/local/bin/as
--with-gnu-ld --with-ld=/usr/local/bin/ld
Thread model: posix
gcc version 4.4.4 (GCC)
#############################################################
Content of test.cpp
#include <iostream>
int main()
{
std::cout<< "hello world\n";
}
#############################################################
/******* COMPILATION OUTPUT *******************/
bash-3.2# gcc -o test1 test.cpp -m32 -mcpu=ultrasparc -lstdc++
/usr/local/bin/ld: target elf32-sparc not found
collect2: ld returned 1 exit status
#############################################################
If I eliminate the -m32/-m64 flag output file is successfully generated.
#############################################################
bash-3.2# file test1
test1: ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required,
dynamically linked, not stripped
#############################################################
Is it something that has gone wrong during configuration due to which the
compiler does not recognize the -m option?
Please help!
More information about the Gcc-bugs
mailing list