This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix __gxx_personality_v0 linking for SymbianOS [csl-arm-branch]
- From: Julian Brown <julian at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Julian Brown <julian at codesourcery dot com>
- Date: Wed, 09 Mar 2005 23:22:52 +0000
- Subject: [PATCH] Fix __gxx_personality_v0 linking for SymbianOS [csl-arm-branch]
Hi,
This patch should allow C++ programs using exceptions to be linked on
SymbianOS, by suitably partitioning the necessary exception-handling
library support routines. All files except eh_personality.cc are omitted
from libsupc++, and pr-support.c is added to libgcc.a. It also disables
the shared libgcc, which isn't needed for this OS, and stops C++ headers
(from libsupc++, and some C-compatibility headers from libstdc++) from
being installed.
OK to apply on csl-arm-branch?
ChangeLog:
* gcc/config.gcc: Disable shared libgcc for SymbianOS.
* gcc/config/arm/t-symbian (LIB2ADDEH): Include
config/arm/pr-support.c.
* libstdc++/configure.ac (ARMSYMBIANOS): New AM_CONDITIONAL: yes if
we are compiling for SymbianOS on ARM.
* libstdc++-v3/include/Makefile.am: Don't install C++ headers for
SymbianOS.
* libstdc++-v3/libsupc++/Makefile.am: Only include eh_personality.cc
in libsupc++ on SymbianOS.
* libstdc++-v3/Makefile.in: Regenerate.
* libstdc++-v3/configure: Regenerate.
* libstdc++-v3/include/Makefile.in: Regenerate.
* libstdc++-v3/libmath/Makefile.in: Regenerate.
* libstdc++-v3/libsupc++/Makefile.in: Regenerate.
* libstdc++-v3/po/Makefile.in: Regenerate.
* libstdc++-v3/src/Makefile.in: Regenerate.
* libstdc++-v3/testsuite/Makefile.in: Regenerate.
Index: gcc/config.gcc
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.405.4.22
diff -c -p -r1.405.4.22 config.gcc
*** gcc/config.gcc 30 Dec 2004 22:33:23 -0000 1.405.4.22
--- gcc/config.gcc 9 Mar 2005 20:39:39 -0000
*************** arm*-*-eabi* | arm*-*-symbianelf* )
*** 710,716 ****
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} t-slibgcc-elf-ver arm/t-symbian"
;;
esac
tm_file="${tm_file} arm/aout.h arm/arm.h"
--- 710,716 ----
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/t-symbian
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/config/arm/t-symbian,v
retrieving revision 1.1.2.6
diff -c -p -r1.1.2.6 t-symbian
*** gcc/config/arm/t-symbian 30 Sep 2004 20:10:58 -0000 1.1.2.6
--- gcc/config/arm/t-symbian 9 Mar 2005 20:15:01 -0000
*************** LIB1ASMFUNCS += \
*** 13,19 ****
_fixsfsi _fixunssfsi
# Inlcude the gcc personality routine
! LIB2ADDEH = $(srcdir)/unwind-c.c
LIB2ADDEHDEP = unwind-arm.h
# Create a multilib for processors with VFP floating-point, and a
# multilib for those without -- using the soft-float ABI in both
--- 13,19 ----
_fixsfsi _fixunssfsi
# Inlcude the gcc personality routine
! LIB2ADDEH = $(srcdir)/unwind-c.c $(srcdir)/config/arm/pr-support.c
LIB2ADDEHDEP = unwind-arm.h
# Create a multilib for processors with VFP floating-point, and a
# multilib for those without -- using the soft-float ABI in both
Index: libstdc++-v3/configure.ac
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/libstdc++-v3/configure.ac,v
retrieving revision 1.11.4.6
diff -c -p -r1.11.4.6 configure.ac
*** libstdc++-v3/configure.ac 30 Dec 2004 22:37:51 -0000 1.11.4.6
--- libstdc++-v3/configure.ac 9 Mar 2005 23:17:42 -0000
*************** AC_SUBST(ATOMIC_WORD_SRCDIR)
*** 278,290 ****
AC_SUBST(ABI_TWEAKS_SRCDIR)
AC_SUBST(OS_INC_SRCDIR)
# Determine cross-compile flags and AM_CONDITIONALs.
#AC_SUBST(GLIBCXX_IS_NATIVE)
#AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes)
# from GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT:
#AM_CONDITIONAL(GLIBCXX_BUILD_LIBMATH, test $need_libmath = yes)
GLIBCXX_EVALUATE_CONDITIONALS
!
AC_CACHE_SAVE
if test ${multilib} = yes; then
--- 278,299 ----
AC_SUBST(ABI_TWEAKS_SRCDIR)
AC_SUBST(OS_INC_SRCDIR)
+ # For SymbianOS, we use a highly cut-down libsupc++. This lets us
+ # conditionalise libsupc++'s Makefile.am to include only the necessary sources.
+ case "$target" in
+ *arm*-symbianelf)
+ ARMSYMBIANOS=yes;;
+ *);;
+ esac
+ AM_CONDITIONAL(ARMSYMBIANOS, test $ARMSYMBIANOS = yes)
+
# Determine cross-compile flags and AM_CONDITIONALs.
#AC_SUBST(GLIBCXX_IS_NATIVE)
#AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes)
# from GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT:
#AM_CONDITIONAL(GLIBCXX_BUILD_LIBMATH, test $need_libmath = yes)
GLIBCXX_EVALUATE_CONDITIONALS
!
AC_CACHE_SAVE
if test ${multilib} = yes; then
Index: libstdc++-v3/include/Makefile.am
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/libstdc++-v3/include/Makefile.am,v
retrieving revision 1.71.4.5
diff -c -p -r1.71.4.5 Makefile.am
*** libstdc++-v3/include/Makefile.am 30 Dec 2004 22:37:53 -0000 1.71.4.5
--- libstdc++-v3/include/Makefile.am 9 Mar 2005 21:45:32 -0000
*************** ${pch_input}: ${allstamped} ${host_build
*** 556,563 ****
--- 556,568 ----
if GLIBCXX_HOSTED
install-data-local: install-headers ${pch_install}
else
+ if ARMSYMBIANOS
+ # Don't install any headers for SymbianOS.
+ install-data-local:
+ else
install-data-local: install-freestanding-headers
endif
+ endif
# This is a subset of the full install-headers rule. We only need <cstddef>,
# <limits>, <cstdlib>, <cstdarg>, <new>, <typeinfo>, <exception>, and any
Index: libstdc++-v3/libsupc++/Makefile.am
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/libstdc++-v3/libsupc++/Makefile.am,v
retrieving revision 1.48.4.3
diff -c -p -r1.48.4.3 Makefile.am
*** libstdc++-v3/libsupc++/Makefile.am 22 Sep 2004 15:40:32 -0000 1.48.4.3
--- libstdc++-v3/libsupc++/Makefile.am 9 Mar 2005 21:25:22 -0000
*************** toolexeclib_LTLIBRARIES = libsupc++.la
*** 30,35 ****
--- 30,40 ----
# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
noinst_LTLIBRARIES = libsupc++convenience.la
+ if ARMSYMBIANOS
+ sources = \
+ eh_personality.cc
+
+ else
headers = \
exception new typeinfo cxxabi.h exception_defines.h
*************** sources = \
*** 68,73 ****
--- 73,79 ----
tinfo2.cc \
vec.cc \
vterminate.cc
+ endif
libsupc___la_SOURCES = $(sources) $(c_sources)
libsupc__convenience_la_SOURCES = $(sources) $(c_sources)