Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined (89 Views)
Reply
Regular Advisor
Neel2
Posts: 101
Registered: ‎03-24-2008
Message 51 of 62 (108 Views)

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Thanks for your reply.

Ohh, that means do i need to modify the existing source code in order to get compile/link error free with aCC6. The similar source code was working fine ( compile/linking) w/o any error, So aCC6 strict enough to find wrong typedefs now, when it was not able to find earlier(compare with aCC3.57).

We are porting our source code, from aCC3.57 to aCC6.15.

Best regards,
Neel
Please use plain text.
Regular Advisor
Neel2
Posts: 101
Registered: ‎03-24-2008
Message 52 of 62 (108 Views)

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Now, when i link with -Wf,-o for the following error:

ld: Unsatisfied symbol "ut_arg_strcmp(char*,char*,long)[_Z13ut_arg_strcmpPcS_l]" in file /disk/BUILD/aCC_6.15_build/lib/liboscfe.
a[utlog.o]

It shows the following output with nm:

$/usr/ccs/bin/nm -oA * | grep _Z13ut_arg_strcmpPcS_l
[111] |0000000000000|0000000000|FUNC |GLOB |0| UNDEF|libut.a[utlog.o]:_Z13ut_arg_strcmpPcS_l
[316] |0000000000000|0000000400|FUNC |GLOB |0| .text|libut.a[ut.o]:_Z13ut_arg_strcmpPcS_l
[69] |0000000000000|0000000000|FUNC |GLOB |0| UNDEF|libut.a[uttrcfmt.o]:_Z13ut_arg_strcmpPcS_l
[34] |0000000000000|0000000000|FUNC |GLOB |0| UNDEF|libut.a[utcrshpt.o]:_Z13ut_arg_strcmpPcS_l
[316] |0000000000000|0000000400|FUNC |GLOB |0| .text|ut.o:_Z13ut_arg_strcmpPcS_l
[34] |0000000000000|0000000000|FUNC |GLOB |0| UNDEF|utcrshpt.o:_Z13ut_arg_strcmpPcS_l
[111] |0000000000000|0000000000|FUNC |GLOB |0| UNDEF|utlog.o:_Z13ut_arg_strcmpPcS_l
[51] |0000000000000|0000000000|FUNC |GLOB |0| UNDEF|utstats.o:_Z13ut_arg_strcmpPcS_l
[69] |0000000000000|0000000000|FUNC |GLOB |0| UNDEF|uttrcfmt.o:_Z13ut_arg_strcmpPcS_l

//=======================================

Now, it does shows ".text" entry in [316] |0000000000000|0000000400|FUNC |GLOB |0| .text|libut.a [ut.o]:_Z13ut_arg_strcmpPcS_l
What does that mean? Is it defined?

Could you please let me know what should be my next step in order to find out the root cause of this linking error?

Best regards,
Neel
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,705
Registered: ‎03-06-2006
Message 53 of 62 (108 Views)

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

[ Edited ]

>that means do I need to modify the existing source code in order to get compile/link error free with aCC6.

Possibly but strictly speaking, related to 11.23, not the compiler.

>The similar source code was working fine, So aCC6 strict enough to find wrong typedefs now, when it was not able to find earlier

No, it has nothing to do with the compiler. Mangling has always caught this. If anything, it is your OS headers that cause the difference.

>We are porting our source code, from aC++ A.03.57 to A.06.15.


And from 11.11 to 11.23.

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,705
Registered: ‎03-06-2006
Message 54 of 62 (108 Views)

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

[ Edited ]

ld: Unsatisfied symbol ut_arg_strcmp(char*,char*,long)[_Z13ut_arg_strcmpPcS_l] liboscfe.a[utlog.o]
>It shows the following output with nm:
FUNC|GLOB|.text|libut.a[ut.o]:_Z13ut_arg_strcmpPcS_l

>What does that mean? Is it defined?

Yes.

>Could you please let me know what should be my next step in order to find out the root cause of this linking error?

Either you're not using -Wl,+n, you don't have -loscfe on the link line or you didn't regenerate all of the archives created by the foreign devil ar(1).

Please use plain text.
Regular Advisor
Neel2
Posts: 101
Registered: ‎03-24-2008
Message 55 of 62 (108 Views)

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi,

New observation: I stated OPTIMIZE build and now I am not getting those unstatisfied linking errors. what could be the reason behind it? will appreciate your quick reply.

Best regards,
Neel
Please use plain text.
Regular Advisor
Neel2
Posts: 101
Registered: ‎03-24-2008
Message 56 of 62 (108 Views)

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi,

Could you please let me know the following:

unsigned long function(vs_lock *lock)
{
unsigned long i, save;
unsigned int *ptr;

for (i = 0; i < VS_LOCK_SIZE; i++)
{
ptr = &lock->l_words[i];
if ((int) 0x0000000f & reinterpret_cast (ptr) )
continue;
else
{
lock->l_word = ptr;
save = i; /* in case i is undefined after the loop */
break;
}
}
*(lock->l_word) = 1;
return(save);
}


the above function got compiled for 32bit. but its giving an error (Invalide type definition for if ((int) 0x0000000f & reinterpret_cast (ptr) )
while compiling for 64bit.

So, what should be the equivalent of the above if statement for 64bit? Suggestions/pointers are always appreciated.

Best regards,
Nell
Please use plain text.
Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 57 of 62 (108 Views)

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Neel:

You might fihd this document quite helpful:

http://h21007.www2.hp.com/portal/site/dspp/PAGE.template/page.document?ciid=2708d7c682f02110d7c682f0...

Regards!

...JRF...
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,705
Registered: ‎03-06-2006
Message 58 of 62 (108 Views)

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

[ Edited ]

>I started OPTIMIZE build and now I am not getting those unsatisfied linking errors. What could be the reason behind it?

The compiler and linker may delete the references as dead code.

>Could you please let me know the following:
unsigned int *ptr;
reinterpret_cast(ptr)
>the above function got compiled for 32bit. But it's giving an error (Invalid type definition reinterpret_cast(ptr)) while compiling for 64bit.

The Standard makes it illegal to cast a pointer to a smaller integral type.

>what should be the equivalent of the above if statement for 64bit?

You should be writing code that works for both 32 and 64 bit:
static_cast(reinterpret_cast(ptr))

Instead of long, you could be more pedantic and use ptrdiff_t. Or even more by using the C99 intptr_t.

You didn't mention you were porting to 64 bit in this thread.

>JRF: You might find this document quite helpful

Perhaps not since this is an error in all versions of aC++ and really is a 64 bit porting issue.

Please use plain text.
Regular Advisor
Neel2
Posts: 101
Registered: ‎03-24-2008
Message 59 of 62 (108 Views)

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hello,
This error is linking error, which i posted in same thread(please have a look at previous thread)

Today i compare IPF linking result with PA (where all linking working properly),

PA output:

/usr/bin/nm -oA liboscfe.a | grep ut_arg_strcmp
liboscfe.a:ut_arg_strcmp__FPcT1l| |undef |code |
liboscfe.a:ut_arg_strcmp__FPcT1l|000000033730|extern|entry |$CODE$
liboscfe.a:ut_arg_strcmp__FPcT1l| |undef |code |
liboscfe.a:ut_arg_strcmp__FPcT1l| |undef |code |

IPF output:

$/usr/bin/nm -oA /disk/nkhemkar/VDS/aCC_6.15_build/kernel/7.0.1.4/HP-UX_32bit/dbg//lib/liboscfe.a | grep ut_arg_strcmp
[111] |0000000000000|0000000000|FUNC |GLOB |0| UNDEF|/disk/nkhemkar/VDS/aCC_6.15_build/kernel/7.0.1.4/HP-UX_32bit/dbg//lib/liboscfe.a[utlog.o]:_Z13ut_arg_strcmpPcS_l
[316] |0000000000000|0000000400|FUNC |GLOB |0| .text|/disk/nkhemkar/VDS/aCC_6.15_build/kernel/7.0.1.4/HP-UX_32bit/dbg//lib/liboscfe.a[ut.o]:_Z13ut_arg_strcmpPcS_l
[69] |0000000000000|0000000000|FUNC |GLOB |0| UNDEF|/disk/nkhemkar/VDS/aCC_6.15_build/kernel/7.0.1.4/HP-UX_32bit/dbg//lib/liboscfe.a[uttrcfmt.o]:_Z13ut_arg_strcmpPcS_l
[34] |0000000000000|0000000000|FUNC |GLOB |0| UNDEF|/disk/nkhemkar/VDS/aCC_6.15_build/kernel/7.0.1.4/HP-UX_32bit/dbg//lib/liboscfe.a[utcrshpt.o]:_Z13ut_arg_strcmpPcS_l
[316] |0000000000000|0000000400|FUNC |GLOB |0| .text|/disk/nkhemkar/VDS/aCC_6.15_build/kernel/7.0.1.4/HP-UX_32bit/dbg//lib/liboscfe.a[ut.o]:_Z13ut_arg_strcmpPcS_l



Remark: On PA where I can build and link sucessfully, the same souce code and linking order on IPF is giving the unsatisfied linking error. So, today i compare the above output of liboscfe.a and found that the same symbols on PA shows entry and extern.

liboscfe.a:ut_arg_strcmp__FPcT1l|000000033730|extern|entry |$CODE$


So, Could you please let me know why Its showing extern on PA and not on IPF.

Thanks in advance.
Regards,
Neel
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,705
Registered: ‎03-06-2006
Message 60 of 62 (108 Views)

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

[ Edited ]

>This error is linking error, which I posted in same thread (please have a look at previous thread)

(It would have been better to reuse that other thread so I don't have to go back and forth.)

>PA output:

I see one definition and 3 uses.

>IPF output:

I see two definitions (extra copy?) and 3 uses.

>I compare the above output of liboscfe.a and found that the same symbols on PA shows entry and extern.
ut_arg_strcmp__FPcT1l|extern|entry |$CODE$

>Could you please let me know why it's showing extern on PA and not on IPF.

One is SOM the other is ELF, so there is no difference.

If you want me to look at your archive lib, gzip and try to attach it.

Please use plain text.
Regular Advisor
Neel2
Posts: 101
Registered: ‎03-24-2008
Message 61 of 62 (89 Views)

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hello,

I could not attache archives since its more than 1MB.

Backgroud: In IPF archive, you can see two times I have added ut.o since, I am getting the unsatisfied errors (only for functions which is defined in ut.c) so i have appended.

Also, I tried menually to append ut.o and it resolves the linking errors, so now my question is what is the difference between these two archives, PA archive works fine on PA architechure where as, on IPF it gives unsatisfied linking errors.

Also, On PA the same function shows extern.

Is there a any known bug with ar on IPF?


Regards,
Neeel


Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,705
Registered: ‎03-06-2006
Message 62 of 62 (89 Views)

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

[ Edited ]

>I could not attach archives since it's more than 1MB.

That's why I suggested gzip.

>Background: In IPF archive, you can see two times I have added ut.o since, I am getting the unsatisfied errors (only for functions which is defined in ut.c) so i have appended.

How did you create your archive? Adding two copies without -r (replace) isn't a good idea. The best way to create archives is:
rm -f foo.a
ar -r foo.a a1.o a2.o ...
Do not invoke ar(1) multiple times.

>so now my question is what is the difference between these two archives, PA archive works fine on PA architecture whereas, on IPF it gives unsatisfied linking errors.

Basically your original problem was that you were using a foreign devil ar(1) tool. I asked that you remove that broken ar(1) and regenerate each and every archive with the correct ar(1). I assumed that you did it.

If you want to test your archive, use:
$ elfdump -g liboscfe.a

>On PA the same function shows extern.

That's a meaningless difference. It is due to the fact that the SOM format has lots and lots of orthogonal fields (type and scope) and you get more names.

>Is there a any known bug with ar on IPF?

Not if you use the right one.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation