From 17c372d91b4d65e38091d4588e67ffbf297f6990 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 08:48:23 +0100 Subject: [PATCH 01/30] Added XZ archive support XZ archives are more modern and smaller. --- README.md | 4 ++-- common.sh | 1 + prepare-debian-ubuntu.sh | 2 +- prepare-mac-os.sh | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ed00320..2809ab1 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ How do I use it? 1. Set up your environment by installing the following software: - autoconf, automake, bison, flex, gcc, g++/gcc-c++, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, wget, mpc, gmp, libelf, mpfr, git + autoconf, automake, bison, bzip2, flex, gcc, g++/gcc-c++, gzip, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, xz-utils, wget, mpc, gmp, libelf, mpfr, git 2. Set the PSPDEV and PATH environmental variables: @@ -37,7 +37,7 @@ Ubuntu 1. Install the required packages by running. - sudo apt-get install g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip wget + sudo apt-get install g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip wget bzip2 gzip xz-utils 2. Build and install the toolchain and SDK. diff --git a/common.sh b/common.sh index 41aa488..29bd93f 100755 --- a/common.sh +++ b/common.sh @@ -20,6 +20,7 @@ function auto_extract "tar") tar --no-same-owner -xf $path ;; "gz"|"tgz") tar --no-same-owner -xzf $path ;; "bz2"|"tbz2") tar --no-same-owner -xjf $path ;; + "xz"|"txz") tar --no-same-owner -xJf $path ;; "zip") unzip $path ;; *) echo "I don't know how to extract $ext archives!"; return 1 ;; esac diff --git a/prepare-debian-ubuntu.sh b/prepare-debian-ubuntu.sh index 55a93ae..8c55baf 100755 --- a/prepare-debian-ubuntu.sh +++ b/prepare-debian-ubuntu.sh @@ -1,7 +1,7 @@ #!/bin/bash # Install build dependencies -sudo apt-get install $@ g++ build-essential autoconf automake automake1.9 cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool subversion git tcl unzip +sudo apt-get install $@ g++ build-essential autoconf automake automake1.9 cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool subversion git tcl unzip bzip2 gzip xz-utils # Make `/bin/sh` an alias for `/bin/bash` instead of `/bin/dash` - which is # faster, but doesn't play nice with some autotools scripts in psp-ports. diff --git a/prepare-mac-os.sh b/prepare-mac-os.sh index 46d1b3a..fc7f172 100755 --- a/prepare-mac-os.sh +++ b/prepare-mac-os.sh @@ -14,6 +14,7 @@ if [ -e "/opt/local/bin/port" ]; then sudo port install libelf sudo port install libmpc sudo port install libusb + sudo port install xz install_libusb elif [ -e "/usr/local/bin/brew" ]; then @@ -24,6 +25,7 @@ elif [ -e "/usr/local/bin/brew" ]; then sudo -u $CURRENT_USER brew install libusb sudo -u $CURRENT_USER brew install libusb-compat + sudo -u $CURRENT_USER brew install xz else echo "Go install MacPorts from http://www.macports.org/ or Homebrew from http://brew.sh/ first, then we can talk" fi From 7f5a93ba487fb13e7543d6b2f109e93f57993c6f Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 09:30:11 +0100 Subject: [PATCH 02/30] When checking dependencies, check for (g)libtoolize instead of (g)libtool The libtool script is installed in a separate package on some systems and is not necessary for psptoolchain. --- depends/check-dependencies.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/check-dependencies.sh b/depends/check-dependencies.sh index c97a4f7..bde4706 100755 --- a/depends/check-dependencies.sh +++ b/depends/check-dependencies.sh @@ -106,10 +106,10 @@ if [ "$(uname)" == "Darwin" ]; then # GNU libtool will be prepended with letter 'g' to prevent conflicts with # the one comes along with OS X. - check_program glibtool + check_program glibtoolize else check_header readline readline.h readline/readline.h - check_program libtool + check_program libtoolize fi if [ ${#missing_depends[@]} -ne 0 ]; then From c33cc3cebdf378d9e8ea77ddfd03c716e8b4b3f3 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 10:43:59 +0100 Subject: [PATCH 03/30] Update GCC to version 8.2.0 This is the most modern version of GCC. It also brings new C++ versions. patch-gcc_cp_cfns.h is not needed anymore, because the new GCC version uses C++, which removes the sole purpose of that file. I've also disposed of old GCC patches. I've added ISL to GCC build, because it seems to provide some optimizations. --- patches/gcc-4.6.4-PSP.patch | 843 ------------------ ...cc-4.9.3-PSP.patch => gcc-8.2.0-PSP.patch} | 406 +++++---- patches/patch-gcc_cp_cfns.h | 22 - scripts/002-gcc-stage1.sh | 19 +- scripts/005-gcc-stage2.sh | 21 +- 5 files changed, 233 insertions(+), 1078 deletions(-) delete mode 100644 patches/gcc-4.6.4-PSP.patch rename patches/{gcc-4.9.3-PSP.patch => gcc-8.2.0-PSP.patch} (77%) delete mode 100644 patches/patch-gcc_cp_cfns.h diff --git a/patches/gcc-4.6.4-PSP.patch b/patches/gcc-4.6.4-PSP.patch deleted file mode 100644 index d71595a..0000000 --- a/patches/gcc-4.6.4-PSP.patch +++ /dev/null @@ -1,843 +0,0 @@ -diff -Nbaur gcc-4.6.4/config.sub gcc-4.6.4-psp/config.sub ---- gcc-4.6.4/config.sub 2010-05-25 09:22:07.000000000 -0400 -+++ gcc-4.6.4-psp/config.sub 2014-06-09 18:54:13.013936018 -0400 -@@ -279,6 +279,7 @@ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ -+ | mipsallegrex | mipsallegrexel \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ -@@ -375,6 +376,7 @@ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ -+ | mipsallegrex-* | mipsallegrexel-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ -@@ -771,6 +773,10 @@ - basic_machine=m68k-atari - os=-mint - ;; -+ psp) -+ basic_machine=mipsallegrexel-psp -+ os=-elf -+ ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; -diff -Nbaur gcc-4.6.4/gcc/config/mips/allegrex.md gcc-4.6.4-psp/gcc/config/mips/allegrex.md ---- gcc-4.6.4/gcc/config/mips/allegrex.md 1969-12-31 19:00:00.000000000 -0500 -+++ gcc-4.6.4-psp/gcc/config/mips/allegrex.md 2014-06-09 18:54:13.013936018 -0400 -@@ -0,0 +1,191 @@ -+;; Sony ALLEGREX instructions. -+;; Copyright (C) 2005 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. -+ -+(define_c_enum "unspec" [ -+ UNSPEC_WSBH -+ UNSPEC_CLO -+ UNSPEC_CTO -+ UNSPEC_CACHE -+ UNSPEC_CEIL_W_S -+ UNSPEC_FLOOR_W_S -+ UNSPEC_ROUND_W_S -+]) -+ -+;; Multiply Add and Subtract. -+;; Note: removed clobbering for madd and msub (testing needed) -+ -+(define_insn "allegrex_madd" -+ [(set (match_operand:SI 0 "register_operand" "+l") -+ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")) -+ (match_dup 0)))] -+ "TARGET_ALLEGREX" -+ "madd\t%1,%2" -+ [(set_attr "type" "imadd") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "allegrex_msub" -+ [(set (match_operand:SI 0 "register_operand" "+l") -+ (minus:SI (match_dup 0) -+ (mult:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d"))))] -+ "TARGET_ALLEGREX" -+ "msub\t%1,%2" -+ [(set_attr "type" "imadd") -+ (set_attr "mode" "SI")]) -+ -+ -+;; Min and max. -+ -+(define_insn "sminsi3" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (smin:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")))] -+ "TARGET_ALLEGREX" -+ "min\t%0,%1,%2" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "smaxsi3" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (smax:SI (match_operand:SI 1 "register_operand" "d") -+ (match_operand:SI 2 "register_operand" "d")))] -+ "TARGET_ALLEGREX" -+ "max\t%0,%1,%2" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+ -+;; Extended shift instructions. -+ -+(define_insn "allegrex_bitrev" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_BITREV))] -+ "TARGET_ALLEGREX" -+ "bitrev\t%0,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "allegrex_wsbh" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_WSBH))] -+ "TARGET_ALLEGREX" -+ "wsbh\t%0,%1" -+ [(set_attr "type" "arith") -+ (set_attr "mode" "SI")]) -+ -+(define_insn "bswapsi2" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (bswap:SI (match_operand:SI 1 "register_operand" "d")))] -+ "TARGET_ALLEGREX" -+ "wsbw\t%0,%1" -+ [(set_attr "type" "shift") -+ (set_attr "mode" "SI")]) -+ -+ -+;; Count leading ones, count trailing zeros, and count trailing ones (clz is -+;; already defined). -+ -+(define_insn "allegrex_clo" -+ [(set (match_operand:SI 0 "register_operand" "=d") -+ (unspec:SI [(match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_CLO))] -+ "TARGET_ALLEGREX" -+ "clo\t%0,%1" -+ [(set_attr "type" "clz") -+ (set_attr "mode" "SI")]) -+ -+(define_expand "ctzsi2" -+ [(set (match_operand:SI 0 "register_operand") -+ (ctz:SI (match_operand:SI 1 "register_operand")))] -+ "TARGET_ALLEGREX" -+{ -+ rtx r1; -+ -+ r1 = gen_reg_rtx (SImode); -+ emit_insn (gen_allegrex_bitrev (r1, operands[1])); -+ emit_insn (gen_clzsi2 (operands[0], r1)); -+ DONE; -+}) -+ -+(define_expand "allegrex_cto" -+ [(set (match_operand:SI 0 "register_operand") -+ (unspec:SI [(match_operand:SI 1 "register_operand")] -+ UNSPEC_CTO))] -+ "TARGET_ALLEGREX" -+{ -+ rtx r1; -+ -+ r1 = gen_reg_rtx (SImode); -+ emit_insn (gen_allegrex_bitrev (r1, operands[1])); -+ emit_insn (gen_allegrex_clo (operands[0], r1)); -+ DONE; -+}) -+ -+ -+;; Misc. -+ -+(define_insn "allegrex_sync" -+ [(unspec_volatile [(const_int 0)] UNSPEC_SYNC)] -+ "TARGET_ALLEGREX" -+ "sync" -+ [(set_attr "type" "unknown") -+ (set_attr "mode" "none")]) -+ -+(define_insn "allegrex_cache" -+ [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "") -+ (match_operand:SI 1 "register_operand" "d")] -+ UNSPEC_CACHE)] -+ "TARGET_ALLEGREX" -+ "cache\t%0,0(%1)" -+ [(set_attr "type" "unknown") -+ (set_attr "mode" "none")]) -+ -+ -+;; Floating-point builtins. -+ -+(define_insn "allegrex_ceil_w_s" -+ [(set (match_operand:SI 0 "register_operand" "=f") -+ (unspec:SI [(match_operand:SF 1 "register_operand" "f")] -+ UNSPEC_CEIL_W_S))] -+ "TARGET_ALLEGREX" -+ "ceil.w.s\t%0,%1" -+ [(set_attr "type" "fcvt") -+ (set_attr "mode" "SF")]) -+ -+(define_insn "allegrex_floor_w_s" -+ [(set (match_operand:SI 0 "register_operand" "=f") -+ (unspec:SI [(match_operand:SF 1 "register_operand" "f")] -+ UNSPEC_FLOOR_W_S))] -+ "TARGET_ALLEGREX" -+ "floor.w.s\t%0,%1" -+ [(set_attr "type" "fcvt") -+ (set_attr "mode" "SF")]) -+ -+(define_insn "allegrex_round_w_s" -+ [(set (match_operand:SI 0 "register_operand" "=f") -+ (unspec:SI [(match_operand:SF 1 "register_operand" "f")] -+ UNSPEC_ROUND_W_S))] -+ "TARGET_ALLEGREX" -+ "round.w.s\t%0,%1" -+ [(set_attr "type" "fcvt") -+ (set_attr "mode" "SF")]) -diff -Nbaur gcc-4.6.4/gcc/config/mips/mips.c gcc-4.6.4-psp/gcc/config/mips/mips.c ---- gcc-4.6.4/gcc/config/mips/mips.c 2012-09-02 06:37:49.000000000 -0400 -+++ gcc-4.6.4-psp/gcc/config/mips/mips.c 2014-06-09 18:54:13.021936018 -0400 -@@ -239,7 +239,12 @@ - MIPS_BUILTIN_CMP_SINGLE, - - /* For generating bposge32 branch instructions in MIPS32 DSP ASE. */ -- MIPS_BUILTIN_BPOSGE32 -+ MIPS_BUILTIN_BPOSGE32, -+ -+ /* The builtin corresponds to the ALLEGREX cache instruction. Operand 0 -+ is the function code (must be less than 32) and operand 1 is the base -+ address. */ -+ MIPS_BUILTIN_CACHE - }; - - /* Invoke MACRO (COND) for each C.cond.fmt condition. */ -@@ -516,6 +521,10 @@ - normal branch. */ - static bool mips_branch_likely; - -+/* Preferred stack boundary for proper stack vars alignment */ -+unsigned int mips_preferred_stack_boundary; -+unsigned int mips_preferred_stack_align; -+ - /* The current instruction-set architecture. */ - enum processor mips_arch; - const struct mips_cpu_info *mips_arch_info; -@@ -691,6 +700,7 @@ - - /* MIPS II processors. */ - { "r6000", PROCESSOR_R6000, 2, 0 }, -+ { "allegrex", PROCESSOR_ALLEGREX, 2, 0 }, - - /* MIPS III processors. */ - { "r4000", PROCESSOR_R4000, 3, 0 }, -@@ -969,6 +979,9 @@ - 1, /* branch_cost */ - 4 /* memory_latency */ - }, -+ { /* Allegrex */ -+ DEFAULT_COSTS -+ }, - { /* Loongson-2E */ - DEFAULT_COSTS - }, -@@ -12605,6 +12618,7 @@ - AVAIL_NON_MIPS16 (dspr2_32, !TARGET_64BIT && TARGET_DSPR2) - AVAIL_NON_MIPS16 (loongson, TARGET_LOONGSON_VECTORS) - AVAIL_NON_MIPS16 (cache, TARGET_CACHE_BUILTIN) -+AVAIL_NON_MIPS16 (allegrex, TARGET_ALLEGREX) - - /* Construct a mips_builtin_description from the given arguments. - -@@ -12701,6 +12715,30 @@ - MIPS_BUILTIN (bposge, f, "bposge" #VALUE, \ - MIPS_BUILTIN_BPOSGE ## VALUE, MIPS_SI_FTYPE_VOID, AVAIL) - -+/* Define a MIPS_BUILTIN_DIRECT function for instruction CODE_FOR_allegrex_. -+ FUNCTION_TYPE and TARGET_FLAGS are builtin_description fields. */ -+#define DIRECT_ALLEGREX_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_allegrex_ ## INSN, MIPS_FP_COND_f, "__builtin_allegrex_" #INSN, \ -+ MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, mips_builtin_avail_allegrex } -+ -+/* Same as the above, but mapped to an instruction that doesn't share the -+ NAME. NAME is the name of the builtin without the builtin prefix. */ -+#define DIRECT_ALLEGREX_NAMED_BUILTIN(NAME, INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_ ## INSN, MIPS_FP_COND_f, "__builtin_allegrex_" #NAME, \ -+ MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, mips_builtin_avail_allegrex } -+ -+/* Define a MIPS_BUILTIN_DIRECT_NO_TARGET function for instruction -+ CODE_FOR_allegrex_. FUNCTION_TYPE and TARGET_FLAGS are -+ builtin_description fields. */ -+#define DIRECT_ALLEGREX_NO_TARGET_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_allegrex_ ## INSN, MIPS_FP_COND_f, "__builtin_allegrex_" #INSN, \ -+ MIPS_BUILTIN_DIRECT_NO_TARGET, FUNCTION_TYPE, mips_builtin_avail_allegrex } -+ -+/* Define a builtin with a specific function TYPE. */ -+#define SPECIAL_ALLEGREX_BUILTIN(TYPE, INSN, FUNCTION_TYPE, TARGET_FLAGS) \ -+ { CODE_FOR_allegrex_ ## INSN, MIPS_FP_COND_f, "__builtin_allegrex_" #INSN, \ -+ MIPS_BUILTIN_ ## TYPE, FUNCTION_TYPE, mips_builtin_avail_allegrex } -+ - /* Define a Loongson MIPS_BUILTIN_DIRECT function __builtin_loongson_ - for instruction CODE_FOR_loongson_. FUNCTION_TYPE is a - builtin_description field. */ -@@ -12945,6 +12983,40 @@ - DIRECT_BUILTIN (dpsqx_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32), - DIRECT_BUILTIN (dpsqx_sa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32), - -+/* Builtin functions for the Sony ALLEGREX processor. -+ -+ These have the `__builtin_allegrex_' prefix instead of `__builtin_mips_' -+ to maintain compatibility with Sony's ALLEGREX GCC port. -+ -+ Some of the builtins may seem redundant, but they are the same as the -+ builtins defined in the Sony compiler. I chose to map redundant and -+ trivial builtins to the original instruction instead of creating -+ duplicate patterns specifically for the ALLEGREX (as Sony does). */ -+ -+ DIRECT_ALLEGREX_BUILTIN(bitrev, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(wsbh, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(wsbw, bswapsi2, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(clz, clzsi2, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(clo, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(ctz, ctzsi2, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_BUILTIN(cto, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(rotr, rotrsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(rotl, rotlsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ -+ DIRECT_ALLEGREX_NAMED_BUILTIN(seb, extendqisi2, MIPS_SI_FTYPE_QI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(seh, extendhisi2, MIPS_SI_FTYPE_HI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(max, smaxsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(min, sminsi3, MIPS_SI_FTYPE_SI_SI, 0), -+ -+ DIRECT_ALLEGREX_NO_TARGET_BUILTIN(sync, MIPS_VOID_FTYPE_VOID, 0), -+ SPECIAL_ALLEGREX_BUILTIN(CACHE, cache, MIPS_VOID_FTYPE_SI_SI, 0), -+ -+ DIRECT_ALLEGREX_NAMED_BUILTIN(sqrt_s, sqrtsf2, MIPS_SF_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_BUILTIN(ceil_w_s, MIPS_SI_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_BUILTIN(floor_w_s, MIPS_SI_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_BUILTIN(round_w_s, MIPS_SI_FTYPE_SF, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(trunc_w_s, fix_truncsfsi2_insn, MIPS_SI_FTYPE_SF, 0), -+ - /* Builtin functions for ST Microelectronics Loongson-2E/2F cores. */ - LOONGSON_BUILTIN (packsswh, MIPS_V4HI_FTYPE_V2SI_V2SI), - LOONGSON_BUILTIN (packsshb, MIPS_V8QI_FTYPE_V4HI_V4HI), -@@ -13096,6 +13168,8 @@ - /* Standard mode-based argument types. */ - #define MIPS_ATYPE_UQI unsigned_intQI_type_node - #define MIPS_ATYPE_SI intSI_type_node -+#define MIPS_ATYPE_HI intHI_type_node -+#define MIPS_ATYPE_QI intQI_type_node - #define MIPS_ATYPE_USI unsigned_intSI_type_node - #define MIPS_ATYPE_DI intDI_type_node - #define MIPS_ATYPE_UDI unsigned_intDI_type_node -@@ -13270,6 +13344,9 @@ - - switch (opno) - { -+ case 0: -+ emit_insn (GEN_FCN (icode) (0)); -+ break; - case 2: - emit_insn (GEN_FCN (icode) (ops[0], ops[1])); - break; -@@ -13439,6 +13516,28 @@ - const1_rtx, const0_rtx); - } - -+/* Expand a __builtin_allegrex_cache() function. Make sure the passed -+ cache function code is less than 32. */ -+ -+static rtx -+mips_expand_builtin_cache (enum insn_code icode, rtx target, tree exp) -+{ -+ rtx op0, op1; -+ -+ op0 = mips_prepare_builtin_arg (icode, 0, exp, 0); -+ op1 = mips_prepare_builtin_arg (icode, 1, exp, 1); -+ -+ if (GET_CODE (op0) == CONST_INT) -+ if (INTVAL (op0) < 0 || INTVAL (op0) > 0x1f) -+ { -+ error ("invalid function code '%d'", INTVAL (op0)); -+ return const0_rtx; -+ } -+ -+ emit_insn (GEN_FCN (icode) (op0, op1)); -+ return target; -+} -+ - /* Implement TARGET_EXPAND_BUILTIN. */ - - static rtx -@@ -13484,6 +13583,9 @@ - - case MIPS_BUILTIN_BPOSGE32: - return mips_expand_builtin_bposge (d->builtin_type, target); -+ -+ case MIPS_BUILTIN_CACHE: -+ return mips_expand_builtin_cache (d->icode, target, exp); - } - gcc_unreachable (); - } -@@ -15921,6 +16023,22 @@ - Do all CPP-sensitive stuff in non-MIPS16 mode; we'll switch to - MIPS16 mode afterwards if need be. */ - mips_set_mips16_mode (false); -+ -+ /* Validate -mpreferred-stack-boundary= value, or provide default. -+ The default of 128-bit is for newABI else 64-bit. */ -+ mips_preferred_stack_boundary = (TARGET_NEWABI ? 128 : 64); -+ mips_preferred_stack_align = (TARGET_NEWABI ? 16 : 8); -+ if (mips_preferred_stack_boundary_string) -+ { -+ i = atoi (mips_preferred_stack_boundary_string); -+ if (i < 2 || i > 12) -+ error ("-mpreferred-stack-boundary=%d is not between 2 and 12", i); -+ else -+ { -+ mips_preferred_stack_align = (1 << i); -+ mips_preferred_stack_boundary = mips_preferred_stack_align * 8; -+ } -+ } - } - - /* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */ -diff -Nbaur gcc-4.6.4/gcc/config/mips/mips-ftypes.def gcc-4.6.4-psp/gcc/config/mips/mips-ftypes.def ---- gcc-4.6.4/gcc/config/mips/mips-ftypes.def 2009-02-20 10:20:38.000000000 -0500 -+++ gcc-4.6.4-psp/gcc/config/mips/mips-ftypes.def 2014-06-09 18:54:13.013936018 -0400 -@@ -53,9 +53,12 @@ - - DEF_MIPS_FTYPE (2, (SI, DI, SI)) - DEF_MIPS_FTYPE (2, (SI, POINTER, SI)) -+DEF_MIPS_FTYPE (1, (SI, HI)) -+DEF_MIPS_FTYPE (1, (SI, SF)) - DEF_MIPS_FTYPE (1, (SI, SI)) - DEF_MIPS_FTYPE (2, (SI, SI, SI)) - DEF_MIPS_FTYPE (3, (SI, SI, SI, SI)) -+DEF_MIPS_FTYPE (1, (SI, QI)) - DEF_MIPS_FTYPE (1, (SI, V2HI)) - DEF_MIPS_FTYPE (2, (SI, V2HI, V2HI)) - DEF_MIPS_FTYPE (1, (SI, V4QI)) -@@ -124,3 +127,4 @@ - DEF_MIPS_FTYPE (2, (VOID, SI, SI)) - DEF_MIPS_FTYPE (2, (VOID, V2HI, V2HI)) - DEF_MIPS_FTYPE (2, (VOID, V4QI, V4QI)) -+DEF_MIPS_FTYPE (1, (VOID, VOID)) -diff -Nbaur gcc-4.6.4/gcc/config/mips/mips.h gcc-4.6.4-psp/gcc/config/mips/mips.h ---- gcc-4.6.4/gcc/config/mips/mips.h 2011-03-08 15:51:11.000000000 -0500 -+++ gcc-4.6.4-psp/gcc/config/mips/mips.h 2014-06-09 18:54:13.021936018 -0400 -@@ -231,6 +231,7 @@ - #define TARGET_SB1 (mips_arch == PROCESSOR_SB1 \ - || mips_arch == PROCESSOR_SB1A) - #define TARGET_SR71K (mips_arch == PROCESSOR_SR71000) -+#define TARGET_ALLEGREX (mips_arch == PROCESSOR_ALLEGREX) - - /* Scheduling target defines. */ - #define TUNE_20KC (mips_tune == PROCESSOR_20KC) -@@ -258,6 +259,7 @@ - #define TUNE_OCTEON (mips_tune == PROCESSOR_OCTEON) - #define TUNE_SB1 (mips_tune == PROCESSOR_SB1 \ - || mips_tune == PROCESSOR_SB1A) -+#define TUNE_ALLEGREX (mips_tune == PROCESSOR_ALLEGREX) - - /* Whether vector modes and intrinsics for ST Microelectronics - Loongson-2E/2F processors should be enabled. In o32 pairs of -@@ -852,6 +854,9 @@ - /* ISA has LDC1 and SDC1. */ - #define ISA_HAS_LDC1_SDC1 (!ISA_MIPS1 && !TARGET_MIPS16) - -+/* ISA has just the integer condition move instructions (movn,movz) */ -+#define ISA_HAS_INT_CONDMOVE (TARGET_ALLEGREX) -+ - /* ISA has the mips4 FP condition code instructions: FP-compare to CC, - branch on CC, and move (both FP and non-FP) on CC. */ - #define ISA_HAS_8CC (ISA_MIPS4 \ -@@ -874,6 +879,7 @@ - - /* ISA has conditional trap instructions. */ - #define ISA_HAS_COND_TRAP (!ISA_MIPS1 \ -+ && !TARGET_ALLEGREX \ - && !TARGET_MIPS16) - - /* ISA has integer multiply-accumulate instructions, madd and msub. */ -@@ -910,6 +916,7 @@ - /* ISA has count leading zeroes/ones instruction (not implemented). */ - #define ISA_HAS_CLZ_CLO ((ISA_MIPS32 \ - || ISA_MIPS32R2 \ -+ || TARGET_ALLEGREX \ - || ISA_MIPS64 \ - || ISA_MIPS64R2) \ - && !TARGET_MIPS16) -@@ -955,6 +962,7 @@ - || TARGET_MIPS5400 \ - || TARGET_MIPS5500 \ - || TARGET_SR71K \ -+ || TARGET_ALLEGREX \ - || TARGET_SMARTMIPS) \ - && !TARGET_MIPS16) - -@@ -984,11 +992,13 @@ - - /* ISA includes the MIPS32r2 seb and seh instructions. */ - #define ISA_HAS_SEB_SEH ((ISA_MIPS32R2 \ -+ || TARGET_ALLEGREX \ - || ISA_MIPS64R2) \ - && !TARGET_MIPS16) - - /* ISA includes the MIPS32/64 rev 2 ext and ins instructions. */ - #define ISA_HAS_EXT_INS ((ISA_MIPS32R2 \ -+ || TARGET_ALLEGREX \ - || ISA_MIPS64R2) \ - && !TARGET_MIPS16) - -@@ -1038,7 +1048,8 @@ - || ISA_MIPS64 \ - || ISA_MIPS64R2 \ - || TARGET_MIPS5500 \ -- || TARGET_LOONGSON_2EF) -+ || TARGET_LOONGSON_2EF \ -+ || TARGET_ALLEGREX) - - /* ISA includes synci, jr.hb and jalr.hb. */ - #define ISA_HAS_SYNCI ((ISA_MIPS32R2 \ -@@ -2133,7 +2144,7 @@ - `crtl->outgoing_args_size'. */ - #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1 - --#define STACK_BOUNDARY (TARGET_NEWABI ? 128 : 64) -+#define STACK_BOUNDARY (mips_preferred_stack_boundary) - - /* Symbolic macros for the registers used to return integer and floating - point values. */ -@@ -2259,7 +2270,7 @@ - /* Treat LOC as a byte offset from the stack pointer and round it up - to the next fully-aligned offset. */ - #define MIPS_STACK_ALIGN(LOC) \ -- (TARGET_NEWABI ? ((LOC) + 15) & -16 : ((LOC) + 7) & -8) -+ (((LOC) + (mips_preferred_stack_align - 1)) & -(mips_preferred_stack_align)) - - - /* Output assembler code to FILE to increment profiler label # LABELNO -@@ -2911,6 +2922,9 @@ - #endif - #endif - -+extern unsigned int mips_preferred_stack_boundary; -+extern unsigned int mips_preferred_stack_align; -+ - #ifndef HAVE_AS_TLS - #define HAVE_AS_TLS 0 - #endif -diff -Nbaur gcc-4.6.4/gcc/config/mips/mips.md gcc-4.6.4-psp/gcc/config/mips/mips.md ---- gcc-4.6.4/gcc/config/mips/mips.md 2012-01-09 17:09:53.000000000 -0500 -+++ gcc-4.6.4-psp/gcc/config/mips/mips.md 2014-06-09 18:54:13.021936018 -0400 -@@ -37,6 +37,7 @@ - 74kf2_1 - 74kf1_1 - 74kf3_2 -+ allegrex - loongson_2e - loongson_2f - loongson_3a -@@ -598,7 +599,7 @@ - ;; This mode iterator allows :MOVECC to be used anywhere that a - ;; conditional-move-type condition is needed. - (define_mode_iterator MOVECC [SI (DI "TARGET_64BIT") -- (CC "TARGET_HARD_FLOAT && !TARGET_LOONGSON_2EF")]) -+ (CC "TARGET_HARD_FLOAT && !TARGET_LOONGSON_2EF && !TARGET_ALLEGREX")]) - - ;; 32-bit integer moves for which we provide move patterns. - (define_mode_iterator IMOVE32 -@@ -1885,11 +1886,11 @@ - (mult:DI - (any_extend:DI (match_operand:SI 1 "register_operand" "d")) - (any_extend:DI (match_operand:SI 2 "register_operand" "d")))))] -- "!TARGET_64BIT && (ISA_HAS_MSAC || GENERATE_MADD_MSUB || ISA_HAS_DSP)" -+ "!TARGET_64BIT && (ISA_HAS_MSAC || GENERATE_MADD_MSUB || ISA_HAS_DSP || TARGET_ALLEGREX)" - { - if (ISA_HAS_DSP_MULT) - return "msub\t%q0,%1,%2"; -- else if (TARGET_MIPS5500 || GENERATE_MADD_MSUB) -+ else if (TARGET_MIPS5500 || GENERATE_MADD_MSUB || TARGET_ALLEGREX) - return "msub\t%1,%2"; - else - return "msac\t$0,%1,%2"; -@@ -2066,14 +2067,14 @@ - (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d")) - (any_extend:DI (match_operand:SI 2 "register_operand" "d"))) - (match_operand:DI 3 "register_operand" "0")))] -- "(TARGET_MAD || ISA_HAS_MACC || GENERATE_MADD_MSUB || ISA_HAS_DSP) -+ "(TARGET_MAD || ISA_HAS_MACC || GENERATE_MADD_MSUB || ISA_HAS_DSP || TARGET_ALLEGREX) - && !TARGET_64BIT" - { - if (TARGET_MAD) - return "mad\t%1,%2"; - else if (ISA_HAS_DSP_MULT) - return "madd\t%q0,%1,%2"; -- else if (GENERATE_MADD_MSUB || TARGET_MIPS5500) -+ else if (GENERATE_MADD_MSUB || TARGET_MIPS5500 || TARGET_ALLEGREX) - return "madd\t%1,%2"; - else - /* See comment in *macc. */ -@@ -2500,6 +2501,33 @@ - ;; - ;; .................... - ;; -+;; FIND FIRST BIT INSTRUCTION -+;; -+;; .................... -+;; -+ -+(define_expand "ffs2" -+ [(set (match_operand:GPR 0 "register_operand" "") -+ (ffs:GPR (match_operand:GPR 1 "register_operand" "")))] -+ "ISA_HAS_CLZ_CLO" -+{ -+ rtx r1, r2, r3, r4; -+ -+ r1 = gen_reg_rtx (mode); -+ r2 = gen_reg_rtx (mode); -+ r3 = gen_reg_rtx (mode); -+ r4 = gen_reg_rtx (mode); -+ emit_insn (gen_neg2 (r1, operands[1])); -+ emit_insn (gen_and3 (r2, operands[1], r1)); -+ emit_insn (gen_clz2 (r3, r2)); -+ emit_move_insn (r4, GEN_INT (GET_MODE_BITSIZE (mode))); -+ emit_insn (gen_sub3 (operands[0], r4, r3)); -+ DONE; -+}) -+ -+;; -+;; .................... -+;; - ;; NEGATION and ONE'S COMPLEMENT - ;; - ;; .................... -@@ -2550,6 +2578,25 @@ - [(set_attr "alu_type" "not") - (set_attr "mode" "")]) - -+(define_expand "rotl3" -+ [(set (match_operand:GPR 0 "register_operand") -+ (rotate:GPR (match_operand:GPR 1 "register_operand") -+ (match_operand:SI 2 "arith_operand")))] -+ "ISA_HAS_ROR" -+{ -+ rtx temp; -+ -+ if (GET_CODE (operands[2]) == CONST_INT) -+ temp = GEN_INT (GET_MODE_BITSIZE (mode) - INTVAL (operands[2])); -+ else -+ { -+ temp = gen_reg_rtx (mode); -+ emit_insn (gen_neg2 (temp, operands[2])); -+ } -+ emit_insn (gen_rotr3 (operands[0], operands[1], temp)); -+ DONE; -+}) -+ - ;; - ;; .................... - ;; -@@ -6301,7 +6348,7 @@ - (const_int 0)]) - (match_operand:GPR 2 "reg_or_0_operand" "dJ,0") - (match_operand:GPR 3 "reg_or_0_operand" "0,dJ")))] -- "ISA_HAS_CONDMOVE" -+ "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE" - "@ - mov%T4\t%0,%z2,%1 - mov%t4\t%0,%z3,%1" -@@ -6331,8 +6378,12 @@ - (if_then_else:GPR (match_dup 5) - (match_operand:GPR 2 "reg_or_0_operand") - (match_operand:GPR 3 "reg_or_0_operand")))] -- "ISA_HAS_CONDMOVE" -+ "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE" - { -+ if (ISA_HAS_INT_CONDMOVE -+ && GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_FLOAT) -+ FAIL; -+ - mips_expand_conditional_move (operands); - DONE; - }) -@@ -6481,6 +6532,9 @@ - ; ST-Microelectronics Loongson-2E/2F-specific patterns. - (include "loongson.md") - -+; Sony ALLEGREX instructions. -+(include "allegrex.md") -+ - (define_c_enum "unspec" [ - UNSPEC_ADDRESS_FIRST - ]) -diff -Nbaur gcc-4.6.4/gcc/config/mips/mips.opt gcc-4.6.4-psp/gcc/config/mips/mips.opt ---- gcc-4.6.4/gcc/config/mips/mips.opt 2011-02-16 20:59:04.000000000 -0500 -+++ gcc-4.6.4-psp/gcc/config/mips/mips.opt 2014-06-09 18:54:13.025936018 -0400 -@@ -306,5 +306,9 @@ - Target Report Var(TARGET_XGOT) - Lift restrictions on GOT size - -+mpreferred-stack-boundary= -+Target RejectNegative Joined Var(mips_preferred_stack_boundary_string) -+Attempt to keep stack aligned to this power of 2 -+ - noasmopt - Driver -diff -Nbaur gcc-4.6.4/gcc/config/mips/psp.h gcc-4.6.4-psp/gcc/config/mips/psp.h ---- gcc-4.6.4/gcc/config/mips/psp.h 1969-12-31 19:00:00.000000000 -0500 -+++ gcc-4.6.4-psp/gcc/config/mips/psp.h 2014-06-09 18:54:13.025936018 -0400 -@@ -0,0 +1,31 @@ -+/* Support for Sony's Playstation Portable (PSP). -+ Copyright (C) 2005 Free Software Foundation, Inc. -+ Contributed by Marcus R. Brown -+ -+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. */ -+ -+/* Override the startfile spec to include crt0.o. */ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "crt0%O%s crti%O%s crtbegin%O%s" -+ -+#undef SUBTARGET_CPP_SPEC -+#define SUBTARGET_CPP_SPEC "-DPSP=1 -D__psp__=1 -D_PSP=1" -+ -+/* Get rid of the .pdr section. */ -+#undef SUBTARGET_ASM_SPEC -+#define SUBTARGET_ASM_SPEC "-mno-pdr" -diff -Nbaur gcc-4.6.4/gcc/config/mips/t-allegrex gcc-4.6.4-psp/gcc/config/mips/t-allegrex ---- gcc-4.6.4/gcc/config/mips/t-allegrex 1969-12-31 19:00:00.000000000 -0500 -+++ gcc-4.6.4-psp/gcc/config/mips/t-allegrex 2014-06-09 18:54:13.025936018 -0400 -@@ -0,0 +1,29 @@ -+# Suppress building libgcc1.a, since the MIPS compiler port is complete -+# and does not need anything from libgcc1.a. -+LIBGCC1 = -+CROSS_LIBGCC1 = -+ -+EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o -+# Don't let CTOR_LIST end up in sdata section. -+CRTSTUFF_T_CFLAGS = -G 0 -+ -+# Assemble startup files. -+$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES) -+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ -+ -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm -+ -+$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES) -+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ -+ -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm -+ -+# We must build libgcc2.a with -G 0, in case the user wants to link -+# without the $gp register. -+TARGET_LIBGCC2_CFLAGS = -G 0 -+ -+# Build the libraries for both hard and soft floating point -+ -+MULTILIB_OPTIONS = -+MULTILIB_DIRNAMES = -+ -+LIBGCC = stmp-multilib -+INSTALL_LIBGCC = install-multilib -diff -Nbaur gcc-4.6.4/gcc/config.gcc gcc-4.6.4-psp/gcc/config.gcc ---- gcc-4.6.4/gcc/config.gcc 2013-03-06 12:40:07.000000000 -0500 -+++ gcc-4.6.4-psp/gcc/config.gcc 2014-06-09 18:54:13.025936018 -0400 -@@ -2037,6 +2037,18 @@ - tm_file="elfos.h newlib-stdint.h ${tm_file} mips/r3900.h mips/elf.h" - tmake_file="mips/t-r3900 mips/t-libgcc-mips16" - ;; -+mipsallegrex-*-elf* | mipsallegrexel-*-elf*) -+ tm_file="elfos.h ${tm_file} mips/elf.h" -+ tmake_file=mips/t-allegrex -+ target_cpu_default="MASK_SINGLE_FLOAT|MASK_DIVIDE_BREAKS" -+ tm_defines="MIPS_ISA_DEFAULT=2 MIPS_CPU_STRING_DEFAULT=\\\"allegrex\\\" MIPS_ABI_DEFAULT=ABI_EABI" -+ case ${target} in -+ mipsallegrex*-psp-elf*) -+ tm_file="${tm_file} mips/psp.h" -+ ;; -+ esac -+ use_fixproto=yes -+ ;; - mmix-knuth-mmixware) - tm_file="${tm_file} newlib-stdint.h" - need_64bit_hwint=yes -diff -Nbaur gcc-4.6.4/gcc/crtstuff.c gcc-4.6.4-psp/gcc/crtstuff.c ---- gcc-4.6.4/gcc/crtstuff.c 2010-12-23 07:08:21.000000000 -0500 -+++ gcc-4.6.4-psp/gcc/crtstuff.c 2014-06-09 18:54:13.025936018 -0400 -@@ -48,7 +48,7 @@ - - /* Target machine header files require this define. */ - #define IN_LIBGCC2 -- -+#define USED_FOR_TARGET - /* FIXME: Including auto-host is incorrect, but until we have - identified the set of defines that need to go into auto-target.h, - this will have to do. */ -diff -Nbaur gcc-4.6.4/libcpp/Makefile.in gcc-4.6.4-psp/libcpp/Makefile.in ---- gcc-4.6.4/libcpp/Makefile.in 2013-04-12 05:58:00.000000000 -0400 -+++ gcc-4.6.4-psp/libcpp/Makefile.in 2014-06-09 18:54:13.025936018 -0400 -@@ -212,8 +212,8 @@ - # Note that we put the dependencies into a .Tpo file, then move them - # into place if the compile succeeds. We need this because gcc does - # not atomically write the dependency output file. --COMPILE = $(COMPILE.base) -o $@ -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Tpo --POSTCOMPILE = @mv $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -+COMPILE = $(COMPILE.base) -o $@ -+POSTCOMPILE = - else - COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \ - $(depcomp) $(COMPILE.base) -diff -Nbaur gcc-4.6.4/libgcc/config.host gcc-4.6.4-psp/libgcc/config.host ---- gcc-4.6.4/libgcc/config.host 2011-11-23 17:15:54.000000000 -0500 -+++ gcc-4.6.4-psp/libgcc/config.host 2014-06-09 18:54:13.025936018 -0400 -@@ -436,6 +436,8 @@ - ;; - mipstx39-*-elf* | mipstx39el-*-elf*) - ;; -+mips*-psp-elf*) -+ ;; - mmix-knuth-mmixware) - extra_parts="crti.o crtn.o crtbegin.o crtend.o" - tmake_file="${tmake_file} ${cpu_type}/t-${cpu_type}" diff --git a/patches/gcc-4.9.3-PSP.patch b/patches/gcc-8.2.0-PSP.patch similarity index 77% rename from patches/gcc-4.9.3-PSP.patch rename to patches/gcc-8.2.0-PSP.patch index 57a1696..74715e6 100644 --- a/patches/gcc-4.9.3-PSP.patch +++ b/patches/gcc-8.2.0-PSP.patch @@ -1,7 +1,7 @@ -diff -Nru gcc-4.9.3/config.sub gcc-4.9.3-psp/config.sub ---- gcc-4.9.3/config.sub 2013-10-01 17:50:56.000000000 +0100 -+++ gcc-4.9.3-psp/config.sub 2015-10-19 00:17:27.020646514 +0100 -@@ -289,6 +289,7 @@ +diff -adurB --new-file gcc-8.2.0/config.sub gcc-8.2.0-psp/config.sub +--- gcc-8.2.0/config.sub 2018-01-03 05:25:18.000000000 +0100 ++++ gcc-8.2.0-psp/config.sub 2018-12-16 08:04:00.773455255 +0100 +@@ -288,6 +288,7 @@ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ @@ -9,7 +9,7 @@ diff -Nru gcc-4.9.3/config.sub gcc-4.9.3-psp/config.sub | mn10200 | mn10300 \ | moxie \ | mt \ -@@ -408,6 +409,7 @@ +@@ -415,6 +416,7 @@ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ @@ -17,7 +17,7 @@ diff -Nru gcc-4.9.3/config.sub gcc-4.9.3-psp/config.sub | mmix-* \ | mt-* \ | msp430-* \ -@@ -810,6 +812,10 @@ +@@ -836,6 +838,10 @@ basic_machine=m68k-atari os=-mint ;; @@ -28,9 +28,9 @@ diff -Nru gcc-4.9.3/config.sub gcc-4.9.3-psp/config.sub mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; -diff -Nru gcc-4.9.3/gcc/config/mips/allegrex.md gcc-4.9.3-psp/gcc/config/mips/allegrex.md ---- gcc-4.9.3/gcc/config/mips/allegrex.md 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.9.3-psp/gcc/config/mips/allegrex.md 2015-10-19 00:17:27.020646514 +0100 +diff -adurB --new-file gcc-8.2.0/gcc/config/mips/allegrex.md gcc-8.2.0-psp/gcc/config/mips/allegrex.md +--- gcc-8.2.0/gcc/config/mips/allegrex.md 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/allegrex.md 2018-12-16 08:04:00.773455255 +0100 @@ -0,0 +1,172 @@ +;; Sony ALLEGREX instructions. +;; Copyright (C) 2005 Free Software Foundation, Inc. @@ -204,11 +204,11 @@ diff -Nru gcc-4.9.3/gcc/config/mips/allegrex.md gcc-4.9.3-psp/gcc/config/mips/al + "round.w.s\t%0,%1" + [(set_attr "type" "fcvt") + (set_attr "mode" "SF")]) -diff -Nru gcc-4.9.3/gcc/config/mips/mips.c gcc-4.9.3-psp/gcc/config/mips/mips.c ---- gcc-4.9.3/gcc/config/mips/mips.c 2014-03-08 09:27:23.000000000 +0000 -+++ gcc-4.9.3-psp/gcc/config/mips/mips.c 2015-10-19 00:27:43.682089841 +0100 -@@ -248,7 +248,12 @@ - MIPS_BUILTIN_CMP_SINGLE, +diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.c gcc-8.2.0-psp/gcc/config/mips/mips.c +--- gcc-8.2.0/gcc/config/mips/mips.c 2018-03-01 12:37:35.000000000 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/mips.c 2018-12-16 08:31:05.320049739 +0100 +@@ -253,7 +253,12 @@ + MIPS_BUILTIN_MSA_TEST_BRANCH, /* For generating bposge32 branch instructions in MIPS32 DSP ASE. */ - MIPS_BUILTIN_BPOSGE32 @@ -221,7 +221,7 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.c gcc-4.9.3-psp/gcc/config/mips/mips.c }; /* Invoke MACRO (COND) for each C.cond.fmt condition. */ -@@ -574,6 +579,10 @@ +@@ -460,6 +465,10 @@ normal branch. */ static bool mips_branch_likely; @@ -232,7 +232,7 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.c gcc-4.9.3-psp/gcc/config/mips/mips.c /* The current instruction-set architecture. */ enum processor mips_arch; const struct mips_cpu_info *mips_arch_info; -@@ -919,6 +928,9 @@ +@@ -820,6 +829,9 @@ 1, /* branch_cost */ 4 /* memory_latency */ }, @@ -242,15 +242,15 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.c gcc-4.9.3-psp/gcc/config/mips/mips.c { /* Loongson-2E */ DEFAULT_COSTS }, -@@ -13780,6 +13792,7 @@ +@@ -15181,6 +15193,7 @@ AVAIL_NON_MIPS16 (dspr2_32, !TARGET_64BIT && TARGET_DSPR2) AVAIL_NON_MIPS16 (loongson, TARGET_LOONGSON_VECTORS) AVAIL_NON_MIPS16 (cache, TARGET_CACHE_BUILTIN) +AVAIL_NON_MIPS16 (allegrex, TARGET_ALLEGREX) + AVAIL_NON_MIPS16 (msa, TARGET_MSA) /* Construct a mips_builtin_description from the given arguments. - -@@ -13876,6 +13889,30 @@ +@@ -15278,6 +15291,30 @@ MIPS_BUILTIN (bposge, f, "bposge" #VALUE, \ MIPS_BUILTIN_BPOSGE ## VALUE, MIPS_SI_FTYPE_VOID, AVAIL) @@ -281,7 +281,7 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.c gcc-4.9.3-psp/gcc/config/mips/mips.c /* Define a Loongson MIPS_BUILTIN_DIRECT function __builtin_loongson_ for instruction CODE_FOR_loongson_. FUNCTION_TYPE is a builtin_description field. */ -@@ -14122,6 +14159,38 @@ +@@ -15753,6 +15790,38 @@ DIRECT_BUILTIN (dpsqx_s_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32), DIRECT_BUILTIN (dpsqx_sa_w_ph, MIPS_DI_FTYPE_DI_V2HI_V2HI, dspr2_32), @@ -320,16 +320,16 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.c gcc-4.9.3-psp/gcc/config/mips/mips.c /* Builtin functions for ST Microelectronics Loongson-2E/2F cores. */ LOONGSON_BUILTIN (packsswh, MIPS_V4HI_FTYPE_V2SI_V2SI), LOONGSON_BUILTIN (packsshb, MIPS_V8QI_FTYPE_V4HI_V4HI), -@@ -14273,6 +14342,8 @@ - /* Standard mode-based argument types. */ +@@ -16441,6 +16510,8 @@ #define MIPS_ATYPE_UQI unsigned_intQI_type_node + #define MIPS_ATYPE_HI intHI_type_node #define MIPS_ATYPE_SI intSI_type_node +#define MIPS_ATYPE_HI intHI_type_node +#define MIPS_ATYPE_QI intQI_type_node #define MIPS_ATYPE_USI unsigned_intSI_type_node #define MIPS_ATYPE_DI intDI_type_node #define MIPS_ATYPE_UDI unsigned_intDI_type_node -@@ -14575,6 +14646,26 @@ +@@ -17112,6 +17183,26 @@ const1_rtx, const0_rtx); } @@ -356,7 +356,7 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.c gcc-4.9.3-psp/gcc/config/mips/mips.c /* Implement TARGET_EXPAND_BUILTIN. */ static rtx -@@ -14620,6 +14711,9 @@ +@@ -17160,6 +17251,9 @@ case MIPS_BUILTIN_BPOSGE32: return mips_expand_builtin_bposge (d->builtin_type, target); @@ -366,11 +366,10 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.c gcc-4.9.3-psp/gcc/config/mips/mips.c } gcc_unreachable (); } -@@ -17376,6 +17470,22 @@ - +@@ -20212,6 +20306,22 @@ if (TARGET_HARD_FLOAT_ABI && TARGET_MIPS5900) REAL_MODE_FORMAT (SFmode) = &spu_single_format; -+ + + /* Validate -mpreferred-stack-boundary= value, or provide default. + The default of 128-bit is for newABI else 64-bit. */ + mips_preferred_stack_boundary = (TARGET_NEWABI ? 128 : 64); @@ -386,13 +385,14 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.c gcc-4.9.3-psp/gcc/config/mips/mips.c + mips_preferred_stack_boundary = mips_preferred_stack_align * 8; + } + } ++ + mips_register_frame_header_opt (); } - /* Swap the register information for registers I and I + 1, which -diff -Nru gcc-4.9.3/gcc/config/mips/mips-cpus.def gcc-4.9.3-psp/gcc/config/mips/mips-cpus.def ---- gcc-4.9.3/gcc/config/mips/mips-cpus.def 2014-03-04 21:39:50.000000000 +0000 -+++ gcc-4.9.3-psp/gcc/config/mips/mips-cpus.def 2015-10-19 00:17:27.022646519 +0100 -@@ -55,6 +55,7 @@ +diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips-cpus.def gcc-8.2.0-psp/gcc/config/mips/mips-cpus.def +--- gcc-8.2.0/gcc/config/mips/mips-cpus.def 2018-01-03 11:03:58.000000000 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/mips-cpus.def 2018-12-16 08:04:00.777455227 +0100 +@@ -62,6 +62,7 @@ /* MIPS II processors. */ MIPS_CPU ("r6000", PROCESSOR_R6000, 2, 0) @@ -400,31 +400,38 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips-cpus.def gcc-4.9.3-psp/gcc/config/mips/ /* MIPS III processors. */ MIPS_CPU ("r4000", PROCESSOR_R4000, 3, 0) -diff -Nru gcc-4.9.3/gcc/config/mips/mips-ftypes.def gcc-4.9.3-psp/gcc/config/mips/mips-ftypes.def ---- gcc-4.9.3/gcc/config/mips/mips-ftypes.def 2014-02-02 16:05:09.000000000 +0000 -+++ gcc-4.9.3-psp/gcc/config/mips/mips-ftypes.def 2015-10-19 00:17:27.023646521 +0100 -@@ -53,9 +53,12 @@ - DEF_MIPS_FTYPE (2, (SI, DI, SI)) - DEF_MIPS_FTYPE (2, (SI, POINTER, SI)) +diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips-ftypes.def gcc-8.2.0-psp/gcc/config/mips/mips-ftypes.def +--- gcc-8.2.0/gcc/config/mips/mips-ftypes.def 2018-01-03 11:03:58.000000000 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/mips-ftypes.def 2018-12-16 08:06:01.088722866 +0100 +@@ -44,6 +44,8 @@ + DEF_MIPS_FTYPE (3, (DI, DI, V2HI, V2HI)) + DEF_MIPS_FTYPE (3, (DI, DI, V4QI, V4QI)) DEF_MIPS_FTYPE (2, (DI, POINTER, SI)) +DEF_MIPS_FTYPE (1, (SI, HI)) +DEF_MIPS_FTYPE (1, (SI, SF)) + DEF_MIPS_FTYPE (2, (DI, SI, SI)) + DEF_MIPS_FTYPE (2, (DI, USI, USI)) + DEF_MIPS_FTYPE (2, (DI, V2DI, UQI)) +@@ -63,6 +65,7 @@ DEF_MIPS_FTYPE (1, (SI, SI)) DEF_MIPS_FTYPE (2, (SI, SI, SI)) DEF_MIPS_FTYPE (3, (SI, SI, SI, SI)) +DEF_MIPS_FTYPE (1, (SI, QI)) - DEF_MIPS_FTYPE (1, (SI, V2HI)) - DEF_MIPS_FTYPE (2, (SI, V2HI, V2HI)) - DEF_MIPS_FTYPE (1, (SI, V4QI)) -@@ -127,3 +130,4 @@ - DEF_MIPS_FTYPE (1, (VOID, USI)) + DEF_MIPS_FTYPE (1, (SI, UQI)) + DEF_MIPS_FTYPE (1, (SI, UV16QI)) + DEF_MIPS_FTYPE (1, (SI, UV2DI)) +@@ -281,6 +284,7 @@ + DEF_MIPS_FTYPE (3, (VOID, V2DI, CVPOINTER, SI)) DEF_MIPS_FTYPE (2, (VOID, V2HI, V2HI)) DEF_MIPS_FTYPE (2, (VOID, V4QI, V4QI)) +DEF_MIPS_FTYPE (1, (VOID, VOID)) -diff -Nru gcc-4.9.3/gcc/config/mips/mips.h gcc-4.9.3-psp/gcc/config/mips/mips.h ---- gcc-4.9.3/gcc/config/mips/mips.h 2015-02-26 10:40:06.000000000 +0000 -+++ gcc-4.9.3-psp/gcc/config/mips/mips.h 2015-10-19 00:23:37.066514436 +0100 -@@ -231,6 +231,7 @@ + DEF_MIPS_FTYPE (3, (VOID, V4SF, POINTER, SI)) + DEF_MIPS_FTYPE (3, (VOID, V4SI, CVPOINTER, SI)) + DEF_MIPS_FTYPE (3, (VOID, V8HI, CVPOINTER, SI)) +diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.h gcc-8.2.0-psp/gcc/config/mips/mips.h +--- gcc-8.2.0/gcc/config/mips/mips.h 2018-01-03 11:03:58.000000000 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/mips.h 2018-12-16 08:22:53.283288722 +0100 +@@ -285,6 +285,7 @@ #define TARGET_SB1 (mips_arch == PROCESSOR_SB1 \ || mips_arch == PROCESSOR_SB1A) #define TARGET_SR71K (mips_arch == PROCESSOR_SR71000) @@ -432,15 +439,15 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.h gcc-4.9.3-psp/gcc/config/mips/mips.h #define TARGET_XLP (mips_arch == PROCESSOR_XLP) /* Scheduling target defines. */ -@@ -260,6 +261,7 @@ - || mips_tune == PROCESSOR_OCTEON2) +@@ -315,6 +316,7 @@ + || mips_tune == PROCESSOR_OCTEON3) #define TUNE_SB1 (mips_tune == PROCESSOR_SB1 \ || mips_tune == PROCESSOR_SB1A) +#define TUNE_ALLEGREX (mips_tune == PROCESSOR_ALLEGREX) + #define TUNE_P5600 (mips_tune == PROCESSOR_P5600) + #define TUNE_I6400 (mips_tune == PROCESSOR_I6400) - /* Whether vector modes and intrinsics for ST Microelectronics - Loongson-2E/2F processors should be enabled. In o32 pairs of -@@ -868,6 +870,9 @@ +@@ -1018,6 +1020,9 @@ && !TARGET_MIPS5900 \ && !TARGET_MIPS16) @@ -450,23 +457,25 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.h gcc-4.9.3-psp/gcc/config/mips/mips.h /* ISA has the mips4 FP condition code instructions: FP-compare to CC, branch on CC, and move (both FP and non-FP) on CC. */ #define ISA_HAS_8CC (ISA_MIPS4 \ -@@ -895,6 +900,7 @@ +@@ -1053,6 +1058,7 @@ /* ISA has conditional trap instructions. */ #define ISA_HAS_COND_TRAP (!ISA_MIPS1 \ + && !TARGET_ALLEGREX \ && !TARGET_MIPS16) - /* ISA has integer multiply-accumulate instructions, madd and msub. */ -@@ -938,6 +944,7 @@ + /* ISA has conditional trap with immediate instructions. */ +@@ -1112,7 +1118,8 @@ + #define ISA_HAS_IEEE_754_2008 (mips_isa_rev >= 2) + /* ISA has count leading zeroes/ones instruction (not implemented). */ - #define ISA_HAS_CLZ_CLO ((ISA_MIPS32 \ - || ISA_MIPS32R2 \ -+ || TARGET_ALLEGREX \ - || ISA_MIPS64 \ - || ISA_MIPS64R2) \ - && !TARGET_MIPS16) -@@ -983,6 +990,7 @@ +-#define ISA_HAS_CLZ_CLO (mips_isa_rev >= 1 && !TARGET_MIPS16) ++#define ISA_HAS_CLZ_CLO ((mips_isa_rev >= 1 && !TARGET_MIPS16) \ ++ || TARGET_ALLEGREX) + + /* ISA has three operand multiply instructions that put + the high part in an accumulator: mulhi or mulhiu. */ +@@ -1154,6 +1161,7 @@ || TARGET_MIPS5400 \ || TARGET_MIPS5500 \ || TARGET_SR71K \ @@ -474,22 +483,23 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.h gcc-4.9.3-psp/gcc/config/mips/mips.h || TARGET_SMARTMIPS) \ && !TARGET_MIPS16) -@@ -1014,11 +1022,13 @@ +@@ -1183,10 +1191,12 @@ + #define ISA_HAS_TRUNC_W (!ISA_MIPS1) /* ISA includes the MIPS32r2 seb and seh instructions. */ - #define ISA_HAS_SEB_SEH ((ISA_MIPS32R2 \ -+ || TARGET_ALLEGREX \ - || ISA_MIPS64R2) \ - && !TARGET_MIPS16) +-#define ISA_HAS_SEB_SEH (mips_isa_rev >= 2 && !TARGET_MIPS16) ++#define ISA_HAS_SEB_SEH ((mips_isa_rev >= 2 && !TARGET_MIPS16) \ ++ || TARGET_ALLEGREX) /* ISA includes the MIPS32/64 rev 2 ext and ins instructions. */ - #define ISA_HAS_EXT_INS ((ISA_MIPS32R2 \ -+ || TARGET_ALLEGREX \ - || ISA_MIPS64R2) \ - && !TARGET_MIPS16) - -@@ -1084,7 +1094,8 @@ - || ISA_MIPS64R2 \ +-#define ISA_HAS_EXT_INS (mips_isa_rev >= 2 && !TARGET_MIPS16) ++#define ISA_HAS_EXT_INS ((mips_isa_rev >= 2 && !TARGET_MIPS16) \ ++ || TARGET_ALLEGREX) + + /* ISA has instructions for accessing top part of 64-bit fp regs. */ + #define ISA_HAS_MXHC1 (!TARGET_FLOAT32 \ +@@ -1249,7 +1259,8 @@ + #define ISA_HAS_HILO_INTERLOCKS (mips_isa_rev >= 1 \ || TARGET_MIPS5500 \ || TARGET_MIPS5900 \ - || TARGET_LOONGSON_2EF) @@ -497,8 +507,8 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.h gcc-4.9.3-psp/gcc/config/mips/mips.h + || TARGET_ALLEGREX) /* ISA includes synci, jr.hb and jalr.hb. */ - #define ISA_HAS_SYNCI ((ISA_MIPS32R2 \ -@@ -2209,7 +2220,7 @@ + #define ISA_HAS_SYNCI (mips_isa_rev >= 2 && !TARGET_MIPS16) +@@ -2365,7 +2376,7 @@ `crtl->outgoing_args_size'. */ #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1 @@ -507,16 +517,16 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.h gcc-4.9.3-psp/gcc/config/mips/mips.h /* Symbolic macros for the registers used to return integer and floating point values. */ -@@ -2321,7 +2332,7 @@ +@@ -2492,7 +2503,7 @@ /* Treat LOC as a byte offset from the stack pointer and round it up to the next fully-aligned offset. */ #define MIPS_STACK_ALIGN(LOC) \ -- (TARGET_NEWABI ? ((LOC) + 15) & -16 : ((LOC) + 7) & -8) -+ (((LOC) + (mips_preferred_stack_align - 1)) & -(mips_preferred_stack_align)) +- (TARGET_NEWABI ? ROUND_UP ((LOC), 16) : ROUND_UP ((LOC), 8)) ++ (ROUND_UP ((LOC), mips_preferred_stack_align)) /* Output assembler code to FILE to increment profiler label # LABELNO -@@ -2937,6 +2948,9 @@ +@@ -3141,6 +3152,9 @@ " TEXT_SECTION_ASM_OP); #endif @@ -526,9 +536,9 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.h gcc-4.9.3-psp/gcc/config/mips/mips.h #ifndef HAVE_AS_TLS #define HAVE_AS_TLS 0 #endif -diff -Nru gcc-4.9.3/gcc/config/mips/mips.md gcc-4.9.3-psp/gcc/config/mips/mips.md ---- gcc-4.9.3/gcc/config/mips/mips.md 2014-02-02 16:05:09.000000000 +0000 -+++ gcc-4.9.3-psp/gcc/config/mips/mips.md 2015-10-19 00:22:37.694375908 +0100 +diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.md gcc-8.2.0-psp/gcc/config/mips/mips.md +--- gcc-8.2.0/gcc/config/mips/mips.md 2018-01-03 11:03:58.000000000 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/mips.md 2018-12-16 08:18:53.013151197 +0100 @@ -35,6 +35,7 @@ 74kf2_1 74kf1_1 @@ -537,15 +547,15 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.md gcc-4.9.3-psp/gcc/config/mips/mips.m loongson_2e loongson_2f loongson_3a -@@ -756,6 +757,7 @@ +@@ -810,6 +811,7 @@ (define_mode_iterator MOVECC [SI (DI "TARGET_64BIT") (CC "TARGET_HARD_FLOAT && !TARGET_LOONGSON_2EF + && !TARGET_ALLEGREX && !TARGET_MIPS5900")]) - ;; 32-bit integer moves for which we provide move patterns. -@@ -2070,11 +2072,11 @@ + ;; This mode iterator allows :FPCC to be used anywhere that an FP condition +@@ -2248,11 +2250,11 @@ (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d")) (any_extend:DI (match_operand:SI 2 "register_operand" "d")))))] @@ -559,7 +569,7 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.md gcc-4.9.3-psp/gcc/config/mips/mips.m return "msub\t%1,%2"; else return "msac\t$0,%1,%2"; -@@ -2312,14 +2314,14 @@ +@@ -2522,14 +2524,14 @@ (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d")) (any_extend:DI (match_operand:SI 2 "register_operand" "d"))) (match_operand:DI 3 "muldiv_target_operand" "0")))] @@ -576,7 +586,7 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.md gcc-4.9.3-psp/gcc/config/mips/mips.m return "madd\t%1,%2"; else /* See comment in *macc. */ -@@ -2857,6 +2859,33 @@ +@@ -3173,6 +3175,33 @@ ;; ;; .................... ;; @@ -610,7 +620,7 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.md gcc-4.9.3-psp/gcc/config/mips/mips.m ;; NEGATION and ONE'S COMPLEMENT ;; ;; .................... -@@ -2909,6 +2938,25 @@ +@@ -3225,6 +3254,25 @@ (set_attr "compression" "micromips,*") (set_attr "mode" "")]) @@ -636,7 +646,7 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.md gcc-4.9.3-psp/gcc/config/mips/mips.m ;; ;; .................... ;; -@@ -6869,7 +6917,7 @@ +@@ -7196,7 +7244,7 @@ (const_int 0)]) (match_operand:GPR 2 "reg_or_0_operand" "dJ,0") (match_operand:GPR 3 "reg_or_0_operand" "0,dJ")))] @@ -645,23 +655,18 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.md gcc-4.9.3-psp/gcc/config/mips/mips.m "@ mov%T4\t%0,%z2,%1 mov%t4\t%0,%z3,%1" -@@ -6912,8 +6960,12 @@ +@@ -7274,7 +7322,7 @@ (if_then_else:GPR (match_dup 5) (match_operand:GPR 2 "reg_or_0_operand") (match_operand:GPR 3 "reg_or_0_operand")))] -- "ISA_HAS_CONDMOVE" -+ "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE" +- "ISA_HAS_CONDMOVE || ISA_HAS_SEL" ++ "ISA_HAS_CONDMOVE || ISA_HAS_SEL || ISA_HAS_INT_CONDMOVE" { -+ if (ISA_HAS_INT_CONDMOVE -+ && GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_FLOAT) -+ FAIL; -+ - mips_expand_conditional_move (operands); - DONE; - }) -@@ -7185,6 +7237,9 @@ - ; ST-Microelectronics Loongson-2E/2F-specific patterns. - (include "loongson.md") + if (!ISA_HAS_FP_CONDMOVE + && !INTEGRAL_MODE_P (GET_MODE (XEXP (operands[1], 0)))) +@@ -7694,6 +7742,9 @@ + ; The MIPS MSA Instructions. + (include "mips-msa.md") +; Sony ALLEGREX instructions. +(include "allegrex.md") @@ -669,12 +674,12 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.md gcc-4.9.3-psp/gcc/config/mips/mips.m (define_c_enum "unspec" [ UNSPEC_ADDRESS_FIRST ]) -diff -Nru gcc-4.9.3/gcc/config/mips/mips.opt gcc-4.9.3-psp/gcc/config/mips/mips.opt ---- gcc-4.9.3/gcc/config/mips/mips.opt 2014-02-21 13:30:47.000000000 +0000 -+++ gcc-4.9.3-psp/gcc/config/mips/mips.opt 2015-10-19 00:17:27.025646526 +0100 -@@ -400,5 +400,9 @@ - Target Report Var(TARGET_XGOT) - Lift restrictions on GOT size +diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.opt gcc-8.2.0-psp/gcc/config/mips/mips.opt +--- gcc-8.2.0/gcc/config/mips/mips.opt 2018-01-03 11:03:58.000000000 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/mips.opt 2018-12-16 08:04:00.781455198 +0100 +@@ -428,6 +428,10 @@ + Target Report Var(flag_frame_header_optimization) Optimization + Optimize frame header. +mpreferred-stack-boundary= +Target RejectNegative Joined Var(mips_preferred_stack_boundary_string) @@ -682,10 +687,11 @@ diff -Nru gcc-4.9.3/gcc/config/mips/mips.opt gcc-4.9.3-psp/gcc/config/mips/mips. + noasmopt Driver -diff -Nru gcc-4.9.3/gcc/config/mips/psp.h gcc-4.9.3-psp/gcc/config/mips/psp.h ---- gcc-4.9.3/gcc/config/mips/psp.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.9.3-psp/gcc/config/mips/psp.h 2015-10-19 00:17:27.025646526 +0100 -@@ -0,0 +1,31 @@ + +diff -adurB --new-file gcc-8.2.0/gcc/config/mips/psp.h gcc-8.2.0-psp/gcc/config/mips/psp.h +--- gcc-8.2.0/gcc/config/mips/psp.h 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/psp.h 2018-12-16 10:29:10.953973626 +0100 +@@ -0,0 +1,33 @@ +/* Support for Sony's Playstation Portable (PSP). + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by Marcus R. Brown @@ -717,9 +723,11 @@ diff -Nru gcc-4.9.3/gcc/config/mips/psp.h gcc-4.9.3-psp/gcc/config/mips/psp.h +/* Get rid of the .pdr section. */ +#undef SUBTARGET_ASM_SPEC +#define SUBTARGET_ASM_SPEC "-mno-pdr" -diff -Nru gcc-4.9.3/gcc/config/mips/t-allegrex gcc-4.9.3-psp/gcc/config/mips/t-allegrex ---- gcc-4.9.3/gcc/config/mips/t-allegrex 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.9.3-psp/gcc/config/mips/t-allegrex 2015-10-19 00:17:27.025646526 +0100 ++ ++#include "../newlib-stdint.h" +diff -adurB --new-file gcc-8.2.0/gcc/config/mips/t-allegrex gcc-8.2.0-psp/gcc/config/mips/t-allegrex +--- gcc-8.2.0/gcc/config/mips/t-allegrex 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/t-allegrex 2018-12-16 08:04:00.781455198 +0100 @@ -0,0 +1,29 @@ +# Suppress building libgcc1.a, since the MIPS compiler port is complete +# and does not need anything from libgcc1.a. @@ -750,10 +758,10 @@ diff -Nru gcc-4.9.3/gcc/config/mips/t-allegrex gcc-4.9.3-psp/gcc/config/mips/t-a + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib -diff -Nru gcc-4.9.3/gcc/config.gcc gcc-4.9.3-psp/gcc/config.gcc ---- gcc-4.9.3/gcc/config.gcc 2015-05-21 21:50:59.000000000 +0100 -+++ gcc-4.9.3-psp/gcc/config.gcc 2015-10-19 00:17:27.025646526 +0100 -@@ -2118,6 +2118,18 @@ +diff -adurB --new-file gcc-8.2.0/gcc/config.gcc gcc-8.2.0-psp/gcc/config.gcc +--- gcc-8.2.0/gcc/config.gcc 2018-06-25 21:34:01.000000000 +0200 ++++ gcc-8.2.0-psp/gcc/config.gcc 2018-12-16 08:04:00.781455198 +0100 +@@ -2315,6 +2315,18 @@ tm_file="elfos.h newlib-stdint.h ${tm_file} mips/r3900.h mips/elf.h" tmake_file="mips/t-r3900" ;; @@ -771,10 +779,22 @@ diff -Nru gcc-4.9.3/gcc/config.gcc gcc-4.9.3-psp/gcc/config.gcc + ;; mmix-knuth-mmixware) tm_file="${tm_file} newlib-stdint.h" - need_64bit_hwint=yes -diff -Nru gcc-4.9.3/libcpp/Makefile.in gcc-4.9.3-psp/libcpp/Makefile.in ---- gcc-4.9.3/libcpp/Makefile.in 2015-06-26 18:59:14.000000000 +0100 -+++ gcc-4.9.3-psp/libcpp/Makefile.in 2015-10-19 00:17:27.026646529 +0100 + use_gcc_stdint=wrap +diff -adurB --new-file gcc-8.2.0/gcc/graphite.h gcc-8.2.0-psp/gcc/graphite.h +--- gcc-8.2.0/gcc/graphite.h 2018-01-03 11:03:58.000000000 +0100 ++++ gcc-8.2.0-psp/gcc/graphite.h 2018-12-16 09:44:43.550612718 +0100 +@@ -37,6 +37,8 @@ + #include + #include + #include ++#include ++#include + + typedef struct poly_dr *poly_dr_p; + +diff -adurB --new-file gcc-8.2.0/libcpp/Makefile.in gcc-8.2.0-psp/libcpp/Makefile.in +--- gcc-8.2.0/libcpp/Makefile.in 2018-07-26 11:48:58.000000000 +0200 ++++ gcc-8.2.0-psp/libcpp/Makefile.in 2018-12-16 08:04:00.781455198 +0100 @@ -208,8 +208,8 @@ # Note that we put the dependencies into a .Tpo file, then move them # into place if the compile succeeds. We need this because gcc does @@ -786,9 +806,9 @@ diff -Nru gcc-4.9.3/libcpp/Makefile.in gcc-4.9.3-psp/libcpp/Makefile.in else COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \ $(depcomp) $(COMPILE.base) -diff -Nru gcc-4.9.3/libgcc/config/mips/psp.h gcc-4.9.3-psp/libgcc/config/mips/psp.h ---- gcc-4.9.3/libgcc/config/mips/psp.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.9.3-psp/libgcc/config/mips/psp.h 2015-10-19 00:17:27.026646529 +0100 +diff -adurB --new-file gcc-8.2.0/libgcc/config/mips/psp.h gcc-8.2.0-psp/libgcc/config/mips/psp.h +--- gcc-8.2.0/libgcc/config/mips/psp.h 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-8.2.0-psp/libgcc/config/mips/psp.h 2018-12-16 08:04:00.781455198 +0100 @@ -0,0 +1,31 @@ +/* Support for Sony's Playstation Portable (PSP). + Copyright (C) 2005 Free Software Foundation, Inc. @@ -821,9 +841,9 @@ diff -Nru gcc-4.9.3/libgcc/config/mips/psp.h gcc-4.9.3-psp/libgcc/config/mips/ps +/* Get rid of the .pdr section. */ +#undef SUBTARGET_ASM_SPEC +#define SUBTARGET_ASM_SPEC "-mno-pdr" -diff -Nru gcc-4.9.3/libgcc/config/mips/t-allegrex gcc-4.9.3-psp/libgcc/config/mips/t-allegrex ---- gcc-4.9.3/libgcc/config/mips/t-allegrex 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.9.3-psp/libgcc/config/mips/t-allegrex 2015-10-19 00:17:27.026646529 +0100 +diff -adurB --new-file gcc-8.2.0/libgcc/config/mips/t-allegrex gcc-8.2.0-psp/libgcc/config/mips/t-allegrex +--- gcc-8.2.0/libgcc/config/mips/t-allegrex 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-8.2.0-psp/libgcc/config/mips/t-allegrex 2018-12-16 08:04:00.781455198 +0100 @@ -0,0 +1,20 @@ +# Suppress building libgcc1.a, since the MIPS compiler port is complete +# and does not need anything from libgcc1.a. @@ -845,59 +865,9 @@ diff -Nru gcc-4.9.3/libgcc/config/mips/t-allegrex gcc-4.9.3-psp/libgcc/config/mi + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib -diff -Nru gcc-4.9.3/libgcc/config.host gcc-4.9.3-psp/libgcc/config.host ---- gcc-4.9.3/libgcc/config.host 2014-03-27 15:40:31.000000000 +0000 -+++ gcc-4.9.3-psp/libgcc/config.host 2015-10-19 00:17:27.026646529 +0100 -@@ -140,11 +140,15 @@ microblaze*-*-*) - cpu_type=microblaze - ;; - mips*-*-*) -- # All MIPS targets provide a full set of FP routines. - cpu_type=mips - tmake_file="mips/t-mips" - if test "${libgcc_cv_mips_hard_float}" = yes; then -- tmake_file="${tmake_file} t-hardfp-sfdf t-hardfp" -+ if test "${libgcc_cv_mips_single_float}" = yes; then -+ tmake_file="${tmake_file} t-hardfp-sf" -+ else -+ tmake_file="${tmake_file} t-hardfp-sfdf" -+ fi -+ tmake_file="${tmake_file} t-hardfp" - else - tmake_file="${tmake_file} t-softfp-sfdf" - fi -@@ -860,6 +860,14 @@ - mipstx39-*-elf* | mipstx39el-*-elf*) - tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16" - ;; -+mips*-psp*) -+ tmake_file="${tmake_file} mips/t-allegrex" -+ target_cpu_default="MASK_SINGLE_FLOAT|MASK_DIVIDE_BREAKS" -+ tm_file="${tm_file} mips/psp.h" -+ extra_parts="$extra_parts crti.o crtn.o" -+ use_fixproto=yes -+ tm_defines="MIPS_ISA_DEFAULT=2 MIPS_CPU_STRING_DEFAULT=\\\"allegrex\\\" MIPS_ABI_DEFAULT=ABI_EABI" -+ ;; - mmix-knuth-mmixware) - extra_parts="crti.o crtn.o crtbegin.o crtend.o" - tmake_file="${tmake_file} ${cpu_type}/t-${cpu_type}" -diff -Nru gcc-4.9.3/libgcc/crtstuff.c gcc-4.9.3-psp/libgcc/crtstuff.c ---- gcc-4.9.3/libgcc/crtstuff.c 2014-03-10 18:31:20.000000000 +0000 -+++ gcc-4.9.3-psp/libgcc/crtstuff.c 2015-10-19 00:17:27.026646529 +0100 -@@ -47,7 +47,7 @@ - - /* Target machine header files require this define. */ - #define IN_LIBGCC2 -- -+#define USED_FOR_TARGET - /* FIXME: Including auto-host is incorrect, but until we have - identified the set of defines that need to go into auto-target.h, - this will have to do. */ -diff --git /dev/null gcc-4.9.3-psp/libgcc/config/t-hardfp-sf -new file mode 100644 -index 00000000000..10682690219 ---- /dev/null -+++ gcc-4.9.3-psp/libgcc/config/t-hardfp-sf +diff -adurB --new-file gcc-8.2.0/libgcc/config/t-hardfp-sf gcc-8.2.0-psp/libgcc/config/t-hardfp-sf +--- gcc-8.2.0/libgcc/config/t-hardfp-sf 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-8.2.0-psp/libgcc/config/t-hardfp-sf 2018-12-16 08:04:00.781455198 +0100 @@ -0,0 +1,32 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + @@ -931,11 +901,46 @@ index 00000000000..10682690219 + _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \ + _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf \ + _thenan_sf _sf_to_usi _usi_to_sf -diff --git gcc-4.9.3/libgcc/configure gcc-4.9.3-psp/libgcc/configure -index 35896deb7bf..b04e158e155 100644 ---- gcc-4.9.3/libgcc/configure -+++ gcc-4.9.3-psp/libgcc/configure -@@ -4352,6 +4352,26 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +diff -adurB --new-file gcc-8.2.0/libgcc/config.host gcc-8.2.0-psp/libgcc/config.host +--- gcc-8.2.0/libgcc/config.host 2018-04-06 22:04:17.000000000 +0200 ++++ gcc-8.2.0-psp/libgcc/config.host 2018-12-16 08:04:00.781455198 +0100 +@@ -140,11 +140,15 @@ + cpu_type=microblaze + ;; + mips*-*-*) +- # All MIPS targets provide a full set of FP routines. + cpu_type=mips + tmake_file="mips/t-mips" + if test "${libgcc_cv_mips_hard_float}" = yes; then +- tmake_file="${tmake_file} t-hardfp-sfdf t-hardfp" ++ if test "${libgcc_cv_mips_single_float}" = yes; then ++ tmake_file="${tmake_file} t-hardfp-sf" ++ else ++ tmake_file="${tmake_file} t-hardfp-sfdf" ++ fi ++ tmake_file="${tmake_file} t-hardfp" + else + tmake_file="${tmake_file} t-softfp-sfdf" + fi +@@ -959,6 +963,14 @@ + mipstx39-*-elf* | mipstx39el-*-elf*) + tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16" + ;; ++mips*-psp*) ++ tmake_file="${tmake_file} mips/t-allegrex" ++ target_cpu_default="MASK_SINGLE_FLOAT|MASK_DIVIDE_BREAKS" ++ tm_file="${tm_file} mips/psp.h" ++ extra_parts="$extra_parts crti.o crtn.o" ++ use_fixproto=yes ++ tm_defines="MIPS_ISA_DEFAULT=2 MIPS_CPU_STRING_DEFAULT=\\\"allegrex\\\" MIPS_ABI_DEFAULT=ABI_EABI" ++ ;; + mmix-knuth-mmixware) + extra_parts="crti.o crtn.o crtbegin.o crtend.o" + tmake_file="${tmake_file} ${cpu_type}/t-${cpu_type}" +diff -adurB --new-file gcc-8.2.0/libgcc/configure gcc-8.2.0-psp/libgcc/configure +--- gcc-8.2.0/libgcc/configure 2018-04-24 18:45:26.000000000 +0200 ++++ gcc-8.2.0-psp/libgcc/configure 2018-12-16 08:04:00.781455198 +0100 +@@ -4957,6 +4957,26 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_mips_hard_float" >&5 $as_echo "$libgcc_cv_mips_hard_float" >&6; } @@ -961,12 +966,11 @@ index 35896deb7bf..b04e158e155 100644 +$as_echo "$libgcc_cv_mips_single_float" >&6; } esac - # Collect host-machine-specific information. -diff --git gcc-4.9.3/libgcc/configure.ac gcc-4.9.3-psp/libgcc/configure.ac -index d877d21c092..312bf264679 100644 ---- gcc-4.9.3/libgcc/configure.ac -+++ gcc-4.9.3-psp/libgcc/configure.ac -@@ -302,6 +302,14 @@ mips*-*-*) + case ${host} in +diff -adurB --new-file gcc-8.2.0/libgcc/configure.ac gcc-8.2.0-psp/libgcc/configure.ac +--- gcc-8.2.0/libgcc/configure.ac 2018-02-28 09:59:15.000000000 +0100 ++++ gcc-8.2.0-psp/libgcc/configure.ac 2018-12-16 08:04:00.781455198 +0100 +@@ -296,6 +296,14 @@ #endif], [libgcc_cv_mips_hard_float=yes], [libgcc_cv_mips_hard_float=no])]) @@ -980,4 +984,16 @@ index d877d21c092..312bf264679 100644 + [libgcc_cv_mips_single_float=no])]) esac - # Collect host-machine-specific information. + case ${host} in +diff -adurB --new-file gcc-8.2.0/libgcc/crtstuff.c gcc-8.2.0-psp/libgcc/crtstuff.c +--- gcc-8.2.0/libgcc/crtstuff.c 2018-01-03 11:03:58.000000000 +0100 ++++ gcc-8.2.0-psp/libgcc/crtstuff.c 2018-12-16 08:04:00.781455198 +0100 +@@ -47,7 +47,7 @@ + + /* Target machine header files require this define. */ + #define IN_LIBGCC2 +- ++#define USED_FOR_TARGET + /* FIXME: Including auto-host is incorrect, but until we have + identified the set of defines that need to go into auto-target.h, + this will have to do. */ diff --git a/patches/patch-gcc_cp_cfns.h b/patches/patch-gcc_cp_cfns.h deleted file mode 100644 index 79d3dcf..0000000 --- a/patches/patch-gcc_cp_cfns.h +++ /dev/null @@ -1,22 +0,0 @@ ---- gcc/cp/cfns.h.orig 2015-02-13 08:27:46.000000000 +0200 -+++ gcc/cp/cfns.h 2015-02-13 10:23:53.000000000 +0200 -@@ -53,6 +53,9 @@ - static unsigned int hash (const char *, unsigned int); - #ifdef __GNUC__ - __inline -+#ifdef __GNUC_STDC_INLINE__ -+__attribute__ ((__gnu_inline__)) -+#endif - #endif - const char * libc_name_p (const char *, unsigned int); - /* maximum key range = 391, duplicates = 0 */ -@@ -96,7 +99,7 @@ - 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400 - }; -- register int hval = len; -+ register int hval = (int)len; - - switch (hval) - { - diff --git a/scripts/002-gcc-stage1.sh b/scripts/002-gcc-stage1.sh index 4f517a1..902b45a 100755 --- a/scripts/002-gcc-stage1.sh +++ b/scripts/002-gcc-stage1.sh @@ -2,21 +2,23 @@ # gcc-stage1.sh by Naomi Peori (naomi@peori.ca) customized by yreeen(yreeen@gmail.com) ## set gcc version - GCC_VERSION=4.9.3 - GMP_VERSION=5.1.3 - MPC_VERSION=1.0.2 - MPFR_VERSION=3.1.2 + GCC_VERSION=8.2.0 + GMP_VERSION=6.1.2 + MPC_VERSION=1.1.0 + MPFR_VERSION=4.0.1 + ISL_VERSION=0.20 ## Exit on errors set -e ## Download the source code if it does not already exist. - download_and_extract https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.bz2 gcc-$GCC_VERSION + download_and_extract https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.xz gcc-$GCC_VERSION ## Download the library source code if it does not already exist. - download_and_extract https://ftp.gnu.org/gnu/gmp/gmp-$GMP_VERSION.tar.bz2 gmp-$GMP_VERSION + download_and_extract https://ftp.gnu.org/gnu/gmp/gmp-$GMP_VERSION.tar.xz gmp-$GMP_VERSION download_and_extract https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VERSION.tar.gz mpc-$MPC_VERSION - download_and_extract https://ftp.gnu.org/gnu/mpfr/mpfr-$MPFR_VERSION.tar.bz2 mpfr-$MPFR_VERSION + download_and_extract https://ftp.gnu.org/gnu/mpfr/mpfr-$MPFR_VERSION.tar.xz mpfr-$MPFR_VERSION + download_and_extract http://isl.gforge.inria.fr/isl-$ISL_VERSION.tar.xz isl-$ISL_VERSION ## Enter the source directory and patch the source code. cd gcc-$GCC_VERSION @@ -26,13 +28,14 @@ ln -fs ../gmp-$GMP_VERSION gmp ln -fs ../mpc-$MPC_VERSION mpc ln -fs ../mpfr-$MPFR_VERSION mpfr + ln -fs ../isl-$ISL_VERSION isl ## Create and enter the build directory. mkdir build-psp cd build-psp ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c" --enable-lto --with-newlib --with-gmp-include="$(pwd)/gmp" --with-gmp-lib="$(pwd)/gmp/.libs" --with-mpfr-include="$(pwd)/../mpfr/src" --with-mpfr-lib="$(pwd)/mpfr/src/.libs" --without-headers --disable-libssp + CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c" --enable-lto --with-newlib --with-gmp-include="$(pwd)/gmp" --with-gmp-lib="$(pwd)/gmp/.libs" --with-mpfr-include="$(pwd)/mpfr/src" --with-mpfr-lib="$(pwd)/mpfr/src/.libs" --with-isl-include="$(pwd)/isl/include" --with-isl-lib="$(pwd)/isl/.libs" --without-headers --disable-libssp ## Compile and install. make -j $(num_cpus) clean diff --git a/scripts/005-gcc-stage2.sh b/scripts/005-gcc-stage2.sh index db01f7c..42fa41a 100755 --- a/scripts/005-gcc-stage2.sh +++ b/scripts/005-gcc-stage2.sh @@ -3,39 +3,40 @@ # gdc support from TurkeyMan( https://github.com/TurkeyMan ) ## set gcc version - GCC_VERSION=4.9.3 - GMP_VERSION=5.1.3 - MPC_VERSION=1.0.2 - MPFR_VERSION=3.1.2 + GCC_VERSION=8.2.0 + GMP_VERSION=6.1.2 + MPC_VERSION=1.1.0 + MPFR_VERSION=4.0.1 + ISL_VERSION=0.20 ## Exit on errors set -e ## Download the source code if it does not already exist. - download_and_extract https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.bz2 gcc-$GCC_VERSION + download_and_extract https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.xz gcc-$GCC_VERSION ## Download the library source code if it does not already exist. - download_and_extract https://ftp.gnu.org/gnu/gmp/gmp-$GMP_VERSION.tar.bz2 gmp-$GMP_VERSION + download_and_extract https://ftp.gnu.org/gnu/gmp/gmp-$GMP_VERSION.tar.xz gmp-$GMP_VERSION download_and_extract https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VERSION.tar.gz mpc-$MPC_VERSION - download_and_extract https://ftp.gnu.org/gnu/mpfr/mpfr-$MPFR_VERSION.tar.bz2 mpfr-$MPFR_VERSION + download_and_extract https://ftp.gnu.org/gnu/mpfr/mpfr-$MPFR_VERSION.tar.xz mpfr-$MPFR_VERSION + download_and_extract http://isl.gforge.inria.fr/isl-$ISL_VERSION.tar.xz isl-$ISL_VERSION ## Enter the source directory and patch the source code. cd gcc-$GCC_VERSION patch -p1 -i ../../patches/gcc-$GCC_VERSION-PSP.patch - patch -p0 -i ../../patches/patch-gcc_cp_cfns.h ## Unpack the library source code. ln -fs ../gmp-$GMP_VERSION gmp ln -fs ../mpc-$MPC_VERSION mpc ln -fs ../mpfr-$MPFR_VERSION mpfr + ln -fs ../isl-$ISL_VERSION isl ## Create and enter the build directory. mkdir build-psp cd build-psp ## Configure the build. - ## If you want to build gdc add "d" to --enable-languages option. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c,c++" --enable-lto --with-newlib --with-gmp-include="$(pwd)/gmp" --with-gmp-lib="$(pwd)/gmp/.libs" --with-mpfr-include="$(pwd)/../mpfr/src" --with-mpfr-lib="$(pwd)/mpfr/src/.libs" --enable-cxx-flags="-G0" + CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c,c++,lto,objc,obj-c++" --enable-lto --with-newlib --with-gmp-include="$(pwd)/gmp" --with-gmp-lib="$(pwd)/gmp/.libs" --with-mpfr-include="$(pwd)/mpfr/src" --with-mpfr-lib="$(pwd)/mpfr/src/.libs" --with-isl-include="$(pwd)/isl/include" --with-isl-lib="$(pwd)/isl/.libs" --enable-cxx-flags="-G0" ## Compile and install. make -j $(num_cpus) clean From 9164eee3fe9c9838f2ca4a7bbe3ef9d5d2f2f773 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 13:46:04 +0100 Subject: [PATCH 04/30] Put common parts of both GCC stages in one file. Also fix srcdir/builddir usage. This effectively removes the dependency on GMP, MPFR, MPC and ISL installed on the machine. --- gcc.sh | 48 +++++++++++++++++++++++++++++++++++++++ scripts/002-gcc-stage1.sh | 44 +++-------------------------------- scripts/005-gcc-stage2.sh | 47 ++++---------------------------------- 3 files changed, 56 insertions(+), 83 deletions(-) create mode 100755 gcc.sh diff --git a/gcc.sh b/gcc.sh new file mode 100755 index 0000000..56bfdf1 --- /dev/null +++ b/gcc.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# gcc.sh +# Based on gcc-stage1.sh and gcc-stage2.sh by Naomi Peori (naomi@peori.ca) customized by yreeen(yreeen@gmail.com) + + ## set gcc version + GCC_VERSION=8.2.0 + GMP_VERSION=6.1.2 + MPC_VERSION=1.1.0 + MPFR_VERSION=4.0.1 + ISL_VERSION=0.20 + + ## Exit on errors + set -e + + ## Download the source code if it does not already exist. + download_and_extract https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.xz gcc-$GCC_VERSION + + ## Download the library source code if it does not already exist. + download_and_extract https://ftp.gnu.org/gnu/gmp/gmp-$GMP_VERSION.tar.xz gmp-$GMP_VERSION + download_and_extract https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VERSION.tar.gz mpc-$MPC_VERSION + download_and_extract https://ftp.gnu.org/gnu/mpfr/mpfr-$MPFR_VERSION.tar.xz mpfr-$MPFR_VERSION + download_and_extract http://isl.gforge.inria.fr/isl-$ISL_VERSION.tar.xz isl-$ISL_VERSION + + ## Enter the source directory and patch the source code. + cd gcc-$GCC_VERSION + patch -p1 < ../../patches/gcc-$GCC_VERSION-PSP.patch + + ## Unpack the library source code. + ln -fs ../gmp-$GMP_VERSION gmp + ln -fs ../mpc-$MPC_VERSION mpc + ln -fs ../mpfr-$MPFR_VERSION mpfr + ln -fs ../isl-$ISL_VERSION isl + + ## Create and enter the build directory. + mkdir build-psp + cd build-psp + + builddir="$(pwd)" + srcdir="$builddir/.." + + ## Configure the build. + ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c,lto$EXTRA_LANGUAGES" --enable-lto --with-newlib $EXTRA_CONFIGURE_FLAGS + + ## Compile and install. + make -j $(num_cpus) clean + make -j $(num_cpus) + make -j $(num_cpus) install + make -j $(num_cpus) clean diff --git a/scripts/002-gcc-stage1.sh b/scripts/002-gcc-stage1.sh index 902b45a..e09aacd 100755 --- a/scripts/002-gcc-stage1.sh +++ b/scripts/002-gcc-stage1.sh @@ -1,44 +1,6 @@ #!/bin/bash -# gcc-stage1.sh by Naomi Peori (naomi@peori.ca) customized by yreeen(yreeen@gmail.com) - ## set gcc version - GCC_VERSION=8.2.0 - GMP_VERSION=6.1.2 - MPC_VERSION=1.1.0 - MPFR_VERSION=4.0.1 - ISL_VERSION=0.20 + EXTRA_LANGUAGES=',c++,lto,objc,obj-c++' + EXTRA_CONFIGURE_FLAGS='--without-headers --disable-libssp' - ## Exit on errors - set -e - - ## Download the source code if it does not already exist. - download_and_extract https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.xz gcc-$GCC_VERSION - - ## Download the library source code if it does not already exist. - download_and_extract https://ftp.gnu.org/gnu/gmp/gmp-$GMP_VERSION.tar.xz gmp-$GMP_VERSION - download_and_extract https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VERSION.tar.gz mpc-$MPC_VERSION - download_and_extract https://ftp.gnu.org/gnu/mpfr/mpfr-$MPFR_VERSION.tar.xz mpfr-$MPFR_VERSION - download_and_extract http://isl.gforge.inria.fr/isl-$ISL_VERSION.tar.xz isl-$ISL_VERSION - - ## Enter the source directory and patch the source code. - cd gcc-$GCC_VERSION - patch -p1 < ../../patches/gcc-$GCC_VERSION-PSP.patch - - ## Unpack the library source code. - ln -fs ../gmp-$GMP_VERSION gmp - ln -fs ../mpc-$MPC_VERSION mpc - ln -fs ../mpfr-$MPFR_VERSION mpfr - ln -fs ../isl-$ISL_VERSION isl - - ## Create and enter the build directory. - mkdir build-psp - cd build-psp - - ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c" --enable-lto --with-newlib --with-gmp-include="$(pwd)/gmp" --with-gmp-lib="$(pwd)/gmp/.libs" --with-mpfr-include="$(pwd)/mpfr/src" --with-mpfr-lib="$(pwd)/mpfr/src/.libs" --with-isl-include="$(pwd)/isl/include" --with-isl-lib="$(pwd)/isl/.libs" --without-headers --disable-libssp - - ## Compile and install. - make -j $(num_cpus) clean - make -j $(num_cpus) - make -j $(num_cpus) install - make -j $(num_cpus) clean + source ../gcc.sh diff --git a/scripts/005-gcc-stage2.sh b/scripts/005-gcc-stage2.sh index 42fa41a..3cd5d5c 100755 --- a/scripts/005-gcc-stage2.sh +++ b/scripts/005-gcc-stage2.sh @@ -1,45 +1,8 @@ #!/bin/bash -# gcc-stage2.sh by Naomi Peori (naomi@peori.ca) customized by yreeen (yreeen@gmail.com) -# gdc support from TurkeyMan( https://github.com/TurkeyMan ) - ## set gcc version - GCC_VERSION=8.2.0 - GMP_VERSION=6.1.2 - MPC_VERSION=1.1.0 - MPFR_VERSION=4.0.1 - ISL_VERSION=0.20 + EXTRA_LANGUAGES=',c++,objc,obj-c++' + EXTRA_CONFIGURE_FLAGS='--enable-cxx-flags="-G0"' + CFLAGS_FOR_TARGET='-G0' + export CFLAGS_FOR_TARGET - ## Exit on errors - set -e - - ## Download the source code if it does not already exist. - download_and_extract https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.xz gcc-$GCC_VERSION - - ## Download the library source code if it does not already exist. - download_and_extract https://ftp.gnu.org/gnu/gmp/gmp-$GMP_VERSION.tar.xz gmp-$GMP_VERSION - download_and_extract https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VERSION.tar.gz mpc-$MPC_VERSION - download_and_extract https://ftp.gnu.org/gnu/mpfr/mpfr-$MPFR_VERSION.tar.xz mpfr-$MPFR_VERSION - download_and_extract http://isl.gforge.inria.fr/isl-$ISL_VERSION.tar.xz isl-$ISL_VERSION - - ## Enter the source directory and patch the source code. - cd gcc-$GCC_VERSION - patch -p1 -i ../../patches/gcc-$GCC_VERSION-PSP.patch - - ## Unpack the library source code. - ln -fs ../gmp-$GMP_VERSION gmp - ln -fs ../mpc-$MPC_VERSION mpc - ln -fs ../mpfr-$MPFR_VERSION mpfr - ln -fs ../isl-$ISL_VERSION isl - - ## Create and enter the build directory. - mkdir build-psp - cd build-psp - - ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c,c++,lto,objc,obj-c++" --enable-lto --with-newlib --with-gmp-include="$(pwd)/gmp" --with-gmp-lib="$(pwd)/gmp/.libs" --with-mpfr-include="$(pwd)/mpfr/src" --with-mpfr-lib="$(pwd)/mpfr/src/.libs" --with-isl-include="$(pwd)/isl/include" --with-isl-lib="$(pwd)/isl/.libs" --enable-cxx-flags="-G0" - - ## Compile and install. - make -j $(num_cpus) clean - CFLAGS_FOR_TARGET="-G0" make -j $(num_cpus) - make -j $(num_cpus) install - make -j $(num_cpus) clean + source ../gcc.sh From 17c0a0452487adb4151e3fa6fd512e5a548660d7 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 14:50:12 +0100 Subject: [PATCH 05/30] Dispose of duplicate MIPS_ATYPE_HI --- patches/gcc-8.2.0-PSP.patch | 49 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/patches/gcc-8.2.0-PSP.patch b/patches/gcc-8.2.0-PSP.patch index 74715e6..4c27371 100644 --- a/patches/gcc-8.2.0-PSP.patch +++ b/patches/gcc-8.2.0-PSP.patch @@ -1,6 +1,6 @@ diff -adurB --new-file gcc-8.2.0/config.sub gcc-8.2.0-psp/config.sub --- gcc-8.2.0/config.sub 2018-01-03 05:25:18.000000000 +0100 -+++ gcc-8.2.0-psp/config.sub 2018-12-16 08:04:00.773455255 +0100 ++++ gcc-8.2.0-psp/config.sub 2018-12-16 14:48:40.275107924 +0100 @@ -288,6 +288,7 @@ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -30,7 +30,7 @@ diff -adurB --new-file gcc-8.2.0/config.sub gcc-8.2.0-psp/config.sub ;; diff -adurB --new-file gcc-8.2.0/gcc/config/mips/allegrex.md gcc-8.2.0-psp/gcc/config/mips/allegrex.md --- gcc-8.2.0/gcc/config/mips/allegrex.md 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/allegrex.md 2018-12-16 08:04:00.773455255 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/allegrex.md 2018-12-16 14:48:40.275107924 +0100 @@ -0,0 +1,172 @@ +;; Sony ALLEGREX instructions. +;; Copyright (C) 2005 Free Software Foundation, Inc. @@ -206,7 +206,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/allegrex.md gcc-8.2.0-psp/gcc/c + (set_attr "mode" "SF")]) diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.c gcc-8.2.0-psp/gcc/config/mips/mips.c --- gcc-8.2.0/gcc/config/mips/mips.c 2018-03-01 12:37:35.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/mips.c 2018-12-16 08:31:05.320049739 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/mips.c 2018-12-16 14:49:17.406847519 +0100 @@ -253,7 +253,12 @@ MIPS_BUILTIN_MSA_TEST_BRANCH, @@ -320,16 +320,15 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.c gcc-8.2.0-psp/gcc/config /* Builtin functions for ST Microelectronics Loongson-2E/2F cores. */ LOONGSON_BUILTIN (packsswh, MIPS_V4HI_FTYPE_V2SI_V2SI), LOONGSON_BUILTIN (packsshb, MIPS_V8QI_FTYPE_V4HI_V4HI), -@@ -16441,6 +16510,8 @@ +@@ -16441,6 +16510,7 @@ #define MIPS_ATYPE_UQI unsigned_intQI_type_node #define MIPS_ATYPE_HI intHI_type_node #define MIPS_ATYPE_SI intSI_type_node -+#define MIPS_ATYPE_HI intHI_type_node +#define MIPS_ATYPE_QI intQI_type_node #define MIPS_ATYPE_USI unsigned_intSI_type_node #define MIPS_ATYPE_DI intDI_type_node #define MIPS_ATYPE_UDI unsigned_intDI_type_node -@@ -17112,6 +17183,26 @@ +@@ -17112,6 +17182,26 @@ const1_rtx, const0_rtx); } @@ -356,7 +355,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.c gcc-8.2.0-psp/gcc/config /* Implement TARGET_EXPAND_BUILTIN. */ static rtx -@@ -17160,6 +17251,9 @@ +@@ -17160,6 +17250,9 @@ case MIPS_BUILTIN_BPOSGE32: return mips_expand_builtin_bposge (d->builtin_type, target); @@ -366,7 +365,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.c gcc-8.2.0-psp/gcc/config } gcc_unreachable (); } -@@ -20212,6 +20306,22 @@ +@@ -20212,6 +20305,22 @@ if (TARGET_HARD_FLOAT_ABI && TARGET_MIPS5900) REAL_MODE_FORMAT (SFmode) = &spu_single_format; @@ -391,7 +390,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.c gcc-8.2.0-psp/gcc/config diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips-cpus.def gcc-8.2.0-psp/gcc/config/mips/mips-cpus.def --- gcc-8.2.0/gcc/config/mips/mips-cpus.def 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/mips-cpus.def 2018-12-16 08:04:00.777455227 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/mips-cpus.def 2018-12-16 14:48:40.279107896 +0100 @@ -62,6 +62,7 @@ /* MIPS II processors. */ @@ -402,7 +401,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips-cpus.def gcc-8.2.0-psp/gcc MIPS_CPU ("r4000", PROCESSOR_R4000, 3, 0) diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips-ftypes.def gcc-8.2.0-psp/gcc/config/mips/mips-ftypes.def --- gcc-8.2.0/gcc/config/mips/mips-ftypes.def 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/mips-ftypes.def 2018-12-16 08:06:01.088722866 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/mips-ftypes.def 2018-12-16 14:48:40.279107896 +0100 @@ -44,6 +44,8 @@ DEF_MIPS_FTYPE (3, (DI, DI, V2HI, V2HI)) DEF_MIPS_FTYPE (3, (DI, DI, V4QI, V4QI)) @@ -430,7 +429,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips-ftypes.def gcc-8.2.0-psp/g DEF_MIPS_FTYPE (3, (VOID, V8HI, CVPOINTER, SI)) diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.h gcc-8.2.0-psp/gcc/config/mips/mips.h --- gcc-8.2.0/gcc/config/mips/mips.h 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/mips.h 2018-12-16 08:22:53.283288722 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/mips.h 2018-12-16 14:48:40.279107896 +0100 @@ -285,6 +285,7 @@ #define TARGET_SB1 (mips_arch == PROCESSOR_SB1 \ || mips_arch == PROCESSOR_SB1A) @@ -538,7 +537,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.h gcc-8.2.0-psp/gcc/config #endif diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.md gcc-8.2.0-psp/gcc/config/mips/mips.md --- gcc-8.2.0/gcc/config/mips/mips.md 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/mips.md 2018-12-16 08:18:53.013151197 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/mips.md 2018-12-16 14:48:40.279107896 +0100 @@ -35,6 +35,7 @@ 74kf2_1 74kf1_1 @@ -676,7 +675,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.md gcc-8.2.0-psp/gcc/confi ]) diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.opt gcc-8.2.0-psp/gcc/config/mips/mips.opt --- gcc-8.2.0/gcc/config/mips/mips.opt 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/mips.opt 2018-12-16 08:04:00.781455198 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/mips.opt 2018-12-16 14:48:40.279107896 +0100 @@ -428,6 +428,10 @@ Target Report Var(flag_frame_header_optimization) Optimization Optimize frame header. @@ -690,7 +689,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.opt gcc-8.2.0-psp/gcc/conf diff -adurB --new-file gcc-8.2.0/gcc/config/mips/psp.h gcc-8.2.0-psp/gcc/config/mips/psp.h --- gcc-8.2.0/gcc/config/mips/psp.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/psp.h 2018-12-16 10:29:10.953973626 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/psp.h 2018-12-16 14:48:40.279107896 +0100 @@ -0,0 +1,33 @@ +/* Support for Sony's Playstation Portable (PSP). + Copyright (C) 2005 Free Software Foundation, Inc. @@ -727,7 +726,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/psp.h gcc-8.2.0-psp/gcc/config/ +#include "../newlib-stdint.h" diff -adurB --new-file gcc-8.2.0/gcc/config/mips/t-allegrex gcc-8.2.0-psp/gcc/config/mips/t-allegrex --- gcc-8.2.0/gcc/config/mips/t-allegrex 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/t-allegrex 2018-12-16 08:04:00.781455198 +0100 ++++ gcc-8.2.0-psp/gcc/config/mips/t-allegrex 2018-12-16 14:48:40.279107896 +0100 @@ -0,0 +1,29 @@ +# Suppress building libgcc1.a, since the MIPS compiler port is complete +# and does not need anything from libgcc1.a. @@ -760,7 +759,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/t-allegrex gcc-8.2.0-psp/gcc/co +INSTALL_LIBGCC = install-multilib diff -adurB --new-file gcc-8.2.0/gcc/config.gcc gcc-8.2.0-psp/gcc/config.gcc --- gcc-8.2.0/gcc/config.gcc 2018-06-25 21:34:01.000000000 +0200 -+++ gcc-8.2.0-psp/gcc/config.gcc 2018-12-16 08:04:00.781455198 +0100 ++++ gcc-8.2.0-psp/gcc/config.gcc 2018-12-16 14:48:40.279107896 +0100 @@ -2315,6 +2315,18 @@ tm_file="elfos.h newlib-stdint.h ${tm_file} mips/r3900.h mips/elf.h" tmake_file="mips/t-r3900" @@ -782,7 +781,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/config.gcc gcc-8.2.0-psp/gcc/config.gcc use_gcc_stdint=wrap diff -adurB --new-file gcc-8.2.0/gcc/graphite.h gcc-8.2.0-psp/gcc/graphite.h --- gcc-8.2.0/gcc/graphite.h 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/graphite.h 2018-12-16 09:44:43.550612718 +0100 ++++ gcc-8.2.0-psp/gcc/graphite.h 2018-12-16 14:48:40.279107896 +0100 @@ -37,6 +37,8 @@ #include #include @@ -794,7 +793,7 @@ diff -adurB --new-file gcc-8.2.0/gcc/graphite.h gcc-8.2.0-psp/gcc/graphite.h diff -adurB --new-file gcc-8.2.0/libcpp/Makefile.in gcc-8.2.0-psp/libcpp/Makefile.in --- gcc-8.2.0/libcpp/Makefile.in 2018-07-26 11:48:58.000000000 +0200 -+++ gcc-8.2.0-psp/libcpp/Makefile.in 2018-12-16 08:04:00.781455198 +0100 ++++ gcc-8.2.0-psp/libcpp/Makefile.in 2018-12-16 14:48:40.279107896 +0100 @@ -208,8 +208,8 @@ # Note that we put the dependencies into a .Tpo file, then move them # into place if the compile succeeds. We need this because gcc does @@ -808,7 +807,7 @@ diff -adurB --new-file gcc-8.2.0/libcpp/Makefile.in gcc-8.2.0-psp/libcpp/Makefil $(depcomp) $(COMPILE.base) diff -adurB --new-file gcc-8.2.0/libgcc/config/mips/psp.h gcc-8.2.0-psp/libgcc/config/mips/psp.h --- gcc-8.2.0/libgcc/config/mips/psp.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-8.2.0-psp/libgcc/config/mips/psp.h 2018-12-16 08:04:00.781455198 +0100 ++++ gcc-8.2.0-psp/libgcc/config/mips/psp.h 2018-12-16 14:48:40.283107867 +0100 @@ -0,0 +1,31 @@ +/* Support for Sony's Playstation Portable (PSP). + Copyright (C) 2005 Free Software Foundation, Inc. @@ -843,7 +842,7 @@ diff -adurB --new-file gcc-8.2.0/libgcc/config/mips/psp.h gcc-8.2.0-psp/libgcc/c +#define SUBTARGET_ASM_SPEC "-mno-pdr" diff -adurB --new-file gcc-8.2.0/libgcc/config/mips/t-allegrex gcc-8.2.0-psp/libgcc/config/mips/t-allegrex --- gcc-8.2.0/libgcc/config/mips/t-allegrex 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-8.2.0-psp/libgcc/config/mips/t-allegrex 2018-12-16 08:04:00.781455198 +0100 ++++ gcc-8.2.0-psp/libgcc/config/mips/t-allegrex 2018-12-16 14:48:40.283107867 +0100 @@ -0,0 +1,20 @@ +# Suppress building libgcc1.a, since the MIPS compiler port is complete +# and does not need anything from libgcc1.a. @@ -867,7 +866,7 @@ diff -adurB --new-file gcc-8.2.0/libgcc/config/mips/t-allegrex gcc-8.2.0-psp/lib +INSTALL_LIBGCC = install-multilib diff -adurB --new-file gcc-8.2.0/libgcc/config/t-hardfp-sf gcc-8.2.0-psp/libgcc/config/t-hardfp-sf --- gcc-8.2.0/libgcc/config/t-hardfp-sf 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-8.2.0-psp/libgcc/config/t-hardfp-sf 2018-12-16 08:04:00.781455198 +0100 ++++ gcc-8.2.0-psp/libgcc/config/t-hardfp-sf 2018-12-16 14:48:40.283107867 +0100 @@ -0,0 +1,32 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + @@ -903,7 +902,7 @@ diff -adurB --new-file gcc-8.2.0/libgcc/config/t-hardfp-sf gcc-8.2.0-psp/libgcc/ + _thenan_sf _sf_to_usi _usi_to_sf diff -adurB --new-file gcc-8.2.0/libgcc/config.host gcc-8.2.0-psp/libgcc/config.host --- gcc-8.2.0/libgcc/config.host 2018-04-06 22:04:17.000000000 +0200 -+++ gcc-8.2.0-psp/libgcc/config.host 2018-12-16 08:04:00.781455198 +0100 ++++ gcc-8.2.0-psp/libgcc/config.host 2018-12-16 14:48:40.283107867 +0100 @@ -140,11 +140,15 @@ cpu_type=microblaze ;; @@ -939,7 +938,7 @@ diff -adurB --new-file gcc-8.2.0/libgcc/config.host gcc-8.2.0-psp/libgcc/config. tmake_file="${tmake_file} ${cpu_type}/t-${cpu_type}" diff -adurB --new-file gcc-8.2.0/libgcc/configure gcc-8.2.0-psp/libgcc/configure --- gcc-8.2.0/libgcc/configure 2018-04-24 18:45:26.000000000 +0200 -+++ gcc-8.2.0-psp/libgcc/configure 2018-12-16 08:04:00.781455198 +0100 ++++ gcc-8.2.0-psp/libgcc/configure 2018-12-16 14:48:40.283107867 +0100 @@ -4957,6 +4957,26 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_mips_hard_float" >&5 @@ -969,7 +968,7 @@ diff -adurB --new-file gcc-8.2.0/libgcc/configure gcc-8.2.0-psp/libgcc/configure case ${host} in diff -adurB --new-file gcc-8.2.0/libgcc/configure.ac gcc-8.2.0-psp/libgcc/configure.ac --- gcc-8.2.0/libgcc/configure.ac 2018-02-28 09:59:15.000000000 +0100 -+++ gcc-8.2.0-psp/libgcc/configure.ac 2018-12-16 08:04:00.781455198 +0100 ++++ gcc-8.2.0-psp/libgcc/configure.ac 2018-12-16 14:48:40.283107867 +0100 @@ -296,6 +296,14 @@ #endif], [libgcc_cv_mips_hard_float=yes], @@ -987,7 +986,7 @@ diff -adurB --new-file gcc-8.2.0/libgcc/configure.ac gcc-8.2.0-psp/libgcc/config case ${host} in diff -adurB --new-file gcc-8.2.0/libgcc/crtstuff.c gcc-8.2.0-psp/libgcc/crtstuff.c --- gcc-8.2.0/libgcc/crtstuff.c 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/libgcc/crtstuff.c 2018-12-16 08:04:00.781455198 +0100 ++++ gcc-8.2.0-psp/libgcc/crtstuff.c 2018-12-16 14:48:40.283107867 +0100 @@ -47,7 +47,7 @@ /* Target machine header files require this define. */ From 4739a431bce6723ffeb9a39114f2635937174f2c Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 14:54:37 +0100 Subject: [PATCH 06/30] GMP, MPFR, MPC and ISL are not longer a build requirement Now, they're installed automatically under the hood. --- README.md | 4 ++-- depends/check-dependencies.sh | 9 ++------- prepare-debian-ubuntu.sh | 2 +- prepare-mac-os.sh | 2 -- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2809ab1..71dfdc0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ How do I use it? 1. Set up your environment by installing the following software: - autoconf, automake, bison, bzip2, flex, gcc, g++/gcc-c++, gzip, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, xz-utils, wget, mpc, gmp, libelf, mpfr, git + autoconf, automake, bison, bzip2, flex, gcc, g++/gcc-c++, gzip, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, xz-utils, wget, libelf git 2. Set the PSPDEV and PATH environmental variables: @@ -37,7 +37,7 @@ Ubuntu 1. Install the required packages by running. - sudo apt-get install g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip wget bzip2 gzip xz-utils + sudo apt-get install g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libelf-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip wget bzip2 gzip xz-utils 2. Build and install the toolchain and SDK. diff --git a/depends/check-dependencies.sh b/depends/check-dependencies.sh index bde4706..9c7288b 100755 --- a/depends/check-dependencies.sh +++ b/depends/check-dependencies.sh @@ -62,11 +62,6 @@ function check_aclocal missing_depends+=($1); return 1 } - - -# check_header gmp gmp.h -# check_header mpc mpc.h -# check_header mpfr mpfr.h check_header libelf elf.h libelf.h libelf/libelf.h gelf.h libelf/gelf.h check_header libusb usb.h check_header ncurses ncurses.h ncurses/ncurses.h @@ -86,7 +81,7 @@ check_program make check_program gcc check_program g++ -check_program sdl-config +# check_program sdl-config # check_program freetype-config check_program bison @@ -94,7 +89,7 @@ check_program flex check_program tclsh check_program makeinfo -check_program doxygen +# check_program doxygen # Sometimes things will be a little different on Mac OS X... if [ "$(uname)" == "Darwin" ]; then diff --git a/prepare-debian-ubuntu.sh b/prepare-debian-ubuntu.sh index 8c55baf..3e6f5ac 100755 --- a/prepare-debian-ubuntu.sh +++ b/prepare-debian-ubuntu.sh @@ -1,7 +1,7 @@ #!/bin/bash # Install build dependencies -sudo apt-get install $@ g++ build-essential autoconf automake automake1.9 cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool subversion git tcl unzip bzip2 gzip xz-utils +sudo apt-get install $@ g++ build-essential autoconf automake automake1.9 cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libelf-dev libfreetype6-dev zlib1g-dev libtool subversion git tcl unzip bzip2 gzip xz-utils # Make `/bin/sh` an alias for `/bin/bash` instead of `/bin/dash` - which is # faster, but doesn't play nice with some autotools scripts in psp-ports. diff --git a/prepare-mac-os.sh b/prepare-mac-os.sh index fc7f172..cb9f200 100755 --- a/prepare-mac-os.sh +++ b/prepare-mac-os.sh @@ -12,7 +12,6 @@ install_libusb() { if [ -e "/opt/local/bin/port" ]; then sudo port install wget sudo port install libelf - sudo port install libmpc sudo port install libusb sudo port install xz @@ -21,7 +20,6 @@ elif [ -e "/usr/local/bin/brew" ]; then CURRENT_USER=$(stat -f '%Su' /dev/console) sudo -u $CURRENT_USER brew install wget sudo -u $CURRENT_USER brew install libelf - sudo -u $CURRENT_USER brew install libmpc sudo -u $CURRENT_USER brew install libusb sudo -u $CURRENT_USER brew install libusb-compat From 4819798725e7a1e0d8b9c3748bf1074185243775 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 16:19:24 +0100 Subject: [PATCH 07/30] Remove lto from languages (GCC doesn't seem to like this) --- gcc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc.sh b/gcc.sh index 56bfdf1..7a3242f 100755 --- a/gcc.sh +++ b/gcc.sh @@ -39,7 +39,7 @@ srcdir="$builddir/.." ## Configure the build. - ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c,lto$EXTRA_LANGUAGES" --enable-lto --with-newlib $EXTRA_CONFIGURE_FLAGS + ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c$EXTRA_LANGUAGES" --enable-lto --with-newlib $EXTRA_CONFIGURE_FLAGS ## Compile and install. make -j $(num_cpus) clean From 57d78db000491609c4052b71be65e6b230a7e637 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 16:19:42 +0100 Subject: [PATCH 08/30] Fix a build error of stage 2 GCC --- scripts/005-gcc-stage2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/005-gcc-stage2.sh b/scripts/005-gcc-stage2.sh index 3cd5d5c..3c1f89a 100755 --- a/scripts/005-gcc-stage2.sh +++ b/scripts/005-gcc-stage2.sh @@ -1,7 +1,7 @@ #!/bin/bash EXTRA_LANGUAGES=',c++,objc,obj-c++' - EXTRA_CONFIGURE_FLAGS='--enable-cxx-flags="-G0"' + EXTRA_CONFIGURE_FLAGS='--enable-cxx-flags=-G0' CFLAGS_FOR_TARGET='-G0' export CFLAGS_FOR_TARGET From cd233d4d1c14cb4254cfc5471f43c76b4bc40345 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 16:23:46 +0100 Subject: [PATCH 09/30] Fix the actual issue with GCC build and LTO --- gcc.sh | 2 +- scripts/002-gcc-stage1.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc.sh b/gcc.sh index 7a3242f..56bfdf1 100755 --- a/gcc.sh +++ b/gcc.sh @@ -39,7 +39,7 @@ srcdir="$builddir/.." ## Configure the build. - ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c$EXTRA_LANGUAGES" --enable-lto --with-newlib $EXTRA_CONFIGURE_FLAGS + ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c,lto$EXTRA_LANGUAGES" --enable-lto --with-newlib $EXTRA_CONFIGURE_FLAGS ## Compile and install. make -j $(num_cpus) clean diff --git a/scripts/002-gcc-stage1.sh b/scripts/002-gcc-stage1.sh index e09aacd..ac4c7a5 100755 --- a/scripts/002-gcc-stage1.sh +++ b/scripts/002-gcc-stage1.sh @@ -1,6 +1,6 @@ #!/bin/bash - EXTRA_LANGUAGES=',c++,lto,objc,obj-c++' + EXTRA_LANGUAGES='' EXTRA_CONFIGURE_FLAGS='--without-headers --disable-libssp' source ../gcc.sh From 3045dc92e295dc4385300e17c517e24afc6efeb6 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 16 Dec 2018 18:16:04 +0100 Subject: [PATCH 10/30] Fused the prepare scripts into one script. Also made it a little more verbose. A skeleton was added for future support of more package managers on Linux. The system does not use sudo (generally, such scripts should not use sudo), but issues a warning if sudo is not used where it should. The warning message is customized for the system. Removed dependency for automake 1.9 - it is no longer in Debian, which means it's high time the package using it was updated. The script is now safe to be run with a shell other than bash, like dash. The shebang on the top was changed to #!/bin/sh. --- prepare-debian-ubuntu.sh | 11 -- prepare-mac-os.sh | 30 ----- prepare.sh | 232 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 232 insertions(+), 41 deletions(-) delete mode 100755 prepare-debian-ubuntu.sh delete mode 100755 prepare-mac-os.sh create mode 100755 prepare.sh diff --git a/prepare-debian-ubuntu.sh b/prepare-debian-ubuntu.sh deleted file mode 100755 index 3e6f5ac..0000000 --- a/prepare-debian-ubuntu.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# Install build dependencies -sudo apt-get install $@ g++ build-essential autoconf automake automake1.9 cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libelf-dev libfreetype6-dev zlib1g-dev libtool subversion git tcl unzip bzip2 gzip xz-utils - -# Make `/bin/sh` an alias for `/bin/bash` instead of `/bin/dash` - which is -# faster, but doesn't play nice with some autotools scripts in psp-ports. -# The `sudo true` is to make sure we don't pipe into a `sudo` password prompt -# instead of the intended program. -sudo true; echo "dash dash/sh boolean false" | sudo debconf-set-selections -sudo dpkg-reconfigure --frontend=noninteractive dash diff --git a/prepare-mac-os.sh b/prepare-mac-os.sh deleted file mode 100755 index cb9f200..0000000 --- a/prepare-mac-os.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -install_libusb() { - wget --continue https://downloads.sourceforge.net/project/libusb/libusb-0.1%20%28LEGACY%29/0.1.12/libusb-0.1.12.tar.gz -O libusb-legacy.tar.gz - rm -Rf libusb-legacy && mkdir libusb-legacy && tar --strip-components=1 --directory=libusb-legacy -xzf libusb-legacy.tar.gz - cd libusb-legacy - ./configure && make CFLAGS="-Wno-error" CPPFLAGS="-Wno-error" && make install - cd ../ - rm -Rf libusb-legacy && rm libusb-legacy.tar.gz -} - -if [ -e "/opt/local/bin/port" ]; then - sudo port install wget - sudo port install libelf - sudo port install libusb - sudo port install xz - - install_libusb -elif [ -e "/usr/local/bin/brew" ]; then - CURRENT_USER=$(stat -f '%Su' /dev/console) - sudo -u $CURRENT_USER brew install wget - sudo -u $CURRENT_USER brew install libelf - sudo -u $CURRENT_USER brew install libusb - - sudo -u $CURRENT_USER brew install libusb-compat - sudo -u $CURRENT_USER brew install xz -else - echo "Go install MacPorts from http://www.macports.org/ or Homebrew from http://brew.sh/ first, then we can talk" -fi - diff --git a/prepare.sh b/prepare.sh new file mode 100755 index 0000000..7759bb9 --- /dev/null +++ b/prepare.sh @@ -0,0 +1,232 @@ +#!/bin/sh + +case "$(uname -s)" in + Linux) + + if command -v apt >/dev/null 2>&1 + then + if ! [ "$(id -u "$USER")" -eq 0 ] + then + cat >&2 <<_EOF_ +Warning: running without superuser privileges +THIS IS MOST LIKELY GOING TO FAIL. +Run this script using sudo, su or pkexec. +_EOF_ + fi + + set -e + + echo 'Installing dependency packages using APT...' + apt install \ + autoconf \ + automake \ + bison \ + build-essential \ + bzip2 \ + cmake \ + doxygen \ + flex \ + gcc \ + git \ + gzip \ + g++ \ + libelf-dev \ + libfreetype6-dev \ + libncurses-dev \ + libreadline-dev \ + libusb-dev \ + libtool \ + subversion \ + tcl \ + texinfo \ + unzip \ + xz-utils \ + zlib1g-dev + elif command -v apt-get >/dev/null + then + if ! [ "$(id -u "$USER")" -eq 0 ] + then + cat >&2 <<_EOF_ +Warning: running without superuser privileges +THIS IS MOST LIKELY GOING TO FAIL. +Run this script using sudo, su or pkexec. +_EOF_ + fi + + set -e + + echo 'Installing dependency packages using legacy APT...' + apt-get install \ + autoconf \ + automake \ + automake1.9 \ + bison \ + build-essential \ + bzip2 \ + cmake \ + doxygen \ + flex \ + gcc \ + git \ + gzip \ + g++ \ + libelf-dev \ + libfreetype6-dev \ + libncurses5-dev \ + libreadline-dev \ + libusb-dev \ + libtool \ + subversion \ + tcl \ + texinfo \ + unzip \ + xz-utils \ + zlib1g-dev + elif command -v dnf >/dev/null 2>&1 + then + cat >&2 <<_EOF_ +Error: DNF is not supported yet +_EOF_ + exit 77 + elif command -v yum >/dev/null 2>&1 + then + cat >&2 <<_EOF_ +Error: YUM is not supported yet +_EOF_ + exit 77 + elif command -v pacman >/dev/null 2>&1 + then + cat >&2 <<_EOF_ +Error: pacman is not supported yet +_EOF_ + exit 77 + else + cat >&2 <<_EOF_ +Error: your Linux distribution uses an unknown package manager. +_EOF_ + exit 77 + fi + ;; + Darwin) + LIBUSB_URL='https://downloads.sourceforge.net/project/libusb/libusb-0.1%20%28LEGACY%29/0.1.12/libusb-0.1.12.tar.gz' + + cleanup_libusb () + { + echo 'Cleaning up libUSB...' + + rm -rf libusb-legacy libusb-legacy.tar.gz + } + + download_libusb () + { + echo 'Downloading libUSB (legacy version)...' + + if command -v wget >/dev/null 2>&1 + then + wget --continue -O libusb-legacy.tar.gz "$LIBUSB_URL" + elif command -v curl >/dev/null 2>&1 + then + curl --continue-at - -o libusb-legacy.tar.gz "$LIBUSB_URL" + else + cat >&2 <<_EOF_ +Error: no suitable downloader found. + +Install one of these: + + * wget (preferred) + * curl +_EOF_ + exit 77 + fi + } + + build_libusb () + { + echo 'Configuring libUSB (legacy version)...' + mkdir build + cd build + ../configure CFLAGS='-Wno-error' CPPFLAGS='-Wno-error' + echo 'Building libUSB (legacy version)...' + make + echo 'Installing libUSB (legacy version)...' + make install + cd .. + } + + install_libusb () + { + cleanup_libusb + download_libusb + echo 'Unpacking libUSB (legacy version)...' + mkdir libusb-legacy + tar --directory=libusb-legacy --strip-components=1 -zxf libusb-legacy.tar.gz + build_libusb + cd libusb-legacy + cd .. + cleanup_libusb + } + + if command -v port >/dev/null 2>&1 + then + if ! [ "$(id -u "$USER")" -eq 0 ] + then + cat >&2 <<_EOF_ +Warning: running without superuser privileges +THIS IS MOST LIKELY GOING TO FAIL. +Run this script using sudo or su. +_EOF_ + fi + + set -e + + echo 'Installing libELF...' + port install libelf + echo 'Installing libUSB...' + port install libusb + echo 'Installing wget...' + port install wget + echo 'Installing xz...' + port install xz + + install_libusb + elif command -v brew >/dev/null 2>&1 + then + # We are using /usr/bin/stat because otherwise a GNU stat from + # Homebrew may get pulled in which is incompatible. + if ! [ "$(id -u "$USER")" -eq "$(/usr/bin/stat -f'%u' "$(brew --cellar)")" ] + then + cat >&2 <<_EOF_ +Warning: you are not the owner of Homebrew. +THIS IS MOST LIKELY GOING TO FAIL. +Run this script using sudo or su, or contact the owner of Homebrew. +_EOF_ + fi + + echo 'Installing libELF...' + brew install libelf + echo 'Installing libUSB...' + brew install libusb + echo 'Installing libUSB (legacy version)...' + brew install libusb-compat + echo 'Installing wget...' + brew install wget + echo 'Installing xz...' + brew install xz + else + cat >&2 <<_EOF_ +No suitable package manager detected! + +The following package managers are supported on macOS: + + * Homebrew + * MacPorts +_EOF_ + exit 77 + fi + ;; + *) + cat >&2 <<_EOF_ +Error: your operating system is not supported. +_EOF_ + exit 77 +esac From 38281af88857ab437cac67de637eeda846a779b9 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Tue, 18 Dec 2018 06:44:43 +0100 Subject: [PATCH 11/30] Generally reworked scripting system. * Changed the scripts to work under any shell, not just Bash. As a side task, removed all these spaces at the beginning of the files. This wasn't funny, really. * Reworked dependency scripts. Now they're verbose, but I guess they will be silenced later. * Completely new&shiny toolchain.sh! Accepting options on command line and not using environment variables, this one is completely usable with no intervention. Things like PSPDEV or PATH are set based on the command-line options. Of course, toolchain-local.sh and toolchain-sudo.sh have been reworked accordingly and work perfectly with new toolchain.sh. * Removed all usages of sudo. This is NOT a command a script should run. The script instead warns of invalid UID. * Removed all usages of unzip. No ZIP archives are used at the moment and the unzip tool is not standarized and does not support stripping the prefix (I guess it could be done by hand, but it would be a mess). * Removed num_cpus from common.sh. Now scripts should take the number of jobs from the $JOBS variable, set by toolchain.sh. This allows to customize the number of jobs to one's liking. * Removed common.sh from toolchain.sh. export -f is a nonstandard feature anyway. Now each script that needs common.sh includes it. I guess some functions from there could be removed later. * Added run_make to common.sh. This allows to customize options to make in one place. Also removed the -r flag from make because this seems to wreck readline build. * Parametrized most build scripts (for example, 007-gdb-7.3.1.sh was changed to 007-gdb.sh and the version is defined in a variable in the file header). * Merged all the patches for all packages into two patches: - pkg-version-PSP.patch PSP support patch - pkg-version-fixes.patch Bug fix patch (like wrong compiler options, etc.) Not all packages have the fixes patch. For these that have it, its existence is optional and checked. * Disposed of /etc/profile generation script. It was weird and did some assumptions about the host. * Git repository cloning algorithm now checks if the repository is already cloned, is not corrupted and is has the same remote URL. Only then pulls. This should help guard against older repositories. Also changed merge pull to rebase pull. * Various minor changes. --- README.md | 2 +- common.sh | 179 ++++++++----- depends.sh | 95 +++++++ depends/0000-pspdev-prefix.sh | 65 +++++ depends/0100-programs.sh | 39 +++ depends/0200-headers.sh | 10 + depends/check-dependencies.sh | 116 -------- depends/check-pspdev.sh | 15 -- depends/check-sh-is-not-dash.sh | 22 -- gcc.sh | 84 +++--- ...nfofix.patch => binutils-2.22-fixes.patch} | 0 patches/gdb-7.3.1-fix-sim-arange.patch | 22 -- patches/gdb-7.3.1-fix-stpcpy.patch | 11 - ...texinfofix.patch => gdb-7.3.1-fixes.patch} | 69 +++-- prepare.sh | 2 - scripts/001-binutils-2.22.sh | 26 -- scripts/001-binutils.sh | 33 +++ scripts/002-gcc-stage1.sh | 9 +- scripts/003-pspsdk-stage1.sh | 29 +- scripts/004-newlib-1.20.0.sh | 28 -- scripts/004-newlib.sh | 31 +++ scripts/005-gcc-stage2.sh | 12 +- scripts/006-pspsdk-stage2.sh | 31 +-- scripts/007-gdb-7.3.1.sh | 28 -- scripts/007-gdb.sh | 36 +++ scripts/008-insight-6.8.sh | 26 -- scripts/008-insight.sh | 29 ++ scripts/009-psplinkusb.sh | 40 +-- scripts/010-ebootsigner.sh | 22 +- scripts/011-psplibraries.sh | 21 +- scripts/012-profile.sh | 12 - toolchain-local.sh | 12 +- toolchain-sudo.sh | 12 +- toolchain.sh | 247 ++++++++++++++++-- 34 files changed, 827 insertions(+), 588 deletions(-) mode change 100755 => 100644 common.sh create mode 100644 depends.sh create mode 100755 depends/0000-pspdev-prefix.sh create mode 100755 depends/0100-programs.sh create mode 100755 depends/0200-headers.sh delete mode 100755 depends/check-dependencies.sh delete mode 100755 depends/check-pspdev.sh delete mode 100755 depends/check-sh-is-not-dash.sh mode change 100755 => 100644 gcc.sh rename patches/{binutils-2.22-texinfofix.patch => binutils-2.22-fixes.patch} (100%) delete mode 100644 patches/gdb-7.3.1-fix-sim-arange.patch delete mode 100644 patches/gdb-7.3.1-fix-stpcpy.patch rename patches/{gdb-7.3.1-texinfofix.patch => gdb-7.3.1-fixes.patch} (57%) delete mode 100755 scripts/001-binutils-2.22.sh create mode 100755 scripts/001-binutils.sh delete mode 100755 scripts/004-newlib-1.20.0.sh create mode 100755 scripts/004-newlib.sh delete mode 100755 scripts/007-gdb-7.3.1.sh create mode 100755 scripts/007-gdb.sh delete mode 100755 scripts/008-insight-6.8.sh create mode 100755 scripts/008-insight.sh delete mode 100755 scripts/012-profile.sh diff --git a/README.md b/README.md index 71dfdc0..2fd82f3 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Ubuntu 1. Install the required packages by running. - sudo apt-get install g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libelf-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip wget bzip2 gzip xz-utils + sudo apt-get install g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libelf-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl wget bzip2 gzip xz-utils 2. Build and install the toolchain and SDK. diff --git a/common.sh b/common.sh old mode 100755 new mode 100644 index 29bd93f..a8c75e2 --- a/common.sh +++ b/common.sh @@ -1,78 +1,129 @@ -# Returns the number of processor cores available -# Usage: num_cpus -function num_cpus +#!/bin/sh + +# Run the tar command. +# Usage: run_tar +run_tar () { - # This *should* be available on literally everything, including OSX - getconf _NPROCESSORS_ONLN + DIRECTORY="$1" + shift + + tar --directory="$DIRECTORY" --no-same-owner --strip-components=1 "$@" } # Extracts a file based on its extension -# Usage: extract -function auto_extract +# Usage: extract +auto_extract () { - path=$1 - name=`echo $path|sed -e "s/.*\///"` - ext=`echo $name|sed -e "s/.*\.//"` - - echo "Extracting $name..." - - case $ext in - "tar") tar --no-same-owner -xf $path ;; - "gz"|"tgz") tar --no-same-owner -xzf $path ;; - "bz2"|"tbz2") tar --no-same-owner -xjf $path ;; - "xz"|"txz") tar --no-same-owner -xJf $path ;; - "zip") unzip $path ;; - *) echo "I don't know how to extract $ext archives!"; return 1 ;; - esac - - return $? + FILE="$1" + NAME="$(echo "$FILE" | sed -e 's|^.*/||')" + EXTENSION="$(echo "$NAME" | sed -e 's|.*\.||')" + DIRECTORY="$2" + + if [ -d "$DIRECTORY" ] + then + echo "Deleting existing $DIRECTORY" + rm -rf "$DIRECTORY" + fi + + mkdir -p "$DIRECTORY" + + echo "Extracting $NAME" + + case "$EXTENSION" in + tar) + run_tar "$DIRECTORY" -xf "$FILE" + ;; + gz | tgz) + run_tar "$DIRECTORY" -xzf "$FILE" + ;; + bz2 | tbz2) + run_tar "$DIRECTORY" -xjf "$FILE" + ;; + xz | txz) + run_tar "$DIRECTORY" -xJf "$FILE" + ;; + *) + cat >&2 <<_EOF_ +Unsupported archive type: $EXTENSION +_EOF_ + return 1 + ;; + esac + + return $? } # Downloads and extracts a file, with some extra checks. -# Usage: download_and_extract -function download_and_extract +# Usage: download_and_extract +download_and_extract () +{ + URL="$1" + NAME="$(echo "$URL" | sed -e 's|^.*/||;s|\?.*$||')" + OUT_DIR="$2" + + # First, if the archive already exists, attempt to extract it. Failing + # that, attempt to continue an interrupted download. If that also fails, + # remove the presumably corrupted file. + if [ -f "$NAME" ] + then + if auto_extract "$NAME" "$OUT_DIR" + then + return 0 + else + wget --continue --no-check-certificate "$URL" -O "$NAME" || rm -f "$NAME" + fi + fi + + # If the file does not exist at this point, it means it was either never + # downloaded, or it was deleted for being corrupted. Just go ahead and + # download it. + # Using wget --continue here would make buggy servers flip out for nothing. + if ! [ -f "$NAME" ] + then + wget --no-check-certificate "$URL" -O "$NAME" || return 1 + auto_extract "$NAME" "$OUT_DIR" + fi +} + +# Runs Git in a way that won't lock waiting for the user or anything. +# Usage: git_noninteractive +git_noninteractive () { - url=$1 - name=`echo $url|sed -e "s/.*\///"` - outdir=$2 - - # If there are already an extracted directory, delete it, otherwise - # reapplying patches gets messy. I tried. - [ -d $outdir ] && echo "Deleting old version of $outdir" && rm -rf $outdir - - # First, if the archive already exists, attempt to extract it. Failing - # that, attempt to continue an interrupted download. If that also fails, - # remove the presumably corrupted file. - [ -f $name ] && auto_extract $name || { wget --continue --no-check-certificate $url -O $name || rm -f $name; } - - # If the file does not exist at this point, it means it was either never - # downloaded, or it was deleted for being corrupted. Just go ahead and - # download it. - # Using wget --continue here would make buggy servers flip out for nothing. - [ -f $name ] || wget --no-check-certificate $url -O $name && auto_extract $name + SSH_ASKPASS=false git "$@" -function clone_git_repo +# Usage: clone_git_repo [branch] +clone_git_repo () +{ + URL="$1" + LOCAL_DIR="$2" + BRANCH="${3:-master}" + + # It is possible that this is an actual copy of the repository we are + # interested in. + if [ -d "$LOCAL_DIR/.git" ] \ + && git_noninteractive -C "$LOCAL_DIR" status >/dev/null 2>&1 \ + && [ "x$(git_noninteractive -C "$LOCAL_DIR" remote get-url origin 2>/dev/null)" = "x$URL" ] + then + echo "Updating existing repository in $LOCAL_DIR" + cd "$LOCAL_DIR" || return 1 + git_noninteractive pull --rebase origin "$BRANCH" || return 1 + git_noninteractive reset --hard || return 1 + git_noninteractive clean -dfx || return 1 + cd - >/dev/null 2>&1 || return 1 + return 0 + else + echo "Deleting existing $LOCAL_DIR" + rm -rf "$LOCAL_DIR" + fi + + git_noninteractive clone --recursive -b "$BRANCH" "$URL" "$LOCAL_DIR" || return 1 +} + +# Runs make with our options. +# Usage: run_make +run_make () { - host=$1 - user=$2 - repo=$3 - branch=${4:-master} - - OLDPWD=$PWD - - # Try to update an existing repository at the target path. - # Nuke it if it's corrupted and the pull fails. - [ -d $repo/.git ] && { cd $repo && git pull; } || rm -rf $OLDPWD/$repo - - # The above command may leave us standing in the existing repo. - cd $OLDPWD - - # If it does not exist at this point, it was never there in the first place - # or it was nuked due to being corrupted. Clone and track master, please. - # Attempt to clone over SSH if possible, use anonymous HTTP as fallback. - # Set SSH_ASKPASS and stdin(<) to prevent it from freezing to ask for auth. - [ -d $repo ] || SSH_ASKPASS=false git clone --recursive -b $branch git@$host:$user/$repo.git $repo < /dev/null || SSH_ASKPASS=false git clone --recursive -b $branch https://$host/$user/$repo.git $repo < /dev/null || return 1 + make -j"$JOBS" "$@" } diff --git a/depends.sh b/depends.sh new file mode 100644 index 0000000..58642c3 --- /dev/null +++ b/depends.sh @@ -0,0 +1,95 @@ +#!/bin/sh + +fail () +{ + exit 1 +} + +check_program () +{ + if ! command -v "$1" >/dev/null 2>&1 + then + cat >&2 <<_EOF_ +Error: program $1 is missing. +It is a part of $2. +It can be downloaded from <$3>. +_EOF_ + fail + fi +} + +find_header_file () +{ + if [ -z "$HEADER_LOC_LIST" ] + then + HEADER_LOC_LIST="$(cc -v -E - &1 | sed -n -e '/^#include "\.\.\." search starts here:$/,/^End of search list\.$/p' | grep '^ ' | sed -e 's|^ ||')" + fi + + IFS_backup="$IFS" + IFS=' +' + + for DIR in $HEADER_LOC_LIST + do + if [ -f "$DIR/$1" ] + then + return 0 + fi + done + + IFS="$IFS_backup" + unset IFS_backup + + return 1 +} + +check_header () +{ + printf "Checking for header %s... " "$1" + + cat >tmp.$$.c <<_EOF_ +#include <$1> + +int +main (void) +{ + return 0; +} +_EOF_ + + if gcc -c -o tmp.$$.o tmp.$$.c >/dev/null 2>&1 + then + rm -f tmp.$$.c tmp.$$.o + echo "yes" + return 0 + elif find_header_file "$1" + then + rm -f tmp.$$.c tmp.$$.o + echo "present but cannot be compiled" + return 99 + else + rm -f tmp.$$.c tmp.$$.o + echo "no" + return 1 + fi +} + +check_headers () +{ + LIBRARY="$1" + shift + + echo "Checking headers of $LIBRARY:" + + for HEADER + do + if ! check_header "$HEADER" + then + cat >&2 <<_EOF_ +Error: missing header: $HEADER +This usually means that $LIBRARY is not installed or is misconfigured. +_EOF_ + fail + fi + done +} diff --git a/depends/0000-pspdev-prefix.sh b/depends/0000-pspdev-prefix.sh new file mode 100755 index 0000000..08df86a --- /dev/null +++ b/depends/0000-pspdev-prefix.sh @@ -0,0 +1,65 @@ +#!/bin/sh +# 0000-pspdev-prefix.sh by Jakub Kaszycki +# Based on check-pspdev.sh by Naomi Peori (naomi@peori.ca) + +error_byhand () +{ + cat >&2 <<_EOF_ +Error: do not call this script by hand! +Use one of the toolchain.sh scripts! +_EOF_ + exit 1 +} + +error_create () +{ + cat >&2 <<_EOF_ +Error: could not create installation prefix: $PSPDEV +Please create it yourself. +Note that this script needs to be run with permission to write into the prefix. +_EOF_ + exit 1 +} + +error_write () +{ + cat >&2 <<_EOF_ +Error: can not write to installation prefix: $PSPDEV +Please adjust its permissions. +_EOF_ + exit 1 +} + +# This script should not be run by hand, but only by toolchain.sh. Thus, we +# check a variable that is set by that script. +if test -z "$PSPDEV" +then + error_byhand +fi + +# Check whether $PSPDEV/bin is in the PATH. +# toolchain.sh does it. +if ! echo "$PATH" | grep -F "$PSPDEV/bin" > /dev/null 2>&1 +then + error_byhand +fi + +# Check whether $PSPDEV exists. +# If not, create it. +if ! ([ -d "$PSPDEV" ] || mkdir -p "$PSPDEV" > /dev/null 2>&1; exit $?) +then + error_create +fi + +# Check whether we can create files in $PSPDEV. +if ! tee "$PSPDEV/test.tmp" /dev/null 2>&1 +then + error_write +fi + +# Check whether we can dispose of files in $PSPDEV. +# Also dispose of a temporary file. +if ! rm -f "$PSPDEV/test.tmp" >/dev/null 2>&1 +then + error_write +fi diff --git a/depends/0100-programs.sh b/depends/0100-programs.sh new file mode 100755 index 0000000..9546fc0 --- /dev/null +++ b/depends/0100-programs.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +. ../depends.sh + +# Code downloaders +check_program git Git 'https://git-scm.com/' +check_program svn Subversion 'https://subversion.apache.org/' +check_program wget 'GNU wget' 'https://www.gnu.org/software/wget/' + +# Archivers +check_program tar 'GNU tar' 'https://www.gnu.org/software/tar/' + +# Code manipulation +check_program patch 'GNU patch' 'https://www.gnu.org/software/patch/' + +# Build systems +check_program autoconf 'GNU Autoconf' 'https://www.gnu.org/software/autoconf/' +check_program automake 'GNU Automake' 'https://www.gnu.org/software/automake/' +check_program cmake 'CMake' 'https://cmake.org/' +check_program make 'GNU make' 'https://www.gnu.org/software/make/' + +# Compilers +# We use generic names but try to recommend GCC +check_program cc 'GNU GCC' 'https://gcc.gnu.org/' +check_program c++ 'GNU GCC' 'https://gcc.gnu.org/' + +check_program bison 'GNU Bison' 'https://www.gnu.org/software/bison/' +check_program flex 'GNU Flex' 'https://www.gnu.org/software/flex/' +check_program tclsh 'Tcl' 'https://www.tcl.tk/' + +check_program makeinfo 'GNU Texinfo' 'https://www.gnu.org/software/texinfo/' +check_program doxygen 'Doxygen' 'http://www.doxygen.org/' + +# On macOS, +if [ "x$(uname)" = "xDarwin" ]; then + check_program glibtoolize 'GNU Libtool' 'https://www.gnu.org/software/libtool/' +else + check_program libtoolize 'GNU Libtool' 'https://www.gnu.org/software/libtool/' +fi diff --git a/depends/0200-headers.sh b/depends/0200-headers.sh new file mode 100755 index 0000000..c5c5527 --- /dev/null +++ b/depends/0200-headers.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# I've replaced old, file-based header check by new hybrid check. + +. ../depends.sh + +check_headers libELF elf.h libelf.h gelf.h +check_headers 'libUSB (legacy)' usb.h +check_headers NCurses ncurses.h +check_headers ZLib zlib.h +check_headers 'GNU Readline' readline/readline.h diff --git a/depends/check-dependencies.sh b/depends/check-dependencies.sh deleted file mode 100755 index 9c7288b..0000000 --- a/depends/check-dependencies.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash - -header_paths=( - "/usr/include" \ - "/usr/local/include" \ - "/opt/include" \ - "/opt/local/include" \ - "/usr/include/$(uname -m)-linux-gnu" \ - "/usr/local/include/$(uname -m)-linux-gnu" \ - "/usr/include/i386-linux-gnu" \ - "/usr/local/include/i386-linux-gnu" - # -- Add more locations here -- -) - -aclocal_paths=( - "/usr/share/aclocal" - "/usr/local/share/aclocal" -) - -missing_depends=() - -function check_header -{ - for place in ${header_paths[@]}; do - for name in ${@:2}; do - [ -f "$place/$name" ] && return 0 - done - done - - missing_depends+=($1); return 1 -} - -function check_header_nosys -{ - for place in ${header_paths[@]}; do - if [ "${place:0:12}" != "/usr/include" ]; then - for name in ${@:2}; do - [ -f "$place/$name" ] && return 0 - done - fi - done - - missing_depends+=($1); return 1 -} - -function check_program -{ - binary=${2:-$1} - for place in ${PATH//:/ }; do - [ -x "$place/$binary" ] || [ -x "$place/$binary.exe" ] && return 0 - done - - missing_depends+=($1); return 1 -} - -function check_aclocal -{ - for place in ${aclocal_paths[@]}; do - [ -f "$place/$2" ] && return 0 - done - - missing_depends+=($1); return 1 -} - -check_header libelf elf.h libelf.h libelf/libelf.h gelf.h libelf/gelf.h -check_header libusb usb.h -check_header ncurses ncurses.h ncurses/ncurses.h -check_header zlib zlib.h - -check_program git -check_program svn -check_program wget -check_program patch -check_program tar -check_program unzip - -check_program autoconf -check_program automake -check_program cmake -check_program make -check_program gcc -check_program g++ - -# check_program sdl-config -# check_program freetype-config - -check_program bison -check_program flex -check_program tclsh - -check_program makeinfo -# check_program doxygen - -# Sometimes things will be a little different on Mac OS X... -if [ "$(uname)" == "Darwin" ]; then - # readline should be checked carefully on OS X to save us from being - # fooled by BSD libedit. - brew --version 1>/dev/null 2>&1 \ - && header_paths+=("`brew --prefix`/opt/readline/include") - check_header_nosys readline readline.h readline/readline.h - - # GNU libtool will be prepended with letter 'g' to prevent conflicts with - # the one comes along with OS X. - check_program glibtoolize -else - check_header readline readline.h readline/readline.h - check_program libtoolize -fi - -if [ ${#missing_depends[@]} -ne 0 ]; then - echo "Couldn't find dependencies:" - for dep in $missing_depends; do - echo " - $dep" - done - exit 1 -fi diff --git a/depends/check-pspdev.sh b/depends/check-pspdev.sh deleted file mode 100755 index 8a21d44..0000000 --- a/depends/check-pspdev.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# check-pspdev.sh by Naomi Peori (naomi@peori.ca) - -## Check if $PSPDEV is set. -if test ! $PSPDEV; then { echo "ERROR: Set \$PSPDEV before continuing."; exit 1; } fi - -## Check for the $PSPDEV directory. -ls -ld $PSPDEV > /dev/null 2>&1 || mkdir -p $PSPDEV > /dev/null 2>&1 || { echo "ERROR: Create $PSPDEV before continuing."; exit 1; } - -## Check for write permission. -touch $PSPDEV/test.tmp > /dev/null 2>&1 || { echo "ERROR: Grant write permissions for $PSPDEV before continuing."; exit 1; } - -## Check for $PSPDEV/bin in the path. -echo $PATH | grep $PSPDEV/bin > /dev/null 2>&1 || { echo "ERROR: Add $PSPDEV/bin to your path before continuing."; exit 1; } - diff --git a/depends/check-sh-is-not-dash.sh b/depends/check-sh-is-not-dash.sh deleted file mode 100755 index 99945e5..0000000 --- a/depends/check-sh-is-not-dash.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -SH_PATH=$(which sh) -if ls -l $SH_PATH|grep dash >/dev/null 2>&1; then - echo "--------------------------------------------------------------------------------" - echo "ERROR: $SH_PATH is a symlink to dash!" - echo "" - echo "This does not go well with libtool, and will make compilation of some packages" - echo "from psplibraries fail to compile." - echo "" - echo "On Debian-derived distros (including Ubuntu), the following will disable dash," - echo "and make $SH_PATH fall back to bash:" - echo "" - echo '$ echo "dash dash/sh boolean false"|sudo debconf-set-selections' - echo '$ sudo dpkg-reconfigure --frontend=noninteractive dash' - echo "" - echo "Replace 'boolean false' with 'boolean true' if you want to go back to dash." - echo "" - echo "The reason why dash is the default on some systems is that letting bash provide" - echo "$SH_PATH makes all shell scripts start up slightly slower." - echo "--------------------------------------------------------------------------------" -fi diff --git a/gcc.sh b/gcc.sh old mode 100755 new mode 100644 index 56bfdf1..6bf7953 --- a/gcc.sh +++ b/gcc.sh @@ -2,47 +2,43 @@ # gcc.sh # Based on gcc-stage1.sh and gcc-stage2.sh by Naomi Peori (naomi@peori.ca) customized by yreeen(yreeen@gmail.com) - ## set gcc version - GCC_VERSION=8.2.0 - GMP_VERSION=6.1.2 - MPC_VERSION=1.1.0 - MPFR_VERSION=4.0.1 - ISL_VERSION=0.20 - - ## Exit on errors - set -e - - ## Download the source code if it does not already exist. - download_and_extract https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.xz gcc-$GCC_VERSION - - ## Download the library source code if it does not already exist. - download_and_extract https://ftp.gnu.org/gnu/gmp/gmp-$GMP_VERSION.tar.xz gmp-$GMP_VERSION - download_and_extract https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VERSION.tar.gz mpc-$MPC_VERSION - download_and_extract https://ftp.gnu.org/gnu/mpfr/mpfr-$MPFR_VERSION.tar.xz mpfr-$MPFR_VERSION - download_and_extract http://isl.gforge.inria.fr/isl-$ISL_VERSION.tar.xz isl-$ISL_VERSION - - ## Enter the source directory and patch the source code. - cd gcc-$GCC_VERSION - patch -p1 < ../../patches/gcc-$GCC_VERSION-PSP.patch - - ## Unpack the library source code. - ln -fs ../gmp-$GMP_VERSION gmp - ln -fs ../mpc-$MPC_VERSION mpc - ln -fs ../mpfr-$MPFR_VERSION mpfr - ln -fs ../isl-$ISL_VERSION isl - - ## Create and enter the build directory. - mkdir build-psp - cd build-psp - - builddir="$(pwd)" - srcdir="$builddir/.." - - ## Configure the build. - ../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c,lto$EXTRA_LANGUAGES" --enable-lto --with-newlib $EXTRA_CONFIGURE_FLAGS - - ## Compile and install. - make -j $(num_cpus) clean - make -j $(num_cpus) - make -j $(num_cpus) install - make -j $(num_cpus) clean +## set gcc version +GCC_VERSION=8.2.0 +GMP_VERSION=6.1.2 +MPC_VERSION=1.1.0 +MPFR_VERSION=4.0.1 +ISL_VERSION=0.20 + +## Exit on errors +set -e + +## Download the source code if it does not already exist. +download_and_extract "https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.xz" gcc"$VARIANT_SUFFIX-$GCC_VERSION" + +## Download the library source code if it does not already exist. +download_and_extract "https://ftp.gnu.org/gnu/gmp/gmp-$GMP_VERSION.tar.xz" gmp-"$GMP_VERSION" +download_and_extract "https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VERSION.tar.gz" mpc-"$MPC_VERSION" +download_and_extract "https://ftp.gnu.org/gnu/mpfr/mpfr-$MPFR_VERSION.tar.xz" mpfr-"$MPFR_VERSION" +download_and_extract "http://isl.gforge.inria.fr/isl-$ISL_VERSION.tar.xz" isl-"$ISL_VERSION" + +## Enter the source directory and patch the source code. +cd gcc"$VARIANT_SUFFIX-$GCC_VERSION" +patch -p1 < ../../patches/gcc-$GCC_VERSION-PSP.patch + +## Unpack the library source code. +ln -fs ../gmp-$GMP_VERSION gmp +ln -fs ../mpc-$MPC_VERSION mpc +ln -fs ../mpfr-$MPFR_VERSION mpfr +ln -fs ../isl-$ISL_VERSION isl + +## Create and enter the build directory. +mkdir build-psp +cd build-psp + +## Configure the build. +../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c,lto$EXTRA_LANGUAGES" --enable-lto --with-newlib --with-system-zlib $EXTRA_CONFIGURE_FLAGS + +## Compile and install. +run_make +run_make install +run_make clean diff --git a/patches/binutils-2.22-texinfofix.patch b/patches/binutils-2.22-fixes.patch similarity index 100% rename from patches/binutils-2.22-texinfofix.patch rename to patches/binutils-2.22-fixes.patch diff --git a/patches/gdb-7.3.1-fix-sim-arange.patch b/patches/gdb-7.3.1-fix-sim-arange.patch deleted file mode 100644 index 6193181..0000000 --- a/patches/gdb-7.3.1-fix-sim-arange.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- gdb-7.3.1.orig/sim/common/sim-arange.h 2014-04-10 14:07:37.000000000 +1000 -+++ gdb-7.3.1/sim/common/sim-arange.h 2014-04-10 14:05:43.000000000 +1000 -@@ -62,17 +62,13 @@ - - /* Return non-zero if ADDR is in range AR, traversing the entire tree. - If no range is specified, that is defined to mean "everything". */ --extern INLINE int -+static INLINE int - sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/); - #define ADDR_RANGE_HIT_P(ar, addr) \ - ((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr))) - - #ifdef HAVE_INLINE --#ifdef SIM_ARANGE_C --#define SIM_ARANGE_INLINE INLINE --#else --#define SIM_ARANGE_INLINE EXTERN_INLINE --#endif -+#define SIM_ARANGE_INLINE static INLINE - #include "sim-arange.c" - #else - #define SIM_ARANGE_INLINE diff --git a/patches/gdb-7.3.1-fix-stpcpy.patch b/patches/gdb-7.3.1-fix-stpcpy.patch deleted file mode 100644 index edb5aef..0000000 --- a/patches/gdb-7.3.1-fix-stpcpy.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -ru gdb-6.8.orig/bfd/sysdep.h gdb-6.8/bfd/sysdep.h ---- gdb-6.8.orig/bfd/sysdep.h 2007-07-03 16:26:42.000000000 +0200 -+++ gdb-6.8/bfd/sysdep.h 2011-08-21 13:33:47.000000000 +0200 -@@ -131,7 +131,7 @@ - extern PTR realloc (); - #endif - --#if !HAVE_DECL_STPCPY -+#if !HAVE_DECL_STPCPY && !defined(stpcpy) - extern char *stpcpy (char *__dest, const char *__src); - #endif diff --git a/patches/gdb-7.3.1-texinfofix.patch b/patches/gdb-7.3.1-fixes.patch similarity index 57% rename from patches/gdb-7.3.1-texinfofix.patch rename to patches/gdb-7.3.1-fixes.patch index 9f9e32e..79f792f 100644 --- a/patches/gdb-7.3.1-texinfofix.patch +++ b/patches/gdb-7.3.1-fixes.patch @@ -1,9 +1,30 @@ -diff -burN orig.gdb-7.3.1/bfd/doc/bfd.texinfo gdb-7.3.1/bfd/doc/bfd.texinfo +--- gdb-7.3.1.orig/sim/common/sim-arange.h 2014-04-10 14:07:37.000000000 +1000 ++++ gdb-7.3.1/sim/common/sim-arange.h 2014-04-10 14:05:43.000000000 +1000 +@@ -63,3 +63,3 @@ + If no range is specified, that is defined to mean "everything". */ +-extern INLINE int ++static INLINE int + sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/); +@@ -68,7 +68,3 @@ + #ifdef HAVE_INLINE +-#ifdef SIM_ARANGE_C +-#define SIM_ARANGE_INLINE INLINE +-#else +-#define SIM_ARANGE_INLINE EXTERN_INLINE +-#endif ++#define SIM_ARANGE_INLINE static INLINE + #include "sim-arange.c" +--- gdb-6.8.orig/bfd/sysdep.h 2007-07-03 16:26:42.000000000 +0200 ++++ gdb-6.8/bfd/sysdep.h 2011-08-21 13:33:47.000000000 +0200 +@@ -133,3 +133,3 @@ + +-#if !HAVE_DECL_STPCPY ++#if !HAVE_DECL_STPCPY && !defined(stpcpy) + extern char *stpcpy (char *__dest, const char *__src); +only in patch2: --- orig.gdb-7.3.1/bfd/doc/bfd.texinfo 2010-10-28 13:40:25.000000000 +0200 +++ gdb-7.3.1/bfd/doc/bfd.texinfo 2013-08-29 23:05:29.319533968 +0200 -@@ -321,9 +321,9 @@ - @unnumbered BFD Index - @printindex cp +@@ -323,5 +323,5 @@ +@c I think something like @colophon should be in texinfo. In the +@c meantime: @@ -11,53 +32,34 @@ diff -burN orig.gdb-7.3.1/bfd/doc/bfd.texinfo gdb-7.3.1/bfd/doc/bfd.texinfo -% I think something like @colophon should be in texinfo. In the -% meantime: \long\def\colophon{\hbox to0pt{}\vfill - \centerline{The body of this manual is set in} - \centerline{\fontname\tenrm,} -@@ -333,7 +333,7 @@ - \centerline{{\sl\fontname\tensl\/}} - \centerline{are used for emphasis.}\vfill} +@@ -335,4 +335,4 @@ \page\colophon -% Blame: doc@cygnus.com, 28mar91. @end tex +@c Blame: doc@cygnus.com, 28mar91. - @bye -diff -burN orig.gdb-7.3.1/gdb/doc/gdbint.texinfo gdb-7.3.1/gdb/doc/gdbint.texinfo +only in patch2: --- orig.gdb-7.3.1/gdb/doc/gdbint.texinfo 2011-02-04 20:10:12.000000000 +0100 +++ gdb-7.3.1/gdb/doc/gdbint.texinfo 2013-08-29 23:09:03.514998167 +0200 -@@ -35,7 +35,7 @@ - - @titlepage +@@ -37,3 +37,3 @@ @title @value{GDBN} Internals -@subtitle{A guide to the internals of the GNU debugger} +@subtitle A guide to the internals of the GNU debugger @author John Gilmore - @author Cygnus Solutions - @author Second Edition: -diff -burN orig.gdb-7.3.1/gdb/doc/gdb.texinfo gdb-7.3.1/gdb/doc/gdb.texinfo +only in patch2: --- orig.gdb-7.3.1/gdb/doc/gdb.texinfo 2011-09-04 19:10:37.000000000 +0200 +++ gdb-7.3.1/gdb/doc/gdb.texinfo 2013-08-29 23:07:59.951032483 +0200 -@@ -4792,7 +4792,7 @@ - - +@@ -4794,3 +4794,3 @@ @kindex advance @var{location} -@itemx advance @var{location} +@item advance @var{location} Continue running the program up to the given @var{location}. An argument is - required, which should be of one of the forms described in - @ref{Specify Location}. -@@ -5582,7 +5582,7 @@ - @kindex set exec-direction - @item set exec-direction +@@ -5584,3 +5584,3 @@ Set the direction of target execution. -@itemx set exec-direction reverse +@item set exec-direction reverse @cindex execute forward or backward in time - @value{GDBN} will perform all execution commands in reverse, until the - exec-direction mode is changed to ``forward''. Affected commands include -@@ -36953,9 +36953,9 @@ - - @printindex cp +@@ -36955,5 +36955,5 @@ +@c I think something like @colophon should be in texinfo. In the +@c meantime: @@ -65,14 +67,9 @@ diff -burN orig.gdb-7.3.1/gdb/doc/gdb.texinfo gdb-7.3.1/gdb/doc/gdb.texinfo -% I think something like @colophon should be in texinfo. In the -% meantime: \long\def\colophon{\hbox to0pt{}\vfill - \centerline{The body of this manual is set in} - \centerline{\fontname\tenrm,} -@@ -36966,7 +36966,7 @@ - \centerline{{\sl\fontname\tensl\/}} - \centerline{are used for emphasis.}\vfill} +@@ -36968,4 +36968,4 @@ \page\colophon -% Blame: doc@cygnus.com, 1991. @end tex +@c Blame: doc@cygnus.com, 1991. - @bye diff --git a/prepare.sh b/prepare.sh index 7759bb9..2af5d8c 100755 --- a/prepare.sh +++ b/prepare.sh @@ -39,7 +39,6 @@ _EOF_ subversion \ tcl \ texinfo \ - unzip \ xz-utils \ zlib1g-dev elif command -v apt-get >/dev/null @@ -79,7 +78,6 @@ _EOF_ subversion \ tcl \ texinfo \ - unzip \ xz-utils \ zlib1g-dev elif command -v dnf >/dev/null 2>&1 diff --git a/scripts/001-binutils-2.22.sh b/scripts/001-binutils-2.22.sh deleted file mode 100755 index 391e79e..0000000 --- a/scripts/001-binutils-2.22.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# binutils-2.22.sh by Naomi Peori (naomi@peori.ca) - - ## Exit on errors - set -e - - ## Download the source code if it does not already exist. - download_and_extract https://ftp.gnu.org/pub/gnu/binutils/binutils-2.22.tar.bz2 binutils-2.22 - - ## Enter the source directory and patch the source code. - cd binutils-2.22 - patch -p1 < ../../patches/binutils-2.22-PSP.patch - patch -p1 < ../../patches/binutils-2.22-texinfofix.patch - - ## Create and enter the build directory. - mkdir build-psp - cd build-psp - - ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include -Wno-error" CPPFLAGS="$CPPFLAGS -I/opt/local/include -Wno-error" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --enable-install-libbfd - - ## Compile and install. ( -r is required for building under osx ) - make -j $(num_cpus) clean - make -r -j $(num_cpus) - make -j $(num_cpus) install - make -j $(num_cpus) clean diff --git a/scripts/001-binutils.sh b/scripts/001-binutils.sh new file mode 100755 index 0000000..dce8e2a --- /dev/null +++ b/scripts/001-binutils.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# binutils-2.22.sh by Naomi Peori (naomi@peori.ca) + +. ../common.sh + +BINUTILS_VERSION=2.22 + +# Exit on errors +set -e + +# Download the source code if it does not already exist. +download_and_extract https://ftp.gnu.org/pub/gnu/binutils/binutils-"$BINUTILS_VERSION".tar.bz2 binutils-"$BINUTILS_VERSION" + +# Enter the source directory and patch the source code. +cd binutils-"$BINUTILS_VERSION" +patch -p1 < ../../patches/binutils-"$BINUTILS_VERSION"-PSP.patch + +if [ -f ../patches/binutils-"$BINUTILS_VERSION"-fixes.patch ] +then + patch -p1 < ../../patches/binutils-"$BINUTILS_VERSION"-fixes.patch +fi + +# Create and enter the build directory. +mkdir build-psp +cd build-psp + +# Configure the build. +../configure --prefix="$PSPDEV" --target="psp" --enable-install-libbfd --disable-werror --with-system-zlib + +# Compile and install. +run_make +run_make install +run_make clean diff --git a/scripts/002-gcc-stage1.sh b/scripts/002-gcc-stage1.sh index ac4c7a5..c781874 100755 --- a/scripts/002-gcc-stage1.sh +++ b/scripts/002-gcc-stage1.sh @@ -1,6 +1,9 @@ #!/bin/bash - EXTRA_LANGUAGES='' - EXTRA_CONFIGURE_FLAGS='--without-headers --disable-libssp' +. ../common.sh - source ../gcc.sh +EXTRA_LANGUAGES='' +EXTRA_CONFIGURE_FLAGS='--without-headers --disable-libssp' +VARIANT_SUFFIX='-bootstrap' + +source ../gcc.sh diff --git a/scripts/003-pspsdk-stage1.sh b/scripts/003-pspsdk-stage1.sh index 91005d9..32c9326 100755 --- a/scripts/003-pspsdk-stage1.sh +++ b/scripts/003-pspsdk-stage1.sh @@ -1,22 +1,23 @@ #!/bin/bash # pspsdk-stage1.sh by Naomi Peori (naomi@peori.ca) - ## Exit on errors - set -e +. ../common.sh - ## Download the source code if it does not already exist. - clone_git_repo github.com pspdev pspsdk +# Exit on errors +set -e - ## Enter the source directory. - cd pspsdk +# Download the source code if it does not already exist. +clone_git_repo 'https://github.com/pspdev/pspsdk/' pspsdk-stage1 - ## Bootstrap the source. - ./bootstrap +# Enter the source directory. +cd pspsdk-stage1 - ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ./configure --with-pspdev="$PSPDEV" +# Bootstrap the source. +./bootstrap - ## Build and install. - make -j $(num_cpus) clean - make -j $(num_cpus) install-data - make -j $(num_cpus) clean +# Configure the build. +./configure --with-pspdev="$PSPDEV" + +# Build and install. +run_make install-data +run_make clean diff --git a/scripts/004-newlib-1.20.0.sh b/scripts/004-newlib-1.20.0.sh deleted file mode 100755 index 5f432a4..0000000 --- a/scripts/004-newlib-1.20.0.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# newlib-1.20.0.sh by Naomi Peori (naomi@peori.ca) - - ## Exit on errors - set -e - - ## Download the source code if it does not already exist. - download_and_extract https://sourceware.org/pub/newlib/newlib-1.20.0.tar.gz newlib-1.20.0 - - ## Enter the source directory and patch the source code. - cd newlib-1.20.0 - patch -p1 < ../../patches/newlib-1.20.0-PSP.patch - - ## Create and enter the build directory. - mkdir build-psp - cd build-psp - - ## Configure the build. - ../configure --prefix="$PSPDEV" --target="psp" \ - --enable-newlib-iconv \ - --enable-newlib-multithread \ - --enable-newlib-mb \ - - ## Compile and install. - make -j $(num_cpus) clean - make -j $(num_cpus) - make -j $(num_cpus) install - make -j $(num_cpus) clean diff --git a/scripts/004-newlib.sh b/scripts/004-newlib.sh new file mode 100755 index 0000000..7cc5917 --- /dev/null +++ b/scripts/004-newlib.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# newlib-1.20.0.sh by Naomi Peori (naomi@peori.ca) + +. ../common.sh + +# Exit on errors +set -e + +NEWLIB_VERSION=1.20.0 + +# Download the source code if it does not already exist. +download_and_extract "https://sourceware.org/pub/newlib/newlib-$NEWLIB_VERSION.tar.gz" newlib-"$NEWLIB_VERSION" + +# Enter the source directory and patch the source code. +cd newlib-"$NEWLIB_VERSION" +patch -p1 < ../../patches/newlib-"$NEWLIB_VERSION"-PSP.patch + +# Create and enter the build directory. +mkdir build-psp +cd build-psp + +# Configure the build. +../configure --prefix="$PSPDEV" --target="psp" \ + --enable-newlib-iconv \ + --enable-newlib-multithread \ + --enable-newlib-mb + +## Compile and install. +run_make +run_make install +run_make clean diff --git a/scripts/005-gcc-stage2.sh b/scripts/005-gcc-stage2.sh index 3c1f89a..e1aa52a 100755 --- a/scripts/005-gcc-stage2.sh +++ b/scripts/005-gcc-stage2.sh @@ -1,8 +1,10 @@ #!/bin/bash - EXTRA_LANGUAGES=',c++,objc,obj-c++' - EXTRA_CONFIGURE_FLAGS='--enable-cxx-flags=-G0' - CFLAGS_FOR_TARGET='-G0' - export CFLAGS_FOR_TARGET +. ../common.sh - source ../gcc.sh +EXTRA_LANGUAGES=',c++,objc,obj-c++' +EXTRA_CONFIGURE_FLAGS='--enable-cxx-flags=-G0' +CFLAGS_FOR_TARGET='-G0' +export CFLAGS_FOR_TARGET + +source ../gcc.sh diff --git a/scripts/006-pspsdk-stage2.sh b/scripts/006-pspsdk-stage2.sh index 80e768c..8ff6975 100755 --- a/scripts/006-pspsdk-stage2.sh +++ b/scripts/006-pspsdk-stage2.sh @@ -1,23 +1,24 @@ #!/bin/bash # pspsdk-stage2.sh by Naomi Peori (naomi@peori.ca) - ## Exit on errors - set -e +. ../common.sh - ## Download the source code if it does not already exist. - clone_git_repo github.com pspdev pspsdk +# Exit on errors +set -e - ## Enter the source directory. - cd pspsdk +# Download the source code if it does not already exist. +clone_git_repo 'https://github.com/pspdev/pspsdk/' pspsdk-stage2 - ## Bootstrap the source. - ./bootstrap +# Enter the source directory. +cd pspsdk-stage2 - ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ./configure --with-pspdev="$PSPDEV" +# Bootstrap the source. +./bootstrap - ## Build and install. - make -j $(num_cpus) clean - make -j $(num_cpus) - make -j $(num_cpus) install - make -j $(num_cpus) clean +# Configure the build. +./configure --with-pspdev="$PSPDEV" + +## Build and install. +run_make +run_make install +run_make clean diff --git a/scripts/007-gdb-7.3.1.sh b/scripts/007-gdb-7.3.1.sh deleted file mode 100755 index 3f7217c..0000000 --- a/scripts/007-gdb-7.3.1.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# gdb-7.3.1.sh by Naomi Peori (naomi@peori.ca) - - ## Exit on errors - set -e - - ## Download the source code if it does not already exist. - download_and_extract https://ftp.gnu.org/gnu/gdb/gdb-7.3.1.tar.bz2 gdb-7.3.1 - - ## Enter the source directory and patch the source code. - cd gdb-7.3.1 - patch -p1 < ../../patches/gdb-7.3.1-fix-stpcpy.patch - patch -p1 < ../../patches/gdb-7.3.1-PSP.patch - patch -p1 < ../../patches/gdb-7.3.1-texinfofix.patch - patch -p1 < ../../patches/gdb-7.3.1-fix-sim-arange.patch - - ## Create and enter the build directory. - mkdir build-psp - cd build-psp - - ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --disable-werror --disable-nls - - ## Compile and install. - make -j $(num_cpus) clean - make -j $(num_cpus) - make -j $(num_cpus) install - make -j $(num_cpus) clean diff --git a/scripts/007-gdb.sh b/scripts/007-gdb.sh new file mode 100755 index 0000000..6bab74f --- /dev/null +++ b/scripts/007-gdb.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# gdb-7.3.1.sh by Naomi Peori (naomi@peori.ca) + +. ../common.sh + +# Exit on errors +set -e + +GDB_VERSION=7.3.1 + +# Download the source code if it does not already exist. +download_and_extract "https://ftp.gnu.org/gnu/gdb/gdb-$GDB_VERSION.tar.bz2" gdb-"$GDB_VERSION" + +# Enter the source directory and patch the source code. +cd gdb-"$GDB_VERSION" +patch -p1 < ../../patches/gdb-"$GDB_VERSION"-PSP.patch + +if [ -f ../../patches/gdb-"$GDB_VERSION"-fixes.patch ] +then + patch -p1 < ../../patches/gdb-"$GDB_VERSION"-fixes.patch +fi + +# Create and enter the build directory. +mkdir build-psp +cd build-psp + +# Configure the build. +../configure --prefix="$PSPDEV" --target="psp" --disable-werror --with-system-zlib --with-system-readline + +# Compile and install. +# We are doing readline first because there seems to be a bug if we don't do it first. +run_make maybe-configure-readline +run_make maybe-all-readline +run_make +run_make install +run_make clean diff --git a/scripts/008-insight-6.8.sh b/scripts/008-insight-6.8.sh deleted file mode 100755 index e77835c..0000000 --- a/scripts/008-insight-6.8.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# insight-6.8.sh by Naomi Peori (naomi@peori.ca) -exit; - - ## Exit on errors - set -e - - ## Download the source code if it does not already exist. - download_and_extract https://sourceware.org/pub/insight/releases/insight-6.8a.tar.bz2 insight-6.8 - - ## Enter the source directory and patch the source code. - cd insight-6.8 - patch -p1 < ../../patches/insight-6.8-PSP.patch - - ## Create and enter the build directory. - mkdir build-psp - cd build-psp - - ## Configure the build. - CFLAGS="$CFLAGS -I/opt/local/include" CPPFLAGS="$CPPFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" ../configure --prefix="$PSPDEV" --target="psp" --disable-nls --disable-werror - - ## Compile and install. - make -j $(num_cpus) clean - make -j $(num_cpus) - make -j $(num_cpus) install - make -j $(num_cpus) clean diff --git a/scripts/008-insight.sh b/scripts/008-insight.sh new file mode 100755 index 0000000..c057420 --- /dev/null +++ b/scripts/008-insight.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# insight-6.8.sh by Naomi Peori (naomi@peori.ca) +exit; + +. ../common.sh + +# Exit on errors +set -e + +INSIGHT_VERSION="6.8a" + +# Download the source code if it does not already exist. +download_and_extract "https://sourceware.org/pub/insight/releases/insight-$INSIGHT_VERSION.tar.bz2" insight-"$INSIGHT_VERSION" + +# Enter the source directory and patch the source code. +cd insight-"$INSIGHT_VERSION" +patch -p1 < ../../patches/insight-"$INSIGHT_VERSION"-PSP.patch + +# Create and enter the build directory. +mkdir build-psp +cd build-psp + +# Configure the build. +../configure --prefix="$PSPDEV" --target="psp" --disable-werror + +# Compile and install. +run_make +run_make install +run_make clean diff --git a/scripts/009-psplinkusb.sh b/scripts/009-psplinkusb.sh index 5366ceb..161db22 100755 --- a/scripts/009-psplinkusb.sh +++ b/scripts/009-psplinkusb.sh @@ -1,34 +1,18 @@ #!/bin/bash # psplinkusb.sh by Naomi Peori (naomi@peori.ca) - ## Exit on errors - set -e - - ## Download the source code if it does not already exist - clone_git_repo github.com pspdev psplinkusb +. ../common.sh - ## Enter the source directory - cd psplinkusb +# Exit on errors +set -e - ## Mac OS X fix - if [ "$(uname)" == "Darwin" ]; then - if [ -d /opt/local/include ] && [ -d /opt/local/lib ]; then # MacPorts - export C_INCLUDE_PATH="/opt/local/include" - export CPLUS_INCLUDE_PATH="/opt/local/include" - export LIBRARY_PATH="/opt/local/lib" - elif brew --version 1>/dev/null 2>&1; then # Homebrew - HOMEBREW_PREFIX=$(brew --prefix) - export C_INCLUDE_PATH="$HOMEBREW_PREFIX/include:$HOMEBREW_PREFIX/opt/readline/include" - export CPLUS_INCLUDE_PATH="$C_INCLUDE_PATH" - export LIBRARY_PATH="$HOMEBREW_PREFIX/lib:$HOMEBREW_PREFIX/opt/readline/lib" - else - # Additional package manager/well-known locations? Add them here... - echo "WARNING: using libreadline from OS X, this may lead to compilation issues" - fi - fi +# Download the source code if it does not already exist +clone_git_repo 'https://github.com/pspdev/psplinkusb/' psplinkusb - ## Build and install. - make -f Makefile.clients -j $(num_cpus) clean - make -f Makefile.clients -j $(num_cpus) - make -f Makefile.clients -j $(num_cpus) install - make -f Makefile.clients -j $(num_cpus) clean +# Enter the source directory +cd psplinkusb + +# Build and install. +run_make -f Makefile.clients +run_make -f Makefile.clients install +run_make -f Makefile.clients clean diff --git a/scripts/010-ebootsigner.sh b/scripts/010-ebootsigner.sh index 786c294..045f1ab 100755 --- a/scripts/010-ebootsigner.sh +++ b/scripts/010-ebootsigner.sh @@ -2,15 +2,17 @@ # ebootsigner.sh by Sam Hegarty (samr.hegarty@gmail.com) # Modification of script by Naomi Peori (naomi@peori.ca) - ## Exit on errors - set -e +. ../common.sh - ## Download the source code if it does not already exist. - clone_git_repo github.com int-0 ebootsigner +# Exit on errors +set -e - ## Enter the source directory. - cd ebootsigner - - ## Build and install - make -j $(num_cpus) - make -j $(num_cpus) install +# Download the source code if it does not already exist. +clone_git_repo 'https://github.com/int-0/ebootsigner/' ebootsigner + +# Enter the source directory. +cd ebootsigner + +# Build and install +run_make +run_make install diff --git a/scripts/011-psplibraries.sh b/scripts/011-psplibraries.sh index be0f1f0..cf83d01 100755 --- a/scripts/011-psplibraries.sh +++ b/scripts/011-psplibraries.sh @@ -1,18 +1,17 @@ #!/bin/bash # psplibraries.sh by Takeshi Watanabe (takechi101010@gmail.com) - ## clear CC and CXX - unset CC - unset CXX +. ../common.sh - ## Exit on errors - set -e +# Exit on errors +set -e - ## Download the source code. - clone_git_repo github.com pspdev psplibraries +# Download the source code. +clone_git_repo 'https://github.com/pspdev/psplibraries/' psplibraries - ## Enter the source directory. - cd psplibraries +# Enter the source directory. +cd psplibraries - ## Configure the build. - ./libraries.sh +# Configure the build. +# Until psplibraries switches to any compliant shell we have to use bash. +/bin/bash ./libraries.sh diff --git a/scripts/012-profile.sh b/scripts/012-profile.sh deleted file mode 100755 index b804f3e..0000000 --- a/scripts/012-profile.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -e - -if [ -d /etc/profile.d/ ] && [ "$(id -u)" -eq "0" ]; -then - echo "export PSPDEV=$PSPDEV" > /etc/profile.d/psptoolchain.sh - echo "export PATH=\$PATH:\$PSPDEV/bin" >> /etc/profile.d/psptoolchain.sh - echo "$PSPDEV/bin added to your systems login scripts!" -else - echo "Remember to add $PSPDEV/bin to your path..." -fi diff --git a/toolchain-local.sh b/toolchain-local.sh index a7d2a75..57ec0ce 100755 --- a/toolchain-local.sh +++ b/toolchain-local.sh @@ -1,11 +1,3 @@ -export PSPDEV=$(pwd)/pspdev -export PATH=$PATH:$PSPDEV/bin +#!/bin/sh -## If specific steps were requested... -if [ $1 ]; then - ## Run the requested build scripts. - ./toolchain.sh $@ -else - ## Run the all build scripts. - ./toolchain.sh $(seq 1 11) -fi +exec ./toolchain.sh -d"$(pwd)/pspdev" "$@" diff --git a/toolchain-sudo.sh b/toolchain-sudo.sh index 157556f..0e02f87 100755 --- a/toolchain-sudo.sh +++ b/toolchain-sudo.sh @@ -1,14 +1,4 @@ #!/bin/bash # toolchain-sudo.sh by Naomi Peori (naomi@peori.ca) - - INSTALLDIR=/usr/local/pspdev - - ## Enter the psptoolchain directory. - cd "`dirname $0`" || { echo "ERROR: Could not enter the psptoolchain directory."; exit 1; } - ## Set up the environment. - export PSPDEV=$INSTALLDIR - export PATH=$PATH:$PSPDEV/bin - - ## Run the toolchain script. - ./toolchain.sh $@ || { echo "ERROR: Could not run the toolchain script."; exit 1; } +exec ./toolchain.sh -d/usr/local/pspdev "$@" diff --git a/toolchain.sh b/toolchain.sh index dd3d454..d3333e3 100755 --- a/toolchain.sh +++ b/toolchain.sh @@ -1,40 +1,231 @@ -#!/bin/bash -# toolchain.sh by Naomi Peori (naomi@peori.ca) +#!/bin/sh +# toolchain.sh by Jakub Kaszycki - ## Load and export shared functions - source common.sh - export -f num_cpus - export -f auto_extract - export -f download_and_extract - export -f clone_git_repo +# This function is based on an old function, which enforced the number of +# jobs. Now the only purpose of this function is to provide a way to detect +# CPU number when the user wants to detect it. +num_cpus () +{ + if command -v getconf >/dev/null 2>&1 + then + if getconf _NPROCESSORS_ONLN >/dev/null 2>&1 + then + getconf _NPROCESSORS_ONLN + return 0 + fi + fi - ## Enter the psptoolchain directory. - cd "`dirname $0`" || { echo "ERROR: Could not enter the psptoolchain directory."; exit 1; } + cat >&2 <<_EOF_ +Warning: could not detect number of CPUs, assuming 1 job at a time +_EOF_ + echo 1 +} - ## Create the build directory. - mkdir -p build || { echo "ERROR: Could not create the build directory."; exit 1; } +# Parse the command line options. - ## Enter the build directory. - cd build || { echo "ERROR: Could not enter the build directory."; exit 1; } +short_usage () +{ + echo "Usage: $0 [options...] [stages...]" +} - ## Fetch the depend scripts. - DEPEND_SCRIPTS=(`ls ../depends/*.sh | sort`) +error_usage () +{ + short_usage + echo "Try $0 -h for more information." +} - ## Run all the depend scripts. - for SCRIPT in ${DEPEND_SCRIPTS[@]}; do "$SCRIPT" || { echo "$SCRIPT: Failed."; exit 1; } done +usage () +{ + short_usage + cat <<_EOF_ +Builds the PSP toolchain. - ## Fetch the build scripts. - BUILD_SCRIPTS=(`ls ../scripts/*.sh | sort`) +Options: - ## If specific steps were requested... - if [ $1 ]; then + -d Set as the output directory. + This option is required. + -h Print this help text. + -j Run jobs at the same time. If the argument + "auto" is given, chooses a number depending on the + number of available CPUs. If this option is not given, + the script runs only one job at a time (takes + a lot of time with tasks like building GCC, but is + safer, more stable and much more deterministic). + -s Set as the source directory. + The default is current directory. - ## Run the requested build scripts. - for STEP in $@; do "${BUILD_SCRIPTS[$STEP-1]}" || { echo "${BUILD_SCRIPTS[$STEP-1]}: Failed."; exit 1; } done +If no stages are passed, all stages are run. Otherwise, only the selected +stages are run with the order as passed on the command line. - else +Stages may be passed as names, numbers or script names. +_EOF_ +} - ## Run the all build scripts. - for SCRIPT in ${BUILD_SCRIPTS[@]}; do "$SCRIPT" || { echo "$SCRIPT: Failed."; exit 1; } done +PSPDEV= +JOBS=1 +SOURCE=. - fi +while getopts '+:d:hj:s:' opt +do + case "$opt" in + d) + PSPDEV="$OPTARG" + ;; + h) + usage + exit 0 + ;; + j) + JOBS="$OPTARG" + ;; + s) + SOURCE="$OPTARG" + ;; + \?) + echo "Unknown option: -$OPTOPT" + error_usage >&2 + exit 2 + ;; + :) + echo "Missing argument to option -$OPTOPT" >&2 + error_usage >&2 + exit 2 + ;; + *) + echo 'Internal error' >&2 + exit 99 + esac +done + +shift $((OPTIND-1)) + +if [ -z "$PSPDEV" ] +then + echo "Missing required option -d" + exit 2 +fi + +if [ "x$JOBS" = xauto ] +then + JOBS="$(num_cpus)" +fi + +PSPDEV="$(realpath "$PSPDEV")" +SOURCE="$(realpath "$SOURCE")" + +PSPDEV_TMPDIR="$(mktemp -dt pspdev-tmp-XXXXXX)" + +cleanup () +{ + rm -rf "$PSPDEV_TMPDIR" +} + +trap cleanup EXIT + +export JOBS +export PSPDEV +export PSPDEV_TMPDIR + +PATH="$PSPDEV/bin:$PATH" +export PATH + +# Usage: run_script SCRIPT TYPE +run_script () +{ + SCRIPT="$1" + + echo "Running $2 script: $(basename "$SCRIPT")" + + "$SCRIPT" + X=$? + + if ! [ "$X" -eq 0 ] + then + echo "Script $(basename "$SCRIPT") failed with error $X" + exit 1 + fi +} + +# Usage: run_scripts DIR TYPE +run_scripts () +{ + echo "Running $2 scripts" + + IFS_backup="$IFS" + IFS=' +' + for SCRIPT in $(find "$1" -name '*.sh' | sort) + do + run_script "$SCRIPT" "$2" + done + IFS="$IFS_backup" + unset IFS_backup +} + +## Enter the psptoolchain directory. +cd "$SOURCE" || { echo "ERROR: Could not enter the psptoolchain directory."; exit 1; } + +## Create the build directory. +mkdir -p build || { echo "ERROR: Could not create the build directory."; exit 1; } + +## Enter the build directory. +cd build || { echo "ERROR: Could not enter the build directory."; exit 1; } + +run_scripts ../depends dependency + +get_script_number () +{ + NUM="$1" + NUM=$((NUM)) + printf '%03d' "$NUM" + unset NUM +} + +have_script_number () +{ + # First, check it is a number + if ! [ "$(printf "%s" "$1" | tr -d '0-9' | wc -c)" -eq 0 ] + then + return 1 + fi + + NUM="$(get_script_number "$1")" + + [ "$(find ../scripts -name "$NUM-*.sh" | wc -l)" -eq 1 ] + return $? +} + +have_script_name () +{ + [ "$(find ../scripts -name "[0-9][0-9][0-9]-$1.sh" | wc -l)" -eq 1 ] + return $? +} + +if [ "$#" -eq 0 ] +then + run_scripts ../scripts build +else + for SCRIPT + do + if echo "$SCRIPT" | grep -F '/' >/dev/null 2>&1 + then + # Plain file path. + run_script "$(cd .. && realpath "$SCRIPT")" build + elif [ -e "../scripts/$SCRIPT" ] + then + # Script file name + run_script "../scripts/$SCRIPT" build + elif have_script_number "$SCRIPT" + then + # Script number + run_script "../scripts/$(get_script_number "$SCRIPT")-"*".sh" build + elif have_script_name "$SCRIPT" + then + # Script name + run_script "../scripts/"*"-$SCRIPT.sh" build + else + echo "Unknown script: $SCRIPT" >&2 + exit 1 + fi + done +fi From 3a6e1a250aa385dbfd32095ec8bf0b8d9191c93d Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Tue, 18 Dec 2018 14:23:35 +0100 Subject: [PATCH 12/30] Fixed a bug when if archives were partial they would not be extracted after download was finished --- common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common.sh b/common.sh index a8c75e2..35247ec 100644 --- a/common.sh +++ b/common.sh @@ -81,8 +81,9 @@ download_and_extract () if ! [ -f "$NAME" ] then wget --no-check-certificate "$URL" -O "$NAME" || return 1 - auto_extract "$NAME" "$OUT_DIR" fi + + auto_extract "$NAME" "$OUT_DIR" } # Runs Git in a way that won't lock waiting for the user or anything. From ea86413528083b4566e8e1c0dcc6ab3ba5dfa5a0 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Thu, 11 Apr 2019 07:59:52 +0200 Subject: [PATCH 13/30] Added an initial GitLab CI configuration I'm going to use it for local testing and if someone made a GitLab mirror, it would automatically start testing. --- .gitlab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..7c72c08 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,17 @@ +# Although psptoolchain is not using GitLab, I'm considering creating a mirror +# on GitLab and the GitLab CI is by far the most powerful. I will be using this +# to run tests, at least locally before committing. +--- +image: topsekretpl/psptoolchain-ci:latest + +stages: + - build + +build-psptoolchain: + stage: build + script: + - dash ./toolchain-local.sh + - tar cv pspdev | xz -6e > pspdev.tar.xz + artifacts: + paths: + - pspdev.tar.xz From 093f1714404191d98c15e9d512dfd44de4905991 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Thu, 11 Apr 2019 08:42:30 +0200 Subject: [PATCH 14/30] Run builds in parallel --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7c72c08..9ab6b72 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,7 @@ stages: build-psptoolchain: stage: build script: - - dash ./toolchain-local.sh + - dash ./toolchain-local.sh -j 4 - tar cv pspdev | xz -6e > pspdev.tar.xz artifacts: paths: From c48c19158ddcc16c1cf349043013f12dd99f02f9 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Thu, 11 Apr 2019 11:03:45 +0200 Subject: [PATCH 15/30] Some improvements to README.md and prepare.sh --- README.md | 108 ++++++++++++++++++++++++++++++++--------------------- prepare.sh | 4 +- 2 files changed, 69 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 2fd82f3..f941df7 100644 --- a/README.md +++ b/README.md @@ -3,67 +3,91 @@ What does this do? This program will automatically build and install a compiler and other tools used in the creation of homebrew software for the Sony Playstation Portable handheld videogame system. -How do I use it? -================== - -1. Set up your environment by installing the following software: +Dependencies +============ - autoconf, automake, bison, bzip2, flex, gcc, g++/gcc-c++, gzip, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, xz-utils, wget, libelf git +PSP toolchain depends on the following packages: -2. Set the PSPDEV and PATH environmental variables: +``` +autoconf, automake, bison, bzip2, flex, gcc, g++/gcc-c++, gzip, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, xz-utils, wget, libelf git +``` - export PSPDEV=/usr/local/pspdev - export PATH=$PATH:$PSPDEV/bin +Automatic dependency installation +--------------------------------- - The PSPDEV variable is the directory the toolchain will be installed to, change this if you wish. If possible the toolchain script will automatically add these variables to your systems login scripts, otherwise you will need to manually add these variables yourself. +On both Linux and macOS, you can install the dependencies using a script: -3. Run the toolchain script: +```shell +sudo ./prepare.sh +``` - ./toolchain.sh +This method is much easier than installing the packages manually and thus it's +the preferred method, especially for newcomers. -> NOTE: If you have issues with compiling try increasing the amount of memory -> available to your system by creating a swapfile. -> -> dd if=/dev/zero of=/swapfile bs=1M count=2048 -> chmod 600 /swapfile -> mkswap /swapfile -> swapon /swapfile +> NOTE: This script might fail. In such case you need to revert to manual +> installation as described above. Currently, the preparation script supports +> Linux with APT package manager (Debian, Ubuntu and derivatives) +> and macOS with [MacPorts](https://www.macports.org/) or +> [Homebrew](https://brew.sh). > -> After you are done use `swapoff -a` disable the swapfile. Finally you can -> remove it with `rm`. +> If you are using Homebrew, do not use ``sudo``. -Ubuntu ------- +Docker dependency installation +------------------------------ -1. Install the required packages by running. +If you are using a Docker container or don't mind using one, you can use the +image ``topsekretpl/psptoolchain-ci`` from the Registry. It contains all +dependencies bundled into an upstream Debian installation. This is not +recommended for newcomers or people not accustomed with Docker. - sudo apt-get install g++ build-essential autoconf automake cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libelf-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl wget bzip2 gzip xz-utils +If you want to build PSP toolchain in a docker image, do: -2. Build and install the toolchain and SDK. +```shell +sudo docker pull topsekretpl/psptoolchain-ci:latest +sudo docker run --interactive --rm --tty topsekretpl/psptoolchain-ci:latest /bin/bash -i -l +``` - sudo ./toolchain-sudo.sh - -> NOTE: If you do not wish for the toolchain to be installed in /usr/local/pspdev then edit toolchain-sudo.sh and change the INSTALLDIR variable. +Note that this image does **not** contain PSP toolchain, solely the +dependencies. + +Building +======== + +To build the toolchain and install it in ``/usr/local/pspdev``, run: -OSX ---- +```shell +sudo ./toolchain-sudo.sh +``` -1. Install [`port`][MacPorts] or [`brew`][HomeBrew]. -2. Run `prepare-mac-os.sh`. This will auto-install all the libraries you will need before building. - - sudo ./prepare-mac-os.sh +Alternatively, there is another script that allows to install the toolchain in +a subdirectory of this repository: -3. Build and install the toolchain and SDK. - - sudo ./toolchain-sudo.sh +```shell +./toolchain-local.sh +``` -Where do I go from here? -======================== +Both are wrappers around ``toolchain.sh`` which is slightly more sophisticated +but much more powerful. + +> NOTE: If you do not wish for the toolchain to be installed in +> /usr/local/pspdev then edit run ``toolchain.sh`` manually. The ``-h`` option +> of ``toolchain.sh`` provides all necessary help. + +> NOTE: If you have issues with compiling try increasing the amount of memory +> available to your system by creating a swapfile. +> +> dd if=/dev/zero of=/swapfile bs=1M count=2048 +> chmod 600 /swapfile +> mkswap /swapfile +> swapon /swapfile +> +> After you are done use ``swapoff /swapfile`` to disable the swapfile. Then +> you should remove it with ``rm``. + +Next steps +========== Visit the following sites to learn more: http://www.ps2dev.org http://forums.ps2dev.org - -[MacPorts]: http://www.macports.org/ -[HomeBrew]: http://brew.sh/ diff --git a/prepare.sh b/prepare.sh index 2af5d8c..dd7c042 100755 --- a/prepare.sh +++ b/prepare.sh @@ -23,6 +23,7 @@ _EOF_ bison \ build-essential \ bzip2 \ + ca-certificates \ cmake \ doxygen \ flex \ @@ -39,6 +40,7 @@ _EOF_ subversion \ tcl \ texinfo \ + wget \ xz-utils \ zlib1g-dev elif command -v apt-get >/dev/null @@ -100,7 +102,7 @@ _EOF_ exit 77 else cat >&2 <<_EOF_ -Error: your Linux distribution uses an unknown package manager. +Error: your Linux distribution uses an unknown package manager or doesn't have one. _EOF_ exit 77 fi From d457fbbaf9c6192f25ee092ed9036e179ec2eece Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Thu, 11 Apr 2019 11:08:59 +0200 Subject: [PATCH 16/30] Use pigz -5 -p4 instead of xz -6e to improve compression performance --- .gitlab-ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ab6b72..f6ac3d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,10 @@ build-psptoolchain: stage: build script: - dash ./toolchain-local.sh -j 4 - - tar cv pspdev | xz -6e > pspdev.tar.xz + # Use pigz for performance reasons + # When I tried to use xz -6e, I got timeout because of the + # compression (sic!) + - tar cv pspdev | pigz -5 -p4 > pspdev.tar.gz artifacts: paths: - - pspdev.tar.xz + - pspdev.tar.gz From 0d23d6c7766aabc77d5f9fa016d96d98e478a5cd Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Thu, 11 Apr 2019 11:34:26 +0200 Subject: [PATCH 17/30] Remove all compression from job artifacts Apparently, it's unnecessary and only slows down the build --- .gitlab-ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f6ac3d2..c109c00 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,10 +11,7 @@ build-psptoolchain: stage: build script: - dash ./toolchain-local.sh -j 4 - # Use pigz for performance reasons - # When I tried to use xz -6e, I got timeout because of the - # compression (sic!) - - tar cv pspdev | pigz -5 -p4 > pspdev.tar.gz + - tar cvf pspdev.tar pspdev artifacts: paths: - - pspdev.tar.gz + - pspdev.tar From df2bfe8e0cee6ef45734d995c85cb67f4c7c66bf Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Thu, 11 Apr 2019 07:31:45 +0200 Subject: [PATCH 18/30] Update GCC to 8.3.0 --- gcc.sh | 6 +- ...cc-8.2.0-PSP.patch => gcc-8.3.0-PSP.patch} | 128 ++++++++---------- 2 files changed, 61 insertions(+), 73 deletions(-) rename patches/{gcc-8.2.0-PSP.patch => gcc-8.3.0-PSP.patch} (86%) diff --git a/gcc.sh b/gcc.sh index 6bf7953..a3ab990 100644 --- a/gcc.sh +++ b/gcc.sh @@ -3,11 +3,11 @@ # Based on gcc-stage1.sh and gcc-stage2.sh by Naomi Peori (naomi@peori.ca) customized by yreeen(yreeen@gmail.com) ## set gcc version -GCC_VERSION=8.2.0 +GCC_VERSION=8.3.0 GMP_VERSION=6.1.2 MPC_VERSION=1.1.0 -MPFR_VERSION=4.0.1 -ISL_VERSION=0.20 +MPFR_VERSION=4.0.2 +ISL_VERSION=0.21 ## Exit on errors set -e diff --git a/patches/gcc-8.2.0-PSP.patch b/patches/gcc-8.3.0-PSP.patch similarity index 86% rename from patches/gcc-8.2.0-PSP.patch rename to patches/gcc-8.3.0-PSP.patch index 4c27371..4ff7e03 100644 --- a/patches/gcc-8.2.0-PSP.patch +++ b/patches/gcc-8.3.0-PSP.patch @@ -1,6 +1,6 @@ -diff -adurB --new-file gcc-8.2.0/config.sub gcc-8.2.0-psp/config.sub ---- gcc-8.2.0/config.sub 2018-01-03 05:25:18.000000000 +0100 -+++ gcc-8.2.0-psp/config.sub 2018-12-16 14:48:40.275107924 +0100 +diff --unified -rN a/config.sub b/config.sub +--- a/config.sub 2018-01-03 05:25:18.000000000 +0100 ++++ b/config.sub 2019-04-11 11:48:30.936991476 +0200 @@ -288,6 +288,7 @@ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -28,9 +28,9 @@ diff -adurB --new-file gcc-8.2.0/config.sub gcc-8.2.0-psp/config.sub mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; -diff -adurB --new-file gcc-8.2.0/gcc/config/mips/allegrex.md gcc-8.2.0-psp/gcc/config/mips/allegrex.md ---- gcc-8.2.0/gcc/config/mips/allegrex.md 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/allegrex.md 2018-12-16 14:48:40.275107924 +0100 +diff --unified -rN a/gcc/config/mips/allegrex.md b/gcc/config/mips/allegrex.md +--- a/gcc/config/mips/allegrex.md 1970-01-01 01:00:00.000000000 +0100 ++++ b/gcc/config/mips/allegrex.md 2019-04-11 11:48:30.936991476 +0200 @@ -0,0 +1,172 @@ +;; Sony ALLEGREX instructions. +;; Copyright (C) 2005 Free Software Foundation, Inc. @@ -204,9 +204,9 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/allegrex.md gcc-8.2.0-psp/gcc/c + "round.w.s\t%0,%1" + [(set_attr "type" "fcvt") + (set_attr "mode" "SF")]) -diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.c gcc-8.2.0-psp/gcc/config/mips/mips.c ---- gcc-8.2.0/gcc/config/mips/mips.c 2018-03-01 12:37:35.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/mips.c 2018-12-16 14:49:17.406847519 +0100 +diff --unified -rN a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c +--- a/gcc/config/mips/mips.c 2018-03-01 12:37:35.000000000 +0100 ++++ b/gcc/config/mips/mips.c 2019-04-11 11:48:30.936991476 +0200 @@ -253,7 +253,12 @@ MIPS_BUILTIN_MSA_TEST_BRANCH, @@ -388,9 +388,9 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.c gcc-8.2.0-psp/gcc/config mips_register_frame_header_opt (); } -diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips-cpus.def gcc-8.2.0-psp/gcc/config/mips/mips-cpus.def ---- gcc-8.2.0/gcc/config/mips/mips-cpus.def 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/mips-cpus.def 2018-12-16 14:48:40.279107896 +0100 +diff --unified -rN a/gcc/config/mips/mips-cpus.def b/gcc/config/mips/mips-cpus.def +--- a/gcc/config/mips/mips-cpus.def 2018-01-03 11:03:58.000000000 +0100 ++++ b/gcc/config/mips/mips-cpus.def 2019-04-11 11:48:30.936991476 +0200 @@ -62,6 +62,7 @@ /* MIPS II processors. */ @@ -399,9 +399,9 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips-cpus.def gcc-8.2.0-psp/gcc /* MIPS III processors. */ MIPS_CPU ("r4000", PROCESSOR_R4000, 3, 0) -diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips-ftypes.def gcc-8.2.0-psp/gcc/config/mips/mips-ftypes.def ---- gcc-8.2.0/gcc/config/mips/mips-ftypes.def 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/mips-ftypes.def 2018-12-16 14:48:40.279107896 +0100 +diff --unified -rN a/gcc/config/mips/mips-ftypes.def b/gcc/config/mips/mips-ftypes.def +--- a/gcc/config/mips/mips-ftypes.def 2018-01-03 11:03:58.000000000 +0100 ++++ b/gcc/config/mips/mips-ftypes.def 2019-04-11 11:48:30.936991476 +0200 @@ -44,6 +44,8 @@ DEF_MIPS_FTYPE (3, (DI, DI, V2HI, V2HI)) DEF_MIPS_FTYPE (3, (DI, DI, V4QI, V4QI)) @@ -427,9 +427,9 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips-ftypes.def gcc-8.2.0-psp/g DEF_MIPS_FTYPE (3, (VOID, V4SF, POINTER, SI)) DEF_MIPS_FTYPE (3, (VOID, V4SI, CVPOINTER, SI)) DEF_MIPS_FTYPE (3, (VOID, V8HI, CVPOINTER, SI)) -diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.h gcc-8.2.0-psp/gcc/config/mips/mips.h ---- gcc-8.2.0/gcc/config/mips/mips.h 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/mips.h 2018-12-16 14:48:40.279107896 +0100 +diff --unified -rN a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h +--- a/gcc/config/mips/mips.h 2018-01-03 11:03:58.000000000 +0100 ++++ b/gcc/config/mips/mips.h 2019-04-11 11:48:30.936991476 +0200 @@ -285,6 +285,7 @@ #define TARGET_SB1 (mips_arch == PROCESSOR_SB1 \ || mips_arch == PROCESSOR_SB1A) @@ -535,9 +535,9 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.h gcc-8.2.0-psp/gcc/config #ifndef HAVE_AS_TLS #define HAVE_AS_TLS 0 #endif -diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.md gcc-8.2.0-psp/gcc/config/mips/mips.md ---- gcc-8.2.0/gcc/config/mips/mips.md 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/mips.md 2018-12-16 14:48:40.279107896 +0100 +diff --unified -rN a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md +--- a/gcc/config/mips/mips.md 2018-01-03 11:03:58.000000000 +0100 ++++ b/gcc/config/mips/mips.md 2019-04-11 11:48:30.940991455 +0200 @@ -35,6 +35,7 @@ 74kf2_1 74kf1_1 @@ -673,9 +673,9 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.md gcc-8.2.0-psp/gcc/confi (define_c_enum "unspec" [ UNSPEC_ADDRESS_FIRST ]) -diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.opt gcc-8.2.0-psp/gcc/config/mips/mips.opt ---- gcc-8.2.0/gcc/config/mips/mips.opt 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/mips.opt 2018-12-16 14:48:40.279107896 +0100 +diff --unified -rN a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt +--- a/gcc/config/mips/mips.opt 2018-01-03 11:03:58.000000000 +0100 ++++ b/gcc/config/mips/mips.opt 2019-04-11 11:48:30.940991455 +0200 @@ -428,6 +428,10 @@ Target Report Var(flag_frame_header_optimization) Optimization Optimize frame header. @@ -687,9 +687,9 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/mips.opt gcc-8.2.0-psp/gcc/conf noasmopt Driver -diff -adurB --new-file gcc-8.2.0/gcc/config/mips/psp.h gcc-8.2.0-psp/gcc/config/mips/psp.h ---- gcc-8.2.0/gcc/config/mips/psp.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/psp.h 2018-12-16 14:48:40.279107896 +0100 +diff --unified -rN a/gcc/config/mips/psp.h b/gcc/config/mips/psp.h +--- a/gcc/config/mips/psp.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/gcc/config/mips/psp.h 2019-04-11 11:48:30.940991455 +0200 @@ -0,0 +1,33 @@ +/* Support for Sony's Playstation Portable (PSP). + Copyright (C) 2005 Free Software Foundation, Inc. @@ -724,9 +724,9 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/psp.h gcc-8.2.0-psp/gcc/config/ +#define SUBTARGET_ASM_SPEC "-mno-pdr" + +#include "../newlib-stdint.h" -diff -adurB --new-file gcc-8.2.0/gcc/config/mips/t-allegrex gcc-8.2.0-psp/gcc/config/mips/t-allegrex ---- gcc-8.2.0/gcc/config/mips/t-allegrex 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/config/mips/t-allegrex 2018-12-16 14:48:40.279107896 +0100 +diff --unified -rN a/gcc/config/mips/t-allegrex b/gcc/config/mips/t-allegrex +--- a/gcc/config/mips/t-allegrex 1970-01-01 01:00:00.000000000 +0100 ++++ b/gcc/config/mips/t-allegrex 2019-04-11 11:48:30.940991455 +0200 @@ -0,0 +1,29 @@ +# Suppress building libgcc1.a, since the MIPS compiler port is complete +# and does not need anything from libgcc1.a. @@ -757,10 +757,10 @@ diff -adurB --new-file gcc-8.2.0/gcc/config/mips/t-allegrex gcc-8.2.0-psp/gcc/co + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib -diff -adurB --new-file gcc-8.2.0/gcc/config.gcc gcc-8.2.0-psp/gcc/config.gcc ---- gcc-8.2.0/gcc/config.gcc 2018-06-25 21:34:01.000000000 +0200 -+++ gcc-8.2.0-psp/gcc/config.gcc 2018-12-16 14:48:40.279107896 +0100 -@@ -2315,6 +2315,18 @@ +diff --unified -rN a/gcc/config.gcc b/gcc/config.gcc +--- a/gcc/config.gcc 2019-01-29 16:31:10.000000000 +0100 ++++ b/gcc/config.gcc 2019-04-11 11:48:40.704941394 +0200 +@@ -2318,6 +2318,18 @@ tm_file="elfos.h newlib-stdint.h ${tm_file} mips/r3900.h mips/elf.h" tmake_file="mips/t-r3900" ;; @@ -779,21 +779,9 @@ diff -adurB --new-file gcc-8.2.0/gcc/config.gcc gcc-8.2.0-psp/gcc/config.gcc mmix-knuth-mmixware) tm_file="${tm_file} newlib-stdint.h" use_gcc_stdint=wrap -diff -adurB --new-file gcc-8.2.0/gcc/graphite.h gcc-8.2.0-psp/gcc/graphite.h ---- gcc-8.2.0/gcc/graphite.h 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/gcc/graphite.h 2018-12-16 14:48:40.279107896 +0100 -@@ -37,6 +37,8 @@ - #include - #include - #include -+#include -+#include - - typedef struct poly_dr *poly_dr_p; - -diff -adurB --new-file gcc-8.2.0/libcpp/Makefile.in gcc-8.2.0-psp/libcpp/Makefile.in ---- gcc-8.2.0/libcpp/Makefile.in 2018-07-26 11:48:58.000000000 +0200 -+++ gcc-8.2.0-psp/libcpp/Makefile.in 2018-12-16 14:48:40.279107896 +0100 +diff --unified -rN a/libcpp/Makefile.in b/libcpp/Makefile.in +--- a/libcpp/Makefile.in 2019-02-22 15:22:13.000000000 +0100 ++++ b/libcpp/Makefile.in 2019-04-11 11:48:30.940991455 +0200 @@ -208,8 +208,8 @@ # Note that we put the dependencies into a .Tpo file, then move them # into place if the compile succeeds. We need this because gcc does @@ -805,9 +793,9 @@ diff -adurB --new-file gcc-8.2.0/libcpp/Makefile.in gcc-8.2.0-psp/libcpp/Makefil else COMPILE = source='$<' object='$@' libtool=no DEPDIR=$(DEPDIR) $(DEPMODE) \ $(depcomp) $(COMPILE.base) -diff -adurB --new-file gcc-8.2.0/libgcc/config/mips/psp.h gcc-8.2.0-psp/libgcc/config/mips/psp.h ---- gcc-8.2.0/libgcc/config/mips/psp.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-8.2.0-psp/libgcc/config/mips/psp.h 2018-12-16 14:48:40.283107867 +0100 +diff --unified -rN a/libgcc/config/mips/psp.h b/libgcc/config/mips/psp.h +--- a/libgcc/config/mips/psp.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/libgcc/config/mips/psp.h 2019-04-11 11:48:30.940991455 +0200 @@ -0,0 +1,31 @@ +/* Support for Sony's Playstation Portable (PSP). + Copyright (C) 2005 Free Software Foundation, Inc. @@ -840,9 +828,9 @@ diff -adurB --new-file gcc-8.2.0/libgcc/config/mips/psp.h gcc-8.2.0-psp/libgcc/c +/* Get rid of the .pdr section. */ +#undef SUBTARGET_ASM_SPEC +#define SUBTARGET_ASM_SPEC "-mno-pdr" -diff -adurB --new-file gcc-8.2.0/libgcc/config/mips/t-allegrex gcc-8.2.0-psp/libgcc/config/mips/t-allegrex ---- gcc-8.2.0/libgcc/config/mips/t-allegrex 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-8.2.0-psp/libgcc/config/mips/t-allegrex 2018-12-16 14:48:40.283107867 +0100 +diff --unified -rN a/libgcc/config/mips/t-allegrex b/libgcc/config/mips/t-allegrex +--- a/libgcc/config/mips/t-allegrex 1970-01-01 01:00:00.000000000 +0100 ++++ b/libgcc/config/mips/t-allegrex 2019-04-11 11:48:30.940991455 +0200 @@ -0,0 +1,20 @@ +# Suppress building libgcc1.a, since the MIPS compiler port is complete +# and does not need anything from libgcc1.a. @@ -864,9 +852,9 @@ diff -adurB --new-file gcc-8.2.0/libgcc/config/mips/t-allegrex gcc-8.2.0-psp/lib + +LIBGCC = stmp-multilib +INSTALL_LIBGCC = install-multilib -diff -adurB --new-file gcc-8.2.0/libgcc/config/t-hardfp-sf gcc-8.2.0-psp/libgcc/config/t-hardfp-sf ---- gcc-8.2.0/libgcc/config/t-hardfp-sf 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-8.2.0-psp/libgcc/config/t-hardfp-sf 2018-12-16 14:48:40.283107867 +0100 +diff --unified -rN a/libgcc/config/t-hardfp-sf b/libgcc/config/t-hardfp-sf +--- a/libgcc/config/t-hardfp-sf 1970-01-01 01:00:00.000000000 +0100 ++++ b/libgcc/config/t-hardfp-sf 2019-04-11 11:48:30.968991312 +0200 @@ -0,0 +1,32 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + @@ -900,9 +888,9 @@ diff -adurB --new-file gcc-8.2.0/libgcc/config/t-hardfp-sf gcc-8.2.0-psp/libgcc/ + _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \ + _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf \ + _thenan_sf _sf_to_usi _usi_to_sf -diff -adurB --new-file gcc-8.2.0/libgcc/config.host gcc-8.2.0-psp/libgcc/config.host ---- gcc-8.2.0/libgcc/config.host 2018-04-06 22:04:17.000000000 +0200 -+++ gcc-8.2.0-psp/libgcc/config.host 2018-12-16 14:48:40.283107867 +0100 +diff --unified -rN a/libgcc/config.host b/libgcc/config.host +--- a/libgcc/config.host 2018-04-06 22:04:17.000000000 +0200 ++++ b/libgcc/config.host 2019-04-11 11:48:30.968991312 +0200 @@ -140,11 +140,15 @@ cpu_type=microblaze ;; @@ -936,9 +924,9 @@ diff -adurB --new-file gcc-8.2.0/libgcc/config.host gcc-8.2.0-psp/libgcc/config. mmix-knuth-mmixware) extra_parts="crti.o crtn.o crtbegin.o crtend.o" tmake_file="${tmake_file} ${cpu_type}/t-${cpu_type}" -diff -adurB --new-file gcc-8.2.0/libgcc/configure gcc-8.2.0-psp/libgcc/configure ---- gcc-8.2.0/libgcc/configure 2018-04-24 18:45:26.000000000 +0200 -+++ gcc-8.2.0-psp/libgcc/configure 2018-12-16 14:48:40.283107867 +0100 +diff --unified -rN a/libgcc/configure b/libgcc/configure +--- a/libgcc/configure 2018-04-24 18:45:26.000000000 +0200 ++++ b/libgcc/configure 2019-04-11 11:48:30.968991312 +0200 @@ -4957,6 +4957,26 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_mips_hard_float" >&5 @@ -966,9 +954,9 @@ diff -adurB --new-file gcc-8.2.0/libgcc/configure gcc-8.2.0-psp/libgcc/configure esac case ${host} in -diff -adurB --new-file gcc-8.2.0/libgcc/configure.ac gcc-8.2.0-psp/libgcc/configure.ac ---- gcc-8.2.0/libgcc/configure.ac 2018-02-28 09:59:15.000000000 +0100 -+++ gcc-8.2.0-psp/libgcc/configure.ac 2018-12-16 14:48:40.283107867 +0100 +diff --unified -rN a/libgcc/configure.ac b/libgcc/configure.ac +--- a/libgcc/configure.ac 2018-02-28 09:59:15.000000000 +0100 ++++ b/libgcc/configure.ac 2019-04-11 11:48:30.968991312 +0200 @@ -296,6 +296,14 @@ #endif], [libgcc_cv_mips_hard_float=yes], @@ -984,9 +972,9 @@ diff -adurB --new-file gcc-8.2.0/libgcc/configure.ac gcc-8.2.0-psp/libgcc/config esac case ${host} in -diff -adurB --new-file gcc-8.2.0/libgcc/crtstuff.c gcc-8.2.0-psp/libgcc/crtstuff.c ---- gcc-8.2.0/libgcc/crtstuff.c 2018-01-03 11:03:58.000000000 +0100 -+++ gcc-8.2.0-psp/libgcc/crtstuff.c 2018-12-16 14:48:40.283107867 +0100 +diff --unified -rN a/libgcc/crtstuff.c b/libgcc/crtstuff.c +--- a/libgcc/crtstuff.c 2018-01-03 11:03:58.000000000 +0100 ++++ b/libgcc/crtstuff.c 2019-04-11 11:48:30.968991312 +0200 @@ -47,7 +47,7 @@ /* Target machine header files require this define. */ From f081ec90dfa835ef1a1ebb918920a88e80a744ca Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Thu, 11 Apr 2019 22:21:28 +0200 Subject: [PATCH 19/30] Disposed of Insight, which is deprecated and unsupported --- patches/insight-6.8-PSP.patch | 1522 ----------------- scripts/008-insight.sh | 29 - .../{009-psplinkusb.sh => 008-psplinkusb.sh} | 0 ...{010-ebootsigner.sh => 009-ebootsigner.sh} | 0 ...11-psplibraries.sh => 010-psplibraries.sh} | 0 5 files changed, 1551 deletions(-) delete mode 100644 patches/insight-6.8-PSP.patch delete mode 100755 scripts/008-insight.sh rename scripts/{009-psplinkusb.sh => 008-psplinkusb.sh} (100%) rename scripts/{010-ebootsigner.sh => 009-ebootsigner.sh} (100%) rename scripts/{011-psplibraries.sh => 010-psplibraries.sh} (100%) diff --git a/patches/insight-6.8-PSP.patch b/patches/insight-6.8-PSP.patch deleted file mode 100644 index cbadf99..0000000 --- a/patches/insight-6.8-PSP.patch +++ /dev/null @@ -1,1522 +0,0 @@ -diff -burN orig.insight-6.8/bfd/archures.c insight-6.8/bfd/archures.c ---- orig.insight-6.8/bfd/archures.c 2012-01-12 21:44:16.210331681 +0100 -+++ insight-6.8/bfd/archures.c 2012-01-12 21:47:54.862879142 +0100 -@@ -172,6 +172,7 @@ - .#define bfd_mach_mips_loongson_2e 3001 - .#define bfd_mach_mips_loongson_2f 3002 - .#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01 *} -+.#define bfd_mach_mips_allegrex 10111431 {* octal 'AL', 31 *} - .#define bfd_mach_mips_octeon 6501 - .#define bfd_mach_mipsisa32 32 - .#define bfd_mach_mipsisa32r2 33 -diff -burN orig.insight-6.8/bfd/bfd-in2.h insight-6.8/bfd/bfd-in2.h ---- orig.insight-6.8/bfd/bfd-in2.h 2012-01-12 21:44:16.185331961 +0100 -+++ insight-6.8/bfd/bfd-in2.h 2012-01-12 21:48:07.711734673 +0100 -@@ -1849,6 +1849,7 @@ - #define bfd_mach_mips_loongson_2e 3001 - #define bfd_mach_mips_loongson_2f 3002 - #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ -+#define bfd_mach_mips_allegrex 10111431 /* octal 'AL', 31 */ - #define bfd_mach_mips_octeon 6501 - #define bfd_mach_mipsisa32 32 - #define bfd_mach_mipsisa32r2 33 -diff -burN orig.insight-6.8/bfd/cpu-mips.c insight-6.8/bfd/cpu-mips.c ---- orig.insight-6.8/bfd/cpu-mips.c 2012-01-12 21:44:16.192331882 +0100 -+++ insight-6.8/bfd/cpu-mips.c 2012-01-12 21:50:02.104446958 +0100 -@@ -87,6 +87,7 @@ - I_mipsisa64, - I_mipsisa64r2, - I_sb1, -+ I_allegrex, - I_loongson_2e, - I_loongson_2f, - I_mipsocteon -@@ -123,6 +124,7 @@ - N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)), - N (64, 64, bfd_mach_mipsisa64r2,"mips:isa64r2", FALSE, NN(I_mipsisa64r2)), - N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, NN(I_sb1)), -+ N (32, 32, bfd_mach_mips_allegrex, "mips:allegrex", FALSE, NN(I_allegrex)), - N (64, 64, bfd_mach_mips_loongson_2e, "mips:loongson_2e", FALSE, NN(I_loongson_2e)), - N (64, 64, bfd_mach_mips_loongson_2f, "mips:loongson_2f", FALSE, NN(I_loongson_2f)), - N (64, 64, bfd_mach_mips_octeon, "mips:octeon", FALSE, 0) -diff -burN orig.insight-6.8/bfd/elfxx-mips.c insight-6.8/bfd/elfxx-mips.c ---- orig.insight-6.8/bfd/elfxx-mips.c 2012-01-12 21:44:16.180332016 +0100 -+++ insight-6.8/bfd/elfxx-mips.c 2012-01-12 21:52:04.911107059 +0100 -@@ -5221,6 +5221,9 @@ - case E_MIPS_MACH_SB1: - return bfd_mach_mips_sb1; - -+ case E_MIPS_MACH_ALLEGREX: -+ return bfd_mach_mips_allegrex; -+ - case E_MIPS_MACH_LS2E: - return bfd_mach_mips_loongson_2e; - -@@ -9483,6 +9486,10 @@ - val = E_MIPS_ARCH_64 | E_MIPS_MACH_SB1; - break; - -+ case bfd_mach_mips_allegrex: -+ val = E_MIPS_ARCH_2 | E_MIPS_MACH_ALLEGREX; -+ break; -+ - case bfd_mach_mips_octeon: - val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON; - break; -@@ -11271,6 +11278,7 @@ - /* MIPS II extensions. */ - { bfd_mach_mips4000, bfd_mach_mips6000 }, - { bfd_mach_mipsisa32, bfd_mach_mips6000 }, -+ { bfd_mach_mips_allegrex, bfd_mach_mips6000 }, - - /* MIPS I extensions. */ - { bfd_mach_mips6000, bfd_mach_mips3000 }, -diff -burN orig.insight-6.8/config.sub insight-6.8/config.sub ---- orig.insight-6.8/config.sub 2012-01-12 21:44:16.095332968 +0100 -+++ insight-6.8/config.sub 2012-01-12 21:53:03.558550735 +0100 -@@ -267,6 +267,7 @@ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ -+ | mipsallegrex | mipsallegrexel \ - | mn10200 | mn10300 \ - | mt \ - | msp430 \ -@@ -348,6 +349,7 @@ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ -+ | mipsallegrex-* | mipsallegrexel-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ -@@ -714,6 +716,10 @@ - basic_machine=m68k-atari - os=-mint - ;; -+ psp) -+ basic_machine=mipsallegrexel-psp -+ os=-elf -+ ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; -diff -burN orig.insight-6.8/include/elf/common.h insight-6.8/include/elf/common.h ---- orig.insight-6.8/include/elf/common.h 2012-01-12 21:44:16.221331557 +0100 -+++ insight-6.8/include/elf/common.h 2012-01-12 21:53:46.907138058 +0100 -@@ -93,6 +93,7 @@ - #define ET_HIOS 0xFEFF /* Operating system-specific */ - #define ET_LOPROC 0xFF00 /* Processor-specific */ - #define ET_HIPROC 0xFFFF /* Processor-specific */ -+#define ET_PSPEXEC 0xFFA0 /* Sony PSP executable file */ - - /* Values for e_machine, which identifies the architecture. These numbers - are officially assigned by registry@caldera.com. See below for a list of -diff -burN orig.insight-6.8/include/elf/mips.h insight-6.8/include/elf/mips.h ---- orig.insight-6.8/include/elf/mips.h 2012-01-12 21:44:16.220331568 +0100 -+++ insight-6.8/include/elf/mips.h 2012-01-12 21:54:04.675968652 +0100 -@@ -217,6 +217,7 @@ - #define E_MIPS_MACH_5400 0x00910000 - #define E_MIPS_MACH_5500 0x00980000 - #define E_MIPS_MACH_9000 0x00990000 -+#define E_MIPS_MACH_ALLEGREX 0x00A20000 - #define E_MIPS_MACH_LS2E 0x00A00000 - #define E_MIPS_MACH_LS2F 0x00A10000 - -diff -burN orig.insight-6.8/include/opcode/mips.h insight-6.8/include/opcode/mips.h ---- orig.insight-6.8/include/opcode/mips.h 2012-01-12 21:44:16.216331614 +0100 -+++ insight-6.8/include/opcode/mips.h 2012-01-12 22:00:28.154264128 +0100 -@@ -215,6 +215,84 @@ - #define OP_SH_UDI4 6 - #define OP_MASK_UDI4 0xfffff - -+/* Allegrex */ -+#define OP_SH_VFPU_DELTA 0 -+#define OP_MASK_VFPU_DELTA 0xfffc -+#define OP_SH_VFPU_IMM3 16 -+#define OP_MASK_VFPU_IMM3 0x7 -+#define OP_SH_VFPU_IMM5 16 -+#define OP_MASK_VFPU_IMM5 0x1f -+#define OP_SH_VFPU_IMM8 16 -+#define OP_MASK_VFPU_IMM8 0xff -+#define OP_SH_VFPU_CC 18 /* Condition code. */ -+#define OP_MASK_VFPU_CC 0x7 -+#define OP_SH_VFPU_CONST 16 -+#define OP_MASK_VFPU_CONST 0x1f -+#define OP_SH_VFPU_COND 0 /* Conditional compare. */ -+#define OP_MASK_VFPU_COND 0xf -+#define OP_SH_VFPU_VMTVC 0 -+#define OP_MASK_VFPU_VMTVC 0xff -+#define OP_SH_VFPU_VMFVC 8 -+#define OP_MASK_VFPU_VMFVC 0xff -+#define OP_SH_VFPU_RWB 1 -+#define OP_MASK_VFPU_RWB 0x1 -+#define OP_SH_VFPU_ROT 16 /* Rotators used in vrot. */ -+#define OP_MASK_VFPU_ROT 0x1f -+#define OP_SH_VFPU_FLOAT16 0 -+#define OP_MASK_VFPU_FLOAT16 0xffff -+ -+/* VFPU registers. */ -+#define OP_SH_VFPU_VD 0 -+#define OP_MASK_VFPU_VD 0x7f -+#define OP_SH_VFPU_VS 8 -+#define OP_MASK_VFPU_VS 0x7f -+#define OP_SH_VFPU_VT 16 -+#define OP_MASK_VFPU_VT 0x7f -+#define OP_SH_VFPU_VT_LO 16 /* Bits 0-4 of vt. */ -+#define OP_MASK_VFPU_VT_LO 0x1f -+#define OP_SH_VFPU_VT_HI 5 /* Right-shifted. */ -+#define OP_MASK_VFPU_VT_HI1 0x1 /* Bit 5 of vt. */ -+#define OP_MASK_VFPU_VT_HI2 0x3 /* Bits 5-6 of vt. */ -+/* Special handling of vs in vmmul instructions. */ -+#define VFPU_OP_VT_VS_VD 0xff800000 -+#define VFPU_OPCODE_VMMUL 0xf0000000 -+ -+/* VFPU prefix instruction operands. The *_SH_* values really specify where -+ the bitfield begins, as VFPU prefix instructions have four operands -+ encoded within the immediate field. */ -+#define VFPU_SH_PFX_NEG 16 -+#define VFPU_MASK_PFX_NEG 0x1 /* Negation. */ -+#define VFPU_SH_PFX_CST 12 -+#define VFPU_MASK_PFX_CST 0x1 /* Constant. */ -+#define VFPU_SH_PFX_ABS_CSTHI 8 -+#define VFPU_MASK_PFX_ABS_CSTHI 0x1 /* Abs/Constant (bit 2). */ -+#define VFPU_MASK_PFX_SWZ_CSTLO 0x3 /* Swizzle/Constant (bits 0-1). */ -+#define VFPU_SH_PFX_MASK 8 -+#define VFPU_MASK_PFX_MASK 0x1 /* Mask. */ -+#define VFPU_MASK_PFX_SAT 0x3 /* Saturation. */ -+ -+/* Special handling of the vrot instructions. */ -+#define VFPU_MASK_OP_SIZE 0x8080 /* Masks the operand size (pair, triple, quad). */ -+#define VFPU_OP_SIZE_PAIR 0x80 -+#define VFPU_OP_SIZE_TRIPLE 0x8000 -+#define VFPU_OP_SIZE_QUAD 0x8080 -+/* Note that these are within the rotators field, and not the full opcode. */ -+#define VFPU_SH_ROT_HI 2 -+#define VFPU_MASK_ROT_HI 0x3 -+#define VFPU_SH_ROT_LO 0 -+#define VFPU_MASK_ROT_LO 0x3 -+#define VFPU_SH_ROT_NEG 4 /* Negation. */ -+#define VFPU_MASK_ROT_NEG 0x1 -+ -+/* VFPU 16-bit floating-point format. */ -+#define VFPU_FLOAT16_EXP_MAX 0x1f -+#define VFPU_SH_FLOAT16_SIGN 15 -+#define VFPU_MASK_FLOAT16_SIGN 0x1 -+#define VFPU_SH_FLOAT16_EXP 10 -+#define VFPU_MASK_FLOAT16_EXP 0x1f -+#define VFPU_SH_FLOAT16_FRAC 0 -+#define VFPU_MASK_FLOAT16_FRAC 0x3ff -+ - /* This structure holds information for a particular instruction. */ - - struct mips_opcode -@@ -303,6 +381,29 @@ - Requires that "+A" or "+E" occur first to set position. - Enforces: 32 < (pos+size) <= 64. - -+ Sony Allegrex VFPU instructions: -+ "?o" -+ "?0" - "?3" -+ "?4" - "?7" -+ "?a" -+ "?b" -+ "?c" -+ "?e" -+ "?f" -+ "?i" -+ "?q" -+ "?r" -+ "?u" -+ "?w" -+ "?d" -+ "?m" -+ "?n" -+ "?s" -+ "?t" -+ "?v" -+ "?x" -+ "?z" -+ - Floating point instructions: - "D" 5 bit destination register (OP_*_FD) - "M" 3 bit compare condition code (OP_*_CCC) (only used for mips4 and up) -@@ -547,6 +648,8 @@ - #define INSN_5400 0x01000000 - /* NEC VR5500 instruction. */ - #define INSN_5500 0x02000000 -+/* Sony Allegrex instruction. */ -+#define INSN_ALLEGREX 0x10000000 - - /* MDMX ASE */ - #define INSN_MDMX 0x04000000 -@@ -607,6 +710,7 @@ - #define CPU_MIPS64 64 - #define CPU_MIPS64R2 65 - #define CPU_SB1 12310201 /* octal 'SB', 01. */ -+#define CPU_ALLEGREX 10111431 /* octal 'AL', 31. */ - #define CPU_LOONGSON_2E 3001 - #define CPU_LOONGSON_2F 3002 - #define CPU_OCTEON 6501 -@@ -636,6 +740,7 @@ - || (cpu == CPU_VR4120 && ((insn)->membership & INSN_4120) != 0) \ - || (cpu == CPU_VR5400 && ((insn)->membership & INSN_5400) != 0) \ - || (cpu == CPU_VR5500 && ((insn)->membership & INSN_5500) != 0) \ -+ || (cpu == CPU_ALLEGREX && ((insn)->membership & INSN_ALLEGREX) != 0) \ - || (cpu == CPU_LOONGSON_2E \ - && ((insn)->membership & INSN_LOONGSON_2E) != 0) \ - || (cpu == CPU_LOONGSON_2F \ -@@ -759,6 +864,16 @@ - M_LL_AB, - M_LLD_AB, - M_LS_A, -+ M_LVHIP, -+ M_LVHIS, -+ M_LVIP, -+ M_LVIQ, -+ M_LVIS, -+ M_LVIT, -+ M_LVLQ_AB, -+ M_LVRQ_AB, -+ M_LVQ_AB, -+ M_LVQ_AB_2, - M_LW_A, - M_LW_AB, - M_LWC0_A, -@@ -848,6 +963,10 @@ - M_SUB_I, - M_SUBU_I, - M_SUBU_I_2, -+ M_SVLQ_AB, -+ M_SVQ_AB, -+ M_SVRQ_AB, -+ M_SVS_AB, - M_TEQ_I, - M_TGE_I, - M_TGEU_I, -@@ -862,14 +981,24 @@ - M_ULH_A, - M_ULHU, - M_ULHU_A, -+ M_ULVQ, -+ M_ULVQ_AB, -+ M_ULVS, - M_ULW, - M_ULW_A, - M_USH, - M_USH_A, -+ M_USVQ, -+ M_USVQ_AB, -+ M_USVS, - M_USW, - M_USW_A, - M_USD, - M_USD_A, -+ M_VCMOVP, -+ M_VCMOVQ, -+ M_VCMOVS, -+ M_VCMOVT, - M_XOR_I, - M_COP0, - M_COP1, -diff -burN orig.insight-6.8/opcodes/mips-dis.c insight-6.8/opcodes/mips-dis.c ---- orig.insight-6.8/opcodes/mips-dis.c 2012-01-12 21:44:16.108332822 +0100 -+++ insight-6.8/opcodes/mips-dis.c 2012-01-12 22:04:28.084903036 +0100 -@@ -160,6 +160,139 @@ - "c0_taglo", "c0_taghi", "c0_errorepc", "c0_desave", - }; - -+static const char * const vfpu_sreg_names[128] = { -+ "S000", "S010", "S020", "S030", "S100", "S110", "S120", "S130", -+ "S200", "S210", "S220", "S230", "S300", "S310", "S320", "S330", -+ "S400", "S410", "S420", "S430", "S500", "S510", "S520", "S530", -+ "S600", "S610", "S620", "S630", "S700", "S710", "S720", "S730", -+ "S001", "S011", "S021", "S031", "S101", "S111", "S121", "S131", -+ "S201", "S211", "S221", "S231", "S301", "S311", "S321", "S331", -+ "S401", "S411", "S421", "S431", "S501", "S511", "S521", "S531", -+ "S601", "S611", "S621", "S631", "S701", "S711", "S721", "S731", -+ "S002", "S012", "S022", "S032", "S102", "S112", "S122", "S132", -+ "S202", "S212", "S222", "S232", "S302", "S312", "S322", "S332", -+ "S402", "S412", "S422", "S432", "S502", "S512", "S522", "S532", -+ "S602", "S612", "S622", "S632", "S702", "S712", "S722", "S732", -+ "S003", "S013", "S023", "S033", "S103", "S113", "S123", "S133", -+ "S203", "S213", "S223", "S233", "S303", "S313", "S323", "S333", -+ "S403", "S413", "S423", "S433", "S503", "S513", "S523", "S533", -+ "S603", "S613", "S623", "S633", "S703", "S713", "S723", "S733" -+}; -+ -+static const char * const vfpu_vpreg_names[128] = { -+ "C000", "C010", "C020", "C030", "C100", "C110", "C120", "C130", -+ "C200", "C210", "C220", "C230", "C300", "C310", "C320", "C330", -+ "C400", "C410", "C420", "C430", "C500", "C510", "C520", "C530", -+ "C600", "C610", "C620", "C630", "C700", "C710", "C720", "C730", -+ "R000", "R001", "R002", "R003", "R100", "R101", "R102", "R103", -+ "R200", "R201", "R202", "R203", "R300", "R301", "R302", "R303", -+ "R400", "R401", "R402", "R403", "R500", "R501", "R502", "R503", -+ "R600", "R601", "R602", "R603", "R700", "R701", "R702", "R703", -+ "C002", "C012", "C022", "C032", "C102", "C112", "C122", "C132", -+ "C202", "C212", "C222", "C232", "C302", "C312", "C322", "C332", -+ "C402", "C412", "C422", "C432", "C502", "C512", "C522", "C532", -+ "C602", "C612", "C622", "C632", "C702", "C712", "C722", "C732", -+ "R020", "R021", "R022", "R023", "R120", "R121", "R122", "R123", -+ "R220", "R221", "R222", "R223", "R320", "R321", "R322", "R323", -+ "R420", "R421", "R422", "R423", "R520", "R521", "R522", "R523", -+ "R620", "R621", "R622", "R623", "R720", "R721", "R722", "R723" -+}; -+ -+static const char * const vfpu_vtreg_names[128] = { -+ "C000", "C010", "C020", "C030", "C100", "C110", "C120", "C130", -+ "C200", "C210", "C220", "C230", "C300", "C310", "C320", "C330", -+ "C400", "C410", "C420", "C430", "C500", "C510", "C520", "C530", -+ "C600", "C610", "C620", "C630", "C700", "C710", "C720", "C730", -+ "R000", "R001", "R002", "R003", "R100", "R101", "R102", "R103", -+ "R200", "R201", "R202", "R203", "R300", "R301", "R302", "R303", -+ "R400", "R401", "R402", "R403", "R500", "R501", "R502", "R503", -+ "R600", "R601", "R602", "R603", "R700", "R701", "R702", "R703", -+ "C001", "C011", "C021", "C031", "C101", "C111", "C121", "C131", -+ "C201", "C211", "C221", "C231", "C301", "C311", "C321", "C331", -+ "C401", "C411", "C421", "C431", "C501", "C511", "C521", "C531", -+ "C601", "C611", "C621", "C631", "C701", "C711", "C721", "C731", -+ "R010", "R011", "R012", "R013", "R110", "R111", "R112", "R113", -+ "R210", "R211", "R212", "R213", "R310", "R311", "R312", "R313", -+ "R410", "R411", "R412", "R413", "R510", "R511", "R512", "R513", -+ "R610", "R611", "R612", "R613", "R710", "R711", "R712", "R713" -+}; -+ -+static const char * const vfpu_vqreg_names[128] = { -+ "C000", "C010", "C020", "C030", "C100", "C110", "C120", "C130", -+ "C200", "C210", "C220", "C230", "C300", "C310", "C320", "C330", -+ "C400", "C410", "C420", "C430", "C500", "C510", "C520", "C530", -+ "C600", "C610", "C620", "C630", "C700", "C710", "C720", "C730", -+ "R000", "R001", "R002", "R003", "R100", "R101", "R102", "R103", -+ "R200", "R201", "R202", "R203", "R300", "R301", "R302", "R303", -+ "R400", "R401", "R402", "R403", "R500", "R501", "R502", "R503", -+ "R600", "R601", "R602", "R603", "R700", "R701", "R702", "R703", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "" -+}; -+ -+static const char * const vfpu_mpreg_names[128] = { -+ "M000", "", "M020", "", "M100", "", "M120", "", -+ "M200", "", "M220", "", "M300", "", "M320", "", -+ "M400", "", "M420", "", "M500", "", "M520", "", -+ "M600", "", "M620", "", "M700", "", "M720", "", -+ "E000", "", "E002", "", "E100", "", "E102", "", -+ "E200", "", "E202", "", "E300", "", "E302", "", -+ "E400", "", "E402", "", "E500", "", "E502", "", -+ "E600", "", "E602", "", "E700", "", "E702", "", -+ "M002", "", "M022", "", "M102", "", "M122", "", -+ "M202", "", "M222", "", "M302", "", "M322", "", -+ "M402", "", "M422", "", "M502", "", "M522", "", -+ "M602", "", "M622", "", "M702", "", "M722", "", -+ "E020", "", "E022", "", "E120", "", "E122", "", -+ "E220", "", "E222", "", "E320", "", "E322", "", -+ "E420", "", "E422", "", "E520", "", "E522", "", -+ "E620", "", "E622", "", "E720", "", "E722", "" -+}; -+ -+static const char * const vfpu_mtreg_names[128] = { -+ "M000", "M010", "", "", "M100", "M110", "", "", -+ "M200", "M210", "", "", "M300", "M310", "", "", -+ "M400", "M410", "", "", "M500", "M510", "", "", -+ "M600", "M610", "", "", "M700", "M710", "", "", -+ "E000", "E001", "", "", "E100", "E101", "", "", -+ "E200", "E201", "", "", "E300", "E301", "", "", -+ "E400", "E401", "", "", "E500", "E501", "", "", -+ "E600", "E601", "", "", "E700", "E701", "", "", -+ "M001", "M011", "", "", "M101", "M111", "", "", -+ "M201", "M211", "", "", "M301", "M311", "", "", -+ "M401", "M411", "", "", "M501", "M511", "", "", -+ "M601", "M611", "", "", "M701", "M711", "", "", -+ "E010", "E011", "", "", "E110", "E111", "", "", -+ "E210", "E211", "", "", "E310", "E311", "", "", -+ "E410", "E411", "", "", "E510", "E511", "", "", -+ "E610", "E611", "", "", "E710", "E711", "", "" -+}; -+ -+static const char * const vfpu_mqreg_names[128] = { -+ "M000", "", "", "", "M100", "", "", "", -+ "M200", "", "", "", "M300", "", "", "", -+ "M400", "", "", "", "M500", "", "", "", -+ "M600", "", "", "", "M700", "", "", "", -+ "E000", "", "", "", "E100", "", "", "", -+ "E200", "", "", "", "E300", "", "", "", -+ "E400", "", "", "", "E500", "", "", "", -+ "E600", "", "", "", "E700", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "", -+ "", "", "", "", "", "", "", "" -+}; -+ - static const struct mips_cp0sel_name mips_cp0sel_names_mips3264[] = - { - { 16, 1, "c0_config1" }, -@@ -336,6 +469,55 @@ - "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31" - }; - -+static const char * const vfpu_cond_names[16] = { -+ "FL", "EQ", "LT", "LE", "TR", "NE", "GE", "GT", -+ "EZ", "EN", "EI", "ES", "NZ", "NN", "NI", "NS" -+}; -+ -+static const char * const vfpu_const_names[20] = { -+ "", -+ "VFPU_HUGE", -+ "VFPU_SQRT2", -+ "VFPU_SQRT1_2", -+ "VFPU_2_SQRTPI", -+ "VFPU_2_PI", -+ "VFPU_1_PI", -+ "VFPU_PI_4", -+ "VFPU_PI_2", -+ "VFPU_PI", -+ "VFPU_E", -+ "VFPU_LOG2E", -+ "VFPU_LOG10E", -+ "VFPU_LN2", -+ "VFPU_LN10", -+ "VFPU_2PI", -+ "VFPU_PI_6", -+ "VFPU_LOG10TWO", -+ "VFPU_LOG2TEN", -+ "VFPU_SQRT3_2" -+}; -+ -+#define VFPU_NUM_CONSTANTS \ -+ ((sizeof vfpu_const_names) / (sizeof (vfpu_const_names[0]))) -+const unsigned int vfpu_num_constants = VFPU_NUM_CONSTANTS; -+ -+static const char * const vfpu_rwb_names[4] = { -+ "wt", "wb", "", "" -+}; -+ -+static const char * const pfx_cst_names[8] = { -+ "0", "1", "2", "1/2", "3", "1/3", "1/4", "1/6" -+}; -+ -+static const char * const pfx_swz_names[4] = { -+ "x", "y", "z", "w" -+}; -+ -+static const char * const pfx_sat_names[4] = { -+ "", "[0:1]", "", "[-1:1]" -+}; -+ -+ - struct mips_abi_choice - { - const char * name; -@@ -411,6 +593,8 @@ - mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, - { "mips5", 1, bfd_mach_mips5, CPU_MIPS5, ISA_MIPS5, - mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, -+ { "allegrex", 1, bfd_mach_mips_allegrex, CPU_ALLEGREX, ISA_MIPS2, -+ mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, - - /* For stock MIPS32, disassemble all applicable MIPS-specified ASEs. - Note that MIPS-3D and MDMX are not applicable to MIPS32. (See -@@ -1241,6 +1425,349 @@ - (l >> OP_SH_FT) & OP_MASK_FT); - break; - -+ case '?': -+ /* VFPU extensions. */ -+ d++; -+ switch (*d) -+ { -+ case '\0': -+ /* xgettext:c-format */ -+ (*info->fprintf_func) (info->stream, -+ _("# internal error, incomplete VFPU extension sequence (?)")); -+ return; -+ -+ case 'o': -+ delta = (l >> OP_SH_VFPU_DELTA) & OP_MASK_VFPU_DELTA; -+ if (delta & 0x8000) -+ delta |= ~0xffff; -+ (*info->fprintf_func) (info->stream, "%d", -+ delta); -+ break; -+ -+ case '0': -+ case '1': -+ case '2': -+ case '3': -+ { -+ unsigned int pos = *d, base = '0'; -+ unsigned int negation = (l >> (pos - (base - VFPU_SH_PFX_NEG))) & VFPU_MASK_PFX_NEG; -+ unsigned int constant = (l >> (pos - (base - VFPU_SH_PFX_CST))) & VFPU_MASK_PFX_CST; -+ unsigned int abs_consthi = -+ (l >> (pos - (base - VFPU_SH_PFX_ABS_CSTHI))) & VFPU_MASK_PFX_ABS_CSTHI; -+ unsigned int swz_constlo = (l >> ((pos - base) * 2)) & VFPU_MASK_PFX_SWZ_CSTLO; -+ -+ if (negation) -+ (*info->fprintf_func) (info->stream, "-"); -+ if (constant) -+ { -+ (*info->fprintf_func) (info->stream, "%s", -+ pfx_cst_names[(abs_consthi << 2) | swz_constlo]); -+ } -+ else -+ { -+ if (abs_consthi) -+ (*info->fprintf_func) (info->stream, "|%s|", -+ pfx_swz_names[swz_constlo]); -+ else -+ (*info->fprintf_func) (info->stream, "%s", -+ pfx_swz_names[swz_constlo]); -+ } -+ } -+ break; -+ -+ case '4': -+ case '5': -+ case '6': -+ case '7': -+ { -+ unsigned int pos = *d, base = '4'; -+ unsigned int mask = (l >> (pos - (base - VFPU_MASK_PFX_MASK))) & VFPU_MASK_PFX_MASK; -+ unsigned int saturation = (l >> ((pos - base) * 2)) & VFPU_MASK_PFX_SAT; -+ -+ if (mask) -+ (*info->fprintf_func) (info->stream, "m"); -+ else -+ (*info->fprintf_func) (info->stream, "%s", -+ pfx_sat_names[saturation]); -+ } -+ break; -+ -+ case 'a': -+ { -+ unsigned int c = (l >> OP_SH_VFPU_CONST) & OP_MASK_VFPU_CONST; -+ if (c < vfpu_num_constants) -+ { -+ (*info->fprintf_func) (info->stream, "%s", -+ vfpu_const_names[c]); -+ } -+ break; -+ } -+ -+ case 'b': -+ /* 5-bit immediate value. */ -+ (*info->fprintf_func) (info->stream, "%ld", -+ (l >> OP_SH_VFPU_IMM5) & OP_MASK_VFPU_IMM5); -+ break; -+ -+ case 'c': -+ /* VFPU condition code. */ -+ (*info->fprintf_func) (info->stream, "%ld", -+ (l >> OP_SH_VFPU_CC) & OP_MASK_VFPU_CC); -+ break; -+ -+ case 'e': -+ /* 3-bit immediate value. */ -+ (*info->fprintf_func) (info->stream, "%ld", -+ (l >> OP_SH_VFPU_IMM3) & OP_MASK_VFPU_IMM3); -+ break; -+ -+ case 'f': -+ /* Conditional compare. */ -+ (*info->fprintf_func) (info->stream, "%s", -+ vfpu_cond_names[(l >> OP_SH_VFPU_COND) & OP_MASK_VFPU_COND]); -+ /* Apparently this specifier is unused. */ -+ d++; -+ break; -+ -+ case 'i': -+ /* 8-bit immediate value. */ -+ (*info->fprintf_func) (info->stream, "0x%02lx", -+ (l >> OP_SH_VFPU_IMM8) & OP_MASK_VFPU_IMM8); -+ break; -+ -+ case 'q': -+ /* VFPU control register (vmtvc). */ -+ (*info->fprintf_func) (info->stream, "$%ld", -+ (l >> OP_SH_VFPU_VMTVC) & OP_MASK_VFPU_VMTVC); -+ break; -+ -+ case 'r': -+ /* VFPU control register (vmfvc). */ -+ (*info->fprintf_func) (info->stream, "$%ld", -+ (l >> OP_SH_VFPU_VMFVC) & OP_MASK_VFPU_VMFVC); -+ break; -+ -+ case 'u': -+ /* Convert a VFPU 16-bit floating-point number to IEEE754. */ -+ { -+ union float2int { -+ unsigned int i; -+ float f; -+ } float2int; -+ unsigned short float16 = (l >> OP_SH_VFPU_FLOAT16) & OP_MASK_VFPU_FLOAT16; -+ unsigned int sign = (float16 >> VFPU_SH_FLOAT16_SIGN) & VFPU_MASK_FLOAT16_SIGN; -+ int exponent = (float16 >> VFPU_SH_FLOAT16_EXP) & VFPU_MASK_FLOAT16_EXP; -+ unsigned int fraction = float16 & VFPU_MASK_FLOAT16_FRAC; -+ char signchar = '+' + ((sign == 1) * 2); -+ -+ if (exponent == VFPU_FLOAT16_EXP_MAX) -+ { -+ if (fraction == 0) -+ (*info->fprintf_func) (info->stream, "%cInf", signchar); -+ else -+ (*info->fprintf_func) (info->stream, "%cNaN", signchar); -+ } -+ else if (exponent == 0 && fraction == 0) -+ { -+ (*info->fprintf_func) (info->stream, "%c0", signchar); -+ } -+ else -+ { -+ if (exponent == 0) -+ { -+ do -+ { -+ fraction <<= 1; -+ exponent--; -+ } -+ while (!(fraction & (VFPU_MASK_FLOAT16_FRAC + 1))); -+ -+ fraction &= VFPU_MASK_FLOAT16_FRAC; -+ } -+ -+ /* Convert to 32-bit single-precision IEEE754. */ -+ float2int.i = sign << 31; -+ float2int.i |= (exponent + 112) << 23; -+ float2int.i |= fraction << 13; -+ (*info->fprintf_func) (info->stream, "%g", float2int.f); -+ } -+ } -+ break; -+ -+ case 'w': -+ { -+ const char *elements[4]; -+ unsigned int opcode = l & VFPU_MASK_OP_SIZE; -+ unsigned int rotators = (l >> OP_SH_VFPU_ROT) & OP_MASK_VFPU_ROT; -+ unsigned int opsize, rothi, rotlo, negation, i; -+ -+ /* Determine the operand size so we'll know how many elements to output. */ -+ if (opcode == VFPU_OP_SIZE_PAIR) -+ opsize = 2; -+ else if (opcode == VFPU_OP_SIZE_TRIPLE) -+ opsize = 3; -+ else -+ opsize = (opcode == VFPU_OP_SIZE_QUAD) * 4; /* Sanity check. */ -+ -+ rothi = (rotators >> VFPU_SH_ROT_HI) & VFPU_MASK_ROT_HI; -+ rotlo = (rotators >> VFPU_SH_ROT_LO) & VFPU_MASK_ROT_LO; -+ negation = (rotators >> VFPU_SH_ROT_NEG) & VFPU_MASK_ROT_NEG; -+ -+ if (rothi == rotlo) -+ { -+ if (negation) -+ { -+ elements[0] = "-s"; -+ elements[1] = "-s"; -+ elements[2] = "-s"; -+ elements[3] = "-s"; -+ } -+ else -+ { -+ elements[0] = "s"; -+ elements[1] = "s"; -+ elements[2] = "s"; -+ elements[3] = "s"; -+ } -+ } -+ else -+ { -+ elements[0] = "0"; -+ elements[1] = "0"; -+ elements[2] = "0"; -+ elements[3] = "0"; -+ } -+ if (negation) -+ elements[rothi] = "-s"; -+ else -+ elements[rothi] = "s"; -+ elements[rotlo] = "c"; -+ -+ (*info->fprintf_func) (info->stream, "["); -+ i = 0; -+ for (;;) -+ { -+ (*info->fprintf_func) (info->stream, "%s", -+ elements[i++]); -+ if (i >= opsize) -+ break; -+ (*info->fprintf_func) (info->stream, ","); -+ } -+ (*info->fprintf_func) (info->stream, "]"); -+ } -+ break; -+ -+ case 'd': -+ case 'm': -+ case 'n': -+ case 's': -+ case 't': -+ case 'v': -+ case 'x': -+ { -+ unsigned int vreg = 0; -+ -+ /* The first char specifies the bitfield that contains the register number. */ -+ switch (*d) -+ { -+ case 'd': -+ case 'v': -+ case 'x': -+ vreg = (l >> OP_SH_VFPU_VD) & OP_MASK_VFPU_VD; -+ break; -+ -+ case 'm': -+ /* Combine bits 0-4 of vt with bits 5-6 of vt. */ -+ vreg = ((l >> OP_SH_VFPU_VT_LO) & OP_MASK_VFPU_VT_LO) -+ | ((l & OP_MASK_VFPU_VT_HI2) << OP_SH_VFPU_VT_HI); -+ break; -+ -+ case 'n': -+ /* Combine bits 0-4 of vt with bit 5 of vt. */ -+ vreg = ((l >> OP_SH_VFPU_VT_LO) & OP_MASK_VFPU_VT_LO) -+ | ((l & OP_MASK_VFPU_VT_HI1) << OP_SH_VFPU_VT_HI); -+ break; -+ -+ case 's': -+ { -+ unsigned int temp_vreg = l >> OP_SH_VFPU_VS; -+ -+ vreg = temp_vreg & OP_MASK_VFPU_VS; -+ if ((l & VFPU_OP_VT_VS_VD) == VFPU_OPCODE_VMMUL) -+ { -+ /* vmmul instructions have the RXC bit (bit 13) inverted. */ -+ if (temp_vreg & 0x20) -+ vreg = temp_vreg & 0x5f; -+ else -+ vreg |= 0x20; -+ } -+ } -+ break; -+ -+ case 't': -+ vreg = (l >> OP_SH_VFPU_VT) & OP_MASK_VFPU_VT; -+ break; -+ } -+ -+ /* The next char is the register set vreg comes from. */ -+ d++; -+ switch (*d) -+ { -+ case '0': -+ (*info->fprintf_func) (info->stream, "%s.s", -+ vfpu_sreg_names[vreg]); -+ break; -+ -+ case '1': -+ (*info->fprintf_func) (info->stream, "%s.p", -+ vfpu_vpreg_names[vreg]); -+ break; -+ -+ case '2': -+ (*info->fprintf_func) (info->stream, "%s.t", -+ vfpu_vtreg_names[vreg]); -+ break; -+ -+ case '3': -+ (*info->fprintf_func) (info->stream, "%s.q", -+ vfpu_vqreg_names[vreg]); -+ break; -+ -+ case '5': -+ (*info->fprintf_func) (info->stream, "%s.p", -+ vfpu_mpreg_names[vreg]); -+ break; -+ -+ case '6': -+ (*info->fprintf_func) (info->stream, "%s.t", -+ vfpu_mtreg_names[vreg]); -+ break; -+ -+ case '7': -+ (*info->fprintf_func) (info->stream, "%s.q", -+ vfpu_mqreg_names[vreg]); -+ break; -+ -+ default: -+ /* xgettext:c-format */ -+ (*info->fprintf_func) (info->stream, -+ _("# internal error, undefined vreg modifier(%c)"), -+ *d); -+ break; -+ } -+ -+ /* The last char is unused for disassembly. */ -+ d++; -+ } -+ break; -+ -+ case 'z': -+ (*info->fprintf_func) (info->stream, "%s", -+ vfpu_rwb_names[(l >> OP_SH_VFPU_RWB) & OP_MASK_VFPU_RWB]); -+ break; -+ } -+ break; -+ - default: - /* xgettext:c-format */ - (*info->fprintf_func) (info->stream, -diff -burN orig.insight-6.8/opcodes/mips-opc.c insight-6.8/opcodes/mips-opc.c ---- orig.insight-6.8/opcodes/mips-opc.c 2012-01-12 21:44:16.124332642 +0100 -+++ insight-6.8/opcodes/mips-opc.c 2012-01-12 22:14:06.067091231 +0100 -@@ -121,6 +121,7 @@ - #define N5 (INSN_5400 | INSN_5500) - #define N54 INSN_5400 - #define N55 INSN_5500 -+#define AL INSN_ALLEGREX - #define IOCT INSN_OCTEON - - #define G1 (T3 \ -@@ -318,6 +319,7 @@ - {"bnel", "s,t,p", 0x54000000, 0xfc000000, CBL|RD_s|RD_t, 0, I2|T3 }, - {"bnel", "s,I,p", 0, (int) M_BNEL_I, INSN_MACRO, 0, I2|T3 }, - {"break", "", 0x0000000d, 0xffffffff, TRAP, 0, I1 }, -+{"break", "B", 0x0000000d, 0xfc00003f, TRAP, 0, I32|AL }, - {"break", "c", 0x0000000d, 0xfc00ffff, TRAP, 0, I1 }, - {"break", "c,q", 0x0000000d, 0xfc00003f, TRAP, 0, I1 }, - {"c.f.d", "S,T", 0x46200030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 }, -@@ -500,7 +502,7 @@ - {"flushd", "", 0xbc020000, 0xffffffff, 0, 0, L1 }, - {"flushid", "", 0xbc030000, 0xffffffff, 0, 0, L1 }, - {"wb", "o(b)", 0xbc040000, 0xfc1f0000, SM|RD_b, 0, L1 }, --{"cache", "k,o(b)", 0xbc000000, 0xfc000000, RD_b, 0, I3_32|T3}, -+{"cache", "k,o(b)", 0xbc000000, 0xfc000000, RD_b, 0, I3_32|T3|AL}, - {"cache", "k,A(b)", 0, (int) M_CACHE_AB, INSN_MACRO, 0, I3_32|T3}, - {"ceil.l.d", "D,S", 0x4620000a, 0xffff003f, WR_D|RD_S|FP_D, 0, I3_33 }, - {"ceil.l.s", "D,S", 0x4600000a, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3_33 }, -@@ -515,7 +517,9 @@ - {"cftc1", "d,T", 0x41000023, 0xffe007ff, TRAP|LCD|WR_d|RD_C1|FP_S, 0, MT32 }, - {"cftc2", "d,E", 0x41000025, 0xffe007ff, TRAP|LCD|WR_d|RD_C2, 0, MT32 }, - {"clo", "U,s", 0x70000021, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 }, -+{"clo", "d,s", 0x00000017, 0xfc1f07ff, WR_d|RD_s, 0, AL }, - {"clz", "U,s", 0x70000020, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 }, -+{"clz", "d,s", 0x00000016, 0xfc1f07ff, WR_d|RD_s, 0, AL }, - {"ctc0", "t,G", 0x40c00000, 0xffe007ff, COD|RD_t|WR_CC, 0, I1 }, - {"ctc1", "t,G", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 }, - {"ctc1", "t,S", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 }, -@@ -540,15 +544,15 @@ - {"cvt.ps.s","D,V,T", 0x46000026, 0xffe0003f, WR_D|RD_S|RD_T|FP_S|FP_D, 0, I5_33 }, - {"cvt.pw.ps", "D,S", 0x46c00024, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, M3D }, - {"dabs", "d,v", 0, (int) M_DABS, INSN_MACRO, 0, I3 }, -+{"max", "d,v,t", 0x0000002c, 0xfc0007ff, WR_d|RD_s|RD_t, 0, AL }, - {"dadd", "d,v,t", 0x0000002c, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 }, - {"dadd", "t,r,I", 0, (int) M_DADD_I, INSN_MACRO, 0, I3 }, --{"dadd", "D,S,T", 0x45e00000, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2E }, --{"dadd", "D,S,T", 0x4b60000c, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, - {"daddi", "t,r,j", 0x60000000, 0xfc000000, WR_t|RD_s, 0, I3 }, - {"daddiu", "t,r,j", 0x64000000, 0xfc000000, WR_t|RD_s, 0, I3 }, -+{"min", "d,v,t", 0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t, 0, AL }, - {"daddu", "d,v,t", 0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 }, - {"daddu", "t,r,I", 0, (int) M_DADDU_I, INSN_MACRO, 0, I3 }, --{"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5 }, -+{"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5|AL }, - {"dclo", "U,s", 0x70000025, 0xfc0007ff, RD_s|WR_d|WR_t, 0, I64|N55 }, - {"dclz", "U,s", 0x70000024, 0xfc0007ff, RD_s|WR_d|WR_t, 0, I64|N55 }, - /* dctr and dctw are used on the r5000. */ -@@ -635,7 +639,7 @@ - {"dremu", "z,s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I3 }, - {"dremu", "d,v,t", 3, (int) M_DREMU_3, INSN_MACRO, 0, I3 }, - {"dremu", "d,v,I", 3, (int) M_DREMU_3I, INSN_MACRO, 0, I3 }, --{"dret", "", 0x7000003e, 0xffffffff, 0, 0, N5 }, -+{"dret", "", 0x7000003e, 0xffffffff, 0, 0, N5|AL }, - {"drol", "d,v,t", 0, (int) M_DROL, INSN_MACRO, 0, I3 }, - {"drol", "d,v,I", 0, (int) M_DROL_I, INSN_MACRO, 0, I3 }, - {"dror", "d,v,t", 0, (int) M_DROR, INSN_MACRO, 0, I3 }, -@@ -684,16 +688,16 @@ - {"ei", "t", 0x41606020, 0xffe0ffff, WR_t|WR_C0, 0, I33 }, - {"emt", "", 0x41600be1, 0xffffffff, TRAP, 0, MT32 }, - {"emt", "t", 0x41600be1, 0xffe0ffff, TRAP|WR_t, 0, MT32 }, --{"eret", "", 0x42000018, 0xffffffff, 0, 0, I3_32 }, -+{"eret", "", 0x42000018, 0xffffffff, 0, 0, I3_32|AL }, - {"evpe", "", 0x41600021, 0xffffffff, TRAP, 0, MT32 }, - {"evpe", "t", 0x41600021, 0xffe0ffff, TRAP|WR_t, 0, MT32 }, --{"ext", "t,r,+A,+C", 0x7c000000, 0xfc00003f, WR_t|RD_s, 0, I33 }, -+{"ext", "t,r,+A,+C", 0x7c000000, 0xfc00003f, WR_t|RD_s, 0, I33|AL }, - {"floor.l.d", "D,S", 0x4620000b, 0xffff003f, WR_D|RD_S|FP_D, 0, I3_33 }, - {"floor.l.s", "D,S", 0x4600000b, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3_33 }, - {"floor.w.d", "D,S", 0x4620000f, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I2 }, - {"floor.w.s", "D,S", 0x4600000f, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 }, - {"hibernate","", 0x42000023, 0xffffffff, 0, 0, V1 }, --{"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33 }, -+{"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33|AL }, - {"jr", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 }, - /* jr.hb is officially MIPS{32,64}R2, but it works on R1 as jr with - the same hazard barrier effect. */ -@@ -731,18 +735,10 @@ - {"ld", "t,o(b)", 0xdc000000, 0xfc000000, WR_t|RD_b, 0, I3 }, - {"ld", "t,o(b)", 0, (int) M_LD_OB, INSN_MACRO, 0, I1 }, - {"ld", "t,A(b)", 0, (int) M_LD_AB, INSN_MACRO, 0, I1 }, --{"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, --{"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, --{"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 }, --{"ldc1", "E,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 }, --{"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */ --{"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, 0, I1 }, --{"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, 0, I1 }, --{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, --{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 }, --{"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, --{"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2 }, --{"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 }, -+/* ldc1 is at the bottom of the table. */ -+/* ldc2 is at the bottom of the table. */ -+/* ldc3 is at the bottom of the table. */ -+{"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3|AL }, - {"ldl", "t,A(b)", 0, (int) M_LDL_AB, INSN_MACRO, 0, I3 }, - {"ldr", "t,o(b)", 0x6c000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 }, - {"ldr", "t,A(b)", 0, (int) M_LDR_AB, INSN_MACRO, 0, I3 }, -@@ -772,8 +768,7 @@ - {"lwc1", "E,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 }, - {"l.s", "T,o(b)", 0xc4000000, 0xfc000000, CLD|RD_b|WR_T|FP_S, 0, I1 }, /* lwc1 */ - {"l.s", "T,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 }, --{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 }, --{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 }, -+/* lwc2 is at the bottom of the table. */ - {"lwc3", "E,o(b)", 0xcc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 }, - {"lwc3", "E,A(b)", 0, (int) M_LWC3_AB, INSN_MACRO, 0, I1 }, - {"lwl", "t,o(b)", 0x88000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 }, -@@ -813,12 +808,14 @@ - {"madd.ps", "D,S,T", 0x45600018, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2E }, - {"madd.ps", "D,S,T", 0x71600018, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, - {"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, -+{"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL }, - {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, - {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 }, - {"madd", "7,s,t", 0x70000000, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 }, - {"madd", "d,s,t", 0x70000000, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 }, - {"maddp", "s,t", 0x70000441, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, SMT }, - {"maddu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, -+{"maddu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL }, - {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, - {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 }, - {"maddu", "7,s,t", 0x70000001, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 }, -@@ -859,7 +856,7 @@ - /* mfc2 is at the bottom of the table. */ - /* mfhc2 is at the bottom of the table. */ - /* mfc3 is at the bottom of the table. */ --{"mfdr", "t,G", 0x7000003d, 0xffe007ff, LCD|WR_t|RD_C0, 0, N5 }, -+{"mfdr", "t,G", 0x7000003d, 0xffe007ff, LCD|WR_t|RD_C0, 0, N5|AL }, - {"mfhi", "d", 0x00000010, 0xffff07ff, WR_d|RD_HI, 0, I1 }, - {"mfhi", "d,9", 0x00000010, 0xff9f07ff, WR_d|RD_HI, 0, D32 }, - {"mflo", "d", 0x00000012, 0xffff07ff, WR_d|RD_LO, 0, I1 }, -@@ -880,7 +877,7 @@ - {"movf.l", "X,Y,N", 0x46a00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 }, - {"movf.s", "D,S,N", 0x46000011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4_32 }, - {"movf.ps", "D,S,N", 0x46c00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5_33 }, --{"movn", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4_32|IL2E|IL2F }, -+{"movn", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4_32|IL2E|IL2F|AL }, - {"movnz", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, IL2E|IL2F }, - {"ffc", "d,v", 0x0000000b, 0xfc1f07ff, WR_d|RD_s, 0, L1 }, - {"movn.d", "D,S,t", 0x46200013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4_32 }, -@@ -894,7 +891,7 @@ - {"movt.l", "X,Y,N", 0x46a10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 }, - {"movt.s", "D,S,N", 0x46010011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4_32 }, - {"movt.ps", "D,S,N", 0x46c10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5_33 }, --{"movz", "d,v,t", 0x0000000a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4_32|IL2E|IL2F }, -+{"movz", "d,v,t", 0x0000000a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4_32|IL2E|IL2F|AL }, - {"ffs", "d,v", 0x0000000a, 0xfc1f07ff, WR_d|RD_s, 0, L1 }, - {"movz.d", "D,S,t", 0x46200012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4_32 }, - {"movz.l", "D,S,t", 0x46a00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 }, -@@ -917,9 +914,11 @@ - {"msub.ps", "D,S,T", 0x45600019, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2E }, - {"msub.ps", "D,S,T", 0x71600019, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, - {"msub", "s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, -+{"msub", "s,t", 0x0000002e, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL }, - {"msub", "s,t", 0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, - {"msub", "7,s,t", 0x70000004, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 }, - {"msubu", "s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, -+{"msubu", "s,t", 0x0000002f, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL }, - {"msubu", "s,t", 0x70000005, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, - {"msubu", "7,s,t", 0x70000005, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D33 }, - {"mtpc", "t,P", 0x4080c801, 0xffe0ffc1, COD|RD_t|WR_C0, 0, M1|N5 }, -@@ -934,7 +933,7 @@ - /* mtc2 is at the bottom of the table. */ - /* mthc2 is at the bottom of the table. */ - /* mtc3 is at the bottom of the table. */ --{"mtdr", "t,G", 0x7080003d, 0xffe007ff, COD|RD_t|WR_C0, 0, N5 }, -+{"mtdr", "t,G", 0x7080003d, 0xffe007ff, COD|RD_t|WR_C0, 0, N5|AL }, - {"mthi", "s", 0x00000011, 0xfc1fffff, RD_s|WR_HI, 0, I1 }, - {"mthi", "s,7", 0x00000011, 0xfc1fe7ff, RD_s|WR_HI, 0, D32 }, - {"mtlo", "s", 0x00000013, 0xfc1fffff, RD_s|WR_LO, 0, I1 }, -@@ -1111,13 +1110,13 @@ - {"rol", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I1 }, - {"ror", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I1 }, - {"ror", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I1 }, --{"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_d|RD_t, 0, N5|I33|SMT }, --{"rorv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, N5|I33|SMT }, --{"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33|SMT }, --{"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33|SMT }, --{"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33|SMT }, --{"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33|SMT }, --{"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, I33|SMT }, -+{"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_d|RD_t, 0, N5|I33|SMT|AL }, -+{"rorv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, N5|I33|SMT|AL }, -+{"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33|SMT|AL }, -+{"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33|SMT|AL }, -+{"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33|SMT|AL }, -+{"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33|SMT|AL }, -+{"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, I33|SMT|AL }, - {"round.l.d", "D,S", 0x46200008, 0xffff003f, WR_D|RD_S|FP_D, 0, I3_33 }, - {"round.l.s", "D,S", 0x46000008, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3_33 }, - {"round.w.d", "D,S", 0x4620000c, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I2 }, -@@ -1149,24 +1148,17 @@ - {"sdbbp", "c,q", 0x0000000e, 0xfc00003f, TRAP, 0, G2 }, - {"sdbbp", "", 0x7000003f, 0xffffffff, TRAP, 0, I32 }, - {"sdbbp", "B", 0x7000003f, 0xfc00003f, TRAP, 0, I32 }, --{"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, --{"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, --{"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, --{"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, --{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 }, --{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 }, --{"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2 }, --{"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2 }, --{"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, --{"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, 0, I1 }, --{"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, 0, I1 }, --{"sdl", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 }, -+/* sdc1 is at the bottom of the table. */ -+/* sdc2 is at the bottom of the table. */ -+/* sdc3 is at the bottom of the table. */ -+/* s.d (sdc1 is at the bottom of the table. */ -+{"sdl", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, 0, I3|AL }, - {"sdl", "t,A(b)", 0, (int) M_SDL_AB, INSN_MACRO, 0, I3 }, - {"sdr", "t,o(b)", 0xb4000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 }, - {"sdr", "t,A(b)", 0, (int) M_SDR_AB, INSN_MACRO, 0, I3 }, - {"sdxc1", "S,t(b)", 0x4c000009, 0xfc0007ff, SM|RD_S|RD_t|RD_b|FP_D, 0, I4_33 }, --{"seb", "d,w", 0x7c000420, 0xffe007ff, WR_d|RD_t, 0, I33 }, --{"seh", "d,w", 0x7c000620, 0xffe007ff, WR_d|RD_t, 0, I33 }, -+{"seb", "d,w", 0x7c000420, 0xffe007ff, WR_d|RD_t, 0, I33|AL }, -+{"seh", "d,w", 0x7c000620, 0xffe007ff, WR_d|RD_t, 0, I33|AL }, - {"selsl", "d,v,t", 0x00000005, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 }, - {"selsr", "d,v,t", 0x00000001, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 }, - {"seq", "d,v,t", 0, (int) M_SEQ, INSN_MACRO, 0, I1 }, -@@ -1279,8 +1271,7 @@ - {"swc1", "E,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 }, - {"s.s", "T,o(b)", 0xe4000000, 0xfc000000, SM|RD_T|RD_b|FP_S, 0, I1 }, /* swc1 */ - {"s.s", "T,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 }, --{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 }, --{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 }, -+/* swc2 is at the bottom of the table. */ - {"swc3", "E,o(b)", 0xec000000, 0xfc000000, SM|RD_C3|RD_b, 0, I1 }, - {"swc3", "E,A(b)", 0, (int) M_SWC3_AB, INSN_MACRO, 0, I1 }, - {"swl", "t,o(b)", 0xa8000000, 0xfc000000, SM|RD_t|RD_b, 0, I1 }, -@@ -1365,7 +1356,8 @@ - {"wait", "J", 0x42000020, 0xfe00003f, TRAP, 0, I32|N55 }, - {"waiti", "", 0x42000020, 0xffffffff, TRAP, 0, L1 }, - {"wrpgpr", "d,w", 0x41c00000, 0xffe007ff, RD_t, 0, I33 }, --{"wsbh", "d,w", 0x7c0000a0, 0xffe007ff, WR_d|RD_t, 0, I33 }, -+{"wsbh", "d,w", 0x7c0000a0, 0xffe007ff, WR_d|RD_t, 0, I33|AL }, -+{"wsbw", "d,t", 0x7c0000e0, 0xffe007ff, WR_d|RD_t, 0, AL }, - {"xor", "d,v,t", 0x00000026, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 }, - {"xor", "t,r,I", 0, (int) M_XOR_I, INSN_MACRO, 0, I1 }, - {"xor", "D,S,T", 0x47800002, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2E }, -@@ -1379,6 +1371,319 @@ - {"yield", "s", 0x7c000009, 0xfc1fffff, TRAP|RD_s, 0, MT32 }, - {"yield", "d,s", 0x7c000009, 0xfc1f07ff, TRAP|WR_d|RD_s, 0, MT32 }, - -+/* Sony Allegrex CPU core. */ -+{"bitrev", "d,t", 0x7c000520, 0xffe007ff, WR_d|RD_t, 0, AL }, -+{"mfic", "t,G", 0x70000024, 0xffe007ff, LCD|WR_t|RD_C0, 0, AL }, -+{"mtic", "t,G", 0x70000026, 0xffe007ff, COD|RD_t|WR_C0, 0, AL }, -+ -+/* Sony Allegrex VFPU instructions. */ -+{"bvf", "?c,p", 0x49000000, 0xffe30000, CBD|RD_CC, 0, AL }, -+{"bvfl", "?c,p", 0x49020000, 0xffe30000, CBL|RD_CC, 0, AL }, -+{"bvt", "?c,p", 0x49010000, 0xffe30000, CBD|RD_CC, 0, AL }, -+{"bvtl", "?c,p", 0x49030000, 0xffe30000, CBL|RD_CC, 0, AL }, -+{"lv.s", "?m0x,?o(b)", 0xc8000000, 0xfc000000, CLD|RD_s|WR_CC, 0, AL }, -+{"lv.s", "?m0x,A(b)", 0, (int) M_LVQ_AB, INSN_MACRO, 0, AL }, -+{"ulv.s", "?m0x,o(b)", 0, (int) M_ULVS, INSN_MACRO, 0, AL }, -+{"lv.q", "?n3x,?o(b)", 0xd8000000, 0xfc000002, CLD|RD_s|WR_CC, 0, AL }, -+{"lv.q", "?n3x,A(b)", 0, (int) M_LVQ_AB_2, INSN_MACRO, 0, AL }, -+{"ulv.q", "?n3x,?o(b)", 0, (int) M_ULVQ, INSN_MACRO, 0, AL }, -+{"ulv.q", "?n3x,A(b)", 0, (int) M_ULVQ_AB, INSN_MACRO, 0, AL }, -+{"lvi.s", "?t0x,l?y0", 0, (int) M_LVIS, INSN_MACRO, 0, AL }, -+{"lvi.p", "?t1x,?[l?y0,l?y1?]", 0, (int) M_LVIP, INSN_MACRO, 0, AL }, -+{"lvi.t", "?t2x,?[l?y0,l?y1,l?y2?]", 0, (int) M_LVIT, INSN_MACRO, 0, AL }, -+{"lvi.q", "?t3x,?[l?y0,l?y1,l?y2,l?y3?]", 0, (int) M_LVIQ, INSN_MACRO, 0, AL }, -+{"lvhi.s", "?t0x,?[?u?y0,?u?y1?]", 0, (int) M_LVHIS, INSN_MACRO, 0, AL }, -+{"lvhi.p", "?t1x,?[?u?y0,?u?y1,?u?y2,?u?y3?]", 0, (int) M_LVHIP, INSN_MACRO, 0, AL }, -+{"sv.s", "?m0x,?o(b)", 0xe8000000, 0xfc000000, SM|RD_s|RD_C2, 0, AL }, -+{"sv.s", "?m0x,A(b)", 0, (int) M_SVS_AB, INSN_MACRO, 0, AL }, -+{"usv.s", "?m0x,o(b)", 0, (int) M_USVS, INSN_MACRO, 0, AL }, -+{"sv.q", "?n3x,?o(b)", 0xf8000000, 0xfc000002, SM|RD_s|RD_C2, 0, AL }, -+{"sv.q", "?n3x,?o(b),?z", 0xf8000000, 0xfc000000, SM|RD_s|RD_C2, 0, AL }, -+{"sv.q", "?n3x,A(b)", 0, (int) M_SVQ_AB, INSN_MACRO, 0, AL }, -+{"sv.q", "?n3x,A(b),?z", 0, (int) M_SVQ_AB, INSN_MACRO, 0, AL }, -+{"sv.q", "?n3x,A,?z", 0, (int) M_SVQ_AB, INSN_MACRO, 0, AL }, -+{"usv.q", "?n3x,?o(b)", 0, (int) M_USVQ, INSN_MACRO, 0, AL }, -+{"usv.q", "?n3x,A(b)", 0, (int) M_USVQ_AB, INSN_MACRO, 0, AL }, -+{"vwb.q", "?n3x,?o(b)", 0xf8000002, 0xfc000002, SM|RD_s|RD_C2, 0, AL }, -+{"lvl.q", "?n3x,?o(b)", 0xd4000000, 0xfc000002, CLD|RD_s|WR_CC, 0, AL }, -+{"lvl.q", "?n3x,A(b)", 0, (int) M_LVLQ_AB, INSN_MACRO, 0, AL }, -+{"lvr.q", "?n3x,?o(b)", 0xd4000002, 0xfc000002, CLD|RD_s|WR_CC, 0, AL }, -+{"lvr.q", "?n3x,A(b)", 0, (int) M_LVRQ_AB, INSN_MACRO, 0, AL }, -+{"svl.q", "?n3x,?o(b)", 0xf4000000, 0xfc000002, SM|RD_s|RD_C2, 0, AL }, -+{"svl.q", "?n3x,A(b)", 0, (int) M_SVLQ_AB, INSN_MACRO, 0, AL }, -+{"svr.q", "?n3x,?o(b)", 0xf4000002, 0xfc000002, SM|RD_s|RD_C2, 0, AL }, -+{"svr.q", "?n3x,A(b)", 0, (int) M_SVRQ_AB, INSN_MACRO, 0, AL }, -+{"mtv", "t,?d0z", 0x48e00000, 0xffe0ff80, LCD|WR_t|WR_C2, 0, AL }, -+{"mfv", "t,?d0z", 0x48600000, 0xffe0ff80, COD|RD_t|WR_CC|RD_C2, 0, AL }, -+{"mtvc", "t,?q", 0x48e00000, 0xffe0ff00, LCD|WR_t|WR_C2, 0, AL }, -+{"mfvc", "t,?q", 0x48600000, 0xffe0ff00, COD|RD_t|WR_CC|RD_C2, 0, AL }, -+{"vmtvc", "?q,?s0y", 0xd0510000, 0xffff8000, WR_C2, 0, AL }, -+{"vmfvc", "?d0z,?r", 0xd0500000, 0xffff0080, RD_C2, 0, AL }, -+{"vadd.q", "?d3d,?s3s,?t3t", 0x60008080, 0xff808080, RD_C2, 0, AL }, -+{"vsub.q", "?d3d,?s3s,?t3t", 0x60808080, 0xff808080, RD_C2, 0, AL }, -+{"vdiv.q", "?x3z,?s3y,?t3x", 0x63808080, 0xff808080, RD_C2, 0, AL }, -+{"vmul.q", "?d3d,?s3s,?t3t", 0x64008080, 0xff808080, RD_C2, 0, AL }, -+{"vdot.q", "?d0d,?s3s,?t3t", 0x64808080, 0xff808080, RD_C2, 0, AL }, -+{"vscl.q", "?d3d,?s3s,?t0x", 0x65008080, 0xff808080, RD_C2, 0, AL }, -+{"vhdp.q", "?d0d,?s3y,?t3t", 0x66008080, 0xff808080, RD_C2, 0, AL }, -+{"vcmp.q", "?f2,?s3s,?t3t", 0x6c008080, 0xff8080f0, RD_C2, 0, AL }, -+{"vcmp.q", "?f1,?s3s", 0x6c008080, 0xffff80f0, RD_C2, 0, AL }, -+{"vcmp.q", "?f0", 0x6c008080, 0xfffffff0, RD_C2, 0, AL }, -+{"vmin.q", "?d3d,?s3s,?t3t", 0x6d008080, 0xff808080, RD_C2, 0, AL }, -+{"vmax.q", "?d3d,?s3s,?t3t", 0x6d808080, 0xff808080, RD_C2, 0, AL }, -+{"vsgn.q", "?d3d,?s3s", 0xd04a8080, 0xffff8080, RD_C2, 0, AL }, -+{"vcst.q", "?d3d,?a", 0xd0608080, 0xffe0ff80, RD_C2, 0, AL }, -+{"vscmp.q", "?d3d,?s3s,?t3t", 0x6e808080, 0xff808080, RD_C2, 0, AL }, -+{"vsge.q", "?d3d,?s3s,?t3t", 0x6f008080, 0xff808080, RD_C2, 0, AL }, -+{"vslt.q", "?d3d,?s3s,?t3t", 0x6f808080, 0xff808080, RD_C2, 0, AL }, -+{"vi2uc.q", "?d0m,?s3w", 0xd03c8080, 0xffff8080, RD_C2, 0, AL }, -+{"vi2c.q", "?d0m,?s3w", 0xd03d8080, 0xffff8080, RD_C2, 0, AL }, -+{"vi2us.q", "?d1m,?s3w", 0xd03e8080, 0xffff8080, RD_C2, 0, AL }, -+{"vi2s.q", "?d1m,?s3w", 0xd03f8080, 0xffff8080, RD_C2, 0, AL }, -+{"vmov.q", "?d3d,?s3s", 0xd0008080, 0xffff8080, RD_C2, 0, AL }, -+{"vabs.q", "?d3d,?s3w", 0xd0018080, 0xffff8080, RD_C2, 0, AL }, -+{"vneg.q", "?d3d,?s3w", 0xd0028080, 0xffff8080, RD_C2, 0, AL }, -+{"vidt.q", "?d3d", 0xd0038080, 0xffffff80, RD_C2, 0, AL }, -+{"vsat0.q", "?d3z,?s3s", 0xd0048080, 0xffff8080, RD_C2, 0, AL }, -+{"vsat1.q", "?d3z,?s3s", 0xd0058080, 0xffff8080, RD_C2, 0, AL }, -+{"vzero.q", "?d3d", 0xd0068080, 0xffffff80, RD_C2, 0, AL }, -+{"vone.q", "?d3d", 0xd0078080, 0xffffff80, RD_C2, 0, AL }, -+{"vrcp.q", "?x3z,?s3y", 0xd0108080, 0xffff8080, RD_C2, 0, AL }, -+{"vrsq.q", "?x3z,?s3y", 0xd0118080, 0xffff8080, RD_C2, 0, AL }, -+{"vsin.q", "?x3z,?s3y", 0xd0128080, 0xffff8080, RD_C2, 0, AL }, -+{"vcos.q", "?x3z,?s3y", 0xd0138080, 0xffff8080, RD_C2, 0, AL }, -+{"vexp2.q", "?x3z,?s3y", 0xd0148080, 0xffff8080, RD_C2, 0, AL }, -+{"vlog2.q", "?x3z,?s3y", 0xd0158080, 0xffff8080, RD_C2, 0, AL }, -+{"vsqrt.q", "?x3z,?s3y", 0xd0168080, 0xffff8080, RD_C2, 0, AL }, -+{"vasin.q", "?x3z,?s3y", 0xd0178080, 0xffff8080, RD_C2, 0, AL }, -+{"vnrcp.q", "?x3z,?s3y", 0xd0188080, 0xffff8080, RD_C2, 0, AL }, -+{"vnsin.q", "?x3z,?s3y", 0xd01a8080, 0xffff8080, RD_C2, 0, AL }, -+{"vrexp2.q", "?x3z,?s3y", 0xd01c8080, 0xffff8080, RD_C2, 0, AL }, -+{"vrndi.q", "?d3z", 0xd0218080, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf1.q", "?d3z", 0xd0228080, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf2.q", "?d3z", 0xd0238080, 0xffffff80, RD_C2, 0, AL }, -+{"vf2h.q", "?d1m,?s3s", 0xd0328080, 0xffff8080, RD_C2, 0, AL }, -+{"vsrt1.q", "?d3d,?s3s", 0xd0408080, 0xffff8080, RD_C2, 0, AL }, -+{"vsrt2.q", "?d3d,?s3s", 0xd0418080, 0xffff8080, RD_C2, 0, AL }, -+{"vsrt3.q", "?d3d,?s3s", 0xd0488080, 0xffff8080, RD_C2, 0, AL }, -+{"vsrt4.q", "?d3d,?s3s", 0xd0498080, 0xffff8080, RD_C2, 0, AL }, -+{"vbfy1.q", "?d3d,?s3s", 0xd0428080, 0xffff8080, RD_C2, 0, AL }, -+{"vbfy2.q", "?d3d,?s3s", 0xd0438080, 0xffff8080, RD_C2, 0, AL }, -+{"vocp.q", "?d3d,?s3y", 0xd0448080, 0xffff8080, RD_C2, 0, AL }, -+{"vfad.q", "?d0d,?s3s", 0xd0468080, 0xffff8080, RD_C2, 0, AL }, -+{"vavg.q", "?d0d,?s3s", 0xd0478080, 0xffff8080, RD_C2, 0, AL }, -+{"vf2in.q", "?d3m,?s3s,?b", 0xd2008080, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iz.q", "?d3m,?s3s,?b", 0xd2208080, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iu.q", "?d3m,?s3s,?b", 0xd2408080, 0xffe08080, RD_C2, 0, AL }, -+{"vf2id.q", "?d3m,?s3s,?b", 0xd2608080, 0xffe08080, RD_C2, 0, AL }, -+{"vi2f.q", "?d3d,?s3w,?b", 0xd2808080, 0xffe08080, RD_C2, 0, AL }, -+{"vcmov.q", "?d3d,?s3s,?e", 0, (int) M_VCMOVQ, INSN_MACRO, 0, AL }, -+{"vcmovt.q", "?d3d,?s3s,?e", 0xd2a08080, 0xfff88080, RD_C2, 0, AL }, -+{"vcmovf.q", "?d3d,?s3s,?e", 0xd2a88080, 0xfff88080, RD_C2, 0, AL }, -+{"vmmul.q", "?v7z,?s7y,?t7x", 0xf0008080, 0xff808080, RD_C2, 0, AL }, -+{"vtfm4.q", "?v3z,?s7y,?t3x", 0xf1808080, 0xff808080, RD_C2, 0, AL }, -+{"vhtfm4.q", "?v3z,?s7y,?t3x", 0xf1808000, 0xff808080, RD_C2, 0, AL }, -+{"vmscl.q", "?x7z,?s7y,?t0x", 0xf2008080, 0xff808080, RD_C2, 0, AL }, -+{"vqmul.q", "?v3z,?s3y,?t3x", 0xf2808080, 0xff808080, RD_C2, 0, AL }, -+{"vmmov.q", "?x7z,?s7y", 0xf3808080, 0xffff8080, RD_C2, 0, AL }, -+{"vmidt.q", "?d7z", 0xf3838080, 0xffffff80, RD_C2, 0, AL }, -+{"vmzero.q", "?d7z", 0xf3868080, 0xffffff80, RD_C2, 0, AL }, -+{"vmone.q", "?d7z", 0xf3878080, 0xffffff80, RD_C2, 0, AL }, -+{"vrot.q", "?x3z,?s0y,?w", 0xf3a08080, 0xffe08080, RD_C2, 0, AL }, -+{"vt4444.q", "?d1z,?s3w", 0xd0598080, 0xffff8080, RD_C2, 0, AL }, -+{"vt5551.q", "?d1z,?s3w", 0xd05a8080, 0xffff8080, RD_C2, 0, AL }, -+{"vt5650.q", "?d1z,?s3w", 0xd05b8080, 0xffff8080, RD_C2, 0, AL }, -+{"vadd.t", "?d2d,?s2s,?t2t", 0x60008000, 0xff808080, RD_C2, 0, AL }, -+{"vsub.t", "?d2d,?s2s,?t2t", 0x60808000, 0xff808080, RD_C2, 0, AL }, -+{"vdiv.t", "?x2z,?s2y,?t2x", 0x63808000, 0xff808080, RD_C2, 0, AL }, -+{"vmul.t", "?d2d,?s2s,?t2t", 0x64008000, 0xff808080, RD_C2, 0, AL }, -+{"vdot.t", "?d0d,?s2s,?t2t", 0x64808000, 0xff808080, RD_C2, 0, AL }, -+{"vscl.t", "?d2d,?s2s,?t0x", 0x65008000, 0xff808080, RD_C2, 0, AL }, -+{"vhdp.t", "?d0d,?s2y,?t2t", 0x66008000, 0xff808080, RD_C2, 0, AL }, -+{"vcrs.t", "?d2d,?s2y,?t2x", 0x66808000, 0xff808080, RD_C2, 0, AL }, -+{"vcmp.t", "?f2,?s2s,?t2t", 0x6c008000, 0xff8080f0, RD_C2, 0, AL }, -+{"vcmp.t", "?f1,?s2s", 0x6c008000, 0xffff80f0, RD_C2, 0, AL }, -+{"vcmp.t", "?f0", 0x6c008000, 0xfffffff0, RD_C2, 0, AL }, -+{"vmin.t", "?d2d,?s2s,?t2t", 0x6d008000, 0xff808080, RD_C2, 0, AL }, -+{"vmax.t", "?d2d,?s2s,?t2t", 0x6d808000, 0xff808080, RD_C2, 0, AL }, -+{"vsgn.t", "?d2d,?s2s", 0xd04a8000, 0xffff8080, RD_C2, 0, AL }, -+{"vcst.t", "?d2d,?a", 0xd0608000, 0xffe0ff80, RD_C2, 0, AL }, -+{"vscmp.t", "?d2d,?s2s,?t2t", 0x6e808000, 0xff808080, RD_C2, 0, AL }, -+{"vsge.t", "?d2d,?s2s,?t2t", 0x6f008000, 0xff808080, RD_C2, 0, AL }, -+{"vslt.t", "?d2d,?s2s,?t2t", 0x6f808000, 0xff808080, RD_C2, 0, AL }, -+{"vmov.t", "?d2d,?s2s", 0xd0008000, 0xffff8080, RD_C2, 0, AL }, -+{"vabs.t", "?d2d,?s2w", 0xd0018000, 0xffff8080, RD_C2, 0, AL }, -+{"vneg.t", "?d2d,?s2w", 0xd0028000, 0xffff8080, RD_C2, 0, AL }, -+{"vsat0.t", "?d2z,?s2s", 0xd0048000, 0xffff8080, RD_C2, 0, AL }, -+{"vsat1.t", "?d2z,?s2s", 0xd0058000, 0xffff8080, RD_C2, 0, AL }, -+{"vzero.t", "?d2d", 0xd0068000, 0xffffff80, RD_C2, 0, AL }, -+{"vone.t", "?d2d", 0xd0078000, 0xffffff80, RD_C2, 0, AL }, -+{"vrcp.t", "?x2z,?s2y", 0xd0108000, 0xffff8080, RD_C2, 0, AL }, -+{"vrsq.t", "?x2z,?s2y", 0xd0118000, 0xffff8080, RD_C2, 0, AL }, -+{"vsin.t", "?x2z,?s2y", 0xd0128000, 0xffff8080, RD_C2, 0, AL }, -+{"vcos.t", "?x2z,?s2y", 0xd0138000, 0xffff8080, RD_C2, 0, AL }, -+{"vexp2.t", "?x2z,?s2y", 0xd0148000, 0xffff8080, RD_C2, 0, AL }, -+{"vlog2.t", "?x2z,?s2y", 0xd0158000, 0xffff8080, RD_C2, 0, AL }, -+{"vsqrt.t", "?x2z,?s2y", 0xd0168000, 0xffff8080, RD_C2, 0, AL }, -+{"vasin.t", "?x2z,?s2y", 0xd0178000, 0xffff8080, RD_C2, 0, AL }, -+{"vnrcp.t", "?x2z,?s2y", 0xd0188000, 0xffff8080, RD_C2, 0, AL }, -+{"vnsin.t", "?x2z,?s2y", 0xd01a8000, 0xffff8080, RD_C2, 0, AL }, -+{"vrexp2.t", "?x2z,?s2y", 0xd01c8000, 0xffff8080, RD_C2, 0, AL }, -+{"vrndi.t", "?d2z", 0xd0218000, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf1.t", "?d2z", 0xd0228000, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf2.t", "?d2z", 0xd0238000, 0xffffff80, RD_C2, 0, AL }, -+{"vocp.t", "?d2d,?s2y", 0xd0448000, 0xffff8080, RD_C2, 0, AL }, -+{"vfad.t", "?d0d,?s2s", 0xd0468000, 0xffff8080, RD_C2, 0, AL }, -+{"vavg.t", "?d0d,?s2s", 0xd0478000, 0xffff8080, RD_C2, 0, AL }, -+{"vf2in.t", "?d2m,?s2s,?b", 0xd2008000, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iz.t", "?d2m,?s2s,?b", 0xd2208000, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iu.t", "?d2m,?s2s,?b", 0xd2408000, 0xffe08080, RD_C2, 0, AL }, -+{"vf2id.t", "?d2m,?s2s,?b", 0xd2608000, 0xffe08080, RD_C2, 0, AL }, -+{"vi2f.t", "?d2d,?s2w,?b", 0xd2808000, 0xffe08080, RD_C2, 0, AL }, -+{"vcmov.t", "?d2d,?s2s,?e", 0, (int) M_VCMOVT, INSN_MACRO, 0, AL }, -+{"vcmovt.t", "?d2d,?s2s,?e", 0xd2a08000, 0xfff88080, RD_C2, 0, AL }, -+{"vcmovf.t", "?d2d,?s2s,?e", 0xd2a88000, 0xfff88080, RD_C2, 0, AL }, -+{"vmmul.t", "?v6z,?s6y,?t6x", 0xf0008000, 0xff808080, RD_C2, 0, AL }, -+{"vtfm3.t", "?v2z,?s6y,?t2x", 0xf1008000, 0xff808080, RD_C2, 0, AL }, -+{"vhtfm3.t", "?v2z,?s6y,?t2x", 0xf1000080, 0xff808080, RD_C2, 0, AL }, -+{"vmscl.t", "?x6z,?s6y,?t0x", 0xf2008000, 0xff808080, RD_C2, 0, AL }, -+{"vmmov.t", "?x6z,?s6y", 0xf3808000, 0xffff8080, RD_C2, 0, AL }, -+{"vmidt.t", "?d6z", 0xf3838000, 0xffffff80, RD_C2, 0, AL }, -+{"vmzero.t", "?d6z", 0xf3868000, 0xffffff80, RD_C2, 0, AL }, -+{"vmone.t", "?d6z", 0xf3878000, 0xffffff80, RD_C2, 0, AL }, -+{"vrot.t", "?x2z,?s0y,?w", 0xf3a08000, 0xffe08080, RD_C2, 0, AL }, -+{"vcrsp.t", "?d2z,?s2y,?t2x", 0xf2808000, 0xff808080, RD_C2, 0, AL }, -+{"vadd.p", "?d1d,?s1s,?t1t", 0x60000080, 0xff808080, RD_C2, 0, AL }, -+{"vsub.p", "?d1d,?s1s,?t1t", 0x60800080, 0xff808080, RD_C2, 0, AL }, -+{"vdiv.p", "?x1z,?s1y,?t1x", 0x63800080, 0xff808080, RD_C2, 0, AL }, -+{"vmul.p", "?d1d,?s1s,?t1t", 0x64000080, 0xff808080, RD_C2, 0, AL }, -+{"vdot.p", "?d0d,?s1s,?t1t", 0x64800080, 0xff808080, RD_C2, 0, AL }, -+{"vscl.p", "?d1d,?s1s,?t0x", 0x65000080, 0xff808080, RD_C2, 0, AL }, -+{"vhdp.p", "?d0d,?s1y,?t1t", 0x66000080, 0xff808080, RD_C2, 0, AL }, -+{"vdet.p", "?d0d,?s1s,?t1x", 0x67000080, 0xff808080, RD_C2, 0, AL }, -+{"vcmp.p", "?f2,?s1s,?t1t", 0x6c000080, 0xff8080f0, RD_C2, 0, AL }, -+{"vcmp.p", "?f1,?s1s", 0x6c000080, 0xffff80f0, RD_C2, 0, AL }, -+{"vcmp.p", "?f0", 0x6c000080, 0xfffffff0, RD_C2, 0, AL }, -+{"vmin.p", "?d1d,?s1s,?t1t", 0x6d000080, 0xff808080, RD_C2, 0, AL }, -+{"vmax.p", "?d1d,?s1s,?t1t", 0x6d800080, 0xff808080, RD_C2, 0, AL }, -+{"vsgn.p", "?d1d,?s1s", 0xd04a0080, 0xffff8080, RD_C2, 0, AL }, -+{"vcst.p", "?d1d,?a", 0xd0600080, 0xffe0ff80, RD_C2, 0, AL }, -+{"vscmp.p", "?d1d,?s1s,?t1t", 0x6e800080, 0xff808080, RD_C2, 0, AL }, -+{"vsge.p", "?d1d,?s1s,?t1t", 0x6f000080, 0xff808080, RD_C2, 0, AL }, -+{"vslt.p", "?d1d,?s1s,?t1t", 0x6f800080, 0xff808080, RD_C2, 0, AL }, -+{"vus2i.p", "?d3m,?s1y", 0xd03a0080, 0xffff8080, RD_C2, 0, AL }, -+{"vs2i.p", "?d3m,?s1y", 0xd03b0080, 0xffff8080, RD_C2, 0, AL }, -+{"vi2us.p", "?d0m,?s1w", 0xd03e0080, 0xffff8080, RD_C2, 0, AL }, -+{"vi2s.p", "?d0m,?s1w", 0xd03f0080, 0xffff8080, RD_C2, 0, AL }, -+{"vmov.p", "?d1d,?s1s", 0xd0000080, 0xffff8080, RD_C2, 0, AL }, -+{"vabs.p", "?d1d,?s1w", 0xd0010080, 0xffff8080, RD_C2, 0, AL }, -+{"vneg.p", "?d1d,?s1w", 0xd0020080, 0xffff8080, RD_C2, 0, AL }, -+{"vidt.p", "?d1d", 0xd0030080, 0xffffff80, RD_C2, 0, AL }, -+{"vsat0.p", "?d1z,?s1s", 0xd0040080, 0xffff8080, RD_C2, 0, AL }, -+{"vsat1.p", "?d1z,?s1s", 0xd0050080, 0xffff8080, RD_C2, 0, AL }, -+{"vzero.p", "?d1d", 0xd0060080, 0xffffff80, RD_C2, 0, AL }, -+{"vone.p", "?d1d", 0xd0070080, 0xffffff80, RD_C2, 0, AL }, -+{"vrcp.p", "?x1z,?s1y", 0xd0100080, 0xffff8080, RD_C2, 0, AL }, -+{"vrsq.p", "?x1z,?s1y", 0xd0110080, 0xffff8080, RD_C2, 0, AL }, -+{"vsin.p", "?x1z,?s1y", 0xd0120080, 0xffff8080, RD_C2, 0, AL }, -+{"vcos.p", "?x1z,?s1y", 0xd0130080, 0xffff8080, RD_C2, 0, AL }, -+{"vexp2.p", "?x1z,?s1y", 0xd0140080, 0xffff8080, RD_C2, 0, AL }, -+{"vlog2.p", "?x1z,?s1y", 0xd0150080, 0xffff8080, RD_C2, 0, AL }, -+{"vsqrt.p", "?x1z,?s1y", 0xd0160080, 0xffff8080, RD_C2, 0, AL }, -+{"vasin.p", "?x1z,?s1y", 0xd0170080, 0xffff8080, RD_C2, 0, AL }, -+{"vnrcp.p", "?x1z,?s1y", 0xd0180080, 0xffff8080, RD_C2, 0, AL }, -+{"vnsin.p", "?x1z,?s1y", 0xd01a0080, 0xffff8080, RD_C2, 0, AL }, -+{"vrexp2.p", "?x1z,?s1y", 0xd01c0080, 0xffff8080, RD_C2, 0, AL }, -+{"vrndi.p", "?d1z", 0xd0210080, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf1.p", "?d1z", 0xd0220080, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf2.p", "?d1z", 0xd0230080, 0xffffff80, RD_C2, 0, AL }, -+{"vf2h.p", "?d0m,?s1s", 0xd0320080, 0xffff8080, RD_C2, 0, AL }, -+{"vh2f.p", "?d3d,?s1y", 0xd0330080, 0xffff8080, RD_C2, 0, AL }, -+{"vbfy1.p", "?d1d,?s1s", 0xd0420080, 0xffff8080, RD_C2, 0, AL }, -+{"vocp.p", "?d1d,?s1y", 0xd0440080, 0xffff8080, RD_C2, 0, AL }, -+{"vsocp.p", "?d3z,?s1y", 0xd0450080, 0xffff8080, RD_C2, 0, AL }, -+{"vfad.p", "?d0d,?s1s", 0xd0460080, 0xffff8080, RD_C2, 0, AL }, -+{"vavg.p", "?d0d,?s1s", 0xd0470080, 0xffff8080, RD_C2, 0, AL }, -+{"vf2in.p", "?d1m,?s1s,?b", 0xd2000080, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iz.p", "?d1m,?s1s,?b", 0xd2200080, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iu.p", "?d1m,?s1s,?b", 0xd2400080, 0xffe08080, RD_C2, 0, AL }, -+{"vf2id.p", "?d1m,?s1s,?b", 0xd2600080, 0xffe08080, RD_C2, 0, AL }, -+{"vi2f.p", "?d1d,?s1w,?b", 0xd2800080, 0xffe08080, RD_C2, 0, AL }, -+{"vcmov.p", "?d1d,?s1s,?e", 0, (int) M_VCMOVP, INSN_MACRO, 0, AL }, -+{"vcmovt.p", "?d1d,?s1s,?e", 0xd2a00080, 0xfff88080, RD_C2, 0, AL }, -+{"vcmovf.p", "?d1d,?s1s,?e", 0xd2a80080, 0xfff88080, RD_C2, 0, AL }, -+{"vmmul.p", "?v5z,?s5y,?t5x", 0xf0000080, 0xff808080, RD_C2, 0, AL }, -+{"vtfm2.p", "?v1z,?s5y,?t1x", 0xf0800080, 0xff808080, RD_C2, 0, AL }, -+{"vhtfm2.p", "?v1z,?s5y,?t1x", 0xf0800000, 0xff808080, RD_C2, 0, AL }, -+{"vmscl.p", "?x5z,?s5y,?t0x", 0xf2000080, 0xff808080, RD_C2, 0, AL }, -+{"vmmov.p", "?x5z,?s5y", 0xf3800080, 0xffff8080, RD_C2, 0, AL }, -+{"vmidt.p", "?d5z", 0xf3830080, 0xffffff80, RD_C2, 0, AL }, -+{"vmzero.p", "?d5z", 0xf3860080, 0xffffff80, RD_C2, 0, AL }, -+{"vmone.p", "?d5z", 0xf3870080, 0xffffff80, RD_C2, 0, AL }, -+{"vrot.p", "?x1z,?s0y,?w", 0xf3a00080, 0xffe08080, RD_C2, 0, AL }, -+{"vadd.s", "?d0d,?s0s,?t0t", 0x60000000, 0xff808080, RD_C2, 0, AL }, -+{"vsub.s", "?d0d,?s0s,?t0t", 0x60800000, 0xff808080, RD_C2, 0, AL }, -+{"vdiv.s", "?x0d,?s0s,?t0t", 0x63800000, 0xff808080, RD_C2, 0, AL }, -+{"vmul.s", "?d0d,?s0s,?t0t", 0x64000000, 0xff808080, RD_C2, 0, AL }, -+{"vcmp.s", "?f2,?s0s,?t0t", 0x6c000000, 0xff8080f0, RD_C2, 0, AL }, -+{"vcmp.s", "?f1,?s0s", 0x6c000000, 0xffff80f0, RD_C2, 0, AL }, -+{"vcmp.s", "?f0", 0x6c000000, 0xfffffff0, RD_C2, 0, AL }, -+{"vmin.s", "?d0d,?s0s,?t0t", 0x6d000000, 0xff808080, RD_C2, 0, AL }, -+{"vmax.s", "?d0d,?s0s,?t0t", 0x6d800000, 0xff808080, RD_C2, 0, AL }, -+{"vsgn.s", "?d0d,?s0s", 0xd04a0000, 0xffff8080, RD_C2, 0, AL }, -+{"vcst.s", "?d0d,?a", 0xd0600000, 0xffe0ff80, RD_C2, 0, AL }, -+{"vscmp.s", "?d0d,?s0s,?t0t", 0x6e800000, 0xff808080, RD_C2, 0, AL }, -+{"vsge.s", "?d0d,?s0s,?t0t", 0x6f000000, 0xff808080, RD_C2, 0, AL }, -+{"vslt.s", "?d0d,?s0s,?t0t", 0x6f800000, 0xff808080, RD_C2, 0, AL }, -+{"vus2i.s", "?d1m,?s0y", 0xd03a0000, 0xffff8080, RD_C2, 0, AL }, -+{"vs2i.s", "?d1m,?s0y", 0xd03b0000, 0xffff8080, RD_C2, 0, AL }, -+{"vmov.s", "?d0d,?s0s", 0xd0000000, 0xffff8080, RD_C2, 0, AL }, -+{"vabs.s", "?d0d,?s0w", 0xd0010000, 0xffff8080, RD_C2, 0, AL }, -+{"vneg.s", "?d0d,?s0w", 0xd0020000, 0xffff8080, RD_C2, 0, AL }, -+{"vsat0.s", "?d0z,?s0s", 0xd0040000, 0xffff8080, RD_C2, 0, AL }, -+{"vsat1.s", "?d0z,?s0s", 0xd0050000, 0xffff8080, RD_C2, 0, AL }, -+{"vzero.s", "?d0d", 0xd0060000, 0xffffff80, RD_C2, 0, AL }, -+{"vone.s", "?d0d", 0xd0070000, 0xffffff80, RD_C2, 0, AL }, -+{"vrcp.s", "?x0d,?s0s", 0xd0100000, 0xffff8080, RD_C2, 0, AL }, -+{"vrsq.s", "?x0d,?s0s", 0xd0110000, 0xffff8080, RD_C2, 0, AL }, -+{"vsin.s", "?x0d,?s0s", 0xd0120000, 0xffff8080, RD_C2, 0, AL }, -+{"vcos.s", "?x0d,?s0s", 0xd0130000, 0xffff8080, RD_C2, 0, AL }, -+{"vexp2.s", "?x0d,?s0s", 0xd0140000, 0xffff8080, RD_C2, 0, AL }, -+{"vlog2.s", "?x0d,?s0s", 0xd0150000, 0xffff8080, RD_C2, 0, AL }, -+{"vsqrt.s", "?x0d,?s0s", 0xd0160000, 0xffff8080, RD_C2, 0, AL }, -+{"vasin.s", "?x0d,?s0s", 0xd0170000, 0xffff8080, RD_C2, 0, AL }, -+{"vnrcp.s", "?x0d,?s0y", 0xd0180000, 0xffff8080, RD_C2, 0, AL }, -+{"vnsin.s", "?x0d,?s0y", 0xd01a0000, 0xffff8080, RD_C2, 0, AL }, -+{"vrexp2.s", "?x0d,?s0y", 0xd01c0000, 0xffff8080, RD_C2, 0, AL }, -+{"vrnds.s", "?s0y", 0xd0200000, 0xffff80ff, RD_C2, 0, AL }, -+{"vrndi.s", "?d0d", 0xd0210000, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf1.s", "?d0d", 0xd0220000, 0xffffff80, RD_C2, 0, AL }, -+{"vrndf2.s", "?d0d", 0xd0230000, 0xffffff80, RD_C2, 0, AL }, -+{"vh2f.s", "?d1d,?s0y", 0xd0330000, 0xffff8080, RD_C2, 0, AL }, -+{"vsbz.s", "?d0d,?s0s", 0xd0360000, 0xffff8080, RD_C2, 0, AL }, -+{"vsbn.s", "?d0d,?s0s,?t0t", 0x61000000, 0xff808080, RD_C2, 0, AL }, -+{"vlgb.s", "?d0d,?s0s", 0xd0370000, 0xffff8080, RD_C2, 0, AL }, -+{"vocp.s", "?d0d,?s0y", 0xd0440000, 0xffff8080, RD_C2, 0, AL }, -+{"vsocp.s", "?d1z,?s0y", 0xd0450000, 0xffff8080, RD_C2, 0, AL }, -+{"vf2in.s", "?d0m,?s0s,?b", 0xd2000000, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iz.s", "?d0m,?s0s,?b", 0xd2200000, 0xffe08080, RD_C2, 0, AL }, -+{"vf2iu.s", "?d0m,?s0s,?b", 0xd2400000, 0xffe08080, RD_C2, 0, AL }, -+{"vf2id.s", "?d0m,?s0s,?b", 0xd2600000, 0xffe08080, RD_C2, 0, AL }, -+{"vi2f.s", "?d0d,?s0w,?b", 0xd2800000, 0xffe08080, RD_C2, 0, AL }, -+{"vcmov.s", "?d0d,?s0s,?e", 0, (int) M_VCMOVS, INSN_MACRO, 0, AL }, -+{"vcmovt.s", "?d0d,?s0s,?e", 0xd2a00000, 0xfff88080, RD_C2, 0, AL }, -+{"vcmovf.s", "?d0d,?s0s,?e", 0xd2a80000, 0xfff88080, RD_C2, 0, AL }, -+{"vwbn.s", "?d0d,?s0s,?i", 0xd3000000, 0xff008080, RD_C2, 0, AL }, -+{"vpfxs", "?0,?1,?2,?3", 0xdc000000, 0xff000000, RD_C2, 0, AL }, -+{"vpfxt", "?0,?1,?2,?3", 0xdd000000, 0xff000000, RD_C2, 0, AL }, -+{"vpfxd", "?4,?5,?6,?7", 0xde000000, 0xff000000, RD_C2, 0, AL }, -+{"viim.s", "?t0d,j", 0xdf000000, 0xff800000, RD_C2, 0, AL }, -+{"vfim.s", "?t0d,?u", 0xdf800000, 0xff800000, RD_C2, 0, AL }, -+{"vnop", "", 0xffff0000, 0xffffffff, RD_C2, 0, AL }, -+{"vflush", "", 0xffff040d, 0xffffffff, RD_C2, 0, AL }, -+{"vsync", "", 0xffff0320, 0xffffffff, RD_C2, 0, AL }, -+{"vsync", "i", 0xffff0000, 0xffff0000, RD_C2, 0, AL }, -+ - /* User Defined Instruction. */ - {"udi0", "s,t,d,+1",0x70000010, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 }, - {"udi0", "s,t,+2", 0x70000010, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 }, -@@ -1472,6 +1777,36 @@ - {"mthc2", "t,G,H", 0x48e00000, 0xffe007f8, COD|RD_t|WR_C2|WR_CC, 0, I33 }, - {"mthc2", "t,i", 0x48e00000, 0xffe00000, COD|RD_t|WR_C2|WR_CC, 0, I33 }, - -+/* Coprocessor 2 load/store operations overlap with the Allegrex VFPU -+ instructions so they are here for the latters to take precedence. */ -+/* COP1 ldc1 and sdc1 and COP3 ldc3 and sdc3 also overlap with the VFPU. */ -+{"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, -+{"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, -+{"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 }, -+{"ldc1", "E,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 }, -+{"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */ -+{"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, 0, I1 }, -+{"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, 0, I1 }, -+{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, -+{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 }, -+{"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, -+{"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2 }, -+{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 }, -+{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 }, -+{"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, -+{"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, -+{"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, -+{"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, -+{"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, -+{"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, 0, I1 }, -+{"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, 0, I1 }, -+{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 }, -+{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 }, -+{"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2 }, -+{"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2 }, -+{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 }, -+{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 }, -+ - /* Coprocessor 3 move/branch operations overlap with MIPS IV COP1X - instructions, so they are here for the latters to take precedence. */ - {"bc3f", "p", 0x4d000000, 0xffff0000, CBD|RD_CC, 0, I1 }, -diff -burN orig.insight-6.8/tcl/win/tclWin32Dll.c insight-6.8/tcl/win/tclWin32Dll.c ---- orig.insight-6.8/tcl/win/tclWin32Dll.c 2012-01-12 21:44:15.799336279 +0100 -+++ insight-6.8/tcl/win/tclWin32Dll.c 2012-01-12 22:15:51.851009892 +0100 -@@ -49,10 +49,10 @@ - - typedef struct EXCEPTION_REGISTRATION { - struct EXCEPTION_REGISTRATION *link; -- EXCEPTION_DISPOSITION (*handler)( -+ EXCEPTION_DISPOSITION __attribute__ ((cdecl, used)) (*handler)( - struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); -- void *ebp; -- void *esp; -+ void __attribute__ ((used)) *ebp; -+ void __attribute__ ((used)) *esp; - int status; - } EXCEPTION_REGISTRATION; - #endif -diff -burN orig.insight-6.8/tcl/win/tclWinChan.c insight-6.8/tcl/win/tclWinChan.c ---- orig.insight-6.8/tcl/win/tclWinChan.c 2012-01-12 21:44:15.799336279 +0100 -+++ insight-6.8/tcl/win/tclWinChan.c 2012-01-12 22:17:09.480213132 +0100 -@@ -122,8 +122,8 @@ - }; - - #ifdef HAVE_NO_SEH --static void *ESP; --static void *EBP; -+static __attribute__ ((used)) void *ESP; -+static __attribute__ ((used)) void *EBP; - #endif /* HAVE_NO_SEH */ - - diff --git a/scripts/008-insight.sh b/scripts/008-insight.sh deleted file mode 100755 index c057420..0000000 --- a/scripts/008-insight.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# insight-6.8.sh by Naomi Peori (naomi@peori.ca) -exit; - -. ../common.sh - -# Exit on errors -set -e - -INSIGHT_VERSION="6.8a" - -# Download the source code if it does not already exist. -download_and_extract "https://sourceware.org/pub/insight/releases/insight-$INSIGHT_VERSION.tar.bz2" insight-"$INSIGHT_VERSION" - -# Enter the source directory and patch the source code. -cd insight-"$INSIGHT_VERSION" -patch -p1 < ../../patches/insight-"$INSIGHT_VERSION"-PSP.patch - -# Create and enter the build directory. -mkdir build-psp -cd build-psp - -# Configure the build. -../configure --prefix="$PSPDEV" --target="psp" --disable-werror - -# Compile and install. -run_make -run_make install -run_make clean diff --git a/scripts/009-psplinkusb.sh b/scripts/008-psplinkusb.sh similarity index 100% rename from scripts/009-psplinkusb.sh rename to scripts/008-psplinkusb.sh diff --git a/scripts/010-ebootsigner.sh b/scripts/009-ebootsigner.sh similarity index 100% rename from scripts/010-ebootsigner.sh rename to scripts/009-ebootsigner.sh diff --git a/scripts/011-psplibraries.sh b/scripts/010-psplibraries.sh similarity index 100% rename from scripts/011-psplibraries.sh rename to scripts/010-psplibraries.sh From 71b8fbca6f89095a3fc410462f6a87790a017183 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Fri, 12 Apr 2019 10:22:16 +0200 Subject: [PATCH 20/30] Updated binutils to 2.23.1 --- patches/binutils-2.22-fixes.patch | 24 - ...22-PSP.patch => binutils-2.23.1-PSP.patch} | 535 +++++++++--------- scripts/001-binutils.sh | 2 +- 3 files changed, 279 insertions(+), 282 deletions(-) delete mode 100644 patches/binutils-2.22-fixes.patch rename patches/{binutils-2.22-PSP.patch => binutils-2.23.1-PSP.patch} (93%) diff --git a/patches/binutils-2.22-fixes.patch b/patches/binutils-2.22-fixes.patch deleted file mode 100644 index 6f994c1..0000000 --- a/patches/binutils-2.22-fixes.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -burN orig.binutils-2.22/bfd/doc/bfd.texinfo binutils-2.22/bfd/doc/bfd.texinfo ---- orig.binutils-2.22/bfd/doc/bfd.texinfo 2010-10-28 13:40:25.000000000 +0200 -+++ binutils-2.22/bfd/doc/bfd.texinfo 2013-08-29 22:15:26.795913686 +0200 -@@ -321,9 +321,9 @@ - @unnumbered BFD Index - @printindex cp - -+@c I think something like @colophon should be in texinfo. In the -+@c meantime: - @tex --% I think something like @colophon should be in texinfo. In the --% meantime: - \long\def\colophon{\hbox to0pt{}\vfill - \centerline{The body of this manual is set in} - \centerline{\fontname\tenrm,} -@@ -333,7 +333,7 @@ - \centerline{{\sl\fontname\tensl\/}} - \centerline{are used for emphasis.}\vfill} - \page\colophon --% Blame: doc@cygnus.com, 28mar91. - @end tex -+@c Blame: doc@cygnus.com, 28mar91. - - @bye diff --git a/patches/binutils-2.22-PSP.patch b/patches/binutils-2.23.1-PSP.patch similarity index 93% rename from patches/binutils-2.22-PSP.patch rename to patches/binutils-2.23.1-PSP.patch index c82c245..c40ceec 100644 --- a/patches/binutils-2.22-PSP.patch +++ b/patches/binutils-2.23.1-PSP.patch @@ -1,29 +1,29 @@ -diff -burN orig.binutils-2.22/bfd/archures.c binutils-2.22/bfd/archures.c ---- orig.binutils-2.22/bfd/archures.c 2011-08-02 01:04:19.000000000 +0200 -+++ binutils-2.22/bfd/archures.c 2012-01-04 16:18:30.404282447 +0100 +diff -NrU3 binutils-2.23.1/bfd/archures.c binutils-2.23.1-patched/bfd/archures.c +--- binutils-2.23.1/bfd/archures.c 2012-09-04 14:53:41.000000000 +0200 ++++ binutils-2.23.1-patched/bfd/archures.c 2019-04-11 22:51:02.981512599 +0200 @@ -175,6 +175,7 @@ .#define bfd_mach_mips_loongson_2f 3002 .#define bfd_mach_mips_loongson_3a 3003 .#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01 *} +.#define bfd_mach_mips_allegrex 10111431 {* octal 'AL', 31 *} .#define bfd_mach_mips_octeon 6501 - .#define bfd_mach_mips_xlr 887682 {* decimal 'XLR' *} - .#define bfd_mach_mipsisa32 32 -diff -burN orig.binutils-2.22/bfd/bfd-in2.h binutils-2.22/bfd/bfd-in2.h ---- orig.binutils-2.22/bfd/bfd-in2.h 2011-09-16 03:15:18.000000000 +0200 -+++ binutils-2.22/bfd/bfd-in2.h 2012-01-04 16:18:30.406282423 +0100 -@@ -1882,6 +1882,7 @@ + .#define bfd_mach_mips_octeonp 6601 + .#define bfd_mach_mips_octeon2 6502 +diff -NrU3 binutils-2.23.1/bfd/bfd-in2.h binutils-2.23.1-patched/bfd/bfd-in2.h +--- binutils-2.23.1/bfd/bfd-in2.h 2012-09-04 14:53:41.000000000 +0200 ++++ binutils-2.23.1-patched/bfd/bfd-in2.h 2019-04-11 22:51:02.985512583 +0200 +@@ -1904,6 +1904,7 @@ #define bfd_mach_mips_loongson_2f 3002 #define bfd_mach_mips_loongson_3a 3003 #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_allegrex 10111431 /* octal 'AL', 31 */ #define bfd_mach_mips_octeon 6501 - #define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ - #define bfd_mach_mipsisa32 32 -diff -burN orig.binutils-2.22/bfd/cpu-mips.c binutils-2.22/bfd/cpu-mips.c ---- orig.binutils-2.22/bfd/cpu-mips.c 2011-07-24 16:20:05.000000000 +0200 -+++ binutils-2.22/bfd/cpu-mips.c 2012-01-04 16:18:30.415282321 +0100 -@@ -89,6 +89,7 @@ + #define bfd_mach_mips_octeonp 6601 + #define bfd_mach_mips_octeon2 6502 +diff -NrU3 binutils-2.23.1/bfd/cpu-mips.c binutils-2.23.1-patched/bfd/cpu-mips.c +--- binutils-2.23.1/bfd/cpu-mips.c 2012-01-31 18:54:35.000000000 +0100 ++++ binutils-2.23.1-patched/bfd/cpu-mips.c 2019-04-11 22:51:02.985512583 +0200 +@@ -90,6 +90,7 @@ I_mipsisa64, I_mipsisa64r2, I_sb1, @@ -31,7 +31,7 @@ diff -burN orig.binutils-2.22/bfd/cpu-mips.c binutils-2.22/bfd/cpu-mips.c I_loongson_2e, I_loongson_2f, I_loongson_3a, -@@ -130,6 +131,7 @@ +@@ -133,6 +134,7 @@ N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)), N (64, 64, bfd_mach_mipsisa64r2,"mips:isa64r2", FALSE, NN(I_mipsisa64r2)), N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, NN(I_sb1)), @@ -39,10 +39,34 @@ diff -burN orig.binutils-2.22/bfd/cpu-mips.c binutils-2.22/bfd/cpu-mips.c N (64, 64, bfd_mach_mips_loongson_2e, "mips:loongson_2e", FALSE, NN(I_loongson_2e)), N (64, 64, bfd_mach_mips_loongson_2f, "mips:loongson_2f", FALSE, NN(I_loongson_2f)), N (64, 64, bfd_mach_mips_loongson_3a, "mips:loongson_3a", FALSE, NN(I_loongson_3a)), -diff -burN orig.binutils-2.22/bfd/elfxx-mips.c binutils-2.22/bfd/elfxx-mips.c ---- orig.binutils-2.22/bfd/elfxx-mips.c 2011-11-21 10:29:27.000000000 +0100 -+++ binutils-2.22/bfd/elfxx-mips.c 2012-01-04 16:34:40.245420280 +0100 -@@ -6173,14 +6173,19 @@ +diff -NrU3 binutils-2.23.1/bfd/doc/bfd.texinfo binutils-2.23.1-patched/bfd/doc/bfd.texinfo +--- binutils-2.23.1/bfd/doc/bfd.texinfo 2010-10-28 13:40:25.000000000 +0200 ++++ binutils-2.23.1-patched/bfd/doc/bfd.texinfo 2019-04-11 22:51:02.985512583 +0200 +@@ -321,9 +321,9 @@ + @unnumbered BFD Index + @printindex cp + ++@c I think something like @colophon should be in texinfo. In the ++@c meantime: + @tex +-% I think something like @colophon should be in texinfo. In the +-% meantime: + \long\def\colophon{\hbox to0pt{}\vfill + \centerline{The body of this manual is set in} + \centerline{\fontname\tenrm,} +@@ -333,7 +333,7 @@ + \centerline{{\sl\fontname\tensl\/}} + \centerline{are used for emphasis.}\vfill} + \page\colophon +-% Blame: doc@cygnus.com, 28mar91. + @end tex ++@c Blame: doc@cygnus.com, 28mar91. + + @bye +diff -NrU3 binutils-2.23.1/bfd/elfxx-mips.c binutils-2.23.1-patched/bfd/elfxx-mips.c +--- binutils-2.23.1/bfd/elfxx-mips.c 2012-09-04 16:19:46.000000000 +0200 ++++ binutils-2.23.1-patched/bfd/elfxx-mips.c 2019-04-11 22:51:02.985512583 +0200 +@@ -6275,14 +6275,19 @@ case E_MIPS_MACH_SB1: return bfd_mach_mips_sb1; @@ -60,9 +84,9 @@ diff -burN orig.binutils-2.22/bfd/elfxx-mips.c binutils-2.22/bfd/elfxx-mips.c return bfd_mach_mips_loongson_3a; + */ - case E_MIPS_MACH_OCTEON: - return bfd_mach_mips_octeon; -@@ -10882,6 +10887,10 @@ + case E_MIPS_MACH_OCTEON2: + return bfd_mach_mips_octeon2; +@@ -11031,6 +11036,10 @@ val = E_MIPS_ARCH_64 | E_MIPS_MACH_SB1; break; @@ -73,7 +97,7 @@ diff -burN orig.binutils-2.22/bfd/elfxx-mips.c binutils-2.22/bfd/elfxx-mips.c case bfd_mach_mips_loongson_3a: val = E_MIPS_ARCH_64 | E_MIPS_MACH_LS3A; break; -@@ -13544,6 +13553,7 @@ +@@ -13690,6 +13699,7 @@ /* MIPS II extensions. */ { bfd_mach_mips4000, bfd_mach_mips6000 }, { bfd_mach_mipsisa32, bfd_mach_mips6000 }, @@ -81,19 +105,10 @@ diff -burN orig.binutils-2.22/bfd/elfxx-mips.c binutils-2.22/bfd/elfxx-mips.c /* MIPS I extensions. */ { bfd_mach_mips6000, bfd_mach_mips3000 }, -diff -burN orig.binutils-2.22/bfd/version.h binutils-2.22/bfd/version.h ---- orig.binutils-2.22/bfd/version.h 2011-11-21 10:29:28.000000000 +0100 -+++ binutils-2.22/bfd/version.h 2012-01-04 16:18:30.454281876 +0100 -@@ -1,4 +1,4 @@ --#define BFD_VERSION_DATE 20111121 -+#define BFD_VERSION_DATE (PSNPT 20120103) - #define BFD_VERSION @bfd_version@ - #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ - #define REPORT_BUGS_TO @report_bugs_to@ -diff -burN orig.binutils-2.22/binutils/readelf.c binutils-2.22/binutils/readelf.c ---- orig.binutils-2.22/binutils/readelf.c 2011-09-21 22:49:13.000000000 +0200 -+++ binutils-2.22/binutils/readelf.c 2012-01-04 22:48:15.610613183 +0100 -@@ -2395,10 +2395,11 @@ +diff -NrU3 binutils-2.23.1/binutils/readelf.c binutils-2.23.1-patched/binutils/readelf.c +--- binutils-2.23.1/binutils/readelf.c 2012-11-05 17:27:35.000000000 +0100 ++++ binutils-2.23.1-patched/binutils/readelf.c 2019-04-11 22:51:02.985512583 +0200 +@@ -2431,10 +2431,11 @@ case E_MIPS_MACH_9000: strcat (buf, ", 9000"); break; case E_MIPS_MACH_LS2E: strcat (buf, ", loongson-2e"); break; case E_MIPS_MACH_LS2F: strcat (buf, ", loongson-2f"); break; @@ -106,10 +121,10 @@ diff -burN orig.binutils-2.22/binutils/readelf.c binutils-2.22/binutils/readelf. case 0: /* We simply ignore the field in this case to avoid confusion: MIPS ELF does not specify EF_MIPS_MACH, it is a GNU -diff -burN orig.binutils-2.22/config.sub binutils-2.22/config.sub ---- orig.binutils-2.22/config.sub 2011-06-06 12:36:06.000000000 +0200 -+++ binutils-2.22/config.sub 2012-01-04 22:48:59.316081182 +0100 -@@ -279,6 +279,7 @@ +diff -NrU3 binutils-2.23.1/config.sub binutils-2.23.1-patched/config.sub +--- binutils-2.23.1/config.sub 2012-04-25 17:53:25.000000000 +0200 ++++ binutils-2.23.1-patched/config.sub 2019-04-11 22:51:02.985512583 +0200 +@@ -292,6 +292,7 @@ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ @@ -117,7 +132,7 @@ diff -burN orig.binutils-2.22/config.sub binutils-2.22/config.sub | mn10200 | mn10300 \ | moxie \ | mt \ -@@ -389,6 +390,7 @@ +@@ -408,6 +409,7 @@ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ @@ -125,7 +140,7 @@ diff -burN orig.binutils-2.22/config.sub binutils-2.22/config.sub | mmix-* \ | mt-* \ | msp430-* \ -@@ -788,6 +790,10 @@ +@@ -806,6 +808,10 @@ basic_machine=m68k-atari os=-mint ;; @@ -136,10 +151,10 @@ diff -burN orig.binutils-2.22/config.sub binutils-2.22/config.sub mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; -diff -burN orig.binutils-2.22/configure binutils-2.22/configure ---- orig.binutils-2.22/configure 2011-08-14 14:28:15.000000000 +0200 -+++ binutils-2.22/configure 2012-01-04 16:18:36.756209883 +0100 -@@ -2667,7 +2667,7 @@ +diff -NrU3 binutils-2.23.1/configure binutils-2.23.1-patched/configure +--- binutils-2.23.1/configure 2012-06-28 13:50:52.000000000 +0200 ++++ binutils-2.23.1-patched/configure 2019-04-11 22:51:02.989512565 +0200 +@@ -2674,7 +2674,7 @@ # binutils, gas and ld appear in that order because it makes sense to run # "make check" in that particular order. # If --enable-gold is used, "gold" may replace "ld". @@ -148,7 +163,7 @@ diff -burN orig.binutils-2.22/configure binutils-2.22/configure # libgcj represents the runtime libraries only used by gcj. libgcj="target-libffi \ -@@ -3568,7 +3568,6 @@ +@@ -3593,7 +3593,6 @@ mips*-*-linux*) ;; mips*-*-*) @@ -156,9 +171,9 @@ diff -burN orig.binutils-2.22/configure binutils-2.22/configure ;; sh-*-* | sh64-*-*) case "${target}" in -diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-mips.c ---- orig.binutils-2.22/gas/config/tc-mips.c 2011-11-21 10:29:32.000000000 +0100 -+++ binutils-2.22/gas/config/tc-mips.c 2012-01-14 23:46:05.823744072 +0100 +diff -NrU3 binutils-2.23.1/gas/config/tc-mips.c binutils-2.23.1-patched/gas/config/tc-mips.c +--- binutils-2.23.1/gas/config/tc-mips.c 2012-09-04 16:21:03.000000000 +0200 ++++ binutils-2.23.1-patched/gas/config/tc-mips.c 2019-04-11 22:51:02.989512565 +0200 @@ -91,8 +91,32 @@ #define ZERO 0 @@ -192,7 +207,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m #define TREG 24 #define PIC_CALL_REG 25 #define KT0 26 -@@ -490,11 +514,14 @@ +@@ -493,11 +517,14 @@ /* Return true if the given CPU supports the microMIPS ASE. */ #define CPU_HAS_MICROMIPS(cpu) 0 @@ -206,9 +221,9 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m -#define CPU_HAS_ROR(CPU) CPU_HAS_DROR (CPU) +#define CPU_HAS_ROR(CPU) CPU_HAS_DROR (CPU) || CPU_IS_ALLEGREX (CPU) - /* True if CPU has seq/sne and seqi/snei instructions. */ - #define CPU_HAS_SEQ(CPU) ((CPU) == CPU_OCTEON) -@@ -528,6 +555,7 @@ + /* True if CPU is in the Octeon family */ + #define CPU_IS_OCTEON(CPU) ((CPU) == CPU_OCTEON || (CPU) == CPU_OCTEONP || (CPU) == CPU_OCTEON2) +@@ -529,6 +556,7 @@ || mips_opts.arch == CPU_R16000 \ || mips_opts.arch == CPU_RM7000 \ || mips_opts.arch == CPU_VR5500 \ @@ -216,7 +231,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m || mips_opts.micromips \ ) -@@ -1563,6 +1591,8 @@ +@@ -1559,6 +1587,8 @@ static expressionS imm_expr; static expressionS imm2_expr; static expressionS offset_expr; @@ -225,7 +240,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m /* Relocs associated with imm_expr and offset_expr. */ -@@ -1571,6 +1601,15 @@ +@@ -1567,6 +1597,15 @@ static bfd_reloc_code_real_type offset_reloc[3] = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED}; @@ -241,7 +256,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m /* This is set to the resulting size of the instruction to be produced by mips16_ip if an explicit extension is used or by mips_ip if an explicit size is supplied. */ -@@ -2580,6 +2619,56 @@ +@@ -2570,6 +2609,56 @@ return; } @@ -298,7 +313,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m if (insn.insn_mo->pinfo == INSN_MACRO) { macro_start (); -@@ -5085,6 +5174,55 @@ +@@ -5083,6 +5172,55 @@ } continue; @@ -354,7 +369,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m default: internalError (); } -@@ -6241,6 +6379,7 @@ +@@ -6239,6 +6377,7 @@ macro (struct mips_cl_insn *ip) { unsigned int treg, sreg, dreg, breg; @@ -362,7 +377,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m unsigned int tempreg; int mask; int used_at = 0; -@@ -6272,6 +6411,13 @@ +@@ -6271,6 +6410,13 @@ sreg = breg = EXTRACT_OPERAND (mips_opts.micromips, RS, *ip); mask = ip->insn_mo->mask; @@ -376,7 +391,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m label_expr.X_op = O_constant; label_expr.X_op_symbol = NULL; label_expr.X_add_symbol = NULL; -@@ -7964,6 +8110,34 @@ +@@ -7968,6 +8114,34 @@ /* Itbl support may require additional care here. */ coproc = 1; goto ld_st; @@ -411,7 +426,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m case M_LWL_AB: ab = 1; case M_LWL_OB: -@@ -8125,6 +8299,37 @@ +@@ -8129,6 +8303,37 @@ /* Itbl support may require additional care here. */ coproc = 1; goto ld_st; @@ -449,7 +464,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m case M_SWL_AB: ab = 1; case M_SWL_OB: -@@ -8654,6 +8859,138 @@ +@@ -8661,6 +8866,138 @@ break; } @@ -588,7 +603,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m case M_LI_D: /* Check if we have a constant in IMM_EXPR. If the GPRs are 64 bits wide, IMM_EXPR is the entire value. Otherwise IMM_EXPR is the high -@@ -9164,6 +9501,27 @@ +@@ -9179,6 +9516,27 @@ move_register (dreg, sreg); break; @@ -616,7 +631,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m case M_DMUL: dbl = 1; case M_MUL: -@@ -9779,6 +10137,40 @@ +@@ -9794,6 +10152,40 @@ off12 = mips_opts.micromips; off = 3; goto uld_st; @@ -657,7 +672,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m case M_ULD_A: ab = 1; case M_ULD: -@@ -9804,6 +10196,56 @@ +@@ -9819,6 +10211,56 @@ off = 3; ust = 1; goto uld_st; @@ -714,7 +729,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m case M_USD_A: ab = 1; case M_USD: -@@ -10279,6 +10721,103 @@ +@@ -10294,6 +10736,103 @@ case '%': USE_BITS (OP_MASK_VECALIGN, OP_SH_VECALIGN); break; case '[': break; case ']': break; @@ -818,7 +833,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m case '1': USE_BITS (OP_MASK_SHAMT, OP_SH_SHAMT); break; case '2': USE_BITS (OP_MASK_BP, OP_SH_BP); break; case '3': USE_BITS (OP_MASK_SA3, OP_SH_SA3); break; -@@ -10585,7 +11124,7 @@ +@@ -10610,7 +11149,7 @@ char c = 0; struct mips_opcode *insn; char *argsStart; @@ -827,7 +842,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m unsigned int lastregno; unsigned int destregno = 0; unsigned int lastpos = 0; -@@ -10598,6 +11137,9 @@ +@@ -10623,6 +11162,9 @@ unsigned int rtype; char *dot; long end; @@ -837,7 +852,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m insn_error = NULL; -@@ -11683,6 +12225,1151 @@ +@@ -11755,6 +12297,1151 @@ case 'y': /* ALNV.PS source register. */ gas_assert (mips_opts.micromips); goto do_reg; @@ -1989,7 +2004,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m case 'x': /* Ignore register name. */ case 'U': /* Destination register (CLO/CLZ). */ case 'g': /* Coprocessor destination register. */ -@@ -11877,6 +13564,7 @@ +@@ -11949,6 +13636,7 @@ { if ((regno & 1) != 0 && HAVE_32BIT_FPRS @@ -1997,25 +2012,7 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m && !mips_oddfpreg_ok (ip->insn_mo, argnum)) as_warn (_("Float register should be even, was %d"), regno); -@@ -18227,7 +19915,7 @@ - | RELAX_DELAY_SLOT_SIZE_SECOND); - msg = macro_warning (s); - if (msg != NULL) -- as_warn_where (fragp->fr_file, fragp->fr_line, msg); -+ as_warn_where (fragp->fr_file, fragp->fr_line, "%s", msg); - subtype &= ~s; - } - -@@ -18241,7 +19929,7 @@ - & (RELAX_SECOND_LONGER | RELAX_NOMACRO | RELAX_DELAY_SLOT)); - msg = macro_warning (s); - if (msg != NULL) -- as_warn_where (fragp->fr_file, fragp->fr_line, msg); -+ as_warn_where (fragp->fr_file, fragp->fr_line, "%s", msg); - subtype &= ~s; - } - -@@ -18913,6 +20601,8 @@ +@@ -19045,6 +20733,8 @@ /* MIPS II */ { "r6000", 0, ISA_MIPS2, CPU_R6000 }, @@ -2024,10 +2021,10 @@ diff -burN orig.binutils-2.22/gas/config/tc-mips.c binutils-2.22/gas/config/tc-m /* MIPS III */ { "r4000", 0, ISA_MIPS3, CPU_R4000 }, -diff -burN orig.binutils-2.22/gas/configure binutils-2.22/gas/configure ---- orig.binutils-2.22/gas/configure 2011-05-18 11:41:14.000000000 +0200 -+++ binutils-2.22/gas/configure 2012-01-04 16:18:36.289215219 +0100 -@@ -12043,6 +12043,9 @@ +diff -NrU3 binutils-2.23.1/gas/configure binutils-2.23.1-patched/gas/configure +--- binutils-2.23.1/gas/configure 2012-06-18 06:43:06.000000000 +0200 ++++ binutils-2.23.1-patched/gas/configure 2019-04-11 22:51:02.989512565 +0200 +@@ -12046,6 +12046,9 @@ mips64vr | mips64vrel) mips_cpu=vr4100 ;; @@ -2037,10 +2034,10 @@ diff -burN orig.binutils-2.22/gas/configure binutils-2.22/gas/configure mipsisa32r2* | mipsisa64r2*) mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'` ;; -diff -burN orig.binutils-2.22/gas/configure.in binutils-2.22/gas/configure.in ---- orig.binutils-2.22/gas/configure.in 2011-05-18 11:41:14.000000000 +0200 -+++ binutils-2.22/gas/configure.in 2012-01-04 16:18:36.289215219 +0100 -@@ -213,6 +213,9 @@ +diff -NrU3 binutils-2.23.1/gas/configure.in binutils-2.23.1-patched/gas/configure.in +--- binutils-2.23.1/gas/configure.in 2012-11-05 17:27:44.000000000 +0100 ++++ binutils-2.23.1-patched/gas/configure.in 2019-04-11 22:51:02.993512548 +0200 +@@ -222,6 +222,9 @@ mips64vr | mips64vrel) mips_cpu=vr4100 ;; @@ -2050,10 +2047,10 @@ diff -burN orig.binutils-2.22/gas/configure.in binutils-2.22/gas/configure.in mipsisa32r2* | mipsisa64r2*) changequote(,)dnl mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'` -diff -burN orig.binutils-2.22/gas/testsuite/gas/mips/mips.exp binutils-2.22/gas/testsuite/gas/mips/mips.exp ---- orig.binutils-2.22/gas/testsuite/gas/mips/mips.exp 2011-11-21 10:29:32.000000000 +0100 -+++ binutils-2.22/gas/testsuite/gas/mips/mips.exp 2012-01-04 16:18:34.940230631 +0100 -@@ -409,6 +409,9 @@ +diff -NrU3 binutils-2.23.1/gas/testsuite/gas/mips/mips.exp binutils-2.23.1-patched/gas/testsuite/gas/mips/mips.exp +--- binutils-2.23.1/gas/testsuite/gas/mips/mips.exp 2012-09-04 16:17:13.000000000 +0200 ++++ binutils-2.23.1-patched/gas/testsuite/gas/mips/mips.exp 2019-04-11 22:51:02.993512548 +0200 +@@ -432,6 +432,9 @@ mips_arch_create sb1 64 mips64 { mips3d } \ { -march=sb1 -mtune=sb1 } { -mmips:sb1 } \ { mipsisa64sb1-*-* mipsisa64sb1el-*-* } @@ -2063,9 +2060,9 @@ diff -burN orig.binutils-2.22/gas/testsuite/gas/mips/mips.exp binutils-2.22/gas/ mips_arch_create octeon 64 mips64r2 {} \ { -march=octeon -mtune=octeon } { -mmips:octeon } \ { mips64octeon*-*-* } -diff -burN orig.binutils-2.22/include/elf/common.h binutils-2.22/include/elf/common.h ---- orig.binutils-2.22/include/elf/common.h 2011-07-22 22:22:36.000000000 +0200 -+++ binutils-2.22/include/elf/common.h 2012-01-04 16:18:36.333214716 +0100 +diff -NrU3 binutils-2.23.1/include/elf/common.h binutils-2.23.1-patched/include/elf/common.h +--- binutils-2.23.1/include/elf/common.h 2012-09-04 14:53:47.000000000 +0200 ++++ binutils-2.23.1-patched/include/elf/common.h 2019-04-11 22:51:02.993512548 +0200 @@ -96,6 +96,7 @@ #define ET_HIOS 0xFEFF /* Operating system-specific */ #define ET_LOPROC 0xFF00 /* Processor-specific */ @@ -2074,10 +2071,10 @@ diff -burN orig.binutils-2.22/include/elf/common.h binutils-2.22/include/elf/com /* Values for e_machine, which identifies the architecture. These numbers are officially assigned by registry@sco.com. See below for a list of -diff -burN orig.binutils-2.22/include/elf/mips.h binutils-2.22/include/elf/mips.h ---- orig.binutils-2.22/include/elf/mips.h 2011-07-24 16:20:12.000000000 +0200 -+++ binutils-2.22/include/elf/mips.h 2012-01-04 16:32:22.726926151 +0100 -@@ -265,6 +265,7 @@ +diff -NrU3 binutils-2.23.1/include/elf/mips.h binutils-2.23.1-patched/include/elf/mips.h +--- binutils-2.23.1/include/elf/mips.h 2011-12-19 08:58:02.000000000 +0100 ++++ binutils-2.23.1-patched/include/elf/mips.h 2019-04-11 22:51:02.993512548 +0200 +@@ -272,6 +272,7 @@ #define E_MIPS_MACH_5400 0x00910000 #define E_MIPS_MACH_5500 0x00980000 #define E_MIPS_MACH_9000 0x00990000 @@ -2085,10 +2082,10 @@ diff -burN orig.binutils-2.22/include/elf/mips.h binutils-2.22/include/elf/mips. #define E_MIPS_MACH_LS2E 0x00A00000 #define E_MIPS_MACH_LS2F 0x00A10000 #define E_MIPS_MACH_LS3A 0x00A20000 -diff -burN orig.binutils-2.22/include/opcode/mips.h binutils-2.22/include/opcode/mips.h ---- orig.binutils-2.22/include/opcode/mips.h 2011-08-09 17:20:03.000000000 +0200 -+++ binutils-2.22/include/opcode/mips.h 2012-01-04 16:18:36.338214659 +0100 -@@ -216,6 +216,228 @@ +diff -NrU3 binutils-2.23.1/include/opcode/mips.h binutils-2.23.1-patched/include/opcode/mips.h +--- binutils-2.23.1/include/opcode/mips.h 2012-09-04 16:21:05.000000000 +0200 ++++ binutils-2.23.1-patched/include/opcode/mips.h 2019-04-11 22:51:02.993512548 +0200 +@@ -218,6 +218,228 @@ #define MDMX_FMTSEL_VEC_QH 0x15 #define MDMX_FMTSEL_VEC_OB 0x16 @@ -2317,7 +2314,7 @@ diff -burN orig.binutils-2.22/include/opcode/mips.h binutils-2.22/include/opcode /* UDI */ #define OP_SH_UDI1 6 #define OP_MASK_UDI1 0x1f -@@ -416,6 +638,29 @@ +@@ -421,6 +643,29 @@ Requires that "+A" or "+E" occur first to set position. Enforces: 32 < (pos+size) <= 64. @@ -2347,7 +2344,7 @@ diff -burN orig.binutils-2.22/include/opcode/mips.h binutils-2.22/include/opcode Floating point instructions: "D" 5 bit destination register (OP_*_FD) "M" 3 bit compare condition code (OP_*_CCC) (only used for mips4 and up) -@@ -750,6 +995,8 @@ +@@ -757,6 +1002,8 @@ #define INSN_5400 0x01000000 /* NEC VR5500 instruction. */ #define INSN_5500 0x02000000 @@ -2356,7 +2353,7 @@ diff -burN orig.binutils-2.22/include/opcode/mips.h binutils-2.22/include/opcode /* MDMX ASE */ #define INSN_MDMX 0x04000000 -@@ -819,6 +1066,7 @@ +@@ -826,12 +1073,13 @@ #define CPU_MIPS64 64 #define CPU_MIPS64R2 65 #define CPU_SB1 12310201 /* octal 'SB', 01. */ @@ -2364,15 +2361,25 @@ diff -burN orig.binutils-2.22/include/opcode/mips.h binutils-2.22/include/opcode #define CPU_LOONGSON_2E 3001 #define CPU_LOONGSON_2F 3002 #define CPU_LOONGSON_3A 3003 -@@ -851,6 +1099,7 @@ - || (cpu == CPU_VR4120 && ((insn)->membership & INSN_4120) != 0) \ - || (cpu == CPU_VR5400 && ((insn)->membership & INSN_5400) != 0) \ - || (cpu == CPU_VR5500 && ((insn)->membership & INSN_5500) != 0) \ -+ || (cpu == CPU_ALLEGREX && ((insn)->membership & INSN_ALLEGREX) != 0) \ - || (cpu == CPU_LOONGSON_2E \ - && ((insn)->membership & INSN_LOONGSON_2E) != 0) \ - || (cpu == CPU_LOONGSON_2F \ -@@ -1005,11 +1254,27 @@ + #define CPU_OCTEON 6501 +-#define CPU_OCTEONP 6601 +-#define CPU_OCTEON2 6502 ++#define CPU_OCTEONP 6601 ++#define CPU_OCTEON2 6502 + #define CPU_XLR 887682 /* decimal 'XLR' */ + + /* Return true if the given CPU is included in INSN_* mask MASK. */ +@@ -876,6 +1124,9 @@ + case CPU_VR5500: + return (mask & INSN_5500) != 0; + ++ case CPU_ALLEGREX: ++ return (mask & INSN_ALLEGREX) != 0; ++ + case CPU_LOONGSON_2E: + return (mask & INSN_LOONGSON_2E) != 0; + +@@ -1074,11 +1325,27 @@ M_LI_DD, M_LI_S, M_LI_SS, @@ -2400,7 +2407,7 @@ diff -burN orig.binutils-2.22/include/opcode/mips.h binutils-2.22/include/opcode M_LW_A, M_LW_AB, M_LWC0_A, -@@ -1021,6 +1286,7 @@ +@@ -1090,6 +1357,7 @@ M_LWC2_OB, M_LWC3_A, M_LWC3_AB, @@ -2408,7 +2415,7 @@ diff -burN orig.binutils-2.22/include/opcode/mips.h binutils-2.22/include/opcode M_LWL_A, M_LWL_AB, M_LWL_OB, -@@ -1130,6 +1396,10 @@ +@@ -1203,6 +1471,10 @@ M_SUB_I, M_SUBU_I, M_SUBU_I_2, @@ -2419,7 +2426,7 @@ diff -burN orig.binutils-2.22/include/opcode/mips.h binutils-2.22/include/opcode M_TEQ_I, M_TGE_I, M_TGEU_I, -@@ -1144,14 +1414,24 @@ +@@ -1217,14 +1489,24 @@ M_ULH_A, M_ULHU, M_ULHU_A, @@ -2444,9 +2451,9 @@ diff -burN orig.binutils-2.22/include/opcode/mips.h binutils-2.22/include/opcode M_XOR_I, M_COP0, M_COP1, -diff -burN orig.binutils-2.22/include/opcode/vfpu.h binutils-2.22/include/opcode/vfpu.h ---- orig.binutils-2.22/include/opcode/vfpu.h 1970-01-01 01:00:00.000000000 +0100 -+++ binutils-2.22/include/opcode/vfpu.h 2012-01-04 16:18:36.338214659 +0100 +diff -NrU3 binutils-2.23.1/include/opcode/vfpu.h binutils-2.23.1-patched/include/opcode/vfpu.h +--- binutils-2.23.1/include/opcode/vfpu.h 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.23.1-patched/include/opcode/vfpu.h 2019-04-11 22:51:02.993512548 +0200 @@ -0,0 +1,261 @@ +#ifndef _VFPU_H_ +#define _VFPU_H_ @@ -2709,10 +2716,10 @@ diff -burN orig.binutils-2.22/include/opcode/vfpu.h binutils-2.22/include/opcode +#define VFPU_MASK_SYNC 0xffff0000 + +#endif /* _VFPU_H_ */ -diff -burN orig.binutils-2.22/ld/configure.tgt binutils-2.22/ld/configure.tgt ---- orig.binutils-2.22/ld/configure.tgt 2011-11-21 10:29:37.000000000 +0100 -+++ binutils-2.22/ld/configure.tgt 2012-01-04 16:18:36.578211917 +0100 -@@ -383,6 +383,8 @@ +diff -NrU3 binutils-2.23.1/ld/configure.tgt binutils-2.23.1-patched/ld/configure.tgt +--- binutils-2.23.1/ld/configure.tgt 2012-09-04 14:53:47.000000000 +0200 ++++ binutils-2.23.1-patched/ld/configure.tgt 2019-04-11 22:51:02.993512548 +0200 +@@ -422,6 +422,8 @@ mips*vr4100-*-elf*) targ_emul=elf32b4300 ;; mips*vr5000el-*-elf*) targ_emul=elf32l4300 ;; mips*vr5000-*-elf*) targ_emul=elf32b4300 ;; @@ -2721,9 +2728,9 @@ diff -burN orig.binutils-2.22/ld/configure.tgt binutils-2.22/ld/configure.tgt mips*el-sde-elf*) targ_emul=elf32ltsmip targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" ;; mips*-sde-elf*) targ_emul=elf32btsmip -diff -burN orig.binutils-2.22/ld/emulparams/elf_mipsallegrexel_psp.sh binutils-2.22/ld/emulparams/elf_mipsallegrexel_psp.sh ---- orig.binutils-2.22/ld/emulparams/elf_mipsallegrexel_psp.sh 1970-01-01 01:00:00.000000000 +0100 -+++ binutils-2.22/ld/emulparams/elf_mipsallegrexel_psp.sh 2012-01-04 16:18:36.368214315 +0100 +diff -NrU3 binutils-2.23.1/ld/emulparams/elf_mipsallegrexel_psp.sh binutils-2.23.1-patched/ld/emulparams/elf_mipsallegrexel_psp.sh +--- binutils-2.23.1/ld/emulparams/elf_mipsallegrexel_psp.sh 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.23.1-patched/ld/emulparams/elf_mipsallegrexel_psp.sh 2019-04-11 22:51:02.993512548 +0200 @@ -0,0 +1,22 @@ +# Based off of the default elf32 MIPS target. However, we use a seperate +# script template because the PSP architecture defines sections that normally @@ -2747,18 +2754,18 @@ diff -burN orig.binutils-2.22/ld/emulparams/elf_mipsallegrexel_psp.sh binutils-2 + +# Discard the .comment and .pdr sections. +OTHER_SECTIONS="/DISCARD/ : { *(.comment) *(.pdr) }" -diff -burN orig.binutils-2.22/ld/Makefile.am binutils-2.22/ld/Makefile.am ---- orig.binutils-2.22/ld/Makefile.am 2011-07-22 22:22:37.000000000 +0200 -+++ binutils-2.22/ld/Makefile.am 2012-01-04 17:02:20.728460268 +0100 -@@ -262,6 +262,7 @@ - eelf_i386_ldso.c \ +diff -NrU3 binutils-2.23.1/ld/Makefile.am binutils-2.23.1-patched/ld/Makefile.am +--- binutils-2.23.1/ld/Makefile.am 2012-09-04 14:53:47.000000000 +0200 ++++ binutils-2.23.1-patched/ld/Makefile.am 2019-04-11 22:51:02.993512548 +0200 +@@ -268,6 +268,7 @@ + eelf_i386_nacl.c \ eelf_i386_sol2.c \ eelf_i386_vxworks.c \ + eelf_mipsallegrexel_psp.o \ eelf_s390.c \ egld960.c \ egld960coff.c \ -@@ -1196,6 +1197,9 @@ +@@ -1240,6 +1241,9 @@ $(srcdir)/emulparams/vxworks.sh $(srcdir)/emultempl/vxworks.em \ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_i386_vxworks "$(tdir_elf_i386_vxworks)" @@ -2768,18 +2775,18 @@ diff -burN orig.binutils-2.22/ld/Makefile.am binutils-2.22/ld/Makefile.am eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)" -diff -burN orig.binutils-2.22/ld/Makefile.in binutils-2.22/ld/Makefile.in ---- orig.binutils-2.22/ld/Makefile.in 2011-07-22 22:22:37.000000000 +0200 -+++ binutils-2.22/ld/Makefile.in 2012-01-04 17:02:25.531403806 +0100 -@@ -568,6 +568,7 @@ - eelf_i386_ldso.c \ +diff -NrU3 binutils-2.23.1/ld/Makefile.in binutils-2.23.1-patched/ld/Makefile.in +--- binutils-2.23.1/ld/Makefile.in 2012-09-04 14:53:47.000000000 +0200 ++++ binutils-2.23.1-patched/ld/Makefile.in 2019-04-11 22:51:02.993512548 +0200 +@@ -575,6 +575,7 @@ + eelf_i386_nacl.c \ eelf_i386_sol2.c \ eelf_i386_vxworks.c \ + eelf_mipsallegrexel_psp.o \ eelf_s390.c \ egld960.c \ egld960coff.c \ -@@ -2649,6 +2650,9 @@ +@@ -2710,6 +2711,9 @@ $(srcdir)/emulparams/vxworks.sh $(srcdir)/emultempl/vxworks.em \ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_i386_vxworks "$(tdir_elf_i386_vxworks)" @@ -2789,9 +2796,9 @@ diff -burN orig.binutils-2.22/ld/Makefile.in binutils-2.22/ld/Makefile.in eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)" -diff -burN orig.binutils-2.22/ld/scripttempl/elf_psp.sc binutils-2.22/ld/scripttempl/elf_psp.sc ---- orig.binutils-2.22/ld/scripttempl/elf_psp.sc 1970-01-01 01:00:00.000000000 +0100 -+++ binutils-2.22/ld/scripttempl/elf_psp.sc 2012-01-04 16:18:36.380214179 +0100 +diff -NrU3 binutils-2.23.1/ld/scripttempl/elf_psp.sc binutils-2.23.1-patched/ld/scripttempl/elf_psp.sc +--- binutils-2.23.1/ld/scripttempl/elf_psp.sc 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.23.1-patched/ld/scripttempl/elf_psp.sc 2019-04-11 22:51:02.993512548 +0200 @@ -0,0 +1,496 @@ +# +# Unusual variables checked by this code: @@ -3289,9 +3296,9 @@ diff -burN orig.binutils-2.22/ld/scripttempl/elf_psp.sc binutils-2.22/ld/scriptt + ${RELOCATING+${STACKNOTE}} +} +EOF -diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis.c ---- orig.binutils-2.22/opcodes/mips-dis.c 2011-08-09 17:20:03.000000000 +0200 -+++ binutils-2.22/opcodes/mips-dis.c 2012-01-04 16:18:36.745210009 +0100 +diff -NrU3 binutils-2.23.1/opcodes/mips-dis.c binutils-2.23.1-patched/opcodes/mips-dis.c +--- binutils-2.23.1/opcodes/mips-dis.c 2012-09-04 16:23:13.000000000 +0200 ++++ binutils-2.23.1-patched/opcodes/mips-dis.c 2019-04-11 22:51:41.193350688 +0200 @@ -245,6 +245,139 @@ "c0_taglo", "c0_taghi", "c0_errorepc", "c0_desave", }; @@ -3496,8 +3503,17 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. /* For stock MIPS32, disassemble all applicable MIPS-specified ASEs. Note that MIPS-3D and MDMX are not applicable to MIPS32. (See -@@ -1479,6 +1662,349 @@ - (l >> OP_SH_FT) & OP_MASK_FT); +@@ -938,7 +1121,7 @@ + const fprintf_ftype infprintf = info->fprintf_func; + unsigned int lsb, msb, msbd; + void *is = info->stream; +- int op; ++ int delta, op; + + lsb = 0; + +@@ -1406,6 +1589,349 @@ + infprintf (is, "$v%d", GET_OP (l, FT)); break; + case '?': @@ -3507,15 +3523,15 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. + { + case '\0': + /* xgettext:c-format */ -+ (*info->fprintf_func) (info->stream, ++ infprintf (is, + _("# internal error, incomplete VFPU extension sequence (?)")); + return; + + case 'o': + delta = (l >> OP_SH_VFPU_DELTA) & OP_MASK_VFPU_DELTA; + if (delta & 0x8000) -+ delta |= ~0xffff; -+ (*info->fprintf_func) (info->stream, "%d", ++ delta |= ~0xffff; ++ infprintf (is, "%d", + delta); + break; + @@ -3532,19 +3548,19 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. + unsigned int swz_constlo = (l >> ((pos - base) * 2)) & VFPU_MASK_PFX_SWZ_CSTLO; + + if (negation) -+ (*info->fprintf_func) (info->stream, "-"); ++ infprintf (is, "-"); + if (constant) + { -+ (*info->fprintf_func) (info->stream, "%s", ++ infprintf (is, "%s", + pfx_cst_names[(abs_consthi << 2) | swz_constlo]); + } + else + { + if (abs_consthi) -+ (*info->fprintf_func) (info->stream, "|%s|", ++ infprintf (is, "|%s|", + pfx_swz_names[swz_constlo]); + else -+ (*info->fprintf_func) (info->stream, "%s", ++ infprintf (is, "%s", + pfx_swz_names[swz_constlo]); + } + } @@ -3560,9 +3576,9 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. + unsigned int saturation = (l >> ((pos - base) * 2)) & VFPU_MASK_PFX_SAT; + + if (mask) -+ (*info->fprintf_func) (info->stream, "m"); ++ infprintf (is, "m"); + else -+ (*info->fprintf_func) (info->stream, "%s", ++ infprintf (is, "%s", + pfx_sat_names[saturation]); + } + break; @@ -3572,7 +3588,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. + unsigned int c = (l >> OP_SH_VFPU_CONST) & OP_MASK_VFPU_CONST; + if (c < vfpu_num_constants) + { -+ (*info->fprintf_func) (info->stream, "%s", ++ infprintf (is, "%s", + vfpu_const_names[c]); + } + break; @@ -3580,25 +3596,25 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. + + case 'b': + /* 5-bit immediate value. */ -+ (*info->fprintf_func) (info->stream, "%d", ++ infprintf (is, "%d", + (l >> OP_SH_VFPU_IMM5) & OP_MASK_VFPU_IMM5); + break; + + case 'c': + /* VFPU condition code. */ -+ (*info->fprintf_func) (info->stream, "%d", ++ infprintf (is, "%d", + (l >> OP_SH_VFPU_CC) & OP_MASK_VFPU_CC); + break; + + case 'e': + /* 3-bit immediate value. */ -+ (*info->fprintf_func) (info->stream, "%d", ++ infprintf (is, "%d", + (l >> OP_SH_VFPU_IMM3) & OP_MASK_VFPU_IMM3); + break; + + case 'f': + /* Conditional compare. */ -+ (*info->fprintf_func) (info->stream, "%s", ++ infprintf (is, "%s", + vfpu_cond_names[(l >> OP_SH_VFPU_COND) & OP_MASK_VFPU_COND]); + /* Apparently this specifier is unused. */ + d++; @@ -3606,19 +3622,19 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. + + case 'i': + /* 8-bit immediate value. */ -+ (*info->fprintf_func) (info->stream, "0x%02x", ++ infprintf (is, "0x%02x", + (l >> OP_SH_VFPU_IMM8) & OP_MASK_VFPU_IMM8); + break; + + case 'q': + /* VFPU control register (vmtvc). */ -+ (*info->fprintf_func) (info->stream, "$%d", ++ infprintf (is, "$%d", + (l >> OP_SH_VFPU_VMTVC) & OP_MASK_VFPU_VMTVC); + break; + + case 'r': + /* VFPU control register (vmfvc). */ -+ (*info->fprintf_func) (info->stream, "$%d", ++ infprintf (is, "$%d", + (l >> OP_SH_VFPU_VMFVC) & OP_MASK_VFPU_VMFVC); + break; + @@ -3638,13 +3654,13 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. + if (exponent == VFPU_FLOAT16_EXP_MAX) + { + if (fraction == 0) -+ (*info->fprintf_func) (info->stream, "%cInf", signchar); ++ infprintf (is, "%cInf", signchar); + else -+ (*info->fprintf_func) (info->stream, "%cNaN", signchar); ++ infprintf (is, "%cNaN", signchar); + } + else if (exponent == 0 && fraction == 0) + { -+ (*info->fprintf_func) (info->stream, "%c0", signchar); ++ infprintf (is, "%c0", signchar); + } + else + { @@ -3664,7 +3680,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. + float2int.i = sign << 31; + float2int.i |= (exponent + 112) << 23; + float2int.i |= fraction << 13; -+ (*info->fprintf_func) (info->stream, "%g", float2int.f); ++ infprintf (is, "%g", float2int.f); + } + } + break; @@ -3718,17 +3734,17 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. + elements[rothi] = "s"; + elements[rotlo] = "c"; + -+ (*info->fprintf_func) (info->stream, "["); ++ infprintf (is, "["); + i = 0; + for (;;) + { -+ (*info->fprintf_func) (info->stream, "%s", ++ infprintf (is, "%s", + elements[i++]); + if (i >= opsize) + break; -+ (*info->fprintf_func) (info->stream, ","); ++ infprintf (is, ","); + } -+ (*info->fprintf_func) (info->stream, "]"); ++ infprintf (is, "]"); + } + break; + @@ -3789,43 +3805,43 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. + switch (*d) + { + case '0': -+ (*info->fprintf_func) (info->stream, "%s.s", ++ infprintf (is, "%s.s", + vfpu_sreg_names[vreg]); + break; + + case '1': -+ (*info->fprintf_func) (info->stream, "%s.p", ++ infprintf (is, "%s.p", + vfpu_vpreg_names[vreg]); + break; + + case '2': -+ (*info->fprintf_func) (info->stream, "%s.t", ++ infprintf (is, "%s.t", + vfpu_vtreg_names[vreg]); + break; + + case '3': -+ (*info->fprintf_func) (info->stream, "%s.q", ++ infprintf (is, "%s.q", + vfpu_vqreg_names[vreg]); + break; + + case '5': -+ (*info->fprintf_func) (info->stream, "%s.p", ++ infprintf (is, "%s.p", + vfpu_mpreg_names[vreg]); + break; + + case '6': -+ (*info->fprintf_func) (info->stream, "%s.t", ++ infprintf (is, "%s.t", + vfpu_mtreg_names[vreg]); + break; + + case '7': -+ (*info->fprintf_func) (info->stream, "%s.q", ++ infprintf (is, "%s.q", + vfpu_mqreg_names[vreg]); + break; + + default: + /* xgettext:c-format */ -+ (*info->fprintf_func) (info->stream, ++ infprintf (is, + _("# internal error, undefined vreg modifier(%c)"), + *d); + break; @@ -3837,7 +3853,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. + break; + + case 'z': -+ (*info->fprintf_func) (info->stream, "%s", ++ infprintf (is, "%s", + vfpu_rwb_names[(l >> OP_SH_VFPU_RWB) & OP_MASK_VFPU_RWB]); + break; + } @@ -3845,19 +3861,24 @@ diff -burN orig.binutils-2.22/opcodes/mips-dis.c binutils-2.22/opcodes/mips-dis. + default: /* xgettext:c-format */ - (*info->fprintf_func) (info->stream, -diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc.c ---- orig.binutils-2.22/opcodes/mips-opc.c 2011-08-09 17:20:03.000000000 +0200 -+++ binutils-2.22/opcodes/mips-opc.c 2012-01-12 22:06:52.133470527 +0100 -@@ -121,6 +121,7 @@ + infprintf (is, _("# internal error, undefined modifier (%c)"), *d); +diff -NrU3 binutils-2.23.1/opcodes/mips-opc.c binutils-2.23.1-patched/opcodes/mips-opc.c +--- binutils-2.23.1/opcodes/mips-opc.c 2012-09-04 16:21:10.000000000 +0200 ++++ binutils-2.23.1-patched/opcodes/mips-opc.c 2019-04-11 22:51:02.993512548 +0200 +@@ -122,9 +122,10 @@ #define N5 (INSN_5400 | INSN_5500) #define N54 INSN_5400 #define N55 INSN_5500 -+#define AL INSN_ALLEGREX - #define IOCT INSN_OCTEON ++#define AL INSN_ALLEGREX + #define IOCT (INSN_OCTEON | INSN_OCTEONP | INSN_OCTEON2) +-#define IOCTP (INSN_OCTEONP | INSN_OCTEON2) +-#define IOCT2 INSN_OCTEON2 ++#define IOCTP (INSN_OCTEONP | INSN_OCTEON2) ++#define IOCT2 (INSN_OCTEON2) #define XLR INSN_XLR -@@ -402,6 +403,7 @@ + #define G1 (T3 \ +@@ -405,6 +406,7 @@ {"bnel", "s,t,p", 0x54000000, 0xfc000000, CBL|RD_s|RD_t, 0, I2|T3 }, {"bnel", "s,I,p", 0, (int) M_BNEL_I, INSN_MACRO, 0, I2|T3 }, {"break", "", 0x0000000d, 0xffffffff, TRAP, 0, I1 }, @@ -3865,7 +3886,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"break", "c", 0x0000000d, 0xfc00ffff, TRAP, 0, I1 }, {"break", "c,q", 0x0000000d, 0xfc00003f, TRAP, 0, I1 }, {"c.f.d", "S,T", 0x46200030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 }, -@@ -584,7 +586,7 @@ +@@ -587,7 +589,7 @@ {"flushd", "", 0xbc020000, 0xffffffff, 0, 0, L1 }, {"flushid", "", 0xbc030000, 0xffffffff, 0, 0, L1 }, {"wb", "o(b)", 0xbc040000, 0xfc1f0000, SM|RD_b, 0, L1 }, @@ -3874,17 +3895,17 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"cache", "k,A(b)", 0, (int) M_CACHE_AB, INSN_MACRO, 0, I3_32|T3}, {"ceil.l.d", "D,S", 0x4620000a, 0xffff003f, WR_D|RD_S|FP_D, 0, I3_33 }, {"ceil.l.s", "D,S", 0x4600000a, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3_33 }, -@@ -602,7 +604,9 @@ +@@ -605,7 +607,9 @@ {"cins", "t,r,+P,+S",0x70000033, 0xfc00003f, WR_t|RD_s, 0, IOCT }, /* cins32 */ {"cins", "t,r,+p,+s",0x70000032, 0xfc00003f, WR_t|RD_s, 0, IOCT }, {"clo", "U,s", 0x70000021, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 }, +{"clo", "d,s", 0x00000017, 0xfc1f07ff, WR_d|RD_s, 0, AL }, {"clz", "U,s", 0x70000020, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 }, +{"clz", "d,s", 0x00000016, 0xfc1f07ff, WR_d|RD_s, 0, AL }, - {"ctc0", "t,G", 0x40c00000, 0xffe007ff, COD|RD_t|WR_CC, 0, I1 }, + {"ctc0", "t,G", 0x40c00000, 0xffe007ff, COD|RD_t|WR_CC, 0, I1, IOCT|IOCTP|IOCT2 }, {"ctc1", "t,G", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 }, {"ctc1", "t,S", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 }, -@@ -627,16 +631,16 @@ +@@ -630,16 +634,16 @@ {"cvt.ps.s","D,V,T", 0x46000026, 0xffe0003f, WR_D|RD_S|RD_T|FP_S|FP_D, 0, I5_33 }, {"cvt.pw.ps", "D,S", 0x46c00024, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, M3D }, {"dabs", "d,v", 0, (int) M_DABS, INSN_MACRO, 0, I3 }, @@ -3904,7 +3925,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"dclo", "U,s", 0x70000025, 0xfc0007ff, RD_s|WR_d|WR_t, 0, I64|N55 }, {"dclz", "U,s", 0x70000024, 0xfc0007ff, RD_s|WR_d|WR_t, 0, I64|N55 }, /* dctr and dctw are used on the r5000. */ -@@ -725,7 +729,7 @@ +@@ -728,7 +732,7 @@ {"dremu", "z,s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I3 }, {"dremu", "d,v,t", 0, (int) M_DREMU_3, INSN_MACRO, 0, I3 }, {"dremu", "d,v,I", 0, (int) M_DREMU_3I, INSN_MACRO, 0, I3 }, @@ -3913,8 +3934,8 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"drol", "d,v,t", 0, (int) M_DROL, INSN_MACRO, 0, I3 }, {"drol", "d,v,I", 0, (int) M_DROL_I, INSN_MACRO, 0, I3 }, {"dror", "d,v,t", 0, (int) M_DROR, INSN_MACRO, 0, I3 }, -@@ -774,10 +778,10 @@ - {"ei", "t", 0x41606020, 0xffe0ffff, WR_t|WR_C0, 0, I33|IOCT}, +@@ -777,10 +781,10 @@ + {"ei", "t", 0x41606020, 0xffe0ffff, WR_t|WR_C0, 0, I33 }, {"emt", "", 0x41600be1, 0xffffffff, TRAP, 0, MT32 }, {"emt", "t", 0x41600be1, 0xffe0ffff, TRAP|WR_t, 0, MT32 }, -{"eret", "", 0x42000018, 0xffffffff, NODS, 0, I3_32 }, @@ -3926,7 +3947,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"exts32", "t,r,+p,+S",0x7000003b, 0xfc00003f, WR_t|RD_s, 0, IOCT }, {"exts", "t,r,+P,+S",0x7000003b, 0xfc00003f, WR_t|RD_s, 0, IOCT }, /* exts32 */ {"exts", "t,r,+p,+s",0x7000003a, 0xfc00003f, WR_t|RD_s, 0, IOCT }, -@@ -786,7 +790,7 @@ +@@ -789,7 +793,7 @@ {"floor.w.d", "D,S", 0x4620000f, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I2 }, {"floor.w.s", "D,S", 0x4600000f, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 }, {"hibernate","", 0x42000023, 0xffffffff, 0, 0, V1 }, @@ -3935,7 +3956,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"iret", "", 0x42000038, 0xffffffff, NODS, 0, MC }, {"jr", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 }, /* jr.hb is officially MIPS{32,64}R2, but it works on R1 as jr with -@@ -829,18 +833,10 @@ +@@ -851,18 +855,10 @@ {"ldaddw", "t,b", 0x70000010, 0xfc00ffff, SM|RD_t|WR_t|RD_b, 0, XLR }, {"ldaddwu", "t,b", 0x70000011, 0xfc00ffff, SM|RD_t|WR_t|RD_b, 0, XLR }, {"ldaddd", "t,b", 0x70000012, 0xfc00ffff, SM|RD_t|WR_t|RD_b, 0, XLR }, @@ -3946,10 +3967,10 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. -{"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */ -{"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, INSN2_M_FP_D, I1 }, -{"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, INSN2_M_FP_D, I1 }, --{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, --{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 }, --{"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, --{"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2 }, +-{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2, IOCT|IOCTP|IOCT2 }, +-{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2, IOCT|IOCTP|IOCT2 }, +-{"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2, IOCT|IOCTP|IOCT2 }, +-{"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2, IOCT|IOCTP|IOCT2 }, -{"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 }, +/* ldc1 is at the bottom of the table. */ +/* ldc2 is at the bottom of the table. */ @@ -3958,17 +3979,17 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"ldl", "t,A(b)", 0, (int) M_LDL_AB, INSN_MACRO, 0, I3 }, {"ldr", "t,o(b)", 0x6c000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 }, {"ldr", "t,A(b)", 0, (int) M_LDR_AB, INSN_MACRO, 0, I3 }, -@@ -870,8 +866,7 @@ +@@ -892,8 +888,7 @@ {"lwc1", "E,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, INSN2_M_FP_S, I1 }, {"l.s", "T,o(b)", 0xc4000000, 0xfc000000, CLD|RD_b|WR_T|FP_S, 0, I1 }, /* lwc1 */ {"l.s", "T,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, INSN2_M_FP_S, I1 }, --{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 }, --{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 }, +-{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1, IOCT|IOCTP|IOCT2 }, +-{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1, IOCT|IOCTP|IOCT2 }, +/* lwc2 is at the bottom of the table. */ - {"lwc3", "E,o(b)", 0xcc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 }, - {"lwc3", "E,A(b)", 0, (int) M_LWC3_AB, INSN_MACRO, 0, I1 }, + {"lwc3", "E,o(b)", 0xcc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1, IOCT|IOCTP|IOCT2 }, + {"lwc3", "E,A(b)", 0, (int) M_LWC3_AB, INSN_MACRO, 0, I1, IOCT|IOCTP|IOCT2 }, {"lwl", "t,o(b)", 0x88000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 }, -@@ -911,12 +906,14 @@ +@@ -933,12 +928,14 @@ {"madd.ps", "D,S,T", 0x45600018, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2E }, {"madd.ps", "D,S,T", 0x71600018, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, {"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, @@ -3983,7 +4004,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 }, {"maddu", "7,s,t", 0x70000001, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 }, -@@ -957,7 +954,7 @@ +@@ -979,7 +976,7 @@ /* mfc2 is at the bottom of the table. */ /* mfhc2 is at the bottom of the table. */ /* mfc3 is at the bottom of the table. */ @@ -3992,7 +4013,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"mfhi", "d", 0x00000010, 0xffff07ff, WR_d|RD_HI, 0, I1 }, {"mfhi", "d,9", 0x00000010, 0xff9f07ff, WR_d|RD_HI, 0, D32 }, {"mflo", "d", 0x00000012, 0xffff07ff, WR_d|RD_LO, 0, I1 }, -@@ -979,7 +976,7 @@ +@@ -1001,7 +998,7 @@ {"movf.l", "X,Y,N", 0x46a00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 }, {"movf.s", "D,S,N", 0x46000011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4_32 }, {"movf.ps", "D,S,N", 0x46c00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5_33 }, @@ -4001,7 +4022,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"movnz", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, IL2E|IL2F|IL3A }, {"ffc", "d,v", 0x0000000b, 0xfc1f07ff, WR_d|RD_s, 0, L1 }, {"movn.d", "D,S,t", 0x46200013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4_32 }, -@@ -993,7 +990,7 @@ +@@ -1015,7 +1012,7 @@ {"movt.l", "X,Y,N", 0x46a10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 }, {"movt.s", "D,S,N", 0x46010011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4_32 }, {"movt.ps", "D,S,N", 0x46c10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5_33 }, @@ -4010,7 +4031,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"ffs", "d,v", 0x0000000a, 0xfc1f07ff, WR_d|RD_s, 0, L1 }, {"movz.d", "D,S,t", 0x46200012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4_32 }, {"movz.l", "D,S,t", 0x46a00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 }, -@@ -1021,9 +1018,11 @@ +@@ -1043,9 +1040,11 @@ {"msub.ps", "D,S,T", 0x45600019, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2E }, {"msub.ps", "D,S,T", 0x71600019, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, {"msub", "s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, @@ -4022,7 +4043,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"msubu", "s,t", 0x70000005, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, {"msubu", "7,s,t", 0x70000005, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 }, {"mtpc", "t,P", 0x4080c801, 0xffe0ffc1, COD|RD_t|WR_C0, 0, M1|N5 }, -@@ -1038,7 +1037,7 @@ +@@ -1060,7 +1059,7 @@ /* mtc2 is at the bottom of the table. */ /* mthc2 is at the bottom of the table. */ /* mtc3 is at the bottom of the table. */ @@ -4031,7 +4052,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"mthi", "s", 0x00000011, 0xfc1fffff, RD_s|WR_HI, 0, I1 }, {"mthi", "s,7", 0x00000011, 0xfc1fe7ff, RD_s|WR_HI, 0, D32 }, {"mtlo", "s", 0x00000013, 0xfc1fffff, RD_s|WR_LO, 0, I1 }, -@@ -1223,13 +1222,13 @@ +@@ -1254,13 +1253,13 @@ {"rol", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I1 }, {"ror", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I1 }, {"ror", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I1 }, @@ -4052,7 +4073,7 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"round.l.d", "D,S", 0x46200008, 0xffff003f, WR_D|RD_S|FP_D, 0, I3_33 }, {"round.l.s", "D,S", 0x46000008, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I3_33 }, {"round.w.d", "D,S", 0x4620000c, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, I2 }, -@@ -1262,24 +1261,17 @@ +@@ -1299,24 +1298,17 @@ {"sdbbp", "c,q", 0x0000000e, 0xfc00003f, TRAP, 0, G2 }, {"sdbbp", "", 0x7000003f, 0xffffffff, TRAP, 0, I32 }, {"sdbbp", "B", 0x7000003f, 0xfc00003f, TRAP, 0, I32 }, @@ -4060,10 +4081,10 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. -{"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, -{"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, INSN2_M_FP_D, I2 }, -{"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, INSN2_M_FP_D, I2 }, --{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 }, --{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 }, --{"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2 }, --{"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2 }, +-{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2, IOCT|IOCTP|IOCT2 }, +-{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2, IOCT|IOCTP|IOCT2 }, +-{"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2, IOCT|IOCTP|IOCT2 }, +-{"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2, IOCT|IOCTP|IOCT2 }, -{"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, -{"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, INSN2_M_FP_D, I1 }, -{"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, INSN2_M_FP_D, I1 }, @@ -4084,17 +4105,17 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"selsl", "d,v,t", 0x00000005, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 }, {"selsr", "d,v,t", 0x00000001, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 }, {"seq", "d,v,t", 0x7000002a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, IOCT }, -@@ -1399,8 +1391,7 @@ +@@ -1436,8 +1428,7 @@ {"swc1", "E,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, INSN2_M_FP_S, I1 }, {"s.s", "T,o(b)", 0xe4000000, 0xfc000000, SM|RD_T|RD_b|FP_S, 0, I1 }, /* swc1 */ {"s.s", "T,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, INSN2_M_FP_S, I1 }, --{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 }, --{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 }, +-{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1, IOCT|IOCTP|IOCT2 }, +-{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1, IOCT|IOCTP|IOCT2 }, +/* swc2 is at the bottom of the table. */ - {"swc3", "E,o(b)", 0xec000000, 0xfc000000, SM|RD_C3|RD_b, 0, I1 }, - {"swc3", "E,A(b)", 0, (int) M_SWC3_AB, INSN_MACRO, 0, I1 }, + {"swc3", "E,o(b)", 0xec000000, 0xfc000000, SM|RD_C3|RD_b, 0, I1, IOCT|IOCTP|IOCT2 }, + {"swc3", "E,A(b)", 0, (int) M_SWC3_AB, INSN_MACRO, 0, I1, IOCT|IOCTP|IOCT2 }, {"swl", "t,o(b)", 0xa8000000, 0xfc000000, SM|RD_t|RD_b, 0, I1 }, -@@ -1497,7 +1488,8 @@ +@@ -1534,7 +1525,8 @@ {"wait", "J", 0x42000020, 0xfe00003f, NODS, 0, I32|N55 }, {"waiti", "", 0x42000020, 0xffffffff, NODS, 0, L1 }, {"wrpgpr", "d,w", 0x41c00000, 0xffe007ff, RD_t, 0, I33 }, @@ -4104,9 +4125,9 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. {"xor", "d,v,t", 0x00000026, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 }, {"xor", "t,r,I", 0, (int) M_XOR_I, INSN_MACRO, 0, I1 }, {"xor", "D,S,T", 0x47800002, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2E }, -@@ -1511,6 +1503,321 @@ - {"yield", "s", 0x7c000009, 0xfc1fffff, NODS|RD_s, 0, MT32 }, - {"yield", "d,s", 0x7c000009, 0xfc1f07ff, NODS|WR_d|RD_s, 0, MT32 }, +@@ -1550,6 +1542,321 @@ + {"zcb", "(b)", 0x7000071f, 0xfc1fffff, SM|RD_b, 0, IOCT2 }, + {"zcbt", "(b)", 0x7000075f, 0xfc1fffff, SM|RD_b, 0, IOCT2 }, +/* Sony Allegrex CPU core. */ +{"bitrev", "d,t", 0x7c000520, 0xffe007ff, WR_d|RD_t, 0, AL }, @@ -4426,9 +4447,9 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. /* User Defined Instruction. */ {"udi0", "s,t,d,+1",0x70000010, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 }, {"udi0", "s,t,+2", 0x70000010, 0xfc00003f, WR_d|RD_s|RD_t, 0, I33 }, -@@ -1606,6 +1913,36 @@ - {"mthc2", "t,G,H", 0x48e00000, 0xffe007f8, COD|RD_t|WR_C2|WR_CC, 0, I33 }, - {"mthc2", "t,i", 0x48e00000, 0xffe00000, COD|RD_t|WR_C2|WR_CC, 0, I33 }, +@@ -1645,6 +1952,36 @@ + {"mthc2", "t,G,H", 0x48e00000, 0xffe007f8, COD|RD_t|WR_C2|WR_CC, 0, I33, IOCT|IOCTP|IOCT2 }, + {"mthc2", "t,i", 0x48e00000, 0xffe00000, COD|RD_t|WR_C2|WR_CC, 0, I33, IOCT|IOCTP|IOCT2 }, +/* Coprocessor 2 load/store operations overlap with the Allegrex VFPU + instructions so they are here for the latters to take precedence. */ @@ -4440,12 +4461,12 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. +{"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */ +{"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, 0, I1 }, +{"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, 0, I1 }, -+{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, -+{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 }, -+{"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, -+{"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2 }, -+{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 }, -+{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 }, ++{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2, IOCT|IOCTP|IOCT2 }, ++{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2, IOCT|IOCTP|IOCT2 }, ++{"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2, IOCT|IOCTP|IOCT2 }, ++{"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2, IOCT|IOCTP|IOCT2 }, ++{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1, IOCT|IOCTP|IOCT2 }, ++{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1, IOCT|IOCTP|IOCT2 }, +{"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, +{"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, +{"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, @@ -4453,17 +4474,17 @@ diff -burN orig.binutils-2.22/opcodes/mips-opc.c binutils-2.22/opcodes/mips-opc. +{"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, +{"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, 0, I1 }, +{"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, 0, I1 }, -+{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 }, -+{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 }, -+{"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2 }, -+{"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2 }, -+{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 }, -+{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 }, ++{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2, IOCT|IOCTP|IOCT2 }, ++{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2, IOCT|IOCTP|IOCT2 }, ++{"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2, IOCT|IOCTP|IOCT2 }, ++{"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2, IOCT|IOCTP|IOCT2 }, ++{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1, IOCT|IOCTP|IOCT2 }, ++{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1, IOCT|IOCTP|IOCT2 }, + /* Coprocessor 3 move/branch operations overlap with MIPS IV COP1X instructions, so they are here for the latters to take precedence. */ - {"bc3f", "p", 0x4d000000, 0xffff0000, CBD|RD_CC, 0, I1 }, -@@ -1643,7 +1980,6 @@ + {"bc3f", "p", 0x4d000000, 0xffff0000, CBD|RD_CC, 0, I1, IOCT|IOCTP|IOCT2 }, +@@ -1682,7 +2019,6 @@ {"addu_s.ob", "d,s,t", 0x7c000114, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D64 }, {"addu_s.qb", "d,s,t", 0x7c000110, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 }, {"addwc", "d,s,t", 0x7c000450, 0xfc0007ff, WR_d|RD_s|RD_t, 0, D32 }, diff --git a/scripts/001-binutils.sh b/scripts/001-binutils.sh index dce8e2a..679a449 100755 --- a/scripts/001-binutils.sh +++ b/scripts/001-binutils.sh @@ -3,7 +3,7 @@ . ../common.sh -BINUTILS_VERSION=2.22 +BINUTILS_VERSION=2.23.1 # Exit on errors set -e From bc14dd3294c259684839c4c201b917669b50c6cd Mon Sep 17 00:00:00 2001 From: "N. Alexander Tessner" Date: Sun, 6 Oct 2019 21:17:13 -0400 Subject: [PATCH 21/30] Fixed readline.h dependency check on Manjaro. --- depends.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/depends.sh b/depends.sh index 58642c3..579231f 100644 --- a/depends.sh +++ b/depends.sh @@ -48,6 +48,7 @@ check_header () printf "Checking for header %s... " "$1" cat >tmp.$$.c <<_EOF_ +#include #include <$1> int From 22cbdea60e6a98788b2105f185e9cd765fd2d322 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Thu, 2 Apr 2020 10:21:50 +0200 Subject: [PATCH 22/30] Fix broken if check The if check gave an error if $USER is not set. --- prepare.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prepare.sh b/prepare.sh index dd7c042..3ecff4b 100755 --- a/prepare.sh +++ b/prepare.sh @@ -5,7 +5,7 @@ case "$(uname -s)" in if command -v apt >/dev/null 2>&1 then - if ! [ "$(id -u "$USER")" -eq 0 ] + if [ "$(id -u)" -ne "0" ] then cat >&2 <<_EOF_ Warning: running without superuser privileges @@ -45,7 +45,7 @@ _EOF_ zlib1g-dev elif command -v apt-get >/dev/null then - if ! [ "$(id -u "$USER")" -eq 0 ] + if [ "$(id -u)" -ne "0" ] then cat >&2 <<_EOF_ Warning: running without superuser privileges From 54394984ad7968178d52c65271b30ed7d7490244 Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Sun, 5 Apr 2020 21:27:12 +0200 Subject: [PATCH 23/30] Remove USER variable also from checks for macOS --- prepare.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prepare.sh b/prepare.sh index 3ecff4b..5ae39a7 100755 --- a/prepare.sh +++ b/prepare.sh @@ -168,7 +168,7 @@ _EOF_ if command -v port >/dev/null 2>&1 then - if ! [ "$(id -u "$USER")" -eq 0 ] + if [ "$(id -u)" -ne 0 ] then cat >&2 <<_EOF_ Warning: running without superuser privileges @@ -193,7 +193,7 @@ _EOF_ then # We are using /usr/bin/stat because otherwise a GNU stat from # Homebrew may get pulled in which is incompatible. - if ! [ "$(id -u "$USER")" -eq "$(/usr/bin/stat -f'%u' "$(brew --cellar)")" ] + if [ "$(id -u)" -ne "$(/usr/bin/stat -f'%u' "$(brew --cellar)")" ] then cat >&2 <<_EOF_ Warning: you are not the owner of Homebrew. From 728cb11a9cc3724461c5fc7d852c82e60333df44 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 11 Apr 2020 11:53:17 +1000 Subject: [PATCH 24/30] Enable plugin support --- gcc.sh | 2 +- scripts/001-binutils.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc.sh b/gcc.sh index a3ab990..57be0a1 100644 --- a/gcc.sh +++ b/gcc.sh @@ -36,7 +36,7 @@ mkdir build-psp cd build-psp ## Configure the build. -../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c,lto$EXTRA_LANGUAGES" --enable-lto --with-newlib --with-system-zlib $EXTRA_CONFIGURE_FLAGS +../configure --prefix="$PSPDEV" --target="psp" --enable-languages="c,lto$EXTRA_LANGUAGES" --enable-lto --enable-plugins --with-newlib --with-system-zlib $EXTRA_CONFIGURE_FLAGS ## Compile and install. run_make diff --git a/scripts/001-binutils.sh b/scripts/001-binutils.sh index 679a449..13daf88 100755 --- a/scripts/001-binutils.sh +++ b/scripts/001-binutils.sh @@ -25,9 +25,9 @@ mkdir build-psp cd build-psp # Configure the build. -../configure --prefix="$PSPDEV" --target="psp" --enable-install-libbfd --disable-werror --with-system-zlib +../configure --prefix="$PSPDEV" --target="psp" --enable-install-libbfd --enable-plugins --disable-werror --with-system-zlib # Compile and install. -run_make +run_make run_make install run_make clean From 78fb32d9d06f892645707f62e5f32183c7ffc29c Mon Sep 17 00:00:00 2001 From: Daniel 0xdbeef Zalega Date: Thu, 16 Apr 2020 17:56:37 +0200 Subject: [PATCH 25/30] Upated GCC to 9.3 --- gcc.sh | 2 +- ...cc-8.3.0-PSP.patch => gcc-9.3.0-PSP.patch} | 85 ++++++++++--------- 2 files changed, 45 insertions(+), 42 deletions(-) rename patches/{gcc-8.3.0-PSP.patch => gcc-9.3.0-PSP.patch} (96%) diff --git a/gcc.sh b/gcc.sh index 57be0a1..33c17f9 100644 --- a/gcc.sh +++ b/gcc.sh @@ -3,7 +3,7 @@ # Based on gcc-stage1.sh and gcc-stage2.sh by Naomi Peori (naomi@peori.ca) customized by yreeen(yreeen@gmail.com) ## set gcc version -GCC_VERSION=8.3.0 +GCC_VERSION=9.3.0 GMP_VERSION=6.1.2 MPC_VERSION=1.1.0 MPFR_VERSION=4.0.2 diff --git a/patches/gcc-8.3.0-PSP.patch b/patches/gcc-9.3.0-PSP.patch similarity index 96% rename from patches/gcc-8.3.0-PSP.patch rename to patches/gcc-9.3.0-PSP.patch index 4ff7e03..aab9e71 100644 --- a/patches/gcc-8.3.0-PSP.patch +++ b/patches/gcc-9.3.0-PSP.patch @@ -1,33 +1,36 @@ diff --unified -rN a/config.sub b/config.sub --- a/config.sub 2018-01-03 05:25:18.000000000 +0100 +++ b/config.sub 2019-04-11 11:48:30.936991476 +0200 -@@ -288,6 +288,7 @@ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ -+ | mipsallegrex | mipsallegrexel \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ -@@ -415,6 +416,7 @@ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ -+ | mipsallegrex-* | mipsallegrexel-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ -@@ -836,6 +838,10 @@ - basic_machine=m68k-atari - os=-mint - ;; -+ psp) -+ basic_machine=mipsallegrexel-psp -+ os=-elf +@@ -632,6 +632,10 @@ + basic_machine=ymp-cray + os=unicos + ;; ++ psp) ++ basic_machine=mipsallegrexel-psp ++ os=elf ++ ;; + *) + basic_machine=$1 + os= +@@ -644,6 +648,10 @@ + case $basic_machine in + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. ++ mipsallegrexel-*) ++ cpu=mipsallegrexel ++ vendor=psp + ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; + w89k) + cpu=hppa1.1 + vendor=winbond +@@ -1210,6 +1218,7 @@ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ ++ | mipsallegrex | mipsallegrexel \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ diff --unified -rN a/gcc/config/mips/allegrex.md b/gcc/config/mips/allegrex.md --- a/gcc/config/mips/allegrex.md 1970-01-01 01:00:00.000000000 +0100 +++ b/gcc/config/mips/allegrex.md 2019-04-11 11:48:30.936991476 +0200 @@ -129,18 +132,18 @@ diff --unified -rN a/gcc/config/mips/allegrex.md b/gcc/config/mips/allegrex.md + [(set_attr "type" "clz") + (set_attr "mode" "SI")]) + -+(define_expand "ctzsi2" -+ [(set (match_operand:SI 0 "register_operand") -+ (ctz:SI (match_operand:SI 1 "register_operand")))] -+ "TARGET_ALLEGREX" -+{ -+ rtx r1; -+ -+ r1 = gen_reg_rtx (SImode); -+ emit_insn (gen_allegrex_bitrev (r1, operands[1])); -+ emit_insn (gen_clzsi2 (operands[0], r1)); -+ DONE; -+}) ++;;(define_expand "ctzsi2" ++;; [(set (match_operand:SI 0 "register_operand") ++;; (ctz:SI (match_operand:SI 1 "register_operand")))] ++;; "TARGET_ALLEGREX" ++;;{ ++;; rtx r1; ++;; ++;; r1 = gen_reg_rtx (SImode); ++;; emit_insn (gen_allegrex_bitrev (r1, operands[1])); ++;; emit_insn (gen_clzsi2 (operands[0], r1)); ++;; DONE; ++;;}) + +(define_expand "allegrex_cto" + [(set (match_operand:SI 0 "register_operand") @@ -298,7 +301,7 @@ diff --unified -rN a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c + DIRECT_ALLEGREX_BUILTIN(bitrev, MIPS_SI_FTYPE_SI, 0), + DIRECT_ALLEGREX_NAMED_BUILTIN(clz, clzsi2, MIPS_SI_FTYPE_SI, 0), + DIRECT_ALLEGREX_BUILTIN(clo, MIPS_SI_FTYPE_SI, 0), -+ DIRECT_ALLEGREX_NAMED_BUILTIN(ctz, ctzsi2, MIPS_SI_FTYPE_SI, 0), ++ //DIRECT_ALLEGREX_NAMED_BUILTIN(ctz, ctzsi2, MIPS_SI_FTYPE_SI, 0), + DIRECT_ALLEGREX_BUILTIN(cto, MIPS_SI_FTYPE_SI, 0), + DIRECT_ALLEGREX_NAMED_BUILTIN(rotr, rotrsi3, MIPS_SI_FTYPE_SI_SI, 0), + DIRECT_ALLEGREX_NAMED_BUILTIN(rotl, rotlsi3, MIPS_SI_FTYPE_SI_SI, 0), @@ -766,12 +769,12 @@ diff --unified -rN a/gcc/config.gcc b/gcc/config.gcc ;; +mipsallegrex-*-elf* | mipsallegrexel-*-elf*) + tm_file="elfos.h ${tm_file} mips/elf.h" -+ tmake_file=mips/t-allegrex ++ tmake_file=mips/t-allegrex; + target_cpu_default="MASK_SINGLE_FLOAT|MASK_DIVIDE_BREAKS" + tm_defines="MIPS_ISA_DEFAULT=2 MIPS_CPU_STRING_DEFAULT=\\\"allegrex\\\" MIPS_ABI_DEFAULT=ABI_EABI" + case ${target} in + mipsallegrex*-psp-elf*) -+ tm_file="${tm_file} mips/psp.h" ++ tm_file="${tm_file} mips/psp.h"; + ;; + esac + use_fixproto=yes From bbf23b8f096d4d352ec2ebf09d4ebecbb53a701e Mon Sep 17 00:00:00 2001 From: Daniel 0xdbeef Zalega Date: Wed, 15 Apr 2020 23:34:40 +0200 Subject: [PATCH 26/30] Added `--depth 1` to clone_git_repo function. --- common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.sh b/common.sh index 35247ec..9a744e4 100644 --- a/common.sh +++ b/common.sh @@ -119,7 +119,7 @@ clone_git_repo () rm -rf "$LOCAL_DIR" fi - git_noninteractive clone --recursive -b "$BRANCH" "$URL" "$LOCAL_DIR" || return 1 + git_noninteractive clone --recursive --depth 1 -b "$BRANCH" "$URL" "$LOCAL_DIR" || return 1 } # Runs make with our options. From 6436bda249054ec291ec040b012885b6068fc4c6 Mon Sep 17 00:00:00 2001 From: Daniel 0xdbeef Zalega Date: Wed, 15 Apr 2020 23:13:41 +0200 Subject: [PATCH 27/30] Removed newlib patch; cloning pspdev fork with patch already applied. --- patches/newlib-1.20.0-PSP.patch | 11011 ------------------------------ scripts/004-newlib.sh | 4 +- 2 files changed, 2 insertions(+), 11013 deletions(-) delete mode 100644 patches/newlib-1.20.0-PSP.patch diff --git a/patches/newlib-1.20.0-PSP.patch b/patches/newlib-1.20.0-PSP.patch deleted file mode 100644 index bcd361f..0000000 --- a/patches/newlib-1.20.0-PSP.patch +++ /dev/null @@ -1,11011 +0,0 @@ -diff -burN orig.newlib-1.20.0/config.sub newlib-1.20.0/config.sub ---- orig.newlib-1.20.0/config.sub 2011-11-02 01:56:53.000000000 +0100 -+++ newlib-1.20.0/config.sub 2012-01-11 22:19:26.220733638 +0100 -@@ -283,6 +283,7 @@ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ -+ | mipsallegrex | mipsallegrexel \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ -@@ -396,6 +397,7 @@ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ -+ | mipsallegrex-* | mipsallegrexel-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ -@@ -795,6 +797,10 @@ - basic_machine=m68k-atari - os=-mint - ;; -+ psp) -+ basic_machine=mipsallegrexel-psp -+ os=-elf -+ ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; -diff -burN orig.newlib-1.20.0/configure newlib-1.20.0/configure ---- orig.newlib-1.20.0/configure 2011-12-18 11:20:51.000000000 +0100 -+++ newlib-1.20.0/configure 2012-01-12 17:27:27.578788596 +0100 -@@ -3598,6 +3598,9 @@ - ;; - mips*-*-linux*) - ;; -+ mipsallegrex*-*-*) -+ noconfigdirs="$noconfigdirs target-libgloss" -+ ;; - mips*-*-*) - noconfigdirs="$noconfigdirs gprof" - ;; -diff -burN orig.newlib-1.20.0/configure.ac newlib-1.20.0/configure.ac ---- orig.newlib-1.20.0/configure.ac 2011-11-09 19:57:28.000000000 +0100 -+++ newlib-1.20.0/configure.ac 2012-01-12 17:27:37.605670110 +0100 -@@ -1024,6 +1024,9 @@ - ;; - mips*-*-linux*) - ;; -+ mipsallegrex*-*-*) -+ noconfigdirs="$noconfigdirs target-libgloss" -+ ;; - mips*-*-*) - noconfigdirs="$noconfigdirs gprof" - ;; -diff -burN orig.newlib-1.20.0/newlib/configure.host newlib-1.20.0/newlib/configure.host ---- orig.newlib-1.20.0/newlib/configure.host 2011-11-29 07:33:48.000000000 +0100 -+++ newlib-1.20.0/newlib/configure.host 2012-01-15 11:44:50.815626775 +0100 -@@ -535,7 +535,7 @@ - default_newlib_io_long_long="yes" - default_newlib_io_c99_formats="yes" - newlib_cflags="${newlib_cflags} -D_COMPILING_NEWLIB" -- newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC" -+ newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC -DHAVE_RENAME" - # turn off unsupported items in posix directory - newlib_cflags="${newlib_cflags} -D_NO_GETLOGIN -D_NO_GETPWENT -D_NO_GETUT -D_NO_GETPASS -D_NO_SIGSET -D_NO_WORDEXP -D_NO_POPEN" - ;; -@@ -665,6 +665,12 @@ - default_newlib_io_long_long="yes" - newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES" - ;; -+ mipsallegrex*-psp-*) -+ default_newlib_io_long_long="yes" -+ sys_dir=psp -+ syscall_dir=syscalls -+ newlib_cflags="${newlib_cflags} -G0 -mno-explicit-relocs -DCOMPACT_CTYPE -DCLOCK_PROVIDED -DHAVE_FCNTL -DHAVE_RENAME -DMALLOC_ALIGNMENT=16 -I${prefix}/psp/sdk/include" -+ ;; - mips*-*-elf*) - default_newlib_io_long_long="yes" - newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES" -diff -burN orig.newlib-1.20.0/newlib/libc/include/machine/time.h newlib-1.20.0/newlib/libc/include/machine/time.h ---- orig.newlib-1.20.0/newlib/libc/include/machine/time.h 2009-04-07 00:04:33.000000000 +0200 -+++ newlib-1.20.0/newlib/libc/include/machine/time.h 2012-01-12 17:31:50.433651821 +0100 -@@ -9,6 +9,10 @@ - #endif - #endif /* !__rtems__ */ - -+#if defined(__psp__) -+#define _CLOCKS_PER_SEC_ 1000000 -+#endif -+ - #ifdef __SPU__ - #include - int nanosleep (const struct timespec *, struct timespec *); -diff -burN orig.newlib-1.20.0/newlib/libc/include/memory.h newlib-1.20.0/newlib/libc/include/memory.h ---- orig.newlib-1.20.0/newlib/libc/include/memory.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/include/memory.h 2015-10-25 21:51:34.000000000 +0100 -@@ -0,0 +1,11 @@ -+/* -+ * memory.h -+ * -+ */ -+ -+#ifndef _MEMORY_H_ -+#define _MEMORY_H_ -+ -+#include -+ -+#endif /* _MEMORY_H_ */ -diff -burN orig.newlib-1.20.0/newlib/libc/include/stdint.h newlib-1.20.0/newlib/libc/include/stdint.h ---- orig.newlib-1.20.0/newlib/libc/include/stdint.h 2009-04-24 23:55:07.000000000 +0200 -+++ newlib-1.20.0/newlib/libc/include/stdint.h 2012-01-12 17:32:29.126185197 +0100 -@@ -30,11 +30,9 @@ - #define __have_longlong64 1 - #endif - --/* Check if "long" is 64bit or 32bit wide */ -+/* Check if "long" is 64bit */ - #if __STDINT_EXP(LONG_MAX) > 0x7fffffff - #define __have_long64 1 --#elif __STDINT_EXP(LONG_MAX) == 0x7fffffff && !defined(__SPU__) --#define __have_long32 1 - #endif - - #if __STDINT_EXP(SCHAR_MAX) == 0x7f -diff -burN orig.newlib-1.20.0/newlib/libc/include/stdlib.h newlib-1.20.0/newlib/libc/include/stdlib.h ---- orig.newlib-1.20.0/newlib/libc/include/stdlib.h 2015-10-25 21:15:11.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/include/stdlib.h 2015-10-25 21:16:25.000000000 +0100 -@@ -122,6 +122,7 @@ - #ifndef __STRICT_ANSI__ - _PTR _EXFUN(reallocf,(_PTR __r, size_t __size)); - #endif -+char * _EXFUN(realpath,(const char *, char *)); - _VOID _EXFUN(srand,(unsigned __seed)); - double _EXFUN(strtod,(const char *__n, char **__end_PTR)); - double _EXFUN(_strtod_r,(struct _reent *,const char *__n, char **__end_PTR)); -diff -burN orig.newlib-1.20.0/newlib/libc/include/sys/config.h newlib-1.20.0/newlib/libc/include/sys/config.h ---- orig.newlib-1.20.0/newlib/libc/include/sys/config.h 2010-12-02 20:30:46.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/include/sys/config.h 2012-01-12 17:32:45.489987517 +0100 -@@ -130,6 +130,12 @@ - #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) - #endif - -+/* We compile newlib with -G0 for PSP, but if we're compiling an app with $gp enabled, -+ then _impure_ptr is expected to live in .sdata. */ -+#if defined(__psp__) -+#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) -+#endif -+ - #ifdef __xstormy16__ - #define __SMALL_BITFIELDS - #undef INT_MAX -diff -burN orig.newlib-1.20.0/newlib/libc/include/sys/types.h newlib-1.20.0/newlib/libc/include/sys/types.h ---- orig.newlib-1.20.0/newlib/libc/include/sys/types.h 2011-08-01 19:22:18.000000000 +0200 -+++ newlib-1.20.0/newlib/libc/include/sys/types.h 2012-01-12 17:33:17.597599073 +0100 -@@ -200,6 +200,7 @@ - - typedef unsigned short nlink_t; - -+#if !defined(__psp__) - /* We don't define fd_set and friends if we are compiling POSIX - source, or if we have included (or may include as indicated - by __USE_W32_SOCKETS) the W32api winsock[2].h header which -@@ -245,6 +246,7 @@ - })) - - # endif /* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) */ -+#endif /* !defined(__psp__) */ - - #undef __MS_types__ - #undef _ST_INT32 -diff -burN orig.newlib-1.20.0/newlib/libc/include/sys/unistd.h newlib-1.20.0/newlib/libc/include/sys/unistd.h ---- orig.newlib-1.20.0/newlib/libc/include/sys/unistd.h 2011-08-19 16:29:34.000000000 +0200 -+++ newlib-1.20.0/newlib/libc/include/sys/unistd.h 2012-01-12 17:33:48.549223919 +0100 -@@ -241,6 +241,7 @@ - void _EXFUN(sync, (void)); - #endif - -+#if !defined(__psp__) - ssize_t _EXFUN(readlink, (const char *__path, char *__buf, size_t __buflen)); - #if defined(__CYGWIN__) - ssize_t _EXFUN(readlinkat, (int __dirfd1, const char *__path, char *__buf, size_t __buflen)); -@@ -250,6 +251,7 @@ - int _EXFUN(symlinkat, (const char *, int, const char *)); - int _EXFUN(unlinkat, (int, const char *, int)); - #endif -+#endif - - #define F_OK 0 - #define R_OK 4 -diff -burN orig.newlib-1.20.0/newlib/libc/sys/configure newlib-1.20.0/newlib/libc/sys/configure ---- orig.newlib-1.20.0/newlib/libc/sys/configure 2011-12-19 23:03:37.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/configure 2012-01-12 17:36:01.953599625 +0100 -@@ -796,6 +796,7 @@ - mmixware - netware - rdos -+psp - rtems - sh - sparc64 -@@ -11808,6 +11809,8 @@ - ;; - rdos) subdirs="$subdirs rdos" - ;; -+ psp) subdirs="$subdirs psp" -+ ;; - rtems) subdirs="$subdirs rtems" - ;; - sh) subdirs="$subdirs sh" -diff -burN orig.newlib-1.20.0/newlib/libc/sys/configure.in newlib-1.20.0/newlib/libc/sys/configure.in ---- orig.newlib-1.20.0/newlib/libc/sys/configure.in 2010-02-24 21:59:55.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/configure.in 2012-01-12 17:36:34.049207168 +0100 -@@ -34,6 +34,7 @@ - mmixware) AC_CONFIG_SUBDIRS(mmixware) ;; - netware) AC_CONFIG_SUBDIRS(netware) ;; - rdos) AC_CONFIG_SUBDIRS(rdos) ;; -+ psp) AC_CONFIG_SUBDIRS(psp) ;; - rtems) AC_CONFIG_SUBDIRS(rtems) ;; - sh) AC_CONFIG_SUBDIRS(sh) ;; - sparc64) AC_CONFIG_SUBDIRS(sparc64) ;; -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/aclocal.m4 newlib-1.20.0/newlib/libc/sys/psp/aclocal.m4 ---- orig.newlib-1.20.0/newlib/libc/sys/psp/aclocal.m4 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/aclocal.m4 2012-01-12 17:41:43.780292058 +0100 -@@ -0,0 +1,992 @@ -+# generated automatically by aclocal 1.11.1 -*- Autoconf -*- -+ -+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. -+# This file 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. -+ -+m4_ifndef([AC_AUTOCONF_VERSION], -+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -+[m4_warning([this file was generated for autoconf 2.68. -+You have another version of autoconf. It may work, but is not guaranteed to. -+If you have problems, you may need to regenerate the build system entirely. -+To do so, use the procedure documented by the package, typically `autoreconf'.])]) -+ -+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# 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. -+# (This private macro should not be called outside this file.) -+AC_DEFUN([AM_AUTOMAKE_VERSION], -+[am__api_version='1.11' -+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -+dnl require some minimum version. Point them to the right macro. -+m4_if([$1], [1.11.1], [], -+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -+]) -+ -+# _AM_AUTOCONF_VERSION(VERSION) -+# ----------------------------- -+# aclocal traces this macro to find the Autoconf version. -+# This is a private macro too. Using m4_define simplifies -+# the logic in aclocal, which can simply ignore this definition. -+m4_define([_AM_AUTOCONF_VERSION], []) -+ -+# AM_SET_CURRENT_AUTOMAKE_VERSION -+# ------------------------------- -+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -+[AM_AUTOMAKE_VERSION([1.11.1])dnl -+m4_ifndef([AC_AUTOCONF_VERSION], -+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -+ -+# AM_AUX_DIR_EXPAND -*- Autoconf -*- -+ -+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -+# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -+# -+# Of course, Automake must honor this variable whenever it calls a -+# tool from the auxiliary directory. The problem is that $srcdir (and -+# therefore $ac_aux_dir as well) can be either absolute or relative, -+# depending on how configure is run. This is pretty annoying, since -+# it makes $ac_aux_dir quite unusable in subdirectories: in the top -+# source directory, any form will work fine, but in subdirectories a -+# relative path needs to be adjusted first. -+# -+# $ac_aux_dir/missing -+# fails when called from a subdirectory if $ac_aux_dir is relative -+# $top_srcdir/$ac_aux_dir/missing -+# fails if $ac_aux_dir is absolute, -+# fails when called from a subdirectory in a VPATH build with -+# a relative $ac_aux_dir -+# -+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -+# are both prefixed by $srcdir. In an in-source build this is usually -+# harmless because $srcdir is `.', but things will broke when you -+# start a VPATH build or use an absolute $srcdir. -+# -+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -+# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -+# and then we would define $MISSING as -+# MISSING="\${SHELL} $am_aux_dir/missing" -+# This will work as long as MISSING is not called from configure, because -+# unfortunately $(top_srcdir) has no meaning in configure. -+# However there are other variables, like CC, which are often used in -+# configure, and could therefore not use this "fixed" $ac_aux_dir. -+# -+# Another solution, used here, is to always expand $ac_aux_dir to an -+# absolute PATH. The drawback is that using absolute paths prevent a -+# configured tree to be moved without reconfiguration. -+ -+AC_DEFUN([AM_AUX_DIR_EXPAND], -+[dnl Rely on autoconf to set up CDPATH properly. -+AC_PREREQ([2.50])dnl -+# expand $ac_aux_dir to an absolute path -+am_aux_dir=`cd $ac_aux_dir && pwd` -+]) -+ -+# AM_CONDITIONAL -*- Autoconf -*- -+ -+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -+# Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# serial 9 -+ -+# AM_CONDITIONAL(NAME, SHELL-CONDITION) -+# ------------------------------------- -+# Define a conditional. -+AC_DEFUN([AM_CONDITIONAL], -+[AC_PREREQ(2.52)dnl -+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], -+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -+AC_SUBST([$1_TRUE])dnl -+AC_SUBST([$1_FALSE])dnl -+_AM_SUBST_NOTMAKE([$1_TRUE])dnl -+_AM_SUBST_NOTMAKE([$1_FALSE])dnl -+m4_define([_AM_COND_VALUE_$1], [$2])dnl -+if $2; then -+ $1_TRUE= -+ $1_FALSE='#' -+else -+ $1_TRUE='#' -+ $1_FALSE= -+fi -+AC_CONFIG_COMMANDS_PRE( -+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then -+ AC_MSG_ERROR([[conditional "$1" was never defined. -+Usually this means the macro was only invoked conditionally.]]) -+fi])]) -+ -+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -+# Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# serial 10 -+ -+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -+# written in clear, in which case automake, when reading aclocal.m4, -+# will think it sees a *use*, and therefore will trigger all it's -+# C support machinery. Also note that it means that autoscan, seeing -+# CC etc. in the Makefile, will ask for an AC_PROG_CC use... -+ -+ -+# _AM_DEPENDENCIES(NAME) -+# ---------------------- -+# See how the compiler implements dependency checking. -+# NAME is "CC", "CXX", "GCJ", or "OBJC". -+# We try a few techniques and use that to set a single cache variable. -+# -+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -+# dependency, and given that the user is not expected to run this macro, -+# just rely on AC_PROG_CC. -+AC_DEFUN([_AM_DEPENDENCIES], -+[AC_REQUIRE([AM_SET_DEPDIR])dnl -+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -+AC_REQUIRE([AM_MAKE_INCLUDE])dnl -+AC_REQUIRE([AM_DEP_TRACK])dnl -+ -+ifelse([$1], CC, [depcc="$CC" am_compiler_list=], -+ [$1], CXX, [depcc="$CXX" am_compiler_list=], -+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], -+ [$1], UPC, [depcc="$UPC" am_compiler_list=], -+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], -+ [depcc="$$1" am_compiler_list=]) -+ -+AC_CACHE_CHECK([dependency style of $depcc], -+ [am_cv_$1_dependencies_compiler_type], -+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then -+ # We make a subdir and do the tests there. Otherwise we can end up -+ # making bogus files that we don't know about and never remove. For -+ # instance it was reported that on HP-UX the gcc test will end up -+ # making a dummy file named `D' -- because `-MD' means `put the output -+ # in D'. -+ mkdir conftest.dir -+ # Copy depcomp to subdir because otherwise we won't find it if we're -+ # using a relative directory. -+ cp "$am_depcomp" conftest.dir -+ cd conftest.dir -+ # We will build objects and dependencies in a subdirectory because -+ # it helps to detect inapplicable dependency modes. For instance -+ # both Tru64's cc and ICC support -MD to output dependencies as a -+ # side effect of compilation, but ICC will put the dependencies in -+ # the current directory while Tru64 will put them in the object -+ # directory. -+ mkdir sub -+ -+ am_cv_$1_dependencies_compiler_type=none -+ if test "$am_compiler_list" = ""; then -+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` -+ fi -+ am__universal=false -+ m4_case([$1], [CC], -+ [case " $depcc " in #( -+ *\ -arch\ *\ -arch\ *) am__universal=true ;; -+ esac], -+ [CXX], -+ [case " $depcc " in #( -+ *\ -arch\ *\ -arch\ *) am__universal=true ;; -+ esac]) -+ -+ for depmode in $am_compiler_list; do -+ # Setup a source with many dependencies, because some compilers -+ # like to wrap large dependency lists on column 80 (with \), and -+ # we should not choose a depcomp mode which is confused by this. -+ # -+ # We need to recreate these files for each test, as the compiler may -+ # overwrite some of them when testing with obscure command lines. -+ # This happens at least with the AIX C compiler. -+ : > sub/conftest.c -+ for i in 1 2 3 4 5 6; do -+ echo '#include "conftst'$i'.h"' >> sub/conftest.c -+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with -+ # Solaris 8's {/usr,}/bin/sh. -+ touch sub/conftst$i.h -+ done -+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf -+ -+ # We check with `-c' and `-o' for the sake of the "dashmstdout" -+ # mode. It turns out that the SunPro C++ compiler does not properly -+ # handle `-M -o', and we need to detect this. Also, some Intel -+ # versions had trouble with output in subdirs -+ am__obj=sub/conftest.${OBJEXT-o} -+ am__minus_obj="-o $am__obj" -+ case $depmode in -+ gcc) -+ # This depmode causes a compiler race in universal mode. -+ test "$am__universal" = false || continue -+ ;; -+ nosideeffect) -+ # after this tag, mechanisms are not by side-effect, so they'll -+ # only be used when explicitly requested -+ if test "x$enable_dependency_tracking" = xyes; then -+ continue -+ else -+ break -+ fi -+ ;; -+ msvisualcpp | msvcmsys) -+ # This compiler won't grok `-c -o', but also, the minuso test has -+ # not run yet. These depmodes are late enough in the game, and -+ # so weak that their functioning should not be impacted. -+ am__obj=conftest.${OBJEXT-o} -+ am__minus_obj= -+ ;; -+ none) break ;; -+ esac -+ if depmode=$depmode \ -+ source=sub/conftest.c object=$am__obj \ -+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ -+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ -+ >/dev/null 2>conftest.err && -+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && -+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && -+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 && -+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then -+ # icc doesn't choke on unknown options, it will just issue warnings -+ # or remarks (even with -Werror). So we grep stderr for any message -+ # that says an option was ignored or not supported. -+ # When given -MP, icc 7.0 and 7.1 complain thusly: -+ # icc: Command line warning: ignoring option '-M'; no argument required -+ # The diagnosis changed in icc 8.0: -+ # icc: Command line remark: option '-MP' not supported -+ if (grep 'ignoring option' conftest.err || -+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else -+ am_cv_$1_dependencies_compiler_type=$depmode -+ break -+ fi -+ fi -+ done -+ -+ cd .. -+ rm -rf conftest.dir -+else -+ am_cv_$1_dependencies_compiler_type=none -+fi -+]) -+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -+AM_CONDITIONAL([am__fastdep$1], [ -+ test "x$enable_dependency_tracking" != xno \ -+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -+]) -+ -+ -+# AM_SET_DEPDIR -+# ------------- -+# Choose a directory name for dependency files. -+# This macro is AC_REQUIREd in _AM_DEPENDENCIES -+AC_DEFUN([AM_SET_DEPDIR], -+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -+]) -+ -+ -+# AM_DEP_TRACK -+# ------------ -+AC_DEFUN([AM_DEP_TRACK], -+[AC_ARG_ENABLE(dependency-tracking, -+[ --disable-dependency-tracking speeds up one-time build -+ --enable-dependency-tracking do not reject slow dependency extractors]) -+if test "x$enable_dependency_tracking" != xno; then -+ am_depcomp="$ac_aux_dir/depcomp" -+ AMDEPBACKSLASH='\' -+fi -+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -+AC_SUBST([AMDEPBACKSLASH])dnl -+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -+]) -+ -+# Generate code to set up dependency tracking. -*- Autoconf -*- -+ -+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -+# Free Software Foundation, Inc. -+# -+# This file 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. -+ -+#serial 5 -+ -+# _AM_OUTPUT_DEPENDENCY_COMMANDS -+# ------------------------------ -+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -+[{ -+ # Autoconf 2.62 quotes --file arguments for eval, but not when files -+ # are listed without --file. Let's play safe and only enable the eval -+ # if we detect the quoting. -+ case $CONFIG_FILES in -+ *\'*) eval set x "$CONFIG_FILES" ;; -+ *) set x $CONFIG_FILES ;; -+ esac -+ shift -+ for mf -+ do -+ # Strip MF so we end up with the name of the file. -+ mf=`echo "$mf" | sed -e 's/:.*$//'` -+ # Check whether this is an Automake generated Makefile or not. -+ # We used to match only the files named `Makefile.in', but -+ # some people rename them; so instead we look at the file content. -+ # Grep'ing the first line is not enough: some people post-process -+ # each Makefile.in and add a new line on top of each file to say so. -+ # Grep'ing the whole file is not good either: AIX grep has a line -+ # limit of 2048, but all sed's we know have understand at least 4000. -+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then -+ dirpart=`AS_DIRNAME("$mf")` -+ else -+ continue -+ fi -+ # Extract the definition of DEPDIR, am__include, and am__quote -+ # from the Makefile without running `make'. -+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` -+ test -z "$DEPDIR" && continue -+ am__include=`sed -n 's/^am__include = //p' < "$mf"` -+ test -z "am__include" && continue -+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"` -+ # When using ansi2knr, U may be empty or an underscore; expand it -+ U=`sed -n 's/^U = //p' < "$mf"` -+ # Find all dependency output files, they are included files with -+ # $(DEPDIR) in their names. We invoke sed twice because it is the -+ # simplest approach to changing $(DEPDIR) to its actual value in the -+ # expansion. -+ for file in `sed -n " -+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ -+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do -+ # Make sure the directory exists. -+ test -f "$dirpart/$file" && continue -+ fdir=`AS_DIRNAME(["$file"])` -+ AS_MKDIR_P([$dirpart/$fdir]) -+ # echo "creating $dirpart/$file" -+ echo '# dummy' > "$dirpart/$file" -+ done -+ done -+} -+])# _AM_OUTPUT_DEPENDENCY_COMMANDS -+ -+ -+# AM_OUTPUT_DEPENDENCY_COMMANDS -+# ----------------------------- -+# This macro should only be invoked once -- use via AC_REQUIRE. -+# -+# This code is only required when automatic dependency tracking -+# is enabled. FIXME. This creates each `.P' file that we will -+# need in order to bootstrap the dependency handling code. -+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -+[AC_CONFIG_COMMANDS([depfiles], -+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], -+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -+]) -+ -+# Do all the work for Automake. -*- Autoconf -*- -+ -+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# serial 16 -+ -+# 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. -+ -+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -+# AM_INIT_AUTOMAKE([OPTIONS]) -+# ----------------------------------------------- -+# The call with PACKAGE and VERSION arguments is the old style -+# call (pre autoconf-2.50), which is being phased out. PACKAGE -+# and VERSION should now be passed to AC_INIT and removed from -+# the call to AM_INIT_AUTOMAKE. -+# We support both call styles for the transition. After -+# the next Automake release, Autoconf can make the AC_INIT -+# arguments mandatory, and then we can depend on a new Autoconf -+# release and drop the old call support. -+AC_DEFUN([AM_INIT_AUTOMAKE], -+[AC_PREREQ([2.62])dnl -+dnl Autoconf wants to disallow AM_ names. We explicitly allow -+dnl the ones we care about. -+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -+AC_REQUIRE([AC_PROG_INSTALL])dnl -+if test "`cd $srcdir && pwd`" != "`pwd`"; then -+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output -+ # is not polluted with repeated "-I." -+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl -+ # test to see if srcdir already configured -+ if test -f $srcdir/config.status; then -+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -+ fi -+fi -+ -+# test whether we have cygpath -+if test -z "$CYGPATH_W"; then -+ if (cygpath --version) >/dev/null 2>/dev/null; then -+ CYGPATH_W='cygpath -w' -+ else -+ CYGPATH_W=echo -+ fi -+fi -+AC_SUBST([CYGPATH_W]) -+ -+# Define the identity of the package. -+dnl Distinguish between old-style and new-style calls. -+m4_ifval([$2], -+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl -+ AC_SUBST([PACKAGE], [$1])dnl -+ AC_SUBST([VERSION], [$2])], -+[_AM_SET_OPTIONS([$1])dnl -+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, -+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl -+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl -+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl -+ -+_AM_IF_OPTION([no-define],, -+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl -+ -+# Some tools Automake needs. -+AC_REQUIRE([AM_SANITY_CHECK])dnl -+AC_REQUIRE([AC_ARG_PROGRAM])dnl -+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -+AM_MISSING_PROG(AUTOCONF, autoconf) -+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -+AM_MISSING_PROG(AUTOHEADER, autoheader) -+AM_MISSING_PROG(MAKEINFO, makeinfo) -+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -+AC_REQUIRE([AM_PROG_MKDIR_P])dnl -+# We need awk for the "check" target. The system "awk" is bad on -+# some platforms. -+AC_REQUIRE([AC_PROG_AWK])dnl -+AC_REQUIRE([AC_PROG_MAKE_SET])dnl -+AC_REQUIRE([AM_SET_LEADING_DOT])dnl -+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], -+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], -+ [_AM_PROG_TAR([v7])])]) -+_AM_IF_OPTION([no-dependencies],, -+[AC_PROVIDE_IFELSE([AC_PROG_CC], -+ [_AM_DEPENDENCIES(CC)], -+ [define([AC_PROG_CC], -+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -+AC_PROVIDE_IFELSE([AC_PROG_CXX], -+ [_AM_DEPENDENCIES(CXX)], -+ [define([AC_PROG_CXX], -+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -+AC_PROVIDE_IFELSE([AC_PROG_OBJC], -+ [_AM_DEPENDENCIES(OBJC)], -+ [define([AC_PROG_OBJC], -+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl -+]) -+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. -+AC_CONFIG_COMMANDS_PRE(dnl -+[m4_provide_if([_AM_COMPILER_EXEEXT], -+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -+]) -+ -+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -+dnl mangled by Autoconf and run in a shell conditional statement. -+m4_define([_AC_COMPILER_EXEEXT], -+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) -+ -+ -+# When config.status generates a header, we must update the stamp-h file. -+# This file resides in the same directory as the config header -+# that is generated. The stamp files are numbered to have different names. -+ -+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -+# loop where config.status creates the headers, so we can generate -+# our stamp files there. -+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -+[# Compute $1's index in $config_headers. -+_am_arg=$1 -+_am_stamp_count=1 -+for _am_header in $config_headers :; do -+ case $_am_header in -+ $_am_arg | $_am_arg:* ) -+ break ;; -+ * ) -+ _am_stamp_count=`expr $_am_stamp_count + 1` ;; -+ esac -+done -+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -+ -+# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# AM_PROG_INSTALL_SH -+# ------------------ -+# Define $install_sh. -+AC_DEFUN([AM_PROG_INSTALL_SH], -+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -+if test x"${install_sh}" != xset; then -+ case $am_aux_dir in -+ *\ * | *\ *) -+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; -+ *) -+ install_sh="\${SHELL} $am_aux_dir/install-sh" -+ esac -+fi -+AC_SUBST(install_sh)]) -+ -+# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# serial 2 -+ -+# Check whether the underlying file-system supports filenames -+# with a leading dot. For instance MS-DOS doesn't. -+AC_DEFUN([AM_SET_LEADING_DOT], -+[rm -rf .tst 2>/dev/null -+mkdir .tst 2>/dev/null -+if test -d .tst; then -+ am__leading_dot=. -+else -+ am__leading_dot=_ -+fi -+rmdir .tst 2>/dev/null -+AC_SUBST([am__leading_dot])]) -+ -+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- -+# From Jim Meyering -+ -+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -+# Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# serial 5 -+ -+# AM_MAINTAINER_MODE([DEFAULT-MODE]) -+# ---------------------------------- -+# Control maintainer-specific portions of Makefiles. -+# Default is to disable them, unless `enable' is passed literally. -+# For symmetry, `disable' may be passed as well. Anyway, the user -+# can override the default with the --enable/--disable switch. -+AC_DEFUN([AM_MAINTAINER_MODE], -+[m4_case(m4_default([$1], [disable]), -+ [enable], [m4_define([am_maintainer_other], [disable])], -+ [disable], [m4_define([am_maintainer_other], [enable])], -+ [m4_define([am_maintainer_other], [enable]) -+ m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) -+ dnl maintainer-mode's default is 'disable' unless 'enable' is passed -+ AC_ARG_ENABLE([maintainer-mode], -+[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful -+ (and sometimes confusing) to the casual installer], -+ [USE_MAINTAINER_MODE=$enableval], -+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) -+ AC_MSG_RESULT([$USE_MAINTAINER_MODE]) -+ AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) -+ MAINT=$MAINTAINER_MODE_TRUE -+ AC_SUBST([MAINT])dnl -+] -+) -+ -+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) -+ -+# Check to see how 'make' treats includes. -*- Autoconf -*- -+ -+# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# serial 4 -+ -+# AM_MAKE_INCLUDE() -+# ----------------- -+# Check to see how make treats includes. -+AC_DEFUN([AM_MAKE_INCLUDE], -+[am_make=${MAKE-make} -+cat > confinc << 'END' -+am__doit: -+ @echo this is the am__doit target -+.PHONY: am__doit -+END -+# If we don't find an include directive, just comment out the code. -+AC_MSG_CHECKING([for style of include used by $am_make]) -+am__include="#" -+am__quote= -+_am_result=none -+# First try GNU make style include. -+echo "include confinc" > confmf -+# Ignore all kinds of additional output from `make'. -+case `$am_make -s -f confmf 2> /dev/null` in #( -+*the\ am__doit\ target*) -+ am__include=include -+ am__quote= -+ _am_result=GNU -+ ;; -+esac -+# Now try BSD make style include. -+if test "$am__include" = "#"; then -+ echo '.include "confinc"' > confmf -+ case `$am_make -s -f confmf 2> /dev/null` in #( -+ *the\ am__doit\ target*) -+ am__include=.include -+ am__quote="\"" -+ _am_result=BSD -+ ;; -+ esac -+fi -+AC_SUBST([am__include]) -+AC_SUBST([am__quote]) -+AC_MSG_RESULT([$_am_result]) -+rm -f confinc confmf -+]) -+ -+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -+ -+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -+# Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# serial 6 -+ -+# AM_MISSING_PROG(NAME, PROGRAM) -+# ------------------------------ -+AC_DEFUN([AM_MISSING_PROG], -+[AC_REQUIRE([AM_MISSING_HAS_RUN]) -+$1=${$1-"${am_missing_run}$2"} -+AC_SUBST($1)]) -+ -+ -+# AM_MISSING_HAS_RUN -+# ------------------ -+# Define MISSING if not defined so far and test if it supports --run. -+# If it does, set am_missing_run to use it, otherwise, to nothing. -+AC_DEFUN([AM_MISSING_HAS_RUN], -+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -+AC_REQUIRE_AUX_FILE([missing])dnl -+if test x"${MISSING+set}" != xset; then -+ case $am_aux_dir in -+ *\ * | *\ *) -+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; -+ *) -+ MISSING="\${SHELL} $am_aux_dir/missing" ;; -+ esac -+fi -+# Use eval to expand $SHELL -+if eval "$MISSING --run true"; then -+ am_missing_run="$MISSING --run " -+else -+ am_missing_run= -+ AC_MSG_WARN([`missing' script is too old or missing]) -+fi -+]) -+ -+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# AM_PROG_MKDIR_P -+# --------------- -+# Check for `mkdir -p'. -+AC_DEFUN([AM_PROG_MKDIR_P], -+[AC_PREREQ([2.60])dnl -+AC_REQUIRE([AC_PROG_MKDIR_P])dnl -+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -+dnl while keeping a definition of mkdir_p for backward compatibility. -+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -+dnl Makefile.ins that do not define MKDIR_P, so we do our own -+dnl adjustment using top_builddir (which is defined more often than -+dnl MKDIR_P). -+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -+case $mkdir_p in -+ [[\\/$]]* | ?:[[\\/]]*) ;; -+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -+esac -+]) -+ -+# Helper functions for option handling. -*- Autoconf -*- -+ -+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# serial 4 -+ -+# _AM_MANGLE_OPTION(NAME) -+# ----------------------- -+AC_DEFUN([_AM_MANGLE_OPTION], -+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) -+ -+# _AM_SET_OPTION(NAME) -+# ------------------------------ -+# Set option NAME. Presently that only means defining a flag for this option. -+AC_DEFUN([_AM_SET_OPTION], -+[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) -+ -+# _AM_SET_OPTIONS(OPTIONS) -+# ---------------------------------- -+# OPTIONS is a space-separated list of Automake options. -+AC_DEFUN([_AM_SET_OPTIONS], -+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) -+ -+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -+# ------------------------------------------- -+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -+AC_DEFUN([_AM_IF_OPTION], -+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -+ -+# Check to make sure that the build environment is sane. -*- Autoconf -*- -+ -+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -+# Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# serial 5 -+ -+# AM_SANITY_CHECK -+# --------------- -+AC_DEFUN([AM_SANITY_CHECK], -+[AC_MSG_CHECKING([whether build environment is sane]) -+# Just in case -+sleep 1 -+echo timestamp > conftest.file -+# Reject unsafe characters in $srcdir or the absolute working directory -+# name. Accept space and tab only in the latter. -+am_lf=' -+' -+case `pwd` in -+ *[[\\\"\#\$\&\'\`$am_lf]]*) -+ AC_MSG_ERROR([unsafe absolute working directory name]);; -+esac -+case $srcdir in -+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) -+ AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; -+esac -+ -+# 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" conftest.file 2> /dev/null` -+ if test "$[*]" = "X"; then -+ # -L didn't work. -+ set X `ls -t "$srcdir/configure" conftest.file` -+ fi -+ rm -f conftest.file -+ if test "$[*]" != "X $srcdir/configure conftest.file" \ -+ && test "$[*]" != "X conftest.file $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]" = conftest.file -+ ) -+then -+ # Ok. -+ : -+else -+ AC_MSG_ERROR([newly created file is older than distributed files! -+Check your system clock]) -+fi -+AC_MSG_RESULT(yes)]) -+ -+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# AM_PROG_INSTALL_STRIP -+# --------------------- -+# One issue with vendor `install' (even GNU) is that you can't -+# specify the program used to strip binaries. This is especially -+# annoying in cross-compiling environments, where the build's strip -+# is unlikely to handle the host's binaries. -+# Fortunately install-sh will honor a STRIPPROG variable, so we -+# always use install-sh in `make install-strip', and initialize -+# STRIPPROG with the value of the STRIP variable (set by the user). -+AC_DEFUN([AM_PROG_INSTALL_STRIP], -+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -+# Installed binaries are usually stripped using `strip' when the user -+# run `make install-strip'. However `strip' might not be the right -+# tool to use in cross-compilation environments, therefore Automake -+# will honor the `STRIP' environment variable to overrule this program. -+dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -+if test "$cross_compiling" != no; then -+ AC_CHECK_TOOL([STRIP], [strip], :) -+fi -+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -+AC_SUBST([INSTALL_STRIP_PROGRAM])]) -+ -+# Copyright (C) 2006, 2008 Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# serial 2 -+ -+# _AM_SUBST_NOTMAKE(VARIABLE) -+# --------------------------- -+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -+# This macro is traced by Automake. -+AC_DEFUN([_AM_SUBST_NOTMAKE]) -+ -+# AM_SUBST_NOTMAKE(VARIABLE) -+# --------------------------- -+# Public sister of _AM_SUBST_NOTMAKE. -+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) -+ -+# Check how to create a tarball. -*- Autoconf -*- -+ -+# Copyright (C) 2004, 2005 Free Software Foundation, Inc. -+# -+# This file 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. -+ -+# serial 2 -+ -+# _AM_PROG_TAR(FORMAT) -+# -------------------- -+# Check how to create a tarball in format FORMAT. -+# FORMAT should be one of `v7', `ustar', or `pax'. -+# -+# Substitute a variable $(am__tar) that is a command -+# writing to stdout a FORMAT-tarball containing the directory -+# $tardir. -+# tardir=directory && $(am__tar) > result.tar -+# -+# Substitute a variable $(am__untar) that extract such -+# a tarball read from stdin. -+# $(am__untar) < result.tar -+AC_DEFUN([_AM_PROG_TAR], -+[# Always define AMTAR for backward compatibility. -+AM_MISSING_PROG([AMTAR], [tar]) -+m4_if([$1], [v7], -+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], -+ [m4_case([$1], [ustar],, [pax],, -+ [m4_fatal([Unknown tar format])]) -+AC_MSG_CHECKING([how to create a $1 tar archive]) -+# Loop over all known methods to create a tar archive until one works. -+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -+_am_tools=${am_cv_prog_tar_$1-$_am_tools} -+# Do not fold the above two line into one, because Tru64 sh and -+# Solaris sh will not grok spaces in the rhs of `-'. -+for _am_tool in $_am_tools -+do -+ case $_am_tool in -+ gnutar) -+ for _am_tar in tar gnutar gtar; -+ do -+ AM_RUN_LOG([$_am_tar --version]) && break -+ done -+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' -+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' -+ am__untar="$_am_tar -xf -" -+ ;; -+ plaintar) -+ # Must skip GNU tar: if it does not support --format= it doesn't create -+ # ustar tarball either. -+ (tar --version) >/dev/null 2>&1 && continue -+ am__tar='tar chf - "$$tardir"' -+ am__tar_='tar chf - "$tardir"' -+ am__untar='tar xf -' -+ ;; -+ pax) -+ am__tar='pax -L -x $1 -w "$$tardir"' -+ am__tar_='pax -L -x $1 -w "$tardir"' -+ am__untar='pax -r' -+ ;; -+ cpio) -+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L' -+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L' -+ am__untar='cpio -i -H $1 -d' -+ ;; -+ none) -+ am__tar=false -+ am__tar_=false -+ am__untar=false -+ ;; -+ esac -+ -+ # If the value was cached, stop now. We just wanted to have am__tar -+ # and am__untar set. -+ test -n "${am_cv_prog_tar_$1}" && break -+ -+ # tar/untar a dummy directory, and stop if the command works -+ rm -rf conftest.dir -+ mkdir conftest.dir -+ echo GrepMe > conftest.dir/file -+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) -+ rm -rf conftest.dir -+ if test -s conftest.tar; then -+ AM_RUN_LOG([$am__untar /dev/null 2>&1 && break -+ fi -+done -+rm -rf conftest.dir -+ -+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -+AC_MSG_RESULT([$am_cv_prog_tar_$1])]) -+AC_SUBST([am__tar]) -+AC_SUBST([am__untar]) -+]) # _AM_PROG_TAR -+ -+m4_include([../../../acinclude.m4]) -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/arpa/inet.h newlib-1.20.0/newlib/libc/sys/psp/arpa/inet.h ---- orig.newlib-1.20.0/newlib/libc/sys/psp/arpa/inet.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/arpa/inet.h 2012-01-11 22:42:35.780861713 +0100 -@@ -0,0 +1,26 @@ -+/* arpa/inet.h - Functions for converting IP addresses between strings and numbers */ -+ -+#ifndef _ARPA_INET_H_ -+#define _ARPA_INET_H_ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include -+ -+in_addr_t sceNetInetInetAddr(const char *ip); -+int sceNetInetInetAton(const char *ip, struct in_addr *in); -+const char* sceNetInetInetNtop(int af, const void *src, char *dst, socklen_t cnt); -+int sceNetInetInetPton(int af, const char *src, void *dst); -+ -+char *inet_ntoa(struct in_addr in); -+#define inet_addr sceNetInetInetAddr -+#define inet_aton sceNetInetInetAton -+#define inet_ntop sceNetInetInetNtop -+#define inet_pton sceNetInetInetPton -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* _ARPA_INET_H_ */ -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/confdefs.h newlib-1.20.0/newlib/libc/sys/psp/confdefs.h ---- orig.newlib-1.20.0/newlib/libc/sys/psp/confdefs.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/confdefs.h 2012-01-12 17:25:58.396837915 +0100 -@@ -0,0 +1 @@ -+ -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/configure newlib-1.20.0/newlib/libc/sys/psp/configure ---- orig.newlib-1.20.0/newlib/libc/sys/psp/configure 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/configure 2012-01-15 11:44:24.700707036 +0100 -@@ -0,0 +1,4745 @@ -+#! /bin/sh -+# Guess values for system-dependent variables and create Makefiles. -+# Generated by GNU Autoconf 2.68 for newlib 1.20.0. -+# -+# -+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -+# Foundation, Inc. -+# -+# -+# This configure script is free software; the Free Software Foundation -+# gives unlimited permission to copy, distribute and modify it. -+## -------------------- ## -+## M4sh Initialization. ## -+## -------------------- ## -+ -+# Be more Bourne compatible -+DUALCASE=1; export DUALCASE # for MKS sh -+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : -+ emulate sh -+ NULLCMD=: -+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which -+ # is contrary to our usage. Disable this feature. -+ alias -g '${1+"$@"}'='"$@"' -+ setopt NO_GLOB_SUBST -+else -+ case `(set -o) 2>/dev/null` in #( -+ *posix*) : -+ set -o posix ;; #( -+ *) : -+ ;; -+esac -+fi -+ -+ -+as_nl=' -+' -+export as_nl -+# Printing a long string crashes Solaris 7 /usr/bin/printf. -+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -+# Prefer a ksh shell builtin over an external printf program on Solaris, -+# but without wasting forks for bash or zsh. -+if test -z "$BASH_VERSION$ZSH_VERSION" \ -+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then -+ as_echo='print -r --' -+ as_echo_n='print -rn --' -+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then -+ as_echo='printf %s\n' -+ as_echo_n='printf %s' -+else -+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then -+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' -+ as_echo_n='/usr/ucb/echo -n' -+ else -+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"' -+ as_echo_n_body='eval -+ arg=$1; -+ case $arg in #( -+ *"$as_nl"*) -+ expr "X$arg" : "X\\(.*\\)$as_nl"; -+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; -+ esac; -+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" -+ ' -+ export as_echo_n_body -+ as_echo_n='sh -c $as_echo_n_body as_echo' -+ fi -+ export as_echo_body -+ as_echo='sh -c $as_echo_body as_echo' -+fi -+ -+# The user is always right. -+if test "${PATH_SEPARATOR+set}" != set; then -+ PATH_SEPARATOR=: -+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { -+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || -+ PATH_SEPARATOR=';' -+ } -+fi -+ -+ -+# IFS -+# We need space, tab and new line, in precisely that order. Quoting is -+# there to prevent editors from complaining about space-tab. -+# (If _AS_PATH_WALK were called with IFS unset, it would disable word -+# splitting by setting IFS to empty value.) -+IFS=" "" $as_nl" -+ -+# Find who we are. Look in the path if we contain no directory separator. -+as_myself= -+case $0 in #(( -+ *[\\/]* ) as_myself=$0 ;; -+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -+ done -+IFS=$as_save_IFS -+ -+ ;; -+esac -+# We did not find ourselves, most probably we were run as `sh COMMAND' -+# in which case we are not to be found in the path. -+if test "x$as_myself" = x; then -+ as_myself=$0 -+fi -+if test ! -f "$as_myself"; then -+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 -+ exit 1 -+fi -+ -+# Unset variables that we do not need and which cause bugs (e.g. in -+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -+# suppresses any "Segmentation fault" message there. '((' could -+# trigger a bug in pdksh 5.2.14. -+for as_var in BASH_ENV ENV MAIL MAILPATH -+do eval test x\${$as_var+set} = xset \ -+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -+done -+PS1='$ ' -+PS2='> ' -+PS4='+ ' -+ -+# NLS nuisances. -+LC_ALL=C -+export LC_ALL -+LANGUAGE=C -+export LANGUAGE -+ -+# CDPATH. -+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH -+ -+if test "x$CONFIG_SHELL" = x; then -+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : -+ emulate sh -+ NULLCMD=: -+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which -+ # is contrary to our usage. Disable this feature. -+ alias -g '\${1+\"\$@\"}'='\"\$@\"' -+ setopt NO_GLOB_SUBST -+else -+ case \`(set -o) 2>/dev/null\` in #( -+ *posix*) : -+ set -o posix ;; #( -+ *) : -+ ;; -+esac -+fi -+" -+ as_required="as_fn_return () { (exit \$1); } -+as_fn_success () { as_fn_return 0; } -+as_fn_failure () { as_fn_return 1; } -+as_fn_ret_success () { return 0; } -+as_fn_ret_failure () { return 1; } -+ -+exitcode=0 -+as_fn_success || { exitcode=1; echo as_fn_success failed.; } -+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : -+ -+else -+ exitcode=1; echo positional parameters were not saved. -+fi -+test x\$exitcode = x0 || exit 1" -+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO -+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO -+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && -+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" -+ if (eval "$as_required") 2>/dev/null; then : -+ as_have_required=yes -+else -+ as_have_required=no -+fi -+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -+ -+else -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+as_found=false -+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ as_found=: -+ case $as_dir in #( -+ /*) -+ for as_base in sh bash ksh sh5; do -+ # Try only shells that exist, to save several forks. -+ as_shell=$as_dir/$as_base -+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } && -+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : -+ CONFIG_SHELL=$as_shell as_have_required=yes -+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : -+ break 2 -+fi -+fi -+ done;; -+ esac -+ as_found=false -+done -+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && -+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : -+ CONFIG_SHELL=$SHELL as_have_required=yes -+fi; } -+IFS=$as_save_IFS -+ -+ -+ if test "x$CONFIG_SHELL" != x; then : -+ # We cannot yet assume a decent shell, so we have to provide a -+ # neutralization value for shells without unset; and this also -+ # works around shells that cannot unset nonexistent variables. -+ # Preserve -v and -x to the replacement shell. -+ BASH_ENV=/dev/null -+ ENV=/dev/null -+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -+ export CONFIG_SHELL -+ case $- in # (((( -+ *v*x* | *x*v* ) as_opts=-vx ;; -+ *v* ) as_opts=-v ;; -+ *x* ) as_opts=-x ;; -+ * ) as_opts= ;; -+ esac -+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} -+fi -+ -+ if test x$as_have_required = xno; then : -+ $as_echo "$0: This script requires a shell more modern than all" -+ $as_echo "$0: the shells that I found on your system." -+ if test x${ZSH_VERSION+set} = xset ; then -+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" -+ $as_echo "$0: be upgraded to zsh 4.3.4 or later." -+ else -+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -+$0: including any error possibly output before this -+$0: message. Then install a modern shell, or manually run -+$0: the script under such a shell if you do have one." -+ fi -+ exit 1 -+fi -+fi -+fi -+SHELL=${CONFIG_SHELL-/bin/sh} -+export SHELL -+# Unset more variables known to interfere with behavior of common tools. -+CLICOLOR_FORCE= GREP_OPTIONS= -+unset CLICOLOR_FORCE GREP_OPTIONS -+ -+## --------------------- ## -+## M4sh Shell Functions. ## -+## --------------------- ## -+# as_fn_unset VAR -+# --------------- -+# Portably unset VAR. -+as_fn_unset () -+{ -+ { eval $1=; unset $1;} -+} -+as_unset=as_fn_unset -+ -+# as_fn_set_status STATUS -+# ----------------------- -+# Set $? to STATUS, without forking. -+as_fn_set_status () -+{ -+ return $1 -+} # as_fn_set_status -+ -+# as_fn_exit STATUS -+# ----------------- -+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -+as_fn_exit () -+{ -+ set +e -+ as_fn_set_status $1 -+ exit $1 -+} # as_fn_exit -+ -+# as_fn_mkdir_p -+# ------------- -+# Create "$as_dir" as a directory, including parents if necessary. -+as_fn_mkdir_p () -+{ -+ -+ case $as_dir in #( -+ -*) as_dir=./$as_dir;; -+ esac -+ test -d "$as_dir" || eval $as_mkdir_p || { -+ as_dirs= -+ while :; do -+ case $as_dir in #( -+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( -+ *) as_qdir=$as_dir;; -+ esac -+ as_dirs="'$as_qdir' $as_dirs" -+ as_dir=`$as_dirname -- "$as_dir" || -+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_dir" : 'X\(//\)[^/]' \| \ -+ X"$as_dir" : 'X\(//\)$' \| \ -+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X"$as_dir" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)[^/].*/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ test -d "$as_dir" && break -+ done -+ test -z "$as_dirs" || eval "mkdir $as_dirs" -+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -+ -+ -+} # as_fn_mkdir_p -+# as_fn_append VAR VALUE -+# ---------------------- -+# Append the text in VALUE to the end of the definition contained in VAR. Take -+# advantage of any shell optimizations that allow amortized linear growth over -+# repeated appends, instead of the typical quadratic growth present in naive -+# implementations. -+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : -+ eval 'as_fn_append () -+ { -+ eval $1+=\$2 -+ }' -+else -+ as_fn_append () -+ { -+ eval $1=\$$1\$2 -+ } -+fi # as_fn_append -+ -+# as_fn_arith ARG... -+# ------------------ -+# Perform arithmetic evaluation on the ARGs, and store the result in the -+# global $as_val. Take advantage of shells that can avoid forks. The arguments -+# must be portable across $(()) and expr. -+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : -+ eval 'as_fn_arith () -+ { -+ as_val=$(( $* )) -+ }' -+else -+ as_fn_arith () -+ { -+ as_val=`expr "$@" || test $? -eq 1` -+ } -+fi # as_fn_arith -+ -+ -+# as_fn_error STATUS ERROR [LINENO LOG_FD] -+# ---------------------------------------- -+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -+# script with STATUS, using 1 if that was 0. -+as_fn_error () -+{ -+ as_status=$1; test $as_status -eq 0 && as_status=1 -+ if test "$4"; then -+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 -+ fi -+ $as_echo "$as_me: error: $2" >&2 -+ as_fn_exit $as_status -+} # as_fn_error -+ -+if expr a : '\(a\)' >/dev/null 2>&1 && -+ test "X`expr 00001 : '.*\(...\)'`" = X001; then -+ as_expr=expr -+else -+ as_expr=false -+fi -+ -+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then -+ as_basename=basename -+else -+ as_basename=false -+fi -+ -+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then -+ as_dirname=dirname -+else -+ as_dirname=false -+fi -+ -+as_me=`$as_basename -- "$0" || -+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ -+ X"$0" : 'X\(//\)$' \| \ -+ X"$0" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X/"$0" | -+ sed '/^.*\/\([^/][^/]*\)\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\/\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\/\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ -+# Avoid depending upon Character Ranges. -+as_cr_letters='abcdefghijklmnopqrstuvwxyz' -+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -+as_cr_Letters=$as_cr_letters$as_cr_LETTERS -+as_cr_digits='0123456789' -+as_cr_alnum=$as_cr_Letters$as_cr_digits -+ -+ -+ as_lineno_1=$LINENO as_lineno_1a=$LINENO -+ as_lineno_2=$LINENO as_lineno_2a=$LINENO -+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && -+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { -+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) -+ sed -n ' -+ p -+ /[$]LINENO/= -+ ' <$as_myself | -+ sed ' -+ s/[$]LINENO.*/&-/ -+ t lineno -+ b -+ :lineno -+ N -+ :loop -+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ -+ t loop -+ s/-\n.*// -+ ' >$as_me.lineno && -+ chmod +x "$as_me.lineno" || -+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } -+ -+ # Don't try to exec as it changes $[0], causing all sort of problems -+ # (the dirname of $[0] is not the place where we might find the -+ # original and so on. Autoconf is especially sensitive to this). -+ . "./$as_me.lineno" -+ # Exit status is that of the last command. -+ exit -+} -+ -+ECHO_C= ECHO_N= ECHO_T= -+case `echo -n x` in #((((( -+-n*) -+ case `echo 'xy\c'` in -+ *c*) ECHO_T=' ';; # ECHO_T is single tab character. -+ xy) ECHO_C='\c';; -+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null -+ ECHO_T=' ';; -+ esac;; -+*) -+ ECHO_N='-n';; -+esac -+ -+rm -f conf$$ conf$$.exe conf$$.file -+if test -d conf$$.dir; then -+ rm -f conf$$.dir/conf$$.file -+else -+ rm -f conf$$.dir -+ mkdir conf$$.dir 2>/dev/null -+fi -+if (echo >conf$$.file) 2>/dev/null; then -+ if ln -s conf$$.file conf$$ 2>/dev/null; then -+ as_ln_s='ln -s' -+ # ... but there are two gotchas: -+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. -+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. -+ # In both cases, we have to default to `cp -p'. -+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || -+ as_ln_s='cp -p' -+ elif ln conf$$.file conf$$ 2>/dev/null; then -+ as_ln_s=ln -+ else -+ as_ln_s='cp -p' -+ fi -+else -+ as_ln_s='cp -p' -+fi -+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -+rmdir conf$$.dir 2>/dev/null -+ -+if mkdir -p . 2>/dev/null; then -+ as_mkdir_p='mkdir -p "$as_dir"' -+else -+ test -d ./-p && rmdir ./-p -+ as_mkdir_p=false -+fi -+ -+if test -x / >/dev/null 2>&1; then -+ as_test_x='test -x' -+else -+ if ls -dL / >/dev/null 2>&1; then -+ as_ls_L_option=L -+ else -+ as_ls_L_option= -+ fi -+ as_test_x=' -+ eval sh -c '\'' -+ if test -d "$1"; then -+ test -d "$1/."; -+ else -+ case $1 in #( -+ -*)set "./$1";; -+ esac; -+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( -+ ???[sx]*):;;*)false;;esac;fi -+ '\'' sh -+ ' -+fi -+as_executable_p=$as_test_x -+ -+# Sed expression to map a string onto a valid CPP name. -+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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -+ -+ -+test -n "$DJDIR" || exec 7<&0 &1 -+ -+# Name of the host. -+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -+# so uname gets run too. -+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -+ -+# -+# Initializations. -+# -+ac_default_prefix=/usr/local -+ac_clean_files= -+ac_config_libobj_dir=. -+LIBOBJS= -+cross_compiling=no -+subdirs= -+MFLAGS= -+MAKEFLAGS= -+ -+# Identity of this package. -+PACKAGE_NAME='newlib' -+PACKAGE_TARNAME='newlib' -+PACKAGE_VERSION='1.20.0' -+PACKAGE_STRING='newlib 1.20.0' -+PACKAGE_BUGREPORT='' -+PACKAGE_URL='' -+ -+ac_unique_file="libcglue.c" -+ac_subst_vars='LTLIBOBJS -+LIBOBJS -+sys_dir -+machine_dir -+libm_machine_dir -+lpfx -+aext -+oext -+OBJEXT -+USE_LIBTOOL_FALSE -+USE_LIBTOOL_TRUE -+ELIX_LEVEL_4_FALSE -+ELIX_LEVEL_4_TRUE -+ELIX_LEVEL_3_FALSE -+ELIX_LEVEL_3_TRUE -+ELIX_LEVEL_2_FALSE -+ELIX_LEVEL_2_TRUE -+ELIX_LEVEL_1_FALSE -+ELIX_LEVEL_1_TRUE -+ELIX_LEVEL_0_FALSE -+ELIX_LEVEL_0_TRUE -+LDFLAGS -+NO_INCLUDE_LIST -+NEWLIB_CFLAGS -+CCASFLAGS -+CCAS -+MAINT -+MAINTAINER_MODE_FALSE -+MAINTAINER_MODE_TRUE -+READELF -+RANLIB -+AR -+AS -+am__fastdepCC_FALSE -+am__fastdepCC_TRUE -+CCDEPMODE -+AMDEPBACKSLASH -+AMDEP_FALSE -+AMDEP_TRUE -+am__quote -+am__include -+DEPDIR -+CC -+am__untar -+am__tar -+AMTAR -+am__leading_dot -+SET_MAKE -+AWK -+mkdir_p -+MKDIR_P -+INSTALL_STRIP_PROGRAM -+STRIP -+install_sh -+MAKEINFO -+AUTOHEADER -+AUTOMAKE -+AUTOCONF -+ACLOCAL -+VERSION -+PACKAGE -+CYGPATH_W -+am__isrc -+INSTALL_DATA -+INSTALL_SCRIPT -+INSTALL_PROGRAM -+host_os -+host_vendor -+host_cpu -+host -+build_os -+build_vendor -+build_cpu -+build -+newlib_basedir -+MAY_SUPPLY_SYSCALLS_FALSE -+MAY_SUPPLY_SYSCALLS_TRUE -+target_alias -+host_alias -+build_alias -+LIBS -+ECHO_T -+ECHO_N -+ECHO_C -+DEFS -+mandir -+localedir -+libdir -+psdir -+pdfdir -+dvidir -+htmldir -+infodir -+docdir -+oldincludedir -+includedir -+localstatedir -+sharedstatedir -+sysconfdir -+datadir -+datarootdir -+libexecdir -+sbindir -+bindir -+program_transform_name -+prefix -+exec_prefix -+PACKAGE_URL -+PACKAGE_BUGREPORT -+PACKAGE_STRING -+PACKAGE_VERSION -+PACKAGE_TARNAME -+PACKAGE_NAME -+PATH_SEPARATOR -+SHELL' -+ac_subst_files='' -+ac_user_opts=' -+enable_option_checking -+enable_multilib -+enable_target_optspace -+enable_malloc_debugging -+enable_newlib_multithread -+enable_newlib_iconv -+enable_newlib_elix_level -+enable_newlib_io_float -+enable_newlib_supplied_syscalls -+enable_dependency_tracking -+enable_maintainer_mode -+' -+ ac_precious_vars='build_alias -+host_alias -+target_alias -+CCAS -+CCASFLAGS' -+ -+ -+# Initialize some variables set by options. -+ac_init_help= -+ac_init_version=false -+ac_unrecognized_opts= -+ac_unrecognized_sep= -+# The variables have the same names as the options, with -+# dashes changed to underlines. -+cache_file=/dev/null -+exec_prefix=NONE -+no_create= -+no_recursion= -+prefix=NONE -+program_prefix=NONE -+program_suffix=NONE -+program_transform_name=s,x,x, -+silent= -+site= -+srcdir= -+verbose= -+x_includes=NONE -+x_libraries=NONE -+ -+# Installation directory options. -+# These are left unexpanded so users can "make install exec_prefix=/foo" -+# and all the variables that are supposed to be based on exec_prefix -+# by default will actually change. -+# Use braces instead of parens because sh, perl, etc. also accept them. -+# (The list follows the same order as the GNU Coding Standards.) -+bindir='${exec_prefix}/bin' -+sbindir='${exec_prefix}/sbin' -+libexecdir='${exec_prefix}/libexec' -+datarootdir='${prefix}/share' -+datadir='${datarootdir}' -+sysconfdir='${prefix}/etc' -+sharedstatedir='${prefix}/com' -+localstatedir='${prefix}/var' -+includedir='${prefix}/include' -+oldincludedir='/usr/include' -+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -+infodir='${datarootdir}/info' -+htmldir='${docdir}' -+dvidir='${docdir}' -+pdfdir='${docdir}' -+psdir='${docdir}' -+libdir='${exec_prefix}/lib' -+localedir='${datarootdir}/locale' -+mandir='${datarootdir}/man' -+ -+ac_prev= -+ac_dashdash= -+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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; -+ *=) ac_optarg= ;; -+ *) ac_optarg=yes ;; -+ esac -+ -+ # Accept the important Cygnus configure options, so we can diagnose typos. -+ -+ case $ac_dashdash$ac_option in -+ --) -+ ac_dashdash=yes ;; -+ -+ -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_alias ;; -+ -build=* | --build=* | --buil=* | --bui=* | --bu=*) -+ build_alias=$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 ;; -+ -+ --config-cache | -C) -+ cache_file=config.cache ;; -+ -+ -datadir | --datadir | --datadi | --datad) -+ ac_prev=datadir ;; -+ -datadir=* | --datadir=* | --datadi=* | --datad=*) -+ datadir=$ac_optarg ;; -+ -+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ -+ | --dataroo | --dataro | --datar) -+ ac_prev=datarootdir ;; -+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ -+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) -+ datarootdir=$ac_optarg ;; -+ -+ -disable-* | --disable-*) -+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` -+ # Reject names that are not valid shell variable names. -+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -+ as_fn_error $? "invalid feature name: $ac_useropt" -+ ac_useropt_orig=$ac_useropt -+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` -+ case $ac_user_opts in -+ *" -+"enable_$ac_useropt" -+"*) ;; -+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" -+ ac_unrecognized_sep=', ';; -+ esac -+ eval enable_$ac_useropt=no ;; -+ -+ -docdir | --docdir | --docdi | --doc | --do) -+ ac_prev=docdir ;; -+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) -+ docdir=$ac_optarg ;; -+ -+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) -+ ac_prev=dvidir ;; -+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) -+ dvidir=$ac_optarg ;; -+ -+ -enable-* | --enable-*) -+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` -+ # Reject names that are not valid shell variable names. -+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -+ as_fn_error $? "invalid feature name: $ac_useropt" -+ ac_useropt_orig=$ac_useropt -+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` -+ case $ac_user_opts in -+ *" -+"enable_$ac_useropt" -+"*) ;; -+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" -+ ac_unrecognized_sep=', ';; -+ esac -+ eval enable_$ac_useropt=\$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 | -h) -+ ac_init_help=long ;; -+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) -+ ac_init_help=recursive ;; -+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) -+ ac_init_help=short ;; -+ -+ -host | --host | --hos | --ho) -+ ac_prev=host_alias ;; -+ -host=* | --host=* | --hos=* | --ho=*) -+ host_alias=$ac_optarg ;; -+ -+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) -+ ac_prev=htmldir ;; -+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ -+ | --ht=*) -+ htmldir=$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 ;; -+ -+ -localedir | --localedir | --localedi | --localed | --locale) -+ ac_prev=localedir ;; -+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) -+ localedir=$ac_optarg ;; -+ -+ -localstatedir | --localstatedir | --localstatedi | --localstated \ -+ | --localstate | --localstat | --localsta | --localst | --locals) -+ ac_prev=localstatedir ;; -+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ -+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) -+ 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 | -n) -+ 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 ;; -+ -+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) -+ ac_prev=pdfdir ;; -+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) -+ pdfdir=$ac_optarg ;; -+ -+ -psdir | --psdir | --psdi | --psd | --ps) -+ ac_prev=psdir ;; -+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) -+ psdir=$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_alias ;; -+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) -+ target_alias=$ac_optarg ;; -+ -+ -v | -verbose | --verbose | --verbos | --verbo | --verb) -+ verbose=yes ;; -+ -+ -version | --version | --versio | --versi | --vers | -V) -+ ac_init_version=: ;; -+ -+ -with-* | --with-*) -+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` -+ # Reject names that are not valid shell variable names. -+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -+ as_fn_error $? "invalid package name: $ac_useropt" -+ ac_useropt_orig=$ac_useropt -+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` -+ case $ac_user_opts in -+ *" -+"with_$ac_useropt" -+"*) ;; -+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" -+ ac_unrecognized_sep=', ';; -+ esac -+ eval with_$ac_useropt=\$ac_optarg ;; -+ -+ -without-* | --without-*) -+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` -+ # Reject names that are not valid shell variable names. -+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -+ as_fn_error $? "invalid package name: $ac_useropt" -+ ac_useropt_orig=$ac_useropt -+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` -+ case $ac_user_opts in -+ *" -+"with_$ac_useropt" -+"*) ;; -+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" -+ ac_unrecognized_sep=', ';; -+ esac -+ eval with_$ac_useropt=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 ;; -+ -+ -*) as_fn_error $? "unrecognized option: \`$ac_option' -+Try \`$0 --help' for more information" -+ ;; -+ -+ *=*) -+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` -+ # Reject names that are not valid shell variable names. -+ case $ac_envvar in #( -+ '' | [0-9]* | *[!_$as_cr_alnum]* ) -+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; -+ esac -+ eval $ac_envvar=\$ac_optarg -+ export $ac_envvar ;; -+ -+ *) -+ # FIXME: should be removed in autoconf 3.0. -+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 -+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && -+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 -+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" -+ ;; -+ -+ esac -+done -+ -+if test -n "$ac_prev"; then -+ ac_option=--`echo $ac_prev | sed 's/_/-/g'` -+ as_fn_error $? "missing argument to $ac_option" -+fi -+ -+if test -n "$ac_unrecognized_opts"; then -+ case $enable_option_checking in -+ no) ;; -+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; -+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; -+ esac -+fi -+ -+# Check all directory arguments for consistency. -+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ -+ datadir sysconfdir sharedstatedir localstatedir includedir \ -+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ -+ libdir localedir mandir -+do -+ eval ac_val=\$$ac_var -+ # Remove trailing slashes. -+ case $ac_val in -+ */ ) -+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` -+ eval $ac_var=\$ac_val;; -+ esac -+ # Be sure to have absolute directory names. -+ case $ac_val in -+ [\\/$]* | ?:[\\/]* ) continue;; -+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;; -+ esac -+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -+done -+ -+# There might be people who depend on the old broken behavior: `$host' -+# used to hold the argument of --host etc. -+# FIXME: To remove some day. -+build=$build_alias -+host=$host_alias -+target=$target_alias -+ -+# FIXME: To remove some day. -+if test "x$host_alias" != x; then -+ if test "x$build_alias" = x; then -+ cross_compiling=maybe -+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. -+ If a cross compiler is detected then cross compile mode will be used" >&2 -+ elif test "x$build_alias" != "x$host_alias"; then -+ cross_compiling=yes -+ fi -+fi -+ -+ac_tool_prefix= -+test -n "$host_alias" && ac_tool_prefix=$host_alias- -+ -+test "$silent" = yes && exec 6>/dev/null -+ -+ -+ac_pwd=`pwd` && test -n "$ac_pwd" && -+ac_ls_di=`ls -di .` && -+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || -+ as_fn_error $? "working directory cannot be determined" -+test "X$ac_ls_di" = "X$ac_pwd_ls_di" || -+ as_fn_error $? "pwd does not report name of working directory" -+ -+ -+# 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 the parent directory. -+ ac_confdir=`$as_dirname -- "$as_myself" || -+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_myself" : 'X\(//\)[^/]' \| \ -+ X"$as_myself" : 'X\(//\)$' \| \ -+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X"$as_myself" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)[^/].*/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ 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 -+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." -+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -+fi -+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -+ac_abs_confdir=`( -+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" -+ pwd)` -+# When building in place, set srcdir=. -+if test "$ac_abs_confdir" = "$ac_pwd"; then -+ srcdir=. -+fi -+# Remove unnecessary trailing slashes from srcdir. -+# Double slashes in file names in object file debugging info -+# mess up M-x gdb in Emacs. -+case $srcdir in -+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -+esac -+for ac_var in $ac_precious_vars; do -+ eval ac_env_${ac_var}_set=\${${ac_var}+set} -+ eval ac_env_${ac_var}_value=\$${ac_var} -+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} -+ eval ac_cv_env_${ac_var}_value=\$${ac_var} -+done -+ -+# -+# Report the --help message. -+# -+if test "$ac_init_help" = "long"; then -+ # 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 <<_ACEOF -+\`configure' configures newlib 1.20.0 to adapt to many kinds of systems. -+ -+Usage: $0 [OPTION]... [VAR=VALUE]... -+ -+To assign environment variables (e.g., CC, CFLAGS...), specify them as -+VAR=VALUE. See below for descriptions of some of the useful variables. -+ -+Defaults for the options are specified in brackets. -+ -+Configuration: -+ -h, --help display this help and exit -+ --help=short display options specific to this package -+ --help=recursive display the short help of all the included packages -+ -V, --version display version information and exit -+ -q, --quiet, --silent do not print \`checking ...' messages -+ --cache-file=FILE cache test results in FILE [disabled] -+ -C, --config-cache alias for \`--cache-file=config.cache' -+ -n, --no-create do not create output files -+ --srcdir=DIR find the sources in DIR [configure dir or \`..'] -+ -+Installation directories: -+ --prefix=PREFIX install architecture-independent files in PREFIX -+ [$ac_default_prefix] -+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX -+ [PREFIX] -+ -+By default, \`make install' will install all the files in -+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -+an installation prefix other than \`$ac_default_prefix' using \`--prefix', -+for instance \`--prefix=\$HOME'. -+ -+For better control, use the options below. -+ -+Fine tuning of the installation directories: -+ --bindir=DIR user executables [EPREFIX/bin] -+ --sbindir=DIR system admin executables [EPREFIX/sbin] -+ --libexecdir=DIR program executables [EPREFIX/libexec] -+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] -+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] -+ --localstatedir=DIR modifiable single-machine data [PREFIX/var] -+ --libdir=DIR object code libraries [EPREFIX/lib] -+ --includedir=DIR C header files [PREFIX/include] -+ --oldincludedir=DIR C header files for non-gcc [/usr/include] -+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] -+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR] -+ --infodir=DIR info documentation [DATAROOTDIR/info] -+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale] -+ --mandir=DIR man documentation [DATAROOTDIR/man] -+ --docdir=DIR documentation root [DATAROOTDIR/doc/newlib] -+ --htmldir=DIR html documentation [DOCDIR] -+ --dvidir=DIR dvi documentation [DOCDIR] -+ --pdfdir=DIR pdf documentation [DOCDIR] -+ --psdir=DIR ps documentation [DOCDIR] -+_ACEOF -+ -+ cat <<\_ACEOF -+ -+Program names: -+ --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 -+ -+System types: -+ --build=BUILD configure for building on BUILD [guessed] -+ --host=HOST cross-compile to build programs to run on HOST [BUILD] -+_ACEOF -+fi -+ -+if test -n "$ac_init_help"; then -+ case $ac_init_help in -+ short | recursive ) echo "Configuration of newlib 1.20.0:";; -+ esac -+ cat <<\_ACEOF -+ -+Optional Features: -+ --disable-option-checking ignore unrecognized --enable/--with options -+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) -+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] -+ --enable-multilib build many library versions (default) -+ --enable-target-optspace optimize for space -+ --enable-malloc-debugging indicate malloc debugging requested -+ --enable-newlib-multithread enable support for multiple threads -+ --enable-newlib-iconv enable iconv library support -+ --enable-newlib-elix-level supply desired elix library level (1-4) -+ --disable-newlib-io-float disable printf/scanf family float support -+ --disable-newlib-supplied-syscalls disable newlib from supplying syscalls -+ --disable-dependency-tracking speeds up one-time build -+ --enable-dependency-tracking do not reject slow dependency extractors -+ --enable-maintainer-mode enable make rules and dependencies not useful -+ (and sometimes confusing) to the casual installer -+ -+Some influential environment variables: -+ CCAS assembler compiler command (defaults to CC) -+ CCASFLAGS assembler compiler flags (defaults to CFLAGS) -+ -+Use these variables to override the choices made by `configure' or to help -+it to find libraries and programs with nonstandard names/locations. -+ -+Report bugs to the package provider. -+_ACEOF -+ac_status=$? -+fi -+ -+if test "$ac_init_help" = "recursive"; then -+ # If there are subdirs, report their specific --help. -+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue -+ test -d "$ac_dir" || -+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || -+ continue -+ ac_builddir=. -+ -+case "$ac_dir" in -+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -+*) -+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` -+ # A ".." for each directory in $ac_dir_suffix. -+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` -+ case $ac_top_builddir_sub in -+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;; -+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; -+ esac ;; -+esac -+ac_abs_top_builddir=$ac_pwd -+ac_abs_builddir=$ac_pwd$ac_dir_suffix -+# for backward compatibility: -+ac_top_builddir=$ac_top_build_prefix -+ -+case $srcdir in -+ .) # We are building in place. -+ ac_srcdir=. -+ ac_top_srcdir=$ac_top_builddir_sub -+ ac_abs_top_srcdir=$ac_pwd ;; -+ [\\/]* | ?:[\\/]* ) # Absolute name. -+ ac_srcdir=$srcdir$ac_dir_suffix; -+ ac_top_srcdir=$srcdir -+ ac_abs_top_srcdir=$srcdir ;; -+ *) # Relative name. -+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix -+ ac_top_srcdir=$ac_top_build_prefix$srcdir -+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -+esac -+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -+ -+ cd "$ac_dir" || { ac_status=$?; continue; } -+ # Check for guested configure. -+ if test -f "$ac_srcdir/configure.gnu"; then -+ echo && -+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive -+ elif test -f "$ac_srcdir/configure"; then -+ echo && -+ $SHELL "$ac_srcdir/configure" --help=recursive -+ else -+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 -+ fi || ac_status=$? -+ cd "$ac_pwd" || { ac_status=$?; break; } -+ done -+fi -+ -+test -n "$ac_init_help" && exit $ac_status -+if $ac_init_version; then -+ cat <<\_ACEOF -+newlib configure 1.20.0 -+generated by GNU Autoconf 2.68 -+ -+Copyright (C) 2010 Free Software Foundation, Inc. -+This configure script is free software; the Free Software Foundation -+gives unlimited permission to copy, distribute and modify it. -+_ACEOF -+ exit -+fi -+ -+## ------------------------ ## -+## Autoconf initialization. ## -+## ------------------------ ## -+ -+# ac_fn_c_try_compile LINENO -+# -------------------------- -+# Try to compile conftest.$ac_ext, and return whether this succeeded. -+ac_fn_c_try_compile () -+{ -+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ rm -f conftest.$ac_objext -+ if { { ac_try="$ac_compile" -+case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -+$as_echo "$ac_try_echo"; } >&5 -+ (eval "$ac_compile") 2>conftest.err -+ ac_status=$? -+ if test -s conftest.err; then -+ grep -v '^ *+' conftest.err >conftest.er1 -+ cat conftest.er1 >&5 -+ mv -f conftest.er1 conftest.err -+ fi -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; } && { -+ test -z "$ac_c_werror_flag" || -+ test ! -s conftest.err -+ } && test -s conftest.$ac_objext; then : -+ ac_retval=0 -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_retval=1 -+fi -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ as_fn_set_status $ac_retval -+ -+} # ac_fn_c_try_compile -+cat >config.log <<_ACEOF -+This file contains any messages produced by compilers while -+running configure, to aid debugging if configure makes a mistake. -+ -+It was created by newlib $as_me 1.20.0, which was -+generated by GNU Autoconf 2.68. Invocation command line was -+ -+ $ $0 $@ -+ -+_ACEOF -+exec 5>>config.log -+{ -+cat <<_ASUNAME -+## --------- ## -+## Platform. ## -+## --------- ## -+ -+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -+uname -m = `(uname -m) 2>/dev/null || echo unknown` -+uname -r = `(uname -r) 2>/dev/null || echo unknown` -+uname -s = `(uname -s) 2>/dev/null || echo unknown` -+uname -v = `(uname -v) 2>/dev/null || echo unknown` -+ -+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` -+ -+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` -+ -+_ASUNAME -+ -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ $as_echo "PATH: $as_dir" -+ done -+IFS=$as_save_IFS -+ -+} >&5 -+ -+cat >&5 <<_ACEOF -+ -+ -+## ----------- ## -+## Core tests. ## -+## ----------- ## -+ -+_ACEOF -+ -+ -+# Keep a trace of the command line. -+# Strip out --no-create and --no-recursion so they do not pile up. -+# Strip out --silent because we don't want to record it for future runs. -+# Also quote any args containing shell meta-characters. -+# Make two passes to allow for proper duplicate-argument suppression. -+ac_configure_args= -+ac_configure_args0= -+ac_configure_args1= -+ac_must_keep_next=false -+for ac_pass in 1 2 -+do -+ for ac_arg -+ do -+ case $ac_arg in -+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ -+ | -silent | --silent | --silen | --sile | --sil) -+ continue ;; -+ *\'*) -+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; -+ esac -+ case $ac_pass in -+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; -+ 2) -+ as_fn_append ac_configure_args1 " '$ac_arg'" -+ if test $ac_must_keep_next = true; then -+ ac_must_keep_next=false # Got value, back to normal. -+ else -+ case $ac_arg in -+ *=* | --config-cache | -C | -disable-* | --disable-* \ -+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ -+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ -+ | -with-* | --with-* | -without-* | --without-* | --x) -+ case "$ac_configure_args0 " in -+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; -+ esac -+ ;; -+ -* ) ac_must_keep_next=true ;; -+ esac -+ fi -+ as_fn_append ac_configure_args " '$ac_arg'" -+ ;; -+ esac -+ done -+done -+{ ac_configure_args0=; unset ac_configure_args0;} -+{ ac_configure_args1=; unset ac_configure_args1;} -+ -+# When interrupted or exit'd, cleanup temporary files, and complete -+# config.log. We remove comments because anyway the quotes in there -+# would cause problems or look ugly. -+# WARNING: Use '\'' to represent an apostrophe within the trap. -+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -+trap 'exit_status=$? -+ # Save into config.log some information that might help in debugging. -+ { -+ echo -+ -+ $as_echo "## ---------------- ## -+## Cache variables. ## -+## ---------------- ##" -+ echo -+ # The following way of writing the cache mishandles newlines in values, -+( -+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do -+ eval ac_val=\$$ac_var -+ case $ac_val in #( -+ *${as_nl}*) -+ case $ac_var in #( -+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; -+ esac -+ case $ac_var in #( -+ _ | IFS | as_nl) ;; #( -+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( -+ *) { eval $ac_var=; unset $ac_var;} ;; -+ esac ;; -+ esac -+ done -+ (set) 2>&1 | -+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( -+ *${as_nl}ac_space=\ *) -+ sed -n \ -+ "s/'\''/'\''\\\\'\'''\''/g; -+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" -+ ;; #( -+ *) -+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" -+ ;; -+ esac | -+ sort -+) -+ echo -+ -+ $as_echo "## ----------------- ## -+## Output variables. ## -+## ----------------- ##" -+ echo -+ for ac_var in $ac_subst_vars -+ do -+ eval ac_val=\$$ac_var -+ case $ac_val in -+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; -+ esac -+ $as_echo "$ac_var='\''$ac_val'\''" -+ done | sort -+ echo -+ -+ if test -n "$ac_subst_files"; then -+ $as_echo "## ------------------- ## -+## File substitutions. ## -+## ------------------- ##" -+ echo -+ for ac_var in $ac_subst_files -+ do -+ eval ac_val=\$$ac_var -+ case $ac_val in -+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; -+ esac -+ $as_echo "$ac_var='\''$ac_val'\''" -+ done | sort -+ echo -+ fi -+ -+ if test -s confdefs.h; then -+ $as_echo "## ----------- ## -+## confdefs.h. ## -+## ----------- ##" -+ echo -+ cat confdefs.h -+ echo -+ fi -+ test "$ac_signal" != 0 && -+ $as_echo "$as_me: caught signal $ac_signal" -+ $as_echo "$as_me: exit $exit_status" -+ } >&5 -+ rm -f core *.core core.conftest.* && -+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files && -+ exit $exit_status -+' 0 -+for ac_signal in 1 2 13 15; do -+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -+done -+ac_signal=0 -+ -+# confdefs.h avoids OS command line length limits that DEFS can exceed. -+rm -f -r conftest* confdefs.h -+ -+$as_echo "/* confdefs.h */" > confdefs.h -+ -+# Predefined preprocessor variables. -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_NAME "$PACKAGE_NAME" -+_ACEOF -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -+_ACEOF -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_VERSION "$PACKAGE_VERSION" -+_ACEOF -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_STRING "$PACKAGE_STRING" -+_ACEOF -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -+_ACEOF -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_URL "$PACKAGE_URL" -+_ACEOF -+ -+ -+# Let the site file select an alternate cache file if it wants to. -+# Prefer an explicitly selected file to automatically selected ones. -+ac_site_file1=NONE -+ac_site_file2=NONE -+if test -n "$CONFIG_SITE"; then -+ # We do not want a PATH search for config.site. -+ case $CONFIG_SITE in #(( -+ -*) ac_site_file1=./$CONFIG_SITE;; -+ */*) ac_site_file1=$CONFIG_SITE;; -+ *) ac_site_file1=./$CONFIG_SITE;; -+ esac -+elif test "x$prefix" != xNONE; then -+ ac_site_file1=$prefix/share/config.site -+ ac_site_file2=$prefix/etc/config.site -+else -+ ac_site_file1=$ac_default_prefix/share/config.site -+ ac_site_file2=$ac_default_prefix/etc/config.site -+fi -+for ac_site_file in "$ac_site_file1" "$ac_site_file2" -+do -+ test "x$ac_site_file" = xNONE && continue -+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -+$as_echo "$as_me: loading site script $ac_site_file" >&6;} -+ sed 's/^/| /' "$ac_site_file" >&5 -+ . "$ac_site_file" \ -+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+as_fn_error $? "failed to load site script $ac_site_file -+See \`config.log' for more details" "$LINENO" 5; } -+ fi -+done -+ -+if test -r "$cache_file"; then -+ # Some versions of bash will fail to source /dev/null (special files -+ # actually), so we avoid doing that. DJGPP emulates it as a regular file. -+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -+$as_echo "$as_me: loading cache $cache_file" >&6;} -+ case $cache_file in -+ [\\/]* | ?:[\\/]* ) . "$cache_file";; -+ *) . "./$cache_file";; -+ esac -+ fi -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -+$as_echo "$as_me: creating cache $cache_file" >&6;} -+ >$cache_file -+fi -+ -+# Check that the precious variables saved in the cache have kept the same -+# value. -+ac_cache_corrupted=false -+for ac_var in $ac_precious_vars; do -+ eval ac_old_set=\$ac_cv_env_${ac_var}_set -+ eval ac_new_set=\$ac_env_${ac_var}_set -+ eval ac_old_val=\$ac_cv_env_${ac_var}_value -+ eval ac_new_val=\$ac_env_${ac_var}_value -+ case $ac_old_set,$ac_new_set in -+ set,) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} -+ ac_cache_corrupted=: ;; -+ ,set) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} -+ ac_cache_corrupted=: ;; -+ ,);; -+ *) -+ if test "x$ac_old_val" != "x$ac_new_val"; then -+ # differences in whitespace do not lead to failure. -+ ac_old_val_w=`echo x $ac_old_val` -+ ac_new_val_w=`echo x $ac_new_val` -+ if test "$ac_old_val_w" != "$ac_new_val_w"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} -+ ac_cache_corrupted=: -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} -+ eval $ac_var=\$ac_old_val -+ fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} -+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} -+ fi;; -+ esac -+ # Pass precious variables to config.status. -+ if test "$ac_new_set" = set; then -+ case $ac_new_val in -+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; -+ *) ac_arg=$ac_var=$ac_new_val ;; -+ esac -+ case " $ac_configure_args " in -+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. -+ *) as_fn_append ac_configure_args " '$ac_arg'" ;; -+ esac -+ fi -+done -+if $ac_cache_corrupted; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} -+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -+fi -+## -------------------- ## -+## Main body of script. ## -+## -------------------- ## -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+ -+ -+ -+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 -+ elif test -f "$ac_dir/shtool"; then -+ ac_aux_dir=$ac_dir -+ ac_install_sh="$ac_aux_dir/shtool install -c" -+ break -+ fi -+done -+if test -z "$ac_aux_dir"; then -+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../../.. \"$srcdir\"/../../../.." "$LINENO" 5 -+fi -+ -+# These three variables are undocumented and unsupported, -+# and are intended to be withdrawn in a future Autoconf release. -+# They can cause serious problems if a builder's source tree is in a directory -+# whose full name contains unusual characters. -+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -+ -+ -+ -+ -+# Make sure we can run config.sub. -+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || -+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -+$as_echo_n "checking build system type... " >&6; } -+if ${ac_cv_build+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_build_alias=$build_alias -+test "x$ac_build_alias" = x && -+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -+test "x$ac_build_alias" = x && -+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || -+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -+$as_echo "$ac_cv_build" >&6; } -+case $ac_cv_build in -+*-*-*) ;; -+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -+esac -+build=$ac_cv_build -+ac_save_IFS=$IFS; IFS='-' -+set x $ac_cv_build -+shift -+build_cpu=$1 -+build_vendor=$2 -+shift; shift -+# Remember, the first character of IFS is used to create $*, -+# except with old shells: -+build_os=$* -+IFS=$ac_save_IFS -+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -+$as_echo_n "checking host system type... " >&6; } -+if ${ac_cv_host+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "x$host_alias" = x; then -+ ac_cv_host=$ac_cv_build -+else -+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || -+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -+$as_echo "$ac_cv_host" >&6; } -+case $ac_cv_host in -+*-*-*) ;; -+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -+esac -+host=$ac_cv_host -+ac_save_IFS=$IFS; IFS='-' -+set x $ac_cv_host -+shift -+host_cpu=$1 -+host_vendor=$2 -+shift; shift -+# Remember, the first character of IFS is used to create $*, -+# except with old shells: -+host_os=$* -+IFS=$ac_save_IFS -+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -+ -+ -+am__api_version='1.11' -+ -+# 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 -+# AmigaOS /C/install, which installs bootblocks on floppy discs -+# 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. -+# Reject install programs that cannot install multiple files. -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -+$as_echo_n "checking for a BSD-compatible install... " >&6; } -+if test -z "$INSTALL"; then -+if ${ac_cv_path_install+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ # Account for people who put trailing slashes in PATH elements. -+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. -+ # Don't use installbsd from OSF since it installs stuff as root -+ # by default. -+ for ac_prog in ginstall scoinst install; do -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then -+ if test $ac_prog = install && -+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then -+ # AIX install. It has an incompatible calling convention. -+ : -+ elif test $ac_prog = install && -+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then -+ # program-specific install script used by HP pwplus--don't use. -+ : -+ else -+ rm -rf conftest.one conftest.two conftest.dir -+ echo one > conftest.one -+ echo two > conftest.two -+ mkdir conftest.dir -+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && -+ test -s conftest.one && test -s conftest.two && -+ test -s conftest.dir/conftest.one && -+ test -s conftest.dir/conftest.two -+ then -+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" -+ break 3 -+ fi -+ fi -+ fi -+ done -+ done -+ ;; -+esac -+ -+ done -+IFS=$as_save_IFS -+ -+rm -rf conftest.one conftest.two conftest.dir -+ -+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. Don't cache a -+ # value for INSTALL within a source directory, because that will -+ # break other packages using the cache if that directory is -+ # removed, or if the value is a relative name. -+ INSTALL=$ac_install_sh -+ fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -+$as_echo "$INSTALL" >&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}' -+ -+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -+$as_echo_n "checking whether build environment is sane... " >&6; } -+# Just in case -+sleep 1 -+echo timestamp > conftest.file -+# Reject unsafe characters in $srcdir or the absolute working directory -+# name. Accept space and tab only in the latter. -+am_lf=' -+' -+case `pwd` in -+ *[\\\"\#\$\&\'\`$am_lf]*) -+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -+esac -+case $srcdir in -+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*) -+ as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; -+esac -+ -+# 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" conftest.file 2> /dev/null` -+ if test "$*" = "X"; then -+ # -L didn't work. -+ set X `ls -t "$srcdir/configure" conftest.file` -+ fi -+ rm -f conftest.file -+ if test "$*" != "X $srcdir/configure conftest.file" \ -+ && test "$*" != "X conftest.file $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". -+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -+alias in your environment" "$LINENO" 5 -+ fi -+ -+ test "$2" = conftest.file -+ ) -+then -+ # Ok. -+ : -+else -+ as_fn_error $? "newly created file is older than distributed files! -+Check your system clock" "$LINENO" 5 -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+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" -+# Double any \ or $. -+# By default was `s,x,x', remove it if useless. -+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -+ -+# expand $ac_aux_dir to an absolute path -+am_aux_dir=`cd $ac_aux_dir && pwd` -+ -+if test x"${MISSING+set}" != xset; then -+ case $am_aux_dir in -+ *\ * | *\ *) -+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; -+ *) -+ MISSING="\${SHELL} $am_aux_dir/missing" ;; -+ esac -+fi -+# Use eval to expand $SHELL -+if eval "$MISSING --run true"; then -+ am_missing_run="$MISSING --run " -+else -+ am_missing_run= -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -+fi -+ -+if test x"${install_sh}" != xset; then -+ case $am_aux_dir in -+ *\ * | *\ *) -+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; -+ *) -+ install_sh="\${SHELL} $am_aux_dir/install-sh" -+ esac -+fi -+ -+# Installed binaries are usually stripped using `strip' when the user -+# run `make install-strip'. However `strip' might not be the right -+# tool to use in cross-compilation environments, therefore Automake -+# will honor the `STRIP' environment variable to overrule this program. -+if test "$cross_compiling" != no; then -+ if test -n "$ac_tool_prefix"; then -+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -+set dummy ${ac_tool_prefix}strip; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_STRIP+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$STRIP"; then -+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_STRIP="${ac_tool_prefix}strip" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+STRIP=$ac_cv_prog_STRIP -+if test -n "$STRIP"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -+$as_echo "$STRIP" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+fi -+if test -z "$ac_cv_prog_STRIP"; then -+ ac_ct_STRIP=$STRIP -+ # Extract the first word of "strip", so it can be a program name with args. -+set dummy strip; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_ac_ct_STRIP+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$ac_ct_STRIP"; then -+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_ac_ct_STRIP="strip" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -+if test -n "$ac_ct_STRIP"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -+$as_echo "$ac_ct_STRIP" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ if test "x$ac_ct_STRIP" = x; then -+ STRIP=":" -+ else -+ case $cross_compiling:$ac_tool_warned in -+yes:) -+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -+ac_tool_warned=yes ;; -+esac -+ STRIP=$ac_ct_STRIP -+ fi -+else -+ STRIP="$ac_cv_prog_STRIP" -+fi -+ -+fi -+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -+if test -z "$MKDIR_P"; then -+ if ${ac_cv_path_mkdir+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_prog in mkdir gmkdir; do -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue -+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( -+ 'mkdir (GNU coreutils) '* | \ -+ 'mkdir (coreutils) '* | \ -+ 'mkdir (fileutils) '4.1*) -+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext -+ break 3;; -+ esac -+ done -+ done -+ done -+IFS=$as_save_IFS -+ -+fi -+ -+ test -d ./--version && rmdir ./--version -+ if test "${ac_cv_path_mkdir+set}" = set; then -+ MKDIR_P="$ac_cv_path_mkdir -p" -+ else -+ # As a last resort, use the slow shell script. Don't cache a -+ # value for MKDIR_P within a source directory, because that will -+ # break other packages using the cache if that directory is -+ # removed, or if the value is a relative name. -+ MKDIR_P="$ac_install_sh -d" -+ fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -+$as_echo "$MKDIR_P" >&6; } -+ -+mkdir_p="$MKDIR_P" -+case $mkdir_p in -+ [\\/$]* | ?:[\\/]*) ;; -+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -+esac -+ -+for ac_prog in gawk mawk nawk awk -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_AWK+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$AWK"; then -+ ac_cv_prog_AWK="$AWK" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_AWK="$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+AWK=$ac_cv_prog_AWK -+if test -n "$AWK"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -+$as_echo "$AWK" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$AWK" && break -+done -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -+set x ${MAKE-make} -+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat >conftest.make <<\_ACEOF -+SHELL = /bin/sh -+all: -+ @echo '@@@%%%=$(MAKE)=@@@%%%' -+_ACEOF -+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -+case `${MAKE-make} -f conftest.make 2>/dev/null` in -+ *@@@%%%=?*=@@@%%%*) -+ eval ac_cv_prog_make_${ac_make}_set=yes;; -+ *) -+ eval ac_cv_prog_make_${ac_make}_set=no;; -+esac -+rm -f conftest.make -+fi -+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ SET_MAKE= -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ SET_MAKE="MAKE=${MAKE-make}" -+fi -+ -+rm -rf .tst 2>/dev/null -+mkdir .tst 2>/dev/null -+if test -d .tst; then -+ am__leading_dot=. -+else -+ am__leading_dot=_ -+fi -+rmdir .tst 2>/dev/null -+ -+DEPDIR="${am__leading_dot}deps" -+ -+ac_config_commands="$ac_config_commands depfiles" -+ -+ -+am_make=${MAKE-make} -+cat > confinc << 'END' -+am__doit: -+ @echo this is the am__doit target -+.PHONY: am__doit -+END -+# If we don't find an include directive, just comment out the code. -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -+$as_echo_n "checking for style of include used by $am_make... " >&6; } -+am__include="#" -+am__quote= -+_am_result=none -+# First try GNU make style include. -+echo "include confinc" > confmf -+# Ignore all kinds of additional output from `make'. -+case `$am_make -s -f confmf 2> /dev/null` in #( -+*the\ am__doit\ target*) -+ am__include=include -+ am__quote= -+ _am_result=GNU -+ ;; -+esac -+# Now try BSD make style include. -+if test "$am__include" = "#"; then -+ echo '.include "confinc"' > confmf -+ case `$am_make -s -f confmf 2> /dev/null` in #( -+ *the\ am__doit\ target*) -+ am__include=.include -+ am__quote="\"" -+ _am_result=BSD -+ ;; -+ esac -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -+$as_echo "$_am_result" >&6; } -+rm -f confinc confmf -+ -+# Check whether --enable-dependency-tracking was given. -+if test "${enable_dependency_tracking+set}" = set; then : -+ enableval=$enable_dependency_tracking; -+fi -+ -+if test "x$enable_dependency_tracking" != xno; then -+ am_depcomp="$ac_aux_dir/depcomp" -+ AMDEPBACKSLASH='\' -+fi -+ if test "x$enable_dependency_tracking" != xno; then -+ AMDEP_TRUE= -+ AMDEP_FALSE='#' -+else -+ AMDEP_TRUE='#' -+ AMDEP_FALSE= -+fi -+ -+ -+ -+# Check whether --enable-multilib was given. -+if test "${enable_multilib+set}" = set; then : -+ enableval=$enable_multilib; case "${enableval}" in -+ yes) multilib=yes ;; -+ no) multilib=no ;; -+ *) as_fn_error $? "bad value ${enableval} for multilib option" "$LINENO" 5 ;; -+ esac -+else -+ multilib=yes -+fi -+ -+# Check whether --enable-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 ;; -+ *) as_fn_error $? "bad value ${enableval} for target-optspace option" "$LINENO" 5 ;; -+ esac -+else -+ target_optspace= -+fi -+ -+# Check whether --enable-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 ;; -+ *) as_fn_error $? "bad value ${enableval} for malloc-debugging option" "$LINENO" 5 ;; -+ esac -+else -+ malloc_debugging= -+fi -+ -+# Check whether --enable-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 ;; -+ *) as_fn_error $? "bad value ${enableval} for newlib-multithread option" "$LINENO" 5 ;; -+ esac -+else -+ newlib_multithread=yes -+fi -+ -+# Check whether --enable-newlib-iconv was given. -+if test "${enable_newlib_iconv+set}" = set; then : -+ enableval=$enable_newlib_iconv; if test "${newlib_iconv+set}" != set; then -+ case "${enableval}" in -+ yes) newlib_iconv=yes ;; -+ no) newlib_iconv=no ;; -+ *) as_fn_error $? "bad value ${enableval} for newlib-iconv option" "$LINENO" 5 ;; -+ esac -+ fi -+else -+ newlib_iconv=${newlib_iconv} -+fi -+ -+# Check whether --enable-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 ;; -+ *) as_fn_error $? "bad value ${enableval} for newlib-elix-level option" "$LINENO" 5 ;; -+ esac -+else -+ newlib_elix_level=0 -+fi -+ -+# Check whether --enable-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 ;; -+ *) as_fn_error $? "bad value ${enableval} for newlib-io-float option" "$LINENO" 5 ;; -+ esac -+else -+ newlib_io_float=yes -+fi -+ -+# Check whether --enable-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 ;; -+ *) as_fn_error $? "bad value ${enableval} for newlib-supplied-syscalls option" "$LINENO" 5 ;; -+ 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 -+ -+ -+ -+ -+if test "`cd $srcdir && pwd`" != "`pwd`"; then -+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output -+ # is not polluted with repeated "-I." -+ am__isrc=' -I$(srcdir)' -+ # test to see if srcdir already configured -+ if test -f $srcdir/config.status; then -+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 -+ fi -+fi -+ -+# test whether we have cygpath -+if test -z "$CYGPATH_W"; then -+ if (cygpath --version) >/dev/null 2>/dev/null; then -+ CYGPATH_W='cygpath -w' -+ else -+ CYGPATH_W=echo -+ fi -+fi -+ -+ -+# Define the identity of the package. -+ PACKAGE='newlib' -+ VERSION='1.20.0' -+ -+ -+# Some tools Automake needs. -+ -+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} -+ -+ -+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} -+ -+ -+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} -+ -+ -+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} -+ -+ -+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} -+ -+# We need awk for the "check" target. The system "awk" is bad on -+# some platforms. -+# Always define AMTAR for backward compatibility. -+ -+AMTAR=${AMTAR-"${am_missing_run}tar"} -+ -+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' -+ -+ -+ -+ -+ -+ -+# 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 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_CC+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$CC"; then -+ ac_cv_prog_CC="$CC" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_CC="gcc" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+CC=$ac_cv_prog_CC -+if test -n "$CC"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -+$as_echo "$CC" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ -+depcc="$CC" am_compiler_list= -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -+$as_echo_n "checking dependency style of $depcc... " >&6; } -+if ${am_cv_CC_dependencies_compiler_type+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then -+ # We make a subdir and do the tests there. Otherwise we can end up -+ # making bogus files that we don't know about and never remove. For -+ # instance it was reported that on HP-UX the gcc test will end up -+ # making a dummy file named `D' -- because `-MD' means `put the output -+ # in D'. -+ mkdir conftest.dir -+ # Copy depcomp to subdir because otherwise we won't find it if we're -+ # using a relative directory. -+ cp "$am_depcomp" conftest.dir -+ cd conftest.dir -+ # We will build objects and dependencies in a subdirectory because -+ # it helps to detect inapplicable dependency modes. For instance -+ # both Tru64's cc and ICC support -MD to output dependencies as a -+ # side effect of compilation, but ICC will put the dependencies in -+ # the current directory while Tru64 will put them in the object -+ # directory. -+ mkdir sub -+ -+ am_cv_CC_dependencies_compiler_type=none -+ if test "$am_compiler_list" = ""; then -+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` -+ fi -+ am__universal=false -+ case " $depcc " in #( -+ *\ -arch\ *\ -arch\ *) am__universal=true ;; -+ esac -+ -+ for depmode in $am_compiler_list; do -+ # Setup a source with many dependencies, because some compilers -+ # like to wrap large dependency lists on column 80 (with \), and -+ # we should not choose a depcomp mode which is confused by this. -+ # -+ # We need to recreate these files for each test, as the compiler may -+ # overwrite some of them when testing with obscure command lines. -+ # This happens at least with the AIX C compiler. -+ : > sub/conftest.c -+ for i in 1 2 3 4 5 6; do -+ echo '#include "conftst'$i'.h"' >> sub/conftest.c -+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with -+ # Solaris 8's {/usr,}/bin/sh. -+ touch sub/conftst$i.h -+ done -+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf -+ -+ # We check with `-c' and `-o' for the sake of the "dashmstdout" -+ # mode. It turns out that the SunPro C++ compiler does not properly -+ # handle `-M -o', and we need to detect this. Also, some Intel -+ # versions had trouble with output in subdirs -+ am__obj=sub/conftest.${OBJEXT-o} -+ am__minus_obj="-o $am__obj" -+ case $depmode in -+ gcc) -+ # This depmode causes a compiler race in universal mode. -+ test "$am__universal" = false || continue -+ ;; -+ nosideeffect) -+ # after this tag, mechanisms are not by side-effect, so they'll -+ # only be used when explicitly requested -+ if test "x$enable_dependency_tracking" = xyes; then -+ continue -+ else -+ break -+ fi -+ ;; -+ msvisualcpp | msvcmsys) -+ # This compiler won't grok `-c -o', but also, the minuso test has -+ # not run yet. These depmodes are late enough in the game, and -+ # so weak that their functioning should not be impacted. -+ am__obj=conftest.${OBJEXT-o} -+ am__minus_obj= -+ ;; -+ none) break ;; -+ esac -+ if depmode=$depmode \ -+ source=sub/conftest.c object=$am__obj \ -+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ -+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ -+ >/dev/null 2>conftest.err && -+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && -+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && -+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 && -+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then -+ # icc doesn't choke on unknown options, it will just issue warnings -+ # or remarks (even with -Werror). So we grep stderr for any message -+ # that says an option was ignored or not supported. -+ # When given -MP, icc 7.0 and 7.1 complain thusly: -+ # icc: Command line warning: ignoring option '-M'; no argument required -+ # The diagnosis changed in icc 8.0: -+ # icc: Command line remark: option '-MP' not supported -+ if (grep 'ignoring option' conftest.err || -+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else -+ am_cv_CC_dependencies_compiler_type=$depmode -+ break -+ fi -+ fi -+ done -+ -+ cd .. -+ rm -rf conftest.dir -+else -+ am_cv_CC_dependencies_compiler_type=none -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type -+ -+ if -+ test "x$enable_dependency_tracking" != xno \ -+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then -+ am__fastdepCC_TRUE= -+ am__fastdepCC_FALSE='#' -+else -+ am__fastdepCC_TRUE='#' -+ am__fastdepCC_FALSE= -+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 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_CC+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$CC"; then -+ ac_cv_prog_CC="$CC" # Let the user override the test. -+else -+ ac_prog_rejected=no -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then -+ ac_prog_rejected=yes -+ continue -+ fi -+ ac_cv_prog_CC="cc" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_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 $# != 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 -+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" -+ fi -+fi -+fi -+fi -+CC=$ac_cv_prog_CC -+if test -n "$CC"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -+$as_echo "$CC" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -z "$CC" && as_fn_error $? "no acceptable cc found in \$PATH" "$LINENO" 5 -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using GNU C" >&5 -+$as_echo_n "checking whether we are using GNU C... " >&6; } -+if ${ac_cv_c_compiler_gnu+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat > conftest.c <&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } | egrep yes >/dev/null 2>&1; then -+ ac_cv_c_compiler_gnu=yes -+else -+ ac_cv_c_compiler_gnu=no -+fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -+$as_echo "$ac_cv_c_compiler_gnu" >&6; } -+ -+if test $ac_cv_c_compiler_gnu = yes; then -+ GCC=yes -+ ac_test_CFLAGS="${CFLAGS+set}" -+ ac_save_CFLAGS="$CFLAGS" -+ ac_test_CFLAGS=${CFLAGS+set} -+ac_save_CFLAGS=$CFLAGS -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -+$as_echo_n "checking whether $CC accepts -g... " >&6; } -+if ${ac_cv_prog_cc_g+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_save_c_werror_flag=$ac_c_werror_flag -+ ac_c_werror_flag=yes -+ ac_cv_prog_cc_g=no -+ CFLAGS="-g" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_prog_cc_g=yes -+else -+ CFLAGS="" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ -+else -+ ac_c_werror_flag=$ac_save_c_werror_flag -+ CFLAGS="-g" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_prog_cc_g=yes -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ ac_c_werror_flag=$ac_save_c_werror_flag -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -+$as_echo "$ac_cv_prog_cc_g" >&6; } -+if test "$ac_test_CFLAGS" = set; then -+ CFLAGS=$ac_save_CFLAGS -+elif test $ac_cv_prog_cc_g = yes; then -+ if test "$GCC" = yes; then -+ CFLAGS="-g -O2" -+ else -+ CFLAGS="-g" -+ fi -+else -+ if test "$GCC" = yes; then -+ CFLAGS="-O2" -+ else -+ CFLAGS= -+ fi -+fi -+ 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 -+ -+ -+if test -n "$ac_tool_prefix"; then -+ # 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 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_AS+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$AS"; then -+ ac_cv_prog_AS="$AS" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_AS="${ac_tool_prefix}as" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+AS=$ac_cv_prog_AS -+if test -n "$AS"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -+$as_echo "$AS" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+fi -+if test -z "$ac_cv_prog_AS"; then -+ ac_ct_AS=$AS -+ # Extract the first word of "as", so it can be a program name with args. -+set dummy as; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_ac_ct_AS+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$ac_ct_AS"; then -+ ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_ac_ct_AS="as" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+ac_ct_AS=$ac_cv_prog_ac_ct_AS -+if test -n "$ac_ct_AS"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 -+$as_echo "$ac_ct_AS" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ if test "x$ac_ct_AS" = x; then -+ AS="" -+ else -+ case $cross_compiling:$ac_tool_warned in -+yes:) -+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -+ac_tool_warned=yes ;; -+esac -+ AS=$ac_ct_AS -+ fi -+else -+ AS="$ac_cv_prog_AS" -+fi -+ -+if test -n "$ac_tool_prefix"; then -+ # 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 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_AR+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$AR"; then -+ ac_cv_prog_AR="$AR" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_AR="${ac_tool_prefix}ar" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+AR=$ac_cv_prog_AR -+if test -n "$AR"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -+$as_echo "$AR" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+fi -+if test -z "$ac_cv_prog_AR"; then -+ ac_ct_AR=$AR -+ # Extract the first word of "ar", so it can be a program name with args. -+set dummy ar; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_ac_ct_AR+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$ac_ct_AR"; then -+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_ac_ct_AR="ar" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+ac_ct_AR=$ac_cv_prog_ac_ct_AR -+if test -n "$ac_ct_AR"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -+$as_echo "$ac_ct_AR" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ if test "x$ac_ct_AR" = x; then -+ AR="" -+ else -+ case $cross_compiling:$ac_tool_warned in -+yes:) -+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -+ac_tool_warned=yes ;; -+esac -+ AR=$ac_ct_AR -+ fi -+else -+ AR="$ac_cv_prog_AR" -+fi -+ -+if test -n "$ac_tool_prefix"; then -+ # 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 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_RANLIB+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$RANLIB"; then -+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+RANLIB=$ac_cv_prog_RANLIB -+if test -n "$RANLIB"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -+$as_echo "$RANLIB" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+fi -+if test -z "$ac_cv_prog_RANLIB"; then -+ ac_ct_RANLIB=$RANLIB -+ # Extract the first word of "ranlib", so it can be a program name with args. -+set dummy ranlib; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$ac_ct_RANLIB"; then -+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_ac_ct_RANLIB="ranlib" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -+if test -n "$ac_ct_RANLIB"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -+$as_echo "$ac_ct_RANLIB" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ if test "x$ac_ct_RANLIB" = x; then -+ RANLIB=":" -+ else -+ case $cross_compiling:$ac_tool_warned in -+yes:) -+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -+ac_tool_warned=yes ;; -+esac -+ RANLIB=$ac_ct_RANLIB -+ fi -+else -+ RANLIB="$ac_cv_prog_RANLIB" -+fi -+ -+if test -n "$ac_tool_prefix"; then -+ # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args. -+set dummy ${ac_tool_prefix}readelf; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_READELF+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$READELF"; then -+ ac_cv_prog_READELF="$READELF" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_READELF="${ac_tool_prefix}readelf" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+READELF=$ac_cv_prog_READELF -+if test -n "$READELF"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 -+$as_echo "$READELF" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+fi -+if test -z "$ac_cv_prog_READELF"; then -+ ac_ct_READELF=$READELF -+ # Extract the first word of "readelf", so it can be a program name with args. -+set dummy readelf; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_ac_ct_READELF+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$ac_ct_READELF"; then -+ ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_ac_ct_READELF="readelf" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+ac_ct_READELF=$ac_cv_prog_ac_ct_READELF -+if test -n "$ac_ct_READELF"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 -+$as_echo "$ac_ct_READELF" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ if test "x$ac_ct_READELF" = x; then -+ READELF=":" -+ else -+ case $cross_compiling:$ac_tool_warned in -+yes:) -+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -+ac_tool_warned=yes ;; -+esac -+ READELF=$ac_ct_READELF -+ fi -+else -+ READELF="$ac_cv_prog_READELF" -+fi -+ -+ -+ -+ -+# Hack to ensure that INSTALL won't be set to "../" with autoconf 2.13. */ -+ac_given_INSTALL=$INSTALL -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } -+ # Check whether --enable-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 -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -+$as_echo "$USE_MAINTAINER_MODE" >&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 -+ -+ -+# By default we simply use the C compiler to build assembly code. -+ -+test "${CCAS+set}" = set || CCAS=$CC -+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS -+ -+ -+ -+ -+# 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 -+ -+ dummy_var=1 -+fi -+ -+. ${newlib_basedir}/configure.host -+ -+newlib_cflags="${newlib_cflags} -fno-builtin" -+ -+NEWLIB_CFLAGS=${newlib_cflags} -+ -+ -+NO_INCLUDE_LIST=${noinclude} -+ -+ -+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} -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ac_config_files="$ac_config_files Makefile" -+ -+cat >confcache <<\_ACEOF -+# 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, see configure's option --config-cache. -+# It is not useful on other systems. If it contains results you don't -+# want to keep, you may remove or edit it. -+# -+# config.status only pays attention to the cache file if you give it -+# the --recheck option to rerun configure. -+# -+# `ac_cv_env_foo' variables (set or unset) will be overridden when -+# loading this file, other *unset* `ac_cv_foo' will be assigned the -+# following values. -+ -+_ACEOF -+ -+# The following way of writing the cache mishandles newlines in values, -+# but we know of no workaround that is simple, portable, and efficient. -+# So, we kill variables containing newlines. -+# 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. -+( -+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do -+ eval ac_val=\$$ac_var -+ case $ac_val in #( -+ *${as_nl}*) -+ case $ac_var in #( -+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; -+ esac -+ case $ac_var in #( -+ _ | IFS | as_nl) ;; #( -+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( -+ *) { eval $ac_var=; unset $ac_var;} ;; -+ esac ;; -+ esac -+ done -+ -+ (set) 2>&1 | -+ case $as_nl`(ac_space=' '; set) 2>&1` in #( -+ *${as_nl}ac_space=\ *) -+ # `set' does not quote correctly, so add quotes: double-quote -+ # substitution turns \\\\ into \\, and sed turns \\ into \. -+ sed -n \ -+ "s/'/'\\\\''/g; -+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" -+ ;; #( -+ *) -+ # `set' quotes correctly as required by POSIX, so do not add quotes. -+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" -+ ;; -+ esac | -+ sort -+) | -+ sed ' -+ /^ac_cv_env_/b end -+ t clear -+ :clear -+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ -+ t end -+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ -+ :end' >>confcache -+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else -+ if test -w "$cache_file"; then -+ if test "x$cache_file" != "x/dev/null"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -+$as_echo "$as_me: updating cache $cache_file" >&6;} -+ if test ! -f "$cache_file" || test -h "$cache_file"; then -+ cat confcache >"$cache_file" -+ else -+ case $cache_file in #( -+ */* | ?:*) -+ mv -f confcache "$cache_file"$$ && -+ mv -f "$cache_file"$$ "$cache_file" ;; #( -+ *) -+ mv -f confcache "$cache_file" ;; -+ esac -+ fi -+ fi -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} -+ fi -+fi -+rm -f confcache -+ -+test "x$prefix" = xNONE && prefix=$ac_default_prefix -+# Let make expand exec_prefix. -+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -+ -+# Transform confdefs.h into DEFS. -+# Protect against shell expansion while executing Makefile rules. -+# Protect against Makefile macro expansion. -+# -+# If the first sed substitution is executed (which looks for macros that -+# take arguments), then branch to the quote section. Otherwise, -+# look for a macro that doesn't take arguments. -+ac_script=' -+:mline -+/\\$/{ -+ N -+ s,\\\n,, -+ b mline -+} -+t clear -+:clear -+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -+t quote -+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -+t quote -+b any -+:quote -+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -+s/\[/\\&/g -+s/\]/\\&/g -+s/\$/$$/g -+H -+:any -+${ -+ g -+ s/^\n// -+ s/\n/ /g -+ p -+} -+' -+DEFS=`sed -n "$ac_script" confdefs.h` -+ -+ -+ac_libobjs= -+ac_ltlibobjs= -+U= -+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue -+ # 1. Remove the extension, and $U if already installed. -+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' -+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"` -+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR -+ # will be set to the directory where LIBOBJS objects are built. -+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" -+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -+done -+LIBOBJS=$ac_libobjs -+ -+LTLIBOBJS=$ac_ltlibobjs -+ -+ -+if test -z "${MAY_SUPPLY_SYSCALLS_TRUE}" && test -z "${MAY_SUPPLY_SYSCALLS_FALSE}"; then -+ as_fn_error $? "conditional \"MAY_SUPPLY_SYSCALLS\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi -+ -+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then -+ as_fn_error $? "conditional \"AMDEP\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi -+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then -+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi -+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then -+ as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi -+if test -z "${ELIX_LEVEL_0_TRUE}" && test -z "${ELIX_LEVEL_0_FALSE}"; then -+ as_fn_error $? "conditional \"ELIX_LEVEL_0\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi -+if test -z "${ELIX_LEVEL_1_TRUE}" && test -z "${ELIX_LEVEL_1_FALSE}"; then -+ as_fn_error $? "conditional \"ELIX_LEVEL_1\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi -+if test -z "${ELIX_LEVEL_2_TRUE}" && test -z "${ELIX_LEVEL_2_FALSE}"; then -+ as_fn_error $? "conditional \"ELIX_LEVEL_2\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi -+if test -z "${ELIX_LEVEL_3_TRUE}" && test -z "${ELIX_LEVEL_3_FALSE}"; then -+ as_fn_error $? "conditional \"ELIX_LEVEL_3\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi -+if test -z "${ELIX_LEVEL_4_TRUE}" && test -z "${ELIX_LEVEL_4_FALSE}"; then -+ as_fn_error $? "conditional \"ELIX_LEVEL_4\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi -+if test -z "${USE_LIBTOOL_TRUE}" && test -z "${USE_LIBTOOL_FALSE}"; then -+ as_fn_error $? "conditional \"USE_LIBTOOL\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi -+ -+: "${CONFIG_STATUS=./config.status}" -+ac_write_fail=0 -+ac_clean_files_save=$ac_clean_files -+ac_clean_files="$ac_clean_files $CONFIG_STATUS" -+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -+as_write_fail=0 -+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -+#! $SHELL -+# Generated by $as_me. -+# Run this file to recreate the current configuration. -+# Compiler output produced by configure, useful for debugging -+# configure, is in config.log if it exists. -+ -+debug=false -+ac_cs_recheck=false -+ac_cs_silent=false -+ -+SHELL=\${CONFIG_SHELL-$SHELL} -+export SHELL -+_ASEOF -+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -+## -------------------- ## -+## M4sh Initialization. ## -+## -------------------- ## -+ -+# Be more Bourne compatible -+DUALCASE=1; export DUALCASE # for MKS sh -+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : -+ emulate sh -+ NULLCMD=: -+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which -+ # is contrary to our usage. Disable this feature. -+ alias -g '${1+"$@"}'='"$@"' -+ setopt NO_GLOB_SUBST -+else -+ case `(set -o) 2>/dev/null` in #( -+ *posix*) : -+ set -o posix ;; #( -+ *) : -+ ;; -+esac -+fi -+ -+ -+as_nl=' -+' -+export as_nl -+# Printing a long string crashes Solaris 7 /usr/bin/printf. -+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -+# Prefer a ksh shell builtin over an external printf program on Solaris, -+# but without wasting forks for bash or zsh. -+if test -z "$BASH_VERSION$ZSH_VERSION" \ -+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then -+ as_echo='print -r --' -+ as_echo_n='print -rn --' -+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then -+ as_echo='printf %s\n' -+ as_echo_n='printf %s' -+else -+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then -+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' -+ as_echo_n='/usr/ucb/echo -n' -+ else -+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"' -+ as_echo_n_body='eval -+ arg=$1; -+ case $arg in #( -+ *"$as_nl"*) -+ expr "X$arg" : "X\\(.*\\)$as_nl"; -+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; -+ esac; -+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" -+ ' -+ export as_echo_n_body -+ as_echo_n='sh -c $as_echo_n_body as_echo' -+ fi -+ export as_echo_body -+ as_echo='sh -c $as_echo_body as_echo' -+fi -+ -+# The user is always right. -+if test "${PATH_SEPARATOR+set}" != set; then -+ PATH_SEPARATOR=: -+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { -+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || -+ PATH_SEPARATOR=';' -+ } -+fi -+ -+ -+# IFS -+# We need space, tab and new line, in precisely that order. Quoting is -+# there to prevent editors from complaining about space-tab. -+# (If _AS_PATH_WALK were called with IFS unset, it would disable word -+# splitting by setting IFS to empty value.) -+IFS=" "" $as_nl" -+ -+# Find who we are. Look in the path if we contain no directory separator. -+as_myself= -+case $0 in #(( -+ *[\\/]* ) as_myself=$0 ;; -+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -+ done -+IFS=$as_save_IFS -+ -+ ;; -+esac -+# We did not find ourselves, most probably we were run as `sh COMMAND' -+# in which case we are not to be found in the path. -+if test "x$as_myself" = x; then -+ as_myself=$0 -+fi -+if test ! -f "$as_myself"; then -+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 -+ exit 1 -+fi -+ -+# Unset variables that we do not need and which cause bugs (e.g. in -+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -+# suppresses any "Segmentation fault" message there. '((' could -+# trigger a bug in pdksh 5.2.14. -+for as_var in BASH_ENV ENV MAIL MAILPATH -+do eval test x\${$as_var+set} = xset \ -+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -+done -+PS1='$ ' -+PS2='> ' -+PS4='+ ' -+ -+# NLS nuisances. -+LC_ALL=C -+export LC_ALL -+LANGUAGE=C -+export LANGUAGE -+ -+# CDPATH. -+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH -+ -+ -+# as_fn_error STATUS ERROR [LINENO LOG_FD] -+# ---------------------------------------- -+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -+# script with STATUS, using 1 if that was 0. -+as_fn_error () -+{ -+ as_status=$1; test $as_status -eq 0 && as_status=1 -+ if test "$4"; then -+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 -+ fi -+ $as_echo "$as_me: error: $2" >&2 -+ as_fn_exit $as_status -+} # as_fn_error -+ -+ -+# as_fn_set_status STATUS -+# ----------------------- -+# Set $? to STATUS, without forking. -+as_fn_set_status () -+{ -+ return $1 -+} # as_fn_set_status -+ -+# as_fn_exit STATUS -+# ----------------- -+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -+as_fn_exit () -+{ -+ set +e -+ as_fn_set_status $1 -+ exit $1 -+} # as_fn_exit -+ -+# as_fn_unset VAR -+# --------------- -+# Portably unset VAR. -+as_fn_unset () -+{ -+ { eval $1=; unset $1;} -+} -+as_unset=as_fn_unset -+# as_fn_append VAR VALUE -+# ---------------------- -+# Append the text in VALUE to the end of the definition contained in VAR. Take -+# advantage of any shell optimizations that allow amortized linear growth over -+# repeated appends, instead of the typical quadratic growth present in naive -+# implementations. -+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : -+ eval 'as_fn_append () -+ { -+ eval $1+=\$2 -+ }' -+else -+ as_fn_append () -+ { -+ eval $1=\$$1\$2 -+ } -+fi # as_fn_append -+ -+# as_fn_arith ARG... -+# ------------------ -+# Perform arithmetic evaluation on the ARGs, and store the result in the -+# global $as_val. Take advantage of shells that can avoid forks. The arguments -+# must be portable across $(()) and expr. -+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : -+ eval 'as_fn_arith () -+ { -+ as_val=$(( $* )) -+ }' -+else -+ as_fn_arith () -+ { -+ as_val=`expr "$@" || test $? -eq 1` -+ } -+fi # as_fn_arith -+ -+ -+if expr a : '\(a\)' >/dev/null 2>&1 && -+ test "X`expr 00001 : '.*\(...\)'`" = X001; then -+ as_expr=expr -+else -+ as_expr=false -+fi -+ -+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then -+ as_basename=basename -+else -+ as_basename=false -+fi -+ -+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then -+ as_dirname=dirname -+else -+ as_dirname=false -+fi -+ -+as_me=`$as_basename -- "$0" || -+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ -+ X"$0" : 'X\(//\)$' \| \ -+ X"$0" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X/"$0" | -+ sed '/^.*\/\([^/][^/]*\)\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\/\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\/\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ -+# Avoid depending upon Character Ranges. -+as_cr_letters='abcdefghijklmnopqrstuvwxyz' -+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -+as_cr_Letters=$as_cr_letters$as_cr_LETTERS -+as_cr_digits='0123456789' -+as_cr_alnum=$as_cr_Letters$as_cr_digits -+ -+ECHO_C= ECHO_N= ECHO_T= -+case `echo -n x` in #((((( -+-n*) -+ case `echo 'xy\c'` in -+ *c*) ECHO_T=' ';; # ECHO_T is single tab character. -+ xy) ECHO_C='\c';; -+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null -+ ECHO_T=' ';; -+ esac;; -+*) -+ ECHO_N='-n';; -+esac -+ -+rm -f conf$$ conf$$.exe conf$$.file -+if test -d conf$$.dir; then -+ rm -f conf$$.dir/conf$$.file -+else -+ rm -f conf$$.dir -+ mkdir conf$$.dir 2>/dev/null -+fi -+if (echo >conf$$.file) 2>/dev/null; then -+ if ln -s conf$$.file conf$$ 2>/dev/null; then -+ as_ln_s='ln -s' -+ # ... but there are two gotchas: -+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. -+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. -+ # In both cases, we have to default to `cp -p'. -+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || -+ as_ln_s='cp -p' -+ elif ln conf$$.file conf$$ 2>/dev/null; then -+ as_ln_s=ln -+ else -+ as_ln_s='cp -p' -+ fi -+else -+ as_ln_s='cp -p' -+fi -+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -+rmdir conf$$.dir 2>/dev/null -+ -+ -+# as_fn_mkdir_p -+# ------------- -+# Create "$as_dir" as a directory, including parents if necessary. -+as_fn_mkdir_p () -+{ -+ -+ case $as_dir in #( -+ -*) as_dir=./$as_dir;; -+ esac -+ test -d "$as_dir" || eval $as_mkdir_p || { -+ as_dirs= -+ while :; do -+ case $as_dir in #( -+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( -+ *) as_qdir=$as_dir;; -+ esac -+ as_dirs="'$as_qdir' $as_dirs" -+ as_dir=`$as_dirname -- "$as_dir" || -+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_dir" : 'X\(//\)[^/]' \| \ -+ X"$as_dir" : 'X\(//\)$' \| \ -+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X"$as_dir" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)[^/].*/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ test -d "$as_dir" && break -+ done -+ test -z "$as_dirs" || eval "mkdir $as_dirs" -+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -+ -+ -+} # as_fn_mkdir_p -+if mkdir -p . 2>/dev/null; then -+ as_mkdir_p='mkdir -p "$as_dir"' -+else -+ test -d ./-p && rmdir ./-p -+ as_mkdir_p=false -+fi -+ -+if test -x / >/dev/null 2>&1; then -+ as_test_x='test -x' -+else -+ if ls -dL / >/dev/null 2>&1; then -+ as_ls_L_option=L -+ else -+ as_ls_L_option= -+ fi -+ as_test_x=' -+ eval sh -c '\'' -+ if test -d "$1"; then -+ test -d "$1/."; -+ else -+ case $1 in #( -+ -*)set "./$1";; -+ esac; -+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( -+ ???[sx]*):;;*)false;;esac;fi -+ '\'' sh -+ ' -+fi -+as_executable_p=$as_test_x -+ -+# Sed expression to map a string onto a valid CPP name. -+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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -+ -+ -+exec 6>&1 -+## ----------------------------------- ## -+## Main body of $CONFIG_STATUS script. ## -+## ----------------------------------- ## -+_ASEOF -+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -+ -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+# Save the log message, to keep $0 and so on meaningful, and to -+# report actual input values of CONFIG_FILES etc. instead of their -+# values after options handling. -+ac_log=" -+This file was extended by newlib $as_me 1.20.0, which was -+generated by GNU Autoconf 2.68. Invocation command line was -+ -+ CONFIG_FILES = $CONFIG_FILES -+ CONFIG_HEADERS = $CONFIG_HEADERS -+ CONFIG_LINKS = $CONFIG_LINKS -+ CONFIG_COMMANDS = $CONFIG_COMMANDS -+ $ $0 $@ -+ -+on `(hostname || uname -n) 2>/dev/null | sed 1q` -+" -+ -+_ACEOF -+ -+case $ac_config_files in *" -+"*) set x $ac_config_files; shift; ac_config_files=$*;; -+esac -+ -+ -+ -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+# Files that config.status was made for. -+config_files="$ac_config_files" -+config_commands="$ac_config_commands" -+ -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+ac_cs_usage="\ -+\`$as_me' instantiates files and other configuration actions -+from templates according to the current configuration. Unless the files -+and actions are specified as TAGs, all are instantiated by default. -+ -+Usage: $0 [OPTION]... [TAG]... -+ -+ -h, --help print this help, then exit -+ -V, --version print version number and configuration settings, then exit -+ --config print configuration, then exit -+ -q, --quiet, --silent -+ do not print progress messages -+ -d, --debug don't remove temporary files -+ --recheck update $as_me by reconfiguring in the same conditions -+ --file=FILE[:TEMPLATE] -+ instantiate the configuration file FILE -+ -+Configuration files: -+$config_files -+ -+Configuration commands: -+$config_commands -+ -+Report bugs to the package provider." -+ -+_ACEOF -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -+ac_cs_version="\\ -+newlib config.status 1.20.0 -+configured by $0, generated by GNU Autoconf 2.68, -+ with options \\"\$ac_cs_config\\" -+ -+Copyright (C) 2010 Free Software Foundation, Inc. -+This config.status script is free software; the Free Software Foundation -+gives unlimited permission to copy, distribute and modify it." -+ -+ac_pwd='$ac_pwd' -+srcdir='$srcdir' -+INSTALL='$INSTALL' -+MKDIR_P='$MKDIR_P' -+AWK='$AWK' -+test -n "\$AWK" || AWK=awk -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+# The default lists apply if the user does not specify any file. -+ac_need_defaults=: -+while test $# != 0 -+do -+ case $1 in -+ --*=?*) -+ ac_option=`expr "X$1" : 'X\([^=]*\)='` -+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` -+ ac_shift=: -+ ;; -+ --*=) -+ ac_option=`expr "X$1" : 'X\([^=]*\)='` -+ ac_optarg= -+ ac_shift=: -+ ;; -+ *) -+ ac_option=$1 -+ ac_optarg=$2 -+ ac_shift=shift -+ ;; -+ esac -+ -+ case $ac_option in -+ # Handling of the options. -+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) -+ ac_cs_recheck=: ;; -+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) -+ $as_echo "$ac_cs_version"; exit ;; -+ --config | --confi | --conf | --con | --co | --c ) -+ $as_echo "$ac_cs_config"; exit ;; -+ --debug | --debu | --deb | --de | --d | -d ) -+ debug=: ;; -+ --file | --fil | --fi | --f ) -+ $ac_shift -+ case $ac_optarg in -+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; -+ '') as_fn_error $? "missing file argument" ;; -+ esac -+ as_fn_append CONFIG_FILES " '$ac_optarg'" -+ ac_need_defaults=false;; -+ --he | --h | --help | --hel | -h ) -+ $as_echo "$ac_cs_usage"; exit ;; -+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ -+ | -silent | --silent | --silen | --sile | --sil | --si | --s) -+ ac_cs_silent=: ;; -+ -+ # This is an error. -+ -*) as_fn_error $? "unrecognized option: \`$1' -+Try \`$0 --help' for more information." ;; -+ -+ *) as_fn_append ac_config_targets " $1" -+ ac_need_defaults=false ;; -+ -+ esac -+ shift -+done -+ -+ac_configure_extra_args= -+ -+if $ac_cs_silent; then -+ exec 6>/dev/null -+ ac_configure_extra_args="$ac_configure_extra_args --silent" -+fi -+ -+_ACEOF -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+if \$ac_cs_recheck; then -+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -+ shift -+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 -+ CONFIG_SHELL='$SHELL' -+ export CONFIG_SHELL -+ exec "\$@" -+fi -+ -+_ACEOF -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+exec 5>>config.log -+{ -+ echo -+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -+## Running $as_me. ## -+_ASBOX -+ $as_echo "$ac_log" -+} >&5 -+ -+_ACEOF -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+# -+# INIT-COMMANDS -+# -+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" -+ -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+ -+# Handling of arguments. -+for ac_config_target in $ac_config_targets -+do -+ case $ac_config_target in -+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; -+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; -+ -+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; -+ esac -+done -+ -+ -+# If the user did not use the arguments to specify the items to instantiate, -+# then the envvar interface is used. Set only those that are not. -+# We use the long form for the default assignment because of an extremely -+# bizarre bug on SunOS 4.1.3. -+if $ac_need_defaults; then -+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -+fi -+ -+# Have a temporary directory for convenience. Make it in the build tree -+# simply because there is no reason against having it here, and in addition, -+# creating and moving files from /tmp can sometimes cause problems. -+# Hook for its removal unless debugging. -+# Note that there is a small window in which the directory will not be cleaned: -+# after its creation but before its name has been assigned to `$tmp'. -+$debug || -+{ -+ tmp= ac_tmp= -+ trap 'exit_status=$? -+ : "${ac_tmp:=$tmp}" -+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -+' 0 -+ trap 'as_fn_exit 1' 1 2 13 15 -+} -+# Create a (secure) tmp directory for tmp files. -+ -+{ -+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && -+ test -d "$tmp" -+} || -+{ -+ tmp=./conf$$-$RANDOM -+ (umask 077 && mkdir "$tmp") -+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -+ac_tmp=$tmp -+ -+# Set up the scripts for CONFIG_FILES section. -+# No need to generate them if there are no CONFIG_FILES. -+# This happens for instance with `./config.status config.h'. -+if test -n "$CONFIG_FILES"; then -+ -+ -+ac_cr=`echo X | tr X '\015'` -+# On cygwin, bash can eat \r inside `` if the user requested igncr. -+# But we know of no other shell where ac_cr would be empty at this -+# point, so we can use a bashism as a fallback. -+if test "x$ac_cr" = x; then -+ eval ac_cr=\$\'\\r\' -+fi -+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then -+ ac_cs_awk_cr='\\r' -+else -+ ac_cs_awk_cr=$ac_cr -+fi -+ -+echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -+_ACEOF -+ -+ -+{ -+ echo "cat >conf$$subs.awk <<_ACEOF" && -+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && -+ echo "_ACEOF" -+} >conf$$subs.sh || -+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -+ac_delim='%!_!# ' -+for ac_last_try in false false false false false :; do -+ . ./conf$$subs.sh || -+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -+ -+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` -+ if test $ac_delim_n = $ac_delim_num; then -+ break -+ elif $ac_last_try; then -+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -+ else -+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! " -+ fi -+done -+rm -f conf$$subs.sh -+ -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -+_ACEOF -+sed -n ' -+h -+s/^/S["/; s/!.*/"]=/ -+p -+g -+s/^[^!]*!// -+:repl -+t repl -+s/'"$ac_delim"'$// -+t delim -+:nl -+h -+s/\(.\{148\}\)..*/\1/ -+t more1 -+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -+p -+n -+b repl -+:more1 -+s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -+p -+g -+s/.\{148\}// -+t nl -+:delim -+h -+s/\(.\{148\}\)..*/\1/ -+t more2 -+s/["\\]/\\&/g; s/^/"/; s/$/"/ -+p -+b -+:more2 -+s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -+p -+g -+s/.\{148\}// -+t delim -+' >$CONFIG_STATUS || ac_write_fail=1 -+rm -f conf$$subs.awk -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+_ACAWK -+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && -+ for (key in S) S_is_set[key] = 1 -+ FS = "" -+ -+} -+{ -+ line = $ 0 -+ nfields = split(line, field, "@") -+ substed = 0 -+ len = length(field[1]) -+ for (i = 2; i < nfields; i++) { -+ key = field[i] -+ keylen = length(key) -+ if (S_is_set[key]) { -+ value = S[key] -+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) -+ len += length(value) + length(field[++i]) -+ substed = 1 -+ } else -+ len += 1 + keylen -+ } -+ -+ print line -+} -+ -+_ACAWK -+_ACEOF -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then -+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -+else -+ cat -+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ -+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -+_ACEOF -+ -+# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -+# trailing colons and then remove the whole line if VPATH becomes empty -+# (actually we leave an empty line to preserve line numbers). -+if test "x$srcdir" = x.; then -+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -+h -+s/// -+s/^/:/ -+s/[ ]*$/:/ -+s/:\$(srcdir):/:/g -+s/:\${srcdir}:/:/g -+s/:@srcdir@:/:/g -+s/^:*// -+s/:*$// -+x -+s/\(=[ ]*\).*/\1/ -+G -+s/\n// -+s/^[^=]*=[ ]*$// -+}' -+fi -+ -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+fi # test -n "$CONFIG_FILES" -+ -+ -+eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" -+shift -+for ac_tag -+do -+ case $ac_tag in -+ :[FHLC]) ac_mode=$ac_tag; continue;; -+ esac -+ case $ac_mode$ac_tag in -+ :[FHL]*:*);; -+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; -+ :[FH]-) ac_tag=-:-;; -+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; -+ esac -+ ac_save_IFS=$IFS -+ IFS=: -+ set x $ac_tag -+ IFS=$ac_save_IFS -+ shift -+ ac_file=$1 -+ shift -+ -+ case $ac_mode in -+ :L) ac_source=$1;; -+ :[FH]) -+ ac_file_inputs= -+ for ac_f -+ do -+ case $ac_f in -+ -) ac_f="$ac_tmp/stdin";; -+ *) # Look for the file first in the build tree, then in the source tree -+ # (if the path is not absolute). The absolute path cannot be DOS-style, -+ # because $ac_f cannot contain `:'. -+ test -f "$ac_f" || -+ case $ac_f in -+ [\\/$]*) false;; -+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; -+ esac || -+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; -+ esac -+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac -+ as_fn_append ac_file_inputs " '$ac_f'" -+ done -+ -+ # Let's still pretend it is `configure' which instantiates (i.e., don't -+ # use $as_me), people would be surprised to read: -+ # /* config.h. Generated by config.status. */ -+ configure_input='Generated from '` -+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' -+ `' by configure.' -+ if test x"$ac_file" != x-; then -+ configure_input="$ac_file. $configure_input" -+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -+$as_echo "$as_me: creating $ac_file" >&6;} -+ fi -+ # Neutralize special characters interpreted by sed in replacement strings. -+ case $configure_input in #( -+ *\&* | *\|* | *\\* ) -+ ac_sed_conf_input=`$as_echo "$configure_input" | -+ sed 's/[\\\\&|]/\\\\&/g'`;; #( -+ *) ac_sed_conf_input=$configure_input;; -+ esac -+ -+ case $ac_tag in -+ *:-:* | *:-) cat >"$ac_tmp/stdin" \ -+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; -+ esac -+ ;; -+ esac -+ -+ ac_dir=`$as_dirname -- "$ac_file" || -+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$ac_file" : 'X\(//\)[^/]' \| \ -+ X"$ac_file" : 'X\(//\)$' \| \ -+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X"$ac_file" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)[^/].*/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ as_dir="$ac_dir"; as_fn_mkdir_p -+ ac_builddir=. -+ -+case "$ac_dir" in -+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -+*) -+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` -+ # A ".." for each directory in $ac_dir_suffix. -+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` -+ case $ac_top_builddir_sub in -+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;; -+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; -+ esac ;; -+esac -+ac_abs_top_builddir=$ac_pwd -+ac_abs_builddir=$ac_pwd$ac_dir_suffix -+# for backward compatibility: -+ac_top_builddir=$ac_top_build_prefix -+ -+case $srcdir in -+ .) # We are building in place. -+ ac_srcdir=. -+ ac_top_srcdir=$ac_top_builddir_sub -+ ac_abs_top_srcdir=$ac_pwd ;; -+ [\\/]* | ?:[\\/]* ) # Absolute name. -+ ac_srcdir=$srcdir$ac_dir_suffix; -+ ac_top_srcdir=$srcdir -+ ac_abs_top_srcdir=$srcdir ;; -+ *) # Relative name. -+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix -+ ac_top_srcdir=$ac_top_build_prefix$srcdir -+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -+esac -+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -+ -+ -+ case $ac_mode in -+ :F) -+ # -+ # CONFIG_FILE -+ # -+ -+ case $INSTALL in -+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; -+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; -+ esac -+ ac_MKDIR_P=$MKDIR_P -+ case $MKDIR_P in -+ [\\/$]* | ?:[\\/]* ) ;; -+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; -+ esac -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+# If the template does not know about datarootdir, expand it. -+# FIXME: This hack should be removed a few years after 2.60. -+ac_datarootdir_hack=; ac_datarootdir_seen= -+ac_sed_dataroot=' -+/datarootdir/ { -+ p -+ q -+} -+/@datadir@/p -+/@docdir@/p -+/@infodir@/p -+/@localedir@/p -+/@mandir@/p' -+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -+*datarootdir*) ac_datarootdir_seen=yes;; -+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -+_ACEOF -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+ ac_datarootdir_hack=' -+ s&@datadir@&$datadir&g -+ s&@docdir@&$docdir&g -+ s&@infodir@&$infodir&g -+ s&@localedir@&$localedir&g -+ s&@mandir@&$mandir&g -+ s&\\\${datarootdir}&$datarootdir&g' ;; -+esac -+_ACEOF -+ -+# Neutralize VPATH when `$srcdir' = `.'. -+# Shell code in configure.ac might set extrasub. -+# FIXME: do we really want to maintain this feature? -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+ac_sed_extra="$ac_vpsub -+$extrasub -+_ACEOF -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+:t -+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -+s|@configure_input@|$ac_sed_conf_input|;t t -+s&@top_builddir@&$ac_top_builddir_sub&;t t -+s&@top_build_prefix@&$ac_top_build_prefix&;t t -+s&@srcdir@&$ac_srcdir&;t t -+s&@abs_srcdir@&$ac_abs_srcdir&;t t -+s&@top_srcdir@&$ac_top_srcdir&;t t -+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -+s&@builddir@&$ac_builddir&;t t -+s&@abs_builddir@&$ac_abs_builddir&;t t -+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -+s&@INSTALL@&$ac_INSTALL&;t t -+s&@MKDIR_P@&$ac_MKDIR_P&;t t -+$ac_datarootdir_hack -+" -+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ -+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+ -+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && -+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && -+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ -+ "$ac_tmp/out"`; test -z "$ac_out"; } && -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -+which seems to be undefined. Please make sure it is defined" >&5 -+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -+which seems to be undefined. Please make sure it is defined" >&2;} -+ -+ rm -f "$ac_tmp/stdin" -+ case $ac_file in -+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; -+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; -+ esac \ -+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+ ;; -+ -+ -+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -+$as_echo "$as_me: executing $ac_file commands" >&6;} -+ ;; -+ esac -+ -+ -+ case $ac_file$ac_mode in -+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || { -+ # Autoconf 2.62 quotes --file arguments for eval, but not when files -+ # are listed without --file. Let's play safe and only enable the eval -+ # if we detect the quoting. -+ case $CONFIG_FILES in -+ *\'*) eval set x "$CONFIG_FILES" ;; -+ *) set x $CONFIG_FILES ;; -+ esac -+ shift -+ for mf -+ do -+ # Strip MF so we end up with the name of the file. -+ mf=`echo "$mf" | sed -e 's/:.*$//'` -+ # Check whether this is an Automake generated Makefile or not. -+ # We used to match only the files named `Makefile.in', but -+ # some people rename them; so instead we look at the file content. -+ # Grep'ing the first line is not enough: some people post-process -+ # each Makefile.in and add a new line on top of each file to say so. -+ # Grep'ing the whole file is not good either: AIX grep has a line -+ # limit of 2048, but all sed's we know have understand at least 4000. -+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then -+ dirpart=`$as_dirname -- "$mf" || -+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$mf" : 'X\(//\)[^/]' \| \ -+ X"$mf" : 'X\(//\)$' \| \ -+ X"$mf" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X"$mf" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)[^/].*/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ else -+ continue -+ fi -+ # Extract the definition of DEPDIR, am__include, and am__quote -+ # from the Makefile without running `make'. -+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` -+ test -z "$DEPDIR" && continue -+ am__include=`sed -n 's/^am__include = //p' < "$mf"` -+ test -z "am__include" && continue -+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"` -+ # When using ansi2knr, U may be empty or an underscore; expand it -+ U=`sed -n 's/^U = //p' < "$mf"` -+ # Find all dependency output files, they are included files with -+ # $(DEPDIR) in their names. We invoke sed twice because it is the -+ # simplest approach to changing $(DEPDIR) to its actual value in the -+ # expansion. -+ for file in `sed -n " -+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ -+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do -+ # Make sure the directory exists. -+ test -f "$dirpart/$file" && continue -+ fdir=`$as_dirname -- "$file" || -+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$file" : 'X\(//\)[^/]' \| \ -+ X"$file" : 'X\(//\)$' \| \ -+ X"$file" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X"$file" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)[^/].*/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ as_dir=$dirpart/$fdir; as_fn_mkdir_p -+ # echo "creating $dirpart/$file" -+ echo '# dummy' > "$dirpart/$file" -+ done -+ done -+} -+ ;; -+ -+ esac -+done # for ac_tag -+ -+ -+as_fn_exit 0 -+_ACEOF -+ac_clean_files=$ac_clean_files_save -+ -+test $ac_write_fail = 0 || -+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 -+ -+ -+# configure is writing to config.log, and then calls config.status. -+# config.status does its own redirection, appending to config.log. -+# Unfortunately, on DOS this fails, as config.log is still kept open -+# by configure, so config.status won't be able to write to it; its -+# output is simply discarded. So we exec the FD to /dev/null, -+# effectively closing config.log, so it can be properly (re)opened and -+# appended to by config.status. When coming back to configure, we -+# need to make the FD available again. -+if test "$no_create" != yes; then -+ ac_cs_success=: -+ ac_config_status_args= -+ test "$silent" = yes && -+ ac_config_status_args="$ac_config_status_args --quiet" -+ exec 5>/dev/null -+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false -+ exec 5>>config.log -+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which -+ # would make configure fail if this is the last instruction. -+ $ac_cs_success || as_fn_exit 1 -+fi -+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -+fi -+ -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/configure.in newlib-1.20.0/newlib/libc/sys/psp/configure.in ---- orig.newlib-1.20.0/newlib/libc/sys/psp/configure.in 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/configure.in 2012-01-11 22:43:31.234242024 +0100 -@@ -0,0 +1,14 @@ -+dnl This is the newlib/libc/sys/sun4 configure.in file. -+dnl Process this file with autoconf to produce a configure script. -+ -+AC_PREREQ(2.59) -+AC_INIT([newlib],[NEWLIB_VERSION]) -+AC_CONFIG_SRCDIR([libcglue.c]) -+ -+dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. -+AC_CONFIG_AUX_DIR(../../../..) -+ -+NEWLIB_CONFIGURE(../../..) -+ -+AC_CONFIG_FILES(Makefile) -+AC_OUTPUT -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/crt0.c newlib-1.20.0/newlib/libc/sys/psp/crt0.c ---- orig.newlib-1.20.0/newlib/libc/sys/psp/crt0.c 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/crt0.c 2012-01-11 22:43:43.898100469 +0100 -@@ -0,0 +1,3 @@ -+/* The real crt0.c lives in PSPSDK. */ -+ -+void _start() { } -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/fdman.c newlib-1.20.0/newlib/libc/sys/psp/fdman.c ---- orig.newlib-1.20.0/newlib/libc/sys/psp/fdman.c 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/fdman.c 2012-01-12 17:25:59.497825013 +0100 -@@ -0,0 +1,115 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * fdman.c - File descriptor management. -+ * -+ * Copyright (c) 2006 Rafael Cabezas -+ */ -+#include -+#include -+#include "fdman.h" -+ -+extern int pspDisableInterrupts(); -+extern void pspEnableInterrupts(int); -+ -+static __psp_descriptormap_type __psp_descriptor_data_pool[__PSP_FILENO_MAX]; -+__psp_descriptormap_type *__psp_descriptormap [__PSP_FILENO_MAX]; -+ -+void __psp_fdman_init() -+{ -+ int scefd; -+ -+ /* Initialize descriptor data*/ -+ memset(__psp_descriptor_data_pool, 0, sizeof(__psp_descriptormap_type) *__PSP_FILENO_MAX); -+ /* Initialize descriptor map*/ -+ memset(__psp_descriptormap, 0, sizeof(__psp_descriptormap_type*)*__PSP_FILENO_MAX); -+ -+ scefd = sceKernelStdin(); -+ if (scefd >= 0) { -+ __psp_descriptormap[0] = &__psp_descriptor_data_pool[0]; -+ __psp_descriptormap[0]->sce_descriptor = scefd; -+ __psp_descriptormap[0]->type = __PSP_DESCRIPTOR_TYPE_TTY; -+ } -+ scefd = sceKernelStdout(); -+ if (scefd >= 0) { -+ __psp_descriptormap[1] = &__psp_descriptor_data_pool[1]; -+ __psp_descriptormap[1]->sce_descriptor = scefd; -+ __psp_descriptormap[1]->type = __PSP_DESCRIPTOR_TYPE_TTY; -+ } -+ scefd = sceKernelStderr(); -+ if (scefd >= 0) { -+ __psp_descriptormap[2] = &__psp_descriptor_data_pool[2]; -+ __psp_descriptormap[2]->sce_descriptor = scefd; -+ __psp_descriptormap[2]->type = __PSP_DESCRIPTOR_TYPE_TTY; -+ } -+} -+ -+int __psp_fdman_get_new_descriptor() -+{ -+ int i = 0; -+ int inten; -+ -+ inten = pspDisableInterrupts(); /* lock here to make thread safe */ -+ for (i = 0; i < __PSP_FILENO_MAX; i++) { -+ if (__psp_descriptormap[i] == NULL) { -+ __psp_descriptormap[i] = &__psp_descriptor_data_pool[i]; -+ __psp_descriptormap[i]->ref_count++; -+ pspEnableInterrupts(inten); /* release lock */ -+ return i; -+ } -+ } -+ pspEnableInterrupts(inten); /* release lock */ -+ -+ errno = ENOMEM; -+ return -1; -+} -+ -+int __psp_fdman_get_dup_descriptor(int fd) -+{ -+ int i = 0; -+ int inten; -+ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ inten = pspDisableInterrupts(); /* lock here to make thread safe */ -+ for (i = 0; i < __PSP_FILENO_MAX; i++) { -+ if (__psp_descriptormap[i] == NULL) { -+ __psp_descriptormap[i] = &__psp_descriptor_data_pool[fd]; -+ __psp_descriptormap[i]->ref_count++; -+ pspEnableInterrupts(inten); /* release lock */ -+ return i; -+ } -+ } -+ pspEnableInterrupts(inten); /* release lock */ -+ -+ errno = ENOMEM; -+ return -1; -+} -+ -+void __psp_fdman_release_descriptor(int fd) -+{ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return; -+ } -+ -+ __psp_descriptormap[fd]->ref_count--; -+ -+ if (__psp_descriptormap[fd]->ref_count == 0) { -+ -+ if (__psp_descriptormap[fd]->filename != NULL) { -+ free(__psp_descriptormap[fd]->filename); -+ } -+ __psp_descriptormap[fd]->filename = NULL; -+ __psp_descriptormap[fd]->sce_descriptor = 0; -+ __psp_descriptormap[fd]->type = 0; -+ __psp_descriptormap[fd]->flags = 0; -+ -+ } -+ __psp_descriptormap[fd] = NULL; -+} -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/fdman.h newlib-1.20.0/newlib/libc/sys/psp/fdman.h ---- orig.newlib-1.20.0/newlib/libc/sys/psp/fdman.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/fdman.h 2012-01-12 17:25:59.497825013 +0100 -@@ -0,0 +1,44 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * fdman.h - File descriptor management. -+ * -+ * Copyright (c) 2006 Rafael Cabezas -+ */ -+ -+#ifndef _FDMAN_H_ -+ #define _FDMAN_H_ -+ -+ #define __PSP_FILENO_MAX 1024 -+ -+ #define __PSP_IS_FD_VALID(FD) \ -+ ( (FD >= 0) && (FD < __PSP_FILENO_MAX) && (__psp_descriptormap[FD] != NULL) ) -+ -+ #define __PSP_IS_FD_OF_TYPE(FD, TYPE) \ -+ ( (__PSP_IS_FD_VALID(FD)) && (__psp_descriptormap[FD]->type == TYPE) ) -+ -+ typedef enum { -+ __PSP_DESCRIPTOR_TYPE_FILE , -+ __PSP_DESCRIPTOR_TYPE_PIPE , -+ __PSP_DESCRIPTOR_TYPE_SOCKET, -+ __PSP_DESCRIPTOR_TYPE_TTY -+ } __psp_fdman_fd_types; -+ -+ typedef struct { -+ char * filename; -+ u8 type; -+ u32 sce_descriptor; -+ u32 flags; -+ u32 ref_count; -+ } __psp_descriptormap_type; -+ -+ extern __psp_descriptormap_type *__psp_descriptormap[__PSP_FILENO_MAX]; -+ -+ void __psp_fdman_init(); -+ int __psp_fdman_get_new_descriptor(); -+ int __psp_fdman_get_dup_descriptor(int fd); -+ void __psp_fdman_release_descriptor(int fd); -+ -+#endif -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/include/netdb.h newlib-1.20.0/newlib/libc/sys/psp/include/netdb.h ---- orig.newlib-1.20.0/newlib/libc/sys/psp/include/netdb.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/include/netdb.h 2012-01-12 17:25:59.497825013 +0100 -@@ -0,0 +1,36 @@ -+/* Simple gethostbyname and gethostbyaddr replacements, note not thread safe */ -+#ifndef __NETDB_H__ -+#define __NETDB_H__ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#define NETDB_INTERNAL -1 /* see errno */ -+#define NETDB_SUCCESS 0 /* no problem */ -+#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */ -+#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */ -+#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ -+#define NO_DATA 4 /* Valid name, no data record of requested type */ -+#define NO_ADDRESS NO_DATA /* no address, look for MX record */ -+ -+extern int h_errno; -+ -+struct hostent -+{ -+ char *h_name; -+ char **h_aliases; -+ int h_addrtype; -+ int h_length; -+ char **h_addr_list; -+ char *h_addr; -+}; -+ -+struct hostent *gethostbyaddr(const void *addr, int len, int type); -+struct hostent *gethostbyname(const char *name); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/interrupt.S newlib-1.20.0/newlib/libc/sys/psp/interrupt.S ---- orig.newlib-1.20.0/newlib/libc/sys/psp/interrupt.S 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/interrupt.S 2012-01-12 17:25:59.497825013 +0100 -@@ -0,0 +1,66 @@ -+ -+ .set noreorder -+ .set noat -+ -+ .global pspDisableInterrupts -+ .ent pspDisableInterrupts -+ -+pspDisableInterrupts: -+ mfic $v0, $0 -+ mtic $0, $0 -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ jr $ra -+ nop -+ -+ .end pspDisableInterrupts -+ -+ .global pspEnableInterrupts -+ .ent pspEnableInterrupts -+ -+pspEnableInterrupts: -+ mtic $a0, $0 -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ nop -+ jr $ra -+ nop -+ -+ .end pspEnableInterrupts -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/libcglue.c newlib-1.20.0/newlib/libc/sys/psp/libcglue.c ---- orig.newlib-1.20.0/newlib/libc/sys/psp/libcglue.c 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/libcglue.c 2012-01-15 11:45:28.792195329 +0100 -@@ -0,0 +1,969 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * libcglue.c - Newlib-compatible system calls. -+ * -+ * Copyright (c) 2005 Marcus R. Brown -+ * Copyright (c) 2005 James Forshaw -+ * Copyright (c) 2005 John Kelley -+ * Copyright (c) 2005 Jim Paris -+ * -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "fdman.h" -+ -+extern char __psp_cwd[MAXPATHLEN + 1]; -+extern void __psp_init_cwd(char *argv_0); -+extern int __psp_path_absolute(const char *in, char *out, int len); -+extern int pspDisableInterrupts(); -+extern void pspEnableInterrupts(int); -+ -+/* The following functions are defined in socket.c. They have weak linkage so -+ that the user doesn't have to link against the PSP network libraries if they -+ don't use the sockets API. */ -+extern int __psp_socket_close(int s) __attribute__((weak)); -+extern ssize_t __psp_socket_recv(int s, void *buf, size_t len, int flags) __attribute__((weak)); -+extern ssize_t __psp_socket_send(int s, const void *buf, size_t len, int flags) __attribute__((weak)); -+ -+extern int pipe(int fildes[2]); -+extern int __psp_pipe_close(int filedes); -+extern int __psp_pipe_nonblocking_read(int fd, void *buf, size_t len); -+extern int __psp_pipe_read(int fd, void *buf, size_t len); -+extern int __psp_pipe_write(int fd, const void *buf, size_t size); -+extern int __psp_pipe_nonblocking_write(int fd, const void *buf, size_t len); -+ -+int __psp_set_errno(int code); -+ -+#ifdef F___psp_set_errno -+int __psp_set_errno(int code) -+{ -+ if ((code & 0x80010000) == 0x80010000) { -+ errno = code & 0xFFFF; -+ return -1; -+ } -+ return code; -+} -+#endif -+ -+#ifdef F_getcwd -+char *getcwd(char *buf, size_t size) -+{ -+ if(!buf) { -+ errno = EINVAL; -+ return NULL; -+ } -+ -+ if(strlen(__psp_cwd) >= size) { -+ errno = ERANGE; -+ return NULL; -+ } -+ -+ strcpy(buf, __psp_cwd); -+ return buf; -+} -+#endif -+ -+#ifdef F_chdir -+int chdir(const char *path) -+{ -+ char dest[MAXPATHLEN + 1]; -+ SceUID uid; -+ -+ if(__psp_path_absolute(path, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ /* sceIoChdir doesn't give an indication of whether it worked, -+ so test for existence by attempting to open the dir */ -+ uid = sceIoDopen(dest); -+ if(uid < 0) { -+ errno = ENOTDIR; -+ return -1; -+ } -+ sceIoDclose(uid); -+ -+ sceIoChdir(dest); -+ strcpy(__psp_cwd, dest); -+ return 0; -+} -+#endif -+ -+#ifdef F_mkdir -+int mkdir(const char *pathname, mode_t mode) -+{ -+ char dest[MAXPATHLEN + 1]; -+ -+ if(__psp_path_absolute(pathname, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ return __psp_set_errno(sceIoMkdir(dest, mode)); -+} -+#endif -+ -+#ifdef F_rmdir -+int rmdir(const char *pathname) -+{ -+ char dest[MAXPATHLEN + 1]; -+ -+ if(__psp_path_absolute(pathname, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ return __psp_set_errno(sceIoRmdir(dest)); -+} -+#endif -+ -+#ifdef F_realpath -+char *realpath(const char *path, char *resolved_path) -+{ -+ if(!path || !resolved_path) { -+ errno = EINVAL; -+ return NULL; -+ } -+ if(__psp_path_absolute(path, resolved_path, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return NULL; -+ } -+ if(access(resolved_path, F_OK) < 0) { -+ errno = ENOENT; -+ return NULL; -+ } -+ return resolved_path; -+} -+#endif -+ -+/* Wrappers of the standard open(), close(), read(), write(), unlink() and lseek() routines. */ -+#ifdef F__open -+int _open(const char *name, int flags, int mode) -+{ -+ int scefd, fd; -+ int sce_flags; -+ char dest[MAXPATHLEN + 1]; -+ -+ if(__psp_path_absolute(name, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ /* O_RDONLY starts at 0, where PSP_O_RDONLY starts at 1, so remap the read/write -+ flags by adding 1. */ -+ sce_flags = (flags & O_ACCMODE) + 1; -+ -+ /* Translate standard open flags into the flags understood by the PSP kernel. */ -+ if (flags & O_APPEND) { -+ sce_flags |= PSP_O_APPEND; -+ } -+ if (flags & O_CREAT) { -+ sce_flags |= PSP_O_CREAT; -+ } -+ if (flags & O_TRUNC) { -+ sce_flags |= PSP_O_TRUNC; -+ } -+ if (flags & O_EXCL) { -+ sce_flags |= PSP_O_EXCL; -+ } -+ if (flags & O_NONBLOCK) { -+ sce_flags |= PSP_O_NBLOCK; -+ } -+ -+ scefd = sceIoOpen(dest, sce_flags, mode); -+ if (scefd >= 0) { -+ fd = __psp_fdman_get_new_descriptor(); -+ if (fd != -1) { -+ __psp_descriptormap[fd]->sce_descriptor = scefd; -+ __psp_descriptormap[fd]->type = __PSP_DESCRIPTOR_TYPE_FILE; -+ __psp_descriptormap[fd]->flags = flags; -+ __psp_descriptormap[fd]->filename = strdup(dest); -+ return fd; -+ } -+ else { -+ sceIoClose(scefd); -+ errno = ENOMEM; -+ return -1; -+ } -+ } -+ else { -+ return __psp_set_errno(scefd); -+ } -+ -+} -+#endif -+ -+#ifdef F__close -+int _close(int fd) -+{ -+ int ret = 0; -+ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ case __PSP_DESCRIPTOR_TYPE_TTY: -+ if (__psp_descriptormap[fd]->ref_count == 1) { -+ ret = __psp_set_errno(sceIoClose(__psp_descriptormap[fd]->sce_descriptor)); -+ } -+ __psp_fdman_release_descriptor(fd); -+ return ret; -+ break; -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ return __psp_pipe_close(fd); -+ break; -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ if (__psp_socket_close != NULL) { -+ ret = __psp_socket_close(fd); -+ return ret; -+ } -+ break; -+ default: -+ break; -+ } -+ -+ errno = EBADF; -+ return -1; -+} -+#endif -+ -+#ifdef F__read -+int _read(int fd, void *buf, size_t size) -+{ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ case __PSP_DESCRIPTOR_TYPE_TTY: -+ return __psp_set_errno(sceIoRead(__psp_descriptormap[fd]->sce_descriptor, buf, size)); -+ break; -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ if (__psp_descriptormap[fd]->flags & O_NONBLOCK) { -+ return __psp_pipe_nonblocking_read(fd, buf, size); -+ } -+ else { -+ return __psp_pipe_read(fd, buf, size); -+ } -+ break; -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ if (__psp_socket_recv != NULL) { -+ return __psp_socket_recv(fd, buf, size, 0); -+ } -+ break; -+ default: -+ break; -+ } -+ -+ errno = EBADF; -+ return -1; -+ -+} -+#endif -+ -+#ifdef F__write -+int _write(int fd, const void *buf, size_t size) -+{ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ case __PSP_DESCRIPTOR_TYPE_TTY: -+ return __psp_set_errno(sceIoWrite(__psp_descriptormap[fd]->sce_descriptor, buf, size)); -+ break; -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ if (__psp_descriptormap[fd]->flags & O_NONBLOCK) { -+ return __psp_pipe_nonblocking_write(fd, buf, size); -+ } -+ else { -+ return __psp_pipe_write(fd, buf, size); -+ } -+ break; -+ break; -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ if (__psp_socket_send != NULL) { -+ return __psp_socket_send(fd, buf, size, 0); -+ } -+ break; -+ default: -+ break; -+ } -+ -+ errno = EBADF; -+ return -1; -+} -+#endif -+ -+#ifdef F__lseek -+off_t _lseek(int fd, off_t offset, int whence) -+{ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ /* We don't have to do anything with the whence argument because SEEK_* == PSP_SEEK_*. */ -+ return (off_t) __psp_set_errno(sceIoLseek(__psp_descriptormap[fd]->sce_descriptor, offset, whence)); -+ break; -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ break; -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ break; -+ default: -+ break; -+ } -+ -+ errno = EBADF; -+ return -1; -+ -+} -+#endif -+ -+#ifdef F__unlink -+int _unlink(const char *path) -+{ -+ char dest[MAXPATHLEN + 1]; -+ -+ if(__psp_path_absolute(path, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ return __psp_set_errno(sceIoRemove(dest)); -+} -+#endif -+ -+#ifdef F__link -+int _link(const char *name1, const char *name2) -+{ -+ errno = ENOSYS; -+ return -1; /* not supported */ -+} -+#endif -+ -+#ifdef F_opendir -+DIR *opendir(const char *filename) -+{ -+ char dest[MAXPATHLEN + 1]; -+ DIR *dirp; -+ SceUID uid; -+ -+ /* Normalize pathname so that opendir(".") works */ -+ if(__psp_path_absolute(filename, dest, MAXPATHLEN) < 0) { -+ errno = ENOENT; -+ return NULL; -+ } -+ -+ dirp = (DIR *)malloc(sizeof(DIR)); -+ -+ uid = sceIoDopen(dest); -+ -+ if (uid < 0) -+ { -+ free(dirp); -+ (void) __psp_set_errno(uid); -+ return NULL; -+ } -+ -+ dirp->uid = uid; -+ -+ return dirp; -+} -+#endif -+ -+#ifdef F_readdir -+struct dirent *readdir(DIR *dirp) -+{ -+ int ret; -+ -+ /* Zero the dirent, to avoid possible problems with sceIoDread */ -+ memset(&dirp->de, 0, sizeof(struct dirent)); -+ -+ ret = sceIoDread(dirp->uid, (SceIoDirent *)&dirp->de); -+ if (ret == 0) { -+ /* EOF */ -+ errno = 0; -+ return NULL; -+ } -+ if (ret < 0) { -+ (void) __psp_set_errno(ret); -+ return NULL; -+ } -+ -+ return &dirp->de; -+} -+#endif -+ -+#ifdef F_closedir -+int closedir(DIR *dirp) -+{ -+ if (dirp != NULL) -+ { -+ int uid; -+ uid = dirp->uid; -+ free (dirp); -+ return __psp_set_errno(sceIoDclose(uid)); -+ } -+ errno = EBADF; -+ return -1; -+} -+#endif -+ -+/* Time routines. These wrap around the routines provided by the kernel. */ -+#ifdef F__gettimeofday -+int _gettimeofday(struct timeval *tp, struct timezone *tzp) -+{ -+ int ret; -+ time_t t; -+ struct timeval tv1, tv2; -+ -+ /* The kernel sceKernelLibcGettimeofday only returns time -+ since midnight. To get a proper timeval return value, we -+ get seconds using sceKernelLibcTime and microseconds using -+ sceKernelLibcGettimeofday. Since we are reading the time -+ with two different function calls, we need to be careful -+ to avoid glitches when the time changes between calls. */ -+ -+ retry: -+ /* Get seconds and microseconds since midnight */ -+ ret = __psp_set_errno(sceKernelLibcGettimeofday(&tv1, tzp)); -+ if (ret < 0) -+ return ret; -+ -+ /* Get seconds since epoch */ -+ ret = __psp_set_errno(sceKernelLibcTime(&t)); -+ if (ret < 0) -+ return ret; -+ -+ /* Get seconds and microseconds since midnight, again */ -+ ret = __psp_set_errno(sceKernelLibcGettimeofday(&tv2, tzp)); -+ if (ret < 0) -+ return ret; -+ -+ /* Retry if microseconds wrapped around */ -+ if (tv2.tv_usec < tv1.tv_usec) -+ goto retry; -+ -+ /* Return the actual time since epoch */ -+ tp->tv_sec = t; -+ tp->tv_usec = tv2.tv_usec; -+ -+ return 0; -+} -+ -+#endif -+ -+#if defined(F_clock) -+clock_t clock(void) -+{ -+ return sceKernelLibcClock(); -+} -+#endif -+ -+#if defined(F_time) -+time_t time(time_t *t) -+{ -+ return __psp_set_errno(sceKernelLibcTime(t)); -+} -+#endif -+ -+#if defined(F_sleep) -+unsigned int sleep(unsigned int secs) { -+ while(secs--) { -+ sceKernelDelayThreadCB(1000000); -+ } -+ return 0; -+} -+#endif -+ -+/* PSP-compatible sbrk(). */ -+#if defined(F__sbrk) || defined(F_glue__sbrk) -+ -+#define DEFAULT_PRX_HEAP_SIZE_KB 64 -+ -+/* If defined it specifies the desired size of the heap, in KB. */ -+extern int sce_newlib_heap_kb_size __attribute__((weak)); -+extern int __pspsdk_is_prx __attribute__((weak)); -+ -+/* UID of the memory block that represents the heap. */ -+static SceUID __psp_heap_blockid; -+ -+void * _sbrk(ptrdiff_t incr) -+{ -+ static void * heap_bottom = NULL; -+ static void * heap_top = NULL; -+ static void * heap_ptr = NULL; -+ -+ /* Has our heap been initialized? */ -+ if (heap_bottom == NULL) { -+ /* No, initialize the heap. */ -+ SceSize heap_size = (SceSize) -1; -+ -+ if (&sce_newlib_heap_kb_size != NULL) { -+ heap_size = sce_newlib_heap_kb_size; -+ } else if(&__pspsdk_is_prx != NULL) { -+ heap_size = DEFAULT_PRX_HEAP_SIZE_KB; -+ } -+ -+ heap_size *= 1024; -+ if ((int)heap_size < 0) { -+ heap_size += sceKernelMaxFreeMemSize(); -+ } -+ -+ if (heap_size != 0) { -+ __psp_heap_blockid = sceKernelAllocPartitionMemory(2, "block", PSP_SMEM_Low, heap_size, NULL); -+ if (__psp_heap_blockid > 0) { -+ heap_bottom = sceKernelGetBlockHeadAddr(__psp_heap_blockid); -+ heap_ptr = heap_bottom; -+ heap_top = (unsigned char *) heap_bottom + heap_size; -+ } -+ } -+ } -+ -+ void * heap_addr = (void *) -1; -+ void * next_heap_ptr = (void *) ((ptrdiff_t) heap_ptr + incr); -+ if ((heap_bottom != NULL) && (next_heap_ptr >= heap_bottom) && (next_heap_ptr < heap_top)) { -+ heap_addr = heap_ptr; -+ heap_ptr = next_heap_ptr; -+ } -+ -+ return heap_addr; -+} -+ -+/* Free the heap. */ -+int __psp_free_heap(void) -+{ -+ if (__psp_heap_blockid > 0) { -+ return sceKernelFreePartitionMemory(__psp_heap_blockid); -+ } -+ -+ return __psp_heap_blockid; -+} -+#endif -+ -+/* Other POSIX routines that must be defined. */ -+#ifdef F__fstat -+int _fstat(int fd, struct stat *sbuf) -+{ -+ int ret; -+ SceOff oldpos; -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_TTY: -+ memset(sbuf, '\0', sizeof(struct stat)); -+ sbuf->st_mode = S_IFCHR; -+ return 0; -+ break; -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ if (__psp_descriptormap[fd]->filename != NULL) { -+ ret = stat(__psp_descriptormap[fd]->filename, sbuf); -+ -+ /* Find true size of the open file */ -+ oldpos = sceIoLseek(__psp_descriptormap[fd]->sce_descriptor, 0, SEEK_CUR); -+ if (oldpos != (off_t) -1) { -+ sbuf->st_size = (off_t) sceIoLseek(__psp_descriptormap[fd]->sce_descriptor, 0, SEEK_END); -+ sceIoLseek(__psp_descriptormap[fd]->sce_descriptor, oldpos, SEEK_SET); -+ } -+ return ret; -+ } -+ break; -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ default: -+ break; -+ } -+ -+ errno = EBADF; -+ return -1; -+} -+#endif -+ -+#ifdef F_isatty -+int isatty(int fd) -+{ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return 0; -+ } -+ -+ if (__psp_descriptormap[fd]->type == __PSP_DESCRIPTOR_TYPE_TTY) { -+ return 1; -+ } -+ else { -+ return 0; -+ } -+} -+#endif -+ -+#ifdef F__isatty -+int _isatty(int fd) -+{ -+ return isatty(fd); -+} -+#endif -+ -+#ifdef F__stat -+static time_t psp_to_epoch_time(ScePspDateTime psp_time) -+{ -+ struct tm conv_time; -+ conv_time.tm_year = psp_time.year; -+ conv_time.tm_mon = psp_time.month; -+ conv_time.tm_mday = psp_time.day; -+ conv_time.tm_hour = psp_time.hour; -+ conv_time.tm_min = psp_time.minute; -+ conv_time.tm_sec = psp_time.second; -+ conv_time.tm_isdst = -1; -+ return mktime(&conv_time); -+} -+ -+int _stat(const char *filename, struct stat *buf) -+{ -+ SceIoStat psp_stat; -+ char dest[MAXPATHLEN + 1]; -+ int ret; -+ -+ if(__psp_path_absolute(filename, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ memset(buf, '\0', sizeof(struct stat)); -+ ret = sceIoGetstat(dest, &psp_stat); -+ if (ret < 0) { -+ return __psp_set_errno(ret); -+ } -+ -+ buf->st_ctime = psp_to_epoch_time(psp_stat.st_ctime); -+ buf->st_atime = psp_to_epoch_time(psp_stat.st_atime); -+ buf->st_mtime = psp_to_epoch_time(psp_stat.st_mtime); -+ -+ buf->st_mode = (psp_stat.st_mode & 0xfff) | -+ ((FIO_S_ISLNK(psp_stat.st_mode))?(S_IFLNK):(0)) | -+ ((FIO_S_ISREG(psp_stat.st_mode))?(S_IFREG):(0)) | -+ ((FIO_S_ISDIR(psp_stat.st_mode))?(S_IFDIR):(0)); -+ buf->st_size = psp_stat.st_size; -+ return 0; -+} -+#endif -+ -+/* from stat.h in ps2sdk, this function may be correct */ -+#define FIO_CST_SIZE 0x0004 -+ -+#ifdef F_truncate -+int truncate(const char *filename, off_t length) -+{ -+ SceIoStat psp_stat; -+ char dest[MAXPATHLEN + 1]; -+ -+ if(__psp_path_absolute(filename, dest, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ psp_stat.st_size = length; -+ if(length < 0) -+ { -+ errno = EINVAL; -+ return -1; -+ } -+ return __psp_set_errno(sceIoChstat(dest, &psp_stat, FIO_CST_SIZE)); -+} -+#endif -+ -+/* Unsupported newlib system calls. */ -+#ifdef F__fork -+pid_t fork(void) -+{ -+ errno = ENOSYS; -+ return (pid_t) -1; -+} -+#endif -+ -+#ifdef F__getpid -+pid_t _getpid(void) -+{ -+ errno = ENOSYS; -+ return (pid_t) -1; -+} -+#endif -+ -+#ifdef F__kill -+int _kill(int unused, int unused2) -+{ -+ errno = ENOSYS; -+ return -1; -+} -+#endif -+ -+#ifdef F__wait -+pid_t _wait(int *unused) -+{ -+ errno = ENOSYS; -+ return (pid_t) -1; -+} -+#endif -+ -+#ifdef F_access -+int access(const char *fn, int flags) -+{ -+ struct stat s; -+ if (stat(fn, &s)) -+ return -1; -+ if (s.st_mode & S_IFDIR) -+ return 0; -+ if (flags & W_OK) -+ { -+ if (s.st_mode & S_IWRITE) -+ return 0; -+ errno = EACCES; -+ return -1; -+ } -+ return 0; -+} -+#endif -+ -+#ifdef F__fcntl -+int _fcntl(int fd, int cmd, ...) -+{ -+ if (!__PSP_IS_FD_VALID(fd)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ switch (cmd) -+ { -+ case F_DUPFD: -+ { -+ return __psp_fdman_get_dup_descriptor(fd); -+ break; -+ } -+ case F_GETFL: -+ { -+ return __psp_descriptormap[fd]->flags; -+ break; -+ } -+ case F_SETFL: -+ { -+ int newfl; -+ va_list args; -+ -+ va_start (args, cmd); /* Initialize the argument list. */ -+ newfl = va_arg(args, int); -+ va_end (args); /* Clean up. */ -+ -+ __psp_descriptormap[fd]->flags = newfl; -+ -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ break; -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ break; -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ if (newfl & O_NONBLOCK) -+ { -+ int one = 1; -+ return setsockopt(fd, SOL_SOCKET, SO_NONBLOCK, (char *)&one, sizeof(one)); -+ } -+ else -+ { -+ int zero = 0; -+ return setsockopt(fd, SOL_SOCKET, SO_NONBLOCK, (char *)&zero, sizeof(zero)); -+ } -+ break; -+ default: -+ break; -+ } -+ return 0; -+ break; -+ } -+ } -+ -+ errno = EBADF; -+ return -1; -+} -+#endif /* F__fcntl */ -+ -+#ifdef F_tzset -+void tzset(void) -+{ -+ static int initialized = 0; -+ -+ if (!initialized) -+ { -+ initialized = 1; -+ -+ /* Don't init if TZ has already been set once, this probably means the user -+ wanted to override what we would set below. */ -+ if (getenv("TZ") == NULL) -+ { -+ /* Initialize timezone from PSP configuration */ -+ int tzOffset = 0; -+ sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_TIMEZONE, &tzOffset); -+ int tzOffsetAbs = tzOffset < 0 ? -tzOffset : tzOffset; -+ int hours = tzOffsetAbs / 60; -+ int minutes = tzOffsetAbs - hours * 60; -+ int pspDaylight = 0; -+ sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_DAYLIGHTSAVINGS, &pspDaylight); -+ static char tz[18]; -+ sprintf(tz, "GMT%s%02i:%02i%s", tzOffset < 0 ? "+" : "-", hours, minutes, pspDaylight ? "daylight" : ""); -+ setenv("TZ", tz, 1); -+ } -+ } -+ -+ _tzset_r(_REENT); -+} -+#endif -+ -+#ifdef F_mlock -+static unsigned int lock_count = 0; -+static unsigned int intr_flags = 0; -+ -+void __malloc_lock(struct _reent *ptr) -+{ -+ unsigned int flags = pspDisableInterrupts(); -+ -+ if (lock_count == 0) { -+ intr_flags = flags; -+ } -+ -+ lock_count++; -+} -+ -+void __malloc_unlock(struct _reent *ptr) -+{ -+ if (--lock_count == 0) { -+ pspEnableInterrupts(intr_flags); -+ } -+} -+#endif -+ -+/* Exit. */ -+#if defined(F__exit) || defined(F_glue__exit) -+extern int sce_newlib_nocreate_thread_in_start __attribute__((weak)); -+ -+extern int __psp_free_heap(void); -+ -+void _exit(int status) -+{ -+ if (&sce_newlib_nocreate_thread_in_start == NULL) { -+ /* Free the heap created by _sbrk(). */ -+ __psp_free_heap(); -+ -+ sceKernelSelfStopUnloadModule(1, 0, NULL); -+ } else { -+ if (status == 0) { -+ /* Free the heap created by _sbrk(). */ -+ __psp_free_heap(); -+ } -+ -+ sceKernelExitThread(status); -+ } -+ -+ while (1) ; -+} -+ -+/* Note: This function is being linked into _exit.o. -+ -+ Because __psp_libc_init is a weak import in crt0.c, the linker -+ chooses to ignore an object file in libc.a that contains just this -+ function, since it's not necessary for successful compilation. -+ -+ By putting it instead in _exit.o, which is already used by crt0.c, -+ the linker sees __psp_libc_init and resolves the symbol properly. -+*/ -+void __psp_libc_init(int argc, char *argv[]) -+{ -+ (void) argc; -+ -+ /* Initialize cwd from this program's path */ -+ __psp_init_cwd(argv[0]); -+ -+ /* Initialize filedescriptor management */ -+ __psp_fdman_init(); -+} -+ -+#endif /* F__exit */ -+ -+#ifdef F__rename -+int _rename(const char *old, const char *new) -+{ -+ char oldname[MAXPATHLEN + 1]; -+ char newname[MAXPATHLEN + 1]; -+ -+ if(__psp_path_absolute(old, oldname, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ if(__psp_path_absolute(new, newname, MAXPATHLEN) < 0) { -+ errno = ENAMETOOLONG; -+ return -1; -+ } -+ -+ return __psp_set_errno(sceIoRename(oldname, newname)); -+} -+#endif -+ -+#ifdef F_nanosleep -+/* note: we don't use rem as we have no signals */ -+int nanosleep(const struct timespec *req, struct timespec *rem) -+{ -+ if( req == NULL ) -+ return EFAULT; -+ -+ if( rem != NULL ) { -+ rem->tv_sec = 0; -+ rem->tv_nsec = 0; -+ } -+ -+ sceKernelDelayThreadCB( 1000000 * req->tv_sec + (req->tv_nsec / 1000) ); -+ -+ return 0; -+} -+#endif -+ -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/Makefile.am newlib-1.20.0/newlib/libc/sys/psp/Makefile.am ---- orig.newlib-1.20.0/newlib/libc/sys/psp/Makefile.am 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/Makefile.am 2012-01-15 11:44:06.326516523 +0100 -@@ -0,0 +1,71 @@ -+## Process this file with automake to generate Makefile.in -+ -+AUTOMAKE_OPTIONS = cygnus -+ -+INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) -+ -+AM_CCASFLAGS = $(INCLUDES) $(CFLAGS) -+ -+noinst_LIBRARIES = lib.a -+ -+LIBCGLUE_MULT_OBJS = _close.o _exit.o _fork.o _fstat.o _getpid.o \ -+ _gettimeofday.o _kill.o _lseek.o _open.o _read.o \ -+ _sbrk.o _wait.o _write.o clock.o isatty.o _isatty.o \ -+ time.o _link.o _unlink.o sleep.o opendir.o readdir.o \ -+ closedir.o getcwd.o chdir.o mkdir.o rmdir.o \ -+ realpath.o _stat.o truncate.o access.o tzset.o \ -+ __psp_set_errno.o mlock.o _fcntl.o _rename.o nanosleep.o -+ -+SOCKET_MULT_OBJS = socket.o accept.o bind.o connect.o getsockopt.o \ -+ listen.o recv.o recvfrom.o send.o sendto.o \ -+ setsockopt.o shutdown.o getsockname.o getpeername.o \ -+ inet_ntoa.o -+ -+PE_OBJS = pipe.o -+ -+FDMAN_OBJS = fdman.o -+ -+SELECT_OBJS = select.o -+ -+INTERRUPT_OBJS = interrupt.o -+ -+XPRINTF_MULT_OBJS = vxprintf.o _xprintf.o __sout.o vsnprintf.o snprintf.o \ -+ vsprintf.o sprintf.o __mout.o mprintf.o vmprintf.o asprintf.o \ -+ vasprintf.o __fout.o fprintf.o vfprintf.o printf.o vprintf.o \ -+ _sprintf_r.o -+ -+NETDB_MULT_OBJS = h_errno.o gethostbyaddr.o gethostbyname.o -+ -+ -+lib_a_SOURCES = libcglue.c socket.c pspcwd.c xprintf.c netdb.c pipe.c fdman.c select.c syscalls.c interrupt.S -+lib_a_LIBADD = $(LIBCGLUE_MULT_OBJS) $(SOCKET_MULT_OBJS) $(XPRINTF_MULT_OBJS) \ -+ $(NETDB_MULT_OBJS) $(PIPE_OBJS) $(FDMAN_OBJS) $(SELECT_OBJS) $(INTERRUPT_OBJS) -+ -+all: crt0.o -+ -+$(LIBCGLUE_MULT_OBJS): libcglue.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(SOCKET_MULT_OBJS): socket.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(XPRINTF_MULT_OBJS): xprintf.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(NETDB_MULT_OBJS): netdb.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(PIPE_OBJS): pipe.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(FDMAN_OBJS): fdman.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(SELECT_OBJS): select.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(INTERRUPT_OBJS): interrupt.S -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+ACLOCAL_AMFLAGS = -I ../../.. -+CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/Makefile.in newlib-1.20.0/newlib/libc/sys/psp/Makefile.in ---- orig.newlib-1.20.0/newlib/libc/sys/psp/Makefile.in 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/Makefile.in 2012-01-15 11:44:23.259769014 +0100 -@@ -0,0 +1,468 @@ -+# Makefile.in generated by automake 1.11.1 from Makefile.am. -+# @configure_input@ -+ -+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. -+ -+@SET_MAKE@ -+ -+VPATH = @srcdir@ -+pkgdatadir = $(datadir)/@PACKAGE@ -+pkgincludedir = $(includedir)/@PACKAGE@ -+pkglibdir = $(libdir)/@PACKAGE@ -+pkglibexecdir = $(libexecdir)/@PACKAGE@ -+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -+install_sh_DATA = $(install_sh) -c -m 644 -+install_sh_PROGRAM = $(install_sh) -c -+install_sh_SCRIPT = $(install_sh) -c -+INSTALL_HEADER = $(INSTALL_DATA) -+transform = $(program_transform_name) -+NORMAL_INSTALL = : -+PRE_INSTALL = : -+POST_INSTALL = : -+NORMAL_UNINSTALL = : -+PRE_UNINSTALL = : -+POST_UNINSTALL = : -+build_triplet = @build@ -+host_triplet = @host@ -+subdir = . -+DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ -+ $(top_srcdir)/configure $(am__configure_deps) \ -+ $(srcdir)/../../../../mkinstalldirs -+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -+am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \ -+ $(top_srcdir)/configure.in -+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ -+ $(ACLOCAL_M4) -+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ -+ configure.lineno config.status.lineno -+mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs -+CONFIG_CLEAN_FILES = -+CONFIG_CLEAN_VPATH_FILES = -+LIBRARIES = $(noinst_LIBRARIES) -+ARFLAGS = cru -+lib_a_AR = $(AR) $(ARFLAGS) -+lib_a_DEPENDENCIES = $(LIBCGLUE_MULT_OBJS) $(SOCKET_MULT_OBJS) \ -+ $(XPRINTF_MULT_OBJS) $(NETDB_MULT_OBJS) $(FDMAN_OBJS) \ -+ $(SELECT_OBJS) $(INTERRUPT_OBJS) -+am_lib_a_OBJECTS = libcglue.$(OBJEXT) socket.$(OBJEXT) \ -+ pspcwd.$(OBJEXT) xprintf.$(OBJEXT) netdb.$(OBJEXT) \ -+ pipe.$(OBJEXT) fdman.$(OBJEXT) select.$(OBJEXT) \ -+ syscalls.$(OBJEXT) interrupt.$(OBJEXT) -+lib_a_OBJECTS = $(am_lib_a_OBJECTS) -+DEFAULT_INCLUDES = -I.@am__isrc@ -+depcomp = -+am__depfiles_maybe = -+CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ -+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ -+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -+CCLD = $(CC) -+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -+SOURCES = $(lib_a_SOURCES) -+ETAGS = etags -+CTAGS = ctags -+ACLOCAL = @ACLOCAL@ -+AMTAR = @AMTAR@ -+AR = @AR@ -+AS = @AS@ -+AUTOCONF = @AUTOCONF@ -+AUTOHEADER = @AUTOHEADER@ -+AUTOMAKE = @AUTOMAKE@ -+AWK = @AWK@ -+CC = @CC@ -+CCAS = @CCAS@ -+CCASFLAGS = @CCASFLAGS@ -+CCDEPMODE = @CCDEPMODE@ -+CYGPATH_W = @CYGPATH_W@ -+DEFS = @DEFS@ -+DEPDIR = @DEPDIR@ -+ECHO_C = @ECHO_C@ -+ECHO_N = @ECHO_N@ -+ECHO_T = @ECHO_T@ -+INSTALL = @INSTALL@ -+INSTALL_DATA = @INSTALL_DATA@ -+INSTALL_PROGRAM = @INSTALL_PROGRAM@ -+INSTALL_SCRIPT = @INSTALL_SCRIPT@ -+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -+LDFLAGS = @LDFLAGS@ -+LIBOBJS = @LIBOBJS@ -+LIBS = @LIBS@ -+LTLIBOBJS = @LTLIBOBJS@ -+MAINT = @MAINT@ -+MAKEINFO = @MAKEINFO@ -+MKDIR_P = @MKDIR_P@ -+NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ -+NO_INCLUDE_LIST = @NO_INCLUDE_LIST@ -+OBJEXT = @OBJEXT@ -+PACKAGE = @PACKAGE@ -+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -+PACKAGE_NAME = @PACKAGE_NAME@ -+PACKAGE_STRING = @PACKAGE_STRING@ -+PACKAGE_TARNAME = @PACKAGE_TARNAME@ -+PACKAGE_URL = @PACKAGE_URL@ -+PACKAGE_VERSION = @PACKAGE_VERSION@ -+PATH_SEPARATOR = @PATH_SEPARATOR@ -+RANLIB = @RANLIB@ -+READELF = @READELF@ -+SET_MAKE = @SET_MAKE@ -+SHELL = @SHELL@ -+STRIP = @STRIP@ -+VERSION = @VERSION@ -+abs_builddir = @abs_builddir@ -+abs_srcdir = @abs_srcdir@ -+abs_top_builddir = @abs_top_builddir@ -+abs_top_srcdir = @abs_top_srcdir@ -+aext = @aext@ -+am__include = @am__include@ -+am__leading_dot = @am__leading_dot@ -+am__quote = @am__quote@ -+am__tar = @am__tar@ -+am__untar = @am__untar@ -+bindir = @bindir@ -+build = @build@ -+build_alias = @build_alias@ -+build_cpu = @build_cpu@ -+build_os = @build_os@ -+build_vendor = @build_vendor@ -+builddir = @builddir@ -+datadir = @datadir@ -+datarootdir = @datarootdir@ -+docdir = @docdir@ -+dvidir = @dvidir@ -+exec_prefix = @exec_prefix@ -+host = @host@ -+host_alias = @host_alias@ -+host_cpu = @host_cpu@ -+host_os = @host_os@ -+host_vendor = @host_vendor@ -+htmldir = @htmldir@ -+includedir = @includedir@ -+infodir = @infodir@ -+install_sh = @install_sh@ -+libdir = @libdir@ -+libexecdir = @libexecdir@ -+libm_machine_dir = @libm_machine_dir@ -+localedir = @localedir@ -+localstatedir = @localstatedir@ -+lpfx = @lpfx@ -+machine_dir = @machine_dir@ -+mandir = @mandir@ -+mkdir_p = @mkdir_p@ -+newlib_basedir = @newlib_basedir@ -+oext = @oext@ -+oldincludedir = @oldincludedir@ -+pdfdir = @pdfdir@ -+prefix = @prefix@ -+program_transform_name = @program_transform_name@ -+psdir = @psdir@ -+sbindir = @sbindir@ -+sharedstatedir = @sharedstatedir@ -+srcdir = @srcdir@ -+sys_dir = @sys_dir@ -+sysconfdir = @sysconfdir@ -+target_alias = @target_alias@ -+top_build_prefix = @top_build_prefix@ -+top_builddir = @top_builddir@ -+top_srcdir = @top_srcdir@ -+AUTOMAKE_OPTIONS = cygnus -+INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) -+AM_CCASFLAGS = $(INCLUDES) $(CFLAGS) -+noinst_LIBRARIES = lib.a -+LIBCGLUE_MULT_OBJS = _close.o _exit.o _fork.o _fstat.o _getpid.o \ -+ _gettimeofday.o _kill.o _lseek.o _open.o _read.o \ -+ _sbrk.o _wait.o _write.o clock.o isatty.o _isatty.o \ -+ time.o _link.o _unlink.o sleep.o opendir.o readdir.o \ -+ closedir.o getcwd.o chdir.o mkdir.o rmdir.o \ -+ realpath.o _stat.o truncate.o access.o tzset.o \ -+ __psp_set_errno.o mlock.o _fcntl.o _rename.o nanosleep.o -+ -+SOCKET_MULT_OBJS = socket.o accept.o bind.o connect.o getsockopt.o \ -+ listen.o recv.o recvfrom.o send.o sendto.o \ -+ setsockopt.o shutdown.o getsockname.o getpeername.o \ -+ inet_ntoa.o -+ -+PE_OBJS = pipe.o -+FDMAN_OBJS = fdman.o -+SELECT_OBJS = select.o -+INTERRUPT_OBJS = interrupt.o -+XPRINTF_MULT_OBJS = vxprintf.o _xprintf.o __sout.o vsnprintf.o snprintf.o \ -+ vsprintf.o sprintf.o __mout.o mprintf.o vmprintf.o asprintf.o \ -+ vasprintf.o __fout.o fprintf.o vfprintf.o printf.o vprintf.o \ -+ _sprintf_r.o -+ -+NETDB_MULT_OBJS = h_errno.o gethostbyaddr.o gethostbyname.o -+lib_a_SOURCES = libcglue.c socket.c pspcwd.c xprintf.c netdb.c pipe.c fdman.c select.c syscalls.c interrupt.S -+lib_a_LIBADD = $(LIBCGLUE_MULT_OBJS) $(SOCKET_MULT_OBJS) $(XPRINTF_MULT_OBJS) \ -+ $(NETDB_MULT_OBJS) $(PIPE_OBJS) $(FDMAN_OBJS) $(SELECT_OBJS) $(INTERRUPT_OBJS) -+ -+ACLOCAL_AMFLAGS = -I ../../.. -+CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host -+all: all-am -+ -+.SUFFIXES: -+.SUFFIXES: .S .c .o .obj -+am--refresh: -+ @: -+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) -+ @for dep in $?; do \ -+ case '$(am__configure_deps)' in \ -+ *$$dep*) \ -+ echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus'; \ -+ $(am__cd) $(srcdir) && $(AUTOMAKE) --cygnus \ -+ && exit 0; \ -+ exit 1;; \ -+ esac; \ -+ done; \ -+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \ -+ $(am__cd) $(top_srcdir) && \ -+ $(AUTOMAKE) --cygnus Makefile -+.PRECIOUS: Makefile -+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -+ @case '$?' in \ -+ *config.status*) \ -+ echo ' $(SHELL) ./config.status'; \ -+ $(SHELL) ./config.status;; \ -+ *) \ -+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ -+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ -+ esac; -+ -+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) -+ $(SHELL) ./config.status --recheck -+ -+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) -+ $(am__cd) $(srcdir) && $(AUTOCONF) -+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) -+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -+$(am__aclocal_m4_deps): -+ -+clean-noinstLIBRARIES: -+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -+lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) -+ -rm -f lib.a -+ $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) -+ $(RANLIB) lib.a -+ -+mostlyclean-compile: -+ -rm -f *.$(OBJEXT) -+ -+distclean-compile: -+ -rm -f *.tab.c -+ -+.S.o: -+ $(CPPASCOMPILE) -c -o $@ $< -+ -+.S.obj: -+ $(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` -+ -+.c.o: -+ $(COMPILE) -c $< -+ -+.c.obj: -+ $(COMPILE) -c `$(CYGPATH_W) '$<'` -+ -+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) -+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ -+ unique=`for i in $$list; do \ -+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ -+ done | \ -+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ -+ END { if (nonempty) { for (i in files) print i; }; }'`; \ -+ mkid -fID $$unique -+tags: TAGS -+ -+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ -+ $(TAGS_FILES) $(LISP) -+ set x; \ -+ here=`pwd`; \ -+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ -+ unique=`for i in $$list; do \ -+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ -+ done | \ -+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ -+ END { if (nonempty) { for (i in files) print i; }; }'`; \ -+ shift; \ -+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ -+ test -n "$$unique" || unique=$$empty_fix; \ -+ if test $$# -gt 0; then \ -+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ -+ "$$@" $$unique; \ -+ else \ -+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ -+ $$unique; \ -+ fi; \ -+ fi -+ctags: CTAGS -+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ -+ $(TAGS_FILES) $(LISP) -+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ -+ unique=`for i in $$list; do \ -+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ -+ done | \ -+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ -+ END { if (nonempty) { for (i in files) print i; }; }'`; \ -+ test -z "$(CTAGS_ARGS)$$unique" \ -+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ -+ $$unique -+ -+GTAGS: -+ here=`$(am__cd) $(top_builddir) && pwd` \ -+ && $(am__cd) $(top_srcdir) \ -+ && gtags -i $(GTAGS_ARGS) "$$here" -+ -+distclean-tags: -+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -+check-am: -+check: check-am -+all-am: Makefile $(LIBRARIES) -+installdirs: -+install: install-am -+install-exec: install-exec-am -+install-data: install-data-am -+uninstall: uninstall-am -+ -+install-am: all-am -+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -+ -+installcheck: installcheck-am -+install-strip: -+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ -+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ -+ `test -z '$(STRIP)' || \ -+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -+mostlyclean-generic: -+ -+clean-generic: -+ -+distclean-generic: -+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -+ -+maintainer-clean-generic: -+ @echo "This command is intended for maintainers to use" -+ @echo "it deletes files that may require special tools to rebuild." -+clean: clean-am -+ -+clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am -+ -+distclean: distclean-am -+ -rm -f $(am__CONFIG_DISTCLEAN_FILES) -+ -rm -f Makefile -+distclean-am: clean-am distclean-compile distclean-generic \ -+ distclean-tags -+ -+dvi: dvi-am -+ -+dvi-am: -+ -+html: html-am -+ -+html-am: -+ -+info: info-am -+ -+info-am: -+ -+install-data-am: -+ -+install-dvi: install-dvi-am -+ -+install-dvi-am: -+ -+install-exec-am: -+ -+install-html: install-html-am -+ -+install-html-am: -+ -+install-info: install-info-am -+ -+install-info-am: -+ -+install-man: -+ -+install-pdf: install-pdf-am -+ -+install-pdf-am: -+ -+install-ps: install-ps-am -+ -+install-ps-am: -+ -+installcheck-am: -+ -+maintainer-clean: maintainer-clean-am -+ -rm -f $(am__CONFIG_DISTCLEAN_FILES) -+ -rm -rf $(top_srcdir)/autom4te.cache -+ -rm -f Makefile -+maintainer-clean-am: distclean-am maintainer-clean-generic -+ -+mostlyclean: mostlyclean-am -+ -+mostlyclean-am: mostlyclean-compile mostlyclean-generic -+ -+pdf: pdf-am -+ -+pdf-am: -+ -+ps: ps-am -+ -+ps-am: -+ -+uninstall-am: -+ -+.MAKE: install-am install-strip -+ -+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ -+ clean-generic clean-noinstLIBRARIES ctags distclean \ -+ distclean-compile distclean-generic distclean-tags dvi dvi-am \ -+ html html-am info info-am install install-am install-data \ -+ install-data-am install-dvi install-dvi-am install-exec \ -+ install-exec-am install-html install-html-am install-info \ -+ install-info-am install-man install-pdf install-pdf-am \ -+ install-ps install-ps-am install-strip installcheck \ -+ installcheck-am installdirs maintainer-clean \ -+ maintainer-clean-generic mostlyclean mostlyclean-compile \ -+ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ -+ uninstall-am -+ -+ -+all: crt0.o -+ -+$(LIBCGLUE_MULT_OBJS): libcglue.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(SOCKET_MULT_OBJS): socket.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(XPRINTF_MULT_OBJS): xprintf.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(NETDB_MULT_OBJS): netdb.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(PIPE_OBJS): pipe.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(FDMAN_OBJS): fdman.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(SELECT_OBJS): select.c -+ $(COMPILE) -DF_$* $< -c -o $@ -+ -+$(INTERRUPT_OBJS): interrupt.S -+ $(COMPILE) -DF_$* $< -c -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 -burN orig.newlib-1.20.0/newlib/libc/sys/psp/netdb.c newlib-1.20.0/newlib/libc/sys/psp/netdb.c ---- orig.newlib-1.20.0/newlib/libc/sys/psp/netdb.c 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/netdb.c 2012-01-12 17:25:59.499824990 +0100 -@@ -0,0 +1,103 @@ -+/* Simple gethostbyname and gethostbyaddr replacements using the resolver lib */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define MAX_NAME 512 -+ -+#ifdef F_h_errno -+int h_errno = NETDB_SUCCESS; -+#endif -+ -+#ifdef F_gethostbyaddr -+struct hostent *gethostbyaddr(const void *addr, int len, int type) -+{ -+ static struct hostent ent; -+ static char * aliases[1] = { NULL }; -+ char buf[1024]; -+ static char sname[MAX_NAME] = ""; -+ static struct in_addr saddr = { 0 }; -+ static char *addrlist[2] = { (char *) &saddr, NULL }; -+ int rid; -+ int err; -+ -+ if((len != sizeof(struct in_addr)) || (type != AF_INET) || (addr == NULL)) -+ { -+ h_errno = HOST_NOT_FOUND; -+ return NULL; -+ } -+ -+ memcpy(&saddr, addr, len); -+ -+ if(sceNetResolverCreate(&rid, buf, sizeof(buf)) < 0) -+ { -+ h_errno = NO_RECOVERY; -+ return NULL; -+ } -+ -+ err = sceNetResolverStartAtoN(rid, &saddr, sname, sizeof(sname), 2, 3); -+ sceNetResolverStop(rid); -+ sceNetResolverDelete(rid); -+ if(err < 0) -+ { -+ h_errno = HOST_NOT_FOUND; -+ return NULL; -+ } -+ -+ ent.h_name = sname; -+ ent.h_aliases = aliases; -+ ent.h_addrtype = AF_INET; -+ ent.h_length = sizeof(struct in_addr); -+ ent.h_addr_list = addrlist; -+ ent.h_addr = (char *) &saddr; -+ -+ return &ent; -+} -+#endif -+ -+#ifdef F_gethostbyname -+struct hostent *gethostbyname(const char *name) -+{ -+ static struct hostent ent; -+ char buf[1024]; -+ static char sname[MAX_NAME] = ""; -+ static struct in_addr saddr = { 0 }; -+ static char *addrlist[2] = { (char *) &saddr, NULL }; -+ int rid; -+ -+ if(sceNetInetInetAton(name, &saddr) == 0) -+ { -+ int err; -+ -+ if(sceNetResolverCreate(&rid, buf, sizeof(buf)) < 0) -+ { -+ h_errno = NO_RECOVERY; -+ return NULL; -+ } -+ -+ err = sceNetResolverStartNtoA(rid, name, &saddr, 2, 3); -+ sceNetResolverDelete(rid); -+ if(err < 0) -+ { -+ h_errno = HOST_NOT_FOUND; -+ return NULL; -+ } -+ -+ } -+ -+ snprintf(sname, MAX_NAME, "%s", name); -+ ent.h_name = sname; -+ ent.h_aliases = 0; -+ ent.h_addrtype = AF_INET; -+ ent.h_length = sizeof(struct in_addr); -+ ent.h_addr_list = addrlist; -+ ent.h_addr = (char *) &saddr; -+ -+ return &ent; -+} -+ -+#endif -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/netinet/in.h newlib-1.20.0/newlib/libc/sys/psp/netinet/in.h ---- orig.newlib-1.20.0/newlib/libc/sys/psp/netinet/in.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/netinet/in.h 2012-01-12 17:25:59.499824990 +0100 -@@ -0,0 +1,271 @@ -+/* $NetBSD: in.h,v 1.71 2005/08/05 09:21:25 elad Exp $ */ -+ -+/* -+ * Copyright (c) 1982, 1986, 1990, 1993 -+ * The Regents of the University of California. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. Neither the name of the University nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * @(#)in.h 8.3 (Berkeley) 1/3/94 -+ */ -+ -+/* -+ * Constants and structures defined by the internet system, -+ * Per RFC 790, September 1981, and numerous additions. -+ */ -+ -+#ifndef _NETINET_IN_H_ -+#define _NETINET_IN_H_ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include -+ -+typedef uint32_t in_addr_t; -+typedef uint16_t in_port_t; -+ -+/* -+ * Protocols -+ */ -+#define IPPROTO_IP 0 /* dummy for IP */ -+#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */ -+#define IPPROTO_ICMP 1 /* control message protocol */ -+#define IPPROTO_IGMP 2 /* group mgmt protocol */ -+#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */ -+#define IPPROTO_IPV4 4 /* IP header */ -+#define IPPROTO_IPIP 4 /* IP inside IP */ -+#define IPPROTO_TCP 6 /* tcp */ -+#define IPPROTO_EGP 8 /* exterior gateway protocol */ -+#define IPPROTO_PUP 12 /* pup */ -+#define IPPROTO_UDP 17 /* user datagram protocol */ -+#define IPPROTO_IDP 22 /* xns idp */ -+#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */ -+#define IPPROTO_IPV6 41 /* IP6 header */ -+#define IPPROTO_ROUTING 43 /* IP6 routing header */ -+#define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */ -+#define IPPROTO_RSVP 46 /* resource reservation */ -+#define IPPROTO_GRE 47 /* GRE encaps RFC 1701 */ -+#define IPPROTO_ESP 50 /* encap. security payload */ -+#define IPPROTO_AH 51 /* authentication header */ -+#define IPPROTO_MOBILE 55 /* IP Mobility RFC 2004 */ -+#define IPPROTO_IPV6_ICMP 58 /* IPv6 ICMP */ -+#define IPPROTO_ICMPV6 58 /* ICMP6 */ -+#define IPPROTO_NONE 59 /* IP6 no next header */ -+#define IPPROTO_DSTOPTS 60 /* IP6 destination option */ -+#define IPPROTO_EON 80 /* ISO cnlp */ -+#define IPPROTO_ETHERIP 97 /* Ethernet-in-IP */ -+#define IPPROTO_ENCAP 98 /* encapsulation header */ -+#define IPPROTO_PIM 103 /* Protocol indep. multicast */ -+#define IPPROTO_IPCOMP 108 /* IP Payload Comp. Protocol */ -+#define IPPROTO_VRRP 112 /* VRRP RFC 2338 */ -+ -+#define IPPROTO_RAW 255 /* raw IP packet */ -+#define IPPROTO_MAX 256 -+ -+/* last return value of *_input(), meaning "all job for this pkt is done". */ -+#define IPPROTO_DONE 257 -+ -+/* sysctl placeholder for (FAST_)IPSEC */ -+#define CTL_IPPROTO_IPSEC 258 -+ -+ -+/* -+ * Local port number conventions: -+ * -+ * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root), -+ * unless a kernel is compiled with IPNOPRIVPORTS defined. -+ * -+ * When a user does a bind(2) or connect(2) with a port number of zero, -+ * a non-conflicting local port address is chosen. -+ * -+ * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although -+ * that is settable by sysctl(3); net.inet.ip.anonportmin and -+ * net.inet.ip.anonportmax respectively. -+ * -+ * A user may set the IPPROTO_IP option IP_PORTRANGE to change this -+ * default assignment range. -+ * -+ * The value IP_PORTRANGE_DEFAULT causes the default behavior. -+ * -+ * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT, -+ * and exists only for FreeBSD compatibility purposes. -+ * -+ * The value IP_PORTRANGE_LOW changes the range to the "low" are -+ * that is (by convention) restricted to privileged processes. -+ * This convention is based on "vouchsafe" principles only. -+ * It is only secure if you trust the remote host to restrict these ports. -+ * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX. -+ */ -+ -+#define IPPORT_RESERVED 1024 -+#define IPPORT_ANONMIN 49152 -+#define IPPORT_ANONMAX 65535 -+#define IPPORT_RESERVEDMIN 600 -+#define IPPORT_RESERVEDMAX (IPPORT_RESERVED-1) -+ -+/* -+ * Internet address (a structure for historical reasons) -+ */ -+struct in_addr { -+ in_addr_t s_addr; -+} __attribute__((__packed__)); -+ -+#define __IPADDR(x) ((uint32_t)(x)) -+ -+#define IN_CLASSA(i) (((uint32_t)(i) & __IPADDR(0x80000000)) == \ -+ __IPADDR(0x00000000)) -+#define IN_CLASSA_NET __IPADDR(0xff000000) -+#define IN_CLASSA_NSHIFT 24 -+#define IN_CLASSA_HOST __IPADDR(0x00ffffff) -+#define IN_CLASSA_MAX 128 -+ -+#define IN_CLASSB(i) (((uint32_t)(i) & __IPADDR(0xc0000000)) == \ -+ __IPADDR(0x80000000)) -+#define IN_CLASSB_NET __IPADDR(0xffff0000) -+#define IN_CLASSB_NSHIFT 16 -+#define IN_CLASSB_HOST __IPADDR(0x0000ffff) -+#define IN_CLASSB_MAX 65536 -+ -+#define IN_CLASSC(i) (((uint32_t)(i) & __IPADDR(0xe0000000)) == \ -+ __IPADDR(0xc0000000)) -+#define IN_CLASSC_NET __IPADDR(0xffffff00) -+#define IN_CLASSC_NSHIFT 8 -+#define IN_CLASSC_HOST __IPADDR(0x000000ff) -+ -+#define IN_CLASSD(i) (((uint32_t)(i) & __IPADDR(0xf0000000)) == \ -+ __IPADDR(0xe0000000)) -+/* These ones aren't really net and host fields, but routing needn't know. */ -+#define IN_CLASSD_NET __IPADDR(0xf0000000) -+#define IN_CLASSD_NSHIFT 28 -+#define IN_CLASSD_HOST __IPADDR(0x0fffffff) -+#define IN_MULTICAST(i) IN_CLASSD(i) -+ -+#define IN_EXPERIMENTAL(i) (((uint32_t)(i) & __IPADDR(0xf0000000)) == \ -+ __IPADDR(0xf0000000)) -+#define IN_BADCLASS(i) (((uint32_t)(i) & __IPADDR(0xf0000000)) == \ -+ __IPADDR(0xf0000000)) -+ -+#define IN_LOCAL_GROUP(i) (((uint32_t)(i) & __IPADDR(0xffffff00)) == \ -+ __IPADDR(0xe0000000)) -+ -+#define INADDR_ANY __IPADDR(0x00000000) -+#define INADDR_LOOPBACK __IPADDR(0x7f000001) -+#define INADDR_BROADCAST __IPADDR(0xffffffff) /* must be masked */ -+ -+#define INADDR_UNSPEC_GROUP __IPADDR(0xe0000000) /* 224.0.0.0 */ -+#define INADDR_ALLHOSTS_GROUP __IPADDR(0xe0000001) /* 224.0.0.1 */ -+#define INADDR_ALLRTRS_GROUP __IPADDR(0xe0000002) /* 224.0.0.2 */ -+#define INADDR_MAX_LOCAL_GROUP __IPADDR(0xe00000ff) /* 224.0.0.255 */ -+ -+#define IN_LOOPBACKNET 127 /* official! */ -+ -+/* -+ * Socket address, internet style. -+ */ -+struct sockaddr_in { -+ uint8_t sin_len; -+ sa_family_t sin_family; -+ in_port_t sin_port; -+ struct in_addr sin_addr; -+ int8_t sin_zero[8]; -+}; -+ -+#define INET_ADDRSTRLEN 16 -+ -+/* -+ * Structure used to describe IP options. -+ * Used to store options internally, to pass them to a process, -+ * or to restore options retrieved earlier. -+ * The ip_dst is used for the first-hop gateway when using a source route -+ * (this gets put into the header proper). -+ */ -+struct ip_opts { -+ struct in_addr ip_dst; /* first hop, 0 w/o src rt */ -+#if defined(__cplusplus) -+ int8_t Ip_opts[40]; /* actually variable in size */ -+#else -+ int8_t ip_opts[40]; /* actually variable in size */ -+#endif -+}; -+ -+/* -+ * Options for use with [gs]etsockopt at the IP level. -+ * First word of comment is data type; bool is stored in int. -+ */ -+#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */ -+#define IP_HDRINCL 2 /* int; header is included with data */ -+#define IP_TOS 3 /* int; IP type of service and preced. */ -+#define IP_TTL 4 /* int; IP time to live */ -+#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */ -+#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */ -+#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */ -+#define IP_RETOPTS 8 /* ip_opts; set/get IP options */ -+#define IP_MULTICAST_IF 9 /* in_addr; set/get IP multicast i/f */ -+#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */ -+#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */ -+#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */ -+#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ -+#define IP_PORTRANGE 19 /* int; range to use for ephemeral port */ -+#define IP_RECVIF 20 /* bool; receive reception if w/dgram */ -+#define IP_ERRORMTU 21 /* int; get MTU of last xmit = EMSGSIZE */ -+#if 1 /*IPSEC*/ -+#define IP_IPSEC_POLICY 22 /* struct; get/set security policy */ -+#endif -+ -+/* -+ * Defaults and limits for options -+ */ -+#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */ -+#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ -+#define IP_MAX_MEMBERSHIPS 20 /* per socket; must fit in one mbuf */ -+ -+/* -+ * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. -+ */ -+struct ip_mreq { -+ struct in_addr imr_multiaddr; /* IP multicast address of group */ -+ struct in_addr imr_interface; /* local IP address of interface */ -+}; -+ -+/* -+ * Argument for IP_PORTRANGE: -+ * - which range to search when port is unspecified at bind() or connect() -+ */ -+#define IP_PORTRANGE_DEFAULT 0 /* default range */ -+#define IP_PORTRANGE_HIGH 1 /* same as DEFAULT (FreeBSD compat) */ -+#define IP_PORTRANGE_LOW 2 /* use privileged range */ -+ -+#define ntohs(x) __builtin_allegrex_wsbh(x) -+#define ntohl(x) __builtin_allegrex_wsbw(x) -+#define htons(x) __builtin_allegrex_wsbh(x) -+#define htonl(x) __builtin_allegrex_wsbw(x) -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif /* !_NETINET_IN_H_ */ -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/netinet/tcp.h newlib-1.20.0/newlib/libc/sys/psp/netinet/tcp.h ---- orig.newlib-1.20.0/newlib/libc/sys/psp/netinet/tcp.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/netinet/tcp.h 2012-01-12 17:25:59.499824990 +0100 -@@ -0,0 +1,12 @@ -+#ifndef __NETINET_TCP_H__ -+#define __NETINET_TCP_H__ -+ -+#include -+ -+#define SOL_TCP IPPROTO_TCP -+ -+/* Socket options */ -+#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ -+#define TCP_MAXSEG 0x02 /* set maximum segment size */ -+ -+#endif -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/pipe.c newlib-1.20.0/newlib/libc/sys/psp/pipe.c ---- orig.newlib-1.20.0/newlib/libc/sys/psp/pipe.c 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/pipe.c 2012-01-12 17:25:59.500824978 +0100 -@@ -0,0 +1,305 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * pipe.c - Socket wrappers to provide similar functions to normal unix -+ * -+ * Copyright (c) 2006 Rafael Cabezas -+ * -+ * - 20070630 Alper Akcan "anhanguera" -+ * [non]blocking read/write() fix -+ * illegal size fix for read/write() -+ * -+ */ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include "fdman.h" -+ -+/* Pipe functions */ -+/* Returns how many bytes are in the pipe -- waiting to be read */ -+size_t __psp_pipe_peekmsgsize(int fd) -+{ -+ SceKernelMppInfo info; -+ info.size = sizeof(info); -+ -+ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ if (sceKernelReferMsgPipeStatus(__psp_descriptormap[fd]->sce_descriptor, &info) == 0) { -+ return (info.bufSize - info.freeSize); -+ } -+ else { -+ return -1; -+ } -+} -+ -+int pipe(int fildes[2]) -+{ -+ static int iIndex = 0; -+ char name[32]; -+ iIndex++; -+ -+ sprintf(name, "__psp_pipe_%02d", iIndex); -+ -+ SceUID uid = sceKernelCreateMsgPipe(name, PSP_MEMORY_PARTITION_USER, 0, (void *)PIPE_BUF, NULL); -+ -+ if (uid >= 0) { -+ fildes[0] = __psp_fdman_get_new_descriptor(); -+ if (fildes[0] != -1) { -+ __psp_descriptormap[fildes[0]]->sce_descriptor = uid; -+ __psp_descriptormap[fildes[0]]->type = __PSP_DESCRIPTOR_TYPE_PIPE; -+ } -+ else { -+ sceKernelDeleteMsgPipe(uid); -+ errno = EFAULT; -+ return -1; -+ } -+ -+ fildes[1] = __psp_fdman_get_dup_descriptor(fildes[0]); -+ if (fildes[1] != -1) { -+ __psp_descriptormap[fildes[1]]->sce_descriptor = uid; -+ return 0; -+ } -+ else { -+ sceKernelDeleteMsgPipe(uid); -+ errno = EFAULT; -+ return -1; -+ } -+ -+ } -+ else { -+ errno = EFAULT; -+ return -1; -+ } -+} -+ -+int __psp_pipe_close(int fd) -+{ -+ int ret = 0; -+ -+ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ -+ if ( __psp_descriptormap[fd]->ref_count == 1 ) { -+ /** -+ * Delete a message pipe -+ * -+ * @param uid - The UID of the pipe -+ * -+ * @return 0 on success, < 0 on error -+ */ -+ ret = sceKernelDeleteMsgPipe(__psp_descriptormap[fd]->sce_descriptor); -+ } -+ -+ __psp_fdman_release_descriptor(fd); -+ -+ if(ret < 0) { -+ return __psp_set_errno(ret); -+ } -+ -+ return 0; -+} -+ -+int __psp_pipe_nonblocking_read(int fd, void *buf, size_t len) -+{ -+ int ret; -+ int sceuid; -+ int size; -+ -+ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ sceuid = __psp_descriptormap[fd]->sce_descriptor; -+ -+ size = __psp_pipe_peekmsgsize(fd); -+ if (size > 0) { -+ if (size < len) { -+ len = size; -+ } -+ } -+ else if (size == 0) { -+ errno = EAGAIN; -+ return -1; -+ } -+ else { -+ errno = EBADF; -+ return -1; -+ } -+ -+ /** -+ * Receive a message from a pipe -+ * -+ * @param uid - The UID of the pipe -+ * @param message - Pointer to the message -+ * @param size - Size of the message -+ * @param unk1 - Unknown -+ * @param unk2 - Unknown -+ * @param timeout - Timeout for receive -+ * -+ * @return 0 on success, < 0 on error -+ */ -+ ret = sceKernelTryReceiveMsgPipe(sceuid, buf, len, 0, 0); -+ -+ if (ret == 0) {/* Success - Data */ -+ return len; -+ } -+ else if (ret == SCE_KERNEL_ERROR_MPP_EMPTY) {/* No data */ -+ errno = EAGAIN; -+ return -1; -+ } -+ else {/* Error */ -+ return __psp_set_errno(ret); -+ } -+} -+ -+int __psp_pipe_read(int fd, void *buf, size_t len) -+{ -+ int ret; -+ int sceuid; -+ int size; -+ -+ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ sceuid = __psp_descriptormap[fd]->sce_descriptor; -+ -+#if 0 -+ /* we should block until there is some data (or maybe for enough data), -+ * peeking the msg size should be only for nonblocking reads -+ */ -+ size = __psp_pipe_peekmsgsize(fd); -+ if (size > 0) { -+ if (size < len) { -+ len = size; -+ } -+ } -+ else { -+ errno = EBADF; -+ return -1; -+ } -+#endif -+ /* if len is greater than PIPE_BUF then, MsgPipe functions returns -+ * SCE_KERNEL_ERROR_ILLEGAL_SIZE, but it should read at least -+ * PIPE_BUF bytes, and return the number of bytes read. -+ */ -+ if (len > PIPE_BUF) { -+ len = PIPE_BUF; -+ } -+ -+ /** -+ * Receive a message from a pipe -+ * -+ * @param uid - The UID of the pipe -+ * @param message - Pointer to the message -+ * @param size - Size of the message -+ * @param unk1 - Unknown -+ * @param unk2 - Unknown -+ * @param timeout - Timeout for receive -+ * -+ * @return 0 on success, < 0 on error -+ */ -+ ret = sceKernelReceiveMsgPipe(sceuid, buf, len, 0, NULL, NULL); -+ -+ if (ret == 0) {/* Success - Data */ -+ return len; -+ } -+ else {/* Error */ -+ return __psp_set_errno(ret); -+ } -+} -+ -+int __psp_pipe_write(int fd, const void *buf, size_t len) -+{ -+ int ret; -+ int sceuid; -+ char *cbuf; -+ -+ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ sceuid = __psp_descriptormap[fd]->sce_descriptor; -+ -+ /* if len is greater than PIPE_BUF then, MsgPipe functions returns -+ * SCE_KERNEL_ERROR_ILLEGAL_SIZE, but it should write at least -+ * PIPE_BUF bytes, and return the number of bytes written. -+ */ -+ if (len > PIPE_BUF) { -+ len = PIPE_BUF; -+ } -+ -+ /** -+ * Send a message to a pipe -+ * -+ * @param uid - The UID of the pipe -+ * @param message - Pointer to the message -+ * @param size - Size of the message -+ * @param unk1 - Unknown -+ * @param unk2 - Unknown -+ * @param timeout - Timeout for send -+ * -+ * @return 0 on success, < 0 on error -+ */ -+ cbuf = (char *)buf; -+ ret = sceKernelSendMsgPipe(sceuid, cbuf, len, 0, NULL, NULL); -+ if (ret == 0) {/* Success - Data */ -+ return len; -+ } -+ else {/* Error */ -+ return __psp_set_errno(ret); -+ } -+} -+ -+int __psp_pipe_nonblocking_write(int fd, const void *buf, size_t len) -+{ -+ int ret; -+ int sceuid; -+ char *cbuf; -+ -+ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ sceuid = __psp_descriptormap[fd]->sce_descriptor; -+ -+ /* if len is greater than PIPE_BUF then, MsgPipe functions returns -+ * SCE_KERNEL_ERROR_ILLEGAL_SIZE, but it should write at least -+ * PIPE_BUF bytes, and return the number of bytes written. -+ */ -+ if (len > PIPE_BUF) { -+ len = PIPE_BUF; -+ } -+ -+ cbuf = (char *)buf; -+ ret = sceKernelTrySendMsgPipe(sceuid, cbuf, len, 0, 0); -+ -+ if (ret == 0) {/* Success - Data */ -+ return len; -+ } -+ else if (ret == SCE_KERNEL_ERROR_MPP_FULL) { -+ errno = EAGAIN; -+ return -1; -+ } -+ else {/* Error */ -+ return __psp_set_errno(ret); -+ } -+} -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/pspcwd.c newlib-1.20.0/newlib/libc/sys/psp/pspcwd.c ---- orig.newlib-1.20.0/newlib/libc/sys/psp/pspcwd.c 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/pspcwd.c 2012-01-12 17:25:59.500824978 +0100 -@@ -0,0 +1,166 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * pspcwd.c - Current working directory emulation helper functions -+ * -+ * Copyright (c) 2005 Marcus R. Brown -+ * Copyright (c) 2005 James Forshaw -+ * Copyright (c) 2005 John Kelley -+ * Copyright (c) 2005 Jim Paris -+ * -+ */ -+#include -+#include -+#include -+ -+#include -+#include -+ -+char __psp_cwd[MAXPATHLEN + 1] = { 0 }; -+ -+/* Set the current working directory (CWD) to the path where the module was launched. */ -+void __psp_init_cwd(char *argv_0) -+{ -+ if (argv_0 != NULL) { -+ char base_path[MAXPATHLEN + 1]; -+ char *end; -+ -+ strncpy(base_path, argv_0, sizeof(base_path) - 1); -+ base_path[sizeof(base_path) - 1] = '\0'; -+ end = strrchr(base_path, '/'); -+ if (end != NULL) { -+ *(end + 1) = '\0'; -+ chdir(base_path); -+ } -+ } -+} -+ -+/* Return the number of bytes taken up by the "drive:" prefix, -+ or -1 if it's not found */ -+int __psp_get_drive(const char *d) -+{ -+ int i; -+ for(i=0; d[i]; i++) { -+ if(! ((d[i] >= 'a' && d[i] <= 'z') || -+ (d[i] >= '0' && d[i] <= '9') )) -+ break; -+ } -+ if(d[i] == ':') return i+1; -+ return -1; -+} -+ -+/* Like strcpy, but returns 0 if the string doesn't fit */ -+int __psp_safe_strcpy(char *out, const char *in, int maxlen) -+{ -+ for( ; maxlen > 0 && *in ; maxlen-- ) -+ *(out++) = *(in++); -+ if(maxlen < 1) return 0; -+ *out = 0; -+ return 1; -+} -+ -+/* Like strcat, but returns 0 if the string doesn't fit */ -+int __psp_safe_strcat(char *out, const char *in, int maxlen) -+{ -+ for( ; *out ; out++,maxlen-- ) -+ continue; -+ return __psp_safe_strcpy(out, in, maxlen); -+} -+ -+/* Normalize a pathname (without leading "drive:") by removing -+ . and .. components, duplicated /, etc. */ -+int __psp_path_normalize(char *out, int len) -+{ -+ int i, j; -+ int first, next; -+ -+ /* First append "/" to make the rest easier */ -+ if(!__psp_safe_strcat(out,"/",len)) return -10; -+ -+ /* Convert "//" to "/" */ -+ for(i=0; out[i+1]; i++) { -+ if(out[i]=='/' && out[i+1]=='/') { -+ for(j=i+1; out[j]; j++) -+ out[j] = out[j+1]; -+ i--; -+ } -+ } -+ -+ /* Convert "/./" to "/" */ -+ for(i=0; out[i] && out[i+1] && out[i+2]; i++) { -+ if(out[i]=='/' && out[i+1]=='.' && out[i+2]=='/') { -+ for(j=i+1; out[j]; j++) -+ out[j] = out[j+2]; -+ i--; -+ } -+ } -+ -+ /* Convert "/asdf/../" to "/" until we can't anymore. Also -+ * convert leading "/../" to "/" */ -+ first = next = 0; -+ while(1) { -+ /* If a "../" follows, remove it and the parent */ -+ if(out[next+1] && out[next+1]=='.' && -+ out[next+2] && out[next+2]=='.' && -+ out[next+3] && out[next+3]=='/') { -+ for(j=0; out[first+j+1]; j++) -+ out[first+j+1] = out[next+j+4]; -+ first = next = 0; -+ continue; -+ } -+ -+ /* Find next slash */ -+ first = next; -+ for(next=first+1; out[next] && out[next] != '/'; next++) -+ continue; -+ if(!out[next]) break; -+ } -+ -+ /* Remove trailing "/" */ -+ for(i=1; out[i]; i++) -+ continue; -+ if(i >= 1 && out[i-1] == '/') -+ out[i-1] = 0; -+ -+ return 0; -+} -+ -+/* Convert relative path to absolute path. */ -+int __psp_path_absolute(const char *in, char *out, int len) -+{ -+ int dr; -+ -+ /* See what the relative URL starts with */ -+ dr = __psp_get_drive(in); -+ if(dr > 0 && in[dr] == '/') { -+ /* It starts with "drive:/", so it's already absolute */ -+ if(!__psp_safe_strcpy(out, in, len)) -+ return -1; -+ } else if(in[0] == '/') { -+ /* It's absolute, but missing the drive, so use cwd's drive */ -+ if(strlen(__psp_cwd) >= len) -+ return -2; -+ strcpy(out, __psp_cwd); -+ dr = __psp_get_drive(out); -+ out[dr] = 0; -+ if(!__psp_safe_strcat(out, in, len)) -+ return -3; -+ } else { -+ /* It's not absolute, so append it to the current cwd */ -+ if(strlen(__psp_cwd) >= len) -+ return -4; -+ strcpy(out, __psp_cwd); -+ if(!__psp_safe_strcat(out, "/", len)) -+ return -6; -+ if(!__psp_safe_strcat(out, in, len)) -+ return -7; -+ } -+ -+ /* Now normalize the pathname portion */ -+ dr = __psp_get_drive(out); -+ if(dr < 0) dr = 0; -+ return __psp_path_normalize(out + dr, len - dr); -+} -+ -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/README newlib-1.20.0/newlib/libc/sys/psp/README ---- orig.newlib-1.20.0/newlib/libc/sys/psp/README 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/README 2012-01-12 18:36:02.327308955 +0100 -@@ -0,0 +1,15 @@ -+Newlib for PSP -+-- -+ -+This sys/psp directory depends on PSPSDK headers. It expects them to live in -+${prefix}/psp/sdk/include (see newlib/configure.host). -+ -+I used the autotools to generate aclocal.m4, Makefile.in and configure using: -+ -+ aclocal -I ../../.. -+ automake --cygnus -+ autoconf -+ -+-- -+Originally by Marcus R. Brown -+Updated by artart78 -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/select.c newlib-1.20.0/newlib/libc/sys/psp/select.c ---- orig.newlib-1.20.0/newlib/libc/sys/psp/select.c 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/select.c 2012-01-12 17:25:59.500824978 +0100 -@@ -0,0 +1,199 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * select.c - Socket wrappers to provide similar functions to normal unix -+ * -+ * Copyright (c) 2006 Rafael Cabezas -+ * -+ * - 20070701 Alper Akcan "anhanguera" -+ * select EBADF fix -+ * -+ */ -+#include -+#include -+#include -+#include -+#include -+ -+#include "fdman.h" -+ -+#define SELECT_POLLING_DELAY_IN_us 100 -+ -+static int __psp_poll_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds); -+ -+int select(int n, fd_set *readfds, fd_set *writefds, -+ fd_set *exceptfds, struct timeval *timeout) -+{ -+ int count; -+ clock_t start_time, time; -+ -+ start_time = clock(); -+ -+ count = 0; -+ -+ if (timeout) { -+ time = (timeout->tv_sec * CLOCKS_PER_SEC) + (timeout->tv_usec * (1*1000*1000/CLOCKS_PER_SEC)); -+ } -+ else { -+ time = 0; -+ } -+ -+ for (;;) { -+ count = __psp_poll_select(n, readfds, writefds, exceptfds); -+ /* If timeout == NULL, then don't timeout! */ -+ if ( (count > 0) || ((timeout != NULL) && ((clock() - start_time) >= time)) ) { -+ break; -+ } -+ if (count < 0) { -+ /* anhanguera - 20070701 -+ * error, lets let the caller to handle error state -+ */ -+ break; -+ } -+ else { -+ /* Nothing found, and not timed-out yet; let's yield for SELECT_POLLING_DELAY_IN_us, so we're not in a busy loop */ -+ sceKernelDelayThread(SELECT_POLLING_DELAY_IN_us); -+ } -+ } -+ -+ return count; -+} -+ -+#define SCE_FD_SET(n, p) \ -+ ((p)->fds_bits[((n) & 0xFF) /__NFDBITS] |= (1 << ((n) % __NFDBITS))) -+ -+static int __psp_poll_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds) -+{ -+ int fd, count; -+ fd_set ready_readfds, ready_writefds, ready_exceptfds; -+ fd_set scereadfds, scewritefds, sceexceptfds; -+ SceKernelMppInfo info; -+ struct timeval scetv; -+ -+ FD_ZERO(&ready_readfds); -+ FD_ZERO(&ready_writefds); -+ FD_ZERO(&ready_exceptfds); -+ -+ info.size = sizeof(info); -+ scetv.tv_sec = 0; -+ scetv.tv_usec = 0; -+ count = 0; -+ -+ for (fd = 0; fd < n; fd++) -+ { -+ if (__psp_descriptormap[fd] != NULL) { -+ switch(__psp_descriptormap[fd]->type) -+ { -+ case __PSP_DESCRIPTOR_TYPE_PIPE: -+ if (readfds && FD_ISSET(fd, readfds)) { -+ if (sceKernelReferMsgPipeStatus(__psp_descriptormap[fd]->sce_descriptor, &info) == 0) { -+ if (info.bufSize != info.freeSize) { -+ FD_SET(fd, &ready_readfds); -+ count++; -+ } -+ } -+ else { -+ FD_SET(fd, &ready_exceptfds); -+ count++; -+ } -+ } -+ if (writefds && FD_ISSET(fd, writefds)) { -+ if (sceKernelReferMsgPipeStatus(__psp_descriptormap[fd]->sce_descriptor, &info) == 0) { -+ if (info.freeSize > 0) { -+ FD_SET(fd, &ready_writefds); -+ count++; -+ } -+ } -+ else { -+ FD_SET(fd, &ready_exceptfds); -+ count++; -+ } -+ } -+ break; -+ case __PSP_DESCRIPTOR_TYPE_FILE: -+ if (readfds && FD_ISSET(fd, readfds)) { -+ if (readfds && FD_ISSET(fd, readfds)) { -+ /** Just set it for now */ -+ FD_SET(fd, &ready_readfds); -+ count++; -+ } -+ } -+ break; -+ case __PSP_DESCRIPTOR_TYPE_SOCKET: -+ if (readfds && FD_ISSET(fd, readfds)) { -+ int sce_ret, sce_fd; -+ sce_fd = __psp_descriptormap[fd]->sce_descriptor; -+ FD_ZERO(&scereadfds); -+ SCE_FD_SET(sce_fd, &scereadfds); -+ errno = 0; -+ sce_ret = sceNetInetSelect (sce_fd+1, &scereadfds, NULL, NULL, &scetv); -+ if (sce_ret>0) { -+ FD_SET(fd, &ready_readfds); -+ count++; -+ } -+ else if (sce_ret == -1) { -+ errno = sceNetInetGetErrno(); -+ if (exceptfds && FD_ISSET(fd, exceptfds)) { -+ FD_SET(fd, &ready_exceptfds); -+ count++; -+ } else { -+ count = -1; -+ } -+ } -+ } -+ if (writefds && FD_ISSET(fd, writefds)) { -+ int sce_ret; -+ FD_ZERO(&scewritefds); -+ SCE_FD_SET(__psp_descriptormap[fd]->sce_descriptor, &scewritefds); -+ sce_ret = sceNetInetSelect (__psp_descriptormap[fd]->sce_descriptor+1, NULL, &scewritefds, NULL, &scetv); -+ if (sce_ret>0) { -+ FD_SET(fd, &ready_writefds); -+ count++; -+ } -+ else if (sce_ret == -1) { -+ if (exceptfds && FD_ISSET(fd, exceptfds)) { -+ FD_SET(fd, &ready_exceptfds); -+ count++; -+ } -+ else { -+ count = -1; -+ } -+ } -+ } -+ break; -+ } -+ } else { -+ /* anhanguera - 20070701 -+ * -+ * here we know that, system has no idea about 'fd'. if caller requested -+ * information about 'fd', return '-1' and set errno to 'EBADF'. we should -+ * increse the count and set exceptfd for fd, but it is safe to obey select -+ * manual. -+ * -+ * from manual; -+ * On error, -1 is returned, and errno is set appropriately; the sets and -+ * timeout become undefined, so do not rely on their contents after an error. -+ */ -+ if ((readfds && FD_ISSET(fd, readfds)) || -+ (writefds && FD_ISSET(fd, writefds)) || -+ (exceptfds && FD_ISSET(fd, exceptfds))) { -+ errno = EBADF; -+ return -1; -+ } -+ } -+ } -+ -+ if (count > 0) { -+ if (readfds) -+ *readfds = ready_readfds; -+ if (writefds) -+ *writefds = ready_writefds; -+ if (exceptfds) -+ *exceptfds = ready_exceptfds; -+ } -+ -+ return count; -+} -+ -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/socket.c newlib-1.20.0/newlib/libc/sys/psp/socket.c ---- orig.newlib-1.20.0/newlib/libc/sys/psp/socket.c 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/socket.c 2012-01-12 17:25:59.501824966 +0100 -@@ -0,0 +1,390 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * socket.c - Socket wrappers to provide similar functions to normal unix -+ * -+ * Copyright (c) 2005 Marcus R. Brown -+ * Copyright (c) 2005 James Forshaw -+ * -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include "fdman.h" -+ -+#ifdef F_socket -+int socket(int domain, int type, int protocol) -+{ -+ int sock, scesock; -+ int i; -+ -+ scesock = sceNetInetSocket(domain, type, protocol); -+ if(scesock < 0) { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ sock = __psp_fdman_get_new_descriptor(); -+ if( sock != -1 ) { -+ __psp_descriptormap[sock]->sce_descriptor = scesock; -+ __psp_descriptormap[sock]->type = __PSP_DESCRIPTOR_TYPE_SOCKET; -+ } -+ else { -+ sceNetInetClose(scesock); -+ errno = ENOENT; -+ return -1; -+ } -+ -+ return sock; -+} -+ -+/* These are glue routines that are called from _close(), _read(), and -+ _write(). They are here so that any program that uses socket() will pull -+ them in and have expanded socket capability. */ -+ -+int __psp_socket_close(int sock) -+{ -+ int ret = 0; -+ -+ if (__psp_descriptormap[sock]->ref_count == 1) { -+ ret = sceNetInetClose(__psp_descriptormap[sock]->sce_descriptor); -+ } -+ -+ __psp_fdman_release_descriptor(sock); -+ -+ if(ret < 0) -+ { -+ /* If close is defined likely errno is */ -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+ssize_t __psp_socket_recv(int s, void *buf, size_t len, int flags) -+{ -+ return recv(s, buf, len, flags); -+} -+ -+ssize_t __psp_socket_send(int s, const void *buf, size_t len, int flags) -+{ -+ return send(s, buf, len, flags); -+} -+#endif -+ -+#ifdef F_accept -+int accept(int s, struct sockaddr *addr, socklen_t *addrlen) -+{ -+ int newscesock, newsock; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ newscesock = sceNetInetAccept(__psp_descriptormap[s]->sce_descriptor, addr, addrlen); -+ if( (newscesock >= 0) ) { -+ newsock = __psp_fdman_get_new_descriptor(); -+ if ( newsock != -1 ) { -+ __psp_descriptormap[newsock]->sce_descriptor = newscesock; -+ __psp_descriptormap[newsock]->type = __PSP_DESCRIPTOR_TYPE_SOCKET; -+ } -+ else { -+ sceNetInetClose(newscesock); -+ errno = ENOENT; -+ return -1; -+ } -+ } -+ else { -+ errno = ENOENT; -+ return -1; -+ } -+ -+ return newsock; -+} -+#endif -+ -+#ifdef F_bind -+int bind(int s, const struct sockaddr *my_addr, socklen_t addrlen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetBind(__psp_descriptormap[s]->sce_descriptor, my_addr, addrlen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_connect -+int connect(int s, const struct sockaddr *serv_addr, socklen_t addrlen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetConnect(__psp_descriptormap[s]->sce_descriptor, serv_addr, addrlen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_setsockopt -+int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetGetsockopt(__psp_descriptormap[s]->sce_descriptor, level, optname, optval, optlen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_listen -+int listen(int s, int backlog) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetListen(__psp_descriptormap[s]->sce_descriptor, backlog); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_recv -+ssize_t recv(int s, void *buf, size_t len, int flags) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetRecv(__psp_descriptormap[s]->sce_descriptor, buf, len, flags); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return ret; -+} -+#endif -+ -+#ifdef F_recvfrom -+ssize_t recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetRecvfrom(__psp_descriptormap[s]->sce_descriptor, buf, len, flags, from, fromlen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return ret; -+} -+#endif -+ -+#ifdef F_send -+ssize_t send(int s, const void *buf, size_t len, int flags) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetSend(__psp_descriptormap[s]->sce_descriptor, buf, len, flags); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return ret; -+} -+#endif -+ -+#ifdef F_sendto -+ssize_t sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetSendto(__psp_descriptormap[s]->sce_descriptor, buf, len, flags, to, tolen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return ret; -+} -+#endif -+ -+#ifdef F_setsockopt -+int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetSetsockopt(__psp_descriptormap[s]->sce_descriptor, level, optname, optval, optlen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ else -+ { -+ if ( (level == SOL_SOCKET) && (optname == SO_NONBLOCK) ) { -+ if (*((int*)optval) == 1) { -+ __psp_descriptormap[s]->flags |= O_NONBLOCK; -+ } -+ else { -+ __psp_descriptormap[s]->flags &= ~O_NONBLOCK; -+ } -+ } -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_shutdown -+int shutdown(int s, int how) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetShutdown(__psp_descriptormap[s]->sce_descriptor, how); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_getpeername -+int getpeername(int s, struct sockaddr *name, socklen_t *namelen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetGetpeername(__psp_descriptormap[s]->sce_descriptor, name, namelen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_getsockname -+int getsockname(int s, struct sockaddr *name, socklen_t *namelen) -+{ -+ int ret; -+ -+ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) { -+ errno = EBADF; -+ return -1; -+ } -+ -+ ret = sceNetInetGetsockname(__psp_descriptormap[s]->sce_descriptor, name, namelen); -+ if(ret < 0) -+ { -+ errno = sceNetInetGetErrno(); -+ return -1; -+ } -+ -+ return 0; -+} -+#endif -+ -+#ifdef F_inet_ntoa -+char *inet_ntoa(struct in_addr in) -+{ -+ static char ip_addr[INET_ADDRSTRLEN+1]; -+ -+ if(sceNetInetInetNtop(AF_INET, &in, ip_addr, INET_ADDRSTRLEN) == NULL) -+ { -+ strcpy(ip_addr, "Invalid"); -+ } -+ -+ return ip_addr; -+} -+#endif -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/sys/dirent.h newlib-1.20.0/newlib/libc/sys/psp/sys/dirent.h ---- orig.newlib-1.20.0/newlib/libc/sys/psp/sys/dirent.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/sys/dirent.h 2012-01-12 17:25:59.519824755 +0100 -@@ -0,0 +1,39 @@ -+#ifndef _SYS_DIRENT_H -+#define _SYS_DIRENT_H -+ -+/* PSP dirent.h, based on pspiofilemgr_dirent.h -+ by Jim Paris */ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include -+ -+#define MAXNAMLEN 255 -+ -+/* Same as SceIoDirent, just with a different name. */ -+struct dirent { -+ /** File status. */ -+ SceIoStat d_stat; -+ /** File name. */ -+ char d_name[256]; -+ /** Device-specific data. */ -+ void * d_private; -+ int dummy; -+}; -+ -+typedef struct { -+ SceUID uid; -+ struct dirent de; -+} DIR; -+ -+DIR *opendir (const char *); -+struct dirent *readdir (DIR *); -+int closedir (DIR *); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/sys/errno.h newlib-1.20.0/newlib/libc/sys/psp/sys/errno.h ---- orig.newlib-1.20.0/newlib/libc/sys/psp/sys/errno.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/sys/errno.h 2012-01-12 17:25:59.520824744 +0100 -@@ -0,0 +1,158 @@ -+/* errno.h for PSP, based on newlib/libc/include/sys/errno.h. */ -+ -+#ifndef _SYS_ERRNO_H_ -+#ifdef __cplusplus -+extern "C" { -+#endif -+#define _SYS_ERRNO_H_ -+ -+#include -+ -+#ifndef _REENT_ONLY -+#define errno (*__errno()) -+extern int *__errno _PARAMS ((void)); -+#endif -+ -+/* Please don't use these variables directly. -+ Use strerror instead. */ -+extern __IMPORT _CONST char * _CONST _sys_errlist[]; -+extern __IMPORT int _sys_nerr; -+#ifdef __CYGWIN__ -+extern __IMPORT const char * const sys_errlist[]; -+extern __IMPORT int sys_nerr; -+#endif -+ -+#define __errno_r(ptr) ((ptr)->_errno) -+ -+#define EPERM 1 /* Not super-user */ -+#define ENOENT 2 /* No such file or directory */ -+#define ESRCH 3 /* No such process */ -+#define EINTR 4 /* Interrupted system call */ -+#define EIO 5 /* I/O error */ -+#define ENXIO 6 /* No such device or address */ -+#define E2BIG 7 /* Arg list too long */ -+#define ENOEXEC 8 /* Exec format error */ -+#define EBADF 9 /* Bad file number */ -+#define ECHILD 10 /* No children */ -+#define EAGAIN 11 /* No more processes */ -+#define ENOMEM 12 /* Not enough core */ -+#define EACCES 13 /* Permission denied */ -+#define EFAULT 14 /* Bad address */ -+#define ENOTBLK 15 /* Block device required */ -+#define EBUSY 16 /* Mount device busy */ -+#define EEXIST 17 /* File exists */ -+#define EXDEV 18 /* Cross-device link */ -+#define ENODEV 19 /* No such device */ -+#define ENOTDIR 20 /* Not a directory */ -+#define EISDIR 21 /* Is a directory */ -+#define EINVAL 22 /* Invalid argument */ -+#define ENFILE 23 /* Too many open files in system */ -+#define EMFILE 24 /* Too many open files */ -+#define ENOTTY 25 /* Not a typewriter */ -+#define ETXTBSY 26 /* Text file busy */ -+#define EFBIG 27 /* File too large */ -+#define ENOSPC 28 /* No space left on device */ -+#define ESPIPE 29 /* Illegal seek */ -+#define EROFS 30 /* Read only file system */ -+#define EMLINK 31 /* Too many links */ -+#define EPIPE 32 /* Broken pipe */ -+#define EDOM 33 /* Math arg out of domain of func */ -+#define ERANGE 34 /* Math result not representable */ -+#define ENOMSG 35 /* No message of desired type */ -+#define EIDRM 36 /* Identifier removed */ -+#define ECHRNG 37 /* Channel number out of range */ -+#define EL2NSYNC 38 /* Level 2 not synchronized */ -+#define EL3HLT 39 /* Level 3 halted */ -+#define EL3RST 40 /* Level 3 reset */ -+#define ELNRNG 41 /* Link number out of range */ -+#define EUNATCH 42 /* Protocol driver not attached */ -+#define ENOCSI 43 /* No CSI structure available */ -+#define EL2HLT 44 /* Level 2 halted */ -+#define EDEADLK 45 /* Deadlock condition */ -+#define ENOLCK 46 /* No record locks available */ -+#define EBADE 50 /* Invalid exchange */ -+#define EBADR 51 /* Invalid request descriptor */ -+#define EXFULL 52 /* Exchange full */ -+#define ENOANO 53 /* No anode */ -+#define EBADRQC 54 /* Invalid request code */ -+#define EBADSLT 55 /* Invalid slot */ -+#define EDEADLOCK 56 /* File locking deadlock error */ -+#define EBFONT 57 /* Bad font file fmt */ -+#define ENOSTR 60 /* Device not a stream */ -+#define ENODATA 61 /* No data (for no delay io) */ -+#define ETIME 62 /* Timer expired */ -+#define ENOSR 63 /* Out of streams resources */ -+#define ENONET 64 /* Machine is not on the network */ -+#define ENOPKG 65 /* Package not installed */ -+#define EREMOTE 66 /* The object is remote */ -+#define ENOLINK 67 /* The link has been severed */ -+#define EADV 68 /* Advertise error */ -+#define ESRMNT 69 /* Srmount error */ -+#define ECOMM 70 /* Communication error on send */ -+#define EPROTO 71 /* Protocol error */ -+#define EMULTIHOP 74 /* Multihop attempted */ -+#define ELBIN 75 /* Inode is remote (not really error) */ -+#define EDOTDOT 76 /* Cross mount point (not really error) */ -+#define EBADMSG 77 /* Trying to read unreadable message */ -+#define EFTYPE 79 /* Inappropriate file type or format */ -+#define ENOTUNIQ 80 /* Given log. name not unique */ -+#define EBADFD 81 /* f.d. invalid for this operation */ -+#define EREMCHG 82 /* Remote address changed */ -+#define ELIBACC 83 /* Can't access a needed shared lib */ -+#define ELIBBAD 84 /* Accessing a corrupted shared lib */ -+#define ELIBSCN 85 /* .lib section in a.out corrupted */ -+#define ELIBMAX 86 /* Attempting to link in too many libs */ -+#define ELIBEXEC 87 /* Attempting to exec a shared library */ -+#define ENOSYS 88 /* Function not implemented */ -+#define ENMFILE 89 /* No more files */ -+#define ENOTEMPTY 90 /* Directory not empty */ -+#define ENAMETOOLONG 91 /* File or path name too long */ -+#define ELOOP 92 /* Too many symbolic links */ -+#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -+#define EPFNOSUPPORT 96 /* Protocol family not supported */ -+#define ECONNRESET 104 /* Connection reset by peer */ -+#define ENOBUFS 105 /* No buffer space available */ -+#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */ -+#define EPROTOTYPE 107 /* Protocol wrong type for socket */ -+#define ENOTSOCK 108 /* Socket operation on non-socket */ -+#define ENOPROTOOPT 109 /* Protocol not available */ -+#define ESHUTDOWN 110 /* Can't send after socket shutdown */ -+#define ECONNREFUSED 111 /* Connection refused */ -+#define EADDRINUSE 112 /* Address already in use */ -+#define ECONNABORTED 113 /* Connection aborted */ -+#define ENETUNREACH 114 /* Network is unreachable */ -+#define ENETDOWN 115 /* Network interface is not configured */ -+#define ETIMEDOUT 116 /* Connection timed out */ -+#define EHOSTDOWN 117 /* Host is down */ -+#define EHOSTUNREACH 118 /* Host is unreachable */ -+#define EINPROGRESS 119 /* Connection already in progress */ -+#define EALREADY 120 /* Socket already connected */ -+#define EDESTADDRREQ 121 /* Destination address required */ -+#define EMSGSIZE 122 /* Message too long */ -+#define EPROTONOSUPPORT 123 /* Unknown protocol */ -+#define ESOCKTNOSUPPORT 124 /* Socket type not supported */ -+#define EADDRNOTAVAIL 125 /* Address not available */ -+#define ENETRESET 126 -+#define EISCONN 127 /* Socket is already connected */ -+#define ENOTCONN 128 /* Socket is not connected */ -+#define ETOOMANYREFS 129 -+#define EPROCLIM 130 -+#define EUSERS 131 -+#define EDQUOT 132 -+#define ESTALE 133 -+#define ENOTSUP 134 /* Not supported */ -+#define ENOMEDIUM 135 /* No medium (in tape drive) */ -+#define ENOSHARE 136 /* No such host or network path */ -+#define ECASECLASH 137 /* Filename exists with different case */ -+#define EILSEQ 138 -+#define EOVERFLOW 139 /* Value too large for defined data type */ -+ -+/* From cygwin32. */ -+#define EWOULDBLOCK EAGAIN /* Operation would block */ -+ -+#define __ELASTERROR 2000 /* Users can add values starting here */ -+ -+#ifdef __cplusplus -+} -+#endif -+#endif /* _SYS_ERRNO_H */ -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/sys/fd_set.h newlib-1.20.0/newlib/libc/sys/psp/sys/fd_set.h ---- orig.newlib-1.20.0/newlib/libc/sys/psp/sys/fd_set.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/sys/fd_set.h 2012-01-12 17:25:59.521824732 +0100 -@@ -0,0 +1,69 @@ -+/* $NetBSD: fd_set.h,v 1.1 2005/05/22 12:44:24 kleink Exp $ */ -+ -+/*- -+ * Copyright (c) 1992, 1993 -+ * The Regents of the University of California. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. Neither the name of the University nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * from: @(#)types.h 8.4 (Berkeley) 1/21/94 -+ */ -+ -+#ifndef _SYS_FD_SET_H_ -+#define _SYS_FD_SET_H_ -+ -+#include -+#include -+ -+/* -+ * Implementation dependent defines, hidden from user space. X/Open does not -+ * specify them. -+ */ -+#define __NBBY 8 /* number of bits in a byte */ -+typedef uint32_t __fd_mask; -+ -+/* bits per mask */ -+#define __NFDBITS ((unsigned int)sizeof(__fd_mask) * __NBBY) -+ -+#define __howmany(x, y) (((x) + ((y) - 1)) / (y)) -+ -+#define FD_SETSIZE 256 -+ -+typedef struct fd_set { -+ __fd_mask fds_bits[__howmany(FD_SETSIZE, __NFDBITS)]; -+} fd_set; -+ -+#define FD_SET(n, p) \ -+ ((p)->fds_bits[(n) /__NFDBITS] |= (1 << ((n) % __NFDBITS))) -+ -+#define FD_CLR(n, p) \ -+ ((p)->fds_bits[(n) /__NFDBITS] &= ~(1 << ((n) % __NFDBITS))) -+ -+#define FD_ISSET(n, p) \ -+ ((p)->fds_bits[(n) /__NFDBITS] & (1 << ((n) % __NFDBITS))) -+ -+#define FD_ZERO(p) (void)__builtin_memset((p), 0, sizeof(*(p))) -+ -+#endif /* _SYS_FD_SET_H_ */ -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/sys/ioctl.h newlib-1.20.0/newlib/libc/sys/psp/sys/ioctl.h ---- orig.newlib-1.20.0/newlib/libc/sys/psp/sys/ioctl.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/sys/ioctl.h 2012-01-12 17:25:59.521824732 +0100 -@@ -0,0 +1 @@ -+/* Empty file, here for compatibility */ -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/sys/select.h newlib-1.20.0/newlib/libc/sys/psp/sys/select.h ---- orig.newlib-1.20.0/newlib/libc/sys/psp/sys/select.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/sys/select.h 2012-01-12 17:25:59.541824497 +0100 -@@ -0,0 +1,54 @@ -+/* $NetBSD: select.h,v 1.24 2005/05/22 12:44:24 kleink Exp $ */ -+ -+/*- -+ * Copyright (c) 1992, 1993 -+ * The Regents of the University of California. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. Neither the name of the University nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * @(#)select.h 8.2 (Berkeley) 1/4/94 -+ */ -+ -+#ifndef _SYS_SELECT_H_ -+#define _SYS_SELECT_H_ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include -+#include -+ -+int sceNetInetSelect(int n, fd_set *readfds, fd_set *writefds, -+ fd_set *exceptfds, struct timeval *timeout); -+ -+int select(int n, fd_set *readfds, fd_set *writefds, -+ fd_set *exceptfds, struct timeval *timeout); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif /* !_SYS_SELECT_H_ */ -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/sys/socket.h newlib-1.20.0/newlib/libc/sys/psp/sys/socket.h ---- orig.newlib-1.20.0/newlib/libc/sys/psp/sys/socket.h 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/sys/socket.h 2012-01-12 17:25:59.541824497 +0100 -@@ -0,0 +1,294 @@ -+/* $NetBSD: socket.h,v 1.77 2005/11/29 03:12:16 christos Exp $ */ -+ -+/* -+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. Neither the name of the project nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+/* -+ * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 -+ * The Regents of the University of California. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. Neither the name of the University nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * @(#)socket.h 8.6 (Berkeley) 5/3/95 -+ */ -+ -+#ifndef _SYS_SOCKET_H_ -+#define _SYS_SOCKET_H_ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include -+#include -+#include -+ -+typedef uint8_t sa_family_t; -+typedef uint32_t socklen_t; -+ -+/* -+ * Socket types. -+ */ -+#define SOCK_STREAM 1 /* stream socket */ -+#define SOCK_DGRAM 2 /* datagram socket */ -+#define SOCK_RAW 3 /* raw-protocol interface */ -+#define SOCK_RDM 4 /* reliably-delivered message */ -+#define SOCK_SEQPACKET 5 /* sequenced packet stream */ -+ -+/* -+ * Option flags per-socket. -+ */ -+#define SO_DEBUG 0x0001 /* turn on debugging info recording */ -+#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ -+#define SO_REUSEADDR 0x0004 /* allow local address reuse */ -+#define SO_KEEPALIVE 0x0008 /* keep connections alive */ -+#define SO_DONTROUTE 0x0010 /* just use interface addresses */ -+#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ -+#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ -+#define SO_LINGER 0x0080 /* linger on close if data present */ -+#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ -+#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ -+#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */ -+ -+/* -+ * Additional options, not kept in so_options. -+ */ -+#define SO_SNDBUF 0x1001 /* send buffer size */ -+#define SO_RCVBUF 0x1002 /* receive buffer size */ -+#define SO_SNDLOWAT 0x1003 /* send low-water mark */ -+#define SO_RCVLOWAT 0x1004 /* receive low-water mark */ -+#define SO_SNDTIMEO 0x1005 /* send timeout */ -+#define SO_RCVTIMEO 0x1006 /* receive timeout */ -+#define SO_ERROR 0x1007 /* get error status and clear */ -+#define SO_TYPE 0x1008 /* get socket type */ -+#define SO_OVERFLOWED 0x1009 /* datagrams: return packets dropped */ -+#define SO_NONBLOCK 0x1009 /* non-blocking I/O */ -+ -+/* -+ * Structure used for manipulating linger option. -+ */ -+struct linger { -+ int l_onoff; /* option on/off */ -+ int l_linger; /* linger time in seconds */ -+}; -+ -+/* -+ * Level number for (get/set)sockopt() to apply to socket itself. -+ */ -+#define SOL_SOCKET 0xffff /* options for socket level */ -+ -+/* -+ * Address families. -+ */ -+#define AF_UNSPEC 0 /* unspecified */ -+#define AF_LOCAL 1 /* local to host (pipes, portals) */ -+#define AF_UNIX AF_LOCAL /* backward compatibility */ -+#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ -+#define AF_IMPLINK 3 /* arpanet imp addresses */ -+#define AF_PUP 4 /* pup protocols: e.g. BSP */ -+#define AF_CHAOS 5 /* mit CHAOS protocols */ -+#define AF_NS 6 /* XEROX NS protocols */ -+#define AF_ISO 7 /* ISO protocols */ -+#define AF_OSI AF_ISO -+#define AF_ECMA 8 /* european computer manufacturers */ -+#define AF_DATAKIT 9 /* datakit protocols */ -+#define AF_CCITT 10 /* CCITT protocols, X.25 etc */ -+#define AF_SNA 11 /* IBM SNA */ -+#define AF_DECnet 12 /* DECnet */ -+#define AF_DLI 13 /* DEC Direct data link interface */ -+#define AF_LAT 14 /* LAT */ -+#define AF_HYLINK 15 /* NSC Hyperchannel */ -+#define AF_APPLETALK 16 /* Apple Talk */ -+#define AF_ROUTE 17 /* Internal Routing Protocol */ -+#define AF_LINK 18 /* Link layer interface */ -+#define AF_COIP 20 /* connection-oriented IP, aka ST II */ -+#define AF_CNT 21 /* Computer Network Technology */ -+#define AF_IPX 23 /* Novell Internet Protocol */ -+#define AF_INET6 24 /* IP version 6 */ -+#define AF_ISDN 26 /* Integrated Services Digital Network*/ -+#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */ -+#define AF_NATM 27 /* native ATM access */ -+#define AF_ARP 28 /* (rev.) addr. res. prot. (RFC 826) */ -+#define AF_MAX 31 -+ -+/* -+ * Structure used by kernel to store most -+ * addresses. -+ */ -+struct sockaddr { -+ uint8_t sa_len; /* total length */ -+ sa_family_t sa_family; /* address family */ -+ char sa_data[14]; /* actually longer; address value */ -+}; -+ -+/* -+ * Protocol families, same as address families for now. -+ */ -+#define PF_UNSPEC AF_UNSPEC -+#define PF_LOCAL AF_LOCAL -+#define PF_UNIX PF_LOCAL /* backward compatibility */ -+#define PF_INET AF_INET -+#define PF_IMPLINK AF_IMPLINK -+#define PF_PUP AF_PUP -+#define PF_CHAOS AF_CHAOS -+#define PF_NS AF_NS -+#define PF_ISO AF_ISO -+#define PF_OSI AF_ISO -+#define PF_ECMA AF_ECMA -+#define PF_DATAKIT AF_DATAKIT -+#define PF_CCITT AF_CCITT -+#define PF_SNA AF_SNA -+#define PF_DECnet AF_DECnet -+#define PF_DLI AF_DLI -+#define PF_LAT AF_LAT -+#define PF_HYLINK AF_HYLINK -+#define PF_APPLETALK AF_APPLETALK -+#define PF_ROUTE AF_ROUTE -+#define PF_LINK AF_LINK -+#if defined(_NETBSD_SOURCE) -+#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */ -+#endif -+#define PF_COIP AF_COIP -+#define PF_CNT AF_CNT -+#define PF_INET6 AF_INET6 -+#define PF_IPX AF_IPX /* same format as AF_NS */ -+#if defined(_NETBSD_SOURCE) -+#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */ -+#define PF_PIP pseudo_AF_PIP -+#endif -+#define PF_ISDN AF_ISDN /* same as E164 */ -+#define PF_E164 AF_E164 -+#define PF_NATM AF_NATM -+#define PF_ARP AF_ARP -+#if defined(_NETBSD_SOURCE) -+#define PF_KEY pseudo_AF_KEY /* like PF_ROUTE, only for key mgmt */ -+#endif -+ -+#define PF_MAX AF_MAX -+ -+#define MSG_OOB 0x1 /* process out-of-band data */ -+#define MSG_PEEK 0x2 /* peek at incoming message */ -+#define MSG_DONTROUTE 0x4 /* send without using routing tables */ -+#define MSG_EOR 0x8 /* data completes record */ -+#define MSG_TRUNC 0x10 /* data discarded before delivery */ -+#define MSG_CTRUNC 0x20 /* control data lost before delivery */ -+#define MSG_WAITALL 0x40 /* wait for full request or error */ -+#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ -+#define MSG_BCAST 0x100 /* this message was rcvd using link-level brdcst */ -+#define MSG_MCAST 0x200 /* this message was rcvd using link-level mcast */ -+ -+/* -+ * Types of socket shutdown(2). -+ */ -+#define SHUT_RD 0 /* Disallow further receives. */ -+#define SHUT_WR 1 /* Disallow further sends. */ -+#define SHUT_RDWR 2 /* Disallow further sends/receives. */ -+ -+struct iovec { -+ void *iov_base; /* Base address. */ -+ size_t iov_len; /* Length. */ -+}; -+ -+struct msghdr { -+ void *msg_name; /* optional address */ -+ socklen_t msg_namelen; /* size of address */ -+ struct iovec *msg_iov; /* scatter/gather array */ -+ int msg_iovlen; /* # elements in msg_iov */ -+ void *msg_control; /* ancillary data, see below */ -+ socklen_t msg_controllen; /* ancillary data buffer len */ -+ int msg_flags; /* flags on received message */ -+}; -+ -+/* BSD-compatible socket API. */ -+int accept(int, struct sockaddr * __restrict, socklen_t * __restrict); -+int bind(int, const struct sockaddr *, socklen_t); -+int connect(int, const struct sockaddr *, socklen_t); -+int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict); -+int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict); -+int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict); -+int listen(int, int); -+ssize_t recv(int, void *, size_t, int); -+ssize_t recvfrom(int, void * __restrict, size_t, int, -+ struct sockaddr * __restrict, socklen_t * __restrict); -+ssize_t recvmsg(int s, struct msghdr *msg, int flags); -+ssize_t send(int, const void *, size_t, int); -+ssize_t sendto(int, const void *, -+ size_t, int, const struct sockaddr *, socklen_t); -+ssize_t sendmsg(int s, const struct msghdr *msg, int flags); -+int setsockopt(int, int, int, const void *, socklen_t); -+int shutdown(int, int); -+int socket(int, int, int); -+ -+/* sceNetInet socket API. */ -+int sceNetInetAccept(int s, struct sockaddr *addr, socklen_t *addrlen); -+int sceNetInetBind(int s, const struct sockaddr *my_addr, socklen_t addrlen); -+int sceNetInetConnect(int s, const struct sockaddr *serv_addr, socklen_t addrlen); -+int sceNetInetGetsockopt(int s, int level, int optname, void *optval, socklen_t *optlen); -+int sceNetInetListen(int s, int backlog); -+ssize_t sceNetInetRecv(int s, void *buf, size_t len, int flags); -+ssize_t sceNetInetRecvfrom(int s, void *buf, size_t flags, int, struct sockaddr *from, socklen_t *fromlen); -+ssize_t sceNetInetRecvmsg(int s, struct msghdr *msg, int flags); -+ssize_t sceNetInetSend(int s, const void *buf, size_t len, int flags); -+ssize_t sceNetInetSendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); -+ssize_t sceNetInetSendmsg(int s, const struct msghdr *msg, int flags); -+int sceNetInetSetsockopt(int s, int level, int optname, const void *optval, socklen_t optlen); -+int sceNetInetShutdown(int s, int how); -+int sceNetInetSocket(int domain, int type, int protocol); -+int sceNetInetClose(int s); -+int sceNetInetGetErrno(void); -+int sceNetInetGetsockname(int s, struct sockaddr *name, socklen_t *namelen); -+int sceNetInetGetpeername(int s, struct sockaddr *name, socklen_t *namelen); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif /* !_SYS_SOCKET_H_ */ -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/syscalls.c newlib-1.20.0/newlib/libc/sys/psp/syscalls.c ---- orig.newlib-1.20.0/newlib/libc/sys/psp/syscalls.c 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/syscalls.c 2012-01-12 17:25:59.542824485 +0100 -@@ -0,0 +1,19 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * syscalls.c - functions in systeam namespace goes here -+ * -+ * Copyright (c) 2007 Alper Akcan "anhanguera" -+ * -+ */ -+ -+#include -+ -+int __psp_set_errno (int code); -+ -+time_t _times (time_t *t) -+{ -+ return __psp_set_errno(sceKernelLibcTime(t)); -+} -diff -burN orig.newlib-1.20.0/newlib/libc/sys/psp/xprintf.c newlib-1.20.0/newlib/libc/sys/psp/xprintf.c ---- orig.newlib-1.20.0/newlib/libc/sys/psp/xprintf.c 1970-01-01 01:00:00.000000000 +0100 -+++ newlib-1.20.0/newlib/libc/sys/psp/xprintf.c 2012-01-12 17:25:59.543824473 +0100 -@@ -0,0 +1,984 @@ -+/* -+ * PSP Software Development Kit - http://www.pspdev.org -+ * ----------------------------------------------------------------------- -+ * Licensed under the BSD license, see LICENSE in PSPSDK root for details. -+ * -+ * xprintf.c - Various *printf functions. -+ * -+ * Copyright (c) 2005 Marcus R. Brown -+ * Copyright (c) 2005 James Forshaw -+ * Copyright (c) 2005 John Kelley -+ * -+ * $Id: newlib-1.13.0.patch 1891 2006-05-02 15:32:28Z raf $ -+ */ -+/* Code borrowed from mysql's xprintf.c, by Richard Hipp */ -+/* This xprintf.c file on which this one is based is in public domain. */ -+ -+#include -+#include -+#include -+ -+#include -+#include -+ -+/* -+** The maximum number of digits of accuracy in a floating-point conversion. -+*/ -+#define MAXDIG 20 -+ -+/* Instead of including ctype.h, use the isdigit() prototype because psplibc doesn't -+ know about newlib, and newlib defines isdigit as a macro that uses _ctype_. */ -+int isdigit(int __c); -+ -+int vxprintf(void (*func)(char *, int, void *), void *arg, const char *format, va_list ap); -+ -+#ifdef F_vxprintf -+/* -+** Conversion types fall into various categories as defined by the -+** following enumeration. -+*/ -+ -+enum e_type { /* The type of the format field */ -+ RADIX, /* Integer types. %d, %x, %o, and so forth */ -+ FLOAT, /* Floating point. %f */ -+ EXP, /* Exponentional notation. %e and %E */ -+ GENERIC, /* Floating or exponential, depending on exponent. %g */ -+ SIZE, /* Return number of characters processed so far. %n */ -+ STRING, /* Strings. %s */ -+ PERCENT, /* Percent symbol. %% */ -+ CHAR, /* Characters. %c */ -+ ERROR, /* Used to indicate no such conversion type */ -+/* The rest are extensions, not normally found in printf() */ -+ CHARLIT, /* Literal characters. %' */ -+ SEEIT, /* Strings with visible control characters. %S */ -+ MEM_STRING, /* A string which should be deleted after use. %z */ -+ ORDINAL, /* 1st, 2nd, 3rd and so forth */ -+}; -+ -+/* -+** Each builtin conversion character (ex: the 'd' in "%d") is described -+** by an instance of the following structure -+*/ -+typedef struct s_info { /* Information about each format field */ -+ int fmttype; /* The format field code letter */ -+ int base; /* The base for radix conversion */ -+ char *charset; /* The character set for conversion */ -+ int flag_signed; /* Is the quantity signed? */ -+ char *prefix; /* Prefix on non-zero values in alt format */ -+ enum e_type type; /* Conversion paradigm */ -+} info; -+ -+/* -+** The following table is searched linearly, so it is good to put the -+** most frequently used conversion types first. -+*/ -+static info fmtinfo[] = { -+ { 'd', 10, "0123456789", 1, 0, RADIX, }, -+ { 's', 0, 0, 0, 0, STRING, }, -+ { 'S', 0, 0, 0, 0, SEEIT, }, -+ { 'z', 0, 0, 0, 0, MEM_STRING, }, -+ { 'c', 0, 0, 0, 0, CHAR, }, -+ { 'o', 8, "01234567", 0, "0", RADIX, }, -+ { 'u', 10, "0123456789", 0, 0, RADIX, }, -+ { 'x', 16, "0123456789abcdef", 0, "x0", RADIX, }, -+ { 'X', 16, "0123456789ABCDEF", 0, "X0", RADIX, }, -+ { 'r', 10, "0123456789", 0, 0, ORDINAL, }, -+ { 'f', 0, 0, 1, 0, FLOAT, }, -+ { 'e', 0, "e", 1, 0, EXP, }, -+ { 'E', 0, "E", 1, 0, EXP, }, -+ { 'g', 0, "e", 1, 0, GENERIC, }, -+ { 'G', 0, "E", 1, 0, GENERIC, }, -+ { 'i', 10, "0123456789", 1, 0, RADIX, }, -+ { 'n', 0, 0, 0, 0, SIZE, }, -+ { 'S', 0, 0, 0, 0, SEEIT, }, -+ { '%', 0, 0, 0, 0, PERCENT, }, -+ { 'b', 2, "01", 0, "b0", RADIX, }, /* Binary notation */ -+ { 'p', 16, "0123456789ABCDEF", 0, "x0", RADIX, }, /* Pointers */ -+ { '\'', 0, 0, 0, 0, CHARLIT, }, /* Literal char */ -+}; -+#define NINFO (sizeof(fmtinfo)/sizeof(info)) /* Size of the fmtinfo table */ -+ -+/* -+** If NOFLOATINGPOINT is defined, then none of the floating point -+** conversions will work. -+*/ -+#ifndef NOFLOATINGPOINT -+/* -+** "*val" is a double such that 0.1 <= *val < 10.0 -+** Return the ascii code for the leading digit of *val, then -+** multiply "*val" by 10.0 to renormalize. -+** -+** Example: -+** input: *val = 3.14159 -+** output: *val = 1.4159 function return = '3' -+** -+** The counter *cnt is incremented each time. After counter exceeds -+** 16 (the number of significant digits in a 64-bit float) '0' is -+** always returned. -+*/ -+static int getdigit(long double *val, int *cnt){ -+ int digit; -+ long double d; -+ if( (*cnt)++ >= MAXDIG ) return '0'; -+ digit = (int)*val; -+ d = digit; -+ digit += '0'; -+ *val = (*val - d)*10.0; -+ return digit; -+} -+#endif -+ -+/* -+** Setting the size of the BUFFER involves trade-offs. No %d or %f -+** conversion can have more than BUFSIZE characters. If the field -+** width is larger than BUFSIZE, it is silently shortened. On the -+** other hand, this routine consumes more stack space with larger -+** BUFSIZEs. If you have some threads for which you want to minimize -+** stack space, you should keep BUFSIZE small. -+*/ -+#define BUFSIZE 100 /* Size of the output buffer */ -+ -+/* -+** The root program. All variations call this core. -+** -+** INPUTS: -+** func This is a pointer to a function taking three arguments -+** 1. A pointer to the list of characters to be output -+** (Note, this list is NOT null terminated.) -+** 2. An integer number of characters to be output. -+** (Note: This number might be zero.) -+** 3. A pointer to anything. Same as the "arg" parameter. -+** -+** arg This is the pointer to anything which will be passed as the -+** third argument to "func". Use it for whatever you like. -+** -+** fmt This is the format string, as in the usual print. -+** -+** ap This is a pointer to a list of arguments. Same as in -+** vfprint. -+** -+** OUTPUTS: -+** The return value is the total number of characters sent to -+** the function "func". Returns -1 on a error. -+** -+** Note that the order in which automatic variables are declared below -+** seems to make a big difference in determining how fast this beast -+** will run. -+*/ -+ -+int vxprintf(func,arg,format,ap) -+ void (*func)(char*,int,void*); -+ void *arg; -+ const char *format; -+ va_list ap; -+{ -+ register const char *fmt; /* The format string. */ -+ register int c; /* Next character in the format string */ -+ register char *bufpt; /* Pointer to the conversion buffer */ -+ register int precision; /* Precision of the current field */ -+ register int length; /* Length of the field */ -+ register int idx; /* A general purpose loop counter */ -+ int count; /* Total number of characters output */ -+ int width; /* Width of the current field */ -+ int flag_leftjustify; /* True if "-" flag is present */ -+ int flag_plussign; /* True if "+" flag is present */ -+ int flag_blanksign; /* True if " " flag is present */ -+ int flag_alternateform; /* True if "#" flag is present */ -+ int flag_zeropad; /* True if field width constant starts with zero */ -+ int flag_long; /* True if "l" flag is present */ -+ int flag_center; /* True if "=" flag is present */ -+ unsigned long long longvalue; /* Value for integer types */ -+ -+ long double realvalue; /* Value for real types */ -+ info *infop; /* Pointer to the appropriate info structure */ -+ char buf[BUFSIZE]; /* Conversion buffer */ -+ char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */ -+ int errorflag = 0; /* True if an error is encountered */ -+ enum e_type xtype; /* Conversion paradigm */ -+ char *zMem = 0; /* String to be freed */ -+ static char spaces[] = -+ " "; -+#define SPACESIZE (sizeof(spaces)-1) -+#ifndef NOFLOATINGPOINT -+ int exp; /* exponent of real numbers */ -+ long double rounder; /* Used for rounding floating point values */ -+ int flag_dp; /* True if decimal point should be shown */ -+ int flag_rtz; /* True if trailing zeros should be removed */ -+ int flag_exp; /* True to force display of the exponent */ -+ int nsd; /* Number of significant digits returned */ -+#endif -+ -+ fmt = format; /* Put in a register for speed */ -+ count = length = 0; -+ bufpt = 0; -+ for(; (c=(*fmt))!=0; ++fmt){ -+ if( c!='%' ){ -+ register int amt; -+ bufpt = (char *)fmt; -+ amt = 1; -+ while( (c=(*++fmt))!='%' && c!=0 ) amt++; -+ (*func)(bufpt,amt,arg); -+ count += amt; -+ if( c==0 ) break; -+ } -+ if( (c=(*++fmt))==0 ){ -+ errorflag = 1; -+ (*func)("%",1,arg); -+ count++; -+ break; -+ } -+ /* Find out what flags are present */ -+ flag_leftjustify = flag_plussign = flag_blanksign = -+ flag_alternateform = flag_zeropad = flag_center = 0; -+ do{ -+ switch( c ){ -+ case '-': flag_leftjustify = 1; c = 0; break; -+ case '+': flag_plussign = 1; c = 0; break; -+ case ' ': flag_blanksign = 1; c = 0; break; -+ case '#': flag_alternateform = 1; c = 0; break; -+ case '0': flag_zeropad = 1; c = 0; break; -+ case '=': flag_center = 1; c = 0; break; -+ default: break; -+ } -+ }while( c==0 && (c=(*++fmt))!=0 ); -+ if( flag_center ) flag_leftjustify = 0; -+ /* Get the field width */ -+ width = 0; -+ if( c=='*' ){ -+ width = va_arg(ap,int); -+ if( width<0 ){ -+ flag_leftjustify = 1; -+ width = -width; -+ } -+ c = *++fmt; -+ }else{ -+ while( isdigit(c) ){ -+ width = width*10 + c - '0'; -+ c = *++fmt; -+ } -+ } -+ if( width > BUFSIZE-10 ){ -+ width = BUFSIZE-10; -+ } -+ /* Get the precision */ -+ if( c=='.' ){ -+ precision = 0; -+ c = *++fmt; -+ if( c=='*' ){ -+ precision = va_arg(ap,int); -+#ifndef COMPATIBILITY -+ /* This is sensible, but SUN OS 4.1 doesn't do it. */ -+ if( precision<0 ) precision = -precision; -+#endif -+ c = *++fmt; -+ }else{ -+ while( isdigit(c) ){ -+ precision = precision*10 + c - '0'; -+ c = *++fmt; -+ } -+ } -+ /* Limit the precision to prevent overflowing buf[] during conversion */ -+ if( precision>BUFSIZE-40 ) precision = BUFSIZE-40; -+ }else{ -+ precision = -1; -+ } -+ /* Get the conversion type modifier */ -+ if( c=='l' ){ -+ flag_long = 1; -+ c = *++fmt; -+ if( c == 'l' ){ -+ flag_long = 2; -+ c = *++fmt; -+ } -+ }else{ -+ flag_long = 0; -+ } -+ /* Fetch the info entry for the field */ -+ infop = 0; -+ for(idx=0; idxtype; -+ } -+ -+ /* -+ ** At this point, variables are initialized as follows: -+ ** -+ ** flag_alternateform TRUE if a '#' is present. -+ ** flag_plussign TRUE if a '+' is present. -+ ** flag_leftjustify TRUE if a '-' is present or if the -+ ** field width was negative. -+ ** flag_zeropad TRUE if the width began with 0. -+ ** flag_long TRUE if the letter 'l' (ell) prefixed -+ ** the conversion character. -+ ** flag_blanksign TRUE if a ' ' is present. -+ ** width The specified field width. This is -+ ** always non-negative. Zero is the default. -+ ** precision The specified precision. The default -+ ** is -1. -+ ** xtype The class of the conversion. -+ ** infop Pointer to the appropriate info struct. -+ */ -+ switch( xtype ){ -+ case ORDINAL: -+ case RADIX: -+ if(( flag_long>1 )&&( infop->flag_signed )){ -+ signed long long t = va_arg(ap,signed long long); -+ longvalue = t; -+ }else if(( flag_long>1 )&&( !infop->flag_signed )){ -+ unsigned long long t = va_arg(ap,unsigned long long); -+ longvalue = t; -+ }else if(( flag_long )&&( infop->flag_signed )){ -+ signed long t = va_arg(ap,signed long); -+ longvalue = t; -+ }else if(( flag_long )&&( !infop->flag_signed )){ -+ unsigned long t = va_arg(ap,unsigned long); -+ longvalue = t; -+ }else if(( !flag_long )&&( infop->flag_signed )){ -+ signed int t = va_arg(ap,signed int) & ((unsigned long) 0xffffffff); -+ longvalue = t; -+ }else{ -+ unsigned int t = va_arg(ap,unsigned int) & ((unsigned long) 0xffffffff); -+ longvalue = t; -+ } -+#ifdef COMPATIBILITY -+ /* For the format %#x, the value zero is printed "0" not "0x0". -+ ** I think this is stupid. */ -+ if( longvalue==0 ) flag_alternateform = 0; -+#else -+ /* More sensible: turn off the prefix for octal (to prevent "00"), -+ ** but leave the prefix for hex. */ -+ if( longvalue==0 && infop->base==8 ) flag_alternateform = 0; -+#endif -+ if( infop->flag_signed ){ -+ if( *(long long*)&longvalue<0 ){ -+ longvalue = -*(long long*)&longvalue; -+ prefix = '-'; -+ }else if( flag_plussign ) prefix = '+'; -+ else if( flag_blanksign ) prefix = ' '; -+ else prefix = 0; -+ }else prefix = 0; -+ if( flag_zeropad && precision3 || (b>10 && b<14) ){ -+ bufpt[0] = 't'; -+ bufpt[1] = 'h'; -+ }else if( a==1 ){ -+ bufpt[0] = 's'; -+ bufpt[1] = 't'; -+ }else if( a==2 ){ -+ bufpt[0] = 'n'; -+ bufpt[1] = 'd'; -+ }else if( a==3 ){ -+ bufpt[0] = 'r'; -+ bufpt[1] = 'd'; -+ } -+ } -+ { -+ register char *cset; /* Use registers for speed */ -+ register int base; -+ cset = infop->charset; -+ base = infop->base; -+ do{ /* Convert to ascii */ -+ *(--bufpt) = cset[longvalue%base]; -+ longvalue = longvalue/base; -+ }while( longvalue>0 ); -+ } -+ length = (int)(&buf[BUFSIZE]-bufpt); -+ if(infop->fmttype == 'p') -+ { -+ precision = 8; -+ flag_alternateform = 1; -+ } -+ -+ for(idx=precision-length; idx>0; idx--){ -+ *(--bufpt) = '0'; /* Zero pad */ -+ } -+ if( prefix ) *(--bufpt) = prefix; /* Add sign */ -+ if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ -+ char *pre, x; -+ pre = infop->prefix; -+ if( *bufpt!=pre[0] ){ -+ for(pre=infop->prefix; (x=(*pre))!=0; pre++) *(--bufpt) = x; -+ } -+ } -+ -+ length = (int)(&buf[BUFSIZE]-bufpt); -+ break; -+ case FLOAT: -+ case EXP: -+ case GENERIC: -+ realvalue = va_arg(ap,double); -+#ifndef NOFLOATINGPOINT -+ if( precision<0 ) precision = 6; /* Set default precision */ -+ if( precision>BUFSIZE-10 ) precision = BUFSIZE-10; -+ if( realvalue<0.0 ){ -+ realvalue = -realvalue; -+ prefix = '-'; -+ }else{ -+ if( flag_plussign ) prefix = '+'; -+ else if( flag_blanksign ) prefix = ' '; -+ else prefix = 0; -+ } -+ if( infop->type==GENERIC && precision>0 ) precision--; -+ rounder = 0.0; -+#ifdef COMPATIBILITY -+ /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */ -+ for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1); -+#else -+ /* It makes more sense to use 0.5 */ -+ if( precision>MAXDIG-1 ) idx = MAXDIG-1; -+ else idx = precision; -+ for(rounder=0.5; idx>0; idx--, rounder*=0.1); -+#endif -+ if( infop->type==FLOAT ) realvalue += rounder; -+ /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */ -+ exp = 0; -+ if( realvalue>0.0 ){ -+ int k = 0; -+ while( realvalue>=1e8 && k++<100 ){ realvalue *= 1e-8; exp+=8; } -+ while( realvalue>=10.0 && k++<100 ){ realvalue *= 0.1; exp++; } -+ while( realvalue<1e-8 && k++<100 ){ realvalue *= 1e8; exp-=8; } -+ while( realvalue<1.0 && k++<100 ){ realvalue *= 10.0; exp--; } -+ if( k>=100 ){ -+ bufpt = "NaN"; -+ length = 3; -+ break; -+ } -+ } -+ bufpt = buf; -+ /* -+ ** If the field type is GENERIC, then convert to either EXP -+ ** or FLOAT, as appropriate. -+ */ -+ flag_exp = xtype==EXP; -+ if( xtype!=FLOAT ){ -+ realvalue += rounder; -+ if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; } -+ } -+ if( xtype==GENERIC ){ -+ flag_rtz = !flag_alternateform; -+ if( exp<-4 || exp>precision ){ -+ xtype = EXP; -+ }else{ -+ precision = precision - exp; -+ xtype = FLOAT; -+ } -+ }else{ -+ flag_rtz = 0; -+ } -+ /* -+ ** The "exp+precision" test causes output to be of type EXP if -+ ** the precision is too large to fit in buf[]. -+ */ -+ nsd = 0; -+ if( xtype==FLOAT && exp+precision0 || flag_alternateform); -+ if( prefix ) *(bufpt++) = prefix; /* Sign */ -+ if( exp<0 ) *(bufpt++) = '0'; /* Digits before "." */ -+ else for(; exp>=0; exp--) *(bufpt++) = getdigit(&realvalue,&nsd); -+ if( flag_dp ) *(bufpt++) = '.'; /* The decimal point */ -+ for(exp++; exp<0 && precision>0; precision--, exp++){ -+ *(bufpt++) = '0'; -+ } -+ while( (precision--)>0 ) *(bufpt++) = getdigit(&realvalue,&nsd); -+ *(bufpt--) = 0; /* Null terminate */ -+ if( flag_rtz && flag_dp ){ /* Remove trailing zeros and "." */ -+ while( bufpt>=buf && *bufpt=='0' ) *(bufpt--) = 0; -+ if( bufpt>=buf && *bufpt=='.' ) *(bufpt--) = 0; -+ } -+ bufpt++; /* point to next free slot */ -+ }else{ /* EXP or GENERIC */ -+ flag_dp = (precision>0 || flag_alternateform); -+ if( prefix ) *(bufpt++) = prefix; /* Sign */ -+ *(bufpt++) = getdigit(&realvalue,&nsd); /* First digit */ -+ if( flag_dp ) *(bufpt++) = '.'; /* Decimal point */ -+ while( (precision--)>0 ) *(bufpt++) = getdigit(&realvalue,&nsd); -+ bufpt--; /* point to last digit */ -+ if( flag_rtz && flag_dp ){ /* Remove tail zeros */ -+ while( bufpt>=buf && *bufpt=='0' ) *(bufpt--) = 0; -+ if( bufpt>=buf && *bufpt=='.' ) *(bufpt--) = 0; -+ } -+ bufpt++; /* point to next free slot */ -+ if( exp || flag_exp ){ -+ *(bufpt++) = infop->charset[0]; -+ if( exp<0 ){ *(bufpt++) = '-'; exp = -exp; } /* sign of exp */ -+ else { *(bufpt++) = '+'; } -+ if( exp>=100 ){ -+ *(bufpt++) = (exp/100)+'0'; /* 100's digit */ -+ exp %= 100; -+ } -+ *(bufpt++) = exp/10+'0'; /* 10's digit */ -+ *(bufpt++) = exp%10+'0'; /* 1's digit */ -+ } -+ } -+ /* The converted number is in buf[] and zero terminated. Output it. -+ ** Note that the number is in the usual order, not reversed as with -+ ** integer conversions. */ -+ length = (int)(bufpt-buf); -+ bufpt = buf; -+ -+ /* Special case: Add leading zeros if the flag_zeropad flag is -+ ** set and we are not left justified */ -+ if( flag_zeropad && !flag_leftjustify && length < width){ -+ int i; -+ int nPad = width - length; -+ for(i=width; i>=nPad; i--){ -+ bufpt[i] = bufpt[i-nPad]; -+ } -+ i = prefix!=0; -+ while( nPad-- ) bufpt[i++] = '0'; -+ length = width; -+ } -+#endif -+ break; -+ case SIZE: -+ *(va_arg(ap,int*)) = count; -+ length = width = 0; -+ break; -+ case PERCENT: -+ buf[0] = '%'; -+ bufpt = buf; -+ length = 1; -+ break; -+ case CHARLIT: -+ case CHAR: -+ c = buf[0] = (xtype==CHAR ? va_arg(ap,int) : *++fmt); -+ if( precision>=0 ){ -+ for(idx=1; idx=0 && precision=0x7f ){ -+ buf[i++] = '^'; -+ buf[i] = (c&0x1f)+0x40; -+ }else{ -+ buf[i] = c; -+ } -+ } -+ bufpt = buf; -+ length = i; -+ if( precision>=0 && precision0 ){ -+ if( flag_center ){ -+ nspace = nspace/2; -+ width -= nspace; -+ flag_leftjustify = 1; -+ } -+ count += nspace; -+ while( nspace>=SPACESIZE ){ -+ (*func)(spaces,SPACESIZE,arg); -+ nspace -= SPACESIZE; -+ } -+ if( nspace>0 ) (*func)(spaces,nspace,arg); -+ } -+ } -+ if( length>0 ){ -+ (*func)(bufpt,length,arg); -+ count += length; -+ } -+ if( xtype==MEM_STRING && zMem ){ -+ free(zMem); -+ } -+ if( flag_leftjustify ){ -+ register int nspace; -+ nspace = width-length; -+ if( nspace>0 ){ -+ count += nspace; -+ while( nspace>=SPACESIZE ){ -+ (*func)(spaces,SPACESIZE,arg); -+ nspace -= SPACESIZE; -+ } -+ if( nspace>0 ) (*func)(spaces,nspace,arg); -+ } -+ } -+ }/* End for loop over the format string */ -+ return errorflag ? -1 : count; -+} /* End of function */ -+#endif -+ -+#ifdef F__xprintf -+/* -+** This non-standard function is still occasionally useful.... -+*/ -+int xprintf( -+ void (*func)(char*,int,void*), -+ void *arg, -+ const char *format, -+ ... -+){ -+ va_list ap; -+ va_start(ap,format); -+ return vxprintf(func,arg,format,ap); -+} -+#endif -+ -+/* -+** Now for string-print, also as found in any standard library. -+** Add to this the snprint function which stops added characters -+** to the string at a given length. -+** -+** Note that snprint returns the length of the string as it would -+** be if there were no limit on the output. -+*/ -+struct s_strargument { /* Describes the string being written to */ -+ char *next; /* Next free slot in the string */ -+ char *last; /* Last available slot in the string */ -+}; -+ -+void __sout(char *, int, void *); -+#ifdef F___sout -+void __sout(txt,amt,arg) -+ char *txt; -+ int amt; -+ void *arg; -+{ -+ register char *head; -+ register const char *t; -+ register int a; -+ register char *tail; -+ a = amt; -+ t = txt; -+ head = ((struct s_strargument*)arg)->next; -+ tail = ((struct s_strargument*)arg)->last; -+ if( tail ){ -+ while( a-- >0 && head0 ) *(head++) = *(t++); -+ } -+ *head = 0; -+ ((struct s_strargument*)arg)->next = head; -+} -+#endif -+ -+#ifdef F_vsnprintf -+int vsnprintf(char *buf, size_t n, const char *fmt, va_list ap){ -+ struct s_strargument arg; -+ arg.next = buf; -+ arg.last = &buf[n-1]; -+ *buf = 0; -+ return vxprintf(__sout,&arg,fmt,ap); -+} -+#endif -+ -+#ifdef F_snprintf -+int snprintf(char *str, size_t sz, const char *format, ...) -+{ -+ va_list args; -+ struct s_strargument arg; -+ int ret; -+ -+ arg.next = str; -+ arg.last = &str[sz-1]; -+ -+ va_start(args, format); -+ ret = vxprintf(__sout, &arg, format, args); -+ va_end(args); -+ -+ return ret; -+} -+#endif -+ -+#ifdef F_vsprintf -+int vsprintf(char *buf, const char *fmt, va_list ap){ -+ struct s_strargument arg; -+ arg.next = buf; -+ arg.last = NULL; -+ *buf = 0; -+ return vxprintf(__sout,&arg,fmt,ap); -+} -+#endif -+ -+#ifdef F_sprintf -+int sprintf (char *str, const char *format, ...) -+{ -+ va_list args; -+ struct s_strargument arg; -+ int ret; -+ -+ arg.next = str; -+ arg.last = NULL; -+ -+ va_start(args, format); -+ ret = vxprintf(__sout, &arg, format, args); -+ va_end(args); -+ -+ return ret; -+} -+#endif -+ -+/* -+** The following section of code handles the mprintf routine, that -+** writes to memory obtained from malloc(). -+*/ -+ -+/* This structure is used to store state information about the -+** write in progress -+*/ -+struct sgMprintf { -+ char *zBase; /* A base allocation */ -+ char *zText; /* The string collected so far */ -+ int nChar; /* Length of the string so far */ -+ int nAlloc; /* Amount of space allocated in zText */ -+}; -+ -+void __mout(char *, int, void*); -+ -+#ifdef F___mout -+/* The xprintf callback function. */ -+void __mout(zNewText,nNewChar,arg) -+ char *zNewText; -+ int nNewChar; -+ void *arg; -+{ -+ struct sgMprintf *pM = (struct sgMprintf*)arg; -+ if( pM->nChar + nNewChar + 1 > pM->nAlloc ){ -+ pM->nAlloc = pM->nChar + nNewChar*2 + 1; -+ if( pM->zText==pM->zBase ){ -+ pM->zText = malloc(pM->nAlloc); -+ if( pM->zText && pM->nChar ) memcpy(pM->zText,pM->zBase,pM->nChar); -+ }else{ -+ pM->zText = realloc(pM->zText, pM->nAlloc); -+ } -+ } -+ if( pM->zText ){ -+ memcpy(&pM->zText[pM->nChar], zNewText, nNewChar); -+ pM->nChar += nNewChar; -+ pM->zText[pM->nChar] = 0; -+ } -+} -+#endif -+ -+/* -+** mprintf() works like printf(), but allocations memory to hold the -+** resulting string and returns a pointer to the allocated memory. -+** -+** We changed the name to TclMPrint() to conform with the Tcl private -+** routine naming conventions. -+*/ -+ -+#ifdef F_mprintf -+char *mprintf(const char *zFormat, ...){ -+ va_list ap; -+ struct sgMprintf sMprintf; -+ char *zNew; -+ char zBuf[200]; -+ -+ va_start(ap,zFormat); -+ sMprintf.nChar = 0; -+ sMprintf.nAlloc = sizeof(zBuf); -+ sMprintf.zText = zBuf; -+ sMprintf.zBase = zBuf; -+ vxprintf(__mout,&sMprintf,zFormat,ap); -+ va_end(ap); -+ if( sMprintf.zText==sMprintf.zBase ){ -+ zNew = malloc( sMprintf.nChar+1 ); -+ if( zNew ) strcpy(zNew,zBuf); -+ }else{ -+ zNew = realloc(sMprintf.zText,sMprintf.nChar+1); -+ } -+ -+ return zNew; -+} -+#endif -+ -+/* This is the varargs version of mprintf. -+** -+** The name is changed to TclVMPrintf() to conform with Tcl naming -+** conventions. -+*/ -+#ifdef F_vmprintf -+char *vmprintf(const char *zFormat,va_list ap){ -+ struct sgMprintf sMprintf; -+ char zBuf[200]; -+ sMprintf.nChar = 0; -+ sMprintf.zText = zBuf; -+ sMprintf.nAlloc = sizeof(zBuf); -+ sMprintf.zBase = zBuf; -+ vxprintf(__mout,&sMprintf,zFormat,ap); -+ if( sMprintf.zText==sMprintf.zBase ){ -+ sMprintf.zText = malloc( strlen(zBuf)+1 ); -+ if( sMprintf.zText ) strcpy(sMprintf.zText,zBuf); -+ }else{ -+ sMprintf.zText = realloc(sMprintf.zText,sMprintf.nChar+1); -+ } -+ return sMprintf.zText; -+} -+#endif -+ -+#ifdef F_asprintf -+int asprintf(char ** strp, const char *zFormat, ...){ -+ va_list ap; -+ struct sgMprintf sMprintf; -+ char *zNew; -+ char zBuf[200]; -+ -+ va_start(ap,zFormat); -+ sMprintf.nChar = 0; -+ sMprintf.nAlloc = sizeof(zBuf); -+ sMprintf.zText = zBuf; -+ sMprintf.zBase = zBuf; -+ vxprintf(__mout,&sMprintf,zFormat,ap); -+ va_end(ap); -+ if( sMprintf.zText==sMprintf.zBase ){ -+ zNew = malloc( sMprintf.nChar+1 ); -+ if( zNew ) strcpy(zNew,zBuf); -+ }else{ -+ zNew = realloc(sMprintf.zText,sMprintf.nChar+1); -+ } -+ -+ *strp = zNew; -+ -+ return sMprintf.nChar+1; -+} -+#endif -+ -+#ifdef F_vasprintf -+int vasprintf(char **strp, const char *format, va_list ap) { -+ struct sgMprintf sMprintf; -+ char zBuf[200]; -+ sMprintf.nChar = 0; -+ sMprintf.zText = zBuf; -+ sMprintf.nAlloc = sizeof(zBuf); -+ sMprintf.zBase = zBuf; -+ vxprintf(__mout,&sMprintf,format,ap); -+ if( sMprintf.zText==sMprintf.zBase ){ -+ sMprintf.zText = malloc( strlen(zBuf)+1 ); -+ if( sMprintf.zText ) strcpy(sMprintf.zText,zBuf); -+ }else{ -+ sMprintf.zText = realloc(sMprintf.zText,sMprintf.nChar+1); -+ } -+ *strp = sMprintf.zText; -+ return sMprintf.nChar; -+} -+#endif -+ -+/* -+** The following section of code handles the standard fprintf routines -+** for pthreads. -+*/ -+ -+void __fout(char *, int, void *); -+ -+#ifdef F___fout -+void __fout(zNewText,nNewChar,arg) -+ char *zNewText; -+ int nNewChar; -+ void *arg; -+{ -+ fwrite(zNewText,1,nNewChar,(FILE*)arg); -+} -+#endif -+ -+#ifdef F_fprintf -+/* The public interface routines */ -+int fprintf(FILE *pOut, const char *zFormat, ...){ -+ va_list ap; -+ int retc; -+ -+ va_start(ap,zFormat); -+ retc = vxprintf(__fout,pOut,zFormat,ap); -+ va_end(ap); -+ return retc; -+} -+#endif -+ -+#ifdef F_vfprintf -+int vfprintf(FILE *pOut, const char *zFormat, va_list ap){ -+ return vxprintf(__fout,pOut,zFormat,ap); -+} -+#endif -+ -+ -+#ifdef F_printf -+int printf(const char *format, ...) -+{ -+ va_list args; -+ int ret; -+ -+ va_start(args, format); -+ ret = vprintf(format, args); -+ va_end(args); -+ -+ return ret; -+} -+#endif -+ -+#ifdef F_vprintf -+int vprintf(const char *format, va_list args) -+{ -+ return vxprintf(__fout, stdout, format, args); -+} -+#endif -+ -+#ifdef F__sprintf_r -+/* Idiotic kludge to get around newlib stupidity. tmpnam() calls this -+ directly, but since sprintf() above replaces newlib's sprintf() (and -+ _sprintf_r()) we have to define this in order to link tmpnam(). */ -+int _sprintf_r(struct _reent *unused, char *str, const char *format, ...) -+{ -+ va_list args; -+ struct s_strargument arg; -+ int ret; -+ -+ (void) unused; -+ arg.next = str; -+ arg.last = NULL; -+ -+ va_start(args, format); -+ ret = vxprintf(__sout, &arg, format, args); -+ va_end(args); -+ -+ return ret; -+} -+#endif -diff -burN orig.newlib-1.20.0/newlib/Makefile.am newlib-1.20.0/newlib/Makefile.am ---- orig.newlib-1.20.0/newlib/Makefile.am 2011-05-19 08:04:59.000000000 +0200 -+++ newlib-1.20.0/newlib/Makefile.am 2012-01-11 22:25:57.153249236 +0100 -@@ -283,6 +283,18 @@ - for i in $(srcdir)/libc/include/rpc/*.h; do \ - $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/rpc/`basename $$i`; \ - done; \ -+ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/netinet; \ -+ for i in $(srcdir)/libc/sys/$(sys_dir)/netinet/*.h; do \ -+ if [ -f $$i ]; then \ -+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/netinet/`basename $$i`; \ -+ else true; fi ; \ -+ done ; \ -+ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/arpa; \ -+ for i in $(srcdir)/libc/sys/$(sys_dir)/arpa/*.h; do \ -+ if [ -f $$i ]; then \ -+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/arpa/`basename $$i`; \ -+ else true; fi ; \ -+ done ; \ - $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/sys; \ - for i in $(srcdir)/libc/include/sys/*.h; do \ - $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \ -diff -burN orig.newlib-1.20.0/newlib/Makefile.in newlib-1.20.0/newlib/Makefile.in ---- orig.newlib-1.20.0/newlib/Makefile.in 2011-05-19 08:04:59.000000000 +0200 -+++ newlib-1.20.0/newlib/Makefile.in 2012-01-11 22:26:57.205559574 +0100 -@@ -990,6 +990,18 @@ - for i in $(srcdir)/libc/include/rpc/*.h; do \ - $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/rpc/`basename $$i`; \ - done; \ -+ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/netinet; \ -+ for i in $(srcdir)/libc/sys/$(sys_dir)/netinet/*.h; do \ -+ if [ -f $$i ]; then \ -+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/netinet/`basename $$i`; \ -+ else true; fi ; \ -+ done ; \ -+ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/arpa; \ -+ for i in $(srcdir)/libc/sys/$(sys_dir)/arpa/*.h; do \ -+ if [ -f $$i ]; then \ -+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/arpa/`basename $$i`; \ -+ else true; fi ; \ -+ done ; \ - $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/sys; \ - for i in $(srcdir)/libc/include/sys/*.h; do \ - $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \ diff --git a/scripts/004-newlib.sh b/scripts/004-newlib.sh index 7cc5917..d38782a 100755 --- a/scripts/004-newlib.sh +++ b/scripts/004-newlib.sh @@ -7,13 +7,13 @@ set -e NEWLIB_VERSION=1.20.0 +NEWLIB_VERSION_BRANCH=${NEWLIB_VERSION//./_} # Download the source code if it does not already exist. -download_and_extract "https://sourceware.org/pub/newlib/newlib-$NEWLIB_VERSION.tar.gz" newlib-"$NEWLIB_VERSION" +clone_git_repo 'https://github.com/pspdev/newlib' newlib-"$NEWLIB_VERSION" newlib-"$NEWLIB_VERSION_BRANCH"-PSP # Enter the source directory and patch the source code. cd newlib-"$NEWLIB_VERSION" -patch -p1 < ../../patches/newlib-"$NEWLIB_VERSION"-PSP.patch # Create and enter the build directory. mkdir build-psp From 928349123b55452d64c343e5f9381650759d103c Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Thu, 23 Apr 2020 17:38:28 +0200 Subject: [PATCH 28/30] Deleted GitLab CI --- .gitlab-ci.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index c109c00..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Although psptoolchain is not using GitLab, I'm considering creating a mirror -# on GitLab and the GitLab CI is by far the most powerful. I will be using this -# to run tests, at least locally before committing. ---- -image: topsekretpl/psptoolchain-ci:latest - -stages: - - build - -build-psptoolchain: - stage: build - script: - - dash ./toolchain-local.sh -j 4 - - tar cvf pspdev.tar pspdev - artifacts: - paths: - - pspdev.tar From 53e4e16fde35183d8edc44cd43b24839330426d8 Mon Sep 17 00:00:00 2001 From: Cadu VboxLF Date: Mon, 30 Oct 2017 18:46:40 -0200 Subject: [PATCH 29/30] Removed stale automake1.9 and added libtool-bin for "libtool" binary. --- prepare.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/prepare.sh b/prepare.sh index 5ae39a7..378d440 100755 --- a/prepare.sh +++ b/prepare.sh @@ -37,6 +37,7 @@ _EOF_ libreadline-dev \ libusb-dev \ libtool \ + libtool-bin \ subversion \ tcl \ texinfo \ @@ -77,6 +78,7 @@ _EOF_ libreadline-dev \ libusb-dev \ libtool \ + libtool-bin \ subversion \ tcl \ texinfo \ From ee729b75c3b8b8b350afccea765acfad6bdb5e9c Mon Sep 17 00:00:00 2001 From: Jakub Kaszycki Date: Thu, 23 Apr 2020 17:58:46 +0200 Subject: [PATCH 30/30] Upgraded to binutils 2.23.2. I upgraded to just the last version I could get before 2.24 because 2.24 was a nontrivial rewrite. Addressing 2.24 will be a matter of its own. --- ....1-PSP.patch => binutils-2.23.2-PSP.patch} | 148 +++++++++--------- scripts/001-binutils.sh | 2 +- 2 files changed, 75 insertions(+), 75 deletions(-) rename patches/{binutils-2.23.1-PSP.patch => binutils-2.23.2-PSP.patch} (97%) diff --git a/patches/binutils-2.23.1-PSP.patch b/patches/binutils-2.23.2-PSP.patch similarity index 97% rename from patches/binutils-2.23.1-PSP.patch rename to patches/binutils-2.23.2-PSP.patch index c40ceec..e9f98e8 100644 --- a/patches/binutils-2.23.1-PSP.patch +++ b/patches/binutils-2.23.2-PSP.patch @@ -1,6 +1,6 @@ -diff -NrU3 binutils-2.23.1/bfd/archures.c binutils-2.23.1-patched/bfd/archures.c ---- binutils-2.23.1/bfd/archures.c 2012-09-04 14:53:41.000000000 +0200 -+++ binutils-2.23.1-patched/bfd/archures.c 2019-04-11 22:51:02.981512599 +0200 +diff -NrU3 binutils-2.23.2/bfd/archures.c binutils-2.23.2-patched/bfd/archures.c +--- binutils-2.23.2/bfd/archures.c 2012-09-04 14:53:41.000000000 +0200 ++++ binutils-2.23.2-patched/bfd/archures.c 2020-04-23 17:57:30.297522944 +0200 @@ -175,6 +175,7 @@ .#define bfd_mach_mips_loongson_2f 3002 .#define bfd_mach_mips_loongson_3a 3003 @@ -9,9 +9,9 @@ diff -NrU3 binutils-2.23.1/bfd/archures.c binutils-2.23.1-patched/bfd/archures.c .#define bfd_mach_mips_octeon 6501 .#define bfd_mach_mips_octeonp 6601 .#define bfd_mach_mips_octeon2 6502 -diff -NrU3 binutils-2.23.1/bfd/bfd-in2.h binutils-2.23.1-patched/bfd/bfd-in2.h ---- binutils-2.23.1/bfd/bfd-in2.h 2012-09-04 14:53:41.000000000 +0200 -+++ binutils-2.23.1-patched/bfd/bfd-in2.h 2019-04-11 22:51:02.985512583 +0200 +diff -NrU3 binutils-2.23.2/bfd/bfd-in2.h binutils-2.23.2-patched/bfd/bfd-in2.h +--- binutils-2.23.2/bfd/bfd-in2.h 2012-09-04 14:53:41.000000000 +0200 ++++ binutils-2.23.2-patched/bfd/bfd-in2.h 2020-04-23 17:57:30.297522944 +0200 @@ -1904,6 +1904,7 @@ #define bfd_mach_mips_loongson_2f 3002 #define bfd_mach_mips_loongson_3a 3003 @@ -20,9 +20,9 @@ diff -NrU3 binutils-2.23.1/bfd/bfd-in2.h binutils-2.23.1-patched/bfd/bfd-in2.h #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -diff -NrU3 binutils-2.23.1/bfd/cpu-mips.c binutils-2.23.1-patched/bfd/cpu-mips.c ---- binutils-2.23.1/bfd/cpu-mips.c 2012-01-31 18:54:35.000000000 +0100 -+++ binutils-2.23.1-patched/bfd/cpu-mips.c 2019-04-11 22:51:02.985512583 +0200 +diff -NrU3 binutils-2.23.2/bfd/cpu-mips.c binutils-2.23.2-patched/bfd/cpu-mips.c +--- binutils-2.23.2/bfd/cpu-mips.c 2012-01-31 18:54:35.000000000 +0100 ++++ binutils-2.23.2-patched/bfd/cpu-mips.c 2020-04-23 17:57:30.297522944 +0200 @@ -90,6 +90,7 @@ I_mipsisa64, I_mipsisa64r2, @@ -39,9 +39,9 @@ diff -NrU3 binutils-2.23.1/bfd/cpu-mips.c binutils-2.23.1-patched/bfd/cpu-mips.c N (64, 64, bfd_mach_mips_loongson_2e, "mips:loongson_2e", FALSE, NN(I_loongson_2e)), N (64, 64, bfd_mach_mips_loongson_2f, "mips:loongson_2f", FALSE, NN(I_loongson_2f)), N (64, 64, bfd_mach_mips_loongson_3a, "mips:loongson_3a", FALSE, NN(I_loongson_3a)), -diff -NrU3 binutils-2.23.1/bfd/doc/bfd.texinfo binutils-2.23.1-patched/bfd/doc/bfd.texinfo ---- binutils-2.23.1/bfd/doc/bfd.texinfo 2010-10-28 13:40:25.000000000 +0200 -+++ binutils-2.23.1-patched/bfd/doc/bfd.texinfo 2019-04-11 22:51:02.985512583 +0200 +diff -NrU3 binutils-2.23.2/bfd/doc/bfd.texinfo binutils-2.23.2-patched/bfd/doc/bfd.texinfo +--- binutils-2.23.2/bfd/doc/bfd.texinfo 2010-10-28 13:40:25.000000000 +0200 ++++ binutils-2.23.2-patched/bfd/doc/bfd.texinfo 2020-04-23 17:57:30.297522944 +0200 @@ -321,9 +321,9 @@ @unnumbered BFD Index @printindex cp @@ -63,10 +63,10 @@ diff -NrU3 binutils-2.23.1/bfd/doc/bfd.texinfo binutils-2.23.1-patched/bfd/doc/b +@c Blame: doc@cygnus.com, 28mar91. @bye -diff -NrU3 binutils-2.23.1/bfd/elfxx-mips.c binutils-2.23.1-patched/bfd/elfxx-mips.c ---- binutils-2.23.1/bfd/elfxx-mips.c 2012-09-04 16:19:46.000000000 +0200 -+++ binutils-2.23.1-patched/bfd/elfxx-mips.c 2019-04-11 22:51:02.985512583 +0200 -@@ -6275,14 +6275,19 @@ +diff -NrU3 binutils-2.23.2/bfd/elfxx-mips.c binutils-2.23.2-patched/bfd/elfxx-mips.c +--- binutils-2.23.2/bfd/elfxx-mips.c 2013-03-25 09:06:20.000000000 +0100 ++++ binutils-2.23.2-patched/bfd/elfxx-mips.c 2020-04-23 17:57:30.299522934 +0200 +@@ -6271,14 +6271,19 @@ case E_MIPS_MACH_SB1: return bfd_mach_mips_sb1; @@ -86,7 +86,7 @@ diff -NrU3 binutils-2.23.1/bfd/elfxx-mips.c binutils-2.23.1-patched/bfd/elfxx-mi case E_MIPS_MACH_OCTEON2: return bfd_mach_mips_octeon2; -@@ -11031,6 +11036,10 @@ +@@ -11027,6 +11032,10 @@ val = E_MIPS_ARCH_64 | E_MIPS_MACH_SB1; break; @@ -97,7 +97,7 @@ diff -NrU3 binutils-2.23.1/bfd/elfxx-mips.c binutils-2.23.1-patched/bfd/elfxx-mi case bfd_mach_mips_loongson_3a: val = E_MIPS_ARCH_64 | E_MIPS_MACH_LS3A; break; -@@ -13690,6 +13699,7 @@ +@@ -13686,6 +13695,7 @@ /* MIPS II extensions. */ { bfd_mach_mips4000, bfd_mach_mips6000 }, { bfd_mach_mipsisa32, bfd_mach_mips6000 }, @@ -105,9 +105,9 @@ diff -NrU3 binutils-2.23.1/bfd/elfxx-mips.c binutils-2.23.1-patched/bfd/elfxx-mi /* MIPS I extensions. */ { bfd_mach_mips6000, bfd_mach_mips3000 }, -diff -NrU3 binutils-2.23.1/binutils/readelf.c binutils-2.23.1-patched/binutils/readelf.c ---- binutils-2.23.1/binutils/readelf.c 2012-11-05 17:27:35.000000000 +0100 -+++ binutils-2.23.1-patched/binutils/readelf.c 2019-04-11 22:51:02.985512583 +0200 +diff -NrU3 binutils-2.23.2/binutils/readelf.c binutils-2.23.2-patched/binutils/readelf.c +--- binutils-2.23.2/binutils/readelf.c 2013-03-25 09:06:21.000000000 +0100 ++++ binutils-2.23.2-patched/binutils/readelf.c 2020-04-23 17:57:30.299522934 +0200 @@ -2431,10 +2431,11 @@ case E_MIPS_MACH_9000: strcat (buf, ", 9000"); break; case E_MIPS_MACH_LS2E: strcat (buf, ", loongson-2e"); break; @@ -121,9 +121,9 @@ diff -NrU3 binutils-2.23.1/binutils/readelf.c binutils-2.23.1-patched/binutils/r case 0: /* We simply ignore the field in this case to avoid confusion: MIPS ELF does not specify EF_MIPS_MACH, it is a GNU -diff -NrU3 binutils-2.23.1/config.sub binutils-2.23.1-patched/config.sub ---- binutils-2.23.1/config.sub 2012-04-25 17:53:25.000000000 +0200 -+++ binutils-2.23.1-patched/config.sub 2019-04-11 22:51:02.985512583 +0200 +diff -NrU3 binutils-2.23.2/config.sub binutils-2.23.2-patched/config.sub +--- binutils-2.23.2/config.sub 2012-04-25 17:53:25.000000000 +0200 ++++ binutils-2.23.2-patched/config.sub 2020-04-23 17:57:30.301522924 +0200 @@ -292,6 +292,7 @@ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ @@ -151,9 +151,9 @@ diff -NrU3 binutils-2.23.1/config.sub binutils-2.23.1-patched/config.sub mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; -diff -NrU3 binutils-2.23.1/configure binutils-2.23.1-patched/configure ---- binutils-2.23.1/configure 2012-06-28 13:50:52.000000000 +0200 -+++ binutils-2.23.1-patched/configure 2019-04-11 22:51:02.989512565 +0200 +diff -NrU3 binutils-2.23.2/configure binutils-2.23.2-patched/configure +--- binutils-2.23.2/configure 2012-06-28 13:50:52.000000000 +0200 ++++ binutils-2.23.2-patched/configure 2020-04-23 17:57:30.323522816 +0200 @@ -2674,7 +2674,7 @@ # binutils, gas and ld appear in that order because it makes sense to run # "make check" in that particular order. @@ -171,9 +171,9 @@ diff -NrU3 binutils-2.23.1/configure binutils-2.23.1-patched/configure ;; sh-*-* | sh64-*-*) case "${target}" in -diff -NrU3 binutils-2.23.1/gas/config/tc-mips.c binutils-2.23.1-patched/gas/config/tc-mips.c ---- binutils-2.23.1/gas/config/tc-mips.c 2012-09-04 16:21:03.000000000 +0200 -+++ binutils-2.23.1-patched/gas/config/tc-mips.c 2019-04-11 22:51:02.989512565 +0200 +diff -NrU3 binutils-2.23.2/gas/config/tc-mips.c binutils-2.23.2-patched/gas/config/tc-mips.c +--- binutils-2.23.2/gas/config/tc-mips.c 2012-09-04 16:21:03.000000000 +0200 ++++ binutils-2.23.2-patched/gas/config/tc-mips.c 2020-04-23 17:57:30.325522805 +0200 @@ -91,8 +91,32 @@ #define ZERO 0 @@ -2021,9 +2021,9 @@ diff -NrU3 binutils-2.23.1/gas/config/tc-mips.c binutils-2.23.1-patched/gas/conf /* MIPS III */ { "r4000", 0, ISA_MIPS3, CPU_R4000 }, -diff -NrU3 binutils-2.23.1/gas/configure binutils-2.23.1-patched/gas/configure ---- binutils-2.23.1/gas/configure 2012-06-18 06:43:06.000000000 +0200 -+++ binutils-2.23.1-patched/gas/configure 2019-04-11 22:51:02.989512565 +0200 +diff -NrU3 binutils-2.23.2/gas/configure binutils-2.23.2-patched/gas/configure +--- binutils-2.23.2/gas/configure 2012-06-18 06:43:06.000000000 +0200 ++++ binutils-2.23.2-patched/gas/configure 2020-04-23 17:57:30.327522796 +0200 @@ -12046,6 +12046,9 @@ mips64vr | mips64vrel) mips_cpu=vr4100 @@ -2034,9 +2034,9 @@ diff -NrU3 binutils-2.23.1/gas/configure binutils-2.23.1-patched/gas/configure mipsisa32r2* | mipsisa64r2*) mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'` ;; -diff -NrU3 binutils-2.23.1/gas/configure.in binutils-2.23.1-patched/gas/configure.in ---- binutils-2.23.1/gas/configure.in 2012-11-05 17:27:44.000000000 +0100 -+++ binutils-2.23.1-patched/gas/configure.in 2019-04-11 22:51:02.993512548 +0200 +diff -NrU3 binutils-2.23.2/gas/configure.in binutils-2.23.2-patched/gas/configure.in +--- binutils-2.23.2/gas/configure.in 2012-11-05 17:27:44.000000000 +0100 ++++ binutils-2.23.2-patched/gas/configure.in 2020-04-23 17:57:30.327522796 +0200 @@ -222,6 +222,9 @@ mips64vr | mips64vrel) mips_cpu=vr4100 @@ -2047,9 +2047,9 @@ diff -NrU3 binutils-2.23.1/gas/configure.in binutils-2.23.1-patched/gas/configur mipsisa32r2* | mipsisa64r2*) changequote(,)dnl mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'` -diff -NrU3 binutils-2.23.1/gas/testsuite/gas/mips/mips.exp binutils-2.23.1-patched/gas/testsuite/gas/mips/mips.exp ---- binutils-2.23.1/gas/testsuite/gas/mips/mips.exp 2012-09-04 16:17:13.000000000 +0200 -+++ binutils-2.23.1-patched/gas/testsuite/gas/mips/mips.exp 2019-04-11 22:51:02.993512548 +0200 +diff -NrU3 binutils-2.23.2/gas/testsuite/gas/mips/mips.exp binutils-2.23.2-patched/gas/testsuite/gas/mips/mips.exp +--- binutils-2.23.2/gas/testsuite/gas/mips/mips.exp 2012-09-04 16:17:13.000000000 +0200 ++++ binutils-2.23.2-patched/gas/testsuite/gas/mips/mips.exp 2020-04-23 17:57:30.327522796 +0200 @@ -432,6 +432,9 @@ mips_arch_create sb1 64 mips64 { mips3d } \ { -march=sb1 -mtune=sb1 } { -mmips:sb1 } \ @@ -2060,9 +2060,9 @@ diff -NrU3 binutils-2.23.1/gas/testsuite/gas/mips/mips.exp binutils-2.23.1-patch mips_arch_create octeon 64 mips64r2 {} \ { -march=octeon -mtune=octeon } { -mmips:octeon } \ { mips64octeon*-*-* } -diff -NrU3 binutils-2.23.1/include/elf/common.h binutils-2.23.1-patched/include/elf/common.h ---- binutils-2.23.1/include/elf/common.h 2012-09-04 14:53:47.000000000 +0200 -+++ binutils-2.23.1-patched/include/elf/common.h 2019-04-11 22:51:02.993512548 +0200 +diff -NrU3 binutils-2.23.2/include/elf/common.h binutils-2.23.2-patched/include/elf/common.h +--- binutils-2.23.2/include/elf/common.h 2012-09-04 14:53:47.000000000 +0200 ++++ binutils-2.23.2-patched/include/elf/common.h 2020-04-23 17:57:30.327522796 +0200 @@ -96,6 +96,7 @@ #define ET_HIOS 0xFEFF /* Operating system-specific */ #define ET_LOPROC 0xFF00 /* Processor-specific */ @@ -2071,9 +2071,9 @@ diff -NrU3 binutils-2.23.1/include/elf/common.h binutils-2.23.1-patched/include/ /* Values for e_machine, which identifies the architecture. These numbers are officially assigned by registry@sco.com. See below for a list of -diff -NrU3 binutils-2.23.1/include/elf/mips.h binutils-2.23.1-patched/include/elf/mips.h ---- binutils-2.23.1/include/elf/mips.h 2011-12-19 08:58:02.000000000 +0100 -+++ binutils-2.23.1-patched/include/elf/mips.h 2019-04-11 22:51:02.993512548 +0200 +diff -NrU3 binutils-2.23.2/include/elf/mips.h binutils-2.23.2-patched/include/elf/mips.h +--- binutils-2.23.2/include/elf/mips.h 2011-12-19 08:58:02.000000000 +0100 ++++ binutils-2.23.2-patched/include/elf/mips.h 2020-04-23 17:57:30.327522796 +0200 @@ -272,6 +272,7 @@ #define E_MIPS_MACH_5400 0x00910000 #define E_MIPS_MACH_5500 0x00980000 @@ -2082,9 +2082,9 @@ diff -NrU3 binutils-2.23.1/include/elf/mips.h binutils-2.23.1-patched/include/el #define E_MIPS_MACH_LS2E 0x00A00000 #define E_MIPS_MACH_LS2F 0x00A10000 #define E_MIPS_MACH_LS3A 0x00A20000 -diff -NrU3 binutils-2.23.1/include/opcode/mips.h binutils-2.23.1-patched/include/opcode/mips.h ---- binutils-2.23.1/include/opcode/mips.h 2012-09-04 16:21:05.000000000 +0200 -+++ binutils-2.23.1-patched/include/opcode/mips.h 2019-04-11 22:51:02.993512548 +0200 +diff -NrU3 binutils-2.23.2/include/opcode/mips.h binutils-2.23.2-patched/include/opcode/mips.h +--- binutils-2.23.2/include/opcode/mips.h 2012-09-04 16:21:05.000000000 +0200 ++++ binutils-2.23.2-patched/include/opcode/mips.h 2020-04-23 17:57:30.327522796 +0200 @@ -218,6 +218,228 @@ #define MDMX_FMTSEL_VEC_QH 0x15 #define MDMX_FMTSEL_VEC_OB 0x16 @@ -2451,9 +2451,9 @@ diff -NrU3 binutils-2.23.1/include/opcode/mips.h binutils-2.23.1-patched/include M_XOR_I, M_COP0, M_COP1, -diff -NrU3 binutils-2.23.1/include/opcode/vfpu.h binutils-2.23.1-patched/include/opcode/vfpu.h ---- binutils-2.23.1/include/opcode/vfpu.h 1970-01-01 01:00:00.000000000 +0100 -+++ binutils-2.23.1-patched/include/opcode/vfpu.h 2019-04-11 22:51:02.993512548 +0200 +diff -NrU3 binutils-2.23.2/include/opcode/vfpu.h binutils-2.23.2-patched/include/opcode/vfpu.h +--- binutils-2.23.2/include/opcode/vfpu.h 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.23.2-patched/include/opcode/vfpu.h 2020-04-23 17:57:30.329522786 +0200 @@ -0,0 +1,261 @@ +#ifndef _VFPU_H_ +#define _VFPU_H_ @@ -2716,9 +2716,9 @@ diff -NrU3 binutils-2.23.1/include/opcode/vfpu.h binutils-2.23.1-patched/include +#define VFPU_MASK_SYNC 0xffff0000 + +#endif /* _VFPU_H_ */ -diff -NrU3 binutils-2.23.1/ld/configure.tgt binutils-2.23.1-patched/ld/configure.tgt ---- binutils-2.23.1/ld/configure.tgt 2012-09-04 14:53:47.000000000 +0200 -+++ binutils-2.23.1-patched/ld/configure.tgt 2019-04-11 22:51:02.993512548 +0200 +diff -NrU3 binutils-2.23.2/ld/configure.tgt binutils-2.23.2-patched/ld/configure.tgt +--- binutils-2.23.2/ld/configure.tgt 2012-09-04 14:53:47.000000000 +0200 ++++ binutils-2.23.2-patched/ld/configure.tgt 2020-04-23 17:57:30.329522786 +0200 @@ -422,6 +422,8 @@ mips*vr4100-*-elf*) targ_emul=elf32b4300 ;; mips*vr5000el-*-elf*) targ_emul=elf32l4300 ;; @@ -2728,9 +2728,9 @@ diff -NrU3 binutils-2.23.1/ld/configure.tgt binutils-2.23.1-patched/ld/configure mips*el-sde-elf*) targ_emul=elf32ltsmip targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" ;; mips*-sde-elf*) targ_emul=elf32btsmip -diff -NrU3 binutils-2.23.1/ld/emulparams/elf_mipsallegrexel_psp.sh binutils-2.23.1-patched/ld/emulparams/elf_mipsallegrexel_psp.sh ---- binutils-2.23.1/ld/emulparams/elf_mipsallegrexel_psp.sh 1970-01-01 01:00:00.000000000 +0100 -+++ binutils-2.23.1-patched/ld/emulparams/elf_mipsallegrexel_psp.sh 2019-04-11 22:51:02.993512548 +0200 +diff -NrU3 binutils-2.23.2/ld/emulparams/elf_mipsallegrexel_psp.sh binutils-2.23.2-patched/ld/emulparams/elf_mipsallegrexel_psp.sh +--- binutils-2.23.2/ld/emulparams/elf_mipsallegrexel_psp.sh 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.23.2-patched/ld/emulparams/elf_mipsallegrexel_psp.sh 2020-04-23 17:57:30.329522786 +0200 @@ -0,0 +1,22 @@ +# Based off of the default elf32 MIPS target. However, we use a seperate +# script template because the PSP architecture defines sections that normally @@ -2754,9 +2754,9 @@ diff -NrU3 binutils-2.23.1/ld/emulparams/elf_mipsallegrexel_psp.sh binutils-2.23 + +# Discard the .comment and .pdr sections. +OTHER_SECTIONS="/DISCARD/ : { *(.comment) *(.pdr) }" -diff -NrU3 binutils-2.23.1/ld/Makefile.am binutils-2.23.1-patched/ld/Makefile.am ---- binutils-2.23.1/ld/Makefile.am 2012-09-04 14:53:47.000000000 +0200 -+++ binutils-2.23.1-patched/ld/Makefile.am 2019-04-11 22:51:02.993512548 +0200 +diff -NrU3 binutils-2.23.2/ld/Makefile.am binutils-2.23.2-patched/ld/Makefile.am +--- binutils-2.23.2/ld/Makefile.am 2013-03-25 09:06:23.000000000 +0100 ++++ binutils-2.23.2-patched/ld/Makefile.am 2020-04-23 17:57:30.329522786 +0200 @@ -268,6 +268,7 @@ eelf_i386_nacl.c \ eelf_i386_sol2.c \ @@ -2765,7 +2765,7 @@ diff -NrU3 binutils-2.23.1/ld/Makefile.am binutils-2.23.1-patched/ld/Makefile.am eelf_s390.c \ egld960.c \ egld960coff.c \ -@@ -1240,6 +1241,9 @@ +@@ -1242,6 +1243,9 @@ $(srcdir)/emulparams/vxworks.sh $(srcdir)/emultempl/vxworks.em \ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_i386_vxworks "$(tdir_elf_i386_vxworks)" @@ -2775,9 +2775,9 @@ diff -NrU3 binutils-2.23.1/ld/Makefile.am binutils-2.23.1-patched/ld/Makefile.am eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)" -diff -NrU3 binutils-2.23.1/ld/Makefile.in binutils-2.23.1-patched/ld/Makefile.in ---- binutils-2.23.1/ld/Makefile.in 2012-09-04 14:53:47.000000000 +0200 -+++ binutils-2.23.1-patched/ld/Makefile.in 2019-04-11 22:51:02.993512548 +0200 +diff -NrU3 binutils-2.23.2/ld/Makefile.in binutils-2.23.2-patched/ld/Makefile.in +--- binutils-2.23.2/ld/Makefile.in 2013-03-25 09:06:23.000000000 +0100 ++++ binutils-2.23.2-patched/ld/Makefile.in 2020-04-23 17:57:30.329522786 +0200 @@ -575,6 +575,7 @@ eelf_i386_nacl.c \ eelf_i386_sol2.c \ @@ -2786,7 +2786,7 @@ diff -NrU3 binutils-2.23.1/ld/Makefile.in binutils-2.23.1-patched/ld/Makefile.in eelf_s390.c \ egld960.c \ egld960coff.c \ -@@ -2710,6 +2711,9 @@ +@@ -2712,6 +2713,9 @@ $(srcdir)/emulparams/vxworks.sh $(srcdir)/emultempl/vxworks.em \ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_i386_vxworks "$(tdir_elf_i386_vxworks)" @@ -2796,9 +2796,9 @@ diff -NrU3 binutils-2.23.1/ld/Makefile.in binutils-2.23.1-patched/ld/Makefile.in eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)" -diff -NrU3 binutils-2.23.1/ld/scripttempl/elf_psp.sc binutils-2.23.1-patched/ld/scripttempl/elf_psp.sc ---- binutils-2.23.1/ld/scripttempl/elf_psp.sc 1970-01-01 01:00:00.000000000 +0100 -+++ binutils-2.23.1-patched/ld/scripttempl/elf_psp.sc 2019-04-11 22:51:02.993512548 +0200 +diff -NrU3 binutils-2.23.2/ld/scripttempl/elf_psp.sc binutils-2.23.2-patched/ld/scripttempl/elf_psp.sc +--- binutils-2.23.2/ld/scripttempl/elf_psp.sc 1970-01-01 01:00:00.000000000 +0100 ++++ binutils-2.23.2-patched/ld/scripttempl/elf_psp.sc 2020-04-23 17:57:30.329522786 +0200 @@ -0,0 +1,496 @@ +# +# Unusual variables checked by this code: @@ -3296,9 +3296,9 @@ diff -NrU3 binutils-2.23.1/ld/scripttempl/elf_psp.sc binutils-2.23.1-patched/ld/ + ${RELOCATING+${STACKNOTE}} +} +EOF -diff -NrU3 binutils-2.23.1/opcodes/mips-dis.c binutils-2.23.1-patched/opcodes/mips-dis.c ---- binutils-2.23.1/opcodes/mips-dis.c 2012-09-04 16:23:13.000000000 +0200 -+++ binutils-2.23.1-patched/opcodes/mips-dis.c 2019-04-11 22:51:41.193350688 +0200 +diff -NrU3 binutils-2.23.2/opcodes/mips-dis.c binutils-2.23.2-patched/opcodes/mips-dis.c +--- binutils-2.23.2/opcodes/mips-dis.c 2012-09-04 16:23:13.000000000 +0200 ++++ binutils-2.23.2-patched/opcodes/mips-dis.c 2020-04-23 17:57:30.329522786 +0200 @@ -245,6 +245,139 @@ "c0_taglo", "c0_taghi", "c0_errorepc", "c0_desave", }; @@ -3862,9 +3862,9 @@ diff -NrU3 binutils-2.23.1/opcodes/mips-dis.c binutils-2.23.1-patched/opcodes/mi default: /* xgettext:c-format */ infprintf (is, _("# internal error, undefined modifier (%c)"), *d); -diff -NrU3 binutils-2.23.1/opcodes/mips-opc.c binutils-2.23.1-patched/opcodes/mips-opc.c ---- binutils-2.23.1/opcodes/mips-opc.c 2012-09-04 16:21:10.000000000 +0200 -+++ binutils-2.23.1-patched/opcodes/mips-opc.c 2019-04-11 22:51:02.993512548 +0200 +diff -NrU3 binutils-2.23.2/opcodes/mips-opc.c binutils-2.23.2-patched/opcodes/mips-opc.c +--- binutils-2.23.2/opcodes/mips-opc.c 2012-09-04 16:21:10.000000000 +0200 ++++ binutils-2.23.2-patched/opcodes/mips-opc.c 2020-04-23 17:57:30.331522776 +0200 @@ -122,9 +122,10 @@ #define N5 (INSN_5400 | INSN_5500) #define N54 INSN_5400 diff --git a/scripts/001-binutils.sh b/scripts/001-binutils.sh index 13daf88..9b7d447 100755 --- a/scripts/001-binutils.sh +++ b/scripts/001-binutils.sh @@ -3,7 +3,7 @@ . ../common.sh -BINUTILS_VERSION=2.23.1 +BINUTILS_VERSION=2.23.2 # Exit on errors set -e