commit 6483618f4627dc4211fb6bedc9baa06d3902c436 Author: Dave Murphy Date: Thu Jan 27 19:55:22 2005 +0000 Initial Import diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000..fffdae9 --- /dev/null +++ b/.cvsignore @@ -0,0 +1,4 @@ +powerpc-gekko +libogc-20050121 +gcc-3.4.3 +binutils-2.15 \ No newline at end of file diff --git a/README.TXT b/README.TXT new file mode 100644 index 0000000..bc26f86 --- /dev/null +++ b/README.TXT @@ -0,0 +1,184 @@ +Devkit r11 build scripts +-------------------------- + +This readme will guide you through building devkitARM or devkitPPC from source using a set of scripts. + +To use these scripts under minsys and MinGW you will need some additional packages over and above the base install. + +The minsys developer toolkit + +http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe?download + +Bison, Flex and Wget from the gnuwin32 project + +http://sourceforge.net/projects/gnuwin32/ + +Downloading the source packages +------------------------------- + +When you run the build script it will ask you to choose from one of two options, one for if you have already downloaded the source packages and another for if you want it to download them for you (using wget). If you choose option one and want to get the source packages for yourself then you can find them at the urls listed below; + +binutils 2.15 - http://ftp.gnu.org/gnu/binutils/binutils-2.15.tar.bz2 +gcc-core 3.4.2 - ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-3.4.3/gcc-core-3.4.2.tar.bz2 +gcc-g++ 3.4.2 - ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-3.4.3/gcc-g++-3.4.2.tar.bz2 +newlib 1.12.0 - ftp://sources.redhat.com/pub/newlib/newlib-1.12.0.tar.gz + +The top level shell script has now been unified and offers the option of devkitARM or devkitPPC. + +Building devkitARM +------------------ + +Simply run the "build-devkit.sh" script in the same directory as this text file as shown below, then follow the prompts; + +./build-devkit.sh + +Once the script finds the source packages they will be decompressed and the build process will begin. When its finished you have the option to delete all temporary files, sources and their source packages. + + +Using devkitARM +--------------- + +All you need to do now to use devkitARM is make sure that your freshly built tools are in your PATH, something like this; + +export PATH=$PATH:/bin + +(Obviously replace with the full path to the devkitARM installation directory) + +to use the built in crt0 and linkscript use arm-elf-gcc to link your project - use the command -specs=gba.specs for a normal cart image & -specs=gba_mb.specs for a multiboot image. + +Getting started +--------------- + +The best thing to do next is test the compiler, so go to http://www.devkit.tk and download "libgba" from the downloads section and also "PCXview" from the sample code section. + + +Building devkitPPC +------------------ + +Simply run the "build-devkit.sh" script in the same directory as this text file as shown below, then follow the prompts; + +./build-devkit.sh + +Once the script finds the source packages they will be decompressed and the build process will begin. When its finished you have the option to delete all temporary files, sources and their source packages. + + +Using devkitPPC +--------------- + +All you need to do now to use devkitPPC is make sure that your freshly built tools are in your PATH, something like this; + +export PATH=$PATH:/bin + +(Obviously replace with the full path to the devkitPPC installation directory) + +to use the built in crt0 and linkscript use powerpc-elf-gcc to link your project, using the command line switch -mgcn for a bare bones system, -mogc to use libogc and the multi-threaded microkernel. + + + +Credits +------- + +* Thanks to WinterMute for bringing us devkitARM, the website is http://www.devkit.tk +* Build scripts written by WinterMute and tied together by GreenGianT +* Thanks to Mr Spiv, Honkey Kong and JoostP for OS X testing +* libogc written and supplied by Shagkur. Additional code by WinterMute +* libgba by WinterMute +* b2fxec by Mr Spiv +* scripts made BSD compatible by o2addict + + - efnet #gbadev forever! + +History +------------------------------------------------------------------------------------- +planned for release 12 +------------------------------------------------------------------------------------- + * update to newlib 1.13.0 + * patch for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9571 + * fix iwram overlay section alignment for GBA + +------------------------------------------------------------------------------------- +21st January 2005 - release 11 +------------------------------------------------------------------------------------- + + * updated to gcc 3.4.3 + * reverted msvc format errors for compatibility with dev-cpp & vham editors + * patched for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16343 + +------------------------------------------------------------------------------------- +28th July 2004 - release 8 +------------------------------------------------------------------------------------- + + * updated to gcc 3.4.1 + * win32 native b2fxec added & cygwin1.dll removed + +------------------------------------------------------------------------------------- +26th June 2004 - devkitPPC release 7 +------------------------------------------------------------------------------------- + + * libogc added to devkitPPC + * updated specs file with -mogc switch for linking + +------------------------------------------------------------------------------------- +12th June 2004 - release 6a +------------------------------------------------------------------------------------- + + * long calls patch added + * -save-temps fixed (again) + * binutils 2.15.0 + * specs file and crt0 for e-reader + * specs file and crt0 for gamepark gp32 libraries + +------------------------------------------------------------------------------------- +8th May 2004 - release 6 +------------------------------------------------------------------------------------- + + * updated to gcc 3.4.0 + * reverted to binutils 2.14.0 + +------------------------------------------------------------------------------------- +12th April 2004 - release 5. +------------------------------------------------------------------------------------- + + * built in crt0 and linkscript for gp32 added. Use -specs=gp32.specs when linking + * Mr Spiv's b2fxec included + * DarkFader's gbafix included + * linux build available for download + +------------------------------------------------------------------------------------- +15th March 2004 - Release 4 +------------------------------------------------------------------------------------- + + * updated to binutils 2.15.90 + * more msdev error output conversion + * -save-temps fixed + +------------------------------------------------------------------------------------- +26th February 2004 - Release 3a +------------------------------------------------------------------------------------- + + * updated to newlib 1.12.0 + * crt0, linkscript and runtime library support added to DevkitARM + +------------------------------------------------------------------------------------- +20th February 2004 +------------------------------------------------------------------------------------- + +DevkitARM and DevkitPPC updated - Release 3 + + * updated to gcc 3.3.3 + +------------------------------------------------------------------------------------- +14th February 2004 - Release 2 +------------------------------------------------------------------------------------- + + * crt0, linkscript and runtime library support added to DevkitPPC + * adjusted error output for msdev + * Fixed minor problem with include paths + +------------------------------------------------------------------------------------- +16th January 2004 - release 1 +------------------------------------------------------------------------------------- + + * Initial build supporting arm target + * Required link script and crt0 + * no built in support for runtime libraries diff --git a/build-devkit.sh b/build-devkit.sh new file mode 100644 index 0000000..a1acc6e --- /dev/null +++ b/build-devkit.sh @@ -0,0 +1,316 @@ +#--------------------------------------------------------------------------------- +# Build scripts for devkitARM/devkitPPC release 11 +#--------------------------------------------------------------------------------- + + +#--------------------------------------------------------------------------------- +# specify some urls to download the source packages from +#--------------------------------------------------------------------------------- + +BINUTILS_VER=2.15 +GCC_VER=3.4.3 +NEWLIB_VER=1.12.0 +LIBOGC_VER=20050121 + +BINUTILS="binutils-$BINUTILS_VER.tar.bz2" +GCC_CORE="gcc-core-$GCC_VER.tar.bz2" +GCC_GPP="gcc-g++-$GCC_VER.tar.bz2" +NEWLIB="newlib-$NEWLIB_VER.tar.gz" +LIBOGC="libogc-src-$LIBOGC_VER.tar.bz2" + +BINUTILS_URL="http://ftp.gnu.org/gnu/binutils/$BINUTILS" +GCC_CORE_URL="ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-$GCC_VER/$GCC_CORE" +GCC_GPP_URL="ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-$GCC_VER/$GCC_GPP" +LIBOGC_URL="http://osdn.dl.sourceforge.net/sourceforge/devkitpro/$LIBOGC" + +#--------------------------------------------------------------------------------- +# Ask whether to download the source packages or not +#--------------------------------------------------------------------------------- + +VERSION=0 + +while [ $VERSION -eq 0 ] +do + echo + echo "This script will build and install your devkit. Please select the one you require" + echo + echo "1: build devkitARM (gba gp32)" + echo "2: build devkitPPC (gamecube)" + read VERSION + + if [ "$VERSION" -ne 1 -a "$VERSION" -ne 2 ] + then + VERSION=0 + fi +done + +if [ $VERSION -eq 1 ] +then + scriptdir='./dka-scripts' + package='devkitARM' + builddir=arm-elf + target=arm-elf +else + scriptdir='./dkp-scripts' + package='devkitPPC' + builddir=powerpc-gekko + target=powerpc-gekko +fi + +DOWNLOAD=0 + +while [ $DOWNLOAD -eq 0 ] +do + echo + echo "The installation requires binutils-$BINUTILS_VER, gcc$GCC_VER and newlib-$NEWLIB_VER. Please select an option:" + echo + echo "1: I have already downloaded the source packages" + echo "2: Download the packages for me (requires wget)" + read DOWNLOAD + + if [ "$DOWNLOAD" -ne 1 -a "$DOWNLOAD" -ne 2 ] + then + DOWNLOAD=0 + fi +done + + +#--------------------------------------------------------------------------------- +# Get preferred installation directory and set paths to the sources +#--------------------------------------------------------------------------------- +echo +echo "Please enter the directory where you would like '$package' to be installed:" +echo "for mingw/msys you must use :/ or you will have include path problems" +read INSTALLDIR +echo + +[ ! -z "$INSTALLDIR" ] && mkdir -p $INSTALLDIR && touch $INSTALLDIR/nonexistantfile && rm $INSTALLDIR/nonexistantfile || exit 1 + +if [ $DOWNLOAD -eq 1 ] +then + FOUND=0 + while [ $FOUND -eq 0 ] + do + echo + echo "Please enter the full path to the directory that contains the source packages:" + read SRCDIR + + if [ ! -f $SRCDIR/$BINUTILS ] + then + echo "Error: $BINUTILS not found in $SRCDIR" + exit + else + FOUND=1 + fi + + if [ ! -f $SRCDIR/$GCC_GPP ] + then + echo "Error: $GCC_GPP not found in $SRCDIR" + exit + else + FOUND=1 + fi + + if [ ! -f $SRCDIR/$GCC_CORE ] + then + echo "Error: $GCC_CORE not found in $SRCDIR" + exit + else + FOUND=1 + fi + + if [ ! -f $SRCDIR/$NEWLIB ] + then + echo "Error: $NEWLIB not found in $SRCDIR" + exit + else + FOUND=1 + fi + + if [ $VERSION -eq 2 ] + then + if [ ! -f $SRCDIR/$LIBOGC ] + then + echo "Error: $LIBOGC not found in $SRCDIR" + exit + else + FOUND=1 + fi + + fi + + done + +else + + wget -c $BINUTILS_URL + if [ ! -f $BINUTILS ] + then + echo "Error: Failed to download "$BINUTILS + exit + fi + + wget -c $GCC_CORE_URL + if [ ! -f $GCC_CORE ] + then + echo "Error: Failed to download "$GCC_CORE + exit + fi + + wget -c $GCC_GPP_URL + if [ ! -f $GCC_GPP ] + then + echo "Error: Failed to download "$GCC_GPP + exit + fi + + wget -c $NEWLIB_URL + if [ ! -f $NEWLIB ] + then + echo "Error: Failed to download "$NEWLIB + exit + fi + + if [ $VERSION -eq 2 ] + then + wget -c $LIBOGC_URL + if [ ! -f $LIBOGC ] + then + echo "Error: Failed to download "$LIBOGC + exit + fi + fi + + SRCDIR=`pwd` +fi + +BINUTILS_SRCDIR="binutils-$BINUTILS_VER/" +GCC_SRCDIR="gcc-$GCC_VER/" +NEWLIB_SRCDIR="newlib-$NEWLIB_VER/" +LIBOGC_SRCDIR="libogc-$LIBOGC_VER/" + +echo +echo 'Ready to install '$package' in '$INSTALLDIR +echo +echo 'press return to continue' + +read dummy + + + +#--------------------------------------------------------------------------------- +# find proper make +#--------------------------------------------------------------------------------- + +if [ -z "$MAKE" -a -x "$(which gnumake)" ]; then MAKE=$(which gnumake); fi +if [ -z "$MAKE" -a -x "$(which gmake)" ]; then MAKE=$(which gmake); fi +if [ -z "$MAKE" -a -x "$(which make)" ]; then MAKE=$(which make); fi +if [ -z "$MAKE" ]; then + echo no make found + exit 1 +fi +echo use $MAKE as make +export MAKE + + +#--------------------------------------------------------------------------------- +# Extract source packages +#--------------------------------------------------------------------------------- + +BUILDSCRIPTDIR=$(pwd) + +echo "Extracting $BINUTILS" +tar -xjvf $SRCDIR/$BINUTILS + +echo "Extracting $GCC_CORE" +tar -xjvf $SRCDIR/$GCC_CORE + +echo "Extracting $GCC_GPP" +tar -xjvf $SRCDIR/$GCC_GPP + +echo "Extracting $NEWLIB" +tar -xzvf $SRCDIR/$NEWLIB + +if [ $VERSION -eq 2 ] +then + echo "Extracting $LIBOGC" + mkdir -p $LIBOGC_SRCDIR + bzip2 -cd $SRCDIR/$LIBOGC | tar -xv -C $LIBOGC_SRCDIR +fi + +#--------------------------------------------------------------------------------- +# apply patches +#--------------------------------------------------------------------------------- +patch -p1 -d $BINUTILS_SRCDIR -i $(pwd)/patches/devkit-binutils-2.15.patch +patch -p1 -d $GCC_SRCDIR -i $(pwd)/patches/devkit-gcc-3.4.3.patch +patch -p1 -d $NEWLIB_SRCDIR -i $(pwd)/patches/devkit-newlib-1.12.0.patch + + +#--------------------------------------------------------------------------------- +# only necessary when Darwin gcc is 3.1 or earlier, to add a check for this here +#--------------------------------------------------------------------------------- +#if test $(uname -s | grep Darwin) +#then +# export CFLAGS = "-O2 -pipe -no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0" +# export LDFLAGS='' +# +#else + + export CFLAGS='-O2 -pipe' + export LDFLAGS='-s' + +#fi + +export CXXFLAGS='-O2 -pipe' +export DEBUG_FLAGS='' + +#--------------------------------------------------------------------------------- +# Add installed devkit to the path, adjusting path on minsys +#--------------------------------------------------------------------------------- +TOOLPATH=$(echo $INSTALLDIR | sed -e 's/^\([a-zA-Z]\):/\/\1/') +export PATH=$PATH:$TOOLPATH/bin + +#--------------------------------------------------------------------------------- +# Build and install devkit components +#--------------------------------------------------------------------------------- +if [ -f $scriptdir/build-gcc.sh ]; then . $scriptdir/build-gcc.sh ; cd $BUILDSCRIPTDIR; fi +if [ -f $scriptdir/build-crtls.sh ]; then . $scriptdir/build-crtls.sh ; cd $BUILDSCRIPTDIR; fi +if [ -f $scriptdir/build-tools.sh ]; then . $scriptdir/build-tools.sh ; cd $BUILDSCRIPTDIR; fi + +#--------------------------------------------------------------------------------- +# Clean up temporary files and source directories +#--------------------------------------------------------------------------------- + +echo +echo "Would you like to delete temporary files? [Y/n]" +read answer + +if [ -z "$answer" -o "$answer" = "y" -o "$answer" = "Y" ] +then + echo "rm -fr "$builddir + rm -fr $builddir +fi + +echo +echo "Would you like to delete the source directories? [Y/n]" +read answer + +if [ -z "$answer" -o "$answer" = "y" -o "$answer" = "Y" ] +then + echo "rm -fr $BINUTILS_SRCDIR $GCC_SRCDIR $NEWLIB_SRCDIR $LIBOGC_SRCDIR" + rm -fr $BINUTILS_SRCDIR $GCC_SRCDIR $NEWLIB_SRCDIR $LIBOGC_SRCDIR +fi + +echo +echo "Would you like to delete the source packages? [y/N]" +read answer + +if [ ! -z "$answer" -o "$answer" = "y" -o "$answer" = "Y" ] +then + echo "rm -f $BINUTILS $GCC_CORE $GCC_GPP $NEWLIB" + rm -f $SRCDIR/$BINUTILS $SRCDIR/$GCC_CORE $SRCDIR/$GCC_GPP $SRCDIR/$NEWLIB +fi + +echo +echo "note: Add the following to your PATH variable; $INSTALLDIR/bin" +echo diff --git a/dka-crtls/Makefile b/dka-crtls/Makefile new file mode 100644 index 0000000..61e9a7e --- /dev/null +++ b/dka-crtls/Makefile @@ -0,0 +1,11 @@ +PREFIX := arm-elf- +export CC := $(PREFIX)gcc +export CXX := $(PREFIX)g++ +export AR := $(PREFIX)ar +export OBJCOPY := $(PREFIX)objcopy + +all: + $(CC) -marm -c $(CRT).s -o$(CRT).o + $(CC) -marm -mthumb-interwork -c $(CRT).s -o interwork/$(CRT).o + $(CC) -mthumb -c $(CRT).s -o thumb/$(CRT).o + $(CC) -mthumb -mthumb-interwork -c $(CRT).s -o thumb/interwork/$(CRT).o diff --git a/dka-crtls/er_crt0.s b/dka-crtls/er_crt0.s new file mode 100644 index 0000000..801ffa3 --- /dev/null +++ b/dka-crtls/er_crt0.s @@ -0,0 +1,56 @@ +@--------------------------------------------------------------------------------- +@ nintendo e-reader startup code +@--------------------------------------------------------------------------------- +@ author : tim schuerewegen +@ version : 1.0 +@--------------------------------------------------------------------------------- + .section ".init" + .global _start + .align + .arm +@--------------------------------------------------------------------------------- +_start: +@--------------------------------------------------------------------------------- + b start_vector + .long 0 + .long 0x02000000 + +start_vector: + @ enter thumb mode + adr r0, _start_thumb + 1 + bx r0 + + .thumb + +_start_thumb: + + @ save return address (rom) + mov r3, lr + + @ clear bss section + ldr r0, =__bss_start + ldr r1, =__bss_end + mov r2, #0 +_loop_bss_clear: + strb r2, [r0] + add r0, #1 + cmp r0, r1 + blt _loop_bss_clear + + @ set return address (rom) + mov lr, r3 + + @ jump to main + ldr r3, =main + bx r3 + + .align + + .pool + + .end + + .align + .pool + .end + diff --git a/dka-crtls/gba.specs b/dka-crtls/gba.specs new file mode 100644 index 0000000..8d99583 --- /dev/null +++ b/dka-crtls/gba.specs @@ -0,0 +1,8 @@ +%rename link old_link + +*link: +%(old_link) -T gba_cart.ld%s + +*startfile: +gba_crt0%O%s crti%O%s crtbegin%O%s + diff --git a/dka-crtls/gba_cart.ld b/dka-crtls/gba_cart.ld new file mode 100644 index 0000000..cca2590 --- /dev/null +++ b/dka-crtls/gba_cart.ld @@ -0,0 +1,293 @@ +/* Linker Script Original v1.3 by Jeff Frohwein */ +/* v1.0 - Original release */ +/* v1.1 - Added proper .data section support */ +/* v1.2 - Added support for c++ & iwram overlays */ +/* - Major contributions by Jason Wilkins. */ +/* v1.3 - .ewram section now can be used when */ +/* compiling for MULTIBOOT mode. This fixes */ +/* malloc() in DevKitAdvance which depends */ +/* on __eheap_start instead of end to define*/ +/* the starting location of heap space. */ +/* External global variable __gba_iwram_heap*/ +/* support added to allow labels end, _end, */ +/* & __end__ to point to end of iwram or */ +/* the end of ewram. */ +/* Additions by WinterMute */ +/* v1.4 - .sbss section added for unitialised */ +/* data in ewram */ +/* v1.5 - padding section added to stop EZF */ +/* stripping important data */ + +/* This file is released into the public domain */ +/* for commercial or non-commercial use with no */ +/* restrictions placed upon it. */ + +/* NOTE!!!: This linker script defines the RAM & */ +/* ROM start addresses. In order for it to work */ +/* properly, remove -Ttext and -Tbss linker */ +/* options from your makefile if they are */ +/* present. */ + +/* You can use the following to view section */ +/* addresses in your .elf file: */ +/* objdump -h file.elf */ +/* Please note that empty sections may incorrectly*/ +/* list the lma address as the vma address for */ +/* some versions of objdump. */ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) +/* SEARCH_DIR(/bin/arm); */ + +/* By default this linker script will generate code */ +/* for flash carts located at 0x8000000. */ + +/* The linker script function "var1 += var2;" sometimes */ +/* reports incorrect values in the *.map file but the */ +/* actual value it calculates is usually, if not always, */ +/* correct. If you leave out the ". = ALIGN(4);" at the */ +/* end of each section then the return value of SIZEOF() */ +/* is sometimes incorrect and "var1 += var2;" appears to */ +/* not work as well. "var1 += var2" style functions are */ +/* avoided below as a result. */ + +/* The linker script MEMORY directive is not used here due */ +/* to the fact that __text_start is not always a fixed value. */ + +__text_start = 0x8000000; +__eheap_end = 0x2040000; +__iwram_start = 0x3000000; +__iheap_end = 0x3008000 - 0x400; +__sp_usr = 0x3008000 - 0x100; +__sp_irq = 0x3008000 - 0x60; +__intr_vector_buf = 0x3008000 - 4; +__sp_usr_offset = __sp_usr - __iwram_start; +__intr_vect_offset = __intr_vector_buf - __sp_usr; +SECTIONS +{ + . = __text_start; + .init : + { + KEEP (*(.init)) + . = ALIGN(4); + } =0xff + + .plt : + { + *(.plt) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } + + .text : /* ALIGN (4): */ + { + *(EXCLUDE_FILE (*.iwram*) .text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7) + *(.glue_7t) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0xff + __text_end = .; + .fini : + { + KEEP (*(.fini)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } =0 + + .rodata : + { + *(.rodata) + *all.rodata*(*) + *(.roda) + *(.rodata.*) + *(.gnu.linkonce.r*) + SORT(CONSTRUCTORS) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0xff + + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0 + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0 + .jcr : { KEEP (*(.jcr)) } + +/* laddr = ADDR(.init) + SIZEOF(.init) + SIZEOF(.text) + SIZEOF(.fini) + SIZEOF(.rodata) + SIZEOF(.ctors) + SIZEOF(.dtors); +*/ + .eh_frame : + { + KEEP (*(.eh_frame)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0 + + .gcc_except_table : + { + *(.gcc_except_table) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0 + __iwram_lma = .; + + .iwram __iwram_start : AT (__iwram_lma) + { + __iwram_start = ABSOLUTE(.) ; + *(.iwram) + *iwram.*(.text) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0xff + + __data_lma = __iwram_lma + SIZEOF(.iwram) ; + __iwram_end = . ; + + .bss ALIGN(4) : + { + __bss_start = ABSOLUTE(.); + __bss_start__ = ABSOLUTE(.); + *(.dynbss) + *(.gnu.linkonce.b*) + *(COMMON) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } + + __bss_end = . ; + __bss_end__ = . ; + + .data ALIGN(4) : AT (__data_lma) + { + __data_start = ABSOLUTE(.); + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + CONSTRUCTORS + . = ALIGN(4); + } = 0xff + + __iwram_overlay_lma = __data_lma + SIZEOF(.data); + + __data_end = .; + PROVIDE (edata = .); + __iwram_overlay_start = . ; + + OVERLAY ALIGN(4) : NOCROSSREFS AT (__iwram_overlay_lma) + { + .iwram0 { *(.iwram0) . = ALIGN(4);} + .iwram1 { *(.iwram1) . = ALIGN(4);} + .iwram2 { *(.iwram2) . = ALIGN(4);} + .iwram3 { *(.iwram3) . = ALIGN(4);} + .iwram4 { *(.iwram4) . = ALIGN(4);} + .iwram5 { *(.iwram5) . = ALIGN(4);} + .iwram6 { *(.iwram6) . = ALIGN(4);} + .iwram7 { *(.iwram7) . = ALIGN(4);} + .iwram8 { *(.iwram8) . = ALIGN(4);} + .iwram9 { *(.iwram9) . = ALIGN(4);} + } = 0xff + __ewram_lma = LOADADDR(.iwram0) + SIZEOF(.iwram0)+SIZEOF(.iwram1)+SIZEOF(.iwram2)+SIZEOF(.iwram3)+SIZEOF(.iwram4)+SIZEOF(.iwram5)+SIZEOF(.iwram6)+SIZEOF(.iwram7)+SIZEOF(.iwram8)+SIZEOF(.iwram9); + + __iwram_overlay_end = . ; + __iheap_start = . ; + + __ewram_start = 0x2000000; + .ewram __ewram_start : AT (__ewram_lma) + { + *(.ewram) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0xff + __ewram_overlay_lma = __ewram_lma + SIZEOF(.ewram); + + .sbss ALIGN(4): + { + *(.sbss) + . = ALIGN(4); + } + + __ewram_end = . ; + __ewram_overlay_start = . ; + + OVERLAY ALIGN(4): NOCROSSREFS AT (__ewram_overlay_lma) + { + .ewram0 { *(.ewram0) . = ALIGN(4);} + .ewram1 { *(.ewram1) . = ALIGN(4);} + .ewram2 { *(.ewram2) . = ALIGN(4);} + .ewram3 { *(.ewram3) . = ALIGN(4);} + .ewram4 { *(.ewram4) . = ALIGN(4);} + .ewram5 { *(.ewram5) . = ALIGN(4);} + .ewram6 { *(.ewram6) . = ALIGN(4);} + .ewram7 { *(.ewram7) . = ALIGN(4);} + .ewram8 { *(.ewram8) . = ALIGN(4);} + .ewram9 { *(.ewram9) . = ALIGN(4);} + } = 0xff + + __pad_lma = LOADADDR(.ewram0) + SIZEOF(.ewram0)+SIZEOF(.ewram1)+SIZEOF(.ewram2)+SIZEOF(.ewram3)+SIZEOF(.ewram4)+SIZEOF(.ewram5)+SIZEOF(.ewram6)+SIZEOF(.ewram7)+SIZEOF(.ewram8)+SIZEOF(.ewram9); + + /* EZF Advance strips trailing 0xff bytes, add a pad section so nothing important is removed */ + .pad ALIGN(4) : AT (__pad_lma) + { + LONG(0x52416b64) + LONG(0x4d) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0xff + + __ewram_overlay_end = . ; + __eheap_start = . ; + + _end = .; + __end__ = _end ; /* v1.3 */ + PROVIDE (end = _end); /* v1.3 */ + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .stack 0x80000 : { _stack = .; *(.stack) } + /* These must appear regardless of . */ +} diff --git a/dka-crtls/gba_crt0.s b/dka-crtls/gba_crt0.s new file mode 100644 index 0000000..57b30cf --- /dev/null +++ b/dka-crtls/gba_crt0.s @@ -0,0 +1,247 @@ + .section ".init" + .global _start + .align + .arm +@--------------------------------------------------------------------------------- +_start: +@--------------------------------------------------------------------------------- + b rom_header_end + + .fill 156,1,0 @ Nintendo Logo Character Data (8000004h) + .fill 16,1,0 @ Game Title + .byte 0x30,0x31 @ Maker Code (80000B0h) + .byte 0x96 @ Fixed Value (80000B2h) + .byte 0x00 @ Main Unit Code (80000B3h) + .byte 0x00 @ Device Type (80000B4h) + .fill 7,1,0 @ unused + .byte 0x00 @ Software Version No (80000BCh) + .byte 0xf0 @ Complement Check (80000BDh) + .byte 0x00,0x00 @ Checksum (80000BEh) + +@--------------------------------------------------------------------------------- +rom_header_end: +@--------------------------------------------------------------------------------- + b start_vector @ This branch must be here for proper + @ positioning of the following header. + + .GLOBAL __boot_method, __slave_number +@--------------------------------------------------------------------------------- +__boot_method: +@--------------------------------------------------------------------------------- + .byte 0 @ boot method (0=ROM boot, 3=Multiplay boot) +@--------------------------------------------------------------------------------- +__slave_number: +@--------------------------------------------------------------------------------- + .byte 0 @ slave # (1=slave#1, 2=slave#2, 3=slave#3) + + .byte 0 @ reserved + .byte 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + + .global start_vector + .align +@--------------------------------------------------------------------------------- +start_vector: +@--------------------------------------------------------------------------------- + mov r0, #0x4000000 @ REG_BASE + add r0,r0,#0x208 @ REG_IME + strh r0,[r0] + + mov r0, #0x12 @ Switch to IRQ Mode + msr cpsr, r0 + ldr sp,=__sp_irq @ Set IRQ stack + mov r0, #0x1f @ Switch to System Mode + msr cpsr, r0 + ldr sp,=__sp_usr @ Set user stack + +@--------------------------------------------------------------------------------- +@ Enter Thumb mode +@--------------------------------------------------------------------------------- + add r0,pc,#1 + bx r0 + + .thumb + + ldr r0,=__text_start + lsl r0,#5 @ Was code compiled at 0x08000000 or higher? + bcs DoEWRAMClear @ yes, you can not run it in external WRAM + + mov r0,pc + lsl r0,#5 @ Are we running from ROM (0x8000000 or higher) ? + bcc SkipEWRAMClear @ No, so no need to do a copy. + +@--------------------------------------------------------------------------------- +@ We were started in ROM, silly emulators. :P +@ So we need to copy to ExWRAM. +@--------------------------------------------------------------------------------- + mov r3,#0x40 + lsl r3,#12 @ r3 = 0x40000 + lsl r2,r3,#7 @ r2 = 0x2000000 + mov r6,r2 @ r6 = 0x2000000 + lsl r1,r2,#2 @ r1 = 0x8000000 + + bl CopyMem + + bx r6 @ Jump to the code to execute + +@--------------------------------------------------------------------------------- +DoEWRAMClear: @ Clear External WRAM to 0x00 +@--------------------------------------------------------------------------------- + mov r1,#0x40 + lsl r1,#12 @ r1 = 0x40000 + lsl r0,r1,#7 @ r0 = 0x2000000 + bl ClearMem + +@--------------------------------------------------------------------------------- +SkipEWRAMClear: @ Clear Internal WRAM to 0x00 +@--------------------------------------------------------------------------------- + mov r0,#3 + lsl r0,#24 @ r0 = 0x3000000 + ldr r1,=__sp_usr_offset - 16 + bl ClearMem + +@--------------------------------------------------------------------------------- +@ Clear BSS section to 0x00 +@--------------------------------------------------------------------------------- + ldr r0,=__bss_start + ldr r1,=__bss_end + sub r1,r0 + bl ClearMem + +@--------------------------------------------------------------------------------- +@ Copy initialized data (data section) from LMA to VMA (ROM to RAM) +@--------------------------------------------------------------------------------- + ldr r1,=__data_lma + ldr r2,=__data_start + ldr r4,=__data_end + bl CopyMemChk + +@--------------------------------------------------------------------------------- +@ Copy internal work ram (iwram section) from LMA to VMA (ROM to RAM) +@--------------------------------------------------------------------------------- + ldr r1,=__iwram_lma + ldr r2,=__iwram_start + ldr r4,=__iwram_end + bl CopyMemChk + +@--------------------------------------------------------------------------------- +@ Copy internal work ram overlay 0 (iwram0 section) from LMA to VMA (ROM to RAM) +@--------------------------------------------------------------------------------- + ldr r2,=__load_stop_iwram0 + ldr r1,=__load_start_iwram0 + sub r3,r2,r1 @ Is there any data to copy? + beq CIW0Skip @ no + + ldr r2,=__iwram_overlay_start + bl CopyMem +@--------------------------------------------------------------------------------- +CIW0Skip: +@--------------------------------------------------------------------------------- +@ Copy external work ram (ewram section) from LMA to VMA (ROM to RAM) +@--------------------------------------------------------------------------------- + ldr r1,=__ewram_lma + ldr r2,=__ewram_start + ldr r4,=__ewram_end + bl CopyMemChk + +@--------------------------------------------------------------------------------- +@ Copy external work ram overlay 0 (ewram0 section) from LMA to VMA (ROM to RAM) +@--------------------------------------------------------------------------------- + ldr r2,=__load_stop_ewram0 + ldr r1,=__load_start_ewram0 + sub r3,r2,r1 @ Is there any data to copy? + beq CEW0Skip @ no + + ldr r2,=__ewram_overlay_start + bl CopyMem +@--------------------------------------------------------------------------------- +CEW0Skip: +@--------------------------------------------------------------------------------- +@ set heap end +@--------------------------------------------------------------------------------- + ldr r1,=fake_heap_end + ldr r0,=__eheap_end + str r0,[r1] +@--------------------------------------------------------------------------------- +@ global constructors +@--------------------------------------------------------------------------------- + ldr r3,=_init + bl _call_via_r3 +@--------------------------------------------------------------------------------- +@ Jump to user code +@--------------------------------------------------------------------------------- + mov r0,#0 @ int argc + mov r1,#0 @ char *argv[] + ldr r3,=main + bl _call_via_r3 +@--------------------------------------------------------------------------------- +@ Clear memory to 0x00 if length != 0 +@--------------------------------------------------------------------------------- +@ r0 = Start Address +@ r1 = Length +@--------------------------------------------------------------------------------- +ClearMem: +@--------------------------------------------------------------------------------- + mov r2,#3 @ These commands are used in cases where + add r1,r2 @ the length is not a multiple of 4, + bic r1,r2 @ even though it should be. + + beq ClearMX @ Length is zero so exit + + mov r2,#0 +@--------------------------------------------------------------------------------- +ClrLoop: +@--------------------------------------------------------------------------------- + stmia r0!,{r2} + sub r1,#4 + bne ClrLoop +@--------------------------------------------------------------------------------- +ClearMX: +@--------------------------------------------------------------------------------- + bx lr + +@--------------------------------------------------------------------------------- +@ Copy memory if length != 0 +@--------------------------------------------------------------------------------- +@ r1 = Source Address +@ r2 = Dest Address +@ r4 = Dest Address + Length +@--------------------------------------------------------------------------------- +CopyMemChk: +@--------------------------------------------------------------------------------- + sub r3,r4,r2 @ Is there any data to copy? +@--------------------------------------------------------------------------------- +@ Copy memory +@--------------------------------------------------------------------------------- +@ r1 = Source Address +@ r2 = Dest Address +@ r3 = Length +@--------------------------------------------------------------------------------- +CopyMem: +@--------------------------------------------------------------------------------- + mov r0,#3 @ These commands are used in cases where + add r3,r0 @ the length is not a multiple of 4, + bic r3,r0 @ even though it should be. + beq CIDExit @ Length is zero so exit + +@--------------------------------------------------------------------------------- +CIDLoop: +@--------------------------------------------------------------------------------- + ldmia r1!,{r0} + stmia r2!,{r0} + sub r3,#4 + bne CIDLoop +@--------------------------------------------------------------------------------- +CIDExit: +@--------------------------------------------------------------------------------- + bx lr + + .align + .pool + .end + diff --git a/dka-crtls/gba_er.ld b/dka-crtls/gba_er.ld new file mode 100644 index 0000000..4147ebe --- /dev/null +++ b/dka-crtls/gba_er.ld @@ -0,0 +1,50 @@ +/***********************************/ +/* NINTENDO E-READER LINKER SCRIPT */ +/***********************************/ +/* Author : Tim Schuerewegen */ +/* Version : 1.0 */ +/***********************************/ + +OUTPUT_FORMAT( "elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH( arm) +ENTRY( _start) + +SECTIONS +{ + . = 0x02000000; + + .init : + { + *(.init) + . = ALIGN(4); + } = 0xff + + .text : + { + *(.text) + . = ALIGN(4); + } = 0xff + + .rodata : + { + *(.rodata) + . = ALIGN(4); + } = 0xff + + .data : + { + *(.data) + . = ALIGN(4); + } = 0xff + + .bss : + { + __bss_start = .; + *(.bss) + . = ALIGN(4); + } + __bss_end = .; + + __end = .; +} + diff --git a/dka-crtls/gba_er.specs b/dka-crtls/gba_er.specs new file mode 100644 index 0000000..419b085 --- /dev/null +++ b/dka-crtls/gba_er.specs @@ -0,0 +1,8 @@ +%rename link old_link +%rename endfile old_endfile + +*link: +-T gba_er.ld%s %(old_link) + +*startfile: +er_crt0%O%s diff --git a/dka-crtls/gba_mb.ld b/dka-crtls/gba_mb.ld new file mode 100644 index 0000000..501d66e --- /dev/null +++ b/dka-crtls/gba_mb.ld @@ -0,0 +1,284 @@ +/* Linker Script Original v1.3 by Jeff Frohwein */ +/* v1.0 - Original release */ +/* v1.1 - Added proper .data section support */ +/* v1.2 - Added support for c++ & iwram overlays */ +/* - Major contributions by Jason Wilkins. */ +/* v1.3 - .ewram section now can be used when */ +/* compiling for MULTIBOOT mode. This fixes */ +/* malloc() in DevKitAdvance which depends */ +/* on __eheap_start instead of end to define*/ +/* the starting location of heap space. */ +/* External global variable __gba_iwram_heap*/ +/* support added to allow labels end, _end, */ +/* & __end__ to point to end of iwram or */ +/* the end of ewram. */ +/* Additions by WinterMute */ +/* v1.4 - .sbss section added for unitialised */ +/* data in ewram */ +/* v1.5 - padding section added to stop EZF */ +/* stripping important data */ + +/* This file is released into the public domain */ +/* for commercial or non-commercial use with no */ +/* restrictions placed upon it. */ + +/* NOTE!!!: This linker script defines the RAM & */ +/* ROM start addresses. In order for it to work */ +/* properly, remove -Ttext and -Tbss linker */ +/* options from your makefile if they are */ +/* present. */ + +/* You can use the following to view section */ +/* addresses in your .elf file: */ +/* objdump -h file.elf */ +/* Please note that empty sections may incorrectly*/ +/* list the lma address as the vma address for */ +/* some versions of objdump. */ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) +/* SEARCH_DIR(/bin/arm); */ + +/* By default this linker script will generate code */ +/* for flash carts located at 0x8000000. */ + +/* The linker script function "var1 += var2;" sometimes */ +/* reports incorrect values in the *.map file but the */ +/* actual value it calculates is usually, if not always, */ +/* correct. If you leave out the ". = ALIGN(4);" at the */ +/* end of each section then the return value of SIZEOF() */ +/* is sometimes incorrect and "var1 += var2;" appears to */ +/* not work as well. "var1 += var2" style functions are */ +/* avoided below as a result. */ +__text_start = 0x2000000 ; +__eheap_end = 0x2040000; +__iwram_start = 0x3000000; +__iheap_end = 0x3008000 - 0x400; +__sp_usr = 0x3008000 - 0x100; +__sp_irq = 0x3008000 - 0x60; +__intr_vector_buf = 0x3008000 - 4; +__sp_usr_offset = __sp_usr - __iwram_start; +__intr_vect_offset = __intr_vector_buf - __sp_usr; + +SECTIONS +{ + . = __text_start; + .init : + { + KEEP (*(.init)) + . = ALIGN(4); + } =0xff + + .plt : + { + *(.plt) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } + + .text : /* ALIGN (4): */ + { + *(EXCLUDE_FILE (*.iwram*) .text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7) + *(.glue_7t) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0xff + __text_end = .; + .fini : + { + KEEP (*(.fini)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } =0 + + .rodata : + { + *(.rodata) + *all.rodata*(*) + *(.roda) + *(.rodata.*) + *(.gnu.linkonce.r*) + SORT(CONSTRUCTORS) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0xff + + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0 + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0 + .jcr : { KEEP (*(.jcr)) } + +/* laddr = ADDR(.init) + SIZEOF(.init) + SIZEOF(.text) + SIZEOF(.fini) + SIZEOF(.rodata) + SIZEOF(.ctors) + SIZEOF(.dtors); +*/ + .eh_frame : + { + KEEP (*(.eh_frame)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0 + + .gcc_except_table : + { + *(.gcc_except_table) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0 + __iwram_lma = .; + + .iwram __iwram_start : AT (__iwram_lma) + { + __iwram_start = ABSOLUTE(.) ; + *(.iwram) + *iwram.*(.text) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0xff + + __data_lma = __iwram_lma + SIZEOF(.iwram) ; + __iwram_end = . ; + + .bss ALIGN(4) : + { + __bss_start = ABSOLUTE(.); + __bss_start__ = ABSOLUTE(.); + *(.dynbss) + *(.gnu.linkonce.b*) + *(COMMON) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } + + __bss_end = . ; + __bss_end__ = . ; + + .data ALIGN(4) : AT (__data_lma) + { + __data_start = ABSOLUTE(.); + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + CONSTRUCTORS + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0xff + + __iwram_overlay_lma = __data_lma + SIZEOF(.data); + + __data_end = .; + PROVIDE (edata = .); + __iwram_overlay_start = . ; + + OVERLAY ALIGN(4) : NOCROSSREFS AT (__iwram_overlay_lma) + { + .iwram0 { *(.iwram0) . = ALIGN(4);} + .iwram1 { *(.iwram1) . = ALIGN(4);} + .iwram2 { *(.iwram2) . = ALIGN(4);} + .iwram3 { *(.iwram3) . = ALIGN(4);} + .iwram4 { *(.iwram4) . = ALIGN(4);} + .iwram5 { *(.iwram5) . = ALIGN(4);} + .iwram6 { *(.iwram6) . = ALIGN(4);} + .iwram7 { *(.iwram7) . = ALIGN(4);} + .iwram8 { *(.iwram8) . = ALIGN(4);} + .iwram9 { *(.iwram9) . = ALIGN(4);} + } = 0xff + __ewram_lma = LOADADDR(.iwram0) + SIZEOF(.iwram0)+SIZEOF(.iwram1)+SIZEOF(.iwram2)+SIZEOF(.iwram3)+SIZEOF(.iwram4)+SIZEOF(.iwram5)+SIZEOF(.iwram6)+SIZEOF(.iwram7)+SIZEOF(.iwram8)+SIZEOF(.iwram9); + + __iwram_overlay_end = . ; + __iheap_start = . ; + + /* v1.3 */ + __ewram_start = __ewram_lma ; + .ewram __ewram_start : AT (__ewram_lma) + { + *(.ewram) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0xff + + __ewram_overlay_lma = __ewram_lma + SIZEOF(.ewram); + + .sbss ALIGN(4): + { + *(.sbss) + . = ALIGN(4); + } + + __ewram_end = . ; + __ewram_overlay_start = . ; + + OVERLAY ALIGN(4): NOCROSSREFS AT (__ewram_overlay_lma) + { + .ewram0 { *(.ewram0) . = ALIGN(4);} + .ewram1 { *(.ewram1) . = ALIGN(4);} + .ewram2 { *(.ewram2) . = ALIGN(4);} + .ewram3 { *(.ewram3) . = ALIGN(4);} + .ewram4 { *(.ewram4) . = ALIGN(4);} + .ewram5 { *(.ewram5) . = ALIGN(4);} + .ewram6 { *(.ewram6) . = ALIGN(4);} + .ewram7 { *(.ewram7) . = ALIGN(4);} + .ewram8 { *(.ewram8) . = ALIGN(4);} + .ewram9 { *(.ewram9) . = ALIGN(4);} + } = 0xff + + __ewram_overlay_end = . ; + + __eheap_start = . ; + + _end = .; + __end__ = _end ; /* v1.3 */ + PROVIDE (end = _end); /* v1.3 */ + + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .stack 0x80000 : { _stack = .; *(.stack) } + /* These must appear regardless of . */ +} diff --git a/dka-crtls/gba_mb.specs b/dka-crtls/gba_mb.specs new file mode 100644 index 0000000..cda74a5 --- /dev/null +++ b/dka-crtls/gba_mb.specs @@ -0,0 +1,8 @@ +%rename link old_link + +*link: +-T gba_mb.ld%s %(old_link) + +*startfile: +gba_crt0%O%s crti%O%s crtbegin%O%s + diff --git a/dka-crtls/gp32.ld b/dka-crtls/gp32.ld new file mode 100644 index 0000000..d044730 --- /dev/null +++ b/dka-crtls/gp32.ld @@ -0,0 +1,152 @@ +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) + +MEMORY + { + ram : ORIGIN = 0xc000000, LENGTH = 8M + } + +SECTIONS +{ + .init : + { + __text_start = . ; + KEEP (*(.init)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + .plt : { *(.plt) } >ram = 0xff + + .text : /* ALIGN (4): */ + { + + *(EXCLUDE_FILE (*text.iwram*) .text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7) + *(.glue_7t) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + .fini : + { + KEEP (*(.fini)) + } >ram =0xff + + __text_end = . ; + + .rodata : + { + *(.rodata) + *all.rodata*(*) + *(.roda) + *(.rodata.*) + *(.gnu.linkonce.r*) + SORT(CONSTRUCTORS) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + + .eh_frame : + { + KEEP (*(.eh_frame)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + + .gcc_except_table : + { + *(.gcc_except_table) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + .jcr : { KEEP (*(.jcr)) } >ram = 0 + .got : { *(.got.plt) *(.got) } >ram = 0 + __ro_end = . ; + + .data ALIGN(4) : + { + __data_start = ABSOLUTE(.); + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + CONSTRUCTORS + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + + __data_end = . ; + + .bss ALIGN(4) : + { + __bss_start = ABSOLUTE(.); + /* __bss_start__ = ABSOLUTE(.); */ + *(.dynbss) + *(.gnu.linkonce.b*) + *(COMMON) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } > ram + __bss_end = . ; + + _end = . ; + __end__ = . ; + PROVIDE (end = _end); + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .stack 0x80000 : { _stack = .; *(.stack) } + /* These must appear regardless of . */ +} diff --git a/dka-crtls/gp32.specs b/dka-crtls/gp32.specs new file mode 100644 index 0000000..a15e5b0 --- /dev/null +++ b/dka-crtls/gp32.specs @@ -0,0 +1,8 @@ +%rename link old_link + +*link: +%(old_link) -T gp32.ld%s + +*startfile: +gp32_crt0%O%s crti%O%s crtbegin%O%s + diff --git a/dka-crtls/gp32_crt0.s b/dka-crtls/gp32_crt0.s new file mode 100644 index 0000000..838dfc2 --- /dev/null +++ b/dka-crtls/gp32_crt0.s @@ -0,0 +1,74 @@ + .section ".init" + .code 32 + .align + .global _start +@--------------------------------------------------------------------------------- +_start: +@--------------------------------------------------------------------------------- + b _start2 + +@--------------------------------------------------------------------------------- +@ AXF addresses +@--------------------------------------------------------------------------------- +_text_start: + .word __text_start +_ro_end: + .word __ro_end +_data_start: + .word __data_start + .word __bss_end +_bss_start: + .word __bss_start +_bss_end: + .word __bss_end + +@--------------------------------------------------------------------------------- +@ GamePark magic sequence +@--------------------------------------------------------------------------------- + .word 0x44450011 + .word 0x44450011 + .word 0x01234567 + .word 0x12345678 + .word 0x23456789 + .word 0x34567890 + .word 0x45678901 + .word 0x56789012 + .word 0x23456789 + .word 0x34567890 + .word 0x45678901 + .word 0x56789012 + .word 0x23456789 + .word 0x34567890 + .word 0x45678901 + .word 0x56789012 + +@--------------------------------------------------------------------------------- +_start2: +@--------------------------------------------------------------------------------- + mrs r0, CPSR + orr r0, r0, #0xC0 + msr CPSR_ctl, r0 + + mrs r0, CPSR + bic r0, r0, #0xC0 + orr r0, r0, #0x40 + msr CPSR_ctl,r0 + +@--------------------------------------------------------------------------------- +@ global constructors +@--------------------------------------------------------------------------------- + ldr r3,=_call_main + mov lr,r3 + ldr r3,=_init + bx r3 +@--------------------------------------------------------------------------------- +@ Jump to user code +@--------------------------------------------------------------------------------- +_call_main: +@--------------------------------------------------------------------------------- + mov lr, #0 + ldr r3, =main + bx r3 + + .pool + .end diff --git a/dka-crtls/gp32_gpsdk.ld b/dka-crtls/gp32_gpsdk.ld new file mode 100644 index 0000000..4e2ed55 --- /dev/null +++ b/dka-crtls/gp32_gpsdk.ld @@ -0,0 +1,197 @@ +/* GP32 Linker Script v1.2 by Jeff F */ +/* v1.0 - Original release */ +/* v1.1 - Cleaned up and added MEMORY command */ +/* v1.2 - DJWillis - Added propper .init and */ +/* .fini for GCC 3.3.2 and above */ +/* */ +/* This file is released into the public domain */ +/* for commercial or non-commercial use with no */ +/* restrictions placed upon it. */ +/* */ +/* NOTE!!!: This linker script defines the RAM */ +/* start addresses. In order for it to work */ +/* properly, remove -Ttext and -Tbss linker */ +/* options from your makefile if they are */ +/* present. */ +/* */ +/* You can use the following to view section */ +/* addresses in your .elf file: */ +/* objdump -h file.elf */ +/* */ +/* Please note that empty sections may incorrectly*/ +/* list the lma address as the vma address for */ +/* some versions of objdump. */ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) +/* SEARCH_DIR(/bin/arm); */ + +/* Then use it like this: IWRAMHEAP */ +/* The linker script function "var1 += var2;" sometimes */ +/* reports incorrect values in the *.map file but the */ +/* actual value it calculates is usually, if not always, */ +/* correct. If you leave out the ". = ALIGN(4);" at the */ +/* end of each section then the return value of SIZEOF() */ +/* is sometimes incorrect and "var1 += var2;" appears to */ +/* not work as well. "var1 += var2" style functions are */ +/* avoided below as a result. */ + +/* The linker script MEMORY directive is not used here due */ +/* to the fact that __text_start is not always a fixed value. */ + +MEMORY + { + ram : ORIGIN = 0xc000000, LENGTH = 8M + } + +SECTIONS +{ + .text : /* ALIGN (4): */ + { + __text_start = . ; + + *(EXCLUDE_FILE (*text.iwram*) .text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7) + *(.glue_7t) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + + __text_end = . ; + + + .init : + { + *(.init) + } > ram = 0xff + + .jcr : + { + *(.jcr) + } > ram = 0xff + + .fini : + { + *(.fini) + } > ram = 0xff + + .rodata : + { + *(.rodata) + *all.rodata*(*) + *(.roda) + *(.rodata.*) + *(.gnu.linkonce.r*) + SORT(CONSTRUCTORS) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + + .eh_frame : + { + KEEP (*(.eh_frame)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + + .gcc_except_table : + { + *(.gcc_except_table) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + __ro_end = . ; + + .data ALIGN(4) : + { + __data_start = ABSOLUTE(.); + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + CONSTRUCTORS + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + + __data_end = . ; + + .bss ALIGN(4) : + { + __bss_start = ABSOLUTE(.); + /* __bss_start__ = ABSOLUTE(.); */ + *(.dynbss) + *(.gnu.linkonce.b*) + *(COMMON) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } > ram + __bss_end = . ; + + __eheap_start = . ; /* Needed by DevKitAdvance. Start of malloc() heap for DKA. */ + + _end = . ; + __end__ = . ; + PROVIDE (end = _end); + + __eheap_end = . ; + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .stack 0x80000 : { _stack = .; *(.stack) } + /* These must appear regardless of . */ +} diff --git a/dka-crtls/gp32_gpsdk.specs b/dka-crtls/gp32_gpsdk.specs new file mode 100644 index 0000000..014c55e --- /dev/null +++ b/dka-crtls/gp32_gpsdk.specs @@ -0,0 +1,8 @@ +%rename link old_link + +*link: +%(old_link) -T gp32_gpsdk.ld%s + +*startfile: +gp32_gpsdk_crt0%O%s crti%O%s crtbegin%O%s + diff --git a/dka-crtls/gp32_gpsdk_crt0.s b/dka-crtls/gp32_gpsdk_crt0.s new file mode 100644 index 0000000..99770ce --- /dev/null +++ b/dka-crtls/gp32_gpsdk_crt0.s @@ -0,0 +1,246 @@ +@**************************************************** +@* gp32 crt0.S v1.0 by Jeff F * +@**************************************************** + +@ v1.0 - Original release +@ +@ This file is released into the public domain for commercial +@ or non-commercial usage with no restrictions placed upon it. + + .TEXT + +@ Note: Normally it is the job of crt0.S to clear the BSS +@ (Zero Initialized) section to 0x00, but in the case of +@ the gp32 we do not have to do this because it is done +@ by the gp32 bios after it loads the app. + +@ The official sdt dev kit uses 'Main ()' as the entry +@ point. If you would rather use 'main ()' instead then +@ comment out the next line. +@ +@ You have to use 'main ()' at some point in your program +@ if you want to do c++ code. GCC will do a call to constructor +@ setup before executing 'main ()'. Using 'main ()' also increases +@ your program size by ~5500 bytes. + +@ .equ __OfficialEntry, 1 + +@ The official sdt dev kit initializes various things in init.o +@ Crt0.S performs similar tasks for compatibility. If you don't +@ wish to use the official libs, or those that are compatible, +@ then you need to comment out the next line to prevent link errors. + + .equ __OfficialInits, 1 + + + .GLOBAL _start +_start: + .ALIGN + .CODE 32 + + @ Start Vector + + b _GpInit + + .word __text_start @ Start of text (Read Only) section +_roe: .word __ro_end @ End " +_rws: .word __data_start @ Start of data (Read/Write) section + .word __bss_end @ End of bss (this is the way sdt does it for some reason) +_zis: .word __bss_start @ Start of bss (Zero Initialized) section +_zie: .word __bss_end @ End " + + .word 0x44450011 + .word 0x44450011 + + .word 0x01234567 + .word 0x12345678 + .word 0x23456789 + .word 0x34567890 + .word 0x45678901 + .word 0x56789012 + .word 0x23456789 + .word 0x34567890 + .word 0x45678901 + .word 0x56789012 + .word 0x23456789 + .word 0x34567890 + .word 0x45678901 + .word 0x56789012 + +_GpInit: + mrs r0,CPSR + orr r0,r0,#0xc0 + msr CPSR_fsxc,r0 + +.ifdef __OfficialInits + +@ Call function in user_init.s +@ bl asm_user_entry + +@ Get pointer to GpSurfaceSet routine + mov r0,#0 + swi 0xb + ldr r1,=GpSurfaceSet + ldr r2,=GpSurfaceFlip + str r0,[r1] + str r0,[r2] + +@ Get time passed + mov r0,#6 + swi 0xb + ldr r1,=_timepassed + str r0,[r1] + +@ Get button stuff + mov r0,#0 + swi 0x10 + ldr r2,=_reg_io_key_a + ldr r3,=_reg_io_key_b + str r0,[r2] + str r1,[r3] + +@ Set heap start location + ldr r0,_zie + ldr r1,=HEAPSTART + str r0,[r1] + +@ Set heap end location + mov r0,#5 + swi 0xb + ldr r1,=HEAPEND + sub r0,r0,#255 + bic r0,r0,#3 + str r0,[r1] + +@ Set App Argument + swi 0x15 + + mov r10,r0 + mov r11,r1 @ possibly not needed but left in anyway + + mrs r0,CPSR + bic r0,r0,#192 + orr r0,r0,#64 + msr CPSR_fsxc,r0 + + mov r0,r10 + mov r1,r11 @ possibly not needed but left in anyway +.endif + +@ Jump to Main () + +.ifdef __OfficialEntry + ldr r3,=Main +.else + ldr r3,=main +.endif + bx r3 @ Init.o uses 'mov pc,r3' but + @ 'bx r3' is used here instead. This way + @ the main function can be ARM or Thumb. + +.ifdef __OfficialInits + + swi 0x12 + orr r1,r1,r2 + and r1,r1,r3 + eor r1,r1,r4 + mov r5,r1,lsr #4 + add r1,r1,r7 + sub r7,r7,r1 + mov r8,#0 + mov pc,r8 + b . + b . + b . + b . + b . + b . + b . + b . + b . + b . + b . + b . + nop + nop + nop + nop + nop + nop + + .GLOBAL _fw_init_for_dbg +_fw_init_for_dbg: + stmdb sp!,{r0-r12} + + mov r10,lr + mov r11,sp + + bic r0,r0,#31 @ 0x1f + orr r1,r0,#17 @ 0x11 + orr r2,r0,#19 @ 0x13 + msr cpsr_cxsf,r1 + mov r12,#4 + add r12,r12,pc + msr cpsr_cxsf,r2 + swi 0x1ff + +@ bl asm_user_entry_path + + mov r0,r11 + mov r1,r10 + add r0,r0,#52 + ldr r2,[r0] + mov lr,r1 + stmdb sp!,{r2} + stmdb sp!,{r0-r12,lr} + +@ Copy RW Base - ZI Base + ldr r0,=_roe @ |Image$$RO$$Limit| + ldr r3,=_zis @ |Image$$ZI$$Base| + ldr r2,=_rws @ |Image$$RW$$Base| + sub r3,r3,r2 +CopyRWData: + cmp r3,#36 + blt CopyRWData2 + ldmia r0!,{r4-r12} + stmia r2!,{r4-r12} + sub r3,r3,#36 + b CopyRWData +CopyRWData2: + cmp r3,#0 + ble CopyRWData3 + ldr r4,[r0],#4 + str r4,[r2],#4 + sub r3,r3,#4 + b CopyRWData2 +CopyRWData3: + +@ Clear ZI section + ldr r1,=_zie @ |Image$$ZI$$Limit| + ldr r0,=_zis @ |Image$$ZI$$Base| + mov r2,#0 + mov r3,r2 + mov r4,r2 + mov r5,r2 + mov r6,r2 + mov r7,r2 + mov r8,r2 + mov r9,r2 + mov r10,r2 + mov r11,r2 + mov r12,r2 +CopyZIData: + stmia r0!,{r2-r12} + cmp r0,r1 + blt CopyZIData + + ldmia sp!,{r0-r12,pc} + +.endif + + .ALIGN + .POOL + + + .END + diff --git a/dka-scripts/build-crtls.sh b/dka-scripts/build-crtls.sh new file mode 100644 index 0000000..453f945 --- /dev/null +++ b/dka-scripts/build-crtls.sh @@ -0,0 +1,12 @@ +DEVKITARM=$INSTALLDIR + +#--------------------------------------------------------------------------------- +# Install and build the gba crt +#--------------------------------------------------------------------------------- + +cp $(pwd)/dka-crtls/* $DEVKITARM/arm-elf/lib/ +cd $DEVKITARM/arm-elf/lib/ +$MAKE CRT=gba_crt0 +$MAKE CRT=gp32_crt0 +$MAKE CRT=er_crt0 +$MAKE CRT=gp32_gpsdk_crt0 diff --git a/dka-scripts/build-gcc.sh b/dka-scripts/build-gcc.sh new file mode 100644 index 0000000..da6142f --- /dev/null +++ b/dka-scripts/build-gcc.sh @@ -0,0 +1,67 @@ +#--------------------------------------------------------------------------------- +# Check Parameters +#--------------------------------------------------------------------------------- + +prefix=$INSTALLDIR + +#--------------------------------------------------------------------------------- +# build and install binutils +#--------------------------------------------------------------------------------- + +mkdir -p $target/binutils +cd $target/binutils + +../../$BINUTILS_SRCDIR/configure \ + --prefix=$prefix --target=$target --disable-nls --disable-shared --disable-debug \ + --disable-threads --with-gcc --with-gnu-as --with-gnu-ld --with-stabs \ + 2>&1 | tee binutils_configure.log + + +$MAKE | tee binutils_make.log 2>&1 +$MAKE install | tee binutils_install.log 2>&1 + +cd $BUILDSCRIPTDIR + + +#--------------------------------------------------------------------------------- +# build and install just the c compiler +#--------------------------------------------------------------------------------- +mkdir -p $target/gcc +cd $target/gcc + + +../../$GCC_SRCDIR/configure \ + --enable-languages=c,c++ \ + --with-cpu=arm7tdmi\ + --enable-interwork --enable-multilib\ + --with-gcc --with-gnu-ld --with-gnu-as --with-stabs \ + --disable-shared --disable-threads --disable-win32-registry --disable-nls\ + --target=$target \ + --with-newlib \ + --prefix=$prefix -v\ + 2>&1 | tee gcc_configure.log + +$MAKE all-gcc | tee gcc_make.log 2>&1 +$MAKE install-gcc | tee gcc_install.log 2>&1 + +#--------------------------------------------------------------------------------- +# build and install newlib +#--------------------------------------------------------------------------------- +cd $BUILDSCRIPTDIR +mkdir -p $target/newlib +cd $target/newlib + +../../$NEWLIB_SRCDIR/configure --target=$target --prefix=$prefix | tee newlib_configure.log 2>&1 + +$MAKE all | tee newlib_make.log 2>&1 +$MAKE install | tee newlib_install.log 2>&1 + +#--------------------------------------------------------------------------------- +# build and install the final compiler +#--------------------------------------------------------------------------------- + +cd $BUILDSCRIPTDIR +cd $target/gcc + +$MAKE | tee gcc_final_make.log 2>&1 +$MAKE install | tee gcc_final_install.log 2>&1 diff --git a/dka-scripts/build-tools.sh b/dka-scripts/build-tools.sh new file mode 100644 index 0000000..6807600 --- /dev/null +++ b/dka-scripts/build-tools.sh @@ -0,0 +1,26 @@ +prefix=$INSTALLDIR + +gcc -O2 tools/gba/gbafix.c + +if [ -f a.out ] + then + exeext= + rm a.out +else + if [ -f a.exe ] + then + exeext=.exe + rm a.exe + else + echo "Error: Failed to build tools" + exit -1 + fi +fi + +g++ tools/bmp2bin.cpp -o $prefix/bin/bmp2bin$exeext -static -O2 -s -D__LITTLE_ENDIAN__ +gcc tools/gbafix.c -o $prefix/bin/gbafix$exeext -static -O2 -s + +cd tools/b2fxec +$MAKE -C tools/gp32/b2fxec +cp b2fxec$exeext $prefix/bin/b2fxec$exeext +$MAKE -C tools/gp32/b2fxec clean diff --git a/dkp-crtls/gcn.ld b/dkp-crtls/gcn.ld new file mode 100644 index 0000000..c2fb63a --- /dev/null +++ b/dkp-crtls/gcn.ld @@ -0,0 +1,242 @@ +/* Default linker script, for normal executables */ +OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", + "elf32-powerpc") +OUTPUT_ARCH(powerpc:common) +ENTRY(_start) +SEARCH_DIR("/powerpc/powerpc-eabi-elf/lib"); +/* Do we need any of these for elf? + __DYNAMIC = 0; */ +PROVIDE (__stack = 0x817F0000); +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = 0x80003100; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } + .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } + .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } + .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } + .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } + .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } + .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } + .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } + .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rela.got1 : { *(.rela.got1) } + .rela.got2 : { *(.rela.got2) } + .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) } + .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) } + .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) } + .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) } + .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) } + .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) } + .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) } + .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) } + .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } + .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + + file_start = 0x80003000; + . = file_start; + .header : + { + /* 0000-001B Text[0..7] sections File Positions */ + LONG(text_file_start); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); + /* 001C-0047 Data[0..10] sections File Positions */ + LONG(0/*data_file_start*/); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); + /* 0048-0063 Text[0..7] sections Mem Address */ + LONG(text_mem_start); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); + /* 0064-008F Data[0..10] sections Mem Address */ + LONG(0/*data_mem_start*/); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); + /* 0090-00AB Text[0..7] sections Sizes */ + LONG(text_mem_size + data_mem_size); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); + /* 00AC-00D7 Data[0..10] sections Sizes */ + LONG(0/*data_mem_size*/); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); LONG(0); + /* 00D8 BSS Mem address + * 00DC BSS Size */ + LONG(bss_mem_start); LONG(bss_mem_size); + /* 00E0 Entry Point */ + LONG(text_mem_start); + } + +. = 0x80003100; + text_mem_start = .; + + .init : + { + KEEP (*(.init)) + } =0 + .text : + { + *(.text .stub .text.* .gnu.linkonce.t.*) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + } =0 + .fini : + { + KEEP (*(.fini)) + } =0 + PROVIDE (__etext = .); + PROVIDE (_etext = .); + PROVIDE (etext = .); + . = ALIGN(32); + text_mem_size = . - text_mem_start; + data_mem_start = .; + .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } + .rodata1 : { *(.rodata1) } + .sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) } + .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + . = ALIGN(32); + /* Ensure the __preinit_array_start label is properly aligned. We + could instead move the label definition inside the section, but + the linker would then create the section even if it turns out to + be empty, which isn't pretty. */ + . = ALIGN(32 / 8); + PROVIDE (__preinit_array_start = .); + .preinit_array : { *(.preinit_array) } + PROVIDE (__preinit_array_end = .); + PROVIDE (__init_array_start = .); + .init_array : { *(.init_array) } + PROVIDE (__init_array_end = .); + PROVIDE (__fini_array_start = .); + .fini_array : { *(.fini_array) } + PROVIDE (__fini_array_end = .); + .data : + { + *(.data .data.* .gnu.linkonce.d.*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } + .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } + .fixup : { *(.fixup) } + .got1 : { *(.got1) } + .got2 : { *(.got2) } + .dynamic : { *(.dynamic) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin*.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin*.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .jcr : { KEEP (*(.jcr)) } + .got : { *(.got.plt) *(.got) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : + { + *(.sdata .sdata.* .gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + +data_mem_size = . - data_mem_start; + bss_mem_start = .; + + __bss_start = .; + .sbss : + { + PROVIDE (__sbss_start = .); + PROVIDE (___sbss_start = .); + *(.dynsbss) + *(.sbss .sbss.* .gnu.linkonce.sb.*) + *(.scommon) + PROVIDE (__sbss_end = .); + PROVIDE (___sbss_end = .); + } + .plt : { *(.plt) } + .bss : + { + *(.dynbss) + *(.bss .bss.* .gnu.linkonce.b.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + } + . = ALIGN(32 / 8); + bss_mem_size = . - bss_mem_start; +text_file_start = text_mem_start - file_start; +data_file_start = data_mem_start - file_start; + + + _end = .; + __end = .; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } +} diff --git a/dkp-crtls/ogc.ld b/dkp-crtls/ogc.ld new file mode 100644 index 0000000..187c7d3 --- /dev/null +++ b/dkp-crtls/ogc.ld @@ -0,0 +1,348 @@ +/* + * Linkscript for GC, automatically sets up DOL structures, + * generate ELF file and use objdump, or generate binary + * directly. + * + * PSUL doesn't seem to handle separate text and data sections correctly, + * that is why the text and data sections are merged in the header. + * + * If you want to experiment, it should be quite obvious how to + * change the header to list the data separately. + */ + +OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc"); +OUTPUT_ARCH(powerpc:common); +EXTERN(_start); +ENTRY(_start); + + +SECTIONS +{ + + /* DOL header (from TITANIK's GC docs) + */ + file_start = 0x80003000; + . = file_start; + + .header : + { + /* 0000-001B Text[0..7] sections File Positions */ + LONG(text_file_start); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 001C-0047 Data[0..10] sections File Positions */ + LONG(data_file_start); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 0048-0063 Text[0..7] sections Mem Address */ + LONG(text_mem_start); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 0064-008F Data[0..10] sections Mem Address */ + LONG(data_mem_start); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 0090-00AB Text[0..7] sections Sizes */ + LONG(text_mem_size); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 00AC-00D7 Data[0..10] sections Sizes */ + LONG(data_mem_size); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 00D8 BSS Mem address + * 00DC BSS Size */ + LONG(bss_mem_start); + LONG(bss_mem_size); + + /* 00E0 Entry Point */ + LONG(ABSOLUTE(_start)); + } + + /* Program + */ + . = 0x80003100; + text_mem_start = .; + + .init : + { + KEEP (*crt0.o(*.init)) + KEEP (*(.init)) + } = 0 + .plt : { *(.plt) } + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } + .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } + .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } + .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } + .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } + .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } + .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } + .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } + .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rela.got1 : { *(.rela.got1) } + .rela.got2 : { *(.rela.got2) } + .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) } + .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) } + .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) } + .rela.sbss : { *(.rela.sbss .rela.sbss.* .rel.gnu.linkonce.sb.*) } + .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) } + .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) } + .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) } + .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) } + .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } + .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .text : + { + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t.*) + } = 0 + .fini : + { + KEEP (*(.fini)) + } = 0 + PROVIDE (__etext = .); + PROVIDE (_etext = .); + PROVIDE (etext = .); + text_mem_size = . - text_mem_start; + data_mem_start = .; + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } + .rodata1 : { *(.rodata1) } + .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } + .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } + /* Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up. */ + /* Ensure the __preinit_array_start label is properly aligned. We + could instead move the label definition inside the section, but + the linker would then create the section even if it turns out to + be empty, which isn't pretty. */ + . = ALIGN(32 / 8); + PROVIDE (__preinit_array_start = .); + .preinit_array : { *(.preinit_array) } + PROVIDE (__preinit_array_end = .); + PROVIDE (__init_array_start = .); + .init_array : { *(.init_array) } + PROVIDE (__init_array_end = .); + PROVIDE (__fini_array_start = .); + .fini_array : { *(.fini_array) } + PROVIDE (__fini_array_end = .); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d.*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } + .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } + .fixup : { *(.fixup) } + .got1 : { *(.got1) } + .got2 : { *(.got2) } + .dynamic : { *(.dynamic) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .jcr : { KEEP (*(.jcr)) } + .got : { *(.got.plt) *(.got) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : + { + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + data_mem_size = . - data_mem_start; + + bss_mem_start = .; + .sbss : + { + __sbss_start = .; + PROVIDE (__sbss_start = .); + PROVIDE (___sbss_start = .); + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.gnu.linkonce.sb.*) + *(.scommon) + PROVIDE (__sbss_end = .); + PROVIDE (___sbss_end = .); + __sbss_end = .; + } + .bss : + { + __bss_start = .; + PROVIDE (__bss_start = .); + *(.dynbss) + *(.bss) + *(.bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + PROVIDE (__bss_end = .); + __bss_end = .; + } + . = ALIGN(32 / 8); + bss_mem_size = . - bss_mem_start; + + /* calculate file addresses */ + text_file_start = text_mem_start - file_start; + data_file_start = data_mem_start - file_start; + + _end = .; + PROVIDE(end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ +} + +__stack_addr = (__bss_start + SIZEOF(.bss) + 0x2000 + 7) & (-8); +__stack_end = (__bss_start + SIZEOF(.bss)); +__intrstack_addr = (__stack_addr + 0x2000); +__intrstack_end = (__stack_addr); +__ArenaLo = (__intrstack_addr + 31) & (-32); +__ArenaHi = (0x81700000); +__gxregs = (__ArenaHi + 31) & (-32); + +/* for backward compatibility with old crt0 */ +__stack = (0x81700000); + +PROVIDE (text_mem_start = text_mem_start); +PROVIDE (data_mem_start = data_mem_start); +PROVIDE (bss_mem_start = bss_mem_start); +PROVIDE(__stack_addr = __stack_addr); +PROVIDE(__stack_end = __stack_end); +PROVIDE(__intrstack_addr = __intrstack_addr); +PROVIDE(__intrstack_end = __intrstack_end); +PROVIDE(__ArenaLo = __ArenaLo); +PROVIDE(__ArenaHi = __ArenaHi); +PROVIDE(__gxregs = __gxregs); diff --git a/dkp-crtls/specs b/dkp-crtls/specs new file mode 100644 index 0000000..659bf73 --- /dev/null +++ b/dkp-crtls/specs @@ -0,0 +1,355 @@ +*asm: +--traditional-format %(asm_cpu) %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} %{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} %{memb|msdata|msdata=eabi: -memb} %{mlittle|mlittle-endian:-mlittle; mbig|mbig-endian :-mbig; mcall-aixdesc | mcall-freebsd | mcall-netbsd | mcall-openbsd | mcall-linux | mcall-gnu :-mbig; mcall-i960-old :-mlittle} + +*asm_debug: +%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}} + +*asm_final: + + +*asm_options: +%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O} + +*invoke_as: +%{!S:-o %|.s | + as %(asm_options) %|.s %A } + +*cpp: +%{posix: -D_POSIX_SOURCE} %{mads : %(cpp_os_ads) ; myellowknife : %(cpp_os_yellowknife) ; mmvme : %(cpp_os_mvme) ; msim : %(cpp_os_sim) ; mwindiss : %(cpp_os_windiss) ; mcall-freebsd: %(cpp_os_freebsd) ; mcall-linux : %(cpp_os_linux) ; mcall-gnu : %(cpp_os_gnu) ; mcall-netbsd : %(cpp_os_netbsd) ; mcall-openbsd: %(cpp_os_openbsd) ; : %(cpp_os_default) } + +*cpp_options: +%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} + +*cpp_debug_options: +%{d*} + +*cpp_unique_options: +%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}} + +*trad_capable_cpp: +cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp} + +*cc1: +%{G*} %{mlittle|mlittle-endian: %(cc1_endian_little); mbig |mbig-endian : %(cc1_endian_big); mcall-aixdesc | mcall-freebsd | mcall-netbsd | mcall-openbsd | mcall-linux | mcall-gnu : -mbig %(cc1_endian_big); mcall-i960-old : -mlittle %(cc1_endian_little); : %(cc1_endian_default)} %{mno-sdata: -msdata=none } %{meabi: %{!mcall-*: -mcall-sysv }} %{!meabi: %{!mno-eabi: %{mrelocatable: -meabi } %{mcall-freebsd: -mno-eabi } %{mcall-i960-old: -meabi } %{mcall-linux: -mno-eabi } %{mcall-gnu: -mno-eabi } %{mcall-netbsd: -mno-eabi } %{mcall-openbsd: -mno-eabi }}} %{msdata: -msdata=default} %{mno-sdata: -msdata=none} %{profile: -p} + +*cc1_options: +%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} + +*cc1plus: + + +*link_gcc_c_sequence: +%G %L %G + +*endfile: +%{mgcn : crtsavres.o%s %(endfile_gcn); mogc : crtsavres.o%s %(endfile_gcn); myellowknife : crtsavres.o%s %(endfile_yellowknife) ; mmvme : crtsavres.o%s %(endfile_mvme) ; msim : crtsavres.o%s %(endfile_sim) ; mwindiss : %(endfile_windiss) ; mcall-freebsd: crtsavres.o%s %(endfile_freebsd) ; mcall-linux : crtsavres.o%s %(endfile_linux) ; mcall-gnu : crtsavres.o%s %(endfile_gnu) ; mcall-netbsd : crtsavres.o%s %(endfile_netbsd) ; mcall-openbsd: crtsavres.o%s %(endfile_openbsd) ; : %(crtsavres_default) %(endfile_default) } + +*link: +%{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} %{YP,*} %{R*} %{Qy:} %{!Qn:-Qy} %(link_shlib) %{!Wl,-T*: %{!T*: %(link_start) }} %(link_target) %(link_os) + +*lib: +%{mgcn : %(lib_gcn); mogc : %(lib_ogc); myellowknife : %(lib_yellowknife) ; mmvme : %(lib_mvme) ; msim : %(lib_sim) ; mwindiss : %(lib_windiss) ; mcall-freebsd: %(lib_freebsd) ; mcall-linux : %(lib_linux) ; mcall-gnu : %(lib_gnu) ; mcall-netbsd : %(lib_netbsd) ; mcall-openbsd: %(lib_openbsd) ; : %(lib_default) } + +*libgcc: +-lgcc + +*startfile: +%{mgcn : %(startfile_gcn) ; mogc : %(startfile_ogc) ; myellowknife : %(startfile_yellowknife) ; mmvme : %(startfile_mvme) ; msim : %(startfile_sim) ; mwindiss : %(startfile_windiss) ; mcall-freebsd: %(startfile_freebsd) ; mcall-linux : %(startfile_linux) ; mcall-gnu : %(startfile_gnu) ; mcall-netbsd : %(startfile_netbsd) ; mcall-openbsd: %(startfile_openbsd) ; : %(startfile_default) } + +*switches_need_spaces: + + +*cross_compile: +1 + +*version: +3.4.3 + +*multilib: +. ; + +*multilib_defaults: +mbig mcall-sysv + +*multilib_extra: + + +*multilib_matches: + + +*multilib_exclusions: + + +*multilib_options: + + +*linker: +collect2 + +*link_libgcc: +%D + +*md_exec_prefix: + + +*md_startfile_prefix: + + +*md_startfile_prefix_1: + + +*startfile_prefix_spec: + + +*sysroot_suffix_spec: + + +*sysroot_hdrs_suffix_spec: + + +*cpp_default: + + +*asm_cpu: +%{!mcpu*: %{mpower: %{!mpower2: -mpwr}} %{mpower2: -mpwrx} %{mpowerpc*: -mppc} %{mno-power: %{!mpowerpc*: -mcom}} %{!mno-power: %{!mpower2: %(asm_default)}}} %{mcpu=common: -mcom} %{mcpu=power: -mpwr} %{mcpu=power2: -mpwrx} %{mcpu=power3: -m604} %{mcpu=power4: -mpower4} %{mcpu=powerpc: -mppc} %{mcpu=rios: -mpwr} %{mcpu=rios1: -mpwr} %{mcpu=rios2: -mpwrx} %{mcpu=rsc: -mpwr} %{mcpu=rsc1: -mpwr} %{mcpu=401: -mppc} %{mcpu=403: -m403} %{mcpu=405: -m405} %{mcpu=405fp: -m405} %{mcpu=440: -m440} %{mcpu=440fp: -m440} %{mcpu=505: -mppc} %{mcpu=601: -m601} %{mcpu=602: -mppc} %{mcpu=603: -mppc} %{mcpu=603e: -mppc} %{mcpu=ec603e: -mppc} %{mcpu=604: -mppc} %{mcpu=604e: -mppc} %{mcpu=620: -mppc} %{mcpu=630: -m604} %{mcpu=740: -mppc} %{mcpu=7400: -mppc} %{mcpu=7450: -mppc} %{mcpu=G4: -mppc} %{mcpu=750: -mppc} %{mcpu=G3: -mppc} %{mcpu=801: -mppc} %{mcpu=821: -mppc} %{mcpu=823: -mppc} %{mcpu=860: -mppc} %{mcpu=970: -mpower4} %{mcpu=G5: -mpower4} %{mcpu=8540: -me500} %{maltivec: -maltivec} + +*asm_default: +-mppc + +*crtsavres_default: +crtsavres.o%s + +*lib_ogc: +--start-group -logcsys -lc --end-group -logc + +*lib_gcn: +--start-group -lads -lc --end-group + +*lib_yellowknife: +--start-group -lyk -lc --end-group + +*lib_mvme: +--start-group -lmvme -lc --end-group + +*lib_sim: +--start-group -lsim -lc --end-group + +*lib_freebsd: + %{!shared: %{!pg: %{!pthread:-lc} %{pthread:-lc_r}} %{pg: %{!pthread:-lc_p} %{pthread:-lc_r_p}} } + +*lib_gnu: +%{mnewlib: --start-group -lgnu -lc --end-group } %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } %{profile:-lc_p} %{!profile:-lc}}} + +*lib_linux: +%{mnewlib: --start-group -llinux -lc --end-group } %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} %{!shared: %{profile:-lc_p} %{!profile:-lc}}} + +*lib_netbsd: +%{profile:-lgmon -lc_p} %{!profile:-lc} + +*lib_openbsd: +%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}} + +*lib_windiss: +--start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group + +*lib_default: + + +*startfile_gcn: +gcn_crt0.o%s ecrti.o%s crtbegin.o%s + +*startfile_ogc: +ecrti.o%s crtbegin.o%s + +*startfile_yellowknife: +ecrti.o%s crt0.o%s crtbegin.o%s + +*startfile_mvme: +ecrti.o%s crt0.o%s crtbegin.o%s + +*startfile_sim: +ecrti.o%s sim-crt0.o%s crtbegin.o%s + +*startfile_freebsd: +%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:%{profile:gcrt1.o%s} %{!profile:crt1.o%s}}}} crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s} + +*startfile_gnu: +%{!shared: %{!static: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}} %{static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s} + +*startfile_linux: +%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} %{mnewlib:ecrti.o%s;:crti.o%s} %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} + +*startfile_netbsd: +ncrti.o%s crt0.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s} + +*startfile_openbsd: +%{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s} + +*startfile_windiss: +crt0.o%s crtbegin.o%s + +*startfile_default: + + +*endfile_gcn: +crtend.o%s ecrtn.o%s + +*endfile_yellowknife: +crtend.o%s ecrtn.o%s + +*endfile_mvme: +crtend.o%s ecrtn.o%s + +*endfile_sim: +crtend.o%s ecrtn.o%s + +*endfile_freebsd: +%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s + +*endfile_gnu: +%{!shared:crtend.o%s} %{shared:crtendS.o%s} %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s} + +*endfile_linux: +%{!shared:crtend.o%s} %{shared:crtendS.o%s} %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s} + +*endfile_netbsd: +%{!shared:crtend.o%s} %{shared:crtendS.o%s} ncrtn.o%s + +*endfile_openbsd: +%{!shared:crtend.o%s} %{shared:crtendS.o%s} + +*endfile_windiss: +crtend.o%s + +*endfile_default: + + +*link_path: + + +*link_shlib: +%{mshlib: %(link_path) } %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} %{static: } %{shared:-G -dy -z text %(link_path) } %{symbolic:-Bsymbolic -G -dy -z text %(link_path) } + +*link_target: +%{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: %{mcall-i960-old: --oformat elf32-powerpcle} }}}} + +*link_start: +%{mgcn : %(link_start_gcn); mogc : %(link_start_gcn); myellowknife : %(link_start_yellowknife) ; mmvme : %(link_start_mvme) ; msim : %(link_start_sim) ; mwindiss : %(link_start_windiss) ; mcall-freebsd: %(link_start_freebsd) ; mcall-linux : %(link_start_linux) ; mcall-gnu : %(link_start_gnu) ; mcall-netbsd : %(link_start_netbsd) ; mcall-openbsd: %(link_start_openbsd) ; : %(link_start_default) } + +*link_start_gcn: + -T ogc.ld%s + +*link_start_yellowknife: +-T yellowknife.ld%s + +*link_start_mvme: +-Ttext 0x40000 + +*link_start_sim: + + +*link_start_freebsd: + + +*link_start_gnu: + + +*link_start_linux: + + +*link_start_netbsd: + + +*link_start_openbsd: +-Ttext 0x400074 + +*link_start_windiss: + + +*link_start_default: + + +*link_os: +%{mads : %(link_os_ads) ; myellowknife : %(link_os_yellowknife) ; mmvme : %(link_os_mvme) ; msim : %(link_os_sim) ; mwindiss : %(link_os_windiss) ; mcall-freebsd: %(link_os_freebsd) ; mcall-linux : %(link_os_linux) ; mcall-gnu : %(link_os_gnu) ; mcall-netbsd : %(link_os_netbsd) ; mcall-openbsd: %(link_os_openbsd) ; : %(link_os_default) } + +*link_os_ads: + + +*link_os_yellowknife: + + +*link_os_mvme: + + +*link_os_sim: +-m elf32ppcsim + +*link_os_freebsd: + %{p:%e`-p' not supported; use `-pg' and gprof(1)} %{Wl,*:%*} %{v:-V} %{assert*} %{R*} %{rpath*} %{defsym*} %{shared:-Bshareable %{h*} %{soname*}} %{!shared: %{!static: %{rdynamic: -export-dynamic} %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} %{static:-Bstatic}} %{symbolic:-Bsymbolic} + +*link_os_linux: +-m elf32ppclinux %{!shared: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}} + +*link_os_gnu: +-m elf32ppclinux %{!shared: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}} + +*link_os_netbsd: +%{!shared: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}} + +*link_os_openbsd: + + +*link_os_windiss: + + +*link_os_default: + + +*cc1_endian_big: + + +*cc1_endian_little: +%{!mstrict-align: %{!mno-strict-align: %{!mcall-i960-old: -mstrict-align } }} + +*cc1_endian_default: +%(cc1_endian_big) + +*cpp_os_ads: + + +*cpp_os_yellowknife: + + +*cpp_os_mvme: + + +*cpp_os_sim: + + +*cpp_os_freebsd: + -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ -Acpu=powerpc -Amachine=powerpc + +*cpp_os_gnu: +-D__unix__ -D__gnu_hurd__ -D__GNU__ %{!undef: %{!ansi: -Dunix -D__unix}} -Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT} + +*cpp_os_linux: +-D__unix__ -D__gnu_linux__ -D__linux__ %{!undef: %{!ansi: %{!std=*:-Dunix -D__unix -Dlinux -D__linux} %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} -Asystem=linux -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT} + +*cpp_os_netbsd: +-D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__ + +*cpp_os_openbsd: +%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS} + +*cpp_os_windiss: +-D__rtasim -D__EABI__ -D__ppc %{!msoft-float: -D__hardfp} + +*cpp_os_default: + + +*fbsd_dynamic_linker: +/usr/libexec/ld-elf.so.1 + +*link_command: +%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) %l %{pie:-pie} %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:} %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov} %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}} %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}} + diff --git a/dkp-scripts/build-crtls.sh b/dkp-scripts/build-crtls.sh new file mode 100644 index 0000000..4a6a954 --- /dev/null +++ b/dkp-scripts/build-crtls.sh @@ -0,0 +1,17 @@ +DEVKITPPC=$INSTALLDIR + +#--------------------------------------------------------------------------------- +# Install and build the gamecube crt and libogc +#--------------------------------------------------------------------------------- + +echo "installing specs ..." +cp `pwd`/dkp-crtls/gcn* $DEVKITPPC/$target/lib/ +cp `pwd`/dkp-crtls/ogc.ld $DEVKITPPC/$target/lib/ +cp `pwd`/dkp-crtls/specs $DEVKITPPC/lib/gcc/$target/$GCC_VER/specs + +echo "building libogc ..." +cd $LIBOGC_SRCDIR +$MAKE +echo "installing libogc ..." +$MAKE install + diff --git a/dkp-scripts/build-gcc.sh b/dkp-scripts/build-gcc.sh new file mode 100644 index 0000000..ea147b5 --- /dev/null +++ b/dkp-scripts/build-gcc.sh @@ -0,0 +1,47 @@ +prefix=$INSTALLDIR + +mkdir -p $target/binutils +cd $target/binutils + +../../$BINUTILS_SRCDIR/configure \ + --prefix=$prefix --target=$target --disable-nls --disable-shared --disable-debug \ + --disable-threads --with-gcc --with-gnu-as --with-gnu-ld --with-stabs \ + 2>&1 | tee binutils_configure.log + + +$MAKE | tee binutils_make.log 2>&1 +$MAKE install | tee binutils_install.log 2>&1 + +cd $BUILDSCRIPTDIR +mkdir -p $target/gcc +cd $target/gcc + +../../$GCC_SRCDIR/configure \ + --enable-languages=c,c++ \ + --with-cpu=750\ + --with-gcc --with-gnu-ld --with-gnu-as --with-stabs \ + --disable-nls --disable-shared --disable-threads --disable-multilib\ + --disable-win32-registry\ + --target=$target \ + --with-newlib \ + --prefix=$prefix -v\ + 2>&1 | tee gcc_configure.log + +$MAKE all-gcc | tee gcc_make.log 2>&1 +$MAKE install-gcc | tee gcc_install.log 2>&1 + +cd $BUILDSCRIPTDIR +mkdir -p $target/newlib +cd $target/newlib + +../../$NEWLIB_SRCDIR/configure --target=$target --prefix=$prefix | tee newlib_configure.log 2>&1 + +$MAKE all | tee newlib_make.log 2>&1 +$MAKE install | tee newlib_install.log 2>&1 + + +cd $BUILDSCRIPTDIR +cd $target/gcc + +$MAKE | tee gcc_final_make.log 2>&1 +$MAKE install | tee gcc_final_install.log 2>&1 diff --git a/patches/devkit-binutils-2.15.patch b/patches/devkit-binutils-2.15.patch new file mode 100644 index 0000000..3b62448 --- /dev/null +++ b/patches/devkit-binutils-2.15.patch @@ -0,0 +1,390 @@ +diff -Nbaur binutils-2.15/config.sub binutils-2.15-gekko/config.sub +--- binutils-2.15/config.sub Mon Jun 2 21:35:44 2003 ++++ binutils-2.15-gekko/config.sub Thu Jan 20 09:03:26 2005 +@@ -218,6 +218,10 @@ + basic_machine=m68k-atari + os=-mint + ;; ++ -gekko) ++ basic_machine=powerpc-eabi ++ os=-elf ++ ;; + esac + + # Decode aliases for certain CPU-COMPANY combinations. +diff -Nbaur binutils-2.15/bfd/doc/chew.c binutils-2.15-new/bfd/doc/chew.c +--- binutils-2.15/bfd/doc/chew.c Sun Jun 29 11:06:40 2003 ++++ binutils-2.15-new/bfd/doc/chew.c Thu Jan 20 20:16:18 2005 +@@ -91,6 +91,12 @@ + #define DEF_SIZE 5000 + #define STACK 50 + ++#ifdef __MINGW32__ ++/* Prevent \r\n\ line endings */ ++#include ++unsigned int _CRT_fmode = _O_BINARY; ++#endif ++ + int internal_wanted; + int internal_mode; + +diff -Nbaur binutils-2.15/gas/config/tc-ppc.c binutils-2.15-new/gas/config/tc-ppc.c +--- binutils-2.15/gas/config/tc-ppc.c Mon May 17 20:36:12 2004 ++++ binutils-2.15-new/gas/config/tc-ppc.c Fri Jan 21 00:28:36 2005 +@@ -310,6 +310,7 @@ + sdr1 has the value 25 + srr0 has the value 26 + srr1 has the value 27 ++ gqr0..7 has the value 912..919 + + The table is sorted. Suitable for searching by a binary search. */ + +@@ -407,6 +408,15 @@ + + { "fpscr", 0 }, + ++ { "gqr0", 912}, ++ { "gqr1", 913}, ++ { "gqr2", 914}, ++ { "gqr3", 915}, ++ { "gqr4", 916}, ++ { "gqr5", 917}, ++ { "gqr6", 918}, ++ { "gqr7", 919}, ++ + { "lr", 8 }, /* Link Register */ + + { "pmr", 0 }, +@@ -906,6 +916,9 @@ + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC + | PPC_OPCODE_64 | PPC_OPCODE_POWER4); + } ++ else if (strcmp (arg, "gekko") == 0) ++ ppc_cpu = PPC_OPCODE_CLASSIC | PPC_OPCODE_PPC | PPC_OPCODE_32 | PPC_OPCODE_GEKKO; ++ + /* -mcom means assemble for the common intersection between Power + and PowerPC. At present, we just allow the union, rather + than the intersection. */ +@@ -1107,7 +1120,9 @@ + -me500, -me500x2 generate code for Motorola e500 core complex\n\ + -mspe generate code for Motorola SPE instructions\n\ + -mregnames Allow symbolic names for registers\n\ +--mno-regnames Do not allow symbolic names for registers\n")); ++-mno-regnames Do not allow symbolic names for registers\n\ ++-mspe generate code for Motorola SPE instructions\n\ ++-mgekko generate code for PowerPC Gekko\n")); + #ifdef OBJ_ELF + fprintf (stream, _("\ + -mrelocatable support for GCC's -mrelocatble option\n\ +@@ -1150,6 +1165,8 @@ + else + ppc_cpu |= PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32; + } ++ else if (strcmp(default_cpu, "gekko") == 0) ++ ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32 | PPC_OPCODE_GEKKO; + else + as_fatal (_("Unknown default cpu = %s, os = %s"), + default_cpu, default_os); +@@ -2570,6 +2587,26 @@ + { + endc = ')'; + need_paren = 0; ++ if (opindex_ptr[1]) ++ { ++ /* do check here if we have further opcodes */ ++ if (*str != endc && (endc != ',' || *str != '\0')) ++ { ++ as_bad(_("syntax error; found `%c' but expected `%c'"),*str,endc); ++ break; ++ } ++ /* we have to move over whitespace ourselves */ ++ if (*str != '\0') ++ { ++ ++str; ++ while (ISSPACE(*str)) ++ { ++ ++str; ++ } ++ } ++ /* now we're looking for the comma */ ++ endc = ','; ++ } + } + else if ((operand->flags & PPC_OPERAND_PARENS) != 0) + { +@@ -2588,6 +2625,8 @@ + break; + } + ++ /* The call to expression should have advanced str past any ++ whitespace. */ + if (*str != '\0') + ++str; + } +diff -Nbaur binutils-2.15/include/opcode/ppc.h binutils-2.15-new/include/opcode/ppc.h +--- binutils-2.15/include/opcode/ppc.h Mon May 17 20:36:06 2004 ++++ binutils-2.15-new/include/opcode/ppc.h Thu Jan 20 19:54:34 2005 +@@ -134,6 +134,9 @@ + /* Opcode is supported by machine check APU. */ + #define PPC_OPCODE_RFMCI 0x800000 + ++/* Opcode is only supported by the PowerPC Gekko processor. */ ++#define PPC_OPCODE_GEKKO (040000000) ++ + /* A macro to extract the major opcode from an instruction. */ + #define PPC_OP(i) (((i) >> 26) & 0x3f) + +@@ -281,6 +284,10 @@ + /* This operand is for the DQ field in a DQ form instruction. */ + #define PPC_OPERAND_DQ (0100000) + ++/* This operand names a quantization register. The disassembler ++ prints these with a leading 'gqr'. */ ++#define PPC_OPERAND_GQR (040000) ++ + /* The POWER and PowerPC assemblers use a few macros. We keep them + with the operands table for simplicity. The macro table is an + array of struct powerpc_macro. */ +diff -Nbaur binutils-2.15/opcodes/ppc-dis.c binutils-2.15-new/opcodes/ppc-dis.c +--- binutils-2.15/opcodes/ppc-dis.c Mon May 17 20:35:56 2004 ++++ binutils-2.15-new/opcodes/ppc-dis.c Thu Jan 20 19:54:34 2005 +@@ -72,6 +72,13 @@ + dialect &= ~PPC_OPCODE_ALTIVEC; + } + else ++ if (info->disassembler_options ++ && (strstr (info->disassembler_options, "gekko") == 0)) ++ { ++ dialect |= PPC_OPCODE_GEKKO; ++ dialect &= ~PPC_OPCODE_ALTIVEC; ++ } ++ else + dialect |= (PPC_OPCODE_403 | PPC_OPCODE_601 | PPC_OPCODE_CLASSIC + | PPC_OPCODE_COMMON); + +@@ -247,6 +254,8 @@ + (*info->print_address_func) (memaddr + value, info); + else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0) + (*info->print_address_func) ((bfd_vma) value & 0xffffffff, info); ++ else if ((operand->flags & PPC_OPERAND_GQR) != 0) ++ (*info->fprintf_func) (info->stream, "gqr%ld", value); + else if ((operand->flags & PPC_OPERAND_CR) == 0 + || (dialect & PPC_OPCODE_PPC) == 0) + (*info->fprintf_func) (info->stream, "%ld", value); +@@ -312,4 +321,5 @@ + fprintf (stream, " power4 Disassemble the Power4 instructions\n"); + fprintf (stream, " 32 Do not disassemble 64-bit instructions\n"); + fprintf (stream, " 64 Allow disassembly of 64-bit instructions\n"); ++ fprintf (stream, " gekko Disassemble the Gamecube Gekko instructions\n"); + } +diff -Nbaur binutils-2.15/opcodes/ppc-opc.c binutils-2.15-new/opcodes/ppc-opc.c +--- binutils-2.15/opcodes/ppc-opc.c Mon May 17 20:35:56 2004 ++++ binutils-2.15-new/opcodes/ppc-opc.c Fri Jan 21 00:29:46 2005 +@@ -93,6 +93,13 @@ + static unsigned long insert_ev8 (unsigned long, long, int, const char **); + static long extract_ev8 (unsigned long, int, int *); + ++static unsigned long insert_psq_gd (unsigned long, long, int, const char **); ++static long extract_psq_gd (unsigned long, int, int *); ++static unsigned long insert_psq_gx (unsigned long, long, int, const char **); ++static long extract_psq_gx (unsigned long, int, int *); ++ ++ ++ + /* The operands table. + + The fields are bits, shift, insert, extract, flags. +@@ -554,6 +561,25 @@ + #define MTMSRD_L WS + 1 + { 1, 16, 0, 0, PPC_OPERAND_OPTIONAL }, + ++ /* I Field in psq_ instructions */ ++#define PSQ_DD MTMSRD_L + 1 ++ { 12, 0, 0, 0, PPC_OPERAND_PARENS|PPC_OPERAND_SIGNED }, ++ ++ /* W Field in psq_ instructions */ ++#define PSQ_WD PSQ_DD + 1 ++ { 1, 15, 0, 0, 0 }, ++ ++ /* d Field in psq_ instructions */ ++#define PSQ_GD PSQ_WD + 1 ++ { 10, 12, insert_psq_gd, extract_psq_gd, PPC_OPERAND_GQR }, ++ ++ /* I Field in psq_ instructions A*/ ++#define PSQ_WX PSQ_GD + 1 ++ { 1, 10, 0, 0, 0 }, ++ ++ /* W Field in psq_ instructions */ ++#define PSQ_GX PSQ_WX + 1 ++ { 10, 7, insert_psq_gx, extract_psq_gx, PPC_OPERAND_GQR }, + }; + + /* The functions used to insert and extract complicated operands. */ +@@ -1417,6 +1443,48 @@ + return ret; + } + ++static unsigned long ++insert_psq_gd (unsigned long insn, ++ long value, ++ int dialect ATTRIBUTE_UNUSED, ++ const char **errmsg) ++{ ++ if (value >= 912 && value <= 919) ++ value -= 912; ++ if (value < 0 || value > 7) ++ *errmsg = _("invalid quantization register"); ++ return insn | ((value & 7) << 12); ++} ++ ++static long ++extract_psq_gd (unsigned long insn, ++ int dialect ATTRIBUTE_UNUSED, ++ int *invalid ATTRIBUTE_UNUSED) ++{ ++ return ((insn & 0x7000) >> 12); ++} ++ ++static unsigned long ++insert_psq_gx (unsigned long insn, ++ long value, ++ int dialect ATTRIBUTE_UNUSED, ++ const char **errmsg) ++{ ++ if (value >= 912 && value <= 919) ++ value -= 912; ++ if (value < 0 || value > 7) ++ *errmsg = _("invalid quantization register"); ++ return insn | ((value & 7) << 7); ++} ++ ++static long ++extract_psq_gx (unsigned long insn, ++ int dialect ATTRIBUTE_UNUSED, ++ int *invalid ATTRIBUTE_UNUSED) ++{ ++ return ((insn & 0x380) >> 7); ++} ++ + /* Macros used to form opcodes. */ + + /* The main opcode. */ +@@ -1696,6 +1764,10 @@ + #define XUC(op, xop) (OP (op) | (((unsigned long)(xop)) & 0x1f)) + #define XUC_MASK XUC(0x3f, 0x1f) + ++/* A PSQ style load/store indexed */ ++#define PSQX(op, xop) (OP (op) | (((unsigned long)(xop)) & 0x7f)) ++#define PSQX_MASK PSQX(0x3f,0x7f) ++ + /* The BO encodings used in extended conditional branch mnemonics. */ + #define BODNZF (0x0) + #define BODNZFP (0x1) +@@ -1786,6 +1858,7 @@ + #define PPCCHLK PPC_OPCODE_CACHELCK + #define PPCCHLK64 PPC_OPCODE_CACHELCK | PPC_OPCODE_BOOKE64 + #define PPCRFMCI PPC_OPCODE_RFMCI ++#define PPCGEKKO PPC_OPCODE_GEKKO + + /* The opcode table. + +@@ -4558,6 +4631,99 @@ + + { "fcfid", XRC(63,846,0), XRA_MASK, PPC64, { FRT, FRB } }, + { "fcfid.", XRC(63,846,1), XRA_MASK, PPC64, { FRT, FRB } }, ++ ++/* GEKKO specific stuff */ ++{ "dcbz_l", X(4,1014), XRT_MASK, PPCGEKKO, { RA, RB }}, ++ ++{ "ps_abs", XRC(4,264,0), XRA_MASK, PPCGEKKO, { FRT,FRB }}, ++{ "ps_abs.", XRC(4,264,1), XRA_MASK, PPCGEKKO, { FRT,FRB }}, ++ ++{ "ps_add", A(4,21,0), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB }}, ++{ "ps_add.", A(4,21,1), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB }}, ++ ++{ "ps_cmpo0", X(4,32), X_MASK|(3<<21), PPCGEKKO, { BF, FRA, FRB }}, ++{ "ps_cmpo1", X(4,96), X_MASK|(3<<21), PPCGEKKO, { BF, FRA, FRB }}, ++ ++{ "ps_cmpu0", X(4,0), X_MASK|(3<<21), PPCGEKKO, { BF, FRA, FRB }}, ++{ "ps_cmpu1", X(4,64), X_MASK|(3<<21), PPCGEKKO, { BF, FRA, FRB }}, ++ ++{ "ps_div", A(4,18,0), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB }}, ++{ "ps_div.", A(4,18,1), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB }}, ++ ++{ "ps_madd", A(4,29,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++{ "ps_madd.", A(4,29,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++ ++{ "ps_madds0", A(4,14,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++{ "ps_madds0.", A(4,14,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++ ++{ "ps_madds1", A(4,15,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++{ "ps_madds1.", A(4,15,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++ ++{ "ps_merge00", XRC(4,528,0), X_MASK, PPCGEKKO, { FRT,FRA,FRB }}, ++{ "ps_merge00.", XRC(4,528,1), X_MASK, PPCGEKKO, { FRT,FRA,FRB }}, ++ ++{ "ps_merge01", XRC(4,560,0), X_MASK, PPCGEKKO, { FRT,FRA,FRB }}, ++{ "ps_merge01.", XRC(4,560,1), X_MASK, PPCGEKKO, { FRT,FRA,FRB }}, ++ ++{ "ps_merge10", XRC(4,592,0), X_MASK, PPCGEKKO, { FRT,FRA,FRB }}, ++{ "ps_merge10.", XRC(4,592,1), X_MASK, PPCGEKKO, { FRT,FRA,FRB }}, ++ ++{ "ps_merge11", XRC(4,624,0), X_MASK, PPCGEKKO, { FRT,FRA,FRB }}, ++{ "ps_merge11.", XRC(4,624,1), X_MASK, PPCGEKKO, { FRT,FRA,FRB }}, ++ ++{ "ps_mr", XRC(4,72,0), XRA_MASK, PPCGEKKO, { FRT, FRB }}, ++{ "ps_mr.", XRC(4,72,1), XRA_MASK, PPCGEKKO, { FRT, FRB }}, ++ ++{ "ps_msub", A(4,28,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++{ "ps_msub.", A(4,28,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++ ++{ "ps_mul", A(4,25,0), AFRB_MASK, PPCGEKKO, { FRT,FRA,FRC }}, ++{ "ps_mul.", A(4,25,1), AFRB_MASK, PPCGEKKO, { FRT,FRA,FRC }}, ++ ++{ "ps_muls0", A(4,12,0), AFRB_MASK, PPCGEKKO, { FRT,FRA,FRC }}, ++{ "ps_muls0.", A(4,12,1), AFRB_MASK, PPCGEKKO, { FRT,FRA,FRC }}, ++ ++{ "ps_muls1", A(4,13,0), AFRB_MASK, PPCGEKKO, { FRT,FRA,FRC }}, ++{ "ps_muls1.", A(4,13,1), AFRB_MASK, PPCGEKKO, { FRT,FRA,FRC }}, ++ ++{ "ps_nabs", XRC(4,136,0), XRA_MASK, PPCGEKKO, { FRT, FRB }}, ++{ "ps_nabs.", XRC(4,136,1), XRA_MASK, PPCGEKKO, { FRT, FRB }}, ++ ++{ "ps_neg", XRC(4,40,0), XRA_MASK, PPCGEKKO, { FRT, FRB }}, ++{ "ps_neg.", XRC(4,40,1), XRA_MASK, PPCGEKKO, { FRT, FRB }}, ++ ++{ "ps_nmadd", A(4,31,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++{ "ps_nmadd.", A(4,31,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++ ++{ "ps_nmsub", A(4,30,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++{ "ps_nmsub.", A(4,30,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++ ++{ "ps_res", A(4,13,0), AFRAFRC_MASK, PPCGEKKO, { FRT,FRB }}, ++{ "ps_res.", A(4,13,1), AFRAFRC_MASK, PPCGEKKO, { FRT,FRB }}, ++ ++{ "ps_rsqrte", A(4,26,0), AFRAFRC_MASK, PPCGEKKO, { FRT,FRB }}, ++{ "ps_rsqrte.", A(4,26,1), AFRAFRC_MASK, PPCGEKKO, { FRT,FRB }}, ++ ++{ "ps_sel", A(4,23,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++{ "ps_sel.", A(4,23,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++ ++{ "ps_sub", A(4,20,0), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB }}, ++{ "ps_sub.", A(4,20,1), AFRC_MASK, PPCGEKKO, { FRT, FRA, FRB }}, ++ ++{ "ps_sum0", A(4,10,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++{ "ps_sum0.", A(4,10,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++ ++{ "ps_sum1", A(4,11,0), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++{ "ps_sum1.", A(4,11,1), A_MASK, PPCGEKKO, { FRT,FRA,FRC,FRB }}, ++ ++{ "psq_l", OP(56), OP_MASK, PPCGEKKO, { FRT,PSQ_DD,RA,PSQ_WD,PSQ_GD }}, ++{ "psq_lu", OP(57), OP_MASK, PPCGEKKO, { FRT,PSQ_DD,RA,PSQ_WD,PSQ_GD }}, ++{ "psq_lux", PSQX(4,76),PSQX_MASK, PPCGEKKO, { FRT,RA,RB,PSQ_WX,PSQ_GX }}, ++{ "psq_lx", PSQX(4,12),PSQX_MASK, PPCGEKKO, { FRT,RA,RB,PSQ_WX,PSQ_GX }}, ++{ "psq_st", OP(60), OP_MASK, PPCGEKKO, { FRT,PSQ_DD,RA,PSQ_WD,PSQ_GD }}, ++{ "psq_stu", OP(61), OP_MASK, PPCGEKKO, { FRT,PSQ_DD,RA,PSQ_WD,PSQ_GD }}, ++{ "psq_stux", PSQX(4,78), PSQX_MASK, PPCGEKKO, { FRT,RA,RB,PSQ_WX,PSQ_GX }}, ++{ "psq_stx", PSQX(4,14), PSQX_MASK, PPCGEKKO, { FRT,RA,RB,PSQ_WX,PSQ_GX }}, + + }; + diff --git a/patches/devkit-gcc-3.4.3.patch b/patches/devkit-gcc-3.4.3.patch new file mode 100644 index 0000000..66e06d4 --- /dev/null +++ b/patches/devkit-gcc-3.4.3.patch @@ -0,0 +1,11772 @@ +diff -Nbaur gcc-3.4.3/config.sub gcc-3.4.3-new/config.sub +--- gcc-3.4.3/config.sub Sun Feb 22 14:44:23 2004 ++++ gcc-3.4.3-new/config.sub Fri Jan 21 10:25:50 2005 +@@ -219,6 +219,10 @@ + basic_machine=m68k-atari + os=-mint + ;; ++ -gekko) ++ basic_machine=powerpc-eabi ++ os=-elf ++ ;; + esac + + # Decode aliases for certain CPU-COMPANY combinations. +diff -Nbaur gcc-3.4.3/gcc/Makefile.in gcc-3.4.3-new/gcc/Makefile.in +--- gcc-3.4.3/gcc/Makefile.in Mon Oct 18 17:00:39 2004 ++++ gcc-3.4.3-new/gcc/Makefile.in Fri Jan 21 10:25:50 2005 +@@ -138,7 +138,7 @@ + # TCFLAGS is used for compilations with the GCC just built. + XCFLAGS = + TCFLAGS = +-CFLAGS = -g ++CFLAGS = -g0 + STAGE1_CFLAGS = -g @stage1_cflags@ + BOOT_CFLAGS = -g -O2 + +@@ -441,6 +441,7 @@ + gcc_gxx_include_dir = @gcc_gxx_include_dir@ + # Directory to search for site-specific includes. + local_includedir = $(local_prefix)/include ++# local_includedir=$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include + includedir = $(prefix)/include + # where the info files go + infodir = @infodir@ +diff -Nbaur gcc-3.4.3/gcc/c-format.c gcc-3.4.3-new/gcc/c-format.c +--- gcc-3.4.3/gcc/c-format.c Sat Dec 20 00:00:27 2003 ++++ gcc-3.4.3-new/gcc/c-format.c Fri Jan 21 10:25:50 2005 +@@ -31,6 +31,7 @@ + #include "diagnostic.h" + #include "langhooks.h" + ++ + /* Set format warning options according to a -Wformat=n option. */ + + void +@@ -509,6 +510,9 @@ + { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 }, + { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L }, + { "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, ++#ifdef __MINGW32__ ++ { "I64", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, ++#endif + { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 }, + { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, + { "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 }, +@@ -543,6 +547,9 @@ + { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 }, + { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L }, + { "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, ++#ifdef __MINGW32__ ++ { "I64", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, ++#endif + { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 }, + { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, + { "t", FMT_LEN_t, STD_C99, NULL, 0, 0 }, +@@ -568,7 +575,9 @@ + { '0', 0, 0, N_("`0' flag"), N_("the `0' printf flag"), STD_C89 }, + { '-', 0, 0, N_("`-' flag"), N_("the `-' printf flag"), STD_C89 }, + { '\'', 0, 0, N_("`'' flag"), N_("the `'' printf flag"), STD_EXT }, ++#ifndef __MINGW32__ + { 'I', 0, 0, N_("`I' flag"), N_("the `I' printf flag"), STD_EXT }, ++#endif + { 'w', 0, 0, N_("field width"), N_("field width in printf format"), STD_C89 }, + { 'p', 0, 0, N_("precision"), N_("precision in printf format"), STD_C89 }, + { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 }, +@@ -638,7 +647,9 @@ + { 'w', 0, 0, N_("field width"), N_("field width in scanf format"), STD_C89 }, + { 'L', 0, 0, N_("length modifier"), N_("length modifier in scanf format"), STD_C89 }, + { '\'', 0, 0, N_("`'' flag"), N_("the `'' scanf flag"), STD_EXT }, ++#ifndef __MINGW32__ + { 'I', 0, 0, N_("`I' flag"), N_("the `I' scanf flag"), STD_EXT }, ++#endif + { 0, 0, 0, NULL, NULL, 0 } + }; + +@@ -917,11 +928,18 @@ + { NULL, 0, 0, NOLENGTHS, NULL, NULL } + }; + ++#ifdef __MINGW32__ ++#define PRINTF_FLAG_CHARS " +#0-'" ++#define SCANF_FLAG_CHARS "*'" ++#else ++#define PRINTF_FLAG_CHARS " +#0-'I" ++#define SCANF_FLAG_CHARS "*'I" ++#endif + + /* This must be in the same order as enum format_type. */ + static const format_kind_info format_types_orig[] = + { +- { "printf", printf_length_specs, print_char_table, " +#0-'I", NULL, ++ { "printf", printf_length_specs, print_char_table, PRINTF_FLAG_CHARS, NULL, + printf_flag_specs, printf_flag_pairs, + FMT_FLAG_ARG_CONVERT|FMT_FLAG_DOLLAR_MULTIPLE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_EMPTY_PREC_OK, + 'w', 0, 'p', 0, 'L', +@@ -951,7 +969,7 @@ + 0, 0, 'p', 0, 'L', + NULL, &integer_type_node + }, +- { "scanf", scanf_length_specs, scan_char_table, "*'I", NULL, ++ { "scanf", scanf_length_specs, scan_char_table, SCANF_FLAG_CHARS, NULL, + scanf_flag_specs, scanf_flag_pairs, + FMT_FLAG_ARG_CONVERT|FMT_FLAG_SCANF_A_KLUDGE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_ZERO_WIDTH_BAD|FMT_FLAG_DOLLAR_GAP_POINTER_OK, + 'w', 0, 0, '*', 'L', +@@ -1929,7 +1947,13 @@ + { + while (fli->name != 0 && fli->name[0] != *format_chars) + fli++; +- if (fli->name != 0) ++ if (fli->name != 0 ++#ifdef __MINGW32__ ++ /* Only accept "I64", not 'I' by itself. */ ++ && (format_chars[0] != 'I' ++ || (format_chars[1] == '6' && format_chars[2] == '4')) ++#endif ++ ) + { + format_chars++; + if (fli->double_name != 0 && fli->name[0] == *format_chars) +@@ -1941,6 +1965,10 @@ + } + else + { ++#ifdef __MINGW32__ ++ if (fli->name[0] == 'I') ++ format_chars += 2; ++#endif + length_chars = fli->name; + length_chars_val = fli->index; + length_chars_std = fli->std; +diff -Nbaur gcc-3.4.3/gcc/collect2.c gcc-3.4.3-new/gcc/collect2.c +--- gcc-3.4.3/gcc/collect2.c Tue Mar 9 15:49:56 2004 ++++ gcc-3.4.3-new/gcc/collect2.c Fri Jan 21 10:25:50 2005 +@@ -30,24 +30,13 @@ + #include "system.h" + #include "coretypes.h" + #include "tm.h" ++#include "pex-read.h" ++ + #include + #if ! defined( SIGCHLD ) && defined( SIGCLD ) + # define SIGCHLD SIGCLD + #endif + +-#ifdef vfork /* Autoconf may define this to fork for us. */ +-# define VFORK_STRING "fork" +-#else +-# define VFORK_STRING "vfork" +-#endif +-#ifdef HAVE_VFORK_H +-#include +-#endif +-#ifdef VMS +-#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \ +- lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1) +-#endif /* VMS */ +- + #ifndef LIBRARY_PATH_ENV + #define LIBRARY_PATH_ENV "LIBRARY_PATH" + #endif +@@ -67,7 +56,6 @@ + cross-versions are in the proper directories. */ + + #ifdef CROSS_COMPILE +-#undef SUNOS4_SHARED_LIBRARIES + #undef OBJECT_FORMAT_COFF + #undef MD_EXEC_PREFIX + #undef REAL_LD_FILE_NAME +@@ -140,7 +128,7 @@ + fprintf ((STREAM), "void _GLOBAL__DD() {\n\t%s();\n}\n", (FUNC)) + #endif + +-#if defined (LDD_SUFFIX) || SUNOS4_SHARED_LIBRARIES ++#ifdef LDD_SUFFIX + #define SCAN_LIBRARIES + #endif + +@@ -255,7 +243,9 @@ + static void add_prefix (struct path_prefix *, const char *); + static void prefix_from_env (const char *, struct path_prefix *); + static void prefix_from_string (const char *, struct path_prefix *); ++static int collect_status (const char *, int status); + static void do_wait (const char *); ++static void do_read_wait (const char *, FILE *); + static void fork_execute (const char *, char **); + static void maybe_unlink (const char *); + static void add_to_list (struct head *, const char *); +@@ -424,7 +414,11 @@ + #endif + + signal (signo, SIG_DFL); ++#if HAVE_KILL + kill (getpid (), signo); ++#else ++ raise (signo); ++#endif + } + + +@@ -1456,14 +1450,11 @@ + } + + +-/* Wait for a process to finish, and exit if a nonzero status is found. */ ++/* Handle error status returned by a finished process. */ + +-int +-collect_wait (const char *prog) ++static int ++collect_status (const char *prog, int status) + { +- int status; +- +- pwait (pid, &status, 0); + if (status) + { + if (WIFSIGNALED (status)) +@@ -1481,6 +1472,17 @@ + return 0; + } + ++/* Wait for a process to finish, and exit if a nonzero status is found. */ ++ ++int ++collect_wait (const char *prog) ++{ ++ int status; ++ ++ pwait (pid, &status, 0); ++ return collect_status (prog, status); ++} ++ + static void + do_wait (const char *prog) + { +@@ -1492,6 +1494,19 @@ + } + } + ++static void ++do_read_wait (const char *prog, FILE *inf) ++{ ++ int status; ++ ++ pex_read_close (pid, inf, &status, 0); ++ status = collect_status (prog, status); ++ if (status != 0) ++ { ++ error ("%s returned %d exit status", prog, status); ++ collect_exit (status); ++ } ++} + + /* Execute a program, and wait for the reply. */ + +@@ -1532,7 +1547,7 @@ + if (redir) + { + /* Open response file. */ +- redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT); ++ redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, S_IWUSR); + + /* Duplicate the stdout and stderr file handles + so they can be restored later. */ +@@ -1995,9 +2010,10 @@ + char *real_nm_argv[4]; + const char **nm_argv = (const char **) real_nm_argv; + int argc = 0; +- int pipe_fd[2]; + char *p, buf[1024]; + FILE *inf; ++ char *errmsg_fmt; ++ char *errmsg_arg; + + if (which_pass == PASS_SECOND) + return; +@@ -2013,13 +2029,6 @@ + nm_argv[argc++] = prog_name; + nm_argv[argc++] = (char *) 0; + +- if (pipe (pipe_fd) < 0) +- fatal_perror ("pipe"); +- +- inf = fdopen (pipe_fd[0], "r"); +- if (inf == (FILE *) 0) +- fatal_perror ("fdopen"); +- + /* Trace if needed. */ + if (vflag) + { +@@ -2035,36 +2044,16 @@ + fflush (stdout); + fflush (stderr); + +- /* Spawn child nm on pipe. */ +- pid = vfork (); +- if (pid == -1) +- fatal_perror (VFORK_STRING); +- +- if (pid == 0) /* child context */ +- { +- /* setup stdout */ +- if (dup2 (pipe_fd[1], 1) < 0) +- fatal_perror ("dup2 %d 1", pipe_fd[1]); +- +- if (close (pipe_fd[0]) < 0) +- fatal_perror ("close %d", pipe_fd[0]); +- +- if (close (pipe_fd[1]) < 0) +- fatal_perror ("close %d", pipe_fd[1]); +- +- execv (nm_file_name, real_nm_argv); +- fatal_perror ("execv %s", nm_file_name); +- } ++ inf = pex_read (nm_file_name, real_nm_argv, nm_file_name, NULL, ++ &errmsg_fmt, &errmsg_arg, 0, &pid); ++ if (inf == (FILE *) 0) ++ fatal_perror (errmsg_fmt, errmsg_arg); + +- /* Parent context from here on. */ + int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN); + #ifdef SIGQUIT + quit_handler = (void (*) (int)) signal (SIGQUIT, SIG_IGN); + #endif + +- if (close (pipe_fd[1]) < 0) +- fatal_perror ("close %d", pipe_fd[1]); +- + if (debug) + fprintf (stderr, "\nnm output with constructors/destructors.\n"); + +@@ -2137,10 +2126,7 @@ + if (debug) + fprintf (stderr, "\n"); + +- if (fclose (inf) != 0) +- fatal_perror ("fclose"); +- +- do_wait (nm_file_name); ++ do_read_wait (nm_file_name, inf); + + signal (SIGINT, int_handler); + #ifdef SIGQUIT +@@ -2148,269 +2134,6 @@ + #endif + } + +-#if SUNOS4_SHARED_LIBRARIES +- +-/* Routines to scan the SunOS 4 _DYNAMIC structure to find shared libraries +- that the output file depends upon and their initialization/finalization +- routines, if any. */ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-/* pointers to the object file */ +-unsigned object; /* address of memory mapped file */ +-unsigned objsize; /* size of memory mapped to file */ +-char * code; /* pointer to code segment */ +-char * data; /* pointer to data segment */ +-struct nlist *symtab; /* pointer to symbol table */ +-struct link_dynamic *ld; +-struct link_dynamic_2 *ld_2; +-struct head libraries; +- +-/* Map the file indicated by NAME into memory and store its address. */ +- +-static void +-mapfile (const char *name) +-{ +- int fp; +- struct stat s; +- if ((fp = open (name, O_RDONLY)) == -1) +- fatal ("unable to open file '%s'", name); +- if (fstat (fp, &s) == -1) +- fatal ("unable to stat file '%s'", name); +- +- objsize = s.st_size; +- object = (unsigned) mmap (0, objsize, PROT_READ|PROT_WRITE, MAP_PRIVATE, +- fp, 0); +- if (object == (unsigned)-1) +- fatal ("unable to mmap file '%s'", name); +- +- close (fp); +-} +- +-/* Helpers for locatelib. */ +- +-static const char *libname; +- +-static int +-libselect (struct direct *d) +-{ +- return (strncmp (libname, d->d_name, strlen (libname)) == 0); +-} +- +-/* If one file has an additional numeric extension past LIBNAME, then put +- that one first in the sort. If both files have additional numeric +- extensions, then put the one with the higher number first in the sort. +- +- We must verify that the extension is numeric, because Sun saves the +- original versions of patched libraries with a .FCS extension. Files with +- invalid extensions must go last in the sort, so that they will not be used. */ +- +-static int +-libcompare (struct direct **d1, struct direct **d2) +-{ +- int i1, i2 = strlen (libname); +- char *e1 = (*d1)->d_name + i2; +- char *e2 = (*d2)->d_name + i2; +- +- while (*e1 && *e2 && *e1 == '.' && *e2 == '.' +- && e1[1] && ISDIGIT (e1[1]) && e2[1] && ISDIGIT (e2[1])) +- { +- ++e1; +- ++e2; +- i1 = strtol (e1, &e1, 10); +- i2 = strtol (e2, &e2, 10); +- if (i1 != i2) +- return i1 - i2; +- } +- +- if (*e1) +- { +- /* It has a valid numeric extension, prefer this one. */ +- if (*e1 == '.' && e1[1] && ISDIGIT (e1[1])) +- return 1; +- /* It has an invalid numeric extension, must prefer the other one. */ +- else +- return -1; +- } +- else if (*e2) +- { +- /* It has a valid numeric extension, prefer this one. */ +- if (*e2 == '.' && e2[1] && ISDIGIT (e2[1])) +- return -1; +- /* It has an invalid numeric extension, must prefer the other one. */ +- else +- return 1; +- } +- else +- return 0; +-} +- +-/* Given the name NAME of a dynamic dependency, find its pathname and add +- it to the list of libraries. */ +- +-static void +-locatelib (const char *name) +-{ +- static const char **l; +- static int cnt; +- char buf[MAXPATHLEN]; +- char *p, *q; +- const char **pp; +- +- if (l == 0) +- { +- char *ld_rules; +- char *ldr = 0; +- /* counting elements in array, need 1 extra for null */ +- cnt = 1; +- ld_rules = (char *) (ld_2->ld_rules + code); +- if (ld_rules) +- { +- cnt++; +- for (; *ld_rules != 0; ld_rules++) +- if (*ld_rules == ':') +- cnt++; +- ld_rules = (char *) (ld_2->ld_rules + code); +- ldr = xstrdup (ld_rules); +- } +- p = getenv ("LD_LIBRARY_PATH"); +- q = 0; +- if (p) +- { +- cnt++; +- for (q = p ; *q != 0; q++) +- if (*q == ':') +- cnt++; +- q = xstrdup (p); +- } +- l = xmalloc ((cnt + 3) * sizeof (char *)); +- pp = l; +- if (ldr) +- { +- *pp++ = ldr; +- for (; *ldr != 0; ldr++) +- if (*ldr == ':') +- { +- *ldr++ = 0; +- *pp++ = ldr; +- } +- } +- if (q) +- { +- *pp++ = q; +- for (; *q != 0; q++) +- if (*q == ':') +- { +- *q++ = 0; +- *pp++ = q; +- } +- } +- /* built in directories are /lib, /usr/lib, and /usr/local/lib */ +- *pp++ = "/lib"; +- *pp++ = "/usr/lib"; +- *pp++ = "/usr/local/lib"; +- *pp = 0; +- } +- libname = name; +- for (pp = l; *pp != 0 ; pp++) +- { +- struct direct **namelist; +- int entries; +- if ((entries = scandir (*pp, &namelist, libselect, libcompare)) > 0) +- { +- sprintf (buf, "%s/%s", *pp, namelist[entries - 1]->d_name); +- add_to_list (&libraries, buf); +- if (debug) +- fprintf (stderr, "%s\n", buf); +- break; +- } +- } +- if (*pp == 0) +- { +- if (debug) +- notice ("not found\n"); +- else +- fatal ("dynamic dependency %s not found", name); +- } +-} +- +-/* Scan the _DYNAMIC structure of the output file to find shared libraries +- that it depends upon and any constructors or destructors they contain. */ +- +-static void +-scan_libraries (const char *prog_name) +-{ +- struct exec *header; +- char *base; +- struct link_object *lo; +- char buff[MAXPATHLEN]; +- struct id *list; +- +- mapfile (prog_name); +- header = (struct exec *)object; +- if (N_BADMAG (*header)) +- fatal ("bad magic number in file '%s'", prog_name); +- if (header->a_dynamic == 0) +- return; +- +- code = (char *) (N_TXTOFF (*header) + (long) header); +- data = (char *) (N_DATOFF (*header) + (long) header); +- symtab = (struct nlist *) (N_SYMOFF (*header) + (long) header); +- +- if (header->a_magic == ZMAGIC && header->a_entry == 0x20) +- { +- /* shared object */ +- ld = (struct link_dynamic *) (symtab->n_value + code); +- base = code; +- } +- else +- { +- /* executable */ +- ld = (struct link_dynamic *) data; +- base = code-PAGSIZ; +- } +- +- if (debug) +- notice ("dynamic dependencies.\n"); +- +- ld_2 = (struct link_dynamic_2 *) ((long) ld->ld_un.ld_2 + (long)base); +- for (lo = (struct link_object *) ld_2->ld_need; lo; +- lo = (struct link_object *) lo->lo_next) +- { +- char *name; +- lo = (struct link_object *) ((long) lo + code); +- name = (char *) (code + lo->lo_name); +- if (lo->lo_library) +- { +- if (debug) +- fprintf (stderr, "\t-l%s.%d => ", name, lo->lo_major); +- sprintf (buff, "lib%s.so.%d.%d", name, lo->lo_major, lo->lo_minor); +- locatelib (buff); +- } +- else +- { +- if (debug) +- fprintf (stderr, "\t%s\n", name); +- add_to_list (&libraries, name); +- } +- } +- +- if (debug) +- fprintf (stderr, "\n"); +- +- /* Now iterate through the library list adding their symbols to +- the list. */ +- for (list = libraries.first; list; list = list->next) +- scan_prog_file (list->name, PASS_LIB); +-} +- +-#else /* SUNOS4_SHARED_LIBRARIES */ + #ifdef LDD_SUFFIX + + /* Use the List Dynamic Dependencies program to find shared libraries that +@@ -2427,9 +2150,10 @@ + char *real_ldd_argv[4]; + const char **ldd_argv = (const char **) real_ldd_argv; + int argc = 0; +- int pipe_fd[2]; + char buf[1024]; + FILE *inf; ++ char *errmsg_fmt; ++ char *errmsg_arg; + + /* If we do not have an `ldd', complain. */ + if (ldd_file_name == 0) +@@ -2464,26 +2188,10 @@ + fflush (stdout); + fflush (stderr); + +- /* Spawn child ldd on pipe. */ +- pid = vfork (); +- if (pid == -1) +- fatal_perror (VFORK_STRING); +- +- if (pid == 0) /* child context */ +- { +- /* setup stdout */ +- if (dup2 (pipe_fd[1], 1) < 0) +- fatal_perror ("dup2 %d 1", pipe_fd[1]); +- +- if (close (pipe_fd[0]) < 0) +- fatal_perror ("close %d", pipe_fd[0]); +- +- if (close (pipe_fd[1]) < 0) +- fatal_perror ("close %d", pipe_fd[1]); +- +- execv (ldd_file_name, real_ldd_argv); +- fatal_perror ("execv %s", ldd_file_name); +- } ++ inf = pex_read (ldd_file_name, real_ldd_argv, ldd_file_name, NULL, ++ &errmsg_fmt, &errmsg_arg, 0, &pid); ++ if (inf == (FILE *) 0) ++ fatal_perror (errmsg_fmt, errmsg_arg); + + /* Parent context from here on. */ + int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN); +@@ -2491,9 +2199,6 @@ + quit_handler = (void (*) (int)) signal (SIGQUIT, SIG_IGN); + #endif + +- if (close (pipe_fd[1]) < 0) +- fatal_perror ("close %d", pipe_fd[1]); +- + if (debug) + notice ("\nldd output with constructors/destructors.\n"); + +@@ -2530,10 +2235,7 @@ + if (debug) + fprintf (stderr, "\n"); + +- if (fclose (inf) != 0) +- fatal_perror ("fclose"); +- +- do_wait (ldd_file_name); ++ do_read_wait (ldd_file_name, inf); + + signal (SIGINT, int_handler); + #ifdef SIGQUIT +@@ -2547,7 +2249,6 @@ + } + + #endif /* LDD_SUFFIX */ +-#endif /* SUNOS4_SHARED_LIBRARIES */ + + #endif /* OBJECT_FORMAT_NONE */ + +diff -Nbaur gcc-3.4.3/gcc/config/arm/arm.md gcc-3.4.3-new/gcc/config/arm/arm.md +--- gcc-3.4.3/gcc/config/arm/arm.md Wed Aug 25 16:46:19 2004 ++++ gcc-3.4.3-new/gcc/config/arm/arm.md Fri Jan 21 10:25:50 2005 +@@ -7205,6 +7205,12 @@ + { + if (TARGET_CALLER_INTERWORKING) + return \"bl\\t%__interwork_call_via_%0\"; ++ else if (arm_arch5) ++ return \"blx\\t%0\"; ++ else if (TARGET_LONG_CALLS) ++ /* For long calls the __call_via functions might not be near ++ this branch, so we have to synthesise their actions. */ ++ return \"bl\\t0f\\n\\tb\\t1f\\n0:\\tbx\\t%0\\n1:\"; + else + return \"bl\\t%__call_via_%0\"; + }" +@@ -7222,6 +7228,12 @@ + { + if (TARGET_CALLER_INTERWORKING) + return \"bl\\t%__interwork_call_via_%1\"; ++ else if (arm_arch5) ++ return \"blx\\t%1\"; ++ else if (TARGET_LONG_CALLS) ++ /* For long calls the __call_via functions might not be near ++ this branch, so we have to synthesise their actions. */ ++ return \"bl\\t0f\\n\\tb\\t1f\\n0:\\tbx\\t%1\\n1:\"; + else + return \"bl\\t%__call_via_%1\"; + }" +diff -Nbaur gcc-3.4.3/gcc/config/arm/t-arm-elf gcc-3.4.3-new/gcc/config/arm/t-arm-elf +--- gcc-3.4.3/gcc/config/arm/t-arm-elf Tue Sep 30 11:21:41 2003 ++++ gcc-3.4.3-new/gcc/config/arm/t-arm-elf Fri Jan 21 10:25:50 2005 +@@ -26,9 +26,9 @@ + # MULTILIB_DIRNAMES += 32bit 26bit + # MULTILIB_EXCEPTIONS += *mthumb/*mapcs-26* + # +-# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork +-# MULTILIB_DIRNAMES += normal interwork +-# MULTILIB_EXCEPTIONS += *mapcs-26/*mthumb-interwork* ++MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork ++MULTILIB_DIRNAMES += normal interwork ++MULTILIB_EXCEPTIONS += *mapcs-26/*mthumb-interwork* + # + # MULTILIB_OPTIONS += fno-leading-underscore/fleading-underscore + # MULTILIB_DIRNAMES += elf under +diff -Nbaur gcc-3.4.3/gcc/config/i386/cygming.h gcc-3.4.3-new/gcc/config/i386/cygming.h +--- gcc-3.4.3/gcc/config/i386/cygming.h Tue Jun 8 07:30:13 2004 ++++ gcc-3.4.3-new/gcc/config/i386/cygming.h Fri Jan 21 10:25:50 2005 +@@ -251,7 +251,7 @@ + unit may not be bound to undefined symbols in another translation unit + without user intervention. For instance, under Microsoft Windows + symbols must be explicitly imported from shared libraries (DLLs). */ +-#define MULTIPLE_SYMBOL_SPACES ++#define MULTIPLE_SYMBOL_SPACES 1 + + extern void i386_pe_unique_section (TREE, int); + #define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section +@@ -308,7 +308,7 @@ + /* DWARF2 Unwinding doesn't work with exception handling yet. To make + it work, we need to build a libgcc_s.dll, and dcrt0.o should be + changed to call __register_frame_info/__deregister_frame_info. */ +-#define DWARF2_UNWIND_INFO 0 ++#define DWARF2_UNWIND_INFO 1 + + /* Don't assume anything about the header files. */ + #define NO_IMPLICIT_EXTERN_C +diff -Nbaur gcc-3.4.3/gcc/config/i386/i386.c gcc-3.4.3-new/gcc/config/i386/i386.c +--- gcc-3.4.3/gcc/config/i386/i386.c Wed Aug 25 06:19:08 2004 ++++ gcc-3.4.3-new/gcc/config/i386/i386.c Fri Jan 21 10:25:50 2005 +@@ -5242,7 +5242,7 @@ + GEN_INT (-allocate), -1); + else + { +- /* Only valid for Win32. */ ++ /* Only valid for Win32 */ + rtx eax = gen_rtx_REG (SImode, 0); + bool eax_live = ix86_eax_live_at_start_p (); + +diff -Nbaur gcc-3.4.3/gcc/config/i386/mingw32-1.c gcc-3.4.3-new/gcc/config/i386/mingw32-1.c +--- gcc-3.4.3/gcc/config/i386/mingw32-1.c Thu Jan 1 00:00:00 1970 ++++ gcc-3.4.3-new/gcc/config/i386/mingw32-1.c Fri Jan 21 10:25:50 2005 +@@ -0,0 +1,41 @@ ++/* This replaces the use of stat and struct stat.st_ino to determine if ++ files are different in gcc.c (do_spec_1) handling of --save-temps ++ switch. ++ Contributed by Danny Smith (dannysmith@users.sourceforge.net) ++ Copyright 2003 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify it under ++the terms of the GNU General Public License as published by the Free ++Software Foundation; either version 2, or (at your option) any later ++version. ++ ++GCC is distributed in the hope that it will be useful, but WITHOUT ANY ++WARRANTY; without even the implied warranty of MERCHANTABILITY or ++FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING. If not, write to the Free ++Software Foundation, 59 Temple Place - Suite 330, Boston, MA ++02111-1307, USA. */ ++ ++#include "config/i386/xm-mingw32.h" ++#define WIN32_LEAN_AND_MEAN ++#include ++ ++/* Return non-zero if src and dst filenames do not refer to same files. */ ++ ++int ++w32_file_id_cmp (const char * src, const char * dst) ++{ ++ char fullpath_src[MAX_PATH]; ++ char fullpath_dst[MAX_PATH]; ++ char* pfilename; ++ ++ /* Just compare full pathnames, without regard to case. */ ++ GetFullPathName (src, MAX_PATH, fullpath_src, &pfilename); ++ GetFullPathName (dst, MAX_PATH, fullpath_dst, &pfilename); ++ return (lstrcmpi (fullpath_src, fullpath_dst)); ++} +diff -Nbaur gcc-3.4.3/gcc/config/i386/mingw32.h gcc-3.4.3-new/gcc/config/i386/mingw32.h +--- gcc-3.4.3/gcc/config/i386/mingw32.h Fri Sep 26 04:46:06 2003 ++++ gcc-3.4.3-new/gcc/config/i386/mingw32.h Fri Jan 21 10:25:50 2005 +@@ -67,7 +67,11 @@ + + #undef STARTFILE_SPEC + #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \ +- %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s}" ++ %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s} \ ++ %{!fno-exceptions:crtbegin%O%s}" ++ ++#undef ENDFILE_SPEC ++#define ENDFILE_SPEC "%{!fno-exceptions:crtend%O%s}" + + /* An additional prefix to try after the standard prefixes. */ + #undef MD_STARTFILE_PREFIX +@@ -104,3 +108,4 @@ + /* Define as short unsigned for compatibility with MS runtime. */ + #undef WINT_TYPE + #define WINT_TYPE "short unsigned int" ++ +diff -Nbaur gcc-3.4.3/gcc/config/i386/t-cygming gcc-3.4.3-new/gcc/config/i386/t-cygming +--- gcc-3.4.3/gcc/config/i386/t-cygming Tue Sep 23 19:55:59 2003 ++++ gcc-3.4.3-new/gcc/config/i386/t-cygming Fri Jan 21 10:25:50 2005 +@@ -10,6 +10,8 @@ + # first. + LIBGCC2_INCLUDES = -I$(srcdir)/../winsup/w32api/include + ++LIB2FUNCS_EXTRA = $(srcdir)/config/i386/w32-shared-ptr.c ++ + winnt.o: $(srcdir)/config/i386/winnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ + $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) +diff -Nbaur gcc-3.4.3/gcc/config/i386/t-mingw32 gcc-3.4.3-new/gcc/config/i386/t-mingw32 +--- gcc-3.4.3/gcc/config/i386/t-mingw32 Tue Jun 11 06:25:44 2002 ++++ gcc-3.4.3-new/gcc/config/i386/t-mingw32 Fri Jan 21 10:25:51 2005 +@@ -1,7 +1,8 @@ + # + # collect2 doesn't work for i386-mingw32* yet. + # +-USE_COLLECT2= ++#USE_COLLECT2= + + # We hide calls to w32api needed for w32 thread support here: +-LIB2FUNCS_EXTRA = $(srcdir)/config/i386/gthr-win32.c ++LIB2FUNCS_EXTRA += $(srcdir)/config/i386/gthr-win32.c ++ +diff -Nbaur gcc-3.4.3/gcc/config/i386/w32-shared-ptr.c gcc-3.4.3-new/gcc/config/i386/w32-shared-ptr.c +--- gcc-3.4.3/gcc/config/i386/w32-shared-ptr.c Thu Jan 1 00:00:00 1970 ++++ gcc-3.4.3-new/gcc/config/i386/w32-shared-ptr.c Fri Jan 21 10:25:51 2005 +@@ -0,0 +1,244 @@ ++/* ++ * w32-shared-ptr.c ++ * ++ * Share informations between EXE/DLLs without using an ++ * additional DLL. ++ * ++ * Contributors: ++ * Created by Adriano dos Santos Fernandes ++ * Enhanced by Thomas Pfaff ++ * ++ * THIS SOFTWARE IS NOT COPYRIGHTED ++ * ++ * This source code is offered for use in the public domain. You may ++ * use, modify or distribute it freely. ++ * ++ * This code is distributed in the hope that it will be useful but ++ * WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY ++ * DISCLAMED. This includes but is not limited to warrenties of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ * ++ */ ++ ++#ifdef __MINGW32__ ++#undef _CRTIMP ++#define _CRTIMP ++#endif ++ ++#include ++#include ++#ifdef __CYGWIN__ ++#include ++#endif ++#ifdef DEBUG ++#include ++#endif ++ ++#include "tconfig.h" ++#include "tsystem.h" ++#include "gthr.h" ++ ++#include "w32-shared-ptr.h" ++ ++#if defined (__CYGWIN__) /* FIXME: This shouldn't be necessary. */ ++typedef unsigned short ATOM; ++ATOM __attribute__ ((stdcall)) AddAtomA(const char*); ++ATOM __attribute__ ((stdcall)) FindAtomA(const char*); ++unsigned int __attribute__ ((stdcall)) GetAtomNameA(ATOM,char*,int); ++#else ++#define WIN32_LEAN_AND_MEAN ++#include ++#endif ++ ++W32_EH_SHARED * __w32_sharedptr; ++ ++void ** __w32_sharedptr_terminate; ++void ** __w32_sharedptr_unexpected; ++ ++ ++#define W32_ATOM_SUFFIX "-LIBGCCW32-EH" ++ ++#ifdef __USING_SJLJ_EXCEPTIONS__ ++#define SJLJ_SUFFIX "-SJLJ" ++#else ++#define SJLJ_SUFFIX ++#endif ++ ++#if __GTHREADS ++#define GTHR_SUFFIX "-GTHR" ++#else ++#define GTHR_SUFFIX ++#endif ++ ++#ifdef __CYGWIN__ ++#define SYS_SUFFIX "-CYGWIN" ++#else ++#define SYS_SUFFIX "-MINGW32" ++#endif ++ ++static const char w32_atom_suffix[] = W32_ATOM_SUFFIX SJLJ_SUFFIX GTHR_SUFFIX SYS_SUFFIX; ++ ++#define SHAREDPTR_BIT1 'A' ++#define SHAREDPTR_BIT0 'a' ++ ++#define SHAREDPTR_BITS (sizeof(W32_EH_SHARED*)*8) ++#define SHARED_ATOM_NAME_LEN (SHAREDPTR_BITS + sizeof(w32_atom_suffix)) ++ ++static ATOM __w32_sharedptr_set (W32_EH_SHARED *w32_sharedptr); ++static W32_EH_SHARED * __w32_sharedptr_get (ATOM atom); ++static void __w32_sharedptr_default_unexpected(void); ++ ++#ifdef __CYGWIN__ ++static void __w32_sharedptr_fixup_after_fork (void); ++#endif ++ ++static void __w32_sharedptr_default_unexpected(void) ++{ ++ ((void(*)(void))__w32_sharedptr->terminate)(); ++} ++ ++static void __w32_eh_shared_initialize (W32_EH_SHARED *w32_sharedptr) ++{ ++#ifdef __GTHREAD_MUTEX_INIT ++ static __gthread_mutex_t dw2_object_mutex = __GTHREAD_MUTEX_INIT; ++#else ++ static __gthread_mutex_t dw2_object_mutex; ++#endif ++#ifdef __GTHREAD_MUTEX_INIT_FUNCTION ++ static __gthread_once_t dw2_once = __GTHREAD_ONCE_INIT; ++#endif ++ ++#ifdef __USING_SJLJ_EXCEPTIONS__ ++#if __GTHREADS ++ static __gthread_key_t sjl_fc_key; ++ static __gthread_once_t sjl_once = __GTHREAD_ONCE_INIT; ++#endif ++#endif ++ ++ memset (w32_sharedptr, 0, sizeof(W32_EH_SHARED)); ++ ++ w32_sharedptr->size = sizeof(W32_EH_SHARED); ++ ++ w32_sharedptr->terminate = (void*)abort; ++ w32_sharedptr->unexpected = (void*)__w32_sharedptr_default_unexpected; ++ ++ w32_sharedptr->dw2_object_mutex = dw2_object_mutex; ++#ifdef __GTHREAD_MUTEX_INIT_FUNCTION ++ w32_sharedptr->dw2_once = dw2_once; ++#endif ++ ++#ifdef __USING_SJLJ_EXCEPTIONS__ ++ w32_sharedptr->sjlj_fc_static = NULL; ++#if __GTHREADS ++ w32_sharedptr->sjlj_fc_key = sjl_fc_key; ++ w32_sharedptr->sjlj_use_fc_key = -1; ++ w32_sharedptr->sjlj_once = sjl_once; ++#endif ++#endif ++} ++ ++void __w32_sharedptr_initialize (void) ++{ ++ W32_EH_SHARED *w32_sharedptr; ++ char s[SHARED_ATOM_NAME_LEN]; ++ ATOM atom; ++ ++ if (__w32_sharedptr) ++ return; ++ ++ memset (s, SHAREDPTR_BIT1, SHAREDPTR_BITS); ++ memcpy (&(s[SHAREDPTR_BITS]), w32_atom_suffix, sizeof(w32_atom_suffix)); ++ ++ atom = FindAtomA (s); ++ if (atom) ++ w32_sharedptr = __w32_sharedptr_get (atom); ++ else ++ { ++ w32_sharedptr = (W32_EH_SHARED *) malloc (sizeof(W32_EH_SHARED)); ++ if (!w32_sharedptr) ++ abort (); ++ ++ __w32_eh_shared_initialize (w32_sharedptr); ++ ++ if (__w32_sharedptr_set (w32_sharedptr)) ++ { ++#ifdef __CYGWIN__ ++ /* recreate atom after fork */ ++ pthread_atfork (NULL,NULL,__w32_sharedptr_fixup_after_fork); ++#endif ++ } ++ else ++ { ++ free (w32_sharedptr); ++ w32_sharedptr = __w32_sharedptr_get (FindAtomA (s)); ++ } ++ } ++ ++ __w32_sharedptr_terminate = &w32_sharedptr->terminate; ++ __w32_sharedptr_unexpected = &w32_sharedptr->unexpected; ++ ++ /* THIS MUST BE THE LAST STEP */ ++ __w32_sharedptr = w32_sharedptr; ++} ++ ++static ATOM __w32_sharedptr_set (W32_EH_SHARED *w32_sharedptr) ++{ ++ int i; ++ int bit; ++ char s[SHARED_ATOM_NAME_LEN]; ++ ATOM atom; ++ ++ /* This should optimize out entirely by O2 */ ++ if (sizeof(bit) != sizeof(w32_sharedptr)) ++ abort (); ++ ++ for (i = SHAREDPTR_BITS - 1, bit = 1; i >= 0; --i, bit <<= 1) ++ s[i] = ((int)w32_sharedptr) & bit ? SHAREDPTR_BIT1 : ++ SHAREDPTR_BIT0; ++ ++ memcpy (&(s[SHAREDPTR_BITS]), w32_atom_suffix, sizeof(w32_atom_suffix)); ++ ++ atom = AddAtomA (s); ++ /* Sanity check to avoid race by concurrent initialization */ ++ if (!atom || __w32_sharedptr_get (atom) != w32_sharedptr) ++ return 0; ++ ++#ifdef DEBUG ++ printf ("%s: set sharedptr: (%p):%s\n", ++ __FUNCTION__,w32_sharedptr, s); ++#endif ++ ++ return atom; ++} ++ ++static W32_EH_SHARED *__w32_sharedptr_get (ATOM atom) ++{ ++ W32_EH_SHARED *w32_sharedptr = NULL; ++ int i; ++ int bit; ++ char s[SHARED_ATOM_NAME_LEN]; ++ ++ /* If this fails something went wrong */ ++ if (!GetAtomNameA (atom, s, sizeof(s))) ++ abort (); ++ ++ for (i = SHAREDPTR_BITS - 1, bit = 1; i >= 0; --i, bit <<= 1) ++ (int)w32_sharedptr |= s[i] == SHAREDPTR_BIT1 ? bit : 0; ++ ++ if (w32_sharedptr->size != sizeof(W32_EH_SHARED)) ++ abort (); ++ ++#ifdef DEBUG ++ printf ("%s: got sharedptr (%p): %s\n", ++ __FUNCTION__, w32_sharedptr, s); ++#endif ++ return w32_sharedptr; ++} ++ ++#ifdef __CYGWIN__ ++static void __w32_sharedptr_fixup_after_fork (void) ++{ ++ if (!__w32_sharedptr_set (__w32_sharedptr)) ++ abort (); ++} ++#endif +diff -Nbaur gcc-3.4.3/gcc/config/i386/w32-shared-ptr.h gcc-3.4.3-new/gcc/config/i386/w32-shared-ptr.h +--- gcc-3.4.3/gcc/config/i386/w32-shared-ptr.h Thu Jan 1 00:00:00 1970 ++++ gcc-3.4.3-new/gcc/config/i386/w32-shared-ptr.h Fri Jan 21 10:25:51 2005 +@@ -0,0 +1,65 @@ ++/* ++ * w32-shared-ptr.h ++ * ++ * Contributors: ++ * Created by Thomas Pfaff ++ * ++ * THIS SOFTWARE IS NOT COPYRIGHTED ++ * ++ * This source code is offered for use in the public domain. You may ++ * use, modify or distribute it freely. ++ * ++ * This code is distributed in the hope that it will be useful but ++ * WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY ++ * DISCLAMED. This includes but is not limited to warrenties of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ * ++ */ ++ ++#ifndef GCC_W32_SHARED_PTR_H ++#define GCC_W32_SHARED_PTR_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++typedef struct ++{ ++ int size; ++ ++ void *terminate; ++ void *unexpected; ++ ++ void *dw2_unseen_objects; ++ void *dw2_seen_objects; ++ __gthread_mutex_t dw2_object_mutex; ++#ifdef __GTHREAD_MUTEX_INIT_FUNCTION ++ __gthread_once_t dw2_once; ++#endif ++ const void *dw2_marker; ++ ++#ifdef __USING_SJLJ_EXCEPTIONS__ ++ void* sjlj_fc_static; ++#if __GTHREADS ++ __gthread_key_t sjlj_fc_key; ++ int sjlj_use_fc_key; ++ __gthread_once_t sjlj_once; ++#endif ++#endif ++ ++} W32_EH_SHARED; ++ ++extern W32_EH_SHARED *__w32_sharedptr; ++ ++extern void ** __w32_sharedptr_terminate; ++extern void ** __w32_sharedptr_unexpected; ++ ++extern void __w32_sharedptr_initialize (void); ++ ++#define W32_SHAREDPTR_INITIALIZE() if (!__w32_sharedptr) __w32_sharedptr_initialize () ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -Nbaur gcc-3.4.3/gcc/config/i386/winnt.c gcc-3.4.3-new/gcc/config/i386/winnt.c +--- gcc-3.4.3/gcc/config/i386/winnt.c Tue Mar 23 23:18:31 2004 ++++ gcc-3.4.3-new/gcc/config/i386/winnt.c Fri Jan 21 10:25:51 2005 +@@ -262,7 +262,8 @@ + } + + /* Don't allow definitions of static data members in dllimport class, +- Just ignore attribute for vtable data. */ ++ If vtable data is marked as DECL_EXTERNAL, import it; otherwise just ++ ignore the attribute. */ + else if (TREE_CODE (decl) == VAR_DECL + && TREE_STATIC (decl) && TREE_PUBLIC (decl) + && !DECL_EXTERNAL (decl) && context_imp) +@@ -347,6 +348,13 @@ + + XEXP (DECL_RTL (decl), 0) = + gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp)); ++ ++#if 0 ++ /* If we are keeping inline functions, make sure we export ++ the function definition even if not used. */ ++ if (flag_keep_inline_functions && TREE_CODE (decl) == FUNCTION_DECL) ++ mark_referenced (DECL_ASSEMBLER_NAME (decl)); ++#endif + } + + /* Mark a DECL as being dllimport'd. */ +@@ -559,7 +567,7 @@ + return str; + } + +-/* Also strip the stdcall suffix. */ ++/* Also strip the fastcall prefix and stdcall suffix. */ + + const char * + i386_pe_strip_name_encoding_full (const char *str) +@@ -567,6 +575,11 @@ + const char *p; + const char *name = i386_pe_strip_name_encoding (str); + ++ /* Strip leading '@' on fastcall symbols. */ ++ if (*name == '@') ++ name++; ++ ++ /* Strip trailing '@n'. */ + p = strchr (name, '@'); + if (p) + return ggc_alloc_string (name, p - name); +@@ -598,9 +611,9 @@ + } + } + else if ((name[0] == FASTCALL_PREFIX) +- || (strncmp (name, DLL_EXPORT_PREFIX, strlen (DLL_EXPORT_PREFIX) ++ || (strncmp (name, DLL_EXPORT_PREFIX, strlen (DLL_EXPORT_PREFIX)) + == 0 +- && name[strlen (DLL_EXPORT_PREFIX)] == FASTCALL_PREFIX))) ++ && name[strlen (DLL_EXPORT_PREFIX)] == FASTCALL_PREFIX)) + /* A fastcall symbol. */ + { + fprintf (stream, "%s", +@@ -828,7 +841,7 @@ + struct extern_list *p; + + ix86_file_end (); +- ++ if (write_symbols != SDB_DEBUG) + for (p = extern_head; p != NULL; p = p->next) + { + tree decl; +diff -Nbaur gcc-3.4.3/gcc/config/i386/x-mingw32 gcc-3.4.3-new/gcc/config/i386/x-mingw32 +--- gcc-3.4.3/gcc/config/i386/x-mingw32 Wed May 28 22:06:23 2003 ++++ gcc-3.4.3-new/gcc/config/i386/x-mingw32 Fri Jan 21 10:25:51 2005 +@@ -2,3 +2,26 @@ + # Make local_includedir relative to EXEC_PREFIX + # + local_includedir=$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include ++STMP_FIXINC= ++# ++# host runtime lib's printf uses 'I64' format specifier prefix instead ++# of 'll' for HOST_WIDEST_INT_PRINT_*. See hwint.h. ++# Avoid warnings while bootstrapping. ++# ++bt-load.o-warn = -Wno-format ++cfg.o-warn = -Wno-format ++gcov-dump.o-warn = -Wno-format ++gcov.o-warn = -Wno-format ++loop-unroll.o-warn = -Wno-format ++predict.o-warn = -Wno-format ++profile.o-warn = -Wno-format ++ ++# ++# For HOST_FILE_ID_CMP for mingw32. ++# ++EXTRA_GCC_OBJS = mingw32-1.o ++ ++mingw32-1.o: $(srcdir)/config/i386/mingw32-1.c \ ++ $(srcdir)/config/i386/xm-mingw32.h ++ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ ++ $(srcdir)/config/i386/mingw32-1.c +diff -Nbaur gcc-3.4.3/gcc/config/i386/x-mingw32.patch gcc-3.4.3-new/gcc/config/i386/x-mingw32.patch +--- gcc-3.4.3/gcc/config/i386/x-mingw32.patch Thu Jan 1 00:00:00 1970 ++++ gcc-3.4.3-new/gcc/config/i386/x-mingw32.patch Fri Jan 21 10:25:51 2005 +@@ -0,0 +1,10 @@ ++--- x-mingw32.orig Sat May 15 18:33:41 2004 +++++ x-mingw32 Tue May 11 13:17:28 2004 ++@@ -2,6 +2,7 @@ ++ # Make local_includedir relative to EXEC_PREFIX ++ # ++ local_includedir=$(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include +++STMP_FIXINC= ++ # ++ # host runtime lib's printf uses 'I64' format specifier prefix instead ++ # of 'll' for HOST_WIDEST_INT_PRINT_*. See hwint.h. +diff -Nbaur gcc-3.4.3/gcc/config/i386/xm-mingw32.h gcc-3.4.3-new/gcc/config/i386/xm-mingw32.h +--- gcc-3.4.3/gcc/config/i386/xm-mingw32.h Sat Jan 31 06:18:23 2004 ++++ gcc-3.4.3-new/gcc/config/i386/xm-mingw32.h Fri Jan 21 10:25:51 2005 +@@ -27,3 +27,18 @@ + + /* This is the name of the null device on windows. */ + #define HOST_BIT_BUCKET "nul" ++ ++/* Windows way to build quoted strings for COLLECT_GCC_OPTIONS ++ environment variable. */ ++#define HOST_QUOTE_STR "\"" ++#define HOST_QUOTE_CHAR '"' ++#define HOST_QUOTED_QUOTE_STR "\"\\\"\"" ++ ++/* Override the default of "ll" in hwint.t. */ ++#define HOST_LL_PREFIX "I64" ++ ++/* This replaces the use of stat to determine if files are different ++ in gcc.c (do_spec_1) handling of --save-temps switch. */ ++extern int ++w32_file_id_cmp (const char *, const char *); ++#define HOST_FILE_ID_CMP(SRC,DST) w32_file_id_cmp (SRC, DST) +diff -Nbaur gcc-3.4.3/gcc/config/rs6000/rs6000.c gcc-3.4.3-new/gcc/config/rs6000/rs6000.c +--- gcc-3.4.3/gcc/config/rs6000/rs6000.c Fri Oct 22 20:19:35 2004 ++++ gcc-3.4.3-new/gcc/config/rs6000/rs6000.c Fri Jan 21 10:57:02 2005 +@@ -10526,19 +10526,24 @@ + : gen_adddi3 (breg, breg, delta_rtx)); + src = gen_rtx_MEM (mode, breg); + } +- +- /* We have now address involving an base register only. +- If we use one of the registers to address memory, +- we have change that register last. */ +- +- breg = (GET_CODE (XEXP (src, 0)) == PLUS +- ? XEXP (XEXP (src, 0), 0) +- : XEXP (src, 0)); +- +- if (!REG_P (breg)) +- abort(); +- +- if (REGNO (breg) >= REGNO (dst) ++ else if (! offsettable_memref_p (src)) ++ { ++ rtx newsrc, basereg; ++ basereg = gen_rtx_REG (Pmode, reg); ++ emit_insn (gen_rtx_SET (VOIDmode, basereg, XEXP (src, 0))); ++ newsrc = gen_rtx_MEM (GET_MODE (src), basereg); ++ MEM_COPY_ATTRIBUTES (newsrc, src); ++ src = newsrc; ++ } ++ ++ breg = XEXP (src, 0); ++ if (GET_CODE (breg) == PLUS || GET_CODE (breg) == LO_SUM) ++ breg = XEXP (breg, 0); ++ ++ /* If the base register we are using to address memory is ++ also a destination reg, then change that register last. */ ++ if (REG_P (breg) ++ && REGNO (breg) >= REGNO (dst) + && REGNO (breg) < REGNO (dst) + nregs) + j = REGNO (breg) - REGNO (dst); + } +@@ -10573,6 +10578,8 @@ + : gen_adddi3 (breg, breg, delta_rtx)); + dst = gen_rtx_MEM (mode, breg); + } ++ else if (! offsettable_memref_p (dst)) ++ abort (); + } + + for (i = 0; i < nregs; i++) +@@ -10582,7 +10589,7 @@ + if (j == nregs) + j = 0; + +- /* If compiler already emited move of first word by ++ /* If compiler already emitted move of first word by + store with update, no need to do anything. */ + if (j == 0 && used_update) + continue; +@@ -15200,6 +15207,17 @@ + rs6000_elf_in_small_data_p (tree decl) + { + if (rs6000_sdata == SDATA_NONE) ++ return false; ++ /* We want to merge strings, so we never consider them small data. */ ++ if (TREE_CODE (decl) == STRING_CST) ++ return false; ++ ++ /* Functions are never in the small data area. */ ++ if (TREE_CODE (decl) == FUNCTION_DECL) ++ return false; ++ ++ /* Thread-local vars can't go in the small data area. */ ++ if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl)) + return false; + + if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl)) +diff -Nbaur gcc-3.4.3/gcc/config/rs6000/sysv4.h gcc-3.4.3-new/gcc/config/rs6000/sysv4.h +--- gcc-3.4.3/gcc/config/rs6000/sysv4.h Mon Oct 18 03:24:20 2004 ++++ gcc-3.4.3-new/gcc/config/rs6000/sysv4.h Fri Jan 21 10:25:51 2005 +@@ -444,7 +444,7 @@ + (TARGET_RELOCATABLE || (flag_pic && DEFAULT_ABI != ABI_AIX) \ + ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"") + +-#define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\"" ++#define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"a\"" + #define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\"" + #define SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits" + +diff -Nbaur gcc-3.4.3/gcc/config.gcc gcc-3.4.3-new/gcc/config.gcc +--- gcc-3.4.3/gcc/config.gcc Wed Sep 8 16:16:10 2004 ++++ gcc-3.4.3-new/gcc/config.gcc Fri Jan 21 10:25:51 2005 +@@ -1163,6 +1163,8 @@ + xm_file=i386/xm-mingw32.h + tmake_file="i386/t-cygming i386/t-mingw32" + extra_objs=winnt.o ++ extra_parts="crtbegin.o crtend.o" ++ target_cpu_default=TARGET_CPU_DEFAULT_pentiumpro + if test x$enable_threads = xyes; then + thread_file='win32' + fi +diff -Nbaur gcc-3.4.3/gcc/config.host gcc-3.4.3-new/gcc/config.host +--- gcc-3.4.3/gcc/config.host Tue Oct 14 04:41:41 2003 ++++ gcc-3.4.3-new/gcc/config.host Fri Jan 21 10:25:51 2005 +@@ -135,6 +135,8 @@ + host_xm_file=i386/xm-mingw32.h + host_xmake_file=i386/x-mingw32 + host_exeext=.exe ++ host_extra_gcc_objs=mingw32-1.o ++ # host_extra_objs=w32_mmap_anon.o + ;; + i[34567]86-*-uwin*) + echo "*** UWIN may not be used as a host platform because" +diff -Nbaur gcc-3.4.3/gcc/cp/decl2.c gcc-3.4.3-new/gcc/cp/decl2.c +--- gcc-3.4.3/gcc/cp/decl2.c Mon Oct 11 15:42:36 2004 ++++ gcc-3.4.3-new/gcc/cp/decl2.c Fri Jan 21 10:25:51 2005 +@@ -1476,6 +1476,11 @@ + { + TREE_PUBLIC (decl) = 1; + DECL_EXTERNAL (decl) = 1; ++ /* If found and the class has dllimport attribute, commit to ++ marking the vtable as dllimport, We don't want to change ++ linkage when maybe_emit_vtable calls this with final true. */ ++ if (lookup_attribute ("dllimport", TYPE_ATTRIBUTES (type))) ++ DECL_INTERFACE_KNOWN (decl) = 1; + } + } + } +diff -Nbaur gcc-3.4.3/gcc/cp/parser.c gcc-3.4.3-new/gcc/cp/parser.c +--- gcc-3.4.3/gcc/cp/parser.c Thu Oct 28 06:28:20 2004 ++++ gcc-3.4.3-new/gcc/cp/parser.c Fri Jan 21 10:25:51 2005 +@@ -9279,7 +9279,7 @@ + declaration context. */ + + /* Warn about attributes. They are ignored. */ +- if (attributes) ++ if (attributes && extra_warnings) + warning ("type attributes are honored only at type definition"); + + type = xref_tag (tag_type, identifier, +diff -Nbaur gcc-3.4.3/gcc/cp/repo.c gcc-3.4.3-new/gcc/cp/repo.c +--- gcc-3.4.3/gcc/cp/repo.c Fri Dec 19 23:28:09 2003 ++++ gcc-3.4.3-new/gcc/cp/repo.c Fri Jan 21 10:25:51 2005 +@@ -1,5 +1,5 @@ + /* Code to maintain a C++ template repository. +- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003 ++ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. + Contributed by Jason Merrill (jason@cygnus.com) + +@@ -53,8 +53,8 @@ + + static struct obstack temporary_obstack; + +-#define IDENTIFIER_REPO_USED(NODE) (TREE_LANG_FLAG_3 (NODE)) +-#define IDENTIFIER_REPO_CHOSEN(NODE) (TREE_LANG_FLAG_4 (NODE)) ++#define IDENTIFIER_REPO_USED(NODE) (TREE_LANG_FLAG_5 (NODE)) ++#define IDENTIFIER_REPO_CHOSEN(NODE) (TREE_LANG_FLAG_6 (NODE)) + + #if 0 + /* Record the flags used to compile this translation unit. */ +@@ -223,7 +223,7 @@ + break; + else if (! inside && c == '\\') + backquote = 1; +- else if (c == '\'') ++ else if (c == HOST_QUOTE_CHAR) + inside = !inside; + else + obstack_1grow (&temporary_obstack, c); +diff -Nbaur gcc-3.4.3/gcc/crtstuff.c gcc-3.4.3-new/gcc/crtstuff.c +--- gcc-3.4.3/gcc/crtstuff.c Thu Oct 14 00:29:04 2004 ++++ gcc-3.4.3-new/gcc/crtstuff.c Fri Jan 21 10:25:51 2005 +@@ -134,6 +134,8 @@ + /* Likewise for _Jv_RegisterClasses. */ + extern void _Jv_RegisterClasses (void *) TARGET_ATTRIBUTE_WEAK; + ++#if !(defined (__MINGW32__) || defined (__CYGWIN__)) ++ + #ifdef OBJECT_FORMAT_ELF + + /* Declare a pointer to void function type. */ +@@ -542,3 +544,108 @@ + #else /* ! CRT_BEGIN && ! CRT_END */ + #error "One of CRT_BEGIN or CRT_END must be defined." + #endif ++ ++#else /*__MINGW32__ || __CYGWIN__ */ ++ ++/* Use __main to run ctors and dtors. This code generates a ++label for beginning of .eh_frame section in crtbegin.o and terminates ++the section in crtend.o. Registration and deregistration is done by ++installing ctor and dtor functions to do the job. */ ++ ++ ++#ifdef CRT_BEGIN ++ ++extern void __w32_sharedptr_initialize(void); ++ ++/* Stick a label at the beginning of the frame unwind info so we can ++ register/deregister it with the exception handling library code. */ ++#if defined (USE_EH_FRAME_REGISTRY) \ ++ && !__USING_SJLJ_EXCEPTIONS__ ++char __EH_FRAME_BEGIN__[] ++ __attribute__((section(EH_FRAME_SECTION_NAME), aligned(4))) ++ = { }; ++ ++static struct object obj; ++ ++/* These will pull in references from libgcc.a(unwind-dw2-fde.o) */ ++ ++void __do_frame_init (void); ++void __do_frame_fini (void); ++ ++void ++__do_frame_init (void) ++{ ++ __w32_sharedptr_initialize(); ++ __register_frame_info (__EH_FRAME_BEGIN__, &obj); ++} ++ ++void ++__do_frame_fini (void) ++{ ++ __deregister_frame_info (__EH_FRAME_BEGIN__); ++} ++#else /* USE_EH_FRAME_REGISTRY && !__USING_SJLJ__EXCEPTIONS__ */ ++void __do_sjlj_init (void); ++ ++void ++__do_sjlj_init (void) ++{ ++ __w32_sharedptr_initialize(); ++} ++#endif ++ ++ ++#elif defined CRT_END ++ ++/* Terminate the frame unwind info section with a 0 as a sentinel; ++ this would be the 'length' field in a real FDE. */ ++#if defined (USE_EH_FRAME_REGISTRY) \ ++ && !__USING_SJLJ_EXCEPTIONS__ ++static int __EH_FRAME_END__[] ++ __attribute__ ((unused, mode(SI), section(EH_FRAME_SECTION_NAME), ++ aligned(4))) ++ = { 0 }; ++static void __reg_frame_ctor (void) __attribute__ ((constructor)); ++static void __dereg_frame_dtor (void) __attribute__ ((destructor)); ++extern void __do_frame_init (void); ++extern void __do_frame_fini (void); ++ ++ ++/* Register the eh_frame. This has to be the first ctor to ++ be invoked so we put it in last. Since we're last, we can't ++ reference __register_frame_info in libgcc.a directly (if eh_frame ++ code has been referenced than it will have been pulled in but ++ we can't count on it) so we call a thunk in crtbegin.o. */ ++ ++static void ++__reg_frame_ctor (void) ++{ ++ __do_frame_init (); ++} ++ ++/* Deregister the eh_frame. This has to be the last dtor. The ++ call to __register_frame_info in crtbegin.o will have pulled in ++ libgcc.a(unwind-dw2-fde.o) if libgcc.a is static lib but not if ++ dll, so we use a thunk again to be sure. */ ++ ++static void ++__dereg_frame_dtor (void) ++{ ++ __do_frame_fini (); ++} ++#else ++static void __sjlj_init_ctor (void) __attribute__ ((constructor)); ++void __do_sjlj_init (void); ++static void ++__sjlj_init_ctor (void) ++{ ++ __do_sjlj_init (); ++} ++ ++#endif /* USE_EH_FRAME_REGISTRY && !__USING_SJLJ__EXCEPTIONS__ */ ++ ++#else /* ! CRT_BEGIN && ! CRT_END */ ++#error "One of CRT_BEGIN or CRT_END must be defined." ++#endif ++ ++#endif /* __MINGW32__ || __CYGWIN__ */ +diff -Nbaur gcc-3.4.3/gcc/doc/extend.texi gcc-3.4.3-new/gcc/doc/extend.texi +--- gcc-3.4.3/gcc/doc/extend.texi Mon Aug 23 19:02:58 2004 ++++ gcc-3.4.3-new/gcc/doc/extend.texi Fri Jan 21 10:25:51 2005 +@@ -3383,7 +3383,7 @@ + @item dllimport + The @code{dllimport} attribute is described in @xref{Function Attributes}. + +-@item dlexport ++@item dllexport + The @code{dllexport} attribute is described in @xref{Function Attributes}. + + @end table +diff -Nbaur gcc-3.4.3/gcc/doc/hostconfig.texi gcc-3.4.3-new/gcc/doc/hostconfig.texi +--- gcc-3.4.3/gcc/doc/hostconfig.texi Wed Jul 30 00:36:47 2003 ++++ gcc-3.4.3-new/gcc/doc/hostconfig.texi Fri Jan 21 10:25:51 2005 +@@ -196,7 +196,15 @@ + Define this macro if the host system has a small limit on the total + size of an argument vector. This causes the driver to take more care + not to pass unnecessary arguments to subprocesses. ++ ++@item HOST_LL_PREFIX ++Define this macro to be a C string representing the printf format prefix ++to specify output of long long types on your host machine. Hosts using ++the MS C runtime libs use the non-standard @samp{I64} prefix. If you do ++not define this macro, GCC will use the standard @samp{ll} prefix to ++format the printing of long long types. + @end ftable ++ + + In addition, if @command{configure} generates an incorrect definition of + any of the macros in @file{auto-host.h}, you can override that +diff -Nbaur gcc-3.4.3/gcc/doc/invoke.texi gcc-3.4.3-new/gcc/doc/invoke.texi +--- gcc-3.4.3/gcc/doc/invoke.texi Wed Oct 6 21:15:08 2004 ++++ gcc-3.4.3-new/gcc/doc/invoke.texi Fri Jan 21 10:25:51 2005 +@@ -497,7 +497,7 @@ + -m96bit-long-double -mregparm=@var{num} -momit-leaf-frame-pointer @gol + -mno-red-zone -mno-tls-direct-seg-refs @gol + -mcmodel=@var{code-model} @gol +--m32 -m64} ++-m32 -m64 -mstack-arg-probe} + + @emph{HPPA Options} + @gccoptlist{-march=@var{architecture-type} @gol +@@ -5992,9 +5992,10 @@ + saves one instruction in the caller since there is no need to pop + the arguments there. + +-This calling convention is incompatible with the one normally +-used on Unix, so you cannot use it if you need to call libraries +-compiled with the Unix compiler. ++@strong{Warning:} this calling convention is incompatible with the ++one normally used on Unix or with GCC, so you cannot use it if you ++need to call libraries compiled with the Unix compiler or with GCC ++without the switch. + + Also, you must provide function prototypes for all functions that + take variable numbers of arguments (including @code{printf}); +@@ -8554,6 +8555,16 @@ + Generate code for the large model: This model makes no assumptions + about addresses and sizes of sections. Currently GCC does not implement + this model. ++ ++@item -mstack-arg-probe ++@opindex mstack-arg-probe ++Emit code in function prologue to probe the stack when allocating more ++than CHECK_STACK_LIMIT bytes in one go. ++ ++Currently, this is the default on windows systems (cygwin and mingw32), ++which define CHECK_STACK_LIMIT as 4000. On these systems, touching the ++stack at 4K increments is necessary to ensure that the guard pages used ++by the OS virtual memory manger are allocated in correct sequence. + @end table + + @node HPPA Options +diff -Nbaur gcc-3.4.3/gcc/gcc.c gcc-3.4.3-new/gcc/gcc.c +--- gcc-3.4.3/gcc/gcc.c Wed Sep 8 16:16:11 2004 ++++ gcc-3.4.3-new/gcc/gcc.c Fri Jan 21 10:25:51 2005 +@@ -88,7 +88,7 @@ + #ifdef HAVE_SYS_RESOURCE_H + #include + #endif +-#if defined (HAVE_DECL_GETRUSAGE) && !HAVE_DECL_GETRUSAGE ++#if defined (HAVE_GETRUSAGE) && defined (HAVE_DECL_GETRUSAGE) && !HAVE_DECL_GETRUSAGE + extern int getrusage (int, struct rusage *); + #endif + +@@ -3169,7 +3169,7 @@ + (argc + 1) * sizeof (argv[0])); + new_argv[0] = new_argv0; + +- execvp (new_argv0, new_argv); ++ execvp (new_argv0, (const char *const *)new_argv); + fatal ("couldn't run `%s': %s", new_argv0, xstrerror (errno)); + } + +@@ -4105,29 +4105,31 @@ + if (switches[i].live_cond == SWITCH_IGNORE) + continue; + +- obstack_grow (&collect_obstack, "'-", 2); ++ obstack_grow (&collect_obstack, HOST_QUOTE_STR "-", 2); + q = switches[i].part1; +- while ((p = strchr (q, '\''))) ++ while ((p = strchr (q, HOST_QUOTE_CHAR))) + { + obstack_grow (&collect_obstack, q, p - q); +- obstack_grow (&collect_obstack, "'\\''", 4); ++ obstack_grow (&collect_obstack, HOST_QUOTED_QUOTE_STR, ++ strlen (HOST_QUOTED_QUOTE_STR)); + q = ++p; + } + obstack_grow (&collect_obstack, q, strlen (q)); +- obstack_grow (&collect_obstack, "'", 1); ++ obstack_grow (&collect_obstack, HOST_QUOTE_STR, 1); + + for (args = switches[i].args; args && *args; args++) + { +- obstack_grow (&collect_obstack, " '", 2); ++ obstack_grow (&collect_obstack, " " HOST_QUOTE_STR, 2); + q = *args; +- while ((p = strchr (q, '\''))) ++ while ((p = strchr (q, HOST_QUOTE_CHAR))) + { + obstack_grow (&collect_obstack, q, p - q); +- obstack_grow (&collect_obstack, "'\\''", 4); ++ obstack_grow (&collect_obstack, HOST_QUOTED_QUOTE_STR, ++ strlen (HOST_QUOTED_QUOTE_STR)); + q = ++p; + } + obstack_grow (&collect_obstack, q, strlen (q)); +- obstack_grow (&collect_obstack, "'", 1); ++ obstack_grow (&collect_obstack, HOST_QUOTE_STR, 1); + } + } + obstack_grow (&collect_obstack, "\0", 1); +@@ -4150,7 +4152,9 @@ + static int suffixed_basename_length; + static const char *input_basename; + static const char *input_suffix; ++#ifndef HOST_FILE_ID_CMP + static struct stat input_stat; ++#endif + static int input_stat_set; + + /* The compiler used to process the current input file. */ +@@ -4701,6 +4705,9 @@ + *((char *) temp_filename + temp_filename_length) = '\0'; + if (strcmp (temp_filename, input_filename) != 0) + { ++#if defined HOST_FILE_ID_CMP ++ if (HOST_FILE_ID_CMP(input_filename, temp_filename) != 0) ++#else + struct stat st_temp; + + /* Note, set_input() resets input_stat_set to 0. */ +@@ -4720,6 +4727,7 @@ + || stat (temp_filename, &st_temp) < 0 + || input_stat.st_dev != st_temp.st_dev + || input_stat.st_ino != st_temp.st_ino) ++#endif + { + temp_filename = save_string (temp_filename, + temp_filename_length + 1); +diff -Nbaur gcc-3.4.3/gcc/ggc.h gcc-3.4.3-new/gcc/ggc.h +--- gcc-3.4.3/gcc/ggc.h Sun Dec 21 14:08:33 2003 ++++ gcc-3.4.3-new/gcc/ggc.h Fri Jan 21 10:25:51 2005 +@@ -287,4 +287,8 @@ + extern int ggc_min_heapsize_heuristic (void); + extern void init_ggc_heuristics (void); + ++#if defined(_WIN32) && ! defined(__CYGWIN__) && ! defined (_UWIN) ++#define getpagesize() 4096 ++#endif ++ + #endif +diff -Nbaur gcc-3.4.3/gcc/ginclude/stdarg.h gcc-3.4.3-new/gcc/ginclude/stdarg.h +--- gcc-3.4.3/gcc/ginclude/stdarg.h Thu Mar 13 02:58:40 2003 ++++ gcc-3.4.3-new/gcc/ginclude/stdarg.h Fri Jan 21 10:25:51 2005 +@@ -30,6 +30,7 @@ + + #ifndef _STDARG_H + #ifndef _ANSI_STDARG_H_ ++#ifndef RC_INVOKED + #ifndef __need___va_list + #define _STDARG_H + #define _ANSI_STDARG_H_ +@@ -129,5 +130,6 @@ + + #endif /* _STDARG_H */ + ++#endif /* not RC_INVOKED */ + #endif /* not _ANSI_STDARG_H_ */ + #endif /* not _STDARG_H */ +diff -Nbaur gcc-3.4.3/gcc/hwint.h gcc-3.4.3-new/gcc/hwint.h +--- gcc-3.4.3/gcc/hwint.h Wed Jun 25 20:33:08 2003 ++++ gcc-3.4.3-new/gcc/hwint.h Fri Jan 21 10:25:51 2005 +@@ -15,6 +15,12 @@ + #define HOST_BITS_PER_INT (CHAR_BIT * SIZEOF_INT) + #define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG) + ++/* On some hosts, runtime printf does not use standard long long prefix. ++ This default can be overriden in host config file. */ ++#ifndef HOST_LL_PREFIX ++# define HOST_LL_PREFIX "ll" ++#endif ++ + /* If HAVE_LONG_LONG and SIZEOF_LONG_LONG aren't defined, but + GCC_VERSION >= 3000, assume this is the second or later stage of a + bootstrap, we do have long long, and it's 64 bits. (This is +@@ -74,10 +80,10 @@ + # define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx" + # endif + #else +-# define HOST_WIDE_INT_PRINT "ll" ++# define HOST_WIDE_INT_PRINT HOST_LL_PREFIX + # define HOST_WIDE_INT_PRINT_C "LL" + /* We can assume that 'long long' is at least 64 bits. */ +-# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%016llx" ++# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%" HOST_LL_PREFIX "x%016" HOST_LL_PREFIX "x" + #endif /* HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG */ + + #define HOST_WIDE_INT_PRINT_DEC "%" HOST_WIDE_INT_PRINT "d" +@@ -109,11 +115,11 @@ + #error "This line should be impossible to reach" + # endif + # endif +-# define HOST_WIDEST_INT_PRINT_DEC "%lld" +-# define HOST_WIDEST_INT_PRINT_DEC_C "%lldLL" +-# define HOST_WIDEST_INT_PRINT_UNSIGNED "%llu" +-# define HOST_WIDEST_INT_PRINT_HEX "0x%llx" +-# define HOST_WIDEST_INT_PRINT_DOUBLE_HEX "0x%llx%016llx" ++# define HOST_WIDEST_INT_PRINT_DEC "%" HOST_LL_PREFIX "d" ++# define HOST_WIDEST_INT_PRINT_DEC_C "%" HOST_LL_PREFIX "dLL" ++# define HOST_WIDEST_INT_PRINT_UNSIGNED "%" HOST_LL_PREFIX "u" ++# define HOST_WIDEST_INT_PRINT_HEX "0x%" HOST_LL_PREFIX "x" ++# define HOST_WIDEST_INT_PRINT_DOUBLE_HEX "0x%" HOST_LL_PREFIX "x%016" HOST_LL_PREFIX "x" + #endif + + #endif /* ! GCC_HWINT_H */ +diff -Nbaur gcc-3.4.3/gcc/libgcc2.c gcc-3.4.3-new/gcc/libgcc2.c +--- gcc-3.4.3/gcc/libgcc2.c Sun Sep 26 21:47:14 2004 ++++ gcc-3.4.3-new/gcc/libgcc2.c Fri Jan 21 10:25:51 2005 +@@ -1504,7 +1504,7 @@ + + /* Jump to a trampoline, loading the static chain address. */ + +-#if defined(WINNT) && ! defined(__CYGWIN__) && ! defined (_UWIN) ++#if defined(_WIN32) && ! defined(__CYGWIN__) && ! defined (_UWIN) + + long + getpagesize (void) +diff -Nbaur gcc-3.4.3/gcc/mklibgcc.in gcc-3.4.3-new/gcc/mklibgcc.in +--- gcc-3.4.3/gcc/mklibgcc.in Mon Oct 18 17:00:43 2004 ++++ gcc-3.4.3-new/gcc/mklibgcc.in Fri Jan 21 10:25:51 2005 +@@ -45,6 +45,7 @@ + echo 'srcdir = @srcdir@' + echo 'VPATH = @srcdir@' + echo 'EQ = =' ++echo 'INCLUDES += -I@srcdir@' + echo + echo 'force:' + echo +diff -Nbaur gcc-3.4.3/gcc/mklibgcc.in.patch gcc-3.4.3-new/gcc/mklibgcc.in.patch +--- gcc-3.4.3/gcc/mklibgcc.in.patch Thu Jan 1 00:00:00 1970 ++++ gcc-3.4.3-new/gcc/mklibgcc.in.patch Fri Jan 21 10:25:51 2005 +@@ -0,0 +1,10 @@ ++--- mklibgcc.in.orig Sat May 15 18:33:35 2004 +++++ mklibgcc.in Tue May 11 12:54:15 2004 ++@@ -39,6 +39,7 @@ ++ echo 'srcdir = @srcdir@' ++ echo 'VPATH = @srcdir@' ++ echo 'EQ = =' +++echo 'INCLUDES += -I@srcdir@' ++ echo ++ echo 'force:' ++ echo +diff -Nbaur gcc-3.4.3/gcc/stor-layout.c gcc-3.4.3-new/gcc/stor-layout.c +--- gcc-3.4.3/gcc/stor-layout.c Sat May 29 00:16:00 2004 ++++ gcc-3.4.3-new/gcc/stor-layout.c Fri Jan 21 10:25:51 2005 +@@ -1,6 +1,6 @@ + /* C-compiler utilities for types and variables storage layout + Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1996, 1998, +- 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ++ 1999, 2000, 2001, 2002, 2003. 2004 Free Software Foundation, Inc. + + This file is part of GCC. + +diff -Nbaur gcc-3.4.3/gcc/system.h gcc-3.4.3-new/gcc/system.h +--- gcc-3.4.3/gcc/system.h Mon Mar 15 23:22:47 2004 ++++ gcc-3.4.3-new/gcc/system.h Fri Jan 21 10:25:51 2005 +@@ -486,6 +486,19 @@ + #define HOST_BIT_BUCKET "/dev/null" + #endif + ++/* Defaults for building quoted strings for COLLECT_GCC_OPTIONS ++ environment variable. These work for POSIX-like hosts. */ ++ ++#ifndef HOST_QUOTE_STR ++#define HOST_QUOTE_STR "\'" ++#endif ++#ifndef HOST_QUOTE_CHAR ++#define HOST_QUOTE_CHAR '\'' ++#endif ++#ifndef HOST_QUOTED_QUOTE_STR ++#define HOST_QUOTED_QUOTE_STR "'\\''" ++#endif ++ + /* Be conservative and only use enum bitfields with GCC. + FIXME: provide a complete autoconf test for buggy enum bitfields. */ + +diff -Nbaur gcc-3.4.3/gcc/tlink.c gcc-3.4.3-new/gcc/tlink.c +--- gcc-3.4.3/gcc/tlink.c Sat Jul 19 15:47:14 2003 ++++ gcc-3.4.3-new/gcc/tlink.c Fri Jan 21 10:25:51 2005 +@@ -463,11 +463,20 @@ + } + fclose (stream); + fclose (output); +- rename (outname, f->key); ++ /* On Windows "rename" returns -1 and sets ERRNO to EACCESS if ++ the new file name already exists. Therefore, we explicitly ++ remove the old file first. */ ++ if (remove (f->key) == -1) ++ fatal_perror ("removing .rpo file"); ++ if (rename (outname, f->key) == -1) ++ fatal_perror ("renaming .rpo file"); + + obstack_grow (&temporary_obstack, "cd ", 3); + obstack_grow (&temporary_obstack, f->dir, strlen (f->dir)); +- obstack_grow (&temporary_obstack, "; ", 2); ++ /* Using ";" as a separator between commands does not work with ++ the Windows command shell. Therefore, we use "&&" which ++ should work everywhere. */ ++ obstack_grow (&temporary_obstack, " && ", 4); + obstack_grow (&temporary_obstack, c_file_name, strlen (c_file_name)); + obstack_1grow (&temporary_obstack, ' '); + obstack_grow (&temporary_obstack, f->args, strlen (f->args)); +diff -Nbaur gcc-3.4.3/gcc/unwind-dw2-fde.c gcc-3.4.3-new/gcc/unwind-dw2-fde.c +--- gcc-3.4.3/gcc/unwind-dw2-fde.c Fri Oct 31 20:46:26 2003 ++++ gcc-3.4.3-new/gcc/unwind-dw2-fde.c Fri Jan 21 10:25:51 2005 +@@ -41,18 +41,32 @@ + #include "gthr.h" + #endif + ++#if defined (__MINGW32__ ) || defined (__CYGWIN__) ++#include "config/i386/w32-shared-ptr.h" ++#endif ++ + /* The unseen_objects list contains objects that have been registered + but not yet categorized in any way. The seen_objects list has had + it's pc_begin and count fields initialized at minimum, and is sorted + by decreasing value of pc_begin. */ ++ ++#if ! (defined (__MINGW32__ ) || defined (__CYGWIN__)) + static struct object *unseen_objects; + static struct object *seen_objects; ++#else ++#define unseen_objects (*(struct object**)(&__w32_sharedptr->dw2_unseen_objects)) ++#define seen_objects (*(struct object**)(&__w32_sharedptr->dw2_seen_objects)) ++#endif + ++#if !(defined (__MINGW32__ ) || defined (__CYGWIN__)) + #ifdef __GTHREAD_MUTEX_INIT + static __gthread_mutex_t object_mutex = __GTHREAD_MUTEX_INIT; + #else + static __gthread_mutex_t object_mutex; + #endif ++#else ++#define object_mutex (__w32_sharedptr->dw2_object_mutex) ++#endif + + #ifdef __GTHREAD_MUTEX_INIT_FUNCTION + static void +@@ -64,8 +78,15 @@ + static void + init_object_mutex_once (void) + { ++#if !(defined (__MINGW32__ ) || defined (__CYGWIN__)) + static __gthread_once_t once = __GTHREAD_ONCE_INIT; ++#else ++#define once (__w32_sharedptr->dw2_once) ++#endif + __gthread_once (&once, init_object_mutex); ++#if (defined (__MINGW32__ ) || defined (__CYGWIN__)) ++#undef once ++#endif + } + #else + #define init_object_mutex_once() +@@ -429,9 +450,13 @@ + fde_split (struct object *ob, fde_compare_t fde_compare, + struct fde_vector *linear, struct fde_vector *erratic) + { +- static const fde *marker; +- size_t count = linear->count; ++#if !(defined (__MINGW32__ ) || defined (__CYGWIN__)) ++ static fde *marker; ++#else ++#define marker (*(const fde **)&__w32_sharedptr->dw2_marker) ++#endif + const fde **chain_end = ▮ ++ size_t count = linear->count; + size_t i, j, k; + + /* This should optimize out, but it is wise to make sure this assumption +@@ -465,6 +490,9 @@ + erratic->array[k++] = linear->array[i]; + linear->count = j; + erratic->count = k; ++#if (defined (__MINGW32__ ) || defined (__CYGWIN__)) ++#undef marker ++#endif + } + + #define SWAP(x,y) do { const fde * tmp = x; x = y; y = tmp; } while (0) +diff -Nbaur gcc-3.4.3/gcc/unwind-sjlj.c gcc-3.4.3-new/gcc/unwind-sjlj.c +--- gcc-3.4.3/gcc/unwind-sjlj.c Sun Nov 2 00:00:08 2003 ++++ gcc-3.4.3-new/gcc/unwind-sjlj.c Fri Jan 21 10:25:51 2005 +@@ -35,6 +35,10 @@ + #include "unwind.h" + #include "gthr.h" + ++#if defined (__MINGW32__ ) || defined (__CYGWIN__) ++#include "config/i386/w32-shared-ptr.h" ++#endif ++ + #ifdef __USING_SJLJ_EXCEPTIONS__ + + #ifdef DONT_USE_BUILTIN_SETJMP +@@ -95,12 +99,21 @@ + + /* Manage the chain of registered function contexts. */ + ++#if !(defined (__MINGW32__ ) || defined (__CYGWIN__)) + /* Single threaded fallback chain. */ + static struct SjLj_Function_Context *fc_static; ++#else ++#define fc_static (*(struct SjLj_Function_Context**)&__w32_sharedptr->sjlj_fc_static) ++#endif + + #if __GTHREADS ++#if !(defined (__MINGW32__ ) || defined (__CYGWIN__)) + static __gthread_key_t fc_key; + static int use_fc_key = -1; ++#else ++#define fc_key (__w32_sharedptr->sjlj_fc_key) ++#define use_fc_key (__w32_sharedptr->sjlj_use_fc_key) ++#endif + + static void + fc_key_init (void) +@@ -111,15 +124,26 @@ + static void + fc_key_init_once (void) + { ++#if !(defined (__MINGW32__ ) || defined (__CYGWIN__)) + static __gthread_once_t once = __GTHREAD_ONCE_INIT; ++#else ++#define once (__w32_sharedptr->sjlj_once) ++#endif + if (__gthread_once (&once, fc_key_init) != 0 || use_fc_key < 0) + use_fc_key = 0; ++#if defined (__MINGW32__ ) || defined (__CYGWIN__) ++#undef once ++#endif + } + #endif + + void + _Unwind_SjLj_Register (struct SjLj_Function_Context *fc) + { ++#if defined (__MINGW32__ ) || defined (__CYGWIN__) ++ W32_SHAREDPTR_INITIALIZE (); ++#endif ++ + #if __GTHREADS + if (use_fc_key < 0) + fc_key_init_once (); +@@ -140,6 +164,10 @@ + static inline struct SjLj_Function_Context * + _Unwind_SjLj_GetContext (void) + { ++#if defined (__MINGW32__ ) || defined (__CYGWIN__) ++ W32_SHAREDPTR_INITIALIZE (); ++#endif ++ + #if __GTHREADS + if (use_fc_key < 0) + fc_key_init_once (); +@@ -153,6 +181,10 @@ + static inline void + _Unwind_SjLj_SetContext (struct SjLj_Function_Context *fc) + { ++#if defined (__MINGW32__ ) || defined (__CYGWIN__) ++ W32_SHAREDPTR_INITIALIZE (); ++#endif ++ + #if __GTHREADS + if (use_fc_key < 0) + fc_key_init_once (); +diff -Nbaur gcc-3.4.3/gcc/varasm.c gcc-3.4.3-new/gcc/varasm.c +--- gcc-3.4.3/gcc/varasm.c Sun Oct 31 09:10:03 2004 ++++ gcc-3.4.3-new/gcc/varasm.c Tue Jan 25 10:34:15 2005 +@@ -4915,6 +4915,7 @@ + default_elf_select_section_1 (tree decl, int reloc, + unsigned HOST_WIDE_INT align, int shlib) + { ++ const char *sname; + switch (categorize_decl_for_section (decl, reloc, shlib)) + { + case SECCAT_TEXT: +@@ -4922,56 +4923,61 @@ + abort (); + case SECCAT_RODATA: + readonly_data_section (); +- break; ++ return; + case SECCAT_RODATA_MERGE_STR: + mergeable_string_section (decl, align, 0); +- break; ++ return; + case SECCAT_RODATA_MERGE_STR_INIT: + mergeable_string_section (DECL_INITIAL (decl), align, 0); +- break; ++ return; + case SECCAT_RODATA_MERGE_CONST: + mergeable_constant_section (DECL_MODE (decl), align, 0); +- break; ++ return; + case SECCAT_SRODATA: +- named_section (NULL_TREE, ".sdata2", reloc); ++ sname = ".sdata2"; + break; + case SECCAT_DATA: + data_section (); +- break; ++ return; + case SECCAT_DATA_REL: +- named_section (NULL_TREE, ".data.rel", reloc); ++ sname = ".data.rel"; + break; + case SECCAT_DATA_REL_LOCAL: +- named_section (NULL_TREE, ".data.rel.local", reloc); ++ sname = ".data.rel.local"; + break; + case SECCAT_DATA_REL_RO: +- named_section (NULL_TREE, ".data.rel.ro", reloc); ++ sname = ".data.rel.ro"; + break; + case SECCAT_DATA_REL_RO_LOCAL: +- named_section (NULL_TREE, ".data.rel.ro.local", reloc); ++ sname = ".data.rel.ro.local"; + break; + case SECCAT_SDATA: +- named_section (NULL_TREE, ".sdata", reloc); ++ sname = ".sdata"; + break; + case SECCAT_TDATA: +- named_section (NULL_TREE, ".tdata", reloc); ++ sname = ".tdata"; + break; + case SECCAT_BSS: + #ifdef BSS_SECTION_ASM_OP + bss_section (); ++ return; + #else +- named_section (NULL_TREE, ".bss", reloc); +-#endif ++ sname = ".bss"; + break; ++#endif + case SECCAT_SBSS: +- named_section (NULL_TREE, ".sbss", reloc); ++ sname = ".sbss"; + break; + case SECCAT_TBSS: +- named_section (NULL_TREE, ".tbss", reloc); ++ sname = ".tbss"; + break; + default: + abort (); + } ++ ++ if (!DECL_P (decl)) ++ decl = NULL_TREE; ++ named_section (decl, sname, reloc); + } + + /* Construct a unique section name based on the decl name and the +diff -Nbaur gcc-3.4.3/gcc/varasm.c.orig gcc-3.4.3-new/gcc/varasm.c.orig +--- gcc-3.4.3/gcc/varasm.c.orig Thu Jan 1 00:00:00 1970 ++++ gcc-3.4.3-new/gcc/varasm.c.orig Tue Jan 25 10:34:10 2005 +@@ -0,0 +1,5240 @@ ++/* Output variables, constants and external declarations, for GNU compiler. ++ Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, ++ 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify it under ++the terms of the GNU General Public License as published by the Free ++Software Foundation; either version 2, or (at your option) any later ++version. ++ ++GCC is distributed in the hope that it will be useful, but WITHOUT ANY ++WARRANTY; without even the implied warranty of MERCHANTABILITY or ++FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING. If not, write to the Free ++Software Foundation, 59 Temple Place - Suite 330, Boston, MA ++02111-1307, USA. */ ++ ++ ++/* This file handles generation of all the assembler code ++ *except* the instructions of a function. ++ This includes declarations of variables and their initial values. ++ ++ We also output the assembler code for constants stored in memory ++ and are responsible for combining constants with the same value. */ ++ ++#include "config.h" ++#include "system.h" ++#include "coretypes.h" ++#include "tm.h" ++#include "rtl.h" ++#include "tree.h" ++#include "flags.h" ++#include "function.h" ++#include "expr.h" ++#include "hard-reg-set.h" ++#include "regs.h" ++#include "real.h" ++#include "output.h" ++#include "toplev.h" ++#include "hashtab.h" ++#include "c-pragma.h" ++#include "ggc.h" ++#include "langhooks.h" ++#include "tm_p.h" ++#include "debug.h" ++#include "target.h" ++#include "cgraph.h" ++ ++#ifdef XCOFF_DEBUGGING_INFO ++#include "xcoffout.h" /* Needed for external data ++ declarations for e.g. AIX 4.x. */ ++#endif ++ ++#ifndef TRAMPOLINE_ALIGNMENT ++#define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY ++#endif ++ ++#ifndef ASM_STABS_OP ++#define ASM_STABS_OP "\t.stabs\t" ++#endif ++ ++/* The (assembler) name of the first globally-visible object output. */ ++const char *first_global_object_name; ++const char *weak_global_object_name; ++ ++struct addr_const; ++struct constant_descriptor_rtx; ++struct rtx_const; ++struct pool_constant; ++ ++#define MAX_RTX_HASH_TABLE 61 ++ ++struct varasm_status GTY(()) ++{ ++ /* Hash facility for making memory-constants ++ from constant rtl-expressions. It is used on RISC machines ++ where immediate integer arguments and constant addresses are restricted ++ so that such constants must be stored in memory. ++ ++ This pool of constants is reinitialized for each function ++ so each function gets its own constants-pool that comes right before ++ it. */ ++ struct constant_descriptor_rtx ** GTY ((length ("MAX_RTX_HASH_TABLE"))) ++ x_const_rtx_hash_table; ++ struct pool_constant ** GTY ((length ("MAX_RTX_HASH_TABLE"))) ++ x_const_rtx_sym_hash_table; ++ ++ /* Pointers to first and last constant in pool. */ ++ struct pool_constant *x_first_pool; ++ struct pool_constant *x_last_pool; ++ ++ /* Current offset in constant pool (does not include any machine-specific ++ header). */ ++ HOST_WIDE_INT x_pool_offset; ++ ++ /* Number of tree-constants deferred during the expansion of this ++ function. */ ++ unsigned int deferred_constants; ++}; ++ ++#define const_rtx_hash_table (cfun->varasm->x_const_rtx_hash_table) ++#define const_rtx_sym_hash_table (cfun->varasm->x_const_rtx_sym_hash_table) ++#define first_pool (cfun->varasm->x_first_pool) ++#define last_pool (cfun->varasm->x_last_pool) ++#define pool_offset (cfun->varasm->x_pool_offset) ++#define n_deferred_constants (cfun->varasm->deferred_constants) ++ ++/* Number for making the label on the next ++ constant that is stored in memory. */ ++ ++static GTY(()) int const_labelno; ++ ++/* Carry information from ASM_DECLARE_OBJECT_NAME ++ to ASM_FINISH_DECLARE_OBJECT. */ ++ ++int size_directive_output; ++ ++/* The last decl for which assemble_variable was called, ++ if it did ASM_DECLARE_OBJECT_NAME. ++ If the last call to assemble_variable didn't do that, ++ this holds 0. */ ++ ++tree last_assemble_variable_decl; ++ ++/* RTX_UNCHANGING_P in a MEM can mean it is stored into, for initialization. ++ So giving constant the alias set for the type will allow such ++ initializations to appear to conflict with the load of the constant. We ++ avoid this by giving all constants an alias set for just constants. ++ Since there will be no stores to that alias set, nothing will ever ++ conflict with them. */ ++ ++static HOST_WIDE_INT const_alias_set; ++ ++static const char *strip_reg_name (const char *); ++static int contains_pointers_p (tree); ++#ifdef ASM_OUTPUT_EXTERNAL ++static bool incorporeal_function_p (tree); ++#endif ++static void decode_addr_const (tree, struct addr_const *); ++static hashval_t const_desc_hash (const void *); ++static int const_desc_eq (const void *, const void *); ++static hashval_t const_hash_1 (const tree); ++static int compare_constant (const tree, const tree); ++static tree copy_constant (tree); ++static void output_constant_def_contents (rtx); ++static void decode_rtx_const (enum machine_mode, rtx, struct rtx_const *); ++static unsigned int const_hash_rtx (enum machine_mode, rtx); ++static int compare_constant_rtx (enum machine_mode, rtx, ++ struct constant_descriptor_rtx *); ++static struct constant_descriptor_rtx * record_constant_rtx ++ (enum machine_mode, rtx); ++static struct pool_constant *find_pool_constant (struct function *, rtx); ++static void mark_constant_pool (void); ++static void mark_constants (rtx); ++static int mark_constant (rtx *current_rtx, void *data); ++static void output_addressed_constants (tree); ++static unsigned HOST_WIDE_INT array_size_for_constructor (tree); ++static unsigned min_align (unsigned, unsigned); ++static void output_constructor (tree, unsigned HOST_WIDE_INT, unsigned int); ++static void globalize_decl (tree); ++static void maybe_assemble_visibility (tree); ++static int in_named_entry_eq (const void *, const void *); ++static hashval_t in_named_entry_hash (const void *); ++#ifdef ASM_OUTPUT_BSS ++static void asm_output_bss (FILE *, tree, const char *, ++ unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT); ++#endif ++#ifdef BSS_SECTION_ASM_OP ++#ifdef ASM_OUTPUT_ALIGNED_BSS ++static void asm_output_aligned_bss (FILE *, tree, const char *, ++ unsigned HOST_WIDE_INT, int) ++ ATTRIBUTE_UNUSED; ++#endif ++#endif /* BSS_SECTION_ASM_OP */ ++static bool asm_emit_uninitialised (tree, const char*, ++ unsigned HOST_WIDE_INT, ++ unsigned HOST_WIDE_INT); ++static void mark_weak (tree); ++ ++enum in_section { no_section, in_text, in_data, in_named ++#ifdef BSS_SECTION_ASM_OP ++ , in_bss ++#endif ++#ifdef CTORS_SECTION_ASM_OP ++ , in_ctors ++#endif ++#ifdef DTORS_SECTION_ASM_OP ++ , in_dtors ++#endif ++#ifdef READONLY_DATA_SECTION_ASM_OP ++ , in_readonly_data ++#endif ++#ifdef EXTRA_SECTIONS ++ , EXTRA_SECTIONS ++#endif ++}; ++static GTY(()) enum in_section in_section = no_section; ++ ++/* Return a nonzero value if DECL has a section attribute. */ ++#ifndef IN_NAMED_SECTION ++#define IN_NAMED_SECTION(DECL) \ ++ ((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \ ++ && DECL_SECTION_NAME (DECL) != NULL_TREE) ++#endif ++ ++/* Text of section name when in_section == in_named. */ ++static GTY(()) const char *in_named_name; ++ ++/* Hash table of flags that have been used for a particular named section. */ ++ ++struct in_named_entry GTY(()) ++{ ++ const char *name; ++ unsigned int flags; ++ bool declared; ++}; ++ ++static GTY((param_is (struct in_named_entry))) htab_t in_named_htab; ++ ++/* Define functions like text_section for any extra sections. */ ++#ifdef EXTRA_SECTION_FUNCTIONS ++EXTRA_SECTION_FUNCTIONS ++#endif ++ ++/* Tell assembler to switch to text section. */ ++ ++void ++text_section (void) ++{ ++ if (in_section != in_text) ++ { ++ in_section = in_text; ++ fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP); ++ } ++} ++ ++/* Tell assembler to switch to data section. */ ++ ++void ++data_section (void) ++{ ++ if (in_section != in_data) ++ { ++ in_section = in_data; ++ if (flag_shared_data) ++ { ++#ifdef SHARED_SECTION_ASM_OP ++ fprintf (asm_out_file, "%s\n", SHARED_SECTION_ASM_OP); ++#else ++ fprintf (asm_out_file, "%s\n", DATA_SECTION_ASM_OP); ++#endif ++ } ++ else ++ fprintf (asm_out_file, "%s\n", DATA_SECTION_ASM_OP); ++ } ++} ++ ++/* Tell assembler to switch to read-only data section. This is normally ++ the text section. */ ++ ++void ++readonly_data_section (void) ++{ ++#ifdef READONLY_DATA_SECTION ++ READONLY_DATA_SECTION (); /* Note this can call data_section. */ ++#else ++#ifdef READONLY_DATA_SECTION_ASM_OP ++ if (in_section != in_readonly_data) ++ { ++ in_section = in_readonly_data; ++ fputs (READONLY_DATA_SECTION_ASM_OP, asm_out_file); ++ fputc ('\n', asm_out_file); ++ } ++#else ++ text_section (); ++#endif ++#endif ++} ++ ++/* Determine if we're in the text section. */ ++ ++int ++in_text_section (void) ++{ ++ return in_section == in_text; ++} ++ ++/* Determine if we're in the data section. */ ++ ++int ++in_data_section (void) ++{ ++ return in_section == in_data; ++} ++ ++/* Helper routines for maintaining in_named_htab. */ ++ ++static int ++in_named_entry_eq (const void *p1, const void *p2) ++{ ++ const struct in_named_entry *old = p1; ++ const char *new = p2; ++ ++ return strcmp (old->name, new) == 0; ++} ++ ++static hashval_t ++in_named_entry_hash (const void *p) ++{ ++ const struct in_named_entry *old = p; ++ return htab_hash_string (old->name); ++} ++ ++/* If SECTION has been seen before as a named section, return the flags ++ that were used. Otherwise, return 0. Note, that 0 is a perfectly valid ++ set of flags for a section to have, so 0 does not mean that the section ++ has not been seen. */ ++ ++unsigned int ++get_named_section_flags (const char *section) ++{ ++ struct in_named_entry **slot; ++ ++ slot = (struct in_named_entry **) ++ htab_find_slot_with_hash (in_named_htab, section, ++ htab_hash_string (section), NO_INSERT); ++ ++ return slot ? (*slot)->flags : 0; ++} ++ ++/* Returns true if the section has been declared before. Sets internal ++ flag on this section in in_named_hash so subsequent calls on this ++ section will return false. */ ++ ++bool ++named_section_first_declaration (const char *name) ++{ ++ struct in_named_entry **slot; ++ ++ slot = (struct in_named_entry **) ++ htab_find_slot_with_hash (in_named_htab, name, ++ htab_hash_string (name), NO_INSERT); ++ if (! (*slot)->declared) ++ { ++ (*slot)->declared = true; ++ return true; ++ } ++ else ++ { ++ return false; ++ } ++} ++ ++ ++/* Record FLAGS for SECTION. If SECTION was previously recorded with a ++ different set of flags, return false. */ ++ ++bool ++set_named_section_flags (const char *section, unsigned int flags) ++{ ++ struct in_named_entry **slot, *entry; ++ ++ slot = (struct in_named_entry **) ++ htab_find_slot_with_hash (in_named_htab, section, ++ htab_hash_string (section), INSERT); ++ entry = *slot; ++ ++ if (!entry) ++ { ++ entry = ggc_alloc (sizeof (*entry)); ++ *slot = entry; ++ entry->name = ggc_strdup (section); ++ entry->flags = flags; ++ entry->declared = false; ++ } ++ else if (entry->flags != flags) ++ return false; ++ ++ return true; ++} ++ ++/* Tell assembler to change to section NAME with attributes FLAGS. */ ++ ++void ++named_section_flags (const char *name, unsigned int flags) ++{ ++ if (in_section != in_named || strcmp (name, in_named_name) != 0) ++ { ++ if (! set_named_section_flags (name, flags)) ++ abort (); ++ ++ (*targetm.asm_out.named_section) (name, flags); ++ ++ if (flags & SECTION_FORGET) ++ in_section = no_section; ++ else ++ { ++ in_named_name = ggc_strdup (name); ++ in_section = in_named; ++ } ++ } ++} ++ ++/* Tell assembler to change to section NAME for DECL. ++ If DECL is NULL, just switch to section NAME. ++ If NAME is NULL, get the name from DECL. ++ If RELOC is 1, the initializer for DECL contains relocs. */ ++ ++void ++named_section (tree decl, const char *name, int reloc) ++{ ++ unsigned int flags; ++ ++ if (decl != NULL_TREE && !DECL_P (decl)) ++ abort (); ++ if (name == NULL) ++ name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); ++ ++ flags = (* targetm.section_type_flags) (decl, name, reloc); ++ ++ /* Sanity check user variables for flag changes. Non-user ++ section flag changes will abort in named_section_flags. ++ However, don't complain if SECTION_OVERRIDE is set. ++ We trust that the setter knows that it is safe to ignore ++ the default flags for this decl. */ ++ if (decl && ! set_named_section_flags (name, flags)) ++ { ++ flags = get_named_section_flags (name); ++ if ((flags & SECTION_OVERRIDE) == 0) ++ error ("%J%D causes a section type conflict", decl, decl); ++ } ++ ++ named_section_flags (name, flags); ++} ++ ++/* If required, set DECL_SECTION_NAME to a unique name. */ ++ ++void ++resolve_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED, ++ int flag_function_or_data_sections) ++{ ++ if (DECL_SECTION_NAME (decl) == NULL_TREE ++ && targetm.have_named_sections ++ && (flag_function_or_data_sections ++ || DECL_ONE_ONLY (decl))) ++ (*targetm.asm_out.unique_section) (decl, reloc); ++} ++ ++#ifdef BSS_SECTION_ASM_OP ++ ++/* Tell the assembler to switch to the bss section. */ ++ ++void ++bss_section (void) ++{ ++ if (in_section != in_bss) ++ { ++ fprintf (asm_out_file, "%s\n", BSS_SECTION_ASM_OP); ++ in_section = in_bss; ++ } ++} ++ ++#ifdef ASM_OUTPUT_BSS ++ ++/* Utility function for ASM_OUTPUT_BSS for targets to use if ++ they don't support alignments in .bss. ++ ??? It is believed that this function will work in most cases so such ++ support is localized here. */ ++ ++static void ++asm_output_bss (FILE *file, tree decl ATTRIBUTE_UNUSED, ++ const char *name, ++ unsigned HOST_WIDE_INT size ATTRIBUTE_UNUSED, ++ unsigned HOST_WIDE_INT rounded) ++{ ++ (*targetm.asm_out.globalize_label) (file, name); ++ bss_section (); ++#ifdef ASM_DECLARE_OBJECT_NAME ++ last_assemble_variable_decl = decl; ++ ASM_DECLARE_OBJECT_NAME (file, name, decl); ++#else ++ /* Standard thing is just output label for the object. */ ++ ASM_OUTPUT_LABEL (file, name); ++#endif /* ASM_DECLARE_OBJECT_NAME */ ++ ASM_OUTPUT_SKIP (file, rounded ? rounded : 1); ++} ++ ++#endif ++ ++#ifdef ASM_OUTPUT_ALIGNED_BSS ++ ++/* Utility function for targets to use in implementing ++ ASM_OUTPUT_ALIGNED_BSS. ++ ??? It is believed that this function will work in most cases so such ++ support is localized here. */ ++ ++static void ++asm_output_aligned_bss (FILE *file, tree decl ATTRIBUTE_UNUSED, ++ const char *name, unsigned HOST_WIDE_INT size, ++ int align) ++{ ++ bss_section (); ++ ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT)); ++#ifdef ASM_DECLARE_OBJECT_NAME ++ last_assemble_variable_decl = decl; ++ ASM_DECLARE_OBJECT_NAME (file, name, decl); ++#else ++ /* Standard thing is just output label for the object. */ ++ ASM_OUTPUT_LABEL (file, name); ++#endif /* ASM_DECLARE_OBJECT_NAME */ ++ ASM_OUTPUT_SKIP (file, size ? size : 1); ++} ++ ++#endif ++ ++#endif /* BSS_SECTION_ASM_OP */ ++ ++/* Switch to the section for function DECL. ++ ++ If DECL is NULL_TREE, switch to the text section. ++ ??? It's not clear that we will ever be passed NULL_TREE, but it's ++ safer to handle it. */ ++ ++void ++function_section (tree decl) ++{ ++ if (decl != NULL_TREE ++ && DECL_SECTION_NAME (decl) != NULL_TREE) ++ named_section (decl, (char *) 0, 0); ++ else ++ text_section (); ++} ++ ++/* Switch to section for variable DECL. RELOC is the same as the ++ argument to SELECT_SECTION. */ ++ ++void ++variable_section (tree decl, int reloc) ++{ ++ if (IN_NAMED_SECTION (decl)) ++ named_section (decl, NULL, reloc); ++ else ++ (*targetm.asm_out.select_section) (decl, reloc, DECL_ALIGN (decl)); ++} ++ ++/* Tell assembler to switch to the section for string merging. */ ++ ++void ++mergeable_string_section (tree decl ATTRIBUTE_UNUSED, ++ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED, ++ unsigned int flags ATTRIBUTE_UNUSED) ++{ ++ if (HAVE_GAS_SHF_MERGE && flag_merge_constants ++ && TREE_CODE (decl) == STRING_CST ++ && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE ++ && align <= 256 ++ && TREE_STRING_LENGTH (decl) >= int_size_in_bytes (TREE_TYPE (decl))) ++ { ++ enum machine_mode mode; ++ unsigned int modesize; ++ const char *str; ++ int i, j, len, unit; ++ char name[30]; ++ ++ mode = TYPE_MODE (TREE_TYPE (TREE_TYPE (decl))); ++ modesize = GET_MODE_BITSIZE (mode); ++ if (modesize >= 8 && modesize <= 256 ++ && (modesize & (modesize - 1)) == 0) ++ { ++ if (align < modesize) ++ align = modesize; ++ ++ str = TREE_STRING_POINTER (decl); ++ len = TREE_STRING_LENGTH (decl); ++ unit = GET_MODE_SIZE (mode); ++ ++ /* Check for embedded NUL characters. */ ++ for (i = 0; i < len; i += unit) ++ { ++ for (j = 0; j < unit; j++) ++ if (str[i + j] != '\0') ++ break; ++ if (j == unit) ++ break; ++ } ++ if (i == len - unit) ++ { ++ sprintf (name, ".rodata.str%d.%d", modesize / 8, ++ (int) (align / 8)); ++ flags |= (modesize / 8) | SECTION_MERGE | SECTION_STRINGS; ++ if (!i && modesize < align) ++ { ++ /* A "" string with requested alignment greater than ++ character size might cause a problem: ++ if some other string required even bigger ++ alignment than "", then linker might think the ++ "" is just part of padding after some other string ++ and not put it into the hash table initially. ++ But this means "" could have smaller alignment ++ than requested. */ ++#ifdef ASM_OUTPUT_SECTION_START ++ named_section_flags (name, flags); ++ ASM_OUTPUT_SECTION_START (asm_out_file); ++#else ++ readonly_data_section (); ++#endif ++ return; ++ } ++ ++ named_section_flags (name, flags); ++ return; ++ } ++ } ++ } ++ ++ readonly_data_section (); ++} ++ ++/* Tell assembler to switch to the section for constant merging. */ ++ ++void ++mergeable_constant_section (enum machine_mode mode ATTRIBUTE_UNUSED, ++ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED, ++ unsigned int flags ATTRIBUTE_UNUSED) ++{ ++ unsigned int modesize = GET_MODE_BITSIZE (mode); ++ ++ if (HAVE_GAS_SHF_MERGE && flag_merge_constants ++ && mode != VOIDmode ++ && mode != BLKmode ++ && modesize <= align ++ && align >= 8 ++ && align <= 256 ++ && (align & (align - 1)) == 0) ++ { ++ char name[24]; ++ ++ sprintf (name, ".rodata.cst%d", (int) (align / 8)); ++ flags |= (align / 8) | SECTION_MERGE; ++ named_section_flags (name, flags); ++ return; ++ } ++ ++ readonly_data_section (); ++} ++ ++/* Given NAME, a putative register name, discard any customary prefixes. */ ++ ++static const char * ++strip_reg_name (const char *name) ++{ ++#ifdef REGISTER_PREFIX ++ if (!strncmp (name, REGISTER_PREFIX, strlen (REGISTER_PREFIX))) ++ name += strlen (REGISTER_PREFIX); ++#endif ++ if (name[0] == '%' || name[0] == '#') ++ name++; ++ return name; ++} ++ ++/* Decode an `asm' spec for a declaration as a register name. ++ Return the register number, or -1 if nothing specified, ++ or -2 if the ASMSPEC is not `cc' or `memory' and is not recognized, ++ or -3 if ASMSPEC is `cc' and is not recognized, ++ or -4 if ASMSPEC is `memory' and is not recognized. ++ Accept an exact spelling or a decimal number. ++ Prefixes such as % are optional. */ ++ ++int ++decode_reg_name (const char *asmspec) ++{ ++ if (asmspec != 0) ++ { ++ int i; ++ ++ /* Get rid of confusing prefixes. */ ++ asmspec = strip_reg_name (asmspec); ++ ++ /* Allow a decimal number as a "register name". */ ++ for (i = strlen (asmspec) - 1; i >= 0; i--) ++ if (! ISDIGIT (asmspec[i])) ++ break; ++ if (asmspec[0] != 0 && i < 0) ++ { ++ i = atoi (asmspec); ++ if (i < FIRST_PSEUDO_REGISTER && i >= 0) ++ return i; ++ else ++ return -2; ++ } ++ ++ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) ++ if (reg_names[i][0] ++ && ! strcmp (asmspec, strip_reg_name (reg_names[i]))) ++ return i; ++ ++#ifdef ADDITIONAL_REGISTER_NAMES ++ { ++ static const struct { const char *const name; const int number; } table[] ++ = ADDITIONAL_REGISTER_NAMES; ++ ++ for (i = 0; i < (int) ARRAY_SIZE (table); i++) ++ if (! strcmp (asmspec, table[i].name)) ++ return table[i].number; ++ } ++#endif /* ADDITIONAL_REGISTER_NAMES */ ++ ++ if (!strcmp (asmspec, "memory")) ++ return -4; ++ ++ if (!strcmp (asmspec, "cc")) ++ return -3; ++ ++ return -2; ++ } ++ ++ return -1; ++} ++ ++/* Create the DECL_RTL for a VAR_DECL or FUNCTION_DECL. DECL should ++ have static storage duration. In other words, it should not be an ++ automatic variable, including PARM_DECLs. ++ ++ There is, however, one exception: this function handles variables ++ explicitly placed in a particular register by the user. ++ ++ ASMSPEC, if not 0, is the string which the user specified as the ++ assembler symbol name. ++ ++ This is never called for PARM_DECL nodes. */ ++ ++void ++make_decl_rtl (tree decl, const char *asmspec) ++{ ++ const char *name = 0; ++ int reg_number; ++ rtx x; ++ ++ /* Check that we are not being given an automatic variable. */ ++ /* A weak alias has TREE_PUBLIC set but not the other bits. */ ++ if (TREE_CODE (decl) == PARM_DECL ++ || TREE_CODE (decl) == RESULT_DECL ++ || (TREE_CODE (decl) == VAR_DECL ++ && !TREE_STATIC (decl) ++ && !TREE_PUBLIC (decl) ++ && !DECL_EXTERNAL (decl) ++ && !DECL_REGISTER (decl))) ++ abort (); ++ /* And that we were not given a type or a label. */ ++ else if (TREE_CODE (decl) == TYPE_DECL ++ || TREE_CODE (decl) == LABEL_DECL) ++ abort (); ++ ++ /* For a duplicate declaration, we can be called twice on the ++ same DECL node. Don't discard the RTL already made. */ ++ if (DECL_RTL_SET_P (decl)) ++ { ++ /* If the old RTL had the wrong mode, fix the mode. */ ++ if (GET_MODE (DECL_RTL (decl)) != DECL_MODE (decl)) ++ SET_DECL_RTL (decl, adjust_address_nv (DECL_RTL (decl), ++ DECL_MODE (decl), 0)); ++ ++ /* ??? Another way to do this would be to maintain a hashed ++ table of such critters. Instead of adding stuff to a DECL ++ to give certain attributes to it, we could use an external ++ hash map from DECL to set of attributes. */ ++ ++ /* Let the target reassign the RTL if it wants. ++ This is necessary, for example, when one machine specific ++ decl attribute overrides another. */ ++ (* targetm.encode_section_info) (decl, DECL_RTL (decl), false); ++ return; ++ } ++ ++ reg_number = decode_reg_name (asmspec); ++ if (reg_number == -2) ++ { ++ /* ASMSPEC is given, and not the name of a register. Mark the ++ name with a star so assemble_name won't munge it. */ ++ char *starred = alloca (strlen (asmspec) + 2); ++ starred[0] = '*'; ++ strcpy (starred + 1, asmspec); ++ change_decl_assembler_name (decl, get_identifier (starred)); ++ } ++ ++ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); ++ ++ if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl)) ++ { ++ /* First detect errors in declaring global registers. */ ++ if (reg_number == -1) ++ error ("%Jregister name not specified for '%D'", decl, decl); ++ else if (reg_number < 0) ++ error ("%Jinvalid register name for '%D'", decl, decl); ++ else if (TYPE_MODE (TREE_TYPE (decl)) == BLKmode) ++ error ("%Jdata type of '%D' isn't suitable for a register", ++ decl, decl); ++ else if (! HARD_REGNO_MODE_OK (reg_number, TYPE_MODE (TREE_TYPE (decl)))) ++ error ("%Jregister specified for '%D' isn't suitable for data type", ++ decl, decl); ++ /* Now handle properly declared static register variables. */ ++ else ++ { ++ int nregs; ++ ++ if (DECL_INITIAL (decl) != 0 && TREE_STATIC (decl)) ++ { ++ DECL_INITIAL (decl) = 0; ++ error ("global register variable has initial value"); ++ } ++ if (TREE_THIS_VOLATILE (decl)) ++ warning ("volatile register variables don't work as you might wish"); ++ ++ /* If the user specified one of the eliminables registers here, ++ e.g., FRAME_POINTER_REGNUM, we don't want to get this variable ++ confused with that register and be eliminated. This usage is ++ somewhat suspect... */ ++ ++ SET_DECL_RTL (decl, gen_rtx_raw_REG (DECL_MODE (decl), reg_number)); ++ ORIGINAL_REGNO (DECL_RTL (decl)) = reg_number; ++ REG_USERVAR_P (DECL_RTL (decl)) = 1; ++ ++ if (TREE_STATIC (decl)) ++ { ++ /* Make this register global, so not usable for anything ++ else. */ ++#ifdef ASM_DECLARE_REGISTER_GLOBAL ++ ASM_DECLARE_REGISTER_GLOBAL (asm_out_file, decl, reg_number, name); ++#endif ++ nregs = HARD_REGNO_NREGS (reg_number, DECL_MODE (decl)); ++ while (nregs > 0) ++ globalize_reg (reg_number + --nregs); ++ } ++ ++ /* As a register variable, it has no section. */ ++ return; ++ } ++ } ++ ++ /* Now handle ordinary static variables and functions (in memory). ++ Also handle vars declared register invalidly. */ ++ ++ if (reg_number >= 0 || reg_number == -3) ++ error ("%Jregister name given for non-register variable '%D'", decl, decl); ++ ++ /* Specifying a section attribute on a variable forces it into a ++ non-.bss section, and thus it cannot be common. */ ++ if (TREE_CODE (decl) == VAR_DECL ++ && DECL_SECTION_NAME (decl) != NULL_TREE ++ && DECL_INITIAL (decl) == NULL_TREE ++ && DECL_COMMON (decl)) ++ DECL_COMMON (decl) = 0; ++ ++ /* Variables can't be both common and weak. */ ++ if (TREE_CODE (decl) == VAR_DECL && DECL_WEAK (decl)) ++ DECL_COMMON (decl) = 0; ++ ++ x = gen_rtx_SYMBOL_REF (Pmode, name); ++ SYMBOL_REF_WEAK (x) = DECL_WEAK (decl); ++ SYMBOL_REF_DECL (x) = decl; ++ ++ x = gen_rtx_MEM (DECL_MODE (decl), x); ++ if (TREE_CODE (decl) != FUNCTION_DECL) ++ set_mem_attributes (x, decl, 1); ++ SET_DECL_RTL (decl, x); ++ ++ /* Optionally set flags or add text to the name to record information ++ such as that it is a function name. ++ If the name is changed, the macro ASM_OUTPUT_LABELREF ++ will have to know how to strip this information. */ ++ (* targetm.encode_section_info) (decl, DECL_RTL (decl), true); ++} ++ ++/* Make the rtl for variable VAR be volatile. ++ Use this only for static variables. */ ++ ++void ++make_var_volatile (tree var) ++{ ++ if (GET_CODE (DECL_RTL (var)) != MEM) ++ abort (); ++ ++ MEM_VOLATILE_P (DECL_RTL (var)) = 1; ++} ++ ++/* Output a string of literal assembler code ++ for an `asm' keyword used between functions. */ ++ ++void ++assemble_asm (tree string) ++{ ++ app_enable (); ++ ++ if (TREE_CODE (string) == ADDR_EXPR) ++ string = TREE_OPERAND (string, 0); ++ ++ fprintf (asm_out_file, "\t%s\n", TREE_STRING_POINTER (string)); ++} ++ ++/* Record an element in the table of global destructors. SYMBOL is ++ a SYMBOL_REF of the function to be called; PRIORITY is a number ++ between 0 and MAX_INIT_PRIORITY. */ ++ ++void ++default_stabs_asm_out_destructor (rtx symbol, int priority ATTRIBUTE_UNUSED) ++{ ++ /* Tell GNU LD that this is part of the static destructor set. ++ This will work for any system that uses stabs, most usefully ++ aout systems. */ ++ fprintf (asm_out_file, "%s\"___DTOR_LIST__\",22,0,0,", ASM_STABS_OP); ++ assemble_name (asm_out_file, XSTR (symbol, 0)); ++ fputc ('\n', asm_out_file); ++} ++ ++void ++default_named_section_asm_out_destructor (rtx symbol, int priority) ++{ ++ const char *section = ".dtors"; ++ char buf[16]; ++ ++ /* ??? This only works reliably with the GNU linker. */ ++ if (priority != DEFAULT_INIT_PRIORITY) ++ { ++ sprintf (buf, ".dtors.%.5u", ++ /* Invert the numbering so the linker puts us in the proper ++ order; constructors are run from right to left, and the ++ linker sorts in increasing order. */ ++ MAX_INIT_PRIORITY - priority); ++ section = buf; ++ } ++ ++ named_section_flags (section, SECTION_WRITE); ++ assemble_align (POINTER_SIZE); ++ assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); ++} ++ ++#ifdef DTORS_SECTION_ASM_OP ++void ++dtors_section (void) ++{ ++ if (in_section != in_dtors) ++ { ++ in_section = in_dtors; ++ fputs (DTORS_SECTION_ASM_OP, asm_out_file); ++ fputc ('\n', asm_out_file); ++ } ++} ++ ++void ++default_dtor_section_asm_out_destructor (rtx symbol, ++ int priority ATTRIBUTE_UNUSED) ++{ ++ dtors_section (); ++ assemble_align (POINTER_SIZE); ++ assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); ++} ++#endif ++ ++/* Likewise for global constructors. */ ++ ++void ++default_stabs_asm_out_constructor (rtx symbol, int priority ATTRIBUTE_UNUSED) ++{ ++ /* Tell GNU LD that this is part of the static destructor set. ++ This will work for any system that uses stabs, most usefully ++ aout systems. */ ++ fprintf (asm_out_file, "%s\"___CTOR_LIST__\",22,0,0,", ASM_STABS_OP); ++ assemble_name (asm_out_file, XSTR (symbol, 0)); ++ fputc ('\n', asm_out_file); ++} ++ ++void ++default_named_section_asm_out_constructor (rtx symbol, int priority) ++{ ++ const char *section = ".ctors"; ++ char buf[16]; ++ ++ /* ??? This only works reliably with the GNU linker. */ ++ if (priority != DEFAULT_INIT_PRIORITY) ++ { ++ sprintf (buf, ".ctors.%.5u", ++ /* Invert the numbering so the linker puts us in the proper ++ order; constructors are run from right to left, and the ++ linker sorts in increasing order. */ ++ MAX_INIT_PRIORITY - priority); ++ section = buf; ++ } ++ ++ named_section_flags (section, SECTION_WRITE); ++ assemble_align (POINTER_SIZE); ++ assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); ++} ++ ++#ifdef CTORS_SECTION_ASM_OP ++void ++ctors_section (void) ++{ ++ if (in_section != in_ctors) ++ { ++ in_section = in_ctors; ++ fputs (CTORS_SECTION_ASM_OP, asm_out_file); ++ fputc ('\n', asm_out_file); ++ } ++} ++ ++void ++default_ctor_section_asm_out_constructor (rtx symbol, ++ int priority ATTRIBUTE_UNUSED) ++{ ++ ctors_section (); ++ assemble_align (POINTER_SIZE); ++ assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); ++} ++#endif ++ ++/* CONSTANT_POOL_BEFORE_FUNCTION may be defined as an expression with ++ a nonzero value if the constant pool should be output before the ++ start of the function, or a zero value if the pool should output ++ after the end of the function. The default is to put it before the ++ start. */ ++ ++#ifndef CONSTANT_POOL_BEFORE_FUNCTION ++#define CONSTANT_POOL_BEFORE_FUNCTION 1 ++#endif ++ ++/* DECL is an object (either VAR_DECL or FUNCTION_DECL) which is going ++ to be output to assembler. ++ Set first_global_object_name and weak_global_object_name as appropriate. */ ++ ++void ++notice_global_symbol (tree decl) ++{ ++ const char **type = &first_global_object_name; ++ ++ if (first_global_object_name ++ || !TREE_PUBLIC (decl) || DECL_EXTERNAL (decl) ++ || !DECL_NAME (decl) ++ || (TREE_CODE (decl) != FUNCTION_DECL ++ && (TREE_CODE (decl) != VAR_DECL ++ || (DECL_COMMON (decl) ++ && (DECL_INITIAL (decl) == 0 ++ || DECL_INITIAL (decl) == error_mark_node)))) ++ || GET_CODE (DECL_RTL (decl)) != MEM) ++ return; ++ ++ /* We win when global object is found, but it is usefull to know about weak ++ symbol as well so we can produce nicer unique names. */ ++ if (DECL_WEAK (decl) || DECL_ONE_ONLY (decl)) ++ type = &weak_global_object_name; ++ ++ if (!*type) ++ { ++ const char *p; ++ char *name; ++ rtx decl_rtl = DECL_RTL (decl); ++ ++ p = (* targetm.strip_name_encoding) (XSTR (XEXP (decl_rtl, 0), 0)); ++ name = xstrdup (p); ++ ++ *type = name; ++ } ++} ++ ++/* Output assembler code for the constant pool of a function and associated ++ with defining the name of the function. DECL describes the function. ++ NAME is the function's name. For the constant pool, we use the current ++ constant pool data. */ ++ ++void ++assemble_start_function (tree decl, const char *fnname) ++{ ++ int align; ++ ++ /* The following code does not need preprocessing in the assembler. */ ++ ++ app_disable (); ++ ++ if (CONSTANT_POOL_BEFORE_FUNCTION) ++ output_constant_pool (fnname, decl); ++ ++ resolve_unique_section (decl, 0, flag_function_sections); ++ function_section (decl); ++ ++ /* Tell assembler to move to target machine's alignment for functions. */ ++ align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT); ++ if (align < force_align_functions_log) ++ align = force_align_functions_log; ++ if (align > 0) ++ { ++ ASM_OUTPUT_ALIGN (asm_out_file, align); ++ } ++ ++ /* Handle a user-specified function alignment. ++ Note that we still need to align to FUNCTION_BOUNDARY, as above, ++ because ASM_OUTPUT_MAX_SKIP_ALIGN might not do any alignment at all. */ ++ if (align_functions_log > align ++ && cfun->function_frequency != FUNCTION_FREQUENCY_UNLIKELY_EXECUTED) ++ { ++#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN ++ ASM_OUTPUT_MAX_SKIP_ALIGN (asm_out_file, ++ align_functions_log, align_functions - 1); ++#else ++ ASM_OUTPUT_ALIGN (asm_out_file, align_functions_log); ++#endif ++ } ++ ++#ifdef ASM_OUTPUT_FUNCTION_PREFIX ++ ASM_OUTPUT_FUNCTION_PREFIX (asm_out_file, fnname); ++#endif ++ ++ (*debug_hooks->begin_function) (decl); ++ ++ /* Make function name accessible from other files, if appropriate. */ ++ ++ if (TREE_PUBLIC (decl)) ++ { ++ notice_global_symbol (decl); ++ ++ globalize_decl (decl); ++ ++ maybe_assemble_visibility (decl); ++ } ++ ++ /* Do any machine/system dependent processing of the function name. */ ++#ifdef ASM_DECLARE_FUNCTION_NAME ++ ASM_DECLARE_FUNCTION_NAME (asm_out_file, fnname, current_function_decl); ++#else ++ /* Standard thing is just output label for the function. */ ++ ASM_OUTPUT_LABEL (asm_out_file, fnname); ++#endif /* ASM_DECLARE_FUNCTION_NAME */ ++} ++ ++/* Output assembler code associated with defining the size of the ++ function. DECL describes the function. NAME is the function's name. */ ++ ++void ++assemble_end_function (tree decl, const char *fnname) ++{ ++#ifdef ASM_DECLARE_FUNCTION_SIZE ++ ASM_DECLARE_FUNCTION_SIZE (asm_out_file, fnname, decl); ++#endif ++ if (! CONSTANT_POOL_BEFORE_FUNCTION) ++ { ++ output_constant_pool (fnname, decl); ++ function_section (decl); /* need to switch back */ ++ } ++} ++ ++/* Assemble code to leave SIZE bytes of zeros. */ ++ ++void ++assemble_zeros (unsigned HOST_WIDE_INT size) ++{ ++ /* Do no output if -fsyntax-only. */ ++ if (flag_syntax_only) ++ return; ++ ++#ifdef ASM_NO_SKIP_IN_TEXT ++ /* The `space' pseudo in the text section outputs nop insns rather than 0s, ++ so we must output 0s explicitly in the text section. */ ++ if (ASM_NO_SKIP_IN_TEXT && in_text_section ()) ++ { ++ unsigned HOST_WIDE_INT i; ++ for (i = 0; i < size; i++) ++ assemble_integer (const0_rtx, 1, BITS_PER_UNIT, 1); ++ } ++ else ++#endif ++ if (size > 0) ++ ASM_OUTPUT_SKIP (asm_out_file, size); ++} ++ ++/* Assemble an alignment pseudo op for an ALIGN-bit boundary. */ ++ ++void ++assemble_align (int align) ++{ ++ if (align > BITS_PER_UNIT) ++ { ++ ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT)); ++ } ++} ++ ++/* Assemble a string constant with the specified C string as contents. */ ++ ++void ++assemble_string (const char *p, int size) ++{ ++ int pos = 0; ++ int maximum = 2000; ++ ++ /* If the string is very long, split it up. */ ++ ++ while (pos < size) ++ { ++ int thissize = size - pos; ++ if (thissize > maximum) ++ thissize = maximum; ++ ++ ASM_OUTPUT_ASCII (asm_out_file, p, thissize); ++ ++ pos += thissize; ++ p += thissize; ++ } ++} ++ ++ ++#if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL ++#define ASM_EMIT_LOCAL(decl, name, size, rounded) \ ++ ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, decl, name, size, DECL_ALIGN (decl)) ++#else ++#if defined ASM_OUTPUT_ALIGNED_LOCAL ++#define ASM_EMIT_LOCAL(decl, name, size, rounded) \ ++ ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, DECL_ALIGN (decl)) ++#else ++#define ASM_EMIT_LOCAL(decl, name, size, rounded) \ ++ ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded) ++#endif ++#endif ++ ++#if defined ASM_OUTPUT_ALIGNED_BSS ++#define ASM_EMIT_BSS(decl, name, size, rounded) \ ++ ASM_OUTPUT_ALIGNED_BSS (asm_out_file, decl, name, size, DECL_ALIGN (decl)) ++#else ++#if defined ASM_OUTPUT_BSS ++#define ASM_EMIT_BSS(decl, name, size, rounded) \ ++ ASM_OUTPUT_BSS (asm_out_file, decl, name, size, rounded) ++#else ++#undef ASM_EMIT_BSS ++#endif ++#endif ++ ++#if defined ASM_OUTPUT_ALIGNED_DECL_COMMON ++#define ASM_EMIT_COMMON(decl, name, size, rounded) \ ++ ASM_OUTPUT_ALIGNED_DECL_COMMON (asm_out_file, decl, name, size, DECL_ALIGN (decl)) ++#else ++#if defined ASM_OUTPUT_ALIGNED_COMMON ++#define ASM_EMIT_COMMON(decl, name, size, rounded) \ ++ ASM_OUTPUT_ALIGNED_COMMON (asm_out_file, name, size, DECL_ALIGN (decl)) ++#else ++#define ASM_EMIT_COMMON(decl, name, size, rounded) \ ++ ASM_OUTPUT_COMMON (asm_out_file, name, size, rounded) ++#endif ++#endif ++ ++static bool ++asm_emit_uninitialised (tree decl, const char *name, ++ unsigned HOST_WIDE_INT size ATTRIBUTE_UNUSED, ++ unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED) ++{ ++ enum ++ { ++ asm_dest_common, ++ asm_dest_bss, ++ asm_dest_local ++ } ++ destination = asm_dest_local; ++ ++ /* ??? We should handle .bss via select_section mechanisms rather than ++ via special target hooks. That would eliminate this special case. */ ++ if (TREE_PUBLIC (decl)) ++ { ++ if (!DECL_COMMON (decl)) ++#ifdef ASM_EMIT_BSS ++ destination = asm_dest_bss; ++#else ++ return false; ++#endif ++ else ++ destination = asm_dest_common; ++ } ++ ++ if (destination == asm_dest_bss) ++ globalize_decl (decl); ++ resolve_unique_section (decl, 0, flag_data_sections); ++ ++ if (flag_shared_data) ++ { ++ switch (destination) ++ { ++#ifdef ASM_OUTPUT_SHARED_BSS ++ case asm_dest_bss: ++ ASM_OUTPUT_SHARED_BSS (asm_out_file, decl, name, size, rounded); ++ return; ++#endif ++#ifdef ASM_OUTPUT_SHARED_COMMON ++ case asm_dest_common: ++ ASM_OUTPUT_SHARED_COMMON (asm_out_file, name, size, rounded); ++ return; ++#endif ++#ifdef ASM_OUTPUT_SHARED_LOCAL ++ case asm_dest_local: ++ ASM_OUTPUT_SHARED_LOCAL (asm_out_file, name, size, rounded); ++ return; ++#endif ++ default: ++ break; ++ } ++ } ++ ++ switch (destination) ++ { ++#ifdef ASM_EMIT_BSS ++ case asm_dest_bss: ++ ASM_EMIT_BSS (decl, name, size, rounded); ++ break; ++#endif ++ case asm_dest_common: ++ ASM_EMIT_COMMON (decl, name, size, rounded); ++ break; ++ case asm_dest_local: ++ ASM_EMIT_LOCAL (decl, name, size, rounded); ++ break; ++ default: ++ abort (); ++ } ++ ++ return true; ++} ++ ++/* Assemble everything that is needed for a variable or function declaration. ++ Not used for automatic variables, and not used for function definitions. ++ Should not be called for variables of incomplete structure type. ++ ++ TOP_LEVEL is nonzero if this variable has file scope. ++ AT_END is nonzero if this is the special handling, at end of compilation, ++ to define things that have had only tentative definitions. ++ DONT_OUTPUT_DATA if nonzero means don't actually output the ++ initial value (that will be done by the caller). */ ++ ++void ++assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED, ++ int at_end ATTRIBUTE_UNUSED, int dont_output_data) ++{ ++ const char *name; ++ unsigned int align; ++ int reloc = 0; ++ rtx decl_rtl; ++ ++ if (lang_hooks.decls.prepare_assemble_variable) ++ (*lang_hooks.decls.prepare_assemble_variable) (decl); ++ ++ last_assemble_variable_decl = 0; ++ ++ /* Normally no need to say anything here for external references, ++ since assemble_external is called by the language-specific code ++ when a declaration is first seen. */ ++ ++ if (DECL_EXTERNAL (decl)) ++ return; ++ ++ /* Output no assembler code for a function declaration. ++ Only definitions of functions output anything. */ ++ ++ if (TREE_CODE (decl) == FUNCTION_DECL) ++ return; ++ ++ /* Do nothing for global register variables. */ ++ if (DECL_RTL_SET_P (decl) && GET_CODE (DECL_RTL (decl)) == REG) ++ { ++ TREE_ASM_WRITTEN (decl) = 1; ++ return; ++ } ++ ++ /* If type was incomplete when the variable was declared, ++ see if it is complete now. */ ++ ++ if (DECL_SIZE (decl) == 0) ++ layout_decl (decl, 0); ++ ++ /* Still incomplete => don't allocate it; treat the tentative defn ++ (which is what it must have been) as an `extern' reference. */ ++ ++ if (!dont_output_data && DECL_SIZE (decl) == 0) ++ { ++ error ("%Jstorage size of `%D' isn't known", decl, decl); ++ TREE_ASM_WRITTEN (decl) = 1; ++ return; ++ } ++ ++ /* The first declaration of a variable that comes through this function ++ decides whether it is global (in C, has external linkage) ++ or local (in C, has internal linkage). So do nothing more ++ if this function has already run. */ ++ ++ if (TREE_ASM_WRITTEN (decl)) ++ return; ++ ++ /* Make sure targetm.encode_section_info is invoked before we set ++ ASM_WRITTEN. */ ++ decl_rtl = DECL_RTL (decl); ++ ++ TREE_ASM_WRITTEN (decl) = 1; ++ ++ /* Do no output if -fsyntax-only. */ ++ if (flag_syntax_only) ++ return; ++ ++ app_disable (); ++ ++ if (! dont_output_data ++ && ! host_integerp (DECL_SIZE_UNIT (decl), 1)) ++ { ++ error ("%Jsize of variable '%D' is too large", decl, decl); ++ return; ++ } ++ ++ name = XSTR (XEXP (decl_rtl, 0), 0); ++ if (TREE_PUBLIC (decl) && DECL_NAME (decl)) ++ notice_global_symbol (decl); ++ ++ /* Compute the alignment of this data. */ ++ ++ align = DECL_ALIGN (decl); ++ ++ /* In the case for initialing an array whose length isn't specified, ++ where we have not yet been able to do the layout, ++ figure out the proper alignment now. */ ++ if (dont_output_data && DECL_SIZE (decl) == 0 ++ && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE) ++ align = MAX (align, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl)))); ++ ++ /* Some object file formats have a maximum alignment which they support. ++ In particular, a.out format supports a maximum alignment of 4. */ ++#ifndef MAX_OFILE_ALIGNMENT ++#define MAX_OFILE_ALIGNMENT BIGGEST_ALIGNMENT ++#endif ++ if (align > MAX_OFILE_ALIGNMENT) ++ { ++ warning ("%Jalignment of '%D' is greater than maximum object " ++ "file alignment. Using %d", decl, decl, ++ MAX_OFILE_ALIGNMENT/BITS_PER_UNIT); ++ align = MAX_OFILE_ALIGNMENT; ++ } ++ ++ /* On some machines, it is good to increase alignment sometimes. */ ++ if (! DECL_USER_ALIGN (decl)) ++ { ++#ifdef DATA_ALIGNMENT ++ align = DATA_ALIGNMENT (TREE_TYPE (decl), align); ++#endif ++#ifdef CONSTANT_ALIGNMENT ++ if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != error_mark_node) ++ align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align); ++#endif ++ } ++ ++ /* Reset the alignment in case we have made it tighter, so we can benefit ++ from it in get_pointer_alignment. */ ++ DECL_ALIGN (decl) = align; ++ set_mem_align (decl_rtl, align); ++ ++ if (TREE_PUBLIC (decl)) ++ maybe_assemble_visibility (decl); ++ ++ /* Output any data that we will need to use the address of. */ ++ if (DECL_INITIAL (decl) == error_mark_node) ++ reloc = contains_pointers_p (TREE_TYPE (decl)) ? 3 : 0; ++ else if (DECL_INITIAL (decl)) ++ { ++ reloc = compute_reloc_for_constant (DECL_INITIAL (decl)); ++ output_addressed_constants (DECL_INITIAL (decl)); ++ } ++ resolve_unique_section (decl, reloc, flag_data_sections); ++ ++ /* Handle uninitialized definitions. */ ++ ++ /* If the decl has been given an explicit section name, then it ++ isn't common, and shouldn't be handled as such. */ ++ if (DECL_SECTION_NAME (decl) || dont_output_data) ++ ; ++ /* We don't implement common thread-local data at present. */ ++ else if (DECL_THREAD_LOCAL (decl)) ++ { ++ if (DECL_COMMON (decl)) ++ sorry ("thread-local COMMON data not implemented"); ++ } ++ else if (DECL_INITIAL (decl) == 0 ++ || DECL_INITIAL (decl) == error_mark_node ++ || (flag_zero_initialized_in_bss ++ /* Leave constant zeroes in .rodata so they can be shared. */ ++ && !TREE_READONLY (decl) ++ && initializer_zerop (DECL_INITIAL (decl)))) ++ { ++ unsigned HOST_WIDE_INT size = tree_low_cst (DECL_SIZE_UNIT (decl), 1); ++ unsigned HOST_WIDE_INT rounded = size; ++ ++ /* Don't allocate zero bytes of common, ++ since that means "undefined external" in the linker. */ ++ if (size == 0) ++ rounded = 1; ++ ++ /* Round size up to multiple of BIGGEST_ALIGNMENT bits ++ so that each uninitialized object starts on such a boundary. */ ++ rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; ++ rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) ++ * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); ++ ++#if !defined(ASM_OUTPUT_ALIGNED_COMMON) && !defined(ASM_OUTPUT_ALIGNED_DECL_COMMON) && !defined(ASM_OUTPUT_ALIGNED_BSS) ++ if ((unsigned HOST_WIDE_INT) DECL_ALIGN (decl) / BITS_PER_UNIT > rounded) ++ warning ("%Jrequested alignment for '%D' is greater than " ++ "implemented alignment of %d", decl, decl, rounded); ++#endif ++ ++ /* If the target cannot output uninitialized but not common global data ++ in .bss, then we have to use .data, so fall through. */ ++ if (asm_emit_uninitialised (decl, name, size, rounded)) ++ return; ++ } ++ ++ /* Handle initialized definitions. ++ Also handle uninitialized global definitions if -fno-common and the ++ target doesn't support ASM_OUTPUT_BSS. */ ++ ++ /* First make the assembler name(s) global if appropriate. */ ++ if (TREE_PUBLIC (decl) && DECL_NAME (decl)) ++ globalize_decl (decl); ++ ++ /* Switch to the appropriate section. */ ++ variable_section (decl, reloc); ++ ++ /* dbxout.c needs to know this. */ ++ if (in_text_section ()) ++ DECL_IN_TEXT_SECTION (decl) = 1; ++ ++ /* Output the alignment of this data. */ ++ if (align > BITS_PER_UNIT) ++ { ++ ASM_OUTPUT_ALIGN (asm_out_file, ++ floor_log2 (DECL_ALIGN (decl) / BITS_PER_UNIT)); ++ } ++ ++ /* Do any machine/system dependent processing of the object. */ ++#ifdef ASM_DECLARE_OBJECT_NAME ++ last_assemble_variable_decl = decl; ++ ASM_DECLARE_OBJECT_NAME (asm_out_file, name, decl); ++#else ++ /* Standard thing is just output label for the object. */ ++ ASM_OUTPUT_LABEL (asm_out_file, name); ++#endif /* ASM_DECLARE_OBJECT_NAME */ ++ ++ if (!dont_output_data) ++ { ++ if (DECL_INITIAL (decl) && DECL_INITIAL (decl) != error_mark_node) ++ /* Output the actual data. */ ++ output_constant (DECL_INITIAL (decl), ++ tree_low_cst (DECL_SIZE_UNIT (decl), 1), ++ align); ++ else ++ /* Leave space for it. */ ++ assemble_zeros (tree_low_cst (DECL_SIZE_UNIT (decl), 1)); ++ } ++} ++ ++/* Return 1 if type TYPE contains any pointers. */ ++ ++static int ++contains_pointers_p (tree type) ++{ ++ switch (TREE_CODE (type)) ++ { ++ case POINTER_TYPE: ++ case REFERENCE_TYPE: ++ /* I'm not sure whether OFFSET_TYPE needs this treatment, ++ so I'll play safe and return 1. */ ++ case OFFSET_TYPE: ++ return 1; ++ ++ case RECORD_TYPE: ++ case UNION_TYPE: ++ case QUAL_UNION_TYPE: ++ { ++ tree fields; ++ /* For a type that has fields, see if the fields have pointers. */ ++ for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields)) ++ if (TREE_CODE (fields) == FIELD_DECL ++ && contains_pointers_p (TREE_TYPE (fields))) ++ return 1; ++ return 0; ++ } ++ ++ case ARRAY_TYPE: ++ /* An array type contains pointers if its element type does. */ ++ return contains_pointers_p (TREE_TYPE (type)); ++ ++ default: ++ return 0; ++ } ++} ++ ++#ifdef ASM_OUTPUT_EXTERNAL ++/* True if DECL is a function decl for which no out-of-line copy exists. ++ It is assumed that DECL's assembler name has been set. */ ++ ++static bool ++incorporeal_function_p (tree decl) ++{ ++ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl)) ++ { ++ const char *name; ++ ++ if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL ++ && DECL_FUNCTION_CODE (decl) == BUILT_IN_ALLOCA) ++ return true; ++ ++ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); ++ if (strncmp (name, "__builtin_", strlen ("__builtin_")) == 0) ++ return true; ++ } ++ return false; ++} ++#endif ++ ++/* Output something to declare an external symbol to the assembler. ++ (Most assemblers don't need this, so we normally output nothing.) ++ Do nothing if DECL is not external. */ ++ ++void ++assemble_external (tree decl ATTRIBUTE_UNUSED) ++{ ++ /* Because most platforms do not define ASM_OUTPUT_EXTERNAL, the ++ main body of this code is only rarely exercised. To provide some ++ testing, on all platforms, we make sure that the ASM_OUT_FILE is ++ open. If it's not, we should not be calling this function. */ ++ if (!asm_out_file) ++ abort (); ++ ++#ifdef ASM_OUTPUT_EXTERNAL ++ if (DECL_P (decl) && DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)) ++ { ++ rtx rtl = DECL_RTL (decl); ++ ++ if (GET_CODE (rtl) == MEM && GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF ++ && !SYMBOL_REF_USED (XEXP (rtl, 0)) ++ && !incorporeal_function_p (decl)) ++ { ++ /* Some systems do require some output. */ ++ SYMBOL_REF_USED (XEXP (rtl, 0)) = 1; ++ ASM_OUTPUT_EXTERNAL (asm_out_file, decl, XSTR (XEXP (rtl, 0), 0)); ++ } ++ } ++#endif ++} ++ ++/* Similar, for calling a library function FUN. */ ++ ++void ++assemble_external_libcall (rtx fun) ++{ ++ /* Declare library function name external when first used, if nec. */ ++ if (! SYMBOL_REF_USED (fun)) ++ { ++ SYMBOL_REF_USED (fun) = 1; ++ (*targetm.asm_out.external_libcall) (fun); ++ } ++} ++ ++/* Assemble a label named NAME. */ ++ ++void ++assemble_label (const char *name) ++{ ++ ASM_OUTPUT_LABEL (asm_out_file, name); ++} ++ ++/* Set the symbol_referenced flag for ID and notify callgraph code. */ ++void ++mark_referenced (tree id) ++{ ++ if (!TREE_SYMBOL_REFERENCED (id)) ++ { ++ struct cgraph_node *node; ++ struct cgraph_varpool_node *vnode; ++ ++ if (!cgraph_global_info_ready) ++ { ++ node = cgraph_node_for_identifier (id); ++ if (node) ++ cgraph_mark_needed_node (node); ++ } ++ ++ vnode = cgraph_varpool_node_for_identifier (id); ++ if (vnode) ++ cgraph_varpool_mark_needed_node (vnode); ++ } ++ TREE_SYMBOL_REFERENCED (id) = 1; ++} ++ ++/* Output to FILE a reference to the assembler name of a C-level name NAME. ++ If NAME starts with a *, the rest of NAME is output verbatim. ++ Otherwise NAME is transformed in an implementation-defined way ++ (usually by the addition of an underscore). ++ Many macros in the tm file are defined to call this function. */ ++ ++void ++assemble_name (FILE *file, const char *name) ++{ ++ const char *real_name; ++ tree id; ++ ++ real_name = (* targetm.strip_name_encoding) (name); ++ ++ id = maybe_get_identifier (real_name); ++ if (id) ++ mark_referenced (id); ++ ++ if (name[0] == '*') ++ fputs (&name[1], file); ++ else ++ ASM_OUTPUT_LABELREF (file, name); ++} ++ ++/* Allocate SIZE bytes writable static space with a gensym name ++ and return an RTX to refer to its address. */ ++ ++rtx ++assemble_static_space (unsigned HOST_WIDE_INT size) ++{ ++ char name[12]; ++ const char *namestring; ++ rtx x; ++ ++#if 0 ++ if (flag_shared_data) ++ data_section (); ++#endif ++ ++ ASM_GENERATE_INTERNAL_LABEL (name, "LF", const_labelno); ++ ++const_labelno; ++ namestring = ggc_strdup (name); ++ ++ x = gen_rtx_SYMBOL_REF (Pmode, namestring); ++ SYMBOL_REF_FLAGS (x) = SYMBOL_FLAG_LOCAL; ++ ++#ifdef ASM_OUTPUT_ALIGNED_DECL_LOCAL ++ ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, NULL_TREE, name, size, ++ BIGGEST_ALIGNMENT); ++#else ++#ifdef ASM_OUTPUT_ALIGNED_LOCAL ++ ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, BIGGEST_ALIGNMENT); ++#else ++ { ++ /* Round size up to multiple of BIGGEST_ALIGNMENT bits ++ so that each uninitialized object starts on such a boundary. */ ++ /* Variable `rounded' might or might not be used in ASM_OUTPUT_LOCAL. */ ++ unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED ++ = ((size + (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1) ++ / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) ++ * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); ++ ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded); ++ } ++#endif ++#endif ++ return x; ++} ++ ++/* Assemble the static constant template for function entry trampolines. ++ This is done at most once per compilation. ++ Returns an RTX for the address of the template. */ ++ ++#ifdef TRAMPOLINE_TEMPLATE ++rtx ++assemble_trampoline_template (void) ++{ ++ char label[256]; ++ const char *name; ++ int align; ++ rtx symbol; ++ ++ /* By default, put trampoline templates in read-only data section. */ ++ ++#ifdef TRAMPOLINE_SECTION ++ TRAMPOLINE_SECTION (); ++#else ++ readonly_data_section (); ++#endif ++ ++ /* Write the assembler code to define one. */ ++ align = floor_log2 (TRAMPOLINE_ALIGNMENT / BITS_PER_UNIT); ++ if (align > 0) ++ { ++ ASM_OUTPUT_ALIGN (asm_out_file, align); ++ } ++ ++ (*targetm.asm_out.internal_label) (asm_out_file, "LTRAMP", 0); ++ TRAMPOLINE_TEMPLATE (asm_out_file); ++ ++ /* Record the rtl to refer to it. */ ++ ASM_GENERATE_INTERNAL_LABEL (label, "LTRAMP", 0); ++ name = ggc_strdup (label); ++ symbol = gen_rtx_SYMBOL_REF (Pmode, name); ++ SYMBOL_REF_FLAGS (symbol) = SYMBOL_FLAG_LOCAL; ++ ++ return symbol; ++} ++#endif ++ ++/* A and B are either alignments or offsets. Return the minimum alignment ++ that may be assumed after adding the two together. */ ++ ++static inline unsigned ++min_align (unsigned int a, unsigned int b) ++{ ++ return (a | b) & -(a | b); ++} ++ ++/* Return the assembler directive for creating a given kind of integer ++ object. SIZE is the number of bytes in the object and ALIGNED_P ++ indicates whether it is known to be aligned. Return NULL if the ++ assembly dialect has no such directive. ++ ++ The returned string should be printed at the start of a new line and ++ be followed immediately by the object's initial value. */ ++ ++const char * ++integer_asm_op (int size, int aligned_p) ++{ ++ struct asm_int_op *ops; ++ ++ if (aligned_p) ++ ops = &targetm.asm_out.aligned_op; ++ else ++ ops = &targetm.asm_out.unaligned_op; ++ ++ switch (size) ++ { ++ case 1: ++ return targetm.asm_out.byte_op; ++ case 2: ++ return ops->hi; ++ case 4: ++ return ops->si; ++ case 8: ++ return ops->di; ++ case 16: ++ return ops->ti; ++ default: ++ return NULL; ++ } ++} ++ ++/* Use directive OP to assemble an integer object X. Print OP at the ++ start of the line, followed immediately by the value of X. */ ++ ++void ++assemble_integer_with_op (const char *op, rtx x) ++{ ++ fputs (op, asm_out_file); ++ output_addr_const (asm_out_file, x); ++ fputc ('\n', asm_out_file); ++} ++ ++/* The default implementation of the asm_out.integer target hook. */ ++ ++bool ++default_assemble_integer (rtx x ATTRIBUTE_UNUSED, ++ unsigned int size ATTRIBUTE_UNUSED, ++ int aligned_p ATTRIBUTE_UNUSED) ++{ ++ const char *op = integer_asm_op (size, aligned_p); ++ return op && (assemble_integer_with_op (op, x), true); ++} ++ ++/* Assemble the integer constant X into an object of SIZE bytes. ALIGN is ++ the alignment of the integer in bits. Return 1 if we were able to output ++ the constant, otherwise 0. If FORCE is nonzero, abort if we can't output ++ the constant. */ ++ ++bool ++assemble_integer (rtx x, unsigned int size, unsigned int align, int force) ++{ ++ int aligned_p; ++ ++ aligned_p = (align >= MIN (size * BITS_PER_UNIT, BIGGEST_ALIGNMENT)); ++ ++ /* See if the target hook can handle this kind of object. */ ++ if ((*targetm.asm_out.integer) (x, size, aligned_p)) ++ return true; ++ ++ /* If the object is a multi-byte one, try splitting it up. Split ++ it into words it if is multi-word, otherwise split it into bytes. */ ++ if (size > 1) ++ { ++ enum machine_mode omode, imode; ++ unsigned int subalign; ++ unsigned int subsize, i; ++ ++ subsize = size > UNITS_PER_WORD? UNITS_PER_WORD : 1; ++ subalign = MIN (align, subsize * BITS_PER_UNIT); ++ omode = mode_for_size (subsize * BITS_PER_UNIT, MODE_INT, 0); ++ imode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0); ++ ++ for (i = 0; i < size; i += subsize) ++ { ++ rtx partial = simplify_subreg (omode, x, imode, i); ++ if (!partial || !assemble_integer (partial, subsize, subalign, 0)) ++ break; ++ } ++ if (i == size) ++ return true; ++ ++ /* If we've printed some of it, but not all of it, there's no going ++ back now. */ ++ if (i > 0) ++ abort (); ++ } ++ ++ if (force) ++ abort (); ++ ++ return false; ++} ++ ++void ++assemble_real (REAL_VALUE_TYPE d, enum machine_mode mode, unsigned int align) ++{ ++ long data[4]; ++ int i; ++ int bitsize, nelts, nunits, units_per; ++ ++ /* This is hairy. We have a quantity of known size. real_to_target ++ will put it into an array of *host* longs, 32 bits per element ++ (even if long is more than 32 bits). We need to determine the ++ number of array elements that are occupied (nelts) and the number ++ of *target* min-addressable units that will be occupied in the ++ object file (nunits). We cannot assume that 32 divides the ++ mode's bitsize (size * BITS_PER_UNIT) evenly. ++ ++ size * BITS_PER_UNIT is used here to make sure that padding bits ++ (which might appear at either end of the value; real_to_target ++ will include the padding bits in its output array) are included. */ ++ ++ nunits = GET_MODE_SIZE (mode); ++ bitsize = nunits * BITS_PER_UNIT; ++ nelts = CEIL (bitsize, 32); ++ units_per = 32 / BITS_PER_UNIT; ++ ++ real_to_target (data, &d, mode); ++ ++ /* Put out the first word with the specified alignment. */ ++ assemble_integer (GEN_INT (data[0]), MIN (nunits, units_per), align, 1); ++ nunits -= units_per; ++ ++ /* Subsequent words need only 32-bit alignment. */ ++ align = min_align (align, 32); ++ ++ for (i = 1; i < nelts; i++) ++ { ++ assemble_integer (GEN_INT (data[i]), MIN (nunits, units_per), align, 1); ++ nunits -= units_per; ++ } ++} ++ ++/* Given an expression EXP with a constant value, ++ reduce it to the sum of an assembler symbol and an integer. ++ Store them both in the structure *VALUE. ++ Abort if EXP does not reduce. */ ++ ++struct addr_const GTY(()) ++{ ++ rtx base; ++ HOST_WIDE_INT offset; ++}; ++ ++static void ++decode_addr_const (tree exp, struct addr_const *value) ++{ ++ tree target = TREE_OPERAND (exp, 0); ++ int offset = 0; ++ rtx x; ++ ++ while (1) ++ { ++ if (TREE_CODE (target) == COMPONENT_REF ++ && host_integerp (byte_position (TREE_OPERAND (target, 1)), 0)) ++ ++ { ++ offset += int_byte_position (TREE_OPERAND (target, 1)); ++ target = TREE_OPERAND (target, 0); ++ } ++ else if (TREE_CODE (target) == ARRAY_REF ++ || TREE_CODE (target) == ARRAY_RANGE_REF) ++ { ++ offset += (tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (target)), 1) ++ * tree_low_cst (TREE_OPERAND (target, 1), 0)); ++ target = TREE_OPERAND (target, 0); ++ } ++ else ++ break; ++ } ++ ++ switch (TREE_CODE (target)) ++ { ++ case VAR_DECL: ++ case FUNCTION_DECL: ++ x = DECL_RTL (target); ++ break; ++ ++ case LABEL_DECL: ++ x = gen_rtx_MEM (FUNCTION_MODE, ++ gen_rtx_LABEL_REF (VOIDmode, force_label_rtx (target))); ++ break; ++ ++ case REAL_CST: ++ case STRING_CST: ++ case COMPLEX_CST: ++ case CONSTRUCTOR: ++ case INTEGER_CST: ++ x = output_constant_def (target, 1); ++ break; ++ ++ default: ++ abort (); ++ } ++ ++ if (GET_CODE (x) != MEM) ++ abort (); ++ x = XEXP (x, 0); ++ ++ value->base = x; ++ value->offset = offset; ++} ++ ++/* We do RTX_UNSPEC + XINT (blah), so nothing can go after RTX_UNSPEC. */ ++enum kind { RTX_UNKNOWN, RTX_DOUBLE, RTX_VECTOR, RTX_INT, RTX_UNSPEC }; ++struct rtx_const GTY(()) ++{ ++ ENUM_BITFIELD(kind) kind : 16; ++ ENUM_BITFIELD(machine_mode) mode : 16; ++ union rtx_const_un { ++ REAL_VALUE_TYPE GTY ((tag ("4"))) du; ++ struct rtx_const_u_addr { ++ rtx base; ++ const char *symbol; ++ HOST_WIDE_INT offset; ++ } GTY ((tag ("1"))) addr; ++ struct rtx_const_u_di { ++ HOST_WIDE_INT high; ++ HOST_WIDE_INT low; ++ } GTY ((tag ("0"))) di; ++ ++ /* The max vector size we have is 16 wide; two variants for ++ integral and floating point vectors. */ ++ struct rtx_const_int_vec { ++ HOST_WIDE_INT high; ++ HOST_WIDE_INT low; ++ } GTY ((tag ("2"))) int_vec[16]; ++ ++ REAL_VALUE_TYPE GTY ((tag ("3"))) fp_vec[8]; ++ ++ } GTY ((desc ("%1.kind >= RTX_INT"), descbits ("1"))) un; ++}; ++ ++/* Uniquize all constants that appear in memory. ++ Each constant in memory thus far output is recorded ++ in `const_desc_table'. */ ++ ++struct constant_descriptor_tree GTY(()) ++{ ++ /* A MEM for the constant. */ ++ rtx rtl; ++ ++ /* The value of the constant. */ ++ tree value; ++}; ++ ++static GTY((param_is (struct constant_descriptor_tree))) ++ htab_t const_desc_htab; ++ ++static struct constant_descriptor_tree * build_constant_desc (tree); ++static void maybe_output_constant_def_contents (struct constant_descriptor_tree *, int); ++ ++/* Compute a hash code for a constant expression. */ ++ ++static hashval_t ++const_desc_hash (const void *ptr) ++{ ++ return const_hash_1 (((struct constant_descriptor_tree *)ptr)->value); ++} ++ ++static hashval_t ++const_hash_1 (const tree exp) ++{ ++ const char *p; ++ hashval_t hi; ++ int len, i; ++ enum tree_code code = TREE_CODE (exp); ++ ++ /* Either set P and LEN to the address and len of something to hash and ++ exit the switch or return a value. */ ++ ++ switch (code) ++ { ++ case INTEGER_CST: ++ p = (char *) &TREE_INT_CST (exp); ++ len = sizeof TREE_INT_CST (exp); ++ break; ++ ++ case REAL_CST: ++ return real_hash (TREE_REAL_CST_PTR (exp)); ++ ++ case STRING_CST: ++ if (flag_writable_strings) ++ { ++ p = (char *) &exp; ++ len = sizeof exp; ++ } ++ else ++ { ++ p = TREE_STRING_POINTER (exp); ++ len = TREE_STRING_LENGTH (exp); ++ } ++ break; ++ ++ case COMPLEX_CST: ++ return (const_hash_1 (TREE_REALPART (exp)) * 5 ++ + const_hash_1 (TREE_IMAGPART (exp))); ++ ++ case CONSTRUCTOR: ++ if (TREE_CODE (TREE_TYPE (exp)) == SET_TYPE) ++ { ++ char *tmp; ++ ++ len = int_size_in_bytes (TREE_TYPE (exp)); ++ tmp = alloca (len); ++ get_set_constructor_bytes (exp, (unsigned char *) tmp, len); ++ p = tmp; ++ break; ++ } ++ else ++ { ++ tree link; ++ ++ hi = 5 + int_size_in_bytes (TREE_TYPE (exp)); ++ ++ for (link = CONSTRUCTOR_ELTS (exp); link; link = TREE_CHAIN (link)) ++ if (TREE_VALUE (link)) ++ hi = hi * 603 + const_hash_1 (TREE_VALUE (link)); ++ ++ return hi; ++ } ++ ++ case ADDR_EXPR: ++ case FDESC_EXPR: ++ { ++ struct addr_const value; ++ ++ decode_addr_const (exp, &value); ++ if (GET_CODE (value.base) == SYMBOL_REF) ++ { ++ /* Don't hash the address of the SYMBOL_REF; ++ only use the offset and the symbol name. */ ++ hi = value.offset; ++ p = XSTR (value.base, 0); ++ for (i = 0; p[i] != 0; i++) ++ hi = ((hi * 613) + (unsigned) (p[i])); ++ } ++ else if (GET_CODE (value.base) == LABEL_REF) ++ hi = value.offset + CODE_LABEL_NUMBER (XEXP (value.base, 0)) * 13; ++ else ++ abort (); ++ } ++ return hi; ++ ++ case PLUS_EXPR: ++ case MINUS_EXPR: ++ return (const_hash_1 (TREE_OPERAND (exp, 0)) * 9 ++ + const_hash_1 (TREE_OPERAND (exp, 1))); ++ ++ case NOP_EXPR: ++ case CONVERT_EXPR: ++ case NON_LVALUE_EXPR: ++ return const_hash_1 (TREE_OPERAND (exp, 0)) * 7 + 2; ++ ++ default: ++ /* A language specific constant. Just hash the code. */ ++ return code; ++ } ++ ++ /* Compute hashing function. */ ++ hi = len; ++ for (i = 0; i < len; i++) ++ hi = ((hi * 613) + (unsigned) (p[i])); ++ ++ return hi; ++} ++ ++/* Wrapper of compare_constant, for the htab interface. */ ++static int ++const_desc_eq (const void *p1, const void *p2) ++{ ++ return compare_constant (((struct constant_descriptor_tree *)p1)->value, ++ ((struct constant_descriptor_tree *)p2)->value); ++} ++ ++/* Compare t1 and t2, and return 1 only if they are known to result in ++ the same bit pattern on output. */ ++ ++static int ++compare_constant (const tree t1, const tree t2) ++{ ++ enum tree_code typecode; ++ ++ if (t1 == NULL_TREE) ++ return t2 == NULL_TREE; ++ if (t2 == NULL_TREE) ++ return 0; ++ ++ if (TREE_CODE (t1) != TREE_CODE (t2)) ++ return 0; ++ ++ switch (TREE_CODE (t1)) ++ { ++ case INTEGER_CST: ++ /* Integer constants are the same only if the same width of type. */ ++ if (TYPE_PRECISION (TREE_TYPE (t1)) != TYPE_PRECISION (TREE_TYPE (t2))) ++ return 0; ++ return tree_int_cst_equal (t1, t2); ++ ++ case REAL_CST: ++ /* Real constants are the same only if the same width of type. */ ++ if (TYPE_PRECISION (TREE_TYPE (t1)) != TYPE_PRECISION (TREE_TYPE (t2))) ++ return 0; ++ ++ return REAL_VALUES_IDENTICAL (TREE_REAL_CST (t1), TREE_REAL_CST (t2)); ++ ++ case STRING_CST: ++ if (flag_writable_strings) ++ return t1 == t2; ++ ++ if (TYPE_MODE (TREE_TYPE (t1)) != TYPE_MODE (TREE_TYPE (t2))) ++ return 0; ++ ++ return (TREE_STRING_LENGTH (t1) == TREE_STRING_LENGTH (t2) ++ && ! memcmp (TREE_STRING_POINTER (t1), TREE_STRING_POINTER (t2), ++ TREE_STRING_LENGTH (t1))); ++ ++ case COMPLEX_CST: ++ return (compare_constant (TREE_REALPART (t1), TREE_REALPART (t2)) ++ && compare_constant (TREE_IMAGPART (t1), TREE_IMAGPART (t2))); ++ ++ case CONSTRUCTOR: ++ typecode = TREE_CODE (TREE_TYPE (t1)); ++ if (typecode != TREE_CODE (TREE_TYPE (t2))) ++ return 0; ++ ++ if (typecode == SET_TYPE) ++ { ++ int len = int_size_in_bytes (TREE_TYPE (t2)); ++ unsigned char *tmp1, *tmp2; ++ ++ if (int_size_in_bytes (TREE_TYPE (t1)) != len) ++ return 0; ++ ++ tmp1 = alloca (len); ++ tmp2 = alloca (len); ++ ++ if (get_set_constructor_bytes (t1, tmp1, len) != NULL_TREE) ++ return 0; ++ if (get_set_constructor_bytes (t2, tmp2, len) != NULL_TREE) ++ return 0; ++ ++ return memcmp (tmp1, tmp2, len) == 0; ++ } ++ else ++ { ++ tree l1, l2; ++ ++ if (typecode == ARRAY_TYPE) ++ { ++ HOST_WIDE_INT size_1 = int_size_in_bytes (TREE_TYPE (t1)); ++ /* For arrays, check that the sizes all match. */ ++ if (TYPE_MODE (TREE_TYPE (t1)) != TYPE_MODE (TREE_TYPE (t2)) ++ || size_1 == -1 ++ || size_1 != int_size_in_bytes (TREE_TYPE (t2))) ++ return 0; ++ } ++ else ++ { ++ /* For record and union constructors, require exact type ++ equality. */ ++ if (TREE_TYPE (t1) != TREE_TYPE (t2)) ++ return 0; ++ } ++ ++ for (l1 = CONSTRUCTOR_ELTS (t1), l2 = CONSTRUCTOR_ELTS (t2); ++ l1 && l2; ++ l1 = TREE_CHAIN (l1), l2 = TREE_CHAIN (l2)) ++ { ++ /* Check that each value is the same... */ ++ if (! compare_constant (TREE_VALUE (l1), TREE_VALUE (l2))) ++ return 0; ++ /* ... and that they apply to the same fields! */ ++ if (typecode == ARRAY_TYPE) ++ { ++ if (! compare_constant (TREE_PURPOSE (l1), ++ TREE_PURPOSE (l2))) ++ return 0; ++ } ++ else ++ { ++ if (TREE_PURPOSE (l1) != TREE_PURPOSE (l2)) ++ return 0; ++ } ++ } ++ ++ return l1 == NULL_TREE && l2 == NULL_TREE; ++ } ++ ++ case ADDR_EXPR: ++ case FDESC_EXPR: ++ { ++ struct addr_const value1, value2; ++ ++ decode_addr_const (t1, &value1); ++ decode_addr_const (t2, &value2); ++ return (value1.offset == value2.offset ++ && strcmp (XSTR (value1.base, 0), XSTR (value2.base, 0)) == 0); ++ } ++ ++ case PLUS_EXPR: ++ case MINUS_EXPR: ++ case RANGE_EXPR: ++ return (compare_constant (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0)) ++ && compare_constant(TREE_OPERAND (t1, 1), TREE_OPERAND (t2, 1))); ++ ++ case NOP_EXPR: ++ case CONVERT_EXPR: ++ case NON_LVALUE_EXPR: ++ return compare_constant (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0)); ++ ++ default: ++ { ++ tree nt1, nt2; ++ nt1 = (*lang_hooks.expand_constant) (t1); ++ nt2 = (*lang_hooks.expand_constant) (t2); ++ if (nt1 != t1 || nt2 != t2) ++ return compare_constant (nt1, nt2); ++ else ++ return 0; ++ } ++ } ++ ++ /* Should not get here. */ ++ abort (); ++} ++ ++/* Make a copy of the whole tree structure for a constant. This ++ handles the same types of nodes that compare_constant handles. ++ Writable string constants are never copied. */ ++ ++static tree ++copy_constant (tree exp) ++{ ++ switch (TREE_CODE (exp)) ++ { ++ case ADDR_EXPR: ++ /* For ADDR_EXPR, we do not want to copy the decl whose address ++ is requested. We do want to copy constants though. */ ++ if (TREE_CODE_CLASS (TREE_CODE (TREE_OPERAND (exp, 0))) == 'c') ++ return build1 (TREE_CODE (exp), TREE_TYPE (exp), ++ copy_constant (TREE_OPERAND (exp, 0))); ++ else ++ return copy_node (exp); ++ ++ case STRING_CST: ++ if (flag_writable_strings) ++ return exp; ++ /* FALLTHROUGH */ ++ case INTEGER_CST: ++ case REAL_CST: ++ return copy_node (exp); ++ ++ case COMPLEX_CST: ++ return build_complex (TREE_TYPE (exp), ++ copy_constant (TREE_REALPART (exp)), ++ copy_constant (TREE_IMAGPART (exp))); ++ ++ case PLUS_EXPR: ++ case MINUS_EXPR: ++ return build (TREE_CODE (exp), TREE_TYPE (exp), ++ copy_constant (TREE_OPERAND (exp, 0)), ++ copy_constant (TREE_OPERAND (exp, 1))); ++ ++ case NOP_EXPR: ++ case CONVERT_EXPR: ++ case NON_LVALUE_EXPR: ++ case VIEW_CONVERT_EXPR: ++ return build1 (TREE_CODE (exp), TREE_TYPE (exp), ++ copy_constant (TREE_OPERAND (exp, 0))); ++ ++ case CONSTRUCTOR: ++ { ++ tree copy = copy_node (exp); ++ tree list = copy_list (CONSTRUCTOR_ELTS (exp)); ++ tree tail; ++ ++ CONSTRUCTOR_ELTS (copy) = list; ++ for (tail = list; tail; tail = TREE_CHAIN (tail)) ++ TREE_VALUE (tail) = copy_constant (TREE_VALUE (tail)); ++ if (TREE_CODE (TREE_TYPE (exp)) == SET_TYPE) ++ for (tail = list; tail; tail = TREE_CHAIN (tail)) ++ TREE_PURPOSE (tail) = copy_constant (TREE_PURPOSE (tail)); ++ ++ return copy; ++ } ++ ++ default: ++ { ++ tree t; ++ t = (*lang_hooks.expand_constant) (exp); ++ if (t != exp) ++ return copy_constant (t); ++ else ++ abort (); ++ } ++ } ++} ++ ++/* Subroutine of output_constant_def: ++ No constant equal to EXP is known to have been output. ++ Make a constant descriptor to enter EXP in the hash table. ++ Assign the label number and construct RTL to refer to the ++ constant's location in memory. ++ Caller is responsible for updating the hash table. */ ++ ++static struct constant_descriptor_tree * ++build_constant_desc (tree exp) ++{ ++ rtx symbol; ++ rtx rtl; ++ char label[256]; ++ int labelno; ++ struct constant_descriptor_tree *desc; ++ ++ desc = ggc_alloc (sizeof (*desc)); ++ desc->value = copy_constant (exp); ++ ++ /* Create a string containing the label name, in LABEL. */ ++ labelno = const_labelno++; ++ ASM_GENERATE_INTERNAL_LABEL (label, "LC", labelno); ++ ++ /* We have a symbol name; construct the SYMBOL_REF and the MEM. */ ++ symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label)); ++ SYMBOL_REF_FLAGS (symbol) = SYMBOL_FLAG_LOCAL; ++ SYMBOL_REF_DECL (symbol) = desc->value; ++ TREE_CONSTANT_POOL_ADDRESS_P (symbol) = 1; ++ ++ rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (exp)), symbol); ++ set_mem_attributes (rtl, exp, 1); ++ set_mem_alias_set (rtl, 0); ++ set_mem_alias_set (rtl, const_alias_set); ++ ++ /* Set flags or add text to the name to record information, such as ++ that it is a local symbol. If the name is changed, the macro ++ ASM_OUTPUT_LABELREF will have to know how to strip this ++ information. This call might invalidate our local variable ++ SYMBOL; we can't use it afterward. */ ++ ++ (*targetm.encode_section_info) (exp, rtl, true); ++ ++ desc->rtl = rtl; ++ ++ return desc; ++} ++ ++/* Return an rtx representing a reference to constant data in memory ++ for the constant expression EXP. ++ ++ If assembler code for such a constant has already been output, ++ return an rtx to refer to it. ++ Otherwise, output such a constant in memory ++ and generate an rtx for it. ++ ++ If DEFER is nonzero, this constant can be deferred and output only ++ if referenced in the function after all optimizations. ++ ++ `const_desc_table' records which constants already have label strings. */ ++ ++rtx ++output_constant_def (tree exp, int defer) ++{ ++ struct constant_descriptor_tree *desc; ++ struct constant_descriptor_tree key; ++ void **loc; ++ ++ /* Look up EXP in the table of constant descriptors. If we didn't find ++ it, create a new one. */ ++ key.value = exp; ++ loc = htab_find_slot (const_desc_htab, &key, INSERT); ++ ++ desc = *loc; ++ if (desc == 0) ++ { ++ desc = build_constant_desc (exp); ++ *loc = desc; ++ } ++ ++ maybe_output_constant_def_contents (desc, defer); ++ return desc->rtl; ++} ++ ++/* Subroutine of output_constant_def: Decide whether or not we need to ++ output the constant DESC now, and if so, do it. */ ++static void ++maybe_output_constant_def_contents (struct constant_descriptor_tree *desc, ++ int defer) ++{ ++ rtx symbol = XEXP (desc->rtl, 0); ++ tree exp = desc->value; ++ ++ if (flag_syntax_only) ++ return; ++ ++ if (TREE_ASM_WRITTEN (exp)) ++ /* Already output; don't do it again. */ ++ return; ++ ++ /* The only constants that cannot safely be deferred, assuming the ++ context allows it, are strings under flag_writable_strings. */ ++ if (defer && (TREE_CODE (exp) != STRING_CST || !flag_writable_strings)) ++ { ++ /* Increment n_deferred_constants if it exists. It needs to be at ++ least as large as the number of constants actually referred to ++ by the function. If it's too small we'll stop looking too early ++ and fail to emit constants; if it's too large we'll only look ++ through the entire function when we could have stopped earlier. */ ++ if (cfun) ++ n_deferred_constants++; ++ return; ++ } ++ ++ output_constant_def_contents (symbol); ++} ++ ++/* We must output the constant data referred to by SYMBOL; do so. */ ++ ++static void ++output_constant_def_contents (rtx symbol) ++{ ++ tree exp = SYMBOL_REF_DECL (symbol); ++ const char *label = XSTR (symbol, 0); ++ HOST_WIDE_INT size; ++ ++ /* Make sure any other constants whose addresses appear in EXP ++ are assigned label numbers. */ ++ int reloc = compute_reloc_for_constant (exp); ++ ++ /* Align the location counter as required by EXP's data type. */ ++ int align = TYPE_ALIGN (TREE_TYPE (exp)); ++#ifdef CONSTANT_ALIGNMENT ++ align = CONSTANT_ALIGNMENT (exp, align); ++#endif ++ ++ output_addressed_constants (exp); ++ ++ /* We are no longer deferring this constant. */ ++ TREE_ASM_WRITTEN (exp) = 1; ++ ++ if (IN_NAMED_SECTION (exp)) ++ named_section (exp, NULL, reloc); ++ else ++ (*targetm.asm_out.select_section) (exp, reloc, align); ++ ++ if (align > BITS_PER_UNIT) ++ { ++ ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT)); ++ } ++ ++ size = int_size_in_bytes (TREE_TYPE (exp)); ++ if (TREE_CODE (exp) == STRING_CST) ++ size = MAX (TREE_STRING_LENGTH (exp), size); ++ ++ /* Do any machine/system dependent processing of the constant. */ ++#ifdef ASM_DECLARE_CONSTANT_NAME ++ ASM_DECLARE_CONSTANT_NAME (asm_out_file, label, exp, size); ++#else ++ /* Standard thing is just output label for the constant. */ ++ ASM_OUTPUT_LABEL (asm_out_file, label); ++#endif /* ASM_DECLARE_CONSTANT_NAME */ ++ ++ /* Output the value of EXP. */ ++ output_constant (exp, size, align); ++} ++ ++/* A constant which was deferred in its original location has been ++ inserted by the RTL inliner into a different function. The ++ current function's deferred constant count must be incremented. */ ++void ++notice_rtl_inlining_of_deferred_constant (void) ++{ ++ n_deferred_constants++; ++} ++ ++/* Look up EXP in the table of constant descriptors. Return the rtl ++ if it has been emitted, else null. */ ++ ++rtx ++lookup_constant_def (tree exp) ++{ ++ struct constant_descriptor_tree *desc; ++ struct constant_descriptor_tree key; ++ ++ key.value = exp; ++ desc = htab_find (const_desc_htab, &key); ++ ++ return (desc ? desc->rtl : NULL_RTX); ++} ++ ++/* Used in the hash tables to avoid outputting the same constant ++ twice. Unlike 'struct constant_descriptor_tree', RTX constants ++ are output once per function, not once per file; there seems ++ to be no reason for the difference. */ ++ ++struct constant_descriptor_rtx GTY(()) ++{ ++ /* More constant_descriptors with the same hash code. */ ++ struct constant_descriptor_rtx *next; ++ ++ /* A MEM for the constant. */ ++ rtx rtl; ++ ++ /* The value of the constant. */ ++ struct rtx_const value; ++}; ++ ++/* Structure to represent sufficient information about a constant so that ++ it can be output when the constant pool is output, so that function ++ integration can be done, and to simplify handling on machines that reference ++ constant pool as base+displacement. */ ++ ++struct pool_constant GTY(()) ++{ ++ struct constant_descriptor_rtx *desc; ++ struct pool_constant *next; ++ struct pool_constant *next_sym; ++ rtx constant; ++ enum machine_mode mode; ++ int labelno; ++ unsigned int align; ++ HOST_WIDE_INT offset; ++ int mark; ++}; ++ ++/* Hash code for a SYMBOL_REF with CONSTANT_POOL_ADDRESS_P true. ++ The argument is XSTR (... , 0) */ ++ ++#define SYMHASH(LABEL) (((unsigned long) (LABEL)) % MAX_RTX_HASH_TABLE) ++ ++/* Initialize constant pool hashing for a new function. */ ++ ++void ++init_varasm_status (struct function *f) ++{ ++ struct varasm_status *p; ++ p = ggc_alloc (sizeof (struct varasm_status)); ++ f->varasm = p; ++ p->x_const_rtx_hash_table ++ = ggc_alloc_cleared (MAX_RTX_HASH_TABLE ++ * sizeof (struct constant_descriptor_rtx *)); ++ p->x_const_rtx_sym_hash_table ++ = ggc_alloc_cleared (MAX_RTX_HASH_TABLE ++ * sizeof (struct pool_constant *)); ++ ++ p->x_first_pool = p->x_last_pool = 0; ++ p->x_pool_offset = 0; ++ p->deferred_constants = 0; ++} ++ ++ ++/* Express an rtx for a constant integer (perhaps symbolic) ++ as the sum of a symbol or label plus an explicit integer. ++ They are stored into VALUE. */ ++ ++static void ++decode_rtx_const (enum machine_mode mode, rtx x, struct rtx_const *value) ++{ ++ /* Clear the whole structure, including any gaps. */ ++ memset (value, 0, sizeof (struct rtx_const)); ++ ++ value->kind = RTX_INT; /* Most usual kind. */ ++ value->mode = mode; ++ ++ switch (GET_CODE (x)) ++ { ++ case CONST_DOUBLE: ++ value->kind = RTX_DOUBLE; ++ if (GET_MODE (x) != VOIDmode) ++ { ++ const REAL_VALUE_TYPE *r = CONST_DOUBLE_REAL_VALUE (x); ++ ++ value->mode = GET_MODE (x); ++ ++ /* Copy the REAL_VALUE_TYPE by members so that we don't ++ copy garbage from the original structure into our ++ carefully cleaned hashing structure. */ ++ value->un.du.class = r->class; ++ value->un.du.sign = r->sign; ++ switch (r->class) ++ { ++ case rvc_zero: ++ case rvc_inf: ++ break; ++ case rvc_normal: ++ value->un.du.exp = r->exp; ++ /* Fall through. */ ++ case rvc_nan: ++ memcpy (value->un.du.sig, r->sig, sizeof (r->sig)); ++ break; ++ default: ++ abort (); ++ } ++ } ++ else ++ { ++ value->un.di.low = CONST_DOUBLE_LOW (x); ++ value->un.di.high = CONST_DOUBLE_HIGH (x); ++ } ++ break; ++ ++ case CONST_VECTOR: ++ { ++ int units, i; ++ ++ units = CONST_VECTOR_NUNITS (x); ++ value->kind = RTX_VECTOR; ++ value->mode = mode; ++ ++ if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT) ++ { ++ for (i = 0; i < units; ++i) ++ { ++ rtx elt = CONST_VECTOR_ELT (x, i); ++ if (GET_CODE (elt) == CONST_INT) ++ { ++ value->un.int_vec[i].low = INTVAL (elt); ++ value->un.int_vec[i].high = 0; ++ } ++ else ++ { ++ value->un.int_vec[i].low = CONST_DOUBLE_LOW (elt); ++ value->un.int_vec[i].high = CONST_DOUBLE_HIGH (elt); ++ } ++ } ++ } ++ else if (GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT) ++ { ++ for (i = 0; i < units; ++i) ++ { ++ const REAL_VALUE_TYPE *r ++ = CONST_DOUBLE_REAL_VALUE (CONST_VECTOR_ELT (x, i)); ++ REAL_VALUE_TYPE *d = &value->un.fp_vec[i]; ++ ++ /* Copy the REAL_VALUE_TYPE by members so that we don't ++ copy garbage from the original structure into our ++ carefully cleaned hashing structure. */ ++ d->class = r->class; ++ d->sign = r->sign; ++ switch (r->class) ++ { ++ case rvc_zero: ++ case rvc_inf: ++ break; ++ case rvc_normal: ++ d->exp = r->exp; ++ /* Fall through. */ ++ case rvc_nan: ++ memcpy (d->sig, r->sig, sizeof (r->sig)); ++ break; ++ default: ++ abort (); ++ } ++ } ++ } ++ else ++ abort (); ++ } ++ break; ++ ++ case CONST_INT: ++ value->un.addr.offset = INTVAL (x); ++ break; ++ ++ case SYMBOL_REF: ++ case LABEL_REF: ++ case PC: ++ value->un.addr.base = x; ++ break; ++ ++ case CONST: ++ x = XEXP (x, 0); ++ if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT) ++ { ++ value->un.addr.base = XEXP (x, 0); ++ value->un.addr.offset = INTVAL (XEXP (x, 1)); ++ } ++ else if (GET_CODE (x) == MINUS && GET_CODE (XEXP (x, 1)) == CONST_INT) ++ { ++ value->un.addr.base = XEXP (x, 0); ++ value->un.addr.offset = - INTVAL (XEXP (x, 1)); ++ } ++ else ++ { ++ value->un.addr.base = x; ++ value->un.addr.offset = 0; ++ } ++ break; ++ ++ default: ++ value->kind = RTX_UNKNOWN; ++ break; ++ } ++ ++ if (value->kind == RTX_INT && value->un.addr.base != 0 ++ && GET_CODE (value->un.addr.base) == UNSPEC) ++ { ++ /* For a simple UNSPEC, the base is set to the ++ operand, the kind field is set to the index of ++ the unspec expression. ++ Together with the code below, in case that ++ the operand is a SYMBOL_REF or LABEL_REF, ++ the address of the string or the code_label ++ is taken as base. */ ++ if (XVECLEN (value->un.addr.base, 0) == 1) ++ { ++ value->kind = RTX_UNSPEC + XINT (value->un.addr.base, 1); ++ value->un.addr.base = XVECEXP (value->un.addr.base, 0, 0); ++ } ++ } ++ ++ if (value->kind >= RTX_INT && value->un.addr.base != 0) ++ switch (GET_CODE (value->un.addr.base)) ++ { ++ case SYMBOL_REF: ++ /* Use the string's address, not the SYMBOL_REF's address, ++ for the sake of addresses of library routines. */ ++ value->un.addr.symbol = XSTR (value->un.addr.base, 0); ++ value->un.addr.base = NULL_RTX; ++ break; ++ ++ case LABEL_REF: ++ /* For a LABEL_REF, compare labels. */ ++ value->un.addr.base = XEXP (value->un.addr.base, 0); ++ ++ default: ++ break; ++ } ++} ++ ++/* Given a MINUS expression, simplify it if both sides ++ include the same symbol. */ ++ ++rtx ++simplify_subtraction (rtx x) ++{ ++ struct rtx_const val0, val1; ++ ++ decode_rtx_const (GET_MODE (x), XEXP (x, 0), &val0); ++ decode_rtx_const (GET_MODE (x), XEXP (x, 1), &val1); ++ ++ if (val0.kind >= RTX_INT ++ && val0.kind == val1.kind ++ && val0.un.addr.base == val1.un.addr.base ++ && val0.un.addr.symbol == val1.un.addr.symbol) ++ return GEN_INT (val0.un.addr.offset - val1.un.addr.offset); ++ ++ return x; ++} ++ ++/* Compute a hash code for a constant RTL expression. */ ++ ++static unsigned int ++const_hash_rtx (enum machine_mode mode, rtx x) ++{ ++ union { ++ struct rtx_const value; ++ unsigned int data[sizeof(struct rtx_const) / sizeof (unsigned int)]; ++ } u; ++ ++ unsigned int hi; ++ size_t i; ++ ++ decode_rtx_const (mode, x, &u.value); ++ ++ /* Compute hashing function. */ ++ hi = 0; ++ for (i = 0; i < ARRAY_SIZE (u.data); i++) ++ hi = hi * 613 + u.data[i]; ++ ++ return hi % MAX_RTX_HASH_TABLE; ++} ++ ++/* Compare a constant rtl object X with a constant-descriptor DESC. ++ Return 1 if DESC describes a constant with the same value as X. */ ++ ++static int ++compare_constant_rtx (enum machine_mode mode, rtx x, ++ struct constant_descriptor_rtx *desc) ++{ ++ struct rtx_const value; ++ ++ decode_rtx_const (mode, x, &value); ++ ++ /* Compare constant contents. */ ++ return memcmp (&value, &desc->value, sizeof (struct rtx_const)) == 0; ++} ++ ++/* Construct a constant descriptor for the rtl-expression X. ++ It is up to the caller to enter the descriptor in the hash table. */ ++ ++static struct constant_descriptor_rtx * ++record_constant_rtx (enum machine_mode mode, rtx x) ++{ ++ struct constant_descriptor_rtx *ptr; ++ ++ ptr = ggc_alloc (sizeof (*ptr)); ++ decode_rtx_const (mode, x, &ptr->value); ++ ++ return ptr; ++} ++ ++/* Given a constant rtx X, make (or find) a memory constant for its value ++ and return a MEM rtx to refer to it in memory. */ ++ ++rtx ++force_const_mem (enum machine_mode mode, rtx x) ++{ ++ int hash; ++ struct constant_descriptor_rtx *desc; ++ char label[256]; ++ rtx def, symbol; ++ struct pool_constant *pool; ++ unsigned int align; ++ ++ /* If we're not allowed to drop X into the constant pool, don't. */ ++ if ((*targetm.cannot_force_const_mem) (x)) ++ return NULL_RTX; ++ ++ /* Compute hash code of X. Search the descriptors for that hash code ++ to see if any of them describes X. If yes, we have an rtx to use. */ ++ hash = const_hash_rtx (mode, x); ++ for (desc = const_rtx_hash_table[hash]; desc; desc = desc->next) ++ if (compare_constant_rtx (mode, x, desc)) ++ return copy_rtx (desc->rtl); ++ ++ /* No constant equal to X is known to have been output. ++ Make a constant descriptor to enter X in the hash table ++ and make a MEM for it. */ ++ desc = record_constant_rtx (mode, x); ++ desc->next = const_rtx_hash_table[hash]; ++ const_rtx_hash_table[hash] = desc; ++ ++ /* Align the location counter as required by EXP's data type. */ ++ align = GET_MODE_ALIGNMENT (mode == VOIDmode ? word_mode : mode); ++#ifdef CONSTANT_ALIGNMENT ++ { ++ tree type = (*lang_hooks.types.type_for_mode) (mode, 0); ++ if (type != NULL_TREE) ++ align = CONSTANT_ALIGNMENT (make_tree (type, x), align); ++ } ++#endif ++ ++ pool_offset += (align / BITS_PER_UNIT) - 1; ++ pool_offset &= ~ ((align / BITS_PER_UNIT) - 1); ++ ++ if (GET_CODE (x) == LABEL_REF) ++ LABEL_PRESERVE_P (XEXP (x, 0)) = 1; ++ ++ /* Allocate a pool constant descriptor, fill it in, and chain it in. */ ++ pool = ggc_alloc (sizeof (struct pool_constant)); ++ pool->desc = desc; ++ pool->constant = x; ++ pool->mode = mode; ++ pool->labelno = const_labelno; ++ pool->align = align; ++ pool->offset = pool_offset; ++ pool->mark = 1; ++ pool->next = 0; ++ ++ if (last_pool == 0) ++ first_pool = pool; ++ else ++ last_pool->next = pool; ++ ++ last_pool = pool; ++ pool_offset += GET_MODE_SIZE (mode); ++ ++ /* Create a string containing the label name, in LABEL. */ ++ ASM_GENERATE_INTERNAL_LABEL (label, "LC", const_labelno); ++ ++ ++const_labelno; ++ ++ /* Construct the SYMBOL_REF and the MEM. */ ++ ++ symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label)); ++ SYMBOL_REF_FLAGS (symbol) = SYMBOL_FLAG_LOCAL; ++ ++ pool->desc->rtl = def = gen_rtx_MEM (mode, symbol); ++ set_mem_attributes (def, (*lang_hooks.types.type_for_mode) (mode, 0), 1); ++ RTX_UNCHANGING_P (def) = 1; ++ ++ /* Add label to symbol hash table. */ ++ hash = SYMHASH (XSTR (symbol, 0)); ++ pool->next_sym = const_rtx_sym_hash_table[hash]; ++ const_rtx_sym_hash_table[hash] = pool; ++ ++ /* Mark the symbol_ref as belonging to this constants pool. */ ++ CONSTANT_POOL_ADDRESS_P (symbol) = 1; ++ SYMBOL_REF_FLAGS (symbol) = SYMBOL_FLAG_LOCAL; ++ current_function_uses_const_pool = 1; ++ ++ return copy_rtx (def); ++} ++ ++/* Given a SYMBOL_REF with CONSTANT_POOL_ADDRESS_P true, return a pointer to ++ the corresponding pool_constant structure. */ ++ ++static struct pool_constant * ++find_pool_constant (struct function *f, rtx addr) ++{ ++ struct pool_constant *pool; ++ const char *label = XSTR (addr, 0); ++ ++ for (pool = f->varasm->x_const_rtx_sym_hash_table[SYMHASH (label)]; pool; ++ pool = pool->next_sym) ++ if (XSTR (XEXP (pool->desc->rtl, 0), 0) == label) ++ return pool; ++ ++ abort (); ++} ++ ++/* Given a constant pool SYMBOL_REF, return the corresponding constant. */ ++ ++rtx ++get_pool_constant (rtx addr) ++{ ++ return (find_pool_constant (cfun, addr))->constant; ++} ++ ++/* Given a constant pool SYMBOL_REF, return the corresponding constant ++ and whether it has been output or not. */ ++ ++rtx ++get_pool_constant_mark (rtx addr, bool *pmarked) ++{ ++ struct pool_constant *pool = find_pool_constant (cfun, addr); ++ *pmarked = (pool->mark != 0); ++ return pool->constant; ++} ++ ++/* Likewise, but for the constant pool of a specific function. */ ++ ++rtx ++get_pool_constant_for_function (struct function *f, rtx addr) ++{ ++ return (find_pool_constant (f, addr))->constant; ++} ++ ++/* Similar, return the mode. */ ++ ++enum machine_mode ++get_pool_mode (rtx addr) ++{ ++ return (find_pool_constant (cfun, addr))->mode; ++} ++ ++enum machine_mode ++get_pool_mode_for_function (struct function *f, rtx addr) ++{ ++ return (find_pool_constant (f, addr))->mode; ++} ++ ++/* Similar, return the offset in the constant pool. */ ++ ++int ++get_pool_offset (rtx addr) ++{ ++ return (find_pool_constant (cfun, addr))->offset; ++} ++ ++/* Return the size of the constant pool. */ ++ ++int ++get_pool_size (void) ++{ ++ return pool_offset; ++} ++ ++/* Write all the constants in the constant pool. */ ++ ++void ++output_constant_pool (const char *fnname ATTRIBUTE_UNUSED, ++ tree fndecl ATTRIBUTE_UNUSED) ++{ ++ struct pool_constant *pool; ++ rtx x; ++ REAL_VALUE_TYPE r; ++ ++ /* It is possible for gcc to call force_const_mem and then to later ++ discard the instructions which refer to the constant. In such a ++ case we do not need to output the constant. */ ++ mark_constant_pool (); ++ ++#ifdef ASM_OUTPUT_POOL_PROLOGUE ++ ASM_OUTPUT_POOL_PROLOGUE (asm_out_file, fnname, fndecl, pool_offset); ++#endif ++ ++ for (pool = first_pool; pool; pool = pool->next) ++ { ++ rtx tmp; ++ ++ x = pool->constant; ++ ++ if (! pool->mark) ++ continue; ++ ++ /* See if X is a LABEL_REF (or a CONST referring to a LABEL_REF) ++ whose CODE_LABEL has been deleted. This can occur if a jump table ++ is eliminated by optimization. If so, write a constant of zero ++ instead. Note that this can also happen by turning the ++ CODE_LABEL into a NOTE. */ ++ /* ??? This seems completely and utterly wrong. Certainly it's ++ not true for NOTE_INSN_DELETED_LABEL, but I disbelieve proper ++ functioning even with INSN_DELETED_P and friends. */ ++ ++ tmp = x; ++ switch (GET_CODE (x)) ++ { ++ case CONST: ++ if (GET_CODE (XEXP (x, 0)) != PLUS ++ || GET_CODE (XEXP (XEXP (x, 0), 0)) != LABEL_REF) ++ break; ++ tmp = XEXP (XEXP (x, 0), 0); ++ /* Fall through. */ ++ ++ case LABEL_REF: ++ tmp = XEXP (x, 0); ++ if (INSN_DELETED_P (tmp) ++ || (GET_CODE (tmp) == NOTE ++ && NOTE_LINE_NUMBER (tmp) == NOTE_INSN_DELETED)) ++ { ++ abort (); ++ x = const0_rtx; ++ } ++ break; ++ ++ default: ++ break; ++ } ++ ++ /* First switch to correct section. */ ++ (*targetm.asm_out.select_rtx_section) (pool->mode, x, pool->align); ++ ++#ifdef ASM_OUTPUT_SPECIAL_POOL_ENTRY ++ ASM_OUTPUT_SPECIAL_POOL_ENTRY (asm_out_file, x, pool->mode, ++ pool->align, pool->labelno, done); ++#endif ++ ++ assemble_align (pool->align); ++ ++ /* Output the label. */ ++ (*targetm.asm_out.internal_label) (asm_out_file, "LC", pool->labelno); ++ ++ /* Output the value of the constant itself. */ ++ switch (GET_MODE_CLASS (pool->mode)) ++ { ++ case MODE_FLOAT: ++ if (GET_CODE (x) != CONST_DOUBLE) ++ abort (); ++ ++ REAL_VALUE_FROM_CONST_DOUBLE (r, x); ++ assemble_real (r, pool->mode, pool->align); ++ break; ++ ++ case MODE_INT: ++ case MODE_PARTIAL_INT: ++ assemble_integer (x, GET_MODE_SIZE (pool->mode), pool->align, 1); ++ break; ++ ++ case MODE_VECTOR_FLOAT: ++ { ++ int i, units; ++ rtx elt; ++ ++ if (GET_CODE (x) != CONST_VECTOR) ++ abort (); ++ ++ units = CONST_VECTOR_NUNITS (x); ++ ++ for (i = 0; i < units; i++) ++ { ++ elt = CONST_VECTOR_ELT (x, i); ++ REAL_VALUE_FROM_CONST_DOUBLE (r, elt); ++ assemble_real (r, GET_MODE_INNER (pool->mode), pool->align); ++ } ++ } ++ break; ++ ++ case MODE_VECTOR_INT: ++ { ++ int i, units; ++ rtx elt; ++ ++ if (GET_CODE (x) != CONST_VECTOR) ++ abort (); ++ ++ units = CONST_VECTOR_NUNITS (x); ++ ++ for (i = 0; i < units; i++) ++ { ++ elt = CONST_VECTOR_ELT (x, i); ++ assemble_integer (elt, GET_MODE_UNIT_SIZE (pool->mode), ++ pool->align, 1); ++ } ++ } ++ break; ++ ++ default: ++ abort (); ++ } ++ ++ /* Make sure all constants in SECTION_MERGE and not SECTION_STRINGS ++ sections have proper size. */ ++ if (pool->align > GET_MODE_BITSIZE (pool->mode) ++ && in_section == in_named ++ && get_named_section_flags (in_named_name) & SECTION_MERGE) ++ assemble_align (pool->align); ++ ++#ifdef ASM_OUTPUT_SPECIAL_POOL_ENTRY ++ done: ; ++#endif ++ } ++ ++#ifdef ASM_OUTPUT_POOL_EPILOGUE ++ ASM_OUTPUT_POOL_EPILOGUE (asm_out_file, fnname, fndecl, pool_offset); ++#endif ++ ++ /* Done with this pool. */ ++ first_pool = last_pool = 0; ++} ++ ++/* Look through the instructions for this function, and mark all the ++ entries in the constant pool which are actually being used. Emit ++ deferred constants which have indeed been used. */ ++ ++static void ++mark_constant_pool (void) ++{ ++ rtx insn; ++ rtx link; ++ struct pool_constant *pool; ++ ++ if (first_pool == 0 && n_deferred_constants == 0) ++ return; ++ ++ for (pool = first_pool; pool; pool = pool->next) ++ pool->mark = 0; ++ ++ for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) ++ if (INSN_P (insn)) ++ mark_constants (PATTERN (insn)); ++ ++ for (link = current_function_epilogue_delay_list; ++ link; ++ link = XEXP (link, 1)) ++ { ++ insn = XEXP (link, 0); ++ ++ if (INSN_P (insn)) ++ mark_constants (PATTERN (insn)); ++ } ++} ++ ++/* Look through appropriate parts of X, marking all entries in the ++ constant pool which are actually being used. Entries that are only ++ referenced by other constants are also marked as used. Emit ++ deferred strings that are used. */ ++ ++static void ++mark_constants (rtx x) ++{ ++ int i; ++ const char *format_ptr; ++ ++ if (x == 0) ++ return; ++ ++ if (GET_CODE (x) == SYMBOL_REF) ++ { ++ mark_constant (&x, NULL); ++ return; ++ } ++ ++ /* Insns may appear inside a SEQUENCE. Only check the patterns of ++ insns, not any notes that may be attached. We don't want to mark ++ a constant just because it happens to appear in a REG_EQUIV note. */ ++ if (INSN_P (x)) ++ { ++ mark_constants (PATTERN (x)); ++ return; ++ } ++ ++ format_ptr = GET_RTX_FORMAT (GET_CODE (x)); ++ ++ for (i = 0; i < GET_RTX_LENGTH (GET_CODE (x)); i++) ++ { ++ switch (*format_ptr++) ++ { ++ case 'e': ++ mark_constants (XEXP (x, i)); ++ break; ++ ++ case 'E': ++ if (XVEC (x, i) != 0) ++ { ++ int j; ++ ++ for (j = 0; j < XVECLEN (x, i); j++) ++ mark_constants (XVECEXP (x, i, j)); ++ } ++ break; ++ ++ case 'S': ++ case 's': ++ case '0': ++ case 'i': ++ case 'w': ++ case 'n': ++ case 'u': ++ case 'B': ++ break; ++ ++ default: ++ abort (); ++ } ++ } ++} ++ ++/* Given a SYMBOL_REF CURRENT_RTX, mark it and all constants it refers ++ to as used. Emit referenced deferred strings. This function can ++ be used with for_each_rtx to mark all SYMBOL_REFs in an rtx. */ ++ ++static int ++mark_constant (rtx *current_rtx, void *data ATTRIBUTE_UNUSED) ++{ ++ rtx x = *current_rtx; ++ ++ if (x == NULL_RTX) ++ return 0; ++ ++ else if (GET_CODE (x) == SYMBOL_REF) ++ { ++ if (CONSTANT_POOL_ADDRESS_P (x)) ++ { ++ struct pool_constant *pool = find_pool_constant (cfun, x); ++ if (pool->mark == 0) ++ { ++ pool->mark = 1; ++ for_each_rtx (&(pool->constant), &mark_constant, NULL); ++ } ++ else ++ return -1; ++ } ++ else if (TREE_CONSTANT_POOL_ADDRESS_P (x)) ++ { ++ tree exp = SYMBOL_REF_DECL (x); ++ if (!TREE_ASM_WRITTEN (exp)) ++ { ++ n_deferred_constants--; ++ output_constant_def_contents (x); ++ } ++ } ++ } ++ return 0; ++} ++ ++/* Determine what kind of relocations EXP may need. */ ++ ++int ++compute_reloc_for_constant (tree exp) ++{ ++ int reloc = 0, reloc2; ++ tree tem; ++ ++ /* Give the front-end a chance to convert VALUE to something that ++ looks more like a constant to the back-end. */ ++ exp = (*lang_hooks.expand_constant) (exp); ++ ++ switch (TREE_CODE (exp)) ++ { ++ case ADDR_EXPR: ++ case FDESC_EXPR: ++ /* Go inside any operations that get_inner_reference can handle and see ++ if what's inside is a constant: no need to do anything here for ++ addresses of variables or functions. */ ++ for (tem = TREE_OPERAND (exp, 0); handled_component_p (tem); ++ tem = TREE_OPERAND (tem, 0)) ++ ; ++ ++ if (TREE_PUBLIC (tem)) ++ reloc |= 2; ++ else ++ reloc |= 1; ++ break; ++ ++ case PLUS_EXPR: ++ reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0)); ++ reloc |= compute_reloc_for_constant (TREE_OPERAND (exp, 1)); ++ break; ++ ++ case MINUS_EXPR: ++ reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0)); ++ reloc2 = compute_reloc_for_constant (TREE_OPERAND (exp, 1)); ++ /* The difference of two local labels is computable at link time. */ ++ if (reloc == 1 && reloc2 == 1) ++ reloc = 0; ++ else ++ reloc |= reloc2; ++ break; ++ ++ case NOP_EXPR: ++ case CONVERT_EXPR: ++ case NON_LVALUE_EXPR: ++ reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0)); ++ break; ++ ++ case CONSTRUCTOR: ++ for (tem = CONSTRUCTOR_ELTS (exp); tem; tem = TREE_CHAIN (tem)) ++ if (TREE_VALUE (tem) != 0) ++ reloc |= compute_reloc_for_constant (TREE_VALUE (tem)); ++ ++ break; ++ ++ default: ++ break; ++ } ++ return reloc; ++} ++ ++/* Find all the constants whose addresses are referenced inside of EXP, ++ and make sure assembler code with a label has been output for each one. ++ Indicate whether an ADDR_EXPR has been encountered. */ ++ ++static void ++output_addressed_constants (tree exp) ++{ ++ tree tem; ++ ++ /* Give the front-end a chance to convert VALUE to something that ++ looks more like a constant to the back-end. */ ++ exp = (*lang_hooks.expand_constant) (exp); ++ ++ switch (TREE_CODE (exp)) ++ { ++ case ADDR_EXPR: ++ case FDESC_EXPR: ++ /* Go inside any operations that get_inner_reference can handle and see ++ if what's inside is a constant: no need to do anything here for ++ addresses of variables or functions. */ ++ for (tem = TREE_OPERAND (exp, 0); handled_component_p (tem); ++ tem = TREE_OPERAND (tem, 0)) ++ ; ++ ++ if (TREE_CODE_CLASS (TREE_CODE (tem)) == 'c' ++ || TREE_CODE (tem) == CONSTRUCTOR) ++ output_constant_def (tem, 0); ++ break; ++ ++ case PLUS_EXPR: ++ case MINUS_EXPR: ++ output_addressed_constants (TREE_OPERAND (exp, 1)); ++ /* Fall through. */ ++ ++ case NOP_EXPR: ++ case CONVERT_EXPR: ++ case NON_LVALUE_EXPR: ++ output_addressed_constants (TREE_OPERAND (exp, 0)); ++ break; ++ ++ case CONSTRUCTOR: ++ for (tem = CONSTRUCTOR_ELTS (exp); tem; tem = TREE_CHAIN (tem)) ++ if (TREE_VALUE (tem) != 0) ++ output_addressed_constants (TREE_VALUE (tem)); ++ ++ break; ++ ++ default: ++ break; ++ } ++} ++ ++/* Return nonzero if VALUE is a valid constant-valued expression ++ for use in initializing a static variable; one that can be an ++ element of a "constant" initializer. ++ ++ Return null_pointer_node if the value is absolute; ++ if it is relocatable, return the variable that determines the relocation. ++ We assume that VALUE has been folded as much as possible; ++ therefore, we do not need to check for such things as ++ arithmetic-combinations of integers. */ ++ ++tree ++initializer_constant_valid_p (tree value, tree endtype) ++{ ++ /* Give the front-end a chance to convert VALUE to something that ++ looks more like a constant to the back-end. */ ++ value = (*lang_hooks.expand_constant) (value); ++ ++ switch (TREE_CODE (value)) ++ { ++ case CONSTRUCTOR: ++ if ((TREE_CODE (TREE_TYPE (value)) == UNION_TYPE ++ || TREE_CODE (TREE_TYPE (value)) == RECORD_TYPE) ++ && TREE_CONSTANT (value) ++ && CONSTRUCTOR_ELTS (value)) ++ { ++ tree elt; ++ bool absolute = true; ++ ++ for (elt = CONSTRUCTOR_ELTS (value); elt; elt = TREE_CHAIN (elt)) ++ { ++ tree reloc; ++ value = TREE_VALUE (elt); ++ reloc = initializer_constant_valid_p (value, TREE_TYPE (value)); ++ if (!reloc) ++ return NULL_TREE; ++ if (reloc != null_pointer_node) ++ absolute = false; ++ } ++ /* For a non-absolute relocation, there is no single ++ variable that can be "the variable that determines the ++ relocation." */ ++ return absolute ? null_pointer_node : error_mark_node; ++ } ++ ++ return TREE_STATIC (value) ? null_pointer_node : NULL_TREE; ++ ++ case INTEGER_CST: ++ case VECTOR_CST: ++ case REAL_CST: ++ case STRING_CST: ++ case COMPLEX_CST: ++ return null_pointer_node; ++ ++ case ADDR_EXPR: ++ case FDESC_EXPR: ++ return staticp (TREE_OPERAND (value, 0)) ? TREE_OPERAND (value, 0) : 0; ++ ++ case VIEW_CONVERT_EXPR: ++ case NON_LVALUE_EXPR: ++ return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype); ++ ++ case CONVERT_EXPR: ++ case NOP_EXPR: ++ /* Allow conversions between pointer types. */ ++ if (POINTER_TYPE_P (TREE_TYPE (value)) ++ && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0)))) ++ return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype); ++ ++ /* Allow conversions between real types. */ ++ if (FLOAT_TYPE_P (TREE_TYPE (value)) ++ && FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0)))) ++ return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype); ++ ++ /* Allow length-preserving conversions between integer types. */ ++ if (INTEGRAL_TYPE_P (TREE_TYPE (value)) ++ && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0))) ++ && (TYPE_PRECISION (TREE_TYPE (value)) ++ == TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0))))) ++ return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype); ++ ++ /* Allow conversions between other integer types only if ++ explicit value. */ ++ if (INTEGRAL_TYPE_P (TREE_TYPE (value)) ++ && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0)))) ++ { ++ tree inner = initializer_constant_valid_p (TREE_OPERAND (value, 0), ++ endtype); ++ if (inner == null_pointer_node) ++ return null_pointer_node; ++ break; ++ } ++ ++ /* Allow (int) &foo provided int is as wide as a pointer. */ ++ if (INTEGRAL_TYPE_P (TREE_TYPE (value)) ++ && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0))) ++ && (TYPE_PRECISION (TREE_TYPE (value)) ++ >= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0))))) ++ return initializer_constant_valid_p (TREE_OPERAND (value, 0), ++ endtype); ++ ++ /* Likewise conversions from int to pointers, but also allow ++ conversions from 0. */ ++ if ((POINTER_TYPE_P (TREE_TYPE (value)) ++ || TREE_CODE (TREE_TYPE (value)) == OFFSET_TYPE) ++ && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0)))) ++ { ++ if (integer_zerop (TREE_OPERAND (value, 0))) ++ return null_pointer_node; ++ else if (TYPE_PRECISION (TREE_TYPE (value)) ++ <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0)))) ++ return initializer_constant_valid_p (TREE_OPERAND (value, 0), ++ endtype); ++ } ++ ++ /* Allow conversions to struct or union types if the value ++ inside is okay. */ ++ if (TREE_CODE (TREE_TYPE (value)) == RECORD_TYPE ++ || TREE_CODE (TREE_TYPE (value)) == UNION_TYPE) ++ return initializer_constant_valid_p (TREE_OPERAND (value, 0), ++ endtype); ++ break; ++ ++ case PLUS_EXPR: ++ if (! INTEGRAL_TYPE_P (endtype) ++ || TYPE_PRECISION (endtype) >= POINTER_SIZE) ++ { ++ tree valid0 = initializer_constant_valid_p (TREE_OPERAND (value, 0), ++ endtype); ++ tree valid1 = initializer_constant_valid_p (TREE_OPERAND (value, 1), ++ endtype); ++ /* If either term is absolute, use the other terms relocation. */ ++ if (valid0 == null_pointer_node) ++ return valid1; ++ if (valid1 == null_pointer_node) ++ return valid0; ++ } ++ break; ++ ++ case MINUS_EXPR: ++ if (! INTEGRAL_TYPE_P (endtype) ++ || TYPE_PRECISION (endtype) >= POINTER_SIZE) ++ { ++ tree valid0 = initializer_constant_valid_p (TREE_OPERAND (value, 0), ++ endtype); ++ tree valid1 = initializer_constant_valid_p (TREE_OPERAND (value, 1), ++ endtype); ++ /* Win if second argument is absolute. */ ++ if (valid1 == null_pointer_node) ++ return valid0; ++ /* Win if both arguments have the same relocation. ++ Then the value is absolute. */ ++ if (valid0 == valid1 && valid0 != 0) ++ return null_pointer_node; ++ ++ /* Since GCC guarantees that string constants are unique in the ++ generated code, a subtraction between two copies of the same ++ constant string is absolute. */ ++ if (valid0 && TREE_CODE (valid0) == STRING_CST && ++ valid1 && TREE_CODE (valid1) == STRING_CST && ++ TREE_STRING_POINTER (valid0) == TREE_STRING_POINTER (valid1)) ++ return null_pointer_node; ++ } ++ ++ /* Support differences between labels. */ ++ if (INTEGRAL_TYPE_P (endtype)) ++ { ++ tree op0, op1; ++ op0 = TREE_OPERAND (value, 0); ++ op1 = TREE_OPERAND (value, 1); ++ ++ /* Like STRIP_NOPS except allow the operand mode to widen. ++ This works around a feature of fold that simplifies ++ (int)(p1 - p2) to ((int)p1 - (int)p2) under the theory ++ that the narrower operation is cheaper. */ ++ ++ while (TREE_CODE (op0) == NOP_EXPR ++ || TREE_CODE (op0) == CONVERT_EXPR ++ || TREE_CODE (op0) == NON_LVALUE_EXPR) ++ { ++ tree inner = TREE_OPERAND (op0, 0); ++ if (inner == error_mark_node ++ || ! INTEGRAL_MODE_P (TYPE_MODE (TREE_TYPE (inner))) ++ || (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0))) ++ > GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (inner))))) ++ break; ++ op0 = inner; ++ } ++ ++ while (TREE_CODE (op1) == NOP_EXPR ++ || TREE_CODE (op1) == CONVERT_EXPR ++ || TREE_CODE (op1) == NON_LVALUE_EXPR) ++ { ++ tree inner = TREE_OPERAND (op1, 0); ++ if (inner == error_mark_node ++ || ! INTEGRAL_MODE_P (TYPE_MODE (TREE_TYPE (inner))) ++ || (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op1))) ++ > GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (inner))))) ++ break; ++ op1 = inner; ++ } ++ ++ if (TREE_CODE (op0) == ADDR_EXPR ++ && TREE_CODE (TREE_OPERAND (op0, 0)) == LABEL_DECL ++ && TREE_CODE (op1) == ADDR_EXPR ++ && TREE_CODE (TREE_OPERAND (op1, 0)) == LABEL_DECL) ++ return null_pointer_node; ++ } ++ break; ++ ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++/* Output assembler code for constant EXP to FILE, with no label. ++ This includes the pseudo-op such as ".int" or ".byte", and a newline. ++ Assumes output_addressed_constants has been done on EXP already. ++ ++ Generate exactly SIZE bytes of assembler data, padding at the end ++ with zeros if necessary. SIZE must always be specified. ++ ++ SIZE is important for structure constructors, ++ since trailing members may have been omitted from the constructor. ++ It is also important for initialization of arrays from string constants ++ since the full length of the string constant might not be wanted. ++ It is also needed for initialization of unions, where the initializer's ++ type is just one member, and that may not be as long as the union. ++ ++ There a case in which we would fail to output exactly SIZE bytes: ++ for a structure constructor that wants to produce more than SIZE bytes. ++ But such constructors will never be generated for any possible input. ++ ++ ALIGN is the alignment of the data in bits. */ ++ ++void ++output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align) ++{ ++ enum tree_code code; ++ unsigned HOST_WIDE_INT thissize; ++ ++ /* Some front-ends use constants other than the standard language-independent ++ varieties, but which may still be output directly. Give the front-end a ++ chance to convert EXP to a language-independent representation. */ ++ exp = (*lang_hooks.expand_constant) (exp); ++ ++ if (size == 0 || flag_syntax_only) ++ return; ++ ++ /* Eliminate any conversions since we'll be outputting the underlying ++ constant. */ ++ while (TREE_CODE (exp) == NOP_EXPR || TREE_CODE (exp) == CONVERT_EXPR ++ || TREE_CODE (exp) == NON_LVALUE_EXPR ++ || TREE_CODE (exp) == VIEW_CONVERT_EXPR) ++ exp = TREE_OPERAND (exp, 0); ++ ++ code = TREE_CODE (TREE_TYPE (exp)); ++ thissize = int_size_in_bytes (TREE_TYPE (exp)); ++ ++ /* Allow a constructor with no elements for any data type. ++ This means to fill the space with zeros. */ ++ if (TREE_CODE (exp) == CONSTRUCTOR && CONSTRUCTOR_ELTS (exp) == 0) ++ { ++ assemble_zeros (size); ++ return; ++ } ++ ++ if (TREE_CODE (exp) == FDESC_EXPR) ++ { ++#ifdef ASM_OUTPUT_FDESC ++ HOST_WIDE_INT part = tree_low_cst (TREE_OPERAND (exp, 1), 0); ++ tree decl = TREE_OPERAND (exp, 0); ++ ASM_OUTPUT_FDESC (asm_out_file, decl, part); ++#else ++ abort (); ++#endif ++ return; ++ } ++ ++ /* Now output the underlying data. If we've handling the padding, return. ++ Otherwise, break and ensure THISSIZE is the size written. */ ++ switch (code) ++ { ++ case CHAR_TYPE: ++ case BOOLEAN_TYPE: ++ case INTEGER_TYPE: ++ case ENUMERAL_TYPE: ++ case POINTER_TYPE: ++ case REFERENCE_TYPE: ++ case OFFSET_TYPE: ++ if (! assemble_integer (expand_expr (exp, NULL_RTX, VOIDmode, ++ EXPAND_INITIALIZER), ++ size, align, 0)) ++ error ("initializer for integer value is too complicated"); ++ break; ++ ++ case REAL_TYPE: ++ if (TREE_CODE (exp) != REAL_CST) ++ error ("initializer for floating value is not a floating constant"); ++ ++ assemble_real (TREE_REAL_CST (exp), TYPE_MODE (TREE_TYPE (exp)), align); ++ break; ++ ++ case COMPLEX_TYPE: ++ output_constant (TREE_REALPART (exp), thissize / 2, align); ++ output_constant (TREE_IMAGPART (exp), thissize / 2, ++ min_align (align, BITS_PER_UNIT * (thissize / 2))); ++ break; ++ ++ case ARRAY_TYPE: ++ case VECTOR_TYPE: ++ if (TREE_CODE (exp) == CONSTRUCTOR) ++ { ++ output_constructor (exp, size, align); ++ return; ++ } ++ else if (TREE_CODE (exp) == STRING_CST) ++ { ++ thissize = MIN ((unsigned HOST_WIDE_INT)TREE_STRING_LENGTH (exp), ++ size); ++ assemble_string (TREE_STRING_POINTER (exp), thissize); ++ } ++ else if (TREE_CODE (exp) == VECTOR_CST) ++ { ++ int elt_size; ++ tree link; ++ unsigned int nalign; ++ enum machine_mode inner; ++ ++ inner = GET_MODE_INNER (TYPE_MODE (TREE_TYPE (exp))); ++ nalign = MIN (align, GET_MODE_ALIGNMENT (inner)); ++ ++ elt_size = GET_MODE_UNIT_SIZE (TYPE_MODE (TREE_TYPE (exp))); ++ ++ link = TREE_VECTOR_CST_ELTS (exp); ++ output_constant (TREE_VALUE (link), elt_size, align); ++ while ((link = TREE_CHAIN (link)) != NULL) ++ output_constant (TREE_VALUE (link), elt_size, nalign); ++ } ++ else ++ abort (); ++ break; ++ ++ case RECORD_TYPE: ++ case UNION_TYPE: ++ if (TREE_CODE (exp) == CONSTRUCTOR) ++ output_constructor (exp, size, align); ++ else ++ abort (); ++ return; ++ ++ case SET_TYPE: ++ if (TREE_CODE (exp) == INTEGER_CST) ++ assemble_integer (expand_expr (exp, NULL_RTX, ++ VOIDmode, EXPAND_INITIALIZER), ++ thissize, align, 1); ++ else if (TREE_CODE (exp) == CONSTRUCTOR) ++ { ++ unsigned char *buffer = alloca (thissize); ++ if (get_set_constructor_bytes (exp, buffer, thissize)) ++ abort (); ++ assemble_string ((char *) buffer, thissize); ++ } ++ else ++ error ("unknown set constructor type"); ++ return; ++ ++ case ERROR_MARK: ++ return; ++ ++ default: ++ abort (); ++ } ++ ++ if (size > thissize) ++ assemble_zeros (size - thissize); ++} ++ ++ ++/* Subroutine of output_constructor, used for computing the size of ++ arrays of unspecified length. VAL must be a CONSTRUCTOR of an array ++ type with an unspecified upper bound. */ ++ ++static unsigned HOST_WIDE_INT ++array_size_for_constructor (tree val) ++{ ++ tree max_index, i; ++ ++ /* This code used to attempt to handle string constants that are not ++ arrays of single-bytes, but nothing else does, so there's no point in ++ doing it here. */ ++ if (TREE_CODE (val) == STRING_CST) ++ return TREE_STRING_LENGTH (val); ++ ++ max_index = NULL_TREE; ++ for (i = CONSTRUCTOR_ELTS (val); i; i = TREE_CHAIN (i)) ++ { ++ tree index = TREE_PURPOSE (i); ++ ++ if (TREE_CODE (index) == RANGE_EXPR) ++ index = TREE_OPERAND (index, 1); ++ if (max_index == NULL_TREE || tree_int_cst_lt (max_index, index)) ++ max_index = index; ++ } ++ ++ if (max_index == NULL_TREE) ++ return 0; ++ ++ /* Compute the total number of array elements. */ ++ i = size_binop (MINUS_EXPR, convert (sizetype, max_index), ++ convert (sizetype, ++ TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (val))))); ++ i = size_binop (PLUS_EXPR, i, convert (sizetype, integer_one_node)); ++ ++ /* Multiply by the array element unit size to find number of bytes. */ ++ i = size_binop (MULT_EXPR, i, TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (val)))); ++ ++ return tree_low_cst (i, 1); ++} ++ ++/* Subroutine of output_constant, used for CONSTRUCTORs (aggregate constants). ++ Generate at least SIZE bytes, padding if necessary. */ ++ ++static void ++output_constructor (tree exp, unsigned HOST_WIDE_INT size, ++ unsigned int align) ++{ ++ tree type = TREE_TYPE (exp); ++ tree link, field = 0; ++ tree min_index = 0; ++ /* Number of bytes output or skipped so far. ++ In other words, current position within the constructor. */ ++ HOST_WIDE_INT total_bytes = 0; ++ /* Nonzero means BYTE contains part of a byte, to be output. */ ++ int byte_buffer_in_use = 0; ++ int byte = 0; ++ ++ if (HOST_BITS_PER_WIDE_INT < BITS_PER_UNIT) ++ abort (); ++ ++ if (TREE_CODE (type) == RECORD_TYPE) ++ field = TYPE_FIELDS (type); ++ ++ if (TREE_CODE (type) == ARRAY_TYPE ++ && TYPE_DOMAIN (type) != 0) ++ min_index = TYPE_MIN_VALUE (TYPE_DOMAIN (type)); ++ ++ /* As LINK goes through the elements of the constant, ++ FIELD goes through the structure fields, if the constant is a structure. ++ if the constant is a union, then we override this, ++ by getting the field from the TREE_LIST element. ++ But the constant could also be an array. Then FIELD is zero. ++ ++ There is always a maximum of one element in the chain LINK for unions ++ (even if the initializer in a source program incorrectly contains ++ more one). */ ++ for (link = CONSTRUCTOR_ELTS (exp); ++ link; ++ link = TREE_CHAIN (link), ++ field = field ? TREE_CHAIN (field) : 0) ++ { ++ tree val = TREE_VALUE (link); ++ tree index = 0; ++ ++ /* The element in a union constructor specifies the proper field ++ or index. */ ++ if ((TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE ++ || TREE_CODE (type) == QUAL_UNION_TYPE) ++ && TREE_PURPOSE (link) != 0) ++ field = TREE_PURPOSE (link); ++ ++ else if (TREE_CODE (type) == ARRAY_TYPE) ++ index = TREE_PURPOSE (link); ++ ++#ifdef ASM_COMMENT_START ++ if (field && flag_verbose_asm) ++ fprintf (asm_out_file, "%s %s:\n", ++ ASM_COMMENT_START, ++ DECL_NAME (field) ++ ? IDENTIFIER_POINTER (DECL_NAME (field)) ++ : ""); ++#endif ++ ++ /* Eliminate the marker that makes a cast not be an lvalue. */ ++ if (val != 0) ++ STRIP_NOPS (val); ++ ++ if (index && TREE_CODE (index) == RANGE_EXPR) ++ { ++ unsigned HOST_WIDE_INT fieldsize ++ = int_size_in_bytes (TREE_TYPE (type)); ++ HOST_WIDE_INT lo_index = tree_low_cst (TREE_OPERAND (index, 0), 0); ++ HOST_WIDE_INT hi_index = tree_low_cst (TREE_OPERAND (index, 1), 0); ++ HOST_WIDE_INT index; ++ unsigned int align2 = min_align (align, fieldsize * BITS_PER_UNIT); ++ ++ for (index = lo_index; index <= hi_index; index++) ++ { ++ /* Output the element's initial value. */ ++ if (val == 0) ++ assemble_zeros (fieldsize); ++ else ++ output_constant (val, fieldsize, align2); ++ ++ /* Count its size. */ ++ total_bytes += fieldsize; ++ } ++ } ++ else if (field == 0 || !DECL_BIT_FIELD (field)) ++ { ++ /* An element that is not a bit-field. */ ++ ++ unsigned HOST_WIDE_INT fieldsize; ++ /* Since this structure is static, ++ we know the positions are constant. */ ++ HOST_WIDE_INT pos = field ? int_byte_position (field) : 0; ++ unsigned int align2; ++ ++ if (index != 0) ++ pos = (tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (val)), 1) ++ * (tree_low_cst (index, 0) - tree_low_cst (min_index, 0))); ++ ++ /* Output any buffered-up bit-fields preceding this element. */ ++ if (byte_buffer_in_use) ++ { ++ assemble_integer (GEN_INT (byte), 1, BITS_PER_UNIT, 1); ++ total_bytes++; ++ byte_buffer_in_use = 0; ++ } ++ ++ /* Advance to offset of this element. ++ Note no alignment needed in an array, since that is guaranteed ++ if each element has the proper size. */ ++ if ((field != 0 || index != 0) && pos != total_bytes) ++ { ++ assemble_zeros (pos - total_bytes); ++ total_bytes = pos; ++ } ++ ++ /* Find the alignment of this element. */ ++ align2 = min_align (align, BITS_PER_UNIT * pos); ++ ++ /* Determine size this element should occupy. */ ++ if (field) ++ { ++ fieldsize = 0; ++ ++ /* If this is an array with an unspecified upper bound, ++ the initializer determines the size. */ ++ /* ??? This ought to only checked if DECL_SIZE_UNIT is NULL, ++ but we cannot do this until the deprecated support for ++ initializing zero-length array members is removed. */ ++ if (TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE ++ && TYPE_DOMAIN (TREE_TYPE (field)) ++ && ! TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (field)))) ++ { ++ fieldsize = array_size_for_constructor (val); ++ /* Given a non-empty initialization, this field had ++ better be last. */ ++ if (fieldsize != 0 && TREE_CHAIN (field) != NULL_TREE) ++ abort (); ++ } ++ else if (DECL_SIZE_UNIT (field)) ++ { ++ /* ??? This can't be right. If the decl size overflows ++ a host integer we will silently emit no data. */ ++ if (host_integerp (DECL_SIZE_UNIT (field), 1)) ++ fieldsize = tree_low_cst (DECL_SIZE_UNIT (field), 1); ++ } ++ } ++ else ++ fieldsize = int_size_in_bytes (TREE_TYPE (type)); ++ ++ /* Output the element's initial value. */ ++ if (val == 0) ++ assemble_zeros (fieldsize); ++ else ++ output_constant (val, fieldsize, align2); ++ ++ /* Count its size. */ ++ total_bytes += fieldsize; ++ } ++ else if (val != 0 && TREE_CODE (val) != INTEGER_CST) ++ error ("invalid initial value for member `%s'", ++ IDENTIFIER_POINTER (DECL_NAME (field))); ++ else ++ { ++ /* Element that is a bit-field. */ ++ ++ HOST_WIDE_INT next_offset = int_bit_position (field); ++ HOST_WIDE_INT end_offset ++ = (next_offset + tree_low_cst (DECL_SIZE (field), 1)); ++ ++ if (val == 0) ++ val = integer_zero_node; ++ ++ /* If this field does not start in this (or, next) byte, ++ skip some bytes. */ ++ if (next_offset / BITS_PER_UNIT != total_bytes) ++ { ++ /* Output remnant of any bit field in previous bytes. */ ++ if (byte_buffer_in_use) ++ { ++ assemble_integer (GEN_INT (byte), 1, BITS_PER_UNIT, 1); ++ total_bytes++; ++ byte_buffer_in_use = 0; ++ } ++ ++ /* If still not at proper byte, advance to there. */ ++ if (next_offset / BITS_PER_UNIT != total_bytes) ++ { ++ assemble_zeros (next_offset / BITS_PER_UNIT - total_bytes); ++ total_bytes = next_offset / BITS_PER_UNIT; ++ } ++ } ++ ++ if (! byte_buffer_in_use) ++ byte = 0; ++ ++ /* We must split the element into pieces that fall within ++ separate bytes, and combine each byte with previous or ++ following bit-fields. */ ++ ++ /* next_offset is the offset n fbits from the beginning of ++ the structure to the next bit of this element to be processed. ++ end_offset is the offset of the first bit past the end of ++ this element. */ ++ while (next_offset < end_offset) ++ { ++ int this_time; ++ int shift; ++ HOST_WIDE_INT value; ++ HOST_WIDE_INT next_byte = next_offset / BITS_PER_UNIT; ++ HOST_WIDE_INT next_bit = next_offset % BITS_PER_UNIT; ++ ++ /* Advance from byte to byte ++ within this element when necessary. */ ++ while (next_byte != total_bytes) ++ { ++ assemble_integer (GEN_INT (byte), 1, BITS_PER_UNIT, 1); ++ total_bytes++; ++ byte = 0; ++ } ++ ++ /* Number of bits we can process at once ++ (all part of the same byte). */ ++ this_time = MIN (end_offset - next_offset, ++ BITS_PER_UNIT - next_bit); ++ if (BYTES_BIG_ENDIAN) ++ { ++ /* On big-endian machine, take the most significant bits ++ first (of the bits that are significant) ++ and put them into bytes from the most significant end. */ ++ shift = end_offset - next_offset - this_time; ++ ++ /* Don't try to take a bunch of bits that cross ++ the word boundary in the INTEGER_CST. We can ++ only select bits from the LOW or HIGH part ++ not from both. */ ++ if (shift < HOST_BITS_PER_WIDE_INT ++ && shift + this_time > HOST_BITS_PER_WIDE_INT) ++ { ++ this_time = shift + this_time - HOST_BITS_PER_WIDE_INT; ++ shift = HOST_BITS_PER_WIDE_INT; ++ } ++ ++ /* Now get the bits from the appropriate constant word. */ ++ if (shift < HOST_BITS_PER_WIDE_INT) ++ value = TREE_INT_CST_LOW (val); ++ else if (shift < 2 * HOST_BITS_PER_WIDE_INT) ++ { ++ value = TREE_INT_CST_HIGH (val); ++ shift -= HOST_BITS_PER_WIDE_INT; ++ } ++ else ++ abort (); ++ ++ /* Get the result. This works only when: ++ 1 <= this_time <= HOST_BITS_PER_WIDE_INT. */ ++ byte |= (((value >> shift) ++ & (((HOST_WIDE_INT) 2 << (this_time - 1)) - 1)) ++ << (BITS_PER_UNIT - this_time - next_bit)); ++ } ++ else ++ { ++ /* On little-endian machines, ++ take first the least significant bits of the value ++ and pack them starting at the least significant ++ bits of the bytes. */ ++ shift = next_offset - int_bit_position (field); ++ ++ /* Don't try to take a bunch of bits that cross ++ the word boundary in the INTEGER_CST. We can ++ only select bits from the LOW or HIGH part ++ not from both. */ ++ if (shift < HOST_BITS_PER_WIDE_INT ++ && shift + this_time > HOST_BITS_PER_WIDE_INT) ++ this_time = (HOST_BITS_PER_WIDE_INT - shift); ++ ++ /* Now get the bits from the appropriate constant word. */ ++ if (shift < HOST_BITS_PER_WIDE_INT) ++ value = TREE_INT_CST_LOW (val); ++ else if (shift < 2 * HOST_BITS_PER_WIDE_INT) ++ { ++ value = TREE_INT_CST_HIGH (val); ++ shift -= HOST_BITS_PER_WIDE_INT; ++ } ++ else ++ abort (); ++ ++ /* Get the result. This works only when: ++ 1 <= this_time <= HOST_BITS_PER_WIDE_INT. */ ++ byte |= (((value >> shift) ++ & (((HOST_WIDE_INT) 2 << (this_time - 1)) - 1)) ++ << next_bit); ++ } ++ ++ next_offset += this_time; ++ byte_buffer_in_use = 1; ++ } ++ } ++ } ++ ++ if (byte_buffer_in_use) ++ { ++ assemble_integer (GEN_INT (byte), 1, BITS_PER_UNIT, 1); ++ total_bytes++; ++ } ++ ++ if ((unsigned HOST_WIDE_INT)total_bytes < size) ++ assemble_zeros (size - total_bytes); ++} ++ ++/* This TREE_LIST contains any weak symbol declarations waiting ++ to be emitted. */ ++static GTY(()) tree weak_decls; ++ ++/* Mark DECL as weak. */ ++ ++static void ++mark_weak (tree decl) ++{ ++ DECL_WEAK (decl) = 1; ++ ++ if (DECL_RTL_SET_P (decl) ++ && GET_CODE (DECL_RTL (decl)) == MEM ++ && XEXP (DECL_RTL (decl), 0) ++ && GET_CODE (XEXP (DECL_RTL (decl), 0)) == SYMBOL_REF) ++ SYMBOL_REF_WEAK (XEXP (DECL_RTL (decl), 0)) = 1; ++} ++ ++/* Merge weak status between NEWDECL and OLDDECL. */ ++ ++void ++merge_weak (tree newdecl, tree olddecl) ++{ ++ if (DECL_WEAK (newdecl) == DECL_WEAK (olddecl)) ++ return; ++ ++ if (DECL_WEAK (newdecl)) ++ { ++ tree wd; ++ ++ /* NEWDECL is weak, but OLDDECL is not. */ ++ ++ /* If we already output the OLDDECL, we're in trouble; we can't ++ go back and make it weak. This error cannot caught in ++ declare_weak because the NEWDECL and OLDDECL was not yet ++ been merged; therefore, TREE_ASM_WRITTEN was not set. */ ++ if (TREE_ASM_WRITTEN (olddecl)) ++ error ("%Jweak declaration of '%D' must precede definition", ++ newdecl, newdecl); ++ ++ /* If we've already generated rtl referencing OLDDECL, we may ++ have done so in a way that will not function properly with ++ a weak symbol. */ ++ else if (TREE_USED (olddecl) ++ && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (olddecl))) ++ warning ("%Jweak declaration of '%D' after first use results " ++ "in unspecified behavior", newdecl, newdecl); ++ ++ if (SUPPORTS_WEAK) ++ { ++ /* We put the NEWDECL on the weak_decls list at some point. ++ Replace it with the OLDDECL. */ ++ for (wd = weak_decls; wd; wd = TREE_CHAIN (wd)) ++ if (TREE_VALUE (wd) == newdecl) ++ { ++ TREE_VALUE (wd) = olddecl; ++ break; ++ } ++ /* We may not find the entry on the list. If NEWDECL is a ++ weak alias, then we will have already called ++ globalize_decl to remove the entry; in that case, we do ++ not need to do anything. */ ++ } ++ ++ /* Make the OLDDECL weak; it's OLDDECL that we'll be keeping. */ ++ mark_weak (olddecl); ++ } ++ else ++ /* OLDDECL was weak, but NEWDECL was not explicitly marked as ++ weak. Just update NEWDECL to indicate that it's weak too. */ ++ mark_weak (newdecl); ++} ++ ++/* Declare DECL to be a weak symbol. */ ++ ++void ++declare_weak (tree decl) ++{ ++ if (! TREE_PUBLIC (decl)) ++ error ("%Jweak declaration of '%D' must be public", decl, decl); ++ else if (TREE_CODE (decl) == FUNCTION_DECL && TREE_ASM_WRITTEN (decl)) ++ error ("%Jweak declaration of '%D' must precede definition", decl, decl); ++ else if (SUPPORTS_WEAK) ++ { ++ if (! DECL_WEAK (decl)) ++ weak_decls = tree_cons (NULL, decl, weak_decls); ++ } ++ else ++ warning ("%Jweak declaration of '%D' not supported", decl, decl); ++ ++ mark_weak (decl); ++} ++ ++/* Emit any pending weak declarations. */ ++ ++void ++weak_finish (void) ++{ ++ tree t; ++ ++ for (t = weak_decls; t; t = TREE_CHAIN (t)) ++ { ++ tree decl = TREE_VALUE (t); ++#if defined (ASM_WEAKEN_DECL) || defined (ASM_WEAKEN_LABEL) ++ const char *const name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); ++#endif ++ ++ if (! TREE_USED (decl)) ++ continue; ++ ++#ifdef ASM_WEAKEN_DECL ++ ASM_WEAKEN_DECL (asm_out_file, decl, name, NULL); ++#else ++#ifdef ASM_WEAKEN_LABEL ++ ASM_WEAKEN_LABEL (asm_out_file, name); ++#else ++#ifdef ASM_OUTPUT_WEAK_ALIAS ++ warning ("only weak aliases are supported in this configuration"); ++ return; ++#endif ++#endif ++#endif ++ } ++} ++ ++/* Emit the assembly bits to indicate that DECL is globally visible. */ ++ ++static void ++globalize_decl (tree decl) ++{ ++ const char *name = XSTR (XEXP (DECL_RTL (decl), 0), 0); ++ ++#if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL) ++ if (DECL_WEAK (decl)) ++ { ++ tree *p, t; ++ ++#ifdef ASM_WEAKEN_DECL ++ ASM_WEAKEN_DECL (asm_out_file, decl, name, 0); ++#else ++ ASM_WEAKEN_LABEL (asm_out_file, name); ++#endif ++ ++ /* Remove this function from the pending weak list so that ++ we do not emit multiple .weak directives for it. */ ++ for (p = &weak_decls; (t = *p) ; ) ++ { ++ if (DECL_ASSEMBLER_NAME (decl) == DECL_ASSEMBLER_NAME (TREE_VALUE (t))) ++ *p = TREE_CHAIN (t); ++ else ++ p = &TREE_CHAIN (t); ++ } ++ return; ++ } ++#endif ++ ++ (*targetm.asm_out.globalize_label) (asm_out_file, name); ++} ++ ++/* Emit an assembler directive to make the symbol for DECL an alias to ++ the symbol for TARGET. */ ++ ++void ++assemble_alias (tree decl, tree target ATTRIBUTE_UNUSED) ++{ ++ const char *name; ++ ++ /* We must force creation of DECL_RTL for debug info generation, even though ++ we don't use it here. */ ++ make_decl_rtl (decl, NULL); ++ ++ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); ++ ++#ifdef ASM_OUTPUT_DEF ++ /* Make name accessible from other files, if appropriate. */ ++ ++ if (TREE_PUBLIC (decl)) ++ { ++ globalize_decl (decl); ++ maybe_assemble_visibility (decl); ++ } ++ ++#ifdef ASM_OUTPUT_DEF_FROM_DECLS ++ ASM_OUTPUT_DEF_FROM_DECLS (asm_out_file, decl, target); ++#else ++ ASM_OUTPUT_DEF (asm_out_file, name, IDENTIFIER_POINTER (target)); ++#endif ++#else /* !ASM_OUTPUT_DEF */ ++#if defined (ASM_OUTPUT_WEAK_ALIAS) || defined (ASM_WEAKEN_DECL) ++ if (DECL_WEAK (decl)) ++ { ++ tree *p, t; ++#ifdef ASM_WEAKEN_DECL ++ ASM_WEAKEN_DECL (asm_out_file, decl, name, IDENTIFIER_POINTER (target)); ++#else ++ ASM_OUTPUT_WEAK_ALIAS (asm_out_file, name, IDENTIFIER_POINTER (target)); ++#endif ++ /* Remove this function from the pending weak list so that ++ we do not emit multiple .weak directives for it. */ ++ for (p = &weak_decls; (t = *p) ; ) ++ if (DECL_ASSEMBLER_NAME (decl) ++ == DECL_ASSEMBLER_NAME (TREE_VALUE (t))) ++ *p = TREE_CHAIN (t); ++ else ++ p = &TREE_CHAIN (t); ++ } ++ else ++ warning ("only weak aliases are supported in this configuration"); ++ ++#else ++ warning ("alias definitions not supported in this configuration; ignored"); ++#endif ++#endif ++ ++ TREE_USED (decl) = 1; ++ TREE_ASM_WRITTEN (decl) = 1; ++ TREE_ASM_WRITTEN (DECL_ASSEMBLER_NAME (decl)) = 1; ++} ++ ++/* Emit an assembler directive to set symbol for DECL visibility to ++ the visibility type VIS, which must not be VISIBILITY_DEFAULT. */ ++ ++void ++default_assemble_visibility (tree decl, int vis) ++{ ++ static const char * const visibility_types[] = { ++ NULL, "internal", "hidden", "protected" ++ }; ++ ++ const char *name, *type; ++ ++ name = (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))); ++ type = visibility_types[vis]; ++ ++#ifdef HAVE_GAS_HIDDEN ++ fprintf (asm_out_file, "\t.%s\t", type); ++ assemble_name (asm_out_file, name); ++ fprintf (asm_out_file, "\n"); ++#else ++ warning ("visibility attribute not supported in this configuration; ignored"); ++#endif ++} ++ ++/* A helper function to call assemble_visibility when needed for a decl. */ ++ ++static void ++maybe_assemble_visibility (tree decl) ++{ ++ enum symbol_visibility vis = DECL_VISIBILITY (decl); ++ ++ if (vis != VISIBILITY_DEFAULT) ++ (* targetm.asm_out.visibility) (decl, vis); ++} ++ ++/* Returns 1 if the target configuration supports defining public symbols ++ so that one of them will be chosen at link time instead of generating a ++ multiply-defined symbol error, whether through the use of weak symbols or ++ a target-specific mechanism for having duplicates discarded. */ ++ ++int ++supports_one_only (void) ++{ ++ if (SUPPORTS_ONE_ONLY) ++ return 1; ++ return SUPPORTS_WEAK; ++} ++ ++/* Set up DECL as a public symbol that can be defined in multiple ++ translation units without generating a linker error. */ ++ ++void ++make_decl_one_only (tree decl) ++{ ++ if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL) ++ abort (); ++ ++ TREE_PUBLIC (decl) = 1; ++ ++ if (SUPPORTS_ONE_ONLY) ++ { ++#ifdef MAKE_DECL_ONE_ONLY ++ MAKE_DECL_ONE_ONLY (decl); ++#endif ++ DECL_ONE_ONLY (decl) = 1; ++ } ++ else if (TREE_CODE (decl) == VAR_DECL ++ && (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node)) ++ DECL_COMMON (decl) = 1; ++ else if (SUPPORTS_WEAK) ++ DECL_WEAK (decl) = 1; ++ else ++ abort (); ++} ++ ++void ++init_varasm_once (void) ++{ ++ in_named_htab = htab_create_ggc (31, in_named_entry_hash, ++ in_named_entry_eq, NULL); ++ const_desc_htab = htab_create_ggc (1009, const_desc_hash, ++ const_desc_eq, NULL); ++ ++ const_alias_set = new_alias_set (); ++} ++ ++enum tls_model ++decl_tls_model (tree decl) ++{ ++ enum tls_model kind; ++ tree attr = lookup_attribute ("tls_model", DECL_ATTRIBUTES (decl)); ++ bool is_local; ++ ++ if (attr) ++ { ++ attr = TREE_VALUE (TREE_VALUE (attr)); ++ if (TREE_CODE (attr) != STRING_CST) ++ abort (); ++ if (!strcmp (TREE_STRING_POINTER (attr), "local-exec")) ++ kind = TLS_MODEL_LOCAL_EXEC; ++ else if (!strcmp (TREE_STRING_POINTER (attr), "initial-exec")) ++ kind = TLS_MODEL_INITIAL_EXEC; ++ else if (!strcmp (TREE_STRING_POINTER (attr), "local-dynamic")) ++ kind = optimize ? TLS_MODEL_LOCAL_DYNAMIC : TLS_MODEL_GLOBAL_DYNAMIC; ++ else if (!strcmp (TREE_STRING_POINTER (attr), "global-dynamic")) ++ kind = TLS_MODEL_GLOBAL_DYNAMIC; ++ else ++ abort (); ++ return kind; ++ } ++ ++ is_local = (*targetm.binds_local_p) (decl); ++ if (!flag_pic) ++ { ++ if (is_local) ++ kind = TLS_MODEL_LOCAL_EXEC; ++ else ++ kind = TLS_MODEL_INITIAL_EXEC; ++ } ++ /* Local dynamic is inefficient when we're not combining the ++ parts of the address. */ ++ else if (optimize && is_local) ++ kind = TLS_MODEL_LOCAL_DYNAMIC; ++ else ++ kind = TLS_MODEL_GLOBAL_DYNAMIC; ++ if (kind < flag_tls_default) ++ kind = flag_tls_default; ++ ++ return kind; ++} ++ ++/* Select a set of attributes for section NAME based on the properties ++ of DECL and whether or not RELOC indicates that DECL's initializer ++ might contain runtime relocations. ++ ++ We make the section read-only and executable for a function decl, ++ read-only for a const data decl, and writable for a non-const data decl. */ ++ ++unsigned int ++default_section_type_flags (tree decl, const char *name, int reloc) ++{ ++ return default_section_type_flags_1 (decl, name, reloc, flag_pic); ++} ++ ++unsigned int ++default_section_type_flags_1 (tree decl, const char *name, int reloc, ++ int shlib) ++{ ++ unsigned int flags; ++ ++ if (decl && TREE_CODE (decl) == FUNCTION_DECL) ++ flags = SECTION_CODE; ++ else if (decl && decl_readonly_section_1 (decl, reloc, shlib)) ++ flags = 0; ++ else ++ flags = SECTION_WRITE; ++ ++ if (decl && DECL_ONE_ONLY (decl)) ++ flags |= SECTION_LINKONCE; ++ ++ if (decl && TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl)) ++ flags |= SECTION_TLS | SECTION_WRITE; ++ ++ if (strcmp (name, ".bss") == 0 ++ || strncmp (name, ".bss.", 5) == 0 ++ || strncmp (name, ".gnu.linkonce.b.", 16) == 0 ++ || strcmp (name, ".sbss") == 0 ++ || strncmp (name, ".sbss.", 6) == 0 ++ || strncmp (name, ".gnu.linkonce.sb.", 17) == 0 ++ || strcmp (name, ".tbss") == 0 ++ || strncmp (name, ".gnu.linkonce.tb.", 17) == 0) ++ flags |= SECTION_BSS; ++ ++ if (strcmp (name, ".tdata") == 0 ++ || strcmp (name, ".tbss") == 0 ++ || strncmp (name, ".gnu.linkonce.td.", 17) == 0 ++ || strncmp (name, ".gnu.linkonce.tb.", 17) == 0) ++ flags |= SECTION_TLS; ++ ++ /* These three sections have special ELF types. They are neither ++ SHT_PROGBITS nor SHT_NOBITS, so when changing sections we don't ++ want to print a section type (@progbits or @nobits). If someone ++ is silly enough to emit code or TLS variables to one of these ++ sections, then don't handle them specially. */ ++ if (!(flags & (SECTION_CODE | SECTION_BSS | SECTION_TLS)) ++ && (strcmp (name, ".init_array") == 0 ++ || strcmp (name, ".fini_array") == 0 ++ || strcmp (name, ".preinit_array") == 0)) ++ flags |= SECTION_NOTYPE; ++ ++ return flags; ++} ++ ++/* Output assembly to switch to section NAME with attribute FLAGS. ++ Four variants for common object file formats. */ ++ ++void ++default_no_named_section (const char *name ATTRIBUTE_UNUSED, ++ unsigned int flags ATTRIBUTE_UNUSED) ++{ ++ /* Some object formats don't support named sections at all. The ++ front-end should already have flagged this as an error. */ ++ abort (); ++} ++ ++void ++default_elf_asm_named_section (const char *name, unsigned int flags) ++{ ++ char flagchars[10], *f = flagchars; ++ ++ if (! named_section_first_declaration (name)) ++ { ++ fprintf (asm_out_file, "\t.section\t%s\n", name); ++ return; ++ } ++ ++ if (!(flags & SECTION_DEBUG)) ++ *f++ = 'a'; ++ if (flags & SECTION_WRITE) ++ *f++ = 'w'; ++ if (flags & SECTION_CODE) ++ *f++ = 'x'; ++ if (flags & SECTION_SMALL) ++ *f++ = 's'; ++ if (flags & SECTION_MERGE) ++ *f++ = 'M'; ++ if (flags & SECTION_STRINGS) ++ *f++ = 'S'; ++ if (flags & SECTION_TLS) ++ *f++ = 'T'; ++ *f = '\0'; ++ ++ fprintf (asm_out_file, "\t.section\t%s,\"%s\"", name, flagchars); ++ ++ if (!(flags & SECTION_NOTYPE)) ++ { ++ const char *type; ++ ++ if (flags & SECTION_BSS) ++ type = "nobits"; ++ else ++ type = "progbits"; ++ ++ fprintf (asm_out_file, ",@%s", type); ++ ++ if (flags & SECTION_ENTSIZE) ++ fprintf (asm_out_file, ",%d", flags & SECTION_ENTSIZE); ++ } ++ ++ putc ('\n', asm_out_file); ++} ++ ++void ++default_coff_asm_named_section (const char *name, unsigned int flags) ++{ ++ char flagchars[8], *f = flagchars; ++ ++ if (flags & SECTION_WRITE) ++ *f++ = 'w'; ++ if (flags & SECTION_CODE) ++ *f++ = 'x'; ++ *f = '\0'; ++ ++ fprintf (asm_out_file, "\t.section\t%s,\"%s\"\n", name, flagchars); ++} ++ ++void ++default_pe_asm_named_section (const char *name, unsigned int flags) ++{ ++ default_coff_asm_named_section (name, flags); ++ ++ if (flags & SECTION_LINKONCE) ++ { ++ /* Functions may have been compiled at various levels of ++ optimization so we can't use `same_size' here. ++ Instead, have the linker pick one. */ ++ fprintf (asm_out_file, "\t.linkonce %s\n", ++ (flags & SECTION_CODE ? "discard" : "same_size")); ++ } ++} ++ ++/* The lame default section selector. */ ++ ++void ++default_select_section (tree decl, int reloc, ++ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) ++{ ++ bool readonly = false; ++ ++ if (DECL_P (decl)) ++ { ++ if (decl_readonly_section (decl, reloc)) ++ readonly = true; ++ } ++ else if (TREE_CODE (decl) == CONSTRUCTOR) ++ { ++ if (! ((flag_pic && reloc) ++ || !TREE_READONLY (decl) ++ || TREE_SIDE_EFFECTS (decl) ++ || !TREE_CONSTANT (decl))) ++ readonly = true; ++ } ++ else if (TREE_CODE (decl) == STRING_CST) ++ readonly = !flag_writable_strings; ++ else if (! (flag_pic && reloc)) ++ readonly = true; ++ ++ if (readonly) ++ readonly_data_section (); ++ else ++ data_section (); ++} ++ ++/* A helper function for default_elf_select_section and ++ default_elf_unique_section. Categorizes the DECL. */ ++ ++enum section_category ++{ ++ SECCAT_TEXT, ++ ++ SECCAT_RODATA, ++ SECCAT_RODATA_MERGE_STR, ++ SECCAT_RODATA_MERGE_STR_INIT, ++ SECCAT_RODATA_MERGE_CONST, ++ SECCAT_SRODATA, ++ ++ SECCAT_DATA, ++ ++ /* To optimize loading of shared programs, define following subsections ++ of data section: ++ _REL Contains data that has relocations, so they get grouped ++ together and dynamic linker will visit fewer pages in memory. ++ _RO Contains data that is otherwise read-only. This is useful ++ with prelinking as most relocations won't be dynamically ++ linked and thus stay read only. ++ _LOCAL Marks data containing relocations only to local objects. ++ These relocations will get fully resolved by prelinking. */ ++ SECCAT_DATA_REL, ++ SECCAT_DATA_REL_LOCAL, ++ SECCAT_DATA_REL_RO, ++ SECCAT_DATA_REL_RO_LOCAL, ++ ++ SECCAT_SDATA, ++ SECCAT_TDATA, ++ ++ SECCAT_BSS, ++ SECCAT_SBSS, ++ SECCAT_TBSS ++}; ++ ++static enum section_category ++categorize_decl_for_section (tree, int, int); ++ ++static enum section_category ++categorize_decl_for_section (tree decl, int reloc, int shlib) ++{ ++ enum section_category ret; ++ ++ if (TREE_CODE (decl) == FUNCTION_DECL) ++ return SECCAT_TEXT; ++ else if (TREE_CODE (decl) == STRING_CST) ++ { ++ if (flag_writable_strings) ++ return SECCAT_DATA; ++ else ++ return SECCAT_RODATA_MERGE_STR; ++ } ++ else if (TREE_CODE (decl) == VAR_DECL) ++ { ++ if (DECL_INITIAL (decl) == NULL ++ || DECL_INITIAL (decl) == error_mark_node) ++ ret = SECCAT_BSS; ++ else if (! TREE_READONLY (decl) ++ || TREE_SIDE_EFFECTS (decl) ++ || ! TREE_CONSTANT (DECL_INITIAL (decl))) ++ { ++ if (shlib && (reloc & 2)) ++ ret = SECCAT_DATA_REL; ++ else if (shlib && reloc) ++ ret = SECCAT_DATA_REL_LOCAL; ++ else ++ ret = SECCAT_DATA; ++ } ++ else if (shlib && (reloc & 2)) ++ ret = SECCAT_DATA_REL_RO; ++ else if (shlib && reloc) ++ ret = SECCAT_DATA_REL_RO_LOCAL; ++ else if (reloc || flag_merge_constants < 2) ++ /* C and C++ don't allow different variables to share the same ++ location. -fmerge-all-constants allows even that (at the ++ expense of not conforming). */ ++ ret = SECCAT_RODATA; ++ else if (TREE_CODE (DECL_INITIAL (decl)) == STRING_CST) ++ ret = SECCAT_RODATA_MERGE_STR_INIT; ++ else ++ ret = SECCAT_RODATA_MERGE_CONST; ++ } ++ else if (TREE_CODE (decl) == CONSTRUCTOR) ++ { ++ if ((shlib && reloc) ++ || TREE_SIDE_EFFECTS (decl) ++ || ! TREE_CONSTANT (decl)) ++ ret = SECCAT_DATA; ++ else ++ ret = SECCAT_RODATA; ++ } ++ else ++ ret = SECCAT_RODATA; ++ ++ /* There are no read-only thread-local sections. */ ++ if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl)) ++ { ++ if (ret == SECCAT_BSS) ++ ret = SECCAT_TBSS; ++ else ++ ret = SECCAT_TDATA; ++ } ++ ++ /* If the target uses small data sections, select it. */ ++ else if ((*targetm.in_small_data_p) (decl)) ++ { ++ if (ret == SECCAT_BSS) ++ ret = SECCAT_SBSS; ++ else if (targetm.have_srodata_section && ret == SECCAT_RODATA) ++ ret = SECCAT_SRODATA; ++ else ++ ret = SECCAT_SDATA; ++ } ++ ++ return ret; ++} ++ ++bool ++decl_readonly_section (tree decl, int reloc) ++{ ++ return decl_readonly_section_1 (decl, reloc, flag_pic); ++} ++ ++bool ++decl_readonly_section_1 (tree decl, int reloc, int shlib) ++{ ++ switch (categorize_decl_for_section (decl, reloc, shlib)) ++ { ++ case SECCAT_RODATA: ++ case SECCAT_RODATA_MERGE_STR: ++ case SECCAT_RODATA_MERGE_STR_INIT: ++ case SECCAT_RODATA_MERGE_CONST: ++ case SECCAT_SRODATA: ++ return true; ++ break; ++ default: ++ return false; ++ break; ++ } ++} ++ ++/* Select a section based on the above categorization. */ ++ ++void ++default_elf_select_section (tree decl, int reloc, ++ unsigned HOST_WIDE_INT align) ++{ ++ default_elf_select_section_1 (decl, reloc, align, flag_pic); ++} ++ ++void ++default_elf_select_section_1 (tree decl, int reloc, ++ unsigned HOST_WIDE_INT align, int shlib) ++{ ++ switch (categorize_decl_for_section (decl, reloc, shlib)) ++ { ++ case SECCAT_TEXT: ++ /* We're not supposed to be called on FUNCTION_DECLs. */ ++ abort (); ++ case SECCAT_RODATA: ++ readonly_data_section (); ++ break; ++ case SECCAT_RODATA_MERGE_STR: ++ mergeable_string_section (decl, align, 0); ++ break; ++ case SECCAT_RODATA_MERGE_STR_INIT: ++ mergeable_string_section (DECL_INITIAL (decl), align, 0); ++ break; ++ case SECCAT_RODATA_MERGE_CONST: ++ mergeable_constant_section (DECL_MODE (decl), align, 0); ++ break; ++ case SECCAT_SRODATA: ++ named_section (decl, ".sdata2", reloc); ++ break; ++ case SECCAT_DATA: ++ data_section (); ++ break; ++ case SECCAT_DATA_REL: ++ named_section (decl, ".data.rel", reloc); ++ break; ++ case SECCAT_DATA_REL_LOCAL: ++ named_section (decl, ".data.rel.local", reloc); ++ break; ++ case SECCAT_DATA_REL_RO: ++ named_section (decl, ".data.rel.ro", reloc); ++ break; ++ case SECCAT_DATA_REL_RO_LOCAL: ++ named_section (decl, ".data.rel.ro.local", reloc); ++ break; ++ case SECCAT_SDATA: ++ named_section (decl, ".sdata", reloc); ++ break; ++ case SECCAT_TDATA: ++ named_section (decl, ".tdata", reloc); ++ break; ++ case SECCAT_BSS: ++#ifdef BSS_SECTION_ASM_OP ++ bss_section (); ++#else ++ named_section (decl, ".bss", reloc); ++#endif ++ break; ++ case SECCAT_SBSS: ++ named_section (decl, ".sbss", reloc); ++ break; ++ case SECCAT_TBSS: ++ named_section (decl, ".tbss", reloc); ++ break; ++ default: ++ abort (); ++ } ++} ++ ++/* Construct a unique section name based on the decl name and the ++ categorization performed above. */ ++ ++void ++default_unique_section (tree decl, int reloc) ++{ ++ default_unique_section_1 (decl, reloc, flag_pic); ++} ++ ++void ++default_unique_section_1 (tree decl, int reloc, int shlib) ++{ ++ bool one_only = DECL_ONE_ONLY (decl); ++ const char *prefix, *name; ++ size_t nlen, plen; ++ char *string; ++ ++ switch (categorize_decl_for_section (decl, reloc, shlib)) ++ { ++ case SECCAT_TEXT: ++ prefix = one_only ? ".gnu.linkonce.t." : ".text."; ++ break; ++ case SECCAT_RODATA: ++ case SECCAT_RODATA_MERGE_STR: ++ case SECCAT_RODATA_MERGE_STR_INIT: ++ case SECCAT_RODATA_MERGE_CONST: ++ prefix = one_only ? ".gnu.linkonce.r." : ".rodata."; ++ break; ++ case SECCAT_SRODATA: ++ prefix = one_only ? ".gnu.linkonce.s2." : ".sdata2."; ++ break; ++ case SECCAT_DATA: ++ case SECCAT_DATA_REL: ++ case SECCAT_DATA_REL_LOCAL: ++ case SECCAT_DATA_REL_RO: ++ case SECCAT_DATA_REL_RO_LOCAL: ++ prefix = one_only ? ".gnu.linkonce.d." : ".data."; ++ break; ++ case SECCAT_SDATA: ++ prefix = one_only ? ".gnu.linkonce.s." : ".sdata."; ++ break; ++ case SECCAT_BSS: ++ prefix = one_only ? ".gnu.linkonce.b." : ".bss."; ++ break; ++ case SECCAT_SBSS: ++ prefix = one_only ? ".gnu.linkonce.sb." : ".sbss."; ++ break; ++ case SECCAT_TDATA: ++ prefix = one_only ? ".gnu.linkonce.td." : ".tdata."; ++ break; ++ case SECCAT_TBSS: ++ prefix = one_only ? ".gnu.linkonce.tb." : ".tbss."; ++ break; ++ default: ++ abort (); ++ } ++ plen = strlen (prefix); ++ ++ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); ++ name = (* targetm.strip_name_encoding) (name); ++ nlen = strlen (name); ++ ++ string = alloca (nlen + plen + 1); ++ memcpy (string, prefix, plen); ++ memcpy (string + plen, name, nlen + 1); ++ ++ DECL_SECTION_NAME (decl) = build_string (nlen + plen, string); ++} ++ ++void ++default_select_rtx_section (enum machine_mode mode ATTRIBUTE_UNUSED, ++ rtx x, ++ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) ++{ ++ if (flag_pic) ++ switch (GET_CODE (x)) ++ { ++ case CONST: ++ case SYMBOL_REF: ++ case LABEL_REF: ++ data_section (); ++ return; ++ ++ default: ++ break; ++ } ++ ++ readonly_data_section (); ++} ++ ++void ++default_elf_select_rtx_section (enum machine_mode mode, rtx x, ++ unsigned HOST_WIDE_INT align) ++{ ++ /* ??? Handle small data here somehow. */ ++ ++ if (flag_pic) ++ switch (GET_CODE (x)) ++ { ++ case CONST: ++ case SYMBOL_REF: ++ named_section (NULL_TREE, ".data.rel.ro", 3); ++ return; ++ ++ case LABEL_REF: ++ named_section (NULL_TREE, ".data.rel.ro.local", 1); ++ return; ++ ++ default: ++ break; ++ } ++ ++ mergeable_constant_section (mode, align, 0); ++} ++ ++/* Set the generally applicable flags on the SYMBOL_REF for EXP. */ ++ ++void ++default_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED) ++{ ++ rtx symbol; ++ int flags; ++ ++ /* Careful not to prod global register variables. */ ++ if (GET_CODE (rtl) != MEM) ++ return; ++ symbol = XEXP (rtl, 0); ++ if (GET_CODE (symbol) != SYMBOL_REF) ++ return; ++ ++ flags = 0; ++ if (TREE_CODE (decl) == FUNCTION_DECL) ++ flags |= SYMBOL_FLAG_FUNCTION; ++ if ((*targetm.binds_local_p) (decl)) ++ flags |= SYMBOL_FLAG_LOCAL; ++ if ((*targetm.in_small_data_p) (decl)) ++ flags |= SYMBOL_FLAG_SMALL; ++ if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl)) ++ flags |= decl_tls_model (decl) << SYMBOL_FLAG_TLS_SHIFT; ++ /* ??? Why is DECL_EXTERNAL ever set for non-PUBLIC names? Without ++ being PUBLIC, the thing *must* be defined in this translation unit. ++ Prevent this buglet from being propagated into rtl code as well. */ ++ if (DECL_P (decl) && DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)) ++ flags |= SYMBOL_FLAG_EXTERNAL; ++ ++ SYMBOL_REF_FLAGS (symbol) = flags; ++} ++ ++/* By default, we do nothing for encode_section_info, so we need not ++ do anything but discard the '*' marker. */ ++ ++const char * ++default_strip_name_encoding (const char *str) ++{ ++ return str + (*str == '*'); ++} ++ ++/* Assume ELF-ish defaults, since that's pretty much the most liberal ++ wrt cross-module name binding. */ ++ ++bool ++default_binds_local_p (tree exp) ++{ ++ return default_binds_local_p_1 (exp, flag_shlib); ++} ++ ++bool ++default_binds_local_p_1 (tree exp, int shlib) ++{ ++ bool local_p; ++ ++ /* A non-decl is an entry in the constant pool. */ ++ if (!DECL_P (exp)) ++ local_p = true; ++ /* Static variables are always local. */ ++ else if (! TREE_PUBLIC (exp)) ++ local_p = true; ++ /* A variable is local if the user tells us so. */ ++ else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT) ++ local_p = true; ++ /* Otherwise, variables defined outside this object may not be local. */ ++ else if (DECL_EXTERNAL (exp)) ++ local_p = false; ++ /* Linkonce and weak data are never local. */ ++ else if (DECL_ONE_ONLY (exp) || DECL_WEAK (exp)) ++ local_p = false; ++ /* If PIC, then assume that any global name can be overridden by ++ symbols resolved from other modules. */ ++ else if (shlib) ++ local_p = false; ++ /* Uninitialized COMMON variable may be unified with symbols ++ resolved from other modules. */ ++ else if (DECL_COMMON (exp) ++ && (DECL_INITIAL (exp) == NULL ++ || DECL_INITIAL (exp) == error_mark_node)) ++ local_p = false; ++ /* Otherwise we're left with initialized (or non-common) global data ++ which is of necessity defined locally. */ ++ else ++ local_p = true; ++ ++ return local_p; ++} ++ ++/* Determine whether or not a pointer mode is valid. Assume defaults ++ of ptr_mode or Pmode - can be overridden. */ ++bool ++default_valid_pointer_mode (enum machine_mode mode) ++{ ++ return (mode == ptr_mode || mode == Pmode); ++} ++ ++/* Default function to output code that will globalize a label. A ++ target must define GLOBAL_ASM_OP or provide it's own function to ++ globalize a label. */ ++#ifdef GLOBAL_ASM_OP ++void ++default_globalize_label (FILE * stream, const char *name) ++{ ++ fputs (GLOBAL_ASM_OP, stream); ++ assemble_name (stream, name); ++ putc ('\n', stream); ++} ++#endif /* GLOBAL_ASM_OP */ ++ ++/* This is how to output an internal numbered label where PREFIX is ++ the class of label and LABELNO is the number within the class. */ ++ ++void ++default_internal_label (FILE *stream, const char *prefix, ++ unsigned long labelno) ++{ ++ char *const buf = alloca (40 + strlen (prefix)); ++ ASM_GENERATE_INTERNAL_LABEL (buf, prefix, labelno); ++ ASM_OUTPUT_LABEL (stream, buf); ++} ++ ++/* This is the default behavior at the beginning of a file. It's ++ controlled by two other target-hook toggles. */ ++void ++default_file_start (void) ++{ ++ if (targetm.file_start_app_off && !flag_verbose_asm) ++ fputs (ASM_APP_OFF, asm_out_file); ++ ++ if (targetm.file_start_file_directive) ++ output_file_directive (asm_out_file, main_input_filename); ++} ++ ++/* This is a generic routine suitable for use as TARGET_ASM_FILE_END ++ which emits a special section directive used to indicate whether or ++ not this object file needs an executable stack. This is primarily ++ a GNU extension to ELF but could be used on other targets. */ ++void ++file_end_indicate_exec_stack (void) ++{ ++ unsigned int flags = SECTION_DEBUG; ++ if (trampolines_created) ++ flags |= SECTION_CODE; ++ ++ named_section_flags (".note.GNU-stack", flags); ++} ++ ++#include "gt-varasm.h" +diff -Nbaur gcc-3.4.3/gcc/version.c gcc-3.4.3-new/gcc/version.c +--- gcc-3.4.3/gcc/version.c Fri Nov 5 03:35:02 2004 ++++ gcc-3.4.3-new/gcc/version.c Fri Jan 21 10:25:51 2005 +@@ -14,4 +14,4 @@ + forward us bugs reported to you, if you determine that they are + not bugs in your modifications.) */ + +-const char bug_report_url[] = ""; ++const char bug_report_url[] = ""; +diff -Nbaur gcc-3.4.3/include/libiberty.h gcc-3.4.3-new/include/libiberty.h +--- gcc-3.4.3/include/libiberty.h Thu May 15 20:02:12 2003 ++++ gcc-3.4.3-new/include/libiberty.h Fri Jan 21 10:25:51 2005 +@@ -1,6 +1,6 @@ + /* Function declarations for libiberty. + +- Copyright 2001, 2002 Free Software Foundation, Inc. ++ Copyright 2001, 2002, 2004 Free Software Foundation, Inc. + + Note - certain prototypes declared in this header file are for + functions whoes implementation copyright does not belong to the +@@ -41,6 +41,8 @@ + + #include "ansidecl.h" + ++#include ++ + #ifdef ANSI_PROTOTYPES + /* Get a definition for size_t. */ + #include +@@ -74,7 +76,7 @@ + to find the declaration so provide a fully prototyped one. If it + is 1, we found it so don't provide any declaration at all. */ + #if !HAVE_DECL_BASENAME +-#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (HAVE_DECL_BASENAME) ++#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__sun__) || defined (HAVE_DECL_BASENAME) + extern char *basename PARAMS ((const char *)); + #else + extern char *basename (); +@@ -274,7 +276,7 @@ + extern int pexecute PARAMS ((const char *, char * const *, const char *, + const char *, char **, char **, int)); + +-/* Wait for pexecute to finish. */ ++/* Wait for a process created by pexecute. */ + + extern int pwait PARAMS ((int, int *, int)); + +diff -Nbaur gcc-3.4.3/include/pex-read.h gcc-3.4.3-new/include/pex-read.h +--- gcc-3.4.3/include/pex-read.h Thu Jan 1 00:00:00 1970 ++++ gcc-3.4.3-new/include/pex-read.h Fri Jan 21 10:25:51 2005 +@@ -0,0 +1,41 @@ ++/* Declarations of the pex-read functions for libiberty. ++ Copyright 2004 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, ++ Boston, MA 02111-1307, USA. */ ++ ++#ifndef PEX_READ_H ++#define PEX_READ_H ++ ++#include ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/* Execute a program and read its standard output. */ ++ ++extern FILE *pex_read (const char *, char * const *, const char *, ++ const char *, char **, char **, int, int *); ++ ++/* Wait for pex_read to finish. */ ++ ++extern int pex_read_close (int, FILE *, int *, int); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* PEX_READ_H */ +diff -Nbaur gcc-3.4.3/libiberty/ChangeLog gcc-3.4.3-new/libiberty/ChangeLog +--- gcc-3.4.3/libiberty/ChangeLog Fri Nov 5 03:34:35 2004 ++++ gcc-3.4.3-new/libiberty/ChangeLog Fri Jan 21 10:25:52 2005 +@@ -14,11 +14,33 @@ + + * GCC 3.4.0 released. + +-2004-02-25 Ian Lance Taylor ++2004-03-17 Ian Lance Taylor + +- Taken from mainline: ++ * pex-unix.c (pexecute): Use vfork instead of fork, with ++ appropriate changes to make this safe. ++ * pex-common.h (STDERR_FILE_NO): Define. + +- 2004-02-24 Ian Lance Taylor ++ * Makefile.in: Clean up REQUIRED_OFILES and CONFIGURED_OFILES for ++ an 80 column screen. Run maint-deps. ++ ++2004-03-09 Kelley Cook ++ ++ * configure.ac: Bump version to 2.59. Apply suggested autoupdates. ++ * acconfig.h: Delete redundant file. ++ * config.in: Regenerate. ++ * configure: Regenerate. ++ ++2004-03-09 Hans-Peter Nilsson ++ ++ * configure: Regenerate for config/accross.m4 correction. ++ ++2004-03-07 Andreas Jaeger ++ ++ * testsuite/test-demangle.c: Include and for ++ prototypes. ++ (main): Initialize style. ++ ++2004-02-24 Ian Lance Taylor + + * cp-demangle.h (enum d_builtin_type_print): Add D_PRINT_UNSIGNED, + D_PRINT_UNSIGNED_LONG, D_PRINT_LONG_LONG, +@@ -51,7 +73,7 @@ + past ones which have been printed already. + * testsuite/demangle-expected: Add three test cases. + +- 2004-02-23 Ian Lance Taylor ++2004-02-23 Ian Lance Taylor + + * cp-demangle.c (__cxa_demangle): Adjust last patch to handle + empty string correctly. +@@ -61,6 +83,29 @@ + built-in type name. + (main): If IN_GLIBCPP_V3 is defined, test __cxa_demangle rather + than cplus_demangle_v3. ++ ++ * dyn-string.c: Remove test of IN_LIBGCC2 and IN_GLIBCPP_V3 and ++ the associated #define of RETURN_ON_ALLOCATION_FAILURE. ++ ++2004-02-16 Matt Kraai ++ ++ * regex.c: Include . ++ (regcomp): Cast i to int. ++ (regerror): Add ATTRIBUTE_UNUSED to parameter preg. ++ ++2004-01-25 Ian Lance Taylor ++ ++ * configure.ac: Add m4_pattern_allow(LIBOBJS). ++ * configure: Regenerate. ++ ++2004-01-22 DJ Delorie ++ ++ * Makefile.in: Convert to ./ throughout. Rebuild dependencies ++ with explicit build rules. ++ (VPATH): Remove. ++ (.c.o): Poison. ++ * configure.ac (pexecute, LIBOBJS): Add ./ . ++ * maint-tool: Build dependencies with explicit rules. + + 2004-01-15 Kazu Hirata + +diff -Nbaur gcc-3.4.3/libiberty/Makefile.in gcc-3.4.3-new/libiberty/Makefile.in +--- gcc-3.4.3/libiberty/Makefile.in Wed Jan 14 21:27:28 2004 ++++ gcc-3.4.3-new/libiberty/Makefile.in Fri Jan 21 10:25:52 2005 +@@ -28,7 +28,6 @@ + + libiberty_topdir = @libiberty_topdir@ + srcdir = @srcdir@ +-VPATH = @srcdir@ + + prefix = @prefix@ + +@@ -70,8 +69,8 @@ + + MAKEOVERRIDES = + +-TARGETLIB = libiberty.a +-TESTLIB = testlib.a ++TARGETLIB = ./libiberty.a ++TESTLIB = ./testlib.a + + LIBOBJS = @LIBOBJS@ + +@@ -118,15 +117,15 @@ + INCDIR=$(srcdir)/$(MULTISRCTOP)../include + + COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES) @ac_libiberty_warn_cflags@ ++ ++# Just to make sure we don't use a built-in rule with VPATH + .c.o: +- if [ x"$(PICFLAG)" != x ]; then \ +- $(COMPILE.c) $(PICFLAG) $< -o pic/$@; \ +- else true; fi +- $(COMPILE.c) $< $(OUTPUT_OPTION) ++ false + + # NOTE: If you add new files to the library, add them to this list + # (alphabetical), and add them to REQUIRED_OFILES, or +-# CONFIGURED_OFILES and funcs in configure.ac. ++# CONFIGURED_OFILES and funcs in configure.ac. Also run "make maint-deps" ++# to build the new rules. + CFILES = alloca.c argv.c asprintf.c atexit.c \ + basename.c bcmp.c bcopy.c bsearch.c bzero.c \ + calloc.c choose-temp.c clock.c concat.c cp-demangle.c \ +@@ -145,6 +144,7 @@ + partition.c \ + pex-djgpp.c pex-mpw.c pex-msdos.c pex-os2.c \ + pex-unix.c pex-win32.c \ ++ pexrd-unix.c pexrd-generic.c \ + physmem.c putenv.c \ + random.c regex.c rename.c rindex.c \ + safe-ctype.c setenv.c sigsetmask.c snprintf.c sort.c spaces.c \ +@@ -158,45 +158,48 @@ + + # These are always included in the library. The first four are listed + # first and by compile time to optimize parallel builds. +-REQUIRED_OFILES = regex.o cplus-dem.o cp-demangle.o cp-demint.o md5.o \ +- alloca.o argv.o \ +- choose-temp.o concat.o \ +- dyn-string.o \ +- fdmatch.o fibheap.o floatformat.o fnmatch.o \ +- getopt.o getopt1.o getpwd.o getruntime.o \ +- hashtab.o hex.o \ +- lbasename.o \ +- lrealpath.o \ +- make-relative-prefix.o \ +- make-temp-file.o \ +- objalloc.o obstack.o \ +- partition.o physmem.o @pexecute@ \ +- safe-ctype.o sort.o spaces.o splay-tree.o strerror.o \ +- strsignal.o \ +- ternary.o \ +- xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o ++REQUIRED_OFILES = ./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o \ ++ ./alloca.o ./argv.o \ ++ ./choose-temp.o ./concat.o ./cp-demint.o \ ++ ./dyn-string.o \ ++ ./fdmatch.o ./fibheap.o ./floatformat.o ./fnmatch.o \ ++ ./getopt.o ./getopt1.o ./getpwd.o ./getruntime.o \ ++ ./hashtab.o ./hex.o \ ++ ./lbasename.o ./lrealpath.o \ ++ ./make-relative-prefix.o ./make-temp-file.o \ ++ ./objalloc.o ./obstack.o \ ++ ./partition.o ./physmem.o @pexecute@ \ ++ ./safe-ctype.o ./sort.o ./spaces.o ./splay-tree.o ./strerror.o \ ++ ./strsignal.o \ ++ ./ternary.o \ ++ ./xatexit.o ./xexit.o ./xmalloc.o ./xmemdup.o ./xstrdup.o \ ++ ./xstrerror.o + + # These are all the objects that configure may add to the library via + # $funcs or EXTRA_OFILES. This list exists here only for "make + # maint-missing" and "make check". +-CONFIGURED_OFILES = asprintf.o atexit.o \ +- basename.o bcmp.o bcopy.o bsearch.o bzero.o \ +- calloc.o clock.o copysign.o \ +- _doprnt.o \ +- ffs.o \ +- getcwd.o getpagesize.o \ +- index.o insque.o \ +- memchr.o memcmp.o memcpy.o memmove.o mempcpy.o memset.o mkstemps.o \ +- pex-djgpp.o pex-mpw.o pex-msdos.o pex-os2.o \ +- pex-unix.o pex-win32.o \ +- putenv.o \ +- random.o rename.o rindex.o \ +- setenv.o sigsetmask.o snprintf.o stpcpy.o stpncpy.o strcasecmp.o \ +- strchr.o strdup.o strncasecmp.o strncmp.o strrchr.o strstr.o \ +- strtod.o strtol.o strtoul.o \ +- tmpnam.o \ +- vasprintf.o vfork.o vfprintf.o vprintf.o vsnprintf.o vsprintf.o \ +- waitpid.o ++CONFIGURED_OFILES = ./asprintf.o ./atexit.o \ ++ ./basename.o ./bcmp.o ./bcopy.o ./bsearch.o ./bzero.o \ ++ ./calloc.o ./clock.o ./copysign.o \ ++ ./_doprnt.o \ ++ ./ffs.o \ ++ ./getcwd.o ./getpagesize.o \ ++ ./index.o ./insque.o \ ++ ./memchr.o ./memcmp.o ./memcpy.o ./memmove.o ./mempcpy.o \ ++ ./memset.o ./mkstemps.o \ ++ ./pex-djgpp.o ./pex-mpw.o ./pex-msdos.o ./pex-os2.o \ ++ ./pex-unix.o ./pex-win32.o \ ++ ./pexrd-unix.o ./pexrd-generic.o \ ++ ./putenv.o \ ++ ./random.o ./rename.o ./rindex.o \ ++ ./setenv.o ./sigsetmask.o ./snprintf.o ./stpcpy.o ./stpncpy.o \ ++ ./strcasecmp.o ./strchr.o ./strdup.o ./strncasecmp.o \ ++ ./strncmp.o ./strrchr.o ./strstr.o \ ++ ./strtod.o ./strtol.o ./strtoul.o \ ++ ./tmpnam.o \ ++ ./vasprintf.o ./vfork.o ./vfprintf.o ./vprintf.o ./vsnprintf.o \ ++ ./vsprintf.o \ ++ ./waitpid.o + + # These files are installed if the library has been configured to do so. + INSTALLED_HEADERS = \ +@@ -390,8 +393,8 @@ + # Depending on Makefile makes sure that config.status has been re-run + # if needed. This prevents problems with parallel builds. + config.h: stamp-h ; @true +-stamp-h: config.in config.status Makefile +- CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status ++stamp-h: $(srcdir)/config.in config.status Makefile ++ CONFIG_FILES= CONFIG_HEADERS=config.h:$(srcdir)/config.in $(SHELL) ./config.status + + config.status: $(srcdir)/configure $(srcdir)/config.table + $(SHELL) ./config.status --recheck +@@ -415,113 +418,658 @@ + # The dependencies in the remainder of this file are automatically + # generated by "make maint-deps". Manual edits will be lost. + +-_doprnt.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h +-alloca.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-argv.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-asprintf.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-atexit.o: config.h +-basename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ++./_doprnt.o: $(srcdir)/_doprnt.c config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/safe-ctype.h +-bsearch.o: config.h $(INCDIR)/ansidecl.h +-calloc.o: $(INCDIR)/ansidecl.h +-choose-temp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-clock.o: config.h +-concat.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-copysign.o: $(INCDIR)/ansidecl.h +-cp-demangle.o: config.h $(INCDIR)/ansidecl.h $(srcdir)/cp-demangle.h \ +- $(INCDIR)/demangle.h $(INCDIR)/dyn-string.h $(INCDIR)/getopt.h \ +- $(INCDIR)/libiberty.h +-cp-demint.o: config.h $(INCDIR)/ansidecl.h $(srcdir)/cp-demangle.h \ +- $(INCDIR)/demangle.h $(INCDIR)/libiberty.h +-cplus-dem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \ +- $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h +-dyn-string.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h \ ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/_doprnt.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/_doprnt.c $(OUTPUT_OPTION) ++ ++./alloca.o: $(srcdir)/alloca.c config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/libiberty.h +-fdmatch.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-fibheap.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/fibheap.h \ ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/alloca.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/alloca.c $(OUTPUT_OPTION) ++ ++./argv.o: $(srcdir)/argv.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/argv.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/argv.c $(OUTPUT_OPTION) ++ ++./asprintf.o: $(srcdir)/asprintf.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/asprintf.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/asprintf.c $(OUTPUT_OPTION) ++ ++./atexit.o: $(srcdir)/atexit.c config.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/atexit.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/atexit.c $(OUTPUT_OPTION) ++ ++./basename.o: $(srcdir)/basename.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ++ $(INCDIR)/safe-ctype.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/basename.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/basename.c $(OUTPUT_OPTION) ++ ++./bcmp.o: $(srcdir)/bcmp.c ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/bcmp.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/bcmp.c $(OUTPUT_OPTION) ++ ++./bcopy.o: $(srcdir)/bcopy.c ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/bcopy.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/bcopy.c $(OUTPUT_OPTION) ++ ++./bsearch.o: $(srcdir)/bsearch.c config.h $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/bsearch.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/bsearch.c $(OUTPUT_OPTION) ++ ++./bzero.o: $(srcdir)/bzero.c ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/bzero.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/bzero.c $(OUTPUT_OPTION) ++ ++./calloc.o: $(srcdir)/calloc.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/calloc.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/calloc.c $(OUTPUT_OPTION) ++ ++./choose-temp.o: $(srcdir)/choose-temp.c config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/libiberty.h +-floatformat.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/floatformat.h \ ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/choose-temp.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/choose-temp.c $(OUTPUT_OPTION) ++ ++./clock.o: $(srcdir)/clock.c config.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/clock.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/clock.c $(OUTPUT_OPTION) ++ ++./concat.o: $(srcdir)/concat.c config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/libiberty.h +-fnmatch.o: config.h $(INCDIR)/fnmatch.h $(INCDIR)/safe-ctype.h +-getcwd.o: config.h +-getopt.o: config.h $(INCDIR)/getopt.h +-getopt1.o: config.h $(INCDIR)/getopt.h +-getpagesize.o: config.h +-getpwd.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-getruntime.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-hashtab.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/hashtab.h \ ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/concat.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/concat.c $(OUTPUT_OPTION) ++ ++./copysign.o: $(srcdir)/copysign.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/copysign.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/copysign.c $(OUTPUT_OPTION) ++ ++./cp-demangle.o: $(srcdir)/cp-demangle.c config.h $(INCDIR)/ansidecl.h \ ++ $(srcdir)/cp-demangle.h $(INCDIR)/demangle.h \ ++ $(INCDIR)/dyn-string.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/cp-demangle.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/cp-demangle.c $(OUTPUT_OPTION) ++ ++./cp-demint.o: $(srcdir)/cp-demint.c config.h $(INCDIR)/ansidecl.h \ ++ $(srcdir)/cp-demangle.h $(INCDIR)/demangle.h \ + $(INCDIR)/libiberty.h +-hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/cp-demint.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/cp-demint.c $(OUTPUT_OPTION) ++ ++./cplus-dem.o: $(srcdir)/cplus-dem.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \ + $(INCDIR)/safe-ctype.h +-lbasename.o: $(INCDIR)/ansidecl.h $(INCDIR)/filenames.h \ ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/cplus-dem.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/cplus-dem.c $(OUTPUT_OPTION) ++ ++./dyn-string.o: $(srcdir)/dyn-string.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/dyn-string.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/dyn-string.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/dyn-string.c $(OUTPUT_OPTION) ++ ++./fdmatch.o: $(srcdir)/fdmatch.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/fdmatch.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/fdmatch.c $(OUTPUT_OPTION) ++ ++./ffs.o: $(srcdir)/ffs.c ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/ffs.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/ffs.c $(OUTPUT_OPTION) ++ ++./fibheap.o: $(srcdir)/fibheap.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/fibheap.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/fibheap.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION) ++ ++./floatformat.o: $(srcdir)/floatformat.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/floatformat.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/floatformat.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/floatformat.c $(OUTPUT_OPTION) ++ ++./fnmatch.o: $(srcdir)/fnmatch.c config.h $(INCDIR)/fnmatch.h \ ++ $(INCDIR)/safe-ctype.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/fnmatch.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/fnmatch.c $(OUTPUT_OPTION) ++ ++./getcwd.o: $(srcdir)/getcwd.c config.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/getcwd.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/getcwd.c $(OUTPUT_OPTION) ++ ++./getopt.o: $(srcdir)/getopt.c config.h $(INCDIR)/getopt.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/getopt.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/getopt.c $(OUTPUT_OPTION) ++ ++./getopt1.o: $(srcdir)/getopt1.c config.h $(INCDIR)/getopt.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/getopt1.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/getopt1.c $(OUTPUT_OPTION) ++ ++./getpagesize.o: $(srcdir)/getpagesize.c config.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/getpagesize.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/getpagesize.c $(OUTPUT_OPTION) ++ ++./getpwd.o: $(srcdir)/getpwd.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/getpwd.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/getpwd.c $(OUTPUT_OPTION) ++ ++./getruntime.o: $(srcdir)/getruntime.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/getruntime.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/getruntime.c $(OUTPUT_OPTION) ++ ++./hashtab.o: $(srcdir)/hashtab.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/hashtab.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/hashtab.c $(OUTPUT_OPTION) ++ ++./hex.o: $(srcdir)/hex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ++ $(INCDIR)/safe-ctype.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/hex.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/hex.c $(OUTPUT_OPTION) ++ ++./index.o: $(srcdir)/index.c ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/index.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/index.c $(OUTPUT_OPTION) ++ ++./insque.o: $(srcdir)/insque.c ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/insque.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/insque.c $(OUTPUT_OPTION) ++ ++./lbasename.o: $(srcdir)/lbasename.c $(INCDIR)/ansidecl.h $(INCDIR)/filenames.h \ + $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h +-lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-make-relative-prefix.o: config.h $(INCDIR)/ansidecl.h \ ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/lbasename.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/lbasename.c $(OUTPUT_OPTION) ++ ++./lrealpath.o: $(srcdir)/lrealpath.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/lrealpath.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/lrealpath.c $(OUTPUT_OPTION) ++ ++./make-relative-prefix.o: $(srcdir)/make-relative-prefix.c config.h \ ++ $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/make-relative-prefix.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/make-relative-prefix.c $(OUTPUT_OPTION) ++ ++./make-temp-file.o: $(srcdir)/make-temp-file.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/make-temp-file.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/make-temp-file.c $(OUTPUT_OPTION) ++ ++./md5.o: $(srcdir)/md5.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/md5.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/md5.c $(OUTPUT_OPTION) ++ ++./memchr.o: $(srcdir)/memchr.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/memchr.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/memchr.c $(OUTPUT_OPTION) ++ ++./memcmp.o: $(srcdir)/memcmp.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/memcmp.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/memcmp.c $(OUTPUT_OPTION) ++ ++./memcpy.o: $(srcdir)/memcpy.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/memcpy.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/memcpy.c $(OUTPUT_OPTION) ++ ++./memmove.o: $(srcdir)/memmove.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/memmove.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/memmove.c $(OUTPUT_OPTION) ++ ++./mempcpy.o: $(srcdir)/mempcpy.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/mempcpy.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/mempcpy.c $(OUTPUT_OPTION) ++ ++./memset.o: $(srcdir)/memset.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/memset.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/memset.c $(OUTPUT_OPTION) ++ ++./mkstemps.o: $(srcdir)/mkstemps.c config.h $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/mkstemps.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/mkstemps.c $(OUTPUT_OPTION) ++ ++./mpw.o: $(srcdir)/mpw.c ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/mpw.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/mpw.c $(OUTPUT_OPTION) ++ ++./msdos.o: $(srcdir)/msdos.c ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/msdos.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/msdos.c $(OUTPUT_OPTION) ++ ++./objalloc.o: $(srcdir)/objalloc.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/objalloc.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/objalloc.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/objalloc.c $(OUTPUT_OPTION) ++ ++./obstack.o: $(srcdir)/obstack.c config.h $(INCDIR)/obstack.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/obstack.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/obstack.c $(OUTPUT_OPTION) ++ ++./partition.o: $(srcdir)/partition.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h $(INCDIR)/partition.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/partition.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/partition.c $(OUTPUT_OPTION) ++ ++./pex-djgpp.o: $(srcdir)/pex-djgpp.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-djgpp.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/pex-djgpp.c $(OUTPUT_OPTION) ++ ++./pex-mpw.o: $(srcdir)/pex-mpw.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-mpw.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/pex-mpw.c $(OUTPUT_OPTION) ++ ++./pex-msdos.o: $(srcdir)/pex-msdos.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h \ ++ $(INCDIR)/safe-ctype.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-msdos.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/pex-msdos.c $(OUTPUT_OPTION) ++ ++./pex-os2.o: $(srcdir)/pex-os2.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-os2.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/pex-os2.c $(OUTPUT_OPTION) ++ ++./pex-unix.o: $(srcdir)/pex-unix.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-unix.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/pex-unix.c $(OUTPUT_OPTION) ++ ++./pex-win32.o: $(srcdir)/pex-win32.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-win32.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/pex-win32.c $(OUTPUT_OPTION) ++ ++./pexrd-generic.o: $(srcdir)/pexrd-generic.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/pexrd-generic.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/pexrd-generic.c $(OUTPUT_OPTION) ++ ++./pexrd-unix.o: $(srcdir)/pexrd-unix.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h $(srcdir)/pex-common.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/pexrd-unix.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/pexrd-unix.c $(OUTPUT_OPTION) ++ ++./physmem.o: $(srcdir)/physmem.c config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/libiberty.h +-make-temp-file.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-md5.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h +-memchr.o: $(INCDIR)/ansidecl.h +-memcmp.o: $(INCDIR)/ansidecl.h +-memcpy.o: $(INCDIR)/ansidecl.h +-memmove.o: $(INCDIR)/ansidecl.h +-mempcpy.o: $(INCDIR)/ansidecl.h +-memset.o: $(INCDIR)/ansidecl.h +-mkstemps.o: config.h $(INCDIR)/ansidecl.h +-objalloc.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/objalloc.h +-obstack.o: config.h $(INCDIR)/obstack.h +-partition.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ +- $(INCDIR)/partition.h +-pex-djgpp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ +- $(srcdir)/pex-common.h +-pex-mpw.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ +- $(srcdir)/pex-common.h +-pex-msdos.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ +- $(srcdir)/pex-common.h $(INCDIR)/safe-ctype.h +-pex-os2.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ +- $(srcdir)/pex-common.h +-pex-unix.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ +- $(srcdir)/pex-common.h +-pex-win32.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ +- $(srcdir)/pex-common.h +-physmem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-putenv.o: config.h $(INCDIR)/ansidecl.h +-random.o: $(INCDIR)/ansidecl.h +-regex.o: config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h +-rename.o: config.h $(INCDIR)/ansidecl.h +-safe-ctype.o: $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h +-setenv.o: config.h $(INCDIR)/ansidecl.h +-sigsetmask.o: $(INCDIR)/ansidecl.h +-snprintf.o: $(INCDIR)/ansidecl.h +-sort.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/physmem.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/physmem.c $(OUTPUT_OPTION) ++ ++./putenv.o: $(srcdir)/putenv.c config.h $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/putenv.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/putenv.c $(OUTPUT_OPTION) ++ ++./random.o: $(srcdir)/random.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/random.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/random.c $(OUTPUT_OPTION) ++ ++./regex.o: $(srcdir)/regex.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/xregex.h \ ++ $(INCDIR)/xregex2.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/regex.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/regex.c $(OUTPUT_OPTION) ++ ++./rename.o: $(srcdir)/rename.c config.h $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/rename.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/rename.c $(OUTPUT_OPTION) ++ ++./rindex.o: $(srcdir)/rindex.c ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/rindex.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/rindex.c $(OUTPUT_OPTION) ++ ++./safe-ctype.o: $(srcdir)/safe-ctype.c $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/safe-ctype.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/safe-ctype.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/safe-ctype.c $(OUTPUT_OPTION) ++ ++./setenv.o: $(srcdir)/setenv.c config.h $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/setenv.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/setenv.c $(OUTPUT_OPTION) ++ ++./sigsetmask.o: $(srcdir)/sigsetmask.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/sigsetmask.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/sigsetmask.c $(OUTPUT_OPTION) ++ ++./snprintf.o: $(srcdir)/snprintf.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/snprintf.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/snprintf.c $(OUTPUT_OPTION) ++ ++./sort.o: $(srcdir)/sort.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ + $(INCDIR)/sort.h +-spaces.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-splay-tree.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ +- $(INCDIR)/splay-tree.h +-stpcpy.o: $(INCDIR)/ansidecl.h +-stpncpy.o: $(INCDIR)/ansidecl.h +-strcasecmp.o: $(INCDIR)/ansidecl.h +-strchr.o: $(INCDIR)/ansidecl.h +-strdup.o: $(INCDIR)/ansidecl.h +-strerror.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-strncasecmp.o: $(INCDIR)/ansidecl.h +-strncmp.o: $(INCDIR)/ansidecl.h +-strrchr.o: $(INCDIR)/ansidecl.h +-strsignal.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-strtod.o: $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h +-strtol.o: config.h $(INCDIR)/safe-ctype.h +-strtoul.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h +-ternary.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ +- $(INCDIR)/ternary.h +-vasprintf.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-vfork.o: $(INCDIR)/ansidecl.h +-vfprintf.o: $(INCDIR)/ansidecl.h +-vprintf.o: $(INCDIR)/ansidecl.h +-vsnprintf.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-vsprintf.o: $(INCDIR)/ansidecl.h +-waitpid.o: config.h +-xatexit.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-xexit.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-xmalloc.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-xmemdup.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-xstrdup.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +-xstrerror.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/sort.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/sort.c $(OUTPUT_OPTION) ++ ++./spaces.o: $(srcdir)/spaces.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/spaces.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/spaces.c $(OUTPUT_OPTION) ++ ++./splay-tree.o: $(srcdir)/splay-tree.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h $(INCDIR)/splay-tree.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/splay-tree.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/splay-tree.c $(OUTPUT_OPTION) ++ ++./stpcpy.o: $(srcdir)/stpcpy.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/stpcpy.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/stpcpy.c $(OUTPUT_OPTION) ++ ++./stpncpy.o: $(srcdir)/stpncpy.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/stpncpy.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/stpncpy.c $(OUTPUT_OPTION) ++ ++./strcasecmp.o: $(srcdir)/strcasecmp.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/strcasecmp.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/strcasecmp.c $(OUTPUT_OPTION) ++ ++./strchr.o: $(srcdir)/strchr.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/strchr.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/strchr.c $(OUTPUT_OPTION) ++ ++./strdup.o: $(srcdir)/strdup.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/strdup.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/strdup.c $(OUTPUT_OPTION) ++ ++./strerror.o: $(srcdir)/strerror.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/strerror.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/strerror.c $(OUTPUT_OPTION) ++ ++./strncasecmp.o: $(srcdir)/strncasecmp.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/strncasecmp.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/strncasecmp.c $(OUTPUT_OPTION) ++ ++./strncmp.o: $(srcdir)/strncmp.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/strncmp.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/strncmp.c $(OUTPUT_OPTION) ++ ++./strrchr.o: $(srcdir)/strrchr.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/strrchr.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/strrchr.c $(OUTPUT_OPTION) ++ ++./strsignal.o: $(srcdir)/strsignal.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/strsignal.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/strsignal.c $(OUTPUT_OPTION) ++ ++./strstr.o: $(srcdir)/strstr.c ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/strstr.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/strstr.c $(OUTPUT_OPTION) ++ ++./strtod.o: $(srcdir)/strtod.c $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/strtod.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/strtod.c $(OUTPUT_OPTION) ++ ++./strtol.o: $(srcdir)/strtol.c config.h $(INCDIR)/safe-ctype.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/strtol.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/strtol.c $(OUTPUT_OPTION) ++ ++./strtoul.o: $(srcdir)/strtoul.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/safe-ctype.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/strtoul.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/strtoul.c $(OUTPUT_OPTION) ++ ++./ternary.o: $(srcdir)/ternary.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h $(INCDIR)/ternary.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/ternary.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/ternary.c $(OUTPUT_OPTION) ++ ++./tmpnam.o: $(srcdir)/tmpnam.c ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/tmpnam.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/tmpnam.c $(OUTPUT_OPTION) ++ ++./vasprintf.o: $(srcdir)/vasprintf.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/vasprintf.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/vasprintf.c $(OUTPUT_OPTION) ++ ++./vfork.o: $(srcdir)/vfork.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/vfork.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/vfork.c $(OUTPUT_OPTION) ++ ++./vfprintf.o: $(srcdir)/vfprintf.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/vfprintf.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/vfprintf.c $(OUTPUT_OPTION) ++ ++./vprintf.o: $(srcdir)/vprintf.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/vprintf.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/vprintf.c $(OUTPUT_OPTION) ++ ++./vsnprintf.o: $(srcdir)/vsnprintf.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/vsnprintf.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/vsnprintf.c $(OUTPUT_OPTION) ++ ++./vsprintf.o: $(srcdir)/vsprintf.c $(INCDIR)/ansidecl.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/vsprintf.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/vsprintf.c $(OUTPUT_OPTION) ++ ++./waitpid.o: $(srcdir)/waitpid.c config.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/waitpid.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/waitpid.c $(OUTPUT_OPTION) ++ ++./xatexit.o: $(srcdir)/xatexit.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/xatexit.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/xatexit.c $(OUTPUT_OPTION) ++ ++./xexit.o: $(srcdir)/xexit.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/xexit.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/xexit.c $(OUTPUT_OPTION) ++ ++./xmalloc.o: $(srcdir)/xmalloc.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/xmalloc.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/xmalloc.c $(OUTPUT_OPTION) ++ ++./xmemdup.o: $(srcdir)/xmemdup.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/xmemdup.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/xmemdup.c $(OUTPUT_OPTION) ++ ++./xstrdup.o: $(srcdir)/xstrdup.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/xstrdup.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/xstrdup.c $(OUTPUT_OPTION) ++ ++./xstrerror.o: $(srcdir)/xstrerror.c config.h $(INCDIR)/ansidecl.h \ ++ $(INCDIR)/libiberty.h ++ if [ x"$(PICFLAG)" != x ]; then \ ++ $(COMPILE.c) $(PICFLAG) $(srcdir)/xstrerror.c -o pic/$@; \ ++ else true; fi ++ $(COMPILE.c) $(srcdir)/xstrerror.c $(OUTPUT_OPTION) ++ +diff -Nbaur gcc-3.4.3/libiberty/config.in gcc-3.4.3-new/libiberty/config.in +--- gcc-3.4.3/libiberty/config.in Sat Jan 10 02:17:41 2004 ++++ gcc-3.4.3-new/libiberty/config.in Fri Jan 21 10:25:52 2005 +@@ -1,7 +1,4 @@ + /* config.in. Generated from configure.ac by autoheader. */ +-/* Define to `unsigned long' if doesn't define. */ +-#undef uintptr_t +- + + /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ + #undef BYTEORDER +@@ -362,9 +359,11 @@ + /* Define to empty if `const' does not conform to ANSI C. */ + #undef const + +-/* Define as `__inline' if that's what the C compiler calls it, or to nothing +- if it is not supported. */ ++/* Define to `__inline__' or `__inline' if that's what the C compiler ++ calls it, or to nothing if 'inline' is not supported under any name. */ ++#ifndef __cplusplus + #undef inline ++#endif + + /* Define to `int' if does not define. */ + #undef pid_t +diff -Nbaur gcc-3.4.3/libiberty/configure gcc-3.4.3-new/libiberty/configure +--- gcc-3.4.3/libiberty/configure Wed Oct 1 18:11:29 2003 ++++ gcc-3.4.3-new/libiberty/configure Fri Jan 21 10:25:52 2005 +@@ -1,9 +1,8 @@ + #! /bin/sh + # Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.57. ++# Generated by GNU Autoconf 2.59. + # +-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +-# Free Software Foundation, Inc. ++# Copyright (C) 2003 Free Software Foundation, Inc. + # This configure script is free software; the Free Software Foundation + # gives unlimited permission to copy, distribute and modify it. + ## --------------------- ## +@@ -20,9 +19,10 @@ + elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix + fi ++DUALCASE=1; export DUALCASE # for MKS sh + + # Support unset when possible. +-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset + else + as_unset=false +@@ -41,7 +41,7 @@ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME + do +- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then ++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var +@@ -218,16 +218,17 @@ + if mkdir -p . 2>/dev/null; then + as_mkdir_p=: + else ++ test -d ./-p && rmdir ./-p + as_mkdir_p=false + fi + + as_executable_p="test -f" + + # Sed expression to map a string onto a valid CPP name. +-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" ++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + + # Sed expression to map a string onto a valid variable name. +-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" ++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + # IFS +@@ -901,12 +902,45 @@ + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; + esac +-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +-# absolute. +-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` ++ ++# Do not use `cd foo && pwd` to compute absolute paths, because ++# the directories may not exist. ++case `pwd` in ++.) ac_abs_builddir="$ac_dir";; ++*) ++ case "$ac_dir" in ++ .) ac_abs_builddir=`pwd`;; ++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; ++ *) ac_abs_builddir=`pwd`/"$ac_dir";; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_builddir=${ac_top_builddir}.;; ++*) ++ case ${ac_top_builddir}. in ++ .) ac_abs_top_builddir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; ++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_srcdir=$ac_srcdir;; ++*) ++ case $ac_srcdir in ++ .) ac_abs_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; ++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_srcdir=$ac_top_srcdir;; ++*) ++ case $ac_top_srcdir in ++ .) ac_abs_top_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; ++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; ++ esac;; ++esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. +@@ -931,8 +965,7 @@ + if $ac_init_version; then + cat <<\_ACEOF + +-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +-Free Software Foundation, Inc. ++Copyright (C) 2003 Free Software Foundation, Inc. + This configure script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it. + _ACEOF +@@ -944,7 +977,7 @@ + running configure, to aid debugging if configure makes a mistake. + + It was created by $as_me, which was +-generated by GNU Autoconf 2.57. Invocation command line was ++generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +@@ -1120,7 +1153,7 @@ + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 +- rm -f core core.* *.core && ++ rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +@@ -2030,7 +2063,6 @@ + (exit $ac_status); } + + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2064,7 +2096,6 @@ + EXEEXT= + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2084,8 +2115,8 @@ + # Try to create an executable without -o first, disregard a.out. + # It will help us diagnose broken compilers, and finding out an intuition + # of exeext. +-echo "$as_me:$LINENO: checking for C compiler default output" >&5 +-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 ++echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 + ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 +@@ -2222,7 +2253,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2273,7 +2303,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2293,10 +2322,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -2310,7 +2349,7 @@ + + ac_compiler_gnu=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_c_compiler_gnu=$ac_compiler_gnu + + fi +@@ -2326,7 +2365,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2343,10 +2381,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -2360,7 +2408,7 @@ + + ac_cv_prog_cc_g=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 + echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +@@ -2387,7 +2435,6 @@ + ac_cv_prog_cc_stdc=no + ac_save_CC=$CC + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2415,6 +2462,16 @@ + va_end (v); + return s; + } ++ ++/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has ++ function prototypes and stuff, but not '\xHH' hex character constants. ++ These don't provoke an error unfortunately, instead are silently treated ++ as 'x'. The following induces an error, until -std1 is added to get ++ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an ++ array size at least. It's necessary to write '\x00'==0 to get something ++ that's true only with -std1. */ ++int osf4_cc_array ['\x00' == 0 ? 1 : -1]; ++ + int test (int i, double x); + struct s1 {int (*f) (int a);}; + struct s2 {int (*f) (double a);}; +@@ -2441,10 +2498,20 @@ + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -2458,7 +2525,7 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext ++rm -f conftest.err conftest.$ac_objext + done + rm -f conftest.$ac_ext conftest.$ac_objext + CC=$ac_save_CC +@@ -2486,10 +2553,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -2497,8 +2574,7 @@ + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ +- ''\ +- '#include ' \ ++ '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ +@@ -2506,14 +2582,13 @@ + 'void exit (int);' + do + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ +-#include + $ac_declaration ++#include + int + main () + { +@@ -2524,10 +2599,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -2541,9 +2626,8 @@ + + continue + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2560,10 +2644,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -2576,7 +2670,7 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done + rm -f conftest* + if test -n "$ac_declaration"; then +@@ -2590,7 +2684,7 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +@@ -2625,7 +2719,6 @@ + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2648,6 +2741,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -2668,7 +2762,6 @@ + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2686,6 +2779,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -2732,7 +2826,6 @@ + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2755,6 +2848,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -2775,7 +2869,6 @@ + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2793,6 +2886,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -2852,7 +2946,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -2946,7 +3039,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3009,10 +3101,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -3026,7 +3128,7 @@ + + ac_cv_c_const=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 + echo "${ECHO_T}$ac_cv_c_const" >&6 +@@ -3046,7 +3148,6 @@ + ac_cv_c_inline=no + for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3061,10 +3162,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -3077,21 +3188,25 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done + + fi + echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 + echo "${ECHO_T}$ac_cv_c_inline" >&6 ++ ++ + case $ac_cv_c_inline in + inline | yes) ;; +- no) +-cat >>confdefs.h <<\_ACEOF +-#define inline +-_ACEOF +- ;; +- *) cat >>confdefs.h <<_ACEOF +-#define inline $ac_cv_c_inline ++ *) ++ case $ac_cv_c_inline in ++ no) ac_val=;; ++ *) ac_val=$ac_cv_c_inline;; ++ esac ++ cat >>confdefs.h <<_ACEOF ++#ifndef __cplusplus ++#define inline $ac_val ++#endif + _ACEOF + ;; + esac +@@ -3104,7 +3219,6 @@ + ac_cv_c_bigendian=unknown + # See if sys/param.h defines the BYTE_ORDER macro. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3125,10 +3239,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -3137,7 +3261,6 @@ + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3158,10 +3281,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -3175,19 +3308,18 @@ + + ac_cv_c_bigendian=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + if test "$cross_compiling" = yes; then + echo $ac_n "cross-compiling... " 2>&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3224,7 +3356,7 @@ + ( exit $ac_status ) + ac_cv_c_bigendian=yes + fi +-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + fi +@@ -3244,7 +3376,7 @@ + int main() { _ascii (); _ebcdic (); return 0; } + EOF + if test -f conftest.c ; then +- if ${CC-cc} ${CFLAGS} conftest.c -o conftest.o && test -f conftest.o ; then ++ if ${CC-cc} ${CFLAGS} -c conftest.c -o conftest.o && test -f conftest.o ; then + if test `grep -l BIGenDianSyS conftest.o` ; then + echo $ac_n ' big endian probe OK, ' 1>&6 + ac_cv_c_bigendian=yes +@@ -3284,9 +3416,9 @@ + _ACEOF + + if test $ac_cv_c_bigendian = unknown; then +- { { echo "$as_me:$LINENO: error: unknown endianess - sorry" >&5 +-echo "$as_me: error: unknown endianess - sorry" >&2;} +- { (exit please pre-set ac_cv_c_bigendian); exit please pre-set ac_cv_c_bigendian; }; } ++ { { echo "$as_me:$LINENO: error: unknown endianess - sorry, please pre-set ac_cv_c_bigendian" >&5 ++echo "$as_me: error: unknown endianess - sorry, please pre-set ac_cv_c_bigendian" >&2;} ++ { (exit 1); exit 1; }; } + fi + + +@@ -3307,6 +3439,7 @@ + # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag + # AFS /usr/afsws/bin/install, which mishandles nonexistent args + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" ++# OS/2's system install, which has a completely different semantic + # ./install, which can be erroneously created by make from ./install.sh. + echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 + echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +@@ -3323,6 +3456,7 @@ + case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ++ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. +@@ -3413,7 +3547,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3431,6 +3564,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -3463,7 +3597,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3490,10 +3623,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -3507,7 +3650,7 @@ + + ac_cv_header_sys_wait_h=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 + echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 +@@ -3525,7 +3668,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3546,10 +3688,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -3563,7 +3715,7 @@ + + ac_cv_header_time=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 + echo "${ECHO_T}$ac_cv_header_time" >&6 +@@ -3582,7 +3734,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3599,10 +3750,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -3616,7 +3777,7 @@ + + libiberty_cv_declare_errno=yes + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $libiberty_cv_declare_errno" >&5 + echo "${ECHO_T}$libiberty_cv_declare_errno" >&6 +@@ -3650,7 +3811,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3671,10 +3831,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -3688,12 +3858,11 @@ + + ac_cv_header_stdc=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3715,7 +3884,6 @@ + if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3740,7 +3908,6 @@ + : + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3790,7 +3957,7 @@ + ( exit $ac_status ) + ac_cv_header_stdc=no + fi +-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + fi +@@ -3824,7 +3991,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3842,6 +4008,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -3875,7 +4042,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3895,10 +4061,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -3912,7 +4088,7 @@ + + ac_cv_type_uintptr_t=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 + echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 +@@ -3941,7 +4117,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -3961,10 +4136,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -3978,7 +4163,7 @@ + + ac_cv_type_pid_t=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 + echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +@@ -4139,7 +4324,6 @@ + { (exit 1); exit 1; }; } + fi + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4186,10 +4370,20 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -4203,7 +4397,8 @@ + + eval "$as_ac_var=no" + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +@@ -4250,12 +4445,54 @@ + # newlib provide and which ones we will be expected to provide. + + if test "x${with_newlib}" = "xyes"; then +- LIBOBJS="$LIBOBJS asprintf.$ac_objext" +- LIBOBJS="$LIBOBJS basename.$ac_objext" +- LIBOBJS="$LIBOBJS insque.$ac_objext" +- LIBOBJS="$LIBOBJS random.$ac_objext" +- LIBOBJS="$LIBOBJS strdup.$ac_objext" +- LIBOBJS="$LIBOBJS vasprintf.$ac_objext" ++ case $LIBOBJS in ++ "asprintf.$ac_objext" | \ ++ *" asprintf.$ac_objext" | \ ++ "asprintf.$ac_objext "* | \ ++ *" asprintf.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS asprintf.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "basename.$ac_objext" | \ ++ *" basename.$ac_objext" | \ ++ "basename.$ac_objext "* | \ ++ *" basename.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS basename.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "insque.$ac_objext" | \ ++ *" insque.$ac_objext" | \ ++ "insque.$ac_objext "* | \ ++ *" insque.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS insque.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "random.$ac_objext" | \ ++ *" random.$ac_objext" | \ ++ "random.$ac_objext "* | \ ++ *" random.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS random.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "strdup.$ac_objext" | \ ++ *" strdup.$ac_objext" | \ ++ "strdup.$ac_objext "* | \ ++ *" strdup.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS strdup.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "vasprintf.$ac_objext" | \ ++ *" vasprintf.$ac_objext" | \ ++ "vasprintf.$ac_objext "* | \ ++ *" vasprintf.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS vasprintf.$ac_objext" ;; ++esac ++ + + for f in $funcs; do + case "$f" in +@@ -4337,16 +4574,86 @@ + # Handle VxWorks configuration specially, since on VxWorks the + # libraries are actually on the target board, not in the file + # system. +- LIBOBJS="$LIBOBJS basename.$ac_objext" +- LIBOBJS="$LIBOBJS getpagesize.$ac_objext" +- LIBOBJS="$LIBOBJS insque.$ac_objext" +- LIBOBJS="$LIBOBJS random.$ac_objext" +- LIBOBJS="$LIBOBJS strcasecmp.$ac_objext" +- LIBOBJS="$LIBOBJS strncasecmp.$ac_objext" +- LIBOBJS="$LIBOBJS strdup.$ac_objext" +- LIBOBJS="$LIBOBJS vfork.$ac_objext" +- LIBOBJS="$LIBOBJS waitpid.$ac_objext" +- LIBOBJS="$LIBOBJS vasprintf.$ac_objext" ++ case $LIBOBJS in ++ "basename.$ac_objext" | \ ++ *" basename.$ac_objext" | \ ++ "basename.$ac_objext "* | \ ++ *" basename.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS basename.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "getpagesize.$ac_objext" | \ ++ *" getpagesize.$ac_objext" | \ ++ "getpagesize.$ac_objext "* | \ ++ *" getpagesize.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS getpagesize.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "insque.$ac_objext" | \ ++ *" insque.$ac_objext" | \ ++ "insque.$ac_objext "* | \ ++ *" insque.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS insque.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "random.$ac_objext" | \ ++ *" random.$ac_objext" | \ ++ "random.$ac_objext "* | \ ++ *" random.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS random.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "strcasecmp.$ac_objext" | \ ++ *" strcasecmp.$ac_objext" | \ ++ "strcasecmp.$ac_objext "* | \ ++ *" strcasecmp.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS strcasecmp.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "strncasecmp.$ac_objext" | \ ++ *" strncasecmp.$ac_objext" | \ ++ "strncasecmp.$ac_objext "* | \ ++ *" strncasecmp.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS strncasecmp.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "strdup.$ac_objext" | \ ++ *" strdup.$ac_objext" | \ ++ "strdup.$ac_objext "* | \ ++ *" strdup.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS strdup.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "vfork.$ac_objext" | \ ++ *" vfork.$ac_objext" | \ ++ "vfork.$ac_objext "* | \ ++ *" vfork.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS vfork.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "waitpid.$ac_objext" | \ ++ *" waitpid.$ac_objext" | \ ++ "waitpid.$ac_objext "* | \ ++ *" waitpid.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS waitpid.$ac_objext" ;; ++esac ++ ++ case $LIBOBJS in ++ "vasprintf.$ac_objext" | \ ++ *" vasprintf.$ac_objext" | \ ++ "vasprintf.$ac_objext "* | \ ++ *" vasprintf.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS vasprintf.$ac_objext" ;; ++esac ++ + for f in $funcs; do + case "$f" in + basename | getpagesize | insque | random | strcasecmp) +@@ -4399,7 +4706,14 @@ + if test -n "${with_target_subdir}" + then + funcs="`echo $funcs | sed -e 's/random//'`" +- LIBOBJS="$LIBOBJS random.$ac_objext" ++ case $LIBOBJS in ++ "random.$ac_objext" | \ ++ *" random.$ac_objext" | \ ++ "random.$ac_objext "* | \ ++ *" random.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS random.$ac_objext" ;; ++esac ++ + vars="`echo $vars | sed -e 's/sys_siglist//'`" + checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`" + fi +@@ -4448,7 +4762,6 @@ + { (exit 1); exit 1; }; } + fi + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4472,10 +4785,20 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -4488,7 +4811,8 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + if test "$ac_cv_search_strerror" = no; then + for ac_lib in cposix; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" +@@ -4498,7 +4822,6 @@ + { (exit 1); exit 1; }; } + fi + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4522,10 +4845,20 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -4539,7 +4872,8 @@ + sed 's/^/| /' conftest.$ac_ext >&5 + + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + done + fi + LIBS=$ac_func_search_save_LIBS +@@ -4566,7 +4900,6 @@ + { (exit 1); exit 1; }; } + fi + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4613,10 +4946,20 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -4630,7 +4973,8 @@ + + eval "$as_ac_var=no" + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +@@ -4640,7 +4984,14 @@ + _ACEOF + + else +- LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ++ case $LIBOBJS in ++ "$ac_func.$ac_objext" | \ ++ *" $ac_func.$ac_objext" | \ ++ "$ac_func.$ac_objext "* | \ ++ *" $ac_func.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; ++esac ++ + fi + done + +@@ -4651,7 +5002,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4689,7 +5039,6 @@ + { (exit 1); exit 1; }; } + fi + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4736,10 +5085,20 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -4753,7 +5112,8 @@ + + eval "$as_ac_var=no" + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +@@ -4777,7 +5137,6 @@ + ac_cv_c_stack_direction=0 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4820,7 +5179,7 @@ + ( exit $ac_status ) + ac_cv_c_stack_direction=-1 + fi +-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +@@ -4842,7 +5201,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4860,6 +5218,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -4902,7 +5261,6 @@ + { (exit 1); exit 1; }; } + fi + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -4949,10 +5307,20 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -4966,7 +5334,8 @@ + + eval "$as_ac_var=no" + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +@@ -5021,7 +5390,7 @@ + ( exit $ac_status ) + ac_cv_func_fork_works=no + fi +-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 +@@ -5054,7 +5423,6 @@ + ac_cv_func_vfork_works=cross + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -5176,7 +5544,7 @@ + ( exit $ac_status ) + ac_cv_func_vfork_works=no + fi +-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 +@@ -5184,7 +5552,7 @@ + + fi; + if test "x$ac_cv_func_fork_works" = xcross; then +- ac_cv_func_vfork_works=ac_cv_func_vfork ++ ac_cv_func_vfork_works=$ac_cv_func_vfork + { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 + echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} + fi +@@ -5211,7 +5579,14 @@ + fi + + if test $ac_cv_func_vfork_works = no; then +- LIBOBJS="$LIBOBJS vfork.$ac_objext" ++ case $LIBOBJS in ++ "vfork.$ac_objext" | \ ++ *" vfork.$ac_objext" | \ ++ "vfork.$ac_objext "* | \ ++ *" vfork.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS vfork.$ac_objext" ;; ++esac ++ + fi + # We only need _doprnt if we might use it to implement v*printf. + if test $ac_cv_func_vprintf != yes \ +@@ -5232,7 +5607,6 @@ + { (exit 1); exit 1; }; } + fi + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -5279,10 +5653,20 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -5296,7 +5680,8 @@ + + eval "$as_ac_var=no" + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +@@ -5306,7 +5691,14 @@ + _ACEOF + + else +- LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ++ case $LIBOBJS in ++ "$ac_func.$ac_objext" | \ ++ *" $ac_func.$ac_objext" | \ ++ "$ac_func.$ac_objext "* | \ ++ *" $ac_func.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; ++esac ++ + fi + done + +@@ -5327,7 +5719,6 @@ + { (exit 1); exit 1; }; } + fi + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -5374,10 +5765,20 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -5391,7 +5792,8 @@ + + eval "$as_ac_var=no" + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +@@ -5417,7 +5819,6 @@ + { (exit 1); exit 1; }; } + fi + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -5434,10 +5835,20 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -5451,7 +5862,8 @@ + + eval "libiberty_cv_var_$v=no" + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + fi + + if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then +@@ -5473,7 +5885,6 @@ + echo "$as_me:$LINENO: checking for external symbol _system_configuration" >&5 + echo $ECHO_N "checking for external symbol _system_configuration... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -5490,10 +5901,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -5514,7 +5935,7 @@ + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + + for ac_func in $checkfuncs +@@ -5531,7 +5952,6 @@ + { (exit 1); exit 1; }; } + fi + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -5578,10 +5998,20 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -5595,7 +6025,8 @@ + + eval "$as_ac_var=no" + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +@@ -5613,7 +6044,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -5645,10 +6075,20 @@ + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 ++ (eval $ac_compile) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -5662,7 +6102,7 @@ + + libiberty_cv_decl_needed_canonicalize_file_name=yes + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + + echo "$as_me:$LINENO: result: $libiberty_cv_decl_needed_canonicalize_file_name" >&5 +@@ -5679,11 +6119,11 @@ + + # Figure out which version of pexecute to use. + case "${host}" in +- *-*-mingw* | *-*-winnt*) pexecute=pex-win32.o ;; +- *-*-msdosdjgpp*) pexecute=pex-djgpp.o ;; +- *-*-msdos*) pexecute=pex-msdos.o ;; +- *-*-os2-emx*) pexecute=pex-os2.o ;; +- *) pexecute=pex-unix.o ;; ++ *-*-mingw* | *-*-winnt*) pexecute="./pex-win32.o ./pexrd-generic.o" ;; ++ *-*-msdosdjgpp*) pexecute="./pex-djgpp.o ./pexrd-generic.o" ;; ++ *-*-msdos*) pexecute="./pex-msdos.o ./pexrd-generic.o" ;; ++ *-*-os2-emx*) pexecute="./pex-os2.o ./pexrd-generic.o" ;; ++ *) pexecute="./pex-unix.o ./pexrd-unix.o" ;; + esac + + +@@ -5704,7 +6144,6 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -5722,6 +6161,7 @@ + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +@@ -5763,7 +6203,6 @@ + { (exit 1); exit 1; }; } + fi + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -5810,10 +6249,20 @@ + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 ++ (eval $ac_link) 2>conftest.er1 + ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 +@@ -5827,7 +6276,8 @@ + + eval "$as_ac_var=no" + fi +-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +@@ -5848,7 +6298,6 @@ + ac_cv_func_mmap_fixed_mapped=no + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -5956,7 +6405,7 @@ + data2 = (char *) malloc (2 * pagesize); + if (!data2) + exit (1); +- data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); ++ data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + exit (1); +@@ -6001,7 +6450,7 @@ + ( exit $ac_status ) + ac_cv_func_mmap_fixed_mapped=no + fi +-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 +@@ -6026,7 +6475,6 @@ + ac_cv_func_strncmp_works=no + else + cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext +@@ -6114,14 +6562,21 @@ + ( exit $ac_status ) + ac_cv_func_strncmp_works=no + fi +-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + rm -f core core.* *.core + fi + echo "$as_me:$LINENO: result: $ac_cv_func_strncmp_works" >&5 + echo "${ECHO_T}$ac_cv_func_strncmp_works" >&6 + if test $ac_cv_func_strncmp_works = no ; then +- LIBOBJS="$LIBOBJS strncmp.$ac_objext" ++ case $LIBOBJS in ++ "strncmp.$ac_objext" | \ ++ *" strncmp.$ac_objext" | \ ++ "strncmp.$ac_objext "* | \ ++ *" strncmp.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS strncmp.$ac_objext" ;; ++esac ++ + fi + + +@@ -6134,6 +6589,16 @@ + fi + + ++ ++L="" ++for l in x $LIBOBJS; do ++ case $l in ++ x) ;; ++ *) L="$L ./$l" ;; ++ esac ++done ++LIBOBJS="$L" ++ + # We need multilib support, but only if configuring for the target. + ac_config_files="$ac_config_files Makefile testsuite/Makefile" + ac_config_commands="$ac_config_commands default" +@@ -6262,9 +6727,10 @@ + elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix + fi ++DUALCASE=1; export DUALCASE # for MKS sh + + # Support unset when possible. +-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset + else + as_unset=false +@@ -6283,7 +6749,7 @@ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME + do +- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then ++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var +@@ -6462,16 +6928,17 @@ + if mkdir -p . 2>/dev/null; then + as_mkdir_p=: + else ++ test -d ./-p && rmdir ./-p + as_mkdir_p=false + fi + + as_executable_p="test -f" + + # Sed expression to map a string onto a valid CPP name. +-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" ++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + + # Sed expression to map a string onto a valid variable name. +-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" ++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + # IFS +@@ -6498,7 +6965,7 @@ + cat >&5 <<_CSEOF + + This file was extended by $as_me, which was +-generated by GNU Autoconf 2.57. Invocation command line was ++generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS +@@ -6561,11 +7028,10 @@ + cat >>$CONFIG_STATUS <<_ACEOF + ac_cs_version="\\ + config.status +-configured by $0, generated by GNU Autoconf 2.57, ++configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +-Free Software Foundation, Inc. ++Copyright (C) 2003 Free Software Foundation, Inc. + This config.status script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it." + srcdir=$srcdir +@@ -6932,12 +7398,45 @@ + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; + esac +-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +-# absolute. +-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` ++ ++# Do not use `cd foo && pwd` to compute absolute paths, because ++# the directories may not exist. ++case `pwd` in ++.) ac_abs_builddir="$ac_dir";; ++*) ++ case "$ac_dir" in ++ .) ac_abs_builddir=`pwd`;; ++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; ++ *) ac_abs_builddir=`pwd`/"$ac_dir";; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_builddir=${ac_top_builddir}.;; ++*) ++ case ${ac_top_builddir}. in ++ .) ac_abs_top_builddir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; ++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_srcdir=$ac_srcdir;; ++*) ++ case $ac_srcdir in ++ .) ac_abs_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; ++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_srcdir=$ac_top_srcdir;; ++*) ++ case $ac_top_srcdir in ++ .) ac_abs_top_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; ++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; ++ esac;; ++esac + + + case $INSTALL in +@@ -6972,14 +7471,14 @@ + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } +- echo $f;; ++ echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree +- echo $f ++ echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree +- echo $srcdir/$f ++ echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +@@ -7063,14 +7562,15 @@ + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } +- echo $f;; ++ # Do quote $f, to prevent DOS paths from being IFS'd. ++ echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree +- echo $f ++ echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree +- echo $srcdir/$f ++ echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +@@ -7259,6 +7759,31 @@ + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` ++ { if $as_mkdir_p; then ++ mkdir -p "$ac_dir" ++ else ++ as_dir="$ac_dir" ++ as_dirs= ++ while test ! -d "$as_dir"; do ++ as_dirs="$as_dir $as_dirs" ++ as_dir=`(dirname "$as_dir") 2>/dev/null || ++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ++ X"$as_dir" : 'X\(//\)[^/]' \| \ ++ X"$as_dir" : 'X\(//\)$' \| \ ++ X"$as_dir" : 'X\(/\)' \| \ ++ . : '\(.\)' 2>/dev/null || ++echo X"$as_dir" | ++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } ++ /^X\(\/\/\)[^/].*/{ s//\1/; q; } ++ /^X\(\/\/\)$/{ s//\1/; q; } ++ /^X\(\/\).*/{ s//\1/; q; } ++ s/.*/./; q'` ++ done ++ test ! -n "$as_dirs" || mkdir $as_dirs ++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 ++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} ++ { (exit 1); exit 1; }; }; } ++ + ac_builddir=. + + if test "$ac_dir" != .; then +@@ -7284,12 +7809,45 @@ + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; + esac +-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +-# absolute. +-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` ++ ++# Do not use `cd foo && pwd` to compute absolute paths, because ++# the directories may not exist. ++case `pwd` in ++.) ac_abs_builddir="$ac_dir";; ++*) ++ case "$ac_dir" in ++ .) ac_abs_builddir=`pwd`;; ++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; ++ *) ac_abs_builddir=`pwd`/"$ac_dir";; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_builddir=${ac_top_builddir}.;; ++*) ++ case ${ac_top_builddir}. in ++ .) ac_abs_top_builddir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; ++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_srcdir=$ac_srcdir;; ++*) ++ case $ac_srcdir in ++ .) ac_abs_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; ++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; ++ esac;; ++esac ++case $ac_abs_builddir in ++.) ac_abs_top_srcdir=$ac_top_srcdir;; ++*) ++ case $ac_top_srcdir in ++ .) ac_abs_top_srcdir=$ac_abs_builddir;; ++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; ++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; ++ esac;; ++esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +diff -Nbaur gcc-3.4.3/libiberty/configure.ac gcc-3.4.3-new/libiberty/configure.ac +--- gcc-3.4.3/libiberty/configure.ac Sat Jan 10 02:17:41 2004 ++++ gcc-3.4.3-new/libiberty/configure.ac Fri Jan 21 10:25:52 2005 +@@ -1,7 +1,8 @@ + dnl Process this file with autoconf to produce a configure script + +-AC_PREREQ(2.57) +-AC_INIT(xmalloc.c) ++AC_PREREQ(2.59) ++AC_INIT ++AC_CONFIG_SRCDIR([xmalloc.c]) + + # This works around the fact that libtool configuration may change LD + # for this particular configuration, but some shells, instead of +@@ -433,7 +434,7 @@ + AC_ISC_POSIX + AC_REPLACE_FUNCS($funcs) + libiberty_AC_FUNC_C_ALLOCA +- AC_FUNC_VFORK ++ AC_FUNC_FORK + if test $ac_cv_func_vfork_works = no; then + AC_LIBOBJ([vfork]) + fi +@@ -449,7 +450,7 @@ + for v in $vars; do + AC_MSG_CHECKING([for $v]) + AC_CACHE_VAL(libiberty_cv_var_$v, +- [AC_TRY_LINK([int *p;], [extern int $v []; p = $v;], ++ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])], + [eval "libiberty_cv_var_$v=yes"], + [eval "libiberty_cv_var_$v=no"])]) + if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then +@@ -464,8 +465,8 @@ + # special check for _system_configuration because AIX <4.3.2 do not + # contain the `physmem' member. + AC_MSG_CHECKING([for external symbol _system_configuration]) +- AC_TRY_COMPILE([#include ], +- [double x = _system_configuration.physmem;], ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], ++ [[double x = _system_configuration.physmem;]])], + [AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, + [Define if you have the _system_configuration variable.])], +@@ -477,11 +478,11 @@ + + # Figure out which version of pexecute to use. + case "${host}" in +- *-*-mingw* | *-*-winnt*) pexecute=pex-win32.o ;; +- *-*-msdosdjgpp*) pexecute=pex-djgpp.o ;; +- *-*-msdos*) pexecute=pex-msdos.o ;; +- *-*-os2-emx*) pexecute=pex-os2.o ;; +- *) pexecute=pex-unix.o ;; ++ *-*-mingw* | *-*-winnt*) pexecute="./pex-win32.o ./pexrd-generic.o" ;; ++ *-*-msdosdjgpp*) pexecute="./pex-djgpp.o ./pexrd-generic.o" ;; ++ *-*-msdos*) pexecute="./pex-msdos.o ./pexrd-generic.o" ;; ++ *-*-os2-emx*) pexecute="./pex-os2.o ./pexrd-generic.o" ;; ++ *) pexecute="./pex-unix.o ./pexrd-unix.o" ;; + esac + AC_SUBST(pexecute) + +@@ -496,9 +497,20 @@ + fi + AC_SUBST(INSTALL_DEST) + ++m4_pattern_allow(LIBOBJS) ++L="" ++for l in x $LIBOBJS; do ++ case $l in ++ x) ;; ++ *) L="$L ./$l" ;; ++ esac ++done ++LIBOBJS="$L" ++ + # We need multilib support, but only if configuring for the target. +-AC_OUTPUT(Makefile testsuite/Makefile, +-[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ++AC_CONFIG_FILES([Makefile testsuite/Makefile]) ++AC_CONFIG_COMMANDS([default], ++ [[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h + if test -n "$CONFIG_FILES"; then + if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then + # FIXME: We shouldn't need to set ac_file +@@ -506,8 +518,8 @@ + LD="${ORIGINAL_LD_FOR_MULTILIBS}" + . ${libiberty_topdir}/config-ml.in + fi +-fi], +-srcdir=${srcdir} ++fi]], ++[[srcdir=${srcdir} + host=${host} + target=${target} + with_target_subdir=${with_target_subdir} +@@ -517,4 +529,5 @@ + CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" + libiberty_topdir=${libiberty_topdir} +-) ++]]) ++AC_OUTPUT +diff -Nbaur gcc-3.4.3/libiberty/dyn-string.c gcc-3.4.3-new/libiberty/dyn-string.c +--- gcc-3.4.3/libiberty/dyn-string.c Mon Apr 1 22:55:12 2002 ++++ gcc-3.4.3-new/libiberty/dyn-string.c Fri Jan 21 10:25:52 2005 +@@ -1,5 +1,5 @@ + /* An abstract string datatype. +- Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. ++ Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc. + Contributed by Mark Mitchell (mark@markmitchell.com). + + This file is part of GNU CC. +@@ -44,15 +44,6 @@ + + #include "libiberty.h" + #include "dyn-string.h" +- +-/* If this file is being compiled for inclusion in the C++ runtime +- library, as part of the demangler implementation, we don't want to +- abort if an allocation fails. Instead, percolate an error code up +- through the call chain. */ +- +-#if defined(IN_LIBGCC2) || defined(IN_GLIBCPP_V3) +-#define RETURN_ON_ALLOCATION_FAILURE +-#endif + + /* Performs in-place initialization of a dyn_string struct. This + function can be used with a dyn_string struct on the stack or +diff -Nbaur gcc-3.4.3/libiberty/getpwd.c gcc-3.4.3-new/libiberty/getpwd.c +--- gcc-3.4.3/libiberty/getpwd.c Sun Oct 7 22:53:31 2001 ++++ gcc-3.4.3-new/libiberty/getpwd.c Fri Jan 21 10:25:52 2005 +@@ -35,6 +35,9 @@ + #if HAVE_SYS_STAT_H + #include + #endif ++#if HAVE_LIMITS_H ++#include ++#endif + + /* Prototype these in case the system headers don't provide them. */ + extern char *getpwd (); +diff -Nbaur gcc-3.4.3/libiberty/maint-tool gcc-3.4.3-new/libiberty/maint-tool +--- gcc-3.4.3/libiberty/maint-tool Tue Apr 15 20:21:38 2003 ++++ gcc-3.4.3-new/libiberty/maint-tool Fri Jan 21 10:25:52 2005 +@@ -213,6 +213,12 @@ + + sub deps { + ++ $crule = "\tif [ x\"\$(PICFLAG)\" != x ]; then \\\n"; ++ $crule .= "\t \$(COMPILE.c) \$(PICFLAG) \$< -o pic/\$@; \\\n"; ++ $crule .= "\telse true; fi\n"; ++ $crule .= "\t\$(COMPILE.c) \$< \$(OUTPUT_OPTION)\n"; ++ $crule .= "\n"; ++ + $incdir = shift @ARGV; + + opendir(INC, $incdir); +@@ -260,10 +266,10 @@ + @deps = sort { &locals_first($a,$b) } keys %scanned; + $obj = $f; + $obj =~ s/\.c$/.o/; +- $obj = "$obj:"; ++ $obj = "./$obj:"; + if ($#deps >= 0) { +- print OUT $obj; +- $len = length($obj); ++ print OUT "$obj \$(srcdir)/$f"; ++ $len = length("$obj $f"); + for $dt (@deps) { + $d = $mine{$dt}; + if ($len + length($d) > 70) { +@@ -275,7 +281,12 @@ + } + } + print OUT "\n"; ++ } else { ++ print OUT "$obj \$(srcdir)/$f\n"; + } ++ $c = $crule; ++ $c =~ s@\$\<@\$\(srcdir\)\/$f@g; ++ print OUT $c; + } + } + closedir(S); +diff -Nbaur gcc-3.4.3/libiberty/pex-common.h gcc-3.4.3-new/libiberty/pex-common.h +--- gcc-3.4.3/libiberty/pex-common.h Fri Jan 24 20:02:11 2003 ++++ gcc-3.4.3-new/libiberty/pex-common.h Fri Jan 21 10:25:52 2005 +@@ -1,6 +1,6 @@ + /* Utilities to execute a program in a subprocess (possibly linked by pipes + with other subprocesses), and wait for it. Shared logic. +- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 ++ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 + Free Software Foundation, Inc. + + This file is part of the libiberty library. +@@ -32,6 +32,9 @@ + + /* stdout file number. */ + #define STDOUT_FILE_NO 1 ++ ++/* stderr file number. */ ++#define STDERR_FILE_NO 2 + + /* value of `pipe': port index for reading. */ + #define READ_PORT 0 +diff -Nbaur gcc-3.4.3/libiberty/pex-unix.c gcc-3.4.3-new/libiberty/pex-unix.c +--- gcc-3.4.3/libiberty/pex-unix.c Fri Jan 24 20:02:11 2003 ++++ gcc-3.4.3-new/libiberty/pex-unix.c Fri Jan 21 10:25:52 2005 +@@ -1,7 +1,7 @@ + /* Utilities to execute a program in a subprocess (possibly linked by pipes + with other subprocesses), and wait for it. Generic Unix version + (also used for UWIN and VMS). +- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 ++ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 + Free Software Foundation, Inc. + + This file is part of the libiberty library. +@@ -44,28 +44,66 @@ + #define waitpid(pid, status, flags) wait(status) + #endif + +-extern int execv (); +-extern int execvp (); ++#ifdef vfork /* Autoconf may define this to fork for us. */ ++# define VFORK_STRING "fork" ++#else ++# define VFORK_STRING "vfork" ++#endif ++#ifdef HAVE_VFORK_H ++#include ++#endif ++#ifdef VMS ++#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \ ++ lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1) ++#endif /* VMS */ ++ ++/* Execute a program, possibly setting up pipes to programs executed ++ via other calls to this function. ++ ++ This version of the function uses vfork. In general vfork is ++ similar to setjmp/longmp, in that any variable which is modified by ++ the child process has an indeterminate value in the parent process. ++ We follow a safe approach here by not modifying any variables at ++ all in the child process (with the possible exception of variables ++ modified by xstrerror if exec fails, but this is unlikely to be ++ detectable). ++ ++ We work a little bit harder to avoid gcc warnings. gcc will warn ++ about any automatic variable which is live at the time of the ++ vfork, which is non-volatile, and which is either set more than ++ once or is an argument to the function. This warning isn't quite ++ right, since what we really care about is whether the variable is ++ live at the time of the vfork and set afterward by the child ++ process, but gcc only checks whether the variable is set more than ++ once. To avoid this warning, we ensure that any variable which is ++ live at the time of the vfork (i.e., used after the vfork) is set ++ exactly once and is not an argument, or is marked volatile. */ + + int +-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) ++pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, ++ flagsarg) + const char *program; + char * const *argv; + const char *this_pname; + const char *temp_base ATTRIBUTE_UNUSED; + char **errmsg_fmt, **errmsg_arg; +- int flags; ++ int flagsarg; + { +- int (*func)() = (flags & PEXECUTE_SEARCH ? execvp : execv); + int pid; + int pdes[2]; ++ int out; + int input_desc, output_desc; +- int retries, sleep_interval; ++ int flags; ++ /* We declare these to be volatile to avoid warnings from gcc about ++ them being clobbered by vfork. */ ++ volatile int retries, sleep_interval; + /* Pipe waiting from last process, to be used as input for the next one. + Value is STDIN_FILE_NO if no pipe is waiting + (i.e. the next command is the first of a group). */ + static int last_pipe_input; + ++ flags = flagsarg; ++ + /* If this is the first process, initialize. */ + if (flags & PEXECUTE_FIRST) + last_pipe_input = STDIN_FILE_NO; +@@ -82,22 +120,24 @@ + *errmsg_arg = NULL; + return -1; + } +- output_desc = pdes[WRITE_PORT]; ++ out = pdes[WRITE_PORT]; + last_pipe_input = pdes[READ_PORT]; + } + else + { + /* Last process. */ +- output_desc = STDOUT_FILE_NO; ++ out = STDOUT_FILE_NO; + last_pipe_input = STDIN_FILE_NO; + } + ++ output_desc = out; ++ + /* Fork a subprocess; wait and retry if it fails. */ + sleep_interval = 1; + pid = -1; + for (retries = 0; retries < 4; retries++) + { +- pid = fork (); ++ pid = vfork (); + if (pid >= 0) + break; + sleep (sleep_interval); +@@ -131,12 +171,21 @@ + close (last_pipe_input); + + /* Exec the program. */ +- (*func) (program, argv); ++ if (flags & PEXECUTE_SEARCH) ++ execvp (program, argv); ++ else ++ execv (program, argv); + +- fprintf (stderr, "%s: ", this_pname); +- fprintf (stderr, install_error_msg, program); +- fprintf (stderr, ": %s\n", xstrerror (errno)); +- exit (-1); ++ /* We don't want to call fprintf after vfork. */ ++#define writeerr(s) write (STDERR_FILE_NO, s, strlen (s)) ++ writeerr (this_pname); ++ writeerr (": "); ++ writeerr ("installation problem, cannot exec '"); ++ writeerr (program); ++ writeerr ("': "); ++ writeerr (xstrerror (errno)); ++ writeerr ("\n"); ++ _exit (-1); + /* NOTREACHED */ + return 0; + +diff -Nbaur gcc-3.4.3/libiberty/pexecute.txh gcc-3.4.3-new/libiberty/pexecute.txh +--- gcc-3.4.3/libiberty/pexecute.txh Fri Jan 24 20:02:11 2003 ++++ gcc-3.4.3-new/libiberty/pexecute.txh Fri Jan 21 10:25:52 2005 +@@ -1,4 +1,4 @@ +-@deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int flags) ++@deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int @var{flags}) + + Executes a program. + +@@ -61,3 +61,39 @@ + + pfinish is necessary for systems like MPW where a script is generated + that runs the requested programs. ++ ++@end undocumented ++ ++@deftypefn Extension FILE* pex_read (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int @var{flags}, int *@var{pidptr}) ++ ++Executes a program and returns a stdio file for the program's standard ++output. This is a safe version of the usual Unix function ++@code{popen}. ++ ++The first seven parameters are the same as for @code{pexecute}. The ++last parameter returns a process identifier to be passed to ++@code{pex_read_close}. ++ ++The only flags used for the @var{flags} parameter is ++@code{PEXECUTE_SEARCH}. ++ ++Upon failure, @var{errmsg_fmt} and @var{errmsg_arg} are set to the ++text of the error message with an optional argument (if not needed, ++@var{errmsg_arg} is set to @code{NULL}), and @code{NULL} is returned. ++@code{errno} is available to the caller to use. ++ ++@end deftypefn ++ ++@deftypefn Extension int pex_read_close (int @var{pid}, FILE *@var{file}, int *@var{status}, int @var{flags}) ++ ++Close a file opened by @code{pex_read}, and wait for the subprocess to ++complete. The @var{pid} and @var{file} arguments should have been ++obtained from a call to @code{pex_read}. ++ ++The result is the pid of the child reaped, or -1 for failure ++(@code{errno} says why). ++ ++On a successful return, *@var{status} is set to the exit status of the ++subprocess. ++ ++@end deftypefn +diff -Nbaur gcc-3.4.3/libiberty/pexrd-generic.c gcc-3.4.3-new/libiberty/pexrd-generic.c +--- gcc-3.4.3/libiberty/pexrd-generic.c Thu Jan 1 00:00:00 1970 ++++ gcc-3.4.3-new/libiberty/pexrd-generic.c Fri Jan 21 10:25:52 2005 +@@ -0,0 +1,72 @@ ++/* Execute a program and read stdout. Generic version. ++ Copyright (C) 2004 Free Software Foundation, Inc. ++ ++This file is part of the libiberty library. ++Libiberty is free software; you can redistribute it and/or ++modify it under the terms of the GNU Library General Public ++License as published by the Free Software Foundation; either ++version 2 of the License, or (at your option) any later version. ++ ++Libiberty is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++Library General Public License for more details. ++ ++You should have received a copy of the GNU Library General Public ++License along with libiberty; see the file COPYING.LIB. If not, ++write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++#include "pex-common.h" ++#include "pex-read.h" ++ ++#include ++#ifdef NEED_DECLARATION_ERRNO ++extern int errno; ++#endif ++#ifdef HAVE_STDLIB_H ++#include ++#endif ++ ++FILE * ++pex_read (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags, ++ pidptr) ++ const char *program; ++ char * const *argv; ++ const char *this_pname ATTRIBUTE_UNUSED; ++ const char *temp_base ATTRIBUTE_UNUSED; ++ char **errmsg_fmt; ++ char **errmsg_arg; ++ int flags ATTRIBUTE_UNUSED; ++ int *pidptr ATTRIBUTE_UNUSED; ++{ ++ char *cmd; ++ int i; ++ FILE *ret; ++ ++ cmd = xstrdup (program); ++ for (i = 0; argv[i] != NULL; ++i) ++ cmd = reconcat (cmd, cmd, " ", argv[i], NULL); ++ ++ ret = popen (cmd, "r"); ++ if (ret == NULL) ++ { ++ *errmsg_fmt = "popen"; ++ *errmsg_arg = NULL; ++ } ++ ++ free (cmd); ++ ++ return ret; ++} ++ ++int ++pex_read_close (pid, file, status, flags) ++ int pid ATTRIBUTE_UNUSED; ++ FILE *file; ++ int *status; ++ int flags ATTRIBUTE_UNUSED; ++{ ++ *status = pclose (file); ++ return 0; ++} +diff -Nbaur gcc-3.4.3/libiberty/pexrd-unix.c gcc-3.4.3-new/libiberty/pexrd-unix.c +--- gcc-3.4.3/libiberty/pexrd-unix.c Thu Jan 1 00:00:00 1970 ++++ gcc-3.4.3-new/libiberty/pexrd-unix.c Fri Jan 21 10:25:52 2005 +@@ -0,0 +1,164 @@ ++/* Execute a program and read stdout. Generic Unix version. ++ Copyright (C) 2004 Free Software Foundation, Inc. ++ ++This file is part of the libiberty library. ++Libiberty is free software; you can redistribute it and/or ++modify it under the terms of the GNU Library General Public ++License as published by the Free Software Foundation; either ++version 2 of the License, or (at your option) any later version. ++ ++Libiberty is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++Library General Public License for more details. ++ ++You should have received a copy of the GNU Library General Public ++License along with libiberty; see the file COPYING.LIB. If not, ++write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++#include "pex-common.h" ++ ++#include ++#include ++#ifdef NEED_DECLARATION_ERRNO ++extern int errno; ++#endif ++#ifdef HAVE_STRING_H ++#include ++#endif ++#ifdef HAVE_STDLIB_H ++#include ++#endif ++#if HAVE_UNISTD_H ++#include ++#endif ++#ifdef HAVE_SYS_WAIT_H ++#include ++#endif ++ ++#ifndef HAVE_WAITPID ++#define waitpid(pid, status, flags) wait(status) ++#endif ++ ++#ifdef vfork /* Autoconf may define this to fork for us. */ ++# define VFORK_STRING "fork" ++#else ++# define VFORK_STRING "vfork" ++#endif ++#ifdef HAVE_VFORK_H ++#include ++#endif ++#ifdef VMS ++#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \ ++ lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1) ++#endif /* VMS */ ++ ++/* A safe version of popen. See pex-unix.c for notes on vfork. */ ++ ++FILE * ++pex_read (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, ++ flagsarg, pidptr) ++ const char *program; ++ char * const *argv; ++ const char *this_pname; ++ const char *temp_base ATTRIBUTE_UNUSED; ++ char **errmsg_fmt; ++ char **errmsg_arg; ++ int flagsarg; ++ int *pidptr; ++{ ++ int flags; ++ int pid; ++ int pdes[2]; ++ int in; ++ int out; ++ FILE *ret; ++ /* We declare these to be volatile to avoid warnings from gcc about ++ them being clobbered by vfork. */ ++ volatile int retries; ++ volatile int sleep_interval; ++ ++ flags = flagsarg; ++ ++ if (pipe (pdes) < 0) ++ { ++ *errmsg_fmt = "pipe"; ++ *errmsg_arg = NULL; ++ return NULL; ++ } ++ ++ in = pdes[READ_PORT]; ++ out = pdes[WRITE_PORT]; ++ ++ sleep_interval = 1; ++ pid = -1; ++ for (retries = 0; retries < 4; retries++) ++ { ++ pid = vfork (); ++ if (pid >= 0) ++ break; ++ sleep (sleep_interval); ++ sleep_interval *= 2; ++ } ++ ++ switch (pid) ++ { ++ case -1: ++ *errmsg_fmt = "fork"; ++ *errmsg_arg = NULL; ++ return NULL; ++ ++ case 0: ++ if (out != STDOUT_FILE_NO) ++ { ++ close (STDOUT_FILE_NO); ++ dup (out); ++ close (out); ++ } ++ close (in); ++ ++ if (flags & PEXECUTE_SEARCH) ++ execvp (program, argv); ++ else ++ execv (program, argv); ++ ++ /* We don't want to call fprintf after vfork. */ ++#define writeerr(s) write (STDERR_FILE_NO, s, strlen (s)) ++ writeerr (this_pname); ++ writeerr (": "); ++ writeerr ("installation problem, cannot exec '"); ++ writeerr (program); ++ writeerr ("': "); ++ writeerr (xstrerror (errno)); ++ writeerr ("\n"); ++ _exit (-1); ++ /* NOTREACHED */ ++ return NULL; ++ ++ default: ++ close (out); ++ ret = fdopen (in, "r"); ++ if (ret == NULL) ++ { ++ *errmsg_fmt = "fdopen"; ++ *errmsg_arg = NULL; ++ return NULL; ++ } ++ *pidptr = pid; ++ return ret; ++ } ++ /* NOTREACHED */ ++} ++ ++int ++pex_read_close (pid, file, status, flags) ++ int pid; ++ FILE *file; ++ int *status; ++ int flags ATTRIBUTE_UNUSED; ++{ ++ /* ??? Canonicalize STATUS value? */ ++ fclose (file); ++ return waitpid (pid, status, 0); ++} +diff -Nbaur gcc-3.4.3/libiberty/regex.c gcc-3.4.3-new/libiberty/regex.c +--- gcc-3.4.3/libiberty/regex.c Tue Apr 15 15:24:26 2003 ++++ gcc-3.4.3-new/libiberty/regex.c Fri Jan 21 10:25:52 2005 +@@ -36,6 +36,8 @@ + # include + #endif + ++#include ++ + #ifndef PARAMS + # if defined __GNUC__ || (defined __STDC__ && __STDC__) + # define PARAMS(args) args +@@ -8040,7 +8042,7 @@ + + /* Map uppercase characters to corresponding lowercase ones. */ + for (i = 0; i < CHAR_SET_SIZE; i++) +- preg->translate[i] = ISUPPER (i) ? TOLOWER (i) : i; ++ preg->translate[i] = ISUPPER (i) ? TOLOWER (i) : (int) i; + } + else + preg->translate = NULL; +@@ -8175,7 +8177,7 @@ + size_t + regerror (errcode, preg, errbuf, errbuf_size) + int errcode; +- const regex_t *preg; ++ const regex_t *preg ATTRIBUTE_UNUSED; + char *errbuf; + size_t errbuf_size; + { +diff -Nbaur gcc-3.4.3/libiberty/strerror.c gcc-3.4.3-new/libiberty/strerror.c +--- gcc-3.4.3/libiberty/strerror.c Thu Oct 2 20:06:29 2003 ++++ gcc-3.4.3-new/libiberty/strerror.c Fri Jan 21 10:25:52 2005 +@@ -2,9 +2,6 @@ + Written by Fred Fish. fnf@cygnus.com + This file is in the public domain. --Per Bothner. */ + +-#include "ansidecl.h" +-#include "libiberty.h" +- + #include "config.h" + + #ifdef HAVE_SYS_ERRLIST +@@ -17,6 +14,9 @@ + #define sys_errlist sys_errlist__ + #endif + ++#include "ansidecl.h" ++#include "libiberty.h" ++ + #include + #include + +@@ -469,8 +469,10 @@ + + #else + ++#ifndef __MINGW32__ + extern int sys_nerr; + extern char *sys_errlist[]; ++#endif + + #endif + +diff -Nbaur gcc-3.4.3/libiberty/testsuite/test-demangle.c gcc-3.4.3-new/libiberty/testsuite/test-demangle.c +--- gcc-3.4.3/libiberty/testsuite/test-demangle.c Fri Jan 2 20:33:55 2004 ++++ gcc-3.4.3-new/libiberty/testsuite/test-demangle.c Fri Jan 21 10:25:52 2005 +@@ -26,6 +26,12 @@ + #include + #include "libiberty.h" + #include "demangle.h" ++#ifdef HAVE_STRING_H ++#include ++#endif ++#if HAVE_STDLIB_H ++# include ++#endif + + struct line + { +@@ -119,7 +125,7 @@ + int argc; + char **argv; + { +- enum demangling_styles style; ++ enum demangling_styles style = auto_demangling; + int no_params; + int is_v3_ctor; + int is_v3_dtor; +diff -Nbaur gcc-3.4.3/libstdc++-v3/config/os/mingw32/os_defines.h gcc-3.4.3-new/libstdc++-v3/config/os/mingw32/os_defines.h +--- gcc-3.4.3/libstdc++-v3/config/os/mingw32/os_defines.h Sat Jul 5 05:05:32 2003 ++++ gcc-3.4.3-new/libstdc++-v3/config/os/mingw32/os_defines.h Fri Jan 21 10:25:52 2005 +@@ -45,4 +45,11 @@ + #undef NOMINMAX + #define NOMINMAX 1 + ++// mingw32 local hack: Override _GLIBCXX_USE_WCHAR_T for wstring ++#define _GLIBCXX_USE_WSTRING 1 ++ ++// mingw32 local hack: Cast long double to doubles to workaround ++// printf bug. ++#define _GLIBCXX_NO_LONG_DOUBLE_IO 1 ++ + #endif +diff -Nbaur gcc-3.4.3/libstdc++-v3/configure.host gcc-3.4.3-new/libstdc++-v3/configure.host +--- gcc-3.4.3/libstdc++-v3/configure.host Tue Oct 5 17:32:49 2004 ++++ gcc-3.4.3-new/libstdc++-v3/configure.host Fri Jan 21 10:25:52 2005 +@@ -180,6 +180,7 @@ + ;; + mingw32*) + os_include_dir="os/mingw32" ++ atomicity_dir="cpu/i486" + ;; + netbsd*) + os_include_dir="os/bsd/netbsd" +diff -Nbaur gcc-3.4.3/libstdc++-v3/include/bits/char_traits.h gcc-3.4.3-new/libstdc++-v3/include/bits/char_traits.h +--- gcc-3.4.3/libstdc++-v3/include/bits/char_traits.h Thu Mar 18 17:36:47 2004 ++++ gcc-3.4.3-new/libstdc++-v3/include/bits/char_traits.h Fri Jan 21 10:25:52 2005 +@@ -296,7 +296,7 @@ + }; + + +-#ifdef _GLIBCXX_USE_WCHAR_T ++#if defined (_GLIBCXX_USE_WCHAR_T) || defined (_GLIBCXX_USE_WSTRING) + /// 21.1.3.2 char_traits specializations + template<> + struct char_traits +@@ -304,8 +304,10 @@ + typedef wchar_t char_type; + typedef wint_t int_type; + typedef streamoff off_type; ++#if defined (_GLIBCXX_USE_WCHAR_T) + typedef wstreampos pos_type; + typedef mbstate_t state_type; ++#endif + + static void + assign(char_type& __c1, const char_type& __c2) +diff -Nbaur gcc-3.4.3/libstdc++-v3/include/bits/locale_facets.tcc gcc-3.4.3-new/libstdc++-v3/include/bits/locale_facets.tcc +--- gcc-3.4.3/libstdc++-v3/include/bits/locale_facets.tcc Tue Sep 14 00:43:24 2004 ++++ gcc-3.4.3-new/libstdc++-v3/include/bits/locale_facets.tcc Fri Jan 21 10:25:52 2005 +@@ -765,7 +765,13 @@ + string __xtrc; + __xtrc.reserve(32); + __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc); ++#if defined (GLIBCXX_NO_LONG_DOUBLE_IO) && !defined(_GLIBCXX_USE_C99) ++ double __vd; ++ std::__convert_to_v(__xtrc.c_str(), __vd, __err, _S_get_c_locale()); ++ __v = static_cast(__vd); ++#else + std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale()); ++#endif + return __beg; + } + +@@ -1220,7 +1226,14 @@ + num_put<_CharT, _OutIter>:: + do_put(iter_type __s, ios_base& __io, char_type __fill, + long double __v) const +- { return _M_insert_float(__s, __io, __fill, 'L', __v); } ++ { ++#ifdef _GLIBCXX_NO_LONG_DOUBLE_IO ++ return _M_insert_float(__s, __io, __fill, char_type(), ++ static_cast(__v)); ++#else ++ return _M_insert_float(__s, __io, __fill, 'L', __v); ++#endif ++ } + + template + _OutIter +@@ -1464,7 +1477,13 @@ + __beg = _M_extract(__beg, __end, __io, __err, __str); + else + __beg = _M_extract(__beg, __end, __io, __err, __str); ++#if defined _GLIBCXX_NO_LONG_DOUBLE_IO && !defined (_GLIBCXX_USE_C99) ++ double __dunits; ++ std::__convert_to_v(__str.c_str(), __dunits, __err, _S_get_c_locale()); ++ __units = static_cast(__dunits); ++#else // _GLIBCXX_NO_LONG_DOUBLE_IO && !defined (_GLIBCXX_USE_C99) + std::__convert_to_v(__str.c_str(), __units, __err, _S_get_c_locale()); ++#endif // _GLIBCXX_NO_LONG_DOUBLE_IO + return __beg; + } + +@@ -1667,6 +1686,32 @@ + { + const locale __loc = __io.getloc(); + const ctype<_CharT>& __ctype = use_facet >(__loc); ++#ifdef _GLIBCXX_NO_LONG_DOUBLE_IO ++ double __dunits = static_cast(__units); ++#ifdef _GLIBCXX_USE_C99 ++ // First try a buffer perhaps big enough. ++ int __cs_size = 64; ++ char* __cs = static_cast(__builtin_alloca(__cs_size)); ++ // _GLIBCXX_RESOLVE_LIB_DEFECTS ++ // 328. Bad sprintf format modifier in money_put<>::do_put() ++ int __len = std::__convert_from_v(__cs, __cs_size, "%.0f", __dunits, ++ _S_get_c_locale()); ++ // If the buffer was not large enough, try again with the correct size. ++ if (__len >= __cs_size) ++ { ++ __cs_size = __len + 1; ++ __cs = static_cast(__builtin_alloca(__cs_size)); ++ __len = std::__convert_from_v(__cs, __cs_size, "%.0f", __dunits, ++ _S_get_c_locale()); ++ } ++#else ++ // max_exponent10 + 1 for the integer part, + 2 for sign and '\0'. ++ const int __cs_size = numeric_limits::max_exponent10 + 3; ++ char* __cs = static_cast(__builtin_alloca(__cs_size)); ++ int __len = std::__convert_from_v(__cs, 0, "%.0f", __dunits, ++ _S_get_c_locale()); ++#endif ++#else // _GLIBCXX_NO_LONG_DOUBLE_IO + #ifdef _GLIBCXX_USE_C99 + // First try a buffer perhaps big enough. + int __cs_size = 64; +@@ -1690,6 +1735,7 @@ + int __len = std::__convert_from_v(__cs, 0, "%.*Lf", __units, + _S_get_c_locale(), 0); + #endif ++#endif // _GLIBCXX_NO_LONG_DOUBLE_IO + _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) + * __cs_size)); + __ctype.widen(__cs, __cs + __len, __ws); +diff -Nbaur gcc-3.4.3/libstdc++-v3/include/bits/stringfwd.h gcc-3.4.3-new/libstdc++-v3/include/bits/stringfwd.h +--- gcc-3.4.3/libstdc++-v3/include/bits/stringfwd.h Thu Mar 18 17:37:03 2004 ++++ gcc-3.4.3-new/libstdc++-v3/include/bits/stringfwd.h Fri Jan 21 10:25:52 2005 +@@ -59,7 +59,7 @@ + + typedef basic_string string; + +-#ifdef _GLIBCXX_USE_WCHAR_T ++#if defined (_GLIBCXX_USE_WCHAR_T) || defined (_GLIBCXX_USE_WSTRING) + template<> struct char_traits; + + typedef basic_string wstring; +diff -Nbaur gcc-3.4.3/libstdc++-v3/libsupc++/Makefile.in gcc-3.4.3-new/libstdc++-v3/libsupc++/Makefile.in +--- gcc-3.4.3/libstdc++-v3/libsupc++/Makefile.in Thu Mar 18 17:37:08 2004 ++++ gcc-3.4.3-new/libstdc++-v3/libsupc++/Makefile.in Fri Jan 21 10:25:52 2005 +@@ -210,7 +210,7 @@ + # These bits are all figured out from configure. Look in acinclude.m4 + # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. + CONFIG_CXXFLAGS = \ +- $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) ++ $(EXTRA_CXX_FLAGS) + + WARN_CXXFLAGS = \ + $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once +diff -Nbaur gcc-3.4.3/libstdc++-v3/libsupc++/eh_globals.cc gcc-3.4.3-new/libstdc++-v3/libsupc++/eh_globals.cc +--- gcc-3.4.3/libstdc++-v3/libsupc++/eh_globals.cc Fri Apr 30 05:20:24 2004 ++++ gcc-3.4.3-new/libstdc++-v3/libsupc++/eh_globals.cc Fri Jan 21 10:25:52 2005 +@@ -32,6 +32,9 @@ + #include + #include "unwind-cxx.h" + #include "bits/c++config.h" ++#ifdef __MINGW32__ ++#undef __GTHREAD_HIDE_WIN32API ++#endif + #include "bits/gthr.h" + + using namespace __cxxabiv1; +diff -Nbaur gcc-3.4.3/libstdc++-v3/libsupc++/eh_term_handler.cc gcc-3.4.3-new/libstdc++-v3/libsupc++/eh_term_handler.cc +--- gcc-3.4.3/libstdc++-v3/libsupc++/eh_term_handler.cc Tue Sep 2 19:46:54 2003 ++++ gcc-3.4.3-new/libstdc++-v3/libsupc++/eh_term_handler.cc Fri Jan 21 10:25:52 2005 +@@ -41,6 +41,7 @@ + # include + #endif + ++#if !(defined (__MINGW32__) || defined (__CYGWIN__)) + /* The current installed user handler. */ + std::terminate_handler __cxxabiv1::__terminate_handler = + #if _GLIBCXX_HOSTED +@@ -49,3 +50,4 @@ + std::abort; + #endif + ++#endif +diff -Nbaur gcc-3.4.3/libstdc++-v3/libsupc++/eh_terminate.cc gcc-3.4.3-new/libstdc++-v3/libsupc++/eh_terminate.cc +--- gcc-3.4.3/libstdc++-v3/libsupc++/eh_terminate.cc Sat May 24 17:22:03 2003 ++++ gcc-3.4.3-new/libstdc++-v3/libsupc++/eh_terminate.cc Fri Jan 21 10:25:52 2005 +@@ -50,6 +50,11 @@ + void + std::terminate () + { ++#if 0 // (defined (__MINGW32__) || defined (__CYGWIN__)) ++ if (__terminate_handler == NULL ) ++ __terminate (__gnu_cxx::__verbose_terminate_handler); ++ else ++#endif + __terminate (__terminate_handler); + } + +@@ -63,6 +68,11 @@ + void + std::unexpected () + { ++#if 0 // (defined (__MINGW32__) || defined (__CYGWIN__)) ++ if (__unexpected_handler == NULL) ++ std::terminate(); ++ else ++#endif + __unexpected (__unexpected_handler); + } + +diff -Nbaur gcc-3.4.3/libstdc++-v3/libsupc++/eh_unex_handler.cc gcc-3.4.3-new/libstdc++-v3/libsupc++/eh_unex_handler.cc +--- gcc-3.4.3/libstdc++-v3/libsupc++/eh_unex_handler.cc Sat May 24 17:22:03 2003 ++++ gcc-3.4.3-new/libstdc++-v3/libsupc++/eh_unex_handler.cc Fri Jan 21 10:25:52 2005 +@@ -29,6 +29,7 @@ + + #include "unwind-cxx.h" + ++#if !(defined (__MINGW32__) || defined (__CYGWIN__)) + /* The current installed user handler. */ + std::unexpected_handler __cxxabiv1::__unexpected_handler = std::terminate; +- ++#endif +diff -Nbaur gcc-3.4.3/libstdc++-v3/libsupc++/typeinfo gcc-3.4.3-new/libstdc++-v3/libsupc++/typeinfo +--- gcc-3.4.3/libstdc++-v3/libsupc++/typeinfo Sat Jul 5 05:05:40 2003 ++++ gcc-3.4.3-new/libstdc++-v3/libsupc++/typeinfo Fri Jan 21 10:25:52 2005 +@@ -44,7 +44,7 @@ + class __class_type_info; + } // namespace __cxxabiv1 + +-#if !__GXX_WEAK__ ++#if !__GXX_WEAK__ || defined (__MINGW32__) || defined (__CYGWIN__) + // If weak symbols are not supported, typeinfo names are not merged. + #define __GXX_MERGED_TYPEINFO_NAMES 0 + #else +diff -Nbaur gcc-3.4.3/libstdc++-v3/libsupc++/unwind-cxx.h gcc-3.4.3-new/libstdc++-v3/libsupc++/unwind-cxx.h +--- gcc-3.4.3/libstdc++-v3/libsupc++/unwind-cxx.h Sat Jul 5 05:05:41 2003 ++++ gcc-3.4.3-new/libstdc++-v3/libsupc++/unwind-cxx.h Fri Jan 21 10:25:52 2005 +@@ -125,9 +125,16 @@ + extern void __terminate(std::terminate_handler) __attribute__((noreturn)); + extern void __unexpected(std::unexpected_handler) __attribute__((noreturn)); + +-// The current installed user handlers. ++ // The current installed user handlers. ++#if defined (__MINGW32__) || defined (__CYGWIN__) ++extern "C" void** __w32_sharedptr_terminate; ++extern "C" void** __w32_sharedptr_unexpected; ++#define __terminate_handler (*(std::terminate_handler*)(__w32_sharedptr_terminate)) ++#define __unexpected_handler (*(std::unexpected_handler*)(__w32_sharedptr_unexpected)) ++#else + extern std::terminate_handler __terminate_handler; + extern std::unexpected_handler __unexpected_handler; ++#endif + + // These are explicitly GNU C++ specific. + +diff -Nbaur gcc-3.4.3/libstdc++-v3/src/Makefile.in gcc-3.4.3-new/libstdc++-v3/src/Makefile.in +--- gcc-3.4.3/libstdc++-v3/src/Makefile.in Fri Apr 16 20:08:35 2004 ++++ gcc-3.4.3-new/libstdc++-v3/src/Makefile.in Fri Jan 21 10:25:52 2005 +@@ -211,7 +211,7 @@ + # These bits are all figured out from configure. Look in acinclude.m4 + # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. + CONFIG_CXXFLAGS = \ +- $(SECTION_FLAGS) $(EXTRA_CXX_FLAGS) ++ $(EXTRA_CXX_FLAGS) + + WARN_CXXFLAGS = \ + $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once +diff -Nbaur gcc-3.4.3/libstdc++-v3/src/globals_io.cc gcc-3.4.3-new/libstdc++-v3/src/globals_io.cc +--- gcc-3.4.3/libstdc++-v3/src/globals_io.cc Thu Mar 18 17:37:13 2004 ++++ gcc-3.4.3-new/libstdc++-v3/src/globals_io.cc Fri Jan 21 10:25:52 2005 +@@ -26,6 +26,9 @@ + // the GNU General Public License. + + #include "bits/c++config.h" ++#ifdef __MINGW32__ ++#undef __GTHREAD_HIDE_WIN32API ++#endif + #include "bits/gthr.h" + #include + #include +diff -Nbaur gcc-3.4.3/ltcf-c.sh gcc-3.4.3-new/ltcf-c.sh +--- gcc-3.4.3/ltcf-c.sh Wed Nov 19 05:29:32 2003 ++++ gcc-3.4.3-new/ltcf-c.sh Fri Jan 21 10:25:52 2005 +@@ -38,17 +38,17 @@ + lt_simple_link_test_code='main(){return(0);}' + + ## Linker Characteristics +-case $host_os in +-cygwin* | mingw*) ++#case $host_os in ++#cygwin* | mingw*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. +- if test "$with_gcc" != yes; then +- with_gnu_ld=no +- fi +- ;; +- +-esac ++# if test "$with_gcc" != yes; then ++# with_gnu_ld=no ++# fi ++# ;; ++# ++#esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then diff --git a/patches/devkit-newlib-1.12.0.patch b/patches/devkit-newlib-1.12.0.patch new file mode 100644 index 0000000..032fa61 --- /dev/null +++ b/patches/devkit-newlib-1.12.0.patch @@ -0,0 +1,2884 @@ +diff -Nbaur newlib-1.12.0/config.sub newlib-1.12.0-new/config.sub +--- newlib-1.12.0/config.sub Fri Aug 8 11:14:48 2003 ++++ newlib-1.12.0-new/config.sub Thu Jan 20 20:21:39 2005 +@@ -218,6 +218,9 @@ + basic_machine=m68k-atari + os=-mint + ;; ++ -gekko) ++ basic_machine=powerpc-eabi ++ os=-elf-gekko + esac + + # Decode aliases for certain CPU-COMPANY combinations. +diff -Nbaur newlib-1.12.0/newlib/configure.host newlib-1.12.0-new/newlib/configure.host +--- newlib-1.12.0/newlib/configure.host Mon Feb 2 16:59:52 2004 ++++ newlib-1.12.0-new/newlib/configure.host Thu Jan 20 20:21:39 2005 +@@ -378,6 +378,9 @@ + powerpcle-*-pe) + posix_dir=posix + ;; ++ powerpc-eabi-elf-gekko) ++ sys_dir=ppcgekko ++ ;; + sh*-*) + sys_dir=sh + ;; +diff -Nbaur newlib-1.12.0/newlib/libc/sys/arm/Makefile.in newlib-1.12.0-new/newlib/libc/sys/arm/Makefile.in +--- newlib-1.12.0/newlib/libc/sys/arm/Makefile.in Fri Jan 23 21:37:38 2004 ++++ newlib-1.12.0-new/newlib/libc/sys/arm/Makefile.in Thu Jan 20 20:20:38 2005 +@@ -88,7 +88,7 @@ + INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + + noinst_LIBRARIES = lib.a +-@MAY_SUPPLY_SYSCALLS_TRUE@extra_objs = syscalls.o ++@MAY_SUPPLY_SYSCALLS_TRUE@extra_objs = syscalls.o malloc_vars.o + @MAY_SUPPLY_SYSCALLS_FALSE@extra_objs = + + lib_a_SOURCES = access.c libcfunc.c trap.S setjmp.S +diff -Nbaur newlib-1.12.0/newlib/libc/sys/arm/malloc_vars.c newlib-1.12.0-new/newlib/libc/sys/arm/malloc_vars.c +--- newlib-1.12.0/newlib/libc/sys/arm/malloc_vars.c Thu Jan 1 00:00:00 1970 ++++ newlib-1.12.0-new/newlib/libc/sys/arm/malloc_vars.c Thu Jan 20 20:20:38 2005 +@@ -0,0 +1,2 @@ ++char *fake_heap_end = (char*)0; ++char *fake_heap_start = (char*)0; +diff -Nbaur newlib-1.12.0/newlib/libc/sys/arm/syscalls.c newlib-1.12.0-new/newlib/libc/sys/arm/syscalls.c +--- newlib-1.12.0/newlib/libc/sys/arm/syscalls.c Tue Jan 6 19:27:22 2004 ++++ newlib-1.12.0-new/newlib/libc/sys/arm/syscalls.c Thu Jan 20 20:20:38 2005 +@@ -474,19 +474,41 @@ + n = n; + } + ++extern char *fake_heap_end; ++extern char *fake_heap_start; ++ + caddr_t + _sbrk (int incr) + { + extern char end asm ("end"); /* Defined by the linker. */ + static char * heap_end; + char * prev_heap_end; ++ char * our_heap_end; + + if (heap_end == NULL) ++ { ++ if (fake_heap_start == NULL) ++ { + heap_end = & end; ++ } ++ else ++ { ++ heap_end = fake_heap_start; ++ } ++ } + + prev_heap_end = heap_end; + +- if (heap_end + incr > stack_ptr) ++ if (fake_heap_end == NULL) ++ { ++ our_heap_end = stack_ptr; ++ } ++ else ++ { ++ our_heap_end = fake_heap_end; ++ } ++ ++ if (heap_end + incr > our_heap_end) + { + /* Some of the libstdc++-v3 tests rely upon detecting + out of memory errors, so do not abort here. */ +diff -Nbaur newlib-1.12.0/newlib/libc/sys/ppcgekko/Makefile.am newlib-1.12.0-new/newlib/libc/sys/ppcgekko/Makefile.am +--- newlib-1.12.0/newlib/libc/sys/ppcgekko/Makefile.am Thu Jan 1 00:00:00 1970 ++++ newlib-1.12.0-new/newlib/libc/sys/ppcgekko/Makefile.am Thu Jan 20 20:21:39 2005 +@@ -0,0 +1,19 @@ ++## Process this file with automake to generate Makefile.in ++ ++AUTOMAKE_OPTIONS = cygnus ++ ++INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) ++ ++noinst_LIBRARIES = lib.a ++ ++lib_a_SOURCES = ++ ++# This is a hack to force automake to include a definition for ++# COMPILE. ++EXTRA_LIBRARIES = libfoo.a ++libfoo_a_SOURCES = crt0.c ++ ++all: crt0.o ++ ++ACLOCAL_AMFLAGS = -I ../../.. ++CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +diff -Nbaur newlib-1.12.0/newlib/libc/sys/ppcgekko/Makefile.in newlib-1.12.0-new/newlib/libc/sys/ppcgekko/Makefile.in +--- newlib-1.12.0/newlib/libc/sys/ppcgekko/Makefile.in Thu Jan 1 00:00:00 1970 ++++ newlib-1.12.0-new/newlib/libc/sys/ppcgekko/Makefile.in Thu Jan 20 20:21:39 2005 +@@ -0,0 +1,341 @@ ++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am ++ ++# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. ++# This Makefile.in is free software; the Free Software Foundation ++# gives unlimited permission to copy and/or distribute it, ++# with or without modifications, as long as this notice is preserved. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY, to the extent permitted by law; without ++# even the implied warranty of MERCHANTABILITY or FITNESS FOR A ++# PARTICULAR PURPOSE. ++ ++ ++SHELL = @SHELL@ ++ ++srcdir = @srcdir@ ++top_srcdir = @top_srcdir@ ++VPATH = @srcdir@ ++prefix = @prefix@ ++exec_prefix = @exec_prefix@ ++ ++bindir = @bindir@ ++sbindir = @sbindir@ ++libexecdir = @libexecdir@ ++datadir = @datadir@ ++sysconfdir = @sysconfdir@ ++sharedstatedir = @sharedstatedir@ ++localstatedir = @localstatedir@ ++libdir = @libdir@ ++infodir = @infodir@ ++mandir = @mandir@ ++includedir = @includedir@ ++oldincludedir = /usr/include ++ ++DESTDIR = ++ ++pkgdatadir = $(datadir)/@PACKAGE@ ++pkglibdir = $(libdir)/@PACKAGE@ ++pkgincludedir = $(includedir)/@PACKAGE@ ++ ++top_builddir = . ++ ++ACLOCAL = @ACLOCAL@ ++AUTOCONF = @AUTOCONF@ ++AUTOMAKE = @AUTOMAKE@ ++AUTOHEADER = @AUTOHEADER@ ++ ++INSTALL = @INSTALL@ ++INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) ++INSTALL_DATA = @INSTALL_DATA@ ++INSTALL_SCRIPT = @INSTALL_SCRIPT@ ++transform = @program_transform_name@ ++ ++NORMAL_INSTALL = : ++PRE_INSTALL = : ++POST_INSTALL = : ++NORMAL_UNINSTALL = : ++PRE_UNINSTALL = : ++POST_UNINSTALL = : ++build_alias = @build_alias@ ++build_triplet = @build@ ++host_alias = @host_alias@ ++host_triplet = @host@ ++target_alias = @target_alias@ ++target_triplet = @target@ ++AR = @AR@ ++AS = @AS@ ++CC = @CC@ ++CPP = @CPP@ ++EXEEXT = @EXEEXT@ ++LDFLAGS = @LDFLAGS@ ++MAINT = @MAINT@ ++MAKEINFO = @MAKEINFO@ ++NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ ++OBJEXT = @OBJEXT@ ++PACKAGE = @PACKAGE@ ++RANLIB = @RANLIB@ ++VERSION = @VERSION@ ++aext = @aext@ ++libm_machine_dir = @libm_machine_dir@ ++machine_dir = @machine_dir@ ++newlib_basedir = @newlib_basedir@ ++oext = @oext@ ++sys_dir = @sys_dir@ ++ ++AUTOMAKE_OPTIONS = cygnus ++ ++INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) ++ ++noinst_LIBRARIES = lib.a ++ ++lib_a_SOURCES = ++ ++# This is a hack to force automake to include a definition for ++# COMPILE. ++EXTRA_LIBRARIES = libfoo.a ++libfoo_a_SOURCES = crt0.c ++ ++ACLOCAL_AMFLAGS = -I ../../.. ++CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host ++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ++mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs ++CONFIG_CLEAN_FILES = ++LIBRARIES = $(noinst_LIBRARIES) ++ ++ ++DEFS = @DEFS@ -I. -I$(srcdir) ++CPPFLAGS = @CPPFLAGS@ ++LIBS = @LIBS@ ++libfoo_a_LIBADD = ++libfoo_a_OBJECTS = crt0.o ++lib_a_LIBADD = ++lib_a_OBJECTS = ++CFLAGS = @CFLAGS@ ++COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) ++CCLD = $(CC) ++LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ ++DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in ++ ++ ++DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) ++ ++TAR = gtar ++GZIP_ENV = --best ++SOURCES = $(libfoo_a_SOURCES) $(lib_a_SOURCES) ++OBJECTS = $(libfoo_a_OBJECTS) $(lib_a_OBJECTS) ++ ++all: all-redirect ++.SUFFIXES: ++.SUFFIXES: .S .c .o .s ++$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) ++ cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile ++ ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status ++ cd $(top_builddir) \ ++ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status ++ ++$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in \ ++ ../../../acinclude.m4 ../../../aclocal.m4 \ ++ ../../../libtool.m4 ++ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) ++ ++config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) ++ $(SHELL) ./config.status --recheck ++$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) ++ cd $(srcdir) && $(AUTOCONF) ++ ++mostlyclean-noinstLIBRARIES: ++ ++clean-noinstLIBRARIES: ++ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) ++ ++distclean-noinstLIBRARIES: ++ ++maintainer-clean-noinstLIBRARIES: ++ ++.c.o: ++ $(COMPILE) -c $< ++ ++.s.o: ++ $(COMPILE) -c $< ++ ++.S.o: ++ $(COMPILE) -c $< ++ ++mostlyclean-compile: ++ -rm -f *.o core *.core ++ ++clean-compile: ++ ++distclean-compile: ++ -rm -f *.tab.c ++ ++maintainer-clean-compile: ++ ++libfoo.a: $(libfoo_a_OBJECTS) $(libfoo_a_DEPENDENCIES) ++ -rm -f libfoo.a ++ $(AR) cru libfoo.a $(libfoo_a_OBJECTS) $(libfoo_a_LIBADD) ++ $(RANLIB) libfoo.a ++ ++lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) ++ -rm -f lib.a ++ $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) ++ $(RANLIB) lib.a ++ ++tags: TAGS ++ ++ID: $(HEADERS) $(SOURCES) $(LISP) ++ list='$(SOURCES) $(HEADERS)'; \ ++ unique=`for i in $$list; do echo $$i; done | \ ++ awk ' { files[$$0] = 1; } \ ++ END { for (i in files) print i; }'`; \ ++ here=`pwd` && cd $(srcdir) \ ++ && mkid -f$$here/ID $$unique $(LISP) ++ ++TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) ++ tags=; \ ++ here=`pwd`; \ ++ list='$(SOURCES) $(HEADERS)'; \ ++ unique=`for i in $$list; do echo $$i; done | \ ++ awk ' { files[$$0] = 1; } \ ++ END { for (i in files) print i; }'`; \ ++ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ ++ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) ++ ++mostlyclean-tags: ++ ++clean-tags: ++ ++distclean-tags: ++ -rm -f TAGS ID ++ ++maintainer-clean-tags: ++ ++distdir = $(PACKAGE)-$(VERSION) ++top_distdir = $(distdir) ++ ++# This target untars the dist file and tries a VPATH configuration. Then ++# it guarantees that the distribution is self-contained by making another ++# tarfile. ++distcheck: dist ++ -rm -rf $(distdir) ++ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz ++ mkdir $(distdir)/=build ++ mkdir $(distdir)/=inst ++ dc_install_base=`cd $(distdir)/=inst && pwd`; \ ++ cd $(distdir)/=build \ ++ && ../configure --srcdir=.. --prefix=$$dc_install_base \ ++ && $(MAKE) $(AM_MAKEFLAGS) \ ++ && $(MAKE) $(AM_MAKEFLAGS) dvi \ ++ && $(MAKE) $(AM_MAKEFLAGS) check \ ++ && $(MAKE) $(AM_MAKEFLAGS) install \ ++ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ ++ && $(MAKE) $(AM_MAKEFLAGS) dist ++ -rm -rf $(distdir) ++ @banner="$(distdir).tar.gz is ready for distribution"; \ ++ dashes=`echo "$$banner" | sed s/./=/g`; \ ++ echo "$$dashes"; \ ++ echo "$$banner"; \ ++ echo "$$dashes" ++dist: distdir ++ -chmod -R a+r $(distdir) ++ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) ++ -rm -rf $(distdir) ++dist-all: distdir ++ -chmod -R a+r $(distdir) ++ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) ++ -rm -rf $(distdir) ++distdir: $(DISTFILES) ++ -rm -rf $(distdir) ++ mkdir $(distdir) ++ -chmod 777 $(distdir) ++ @for file in $(DISTFILES); do \ ++ if test -f $$file; then d=.; else d=$(srcdir); fi; \ ++ if test -d $$d/$$file; then \ ++ cp -pr $$d/$$file $(distdir)/$$file; \ ++ else \ ++ test -f $(distdir)/$$file \ ++ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ ++ || cp -p $$d/$$file $(distdir)/$$file || :; \ ++ fi; \ ++ done ++info-am: ++info: info-am ++dvi-am: ++dvi: dvi-am ++check-am: ++check: check-am ++installcheck-am: ++installcheck: installcheck-am ++install-info-am: ++install-info: install-info-am ++install-exec-am: ++install-exec: install-exec-am ++ ++install-data-am: ++install-data: install-data-am ++ ++install-am: all-am ++ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am ++install: install-am ++uninstall-am: ++uninstall: uninstall-am ++all-am: Makefile $(LIBRARIES) ++all-redirect: all-am ++install-strip: ++ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install ++installdirs: ++ ++ ++mostlyclean-generic: ++ ++clean-generic: ++ ++distclean-generic: ++ -rm -f Makefile $(CONFIG_CLEAN_FILES) ++ -rm -f config.cache config.log stamp-h stamp-h[0-9]* ++ ++maintainer-clean-generic: ++mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ ++ mostlyclean-tags mostlyclean-generic ++ ++mostlyclean: mostlyclean-am ++ ++clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ ++ mostlyclean-am ++ ++clean: clean-am ++ ++distclean-am: distclean-noinstLIBRARIES distclean-compile \ ++ distclean-tags distclean-generic clean-am ++ ++distclean: distclean-am ++ -rm -f config.status ++ ++maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ ++ maintainer-clean-compile maintainer-clean-tags \ ++ maintainer-clean-generic distclean-am ++ @echo "This command is intended for maintainers to use;" ++ @echo "it deletes files that may require special tools to rebuild." ++ ++maintainer-clean: maintainer-clean-am ++ -rm -f config.status ++ ++.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ ++clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ ++mostlyclean-compile distclean-compile clean-compile \ ++maintainer-clean-compile tags mostlyclean-tags distclean-tags \ ++clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ ++check-am installcheck-am installcheck install-info-am install-info \ ++install-exec-am install-exec install-data-am install-data install-am \ ++install uninstall-am uninstall all-redirect all-am all installdirs \ ++mostlyclean-generic distclean-generic clean-generic \ ++maintainer-clean-generic clean mostlyclean distclean maintainer-clean ++ ++ ++all: crt0.o ++ ++# Tell versions [3.59,3.63) of GNU make to not export all variables. ++# Otherwise a system limit (for SysV at least) may be exceeded. ++.NOEXPORT: +diff -Nbaur newlib-1.12.0/newlib/libc/sys/ppcgekko/aclocal.m4 newlib-1.12.0-new/newlib/libc/sys/ppcgekko/aclocal.m4 +--- newlib-1.12.0/newlib/libc/sys/ppcgekko/aclocal.m4 Thu Jan 1 00:00:00 1970 ++++ newlib-1.12.0-new/newlib/libc/sys/ppcgekko/aclocal.m4 Thu Jan 20 20:21:39 2005 +@@ -0,0 +1,382 @@ ++dnl aclocal.m4 generated automatically by aclocal 1.4-p6 ++ ++dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. ++dnl This file is free software; the Free Software Foundation ++dnl gives unlimited permission to copy and/or distribute it, ++dnl with or without modifications, as long as this notice is preserved. ++ ++dnl This program is distributed in the hope that it will be useful, ++dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without ++dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A ++dnl PARTICULAR PURPOSE. ++ ++dnl This provides configure definitions used by all the newlib ++dnl configure.in files. ++ ++dnl Basic newlib configury. This calls basic introductory stuff, ++dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs ++dnl configure.host. The only argument is the relative path to the top ++dnl newlib directory. ++ ++AC_DEFUN(NEWLIB_CONFIGURE, ++[ ++dnl Default to --enable-multilib ++AC_ARG_ENABLE(multilib, ++[ --enable-multilib build many library versions (default)], ++[case "${enableval}" in ++ yes) multilib=yes ;; ++ no) multilib=no ;; ++ *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; ++ esac], [multilib=yes])dnl ++ ++dnl Support --enable-target-optspace ++AC_ARG_ENABLE(target-optspace, ++[ --enable-target-optspace optimize for space], ++[case "${enableval}" in ++ yes) target_optspace=yes ;; ++ no) target_optspace=no ;; ++ *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; ++ esac], [target_optspace=])dnl ++ ++dnl Support --enable-malloc-debugging - currently only supported for Cygwin ++AC_ARG_ENABLE(malloc-debugging, ++[ --enable-malloc-debugging indicate malloc debugging requested], ++[case "${enableval}" in ++ yes) malloc_debugging=yes ;; ++ no) malloc_debugging=no ;; ++ *) AC_MSG_ERROR(bad value ${enableval} for malloc-debugging option) ;; ++ esac], [malloc_debugging=])dnl ++ ++dnl Support --enable-newlib-mb ++AC_ARG_ENABLE(newlib-mb, ++[ --enable-newlib-mb enable multibyte support], ++[case "${enableval}" in ++ yes) newlib_mb=yes ;; ++ no) newlib_mb=no ;; ++ *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; ++ esac], [newlib_mb=])dnl ++ ++dnl Support --enable-newlib-iconv ++AC_ARG_ENABLE(newlib-iconv, ++[ --enable-newlib-iconv enable iconv library support], ++[case "${enableval}" in ++ yes) newlib_iconv=yes ;; ++ no) newlib_iconv=no ;; ++ *) AC_MSG_ERROR(bad value ${enableval} for newlib-iconv option) ;; ++ esac], [newlib_iconv=])dnl ++ ++dnl Support --enable-newlib-builtin-converters ++AC_ARG_ENABLE(newlib-builtin-converters, ++[ --enable-newlib-builtin-converters enable specific comma-separated list of iconv converters to be built-in], ++[if test x${enableval} = x; then ++ AC_MSG_ERROR(bad value ${enableval} for newlib-builtin-converters option - use comma-separated list) ++ fi ++ builtin_converters=${enableval} ++ ], [builtin_converters=])dnl ++ ++dnl Support --enable-newlib-multithread ++AC_ARG_ENABLE(newlib-multithread, ++[ --enable-newlib-multithread enable support for multiple threads], ++[case "${enableval}" in ++ yes) newlib_multithread=yes ;; ++ no) newlib_multithread=no ;; ++ *) AC_MSG_ERROR(bad value ${enableval} for newlib-multithread option) ;; ++ esac], [newlib_multithread=yes])dnl ++ ++dnl Support --enable-newlib-elix-level ++AC_ARG_ENABLE(newlib-elix-level, ++[ --enable-newlib-elix-level supply desired elix library level (1-4)], ++[case "${enableval}" in ++ 0) newlib_elix_level=0 ;; ++ 1) newlib_elix_level=1 ;; ++ 2) newlib_elix_level=2 ;; ++ 3) newlib_elix_level=3 ;; ++ 4) newlib_elix_level=4 ;; ++ *) AC_MSG_ERROR(bad value ${enableval} for newlib-elix-level option) ;; ++ esac], [newlib_elix_level=0])dnl ++ ++dnl Support --disable-newlib-io-float ++AC_ARG_ENABLE(newlib-io-float, ++[ --disable-newlib-io-float disable printf/scanf family float support], ++[case "${enableval}" in ++ yes) newlib_io_float=yes ;; ++ no) newlib_io_float=no ;; ++ *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-float option) ;; ++ esac], [newlib_io_float=yes])dnl ++ ++dnl Support --disable-newlib-supplied-syscalls ++AC_ARG_ENABLE(newlib-supplied-syscalls, ++[ --disable-newlib-supplied-syscalls disable newlib from supplying syscalls], ++[case "${enableval}" in ++ yes) newlib_may_supply_syscalls=yes ;; ++ no) newlib_may_supply_syscalls=no ;; ++ *) AC_MSG_ERROR(bad value ${enableval} for newlib-supplied-syscalls option) ;; ++ esac], [newlib_may_supply_syscalls=yes])dnl ++ ++AM_CONDITIONAL(MAY_SUPPLY_SYSCALLS, test x[$]{newlib_may_supply_syscalls} = xyes) ++ ++dnl We may get other options which we don't document: ++dnl --with-target-subdir, --with-multisrctop, --with-multisubdir ++ ++test -z "[$]{with_target_subdir}" && with_target_subdir=. ++ ++if test "[$]{srcdir}" = "."; then ++ if test "[$]{with_target_subdir}" != "."; then ++ newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" ++ else ++ newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" ++ fi ++else ++ newlib_basedir="[$]{srcdir}/$1" ++fi ++AC_SUBST(newlib_basedir) ++ ++AC_CANONICAL_SYSTEM ++ ++AM_INIT_AUTOMAKE(newlib, 1.12.0) ++ ++# FIXME: We temporarily define our own version of AC_PROG_CC. This is ++# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We ++# are probably using a cross compiler, which will not be able to fully ++# link an executable. This should really be fixed in autoconf ++# itself. ++ ++AC_DEFUN(LIB_AC_PROG_CC, ++[AC_BEFORE([$0], [AC_PROG_CPP])dnl ++AC_CHECK_PROG(CC, gcc, gcc) ++if test -z "$CC"; then ++ AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) ++ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) ++fi ++ ++AC_PROG_CC_GNU ++ ++if test $ac_cv_prog_gcc = yes; then ++ GCC=yes ++dnl Check whether -g works, even if CFLAGS is set, in case the package ++dnl plays around with CFLAGS (such as to build both debugging and ++dnl normal versions of a library), tasteless as that idea is. ++ ac_test_CFLAGS="${CFLAGS+set}" ++ ac_save_CFLAGS="$CFLAGS" ++ CFLAGS= ++ AC_PROG_CC_G ++ if test "$ac_test_CFLAGS" = set; then ++ CFLAGS="$ac_save_CFLAGS" ++ elif test $ac_cv_prog_cc_g = yes; then ++ CFLAGS="-g -O2" ++ else ++ CFLAGS="-O2" ++ fi ++else ++ GCC= ++ test "${CFLAGS+set}" = set || CFLAGS="-g" ++fi ++]) ++ ++LIB_AC_PROG_CC ++ ++AC_CHECK_TOOL(AS, as) ++AC_CHECK_TOOL(AR, ar) ++AC_CHECK_TOOL(RANLIB, ranlib, :) ++ ++AC_PROG_INSTALL ++ ++AM_MAINTAINER_MODE ++ ++# We need AC_EXEEXT to keep automake happy in cygnus mode. However, ++# at least currently, we never actually build a program, so we never ++# need to use $(EXEEXT). Moreover, the test for EXEEXT normally ++# fails, because we are probably configuring with a cross compiler ++# which can't create executables. So we include AC_EXEEXT to keep ++# automake happy, but we don't execute it, since we don't care about ++# the result. ++if false; then ++ AC_EXEEXT ++fi ++ ++. [$]{newlib_basedir}/configure.host ++ ++newlib_cflags="[$]{newlib_cflags} -fno-builtin" ++ ++NEWLIB_CFLAGS=${newlib_cflags} ++AC_SUBST(NEWLIB_CFLAGS) ++ ++LDFLAGS=${ldflags} ++AC_SUBST(LDFLAGS) ++ ++AM_CONDITIONAL(ELIX_LEVEL_0, test x[$]{newlib_elix_level} = x0) ++AM_CONDITIONAL(ELIX_LEVEL_1, test x[$]{newlib_elix_level} = x1) ++AM_CONDITIONAL(ELIX_LEVEL_2, test x[$]{newlib_elix_level} = x2) ++AM_CONDITIONAL(ELIX_LEVEL_3, test x[$]{newlib_elix_level} = x3) ++AM_CONDITIONAL(ELIX_LEVEL_4, test x[$]{newlib_elix_level} = x4) ++ ++AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes) ++ ++# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we ++# use oext, which is set in configure.host based on the target platform. ++OBJEXT=${oext} ++ ++AC_SUBST(OBJEXT) ++AC_SUBST(oext) ++AC_SUBST(aext) ++ ++AC_SUBST(libm_machine_dir) ++AC_SUBST(machine_dir) ++AC_SUBST(sys_dir) ++]) ++ ++# Do all the work for Automake. This macro actually does too much -- ++# some checks are only needed if your package does certain things. ++# But this isn't really a big deal. ++ ++# serial 1 ++ ++dnl Usage: ++dnl AM_INIT_AUTOMAKE(package,version, [no-define]) ++ ++AC_DEFUN([AM_INIT_AUTOMAKE], ++[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl ++AC_REQUIRE([AC_PROG_INSTALL]) ++PACKAGE=[$1] ++AC_SUBST(PACKAGE) ++VERSION=[$2] ++AC_SUBST(VERSION) ++dnl test to see if srcdir already configured ++if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then ++ AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) ++fi ++ifelse([$3],, ++AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) ++AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) ++AC_REQUIRE([AM_SANITY_CHECK]) ++AC_REQUIRE([AC_ARG_PROGRAM]) ++dnl FIXME This is truly gross. ++missing_dir=`cd $ac_aux_dir && pwd` ++AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir) ++AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) ++AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir) ++AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) ++AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) ++AC_REQUIRE([AC_PROG_MAKE_SET])]) ++ ++# Copyright 2002 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2, or (at your option) ++# any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ++ ++# AM_AUTOMAKE_VERSION(VERSION) ++# ---------------------------- ++# Automake X.Y traces this macro to ensure aclocal.m4 has been ++# generated from the m4 files accompanying Automake X.Y. ++AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"]) ++ ++# AM_SET_CURRENT_AUTOMAKE_VERSION ++# ------------------------------- ++# Call AM_AUTOMAKE_VERSION so it can be traced. ++# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. ++AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], ++ [AM_AUTOMAKE_VERSION([1.4-p6])]) ++ ++# ++# Check to make sure that the build environment is sane. ++# ++ ++AC_DEFUN([AM_SANITY_CHECK], ++[AC_MSG_CHECKING([whether build environment is sane]) ++# Just in case ++sleep 1 ++echo timestamp > conftestfile ++# Do `set' in a subshell so we don't clobber the current shell's ++# arguments. Must try -L first in case configure is actually a ++# symlink; some systems play weird games with the mod time of symlinks ++# (eg FreeBSD returns the mod time of the symlink's containing ++# directory). ++if ( ++ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` ++ if test "[$]*" = "X"; then ++ # -L didn't work. ++ set X `ls -t $srcdir/configure conftestfile` ++ fi ++ if test "[$]*" != "X $srcdir/configure conftestfile" \ ++ && test "[$]*" != "X conftestfile $srcdir/configure"; then ++ ++ # If neither matched, then we have a broken ls. This can happen ++ # if, for instance, CONFIG_SHELL is bash and it inherits a ++ # broken ls alias from the environment. This has actually ++ # happened. Such a system could not be considered "sane". ++ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken ++alias in your environment]) ++ fi ++ ++ test "[$]2" = conftestfile ++ ) ++then ++ # Ok. ++ : ++else ++ AC_MSG_ERROR([newly created file is older than distributed files! ++Check your system clock]) ++fi ++rm -f conftest* ++AC_MSG_RESULT(yes)]) ++ ++dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) ++dnl The program must properly implement --version. ++AC_DEFUN([AM_MISSING_PROG], ++[AC_MSG_CHECKING(for working $2) ++# Run test in a subshell; some versions of sh will print an error if ++# an executable is not found, even if stderr is redirected. ++# Redirect stdin to placate older versions of autoconf. Sigh. ++if ($2 --version) < /dev/null > /dev/null 2>&1; then ++ $1=$2 ++ AC_MSG_RESULT(found) ++else ++ $1="$3/missing $2" ++ AC_MSG_RESULT(missing) ++fi ++AC_SUBST($1)]) ++ ++# Define a conditional. ++ ++AC_DEFUN([AM_CONDITIONAL], ++[AC_SUBST($1_TRUE) ++AC_SUBST($1_FALSE) ++if $2; then ++ $1_TRUE= ++ $1_FALSE='#' ++else ++ $1_TRUE='#' ++ $1_FALSE= ++fi]) ++ ++# Add --enable-maintainer-mode option to configure. ++# From Jim Meyering ++ ++# serial 1 ++ ++AC_DEFUN([AM_MAINTAINER_MODE], ++[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) ++ dnl maintainer-mode is disabled by default ++ AC_ARG_ENABLE(maintainer-mode, ++[ --enable-maintainer-mode enable make rules and dependencies not useful ++ (and sometimes confusing) to the casual installer], ++ USE_MAINTAINER_MODE=$enableval, ++ USE_MAINTAINER_MODE=no) ++ AC_MSG_RESULT($USE_MAINTAINER_MODE) ++ AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) ++ MAINT=$MAINTAINER_MODE_TRUE ++ AC_SUBST(MAINT)dnl ++] ++) ++ +diff -Nbaur newlib-1.12.0/newlib/libc/sys/ppcgekko/configure newlib-1.12.0-new/newlib/libc/sys/ppcgekko/configure +--- newlib-1.12.0/newlib/libc/sys/ppcgekko/configure Thu Jan 1 00:00:00 1970 ++++ newlib-1.12.0-new/newlib/libc/sys/ppcgekko/configure Thu Jan 20 20:21:39 2005 +@@ -0,0 +1,1906 @@ ++#! /bin/sh ++ ++# Guess values for system-dependent variables and create Makefiles. ++# Generated automatically using autoconf version 2.13 ++# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. ++# ++# This configure script is free software; the Free Software Foundation ++# gives unlimited permission to copy, distribute and modify it. ++ ++# Defaults: ++ac_help= ++ac_default_prefix=/usr/local ++# Any additions from configure.in: ++ac_help="$ac_help ++ --enable-multilib build many library versions (default)" ++ac_help="$ac_help ++ --enable-target-optspace optimize for space" ++ac_help="$ac_help ++ --enable-malloc-debugging indicate malloc debugging requested" ++ac_help="$ac_help ++ --enable-newlib-mb enable multibyte support" ++ac_help="$ac_help ++ --enable-newlib-iconv enable iconv library support" ++ac_help="$ac_help ++ --enable-newlib-builtin-converters enable specific comma-separated list of iconv converters to be built-in" ++ac_help="$ac_help ++ --enable-newlib-multithread enable support for multiple threads" ++ac_help="$ac_help ++ --enable-newlib-elix-level supply desired elix library level (1-4)" ++ac_help="$ac_help ++ --disable-newlib-io-float disable printf/scanf family float support" ++ac_help="$ac_help ++ --disable-newlib-supplied-syscalls disable newlib from supplying syscalls" ++ac_help="$ac_help ++ --enable-maintainer-mode enable make rules and dependencies not useful ++ (and sometimes confusing) to the casual installer" ++ ++# Initialize some variables set by options. ++# The variables have the same names as the options, with ++# dashes changed to underlines. ++build=NONE ++cache_file=./config.cache ++exec_prefix=NONE ++host=NONE ++no_create= ++nonopt=NONE ++no_recursion= ++prefix=NONE ++program_prefix=NONE ++program_suffix=NONE ++program_transform_name=s,x,x, ++silent= ++site= ++srcdir= ++target=NONE ++verbose= ++x_includes=NONE ++x_libraries=NONE ++bindir='${exec_prefix}/bin' ++sbindir='${exec_prefix}/sbin' ++libexecdir='${exec_prefix}/libexec' ++datadir='${prefix}/share' ++sysconfdir='${prefix}/etc' ++sharedstatedir='${prefix}/com' ++localstatedir='${prefix}/var' ++libdir='${exec_prefix}/lib' ++includedir='${prefix}/include' ++oldincludedir='/usr/include' ++infodir='${prefix}/info' ++mandir='${prefix}/man' ++ ++# Initialize some other variables. ++subdirs= ++MFLAGS= MAKEFLAGS= ++SHELL=${CONFIG_SHELL-/bin/sh} ++# Maximum number of lines to put in a shell here document. ++ac_max_here_lines=12 ++ ++ac_prev= ++for ac_option ++do ++ ++ # If the previous option needs an argument, assign it. ++ if test -n "$ac_prev"; then ++ eval "$ac_prev=\$ac_option" ++ ac_prev= ++ continue ++ fi ++ ++ case "$ac_option" in ++ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; ++ *) ac_optarg= ;; ++ esac ++ ++ # Accept the important Cygnus configure options, so we can diagnose typos. ++ ++ case "$ac_option" in ++ ++ -bindir | --bindir | --bindi | --bind | --bin | --bi) ++ ac_prev=bindir ;; ++ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) ++ bindir="$ac_optarg" ;; ++ ++ -build | --build | --buil | --bui | --bu) ++ ac_prev=build ;; ++ -build=* | --build=* | --buil=* | --bui=* | --bu=*) ++ build="$ac_optarg" ;; ++ ++ -cache-file | --cache-file | --cache-fil | --cache-fi \ ++ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ++ ac_prev=cache_file ;; ++ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ ++ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) ++ cache_file="$ac_optarg" ;; ++ ++ -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ++ ac_prev=datadir ;; ++ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ ++ | --da=*) ++ datadir="$ac_optarg" ;; ++ ++ -disable-* | --disable-*) ++ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` ++ # Reject names that are not valid shell variable names. ++ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then ++ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } ++ fi ++ ac_feature=`echo $ac_feature| sed 's/-/_/g'` ++ eval "enable_${ac_feature}=no" ;; ++ ++ -enable-* | --enable-*) ++ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` ++ # Reject names that are not valid shell variable names. ++ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then ++ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } ++ fi ++ ac_feature=`echo $ac_feature| sed 's/-/_/g'` ++ case "$ac_option" in ++ *=*) ;; ++ *) ac_optarg=yes ;; ++ esac ++ eval "enable_${ac_feature}='$ac_optarg'" ;; ++ ++ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ ++ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ ++ | --exec | --exe | --ex) ++ ac_prev=exec_prefix ;; ++ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ ++ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ ++ | --exec=* | --exe=* | --ex=*) ++ exec_prefix="$ac_optarg" ;; ++ ++ -gas | --gas | --ga | --g) ++ # Obsolete; use --with-gas. ++ with_gas=yes ;; ++ ++ -help | --help | --hel | --he) ++ # Omit some internal or obsolete options to make the list less imposing. ++ # This message is too long to be a string in the A/UX 3.1 sh. ++ cat << EOF ++Usage: configure [options] [host] ++Options: [defaults in brackets after descriptions] ++Configuration: ++ --cache-file=FILE cache test results in FILE ++ --help print this message ++ --no-create do not create output files ++ --quiet, --silent do not print \`checking...' messages ++ --version print the version of autoconf that created configure ++Directory and file names: ++ --prefix=PREFIX install architecture-independent files in PREFIX ++ [$ac_default_prefix] ++ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX ++ [same as prefix] ++ --bindir=DIR user executables in DIR [EPREFIX/bin] ++ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] ++ --libexecdir=DIR program executables in DIR [EPREFIX/libexec] ++ --datadir=DIR read-only architecture-independent data in DIR ++ [PREFIX/share] ++ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] ++ --sharedstatedir=DIR modifiable architecture-independent data in DIR ++ [PREFIX/com] ++ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] ++ --libdir=DIR object code libraries in DIR [EPREFIX/lib] ++ --includedir=DIR C header files in DIR [PREFIX/include] ++ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] ++ --infodir=DIR info documentation in DIR [PREFIX/info] ++ --mandir=DIR man documentation in DIR [PREFIX/man] ++ --srcdir=DIR find the sources in DIR [configure dir or ..] ++ --program-prefix=PREFIX prepend PREFIX to installed program names ++ --program-suffix=SUFFIX append SUFFIX to installed program names ++ --program-transform-name=PROGRAM ++ run sed PROGRAM on installed program names ++EOF ++ cat << EOF ++Host type: ++ --build=BUILD configure for building on BUILD [BUILD=HOST] ++ --host=HOST configure for HOST [guessed] ++ --target=TARGET configure for TARGET [TARGET=HOST] ++Features and packages: ++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) ++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] ++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ++ --x-includes=DIR X include files are in DIR ++ --x-libraries=DIR X library files are in DIR ++EOF ++ if test -n "$ac_help"; then ++ echo "--enable and --with options recognized:$ac_help" ++ fi ++ exit 0 ;; ++ ++ -host | --host | --hos | --ho) ++ ac_prev=host ;; ++ -host=* | --host=* | --hos=* | --ho=*) ++ host="$ac_optarg" ;; ++ ++ -includedir | --includedir | --includedi | --included | --include \ ++ | --includ | --inclu | --incl | --inc) ++ ac_prev=includedir ;; ++ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ ++ | --includ=* | --inclu=* | --incl=* | --inc=*) ++ includedir="$ac_optarg" ;; ++ ++ -infodir | --infodir | --infodi | --infod | --info | --inf) ++ ac_prev=infodir ;; ++ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) ++ infodir="$ac_optarg" ;; ++ ++ -libdir | --libdir | --libdi | --libd) ++ ac_prev=libdir ;; ++ -libdir=* | --libdir=* | --libdi=* | --libd=*) ++ libdir="$ac_optarg" ;; ++ ++ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ ++ | --libexe | --libex | --libe) ++ ac_prev=libexecdir ;; ++ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ ++ | --libexe=* | --libex=* | --libe=*) ++ libexecdir="$ac_optarg" ;; ++ ++ -localstatedir | --localstatedir | --localstatedi | --localstated \ ++ | --localstate | --localstat | --localsta | --localst \ ++ | --locals | --local | --loca | --loc | --lo) ++ ac_prev=localstatedir ;; ++ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ ++ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ ++ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) ++ localstatedir="$ac_optarg" ;; ++ ++ -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ++ ac_prev=mandir ;; ++ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) ++ mandir="$ac_optarg" ;; ++ ++ -nfp | --nfp | --nf) ++ # Obsolete; use --without-fp. ++ with_fp=no ;; ++ ++ -no-create | --no-create | --no-creat | --no-crea | --no-cre \ ++ | --no-cr | --no-c) ++ no_create=yes ;; ++ ++ -no-recursion | --no-recursion | --no-recursio | --no-recursi \ ++ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ++ no_recursion=yes ;; ++ ++ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ ++ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ ++ | --oldin | --oldi | --old | --ol | --o) ++ ac_prev=oldincludedir ;; ++ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ ++ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ ++ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) ++ oldincludedir="$ac_optarg" ;; ++ ++ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ++ ac_prev=prefix ;; ++ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ++ prefix="$ac_optarg" ;; ++ ++ -program-prefix | --program-prefix | --program-prefi | --program-pref \ ++ | --program-pre | --program-pr | --program-p) ++ ac_prev=program_prefix ;; ++ -program-prefix=* | --program-prefix=* | --program-prefi=* \ ++ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) ++ program_prefix="$ac_optarg" ;; ++ ++ -program-suffix | --program-suffix | --program-suffi | --program-suff \ ++ | --program-suf | --program-su | --program-s) ++ ac_prev=program_suffix ;; ++ -program-suffix=* | --program-suffix=* | --program-suffi=* \ ++ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) ++ program_suffix="$ac_optarg" ;; ++ ++ -program-transform-name | --program-transform-name \ ++ | --program-transform-nam | --program-transform-na \ ++ | --program-transform-n | --program-transform- \ ++ | --program-transform | --program-transfor \ ++ | --program-transfo | --program-transf \ ++ | --program-trans | --program-tran \ ++ | --progr-tra | --program-tr | --program-t) ++ ac_prev=program_transform_name ;; ++ -program-transform-name=* | --program-transform-name=* \ ++ | --program-transform-nam=* | --program-transform-na=* \ ++ | --program-transform-n=* | --program-transform-=* \ ++ | --program-transform=* | --program-transfor=* \ ++ | --program-transfo=* | --program-transf=* \ ++ | --program-trans=* | --program-tran=* \ ++ | --progr-tra=* | --program-tr=* | --program-t=*) ++ program_transform_name="$ac_optarg" ;; ++ ++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ ++ | -silent | --silent | --silen | --sile | --sil) ++ silent=yes ;; ++ ++ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ++ ac_prev=sbindir ;; ++ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ ++ | --sbi=* | --sb=*) ++ sbindir="$ac_optarg" ;; ++ ++ -sharedstatedir | --sharedstatedir | --sharedstatedi \ ++ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ ++ | --sharedst | --shareds | --shared | --share | --shar \ ++ | --sha | --sh) ++ ac_prev=sharedstatedir ;; ++ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ ++ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ ++ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ ++ | --sha=* | --sh=*) ++ sharedstatedir="$ac_optarg" ;; ++ ++ -site | --site | --sit) ++ ac_prev=site ;; ++ -site=* | --site=* | --sit=*) ++ site="$ac_optarg" ;; ++ ++ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ++ ac_prev=srcdir ;; ++ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ++ srcdir="$ac_optarg" ;; ++ ++ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ ++ | --syscon | --sysco | --sysc | --sys | --sy) ++ ac_prev=sysconfdir ;; ++ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ ++ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) ++ sysconfdir="$ac_optarg" ;; ++ ++ -target | --target | --targe | --targ | --tar | --ta | --t) ++ ac_prev=target ;; ++ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) ++ target="$ac_optarg" ;; ++ ++ -v | -verbose | --verbose | --verbos | --verbo | --verb) ++ verbose=yes ;; ++ ++ -version | --version | --versio | --versi | --vers) ++ echo "configure generated by autoconf version 2.13" ++ exit 0 ;; ++ ++ -with-* | --with-*) ++ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` ++ # Reject names that are not valid shell variable names. ++ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then ++ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } ++ fi ++ ac_package=`echo $ac_package| sed 's/-/_/g'` ++ case "$ac_option" in ++ *=*) ;; ++ *) ac_optarg=yes ;; ++ esac ++ eval "with_${ac_package}='$ac_optarg'" ;; ++ ++ -without-* | --without-*) ++ ac_package=`echo $ac_option|sed -e 's/-*without-//'` ++ # Reject names that are not valid shell variable names. ++ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then ++ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } ++ fi ++ ac_package=`echo $ac_package| sed 's/-/_/g'` ++ eval "with_${ac_package}=no" ;; ++ ++ --x) ++ # Obsolete; use --with-x. ++ with_x=yes ;; ++ ++ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ ++ | --x-incl | --x-inc | --x-in | --x-i) ++ ac_prev=x_includes ;; ++ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ ++ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) ++ x_includes="$ac_optarg" ;; ++ ++ -x-libraries | --x-libraries | --x-librarie | --x-librari \ ++ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ++ ac_prev=x_libraries ;; ++ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ ++ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) ++ x_libraries="$ac_optarg" ;; ++ ++ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ++ ;; ++ ++ *) ++ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then ++ echo "configure: warning: $ac_option: invalid host type" 1>&2 ++ fi ++ if test "x$nonopt" != xNONE; then ++ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ++ fi ++ nonopt="$ac_option" ++ ;; ++ ++ esac ++done ++ ++if test -n "$ac_prev"; then ++ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } ++fi ++ ++trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 ++ ++# File descriptor usage: ++# 0 standard input ++# 1 file creation ++# 2 errors and warnings ++# 3 some systems may open it to /dev/tty ++# 4 used on the Kubota Titan ++# 6 checking for... messages and results ++# 5 compiler messages saved in config.log ++if test "$silent" = yes; then ++ exec 6>/dev/null ++else ++ exec 6>&1 ++fi ++exec 5>./config.log ++ ++echo "\ ++This file contains any messages produced by compilers while ++running configure, to aid debugging if configure makes a mistake. ++" 1>&5 ++ ++# Strip out --no-create and --no-recursion so they do not pile up. ++# Also quote any args containing shell metacharacters. ++ac_configure_args= ++for ac_arg ++do ++ case "$ac_arg" in ++ -no-create | --no-create | --no-creat | --no-crea | --no-cre \ ++ | --no-cr | --no-c) ;; ++ -no-recursion | --no-recursion | --no-recursio | --no-recursi \ ++ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; ++ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ++ ac_configure_args="$ac_configure_args '$ac_arg'" ;; ++ *) ac_configure_args="$ac_configure_args $ac_arg" ;; ++ esac ++done ++ ++# NLS nuisances. ++# Only set these to C if already set. These must not be set unconditionally ++# because not all systems understand e.g. LANG=C (notably SCO). ++# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! ++# Non-C LC_CTYPE values break the ctype check. ++if test "${LANG+set}" = set; then LANG=C; export LANG; fi ++if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi ++if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi ++if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi ++ ++# confdefs.h avoids OS command line length limits that DEFS can exceed. ++rm -rf conftest* confdefs.h ++# AIX cpp loses on an empty file, so make sure it contains at least a newline. ++echo > confdefs.h ++ ++# A filename unique to this package, relative to the directory that ++# configure is in, which we can look for to find out if srcdir is correct. ++ac_unique_file=crt0.c ++ ++# Find the source files, if location was not specified. ++if test -z "$srcdir"; then ++ ac_srcdir_defaulted=yes ++ # Try the directory containing this script, then its parent. ++ ac_prog=$0 ++ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` ++ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. ++ srcdir=$ac_confdir ++ if test ! -r $srcdir/$ac_unique_file; then ++ srcdir=.. ++ fi ++else ++ ac_srcdir_defaulted=no ++fi ++if test ! -r $srcdir/$ac_unique_file; then ++ if test "$ac_srcdir_defaulted" = yes; then ++ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } ++ else ++ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } ++ fi ++fi ++srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` ++ ++# Prefer explicitly selected file to automatically selected ones. ++if test -z "$CONFIG_SITE"; then ++ if test "x$prefix" != xNONE; then ++ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" ++ else ++ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" ++ fi ++fi ++for ac_site_file in $CONFIG_SITE; do ++ if test -r "$ac_site_file"; then ++ echo "loading site script $ac_site_file" ++ . "$ac_site_file" ++ fi ++done ++ ++if test -r "$cache_file"; then ++ echo "loading cache $cache_file" ++ . $cache_file ++else ++ echo "creating cache $cache_file" ++ > $cache_file ++fi ++ ++ac_ext=c ++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++cross_compiling=$ac_cv_prog_cc_cross ++ ++ac_exeext= ++ac_objext=o ++if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then ++ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. ++ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ++ ac_n= ac_c=' ++' ac_t=' ' ++ else ++ ac_n=-n ac_c= ac_t= ++ fi ++else ++ ac_n= ac_c='\c' ac_t= ++fi ++ ++ ++ ++ac_aux_dir= ++for ac_dir in ../../../.. $srcdir/../../../..; do ++ if test -f $ac_dir/install-sh; then ++ ac_aux_dir=$ac_dir ++ ac_install_sh="$ac_aux_dir/install-sh -c" ++ break ++ elif test -f $ac_dir/install.sh; then ++ ac_aux_dir=$ac_dir ++ ac_install_sh="$ac_aux_dir/install.sh -c" ++ break ++ fi ++done ++if test -z "$ac_aux_dir"; then ++ { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } ++fi ++ac_config_guess=$ac_aux_dir/config.guess ++ac_config_sub=$ac_aux_dir/config.sub ++ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. ++ ++ ++am__api_version="1.4" ++# Find a good install program. We prefer a C program (faster), ++# so one script is as good as another. But avoid the broken or ++# incompatible versions: ++# SysV /etc/install, /usr/sbin/install ++# SunOS /usr/etc/install ++# IRIX /sbin/install ++# AIX /bin/install ++# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag ++# AFS /usr/afsws/bin/install, which mishandles nonexistent args ++# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" ++# ./install, which can be erroneously created by make from ./install.sh. ++echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ++echo "configure:582: checking for a BSD compatible install" >&5 ++if test -z "$INSTALL"; then ++if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" ++ for ac_dir in $PATH; do ++ # Account for people who put trailing slashes in PATH elements. ++ case "$ac_dir/" in ++ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; ++ *) ++ # OSF1 and SCO ODT 3.0 have their own names for install. ++ # Don't use installbsd from OSF since it installs stuff as root ++ # by default. ++ for ac_prog in ginstall scoinst install; do ++ if test -f $ac_dir/$ac_prog; then ++ if test $ac_prog = install && ++ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then ++ # AIX install. It has an incompatible calling convention. ++ : ++ else ++ ac_cv_path_install="$ac_dir/$ac_prog -c" ++ break 2 ++ fi ++ fi ++ done ++ ;; ++ esac ++ done ++ IFS="$ac_save_IFS" ++ ++fi ++ if test "${ac_cv_path_install+set}" = set; then ++ INSTALL="$ac_cv_path_install" ++ else ++ # As a last resort, use the slow shell script. We don't cache a ++ # path for INSTALL within a source directory, because that will ++ # break other packages using the cache if that directory is ++ # removed, or if the path is relative. ++ INSTALL="$ac_install_sh" ++ fi ++fi ++echo "$ac_t""$INSTALL" 1>&6 ++ ++# Use test -z because SunOS4 sh mishandles braces in ${var-val}. ++# It thinks the first close brace ends the variable substitution. ++test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' ++ ++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' ++ ++test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' ++ ++echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 ++echo "configure:635: checking whether build environment is sane" >&5 ++# Just in case ++sleep 1 ++echo timestamp > conftestfile ++# Do `set' in a subshell so we don't clobber the current shell's ++# arguments. Must try -L first in case configure is actually a ++# symlink; some systems play weird games with the mod time of symlinks ++# (eg FreeBSD returns the mod time of the symlink's containing ++# directory). ++if ( ++ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` ++ if test "$*" = "X"; then ++ # -L didn't work. ++ set X `ls -t $srcdir/configure conftestfile` ++ fi ++ if test "$*" != "X $srcdir/configure conftestfile" \ ++ && test "$*" != "X conftestfile $srcdir/configure"; then ++ ++ # If neither matched, then we have a broken ls. This can happen ++ # if, for instance, CONFIG_SHELL is bash and it inherits a ++ # broken ls alias from the environment. This has actually ++ # happened. Such a system could not be considered "sane". ++ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken ++alias in your environment" 1>&2; exit 1; } ++ fi ++ ++ test "$2" = conftestfile ++ ) ++then ++ # Ok. ++ : ++else ++ { echo "configure: error: newly created file is older than distributed files! ++Check your system clock" 1>&2; exit 1; } ++fi ++rm -f conftest* ++echo "$ac_t""yes" 1>&6 ++if test "$program_transform_name" = s,x,x,; then ++ program_transform_name= ++else ++ # Double any \ or $. echo might interpret backslashes. ++ cat <<\EOF_SED > conftestsed ++s,\\,\\\\,g; s,\$,$$,g ++EOF_SED ++ program_transform_name="`echo $program_transform_name|sed -f conftestsed`" ++ rm -f conftestsed ++fi ++test "$program_prefix" != NONE && ++ program_transform_name="s,^,${program_prefix},; $program_transform_name" ++# Use a double $ so make ignores it. ++test "$program_suffix" != NONE && ++ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" ++ ++# sed with no file args requires a program. ++test "$program_transform_name" = "" && program_transform_name="s,x,x," ++ ++echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ++echo "configure:692: checking whether ${MAKE-make} sets \${MAKE}" >&5 ++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftestmake <<\EOF ++all: ++ @echo 'ac_maketemp="${MAKE}"' ++EOF ++# GNU make sometimes prints "make[1]: Entering...", which would confuse us. ++eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` ++if test -n "$ac_maketemp"; then ++ eval ac_cv_prog_make_${ac_make}_set=yes ++else ++ eval ac_cv_prog_make_${ac_make}_set=no ++fi ++rm -f conftestmake ++fi ++if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ SET_MAKE= ++else ++ echo "$ac_t""no" 1>&6 ++ SET_MAKE="MAKE=${MAKE-make}" ++fi ++ ++if test $host != $build; then ++ ac_tool_prefix=${host_alias}- ++else ++ ac_tool_prefix= ++fi ++ ++echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 ++echo "configure:725: checking for Cygwin environment" >&5 ++if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ac_cv_cygwin=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_cygwin=no ++fi ++rm -f conftest* ++rm -f conftest* ++fi ++ ++echo "$ac_t""$ac_cv_cygwin" 1>&6 ++CYGWIN= ++test "$ac_cv_cygwin" = yes && CYGWIN=yes ++echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 ++echo "configure:758: checking for mingw32 environment" >&5 ++if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ac_cv_mingw32=yes ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_mingw32=no ++fi ++rm -f conftest* ++rm -f conftest* ++fi ++ ++echo "$ac_t""$ac_cv_mingw32" 1>&6 ++MINGW32= ++test "$ac_cv_mingw32" = yes && MINGW32=yes ++ ++# Check whether --enable-multilib or --disable-multilib was given. ++if test "${enable_multilib+set}" = set; then ++ enableval="$enable_multilib" ++ case "${enableval}" in ++ yes) multilib=yes ;; ++ no) multilib=no ;; ++ *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; ++ esac ++else ++ multilib=yes ++fi ++ ++# Check whether --enable-target-optspace or --disable-target-optspace was given. ++if test "${enable_target_optspace+set}" = set; then ++ enableval="$enable_target_optspace" ++ case "${enableval}" in ++ yes) target_optspace=yes ;; ++ no) target_optspace=no ;; ++ *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; ++ esac ++else ++ target_optspace= ++fi ++ ++# Check whether --enable-malloc-debugging or --disable-malloc-debugging was given. ++if test "${enable_malloc_debugging+set}" = set; then ++ enableval="$enable_malloc_debugging" ++ case "${enableval}" in ++ yes) malloc_debugging=yes ;; ++ no) malloc_debugging=no ;; ++ *) { echo "configure: error: bad value ${enableval} for malloc-debugging option" 1>&2; exit 1; } ;; ++ esac ++else ++ malloc_debugging= ++fi ++ ++# Check whether --enable-newlib-mb or --disable-newlib-mb was given. ++if test "${enable_newlib_mb+set}" = set; then ++ enableval="$enable_newlib_mb" ++ case "${enableval}" in ++ yes) newlib_mb=yes ;; ++ no) newlib_mb=no ;; ++ *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; ++ esac ++else ++ newlib_mb= ++fi ++ ++# Check whether --enable-newlib-iconv or --disable-newlib-iconv was given. ++if test "${enable_newlib_iconv+set}" = set; then ++ enableval="$enable_newlib_iconv" ++ case "${enableval}" in ++ yes) newlib_iconv=yes ;; ++ no) newlib_iconv=no ;; ++ *) { echo "configure: error: bad value ${enableval} for newlib-iconv option" 1>&2; exit 1; } ;; ++ esac ++else ++ newlib_iconv= ++fi ++ ++# Check whether --enable-newlib-builtin-converters or --disable-newlib-builtin-converters was given. ++if test "${enable_newlib_builtin_converters+set}" = set; then ++ enableval="$enable_newlib_builtin_converters" ++ if test x${enableval} = x; then ++ { echo "configure: error: bad value ${enableval} for newlib-builtin-converters option - use comma-separated list" 1>&2; exit 1; } ++ fi ++ builtin_converters=${enableval} ++ ++else ++ builtin_converters= ++fi ++ ++# Check whether --enable-newlib-multithread or --disable-newlib-multithread was given. ++if test "${enable_newlib_multithread+set}" = set; then ++ enableval="$enable_newlib_multithread" ++ case "${enableval}" in ++ yes) newlib_multithread=yes ;; ++ no) newlib_multithread=no ;; ++ *) { echo "configure: error: bad value ${enableval} for newlib-multithread option" 1>&2; exit 1; } ;; ++ esac ++else ++ newlib_multithread=yes ++fi ++ ++# Check whether --enable-newlib-elix-level or --disable-newlib-elix-level was given. ++if test "${enable_newlib_elix_level+set}" = set; then ++ enableval="$enable_newlib_elix_level" ++ case "${enableval}" in ++ 0) newlib_elix_level=0 ;; ++ 1) newlib_elix_level=1 ;; ++ 2) newlib_elix_level=2 ;; ++ 3) newlib_elix_level=3 ;; ++ 4) newlib_elix_level=4 ;; ++ *) { echo "configure: error: bad value ${enableval} for newlib-elix-level option" 1>&2; exit 1; } ;; ++ esac ++else ++ newlib_elix_level=0 ++fi ++ ++# Check whether --enable-newlib-io-float or --disable-newlib-io-float was given. ++if test "${enable_newlib_io_float+set}" = set; then ++ enableval="$enable_newlib_io_float" ++ case "${enableval}" in ++ yes) newlib_io_float=yes ;; ++ no) newlib_io_float=no ;; ++ *) { echo "configure: error: bad value ${enableval} for newlib-io-float option" 1>&2; exit 1; } ;; ++ esac ++else ++ newlib_io_float=yes ++fi ++ ++# Check whether --enable-newlib-supplied-syscalls or --disable-newlib-supplied-syscalls was given. ++if test "${enable_newlib_supplied_syscalls+set}" = set; then ++ enableval="$enable_newlib_supplied_syscalls" ++ case "${enableval}" in ++ yes) newlib_may_supply_syscalls=yes ;; ++ no) newlib_may_supply_syscalls=no ;; ++ *) { echo "configure: error: bad value ${enableval} for newlib-supplied-syscalls option" 1>&2; exit 1; } ;; ++ esac ++else ++ newlib_may_supply_syscalls=yes ++fi ++ ++ ++ ++if test x${newlib_may_supply_syscalls} = xyes; then ++ MAY_SUPPLY_SYSCALLS_TRUE= ++ MAY_SUPPLY_SYSCALLS_FALSE='#' ++else ++ MAY_SUPPLY_SYSCALLS_TRUE='#' ++ MAY_SUPPLY_SYSCALLS_FALSE= ++fi ++ ++ ++test -z "${with_target_subdir}" && with_target_subdir=. ++ ++if test "${srcdir}" = "."; then ++ if test "${with_target_subdir}" != "."; then ++ newlib_basedir="${srcdir}/${with_multisrctop}../../../.." ++ else ++ newlib_basedir="${srcdir}/${with_multisrctop}../../.." ++ fi ++else ++ newlib_basedir="${srcdir}/../../.." ++fi ++ ++ ++ ++# Do some error checking and defaulting for the host and target type. ++# The inputs are: ++# configure --host=HOST --target=TARGET --build=BUILD NONOPT ++# ++# The rules are: ++# 1. You are not allowed to specify --host, --target, and nonopt at the ++# same time. ++# 2. Host defaults to nonopt. ++# 3. If nonopt is not specified, then host defaults to the current host, ++# as determined by config.guess. ++# 4. Target and build default to nonopt. ++# 5. If nonopt is not specified, then target and build default to host. ++ ++# The aliases save the names the user supplied, while $host etc. ++# will get canonicalized. ++case $host---$target---$nonopt in ++NONE---*---* | *---NONE---* | *---*---NONE) ;; ++*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; ++esac ++ ++ ++# Make sure we can run config.sub. ++if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : ++else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } ++fi ++ ++echo $ac_n "checking host system type""... $ac_c" 1>&6 ++echo "configure:962: checking host system type" >&5 ++ ++host_alias=$host ++case "$host_alias" in ++NONE) ++ case $nonopt in ++ NONE) ++ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : ++ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } ++ fi ;; ++ *) host_alias=$nonopt ;; ++ esac ;; ++esac ++ ++host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` ++host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` ++host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` ++host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` ++echo "$ac_t""$host" 1>&6 ++ ++echo $ac_n "checking target system type""... $ac_c" 1>&6 ++echo "configure:983: checking target system type" >&5 ++ ++target_alias=$target ++case "$target_alias" in ++NONE) ++ case $nonopt in ++ NONE) target_alias=$host_alias ;; ++ *) target_alias=$nonopt ;; ++ esac ;; ++esac ++ ++target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` ++target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` ++target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` ++target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` ++echo "$ac_t""$target" 1>&6 ++ ++echo $ac_n "checking build system type""... $ac_c" 1>&6 ++echo "configure:1001: checking build system type" >&5 ++ ++build_alias=$build ++case "$build_alias" in ++NONE) ++ case $nonopt in ++ NONE) build_alias=$host_alias ;; ++ *) build_alias=$nonopt ;; ++ esac ;; ++esac ++ ++build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` ++build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` ++build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` ++build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` ++echo "$ac_t""$build" 1>&6 ++ ++test "$host_alias" != "$target_alias" && ++ test "$program_prefix$program_suffix$program_transform_name" = \ ++ NONENONEs,x,x, && ++ program_prefix=${target_alias}- ++ ++ ++ ++PACKAGE=newlib ++ ++VERSION=1.12.0 ++ ++if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then ++ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } ++fi ++cat >> confdefs.h <> confdefs.h <&6 ++echo "configure:1044: checking for working aclocal-${am__api_version}" >&5 ++# Run test in a subshell; some versions of sh will print an error if ++# an executable is not found, even if stderr is redirected. ++# Redirect stdin to placate older versions of autoconf. Sigh. ++if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then ++ ACLOCAL=aclocal-${am__api_version} ++ echo "$ac_t""found" 1>&6 ++else ++ ACLOCAL="$missing_dir/missing aclocal-${am__api_version}" ++ echo "$ac_t""missing" 1>&6 ++fi ++ ++echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 ++echo "configure:1057: checking for working autoconf" >&5 ++# Run test in a subshell; some versions of sh will print an error if ++# an executable is not found, even if stderr is redirected. ++# Redirect stdin to placate older versions of autoconf. Sigh. ++if (autoconf --version) < /dev/null > /dev/null 2>&1; then ++ AUTOCONF=autoconf ++ echo "$ac_t""found" 1>&6 ++else ++ AUTOCONF="$missing_dir/missing autoconf" ++ echo "$ac_t""missing" 1>&6 ++fi ++ ++echo $ac_n "checking for working automake-${am__api_version}""... $ac_c" 1>&6 ++echo "configure:1070: checking for working automake-${am__api_version}" >&5 ++# Run test in a subshell; some versions of sh will print an error if ++# an executable is not found, even if stderr is redirected. ++# Redirect stdin to placate older versions of autoconf. Sigh. ++if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then ++ AUTOMAKE=automake-${am__api_version} ++ echo "$ac_t""found" 1>&6 ++else ++ AUTOMAKE="$missing_dir/missing automake-${am__api_version}" ++ echo "$ac_t""missing" 1>&6 ++fi ++ ++echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 ++echo "configure:1083: checking for working autoheader" >&5 ++# Run test in a subshell; some versions of sh will print an error if ++# an executable is not found, even if stderr is redirected. ++# Redirect stdin to placate older versions of autoconf. Sigh. ++if (autoheader --version) < /dev/null > /dev/null 2>&1; then ++ AUTOHEADER=autoheader ++ echo "$ac_t""found" 1>&6 ++else ++ AUTOHEADER="$missing_dir/missing autoheader" ++ echo "$ac_t""missing" 1>&6 ++fi ++ ++echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 ++echo "configure:1096: checking for working makeinfo" >&5 ++# Run test in a subshell; some versions of sh will print an error if ++# an executable is not found, even if stderr is redirected. ++# Redirect stdin to placate older versions of autoconf. Sigh. ++if (makeinfo --version) < /dev/null > /dev/null 2>&1; then ++ MAKEINFO=makeinfo ++ echo "$ac_t""found" 1>&6 ++else ++ MAKEINFO="$missing_dir/missing makeinfo" ++ echo "$ac_t""missing" 1>&6 ++fi ++ ++ ++ ++# FIXME: We temporarily define our own version of AC_PROG_CC. This is ++# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We ++# are probably using a cross compiler, which will not be able to fully ++# link an executable. This should really be fixed in autoconf ++# itself. ++ ++ ++ ++# Extract the first word of "gcc", so it can be a program name with args. ++set dummy gcc; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:1121: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test -n "$CC"; then ++ ac_cv_prog_CC="$CC" # Let the user override the test. ++else ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_CC="gcc" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" ++fi ++fi ++CC="$ac_cv_prog_CC" ++if test -n "$CC"; then ++ echo "$ac_t""$CC" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++if test -z "$CC"; then ++ # Extract the first word of "cc", so it can be a program name with args. ++set dummy cc; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:1151: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test -n "$CC"; then ++ ac_cv_prog_CC="$CC" # Let the user override the test. ++else ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_prog_rejected=no ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ++ ac_prog_rejected=yes ++ continue ++ fi ++ ac_cv_prog_CC="cc" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" ++if test $ac_prog_rejected = yes; then ++ # We found a bogon in the path, so make sure we never use it. ++ set dummy $ac_cv_prog_CC ++ shift ++ if test $# -gt 0; then ++ # We chose a different compiler from the bogus one. ++ # However, it has the same basename, so the bogon will be chosen ++ # first if we set CC to just the basename; use the full file name. ++ shift ++ set dummy "$ac_dir/$ac_word" "$@" ++ shift ++ ac_cv_prog_CC="$@" ++ fi ++fi ++fi ++fi ++CC="$ac_cv_prog_CC" ++if test -n "$CC"; then ++ echo "$ac_t""$CC" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } ++fi ++ ++echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ++echo "configure:1200: checking whether we are using GNU C" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++ ac_cv_prog_gcc=yes ++else ++ ac_cv_prog_gcc=no ++fi ++fi ++ ++echo "$ac_t""$ac_cv_prog_gcc" 1>&6 ++ ++if test $ac_cv_prog_gcc = yes; then ++ GCC=yes ++ ac_test_CFLAGS="${CFLAGS+set}" ++ ac_save_CFLAGS="$CFLAGS" ++ CFLAGS= ++ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ++echo "configure:1224: checking whether ${CC-cc} accepts -g" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ echo 'void f(){}' > conftest.c ++if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ++ ac_cv_prog_cc_g=yes ++else ++ ac_cv_prog_cc_g=no ++fi ++rm -f conftest* ++ ++fi ++ ++echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 ++ if test "$ac_test_CFLAGS" = set; then ++ CFLAGS="$ac_save_CFLAGS" ++ elif test $ac_cv_prog_cc_g = yes; then ++ CFLAGS="-g -O2" ++ else ++ CFLAGS="-O2" ++ fi ++else ++ GCC= ++ test "${CFLAGS+set}" = set || CFLAGS="-g" ++fi ++ ++ ++# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. ++set dummy ${ac_tool_prefix}as; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:1255: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test -n "$AS"; then ++ ac_cv_prog_AS="$AS" # Let the user override the test. ++else ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_AS="${ac_tool_prefix}as" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" ++ test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" ++fi ++fi ++AS="$ac_cv_prog_AS" ++if test -n "$AS"; then ++ echo "$ac_t""$AS" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ ++ ++# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. ++set dummy ${ac_tool_prefix}ar; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:1287: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test -n "$AR"; then ++ ac_cv_prog_AR="$AR" # Let the user override the test. ++else ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_AR="${ac_tool_prefix}ar" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" ++ test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" ++fi ++fi ++AR="$ac_cv_prog_AR" ++if test -n "$AR"; then ++ echo "$ac_t""$AR" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ ++ ++# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. ++set dummy ${ac_tool_prefix}ranlib; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:1319: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test -n "$RANLIB"; then ++ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. ++else ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" ++fi ++fi ++RANLIB="$ac_cv_prog_RANLIB" ++if test -n "$RANLIB"; then ++ echo "$ac_t""$RANLIB" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++ ++if test -z "$ac_cv_prog_RANLIB"; then ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "ranlib", so it can be a program name with args. ++set dummy ranlib; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:1351: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test -n "$RANLIB"; then ++ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. ++else ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_RANLIB="ranlib" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" ++ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" ++fi ++fi ++RANLIB="$ac_cv_prog_RANLIB" ++if test -n "$RANLIB"; then ++ echo "$ac_t""$RANLIB" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 ++fi ++ ++else ++ RANLIB=":" ++fi ++fi ++ ++ ++# Find a good install program. We prefer a C program (faster), ++# so one script is as good as another. But avoid the broken or ++# incompatible versions: ++# SysV /etc/install, /usr/sbin/install ++# SunOS /usr/etc/install ++# IRIX /sbin/install ++# AIX /bin/install ++# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag ++# AFS /usr/afsws/bin/install, which mishandles nonexistent args ++# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" ++# ./install, which can be erroneously created by make from ./install.sh. ++echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ++echo "configure:1396: checking for a BSD compatible install" >&5 ++if test -z "$INSTALL"; then ++if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" ++ for ac_dir in $PATH; do ++ # Account for people who put trailing slashes in PATH elements. ++ case "$ac_dir/" in ++ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; ++ *) ++ # OSF1 and SCO ODT 3.0 have their own names for install. ++ # Don't use installbsd from OSF since it installs stuff as root ++ # by default. ++ for ac_prog in ginstall scoinst install; do ++ if test -f $ac_dir/$ac_prog; then ++ if test $ac_prog = install && ++ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then ++ # AIX install. It has an incompatible calling convention. ++ : ++ else ++ ac_cv_path_install="$ac_dir/$ac_prog -c" ++ break 2 ++ fi ++ fi ++ done ++ ;; ++ esac ++ done ++ IFS="$ac_save_IFS" ++ ++fi ++ if test "${ac_cv_path_install+set}" = set; then ++ INSTALL="$ac_cv_path_install" ++ else ++ # As a last resort, use the slow shell script. We don't cache a ++ # path for INSTALL within a source directory, because that will ++ # break other packages using the cache if that directory is ++ # removed, or if the path is relative. ++ INSTALL="$ac_install_sh" ++ fi ++fi ++echo "$ac_t""$INSTALL" 1>&6 ++ ++# Use test -z because SunOS4 sh mishandles braces in ${var-val}. ++# It thinks the first close brace ends the variable substitution. ++test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' ++ ++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' ++ ++test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' ++ ++ ++echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ++echo "configure:1450: checking whether to enable maintainer-specific portions of Makefiles" >&5 ++ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. ++if test "${enable_maintainer_mode+set}" = set; then ++ enableval="$enable_maintainer_mode" ++ USE_MAINTAINER_MODE=$enableval ++else ++ USE_MAINTAINER_MODE=no ++fi ++ ++ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 ++ ++ ++if test $USE_MAINTAINER_MODE = yes; then ++ MAINTAINER_MODE_TRUE= ++ MAINTAINER_MODE_FALSE='#' ++else ++ MAINTAINER_MODE_TRUE='#' ++ MAINTAINER_MODE_FALSE= ++fi ++ MAINT=$MAINTAINER_MODE_TRUE ++ ++ ++ ++# We need AC_EXEEXT to keep automake happy in cygnus mode. However, ++# at least currently, we never actually build a program, so we never ++# need to use $(EXEEXT). Moreover, the test for EXEEXT normally ++# fails, because we are probably configuring with a cross compiler ++# which can't create executables. So we include AC_EXEEXT to keep ++# automake happy, but we don't execute it, since we don't care about ++# the result. ++if false; then ++ ++ ++echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ++echo "configure:1484: checking for executable suffix" >&5 ++if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then ++ ac_cv_exeext=.exe ++else ++ rm -f conftest* ++ echo 'int main () { return 0; }' > conftest.$ac_ext ++ ac_cv_exeext= ++ if { (eval echo configure:1494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then ++ for file in conftest.*; do ++ case $file in ++ *.c | *.o | *.obj) ;; ++ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; ++ esac ++ done ++ else ++ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } ++ fi ++ rm -f conftest* ++ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no ++fi ++fi ++ ++EXEEXT="" ++test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} ++echo "$ac_t""${ac_cv_exeext}" 1>&6 ++ac_exeext=$EXEEXT ++ ++fi ++ ++. ${newlib_basedir}/configure.host ++ ++newlib_cflags="${newlib_cflags} -fno-builtin" ++ ++NEWLIB_CFLAGS=${newlib_cflags} ++ ++ ++LDFLAGS=${ldflags} ++ ++ ++ ++ ++if test x${newlib_elix_level} = x0; then ++ ELIX_LEVEL_0_TRUE= ++ ELIX_LEVEL_0_FALSE='#' ++else ++ ELIX_LEVEL_0_TRUE='#' ++ ELIX_LEVEL_0_FALSE= ++fi ++ ++ ++if test x${newlib_elix_level} = x1; then ++ ELIX_LEVEL_1_TRUE= ++ ELIX_LEVEL_1_FALSE='#' ++else ++ ELIX_LEVEL_1_TRUE='#' ++ ELIX_LEVEL_1_FALSE= ++fi ++ ++ ++if test x${newlib_elix_level} = x2; then ++ ELIX_LEVEL_2_TRUE= ++ ELIX_LEVEL_2_FALSE='#' ++else ++ ELIX_LEVEL_2_TRUE='#' ++ ELIX_LEVEL_2_FALSE= ++fi ++ ++ ++if test x${newlib_elix_level} = x3; then ++ ELIX_LEVEL_3_TRUE= ++ ELIX_LEVEL_3_FALSE='#' ++else ++ ELIX_LEVEL_3_TRUE='#' ++ ELIX_LEVEL_3_FALSE= ++fi ++ ++ ++if test x${newlib_elix_level} = x4; then ++ ELIX_LEVEL_4_TRUE= ++ ELIX_LEVEL_4_FALSE='#' ++else ++ ELIX_LEVEL_4_TRUE='#' ++ ELIX_LEVEL_4_FALSE= ++fi ++ ++ ++ ++if test x${use_libtool} = xyes; then ++ USE_LIBTOOL_TRUE= ++ USE_LIBTOOL_FALSE='#' ++else ++ USE_LIBTOOL_TRUE='#' ++ USE_LIBTOOL_FALSE= ++fi ++ ++# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we ++# use oext, which is set in configure.host based on the target platform. ++OBJEXT=${oext} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++trap '' 1 2 15 ++cat > confcache <<\EOF ++# This file is a shell script that caches the results of configure ++# tests run on this system so they can be shared between configure ++# scripts and configure runs. It is not useful on other systems. ++# If it contains results you don't want to keep, you may remove or edit it. ++# ++# By default, configure uses ./config.cache as the cache file, ++# creating it if it does not exist already. You can give configure ++# the --cache-file=FILE option to use a different cache file; that is ++# what configure does when it calls configure scripts in ++# subdirectories, so they share the cache. ++# Giving --cache-file=/dev/null disables caching, for debugging configure. ++# config.status only pays attention to the cache file if you give it the ++# --recheck option to rerun configure. ++# ++EOF ++# The following way of writing the cache mishandles newlines in values, ++# but we know of no workaround that is simple, portable, and efficient. ++# So, don't put newlines in cache variables' values. ++# Ultrix sh set writes to stderr and can't be redirected directly, ++# and sets the high bit in the cache file unless we assign to the vars. ++(set) 2>&1 | ++ case `(ac_space=' '; set | grep ac_space) 2>&1` in ++ *ac_space=\ *) ++ # `set' does not quote correctly, so add quotes (double-quote substitution ++ # turns \\\\ into \\, and sed turns \\ into \). ++ sed -n \ ++ -e "s/'/'\\\\''/g" \ ++ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ++ ;; ++ *) ++ # `set' quotes correctly as required by POSIX, so do not add quotes. ++ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ++ ;; ++ esac >> confcache ++if cmp -s $cache_file confcache; then ++ : ++else ++ if test -w $cache_file; then ++ echo "updating cache $cache_file" ++ cat confcache > $cache_file ++ else ++ echo "not updating unwritable cache $cache_file" ++ fi ++fi ++rm -f confcache ++ ++trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 ++ ++test "x$prefix" = xNONE && prefix=$ac_default_prefix ++# Let make expand exec_prefix. ++test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' ++ ++# Any assignment to VPATH causes Sun make to only execute ++# the first set of double-colon rules, so remove it if not needed. ++# If there is a colon in the path, we need to keep it. ++if test "x$srcdir" = x.; then ++ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' ++fi ++ ++trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 ++ ++# Transform confdefs.h into DEFS. ++# Protect against shell expansion while executing Makefile rules. ++# Protect against Makefile macro expansion. ++cat > conftest.defs <<\EOF ++s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g ++s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g ++s%\[%\\&%g ++s%\]%\\&%g ++s%\$%$$%g ++EOF ++DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` ++rm -f conftest.defs ++ ++ ++# Without the "./", some shells look in PATH for config.status. ++: ${CONFIG_STATUS=./config.status} ++ ++echo creating $CONFIG_STATUS ++rm -f $CONFIG_STATUS ++cat > $CONFIG_STATUS </dev/null | sed 1q`: ++# ++# $0 $ac_configure_args ++# ++# Compiler output produced by configure, useful for debugging ++# configure, is in ./config.log if it exists. ++ ++ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" ++for ac_option ++do ++ case "\$ac_option" in ++ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ++ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" ++ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; ++ -version | --version | --versio | --versi | --vers | --ver | --ve | --v) ++ echo "$CONFIG_STATUS generated by autoconf version 2.13" ++ exit 0 ;; ++ -help | --help | --hel | --he | --h) ++ echo "\$ac_cs_usage"; exit 0 ;; ++ *) echo "\$ac_cs_usage"; exit 1 ;; ++ esac ++done ++ ++ac_given_srcdir=$srcdir ++ac_given_INSTALL="$INSTALL" ++ ++trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 ++EOF ++cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF ++$ac_vpsub ++$extrasub ++s%@SHELL@%$SHELL%g ++s%@CFLAGS@%$CFLAGS%g ++s%@CPPFLAGS@%$CPPFLAGS%g ++s%@CXXFLAGS@%$CXXFLAGS%g ++s%@FFLAGS@%$FFLAGS%g ++s%@DEFS@%$DEFS%g ++s%@LDFLAGS@%$LDFLAGS%g ++s%@LIBS@%$LIBS%g ++s%@exec_prefix@%$exec_prefix%g ++s%@prefix@%$prefix%g ++s%@program_transform_name@%$program_transform_name%g ++s%@bindir@%$bindir%g ++s%@sbindir@%$sbindir%g ++s%@libexecdir@%$libexecdir%g ++s%@datadir@%$datadir%g ++s%@sysconfdir@%$sysconfdir%g ++s%@sharedstatedir@%$sharedstatedir%g ++s%@localstatedir@%$localstatedir%g ++s%@libdir@%$libdir%g ++s%@includedir@%$includedir%g ++s%@oldincludedir@%$oldincludedir%g ++s%@infodir@%$infodir%g ++s%@mandir@%$mandir%g ++s%@MAY_SUPPLY_SYSCALLS_TRUE@%$MAY_SUPPLY_SYSCALLS_TRUE%g ++s%@MAY_SUPPLY_SYSCALLS_FALSE@%$MAY_SUPPLY_SYSCALLS_FALSE%g ++s%@newlib_basedir@%$newlib_basedir%g ++s%@host@%$host%g ++s%@host_alias@%$host_alias%g ++s%@host_cpu@%$host_cpu%g ++s%@host_vendor@%$host_vendor%g ++s%@host_os@%$host_os%g ++s%@target@%$target%g ++s%@target_alias@%$target_alias%g ++s%@target_cpu@%$target_cpu%g ++s%@target_vendor@%$target_vendor%g ++s%@target_os@%$target_os%g ++s%@build@%$build%g ++s%@build_alias@%$build_alias%g ++s%@build_cpu@%$build_cpu%g ++s%@build_vendor@%$build_vendor%g ++s%@build_os@%$build_os%g ++s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g ++s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g ++s%@INSTALL_DATA@%$INSTALL_DATA%g ++s%@PACKAGE@%$PACKAGE%g ++s%@VERSION@%$VERSION%g ++s%@ACLOCAL@%$ACLOCAL%g ++s%@AUTOCONF@%$AUTOCONF%g ++s%@AUTOMAKE@%$AUTOMAKE%g ++s%@AUTOHEADER@%$AUTOHEADER%g ++s%@MAKEINFO@%$MAKEINFO%g ++s%@SET_MAKE@%$SET_MAKE%g ++s%@CC@%$CC%g ++s%@AS@%$AS%g ++s%@AR@%$AR%g ++s%@RANLIB@%$RANLIB%g ++s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g ++s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g ++s%@MAINT@%$MAINT%g ++s%@EXEEXT@%$EXEEXT%g ++s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g ++s%@ELIX_LEVEL_0_TRUE@%$ELIX_LEVEL_0_TRUE%g ++s%@ELIX_LEVEL_0_FALSE@%$ELIX_LEVEL_0_FALSE%g ++s%@ELIX_LEVEL_1_TRUE@%$ELIX_LEVEL_1_TRUE%g ++s%@ELIX_LEVEL_1_FALSE@%$ELIX_LEVEL_1_FALSE%g ++s%@ELIX_LEVEL_2_TRUE@%$ELIX_LEVEL_2_TRUE%g ++s%@ELIX_LEVEL_2_FALSE@%$ELIX_LEVEL_2_FALSE%g ++s%@ELIX_LEVEL_3_TRUE@%$ELIX_LEVEL_3_TRUE%g ++s%@ELIX_LEVEL_3_FALSE@%$ELIX_LEVEL_3_FALSE%g ++s%@ELIX_LEVEL_4_TRUE@%$ELIX_LEVEL_4_TRUE%g ++s%@ELIX_LEVEL_4_FALSE@%$ELIX_LEVEL_4_FALSE%g ++s%@USE_LIBTOOL_TRUE@%$USE_LIBTOOL_TRUE%g ++s%@USE_LIBTOOL_FALSE@%$USE_LIBTOOL_FALSE%g ++s%@OBJEXT@%$OBJEXT%g ++s%@oext@%$oext%g ++s%@aext@%$aext%g ++s%@libm_machine_dir@%$libm_machine_dir%g ++s%@machine_dir@%$machine_dir%g ++s%@sys_dir@%$sys_dir%g ++ ++CEOF ++EOF ++ ++cat >> $CONFIG_STATUS <<\EOF ++ ++# Split the substitutions into bite-sized pieces for seds with ++# small command number limits, like on Digital OSF/1 and HP-UX. ++ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ++ac_file=1 # Number of current file. ++ac_beg=1 # First line for current file. ++ac_end=$ac_max_sed_cmds # Line after last line for current file. ++ac_more_lines=: ++ac_sed_cmds="" ++while $ac_more_lines; do ++ if test $ac_beg -gt 1; then ++ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file ++ else ++ sed "${ac_end}q" conftest.subs > conftest.s$ac_file ++ fi ++ if test ! -s conftest.s$ac_file; then ++ ac_more_lines=false ++ rm -f conftest.s$ac_file ++ else ++ if test -z "$ac_sed_cmds"; then ++ ac_sed_cmds="sed -f conftest.s$ac_file" ++ else ++ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" ++ fi ++ ac_file=`expr $ac_file + 1` ++ ac_beg=$ac_end ++ ac_end=`expr $ac_end + $ac_max_sed_cmds` ++ fi ++done ++if test -z "$ac_sed_cmds"; then ++ ac_sed_cmds=cat ++fi ++EOF ++ ++cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF ++for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then ++ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". ++ case "$ac_file" in ++ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ++ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; ++ *) ac_file_in="${ac_file}.in" ;; ++ esac ++ ++ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. ++ ++ # Remove last slash and all that follows it. Not all systems have dirname. ++ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` ++ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then ++ # The file is in a subdirectory. ++ test ! -d "$ac_dir" && mkdir "$ac_dir" ++ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" ++ # A "../" for each directory in $ac_dir_suffix. ++ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` ++ else ++ ac_dir_suffix= ac_dots= ++ fi ++ ++ case "$ac_given_srcdir" in ++ .) srcdir=. ++ if test -z "$ac_dots"; then top_srcdir=. ++ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; ++ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; ++ *) # Relative path. ++ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" ++ top_srcdir="$ac_dots$ac_given_srcdir" ;; ++ esac ++ ++ case "$ac_given_INSTALL" in ++ [/$]*) INSTALL="$ac_given_INSTALL" ;; ++ *) INSTALL="$ac_dots$ac_given_INSTALL" ;; ++ esac ++ ++ echo creating "$ac_file" ++ rm -f "$ac_file" ++ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." ++ case "$ac_file" in ++ *Makefile*) ac_comsub="1i\\ ++# $configure_input" ;; ++ *) ac_comsub= ;; ++ esac ++ ++ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` ++ sed -e "$ac_comsub ++s%@configure_input@%$configure_input%g ++s%@srcdir@%$srcdir%g ++s%@top_srcdir@%$top_srcdir%g ++s%@INSTALL@%$INSTALL%g ++" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file ++fi; done ++rm -f conftest.s* ++ ++EOF ++cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF ++ ++exit 0 ++EOF ++chmod +x $CONFIG_STATUS ++rm -fr confdefs* $ac_clean_files ++test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 ++ +diff -Nbaur newlib-1.12.0/newlib/libc/sys/ppcgekko/configure.in newlib-1.12.0-new/newlib/libc/sys/ppcgekko/configure.in +--- newlib-1.12.0/newlib/libc/sys/ppcgekko/configure.in Thu Jan 1 00:00:00 1970 ++++ newlib-1.12.0-new/newlib/libc/sys/ppcgekko/configure.in Thu Jan 20 20:21:39 2005 +@@ -0,0 +1,12 @@ ++dnl This is the newlib/libc/sys/ppcgekko configure.in file. ++dnl Process this file with autoconf to produce a configure script. ++ ++AC_PREREQ(2.5) ++AC_INIT(crt0.c) ++ ++dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. ++AC_CONFIG_AUX_DIR(../../../..) ++ ++NEWLIB_CONFIGURE(../../..) ++ ++AC_OUTPUT(Makefile) +diff -Nbaur newlib-1.12.0/newlib/libc/sys/ppcgekko/crt0.c newlib-1.12.0-new/newlib/libc/sys/ppcgekko/crt0.c +--- newlib-1.12.0/newlib/libc/sys/ppcgekko/crt0.c Thu Jan 1 00:00:00 1970 ++++ newlib-1.12.0-new/newlib/libc/sys/ppcgekko/crt0.c Thu Jan 20 20:21:39 2005 +@@ -0,0 +1,4 @@ ++/* I have a copy of something that would serve as a NetWare crt0.o, ++ but it is copyright by Novell. */ ++ ++int _dummy_crt0 = 1; +diff -Nbaur newlib-1.12.0/newlib/libc/sys/ppcgekko/include/newlib.h newlib-1.12.0-new/newlib/libc/sys/ppcgekko/include/newlib.h +--- newlib-1.12.0/newlib/libc/sys/ppcgekko/include/newlib.h Thu Jan 1 00:00:00 1970 ++++ newlib-1.12.0-new/newlib/libc/sys/ppcgekko/include/newlib.h Thu Jan 20 20:21:39 2005 +@@ -0,0 +1,2 @@ ++/* dummy file for external tools to use. Real file is created by ++ newlib configuration. */ +diff -Nbaur newlib-1.12.0/newlib/libc/sys/ppcgekko/machine/malloc.h newlib-1.12.0-new/newlib/libc/sys/ppcgekko/machine/malloc.h +--- newlib-1.12.0/newlib/libc/sys/ppcgekko/machine/malloc.h Thu Jan 1 00:00:00 1970 ++++ newlib-1.12.0-new/newlib/libc/sys/ppcgekko/machine/malloc.h Thu Jan 20 20:21:39 2005 +@@ -0,0 +1,8 @@ ++#ifndef _MACHMALLOC_H_ ++#define _MACHMALLOC_H_ ++ ++/* place holder so platforms may add malloc.h extensions */ ++ ++#endif /* _MACHMALLOC_H_ */ ++ ++ +diff -Nbaur newlib-1.12.0/newlib/libc/sys/ppcgekko/machine/stdlib.h newlib-1.12.0-new/newlib/libc/sys/ppcgekko/machine/stdlib.h +--- newlib-1.12.0/newlib/libc/sys/ppcgekko/machine/stdlib.h Thu Jan 1 00:00:00 1970 ++++ newlib-1.12.0-new/newlib/libc/sys/ppcgekko/machine/stdlib.h Thu Jan 20 20:21:39 2005 +@@ -0,0 +1,8 @@ ++#ifndef _MACHSTDLIB_H_ ++#define _MACHSTDLIB_H_ ++ ++/* place holder so platforms may add stdlib.h extensions */ ++ ++#endif /* _MACHSTDLIB_H_ */ ++ ++ +diff -Nbaur newlib-1.12.0/newlib/libc/sys/ppcgekko/sys/lock.h newlib-1.12.0-new/newlib/libc/sys/ppcgekko/sys/lock.h +--- newlib-1.12.0/newlib/libc/sys/ppcgekko/sys/lock.h Thu Jan 1 00:00:00 1970 ++++ newlib-1.12.0-new/newlib/libc/sys/ppcgekko/sys/lock.h Thu Jan 20 20:21:39 2005 +@@ -0,0 +1,51 @@ ++#ifndef __SYS_LOCK_H__ ++#define __SYS_LOCK_H__ ++ ++/* dummy lock routines for single-threaded aps */ ++ ++typedef int _LOCK_T; ++typedef int _LOCK_RECURSIVE_T; ++ ++#define __LOCK_INIT(CLASS,NAME) \ ++ CLASS _LOCK_T NAME = -1 ++#define __LOCK_INIT_RECURSIVE(CLASS,NAME) \ ++ CLASS _LOCK_RECURSIVE_T NAME = -2 ++ ++#define __lock_init(NAME) \ ++ __libc_lock_init(&(NAME),0) ++ ++#define __lock_init_recursive(NAME) \ ++ __libc_lock_init(&(NAME),1) ++ ++#define __lock_close(NAME) \ ++ __libc_lock_close(&(NAME)) ++ ++#define __lock_close_recursive(NAME) \ ++ __libc_lock_close(&(NAME)) ++ ++#define __lock_acquire(NAME) \ ++ __libc_lock_acquire(&(NAME)) ++ ++#define __lock_acquire_recursive(NAME) \ ++ __libc_lock_acquire(&(NAME)) ++ ++#define __lock_try_acquire(NAME) \ ++ __libc_lock_try_acquire(&(NAME)) ++ ++#define __lock_try_acquire_recursive(NAME) \ ++ __libc_lock_try_acquire(&(NAME)) ++ ++#define __lock_release(NAME) \ ++ __libc_lock_release(&(NAME)) ++ ++#define __lock_release_recursive(NAME) \ ++ __libc_lock_release(&(NAME)) ++ ++ ++extern int __libc_lock_init(int*,int); ++extern int __libc_lock_close(int*); ++extern int __libc_lock_acquire(int*); ++extern int __libc_lock_try_acquire(int*); ++extern int __libc_lock_release(int*); ++ ++#endif /* __SYS_LOCK_H__ */ +diff -Nbaur newlib-1.12.0/newlib/libc/sys/ppcgekko/sys/stdio.h newlib-1.12.0-new/newlib/libc/sys/ppcgekko/sys/stdio.h +--- newlib-1.12.0/newlib/libc/sys/ppcgekko/sys/stdio.h Thu Jan 1 00:00:00 1970 ++++ newlib-1.12.0-new/newlib/libc/sys/ppcgekko/sys/stdio.h Thu Jan 20 20:21:40 2005 +@@ -0,0 +1,17 @@ ++#ifndef _NEWLIB_STDIO_H ++#define _NEWLIB_STDIO_H ++ ++/* Internal locking macros, used to protect stdio functions. In the ++ general case, expand to nothing. */ ++#if !defined(__SINGLE_THREAD__) ++# if !defined(_flockfile) ++# define _flockfile(fp) __flockfile(fp) ++ extern void __flockfile(FILE*); ++# endif ++# if !defined(_funlockfile) ++# define _funlockfile(fp) __funlockfile(fp) ++ extern void __funlockfile(FILE*); ++# endif ++#endif /* __SINGLE_THREAD__ */ ++ ++#endif /* _NEWLIB_STDIO_H */