LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 07-30-2012, 09:46 AM   #1
d_shanke
LQ Newbie
 
Registered: Jul 2012
Posts: 4

Rep: Reputation: Disabled
Question STRANGE: Newly Compiled GCC 4.4.4 on Solaris sparc gives problem with -m32/-m64 flags


Hello experts,

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 neccessary 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 remove 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
#############################################################
Could anyone please help me figure out why I am seeing this behavior. I have literally pulled my hair so much that my forehead has started to ache. :-(

Thanks,
damz
 
Old 07-30-2012, 11:45 PM   #2
d_shanke
LQ Newbie
 
Registered: Jul 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
more than 100 views but no comments.
Any pointers to identify the cause would be very appreciated.

Thanks,
damz

Last edited by d_shanke; 08-01-2012 at 12:26 AM.
 
Old 08-09-2012, 06:38 AM   #3
d_shanke
LQ Newbie
 
Registered: Jul 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by d_shanke View Post
more than 100 views but no comments.
Any pointers to identify the cause would be very appreciated.

Thanks,
damz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54155
 
Old 08-09-2012, 05:31 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Thanks for the feed-back.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
STRANGE: Newly Compiled GCC 4.4.4 on Solaris sparc gives problem with -m32/-m64 flags d_shanke Linux - Newbie 1 07-30-2012 09:52 AM
gcc compiled code does not recognized by solaris default as ..... ddegif Solaris / OpenSolaris 4 04-13-2011 11:06 AM
gcc compiled code does not recognized by solaris default as ..... ddegif Solaris / OpenSolaris 1 04-13-2011 04:34 AM
Redirecting Bin, Include and Lib on newly compiled GCC (Solaris 10). Zepiroth Solaris / OpenSolaris 3 11-20-2005 07:17 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 09:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration