aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Thorsen <bo@gcc.gnu.org>2002-05-27 16:01:40 +0200
committerBo Thorsen <bo@gcc.gnu.org>2002-05-27 16:01:40 +0200
commit96842bcde6e7600f3d525805ef5ba7dea3b3dbf5 (patch)
treee87605a18bba39e1c541a5f0a3097e566eecac2b
parentb86aa7b0487f06daa14d302950147b24edf1d478 (diff)
downloadgcc-96842bcde6e7600f3d525805ef5ba7dea3b3dbf5.zip
gcc-96842bcde6e7600f3d525805ef5ba7dea3b3dbf5.tar.gz
gcc-96842bcde6e7600f3d525805ef5ba7dea3b3dbf5.tar.bz2
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
-rw-r--r--gcc/config/i386/linux64.h63
-rw-r--r--gcc/config/i386/t-linux6416
2 files changed, 76 insertions, 3 deletions
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
index e457a7d..5ea9520 100644
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -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}"
+#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. */
+ 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 */
diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
index 264e537..46a7caa 100644
--- a/gcc/config/i386/t-linux64
+++ b/gcc/config/i386/t-linux64
@@ -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: