mirror of
https://github.com/ipxe/ipxe
synced 2025-12-19 02:50:25 +03:00
[build] Remove support for building with the Intel C compiler
Support for building with the Intel C compiler (icc) was added in 2009 in the expectation that UEFI support would eventually involve compiling iPXE to EFI Byte Code. EFI Byte Code has never found any widespread use: no widely available compilers can emit it, Microsoft refuses to sign EFI Byte Code binaries for UEFI Secure Boot, and I have personally never encountered any examples of EFI Byte Code in the wild. The support for using the Intel C compiler has not been tested in over a decade, and would almost certainly require modification to work with current releases of the compiler. Simplify the build process by removing this old legacy code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -29,11 +29,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||
/* EFI headers redefine ARRAY_SIZE */
|
||||
#undef ARRAY_SIZE
|
||||
|
||||
/* EFI headers expect ICC to define __GNUC__ */
|
||||
#if defined ( __ICC ) && ! defined ( __GNUC__ )
|
||||
#define __GNUC__ 1
|
||||
#endif
|
||||
|
||||
/* EFI headers think your compiler uses the MS ABI by default on X64 */
|
||||
#if __x86_64__
|
||||
#define EFIAPI __attribute__((ms_abi))
|
||||
|
||||
@@ -444,75 +444,4 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
pointer >= table_start ( table ) ; \
|
||||
pointer-- )
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Intel's C compiler chokes on several of the constructs used in this
|
||||
* file. The workarounds are ugly, so we use them only for an icc
|
||||
* build.
|
||||
*
|
||||
*/
|
||||
#define ICC_ALIGN_HACK_FACTOR 128
|
||||
#ifdef __ICC
|
||||
|
||||
/*
|
||||
* icc miscompiles zero-length arrays by inserting padding to a length
|
||||
* of two array elements. We therefore have to generate the
|
||||
* __table_entries() symbols by hand in asm.
|
||||
*
|
||||
*/
|
||||
#undef __table_entries
|
||||
#define __table_entries( table, idx ) ( { \
|
||||
extern __table_type ( table ) \
|
||||
__table_temp_sym ( idx, __LINE__ ) [] \
|
||||
__table_entry ( table, idx ) \
|
||||
asm ( __table_entries_sym ( table, idx ) ); \
|
||||
__asm__ ( ".ifndef %c0\n\t" \
|
||||
".section " __table_section ( table, idx ) "\n\t" \
|
||||
".align %c1\n\t" \
|
||||
"\n%c0:\n\t" \
|
||||
".previous\n\t" \
|
||||
".endif\n\t" \
|
||||
: : "i" ( __table_temp_sym ( idx, __LINE__ ) ), \
|
||||
"i" ( __table_alignment ( table ) ) ); \
|
||||
__table_temp_sym ( idx, __LINE__ ); } )
|
||||
#define __table_entries_sym( table, idx ) \
|
||||
"__tbl_" __table_name ( table ) "_" #idx
|
||||
#define __table_temp_sym( a, b ) \
|
||||
___table_temp_sym( __table_, a, _, b )
|
||||
#define ___table_temp_sym( a, b, c, d ) a ## b ## c ## d
|
||||
|
||||
/*
|
||||
* icc ignores __attribute__ (( aligned (x) )) when it is used to
|
||||
* decrease the compiler's default choice of alignment (which may be
|
||||
* higher than the alignment actually required by the structure). We
|
||||
* work around this by forcing the alignment to a large multiple of
|
||||
* the required value (so that we are never attempting to decrease the
|
||||
* default alignment) and then postprocessing the object file to
|
||||
* reduce the alignment back down to the "real" value.
|
||||
*
|
||||
*/
|
||||
#undef __table_alignment
|
||||
#define __table_alignment( table ) \
|
||||
( ICC_ALIGN_HACK_FACTOR * __alignof__ ( __table_type ( table ) ) )
|
||||
|
||||
/*
|
||||
* Because of the alignment hack, we must ensure that the compiler
|
||||
* never tries to place multiple objects within the same section,
|
||||
* otherwise the assembler will insert padding to the (incorrect)
|
||||
* alignment boundary. Do this by appending the line number to table
|
||||
* section names.
|
||||
*
|
||||
* Note that we don't need to worry about padding between array
|
||||
* elements, since the alignment is declared on the variable (i.e. the
|
||||
* whole array) rather than on the type (i.e. on all individual array
|
||||
* elements).
|
||||
*/
|
||||
#undef __table_section
|
||||
#define __table_section( table, idx ) \
|
||||
".tbl." __table_name ( table ) "." __table_str ( idx ) \
|
||||
"." __table_xstr ( __LINE__ )
|
||||
#define __table_xstr( x ) __table_str ( x )
|
||||
|
||||
#endif /* __ICC */
|
||||
|
||||
#endif /* _IPXE_TABLES_H */
|
||||
|
||||
Reference in New Issue
Block a user