LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 07-30-2012, 10:22 AM   #1
d_shanke
LQ Newbie
 
Registered: Jul 2012
Posts: 4

Rep: Reputation: Disabled
Unhappy 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, 10:52 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
gcc compiled code does not recognized by solaris default as ..... ddegif Solaris / OpenSolaris 4 04-13-2011 12:06 PM
gcc compiled code does not recognized by solaris default as ..... ddegif Solaris / OpenSolaris 1 04-13-2011 05:34 AM
Redirecting Bin, Include and Lib on newly compiled GCC (Solaris 10). Zepiroth Solaris / OpenSolaris 3 11-20-2005 08:17 PM
Problem with newly compiled 2.4.22 kernel Xero720 Slackware 2 09-06-2003 01:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:21 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