0

I am trying to compile a simple hello world program in SunOS (5.5.1 Generic_103640-42 sun4u sparc SUNW,Ultra-5_10) ,the problem we are facing is when we try to compile a simple C++ file, we are observing a segmentation fault.Initially we were able to compile, nothing got updated in server I have cross checked, please find my observations..

$/apps/SUNWspro/bin/CC -C chandru.C
CC: Warning: Option -C passed to ld, if ld is invoked, ignored otherwise
CC: Fatal error in ccfe: Segmentation Fault (core dumped)
$ls -l /apps/SUNWspro/bin/CC
lrwxrwxrwx   1 root     other         15 Aug 23  1999 /apps/SUNWspro/bin/CC -> ../SC5.0/bin/CC
$/apps/SOLARIS/C++4.1/bin/CC -V chandru.C
CC: diagnostics generated from compilation of chandru.int.c:
cc: Fatal error in /apps/SUNWspro/bin/../SC5.0/bin/acomp
Status 139
CC: end of diagnostics from compilation of chandru.int.c:
$ls -l /apps/SOLARIS/C++4.1/bin/CC
-r-xr-xr-x   1 scmeadm  scme       44524 Jan 30  1998 /apps/SOLARIS/C++4.1/bin/CC
$cat chandru.C

#include "stdio.h"
int main()
{
        printf("Hello\n");
        return 0;
}

spe:/scmeadm> which CC
/apps/SOLARIS/C++4.1/bin/CC
spe:/usr/att/scmeadm> ldd /apps/SUNWspro/bin/CC
        libintl.so.1 =>  /usr/lib/libintl.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libw.so.1 =>     /usr/lib/libw.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
spe:/scmeadm> ldd /apps/SOLARIS/C++4.1/bin/CC
ldd: /apps/SOLARIS/C++4.1/bin/CC: unsupported or unknown file type

After I cross checked with which CC ,again I complied with these steps 
#/apps/SUNWspro/bin/CC -C chandru.C
CC: Warning: Option -C passed to ld, if ld is invoked, ignored otherwise
CC: Fatal error in ccfe: Segmentation Fault (core dumped)
PATH=/now_scme/lbin:/apps/build/i1010/sun5.6/delta/i/prod/bin:/usr/ccs/bin:/bin:/usr/bin:/now_scme/bin2.1_Sun5.5:/now_scme/bin2.1_Hpux1020:/apps/SOLARIS/C++4.1/bin:/apps/SOLARIS/nmake3.2/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/oss/scmeadm/bin:.
CPLUSLIB=/apps/SOLARIS/C++4.1/lib
CC=/apps/SOLARIS/C++4.1/bin/CC
CPLUSINC=/apps/SOLARIS/C++4.1/include
  • Post the output of env and ldd /apps/SUNWspro/bin/CC. – Andrew Henle Oct 30 '17 at 12:21
  • Anything in /var/adm/messages that indicates memory or disk problems? – Mark Plotnick Oct 30 '17 at 14:28
  • I have edited my question and pasted the ldd /apps/SUNWspro/bin/CC and /var/adm/messages I cross checked but no helpful messages...Thanks Mark and Andrew – chandu Oct 30 '17 at 17:08
  • I'm curious why you're getting: "ldd: /apps/SOLARIS/C++4.1/bin/CC: unsupported or unknown file type" Can you issue a file on it as well? I'm also curious if you have a space issue somewhere. Try checking df -k – sleepyweasel Oct 30 '17 at 19:45
  • CC is probably a shell script. – Mark Plotnick Oct 31 '17 at 4:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.