libgcc-x86_64-glibc.ver: Copy this file from the 3.1 branch.

2002-05-23  Bo Thorsen  <bo@suse.de>

        * config/i386/libgcc-x86_64-glibc.ver: Copy this file from the
	3.1 branch. The file was made by Jakub Jelinek.
	* config/i386/linux64.h (MD_FALLBACK_FRAME_STATE_FOR): Add i386
	support so multilib doesn't break. And don't define this at all
	when -Dinhibit_libc is used.
	(MULTILIB_DEFAULTS): Always set default to 64 bit compilation.
	* config/i386/t-linux64: Implement full multilib support. Patch
	originally done by Andreas Jaeger and Jakub Jelinek.

From-SVN: r53927
This commit is contained in:
Bo Thorsen 2002-05-27 16:01:40 +02:00
parent b86aa7b048
commit 96842bcde6
2 changed files with 77 additions and 4 deletions

View File

@ -65,14 +65,19 @@ Boston, MA 02111-1307, USA. */
%{m32:%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s} \
%{!m32:%{!shared:crtend.o%s} %{shared:crtendS.o%s} /usr/lib64/crtn.o%s}"
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
#define MULTILIB_DEFAULTS { "m64" }
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs.
Don't use this at all if inhibit_libc is used. */
#ifndef inhibit_libc
#ifdef IN_LIBGCC2
#include <signal.h>
#include <sys/ucontext.h>
#endif
#ifdef __x86_64__
#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
do { \
unsigned char *pc_ = (CONTEXT)->ra; \
@ -129,3 +134,59 @@ Boston, MA 02111-1307, USA. */
(FS)->retaddr_column = 16; \
goto SUCCESS; \
} while (0)
#else /* ifdef __x86_64__ */
#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
do { \
unsigned char *pc_ = (CONTEXT)->ra; \
struct sigcontext *sc_; \
long new_cfa_; \
\
/* popl %eax ; movl $__NR_sigreturn,%eax ; int $0x80 */ \
if (*(unsigned short *)(pc_+0) == 0xb858 \
&& *(unsigned int *)(pc_+2) == 119 \
&& *(unsigned short *)(pc_+6) == 0x80cd) \
sc_ = (CONTEXT)->cfa + 4; \
/* movl $__NR_rt_sigreturn,%eax ; int $0x80 */ \
else if (*(unsigned char *)(pc_+0) == 0xb8 \
&& *(unsigned int *)(pc_+1) == 173 \
&& *(unsigned short *)(pc_+5) == 0x80cd) \
{ \
struct rt_sigframe { \
int sig; \
struct siginfo *pinfo; \
void *puc; \
struct siginfo info; \
struct ucontext uc; \
} *rt_ = (CONTEXT)->cfa; \
sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext; \
} \
else \
break; \
\
new_cfa_ = sc_->esp; \
(FS)->cfa_how = CFA_REG_OFFSET; \
(FS)->cfa_reg = 4; \
(FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
\
/* The SVR4 register numbering macros aren't usable in libgcc. */ \
(FS)->regs.reg[0].how = REG_SAVED_OFFSET; \
(FS)->regs.reg[0].loc.offset = (long)&sc_->eax - new_cfa_; \
(FS)->regs.reg[3].how = REG_SAVED_OFFSET; \
(FS)->regs.reg[3].loc.offset = (long)&sc_->ebx - new_cfa_; \
(FS)->regs.reg[1].how = REG_SAVED_OFFSET; \
(FS)->regs.reg[1].loc.offset = (long)&sc_->ecx - new_cfa_; \
(FS)->regs.reg[2].how = REG_SAVED_OFFSET; \
(FS)->regs.reg[2].loc.offset = (long)&sc_->edx - new_cfa_; \
(FS)->regs.reg[6].how = REG_SAVED_OFFSET; \
(FS)->regs.reg[6].loc.offset = (long)&sc_->esi - new_cfa_; \
(FS)->regs.reg[7].how = REG_SAVED_OFFSET; \
(FS)->regs.reg[7].loc.offset = (long)&sc_->edi - new_cfa_; \
(FS)->regs.reg[5].how = REG_SAVED_OFFSET; \
(FS)->regs.reg[5].loc.offset = (long)&sc_->ebp - new_cfa_; \
(FS)->regs.reg[8].how = REG_SAVED_OFFSET; \
(FS)->regs.reg[8].loc.offset = (long)&sc_->eip - new_cfa_; \
(FS)->retaddr_column = 8; \
goto SUCCESS; \
} while (0)
#endif /* ifdef __x86_64__ */
#endif /* ifdef inhibit_libc */

View File

@ -1,3 +1,15 @@
# On x86-64 we do not need any exports for glibc, override the settings
# On x86-64 we do not need any exports for glibc for 64-bit libgcc_s,
# override the settings
# from t-slibgcc-elf-ver and t-linux
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \
$(srcdir)/config/i386/libgcc-x86_64-glibc.ver
MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
SHLIB_SLIBDIR_SUFFIXES = 64:64 32: