From: <ped...@us...> - 2006-09-04 16:10:44
|
Revision: 534 http://svn.sourceforge.net/cegcc/?rev=534&view=rev Author: pedroalves Date: 2006-09-04 09:10:26 -0700 (Mon, 04 Sep 2006) Log Message: ----------- Enable gcc to be built with --disable-threads Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/config/arm/t-mingw32 trunk/cegcc/src/gcc/gcc/config/arm/t-wince-pe trunk/cegcc/src/gcc/gcc/config.gcc Added Paths: ----------- trunk/cegcc/src/gcc/gcc/config/arm/t-gthr-win32 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-09-06 22:29:02
|
Revision: 572 http://svn.sourceforge.net/cegcc/?rev=572&view=rev Author: pedroalves Date: 2006-09-06 15:28:49 -0700 (Wed, 06 Sep 2006) Log Message: ----------- Remove dependency on errno. I checked all uses of __gthr_wince_once, and they all check for == 0 or != 0. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/config/arm/gthr-win32.c trunk/cegcc/src/gcc/gcc/gthr-win32.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-10 03:47:27
|
Revision: 702 http://svn.sourceforge.net/cegcc/?rev=702&view=rev Author: pedroalves Date: 2006-10-09 20:47:05 -0700 (Mon, 09 Oct 2006) Log Message: ----------- * config/arm/cegcc.c : Delete. We use the originals instead. This code is generic PE code, and will hopefully get pushed down to a more general place in GCC 4.3 stage1. * cegcc-cxx.c : Likewise. * cegcc-stubs.c : Likewise. * config.gcc : Use the originals instead of the new copies for the arm*-wince-cegcc case. * config/arm/t-wince-cegcc : Make it empty, we now inherit the generic t-wince-pe. * ChangeLog.ce : New file. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/config/arm/cegcc-cxx.c trunk/cegcc/src/gcc/gcc/config/arm/cegcc-stubs.c trunk/cegcc/src/gcc/gcc/config/arm/cegcc.c trunk/cegcc/src/gcc/gcc/config/arm/t-wince-cegcc trunk/cegcc/src/gcc/gcc/config.gcc Added Paths: ----------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-16 23:38:31
|
Revision: 734 http://svn.sourceforge.net/cegcc/?rev=734&view=rev Author: pedroalves Date: 2006-10-16 16:38:17 -0700 (Mon, 16 Oct 2006) Log Message: ----------- * config/arm/wince-cegcc.h (STARTFILE_SPEC) : Add gcrt3.o instead of gcrt2.o. * config/arm/mingw32.h : Likewise. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h trunk/cegcc/src/gcc/gcc/config/arm/wince-cegcc.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-30 22:38:30
|
Revision: 758 http://svn.sourceforge.net/cegcc/?rev=758&view=rev Author: pedroalves Date: 2006-10-30 13:53:29 -0800 (Mon, 30 Oct 2006) Log Message: ----------- * config/arm/pe-cxx.c: Fix indenting to match the original config/i386/winnt-cxx.c. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/pe-cxx.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-30 22:38:56
|
Revision: 758 http://svn.sourceforge.net/cegcc/?rev=758&view=rev Author: pedroalves Date: 2006-10-30 13:53:29 -0800 (Mon, 30 Oct 2006) Log Message: ----------- * config/arm/pe-cxx.c: Fix indenting to match the original config/i386/winnt-cxx.c. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/pe-cxx.c Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-10-29 21:14:57 UTC (rev 757) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-10-30 21:53:29 UTC (rev 758) @@ -1,3 +1,6 @@ +2006-10-30 Pedro Alves <ped...@po...> + * config/arm/pe-cxx.c: Fix indenting to match the original config/i386/winnt-cxx.c. + 2006-10-17 Pedro Alves <ped...@po...> * config/arm/wince-cegcc.h (STARTFILE_SPEC) : Add gcrt3.o instead of gcrt2.o. Modified: trunk/cegcc/src/gcc/gcc/config/arm/pe-cxx.c =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/pe-cxx.c 2006-10-29 21:14:57 UTC (rev 757) +++ trunk/cegcc/src/gcc/gcc/config/arm/pe-cxx.c 2006-10-30 21:53:29 UTC (rev 758) @@ -38,7 +38,8 @@ bool arm_pe_type_dllimport_p (tree decl) { - gcc_assert (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL); + gcc_assert (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == FUNCTION_DECL); if (TARGET_NOP_FUN_DLLIMPORT && TREE_CODE (decl) == FUNCTION_DECL) return false; @@ -152,7 +153,7 @@ /* Check FUNCTION_DECL's. */ for (member = TYPE_METHODS (t); member; member = TREE_CHAIN (member)) - if (TREE_CODE (member) == FUNCTION_DECL) + if (TREE_CODE (member) == FUNCTION_DECL) maybe_add_dllimport (member); /* Check vtables */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-11-18 16:36:41
|
Revision: 1076 http://cegcc.svn.sourceforge.net/cegcc/?rev=1076&view=rev Author: pedroalves Date: 2007-11-18 08:36:40 -0800 (Sun, 18 Nov 2007) Log Message: ----------- * config/arm/wince-pe.h (ARM_DOUBLEWORD_ALIGN): Define as 0. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-11-18 16:33:11 UTC (rev 1075) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-11-18 16:36:40 UTC (rev 1076) @@ -1,3 +1,7 @@ +2007-11-18 Pedro Alves <ped...@po...> + + * config/arm/wince-pe.h (ARM_DOUBLEWORD_ALIGN): Define as 0. + 2007-11-15 Danny Backx <dan...@us...> * config/arm/mingw32.h (EXTRA_OS_CPP_BUILTINS, CPP_SPEC): Move Modified: trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2007-11-18 16:33:11 UTC (rev 1075) +++ trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2007-11-18 16:36:40 UTC (rev 1076) @@ -230,7 +230,7 @@ #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8 #undef ARM_DOUBLEWORD_ALIGN -#define ARM_DOUBLEWORD_ALIGN 1 +#define ARM_DOUBLEWORD_ALIGN 0 #undef BIGGEST_ALIGNMENT #define BIGGEST_ALIGNMENT 64 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-30 23:52:08
|
Revision: 760 http://svn.sourceforge.net/cegcc/?rev=760&view=rev Author: pedroalves Date: 2006-10-30 15:51:18 -0800 (Mon, 30 Oct 2006) Log Message: ----------- * target-def.h (TARGET_ATTRIBUTE_TABLE): Only define if not defined before. * config/arm/arm.c (arm_file_end): Give it external linkage. (arm_handle_struct_attribute): New. (arm_ms_bitfield_layout_p): New. (TARGET_ATTRIBUTE_TABLE, TARGET_ASM_FILE_END, TARGET_ENCODE_SECTION_INFO, TARGET_STRIP_NAME_ENCODING): Move declarations to config/arm/arm.h. (TARGET_MS_BITFIELD_LAYOUT_P): Define to arm_ms_bitfield_layout_p. (arm_return_in_memory): Replace #ifdef'ing on ARM_WINCE with TARGET_RETURN_AGGREGATES_IN_MEMORY. (arm_attribute_table): Add shared, ms_struct, gcc_struct attributes. Allow subtarget to add attributes using SUBTARGET_ATTRIBUTE_TABLE. (arm_elf_asm_constructor): Only compile on OBJECT_FORMAT_ELF. (thumb_output_function_prologue): Call arm_pe_strip_name_encoding instead of arm_strip_name_encoding. (arm_handle_struct_attribute): New function. (arm_ms_bitfield_layout_p): New function. * config/arm/arm.h (TARGET_ASM_FILE_END, TARGET_ATTRIBUTE_TABLE, TARGET_ENCODE_SECTION_INFO, TARGET_STRIP_NAME_ENCODING): Define. * config/arm/t-wince-cegcc: Add cegcc1.o rule. (TARGET_LIBGCC2_CFLAGS): Add -mwin32. * config/arm/t-mingw32 (SYSTEM_INCLUDE_DIR): Delete. (NATIVE_SYSTEM_HEADER_DIR): Likewise. * config/arm/arm-protos.h (arm_file_end, arm_pe_asm_named_section, arm_pe_section_type_flags, arm_pe_strip_name_encoding, arm_pe_output_labelref, arm_pe_handle_shared_attribute): Declare. * config/arm/wince-pe.h: (TARGET_VERSION): Set to "(arm Windows CE/Native SDK)". (MULTILIB_DEFAULTS): Remove -mfpu=vfp. (SUBTARGET_CPU_DEFAULT): Default to TARGET_CPU_arm8 (armv4). (CPP_SPEC): Remove cegcc specifics. (ASM_SPEC): Don't pass -cpu=iwmmxt to assembler when -mcpu=xscale is used. (SUBTARGET_EXTRA_SPECS, SUBTARGET_ASM_FLOAT_SPEC): Remove. (TARGET_OS_CPP_BUILTINS): Add _stdcall, _fastcall and _cdecl. (SUBTARGET_CPP_SPEC, HANDLE_SYSV_PRAGMA, HANDLE_PRAGMA_PACK_PUSH_POP): Delete. (STARTFILE_SPEC): Remove cegcc specifics. (LIBGCC_SPEC): Likewise. (LIB_SPEC): Likewise. (COMMON_ASM_OP, ASM_OUTPUT_COMMON, ASM_DECLARE_OBJECT_NAME, ASM_DECLARE_FUNCTION_NAME, ASM_OUTPUT_EXTERNAL, ASM_OUTPUT_EXTERNAL_LIBCALL, ASM_OUTPUT_ALIGNED_BSS, TARGET_ASM_FILE_END, SUPPORTS_ONE_ONLY, MULTIPLE_SYMBOL_SPACES): Delete. (ARM_MCOUNT_NAME): Define to _mcount to avoid conflicts. (CHECK_STACK_LIMIT): Delete. (TARGET_DEFAULT): Match Windows CE ABI with MASK_MS_BITFIELD_LAYOUT and MASK_RETURN_AGGREGATES_IN_MEMORY. (TARGET_SUBTARGET_DEFAULT): Delete. (BIGGEST_FIELD_ALIGNMENT): Delete. (SET_ASM_OP): Delete. (DEFAULT_STRUCTURE_SIZE_BOUNDARY): Define to 8 as WinCE's ABI requires. (ASM_OUTPUT_DEF_FROM_DECLS, TARGET_USE_JCR_SECTION, TARGET_USE_LOCAL_THUNK_ALIAS_P, SUBTARGET_ATTRIBUTE_TABLE): Delete. * config/arm/mingw32.h (STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT): Delete. * config/arm/arm.opt: New option -mreturn-aggregates-in-memory. * config/arm/pe.opt: New option -mms-bitfields. * config/arm/pe.c (arm_pe_handle_shared_attribute): New. (arm_pe_strip_name_encoding): New. (arm_pe_output_labelref): Call arm_pe_strip_name_encoding instead of arm_strip_name_encoding. (arm_pe_unique_section): Likewise. (arm_pe_section_type_flags): New. (arm_pe_asm_named_section ): New. (arm_pe_file_end): Call arm_file_end. * config/arm/pe.h (HANDLE_SYSV_PRAGMA): New. (HANDLE_PRAGMA_PACK_PUSH_POP): New. (SUBTARGET_OVERRIDE_OPTIONS): New. (TARGET_ASM_NAMED_SECTION): Set to arm_pe_asm_named_section specialized version. (TARGET_SECTION_TYPE_FLAGS): New. (ASM_DECLARE_FUNCTION_NAME): Don't output -export to .drectve directly. Use arm_pe_record_exported_symbol instead. (TARGET_ASM_FILE_END): Set to arm_pe_file_end. (TARGET_ENCODE_SECTION_INFO): Set to arm_pe_encode_section_info. (TARGET_STRIP_NAME_ENCODING): Set to arm_pe_strip_name_encoding. (COMMON_ASM_OP): New. (ASM_OUTPUT_COMMON): Don't output -export to .drectve directly. Use arm_pe_record_exported_symbol instead. (ASM_DECLARE_OBJECT_NAME): Likewise. (ASM_OUTPUT_EXTERNAL): New. (ASM_OUTPUT_EXTERNAL_LIBCALL): New. (PROFILE_HOOK): New. (ASM_OUTPUT_DEF_FROM_DECLS): New. (SUPPORTS_ONE_ONLY). (SUBTARGET_ATTRIBUTE_TABLE): New. (TARGET_USE_LOCAL_THUNK_ALIAS_P): New. (TARGET_USE_JCR_SECTION): New. (SUBTARGET_ENCODE_SECTION_INFO): New. (TARGET_STRIP_NAME_ENCODING): New. * config/arm/wince-cegcc.h (SUBTARGET_EXTRA_SPECS, EXTRA_OS_CPP_BUILTINS, TARGET_OS_CPP_BUILTINS, SUBTARGET_CPP_SPEC): Delete. * config/arm/t-wince-pe (pe.o): Add expr.h to dependencies. (cegcc1.o): Delete build rule. (MULTILIB_OPTIONS): Remove -mfpu=vfp. (TARGET_LIBGCC2_CFLAGS): Remove unneeded options. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/arm-protos.h trunk/cegcc/src/gcc/gcc/config/arm/arm.c trunk/cegcc/src/gcc/gcc/config/arm/arm.h trunk/cegcc/src/gcc/gcc/config/arm/arm.opt trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h trunk/cegcc/src/gcc/gcc/config/arm/pe.c trunk/cegcc/src/gcc/gcc/config/arm/pe.h trunk/cegcc/src/gcc/gcc/config/arm/pe.opt trunk/cegcc/src/gcc/gcc/config/arm/t-mingw32 trunk/cegcc/src/gcc/gcc/config/arm/t-wince-cegcc trunk/cegcc/src/gcc/gcc/config/arm/t-wince-pe trunk/cegcc/src/gcc/gcc/config/arm/wince-cegcc.h trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h trunk/cegcc/src/gcc/gcc/target-def.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-30 23:53:57
|
Revision: 760 http://svn.sourceforge.net/cegcc/?rev=760&view=rev Author: pedroalves Date: 2006-10-30 15:51:18 -0800 (Mon, 30 Oct 2006) Log Message: ----------- * target-def.h (TARGET_ATTRIBUTE_TABLE): Only define if not defined before. * config/arm/arm.c (arm_file_end): Give it external linkage. (arm_handle_struct_attribute): New. (arm_ms_bitfield_layout_p): New. (TARGET_ATTRIBUTE_TABLE, TARGET_ASM_FILE_END, TARGET_ENCODE_SECTION_INFO, TARGET_STRIP_NAME_ENCODING): Move declarations to config/arm/arm.h. (TARGET_MS_BITFIELD_LAYOUT_P): Define to arm_ms_bitfield_layout_p. (arm_return_in_memory): Replace #ifdef'ing on ARM_WINCE with TARGET_RETURN_AGGREGATES_IN_MEMORY. (arm_attribute_table): Add shared, ms_struct, gcc_struct attributes. Allow subtarget to add attributes using SUBTARGET_ATTRIBUTE_TABLE. (arm_elf_asm_constructor): Only compile on OBJECT_FORMAT_ELF. (thumb_output_function_prologue): Call arm_pe_strip_name_encoding instead of arm_strip_name_encoding. (arm_handle_struct_attribute): New function. (arm_ms_bitfield_layout_p): New function. * config/arm/arm.h (TARGET_ASM_FILE_END, TARGET_ATTRIBUTE_TABLE, TARGET_ENCODE_SECTION_INFO, TARGET_STRIP_NAME_ENCODING): Define. * config/arm/t-wince-cegcc: Add cegcc1.o rule. (TARGET_LIBGCC2_CFLAGS): Add -mwin32. * config/arm/t-mingw32 (SYSTEM_INCLUDE_DIR): Delete. (NATIVE_SYSTEM_HEADER_DIR): Likewise. * config/arm/arm-protos.h (arm_file_end, arm_pe_asm_named_section, arm_pe_section_type_flags, arm_pe_strip_name_encoding, arm_pe_output_labelref, arm_pe_handle_shared_attribute): Declare. * config/arm/wince-pe.h: (TARGET_VERSION): Set to "(arm Windows CE/Native SDK)". (MULTILIB_DEFAULTS): Remove -mfpu=vfp. (SUBTARGET_CPU_DEFAULT): Default to TARGET_CPU_arm8 (armv4). (CPP_SPEC): Remove cegcc specifics. (ASM_SPEC): Don't pass -cpu=iwmmxt to assembler when -mcpu=xscale is used. (SUBTARGET_EXTRA_SPECS, SUBTARGET_ASM_FLOAT_SPEC): Remove. (TARGET_OS_CPP_BUILTINS): Add _stdcall, _fastcall and _cdecl. (SUBTARGET_CPP_SPEC, HANDLE_SYSV_PRAGMA, HANDLE_PRAGMA_PACK_PUSH_POP): Delete. (STARTFILE_SPEC): Remove cegcc specifics. (LIBGCC_SPEC): Likewise. (LIB_SPEC): Likewise. (COMMON_ASM_OP, ASM_OUTPUT_COMMON, ASM_DECLARE_OBJECT_NAME, ASM_DECLARE_FUNCTION_NAME, ASM_OUTPUT_EXTERNAL, ASM_OUTPUT_EXTERNAL_LIBCALL, ASM_OUTPUT_ALIGNED_BSS, TARGET_ASM_FILE_END, SUPPORTS_ONE_ONLY, MULTIPLE_SYMBOL_SPACES): Delete. (ARM_MCOUNT_NAME): Define to _mcount to avoid conflicts. (CHECK_STACK_LIMIT): Delete. (TARGET_DEFAULT): Match Windows CE ABI with MASK_MS_BITFIELD_LAYOUT and MASK_RETURN_AGGREGATES_IN_MEMORY. (TARGET_SUBTARGET_DEFAULT): Delete. (BIGGEST_FIELD_ALIGNMENT): Delete. (SET_ASM_OP): Delete. (DEFAULT_STRUCTURE_SIZE_BOUNDARY): Define to 8 as WinCE's ABI requires. (ASM_OUTPUT_DEF_FROM_DECLS, TARGET_USE_JCR_SECTION, TARGET_USE_LOCAL_THUNK_ALIAS_P, SUBTARGET_ATTRIBUTE_TABLE): Delete. * config/arm/mingw32.h (STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT): Delete. * config/arm/arm.opt: New option -mreturn-aggregates-in-memory. * config/arm/pe.opt: New option -mms-bitfields. * config/arm/pe.c (arm_pe_handle_shared_attribute): New. (arm_pe_strip_name_encoding): New. (arm_pe_output_labelref): Call arm_pe_strip_name_encoding instead of arm_strip_name_encoding. (arm_pe_unique_section): Likewise. (arm_pe_section_type_flags): New. (arm_pe_asm_named_section ): New. (arm_pe_file_end): Call arm_file_end. * config/arm/pe.h (HANDLE_SYSV_PRAGMA): New. (HANDLE_PRAGMA_PACK_PUSH_POP): New. (SUBTARGET_OVERRIDE_OPTIONS): New. (TARGET_ASM_NAMED_SECTION): Set to arm_pe_asm_named_section specialized version. (TARGET_SECTION_TYPE_FLAGS): New. (ASM_DECLARE_FUNCTION_NAME): Don't output -export to .drectve directly. Use arm_pe_record_exported_symbol instead. (TARGET_ASM_FILE_END): Set to arm_pe_file_end. (TARGET_ENCODE_SECTION_INFO): Set to arm_pe_encode_section_info. (TARGET_STRIP_NAME_ENCODING): Set to arm_pe_strip_name_encoding. (COMMON_ASM_OP): New. (ASM_OUTPUT_COMMON): Don't output -export to .drectve directly. Use arm_pe_record_exported_symbol instead. (ASM_DECLARE_OBJECT_NAME): Likewise. (ASM_OUTPUT_EXTERNAL): New. (ASM_OUTPUT_EXTERNAL_LIBCALL): New. (PROFILE_HOOK): New. (ASM_OUTPUT_DEF_FROM_DECLS): New. (SUPPORTS_ONE_ONLY). (SUBTARGET_ATTRIBUTE_TABLE): New. (TARGET_USE_LOCAL_THUNK_ALIAS_P): New. (TARGET_USE_JCR_SECTION): New. (SUBTARGET_ENCODE_SECTION_INFO): New. (TARGET_STRIP_NAME_ENCODING): New. * config/arm/wince-cegcc.h (SUBTARGET_EXTRA_SPECS, EXTRA_OS_CPP_BUILTINS, TARGET_OS_CPP_BUILTINS, SUBTARGET_CPP_SPEC): Delete. * config/arm/t-wince-pe (pe.o): Add expr.h to dependencies. (cegcc1.o): Delete build rule. (MULTILIB_OPTIONS): Remove -mfpu=vfp. (TARGET_LIBGCC2_CFLAGS): Remove unneeded options. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/arm-protos.h trunk/cegcc/src/gcc/gcc/config/arm/arm.c trunk/cegcc/src/gcc/gcc/config/arm/arm.h trunk/cegcc/src/gcc/gcc/config/arm/arm.opt trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h trunk/cegcc/src/gcc/gcc/config/arm/pe.c trunk/cegcc/src/gcc/gcc/config/arm/pe.h trunk/cegcc/src/gcc/gcc/config/arm/pe.opt trunk/cegcc/src/gcc/gcc/config/arm/t-mingw32 trunk/cegcc/src/gcc/gcc/config/arm/t-wince-cegcc trunk/cegcc/src/gcc/gcc/config/arm/t-wince-pe trunk/cegcc/src/gcc/gcc/config/arm/wince-cegcc.h trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h trunk/cegcc/src/gcc/gcc/target-def.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-10-30 23:51:18 UTC (rev 760) @@ -1,16 +1,132 @@ 2006-10-30 Pedro Alves <ped...@po...> - * config/arm/pe-cxx.c: Fix indenting to match the original config/i386/winnt-cxx.c. + * target-def.h (TARGET_ATTRIBUTE_TABLE): Only define if not + defined before. + * config/arm/arm.c (arm_file_end): Give it external linkage. + (arm_handle_struct_attribute): New. + (arm_ms_bitfield_layout_p): New. + (TARGET_ATTRIBUTE_TABLE, TARGET_ASM_FILE_END, + TARGET_ENCODE_SECTION_INFO, TARGET_STRIP_NAME_ENCODING): Move + declarations to config/arm/arm.h. + (TARGET_MS_BITFIELD_LAYOUT_P): Define to + arm_ms_bitfield_layout_p. + (arm_return_in_memory): Replace #ifdef'ing on ARM_WINCE with + TARGET_RETURN_AGGREGATES_IN_MEMORY. + (arm_attribute_table): Add shared, ms_struct, gcc_struct + attributes. + Allow subtarget to add attributes using + SUBTARGET_ATTRIBUTE_TABLE. + (arm_elf_asm_constructor): Only compile on OBJECT_FORMAT_ELF. + (thumb_output_function_prologue): Call arm_pe_strip_name_encoding + instead of arm_strip_name_encoding. + (arm_handle_struct_attribute): New function. + (arm_ms_bitfield_layout_p): New function. + * config/arm/arm.h (TARGET_ASM_FILE_END, TARGET_ATTRIBUTE_TABLE, + TARGET_ENCODE_SECTION_INFO, TARGET_STRIP_NAME_ENCODING): Define. + * config/arm/t-wince-cegcc: Add cegcc1.o rule. + (TARGET_LIBGCC2_CFLAGS): Add -mwin32. + * config/arm/t-mingw32 (SYSTEM_INCLUDE_DIR): Delete. + (NATIVE_SYSTEM_HEADER_DIR): Likewise. + * config/arm/arm-protos.h (arm_file_end, + arm_pe_asm_named_section, arm_pe_section_type_flags, + arm_pe_strip_name_encoding, arm_pe_output_labelref, + arm_pe_handle_shared_attribute): Declare. + * config/arm/wince-pe.h: + (TARGET_VERSION): Set to "(arm Windows CE/Native SDK)". + (MULTILIB_DEFAULTS): Remove -mfpu=vfp. + (SUBTARGET_CPU_DEFAULT): Default to TARGET_CPU_arm8 (armv4). + (CPP_SPEC): Remove cegcc specifics. + (ASM_SPEC): Don't pass -cpu=iwmmxt to assembler when -mcpu=xscale + is used. + (SUBTARGET_EXTRA_SPECS, SUBTARGET_ASM_FLOAT_SPEC): Remove. + (TARGET_OS_CPP_BUILTINS): Add _stdcall, _fastcall and _cdecl. + (SUBTARGET_CPP_SPEC, HANDLE_SYSV_PRAGMA, + HANDLE_PRAGMA_PACK_PUSH_POP): Delete. + (STARTFILE_SPEC): Remove cegcc specifics. + (LIBGCC_SPEC): Likewise. + (LIB_SPEC): Likewise. + (COMMON_ASM_OP, ASM_OUTPUT_COMMON, ASM_DECLARE_OBJECT_NAME, + ASM_DECLARE_FUNCTION_NAME, ASM_OUTPUT_EXTERNAL, + ASM_OUTPUT_EXTERNAL_LIBCALL, ASM_OUTPUT_ALIGNED_BSS, + TARGET_ASM_FILE_END, SUPPORTS_ONE_ONLY, MULTIPLE_SYMBOL_SPACES): + Delete. + (ARM_MCOUNT_NAME): Define to _mcount to avoid conflicts. + (CHECK_STACK_LIMIT): Delete. + (TARGET_DEFAULT): Match Windows CE ABI with + MASK_MS_BITFIELD_LAYOUT and MASK_RETURN_AGGREGATES_IN_MEMORY. + (TARGET_SUBTARGET_DEFAULT): Delete. + (BIGGEST_FIELD_ALIGNMENT): Delete. + (SET_ASM_OP): Delete. + (DEFAULT_STRUCTURE_SIZE_BOUNDARY): Define to 8 as WinCE's ABI + requires. + (ASM_OUTPUT_DEF_FROM_DECLS, TARGET_USE_JCR_SECTION, + TARGET_USE_LOCAL_THUNK_ALIAS_P, SUBTARGET_ATTRIBUTE_TABLE): + Delete. + * config/arm/mingw32.h (STANDARD_INCLUDE_DIR, + STANDARD_INCLUDE_COMPONENT): Delete. + * config/arm/arm.opt: New option -mreturn-aggregates-in-memory. + * config/arm/pe.opt: New option -mms-bitfields. + * config/arm/pe.c (arm_pe_handle_shared_attribute): New. + (arm_pe_strip_name_encoding): New. + (arm_pe_output_labelref): Call arm_pe_strip_name_encoding instead + of arm_strip_name_encoding. + (arm_pe_unique_section): Likewise. + (arm_pe_section_type_flags): New. + (arm_pe_asm_named_section ): New. + (arm_pe_file_end): Call arm_file_end. + * config/arm/pe.h (HANDLE_SYSV_PRAGMA): New. + (HANDLE_PRAGMA_PACK_PUSH_POP): New. + (SUBTARGET_OVERRIDE_OPTIONS): New. + (TARGET_ASM_NAMED_SECTION): Set to arm_pe_asm_named_section + specialized version. + (TARGET_SECTION_TYPE_FLAGS): New. + (ASM_DECLARE_FUNCTION_NAME): Don't output -export to .drectve + directly. + Use arm_pe_record_exported_symbol instead. + (TARGET_ASM_FILE_END): Set to arm_pe_file_end. + (TARGET_ENCODE_SECTION_INFO): Set to arm_pe_encode_section_info. + (TARGET_STRIP_NAME_ENCODING): Set to arm_pe_strip_name_encoding. + (COMMON_ASM_OP): New. + (ASM_OUTPUT_COMMON): Don't output -export to .drectve directly. + Use arm_pe_record_exported_symbol instead. + (ASM_DECLARE_OBJECT_NAME): Likewise. + (ASM_OUTPUT_EXTERNAL): New. + (ASM_OUTPUT_EXTERNAL_LIBCALL): New. + (PROFILE_HOOK): New. + (ASM_OUTPUT_DEF_FROM_DECLS): New. + (SUPPORTS_ONE_ONLY). + (SUBTARGET_ATTRIBUTE_TABLE): New. + (TARGET_USE_LOCAL_THUNK_ALIAS_P): New. + (TARGET_USE_JCR_SECTION): New. + (SUBTARGET_ENCODE_SECTION_INFO): New. + (TARGET_STRIP_NAME_ENCODING): New. + * config/arm/wince-cegcc.h (SUBTARGET_EXTRA_SPECS, + EXTRA_OS_CPP_BUILTINS, TARGET_OS_CPP_BUILTINS, + SUBTARGET_CPP_SPEC): Delete. + * config/arm/t-wince-pe (pe.o): Add expr.h to dependencies. + (cegcc1.o): Delete build rule. + (MULTILIB_OPTIONS): Remove -mfpu=vfp. + (TARGET_LIBGCC2_CFLAGS): Remove unneeded options. + +2006-10-30 Pedro Alves <ped...@po...> + + * config/arm/pe-cxx.c: Fix indenting to match the original + config/i386/winnt-cxx.c. + 2006-10-17 Pedro Alves <ped...@po...> + * config/arm/wince-cegcc.h (STARTFILE_SPEC) : Add gcrt3.o instead of gcrt2.o. * config/arm/mingw32.h: Likewise. 2006-10-16 Danny Backx <dan...@us...> - * config/arm/wince-cegcc.h (LIB_SPEC) : Link -lgmon when called with -pg. + + * config/arm/wince-cegcc.h (LIB_SPEC) : Link -lgmon when called + with -pg. (STARTFILE_SPEC): Add gcrt2.o when called with -pg. 2006-10-12 Danny Backx <dan...@us...> + * config/arm/wince-cegcc.h (mno-cegcc): Remove option. Use the arm-wince-mingw32ce target instead. @@ -23,6 +139,6 @@ * cegcc-stubs.c: Likewise. * config.gcc: Use the originals instead of the new copies for the arm*-wince-cegcc case. - * config/arm/t-wince-cegcc: Make it empty, we now inherit the generic - t-wince-pe. + * config/arm/t-wince-cegcc: Make it empty, we now inherit the + generic t-wince-pe. * ChangeLog.ce: New file. Modified: trunk/cegcc/src/gcc/gcc/config/arm/arm-protos.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/arm-protos.h 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/arm-protos.h 2006-10-30 23:51:18 UTC (rev 760) @@ -35,12 +35,12 @@ extern void arm_asm_output_labelref (FILE *, const char *); extern unsigned long arm_current_func_type (void); extern HOST_WIDE_INT arm_compute_initial_elimination_offset (unsigned int, - unsigned int); + unsigned int); extern HOST_WIDE_INT thumb_compute_initial_elimination_offset (unsigned int, unsigned int); extern unsigned int arm_dbx_register_number (unsigned int); extern void arm_output_fn_unwind (FILE *, bool); - +extern void arm_file_end (void);; #ifdef TREE_CODE extern int arm_return_in_memory (tree); @@ -174,7 +174,10 @@ #endif /* Defined in pe.c. */ -extern void arm_pe_output_labelref (FILE *stream, const char *name); +extern void arm_pe_asm_named_section (const char *, unsigned int, tree); +extern unsigned int arm_pe_section_type_flags (tree, const char *, int); +extern const char *arm_pe_strip_name_encoding (const char *); +extern void arm_pe_output_labelref (FILE *, const char *); extern int arm_pe_dllexport_name_p (const char *); extern int arm_pe_dllimport_name_p (const char *); extern void arm_pe_record_external_function (tree, const char *); @@ -184,10 +187,8 @@ extern int arm_pe_dllexport_name_p (const char *); extern int arm_pe_dllimport_name_p (const char *); extern bool arm_pe_valid_dllimport_attribute_p (tree); -extern tree arm_pe_handle_selectany_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, - bool *no_add_attrs); +extern tree arm_pe_handle_selectany_attribute (tree *, tree, tree, int, bool *); +extern tree arm_pe_handle_shared_attribute (tree *, tree, tree, int, bool *); /* In pe-cxx.c and pe-stubs.c */ extern void arm_pe_adjust_class_at_definition (tree); Modified: trunk/cegcc/src/gcc/gcc/config/arm/arm.c =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/arm.c 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/arm.c 2006-10-30 23:51:18 UTC (rev 760) @@ -152,8 +152,6 @@ static void arm_encode_section_info (tree, rtx, int); #endif -static void arm_file_end (void); - #ifdef AOF_ASSEMBLER static void aof_globalize_label (FILE *, const char *); static void aof_dump_imports (FILE *); @@ -190,6 +188,8 @@ static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode); static bool arm_cannot_copy_insn_p (rtx); static bool arm_tls_symbol_p (rtx x); +static tree arm_handle_struct_attribute (tree *, tree, tree, int, bool *); +static bool arm_ms_bitfield_layout_p (tree record_type); /* Initialize the GCC target structure. */ @@ -198,12 +198,6 @@ #define TARGET_MERGE_DECL_ATTRIBUTES merge_dllimport_decl_attributes #endif -#undef TARGET_ATTRIBUTE_TABLE -#define TARGET_ATTRIBUTE_TABLE arm_attribute_table - -#undef TARGET_ASM_FILE_END -#define TARGET_ASM_FILE_END arm_file_end - #ifdef AOF_ASSEMBLER #undef TARGET_ASM_BYTE_OP #define TARGET_ASM_BYTE_OP "\tDCB\t" @@ -243,6 +237,7 @@ #undef TARGET_DEFAULT_TARGET_FLAGS #define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_SCHED_PROLOG) + #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION arm_handle_option @@ -255,16 +250,6 @@ #undef TARGET_SCHED_ADJUST_COST #define TARGET_SCHED_ADJUST_COST arm_adjust_cost -#undef TARGET_ENCODE_SECTION_INFO -#ifdef ARM_PE -#define TARGET_ENCODE_SECTION_INFO arm_pe_encode_section_info -#else -#define TARGET_ENCODE_SECTION_INFO arm_encode_section_info -#endif - -#undef TARGET_STRIP_NAME_ENCODING -#define TARGET_STRIP_NAME_ENCODING arm_strip_name_encoding - #undef TARGET_ASM_INTERNAL_LABEL #define TARGET_ASM_INTERNAL_LABEL arm_internal_label @@ -375,6 +360,9 @@ #define TARGET_HAVE_TLS true #endif +#undef TARGET_MS_BITFIELD_LAYOUT_P +#define TARGET_MS_BITFIELD_LAYOUT_P arm_ms_bitfield_layout_p + #undef TARGET_CANNOT_FORCE_CONST_MEM #define TARGET_CANNOT_FORCE_CONST_MEM arm_tls_referenced_p @@ -2544,9 +2532,11 @@ if (TREE_CODE (type) == VECTOR_TYPE) return (size < 0 || size > (4 * UNITS_PER_WORD)); - /* For the arm-wince targets we choose to be compatible with Microsoft's - ARM and Thumb compilers, which always return aggregates in memory. */ -#ifndef ARM_WINCE + if (TARGET_RETURN_AGGREGATES_IN_MEMORY + && (TREE_CODE (type) == RECORD_TYPE + || TREE_CODE (type) == UNION_TYPE)) + return 1; + /* All structures/unions bigger than one word are returned in memory. Also catch the case where int_size_in_bytes returns -1. In this case the aggregate is either huge or of variable size, and in either case @@ -2623,7 +2613,6 @@ return 0; } -#endif /* not ARM_WINCE */ /* Return all other types in memory. */ return 1; @@ -2849,7 +2838,13 @@ { "dllimport", 0, 0, false, false, false, handle_dll_attribute }, { "dllexport", 0, 0, false, false, false, handle_dll_attribute }, { "notshared", 0, 0, false, true, false, arm_handle_notshared_attribute }, + { "shared", 0, 0, true, false, false, arm_pe_handle_shared_attribute }, #endif + { "ms_struct", 0, 0, false, false, false, arm_handle_struct_attribute }, + { "gcc_struct", 0, 0, false, false, false, arm_handle_struct_attribute }, +#ifdef SUBTARGET_ATTRIBUTE_TABLE + SUBTARGET_ATTRIBUTE_TABLE, +#endif { NULL, 0, 0, false, false, false, NULL } }; @@ -11302,7 +11297,7 @@ return default_assemble_integer (x, size, aligned_p); } - +#ifdef OBJECT_FORMAT_ELF /* Add a function to the list of static constructors. */ static void @@ -11322,6 +11317,8 @@ fputs ("(target1)\n", asm_out_file); } #endif + +#endif /* A finite state machine takes care of noticing whether or not instructions can be conditionally executed, and thus decrease execution time and code @@ -13850,7 +13847,7 @@ fprintf (f, "\t.code\t16\n"); #ifdef ARM_PE if (arm_pe_dllexport_name_p (name)) - name = arm_strip_name_encoding (name); + name = arm_pe_strip_name_encoding (name); #endif asm_fprintf (f, "\t.globl %s%U%s\n", STUB_NAME, name); fprintf (f, "\t.thumb_func\n"); @@ -14358,7 +14355,7 @@ asm_fprintf (stream, "%U%s", name); } -static void +void arm_file_end (void) { int regno; @@ -15487,4 +15484,49 @@ return FALSE; } +/* Handle a "ms_struct" or "gcc_struct" attribute; arguments as in + struct attribute_spec.handler. */ +static tree +arm_handle_struct_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +{ + tree *type = NULL; + if (DECL_P (*node)) + { + if (TREE_CODE (*node) == TYPE_DECL) + type = &TREE_TYPE (*node); + } + else + type = node; + + if (!(type && (TREE_CODE (*type) == RECORD_TYPE + || TREE_CODE (*type) == UNION_TYPE))) + { + warning (OPT_Wattributes, "%qs attribute ignored", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + + else if ((is_attribute_p ("ms_struct", name) + && lookup_attribute ("gcc_struct", TYPE_ATTRIBUTES (*type))) + || ((is_attribute_p ("gcc_struct", name) + && lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (*type))))) + { + warning (OPT_Wattributes, "%qs incompatible attribute ignored", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + + return NULL_TREE; +} + +static bool +arm_ms_bitfield_layout_p (tree record_type) +{ + return (TARGET_MS_BITFIELD_LAYOUT && + !lookup_attribute ("gcc_struct", TYPE_ATTRIBUTES (record_type))) + || lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (record_type)); +} + #include "gt-arm.h" Modified: trunk/cegcc/src/gcc/gcc/config/arm/arm.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/arm.h 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/arm.h 2006-10-30 23:51:18 UTC (rev 760) @@ -2340,6 +2340,11 @@ } \ while (0) +#define TARGET_ASM_FILE_END arm_file_end +#define TARGET_ATTRIBUTE_TABLE arm_attribute_table +#define TARGET_ENCODE_SECTION_INFO arm_encode_section_info +#define TARGET_STRIP_NAME_ENCODING arm_strip_name_encoding + #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN /* To support -falign-* switches we need to use .p2align so that alignment directives in code sections will be padded Modified: trunk/cegcc/src/gcc/gcc/config/arm/arm.opt =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/arm.opt 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/arm.opt 2006-10-30 23:51:18 UTC (rev 760) @@ -153,3 +153,7 @@ mwords-little-endian Target Report RejectNegative Mask(LITTLE_WORDS) Assume big endian bytes, little endian words + +mreturn-aggregates-in-memory +Target Report Mask(RETURN_AGGREGATES_IN_MEMORY) +Return aggregates in memory Modified: trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h 2006-10-30 23:51:18 UTC (rev 760) @@ -36,13 +36,6 @@ } \ while (0) -/* Override the standard choice of /usr/include as the default prefix - to try when searching for header files. */ -#undef STANDARD_INCLUDE_DIR -#define STANDARD_INCLUDE_DIR "/mingw/include" -#undef STANDARD_INCLUDE_COMPONENT -#define STANDARD_INCLUDE_COMPONENT "MINGW" - #undef CPP_SPEC #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} \ %{!nostdinc: -idirafter ../include/w32api%s -idirafter ../../include/w32api%s }" Modified: trunk/cegcc/src/gcc/gcc/config/arm/pe.c =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/pe.c 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/pe.c 2006-10-30 23:51:18 UTC (rev 760) @@ -61,6 +61,23 @@ #define DLL_EXPORT_PREFIX "@e." #endif +/* Handle a "shared" attribute; + arguments as in struct attribute_spec.handler. */ +tree +arm_pe_handle_shared_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) +{ + if (TREE_CODE (*node) != VAR_DECL) + { + warning (OPT_Wattributes, "%qs attribute only applies to variables", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + + return NULL_TREE; +} + /* Handle a "selectany" attribute; arguments as in struct attribute_spec.handler. */ tree @@ -290,6 +307,19 @@ && arm_pe_dllimport_name_p (XSTR (XEXP (XEXP (rtl, 0), 0), 0)))); } +const char * +arm_pe_strip_name_encoding (const char *str) +{ + if (strncmp (str, DLL_IMPORT_PREFIX, strlen (DLL_IMPORT_PREFIX)) + == 0) + str += strlen (DLL_IMPORT_PREFIX); + else if (strncmp (str, DLL_EXPORT_PREFIX, strlen (DLL_EXPORT_PREFIX)) + == 0) + str += strlen (DLL_EXPORT_PREFIX); + + return arm_strip_name_encoding (str); +} + /* Output a reference to a label. Symbols don't have a prefix (unless they are marked dllimport or dllexport). */ @@ -299,12 +329,12 @@ == 0) /* A dll import */ { - asm_fprintf (stream, "__imp_%U%s", arm_strip_name_encoding (name)); + asm_fprintf (stream, "__imp_%U%s", arm_pe_strip_name_encoding (name)); } else /* Everything else. */ { - asm_fprintf (stream, "%U%s", arm_strip_name_encoding (name)); + asm_fprintf (stream, "%U%s", arm_pe_strip_name_encoding (name)); } } @@ -316,7 +346,7 @@ char *string; name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); - name = arm_strip_name_encoding (name); + name = arm_pe_strip_name_encoding (name); /* The object is put in, for example, section .text$foo. The linker will then ultimately place them in .text @@ -337,18 +367,122 @@ DECL_SECTION_NAME (decl) = build_string (len, string); } +/* Select a set of attributes for section NAME based on the properties + of DECL and whether or not RELOC indicates that DECL's initializer + might contain runtime relocations. + + We make the section read-only and executable for a function decl, + read-only for a const data decl, and writable for a non-const data decl. + + If the section has already been defined, to not allow it to have + different attributes, as (1) this is ambiguous since we're not seeing + all the declarations up front and (2) some assemblers (e.g. SVR4) + do not recognize section redefinitions. */ +/* ??? This differs from the "standard" PE implementation in that we + handle the SHARED variable attribute. Should this be done for all + PE targets? */ + +#define SECTION_PE_SHARED SECTION_MACH_DEP + +unsigned int +arm_pe_section_type_flags (tree decl, const char *name, int reloc) +{ + static htab_t htab; + unsigned int flags; + unsigned int **slot; + + /* The names we put in the hashtable will always be the unique + versions given to us by the stringtable, so we can just use + their addresses as the keys. */ + if (!htab) + htab = htab_create (31, htab_hash_pointer, htab_eq_pointer, NULL); + + if (decl && TREE_CODE (decl) == FUNCTION_DECL) + flags = SECTION_CODE; + else if (decl && decl_readonly_section (decl, reloc)) + flags = 0; + else + { + flags = SECTION_WRITE; + + if (decl && TREE_CODE (decl) == VAR_DECL + && lookup_attribute ("shared", DECL_ATTRIBUTES (decl))) + flags |= SECTION_PE_SHARED; + } + + if (decl && DECL_ONE_ONLY (decl)) + flags |= SECTION_LINKONCE; + + /* See if we already have an entry for this section. */ + slot = (unsigned int **) htab_find_slot (htab, name, INSERT); + if (!*slot) + { + *slot = (unsigned int *) xmalloc (sizeof (unsigned int)); + **slot = flags; + } + else + { + if (decl && **slot != flags) + error ("%q+D causes a section type conflict", decl); + } + + return flags; +} + +void +arm_pe_asm_named_section (const char *name, unsigned int flags, + tree decl) +{ + char flagchars[8], *f = flagchars; + + if ((flags & (SECTION_CODE | SECTION_WRITE)) == 0) + /* readonly data */ + { + *f++ ='d'; /* This is necessary for older versions of gas. */ + *f++ ='r'; + } + else + { + if (flags & SECTION_CODE) + *f++ = 'x'; + if (flags & SECTION_WRITE) + *f++ = 'w'; + if (flags & SECTION_PE_SHARED) + *f++ = 's'; + } + + *f = '\0'; + + fprintf (asm_out_file, "\t.section\t%s,\"%s\"\n", name, flagchars); + + if (flags & SECTION_LINKONCE) + { + /* Functions may have been compiled at various levels of + optimization so we can't use `same_size' here. + Instead, have the linker pick one, without warning. + If 'selectany' attribute has been specified, MS compiler + sets 'discard' characteristic, rather than telling linker + to warn of size or content mismatch, so do the same. */ + bool discard = (flags & SECTION_CODE) + || lookup_attribute ("selectany", + DECL_ATTRIBUTES (decl)); + fprintf (asm_out_file, "\t.linkonce %s\n", + (discard ? "discard" : "same_size")); + } +} + /* The Microsoft linker requires that every function be marked as -DT_FCN. When using gas on cygwin, we must emit appropriate .type -directives. */ + DT_FCN. When using gas on cygwin, we must emit appropriate .type + directives. */ #include "gsyms.h" /* Mark a function appropriately. This should only be called for -functions for which we are not emitting COFF debugging information. -FILE is the assembler output file, NAME is the name of the -function, and PUBLIC is nonzero if the function is globally -visible. */ + functions for which we are not emitting COFF debugging information. + FILE is the assembler output file, NAME is the name of the + function, and PUBLIC is nonzero if the function is globally + visible. */ void arm_pe_declare_function_type (FILE *file, const char *name, int public) @@ -372,10 +506,10 @@ static GTY(()) struct extern_list *extern_head; /* Assemble an external function reference. We need to keep a list of -these, so that we can output the function types at the end of the -assembly. We can't output the types now, because we might see a -definition of the function later on and emit debugging information -for it then. */ + these, so that we can output the function types at the end of the + assembly. We can't output the types now, because we might see a + definition of the function later on and emit debugging information + for it then. */ void arm_pe_record_external_function (tree decl, const char *name) @@ -401,10 +535,10 @@ static GTY(()) struct export_list *export_head; /* Assemble an export symbol entry. We need to keep a list of -these, so that we can output the export list at the end of the -assembly. We used to output these export symbols in each function, -but that causes problems with GNU ld when the sections are -linkonce. */ + these, so that we can output the export list at the end of the + assembly. We used to output these export symbols in each function, + but that causes problems with GNU ld when the sections are + linkonce. */ void arm_pe_record_exported_symbol (const char *name, int is_data) @@ -419,43 +553,43 @@ } /* This is called at the end of assembly. For each external function -which has not been defined, we output a declaration now. We also -output the .drectve section. */ + which has not been defined, we output a declaration now. We also + output the .drectve section. */ void arm_pe_file_end (void) { struct extern_list *p; -// ix86_file_end (); + arm_file_end (); for (p = extern_head; p != NULL; p = p->next) - { - tree decl; + { + tree decl; - decl = p->decl; + decl = p->decl; - /* Positively ensure only one declaration for any given symbol. */ - if (! TREE_ASM_WRITTEN (decl) - && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) - { - TREE_ASM_WRITTEN (decl) = 1; - arm_pe_declare_function_type (asm_out_file, p->name, - TREE_PUBLIC (decl)); + /* Positively ensure only one declaration for any given symbol. */ + if (! TREE_ASM_WRITTEN (decl) + && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) + { + TREE_ASM_WRITTEN (decl) = 1; + arm_pe_declare_function_type (asm_out_file, p->name, + TREE_PUBLIC (decl)); + } } - } if (export_head) - { - struct export_list *q; - drectve_section (); - for (q = export_head; q != NULL; q = q->next) { - fprintf (asm_out_file, "\t.ascii \" -export:%s%s\"\n", - arm_strip_name_encoding (q->name), - (q->is_data) ? ",data" : ""); + struct export_list *q; + drectve_section (); + for (q = export_head; q != NULL; q = q->next) + { + fprintf (asm_out_file, "\t.ascii \" -export:%s%s\"\n", + arm_pe_strip_name_encoding (q->name), + (q->is_data) ? ",data" : ""); + } } - } } #include "gt-pe.h" Modified: trunk/cegcc/src/gcc/gcc/config/arm/pe.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/pe.h 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/pe.h 2006-10-30 23:51:18 UTC (rev 760) @@ -60,12 +60,36 @@ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE 16 + +/* Handle #pragma weak and #pragma pack. */ +#define HANDLE_SYSV_PRAGMA 1 +#define HANDLE_PRAGMA_PACK_PUSH_POP 1 + +union tree_node; +#define TREE union tree_node * + + /* r11 is fixed. */ #undef SUBTARGET_CONDITIONAL_REGISTER_USAGE #define SUBTARGET_CONDITIONAL_REGISTER_USAGE \ fixed_regs [11] = 1; \ call_used_regs [11] = 1; +/* Don't allow flag_pic to propagate since gas may produce invalid code + otherwise. */ + +#undef SUBTARGET_OVERRIDE_OPTIONS +#define SUBTARGET_OVERRIDE_OPTIONS \ +do { \ + if (flag_pic) \ + { \ + warning (0, "-f%s ignored for target (all code is position independent)",\ + (flag_pic > 1) ? "PIC" : "pic"); \ + flag_pic = 0; \ + } \ +} while (0) \ + + /* PE/COFF uses explicit import from shared libraries. */ #define MULTIPLE_SYMBOL_SPACES 1 @@ -77,7 +101,12 @@ /* Switch into a generic section. */ #undef TARGET_ASM_NAMED_SECTION -#define TARGET_ASM_NAMED_SECTION default_pe_asm_named_section +#define TARGET_ASM_NAMED_SECTION arm_pe_asm_named_section + +/* Select attributes for named sections. */ +#undef TARGET_SECTION_TYPE_FLAGS +#define TARGET_SECTION_TYPE_FLAGS arm_pe_section_type_flags + #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true @@ -85,62 +114,120 @@ #undef ASM_OUTPUT_LABELREF #define ASM_OUTPUT_LABELREF arm_pe_output_labelref -/* Output a function definition label. */ -#undef ASM_DECLARE_FUNCTION_NAME -#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \ - do \ - { \ - if (arm_pe_dllexport_name_p (NAME)) \ - { \ - drectve_section (); \ - fprintf (STREAM, "\t.ascii \" -export:%s\"\n", \ - arm_strip_name_encoding (NAME)); \ - function_section (DECL); \ - } \ - ARM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL); \ - if (TARGET_THUMB) \ - fprintf (STREAM, "\t.code 16\n"); \ - ASM_OUTPUT_LABEL (STREAM, NAME); \ - } \ - while (0) +/* Write the extra assembler code needed to declare a function + properly. If we are generating SDB debugging information, this + will happen automatically, so we only need to handle other cases. */ +#undef ASM_DECLARE_FUNCTION_NAME +#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \ + do \ + { \ + if (arm_pe_dllexport_name_p (NAME)) \ + arm_pe_record_exported_symbol (NAME, 0); \ + if (write_symbols != SDB_DEBUG) \ + arm_pe_declare_function_type (STREAM, NAME, TREE_PUBLIC (DECL)); \ + ARM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL); \ + if (TARGET_THUMB) \ + fprintf (STREAM, "\t.code 16\n"); \ + ASM_OUTPUT_LABEL (STREAM, NAME); \ + } \ + while (0) +/* Output function declarations at the end of the file. */ +#undef TARGET_ASM_FILE_END +#define TARGET_ASM_FILE_END arm_pe_file_end + +#undef TARGET_ENCODE_SECTION_INFO +#define TARGET_ENCODE_SECTION_INFO arm_pe_encode_section_info + +#undef TARGET_STRIP_NAME_ENCODING +#define TARGET_STRIP_NAME_ENCODING arm_pe_strip_name_encoding + +#undef COMMON_ASM_OP +#define COMMON_ASM_OP "\t.comm\t" + /* Output a common block. */ #undef ASM_OUTPUT_COMMON #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \ - do \ - { \ - if (arm_pe_dllexport_name_p (NAME)) \ - { \ - drectve_section (); \ - fprintf ((STREAM), "\t.ascii \" -export:%s\"\n",\ - arm_strip_name_encoding (NAME)); \ - } \ - if (! arm_pe_dllimport_name_p (NAME)) \ - { \ - fprintf ((STREAM), "\t.comm\t"); \ - assemble_name ((STREAM), (NAME)); \ - asm_fprintf ((STREAM), ", %d\t%@ %d\n", \ +do { \ + if (arm_pe_dllexport_name_p (NAME)) \ + arm_pe_record_exported_symbol (NAME, 1); \ + if (! arm_pe_dllimport_name_p (NAME)) \ + { \ + fprintf ((STREAM), "\t.comm\t"); \ + assemble_name ((STREAM), (NAME)); \ + asm_fprintf ((STREAM), ", %d\t%@ %d\n", \ (int)(ROUNDED), (int)(SIZE)); \ - } \ - } \ - while (0) + } \ +} while (0) /* Output the label for an initialized variable. */ -#undef ASM_DECLARE_OBJECT_NAME -#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \ - do \ - { \ - if (arm_pe_dllexport_name_p (NAME)) \ - { \ - enum in_section save_section = in_section; \ - drectve_section (); \ - fprintf (STREAM, "\t.ascii \" -export:%s\"\n",\ - arm_strip_name_encoding (NAME)); \ - switch_to_section (save_section, (DECL)); \ - } \ - ASM_OUTPUT_LABEL ((STREAM), (NAME)); \ - } \ - while (0) +#undef ASM_DECLARE_OBJECT_NAME +#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \ + do { \ + if (arm_pe_dllexport_name_p (NAME)) \ + arm_pe_record_exported_symbol (NAME, 1); \ + ASM_OUTPUT_LABEL ((STREAM), (NAME)); \ + } while (0) + +/* Add an external function to the list of functions to be declared at +the end of the file. */ +#undef ASM_OUTPUT_EXTERNAL +#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \ + do \ + { \ + if (TREE_CODE (DECL) == FUNCTION_DECL) \ + arm_pe_record_external_function ((DECL), (NAME)); \ + } \ + while (0) + +/* Declare the type properly for any external libcall. */ +#undef ASM_OUTPUT_EXTERNAL_LIBCALL +#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ + arm_pe_declare_function_type (FILE, XSTR (FUN, 0), 1) + +#undef PROFILE_HOOK +#define PROFILE_HOOK(LABEL) \ + if (MAIN_NAME_P (DECL_NAME (current_function_decl))) \ + { \ + emit_call_insn (gen_rtx_CALL (VOIDmode, \ + gen_rtx_MEM (FUNCTION_MODE, \ + gen_rtx_SYMBOL_REF (Pmode, "_monstartup")), \ + const0_rtx)); \ + } + +/* This implements the `alias' attribute. */ +#undef ASM_OUTPUT_DEF_FROM_DECLS +#define ASM_OUTPUT_DEF_FROM_DECLS(STREAM, DECL, TARGET) \ + do \ + { \ + const char *alias; \ + rtx rtlname = XEXP (DECL_RTL (DECL), 0); \ + if (GET_CODE (rtlname) == SYMBOL_REF) \ + alias = XSTR (rtlname, 0); \ + else \ + abort (); \ + if (TREE_CODE (DECL) == FUNCTION_DECL) \ + arm_pe_declare_function_type (STREAM, alias, \ + TREE_PUBLIC (DECL)); \ + ASM_OUTPUT_DEF (STREAM, alias, IDENTIFIER_POINTER (TARGET)); \ + } while (0) + +#define SUPPORTS_ONE_ONLY 1 + +#define SUBTARGET_ATTRIBUTE_TABLE \ + /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ \ + { "selectany", 0, 0, true, false, false, arm_pe_handle_selectany_attribute } + +/* Decide whether it is safe to use a local alias for a virtual function + when constructing thunks. */ +#undef TARGET_USE_LOCAL_THUNK_ALIAS_P +#define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) (!DECL_ONE_ONLY (DECL)) + +/* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true, + but for .jcr section to work we also need crtbegin and crtend + objects. */ +#define TARGET_USE_JCR_SECTION 0 + /* Support the ctors/dtors and other sections. */ @@ -170,6 +257,24 @@ } \ } +/* Define this macro if references to a symbol must be treated + differently depending on something about the variable or + function named by the symbol (such as what section it is in). + + We must mark dll symbols specially. Definitions of + dllexport'd objects install some info in the .drectve section. + References to dllimport'd objects are fetched indirectly via + __imp_. If both are declared, dllexport overrides. This is also + needed to implement one-only vtables: they go into their own + section and we need to set DECL_SECTION_NAME so we do that here. + Note that we can be called twice on the same decl. */ + +#undef SUBTARGET_ENCODE_SECTION_INFO +#define SUBTARGET_ENCODE_SECTION_INFO arm_pe_encode_section_info + +#undef TARGET_STRIP_NAME_ENCODING +#define TARGET_STRIP_NAME_ENCODING arm_pe_strip_name_encoding + /* Switch to SECTION (an `enum in_section'). ??? This facility should be provided by GCC proper. Modified: trunk/cegcc/src/gcc/gcc/config/arm/pe.opt =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/pe.opt 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/pe.opt 2006-10-30 23:51:18 UTC (rev 760) @@ -1,6 +1,6 @@ ; PE-specific options for the ARM port -; Copyright (C) 2005 Free Software Foundation, Inc. +; Copyright (C) 2005,2006 Free Software Foundation, Inc. ; ; This file is part of GCC. ; @@ -22,3 +22,7 @@ mnop-fun-dllimport Target Report Mask(NOP_FUN_DLLIMPORT) Ignore dllimport attribute for functions + +mms-bitfields +Target Report Mask(MS_BITFIELD_LAYOUT) +Use native (MS) bitfield layout Modified: trunk/cegcc/src/gcc/gcc/config/arm/t-mingw32 =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/t-mingw32 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/t-mingw32 2006-10-30 23:51:18 UTC (rev 760) @@ -1,2 +1 @@ -# Match SYSTEM_INCLUDE_DIR -NATIVE_SYSTEM_HEADER_DIR = /mingw/include + Modified: trunk/cegcc/src/gcc/gcc/config/arm/t-wince-cegcc =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/t-wince-cegcc 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/t-wince-cegcc 2006-10-30 23:51:18 UTC (rev 760) @@ -0,0 +1,7 @@ +cegcc1.o: $(srcdir)/config/arm/cegcc1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(TM_P_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/arm/cegcc1.c + +#Needed because we include <windows.h> +TARGET_LIBGCC2_CFLAGS += -mwin32 Modified: trunk/cegcc/src/gcc/gcc/config/arm/t-wince-pe =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/t-wince-pe 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/t-wince-pe 2006-10-30 23:51:18 UTC (rev 760) @@ -1,5 +1,4 @@ LIB1ASMSRC = arm/lib1funcs.asm - LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \ _call_via_rX _interwork_call_via_rX \ _lshrdi3 _ashrdi3 _ashldi3 \ @@ -7,15 +6,6 @@ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ _fixsfsi _fixunssfsi _floatdidf _floatdisf -#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \ -# _call_via_rX _interwork_call_via_rX \ -# _lshrdi3 _ashrdi3 _ashldi3 \ -# _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ -# _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ -# _fixsfsi _fixunssfsi _floatdidf _floatdisf \ -# _divdi3 _udivmoddi4 _udivdi3 _umoddi3 _moddi3 _muldi3 _negdi2 \ -# _cmpdi2 _fixdfdi _fixsfdi _fixunsdfdi _fixunssfdi - # We want fine grained libraries, so use the new code to build the # floating point emulation libraries. FPBIT = fp-bit.c @@ -35,12 +25,8 @@ echo '#endif' >> dp-bit.c cat $(srcdir)/config/fp-bit.c >> dp-bit.c -#pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ -# $(RTL_H) output.h flags.h $(TREE_H) expr.h toplev.h $(TM_P_H) -# $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c - pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) expr.h flags.h \ $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(srcdir)/config/arm/pe.c @@ -57,14 +43,9 @@ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(srcdir)/config/arm/pe-stubs.c -cegcc1.o: $(srcdir)/config/arm/cegcc1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TM_P_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/arm/cegcc1.c +MULTILIB_OPTIONS = +MULTILIB_DIRNAMES = -MULTILIB_OPTIONS = mfpu=vfp -#MULTILIB_DIRNAMES = fpu -#MULTILIB_EXTRA_OPTS = mfpu=vfp # Note - Thumb multilib omitted because Thumb support for # arm-wince-pe target does not appear to be working in binutils # yet... @@ -74,5 +55,4 @@ LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -mwin32 -fno-leading-underscore \ - -fms-extensions -fdollars-in-identifiers +TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc Modified: trunk/cegcc/src/gcc/gcc/config/arm/wince-cegcc.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/wince-cegcc.h 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/wince-cegcc.h 2006-10-30 23:51:18 UTC (rev 760) @@ -33,35 +33,6 @@ %{!nostdinc:%{!mno-win32: -idirafter ../include/w32api%s -idirafter ../../include/w32api%s }} \ " -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ - { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \ - { "mingw_include_path", DEFAULT_TARGET_MACHINE } - -#define EXTRA_OS_CPP_BUILTINS() - -#undef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define ("_M_ARM=1"); \ - builtin_define ("ARM=1"); \ - builtin_define_std ("UNDER_CE"); \ - builtin_define ("_UNICODE"); \ - builtin_define_std ("UNICODE"); \ - builtin_define ("__stdcall=__attribute__((__cdecl__))"); \ - builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ - /* Even though linkonce works with static libs, this is needed \ - to compare typeinfo symbols across dll boundaries. */ \ - builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ - EXTRA_OS_CPP_BUILTINS (); \ - } \ - while (0) - -#undef SUBTARGET_CPP_SPEC -#define SUBTARGET_CPP_SPEC " -D__cegcc__ -D__pe__" - -/* Now we define the strings used to build the spec file. */ #undef STARTFILE_SPEC #define STARTFILE_SPEC "\ %{shared|mdll:dllcrt1%O%s } \ @@ -76,10 +47,10 @@ "%{mthreads:-lcegccthrd} %{!static: -lcegcc } -lgcc" /* We have to dynamic link to get to the system DLLs. All of libc, libm, -the Unix stuff is in cegcc.dll. The import library is called -'libcegcc.dll.a'. For Windows applications, include more libraries, but -always include coredll. We'd like to specify subsystem windows to -ld, but that doesn't work just yet. */ + the Unix stuff is in cegcc.dll. The import library is called + 'libcegcc.dll.a'. For Windows applications, include more libraries, but + always include coredll. We'd like to specify subsystem windows to + ld, but that doesn't work just yet. */ #undef LIB_SPEC #define LIB_SPEC "%{static: -lm -lc} \ Modified: trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2006-10-30 23:51:18 UTC (rev 760) @@ -21,43 +21,44 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#undef TARGET_DEFAULT -#define TARGET_DEFAULT (MASK_NOP_FUN_DLLIMPORT) +/* Enable WinCE specific code. */ +#define ARM_WINCE 1 #undef MATH_LIBRARY #define MATH_LIBRARY "" -#define NO_IMPLICIT_EXTERN_C - #define TARGET_EXECUTABLE_SUFFIX ".exe" #undef TARGET_VERSION -#define TARGET_VERSION fprintf (stderr, " (arm cegcc)"); +#define TARGET_VERSION fprintf (stderr, " (arm Windows CE/Native SDK)"); -/* pedro: defined empty in arm.h, redefined in pe.h, and then here */ #undef SUBTARGET_CONDITIONAL_REGISTER_USAGE #define SUBTARGET_CONDITIONAL_REGISTER_USAGE #undef MULTILIB_DEFAULTS #define MULTILIB_DEFAULTS \ - { "marm", "mlittle-endian", "msoft-float", "mfpu=vfp", "mno-thumb-interwork" } + { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } + +#undef SUBTARGET_CPU_DEFAULT +#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm8 + +/* We must store doubles in little endian order. Specifying the default + of VFP assures that. To guaranty VFP insns won't be emitted by default, + we default to float-abi=soft. */ #undef FPUTYPE_DEFAULT #define FPUTYPE_DEFAULT FPUTYPE_VFP #undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \ -%{mno-win32:%{mno-cegcc: %emno-cegcc and mno-win32 are not compatible}} \ -%{mno-cegcc: %{!ansi:%{mthreads: -D_MT }}} \ -%{!mno-cegcc: -D__CEGCC32__ -D__CEGCC__ %{!ansi:-Dunix} -D__unix__ -D__unix } \ -%{mwin32|mno-cegcc: -DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ } \ -%{!nostdinc:%{!mno-win32|mno-cegcc: -idirafter ../include/w32api%s -idirafter ../../include/w32api%s }} \ +#define CPP_SPEC "%(cpp_cpu) \ +-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ \ +%{!nostdinc: -idirafter ../include/w32api%s -idirafter ../../include/w32api%s } \ " -#undef ASM_SPEC +#ifndef ASM_SPEC #define ASM_SPEC "\ %{mbig-endian:-EB} \ %{mlittle-endian:-EL} \ -%{mcpu=xscale:-mcpu=iwmmxt; mcpu=*:-mcpu=%*} \ +%{mcpu=*:-mcpu=%*} \ %{march=*:-march=%*} \ %{mapcs-*:-mapcs-%*} \ %(subtarget_asm_float_spec) \ @@ -65,16 +66,8 @@ %{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \ %{mfloat-abi=*} %{mfpu=*} \ %(subtarget_extra_asm_spec)" +#endif -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ - { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \ - { "mingw_include_path", DEFAULT_TARGET_MACHINE } - -#undef SUBTARGET_ASM_FLOAT_SPEC -#define SUBTARGET_ASM_FLOAT_SPEC "\ -%{!mfpu=*:-mfpu=vfp}" - #define EXTRA_OS_CPP_BUILTINS() #define TARGET_OS_CPP_BUILTINS() \ @@ -82,11 +75,21 @@ { \ builtin_define ("_M_ARM=1"); \ builtin_define ("ARM=1"); \ + /* We currently defined UNDER_CE to a non-value, and it seems \ + MSVC2005 does the same. */ \ builtin_define_std ("UNDER_CE"); \ builtin_define ("_UNICODE"); \ builtin_define_std ("UNICODE"); \ + /* Let's just ignore stdcall, and fastcall. */ \ builtin_define ("__stdcall=__attribute__((__cdecl__))"); \ - builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ + builtin_define ("__fastcall=__attribute__((__cdecl__))"); \ + builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ + if (!flag_iso) \ + { \ + builtin_define ("_stdcall=__attribute__((__cdecl__))"); \ + builtin_define ("_fastcall=__attribute__((__cdecl__))"); \ + builtin_define ("_cdecl=__attribute__((__cdecl__))"); \ + } \ /* Even though linkonce works with static libs, this is needed \ to compare typeinfo symbols across dll boundaries. */ \ builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ @@ -94,36 +97,18 @@ } \ while (0) -#undef SUBTARGET_CPP_SPEC -#define SUBTARGET_CPP_SPEC " -D__pe__ " - -/* Handle #pragma weak and #pragma pack. */ -#define HANDLE_SYSV_PRAGMA 1 -#define HANDLE_PRAGMA_PACK_PUSH_POP 1 - /* Now we define the strings used to build the spec file. */ #undef STARTFILE_SPEC -#define STARTFILE_SPEC "\ - %{shared|mdll: %{!mno-cegcc:dllcrt1%O%s} %{mno-cegcc:dllcrt2%O%s} } \ - %{!shared: %{!mdll: \ - %{!mno-cegcc:crt0%O%s} %{mno-cegcc:crt2%O%s} \ - %{mthreads:crtmt%O%s} %{!mthreads:crtst%O%s} \ - } } \ - " +#define STARTFILE_SPEC "" #undef LIBGCC_SPEC -#define LIBGCC_SPEC \ - "%{mthreads:-lcegccthrd} %{!mno-cegcc: %{!static: -lcegcc } } -lgcc" +#define LIBGCC_SPEC "-lgcc" -/* We have to dynamic link to get to the system DLLs. All of libc, libm, -the Unix stuff is in cegcc.dll. The import library is called -'libcegcc.dll.a'. For Windows applications, include more libraries, but -always include coredll. We'd like to specify subsystem windows to -ld, but that doesn't work just yet. */ - +/* Link with coredll, the main libc in the native SDK, + and to corelibc, a static lib that contains the start files, among other + basic crt stuff. */ #undef LIB_SPEC -#define LIB_SPEC "\ - %{!mno-cegcc: %{static: -lm -lc} } -lcoredll" +#define LIB_SPEC "-lcoredll -lcorelibc" #undef LINK_SPEC #define LINK_SPEC "\ @@ -133,82 +118,13 @@ %{shared|mdll: -e DllMainCRTStartup} \ " -#define ARM_WINCE 1 - -#undef COMMON_ASM_OP -#define COMMON_ASM_OP "\t.comm\t" - -/* Output a common block. */ -#undef ASM_OUTPUT_COMMON -#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \ - do { \ - if (arm_pe_dllexport_name_p (NAME)) \ - arm_pe_record_exported_symbol (NAME, 1); \ - if (! arm_pe_dllimport_name_p (NAME)) \ - { \ - fprintf ((STREAM), "\t.comm\t"); \ - assemble_name ((STREAM), (NAME)); \ - fprintf ((STREAM), ", %d\t%s %d\n", \ - (int)(ROUNDED), ASM_COMMENT_START, (int)(SIZE)); \ - } \ - } while (0) - -/* Output the label for an initialized variable. */ -#undef ASM_DECLARE_OBJECT_NAME -#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \ - do { \ - if (arm_pe_dllexport_name_p (NAME)) \ - arm_pe_record_exported_symbol (NAME, 1); \ - ASM_OUTPUT_LABEL ((STREAM), (NAME)); \ - } while (0) - -/* Write the extra assembler code needed to declare a function -properly. If we are generating SDB debugging information, this -will happen automatically, so we only need to handle other cases. */ -#undef ASM_DECLARE_FUNCTION_NAME -#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ - do \ - { \ - if (arm_pe_dllexport_name_p (NAME)) \ - arm_pe_record_exported_symbol (NAME, 0); \ - if (write_symbols != SDB_DEBUG) \ - arm_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL)); \ - ASM_OUTPUT_LABEL (FILE, NAME); \ - } \ - while (0) - - -/* Add an external function to the list of functions to be declared at -the end of the file. */ -#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \ - do \ - { \ - if (TREE_CODE (DECL) == FUNCTION_DECL) \ - arm_pe_record_external_function ((DECL), (NAME)); \ - } \ - while (0) - -/* Declare the type properly for any external libcall. */ -#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ - arm_pe_declare_function_type (FILE, XSTR (FUN, 0), 1) - -/* This says out to put a global symbol in the BSS section. */ -#undef ASM_OUTPUT_ALIGNED_BSS -#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ - asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN)) - -/* Output function declarations at the end of the file. */ -#undef TARGET_ASM_FILE_END -#define TARGET_ASM_FILE_END arm_pe_file_end - + /* Don't assume anything about the header files. */ #define NO_IMPLICIT_EXTERN_C -#define SUPPORTS_ONE_ONLY 1 + +/* Define types for compatibility with MS runtime. */ -/* Windows uses explicit import from shared libraries. */ -#define MULTIPLE_SYMBOL_SPACES 1 - #undef SIZE_TYPE #define SIZE_TYPE "unsigned int" @@ -221,10 +137,10 @@ #undef WCHAR_TYPE #define WCHAR_TYPE "short unsigned int" -/* Define as short unsigned for compatibility with MS runtime. */ #undef WINT_TYPE #define WINT_TYPE "short unsigned int" + #undef DWARF2_UNWIND_INFO #define DWARF2_UNWIND_INFO 0 @@ -252,6 +168,9 @@ /* Prefix for internally generated assembler labels. If we aren't using underscores, we are using prefix `.'s to identify labels that should be ignored. */ +/* If user-symbols don't have underscores, + then it must take more than `L' to identify + a label that should be ignored. */ #undef LPREFIX #define LPREFIX ".L" @@ -259,86 +178,42 @@ #undef LOCAL_LABEL_PREFIX #define LOCAL_LABEL_PREFIX "." -/* The prefix to add to user-visible assembler symbols. */ +/* The prefix to add to user-visible assembler symbols. + Arm Windows CE is not underscored. */ #undef USER_LABEL_PREFIX #define USER_LABEL_PREFIX "" - -/* If user-symbols don't have underscores, - then it must take more than `L' to identify - a label that should be ignored. */ - /* This is how to store into the string BUF the symbol_ref name of an internal numbered label where PREFIX is the class of label and NUM is the number within the class. This is suitable for output with `assemble_name'. */ - #undef ASM_GENERATE_INTERNAL_LABEL #define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ sprintf ((BUF), ".%s%ld", (PREFIX), (long)(NUMBER)) +/* We have to re-define this to prevent any conflicts. */ +#undef ARM_MCOUNT_NAME +#define ARM_MCOUNT_NAME "_mcount" + -/* Emit code to check the stack when allocating more that 4000 - bytes in one go. */ -#define CHECK_STACK_LIMIT 4000 +/* We do bitfields MSVC-compatibly by default. + We choose to be compatible with Microsoft's ARM and Thumb compilers, + which always return aggregates in memory. */ +#undef TARGET_DEFAULT +#define TARGET_DEFAULT (MASK_NOP_FUN_DLLIMPORT | \ + MASK_MS_BITFIELD_LAYOUT | \ + MASK_RETURN_AGGREGATES_IN_MEMORY) -/* By default, target has a 80387, uses IEEE compatible arithmetic, - returns float values in the 387 and needs stack probes. - We also align doubles to 64-bits for MSVC default compatibility. */ - -#undef TARGET_SUBTARGET_DEFAULT -#define TARGET_SUBTARGET_DEFAULT \ - (MASK_IEEE_FP | MASK_ALIGN_DOUBLE) - -/* ### Needs better testing!*/ -/* Native complier aligns internal doubles in structures on dword boundaries. */ -#undef BIGGEST_FIELD_ALIGNMENT -#define BIGGEST_FIELD_ALIGNMENT 64 - /* A bit-field declared as `int' forces `int' alignment for the struct. */ #undef PCC_BITFIELD_TYPE_MATTERS #define PCC_BITFIELD_TYPE_MATTERS 1 #define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec) -/* Enable alias attribute support. */ -#ifndef SET_ASM_OP -#define SET_ASM_OP "\t.set\t" -#endif +#undef DEFAULT_STRUCTURE_SIZE_BOUNDARY +#define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8 - -/* This implements the `alias' attribute. */ -#undef ASM_OUTPUT_DEF_FROM_DECLS -#define ASM_OUTPUT_DEF_FROM_DECLS(STREAM, DECL, TARGET) \ - do \ - { \ - const char *alias; \ - rtx rtlname = XEXP (DECL_RTL (DECL), 0); \ - if (GET_CODE (rtlname) == SYMBOL_REF) \ - alias = XSTR (rtlname, 0); \ - else \ - abort (); \ - if (TREE_CODE (DECL) == FUNCTION_DECL) \ - arm_pe_declare_function_type (STREAM, alias, \ - TREE_PUBLIC (DECL)); \ - ASM_OUTPUT_DEF (STREAM, alias, IDENTIFIER_POINTER (TARGET)); \ - } while (0) - -/* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true, - but for .jcr section to work we also need crtbegin and crtend - objects. */ -#define TARGET_USE_JCR_SECTION 0 - -/* Decide whether it is safe to use a local alias for a virtual function - when constructing thunks. */ -#undef TARGET_USE_LOCAL_THUNK_ALIAS_P -#define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) (!DECL_ONE_ONLY (DECL)) - -#define SUBTARGET_ATTRIBUTE_TABLE \ - /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ \ - { "selectany", 0, 0, true, false, false, arm_pe_handle_selectany_attribute } - #undef TREE #ifndef BUFSIZ Modified: trunk/cegcc/src/gcc/gcc/target-def.h =================================================================== --- trunk/cegcc/src/gcc/gcc/target-def.h 2006-10-30 21:55:45 UTC (rev 759) +++ trunk/cegcc/src/gcc/gcc/target-def.h 2006-10-30 23:51:18 UTC (rev 760) @@ -308,7 +308,10 @@ /* In tree.c. */ #define TARGET_MERGE_DECL_ATTRIBUTES merge_decl_attributes #define TARGET_MERGE_TYPE_ATTRIBUTES merge_type_attributes + +#ifndef TARGET_ATTRIBUTE_TABLE #define TARGET_ATTRIBUTE_TABLE NULL +#endif /* In cse.c. */ #define TARGET_ADDRESS_COST default_address_cost This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2006-11-03 12:06:20
|
Revision: 774 http://svn.sourceforge.net/cegcc/?rev=774&view=rev Author: dannybackx Date: 2006-11-03 04:06:13 -0800 (Fri, 03 Nov 2006) Log Message: ----------- Implement Pedro's quick suggestion. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/pe.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-11-03 11:44:55 UTC (rev 773) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-11-03 12:06:13 UTC (rev 774) @@ -1,3 +1,8 @@ +2006-11-04 Danny Backx <dan...@us...> + + * config/arm/pe.h (PROFILE_HOOK) : Remove, it looks like we don't need + it to get profiling to work. + 2006-10-30 Pedro Alves <ped...@po...> * target-def.h (TARGET_ATTRIBUTE_TABLE): Only define if not Modified: trunk/cegcc/src/gcc/gcc/config/arm/pe.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/pe.h 2006-11-03 11:44:55 UTC (rev 773) +++ trunk/cegcc/src/gcc/gcc/config/arm/pe.h 2006-11-03 12:06:13 UTC (rev 774) @@ -185,6 +185,10 @@ #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ arm_pe_declare_function_type (FILE, XSTR (FUN, 0), 1) +#if 0 +/* + * We don't appear to need this to get monitoring to work. + */ #undef PROFILE_HOOK #define PROFILE_HOOK(LABEL) \ if (MAIN_NAME_P (DECL_NAME (current_function_decl))) \ @@ -194,6 +198,7 @@ gen_rtx_SYMBOL_REF (Pmode, "_monstartup")), \ const0_rtx)); \ } +#endif /* This implements the `alias' attribute. */ #undef ASM_OUTPUT_DEF_FROM_DECLS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-08 12:42:44
|
Revision: 780 http://svn.sourceforge.net/cegcc/?rev=780&view=rev Author: pedroalves Date: 2006-11-08 04:42:26 -0800 (Wed, 08 Nov 2006) Log Message: ----------- * config/arm/wince-pe.h (DEFAULT_SIGNED_CHAR): Define to 1. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-11-06 23:27:38 UTC (rev 779) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-11-08 12:42:26 UTC (rev 780) @@ -1,6 +1,10 @@ -2006-11-04 Danny Backx <dan...@us...> +2006-11-08 Pedro Alves <ped...@po...> - * config/arm/pe.h (PROFILE_HOOK) : Remove, it looks like we don't need + * config/arm/wince-pe.h (DEFAULT_SIGNED_CHAR): Define to 1. + +2006-11-04 Danny Backx <dan...@us...> + + * config/arm/pe.h (PROFILE_HOOK): Remove, it looks like we don't need it to get profiling to work. 2006-10-30 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2006-11-06 23:27:38 UTC (rev 779) +++ trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2006-11-08 12:42:26 UTC (rev 780) @@ -125,6 +125,9 @@ /* Define types for compatibility with MS runtime. */ +#undef DEFAULT_SIGNED_CHAR +#define DEFAULT_SIGNED_CHAR 1 + #undef SIZE_TYPE #define SIZE_TYPE "unsigned int" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-12 18:11:13
|
Revision: 792 http://svn.sourceforge.net/cegcc/?rev=792&view=rev Author: pedroalves Date: 2006-11-12 10:10:58 -0800 (Sun, 12 Nov 2006) Log Message: ----------- * config/arm/wince-pe.h (TARGET_OS_CPP_BUILTINS): Delete _M_ARM and ARM. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-11-12 17:56:49 UTC (rev 791) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-11-12 18:10:58 UTC (rev 792) @@ -1,3 +1,8 @@ +2006-11-12 Pedro Alves <ped...@po...> + + * config/arm/wince-pe.h (TARGET_OS_CPP_BUILTINS): Delete _M_ARM + and ARM. + 2006-11-08 Pedro Alves <ped...@po...> * config/arm/wince-pe.h (DEFAULT_SIGNED_CHAR): Define to 1. Modified: trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2006-11-12 17:56:49 UTC (rev 791) +++ trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2006-11-12 18:10:58 UTC (rev 792) @@ -73,9 +73,7 @@ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ - builtin_define ("_M_ARM=1"); \ - builtin_define ("ARM=1"); \ - /* We currently defined UNDER_CE to a non-value, and it seems \ + /* We currently define UNDER_CE to a non-value, as it seems \ MSVC2005 does the same. */ \ builtin_define_std ("UNDER_CE"); \ builtin_define ("_UNICODE"); \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-27 21:49:46
|
Revision: 830 http://svn.sourceforge.net/cegcc/?rev=830&view=rev Author: pedroalves Date: 2006-11-27 13:49:45 -0800 (Mon, 27 Nov 2006) Log Message: ----------- * config/arm/mingw32.h (STARTFILE_SPEC): Add crt3.o and dllcrt3.o instead of crt2.o and dllcrt2.o. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-11-27 21:41:44 UTC (rev 829) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-11-27 21:49:45 UTC (rev 830) @@ -1,3 +1,8 @@ +2006-11-27 Pedro Alves <ped...@po...> + + * config/arm/mingw32.h (STARTFILE_SPEC): Add crt3.o and dllcrt3.o + instead of crt2.o and dllcrt2.o. + 2006-11-12 Pedro Alves <ped...@po...> * config/arm/wince-pe.h (TARGET_OS_CPP_BUILTINS): Delete _M_ARM Modified: trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h 2006-11-27 21:41:44 UTC (rev 829) +++ trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h 2006-11-27 21:49:45 UTC (rev 830) @@ -55,8 +55,8 @@ "%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lceoldname -lmingwex -lcoredll" #undef STARTFILE_SPEC -#define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \ - %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt3%O%s}" +#define STARTFILE_SPEC "%{shared|mdll:dllcrt3%O%s} \ + %{!shared:%{!mdll:crt3%O%s}} %{pg:gcrt3%O%s}" /* Override startfile prefix defaults. */ #ifndef STANDARD_STARTFILE_PREFIX_1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2006-12-05 19:09:45
|
Revision: 838 http://svn.sourceforge.net/cegcc/?rev=838&view=rev Author: dannybackx Date: 2006-12-05 11:09:44 -0800 (Tue, 05 Dec 2006) Log Message: ----------- This is Pedro's fix for the ARM macro definition, I'm committing it for him as he indicated. Here is the patch that moves _M_ARM and ARM back into gcc builtins, and adds _M_ARMT. _M_ARM and _M_ARMT will be defined to the arm arch being compiled to, _M_ARMT will only be defined if the arm arch supports thumb, and ARM will be defined as empty. I think this matches MSFT's tools behavior. I've tested it manually using -march=armv4, -march=armv5, etc, and with -mcpu=arm8, -mcpu=xscale, etc. I will commit it later if you confirm it works for you, or you can commit it yourself if you want. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/arm-protos.h trunk/cegcc/src/gcc/gcc/config/arm/arm.c trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-12-04 21:47:24 UTC (rev 837) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-12-05 19:09:44 UTC (rev 838) @@ -1,3 +1,12 @@ +2006-12-03 Pedro Alves <ped...@po...> + + * config/arm/arm.c (arm_major_arch, arm_thumb_arch_p): New + functions. + * config/arm/arm-protos.h (arm_major_arch, arm_thumb_arch_p): + Declare. + * config/arm/wince-pe.h (TARGET_OS_CPP_BUILTINS): Add _M_ARM, + _M_ARMT and ARM. + 2006-11-27 Pedro Alves <ped...@po...> * config/arm/mingw32.h (STARTFILE_SPEC): Add crt3.o and dllcrt3.o Modified: trunk/cegcc/src/gcc/gcc/config/arm/arm-protos.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/arm-protos.h 2006-12-04 21:47:24 UTC (rev 837) +++ trunk/cegcc/src/gcc/gcc/config/arm/arm-protos.h 2006-12-05 19:09:44 UTC (rev 838) @@ -1,5 +1,6 @@ -/* Prototypes for exported functions defined in arm.c and pe.c - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +/* Prototypes for exported functions defined in arm.c, pe.c, + pe-cxx.c and pe-stubs.c. + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rea...@ar...) Minor hacks by Nick Clifton (ni...@cy...) @@ -42,6 +43,9 @@ extern void arm_output_fn_unwind (FILE *, bool); extern void arm_file_end (void); +int arm_major_arch (void); +bool arm_thumb_arch_p (void); + #ifdef TREE_CODE extern int arm_return_in_memory (tree); extern void arm_encode_call_attribute (tree, int); Modified: trunk/cegcc/src/gcc/gcc/config/arm/arm.c =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/arm.c 2006-12-04 21:47:24 UTC (rev 837) +++ trunk/cegcc/src/gcc/gcc/config/arm/arm.c 2006-12-05 19:09:44 UTC (rev 838) @@ -15529,4 +15529,28 @@ || lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (record_type)); } +int +arm_major_arch (void) +{ + if ((insn_flags & FL_FOR_ARCH6) == FL_FOR_ARCH6) + return 6; + else if ((insn_flags & FL_FOR_ARCH5) == FL_FOR_ARCH5) + return 5; + else if ((insn_flags & FL_FOR_ARCH4) == FL_FOR_ARCH4) + return 4; + else if ((insn_flags & FL_FOR_ARCH3) == FL_FOR_ARCH3) + return 3; + else if ((insn_flags & FL_FOR_ARCH2) == FL_FOR_ARCH2) + return 2; + + /* This should gives us a nice ICE somewhere. */ + return -1; +} + +bool +arm_thumb_arch_p (void) +{ + return (insn_flags & FL_THUMB) == FL_THUMB; +} + #include "gt-arm.h" Modified: trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2006-12-04 21:47:24 UTC (rev 837) +++ trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2006-12-05 19:09:44 UTC (rev 838) @@ -92,7 +92,21 @@ to compare typeinfo symbols across dll boundaries. */ \ builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ EXTRA_OS_CPP_BUILTINS (); \ - } \ + { \ + /* Define these to be compatible MSFT's tools. */ \ + char buf[64]; \ + int arch = arm_major_arch (); \ + sprintf (buf, "_M_ARM=%d", arch); \ + builtin_define (buf); \ + if (arm_thumb_arch_p ()) \ + { \ + sprintf (buf, "_M_ARMT=%d", arch); \ + builtin_define (buf); \ + } \ + /* Always defined as empty. */ \ + builtin_define ("ARM="); \ + } \ + } \ while (0) /* Now we define the strings used to build the spec file. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2006-12-30 11:25:17
|
Revision: 853 http://svn.sourceforge.net/cegcc/?rev=853&view=rev Author: dannybackx Date: 2006-12-30 03:25:16 -0800 (Sat, 30 Dec 2006) Log Message: ----------- This is the gcc part of the profiling patch. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/t-arm-coff trunk/cegcc/src/gcc/gcc/config/arm/t-arm-elf trunk/cegcc/src/gcc/gcc/config/arm/t-pe trunk/cegcc/src/gcc/gcc/config/arm/t-strongarm-elf trunk/cegcc/src/gcc/gcc/config/arm/t-strongarm-pe trunk/cegcc/src/gcc/gcc/config/arm/t-wince-pe trunk/cegcc/src/gcc/gcc/config/arm/t-xscale-coff trunk/cegcc/src/gcc/gcc/config/arm/t-xscale-elf trunk/cegcc/src/gcc/gcc/coverage.c trunk/cegcc/src/gcc/gcc/doc/gcov.texi trunk/cegcc/src/gcc/gcc/gcov-io.c trunk/cegcc/src/gcc/gcc/libgcov.c trunk/cegcc/src/gcc/gcc/tsystem.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2006-12-30 11:25:16 UTC (rev 853) @@ -1,3 +1,21 @@ +2006-12-21 Danny Backx <dan...@us...> + + * config/arm/t-strongarm-pe config/arm/t-strongarm-elf config/arm/t-pe + config/arm/t-arm-elf config/arm/t-xscale-elf config/arm/t-xscale-coff + config/arm/t-arm-coff config/arm/t-wince-pe : Remove inhibit_libc . + + * coverage.c (build_gcov_info) : Add more support for dealing with + directory names in cross-debugging environment. Main difference + is that this is specified on the host, not the target platform. + + * doc/gcov.texi : Add documentation for GCOV_CROSS_PREFIX. + + * tsystem.h : Don't include <errno.h> when __MINGW32CE__ is defined. + + * gcov-io.c (gcov_open) : Call setvbuf instead of setbuf in mingw32ce. + + * libgcov.c (gcov_exit) : Don't call getenv and setenv in mingw32ce. + 2006-12-03 Pedro Alves <ped...@po...> * config/arm/arm.c (arm_major_arch, arm_thumb_arch_p): New Modified: trunk/cegcc/src/gcc/gcc/config/arm/t-arm-coff =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/t-arm-coff 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/config/arm/t-arm-coff 2006-12-30 11:25:16 UTC (rev 853) @@ -31,4 +31,4 @@ # Currently there is a bug somewhere in GCC's alias analysis # or scheduling code that is breaking _fpmul_parts in fp-bit.c. # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -fno-inline Modified: trunk/cegcc/src/gcc/gcc/config/arm/t-arm-elf =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/t-arm-elf 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/config/arm/t-arm-elf 2006-12-30 11:25:16 UTC (rev 853) @@ -67,7 +67,7 @@ # Currently there is a bug somewhere in GCC's alias analysis # or scheduling code that is breaking _fpmul_parts in fp-bit.c. # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -fno-inline # Assemble startup files. $(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES) Modified: trunk/cegcc/src/gcc/gcc/config/arm/t-pe =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/t-pe 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/config/arm/t-pe 2006-12-30 11:25:16 UTC (rev 853) @@ -47,4 +47,3 @@ LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc Modified: trunk/cegcc/src/gcc/gcc/config/arm/t-strongarm-elf =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/t-strongarm-elf 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/config/arm/t-strongarm-elf 2006-12-30 11:25:16 UTC (rev 853) @@ -32,7 +32,7 @@ # Currently there is a bug somewhere in GCC's alias analysis # or scheduling code that is breaking _fpmul_parts in fp-bit.c. # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -fno-inline # Assemble startup files. $(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES) Modified: trunk/cegcc/src/gcc/gcc/config/arm/t-strongarm-pe =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/t-strongarm-pe 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/config/arm/t-strongarm-pe 2006-12-30 11:25:16 UTC (rev 853) @@ -35,4 +35,4 @@ # Currently there is a bug somewhere in GCC's alias analysis # or scheduling code that is breaking _fpmul_parts in fp-bit.c. # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -fno-inline Modified: trunk/cegcc/src/gcc/gcc/config/arm/t-wince-pe =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/t-wince-pe 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/config/arm/t-wince-pe 2006-12-30 11:25:16 UTC (rev 853) @@ -55,4 +55,4 @@ LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc +TARGET_LIBGCC2_CFLAGS = Modified: trunk/cegcc/src/gcc/gcc/config/arm/t-xscale-coff =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/t-xscale-coff 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/config/arm/t-xscale-coff 2006-12-30 11:25:16 UTC (rev 853) @@ -42,4 +42,4 @@ # Currently there is a bug somewhere in GCC's alias analysis # or scheduling code that is breaking _fpmul_parts in fp-bit.c. # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -fno-inline Modified: trunk/cegcc/src/gcc/gcc/config/arm/t-xscale-elf =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/t-xscale-elf 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/config/arm/t-xscale-elf 2006-12-30 11:25:16 UTC (rev 853) @@ -54,7 +54,7 @@ # Currently there is a bug somewhere in GCC's alias analysis # or scheduling code that is breaking _fpmul_parts in fp-bit.c. # Disabling function inlining is a workaround for this problem. -TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc -fno-inline +TARGET_LIBGCC2_CFLAGS = -fno-inline # Assemble startup files. $(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES) Modified: trunk/cegcc/src/gcc/gcc/coverage.c =================================================================== --- trunk/cegcc/src/gcc/gcc/coverage.c 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/coverage.c 2006-12-30 11:25:16 UTC (rev 853) @@ -776,6 +776,7 @@ unsigned n_fns; const struct function_list *fn; tree string_type; + char *gcov_cross_prefix; /* Count the number of active counters. */ for (n_ctr_types = 0, ix = 0; ix != GCOV_COUNTERS; ix++) @@ -811,12 +812,26 @@ field = build_decl (FIELD_DECL, NULL_TREE, string_type); TREE_CHAIN (field) = fields; fields = field; - filename = getpwd (); - filename = (filename && da_file_name[0] != '/' + + /* + * Additional environment variable for cross-development. + */ + if (gcov_cross_prefix = getenv ("GCOV_CROSS_PREFIX")) + { + filename = concat (gcov_cross_prefix, "/", da_file_name, NULL); + filename_len = strlen (filename); + filename_string = build_string (filename_len + 1, filename); + } + else + { + filename = getpwd (); + filename = (filename && da_file_name[0] != '/' ? concat (filename, "/", da_file_name, NULL) : da_file_name); - filename_len = strlen (filename); - filename_string = build_string (filename_len + 1, filename); + filename_len = strlen (filename); + filename_string = build_string (filename_len + 1, filename); + } + if (filename != da_file_name) free (filename); TREE_TYPE (filename_string) = build_array_type Modified: trunk/cegcc/src/gcc/gcc/doc/gcov.texi =================================================================== --- trunk/cegcc/src/gcc/gcc/doc/gcov.texi 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/doc/gcov.texi 2006-12-30 11:25:16 UTC (rev 853) @@ -544,7 +544,8 @@ to create the needed directory structure, if it is not already present. To support cross-profiling, a program compiled with @option{-fprofile-arcs} -can relocate the data files based on two environment variables: +can relocate the data files based on two environment variables on the target +platform, or one on the host platform: @itemize @bullet @item @@ -558,6 +559,11 @@ @emph{Note:} GCOV_PREFIX_STRIP has no effect if GCOV_PREFIX is undefined, empty or non-absolute. + +@item +GCOV_CROSS_PREFIX is a host platform environment variable. Use it to specify +a target directory to prefix the compiled file name with, replacing the +compile directory. @end itemize For example, if the object file @file{/user/build/foo.o} was built with @@ -568,6 +574,13 @@ @samp{GCOV_PREFIX=/target/run} and @samp{GCOV_PREFIX_STRIP=1}. Such a setting will name the data file @file{/target/run/build/foo.gcda}. +Alternatively, you can set @samp{GCOV_CROSS_PREFIX=/target/run/build} when +compiling, to achieve the same effect. The object file will no longer contain +the information @file{/user/build/foo.o} but @file{/target/run/build/foo.o}. + +The host and target mechanisms are independent of each other, so they can be +used together. + You must move the data files to the expected directory tree in order to use them for profile directed optimizations (@option{--use-profile}), or to use the @command{gcov} tool. Modified: trunk/cegcc/src/gcc/gcc/gcov-io.c =================================================================== --- trunk/cegcc/src/gcc/gcc/gcov-io.c 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/gcov-io.c 2006-12-30 11:25:16 UTC (rev 853) @@ -134,7 +134,11 @@ return 0; #endif +#ifdef __MINGW32CE__ + setvbuf (gcov_var.file, (char *)0, _IONBF, (size_t)0); +#else setbuf (gcov_var.file, (char *)0); +#endif return 1; } Modified: trunk/cegcc/src/gcc/gcc/libgcov.c =================================================================== --- trunk/cegcc/src/gcc/gcc/libgcov.c 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/libgcov.c 2006-12-30 11:25:16 UTC (rev 853) @@ -194,6 +194,12 @@ } } +#ifdef __MINGW32CE__ + /* No getenv support, so disable this. */ + gcov_prefix = (char *)0; + gcov_prefix_strip = 0; + prefix_length = 0; +#else /* Get file name relocation prefix. Non-absolute values are ignored. */ gcov_prefix = getenv("GCOV_PREFIX"); if (gcov_prefix && IS_ABSOLUTE_PATH (gcov_prefix)) @@ -216,6 +222,7 @@ } else prefix_length = 0; +#endif /* Allocate and initialize the filename scratch space. */ gi_filename = alloca (prefix_length + gcov_max_filename + 1); @@ -310,6 +317,15 @@ continue; } #endif +#ifdef UNDER_CE + { + wchar_t x[256]; + int l = strlen(gi_filename); + l = (l < 256) ? l : 255; + wcstombs(x, gi_filename, l); + MessageBoxW(0, L"gcov_open", x, 0); + } +#endif if (!gcov_open (gi_filename)) { fprintf (stderr, "profiling:%s:Cannot open\n", gi_filename); Modified: trunk/cegcc/src/gcc/gcc/tsystem.h =================================================================== --- trunk/cegcc/src/gcc/gcc/tsystem.h 2006-12-30 11:23:27 UTC (rev 852) +++ trunk/cegcc/src/gcc/gcc/tsystem.h 2006-12-30 11:25:16 UTC (rev 853) @@ -92,12 +92,14 @@ /* All systems have this header. */ #include <sys/types.h> -/* All systems have this header. */ +#ifndef __MINGW32CE__ +/* All systems except Windows CE have this header. */ #include <errno.h> #ifndef errno extern int errno; #endif +#endif /* GCC (fixproto) guarantees these system headers exist. */ #include <string.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-06-02 12:46:30
|
Revision: 926 http://svn.sourceforge.net/cegcc/?rev=926&view=rev Author: dannybackx Date: 2007-06-02 05:46:10 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Put this code in SVN, has been on my disk for too long. This is the -fcoverage-base option that allows you to specify at compile time where the application will put the coverage files. This has been submitted to gcc-patches. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/common.opt trunk/cegcc/src/gcc/gcc/coverage.c trunk/cegcc/src/gcc/gcc/doc/gcov.texi trunk/cegcc/src/gcc/gcc/libgcov.c trunk/cegcc/src/gcc/gcc/opts.c trunk/cegcc/src/gcc/gcc/toplev.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-06-02 12:46:10 UTC (rev 926) @@ -1,3 +1,12 @@ +2007-06-02 Danny Backx <dan...@us...> + * toplev.h opts.c coverage.c common.opt libgcov.c : Add support for + -fcoverage-base option. This supports --coverage in a + cross-development environment where it is not always easy to use run + time environment variables. This option works at compile time. This + has been submitted to gcc-patches. + * doc/gcov.texi : Add documentation for -fcoverage-base. + + 2006-12-21 Danny Backx <dan...@us...> * config/arm/t-strongarm-pe config/arm/t-strongarm-elf config/arm/t-pe Modified: trunk/cegcc/src/gcc/gcc/common.opt =================================================================== --- trunk/cegcc/src/gcc/gcc/common.opt 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/common.opt 2007-06-02 12:46:10 UTC (rev 926) @@ -309,6 +309,10 @@ Common Report Var(flag_no_common,0) Do not put uninitialized globals in the common section +fcoverage-base= +Common Joined Var(flag_coverage_base) +Directory in which to put coverage analysis files, for cross-compiler environments + fcprop-registers Common Report Var(flag_cprop_registers) Perform a register copy-propagation optimization pass Modified: trunk/cegcc/src/gcc/gcc/coverage.c =================================================================== --- trunk/cegcc/src/gcc/gcc/coverage.c 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/coverage.c 2007-06-02 12:46:10 UTC (rev 926) @@ -89,6 +89,7 @@ static char *bbg_file_name; static unsigned bbg_file_opened; static int bbg_function_announced; +char *coverage_base = NULL; /* Name of the count data file. */ static char *da_file_name; @@ -813,24 +814,22 @@ TREE_CHAIN (field) = fields; fields = field; - /* - * Additional environment variable for cross-development. - */ - if (gcov_cross_prefix = getenv ("GCOV_CROSS_PREFIX")) - { - filename = concat (gcov_cross_prefix, "/", da_file_name, NULL); - filename_len = strlen (filename); - filename_string = build_string (filename_len + 1, filename); - } + /* Additional command line argument for cross-development */ + if (coverage_base) + { + filename = concat (coverage_base, "/", da_file_name, NULL); + filename_len = strlen (filename); + filename_string = build_string (filename_len + 1, filename); + } else - { - filename = getpwd (); - filename = (filename && da_file_name[0] != '/' - ? concat (filename, "/", da_file_name, NULL) - : da_file_name); - filename_len = strlen (filename); - filename_string = build_string (filename_len + 1, filename); - } + { + filename = getpwd (); + filename = (filename && da_file_name[0] != '/' + ? concat (filename, "/", da_file_name, NULL) + : da_file_name); + filename_len = strlen (filename); + filename_string = build_string (filename_len + 1, filename); + } if (filename != da_file_name) free (filename); Modified: trunk/cegcc/src/gcc/gcc/doc/gcov.texi =================================================================== --- trunk/cegcc/src/gcc/gcc/doc/gcov.texi 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/doc/gcov.texi 2007-06-02 12:46:10 UTC (rev 926) @@ -543,10 +543,14 @@ absolute directory structure on the target system. The program will try to create the needed directory structure, if it is not already present. -To support cross-profiling, a program compiled with @option{-fprofile-arcs} -can relocate the data files based on two environment variables on the target -platform, or one on the host platform: +There are two options to support cross-profiling. A command line argument +to the compiler (-fcoverage-base) allows you to override the directory +stored in the object file; this happens at compile time. Alternatively, +two runtime environment variables allow you to relocate the data files. +Both options have effect only on programs compiled with @option{-fprofile-arcs}. +The two environment variables: + @itemize @bullet @item GCOV_PREFIX contains the prefix to add to the absolute paths @@ -559,11 +563,6 @@ @emph{Note:} GCOV_PREFIX_STRIP has no effect if GCOV_PREFIX is undefined, empty or non-absolute. - -@item -GCOV_CROSS_PREFIX is a host platform environment variable. Use it to specify -a target directory to prefix the compiled file name with, replacing the -compile directory. @end itemize For example, if the object file @file{/user/build/foo.o} was built with @@ -574,13 +573,19 @@ @samp{GCOV_PREFIX=/target/run} and @samp{GCOV_PREFIX_STRIP=1}. Such a setting will name the data file @file{/target/run/build/foo.gcda}. -Alternatively, you can set @samp{GCOV_CROSS_PREFIX=/target/run/build} when +Alternatively, you can use @samp{-fcoverage-base=/target/run/build} when compiling, to achieve the same effect. The object file will no longer contain the information @file{/user/build/foo.o} but @file{/target/run/build/foo.o}. The host and target mechanisms are independent of each other, so they can be used together. +The build time command line option can be used like this : + +@smallexample +gcc -fcoverage-base=/target/run -fprofile-arcs -o t.exe t.c +@end smallexample + You must move the data files to the expected directory tree in order to use them for profile directed optimizations (@option{--use-profile}), or to use the @command{gcov} tool. Modified: trunk/cegcc/src/gcc/gcc/libgcov.c =================================================================== --- trunk/cegcc/src/gcc/gcc/libgcov.c 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/libgcov.c 2007-06-02 12:46:10 UTC (rev 926) @@ -328,7 +328,17 @@ #endif if (!gcov_open (gi_filename)) { +#ifndef UNDER_CE fprintf (stderr, "profiling:%s:Cannot open\n", gi_filename); +#else + { + wchar_t x[256]; + int l = strlen(gi_filename); + l = (l < 256) ? l : 255; + mbstowcs(x, gi_filename, l); + MessageBoxW(0, x, L"gcov_open couldn't open file", 0); + } +#endif continue; } } Modified: trunk/cegcc/src/gcc/gcc/opts.c =================================================================== --- trunk/cegcc/src/gcc/gcc/opts.c 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/opts.c 2007-06-02 12:46:10 UTC (rev 926) @@ -836,6 +836,10 @@ fix_register (arg, 0, 0); break; + case OPT_fcoverage_base_: + coverage_base = xstrdup(arg); + break; + case OPT_fdiagnostics_show_location_: if (!strcmp (arg, "once")) diagnostic_prefixing_rule (global_dc) = DIAGNOSTICS_SHOW_PREFIX_ONCE; Modified: trunk/cegcc/src/gcc/gcc/toplev.h =================================================================== --- trunk/cegcc/src/gcc/gcc/toplev.h 2007-05-31 21:58:28 UTC (rev 925) +++ trunk/cegcc/src/gcc/gcc/toplev.h 2007-06-02 12:46:10 UTC (rev 926) @@ -132,6 +132,7 @@ extern int flag_unswitch_loops; extern int flag_cprop_registers; extern int time_report; +extern char *coverage_base; /* Things to do with target switches. */ extern void print_version (FILE *, const char *); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-08-05 10:20:49
|
Revision: 1040 http://cegcc.svn.sourceforge.net/cegcc/?rev=1040&view=rev Author: dannybackx Date: 2007-08-05 03:20:47 -0700 (Sun, 05 Aug 2007) Log Message: ----------- This is the support for the __exception_handler__ attribute. Code as originally posted on the list has been changed as Pedro suggested. 2007-08-05 Danny Backx <dan...@us...> * c-common.c (handle_exception_handler_attribute) : Add new handler to support the __exception_handler__ attribute. * config/arm/arm.c (arm_exception_handler) : Add function to query the structures built by the compiler for the exception handler for the function that we're currently generating code for. * config/arm/wince-pe.h (ASM_DECLARE_FUNCTION_NAME) : Add macro to generate function header including an exception handler spec and an entry in the .pdata segment, call the one in pe.h to reuse the existing code. * config/arm/wince-pe.h (ASM_DECLARE_FUNCTION_SIZE) : Add macro to generate function trailer (one additional local label) so we can do a size calculation. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME) : Rename to ARM_PE_DECLARE_FUNCTION_NAME so it can be called from ASM_DECLARE_FUNCTION_NAME in config/arm/wince-pe.h . Code reuse instead of code duplication. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/c-common.c trunk/cegcc/src/gcc/gcc/config/arm/arm.c trunk/cegcc/src/gcc/gcc/config/arm/pe.h trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-08-01 00:04:32 UTC (rev 1039) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-08-05 10:20:47 UTC (rev 1040) @@ -197,3 +197,23 @@ * config/arm/t-wince-cegcc: Make it empty, we now inherit the generic t-wince-pe. * ChangeLog.ce: New file. + +2007-08-05 Danny Backx <dan...@us...> + + * c-common.c (handle_exception_handler_attribute) : Add new handler to + support the __exception_handler__ attribute. + * config/arm/arm.c (arm_exception_handler) : Add function to query the + structures built by the compiler for the exception handler for the + function that we're currently generating code for. + * config/arm/wince-pe.h (ASM_DECLARE_FUNCTION_NAME) : Add macro to + generate function header including an exception handler spec and an + entry in the .pdata segment, call the one in pe.h to reuse the + existing code. + * config/arm/wince-pe.h (ASM_DECLARE_FUNCTION_SIZE) : Add macro to + generate function trailer (one additional local label) so we can do a + size calculation. + * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME) : Rename to + ARM_PE_DECLARE_FUNCTION_NAME so it can be called from + ASM_DECLARE_FUNCTION_NAME in config/arm/wince-pe.h . Code reuse + instead of code duplication. + Modified: trunk/cegcc/src/gcc/gcc/c-common.c =================================================================== --- trunk/cegcc/src/gcc/gcc/c-common.c 2007-08-01 00:04:32 UTC (rev 1039) +++ trunk/cegcc/src/gcc/gcc/c-common.c 2007-08-05 10:20:47 UTC (rev 1040) @@ -505,6 +505,8 @@ static tree handle_noinline_attribute (tree *, tree, tree, int, bool *); static tree handle_always_inline_attribute (tree *, tree, tree, int, bool *); +static tree handle_exception_handler_attribute (tree *, tree, tree, int, + bool *); static tree handle_flatten_attribute (tree *, tree, tree, int, bool *); static tree handle_used_attribute (tree *, tree, tree, int, bool *); static tree handle_unused_attribute (tree *, tree, tree, int, bool *); @@ -633,6 +635,8 @@ handle_cleanup_attribute }, { "warn_unused_result", 0, 0, false, true, true, handle_warn_unused_result_attribute }, + { "exception_handler", 1, 1, true, false, false, + handle_exception_handler_attribute }, { "sentinel", 0, 1, false, true, true, handle_sentinel_attribute }, { NULL, 0, 0, false, false, false, NULL } @@ -4216,6 +4220,59 @@ return NULL_TREE; } +/* + * Handle a "exception_handler" attribute. + * + * One argument is required : the name of a function to call in case of exceptions. + * Example syntax : + * + * int main(int argc, char *argv[]) + * __attribute__((__exception_handler__(handler))); + */ + +static tree +handle_exception_handler_attribute (tree *node, tree name, + tree args, + int ARG_UNUSED (flags), + bool *no_add_attrs) +{ + if (TREE_CODE (*node) == FUNCTION_DECL) + { + /* + * We need to pass the name of the exception handler. The + * right code then gets generated from config/arm/mingw32.h + * or similar, the assembler and linker will do the hard work. + * + * FIX ME We don't support passing data to the exception handler. + * + * This should be possible though, by using an additional argument + * which needs to fit in the dword (e.g. a pointer) and storing that + * in the right field as we do with the exception handler. + */ + + /* Handle mode attribute, handle_section_attribute, .. use args */ + tree id = TREE_VALUE (args); + tree attr = NULL_TREE; + +#if 1 + attr = tree_cons (get_identifier ("exception_handler"), args, attr); +#else + /* Works too */ + const char *x = IDENTIFIER_POINTER(id); + + attr = tree_cons (get_identifier ("exception_handler"), + build_string (strlen (x), x), attr); +#endif + } + else + { + warning (OPT_Wattributes, "%qE attribute ignored", name); + *no_add_attrs = true; + } + + return NULL_TREE; +} + /* Handle a "flatten" attribute; arguments as in struct attribute_spec.handler. */ Modified: trunk/cegcc/src/gcc/gcc/config/arm/arm.c =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/arm.c 2007-08-01 00:04:32 UTC (rev 1039) +++ trunk/cegcc/src/gcc/gcc/config/arm/arm.c 2007-08-05 10:20:47 UTC (rev 1040) @@ -15553,4 +15553,28 @@ return (insn_flags & FL_THUMB) == FL_THUMB; } +/* + * called from ASM_DECLARE_FUNCTION_NAME in gcc/config/arm/wince-pe.h + */ +char * +arm_exception_handler (FILE *fp, char *name, tree decl) +{ + tree attr, a2; + + attr = DECL_ATTRIBUTES (decl); + if (! attr) + return NULL; + a2 = lookup_attribute ("__exception_handler__", attr); + if (! a2) + return NULL; + if (a2) + { + return IDENTIFIER_POINTER (TREE_VALUE (TREE_VALUE (a2))); + } + + warning (0, "exception handler information not found for function %s", + name); + return NULL; +} + #include "gt-arm.h" Modified: trunk/cegcc/src/gcc/gcc/config/arm/pe.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/pe.h 2007-08-01 00:04:32 UTC (rev 1039) +++ trunk/cegcc/src/gcc/gcc/config/arm/pe.h 2007-08-05 10:20:47 UTC (rev 1040) @@ -117,8 +117,11 @@ /* Write the extra assembler code needed to declare a function properly. If we are generating SDB debugging information, this will happen automatically, so we only need to handle other cases. */ -#undef ASM_DECLARE_FUNCTION_NAME -#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \ +/* Give this another name so more sub-architectures can overrule ARM_DECLARE_FUNCTION_NAME + * and still call ARM_PE_DECLARE_FUNCTION_NAME. The alternative is to duplicate the code + * below to the sub-architectures, that's a bad idea. + * This is currently done in wince-pe.h . */ +#define ARM_PE_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \ do \ { \ if (arm_pe_dllexport_name_p (NAME)) \ @@ -132,6 +135,9 @@ } \ while (0) +#undef ASM_DECLARE_FUNCTION_NAME +#define ASM_DECLARE_FUNCTION_NAME ARM_PE_DECLARE_FUNCTION_NAME + /* Output function declarations at the end of the file. */ #undef TARGET_ASM_FILE_END #define TARGET_ASM_FILE_END arm_pe_file_end Modified: trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2007-08-01 00:04:32 UTC (rev 1039) +++ trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2007-08-05 10:20:47 UTC (rev 1040) @@ -234,3 +234,48 @@ #ifndef BUFSIZ # undef FILE #endif + +/* + * An ARM specific header for function declarations. + * + * This one is needed for exception handlers : the entry in the pdata section + * needs to know the size of the function for which we handle exceptions. + */ +#undef ASM_DECLARE_FUNCTION_NAME +#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \ + do \ + { \ + char *eh; \ + eh = arm_exception_handler(STREAM, NAME, DECL); \ + if (eh) \ + { \ + asm_fprintf (STREAM, "%@ %s has exception handler %s\n", \ + NAME, eh); \ + asm_fprintf (STREAM, "\t.section .pdata\n"); \ + asm_fprintf (STREAM, "\t.word %s\n", NAME); \ + asm_fprintf (STREAM, "\t.word 0xc0000002 | " \ + "((((.L%s_end - %s) / 4) & 0x3ffffff) << 8) " \ + "/* _cegcc_%s size */\n", NAME, NAME, NAME); \ + asm_fprintf (STREAM, "\t.text\n"); \ + asm_fprintf (STREAM, ".L%s_data:\n", NAME); \ + asm_fprintf (STREAM, "\t.word %s /* .L%s_handler */\n", \ + eh, NAME); \ + asm_fprintf (STREAM, "\t.word 0 /* .L%s_handler_data */\n", \ + NAME); \ + } \ + ARM_PE_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL); \ + } \ + while (0) + +/* + * An ARM specific trailer for function declarations. + * + * This one is needed for exception handlers : the entry in the pdata section + * needs to know the size of the function for which we handle exceptions. + */ +#undef ASM_DECLARE_FUNCTION_SIZE +#define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) \ + { \ + if (arm_exception_handler(STREAM, NAME, DECL)) \ + asm_fprintf (STREAM, ".L%s_end:\n", NAME); \ + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-09-11 21:36:57
|
Revision: 1061 http://cegcc.svn.sourceforge.net/cegcc/?rev=1061&view=rev Author: pedroalves Date: 2007-09-11 14:36:53 -0700 (Tue, 11 Sep 2007) Log Message: ----------- * config/arm/wince-pe.h (ARM_DOUBLEWORD_ALIGN, BIGGEST_ALIGNMENT): Define. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-09-11 21:17:06 UTC (rev 1060) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-09-11 21:36:53 UTC (rev 1061) @@ -1,3 +1,8 @@ +2007-09-11 Pedro Alves <ped...@po...> + + * config/arm/wince-pe.h (ARM_DOUBLEWORD_ALIGN, BIGGEST_ALIGNMENT): + Define. + 2007-08-05 Danny Backx <dan...@us...> * c-common.c (handle_exception_handler_attribute): Add new handler Modified: trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2007-09-11 21:17:06 UTC (rev 1060) +++ trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2007-09-11 21:36:53 UTC (rev 1061) @@ -229,6 +229,12 @@ #undef DEFAULT_STRUCTURE_SIZE_BOUNDARY #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8 +#undef ARM_DOUBLEWORD_ALIGN +#define ARM_DOUBLEWORD_ALIGN 1 + +#undef BIGGEST_ALIGNMENT +#define BIGGEST_ALIGNMENT 64 + #undef TREE #ifndef BUFSIZ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-11-15 20:11:44
|
Revision: 1071 http://cegcc.svn.sourceforge.net/cegcc/?rev=1071&view=rev Author: dannybackx Date: 2007-11-15 12:11:34 -0800 (Thu, 15 Nov 2007) Log Message: ----------- Fix the issue reported by Jacek : you could see in cegcc's dumpspecs which compiler-dependent macros were defined, but not in mingw32ce. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-11-14 22:45:10 UTC (rev 1070) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-11-15 20:11:34 UTC (rev 1071) @@ -1,3 +1,10 @@ +2007-11-15 Danny Backx <dan...@us...> + + * config/arm/mingw32.h (EXTRA_OS_CPP_BUILTINS, CPP_SPEC): Move + macro definitions of __COREDLL__, __MINGW32__, and __MINGW32CE__ + from former to latter construction so they show up when using + -dumpspecs. + 2007-09-11 Pedro Alves <ped...@po...> * config/arm/wince-pe.h (ARM_DOUBLEWORD_ALIGN, BIGGEST_ALIGNMENT): Modified: trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h 2007-11-14 22:45:10 UTC (rev 1070) +++ trunk/cegcc/src/gcc/gcc/config/arm/mingw32.h 2007-11-15 20:11:34 UTC (rev 1071) @@ -27,9 +27,6 @@ #define EXTRA_OS_CPP_BUILTINS() \ do \ { \ - builtin_define ("__COREDLL__"); \ - builtin_define ("__MINGW32__"); \ - builtin_define ("__MINGW32CE__"); \ builtin_define ("_WIN32"); \ builtin_define_std ("WIN32"); \ builtin_define_std ("WINNT"); \ @@ -38,6 +35,7 @@ #undef CPP_SPEC #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} \ +-D__COREDLL__ -D__MINGW32__ -D__MINGW32CE__ \ %{!nostdinc: -idirafter ../include/w32api%s -idirafter ../../include/w32api%s }" #undef LIB_SPEC This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-12-25 20:38:20
|
Revision: 1112 http://cegcc.svn.sourceforge.net/cegcc/?rev=1112&view=rev Author: pedroalves Date: 2007-12-25 12:38:18 -0800 (Tue, 25 Dec 2007) Log Message: ----------- * config.gcc: Remove redundant arm-wince-mingw32ce,arm-*-mingw32ce and arm-wince-cegcc,arm-*-cegcc copies. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/config.gcc Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-12-25 20:35:04 UTC (rev 1111) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-12-25 20:38:18 UTC (rev 1112) @@ -1,3 +1,8 @@ +2007-12-25 Pedro Alves <ped...@po...> + + * config.gcc: Remove redundant arm-wince-mingw32ce,arm-*-mingw32ce + and arm-wince-cegcc,arm-*-cegcc copies. + 2007-11-29 Danny Backx <dan...@us...> * config/arm/mingw32.h, config/arm/wince-cegcc.h : Define Modified: trunk/cegcc/src/gcc/gcc/config.gcc =================================================================== --- trunk/cegcc/src/gcc/gcc/config.gcc 2007-12-25 20:35:04 UTC (rev 1111) +++ trunk/cegcc/src/gcc/gcc/config.gcc 2007-12-25 20:38:18 UTC (rev 1112) @@ -644,6 +644,21 @@ extra_parts="crtinit.o crtfini.o" use_fixproto=yes ;; +arm*-*-cegcc*) + tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h arm/wince-pe.h arm/wince-cegcc.h" + tmake_file="arm/t-arm arm/t-wince-pe arm/t-wince-cegcc" + extra_options="${extra_options} arm/pe.opt arm/cegcc.opt" + extra_objs="pe.o pe-stubs.o" + extra_gcc_objs=cegcc1.o + cxx_target_objs=pe-cxx.o + target_gtfiles="\$(srcdir)/config/arm/pe.c" + case ${enable_threads} in + "" | yes | win32) + thread_file='win32' + tmake_file="${tmake_file} arm/t-gthr-win32" + ;; + esac + ;; arm-*-coff* | armel-*-coff*) tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h" tmake_file="arm/t-arm arm/t-arm-coff" @@ -660,6 +675,21 @@ tm_file="dbxelf.h elfos.h ${fbsd_tm_file} arm/elf.h arm/aout.h arm/freebsd.h arm/arm.h" tmake_file="${tmake_file} arm/t-arm arm/t-strongarm-elf" ;; +arm*-*-mingw32ce*) + tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h arm/wince-pe.h arm/mingw32.h" + xm_file=arm/xm-mingw32.h + tmake_file="arm/t-arm arm/t-wince-pe arm/t-cygming arm/t-mingw32" + target_gtfiles="\$(srcdir)/config/arm/pe.c" + extra_options="${extra_options} arm/pe.opt arm/cygming.opt" + extra_objs="pe.o pe-stubs.o" + cxx_target_objs=pe-cxx.o + case ${enable_threads} in + "" | yes | win32) + thread_file='win32' + tmake_file="${tmake_file} arm/t-gthr-win32" + ;; + esac + ;; arm*-*-netbsdelf*) tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h arm/arm.h arm/netbsd-elf.h" tmake_file="${tmake_file} arm/t-arm arm/t-netbsd" @@ -742,36 +772,6 @@ ;; esac ;; -arm*-wince-cegcc*) - tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h arm/wince-pe.h arm/wince-cegcc.h" - tmake_file="arm/t-arm arm/t-wince-pe arm/t-wince-cegcc" - extra_options="${extra_options} arm/pe.opt arm/cegcc.opt" - extra_objs="pe.o pe-stubs.o" - extra_gcc_objs=cegcc1.o - cxx_target_objs=pe-cxx.o - target_gtfiles="\$(srcdir)/config/arm/pe.c" - case ${enable_threads} in - "" | yes | win32) - thread_file='win32' - tmake_file="${tmake_file} arm/t-gthr-win32" - ;; - esac - ;; -arm-*-cegcc*) - tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h arm/wince-pe.h arm/wince-cegcc.h" - tmake_file="arm/t-arm arm/t-wince-pe arm/t-wince-cegcc" - extra_options="${extra_options} arm/pe.opt arm/cegcc.opt" - extra_objs="pe.o pe-stubs.o" - extra_gcc_objs=cegcc1.o - cxx_target_objs=pe-cxx.o - target_gtfiles="\$(srcdir)/config/arm/pe.c" - case ${enable_threads} in - "" | yes | win32) - thread_file='win32' - tmake_file="${tmake_file} arm/t-gthr-win32" - ;; - esac - ;; arm-*-pe*) tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h" tmake_file="arm/t-arm arm/t-pe" @@ -1270,36 +1270,6 @@ thread_file='posix' fi ;; -arm-*-mingw32*) - tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h arm/wince-pe.h arm/mingw32.h" - xm_file=arm/xm-mingw32.h - tmake_file="arm/t-arm arm/t-wince-pe arm/t-cygming arm/t-mingw32" - target_gtfiles="\$(srcdir)/config/arm/pe.c" - extra_options="${extra_options} arm/pe.opt arm/cygming.opt" - extra_objs="pe.o pe-stubs.o" - cxx_target_objs=pe-cxx.o - case ${enable_threads} in - "" | yes | win32) - thread_file='win32' - tmake_file="${tmake_file} arm/t-gthr-win32" - ;; - esac - ;; -arm-wince-mingw32*) - tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h arm/wince-pe.h arm/mingw32.h" - xm_file=arm/xm-mingw32.h - tmake_file="arm/t-arm arm/t-wince-pe arm/t-cygming arm/t-mingw32" - target_gtfiles="\$(srcdir)/config/arm/pe.c" - extra_options="${extra_options} arm/pe.opt arm/cygming.opt" - extra_objs="pe.o pe-stubs.o" - cxx_target_objs=pe-cxx.o - case ${enable_threads} in - "" | yes | win32) - thread_file='win32' - tmake_file="${tmake_file} arm/t-gthr-win32" - ;; - esac - ;; i[34567]86-*-mingw32*) tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/mingw32.h" xm_file=i386/xm-mingw32.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-12-25 23:25:17
|
Revision: 1117 http://cegcc.svn.sourceforge.net/cegcc/?rev=1117&view=rev Author: pedroalves Date: 2007-12-25 15:25:15 -0800 (Tue, 25 Dec 2007) Log Message: ----------- * libgcov.c (gcov_exit) [UNDER_CE]: Fix mbstowcs/wcstombs confusion. Always null terminate strings. Fix formatting. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/libgcov.c Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-12-25 23:12:07 UTC (rev 1116) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-12-25 23:25:15 UTC (rev 1117) @@ -1,5 +1,10 @@ 2007-12-25 Pedro Alves <ped...@po...> + * libgcov.c (gcov_exit) [UNDER_CE]: Fix mbstowcs/wcstombs + confusion. Always null terminate strings. Fix formatting. + +2007-12-25 Pedro Alves <ped...@po...> + * config.gcc: Remove redundant arm-wince-mingw32ce,arm-*-mingw32ce and arm-wince-cegcc,arm-*-cegcc copies. Modified: trunk/cegcc/src/gcc/gcc/libgcov.c =================================================================== --- trunk/cegcc/src/gcc/gcc/libgcov.c 2007-12-25 23:12:07 UTC (rev 1116) +++ trunk/cegcc/src/gcc/gcc/libgcov.c 2007-12-25 23:25:15 UTC (rev 1117) @@ -319,11 +319,14 @@ #endif #ifdef UNDER_CE { - wchar_t x[256]; - int l = strlen(gi_filename); + wchar_t x[256]; + int l = strlen (gi_filename); l = (l < 256) ? l : 255; - wcstombs(x, gi_filename, l); - MessageBoxW(0, L"gcov_open", x, 0); + mbstowcs (x, gi_filename, l); + x[l] = '\0'; + extern int MessageBoxW (void *, const wchar_t *, + const wchar_t *, unsigned); + MessageBoxW (0, L"gcov_open", x, 0); } #endif if (!gcov_open (gi_filename)) @@ -333,10 +336,13 @@ #else { wchar_t x[256]; - int l = strlen(gi_filename); + int l = strlen (gi_filename); l = (l < 256) ? l : 255; - mbstowcs(x, gi_filename, l); - MessageBoxW(0, x, L"gcov_open couldn't open file", 0); + mbstowcs (x, gi_filename, l); + x[l] = '\0'; + extern int MessageBoxW (void *, const wchar_t *, + const wchar_t *, unsigned); + MessageBoxW (0, x, L"gcov_open couldn't open file", 0); } #endif continue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |