Commit b548dffb by Zack Weinberg

aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New.

libiberty:
	* aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New.
	* configure.in: Replace all alloca logic with a simple use of
	the above new macro.
	* config.table: Kill *-*-beos* entry.
	* config/mh-beos: Delete.
	* configure, config.in: Regenerate.

	* Makefile.in (ALLOCA, HFILES): Kill.
	(REQUIRED_OFILES): Add alloca.o.
	(alloca.o): Depend on libiberty.h.
	(argv.o): Don't depend on alloca-conf.h.
	* alloca-conf.h: Delete.
	* alloca.c: Include libiberty.h.  Kill all #ifdef emacs
	blocks.  Provide the C alloca unconditionally.  Use PTR where
	appropriate.  Make i00afunc static.
	* argv.c: Don't include alloca-conf.h.

include:
	* libiberty.h: Prototype C_alloca; define alloca to either
	__builtin_alloca or C_alloca as appropriate.

gcc:
	* aclocal.m4 (AM_GNU_GETTEXT): Don't AC_REQUIRE
	AC_FUNC_ALLOCA.
	* configure, config.in: Regenerate.
	* config.gcc: Remove references to deleted files.

	* genattr.c, genattrtab.c, genextract.c, genoutput.c,
	genrecog.c, rtl.c: Do not use alloca anywhere.

	* Makefile.in, build-make, system.h, config/x-interix,
	config/x-svr4, config/xm-interix.h, config/xm-openbsd.h,
	config/alpha/xm-alpha.h, config/alpha/xm-vms.h,
	config/arc/xm-arc.h, config/arm/xm-arm.h,
	config/d30v/xm-d30v.h, config/dsp16xx/xm-dsp16xx.h,
	config/h8300/xm-h8300.h, config/i370/x-oe,
	config/i370/xm-linux.h, config/i386/x-aix, config/i386/x-beos,
	config/i386/x-ncr3000, config/i386/x-sco5,
	config/i386/xm-dgux.h, config/i860/x-sysv4,
	config/i960/xm-i960.h, config/m32r/xm-m32r.h,
	config/m68k/x-crds, config/m68k/x-dpx2, config/m68k/x-hp320,
	config/m68k/x-hp320g, config/m69k/x-mot3300,
	config/m68k/x-mot3300-gas, config/m68k/xm-amix.h,
	config/m68k/xm-hp320.h, config/m68k/xm-m68kv.h,
	config/m68k/xm-mot3300.h, config/m88k/x-dolph,
	config/m88k/x-sysv4, config/m88k/x-tekXD88,
	config/m88k/xm-m88k.h, config/mcore/xm-mcore.h,
	config/mips/x-iris, config/mips/x-iris3,
	config/mips/x-sni-svr4, config/mips/x-sysv,
	config/mips/xm-iris6.h, config/mips/xm-mips.h,
	config/mips/xm-nws3250v4.h, config/pa/x-hpux,
	config/pa/x-pa-mpeix, config/pa/xm-pa.h,
	config/pa/xm-pa64hpux.h, config/pa/xm-pahpux.h,
	config/pa/xm-papro.h, config/romp/xm-romp.h,
	config/rs6000/x-aix31, config/rs6000/x-aix41,
	config/rs6000/x-beos, config/rs6000/x-lynx,
	config/rs6000/x-mach, config/rs6000/x-rs6000,
	config/rs6000/x-sysv4, config/rs6000/xm-rs6000.h,
	config/rs6000/xm-sysv4.h, config/sh/xm-sh.h,
	config/sparc/x-sysv4, config/sparc/xm-linux.h,
	config/sparc/xm-pbd.h, config/sparc/xm-sparc.h,
	config/vax/xm-vms.h: Eradicate all references to alloca and
	related stuff.

	* config/xm-alloca.h, config/clipper/x-clix,
	config/i386/xm-sysv4.h, config/i860/x-fx2800,
	config/i860/x-sysv3, config/m88k/x-sysv3,
	config/sparc/xm-sol2.h, config/we32k/x-we32k: Delete
	(contained only alloca related hacks).

	* config/i386/xm-beos.h, config/rs6000/xm-beos.h: Just define
	USE_C_ALLOCA.

From-SVN: r40259
parent 89b3de05
......@@ -58,10 +58,6 @@ INTL_TARGETS = intl.all intl.install
# This is overridden by configure.
BOOT_LANGUAGES = c @all_boot_languages@
ALLOCA =
ALLOCA_FLAGS =
ALLOCA_FINISH = true
# Various ways of specifying flags for compilations:
# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
# BOOT_CFLAGS is the value of CFLAGS to pass to the stage2 and stage3
......@@ -509,7 +505,6 @@ HOST_CFLAGS=$(ALL_CFLAGS) -DGENERATOR_FILE
HOST_CLIB=$(CLIB)
HOST_LDFLAGS=$(LDFLAGS)
HOST_CPPFLAGS=$(ALL_CPPFLAGS)
HOST_ALLOCA=$(ALLOCA)
HOST_MALLOC=$(MALLOC)
HOST_OBSTACK=$(OBSTACK)
HOST_VFPRINTF=$(VFPRINTF)
......@@ -604,34 +599,32 @@ ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) \
# Likewise.
ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
# Even if ALLOCA is set, don't use it if compiling with GCC.
USE_ALLOCA= ${ALLOCA}
USE_HOST_ALLOCA= ` case "${HOST_ALLOCA}" in ?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac `
USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
USE_HOST_VFPRINTF= ` case "${HOST_VFPRINTF}" in ?*) echo ${HOST_PREFIX}${HOST_VFPRINTF} ;; esac `
USE_HOST_DOPRINT= ` case "${HOST_DOPRINT}" in ?*) echo ${HOST_PREFIX}${HOST_DOPRINT} ;; esac `
USE_HOST_STRSTR= ` case "${HOST_STRSTR}" in ?*) echo ${HOST_PREFIX}${HOST_STRSTR} ;; esac `
# Dependency on obstack, alloca, malloc or whatever library facilities
# Dependency on obstack, malloc or whatever library facilities
# are not installed in the system libraries.
# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
LIBDEPS= $(INTLLIBS) $(OBSTACK) $(ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT) $(STRSTR)
# We don't use USE_* because backquote expansion doesn't work in deps.
LIBDEPS= $(INTLLIBS) $(OBSTACK) $(MALLOC) $(VFPRINTF) $(DOPRINT) $(STRSTR)
# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC) $(HOST_PREFIX)$(HOST_VFPRINTF) $(HOST_PREFIX)$(HOST_DOPRINT) $(HOST_PREFIX)$(HOST_STRSTR)
HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_MALLOC) \
$(HOST_PREFIX)$(HOST_VFPRINTF) $(HOST_PREFIX)$(HOST_DOPRINT) \
$(HOST_PREFIX)$(HOST_STRSTR)
# How to link with both our special library facilities
# and the system's installed libraries.
LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(INTLLIBS) @LIBS@ $(VFPRINTF) $(DOPRINT) $(STRSTR) $(CLIB) ../libiberty/libiberty.a
LIBS = $(OBSTACK) $(MALLOC) $(INTLLIBS) @LIBS@ $(VFPRINTF) $(DOPRINT) \
$(STRSTR) $(CLIB) ../libiberty/libiberty.a
# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \
$(USE_HOST_VFPRINTF) $(USE_HOST_DOPRINT) $(USE_HOST_STRSTR) \
$(HOST_CLIB)
HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_MALLOC) $(USE_HOST_VFPRINTF) \
$(USE_HOST_DOPRINT) $(USE_HOST_STRSTR) $(HOST_CLIB)
HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o \
$(HOST_PREFIX)ggc-none.o gensupport.o hashtab.o safe-ctype.o
......@@ -1558,15 +1551,6 @@ mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) system.h
# Build file to support OSF/rose half-pic format.
halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H) system.h
# Normally this target is not used; but it is used if you
# define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
# from the GNU Emacs distribution.
alloca.o: $(srcdir)/../libiberty/alloca.c
rm -f alloca.c
$(LN_S) $(srcdir)/../libiberty/alloca.c alloca.c
$(CC) $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) \
$(ALLOCA_FLAGS) -c alloca.c
$(ALLOCA_FINISH)
#
# Generate header and source files from the machine description,
# and compile them.
......@@ -1819,7 +1803,7 @@ gengenrtl.o : gengenrtl.c $(RTL_BASE_H) system.h real.h
# Compile the libraries to be used by gen*.
# If we are not cross-building, gen* use the same .o's that cc1 will use,
# and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
# with the rules for rtl.o, alloca.o, etc.
# with the rules for rtl.o, etc.
$(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(GCONFIG_H) system.h $(RTL_H) \
bitmap.h $(GGC_H) toplev.h $(HASHTAB_H)
rm -f $(HOST_PREFIX)rtl.c
......@@ -1838,11 +1822,6 @@ $(HOST_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(CONFIG_H) system.h $(RTL_H) \
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(HOST_PREFIX)bitmap.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)bitmap.c
$(HOST_PREFIX_1)alloca.o: $(srcdir)/../libiberty/alloca.c
rm -f $(HOST_PREFIX)alloca.c
$(LN_S) $(srcdir)/../libiberty/alloca.c $(HOST_PREFIX)alloca.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
$(HOST_PREFIX_1)obstack.o: $(srcdir)/../libiberty/obstack.c $(GCONFIG_H)
rm -f $(HOST_PREFIX)obstack.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/obstack.c > $(HOST_PREFIX)obstack.c
......@@ -1875,7 +1854,7 @@ $(HOST_PREFIX_1)errors.o: errors.c
# This satisfies the dependency that we get if you cross-compile a compiler
# that does not need to compile alloca, malloc or whatever.
# that does not need to compile, malloc or whatever.
$(HOST_PREFIX_1):
touch $(HOST_PREFIX_1)
......@@ -2294,7 +2273,7 @@ mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean
-rm -rf libgcc
# Delete the temporary source copies for cross compilation.
-rm -f $(HOST_PREFIX_1)rtl.c
-rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
-rm -f $(HOST_PREFIX_1)malloc.c
-rm -f $(HOST_PREFIX_1)obstack.c
# Delete the temp files made in the course of building libgcc.a.
-rm -f xlimits.h libgcc1-test
......@@ -2308,7 +2287,7 @@ mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean
-rm -f *.[0-9][0-9].* */*.[0-9][0-9].*
# Delete some files made during installation.
-rm -f specs float.h-* enquire SYSCALLS.c.X SYSCALLS.c
-rm -f collect collect2 mips-tfile mips-tdump alloca.s
-rm -f collect collect2 mips-tfile mips-tdump
# Delete files generated for fixproto
-rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \
gen-protos$(build_exeext) fixproto.list fixtmp.* fixhdr.ready
......@@ -2363,7 +2342,7 @@ distclean: clean $(INTL_DISTCLEAN) lang.distclean
-rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
-rm -f testsuite/{gcc,g++}.{log,sum}
-rm -f intl/libintl.h libintl.h
-rm -f cxxmain.c splay-tree.c obstack.c alloca.c hashtab.c safe-ctype.c
-rm -f cxxmain.c splay-tree.c obstack.c hashtab.c safe-ctype.c
-rm -f mklibgcc libgcc.map gccbug .gdbinit configargs.h
-rm -f gcov.pod
-rm -f fixinc/Makefile
......@@ -2903,11 +2882,6 @@ stage1_copy: stage1_build
touch stage1_copy
echo stage2_build > stage_last
# This used to define ALLOCA as empty, but that would lead to bad results
# for a subsequent `make install' since that would not have ALLOCA empty.
# To prevent `make install' from compiling alloca.o and then relinking cc1
# because alloca.o is newer, we permit these recursive makes to compile
# alloca.o. Then cc1 is newer, so it won't have to be relinked.
stage2_build: stage1_copy
$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
STAGE_PREFIX=stage1/ \
......
......@@ -566,7 +566,6 @@ AC_DEFUN(AM_GNU_GETTEXT,
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
unistd.h sys/param.h])
......
......@@ -16,7 +16,6 @@ HOST_CFLAGS=$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) \
HOST_CLIB=
HOST_LDFLAGS=$(LDFLAGS)
HOST_CPPFLAGS=$(ALL_CPPFLAGS)
HOST_ALLOCA=$(ALLOCA)
HOST_MALLOC=$(MALLOC)
HOST_OBSTACK=$(OBSTACK)
......
......@@ -610,7 +610,6 @@ c4x-*)
clipper-intergraph-clix*)
tm_file="${tm_file} svr3.h clipper/clix.h"
xm_file=clipper/xm-clix.h
xmake_file=clipper/x-clix
extra_headers=va-clipper.h
extra_parts="crtbegin.o crtend.o"
install_headers_dir=install-headers-cpio
......@@ -945,7 +944,7 @@ i370-*-linux*)
fi
;;
i[34567]86-*-chorusos*)
xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h"
xm_file="${xm_file} xm-svr4.h"
tm_file="i386/i386.h i386/att.h elfos.h i386/i386afe.h i386/i386elf.h i386/chorus.h"
tmake_file=i386/t-i386elf
xmake_file=x-svr4
......@@ -956,7 +955,7 @@ i[34567]86-*-chorusos*)
esac
;;
i[34567]86-*-elf*)
xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h"
xm_file="${xm_file} xm-svr4.h"
tm_file="i386/i386.h i386/att.h elfos.h i386/i386afe.h i386/i386elf.h"
tmake_file=i386/t-i386elf
xmake_file=x-svr4
......@@ -971,12 +970,10 @@ i[34567]86-ibm-aix*) # IBM PS/2 running AIX
tm_file=i386/aix386ng.h
use_collect2=yes
fi
xm_file="xm-alloca.h ${xm_file}"
xm_defines=USG
xmake_file=i386/x-aix
;;
i[34567]86-ncr-sysv4*) # NCR 3000 - ix86 running system V.4
xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG POSIX SMALL_ARG_MAX"
xmake_file=i386/x-ncr3000
if test x$stabs = xyes -a x$gas = xyes
......@@ -1029,7 +1026,6 @@ i[34567]86-sequent-ptx2* | i[34567]86-sequent-sysv3*)
install_headers_dir=install-headers-cpio
;;
i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4*)
xm_file="xm-alloca.h ${xm_file}"
if test x$gas = xyes
then
tm_file="${tm_file} usegas.h"
......@@ -1251,7 +1247,7 @@ i[34567]86-*-rtems*|i[34567]86-*-rtemself*)
fi
;;
i[34567]86-*-sco3.2v5*) # 80386 running SCO Open Server 5
xm_file="xm-alloca.h ${xm_file} i386/xm-sco5.h"
xm_file="${xm_file} i386/xm-sco5.h"
xm_defines="USG SVR3"
xmake_file=i386/x-sco5
install_headers_dir=install-headers-cpio
......@@ -1305,7 +1301,6 @@ i[34567]86-*-sco*) # 80386 running SCO system
truncate_target=yes
;;
i[34567]86-*-solaris2*)
xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG POSIX SMALL_ARG_MAX"
tm_file=i386/sol2.h
if test x$gas = xyes; then
......@@ -1330,7 +1325,6 @@ i[34567]86-*-solaris2*)
fi
;;
i[34567]86-*-sysv5*) # Intel x86 on System V Release 5
xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG POSIX"
tm_file=i386/sysv5.h
if test x$stabs = xyes
......@@ -1345,7 +1339,6 @@ i[34567]86-*-sysv5*) # Intel x86 on System V Release 5
fi
;;
i[34567]86-*-sysv4*) # Intel 80386's running system V.4
xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG POSIX SMALL_ARG_MAX"
tm_file=i386/sysv4.h
if test x$stabs = xyes
......@@ -1357,7 +1350,6 @@ i[34567]86-*-sysv4*) # Intel 80386's running system V.4
extra_parts="crtbegin.o crtend.o"
;;
i[34567]86-*-udk*) # Intel x86 on SCO UW/OSR5 Dev Kit
xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG POSIX"
tm_file=i386/udk.h
tmake_file="i386/t-i386bare i386/t-crtpic i386/t-udk"
......@@ -1367,7 +1359,7 @@ i[34567]86-*-udk*) # Intel x86 on SCO UW/OSR5 Dev Kit
;;
i[34567]86-*-osf1*) # Intel 80386's running OSF/1 1.3+
cpu_type=i386
xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h i386/xm-osf1elf.h"
xm_file="${xm_file} xm-svr4.h i386/xm-osf1elf.h"
xm_defines="USE_C_ALLOCA SMALL_ARG_MAX"
if test x$stabs = xyes
then
......@@ -1475,7 +1467,6 @@ i[34567]86-*-interix*)
fi
;;
i[34567]86-dg-dgux*)
xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG POSIX"
out_file=i386/dgux.c
tm_file=i386/dgux.h
......@@ -1486,7 +1477,6 @@ i[34567]86-dg-dgux*)
i860-alliant-*) # Alliant FX/2800
tm_file="${tm_file} svr4.h i860/sysv4.h i860/fx2800.h"
xm_file="${xm_file}"
xmake_file=i860/x-fx2800
tmake_file=i860/t-fx2800
extra_parts="crtbegin.o crtend.o"
;;
......@@ -1509,7 +1499,6 @@ i860-*-osf*) # Intel Paragon XP/S, OSF/1AD
i860-*-sysv3*)
tm_file="${tm_file} svr3.h i860/sysv3.h"
xm_defines="USG SVR3"
xmake_file=i860/x-sysv3
extra_parts="crtbegin.o crtend.o"
;;
i860-*-sysv4*)
......@@ -1609,7 +1598,6 @@ m68000-hp-bsd*) # HP 9000/200 running BSD
extra_headers=math-68881.h
;;
m68000-hp-hpux*) # HP 9000 series 300
xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG"
if test x$gas = xyes
then
......@@ -1696,7 +1684,6 @@ m68k-bull-sysv*) # Bull DPX/2
else
tm_file=m68k/dpx2.h
fi
xm_file="xm-alloca.h ${xm_file}"
xm_defines=USG
xmake_file=m68k/x-dpx2
use_collect2=yes
......@@ -1704,7 +1691,6 @@ m68k-bull-sysv*) # Bull DPX/2
;;
m68k-atari-sysv4*) # Atari variant of V.4.
tm_file=m68k/atari.h
xm_file="xm-alloca.h ${xm_file}"
xm_defines=USG
tmake_file=t-svr4
extra_parts="crtbegin.o crtend.o"
......@@ -1713,7 +1699,7 @@ m68k-atari-sysv4*) # Atari variant of V.4.
;;
m68k-motorola-sysv*)
tm_file=m68k/mot3300.h
xm_file="xm-alloca.h m68k/xm-mot3300.h ${xm_file}"
xm_file="m68k/xm-mot3300.h ${xm_file}"
if test x$gas = xyes
then
xmake_file=m68k/x-mot3300-gas
......@@ -1748,19 +1734,17 @@ m68k-ncr-sysv*) # NCR Tower 32 SVR3
;;
m68k-plexus-sysv*)
tm_file=m68k/plexus.h
xm_file="xm-alloca.h m68k/xm-plexus.h ${xm_file}"
xm_file="m68k/xm-plexus.h ${xm_file}"
xm_defines=USG
use_collect2=yes
extra_headers=math-68881.h
;;
m68k-tti-*)
tm_file=m68k/pbb.h
xm_file="xm-alloca.h ${xm_file}"
xm_defines=USG
extra_headers=math-68881.h
;;
m68k-crds-unos*)
xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG unos"
xmake_file=m68k/x-crds
tm_file=m68k/crds.h
......@@ -1769,7 +1753,6 @@ m68k-crds-unos*)
;;
m68k-cbm-sysv4*) # Commodore variant of V.4.
tm_file=m68k/amix.h
xm_file="xm-alloca.h ${xm_file}"
xm_defines=USG
xmake_file=m68k/x-amix
tmake_file=t-svr4
......@@ -1808,7 +1791,6 @@ m68k-isi-bsd*)
extra_headers=math-68881.h
;;
m68k-hp-hpux7*) # HP 9000 series 300 running HPUX version 7.
xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG"
if test x$gas = xyes
then
......@@ -1824,7 +1806,6 @@ m68k-hp-hpux7*) # HP 9000 series 300 running HPUX version 7.
float_format=m68k
;;
m68k-hp-hpux*) # HP 9000 series 300
xm_file="xm-alloca.h ${xm_file}"
xm_defines="USG"
if test x$gas = xyes
then
......@@ -1962,7 +1943,6 @@ m68k*-*-openbsd*)
use_collect2=yes
;;
m68k-*-sysv3*) # Motorola m68k's running system V.3
xm_file="xm-alloca.h ${xm_file}"
xm_defines=USG
extra_parts="crtbegin.o crtend.o"
extra_headers=math-68881.h
......@@ -1970,7 +1950,6 @@ m68k-*-sysv3*) # Motorola m68k's running system V.3
;;
m68k-*-sysv4*) # Motorola m68k's running system V.4
tm_file=m68k/m68kv4.h
xm_file="xm-alloca.h ${xm_file}"
xm_defines=USG
tmake_file=t-svr4
extra_parts="crtbegin.o crtend.o"
......@@ -2096,7 +2075,6 @@ m88k-*-openbsd*)
m88k-*-sysv3*)
tm_file=m88k/sysv3.h
extra_parts="crtbegin.o crtend.o"
xmake_file=m88k/x-sysv3
if test x$gas = xyes
then
tmake_file=m88k/t-m88k-gas
......@@ -2903,7 +2881,6 @@ sh-*-*)
;;
sparc-tti-*)
tm_file=sparc/pbd.h
xm_file="xm-alloca.h ${xm_file}"
xm_defines=USG
;;
sparc64-wrs-vxworks*)
......@@ -3013,7 +2990,7 @@ sparcv9-*-solaris2*)
else
tm_file=sparc/sol2-sld-64.h
fi
xm_file="sparc/xm-sysv4-64.h sparc/xm-sol2.h"
xm_file="sparc/xm-sysv4-64.h"
xm_defines="USG POSIX"
tmake_file="sparc/t-sol2 sparc/t-sol2-64"
if test x$gnu_ld = xyes; then
......@@ -3039,7 +3016,7 @@ sparcv9-*-solaris2*)
fi
;;
sparc-hal-solaris2*)
xm_file="sparc/xm-sysv4.h sparc/xm-sol2.h"
xm_file="sparc/xm-sysv4.h"
xm_defines="USG POSIX"
tm_file="sparc/sol2.h sparc/hal.h"
tmake_file="sparc/t-halos sparc/t-sol2"
......@@ -3067,7 +3044,7 @@ sparc-*-solaris2*)
else
tm_file=sparc/sol2-sld.h
fi
xm_file="sparc/xm-sysv4.h sparc/xm-sol2.h"
xm_file="sparc/xm-sysv4.h"
xm_defines="USG POSIX"
tmake_file=sparc/t-sol2
if test x$gnu_ld = xyes; then
......@@ -3138,7 +3115,7 @@ sparc-*-sysv4*)
extra_parts="crtbegin.o crtend.o"
;;
sparc-*-vxsim*)
xm_file="sparc/xm-sysv4.h sparc/xm-sol2.h"
xm_file="sparc/xm-sysv4.h"
xm_defines="USG POSIX"
tm_file=sparc/vxsim.h
tmake_file=sparc/t-vxsparc
......
/* config.in. Generated automatically from configure.in by autoheader. */
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Define to empty if the keyword does not work. */
#undef const
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END
/* Define to the type of elements in the array set by `getgroups'.
Usually this is either `int' or `gid_t'. */
#undef GETGROUPS_T
......@@ -17,12 +10,6 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
/* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
......@@ -56,15 +43,6 @@
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
......
......@@ -27,19 +27,6 @@ Boston, MA 02111-1307, USA. */
#define HOST_BITS_PER_LONG 64
#define HOST_BITS_PER_LONGLONG 64
/* If compiled with GNU C, use the builtin alloca. */
#ifndef alloca
#if defined(__GNUC__) && !defined(USE_C_ALLOCA)
#define alloca __builtin_alloca
#else
#if !defined(_WIN32) && !defined(USE_C_ALLOCA) && !defined(OPEN_VMS) && !defined(__INTERIX)
#include <alloca.h>
#else
extern void *alloca ();
#endif
#endif
#endif
/* The host compiler has problems with enum bitfields since it makes
them signed so we can't fit all our codes in. */
......
......@@ -69,8 +69,6 @@ Boston, MA 02111-1307, USA. */
#define HAVE_STRERROR
#define HAVE_ATOLL
#define USE_C_ALLOCA /* Using alloca.c */
#define HAVE_FCNTL_H 1
#define HAVE_STDLIB_H 1
#define HAVE_UNISTD_H 1
......@@ -81,11 +79,5 @@ Boston, MA 02111-1307, USA. */
#define STDC_HEADERS 1
#define HAVE_STRINGIZE 1
#if __STDC__
extern void *alloca (size_t);
#else
extern char *alloca (unsigned int);
#endif
#define OBJECT_SUFFIX ".obj"
#define EXECUTABLE_SUFFIX ".exe"
......@@ -28,8 +28,3 @@ Boston, MA 02111-1307, USA. */
/* Doubles are stored in memory with the high order word first. This
matters when cross-compiling. */
#define HOST_WORDS_BIG_ENDIAN 1
/* If compiled with Sun CC, the use of alloca requires this #include. */
#ifndef __GNUC__
#include "alloca.h"
#endif
......@@ -36,11 +36,6 @@ Boston, MA 02111-1307, USA. */
#define HOST_FLOAT_WORDS_BIG_ENDIAN 1
/* If not compiled with GNU C, use C alloca. */
#ifndef __GNUC__
#define USE_C_ALLOCA
#endif
/* If we have defined POSIX, but are compiling in the BSD environment, then
we need to define getcwd in terms of getwd. */
#if defined (POSIX) && defined (_BSD_C)
......
......@@ -34,11 +34,3 @@
/* A C expression for the number of bits in `long' on the host machine. */
#define HOST_BITS_PER_LONG 32
/* Define this macro to indicate that the compiler is running with the `alloca'
implemented in C. */
#ifndef __GNUC__
#define USE_C_ALLOCA
#else
#define alloca __builtin_alloca
#endif
......@@ -25,10 +25,3 @@ Boston, MA 02111-1307, USA. */
#define HOST_BITS_PER_INT 16
#define HOST_BITS_PER_LONG 32
#define HOST_BITS_PER_LONGLONG 64
/* If compiled with GNU C, use the built-in alloca */
#ifdef __GNUC__
#define alloca __builtin_alloca
#else
#define USE_C_ALLOCA
#endif
......@@ -24,10 +24,3 @@ Boston, MA 02111-1307, USA. */
#define HOST_BITS_PER_INT 16
#define HOST_BITS_PER_LONG 32
#define HOST_BITS_PER_LONGLONG 64
/* If compiled with GNU C, use the built-in alloca */
#ifdef __GNUC__
#define alloca __builtin_alloca
#else
#define USE_C_ALLOCA
#endif
......@@ -2,10 +2,6 @@
# Host is an i370 running OpenEdition
#
# Use GCC alloca
ALLOCA = alloca.o
# Don't bother fixing up header files, they're wierd
STMP_FIXPROTO =
......
......@@ -31,13 +31,7 @@ Boston, MA 02111-1307, USA. */
#define HOST_WORDS_BIG_ENDIAN
/* If not compiled with GNU C, use the C alloca and use only int bitfields. */
/* If not compiled with GNU C, use only int bitfields. */
#ifndef __GNUC__
#define USE_C_ALLOCA
#if __STDC__
extern void *alloca ();
#else
extern char *alloca ();
#endif
#define ONLY_INT_FIELDS
#endif
# There is an alloca in -lbsd, but it is limited to 32K
ALLOCA = alloca.o
# If you are running out of memory while compiling gcc, with the standard
# /bin/cc uncomment MALLOCLIB line. That version of malloc is slower but
# has less overhead than the one in libc.
......
# configuration for BeOS
INSTALL=install -c
# Show we need to use the C version of ALLOCA
ALLOCA=alloca.o
# Use it regardless of whether we are compiling with gcc or not.
USE_ALLOCA= `echo "${ALLOCA}"`
USE_HOST_ALLOCA= `echo ${HOST_PREFIX}${HOST_ALLOCA}`
SUBDIR_USE_ALLOCA = `if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi`
# Don't run fixproto
STMP_FIXPROTO =
......@@ -17,13 +17,6 @@ CCLIBFLAGS=
# The rest is just x-i386v4.
# Some versions of SVR4 have an alloca in /usr/ucblib/libucb.a, and if we are
# careful to link that in after libc we can use it, but since newer versions of
# SVR4 are dropping libucb, it is better to just use the portable C version for
# bootstrapping. Do this by defining ALLOCA.
ALLOCA = alloca.o
# We used to build all stages *without* shared libraries because that may make
# debugging the compiler easier (until there is a GDB which supports
# both Dwarf *and* svr4 shared libraries).
......
......@@ -3,8 +3,6 @@ RANLIB_TEST = false
CC = cc
OLDCC = cc
CCLIBFLAGS =
# We avoid the ALLOCA in -lPW becuase it gives us an evil index()
ALLOCA = alloca.o
# See all the declarations.
FIXPROTO_DEFINES = -D_XOPEN_SOURCE -D_POSIX_C_SOURCE=2
......@@ -47,3 +47,10 @@ Boston, MA 02111-1307, USA. */
#define HAVE_PUTENV
#endif
#define HAVE_RENAME
/* This is a temporary hack until the wimpy default 64k stack
limit in BeOS is either increased or made user settable somehow.
This probably won't happen until after the DR9 release. */
#undef USE_C_ALLOCA
#define USE_C_ALLOCA 1
......@@ -4,8 +4,3 @@
#include "i386/xm-i386.h"
#include "xm-svr4.h"
/* If not compiled with GNU C, use the portable alloca. */
#ifndef __GNUC__
#define USE_C_ALLOCA
#endif
/* Configuration for GCC for Intel i386 running System V Release 4. */
#ifdef __HIGHC__
#include <alloca.h> /* for MetaWare High-C on NCR System 3000 */
#endif
# The Alliant FX2800 is supposed to conform to the SysV R4 i860 ABI,
# but apparently the native compiler generates non ABI-compliant
# function prologues and epilogues, so we need the alloca from emacs.
# -- hyc@hanauma.jpl.nasa.gov
ALLOCA=alloca.o
# The svr4 reference port for the i860 contains an alloca.o routine
# in /usr/ucblib/libucb.a, but we can't just try to get that by
# setting CLIB to /usr/ucblib/libucb.a because (unfortunately)
# there are a lot of other routines in libucb.a which are supposed
# to be the Berkeley versions of library routines normally found in
# libc.a and many of these Berkeley versions are badly broken. Thus,
# if we try to link programs with libucb.a before libc.a, those
# programs tend to crash.
# Also, the alloca() routine supplied in early version of svr4 for
# the i860 is non-ABI compliant. It doesn't keep the stack aligned
# to a 16-byte boundary as the ABI requires.
# More importantly however, even a fully ABI compliant alloca() routine
# would fail to work correctly with some versions of the native svr4 C
# compiler currently being distributed for the i860 (as of 1/29/92).
# The problem is that the native C compiler generates non-ABI-compliant
# function epilogues which cut back the stack (upon function exit) in
# an incorrect manner. Specifically, they cut back the stack by adding
# the nominal *static* frame size (determined statically at compile-time)
# to the stack pointer rather than setting the stack pointer based upon
# the current value of the frame pointer (as called for in the i860 ABI).
# This can cause serious trouble in cases where you repeatedly call a
# routine which itself calls alloca(). In such cases, the stack will
# grow continuously until you finally run out of swap space or exceed
# the system's process size limit. To avoid this problem (which can
# arise when a stage1 gcc is being used to build a stage2 gcc) you
# *must* link in the C language version of alloca() which is supplied
# with gcc to your stage1 version of gcc. The following definition
# forces that to happen.
ALLOCA=alloca.o
# We build all stages *without* shared libraries because that may make
# debugging the compiler easier (until there is a GDB which supports
# both Dwarf *and* svr4 shared libraries).
......
......@@ -24,8 +24,3 @@ Boston, MA 02111-1307, USA. */
#define HOST_BITS_PER_INT 32
#define HOST_BITS_PER_LONG 32
#define HOST_BITS_PER_LONGLONG 64
/* If not compiled with GNU C, use the C alloca */
#ifndef __GNUC__
#define USE_C_ALLOCA
#endif
......@@ -28,8 +28,3 @@ Boston, MA 02111-1307, USA. */
/* Doubles are stored in memory with the high order word first. This
matters when cross-compiling. */
#define HOST_WORDS_BIG_ENDIAN 1
/* If compiled with Sun CC, the use of alloca requires this #include. */
#ifndef __GNUC__
#include "alloca.h"
#endif
CC = cc -Wx,-X23
# The following line might be necessary as well or instead of the above.
# If you find out that it is necessary,
# or if you find out that it is not necessary,
# please inform bug-gcc@prep.ai.mit.edu.
# ALLOCA = alloca.o
# need this when using cc
ALLOCA = alloca.o
# avoid lossage assembling alloca.
ALLOCA_FLAGS=-S
ALLOCA_FINISH = $(AS) -o alloca.o alloca.s
# be sure not to confuse ./as with /bin/as
AS=`if [ x$(OLDCC) = x$(CC) ] ; then echo /bin/as; else echo $(GAS); fi`
GAS = gas
......
# Make assignments for compilation on HPUX with their C compiler.
CC=cc -Wc,-Nw2000 -Wc,-Ns2000 -Wc,-Ne700 -Wc,-Np300
OLDCC=cc -Wc,-Nw2000 -Wc,-Ns2000 -Wc,-Ne700 -Wc,-Np300
ALLOCA=alloca.o
# For CCLIBFLAGS you might want to specify the switch that
# forces only 68000 instructions to be used.
......@@ -9,7 +8,5 @@ ALLOCA=alloca.o
# Version 5 of HPUX had a compiler bug that made it crash with -g.
# You must set CFLAGS to empty on version 5.
# You must get alloca.c from GNU Emacs.
# So putenv and other functions get seen by fixproto.
FIXPROTO_DEFINES = -D_HPUX_SOURCE
# Make assignments for compilation on HPUX with their C compiler.
CC=cc -Wc,-Nw2000 -Wc,-Ns2000 -Wc,-Ne700 -Wc,-Np300
OLDCC=cc -Wc,-Nw2000 -Wc,-Ns2000 -Wc,-Ne700 -Wc,-Np300
ALLOCA=alloca.o
# For CCLIBFLAGS you might want to specify the switch that
# forces only 68000 instructions to be used.
......
ALLOCA=alloca.o
# This disables the long/short jump optimization.
# I use sysV68 R3V7.1 RM04 (phdm@info.ucl.ac.be)
# Since ss-950318, with jump optimization enabled, "as" issues a warning
......
ALLOCA=alloca.o
# This disables the long/short jump optimization.
# I use sysV68 R3V7.1 RM04 (phdm@info.ucl.ac.be)
# Since ss-950318, with jump optimization enabled, "as" issues a warning
......
......@@ -20,7 +20,3 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "m68k/xm-m68kv.h" /* Use the System V flavor of m68k host */
#if defined (__GNUC__) && __GNUC__ == 1
#define alloca __builtin_alloca
#endif
......@@ -2,9 +2,3 @@
#define USG
#include "m68k/xm-m68k.h"
/* If compiling with HPUX compiler, we are probably using alloca.c,
so help it work right. */
#ifndef __GNUC__
#define USE_C_ALLOCA
#endif
......@@ -3,7 +3,3 @@
#include "m68k/xm-m68k.h"
#define USG
#ifndef __GNUC__
#define USE_C_ALLOCA
#endif
......@@ -21,12 +21,3 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define USG 1
/* do not use alloca from -lPW with cc, because function epilogues use %sp */
#ifndef __GNUC__
#ifdef __STDC__
extern void *alloca ();
#else
extern char *alloca ();
#endif
#endif
......@@ -6,12 +6,6 @@ EXTRA_PARTS=crtbegin.o crtend.o gcc.ld
gcc.ld: $(srcdir)/config/m88k/dolphin.ld
rm -f gcc.ld; cp $(srcdir)/config/m88k/dolphin.ld gcc.ld
# Green Hills C on Dolphin UNIX System V/88 Release 3.2 Version 3.6/5.86 does
# not provide alloca. It does not harm to have it defined on version 3.8.alfa
# even though it's not needed there.
ALLOCA=alloca.o
# Under DolphinOS 3.8.alfa, /bin/cc defines __GNUC__, but not __m88k__,
# causing gdstarg.h to fail. Defining __m88k__ does probably not hurt on
# DolphinOS 3.6.
......
# this is m88k/x-sysv3
# native compiler does not provide alloca
ALLOCA = alloca.o
# end m88k/x-sysv3
......@@ -4,7 +4,3 @@
# results in a problem when <wait.h> includes <siginfo.h>.
X_CFLAGS = -DNO_BUGS -D__STDC__=0
# The CI5 compiler does not provide alloca.
ALLOCA = alloca.o
......@@ -4,9 +4,6 @@ EXTRA_PARTS=crtbegin.o crtend.o gcc.ld
gcc.ld: $(srcdir)/config/m88k/tekXD88.ld
rm -f gcc.ld; cp $(srcdir)/config/m88k/tekXD88.ld ./gcc.ld
# Green Hills C on the Tektronix XD88 does not provide alloca.
ALLOCA=alloca.o
# rc is cleaner, but the ar program sometimes crashes.
# This is a workaround.
AR_FLAGS=qc
......@@ -37,11 +37,6 @@ Boston, MA 02111-1307, USA. */
#endif
#endif
/* If not compiled with GNU C, use the C alloca */
#ifndef __GNUC__
#define USE_C_ALLOCA
#endif
/* For DG/UX, the best size is different. */
#ifdef __DGUX__
#define OBSTACK_CHUNK_SIZE (8192-16)
......
......@@ -22,8 +22,3 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define HOST_BITS_PER_SHORT 16
#define HOST_BITS_PER_INT 32
#define HOST_BITS_PER_LONG 32
/* If compiled with GNU C, use the built-in alloca. */
#ifdef __GNUC__
#define alloca __builtin_alloca
#endif
......@@ -23,9 +23,6 @@
# -lmalloc is supposed to be faster than the normal malloc
CLIB = -lmld -lmalloc
# Show we need to use the C version of ALLOCA
ALLOCA = alloca.o
# Find all of the declarations from the header files
FIXPROTO_DEFINES= -D__EXTENSIONS__ -D_SGI_SOURCE -D_LANGUAGE_C_PLUS_PLUS
......@@ -25,6 +25,3 @@
# -lmld is so we can link collect2 running native.
# -lmalloc is supposed to be faster than the normal malloc
CLIB = -lmld -lmalloc
# Show we need to use the C version of ALLOCA
ALLOCA = alloca.o
......@@ -9,8 +9,3 @@
CC = $(OLDCC)
OPT =
OLDCC = cc -Olimit 3000 $(OPT)
# Show we need to use the C version of ALLOCA
# The SVR3 configurations have it, but the SVR4 configurations don't.
# For now, just try using it for all SVR* configurations.
ALLOCA = alloca.o
......@@ -19,8 +19,3 @@ OLDCC = cc -Wf,-XNg1500,-XNh2000 -Olimit 3000 $(OPT)
# This enables collect2 to link.
# Some systems use version 2.11 of the compilers. Some use version 3.11.
CLIB= -L/usr/lib/cmplrs/cc2.11 -L/usr/lib/cmplrs/cc3.11 -lmld
# Show we need to use the C version of ALLOCA
# The SVR3 configurations have it, but the SVR4 configurations don't.
# For now, just try using it for all SVR* configurations.
ALLOCA = alloca.o
#define MIPS_OVERRIDE_ALLOCA
#ifndef __GNUC__
#include <alloca.h>
#else
# ifdef __SIZE_TYPE__
extern void *alloca (__SIZE_TYPE__);
# else
extern void *alloca ();
# endif /* __SIZE_TYPE__ */
#endif
#include "mips/xm-mips.h"
#define USG
......
......@@ -42,16 +42,3 @@ Boston, MA 02111-1307, USA. */
for compiling GNU C++. */
#define ONLY_INT_FIELDS 1
#endif
#ifndef MIPS_OVERRIDE_ALLOCA
#ifndef __GNUC__
#define USE_C_ALLOCA
#ifdef __STDC__
extern void * alloca ();
#else
extern char * alloca ();
#endif
#endif
#endif /* not MIPS_OVERRIDE_ALLOCA */
#define USG
#include "xm-mips.h"
/* If compiling with mips compiler, we are probably using alloca.c,
so help it work right. */
#ifndef __GNUC__
#define USE_C_ALLOCA
#endif
ALLOCA=alloca.o
# So putenv and other functions get seen by fixproto.
FIXPROTO_DEFINES = -D_HPUX_SOURCE -D_HIUX_SOURCE
ALLOCA=alloca.o
X_CFLAGS=-I/usr/contrib/include -DSYSV -D_POSIX_SOURCE -D_SOCKET_SOURCE -D_MPEIX_SOURCE -DPOSIX -D_MPEXL_SOURCE
CC=gcc
AR=/bin/ar
......
......@@ -39,7 +39,3 @@ Boston, MA 02111-1307, USA. */
/* HP's compiler has problems with enum bitfields. */
#define ONLY_INT_FIELDS
/* Always claim to use C alloca; this prevents losing if building with
gcc -fno-builtin ... */
#define USE_C_ALLOCA
......@@ -18,7 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* HP-UX is a flavor of System V */
#define USG
......@@ -35,7 +34,3 @@ Boston, MA 02111-1307, USA. */
/* HP's compiler has problems with enum bitfields. */
#define ONLY_INT_FIELDS
/* Always claim to use C alloca; this prevents losing if building with
gcc -fno-builtin ... */
#define USE_C_ALLOCA
......@@ -35,7 +35,3 @@ Boston, MA 02111-1307, USA. */
/* HP's compiler has problems with enum bitfields. */
#define ONLY_INT_FIELDS
/* Always claim to use C alloca; this prevents losing if building with
gcc -fno-builtin ... " */
#define USE_C_ALLOCA
......@@ -32,7 +32,3 @@ Boston, MA 02111-1307, USA. */
/* HP's compiler has problems with enum bitfields. */
#define ONLY_INT_FIELDS
/* Always claim to use C alloca; this prevents losing if building with
gcc -fno-builtin ... */
#define USE_C_ALLOCA
......@@ -27,10 +27,9 @@ Boston, MA 02111-1307, USA. */
#define HOST_WORDS_BIG_ENDIAN
/* If compiled with hc, use the built-in alloca and memcpy.
/* If compiled with hc, use the built-in memcpy.
These definitions assume hc version 2. */
#ifdef __HIGHC__
#define alloca _Alloca
#define bcopy(s,d,l) memcpy(d,s,l)
#define FUNCTION_CONVERSION_BUG
#endif
# configuration for IBM rs6000 running aix
# Show we need to use the C version of ALLOCA
ALLOCA=alloca.o
# For some reason, we need -lm for cc1.
# We need -lld for collect2 (actually this only matters
# for a native compiler, but this is as good a place as any
......
# configuration for IBM RS/6000 running AIX 4.1+
# Show we need to use the C version of ALLOCA
ALLOCA=alloca.o
# We need -lld for collect2 (actually this only matters
# for a native compiler, but this is as good a place as any
# to define the symbol).
......
# configuration for BeOS
INSTALL=install -c
# Show we need to use the C version of ALLOCA
ALLOCA=alloca.o
# Use it regardless of whether we are compiling with gcc or not.
USE_ALLOCA= `echo "${ALLOCA}"`
USE_HOST_ALLOCA= `echo ${HOST_PREFIX}${HOST_ALLOCA}`
SUBDIR_USE_ALLOCA = `if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi`
......@@ -5,9 +5,6 @@ OLDCC = /bin/gcc
# /bin/sh is too buggy, so use /bin/bash instead.
SHELL = /bin/bash
# Show we need to use the C version of ALLOCA
ALLOCA=alloca.o
# configuration for IBM rs6000 running lynx
# For some reason, we need -lm for cc1.
......
# configuration for IBM rs6000 running MACH
# Show we need to use the C version of ALLOCA
ALLOCA=alloca.o
# For some reason, we need -lm for cc1.
CLIB=-lm
# configuration for IBM rs6000 running aix
# Show we need to use the C version of ALLOCA
ALLOCA=alloca.o
# We need -lld for collect2 (actually this only matters
# for a native compiler, but this is as good a place as any
# to define the symbol).
......
X_CFLAGS=-DSVR4
ALLOCA=alloca.o
......@@ -31,10 +31,7 @@ Boston, MA 02111-1307, USA. */
#define HOST_WORDS_BIG_ENDIAN
/* Use the C alloca and use only int bitfields. */
#define USE_C_ALLOCA
extern void *alloca ();
/* Use only int bitfields. */
#define ONLY_INT_FIELDS
/* use ANSI/SYSV style byte manipulation routines instead of BSD ones */
......@@ -65,3 +62,9 @@ extern void *alloca ();
/* SYSTEM_INCLUDE_DIR is the location for system specific, non-POSIX headers. */
#define SYSTEM_INCLUDE_DIR "/boot/develop/headers/be"
/* This is a temporary hack until the wimpy default 64k stack
limit in BeOS is either increased or made user settable somehow.
This probably won't happen until after the DR9 release. */
#undef USE_C_ALLOCA
#define USE_C_ALLOCA 1
......@@ -28,14 +28,8 @@ Boston, MA 02111-1307, USA. */
#define HOST_WORDS_BIG_ENDIAN
/* If not compiled with GNU C, use the C alloca and use only int bitfields. */
/* If not compiled with GNU C, use only int bitfields. */
#ifndef __GNUC__
#define USE_C_ALLOCA
#if __STDC__
extern void *alloca ();
#else
extern char *alloca ();
#endif
#define ONLY_INT_FIELDS
#endif
......
......@@ -34,14 +34,8 @@ Boston, MA 02111-1307, USA. */
#include "xm-linux.h"
#endif
/* if not compiled with GNU C, use the C alloca and use only int bitfields. */
/* if not compiled with GNU C, use only int bitfields. */
#ifndef __GNUC__
#define USE_C_ALLOCA
#ifdef __STDC__
extern void *alloca ();
#else
extern char *alloca ();
#endif
#undef ONLY_INT_FIELDS
#define ONLY_INT_FIELDS
#endif
......@@ -23,8 +23,3 @@ Boston, MA 02111-1307, USA. */
#define HOST_BITS_PER_SHORT 16
#define HOST_BITS_PER_INT 32
#define HOST_BITS_PER_LONG 32
/* If compiled with GNU C, use the built-in alloca. */
#ifdef __GNUC__
#define alloca __builtin_alloca
#endif
X_CFLAGS=-DSVR4
ALLOCA=alloca.o
/* Configuration for GCC for SPARC running Linux-based GNU systems.
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
Contributed by Eddie C. Dost (ecd@skynet.be)
This file is part of GNU CC.
......@@ -20,7 +20,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef inhibit_libc
#include <alloca.h>
#include <stdlib.h>
#include <string.h>
#endif
......@@ -3,7 +3,3 @@
#include "sparc/xm-sparc.h"
#define USG
#ifndef __GNUC__
#define USE_C_ALLOCA
#endif
/* If not compiled with GNU C, include the system's <alloca.h> header. */
#ifndef __GNUC__
#include <alloca.h>
#endif
......@@ -29,8 +29,3 @@ Boston, MA 02111-1307, USA. */
/* Doubles are stored in memory with the high order word first. This
matters when cross-compiling. */
#define HOST_WORDS_BIG_ENDIAN 1
/* If compiled with Sun CC, the use of alloca requires this #include. */
#ifndef __GNUC__
#include "alloca.h"
#endif
......@@ -116,7 +116,6 @@ Boston, MA 02111-1307, USA. */
/* Customizations/kludges for building with DEC's VAX C compiler
rather than GCC. */
#define USE_C_ALLOCA /* using alloca.c */
#define QSORT_WORKAROUND /* do not use VAXCRTL's qsort */
/* use ANSI/SYSV style byte manipulation routines instead of BSD ones */
......@@ -172,14 +171,5 @@ Boston, MA 02111-1307, USA. */
#pragma message disable (undefescap)
#endif
#if defined(USE_C_ALLOCA) && !defined(alloca)
/* Declare alloca() using similar logic to that in alloca.c. */
#ifdef __STDC__
extern void *alloca(unsigned);
#else
extern char *alloca();
#endif
#endif
#define OBJECT_SUFFIX ".obj"
#define EXECUTABLE_SUFFIX ".exe"
# These are host overrides
# From config dir
# Interix doesn't yet have alloca; it's better to use the portable C version for
# bootstrapping. Do this by defining ALLOCA.
ALLOCA = alloca.o
# See all the declarations.
FIXPROTO_DEFINES = -D_XOPEN_SOURCE
......
# Some versions of SVR4 have an alloca in /usr/ucblib/libucb.a, and if we are
# careful to link that in after libc we can use it, but since newer versions of
# SVR4 are dropping libucb, it is better to just use the portable C version for
# bootstrapping. Do this by defining ALLOCA.
ALLOCA = alloca.o
# See all the declarations.
FIXPROTO_DEFINES = -D_XOPEN_SOURCE
/* If not compiled with GNU C, use the portable alloca. */
#ifndef __GNUC__
#define USE_C_ALLOCA
#endif
......@@ -31,11 +31,6 @@ Boston, MA 02111-1307, USA. */
#endif
#endif
/* If not compiled with GNU C, use the portable alloca. */
#ifndef __GNUC__
#define USE_C_ALLOCA 1
#endif
/* Our strategy for finding global constructors is a bit different, although
not a lot. */
#define DO_GLOBAL_CTORS_BODY \
......
......@@ -27,8 +27,3 @@ Boston, MA 02111-1307, USA. */
problems that may occur with gcc's interpretation. */
#undef POSIX
#define POSIX
/* Ensure we get gnu C's defaults. */
#ifdef __GNUC__
#define alloca __builtin_alloca
#endif
......@@ -279,11 +279,9 @@ from the machine description file `md'. */\n\n");
if (unit == 0)
{
int len = strlen (name) + 1;
unit = (struct function_unit *)
alloca (sizeof (struct function_unit));
unit->name = (char *) alloca (len);
memcpy (unit->name, name, len);
xmalloc (sizeof (struct function_unit));
unit->name = xstrdup (name);
unit->multiplicity = multiplicity;
unit->simultaneity = simultaneity;
unit->ready_cost.min = unit->ready_cost.max = ready_cost;
......
......@@ -749,7 +749,7 @@ attr_printf VPARAMS ((register int len, const char *fmt, ...))
const char *fmt;
#endif
va_list p;
register char *str;
char str[256];
VA_START (p, fmt);
......@@ -758,8 +758,9 @@ attr_printf VPARAMS ((register int len, const char *fmt, ...))
fmt = va_arg (p, const char *);
#endif
/* Print the string into a temporary location. */
str = (char *) alloca (len);
if (len > 255) /* leave room for \0 */
abort ();
vsprintf (str, fmt, p);
va_end (p);
......@@ -1983,12 +1984,12 @@ expand_units ()
/* Create an array of ops for each unit. Add an extra unit for the
result_ready_cost function that has the ops of all other units. */
unit_ops = (struct function_unit_op ***)
alloca ((num_units + 1) * sizeof (struct function_unit_op **));
xmalloc ((num_units + 1) * sizeof (struct function_unit_op **));
unit_num = (struct function_unit **)
alloca ((num_units + 1) * sizeof (struct function_unit *));
xmalloc ((num_units + 1) * sizeof (struct function_unit *));
unit_num[num_units] = unit = (struct function_unit *)
alloca (sizeof (struct function_unit));
xmalloc (sizeof (struct function_unit));
unit->num = num_units;
unit->num_opclasses = 0;
......@@ -1997,7 +1998,7 @@ expand_units ()
unit_num[num_units]->num_opclasses += unit->num_opclasses;
unit_num[unit->num] = unit;
unit_ops[unit->num] = op_array = (struct function_unit_op **)
alloca (unit->num_opclasses * sizeof (struct function_unit_op *));
xmalloc (unit->num_opclasses * sizeof (struct function_unit_op *));
for (op = unit->ops; op; op = op->next)
op_array[op->num] = op;
......@@ -2005,7 +2006,7 @@ expand_units ()
/* Compose the array of ops for the extra unit. */
unit_ops[num_units] = op_array = (struct function_unit_op **)
alloca (unit_num[num_units]->num_opclasses
xmalloc (unit_num[num_units]->num_opclasses
* sizeof (struct function_unit_op *));
for (unit = units, i = 0; unit; i += unit->num_opclasses, unit = unit->next)
......@@ -2571,9 +2572,10 @@ simplify_cond (exp, insn_code, insn_index)
rtx defval = XEXP (exp, 1);
rtx new_defval = XEXP (exp, 1);
int len = XVECLEN (exp, 0);
rtx *tests = (rtx *) alloca (len * sizeof (rtx));
rtx *tests = (rtx *) xmalloc (len * sizeof (rtx));
int allsame = 1;
char *first_spacer;
rtx ret;
/* This lets us free all storage allocated below, if appropriate. */
first_spacer = (char *) obstack_finish (rtl_obstack);
......@@ -2656,11 +2658,12 @@ simplify_cond (exp, insn_code, insn_index)
if (len == 0)
{
if (GET_CODE (defval) == COND)
return simplify_cond (defval, insn_code, insn_index);
return defval;
ret = simplify_cond (defval, insn_code, insn_index);
else
ret = defval;
}
else if (allsame)
return exp;
ret = exp;
else
{
rtx newexp = rtx_alloc (COND);
......@@ -2668,8 +2671,10 @@ simplify_cond (exp, insn_code, insn_index)
XVEC (newexp, 0) = rtvec_alloc (len);
memcpy (XVEC (newexp, 0)->elem, tests, len * sizeof (rtx));
XEXP (newexp, 1) = new_defval;
return newexp;
ret = newexp;
}
free (tests);
return ret;
}
/* Remove an insn entry from an attribute value. */
......@@ -2864,13 +2869,15 @@ evaluate_eq_attr (exp, value, insn_code, insn_index)
}
else if (GET_CODE (value) == SYMBOL_REF)
{
char *p, *string;
char *p;
char string[256];
if (GET_CODE (exp) != EQ_ATTR)
abort ();
string = (char *) alloca (2 + strlen (XSTR (exp, 0))
+ strlen (XSTR (exp, 1)));
if (strlen (XSTR (exp, 0)) + strlen (XSTR (exp, 1)) + 2 > 256)
abort ();
strcpy (string, XSTR (exp, 0));
strcat (string, "_");
strcat (string, XSTR (exp, 1));
......@@ -3513,7 +3520,7 @@ optimize_attrs ()
/* Make 2 extra elements, for "code" values -2 and -1. */
insn_code_values
= (struct attr_value_list **) alloca ((insn_code_number + 2)
= (struct attr_value_list **) xmalloc ((insn_code_number + 2)
* sizeof (struct attr_value_list *));
memset ((char *) insn_code_values, 0,
(insn_code_number + 2) * sizeof (struct attr_value_list *));
......@@ -3521,9 +3528,6 @@ optimize_attrs ()
/* Offset the table address so we can index by -2 or -1. */
insn_code_values += 2;
/* Allocate the attr_value_list structures using xmalloc rather than
alloca, because using alloca can overflow the maximum permitted
stack limit on SPARC Lynx. */
iv = ivbuf = ((struct attr_value_list *)
xmalloc (num_insn_ents * sizeof (struct attr_value_list)));
......@@ -3593,6 +3597,7 @@ optimize_attrs ()
}
free (ivbuf);
free (insn_code_values - 2);
}
#if 0
......@@ -3641,6 +3646,7 @@ simplify_by_exploding (exp)
rtx *condtest, *condval;
int i, j, total, ndim = 0;
int most_tests, num_marks, new_marks;
rtx ret;
/* Locate all the EQ_ATTR expressions. */
if (! find_and_mark_used_attributes (exp, &list, &ndim) || ndim == 0)
......@@ -3655,7 +3661,7 @@ simplify_by_exploding (exp)
cover the domain of the attribute. This makes the expanded COND form
order independent. */
space = (struct dimension *) alloca (ndim * sizeof (struct dimension));
space = (struct dimension *) xmalloc (ndim * sizeof (struct dimension));
total = 1;
for (ndim = 0; list; ndim++)
......@@ -3710,8 +3716,8 @@ simplify_by_exploding (exp)
for (i = 0; i < ndim; i++)
space[i].current_value = space[i].values;
condtest = (rtx *) alloca (total * sizeof (rtx));
condval = (rtx *) alloca (total * sizeof (rtx));
condtest = (rtx *) xmalloc (total * sizeof (rtx));
condval = (rtx *) xmalloc (total * sizeof (rtx));
/* Expand the tests and values by iterating over all values in the
attribute space. */
......@@ -3727,6 +3733,7 @@ simplify_by_exploding (exp)
/* We are now finished with the original expression. */
unmark_used_attributes (0, space, ndim);
free (space);
/* Find the most used constant value and make that the default. */
most_tests = -1;
......@@ -3753,27 +3760,32 @@ simplify_by_exploding (exp)
/* Give up if nothing is constant. */
if (num_marks == 0)
return exp;
ret = exp;
/* If all values are the default, use that. */
if (total == most_tests)
return defval;
else if (total == most_tests)
ret = defval;
/* Make a COND with the most common constant value the default. (A more
complex method where tests with the same value were combined didn't
seem to improve things.) */
condexp = rtx_alloc (COND);
XVEC (condexp, 0) = rtvec_alloc ((total - most_tests) * 2);
XEXP (condexp, 1) = defval;
for (i = j = 0; i < total; i++)
if (condval[i] != defval)
{
XVECEXP (condexp, 0, 2 * j) = condtest[i];
XVECEXP (condexp, 0, 2 * j + 1) = condval[i];
j++;
}
return condexp;
else
{
condexp = rtx_alloc (COND);
XVEC (condexp, 0) = rtvec_alloc ((total - most_tests) * 2);
XEXP (condexp, 1) = defval;
for (i = j = 0; i < total; i++)
if (condval[i] != defval)
{
XVECEXP (condexp, 0, 2 * j) = condtest[i];
XVECEXP (condexp, 0, 2 * j + 1) = condval[i];
j++;
}
ret = condexp;
}
free (condtest);
free (condval);
return ret;
}
/* Set the MEM_VOLATILE_P flag for all EQ_ATTR expressions in EXP and
......@@ -5677,7 +5689,7 @@ write_complex_function (unit, name, connection)
struct attr_desc *case_attr, *attr;
struct attr_value *av, *common_av;
rtx value;
char *str;
char str[256];
int using_case;
int i;
......@@ -5694,7 +5706,8 @@ write_complex_function (unit, name, connection)
printf (" {\n");
/* Write the `switch' statement to get the case value. */
str = (char *) alloca (strlen (unit->name) + strlen (name) + strlen (connection) + 10);
if (strlen (unit->name) + sizeof "*_cases" > 256)
abort ();
sprintf (str, "*%s_cases", unit->name);
case_attr = find_attr (str, 0);
if (! case_attr)
......@@ -6048,18 +6061,6 @@ main (argc, argv)
if (argc <= 1)
fatal ("No input file name.");
#if defined (RLIMIT_STACK) && defined (HAVE_GETRLIMIT) && defined (HAVE_SETRLIMIT)
/* Get rid of any avoidable limit on stack size. */
{
struct rlimit rlim;
/* Set the stack limit huge so that alloca does not fail. */
getrlimit (RLIMIT_STACK, &rlim);
rlim.rlim_cur = rlim.rlim_max;
setrlimit (RLIMIT_STACK, &rlim);
}
#endif
if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE)
return (FATAL_EXIT_CODE);
......
......@@ -120,7 +120,7 @@ gen_insn (insn)
else
for (i = XVECLEN (insn, 1) - 1; i >= 0; i--)
{
char *path = (char *) alloca (2);
char path[2];
path[0] = 'a' + i;
path[1] = 0;
......@@ -221,7 +221,7 @@ walk_rtx (x, path)
dupnums[dup_count] = XINT (x, 0);
dup_count++;
newpath = (char *) alloca (depth + 2);
newpath = (char *) xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
......@@ -230,13 +230,14 @@ walk_rtx (x, path)
newpath[depth] = '0' + i;
walk_rtx (XVECEXP (x, 1, i), newpath);
}
free (newpath);
return;
case MATCH_OPERATOR:
oplocs[XINT (x, 0)] = xstrdup (path);
op_count = MAX (op_count, XINT (x, 0) + 1);
newpath = (char *) alloca (depth + 2);
newpath = (char *) xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
......@@ -245,13 +246,14 @@ walk_rtx (x, path)
newpath[depth] = '0' + i;
walk_rtx (XVECEXP (x, 2, i), newpath);
}
free (newpath);
return;
case MATCH_PARALLEL:
oplocs[XINT (x, 0)] = xstrdup (path);
op_count = MAX (op_count, XINT (x, 0) + 1);
newpath = (char *) alloca (depth + 2);
newpath = (char *) xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
......@@ -260,6 +262,7 @@ walk_rtx (x, path)
newpath[depth] = 'a' + i;
walk_rtx (XVECEXP (x, 2, i), newpath);
}
free (newpath);
return;
case ADDRESS:
......@@ -270,7 +273,7 @@ walk_rtx (x, path)
break;
}
newpath = (char *) alloca (depth + 2);
newpath = (char *) xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
......@@ -293,6 +296,7 @@ walk_rtx (x, path)
}
}
}
free (newpath);
}
/* Given a PATH, representing a path down the instruction's
......
......@@ -241,13 +241,14 @@ output_prologue ()
/* We need to define all predicates used. Keep a list of those we
have defined so far. There normally aren't very many predicates
used, so a linked list should be fast enough. */
struct predicate { const char *name; struct predicate *next; };
static void
output_predicate_decls ()
{
struct predicate { const char *name; struct predicate *next; } *predicates = 0;
struct predicate *predicates = 0;
register struct operand_data *d;
struct predicate *p;
struct predicate *p, *next;
for (d = odata; d; d = d->next)
if (d->predicate && d->predicate[0])
......@@ -260,7 +261,7 @@ output_predicate_decls ()
{
printf ("extern int %s PARAMS ((rtx, enum machine_mode));\n",
d->predicate);
p = (struct predicate *) alloca (sizeof (struct predicate));
p = (struct predicate *) xmalloc (sizeof (struct predicate));
p->name = d->predicate;
p->next = predicates;
predicates = p;
......@@ -268,6 +269,11 @@ output_predicate_decls ()
}
printf ("\n\n");
for (p = predicates; p; p = next)
{
next = p->next;
free (p);
}
}
static void
......
......@@ -766,7 +766,7 @@ add_to_sequence (pattern, last, position, insn_type, top)
if (depth > max_depth)
max_depth = depth;
subpos = (char *) alloca (depth + 2);
subpos = (char *) xmalloc (depth + 2);
strcpy (subpos, position);
subpos[depth + 1] = 0;
......@@ -796,7 +796,7 @@ add_to_sequence (pattern, last, position, insn_type, top)
last, subpos, insn_type, 0);
last = &sub->success;
}
return sub;
goto ret;
}
/* Else nothing special. */
......@@ -1027,6 +1027,8 @@ add_to_sequence (pattern, last, position, insn_type, top)
if (this->tests == NULL)
abort ();
ret:
free (subpos);
return sub;
}
......
......@@ -997,7 +997,7 @@ rtx
read_rtx (infile)
FILE *infile;
{
register int i, j, list_counter;
register int i, j;
RTX_CODE tmp_code;
register const char *format_ptr;
/* tmp_char is a buffer used for reading decimal integers
......@@ -1111,40 +1111,31 @@ again:
case 'E':
{
register struct rtx_list *next_rtx, *rtx_list_link;
struct rtx_list *list_rtx = NULL;
/* Obstack to store scratch vector in. */
struct obstack vector_stack;
int list_counter = 0;
rtvec return_vec = NULL_RTVEC;
c = read_skip_spaces (infile);
if (c != '[')
fatal_expected_char (infile, '[', c);
/* add expressions to a list, while keeping a count */
next_rtx = NULL;
list_counter = 0;
obstack_init (&vector_stack);
while ((c = read_skip_spaces (infile)) && c != ']')
{
ungetc (c, infile);
list_counter++;
rtx_list_link = (struct rtx_list *)
alloca (sizeof (struct rtx_list));
rtx_list_link->value = read_rtx (infile);
if (next_rtx == 0)
list_rtx = rtx_list_link;
else
next_rtx->next = rtx_list_link;
next_rtx = rtx_list_link;
rtx_list_link->next = 0;
obstack_ptr_grow (&vector_stack, (PTR) read_rtx (infile));
}
/* get vector length and allocate it */
XVEC (return_rtx, i) = (list_counter
? rtvec_alloc (list_counter) : NULL_RTVEC);
if (list_counter > 0)
{
next_rtx = list_rtx;
for (j = 0; j < list_counter; j++,
next_rtx = next_rtx->next)
XVECEXP (return_rtx, i, j) = next_rtx->value;
return_vec = rtvec_alloc (list_counter);
memcpy (&return_vec->elem[0], obstack_finish (&vector_stack),
list_counter * sizeof (rtx));
}
XVEC (return_rtx, i) = return_vec;
obstack_free (&vector_stack, NULL);
/* close bracket gotten */
}
break;
......
......@@ -112,11 +112,6 @@ extern int errno;
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
# ifdef USE_C_ALLOCA
/* Note that systems that use glibc have a <stdlib.h> that includes
<alloca.h> that defines alloca, so let USE_C_ALLOCA override this. */
# undef alloca
#endif
#endif
/* If we don't have an overriding definition, set SUCCESS_EXIT_CODE and
......@@ -552,11 +547,6 @@ extern void abort PARAMS ((void));
#define UNION_INIT_ZERO
#endif
/* GCC now gives implicit declaration warnings for undeclared builtins. */
#if defined(__GNUC__) && defined (__SIZE_TYPE__)
extern void *alloca (__SIZE_TYPE__);
#endif
/* Various error reporting routines want to use __FUNCTION__. */
#if (GCC_VERSION < 2007)
#ifndef __FUNCTION__
......
......@@ -206,6 +206,20 @@ extern int vasprintf PARAMS ((char **, const char *, va_list))
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
/* Drastically simplified alloca configurator. If we're using GCC,
we use __builtin_alloca; otherwise we use the C alloca. The C
alloca is always available. You can override GCC by defining
USE_C_ALLOCA yourself. */
extern PTR C_alloca PARAMS((size_t));
#undef alloca
#if GCC_VERSION >= 2000 && !defined USE_C_ALLOCA
# define alloca(x) __builtin_alloca(x)
#else
# define alloca(x) C_alloca(x)
# undef USE_C_ALLOCA
# define USE_C_ALLOCA 1
#endif
#ifdef __cplusplus
}
#endif
......
......@@ -64,7 +64,6 @@ MAKEOVERRIDES =
TARGETLIB = libiberty.a
LIBOBJS = @LIBOBJS@
ALLOCA = @ALLOCA@
# A configuration can specify extra .o files that should be included,
# even if they are in libc. (Perhaps the libc version is buggy.)
......@@ -118,9 +117,6 @@ install-info: install-info-subdir
clean-info: clean-info-subdir
dvi: dvi-subdir
# Include files that are in this directory.
HFILES = alloca-conf.h
# NOTE: If you add new files to the library, add them to this list
# (alphabetical), and add them to REQUIRED_OFILES or funcs in
# configure.in.
......@@ -138,17 +134,17 @@ CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \
xmalloc.c xmemdup.c xstrdup.c xstrerror.c
# These are always included in the library.
REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o cp-demangle.o \
dyn-string.o fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o \
getruntime.o hashtab.o hex.o floatformat.o md5.o objalloc.o obstack.o \
partition.o pexecute.o safe-ctype.o sort.o spaces.o splay-tree.o \
strerror.o strsignal.o xatexit.o xexit.o xmalloc.o xmemdup.o \
xstrdup.o xstrerror.o
$(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA)
REQUIRED_OFILES = argv.o alloca.o choose-temp.o concat.o cplus-dem.o \
cp-demangle.o dyn-string.o fdmatch.o fnmatch.o getopt.o getopt1.o \
getpwd.o getruntime.o hashtab.o hex.o floatformat.o md5.o objalloc.o \
obstack.o partition.o pexecute.o safe-ctype.o sort.o spaces.o \
splay-tree.o strerror.o strsignal.o xatexit.o xexit.o xmalloc.o \
xmemdup.o xstrdup.o xstrerror.o
$(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
-rm -f $(TARGETLIB)
$(AR) $(AR_FLAGS) $(TARGETLIB) \
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA)
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
$(RANLIB) $(TARGETLIB)
INSTALL_DEST = @INSTALL_DEST@
......@@ -197,8 +193,8 @@ stamp-picdir:
etags tags: TAGS etags-subdir
TAGS: $(CFILES) $(HFILES)
etags `for i in $(HFILES) $(CFILES); do echo $(srcdir)/$$i ; done`
TAGS: $(CFILES)
etags `for i in $(CFILES); do echo $(srcdir)/$$i ; done`
# The standalone demangler (c++filt) has been moved to binutils.
demangle:
......@@ -207,7 +203,7 @@ demangle:
@false
ls:
@echo Makefile $(HFILES) $(CFILES)
@echo Makefile $(CFILES)
# Need to deal with profiled libraries, too.
......@@ -243,7 +239,6 @@ stamp-h: config.in config.status
config.status: $(srcdir)/configure $(srcdir)/config.table
$(SHELL) ./config.status --recheck
all-subdir check-subdir installcheck-subdir info-subdir \
install-info-subdir clean-info-subdir dvi-subdir install-subdir \
etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \
......@@ -254,11 +249,11 @@ maintainer-clean-subdir:
cd $$dir && $(MAKE) $$target; \
done
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA): stamp-picdir
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS): stamp-picdir
alloca.o: config.h
alloca.o: config.h $(INCDIR)/libiberty.h
atexit.o: config.h
argv.o: config.h alloca-conf.h $(INCDIR)/libiberty.h
argv.o: config.h $(INCDIR)/libiberty.h
basename.o: $(INCDIR)/libiberty.h
choose-temp.o: config.h
clock.o: config.h
......
......@@ -134,3 +134,55 @@ define(AC_DEFINE_NOAUTOHEADER,
[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
EOF
])
# We always want a C version of alloca() compiled into libiberty,
# because native-compiler support for the real alloca is so !@#$%
# unreliable that GCC has decided to use it only when being compiled
# by GCC. This is the part of AC_FUNC_ALLOCA that calculates the
# information alloca.c needs.
AC_DEFUN(libiberty_AC_FUNC_C_ALLOCA,
[AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray,
[AC_EGREP_CPP(webecray,
[#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif
], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
AC_CHECK_FUNC($ac_func,
[AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
[Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP
systems. This function is required for alloca.c support on those
systems.]) break])
done
fi
AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
[AC_TRY_RUN([find_stack_direction ()
{
static char *addr = 0;
auto char dummy;
if (addr == 0)
{
addr = &dummy;
return find_stack_direction ();
}
else
return (&dummy > addr) ? 1 : -1;
}
main ()
{
exit (find_stack_direction() < 0);
}],
ac_cv_c_stack_direction=1,
ac_cv_c_stack_direction=-1,
ac_cv_c_stack_direction=0)])
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction,
[Define if you know the direction of stack growth for your system;
otherwise it will be automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown])
])
#include "config.h"
#if defined(__GNUC__) && !defined(C_ALLOCA)
# ifndef alloca
# define alloca __builtin_alloca
# endif
#else /* ! defined (__GNUC__) */
# ifdef _AIX
#pragma alloca
# else
# if defined(HAVE_ALLOCA_H) && !defined(C_ALLOCA)
# include <alloca.h>
# else /* ! defined (HAVE_ALLOCA_H) */
# ifdef __STDC__
extern PTR alloca (size_t);
# else /* ! defined (__STDC__) */
extern PTR alloca ();
# endif /* ! defined (__STDC__) */
# endif /* ! defined (HAVE_ALLOCA_H) */
# ifdef _WIN32
# include <malloc.h>
# endif
# endif /* ! defined (_AIX) */
#endif /* ! defined (__GNUC__) */
......@@ -25,6 +25,8 @@
#include <config.h>
#endif
#include <libiberty.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
......@@ -32,67 +34,20 @@
#include <stdlib.h>
#endif
#ifdef emacs
#include "blockinput.h"
#endif
/* If compiling with GCC 2, this file's not needed. Except of course if
the C alloca is explicitly requested. */
#if defined (USE_C_ALLOCA) || !defined (__GNUC__) || __GNUC__ < 2
/* If someone has defined alloca as a macro,
there must be some other way alloca is supposed to work. */
#ifndef alloca
#ifdef emacs
#ifdef static
/* actually, only want this if static is defined as ""
-- this is for usg, in which emacs must undefine static
in order to make unexec workable
*/
#ifndef STACK_DIRECTION
you
lose
-- must know STACK_DIRECTION at compile-time
#endif /* STACK_DIRECTION undefined */
#endif /* static */
#endif /* emacs */
/* If your stack is a linked list of frames, you have to
provide an "address metric" ADDRESS_FUNCTION macro. */
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
long i00afunc ();
static long i00afunc ();
#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
#else
#define ADDRESS_FUNCTION(arg) &(arg)
#endif
#if __STDC__
typedef void *pointer;
#else
typedef char *pointer;
#endif
#ifndef NULL
#define NULL 0
#endif
/* Different portions of Emacs need to call different versions of
malloc. The Emacs executable needs alloca to call xmalloc, because
ordinary malloc isn't protected from input signals. On the other
hand, the utilities in lib-src need alloca to call malloc; some of
them are very simple, and don't have an xmalloc routine.
Non-Emacs programs expect this to call use xmalloc.
Callers below should use malloc. */
#ifndef emacs
#define malloc xmalloc
#endif
extern pointer malloc ();
/* Define STACK_DIRECTION if you know the direction of stack
growth for your system; otherwise it will be automatically
deduced at run-time.
......@@ -168,9 +123,9 @@ static header *last_alloca_header = NULL; /* -> last alloca header. */
caller, but that method cannot be made to work for some
implementations of C, for example under Gould's UTX/32. */
pointer
alloca (size)
unsigned size;
PTR
C_alloca (size)
size_t size;
{
auto char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
......@@ -186,17 +141,13 @@ alloca (size)
{
register header *hp; /* Traverses linked list. */
#ifdef emacs
BLOCK_INPUT;
#endif
for (hp = last_alloca_header; hp != NULL;)
if ((STACK_DIR > 0 && hp->h.deep > depth)
|| (STACK_DIR < 0 && hp->h.deep < depth))
{
register header *np = hp->h.next;
free ((pointer) hp); /* Collect garbage. */
free ((PTR) hp); /* Collect garbage. */
hp = np; /* -> next header. */
}
......@@ -204,10 +155,6 @@ alloca (size)
break; /* Rest are not deeper. */
last_alloca_header = hp; /* -> last valid storage. */
#ifdef emacs
UNBLOCK_INPUT;
#endif
}
if (size == 0)
......@@ -216,7 +163,7 @@ alloca (size)
/* Allocate combined header + user data storage. */
{
register pointer new = malloc (sizeof (header) + size);
register PTR new = xmalloc (sizeof (header) + size);
/* Address of header. */
if (new == 0)
......@@ -229,7 +176,7 @@ alloca (size)
/* User storage begins just after header. */
return (pointer) ((char *) new + sizeof (header));
return (PTR) ((char *) new + sizeof (header));
}
}
......@@ -500,6 +447,3 @@ i00afunc (long address)
#endif /* not CRAY2 */
#endif /* CRAY */
#endif /* no alloca */
#endif /* not GCC version 2 */
......@@ -48,7 +48,6 @@ extern char *strdup (); /* Duplicate a string */
#endif /* __STDC__ */
#include "alloca-conf.h"
#ifndef NULL
#define NULL 0
......
/* config.in. Generated automatically from configure.in by autoheader. */
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Define to empty if the keyword does not work. */
#undef const
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END
/* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
......@@ -34,15 +21,6 @@
/* Define if you need to in order for stat and other things to work. */
#undef _POSIX_SOURCE
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
......@@ -250,3 +228,15 @@
/* Define if you have the sys_siglist variable. */
#undef HAVE_SYS_SIGLIST
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP
systems. This function is required for alloca.c support on those
systems. */
#undef CRAY_STACKSEG_END
/* Define if you know the direction of stack growth for your system;
otherwise it will be automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
......@@ -6,7 +6,6 @@ case "${host}" in
*-*-freebsd2.2.[012]) frag=mh-fbsd21 ;;
i370-*-opened*) frag=mh-openedition ;;
i[345]86-*-windows*) frag=mh-windows ;;
*-*-beos*) frag=mh-beos ;;
esac
frags=$frag
......
# Host makefile fragment for BeOS
# This is a temporary hack until the wimpy default 64k stack
# limit in BeOS is either increased or made user settable somehow.
# This probably won't happen until after the DR9 release.
EXTRA_OFILES = alloca.o
......@@ -142,8 +142,7 @@ fi
# For each of these functions, if the host does not provide the
# function we want to put FN.o in LIBOBJS, and if the host does
# provide the function, we want to define HAVE_FN in config.h. Also,
# if the host does not provide alloca, we set ALLOCA to alloca.o
# provide the function, we want to define HAVE_FN in config.h.
setobjs=
CHECK=
......@@ -158,7 +157,6 @@ if test -n "${with_target_subdir}"; then
# newlib provide and which ones we will be expected to provide.
if test "x${with_newlib}" = "xyes"; then
ALLOCA="alloca.o"
LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
for f in $funcs; do
......@@ -277,28 +275,7 @@ if test -z "${setobjs}"; then
# tests. This will only work if the compiler works.
AC_PROG_CC_WORKS
AC_REPLACE_FUNCS($funcs)
case "${host}" in
*-*-interix)
# On Interix, it wrongly concludes that the MSVC compiler supports alloca.
# (MSVC does on Win32, not on Interix.)
# This should be temporary.
ac_cv_header_alloca_h=no
ac_cv_func_alloca_works=no
ALLOCA=alloca.o
cat >> confdefs.h <<\EOF
#define C_ALLOCA 1
EOF
cat >> confdefs.h <<EOF
#define STACK_DIRECTION -1
EOF
;;
*)
AC_FUNC_ALLOCA
;;
esac
libiberty_AC_FUNC_C_ALLOCA
AC_FUNC_VFORK
if test $ac_cv_func_vfork_works = no; then
LIBOBJS="$LIBOBJS vfork.o"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment