Operating System - HP-UX
1820478 Members
2959 Online
109624 Solutions
New Discussion юеВ

collect2: ld returned 12 exit status

 
devshlom
Regular Advisor

collect2: ld returned 12 exit status

Hi,

I have a new problem with one of my products.
suddenly it failed to link on debug mode, but still linking well on release mode.
The only difference between them is that in debug mode, I don't use the strip (-s) option.
As far as I know, I don't have any space or memory problem on the machine.
Any idea?!
8 REPLIES 8
Steven Schweda
Honored Contributor

Re: collect2: ld returned 12 exit status

> As far as I know, I don't have any space
> or memory problem on the machine.

ENOMEM (12) would seem to suggest that you do.
devshlom
Regular Advisor

Re: collect2: ld returned 12 exit status

hi Steven,

can you explain pls?
Venkatesh BL
Honored Contributor

Re: collect2: ld returned 12 exit status

Can you post the complete error? Did it crib about anything else as well?
Dennis Handly
Acclaimed Contributor

Re: collect2: ld returned 12 exit status

Exit status of 12 may have no connection to ENOMEM (12). Especially since it isn't documented.

If you really think you're out of memory, you can look at ld in top and see how close it gets to maxdsiz.
devshlom
Regular Advisor

Re: collect2: ld returned 12 exit status

Hi,
This is all I got as link error - no more, that's the big problem here.
but let me clear something:
I mentioned that I don't have any space problem or memory problem (these are things that I've already checked) - so I'm trying to guess what the problem might be...


tx again
Dennis Handly
Acclaimed Contributor

Re: collect2: ld returned 12 exit status

>I mentioned that I don't have any space problem or memory problem (these are things that I've already checked)

Perhaps you can explain how, so you can convince us doubters? :-)

If you are using aCC6, we require 4 Gb for maxdsiz_64bit. But the linker probably isn't that piggy. :-)

To rule out linker bugs, you should make sure you have the latest linker patch.
Also, did you see any linker error messages?
devshlom
Regular Advisor

Re: collect2: ld returned 12 exit status

I don't have anymore information from the linker.
Are you convince that it got to do with memory problem? (I checked memory via 'vmstat' and it shows that I have 93920 free mem)

do you have more ideas?




Dennis Handly
Acclaimed Contributor

Re: collect2: ld returned 12 exit status

>I don't have anymore information from the linker.

Then the linker is broken. If it has a problem it should either abort with a signal or print an error then exit.

>Are you convinced that it got to do with memory problem? (I checked memory via 'vmstat' and it shows that I have 93920 free mem)

Of course not. vmstat doesn't tell us anything. Have you looked at "swapinfo -tam" and the value of the kernel parm maxdsiz?

>do you have more ideas?

export LDOPTS="-v -t"
Then try to relink.

Or try using "tusc -fp -o tusc.out" on your link line and then we will know what's going on.