From cd8c180f96ddff38d31dce9c272aa39f99d8b684 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 28 Oct 2004 18:35:04 +0000 Subject: [PATCH] add a fix in order to avoid using the broken BDirectWindow-typeinfo function that is contained inside the BE-libs. We generate a new one and use this instead git-svn-id: file:///srv/svn/repos/haiku/trunk/buildtools@9618 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../beos-specific/fix_bdirectwin_typeinfo.cpp | 18 ++++++++++++++++++ gcc/gcc/config/i386/beos-elf.h | 2 +- gcc/gcc/config/i386/t-beos | 8 ++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gcc/gcc/beos-specific/fix_bdirectwin_typeinfo.cpp diff --git a/gcc/gcc/beos-specific/fix_bdirectwin_typeinfo.cpp b/gcc/gcc/beos-specific/fix_bdirectwin_typeinfo.cpp new file mode 100644 index 0000000000..c52f47bc3b --- /dev/null +++ b/gcc/gcc/beos-specific/fix_bdirectwin_typeinfo.cpp @@ -0,0 +1,18 @@ +/* +** This file exists merely to produce the typeinfo-function for BDirectWindow +** (i.e. the symbol __tf13BDirectWindow). +** It seems that the version of this function included in the Be-libs isn't +** working (it crashes GLTeapot, for instance). So we use this file to +** generate a working version of this function which will be linked into any +** application automatically, fixing the problem. +** TODO: check if this applies to Dano/Zeta and deactivate this if it doesn't. +**/ + +#include +#include + +void +dummy() +{ + typeid(BDirectWindow); +} diff --git a/gcc/gcc/config/i386/beos-elf.h b/gcc/gcc/config/i386/beos-elf.h index d96becd062..f0fc93cd9d 100644 --- a/gcc/gcc/config/i386/beos-elf.h +++ b/gcc/gcc/config/i386/beos-elf.h @@ -202,7 +202,7 @@ Boston, MA 02111-1307, USA. */ #define LIBGCC_SPEC "" #undef STARTFILE_SPEC -#define STARTFILE_SPEC "crti.o%s crtbegin.o%s %{!nostart: %{!shared: start_dyn.o%s}} init_term_dyn.o%s %{p:i386-mcount.o%s}" +#define STARTFILE_SPEC "crti.o%s crtbegin.o%s %{!nostart: %{!shared: start_dyn.o%s fix_bdirectwin_typeinfo.o%s}} init_term_dyn.o%s %{p:i386-mcount.o%s}" #undef ENDFILE_SPEC #define ENDFILE_SPEC "crtend.o%s crtn.o%s" diff --git a/gcc/gcc/config/i386/t-beos b/gcc/gcc/config/i386/t-beos index 2bc8596143..bf5db9115e 100644 --- a/gcc/gcc/config/i386/t-beos +++ b/gcc/gcc/config/i386/t-beos @@ -12,3 +12,11 @@ INSTALL_ASSERT_H = winnt.o: $(srcdir)/config/i386/winnt.c $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/winnt.c + +EXTRA_PARTS += fix_bdirectwin_typeinfo.o +# The purpose of this rule is to generate fix_bdirectwin_typeinfo.o. +# This object-file is required to fix a problem with the BDirectWindow-typeinfo +# function as provided by the Be-libs (which crashes GLTeapot). +# +fix_bdirectwin_typeinfo.o: $(srcdir)/beos-specific/fix_bdirectwin_typeinfo.cpp + gcc -c -O0 $(srcdir)/beos-specific/fix_bdirectwin_typeinfo.cpp