PATCH: Reduced scope of libgcc on Symbian OS
Mark Mitchell
mark@codesourcery.com
Wed Sep 1 06:09:00 GMT 2004
On Symbian OS, libgcc should only contain GCC-specific routines; the
system provides a base library containing all of the ARM BPABI
routines. Tested by building libgcc on arm-none-symbianelf, applied
on the mainline and on the csl-arm-branch.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
2004-08-31 Mark Mitchell <mark@codesourcery.com>
* config.gcc (arm*-*-symbianelf*): Do not include t-bpabi.
* config/arm/lib1funcs.asm: Do not include supplemental .S files
when compiling for Symbian.
* config/arm/symbian.h (RENAME_LIBRARY): New macro.
(TARGET_OS_CPP_BUILTINS): Likewise.
* config/arm/t-symbian (LIB1ASMFUNCS): Define.
Index: gcc/config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.405.4.14
diff -c -5 -p -r1.405.4.14 config.gcc
*** gcc/config.gcc 20 Aug 2004 20:10:29 -0000 1.405.4.14
--- gcc/config.gcc 1 Sep 2004 05:48:45 -0000
*************** arm*-*-eabi* | arm*-*-symbianelf* )
*** 682,695 ****
# The BPABI long long divmod functions return a 128-bit value in
# registers r0-r3. Correctly modeling that requires the use of
# TImode.
need_64bit_hwint=yes
tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
! tmake_file="t-slibgcc-elf-ver arm/t-arm arm/t-arm-elf arm/t-bpabi"
case ${target} in
arm*-*-symbianelf*)
tm_file="${tm_file} arm/symbian.h"
tmake_file="${tmake_file} arm/t-symbian"
;;
esac
tm_file="${tm_file} arm/aout.h arm/arm.h"
;;
--- 682,700 ----
# The BPABI long long divmod functions return a 128-bit value in
# registers r0-r3. Correctly modeling that requires the use of
# TImode.
need_64bit_hwint=yes
tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
! tmake_file="t-slibgcc-elf-ver arm/t-arm arm/t-arm-elf"
case ${target} in
+ arm*-*-eabi*)
+ tmake_file="${tmake_file} arm/t-bpabi"
+ ;;
arm*-*-symbianelf*)
tm_file="${tm_file} arm/symbian.h"
+ # We do not include t-bpabi for Symbian OS because the system
+ # provides its own implementation of the BPABI functions.
tmake_file="${tmake_file} arm/t-symbian"
;;
esac
tm_file="${tm_file} arm/aout.h arm/arm.h"
;;
Index: gcc/config/arm/lib1funcs.asm
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/lib1funcs.asm,v
retrieving revision 1.26.4.5
diff -c -5 -p -r1.26.4.5 lib1funcs.asm
*** gcc/config/arm/lib1funcs.asm 18 Aug 2004 03:57:45 -0000 1.26.4.5
--- gcc/config/arm/lib1funcs.asm 1 Sep 2004 05:48:45 -0000
*************** LSYM(Lchange_\register):
*** 1043,1050 ****
--- 1043,1052 ----
SIZE (_interwork_call_via_lr)
#endif /* L_interwork_call_via_rX */
#endif /* Arch supports thumb. */
+ #ifndef __symbian__
#include "ieee754-df.S"
#include "ieee754-sf.S"
#include "bpabi.S"
+ #endif /* __symbian__ */
Index: gcc/config/arm/symbian.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/symbian.h,v
retrieving revision 1.5.2.5
diff -c -5 -p -r1.5.2.5 symbian.h
*** gcc/config/arm/symbian.h 26 Aug 2004 01:02:05 -0000 1.5.2.5
--- gcc/config/arm/symbian.h 1 Sep 2004 05:48:45 -0000
***************
*** 56,60 ****
--- 56,72 ----
/* The assembler should assume VFP FPU format, and armv5t. */
#undef SUBTARGET_ASM_FLOAT_SPEC
#define SUBTARGET_ASM_FLOAT_SPEC \
"%{!mfpu=*:-mfpu=vfp} %{!mcpu=*:%{!march=*:-march=armv5t}}"
+ /* SymbianOS provides the BPABI routines in a separate library.
+ Therefore, we do not need to define any of them in libgcc. */
+ #undef RENAME_LIBRARY
+ #define RENAME_LIBRARY(GCC_NAME, AEABI_NAME) /* empty */
+
+ /* Define the __symbian__ macro. */
+ #define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__symbian__"); \
+ } \
+ while (false)
Index: gcc/config/arm/t-symbian
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/t-symbian,v
retrieving revision 1.1.2.2
diff -c -5 -p -r1.1.2.2 t-symbian
*** gcc/config/arm/t-symbian 26 Aug 2004 01:02:05 -0000 1.1.2.2
--- gcc/config/arm/t-symbian 1 Sep 2004 05:48:45 -0000
***************
*** 1,5 ****
--- 1,19 ----
+ LIB1ASMFUNCS = _bb_init_func _call_via_rX _interwork_call_via_rX
+
+ # These functions have __aeabi equivalents and will never be called by GCC.
+ # By putting them in LIB1ASMFUNCS, we avoid the standard libgcc2.c code being
+ # used -- and we make sure that definitions are not available in lib1funcs.asm,
+ # either, so they end up undefined.
+ LIB1ASMFUNCS += \
+ _ashldi3 _ashrdi3 _divdi3 _floatdidf _udivmoddi4 _umoddi3 \
+ _udivdi3 _lshrdi3 _moddi3 _muldi3 _negdi2 _cmpdi2 \
+ _fixdfdi _fixsfdi _fixunsdfdi _fixunssfdi _floatdisf \
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
+ _fixsfsi _fixunssfsi
+
# Create a multilib for processors with VFP floating-point, and a
# multilib for those without -- using the soft-float ABI in both
# cases. Symbian OS object should be compiled with interworking
# enabled, so there are no separate thumb-mode libraries.
MULTILIB_OPTIONS = mfloat-abi=softfp
More information about the Gcc-patches
mailing list