home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mayn.de
/
ftp.mayn.de-pub.zip
/
ftp.mayn.de-pub
/
apple
/
apple_unix_2
/
gcc-2.7.2.aux.diffs.gz
/
gcc-2.7.2.aux.diffs
Wrap
Text File
|
1995-12-11
|
32KB
|
938 lines
*** /dev/null Tue Dec 5 13:52:55 1995
--- ./README.AUX Tue Dec 5 09:41:49 1995
***************
*** 0 ****
--- 1,75 ----
+ This file details the diffs, patches and new files needed to allow GNU gcc
+ to support A/UX. Most of these are required due to the hybrid nature of
+ A/UX (UNIX and MacOS) and some are simply to describe A/UX itself. Builds
+ of gcc for A/UX require 'gas' (at least 1.38.1) and a previously built
+ version of 'gcc'. Check the A/UX FAQ for sites that carry these.
+
+ * Makefile.in (libgcc2.a): Allow object files in LIB2FUNCS_EXTRA
+ so that objects needing special processing can be added.
+
+ * c-lex.c (readescape, yylex): Provide support for the pascal
+ strings used by Mac programmers.
+ * c-lex.c (yylex): Conditionally do not produce a warning for
+ multi-character constants under A/UX.
+
+ * m68k/aux-exit.c: New file. Provides _exithk() stub for MacOS
+ * m68k/aux-crtfix.c: New file. Provide tool to patch MacOS mcrt files
+ * m68k/aux-mcount.asm: New file. Hook into A/UX profiling.
+ * m68k/aux.h, m68k/x-aux, m68k/xm-aux.h: New files.
+
+ * m68k/m68k.c (use_return_insn): A/UX returns pointers in %a0 --
+ don't use return insn when returning a pointer.
+
+ * gcc.c (process_command): A/UX's 'ld' requires a space
+ between after '-o' but no space after '-L'
+
+ * libgcc2.c: Add in _exithk() stub to exit() call.
+
+ * configure, config.guess, config.sub: Recognize A/UX.
+
+ * fixincludes: Fix A/UX's <sys/param.h>.
+
+ * aux-fixcrts: New file. Uses aux-crtfix to fix MacOS mcrt files.
+
+ These patches follow the tradition of placing the gcc executable in
+ '/usr/local/Gnu' and the support files in '/usr/local/Gnu/lib/gcc/aux'
+
+ To build A/UX the procedure is quite easy and follows the general 'gcc'
+ methods. However, the previously built version of 'gas' must be placed
+ at the top-level source directory and called 'as'. If you're kinda lazy,
+ you do this in the top-level directory of the gcc-2.7.2 source tree:
+
+ % cp <gas's home>gas as
+ % patch < gcc4aux.diffs
+ % ./configure --prefix=/usr/local/Gnu aux
+ % make CC="<pathname to gcc>"
+ % make stage1
+ % make CC="stage1/xgcc -Bstage1/"
+ % make stage2
+ % make CC="stage2/xgcc -Bstage2/"
+ % make CC="stage2/xgcc -Bstage2/" compare
+ % make CC="stage2/xgcc -Bstage2/" install
+ % make CC="stage2/xgcc -Bstage2/" objc-runtime
+ % make CC="stage2/xgcc -Bstage2/" install-libobjc
+
+ Finally, when built, it is recommended that you run 'aux-fixcrts' to
+ patch the MacOS mcrt files to work under 'gcc' if you will be creating
+ MacOS-hybrid programs. The command-line is:
+
+ % sh aux-fixcrts /usr/local/Gnu/lib/gcc/aux/2.7.2
+
+ Enjoy!
+
+ NOTE: These patches are the result of work of a lot of contributors including:
+
+ David W. Berry (formerly @ Apple)
+ John Coolidge (@ Apple)
+ Richard Henderson
+ Jim Jagielski
+
+ --
+ #include <std/disclaimer.h>
+ | Jim Jagielski | jim@jagubox.gsfc.nasa.gov | V: 301 286-5964 |
+ | NASA/GSFC, Code 734.4 | Greenbelt, MD 20771 | F: 301 286-1719 |
+ << This sig is a figment of your imagination; SEEK MENTAL HELP !! >>
+
*** /dev/null Tue Dec 5 13:52:55 1995
--- ./COMPILE.gcc.aux Mon Nov 20 07:12:34 1995
***************
*** 0 ****
--- 1,26 ----
+ #!/bin/ksh
+ #
+ # Just compile gcc
+ #
+ ./configure --prefix=/usr/local/Gnu aux
+ make CC=$GNU/gcc
+ print " "
+ print "======================"
+ print "= Doing stage2 build ="
+ print "======================"
+ make stage1
+ ln as stage1/as
+ make CC="stage1/xgcc -Bstage1/"
+ print " "
+ print "======================"
+ print "= Doing stage3 build ="
+ print "======================"
+ make stage2
+ ln as stage2/as
+ make CC="stage2/xgcc -Bstage2/"
+ print " "
+ print "======================"
+ print "= Doing gcc compare ="
+ print "======================"
+ make CC="stage2/xgcc -Bstage2/" compare
+ exit
*** /dev/null Tue Dec 5 13:52:55 1995
--- ./aux-fixcrts Tue Dec 5 09:41:36 1995
***************
*** 0 ****
--- 1,18 ----
+ #! /bin/sh
+
+ CRTDIR=${1-${CRTDIR-/usr/local/Gnu/lib/gcc/aux/2.7.2}}
+
+ files=`echo /lib/*crt*.o /usr/lib/*crt*.o`
+
+ cp $files $CRTDIR
+
+ for file in $files; do
+ lfile=$CRTDIR/`basename $file`
+ ./aux-crtfix $lfile
+ fixout=`cmp $file $lfile`
+ if [ $? = 0 ]; then
+ rm $lfile
+ else
+ echo Fixed `basename $file`
+ fi
+ done
*** /usr2/src/ORIGS/gcc-2.7.2/./Makefile.in Tue Dec 5 09:35:58 1995
--- ./Makefile.in Tue Dec 5 09:34:08 1995
***************
*** 47,54 ****
# to the stage2 and stage3 compilations
# XCFLAGS is used for most compilations but not when using the GCC just built.
XCFLAGS =
! CFLAGS = -g
! BOOT_CFLAGS = -O $(CFLAGS)
# These exists to be overridden by the x-* and t-* files, respectively.
X_CFLAGS =
T_CFLAGS =
--- 47,54 ----
# to the stage2 and stage3 compilations
# XCFLAGS is used for most compilations but not when using the GCC just built.
XCFLAGS =
! CFLAGS = -O2
! BOOT_CFLAGS = -O2 $(CFLAGS)
# These exists to be overridden by the x-* and t-* files, respectively.
X_CFLAGS =
T_CFLAGS =
***************
*** 181,187 ****
srcdir = .
# Common prefix for installation directories.
# NOTE: This directory must exist when you start installation.
! prefix = /usr/local
# Directory in which to put localized header files. On the systems with
# gcc as the native cc, `local_prefix' may not be `prefix' which is
# `/usr'.
--- 181,187 ----
srcdir = .
# Common prefix for installation directories.
# NOTE: This directory must exist when you start installation.
! prefix = /usr/local/Gnu
# Directory in which to put localized header files. On the systems with
# gcc as the native cc, `local_prefix' may not be `prefix' which is
# `/usr'.
***************
*** 190,200 ****
# Directory in which to put host dependent programs and libraries
exec_prefix = $(prefix)
# Directory in which to put the executable for the command `gcc'
! bindir = $(exec_prefix)/bin
# Directory in which to put the directories used by the compiler.
libdir = $(exec_prefix)/lib
# Directory in which the compiler finds executables, libraries, etc.
! libsubdir = $(libdir)/gcc-lib/$(target)/$(version)
# Directory in which the compiler finds g++ includes.
gxx_include_dir= $(libdir)/g++-include
# Directory to search for site-specific includes.
--- 190,200 ----
# Directory in which to put host dependent programs and libraries
exec_prefix = $(prefix)
# Directory in which to put the executable for the command `gcc'
! bindir = $(exec_prefix)
# Directory in which to put the directories used by the compiler.
libdir = $(exec_prefix)/lib
# Directory in which the compiler finds executables, libraries, etc.
! libsubdir = $(libdir)/gcc/$(target)/$(version)
# Directory in which the compiler finds g++ includes.
gxx_include_dir= $(libdir)/g++-include
# Directory to search for site-specific includes.
***************
*** 887,902 ****
for file in .. $(LIB2FUNCS_EXTRA); \
do \
if [ x$${file} != x.. ]; then \
! name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//'`; \
oname=` echo $${name} | sed -e 's,.*/,,'`; \
echo $${name}; \
! if [ $${name}.asm = $${file} ]; then \
! cp $${file} $${name}.s || exit 1; file=$${name}.s; \
! else true; fi; \
! $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
! if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
! $(AR) $(AR_FLAGS) tmplibgcc2.a $${oname}$(objext); \
! rm -f $${name}.s $${oname}$(objext); \
else true; \
fi; \
done
--- 887,906 ----
for file in .. $(LIB2FUNCS_EXTRA); \
do \
if [ x$${file} != x.. ]; then \
! name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//' -e 's/\$(objext)$$//'`; \
oname=` echo $${name} | sed -e 's,.*/,,'`; \
echo $${name}; \
! if [ $${name}$(objext) = $${file} ]; then \
! $(AR) $(AR_FLAGS) tmplibgcc2.a $${file}; \
! else \
! if [ $${name}.asm = $${file} ]; then \
! cp $${file} $${name}.s || exit 1; file=$${name}.s; \
! else true; fi; \
! $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
! if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
! $(AR) $(AR_FLAGS) tmplibgcc2.a $${oname}$(objext); \
! rm -f $${name}.s $${oname}$(objext); \
! fi; \
else true; \
fi; \
done
***************
*** 1135,1141 ****
gcc.o: gcc.c $(CONFIG_H) multilib.h config.status $(lang_specs_files)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
! -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
-DDEFAULT_TARGET_VERSION=\"$(version)\" \
-DDEFAULT_TARGET_MACHINE=\"$(target)\" \
-DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\" \
--- 1139,1145 ----
gcc.o: gcc.c $(CONFIG_H) multilib.h config.status $(lang_specs_files)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
! -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
-DDEFAULT_TARGET_VERSION=\"$(version)\" \
-DDEFAULT_TARGET_MACHINE=\"$(target)\" \
-DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\" \
***************
*** 2048,2059 ****
# Create the installation directory.
install-dir:
-if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; chmod a+rx $(libdir) ; fi
! -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; chmod a+rx $(libdir)/gcc-lib ; fi
# This dir isn't currently searched by cpp.
! # -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; chmod a+rx $(libdir)/gcc-lib/include ; fi
! -if [ -d $(libdir)/gcc-lib/$(target) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target) ; chmod a+rx $(libdir)/gcc-lib/$(target) ; fi
! -if [ -d $(libdir)/gcc-lib/$(target)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version) ; chmod a+rx $(libdir)/gcc-lib/$(target)/$(version) ; fi
! -if [ -d $(libdir)/gcc-lib/$(target)/$(version)/include ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version)/include ; chmod a+rx $(libdir)/gcc-lib/$(target)/$(version)/include ; fi
-if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi
-if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi
-if [ -d $(tooldir) ] ; then true ; else mkdir $(tooldir) ; chmod a+rx $(tooldir) ; fi
--- 2052,2063 ----
# Create the installation directory.
install-dir:
-if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; chmod a+rx $(libdir) ; fi
! -if [ -d $(libdir)/gcc ] ; then true ; else mkdir $(libdir)/gcc ; chmod a+rx $(libdir)/gcc ; fi
# This dir isn't currently searched by cpp.
! # -if [ -d $(libdir)/gcc/include ] ; then true ; else mkdir $(libdir)/gcc/include ; chmod a+rx $(libdir)/gcc/include ; fi
! -if [ -d $(libdir)/gcc/$(target) ] ; then true ; else mkdir $(libdir)/gcc/$(target) ; chmod a+rx $(libdir)/gcc/$(target) ; fi
! -if [ -d $(libdir)/gcc/$(target)/$(version) ] ; then true ; else mkdir $(libdir)/gcc/$(target)/$(version) ; chmod a+rx $(libdir)/gcc/$(target)/$(version) ; fi
! -if [ -d $(libdir)/gcc/$(target)/$(version)/include ] ; then true ; else mkdir $(libdir)/gcc/$(target)/$(version)/include ; chmod a+rx $(libdir)/gcc/$(target)/$(version)/include ; fi
-if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi
-if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi
-if [ -d $(tooldir) ] ; then true ; else mkdir $(tooldir) ; chmod a+rx $(tooldir) ; fi
*** /usr2/src/ORIGS/gcc-2.7.2/./c-lex.c Thu Jun 15 07:11:39 1995
--- ./c-lex.c Mon Nov 20 07:13:38 1995
***************
*** 848,853 ****
--- 848,861 ----
if (pedantic)
pedwarn ("non-ANSI escape sequence `\\%c'", c);
return c;
+ #ifdef AUX_PASCAL_STRINGS
+ /* Return a special code so that the string constructor can leave a
+ hole and patch in the string length later */
+ case 'p':
+ if (pedantic)
+ pedwarn ("non-ANSI escape sequence `\\p'");
+ return -2;
+ #endif
}
if (c >= 040 && c < 0177)
pedwarn ("unknown escape sequence `\\%c'", c);
***************
*** 1729,1736 ****
--- 1737,1746 ----
num_chars = max_chars;
error ("character constant too long");
}
+ #ifndef AUX /* Many Mac programs use multi-character constants */
else if (num_chars != 1 && ! flag_traditional)
warning ("multi-character character constant");
+ #endif
/* If char type is signed, sign-extend the constant. */
if (! wide_flag)
***************
*** 1781,1786 ****
--- 1791,1799 ----
case '"':
string_constant:
{
+ #ifdef AUX_PASCAL_STRINGS
+ int pascalstring = FALSE;
+ #endif
c = getc (finput);
p = token_buffer + 1;
***************
*** 1792,1797 ****
--- 1805,1823 ----
c = readescape (&ignore);
if (ignore)
goto skipnewline;
+ #ifdef AUX_PASCAL_STRINGS
+ /* readescape() returns -2 to indicate "\p" */
+ if (c == -2)
+ {
+ if (p == token_buffer + 1)
+ pascalstring = TRUE, c = '\0';
+ else
+ {
+ warning ("ignoring pascal string flag (`\\p') not at beginning of string");
+ c = 'p';
+ }
+ }
+ #endif
if (!wide_flag
&& TYPE_PRECISION (char_type_node) < HOST_BITS_PER_INT
&& c >= (1 << TYPE_PRECISION (char_type_node)))
***************
*** 1815,1820 ****
--- 1841,1856 ----
if (c < 0)
error ("Unterminated string constant");
+
+ #ifdef AUX_PASCAL_STRINGS
+ if (pascalstring)
+ {
+ int len;
+ token_buffer[1] = len = p - token_buffer - 2;
+ if (len >= (1 << BITS_PER_UNIT))
+ warning ("Pascal string too long");
+ }
+ #endif
/* We have read the entire constant.
Construct a STRING_CST for the result. */
*** /usr2/src/ORIGS/gcc-2.7.2/./config.guess Thu Nov 9 11:29:05 1995
--- ./config.guess Mon Nov 20 07:13:38 1995
***************
*** 424,429 ****
--- 424,432 ----
echo ns32k-sni-sysv
fi
exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
*** /usr2/src/ORIGS/gcc-2.7.2/./config.sub Thu Jun 15 17:01:49 1995
--- ./config.sub Mon Nov 20 07:13:39 1995
***************
*** 81,87 ****
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
! -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
os=
basic_machine=$1
;;
--- 81,88 ----
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
! -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
! -apple)
os=
basic_machine=$1
;;
***************
*** 190,195 ****
--- 191,200 ----
basic_machine=m68k-apollo
os=-sysv
;;
+ apple | aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
balance)
basic_machine=ns32k-sequent
os=-dynix
***************
*** 641,647 ****
| -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
! | -udi* | -eabi* | -lites* )
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sunos5*)
--- 646,652 ----
| -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
! | -udi* | -eabi* | -lites* | -aux* )
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sunos5*)
***************
*** 721,726 ****
--- 726,734 ----
*-acorn)
os=-riscix1.2
;;
+ m68*-apple)
+ os=-aux
+ ;;
arm*-semi)
os=-aout
;;
***************
*** 858,863 ****
--- 866,874 ----
;;
-vxworks*)
vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
*** /usr2/src/ORIGS/gcc-2.7.2/./configure Tue Dec 5 09:36:12 1995
--- ./configure Tue Dec 5 09:34:23 1995
***************
*** 1544,1549 ****
--- 1544,1558 ----
# The real one comes with the Linux C library.
#extra_parts="crtbegin.o crtend.o"
;;
+ m68k-apple-aux*) # Apple Macintosh running A/UX
+ xm_file=m68k/xm-aux.h
+ tm_file=m68k/aux.h
+ xmake_file=m68k/x-aux
+ broken_install=yes
+ use_collect2=yes
+ install_headers_dir=install-headers-cpio
+ extra_headers=math-68881.h
+ ;;
m88k-dg-dgux*)
case $machine in
m88k-dg-dguxbcs*)
*** /usr2/src/ORIGS/gcc-2.7.2/./fixincludes Tue Dec 5 09:36:19 1995
--- ./fixincludes Tue Dec 5 09:34:34 1995
***************
*** 2465,2470 ****
--- 2465,2488 ----
fi
fi
+ # This file in A/UX 3.0.x/3.1.x contains an __asm directive for c89; gcc
+ # doesn't understand it.
+ file=sys/param.h
+ if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
+ cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
+ chmod +w ${LIB}/$file 2>/dev/null
+ chmod a+r ${LIB}/$file 2>/dev/null
+ fi
+
+ if [ -r ${LIB}/$file ]; then
+ echo "Fixing __asm directive in sys/param.h"
+ sed -e 's|#ifndef NOINLINE|#if !defined(NOINLINE) \&\& !defined(__GNUC__)|' \
+ ${LIB}/$file > ${LIB}/${file}.sed
+ rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
+ if cmp $file ${LIB}/$file >/dev/null 2>&1; then
+ rm -f ${LIB}/$file
+ fi
+ fi
# This loop does not appear to do anything, because it uses file
# rather than $file when setting target. It also appears to be
*** /usr2/src/ORIGS/gcc-2.7.2/./gcc.c Tue Sep 12 17:15:11 1995
--- ./gcc.c Mon Nov 20 07:13:44 1995
***************
*** 2878,2888 ****
--- 2878,2896 ----
/* Null-terminate the vector. */
switches[n_switches].args[j] = 0;
}
+ #ifdef AUX
+ else if (c == 'o')
+ {
+ /* On A/UX, ld cannot handle -o without space.
+ So split the -o from its argument. */
+ switches[n_switches].part1 = "o";
+ #else
else if (*switches_need_spaces != 0 && (c == 'o' || c == 'L'))
{
/* On some systems, ld cannot handle -o or -L without space.
So split the -o or -L from its argument. */
switches[n_switches].part1 = (c == 'o' ? "o" : "L");
+ #endif
switches[n_switches].args = (char **) xmalloc (2 * sizeof (char *));
switches[n_switches].args[0] = xmalloc (strlen (p));
strcpy (switches[n_switches].args[0], &p[1]);
*** /usr2/src/ORIGS/gcc-2.7.2/./libgcc2.c Tue Dec 5 09:36:23 1995
--- ./libgcc2.c Tue Dec 5 09:34:40 1995
***************
*** 2190,2196 ****
--- 2190,2200 ----
extern void __do_global_dtors ();
extern void _cleanup ();
extern void _exit () __attribute__ ((noreturn));
+ #ifdef AUX
+ extern void _exithk ();
+ #endif
+
void
exit (status)
int status;
***************
*** 2202,2207 ****
--- 2206,2214 ----
EXIT_BODY;
#else
_cleanup ();
+ #ifdef AUX
+ _exithk();
+ #endif
#endif
_exit (status);
}
*** /usr2/src/ORIGS/gcc-2.7.2/./config/m68k/m68k.c Thu Sep 28 14:00:17 1995
--- ./config/m68k/m68k.c Mon Nov 20 07:13:50 1995
***************
*** 256,262 ****
{
int regno;
! if (!reload_completed || frame_pointer_needed || get_frame_size () != 0)
return 0;
/* Copied from output_function_epilogue (). We should probably create a
--- 256,266 ----
{
int regno;
! if (!reload_completed || frame_pointer_needed || get_frame_size () != 0
! #ifdef AUX
! || current_function_returns_pointer
! #endif
! )
return 0;
/* Copied from output_function_epilogue (). We should probably create a
*** /dev/null Tue Dec 5 13:52:55 1995
--- ./config/m68k/aux-crtfix.c Mon Nov 20 07:13:48 1995
***************
*** 0 ****
--- 1,86 ----
+ /*
+ Copyright (C) 1995 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ In addition to the permissions in the GNU General Public License, the
+ Free Software Foundation gives you unlimited permission to link the
+ compiled version of this file with other programs, and to distribute
+ those programs without any restriction coming from the use of this
+ file. (The General Public License restrictions do apply in other
+ respects; for example, they cover modification of the file, and
+ distribution when not linked into another program.)
+
+ This file is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+ As a special exception, if you link this library with files
+ compiled with GCC to produce an executable, this does not cause
+ the resulting executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License.
+ */
+
+ /*
+ Specifically for A/UX-MacOS Compatibility:
+ Replace exit with _exithk in crt files. The idea is that we want to
+ override exit and do additional things while being able to call the
+ original exit function as well.
+ */
+
+ #include <filehdr.h>
+ #include <syms.h>
+ #include <stdio.h>
+
+ main(int argc, char ** argv)
+ {
+ struct filehdr hdr;
+ struct syment cursym;
+ FILE* targetfile;
+ int curpos, symnum;
+ int readb;
+
+ if( argc != 2 ) {
+ printf("argc = %d\n", argc);
+ printf("usage: crtfix [crt file]\n");
+ exit(1);
+ }
+
+ targetfile = fopen(argv[1], "r+");
+ if( !targetfile )
+ perror("opening file");
+
+ fread(&hdr, sizeof(struct filehdr), 1, targetfile);
+
+ readb = fseek(targetfile, hdr.f_symptr, SEEK_SET);
+
+ for(symnum=0; symnum < hdr.f_nsyms; symnum++)
+ {
+ curpos = ftell(targetfile);
+ readb = fread(&cursym, sizeof(struct syment), 1, targetfile);
+
+ if(cursym.n_zeroes != 0)
+ {
+ if((!strcmp(cursym.n_name, "exit")) &&
+ (cursym.n_scnum == 1))
+ {
+ fseek(targetfile, curpos, SEEK_SET);
+ strcpy(cursym.n_name, "_exithk");
+ fwrite(&cursym, sizeof(struct syment),
+ 1, targetfile);
+ break;
+ }
+ }
+ }
+ fclose(targetfile);
+ }
*** /dev/null Tue Dec 5 13:52:55 1995
--- ./config/m68k/aux-exit.c Mon Nov 20 07:13:48 1995
***************
*** 0 ****
--- 1,4 ----
+ /* Used under A/UX to perform cleanup for various programs. This is a
+ dummy version used when the mac libs aren't used */
+
+ void _exithk(){ }
*** /dev/null Tue Dec 5 13:52:55 1995
--- ./config/m68k/aux-mcount.asm Mon Nov 20 07:13:49 1995
***************
*** 0 ****
--- 1,11 ----
+ #
+ # Simple glue routine that handles the
+ # fact that A/UXs profiling routine calls
+ # 'mcount%' which gas can't handle, due to
+ # the "%" sign...
+ #
+ # Must be assembled by A/UX's native 'as'
+ #
+ global __mcount
+ __mcount:
+ jmp mcount%
*** /dev/null Tue Dec 5 13:52:55 1995
--- ./config/m68k/aux.h Mon Nov 20 07:13:49 1995
***************
*** 0 ****
--- 1,199 ----
+ /* Definitions for Motorola 680x0 running A/UX and using GAS
+ Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+ #define TARGET_DEFAULT 7 /* 68020, 68881 */
+
+ #include "m68k/m68k.h"
+
+ #define CPP_PREDEFINES \
+ "-Dunix -Dm68k -DAUX -DmacII \
+ -Asystem(unix) -Asystem(AUX) \
+ -Acpu(m68k) -Acpu(mc68000) \
+ -Amachine(m68k) -Amachine(macII)"
+
+ #define CPP_SPEC \
+ "%{!msoft-float:%{!ansi:-Dmc68881 }-D__HAVE_68881__ }\
+ -D__mc68000__ %{!ansi:-Dmc68000 }\
+ %{!mc68000:%{!m68000:-Acpu(mc68020) -D__mc68020__ %{!ansi:-Dmc68020 }}}\
+ %{m68030:-Acpu(mc68030) -D__mc68030__ %{!ansi:-Dmc68030 }}\
+ %{m68040:-Acpu(mc68040) -D__mc68040__ %{!ansi:-Dmc68040 }}\
+ %{!ansi:%{!traditional:-D__STDC__=2 }}\
+ %{sbsd:-D_BSD_SOURCE -DBSD }%{ZB:-D_BSD_SOURCE -DBSD }\
+ %{ssysv:-D_SYSV_SOURCE -DSYSV -DUSG }%{ZS:-D_SYSV_SOURCE -DSYSV -DUSG }\
+ %{sposix:-D_POSIX_SOURCE -DPOSIX }%{ZP:-D_POSIX_SOURCE -DPOSIX }\
+ %{saux:-D_AUX_SOURCE }%{ZA:-D_AUX_SOURCE }\
+ %{!sbsd:%{!ZB:%{!ssysv:%{!ZS:%{!sposix:%{!ZP:%{!snone:\
+ -D_BSD_SOURCE -D_SYSV_SOURCE -D_AUX_SOURCE }}}}}}}"
+
+ /* For /bin/ld */
+ #define LINK_SPEC \
+ "%{p:-L/lib/libp -L/usr/lib/libp }%{pg:-L/lib/libp -L/usr/lib/libp }\
+ %{smac:low.ld%s }%{!smac:shlib.ld%s }"
+
+ #define LIB_SPEC \
+ "%{sbsd:-lbsd }%{ZB:-lbsd }\
+ %{ssysv:-lsvid }%{ZS:-lsvid }\
+ %{sposix:-lposix }%{ZP:-lposix }\
+ %{static:%{smac:-lmac -lat -lld -lmr }-lc }\
+ %{!static:%{smac:-lmac_s -lat -lld -lmr }-lc_s }"
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+ "%{pg:mcrt0.o%s }%{!pg:%{p:mcrt0.o%s }\
+ %{!p:%{smac:maccrt0.o%s low.o%s }%{!smac:crt1.o%s }}}\
+ crt2.o%s "
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC "crtn.o%s "
+
+
+ /*===================================================================*/
+
+ /* No we need to use collect2... gld and A/UX has problems */
+ #define NM_FLAGS ""
+ #define OBJECT_FORMAT_COFF
+ #define MY_ISCOFF(magic) ((magic) == MC68MAGIC)
+
+ #define NO_SYS_SIGLIST
+
+ /* Provide support for pascal strings */
+ #define AUX_PASCAL_STRINGS
+
+ /* Resize standard types */
+ #undef SIZE_TYPE
+ #define SIZE_TYPE "unsigned int"
+ #undef PTRDIFF_TYPE
+ #define PTRDIFF_TYPE "int"
+ #undef WCHAR_TYPE
+ #define WCHAR_TYPE "unsigned int"
+
+ /* Every structure or union's size must be a multiple of 2 bytes. */
+ #define STRUCTURE_SIZE_BOUNDARY 16
+
+ /* Generate calls to memcpy, memcmp and memset, as opposed to bcopy, bcmp,
+ and bzero */
+ #define TARGET_MEM_FUNCTIONS
+
+ /* We call a different function for profiling (__mcount, which is actually
+ a glue routine which calls A/UX's mcount%, which gas cannot generate). */
+
+ #undef FUNCTION_PROFILER
+ #define FUNCTION_PROFILER(FILE, LABELNO) \
+ asm_fprintf (FILE, "\tlea %LLP%d,%Ra0\n\tjbsr __mcount\n", (LABELNO))
+
+ /* Define how to generate (in the callee) the output value of a function
+ and how to find (in the caller) the value returned by a function. VALTYPE
+ is the data type of the value (as a tree). If the precise function being
+ called is known, FUNC is its FUNCTION_DECL; otherwise, FUNC is 0.
+ For A/UX generate the result in d0, a0, or fp0 as appropriate. */
+
+ #undef FUNCTION_VALUE
+ #define FUNCTION_VALUE(VALTYPE, FUNC) \
+ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \
+ ? gen_rtx (REG, TYPE_MODE (VALTYPE), 16) \
+ : (TREE_CODE (VALTYPE) == POINTER_TYPE \
+ ? gen_rtx (REG, TYPE_MODE (VALTYPE), 8) \
+ : gen_rtx (REG, TYPE_MODE (VALTYPE), 0)))
+
+ #undef LIBCALL_VALUE
+ #define LIBCALL_VALUE(MODE) \
+ gen_rtx (REG, (MODE), ((TARGET_68881 && ((MODE) == SFmode || (MODE) == DFmode)) ? 16 : 0))
+
+ /* 1 if N is a possible register number for a function value.
+ For A/UX allow d0, a0, or fp0 as return registers, for integral,
+ pointer, or floating types, respectively. Reject fp0 if not using a
+ 68881 coprocessor. */
+
+ #undef FUNCTION_VALUE_REGNO_P
+ #define FUNCTION_VALUE_REGNO_P(N) \
+ ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16))
+
+ /* Define this to be true when FUNCTION_VALUE_REGNO_P is true for
+ more than one register. */
+
+ #undef NEEDS_UNTYPED_CALL
+ #define NEEDS_UNTYPED_CALL 1
+
+ /* For compatibility with the large body of existing code which does not
+ always properly declare external functions returning pointer types, the
+ A/UX convention is to copy the value returned for pointer functions
+ from a0 to d0 in the function epilogue, so that callers that have
+ neglected to properly declare the callee can still find the correct return
+ value. */
+
+ #define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \
+ { extern int current_function_returns_pointer; \
+ if ((current_function_returns_pointer) && \
+ ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \
+ asm_fprintf (FILE, "\tmovl %Ra0,%Rd0\n"); \
+ }
+
+ #undef ASM_FILE_START
+ #define ASM_FILE_START(FILE) \
+ do { fprintf((FILE), "#NO_APP\n"); \
+ output_file_directive ((FILE), main_input_filename); \
+ } while (0)
+
+ /*
+ The below are taken from m68k/coff.h. We don't just include
+ the file since we'd need to undefine stuff from there.
+ It's a toss-up
+ */
+
+ #undef DBX_DEBUGGING_INFO
+ #define SDB_DEBUGGING_INFO
+
+ #undef PREFERRED_DEBUGGING_TYPE
+ #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
+
+ /* COFF symbols don't start with an underscore. */
+
+ #undef USER_LABEL_PREFIX
+ #define USER_LABEL_PREFIX ""
+
+ /* Use a prefix for local labels, just to be on the save side. */
+
+ #undef LOCAL_LABEL_PREFIX
+ #define LOCAL_LABEL_PREFIX "."
+
+ /* Use a register prefix to avoid clashes with external symbols (classic
+ example: `extern char PC;' in termcap). */
+
+ #undef REGISTER_PREFIX
+ #define REGISTER_PREFIX "%"
+
+ /* In the machine description we can't use %R, because it will not be seen
+ by ASM_FPRINTF. (Isn't that a design bug?). */
+
+ #undef REGISTER_PREFIX_MD
+ #define REGISTER_PREFIX_MD "%%"
+
+ /* config/m68k.md has an explicit reference to the program counter,
+ prefix this by the register prefix. */
+
+ #define ASM_RETURN_CASE_JUMP return "jmp %%pc@(2,%0:w)"
+
+ /* Here are the new register names. */
+
+ #undef REGISTER_NAMES
+ #define REGISTER_NAMES \
+ {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
+ "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \
+ "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7" }
+
*** /dev/null Tue Dec 5 13:52:55 1995
--- ./config/m68k/x-aux Mon Nov 20 07:13:50 1995
***************
*** 0 ****
--- 1,21 ----
+ # Makefile additions for A/UX
+
+ LIB2FUNCS_EXTRA=aux-mcount.o aux-exit.c
+ FIXPROTO_DEFINES = -D_POSIX_SOURCE
+ EXTRA_PASSES=ld aux-crtfix
+ CLIB=-lld # needed for collect2
+ INSTALL=cp
+
+ # needed to support builds for multiple versions of A/UX
+ LDFLAGS=-static
+
+ aux-mcount.o: $(srcdir)/config/m68k/aux-mcount.asm $(GCC_PASSES)
+ /bin/as -o aux-mcount.o $(srcdir)/config/m68k/aux-mcount.asm
+
+ aux-exit.c: $(srcdir)/config/m68k/aux-exit.c
+ cp $(srcdir)/config/m68k/aux-exit.c aux-exit.c
+
+ aux-crtfix: $(srcdir)/config/m68k/aux-crtfix.c
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(srcdir)/config/m68k/aux-crtfix.c \
+ $(LIBS) -o aux-crtfix
+
*** /dev/null Tue Dec 5 13:52:55 1995
--- ./config/m68k/xm-aux.h Mon Nov 20 07:13:50 1995
***************
*** 0 ****
--- 1,9 ----
+ #ifndef USG
+ #define USG
+ #endif
+
+ #ifndef AUX
+ #define AUX
+ #endif
+
+ #include "m68k/xm-m68k.h"