.S help

.S help

Hello.

Iwrote pure.S asm code file for a.cc C++ file, which means that a.s has .S pattern of .bss, .data, .text and .globl sections followed by .globl function definitions using instructions. Here a.cc is the original file whose .S file is a.s.

To confirm the error if any within a.s file I tried checking this.S file using "as -o a.o a.s" which doesn't generate any errors. I am using ICC-v11.0 on Linux x86_64 with GNU-syntax for .S file.

I have to incorporate thisa.s file alongwith other multiple c/c++ files as a single package.

But I have a question, this original C/C++ file(a.cc) which has API been defined inside this a.ccare calledby someother cpp files (could be by b.cc, d.cc, etc.) for example if the file a.cc and ir's API is defined as below -

------a.cc-----
#include
#include "a.h"

Apple ( const State now,
Real crd[MAX_ATOMS][SPACE],
const Real vt[MAX_TORS][SPACE],
const int tlist[MAX_TORS][MAX_ATOMS],
const int ntor );
{
.....
.....
Algorithmdescriptions
.....
.....
}
---

So, this API (apple of a.cc) would be called as "Apple (now, crd, vt, tlist, ntor)" in some places of other C/C++ files. So, my query is - How do one take care of this prototype function calls when compiling and linking with a.s file which is pure .S asm file of a.cc file. (The reason of asking this query is - To take care Compiler and assembler mis-match if any, though ICC-v11.0 has GAS as a assembler,and I think ICC-v11.0 would inernally call "as" asembler.) Does below syntax in a.s would take care -

---------
.section .text
.type Apple, @function
.globl Apple

Apple:
......
......
Algorithm instuctions of a.cc
......
......
-----------

Also, since this package has multiple c/c++ files, the Makefile which has been initially written for multiple .cc files having initially a.cc and called together to generate single executable, how do I give a command for including this a.s file and create it's object and finally link with other .cc files as a standard practice. Here, I mean writing a Makefile with a mix of many .cc files and .s file.

Looking for anyclue or suggestions or any reference of any Open-source package from which I can take some guidelines for above queries and steps.

~BR

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.