Intel® Compilers for Linux*: Compatibility with GNU Compilers

Intel® Compilers for Linux*: Compatibility with GNU Compilers

Intel® Compilers for Linux*: Compatibility with GNU Compilers Copyright © 2002, Intel Corporation. All rights reserved. Intel Corporation 2111 N.E. 25th Avenue Hillsboro, Oregon 97124 Intel Corporation assumes no responsibility for errors or omissions in this document. Nor does Intel make any commitment to update the information contained herein. Information in this document is provided in connection with Intel® products. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted by this document. Except as provided in Intel's Terms and Conditions of Sale for such products, Intel assumes no liability whatsoever, and Intel disclaims any express or implied warranty, relating to sale and/or use of Intel products including liability or warranties relating to fitness for a particular purpose. Intel, Pentium, Intel Xeon, and Itanium 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. Contents Introduction ............................................................................................... 3 Overview .................................................................................................... 3 C and C++ Source Compatibility.............................................................. 4 The Linux Kernel Build ............................................................................. 4 Binary Compatibility ................................................................................. 7 Linking and Libraries ................................................................................ 7 Command Line Options............................................................................ 9 Intel Fortran Compiler............................................................................. 11 Mixed Fortran and C++ Applications..................................................... 13 extensions. As a result, we are able to build the Linux kernel with fewer work-arounds for both the IA-32 and Itanium processor Introduction architectures compared to earlier releases of the Intel Compilers. This paper describes the compatibility of the Intel® Compilers for Linux* with the GNU compilers in terms of source or language, The Intel C++ compiler is binary, or object binary, and command-line compatibility. file, compatible with C language binary files The Intel® C++ and Fortran Compilers for created with the GNU gcc compiler. The Linux help make your software run at top Intel compilers support the C++ Application speeds on all Intel® 32-bit processors and Binary Interface (ABI), which, when fully 64-bit Intel® Itanium® processors. The implemented by other compiler vendors, will compilers also provide compatibility with allow C++ objects files and libraries to be commonly used Linux software development compatible with those compilers. At this tools. writing, the Intel and gcc compilers support the C++ ABI, but a small number of Overview differences remain. Details of object compatibility are described below. The Intel C++ Compiler 7.0 for Linux has improved source, binary and command line compatibility with the GNU gcc compiler Building the Linux kernel with the Intel C++ over previous versions. The motivation for Compiler is an ongoing project at Intel. The improved compatibility comes from customer goal is to improve gcc source compatibility, interest in building the Linux kernel with the and to find opportunities to improve kernel Intel compiler with fewer workarounds, and performance. This paper presents a in improvements to supported command-line discussion of issues associated with specific options. language differences found in building the kernel, to date. For up-to-date information, go to The Intel C++ 7.0 compiler supports the http://support.intel.com/support/perfo ANSI C and C++ standards and has greatly rmancetools/c/linux/tti/kernel.htm improved support for the GNU C language Intel® Compilers for Linux*: Compatibility with Gnu Compilers Page 3 of 14 functionality without inhibiting compiler optimizations important to the Itanium The Intel Fortran Compiler 7.0 for Linux architecture. See the Intel C++ Compiler 7.0 supports the Fortran95 and OpenMP* for Linux User Guide for information on the standards. It is not binary compatible with intrinsic functions. the GNU g77 compiler. The Intel Fortran compiler has the same binary compatibility issues with C++ language object files The gcc C++ language extensions are created with the GNU gcc compiler, as does documented in the gcc manual. Currently, the Intel C++ compilers. the following are known GNU C++ source language compatibility limitations: The Intel C++ and Fortran compilers support • Minimum and maximum operators commonly used GNU compiler command • Declarations and definitions in one line options. The Compiler Command Line header Options section describes the options that are supported, have equivalent options and • Where’s the template? are not supported. • Extracting the function pointer from a bound pointer to member function • C++-Specific Variable, Function, C and C++ Source and Type Attributes Compatibility The C++ library documentation for the Intel The Intel C++ compiler supports the ANSI C compiler is available from Dinkumware*, the and C++ standards. In addition, some of the provider of the C++ library for the Intel C++ GNU C language extensions are supported. compiler for Linux. The extensions are documented in the gcc manual, available at http://gcc.gnu.org. Table 1 shows the supported extensions for The Linux Kernel Build the Intel C++ Compiler 5.0, 6.0 and 7.0 versions, and highlights improvements in The Intel C++ 7.0 Compiler for Linux has source compatibility. Not all C extensions greatly improved support for the GNU C are supported when compiling C++ source language extensions. files. We encourage customers to submit feature requests for additional compatibility As a demonstration of compatibility with gcc, via their Intel® Premier Support account. Intel C++ 7.0 Compilers for Linux have Premier Support is included with every successfully built and run the Linux kernels, purchased compiler. For more information, Version 2.4.18, on IA-32 and Itanium see http://www.intel.com/software/products. processors using a limited number of temporary source patches. The temporary nature of these patches will be addressed in Several of the GNU gcc C language header the future either by adding extensions to files, part of the GNU C library glibc, use gcc Intel compilers or by working with the Linux C language extensions that are not currently community to replace or reduce usage of supported by the Intel C++ compiler. less frequently used, non-standard language Modified versions of these headers are features in the kernel sources. Both efforts redistributed in the substitute headers are currently underway. package installed with the Intel C++ Compiler 7.0 for Linux. For systems using Itanium processors, source patches are required in the following GNU inline-assembly format has been areas supported on IA-32 processors since version 6.0 of the Intel C++ Compiler for Linux and • The Intel C++ Compiler for Itanium is continued in version 7.0. The Itanium processors does not support inline C++ compiler provides intrinsic functions assembly. The compiler for Itanium that provide equivalent inline assembly processors, ecc, supports a rich set of Intel® Compilers for Linux*: Compatibility with Gnu Compilers Page 4 of 14 intrinsics that have been successfully • The alias attribute is not supported. used in place of inline assembly. The Intel workaround is to use a • Nested functions (encountered in atm function call instead of the alias driver code) are not supported by the declaration Intel C++ Compiler for Linux. As a • You cannot initialize a struct array workaround, Intel defined these ast struct x arr[]={}. This is used in functions outside of the functions in the PCMCIA package. The Intel which they are used. workaround is to use and empty • Attribute (packed) for a typedef is used stuct initialization instead. incorrectly in the kernel and is ignored • The __builtin_fabs is not supported by gcc but flagged as an error by ecc. which is also used in the PCMCIA As a workaround, Intel removed the package. The Intel workaround is to attribute(packed) specified for the not define __GNUC__ and typedef. __GNUC__MINOR while building • Get_user/put_user gcc asm macros are PCMCIA package. not yet implemented as intrinsics by ecc. The temporary workaround is to More complete details of the workarounds implement them as function calls in as used in building the kernel with the 7.0 assembly files. compilers can be found at: http://support.intel.com/support/performance For systems using IA-32 processors, source tools/c/linux/tti/kernel.htm. patches are required in the following areas • Below are some examples of non- Note that while we are interested in your standard/incorrect usage in kernel comments on Intel compilers, any questions source that gcc either ignores or directly related to the kernel implementation processes incorrectly. Intel is working need to be supported by the Linux kernel with the Linux community to change the build community. kernel source. To report issues concerning the use of Intel • Arithmetic on function pointers compilers to build the Linux kernel, please use Intel Premier Support, which is included • Duplicate type declarations with every purchased compiler. For

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    14 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us