- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: info : cc compiler option
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2011 08:15 AM
06-19-2011 08:15 AM
info : cc compiler option
I have one ".c" program, in that program there is some "asm", code is also there while compiling the program I m getting below error.
ld: Unsatisfied symbol "asm" in file app_test.o
could you please tell, which cc "option" , I have to take to compile the asm code in ".c" program?
thanks
Manish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2011 10:16 AM
06-19-2011 10:16 AM
Re: info : cc compiler option
Which C compiler? (What makes you think that
your C compiler is also a macro assembler for
whichever assembly language may be embedded
in this (mostly) C code?)
> I have one ".c" program, [...]
With my weak psychic powers, I can't see it
from here.
> while compiling the program
I can't see the command you used, either.
> I m getting below error.
>
> ld: Unsatisfied symbol "asm" in file
> app_test.o
As the message says, that complaint is coming
from "ld", not from the C compiler.
- Tags:
- Port
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2011 10:45 AM
06-19-2011 10:45 AM
Re: info : cc compiler option
I have ".c" code , in which I have some asm code, plz find below
===========================================
char * allocBuf (long size)
{
long offset =
asm (
"10: ldq_l %t0, (%a0);" /* Load the offset pointer locked */
"bis %r31, %t0, %v0;" /* Save the original in the return register */
"addq %t0, %a1, %t0;" /* Increment the offset by the allocation size */
"40: stq_c %t0, (%a0);" /* Try to store it */
"beq %t0, 10b;", /* If zero, we failed, retry */
&dataOff, size);
return &dataBuf[offset];
}
==========================================
cc aap_test.c, I am getting that mentioned "ld: error for asm". could you please help to resolve this issue. I am on HP-UX IA system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2011 11:10 AM
06-19-2011 11:10 AM
Re: info : cc compiler option
> "10: ldq_l %t0, (%a0);" /* Load the offset pointer locked */
> [...]
Your code seems to me to call a function,
"asm", and pass it a bunch of character
strings. The C compiler, too, apparently
thinks that "asm" is a function.
> [...] "ld: error for asm".
In some places, quotation marks are used to
denote text which you are _not_ making up.
Returning to what may be the actual error
message, ...
> ld: Unsatisfied symbol "asm" [...]
Because you haven't supplied the function,
"asm". Apparently, "aap_test.c" (or whatever
it's called) is not a complete program in
itself. You should be able to avoid the
link error message by avoiding the linker:
cc -c whatever.c
But the result of that won't be executable.
What is this program, and why do you expect
it to work on your system?
> [...] I am on HP-UX IA system.
uname -a
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2011 04:44 PM
06-19-2011 04:44 PM
Re: info : cc compiler option
Code with asm must be ported to any new architecture. In your case you have inline assembly for Alpha? You'll have to either replace it by C code or convert to Itanium inline assembly functions, _Asm_*.
>Steven: that complaint is coming from "ld", not from the C compiler.
That's because it looks like a valid function call and Manish isn't using C99. :-(