Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Support for compiling (assembling) .S files

Andy_Duplain
Beginner
336 Views
Hi there, I have an assembler file as part of my project that contains both ia32 and intel64 assembler code, separated by guard statements:
#ifdef __i386
and:
#ifdef __x86_64
I am able to compile this code successfully using GCC under Linux and GCC and LLVM (Xcode 4.2.1) under Mac OS X. I am investigating the Intel C++ compiler but it appears unable to compile (assemble) this file as no manifest constants are defined by the compiler (as evidenced by using the -dM compiler flag) and it therefore sees assembler instructions for the wrong architecture. The manpage for icc doesn't state support for .S files (it does for .s files).
How can I get my .S files compiled by the Intel compilers?
Cheers,
Andy
0 Kudos
1 Reply
mecej4
Honored Contributor III
336 Views
Please try the following option to ICC:

-x assembler-with-cpp ...

You may still need to include definitions for manifest constants in the command line.

0 Kudos
Reply