I'm trying to compile some code using icc 12.1.4 under linux. I have a simple script that compiles each file and a line to link all the files using a custom linker definition file. The build script works for gcc and the linker definition file works for gcc. When I use it with icc, I get a syntax error on this line:
. = ALIGN (., 0x20);
I'm not sure what is causing this error since it works with gcc and other compilers. ALIGN should be a builtin function in the linker (which I'm assuming is ld). I've noticed this same error in icc with other builtin functions (like REGION_ALIAS).
Up-front: Specifying a linker script (via -T) forwards it directly to the linker. If a (syntax) error within that file appears it comes from the linker. We're using the GNU linker, same as you have installed by default. Maybe the (default) linker found by our compiler driver is not the one you're using; e.g. you've installed multiple GNU tool-chains. In that case you can select the tool-chains by using the options -gcc-version=XYZ, -gcc-name= and -gxx-name=. Example for GCC 4.5.1 tool-chain: