Intel® Fortran and C++ compilers – Invalid option -i turns on incremental linking on Linux


Reference Number : DPD200138822


Version : 10.1, 11.0, 11.1


Operating System : Linux*, Mac OS X* / IA-32, Intel® 64, IA-64


Problem Description : 


Both the Intel Fortran and C++ compilers for Mac OS and Linux quietly ignore the invalid option -i and pass it to the linker.

The effect is harmless on Mac OS because the linker (ld) does not support the -i option.

For example:

$ ifort -V -i sample.f90
Intel® Fortran Intel® 64 Compiler Professional for applications running on Intel® 64, Version 11.1 Build 20090511 Package ID: m_cprof_p_11.1.046
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
ld: unknown option: -i

The effect is not harmless on Linux where both compiler driver's (icc, ifort) quietly passing the option to the linker (ld) turns on incremental linking. Incremental linking produces a non-executable LSB relocatable file and not a LSB executable file.

Because the incremental linking is done quietly it leads to user confusion when trying to execute the non-executable LSB relocatable file. The attempt to execute the resulting file results in a "Permission denied" error.

The demonstration below shows how the invalid -i option leads to this confusing situation and error.

$ ifort sample.f90 -o sample

$ file sample
sample: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

$ ifort -i sample.f90 -o sample

$ file sample
sample: ELF 64-bit LSB relocatable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, not stripped

$ ./sample
-bash: ./sample: Permission denied


$ icc sample.c -o sample

$ file sample
sample: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

$ icc -i sample.c -o sample

$ file sample
sample: ELF 64-bit LSB relocatable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, not stripped

$ ./sample
-bash: ./sample: Permission denied


Resolution Status : This is a known issue that will be fixed in a future release. Since -i is not a valid Intel compiler option, correcting or removing the option will resolve the issue.



[DISCLAIMER: The information on this web site is intended for hardware system manufacturers and software developers. Intel does not warrant the accuracy, completeness or utility of any information on this site. Intel may make changes to the information or the site at any time without notice. Intel makes no commitment to update the information at this site. ALL INFORMATION PROVIDED ON THIS WEBSITE IS PROVIDED "as is" without any express, implied, or statutory warranty of any kind including but not limited to warranties of merchantability, non-infringement of intellectual property, or fitness for any particular purpose. Independent companies manufacture the third-party products that are mentioned on this site. Intel is not responsible for the quality or performance of third-party products and makes no representation or warranty regarding such products. The third-party supplier remains solely responsible for the design, manufacture, sale and functionality of its products. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. *Other names and brands may be claimed as the property of others.]
For more complete information about compiler optimizations, see our Optimization Notice.