From: Chris Hanson Date: Mon, 7 Feb 2000 04:42:25 +0000 (+0000) Subject: Fix bug: in GCC 2.95.x, the callee pops the pointer to a short struct X-Git-Tag: 20090517-FFI~4262 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=005bd113f3c59ca1c029755c5f4d3aff9d93e8e9;p=mit-scheme.git Fix bug: in GCC 2.95.x, the callee pops the pointer to a short struct return. --- diff --git a/v7/src/microcode/cmpauxmd/i386.m4 b/v7/src/microcode/cmpauxmd/i386.m4 index 6e5e71e7e..559f6b5b4 100644 --- a/v7/src/microcode/cmpauxmd/i386.m4 +++ b/v7/src/microcode/cmpauxmd/i386.m4 @@ -1,8 +1,8 @@ ### -*-Midas-*- ### -### $Id: i386.m4,v 1.49 1999/01/02 06:11:34 cph Exp $ +### $Id: i386.m4,v 1.50 2000/02/07 04:42:14 cph Exp $ ### -### Copyright (c) 1992-1999 Massachusetts Institute of Technology +### Copyright (c) 1992-2000 Massachusetts Institute of Technology ### ### This program is free software; you can redistribute it and/or ### modify it under the terms of the GNU General Public License as @@ -122,6 +122,11 @@ ### that space on the top of the stack. If STATIC_STRUCT_RETURN ### is defined, the callee returns a pointer to a static struct in ### EAX. Otherwise, the callee returns the struct in EAX/EDX. +### CALLEE_POPS_STRUCT_RETURN +### Modifies the CALLER_ALLOCS_STRUCT_RETURN calling convention. +### Under the modified convention, the callee pops the pointer to +### the allocated space, so the caller doesn't have to. This +### convention is used by GCC 2.9.x. ### WCC386 ### Should be defined when using Watcom assembler. ### WCC386R @@ -628,8 +633,9 @@ ifdef(`CALLER_ALLOCS_STRUCT_RETURN',` define_debugging_label(scheme_to_interface_return) ifdef(`CALLER_ALLOCS_STRUCT_RETURN',` +ifdef(`CALLEE_POPS_STRUCT_RETURN',`',` OP(add,l) TW(IMM(4),REG(esp)) # pop pointer to struct return -') +')') OP(add,l) TW(IMM(16),REG(esp)) # Pop utility args ifdef(`STATIC_STRUCT_RETURN',` diff --git a/v7/src/microcode/s/linux.h b/v7/src/microcode/s/linux.h index 2cb32da45..9ad0f02fb 100644 --- a/v7/src/microcode/s/linux.h +++ b/v7/src/microcode/s/linux.h @@ -1,9 +1,9 @@ /* -*-C-*- System file for Linux -$Id: linux.h,v 1.18 1999/03/03 05:32:18 cph Exp $ +$Id: linux.h,v 1.19 2000/02/07 04:42:25 cph Exp $ -Copyright (c) 1995-1999 Massachusetts Institute of Technology +Copyright (c) 1995-2000 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,7 +29,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define LINUX_STATIC_LIBS(libs) -Xlinker -Bstatic libs -Xlinker -Bdynamic #ifdef __ELF__ +#if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9))) +#define M4_SWITCH_SYSTEM -P "define(LINUX_ELF,1)" -P "define(CALLEE_POPS_STRUCT_RETURN,1)" +#else #define M4_SWITCH_SYSTEM -P "define(LINUX_ELF,1)" +#endif /* Newer versions of Debian don't really support termcap. However, ncurses is supported on all GNU/Linux systems, so we'll use that instead. */