Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.38 KB | None | 0 0
  1. diff -burN gcc-2.7.2.orig/COMPILE.gcc.aux gcc-2.7.2/COMPILE.gcc.aux
  2. --- gcc-2.7.2.orig/COMPILE.gcc.aux 1969-12-31 19:00:00.000000000 -0500
  3. +++ gcc-2.7.2/COMPILE.gcc.aux 1995-11-20 07:12:34.000000000 -0500
  4. @@ -0,0 +1,26 @@
  5. +#!/bin/ksh
  6. +#
  7. +# Just compile gcc
  8. +#
  9. +./configure --prefix=/usr/local/Gnu aux
  10. +make CC=$GNU/gcc
  11. +print " "
  12. +print "======================"
  13. +print "= Doing stage2 build ="
  14. +print "======================"
  15. +make stage1
  16. +ln as stage1/as
  17. +make CC="stage1/xgcc -Bstage1/"
  18. +print " "
  19. +print "======================"
  20. +print "= Doing stage3 build ="
  21. +print "======================"
  22. +make stage2
  23. +ln as stage2/as
  24. +make CC="stage2/xgcc -Bstage2/"
  25. +print " "
  26. +print "======================"
  27. +print "= Doing gcc compare ="
  28. +print "======================"
  29. +make CC="stage2/xgcc -Bstage2/" compare
  30. +exit
  31. diff -burN gcc-2.7.2.orig/Makefile.in gcc-2.7.2/Makefile.in
  32. --- gcc-2.7.2.orig/Makefile.in 1995-11-26 14:44:25.000000000 -0500
  33. +++ gcc-2.7.2/Makefile.in 1995-12-05 09:34:08.000000000 -0500
  34. @@ -47,8 +47,8 @@
  35. # to the stage2 and stage3 compilations
  36. # XCFLAGS is used for most compilations but not when using the GCC just built.
  37. XCFLAGS =
  38. -CFLAGS = -g
  39. -BOOT_CFLAGS = -O $(CFLAGS)
  40. +CFLAGS = -O2
  41. +BOOT_CFLAGS = -O2 $(CFLAGS)
  42. # These exists to be overridden by the x-* and t-* files, respectively.
  43. X_CFLAGS =
  44. T_CFLAGS =
  45. @@ -181,7 +181,7 @@
  46. srcdir = .
  47. # Common prefix for installation directories.
  48. # NOTE: This directory must exist when you start installation.
  49. -prefix = /usr/local
  50. +prefix = /usr/local/Gnu
  51. # Directory in which to put localized header files. On the systems with
  52. # gcc as the native cc, `local_prefix' may not be `prefix' which is
  53. # `/usr'.
  54. @@ -190,11 +190,11 @@
  55. # Directory in which to put host dependent programs and libraries
  56. exec_prefix = $(prefix)
  57. # Directory in which to put the executable for the command `gcc'
  58. -bindir = $(exec_prefix)/bin
  59. +bindir = $(exec_prefix)
  60. # Directory in which to put the directories used by the compiler.
  61. libdir = $(exec_prefix)/lib
  62. # Directory in which the compiler finds executables, libraries, etc.
  63. -libsubdir = $(libdir)/gcc-lib/$(target)/$(version)
  64. +libsubdir = $(libdir)/gcc/$(target)/$(version)
  65. # Directory in which the compiler finds g++ includes.
  66. gxx_include_dir= $(libdir)/g++-include
  67. # Directory to search for site-specific includes.
  68. @@ -887,9 +887,12 @@
  69. for file in .. $(LIB2FUNCS_EXTRA); \
  70. do \
  71. if [ x$${file} != x.. ]; then \
  72. - name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//'`; \
  73. + name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//' -e 's/\$(objext)$$//'`; \
  74. oname=` echo $${name} | sed -e 's,.*/,,'`; \
  75. echo $${name}; \
  76. + if [ $${name}$(objext) = $${file} ]; then \
  77. + $(AR) $(AR_FLAGS) tmplibgcc2.a $${file}; \
  78. + else \
  79. if [ $${name}.asm = $${file} ]; then \
  80. cp $${file} $${name}.s || exit 1; file=$${name}.s; \
  81. else true; fi; \
  82. @@ -897,6 +900,7 @@
  83. if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  84. $(AR) $(AR_FLAGS) tmplibgcc2.a $${oname}$(objext); \
  85. rm -f $${name}.s $${oname}$(objext); \
  86. + fi; \
  87. else true; \
  88. fi; \
  89. done
  90. @@ -1135,7 +1139,7 @@
  91. gcc.o: gcc.c $(CONFIG_H) multilib.h config.status $(lang_specs_files)
  92. $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
  93. -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
  94. - -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
  95. + -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
  96. -DDEFAULT_TARGET_VERSION=\"$(version)\" \
  97. -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
  98. -DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\" \
  99. @@ -2048,12 +2052,12 @@
  100. # Create the installation directory.
  101. install-dir:
  102. -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; chmod a+rx $(libdir) ; fi
  103. - -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; chmod a+rx $(libdir)/gcc-lib ; fi
  104. + -if [ -d $(libdir)/gcc ] ; then true ; else mkdir $(libdir)/gcc ; chmod a+rx $(libdir)/gcc ; fi
  105. # This dir isn't currently searched by cpp.
  106. -# -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; chmod a+rx $(libdir)/gcc-lib/include ; fi
  107. - -if [ -d $(libdir)/gcc-lib/$(target) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target) ; chmod a+rx $(libdir)/gcc-lib/$(target) ; fi
  108. - -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
  109. - -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
  110. +# -if [ -d $(libdir)/gcc/include ] ; then true ; else mkdir $(libdir)/gcc/include ; chmod a+rx $(libdir)/gcc/include ; fi
  111. + -if [ -d $(libdir)/gcc/$(target) ] ; then true ; else mkdir $(libdir)/gcc/$(target) ; chmod a+rx $(libdir)/gcc/$(target) ; fi
  112. + -if [ -d $(libdir)/gcc/$(target)/$(version) ] ; then true ; else mkdir $(libdir)/gcc/$(target)/$(version) ; chmod a+rx $(libdir)/gcc/$(target)/$(version) ; fi
  113. + -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
  114. -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi
  115. -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi
  116. -if [ -d $(tooldir) ] ; then true ; else mkdir $(tooldir) ; chmod a+rx $(tooldir) ; fi
  117. diff -burN gcc-2.7.2.orig/README.AUX gcc-2.7.2/README.AUX
  118. --- gcc-2.7.2.orig/README.AUX 1969-12-31 19:00:00.000000000 -0500
  119. +++ gcc-2.7.2/README.AUX 1995-12-05 09:41:49.000000000 -0500
  120. @@ -0,0 +1,75 @@
  121. +This file details the diffs, patches and new files needed to allow GNU gcc
  122. +to support A/UX. Most of these are required due to the hybrid nature of
  123. +A/UX (UNIX and MacOS) and some are simply to describe A/UX itself. Builds
  124. +of gcc for A/UX require 'gas' (at least 1.38.1) and a previously built
  125. +version of 'gcc'. Check the A/UX FAQ for sites that carry these.
  126. +
  127. + * Makefile.in (libgcc2.a): Allow object files in LIB2FUNCS_EXTRA
  128. + so that objects needing special processing can be added.
  129. +
  130. + * c-lex.c (readescape, yylex): Provide support for the pascal
  131. + strings used by Mac programmers.
  132. + * c-lex.c (yylex): Conditionally do not produce a warning for
  133. + multi-character constants under A/UX.
  134. +
  135. + * m68k/aux-exit.c: New file. Provides _exithk() stub for MacOS
  136. + * m68k/aux-crtfix.c: New file. Provide tool to patch MacOS mcrt files
  137. + * m68k/aux-mcount.asm: New file. Hook into A/UX profiling.
  138. + * m68k/aux.h, m68k/x-aux, m68k/xm-aux.h: New files.
  139. +
  140. + * m68k/m68k.c (use_return_insn): A/UX returns pointers in %a0 --
  141. + don't use return insn when returning a pointer.
  142. +
  143. + * gcc.c (process_command): A/UX's 'ld' requires a space
  144. + between after '-o' but no space after '-L'
  145. +
  146. + * libgcc2.c: Add in _exithk() stub to exit() call.
  147. +
  148. + * configure, config.guess, config.sub: Recognize A/UX.
  149. +
  150. + * fixincludes: Fix A/UX's <sys/param.h>.
  151. +
  152. + * aux-fixcrts: New file. Uses aux-crtfix to fix MacOS mcrt files.
  153. +
  154. +These patches follow the tradition of placing the gcc executable in
  155. +'/usr/local/Gnu' and the support files in '/usr/local/Gnu/lib/gcc/aux'
  156. +
  157. +To build A/UX the procedure is quite easy and follows the general 'gcc'
  158. +methods. However, the previously built version of 'gas' must be placed
  159. +at the top-level source directory and called 'as'. If you're kinda lazy,
  160. +you do this in the top-level directory of the gcc-2.7.2 source tree:
  161. +
  162. + % cp <gas's home>gas as
  163. + % patch < gcc4aux.diffs
  164. + % ./configure --prefix=/usr/local/Gnu aux
  165. + % make CC="<pathname to gcc>"
  166. + % make stage1
  167. + % make CC="stage1/xgcc -Bstage1/"
  168. + % make stage2
  169. + % make CC="stage2/xgcc -Bstage2/"
  170. + % make CC="stage2/xgcc -Bstage2/" compare
  171. + % make CC="stage2/xgcc -Bstage2/" install
  172. + % make CC="stage2/xgcc -Bstage2/" objc-runtime
  173. + % make CC="stage2/xgcc -Bstage2/" install-libobjc
  174. +
  175. +Finally, when built, it is recommended that you run 'aux-fixcrts' to
  176. +patch the MacOS mcrt files to work under 'gcc' if you will be creating
  177. +MacOS-hybrid programs. The command-line is:
  178. +
  179. + % sh aux-fixcrts /usr/local/Gnu/lib/gcc/aux/2.7.2
  180. +
  181. +Enjoy!
  182. +
  183. +NOTE: These patches are the result of work of a lot of contributors including:
  184. +
  185. + David W. Berry (formerly @ Apple)
  186. + John Coolidge (@ Apple)
  187. + Richard Henderson
  188. + Jim Jagielski
  189. +
  190. +--
  191. +#include <std/disclaimer.h>
  192. + | Jim Jagielski | jim@jagubox.gsfc.nasa.gov | V: 301 286-5964 |
  193. + | NASA/GSFC, Code 734.4 | Greenbelt, MD 20771 | F: 301 286-1719 |
  194. + << This sig is a figment of your imagination; SEEK MENTAL HELP !! >>
  195. +
  196. diff -burN gcc-2.7.2.orig/aux-crtfix.c gcc-2.7.2/aux-crtfix.c
  197. --- gcc-2.7.2.orig/aux-crtfix.c 1969-12-31 19:00:00.000000000 -0500
  198. +++ gcc-2.7.2/aux-crtfix.c 1995-11-20 07:13:48.000000000 -0500
  199. @@ -0,0 +1,86 @@
  200. +/*
  201. + Copyright (C) 1995 Free Software Foundation, Inc.
  202. +
  203. + This file is free software; you can redistribute it and/or modify it
  204. + under the terms of the GNU General Public License as published by the
  205. + Free Software Foundation; either version 2, or (at your option) any
  206. + later version.
  207. +
  208. + In addition to the permissions in the GNU General Public License, the
  209. + Free Software Foundation gives you unlimited permission to link the
  210. + compiled version of this file with other programs, and to distribute
  211. + those programs without any restriction coming from the use of this
  212. + file. (The General Public License restrictions do apply in other
  213. + respects; for example, they cover modification of the file, and
  214. + distribution when not linked into another program.)
  215. +
  216. + This file is distributed in the hope that it will be useful, but
  217. + WITHOUT ANY WARRANTY; without even the implied warranty of
  218. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  219. + General Public License for more details.
  220. +
  221. + You should have received a copy of the GNU General Public License
  222. + along with this program; see the file COPYING. If not, write to
  223. + the Free Software Foundation, 59 Temple Place - Suite 330,
  224. + Boston, MA 02111-1307, USA.
  225. +
  226. + As a special exception, if you link this library with files
  227. + compiled with GCC to produce an executable, this does not cause
  228. + the resulting executable to be covered by the GNU General Public License.
  229. + This exception does not however invalidate any other reasons why
  230. + the executable file might be covered by the GNU General Public License.
  231. +*/
  232. +
  233. +/*
  234. + Specifically for A/UX-MacOS Compatibility:
  235. + Replace exit with _exithk in crt files. The idea is that we want to
  236. + override exit and do additional things while being able to call the
  237. + original exit function as well.
  238. +*/
  239. +
  240. +#include <filehdr.h>
  241. +#include <syms.h>
  242. +#include <stdio.h>
  243. +
  244. +main(int argc, char ** argv)
  245. +{
  246. + struct filehdr hdr;
  247. + struct syment cursym;
  248. + FILE* targetfile;
  249. + int curpos, symnum;
  250. + int readb;
  251. +
  252. + if( argc != 2 ) {
  253. + printf("argc = %d\n", argc);
  254. + printf("usage: crtfix [crt file]\n");
  255. + exit(1);
  256. + }
  257. +
  258. + targetfile = fopen(argv[1], "r+");
  259. + if( !targetfile )
  260. + perror("opening file");
  261. +
  262. + fread(&hdr, sizeof(struct filehdr), 1, targetfile);
  263. +
  264. + readb = fseek(targetfile, hdr.f_symptr, SEEK_SET);
  265. +
  266. + for(symnum=0; symnum < hdr.f_nsyms; symnum++)
  267. + {
  268. + curpos = ftell(targetfile);
  269. + readb = fread(&cursym, sizeof(struct syment), 1, targetfile);
  270. +
  271. + if(cursym.n_zeroes != 0)
  272. + {
  273. + if((!strcmp(cursym.n_name, "exit")) &&
  274. + (cursym.n_scnum == 1))
  275. + {
  276. + fseek(targetfile, curpos, SEEK_SET);
  277. + strcpy(cursym.n_name, "_exithk");
  278. + fwrite(&cursym, sizeof(struct syment),
  279. + 1, targetfile);
  280. + break;
  281. + }
  282. + }
  283. + }
  284. + fclose(targetfile);
  285. +}
  286. diff -burN gcc-2.7.2.orig/aux-exit.c gcc-2.7.2/aux-exit.c
  287. --- gcc-2.7.2.orig/aux-exit.c 1969-12-31 19:00:00.000000000 -0500
  288. +++ gcc-2.7.2/aux-exit.c 1995-11-20 07:13:48.000000000 -0500
  289. @@ -0,0 +1,4 @@
  290. +/* Used under A/UX to perform cleanup for various programs. This is a
  291. + dummy version used when the mac libs aren't used */
  292. +
  293. +void _exithk(){ }
  294. diff -burN gcc-2.7.2.orig/aux-fixcrts gcc-2.7.2/aux-fixcrts
  295. --- gcc-2.7.2.orig/aux-fixcrts 1969-12-31 19:00:00.000000000 -0500
  296. +++ gcc-2.7.2/aux-fixcrts 1995-12-05 09:41:36.000000000 -0500
  297. @@ -0,0 +1,18 @@
  298. +#! /bin/sh
  299. +
  300. +CRTDIR=${1-${CRTDIR-/usr/local/Gnu/lib/gcc/aux/2.7.2}}
  301. +
  302. +files=`echo /lib/*crt*.o /usr/lib/*crt*.o`
  303. +
  304. +cp $files $CRTDIR
  305. +
  306. +for file in $files; do
  307. + lfile=$CRTDIR/`basename $file`
  308. + ./aux-crtfix $lfile
  309. + fixout=`cmp $file $lfile`
  310. + if [ $? = 0 ]; then
  311. + rm $lfile
  312. + else
  313. + echo Fixed `basename $file`
  314. + fi
  315. +done
  316. diff -burN gcc-2.7.2.orig/aux-mcount.asm gcc-2.7.2/aux-mcount.asm
  317. --- gcc-2.7.2.orig/aux-mcount.asm 1969-12-31 19:00:00.000000000 -0500
  318. +++ gcc-2.7.2/aux-mcount.asm 1995-11-20 07:13:49.000000000 -0500
  319. @@ -0,0 +1,11 @@
  320. +#
  321. +# Simple glue routine that handles the
  322. +# fact that A/UXs profiling routine calls
  323. +# 'mcount%' which gas can't handle, due to
  324. +# the "%" sign...
  325. +#
  326. +# Must be assembled by A/UX's native 'as'
  327. +#
  328. + global __mcount
  329. +__mcount:
  330. + jmp mcount%
  331. diff -burN gcc-2.7.2.orig/aux.h gcc-2.7.2/aux.h
  332. --- gcc-2.7.2.orig/aux.h 1969-12-31 19:00:00.000000000 -0500
  333. +++ gcc-2.7.2/aux.h 1995-11-20 07:13:49.000000000 -0500
  334. @@ -0,0 +1,199 @@
  335. +/* Definitions for Motorola 680x0 running A/UX and using GAS
  336. + Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  337. +
  338. +This file is part of GNU CC.
  339. +
  340. +GNU CC is free software; you can redistribute it and/or modify
  341. +it under the terms of the GNU General Public License as published by
  342. +the Free Software Foundation; either version 2, or (at your option)
  343. +any later version.
  344. +
  345. +GNU CC is distributed in the hope that it will be useful,
  346. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  347. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  348. +GNU General Public License for more details.
  349. +
  350. +You should have received a copy of the GNU General Public License
  351. +along with GNU CC; see the file COPYING. If not, write to
  352. +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  353. +
  354. +#define TARGET_DEFAULT 7 /* 68020, 68881 */
  355. +
  356. +#include "m68k/m68k.h"
  357. +
  358. +#define CPP_PREDEFINES \
  359. +"-Dunix -Dm68k -DAUX -DmacII \
  360. +-Asystem(unix) -Asystem(AUX) \
  361. +-Acpu(m68k) -Acpu(mc68000) \
  362. +-Amachine(m68k) -Amachine(macII)"
  363. +
  364. +#define CPP_SPEC \
  365. +"%{!msoft-float:%{!ansi:-Dmc68881 }-D__HAVE_68881__ }\
  366. +-D__mc68000__ %{!ansi:-Dmc68000 }\
  367. +%{!mc68000:%{!m68000:-Acpu(mc68020) -D__mc68020__ %{!ansi:-Dmc68020 }}}\
  368. +%{m68030:-Acpu(mc68030) -D__mc68030__ %{!ansi:-Dmc68030 }}\
  369. +%{m68040:-Acpu(mc68040) -D__mc68040__ %{!ansi:-Dmc68040 }}\
  370. +%{!ansi:%{!traditional:-D__STDC__=2 }}\
  371. +%{sbsd:-D_BSD_SOURCE -DBSD }%{ZB:-D_BSD_SOURCE -DBSD }\
  372. +%{ssysv:-D_SYSV_SOURCE -DSYSV -DUSG }%{ZS:-D_SYSV_SOURCE -DSYSV -DUSG }\
  373. +%{sposix:-D_POSIX_SOURCE -DPOSIX }%{ZP:-D_POSIX_SOURCE -DPOSIX }\
  374. +%{saux:-D_AUX_SOURCE }%{ZA:-D_AUX_SOURCE }\
  375. +%{!sbsd:%{!ZB:%{!ssysv:%{!ZS:%{!sposix:%{!ZP:%{!snone:\
  376. +-D_BSD_SOURCE -D_SYSV_SOURCE -D_AUX_SOURCE }}}}}}}"
  377. +
  378. +/* For /bin/ld */
  379. +#define LINK_SPEC \
  380. +"%{p:-L/lib/libp -L/usr/lib/libp }%{pg:-L/lib/libp -L/usr/lib/libp }\
  381. +%{smac:low.ld%s }%{!smac:shlib.ld%s }"
  382. +
  383. +#define LIB_SPEC \
  384. +"%{sbsd:-lbsd }%{ZB:-lbsd }\
  385. +%{ssysv:-lsvid }%{ZS:-lsvid }\
  386. +%{sposix:-lposix }%{ZP:-lposix }\
  387. +%{static:%{smac:-lmac -lat -lld -lmr }-lc }\
  388. +%{!static:%{smac:-lmac_s -lat -lld -lmr }-lc_s }"
  389. +
  390. +#undef STARTFILE_SPEC
  391. +#define STARTFILE_SPEC \
  392. +"%{pg:mcrt0.o%s }%{!pg:%{p:mcrt0.o%s }\
  393. +%{!p:%{smac:maccrt0.o%s low.o%s }%{!smac:crt1.o%s }}}\
  394. +crt2.o%s "
  395. +
  396. +#undef ENDFILE_SPEC
  397. +#define ENDFILE_SPEC "crtn.o%s "
  398. +
  399. +
  400. +/*===================================================================*/
  401. +
  402. +/* No we need to use collect2... gld and A/UX has problems */
  403. +#define NM_FLAGS ""
  404. +#define OBJECT_FORMAT_COFF
  405. +#define MY_ISCOFF(magic) ((magic) == MC68MAGIC)
  406. +
  407. +#define NO_SYS_SIGLIST
  408. +
  409. +/* Provide support for pascal strings */
  410. +#define AUX_PASCAL_STRINGS
  411. +
  412. +/* Resize standard types */
  413. +#undef SIZE_TYPE
  414. +#define SIZE_TYPE "unsigned int"
  415. +#undef PTRDIFF_TYPE
  416. +#define PTRDIFF_TYPE "int"
  417. +#undef WCHAR_TYPE
  418. +#define WCHAR_TYPE "unsigned int"
  419. +
  420. +/* Every structure or union's size must be a multiple of 2 bytes. */
  421. +#define STRUCTURE_SIZE_BOUNDARY 16
  422. +
  423. +/* Generate calls to memcpy, memcmp and memset, as opposed to bcopy, bcmp,
  424. + and bzero */
  425. +#define TARGET_MEM_FUNCTIONS
  426. +
  427. +/* We call a different function for profiling (__mcount, which is actually
  428. + a glue routine which calls A/UX's mcount%, which gas cannot generate). */
  429. +
  430. +#undef FUNCTION_PROFILER
  431. +#define FUNCTION_PROFILER(FILE, LABELNO) \
  432. + asm_fprintf (FILE, "\tlea %LLP%d,%Ra0\n\tjbsr __mcount\n", (LABELNO))
  433. +
  434. +/* Define how to generate (in the callee) the output value of a function
  435. + and how to find (in the caller) the value returned by a function. VALTYPE
  436. + is the data type of the value (as a tree). If the precise function being
  437. + called is known, FUNC is its FUNCTION_DECL; otherwise, FUNC is 0.
  438. + For A/UX generate the result in d0, a0, or fp0 as appropriate. */
  439. +
  440. +#undef FUNCTION_VALUE
  441. +#define FUNCTION_VALUE(VALTYPE, FUNC) \
  442. + (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \
  443. + ? gen_rtx (REG, TYPE_MODE (VALTYPE), 16) \
  444. + : (TREE_CODE (VALTYPE) == POINTER_TYPE \
  445. + ? gen_rtx (REG, TYPE_MODE (VALTYPE), 8) \
  446. + : gen_rtx (REG, TYPE_MODE (VALTYPE), 0)))
  447. +
  448. +#undef LIBCALL_VALUE
  449. +#define LIBCALL_VALUE(MODE) \
  450. + gen_rtx (REG, (MODE), ((TARGET_68881 && ((MODE) == SFmode || (MODE) == DFmode)) ? 16 : 0))
  451. +
  452. +/* 1 if N is a possible register number for a function value.
  453. + For A/UX allow d0, a0, or fp0 as return registers, for integral,
  454. + pointer, or floating types, respectively. Reject fp0 if not using a
  455. + 68881 coprocessor. */
  456. +
  457. +#undef FUNCTION_VALUE_REGNO_P
  458. +#define FUNCTION_VALUE_REGNO_P(N) \
  459. + ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16))
  460. +
  461. +/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for
  462. + more than one register. */
  463. +
  464. +#undef NEEDS_UNTYPED_CALL
  465. +#define NEEDS_UNTYPED_CALL 1
  466. +
  467. +/* For compatibility with the large body of existing code which does not
  468. + always properly declare external functions returning pointer types, the
  469. + A/UX convention is to copy the value returned for pointer functions
  470. + from a0 to d0 in the function epilogue, so that callers that have
  471. + neglected to properly declare the callee can still find the correct return
  472. + value. */
  473. +
  474. +#define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \
  475. +{ extern int current_function_returns_pointer; \
  476. + if ((current_function_returns_pointer) && \
  477. + ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \
  478. + asm_fprintf (FILE, "\tmovl %Ra0,%Rd0\n"); \
  479. +}
  480. +
  481. +#undef ASM_FILE_START
  482. +#define ASM_FILE_START(FILE) \
  483. +do { fprintf((FILE), "#NO_APP\n"); \
  484. + output_file_directive ((FILE), main_input_filename); \
  485. + } while (0)
  486. +
  487. +/*
  488. + The below are taken from m68k/coff.h. We don't just include
  489. + the file since we'd need to undefine stuff from there.
  490. + It's a toss-up
  491. + */
  492. +
  493. +#undef DBX_DEBUGGING_INFO
  494. +#define SDB_DEBUGGING_INFO
  495. +
  496. +#undef PREFERRED_DEBUGGING_TYPE
  497. +#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
  498. +
  499. +/* COFF symbols don't start with an underscore. */
  500. +
  501. +#undef USER_LABEL_PREFIX
  502. +#define USER_LABEL_PREFIX ""
  503. +
  504. +/* Use a prefix for local labels, just to be on the save side. */
  505. +
  506. +#undef LOCAL_LABEL_PREFIX
  507. +#define LOCAL_LABEL_PREFIX "."
  508. +
  509. +/* Use a register prefix to avoid clashes with external symbols (classic
  510. + example: `extern char PC;' in termcap). */
  511. +
  512. +#undef REGISTER_PREFIX
  513. +#define REGISTER_PREFIX "%"
  514. +
  515. +/* In the machine description we can't use %R, because it will not be seen
  516. + by ASM_FPRINTF. (Isn't that a design bug?). */
  517. +
  518. +#undef REGISTER_PREFIX_MD
  519. +#define REGISTER_PREFIX_MD "%%"
  520. +
  521. +/* config/m68k.md has an explicit reference to the program counter,
  522. + prefix this by the register prefix. */
  523. +
  524. +#define ASM_RETURN_CASE_JUMP return "jmp %%pc@(2,%0:w)"
  525. +
  526. +/* Here are the new register names. */
  527. +
  528. +#undef REGISTER_NAMES
  529. +#define REGISTER_NAMES \
  530. +{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
  531. + "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \
  532. + "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7" }
  533. +
  534. diff -burN gcc-2.7.2.orig/c-lex.c gcc-2.7.2/c-lex.c
  535. --- gcc-2.7.2.orig/c-lex.c 1995-06-15 07:11:39.000000000 -0400
  536. +++ gcc-2.7.2/c-lex.c 1995-11-20 07:13:38.000000000 -0500
  537. @@ -848,6 +848,14 @@
  538. if (pedantic)
  539. pedwarn ("non-ANSI escape sequence `\\%c'", c);
  540. return c;
  541. +#ifdef AUX_PASCAL_STRINGS
  542. + /* Return a special code so that the string constructor can leave a
  543. + hole and patch in the string length later */
  544. + case 'p':
  545. + if (pedantic)
  546. + pedwarn ("non-ANSI escape sequence `\\p'");
  547. + return -2;
  548. +#endif
  549. }
  550. if (c >= 040 && c < 0177)
  551. pedwarn ("unknown escape sequence `\\%c'", c);
  552. @@ -1729,8 +1737,10 @@
  553. num_chars = max_chars;
  554. error ("character constant too long");
  555. }
  556. +#ifndef AUX /* Many Mac programs use multi-character constants */
  557. else if (num_chars != 1 && ! flag_traditional)
  558. warning ("multi-character character constant");
  559. +#endif
  560.  
  561. /* If char type is signed, sign-extend the constant. */
  562. if (! wide_flag)
  563. @@ -1781,6 +1791,9 @@
  564. case '"':
  565. string_constant:
  566. {
  567. +#ifdef AUX_PASCAL_STRINGS
  568. + int pascalstring = FALSE;
  569. +#endif
  570. c = getc (finput);
  571. p = token_buffer + 1;
  572.  
  573. @@ -1792,6 +1805,19 @@
  574. c = readescape (&ignore);
  575. if (ignore)
  576. goto skipnewline;
  577. +#ifdef AUX_PASCAL_STRINGS
  578. + /* readescape() returns -2 to indicate "\p" */
  579. + if (c == -2)
  580. + {
  581. + if (p == token_buffer + 1)
  582. + pascalstring = TRUE, c = '\0';
  583. + else
  584. + {
  585. + warning ("ignoring pascal string flag (`\\p') not at beginning of string");
  586. + c = 'p';
  587. + }
  588. + }
  589. +#endif
  590. if (!wide_flag
  591. && TYPE_PRECISION (char_type_node) < HOST_BITS_PER_INT
  592. && c >= (1 << TYPE_PRECISION (char_type_node)))
  593. @@ -1816,6 +1842,16 @@
  594. if (c < 0)
  595. error ("Unterminated string constant");
  596.  
  597. +#ifdef AUX_PASCAL_STRINGS
  598. + if (pascalstring)
  599. + {
  600. + int len;
  601. + token_buffer[1] = len = p - token_buffer - 2;
  602. + if (len >= (1 << BITS_PER_UNIT))
  603. + warning ("Pascal string too long");
  604. + }
  605. +#endif
  606. +
  607. /* We have read the entire constant.
  608. Construct a STRING_CST for the result. */
  609.  
  610. diff -burN gcc-2.7.2.orig/config/m68k/m68k.c gcc-2.7.2/config/m68k/m68k.c
  611. --- gcc-2.7.2.orig/config/m68k/m68k.c 1995-09-28 14:00:17.000000000 -0400
  612. +++ gcc-2.7.2/config/m68k/m68k.c 1995-11-20 07:13:50.000000000 -0500
  613. @@ -256,7 +256,11 @@
  614. {
  615. int regno;
  616.  
  617. - if (!reload_completed || frame_pointer_needed || get_frame_size () != 0)
  618. + if (!reload_completed || frame_pointer_needed || get_frame_size () != 0
  619. +#ifdef AUX
  620. + || current_function_returns_pointer
  621. +#endif
  622. + )
  623. return 0;
  624.  
  625. /* Copied from output_function_epilogue (). We should probably create a
  626. diff -burN gcc-2.7.2.orig/config.guess gcc-2.7.2/config.guess
  627. --- gcc-2.7.2.orig/config.guess 1995-11-26 14:56:22.000000000 -0500
  628. +++ gcc-2.7.2/config.guess 1995-11-20 07:13:38.000000000 -0500
  629. @@ -424,6 +424,9 @@
  630. echo ns32k-sni-sysv
  631. fi
  632. exit 0 ;;
  633. + mc68*:A/UX:*:*)
  634. + echo m68k-apple-aux${UNAME_RELEASE}
  635. + exit 0 ;;
  636. esac
  637.  
  638. #echo '(No uname command or uname output not recognized.)' 1>&2
  639. diff -burN gcc-2.7.2.orig/config.sub gcc-2.7.2/config.sub
  640. --- gcc-2.7.2.orig/config.sub 1995-06-15 17:01:49.000000000 -0400
  641. +++ gcc-2.7.2/config.sub 1995-11-20 07:13:39.000000000 -0500
  642. @@ -81,7 +81,8 @@
  643. -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
  644. -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
  645. -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
  646. - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
  647. + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
  648. + -apple)
  649. os=
  650. basic_machine=$1
  651. ;;
  652. @@ -190,6 +191,10 @@
  653. basic_machine=m68k-apollo
  654. os=-sysv
  655. ;;
  656. + apple | aux)
  657. + basic_machine=m68k-apple
  658. + os=-aux
  659. + ;;
  660. balance)
  661. basic_machine=ns32k-sequent
  662. os=-dynix
  663. @@ -641,7 +646,7 @@
  664. | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
  665. | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
  666. | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  667. - | -udi* | -eabi* | -lites* )
  668. + | -udi* | -eabi* | -lites* | -aux* )
  669. # Remember, each alternative MUST END IN *, to match a version number.
  670. ;;
  671. -sunos5*)
  672. @@ -721,6 +726,9 @@
  673. *-acorn)
  674. os=-riscix1.2
  675. ;;
  676. + m68*-apple)
  677. + os=-aux
  678. + ;;
  679. arm*-semi)
  680. os=-aout
  681. ;;
  682. @@ -859,6 +867,9 @@
  683. -vxworks*)
  684. vendor=wrs
  685. ;;
  686. + -aux*)
  687. + vendor=apple
  688. + ;;
  689. esac
  690. basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
  691. ;;
  692. diff -burN gcc-2.7.2.orig/configure gcc-2.7.2/configure
  693. --- gcc-2.7.2.orig/configure 1995-11-26 14:39:15.000000000 -0500
  694. +++ gcc-2.7.2/configure 1995-12-05 09:34:23.000000000 -0500
  695. @@ -1544,6 +1544,15 @@
  696. # The real one comes with the Linux C library.
  697. #extra_parts="crtbegin.o crtend.o"
  698. ;;
  699. + m68k-apple-aux*) # Apple Macintosh running A/UX
  700. + xm_file=m68k/xm-aux.h
  701. + tm_file=m68k/aux.h
  702. + xmake_file=m68k/x-aux
  703. + broken_install=yes
  704. + use_collect2=yes
  705. + install_headers_dir=install-headers-cpio
  706. + extra_headers=math-68881.h
  707. + ;;
  708. m88k-dg-dgux*)
  709. case $machine in
  710. m88k-dg-dguxbcs*)
  711. diff -burN gcc-2.7.2.orig/fixincludes gcc-2.7.2/fixincludes
  712. --- gcc-2.7.2.orig/fixincludes 1995-11-26 14:22:28.000000000 -0500
  713. +++ gcc-2.7.2/fixincludes 1995-12-05 09:34:34.000000000 -0500
  714. @@ -2465,6 +2465,24 @@
  715. fi
  716. fi
  717.  
  718. +# This file in A/UX 3.0.x/3.1.x contains an __asm directive for c89; gcc
  719. +# doesn't understand it.
  720. +file=sys/param.h
  721. +if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
  722. + cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
  723. + chmod +w ${LIB}/$file 2>/dev/null
  724. + chmod a+r ${LIB}/$file 2>/dev/null
  725. +fi
  726. +
  727. +if [ -r ${LIB}/$file ]; then
  728. + echo "Fixing __asm directive in sys/param.h"
  729. + sed -e 's|#ifndef NOINLINE|#if !defined(NOINLINE) \&\& !defined(__GNUC__)|' \
  730. + ${LIB}/$file > ${LIB}/${file}.sed
  731. + rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
  732. + if cmp $file ${LIB}/$file >/dev/null 2>&1; then
  733. + rm -f ${LIB}/$file
  734. + fi
  735. +fi
  736.  
  737. # This loop does not appear to do anything, because it uses file
  738. # rather than $file when setting target. It also appears to be
  739. diff -burN gcc-2.7.2.orig/gcc.c gcc-2.7.2/gcc.c
  740. --- gcc-2.7.2.orig/gcc.c 1995-09-12 17:15:11.000000000 -0400
  741. +++ gcc-2.7.2/gcc.c 1995-11-20 07:13:44.000000000 -0500
  742. @@ -2878,11 +2878,19 @@
  743. /* Null-terminate the vector. */
  744. switches[n_switches].args[j] = 0;
  745. }
  746. +#ifdef AUX
  747. + else if (c == 'o')
  748. + {
  749. + /* On A/UX, ld cannot handle -o without space.
  750. + So split the -o from its argument. */
  751. + switches[n_switches].part1 = "o";
  752. +#else
  753. else if (*switches_need_spaces != 0 && (c == 'o' || c == 'L'))
  754. {
  755. /* On some systems, ld cannot handle -o or -L without space.
  756. So split the -o or -L from its argument. */
  757. switches[n_switches].part1 = (c == 'o' ? "o" : "L");
  758. +#endif
  759. switches[n_switches].args = (char **) xmalloc (2 * sizeof (char *));
  760. switches[n_switches].args[0] = xmalloc (strlen (p));
  761. strcpy (switches[n_switches].args[0], &p[1]);
  762. diff -burN gcc-2.7.2.orig/libgcc2.c gcc-2.7.2/libgcc2.c
  763. --- gcc-2.7.2.orig/libgcc2.c 1995-11-26 14:39:21.000000000 -0500
  764. +++ gcc-2.7.2/libgcc2.c 1995-12-05 09:34:40.000000000 -0500
  765. @@ -2190,6 +2190,10 @@
  766. extern void __do_global_dtors ();
  767. extern void _cleanup ();
  768. extern void _exit () __attribute__ ((noreturn));
  769. +#ifdef AUX
  770. +extern void _exithk ();
  771. +#endif
  772. +
  773.  
  774. void
  775. exit (status)
  776. @@ -2202,6 +2206,9 @@
  777. EXIT_BODY;
  778. #else
  779. _cleanup ();
  780. +#ifdef AUX
  781. + _exithk();
  782. +#endif
  783. #endif
  784. _exit (status);
  785. }
  786. diff -burN gcc-2.7.2.orig/x-aux gcc-2.7.2/x-aux
  787. --- gcc-2.7.2.orig/x-aux 1969-12-31 19:00:00.000000000 -0500
  788. +++ gcc-2.7.2/x-aux 1995-11-20 07:13:50.000000000 -0500
  789. @@ -0,0 +1,21 @@
  790. +# Makefile additions for A/UX
  791. +
  792. +LIB2FUNCS_EXTRA=aux-mcount.o aux-exit.c
  793. +FIXPROTO_DEFINES = -D_POSIX_SOURCE
  794. +EXTRA_PASSES=ld aux-crtfix
  795. +CLIB=-lld # needed for collect2
  796. +INSTALL=cp
  797. +
  798. +# needed to support builds for multiple versions of A/UX
  799. +LDFLAGS=-static
  800. +
  801. +aux-mcount.o: $(srcdir)/config/m68k/aux-mcount.asm $(GCC_PASSES)
  802. + /bin/as -o aux-mcount.o $(srcdir)/config/m68k/aux-mcount.asm
  803. +
  804. +aux-exit.c: $(srcdir)/config/m68k/aux-exit.c
  805. + cp $(srcdir)/config/m68k/aux-exit.c aux-exit.c
  806. +
  807. +aux-crtfix: $(srcdir)/config/m68k/aux-crtfix.c
  808. + $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(srcdir)/config/m68k/aux-crtfix.c \
  809. + $(LIBS) -o aux-crtfix
  810. +
  811. diff -burN gcc-2.7.2.orig/xm-aux.h gcc-2.7.2/xm-aux.h
  812. --- gcc-2.7.2.orig/xm-aux.h 1969-12-31 19:00:00.000000000 -0500
  813. +++ gcc-2.7.2/xm-aux.h 1995-11-20 07:13:50.000000000 -0500
  814. @@ -0,0 +1,9 @@
  815. +#ifndef USG
  816. +#define USG
  817. +#endif
  818. +
  819. +#ifndef AUX
  820. +#define AUX
  821. +#endif
  822. +
  823. +#include "m68k/xm-m68k.h"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement