From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin von Loewis To: egcs@cygnus.com Subject: --enable-new-abi Date: Sat, 09 May 1998 04:22:00 -0000 Message-id: <199805090828.KAA16324@mira.isdn.cs.tu-berlin.de> X-SW-Source: 1998-05/msg00318.html This is an experimental patch for egcs, enabling -fnew-abi by default. It is useful for compiling libstdc++ with the new ABI. Currently, this enables: - a new lay-out for classes if padding is involved, - a new mechanism to provide shorter mangled names (-fsquangle), - a standard-conforming processing of namespace std (-fhonor-std). Unfortunately, it is not possible to disable the default during runtime (i.e. -fno-new-abi doesn't really work). Therefore, this patch should not go into egcs. Suggestions for improvements are welcome. Martin Sat May 9 09:47:48 1998 Martin von Loewis * configure.in (--enable-new-abi): New option. * acconfig.h: Likewise. * gcc.c (CPP_SPEC): Add -D_HONOR_STD if configured for new ABI. (CC1PLUS_SPEC): Add -fnew-abi if configured for new ABI. Index: acconfig.h =================================================================== RCS file: /egcs/carton/cvsfiles/egcs/gcc/acconfig.h,v retrieving revision 1.14 diff -u -p -r1.14 acconfig.h --- acconfig.h 1998/04/04 17:37:22 1.14 +++ acconfig.h 1998/05/09 07:44:14 @@ -45,4 +48,7 @@ /* Whether abort must be declared even if is included. */ #undef NEED_DECLARATION_ABORT + +/* Use new g++ ABI */ +#undef ENABLE_NEW_ABI @TOP@ Index: configure.in =================================================================== RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v retrieving revision 1.99 diff -u -p -r1.99 configure.in --- configure.in 1998/05/08 01:18:39 1.99 +++ configure.in 1998/05/09 07:44:23 @@ -55,6 +55,12 @@ AC_ARG_WITH(elf, elf="$with_elf", elf=no) +# Specify usage of new ABI +AC_ARG_ENABLE(new-abi, +[ --enable-new-abi try experimental incompatible g++ features.], +newabi="$enable_new_abi", +newabi=no) + # Specify the local prefix AC_ARG_WITH(local-prefix, [ --with-local-prefix=DIR specifies directory to put local include.], @@ -180,6 +192,10 @@ AC_CACHE_VAL(gcc_cv_header_inttypes_h, gcc_cv_header_inttypes_h=yes], gcc_cv_header_inttypes_h=no)]) AC_MSG_RESULT($gcc_cv_header_inttypes_h) + +if test $newabi = yes; then + AC_DEFINE(ENABLE_NEW_ABI) +fi AC_CHECK_FUNCS(strtoul bsearch strerror putenv popen bcopy bzero bcmp \ index rindex strchr strrchr kill getrlimit setrlimit atoll atoq \ Index: gcc.c =================================================================== RCS file: /egcs/carton/cvsfiles/egcs/gcc/gcc.c,v retrieving revision 1.32 diff -u -p -r1.32 gcc.c --- gcc.c 1998/05/07 20:49:41 1.32 +++ gcc.c 1998/05/09 07:44:30 @@ -403,6 +403,11 @@ proper position among the other output f #ifndef CPP_SPEC #define CPP_SPEC "" #endif +#ifdef ENABLE_NEW_ABI +#define CPP_FULL_SPEC CPP_SPEC "-D__HONOR_STD" +#else +#define CPP_FULL_SPEC CPP_SPEC +#endif /* config.h can define CC1_SPEC to provide extra args to cc1 and cc1plus or extra switch-translations. */ @@ -415,6 +420,11 @@ proper position among the other output f #ifndef CC1PLUS_SPEC #define CC1PLUS_SPEC "" #endif +#ifdef ENABLE_NEW_ABI +#define CC1PLUS_FULL_SPEC CC1PLUS_SPEC "-fnew-abi" +#else +#define CC1PLUS_FULL_SPEC CC1PLUS_SPEC +#endif /* config.h can define LINK_SPEC to provide extra args to the linker or extra switch-translations. */ @@ -470,10 +480,10 @@ proper position among the other output f #define LINKER_NAME "collect2" #endif -static char *cpp_spec = CPP_SPEC; +static char *cpp_spec = CPP_FULL_SPEC; static char *cpp_predefines = CPP_PREDEFINES; static char *cc1_spec = CC1_SPEC; -static char *cc1plus_spec = CC1PLUS_SPEC; +static char *cc1plus_spec = CC1PLUS_FULL_SPEC; static char *signed_char_spec = SIGNED_CHAR_SPEC; static char *asm_spec = ASM_SPEC; static char *asm_final_spec = ASM_FINAL_SPEC;