diff options
author | Florian Boor <florian.boor@kernelconcepts.de> | 2008-07-22 17:31:37 +0000 |
---|---|---|
committer | Florian Boor <florian.boor@kernelconcepts.de> | 2008-07-22 17:31:37 +0000 |
commit | d65f1724834111db986f7a13807a809c57b71496 (patch) | |
tree | 569416fb59bf264cf535ca0bce912a5d65bf9072 | |
parent | fa4eb48f75758f1e38948a6e3539bcd0c1e40200 (diff) | |
parent | 721b1996622b7032acb6078f0a32d236901e6b3b (diff) |
merge of 'd99c8702df0201605c294d4a9f65791562789838'
and 'e4aab546c3b33577e2fb6bcfe199da5a98b4a9a3'
70 files changed, 13993 insertions, 1079 deletions
diff --git a/conf/distro/include/sane-srcrevs.inc b/conf/distro/include/sane-srcrevs.inc index de0f6a2a0f..cdd4c6f993 100644 --- a/conf/distro/include/sane-srcrevs.inc +++ b/conf/distro/include/sane-srcrevs.inc @@ -166,7 +166,7 @@ SRCREV_pn-settings-daemon ?= "2006" SRCREV_pn-sjf2410-linux-native ?= "4268" SRCREV_pn-sphyrna ?= "45" SRCREV_pn-tmut ?= "60" -SRCREV_pn-u-boot-openmoko ?= "4297" +SRCREV_pn-u-boot-openmoko ?= "ba029a1426bfca169572bf80d50a8b190a6b0e19" SRCREV_pn-u-boot-openmoko-devel ?= "ba029a1426bfca169572bf80d50a8b190a6b0e19" SRCREV_pn-usbpath ?= "3172" SRCREV_pn-usbpath-native ?= "3172" diff --git a/conf/machine/at91-l9260.conf b/conf/machine/at91-l9260.conf new file mode 100644 index 0000000000..16d0705a24 --- /dev/null +++ b/conf/machine/at91-l9260.conf @@ -0,0 +1,24 @@ +#@TYPE: Machine +#@Name: Olimex eval board for the AT91SAM9260 +#@DESCRIPTION: Machine.inciguration for the AT91SAM9260 development board with a at91sam9260 processor + +TARGET_ARCH = "arm" +PACKAGE_EXTRA_ARCHS = "armv4t armv5te" + +PREFERRED_PROVIDER_virtual/kernel = "linux" +PREFERRED_VERSION_linux = "2.6.25" +PREFERRED_PROVIDER_xserver = "xserver-kdrive" + +KERNEL_IMAGETYPE = "uImage" + +#don't try to access tty1 +USE_VT = "0" + +MACHINE_FEATURES = "kernel26 alsa ext2 usbhost usbgadget" + +# used by sysvinit_2 +SERIAL_CONSOLE = "115200 ttyS0" +IMAGE_FSTYPES ?= "jffs2" +EXTRA_IMAGECMD_jffs2 = "--pad --little-endian --eraseblock=0x20000 -n" + +require conf/machine/include/tune-arm926ejs.inc diff --git a/conf/machine/neuros-osd2.conf b/conf/machine/neuros-osd2.conf index 89e14ce363..75937627cd 100644 --- a/conf/machine/neuros-osd2.conf +++ b/conf/machine/neuros-osd2.conf @@ -29,3 +29,4 @@ MACHINE_FEATURES = "kernel26 pcmcia usbhost screen" require conf/machine/include/tune-arm926ejs.inc require conf/machine/include/neuros.inc +MACHINE_EXTRA_RRECOMMENDS = " dsplink-cmemk-module dsplink-module" diff --git a/contrib/python/generate-manifest-2.5.py b/contrib/python/generate-manifest-2.5.py index 8f1ee88937..08a8a47f15 100755 --- a/contrib/python/generate-manifest-2.5.py +++ b/contrib/python/generate-manifest-2.5.py @@ -13,7 +13,7 @@ VERSION = "2.5.2" BASEREV = 0 __author__ = "Michael 'Mickey' Lauer <mlauer@vanille-media.de>" -__version__ = "20080306" +__version__ = "20080722" class MakefileMaker: @@ -22,14 +22,9 @@ class MakefileMaker: self.packages = {} self.targetPrefix = "${libdir}/python%s/" % VERSION[:3] self.output = outfile - self.out( "#" * 120 ) - self.out( "### AUTO-GENERATED by '%s' [(C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>] on %s" % ( sys.argv[0], time.asctime() ) ) - self.out( "###" ) - self.out( "### Visit THE Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy" ) - self.out( "###" ) - self.out( "### Warning: Manual edits will be lost!" ) - self.out( "###" ) - self.out( "#" * 120 ) + self.out( "# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file." ) + self.out( "# Generator: '%s' Version %s (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>" % ( sys.argv[0], __version__ ) ) + self.out( "# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy" ) # # helper functions # @@ -184,8 +179,8 @@ if __name__ == "__main__": m.addPackage( 0, "python-compiler", "Python Compiler Support", "python-core", "compiler" ) # package - m.addPackage( 0, "python-compression", "Python High Level Compression Support", "python-core python-zlib", - "gzip.* zipfile.*" ) + m.addPackage( 1, "python-compression", "Python High Level Compression Support", "python-core python-zlib", + "gzip.* zipfile.* tarfile.*" ) m.addPackage( 1, "python-crypt", "Python Basic Cryptographic and Hashing Support", "python-core", "hashlib.* md5.* sha.* lib-dynload/crypt.so lib-dynload/_hashlib.so lib-dynload/_sha256.so lib-dynload/_sha512.so" ) @@ -205,12 +200,18 @@ if __name__ == "__main__": m.addPackage( 0, "python-db", "Python File-Based Database Support", "python-core", "anydbm.* dumbdbm.* whichdb.* " ) - m.addPackage( 0, "python-debugger", "Python Debugger", "python-core python-io python-lang python-re python-stringold python-shell", + m.addPackage( 1, "python-debugger", "Python Debugger", "python-core python-io python-lang python-re python-stringold python-shell python-pprint", "bdb.* pdb.*" ) + m.addPackage( 0, "python-difflib", "Python helpers for computing deltas between objects.", "python-lang python-re", + "difflib.*" ) + m.addPackage( 0, "python-distutils", "Python Distribution Utilities", "python-core", "config distutils" ) # package + m.addPackage( 0, "python-doctest", "Python framework for running examples in docstrings.", "python-core python-lang python-io python-re python-unittest python-debugger python-difflib", + "doctest.*" ) + m.addPackage( 0, "python-email", "Python Email Support", "python-core python-io python-re python-mime python-audio python-image", "email" ) # package diff --git a/packages/alsa/alsa-oss_1.0.15.bb b/packages/alsa/alsa-oss_1.0.15.bb index 3cfe886d61..de840e73fe 100644 --- a/packages/alsa/alsa-oss_1.0.15.bb +++ b/packages/alsa/alsa-oss_1.0.15.bb @@ -2,7 +2,7 @@ DESCRIPTION = "Alsa OSS Compatibility Package" SECTION = "libs/multimedia" LICENSE = "GPL" DEPENDS = "alsa-lib" -PR = "1" +PR = "r2" SRC_URI = "ftp://ftp.alsa-project.org/pub/oss-lib/alsa-oss-${PV}.tar.bz2 \ file://libio.patch;patch=1 \ @@ -10,6 +10,8 @@ SRC_URI = "ftp://ftp.alsa-project.org/pub/oss-lib/alsa-oss-${PV}.tar.bz2 \ inherit autotools +LEAD_SONAME = "libaoss.so.0" + do_configure_prepend () { touch NEWS README AUTHORS ChangeLog } diff --git a/packages/alsa/files/libio.patch b/packages/alsa/files/libio.patch index 83345a98d3..a053e4c604 100644 --- a/packages/alsa/files/libio.patch +++ b/packages/alsa/files/libio.patch @@ -1,7 +1,7 @@ Index: alsa-oss-1.0.15/alsa/stdioemu.c =================================================================== --- alsa-oss-1.0.15.orig/alsa/stdioemu.c 2007-10-15 10:50:40.000000000 +0200 -+++ alsa-oss-1.0.15/alsa/stdioemu.c 2008-07-20 22:29:46.767474560 +0200 ++++ alsa-oss-1.0.15/alsa/stdioemu.c 2008-07-21 22:17:06.303161438 +0200 @@ -37,7 +37,9 @@ #endif @@ -18,8 +18,8 @@ Index: alsa-oss-1.0.15/alsa/stdioemu.c result = fopencookie (fdc,"w", fns); +#ifdef HAVE_FILENO result->_fileno = fdc->fd; /* ugly patchy slimy kludgy hack */ -+else -+ result->_filedes = fdc->fd; ++#else ++ result->__filedes = fdc->fd; +#endif } return result; @@ -27,7 +27,7 @@ Index: alsa-oss-1.0.15/alsa/stdioemu.c Index: alsa-oss-1.0.15/configure.in =================================================================== --- alsa-oss-1.0.15.orig/configure.in 2007-10-15 10:50:40.000000000 +0200 -+++ alsa-oss-1.0.15/configure.in 2008-07-20 22:49:45.455837502 +0200 ++++ alsa-oss-1.0.15/configure.in 2008-07-21 22:16:11.719837298 +0200 @@ -33,6 +33,12 @@ LIBS="$OLD_LIBS" fi diff --git a/packages/busybox/busybox_1.11.1.bb b/packages/busybox/busybox_1.11.1.bb index 67c52939cb..945ab7f718 100644 --- a/packages/busybox/busybox_1.11.1.bb +++ b/packages/busybox/busybox_1.11.1.bb @@ -1,18 +1,23 @@ require busybox.inc -PR = "r0" +PR = "r1" -SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \ - file://udhcpscript.patch;patch=1 \ - file://busybox-cron \ - file://busybox-httpd \ - file://busybox-udhcpd \ - file://default.script \ - file://hwclock.sh \ - file://mount.busybox \ - file://syslog \ - file://syslog.conf \ - file://umount.busybox \ - file://defconfig" +SRC_URI = "\ + http://www.busybox.net/downloads/busybox-${PV}.tar.gz \ + http://busybox.net/downloads/fixes-1.11.1/busybox-1.11.1-basename.patch;patch=1 \ + http://busybox.net/downloads/fixes-1.11.1/busybox-1.11.1-tar.patch;patch=1 \ + \ + file://udhcpscript.patch;patch=1 \ + file://busybox-cron \ + file://busybox-httpd \ + file://busybox-udhcpd \ + file://default.script \ + file://hwclock.sh \ + file://mount.busybox \ + file://syslog \ + file://syslog.conf \ + file://umount.busybox \ + file://defconfig \ +" EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX}" diff --git a/packages/dsplink/dsplink_1.51.00.08.bb b/packages/dsplink/dsplink_1.51.00.08.bb index 36ac50f4cf..b7f4c6f72b 100644 --- a/packages/dsplink/dsplink_1.51.00.08.bb +++ b/packages/dsplink/dsplink_1.51.00.08.bb @@ -1,5 +1,9 @@ require dsplink.inc + +DEFAULT_PREFERNECE = "-1" +DEFAULT_PREFERENCE_armv7a = "1" + PR = "r9" PE = "1" PV = "1.51" diff --git a/packages/ffmpeg/omapfbplay/fbplay-static.diff b/packages/ffmpeg/omapfbplay/fbplay-static.diff index 439fc6e6bb..f1f7015c2a 100644 --- a/packages/ffmpeg/omapfbplay/fbplay-static.diff +++ b/packages/ffmpeg/omapfbplay/fbplay-static.diff @@ -1,10 +1,10 @@ ---- /tmp/Makefile 2008-07-10 12:59:00.000000000 +0200 -+++ git/Makefile 2008-07-10 12:57:38.723198000 +0200 +--- /tmp/Makefile 2008-07-21 22:08:58.000000000 +0200 ++++ git/Makefile 2008-07-21 22:10:08.023198000 +0200 @@ -5,6 +5,6 @@ CFLAGS = -O3 -Wall -fomit-frame-pointer -mcpu=cortex-a8 -mfpu=neon \ -I$(LINUX)/include -I$(FFMPEG) LDFLAGS = -L$(FFMPEG)/libavcodec -L$(FFMPEG)/libavformat -L$(FFMPEG)/libavutil --LDLIBS = -lavformat -lavcodec -lavutil -lm -lz -lpthread -+LDLIBS = -lavformat -lavcodec -lavutil -lz -ldl -lbz2 -lfaac -lgsm -lmp3lame -lm -lpthread +-LDLIBS = -lavformat -lavcodec -lavutil -lm -lz -lpthread -lrt ++LDLIBS = -lavformat -lavcodec -lavutil -lz -ldl -lbz2 -lfaac -lgsm -lmp3lame -lm -lpthread -lrt all: omapfbplay diff --git a/packages/freesmartphone/frameworkd_git.bb b/packages/freesmartphone/frameworkd_git.bb index 20c655e98d..f26b0a282d 100644 --- a/packages/freesmartphone/frameworkd_git.bb +++ b/packages/freesmartphone/frameworkd_git.bb @@ -5,7 +5,7 @@ SECTION = "console/network" DEPENDS = "python-cython-native python-pyrex-native" LICENSE = "GPL" PV = "0.8.1+gitr${SRCREV}" -PR = "r9" +PR = "r10" inherit distutils update-rc.d @@ -34,7 +34,16 @@ RDEPENDS_${PN} += "\ python-pyyaml \ python-shell \ python-syslog \ + \ + ${PN}-config \ " -FILES_${PN} += "${sysconfdir} ${datadir}" + +PACKAGES =+ "${PN}-config" + +PACKAGE_ARCH_${PN}-config = "${MACHINE_ARCH}" +FILES_${PN}-config = "${sysconfdir}" + +PACKAGE_ARCH_${PN} = "${BASE_PACKAGE_ARCH}" +FILES_${PN} += "${datadir}" FILES_${PN}-dbg += "${libdir}/${PYTHON_DIR}/site-packages/framework/subsystems/*/.debug" diff --git a/packages/gcc/gcc-4.3.1.inc b/packages/gcc/gcc-4.3.1.inc index 3784727d9b..b14dd4acf5 100644 --- a/packages/gcc/gcc-4.3.1.inc +++ b/packages/gcc/gcc-4.3.1.inc @@ -45,7 +45,6 @@ SRC_URI = "ftp://ftp.gnu.org/pub/gnu/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \ file://904-flatten-switch-stmt-00.patch;patch=1 \ file://arm-nolibfloat.patch;patch=1 \ file://arm-softfloat.patch;patch=1 \ -# file://gcc41-configure.in.patch;patch=1 \ # file://arm-thumb.patch;patch=1 \ # file://arm-thumb-cache.patch;patch=1 \ file://ldflags.patch;patch=1 \ @@ -59,6 +58,8 @@ SRC_URI = "ftp://ftp.gnu.org/pub/gnu/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \ # file://intermask-bigendian.patch;patch=1 \ file://gcc-arm-frename-registers.patch;patch=1 \ file://gcc-release-branch/PR-36500-fix-neon.patch;patch=1 \ + file://gcc-4.3.1-SYSROOT_CFLAGS_FOR_TARGET.patch;patch=1 \ + file://gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch;patch=1 \ " SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch;patch=1 " diff --git a/packages/gcc/gcc-4.3.1/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/packages/gcc/gcc-4.3.1/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch new file mode 100644 index 0000000000..f33e6c1ea6 --- /dev/null +++ b/packages/gcc/gcc-4.3.1/gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch @@ -0,0 +1,31 @@ +--- + configure | 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Index: gcc-4.3.1/configure.ac +=================================================================== +--- gcc-4.3.1.orig/configure.ac 2008-07-21 12:29:18.000000000 -0700 ++++ gcc-4.3.1/configure.ac 2008-07-21 12:29:35.000000000 -0700 +@@ -2352,7 +2352,7 @@ fi + # for target_alias and gcc doesn't manage it consistently. + target_configargs="--cache-file=./config.cache ${target_configargs}" + +-FLAGS_FOR_TARGET= ++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" + case " $target_configdirs " in + *" newlib "*) + case " $target_configargs " in +Index: gcc-4.3.1/configure +=================================================================== +--- gcc-4.3.1.orig/configure 2008-07-21 12:29:48.000000000 -0700 ++++ gcc-4.3.1/configure 2008-07-21 12:29:59.000000000 -0700 +@@ -5841,7 +5841,7 @@ fi + # for target_alias and gcc doesn't manage it consistently. + target_configargs="--cache-file=./config.cache ${target_configargs}" + +-FLAGS_FOR_TARGET= ++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET" + case " $target_configdirs " in + *" newlib "*) + case " $target_configargs " in diff --git a/packages/gcc/gcc-4.3.1/gcc-4.3.1-SYSROOT_CFLAGS_FOR_TARGET.patch b/packages/gcc/gcc-4.3.1/gcc-4.3.1-SYSROOT_CFLAGS_FOR_TARGET.patch new file mode 100644 index 0000000000..2a9605c3d6 --- /dev/null +++ b/packages/gcc/gcc-4.3.1/gcc-4.3.1-SYSROOT_CFLAGS_FOR_TARGET.patch @@ -0,0 +1,5466 @@ +Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it. + +This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET. + +Other changes I had to do include: + +- moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though. + +- passing the right CFLAGS to configure scripts as exported environment variables + +I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do. + +Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3? + +Paolo + +2008-02-19 Paolo Bonzini <bonzini@gnu.org> + + PR bootstrap/32009 + PR bootstrap/32161 + + * configure.ac (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Compute here. + * configure: Regenerate. + + * Makefile.def: Define stage_libcflags for all bootstrap stages. + * Makefile.tpl (BOOT_LIBCFLAGS, STAGE2_LIBCFLAGS, STAGE3_LIBCFLAGS, + STAGE4_LIBCFLAGS): New. + (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Subst from autoconf, without + $(SYSROOT_CFLAGS_FOR_TARGET) and $(DEBUG_PREFIX_CFLAGS_FOR_TARGET). + (BASE_TARGET_EXPORTS): Append them here to C{,XX}FLAGS. + (EXTRA_TARGET_FLAGS): Append them here to {LIB,}C{,XX}FLAGS. + (configure-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags + for target modules. Don't export LIBCFLAGS. + (all-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags; pass + $(BASE_FLAGS_TO_PASS) where [+args+] was passed, and [+args+] after + the overridden CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. + (invocations of `all'): Replace $(TARGET_FLAGS_TO_PASS) with + $(EXTRA_TARGET_FLAGS), $(FLAGS_TO_PASS) with $(EXTRA_HOST_FLAGS). + * Makefile.in: Regenerate. + +config: +2008-02-19 Paolo Bonzini <bonzini@gnu.org> + + PR bootstrap/32009 + * mh-ppc-darwin (BOOT_CFLAGS): Reenable. + +gcc: +2008-02-19 Paolo Bonzini <bonzini@gnu.org> + + PR bootstrap/32009 + * doc/install.texi: Correct references to CFLAGS, replacing them + with BOOT_CFLAGS. Document flags used during bootstrap for + target libraries. + + +--- + Makefile.def | 24 + Makefile.in | 1802 +++++++++++++++++++++++++++++++-------------------- + Makefile.tpl | 57 - + config/mh-ppc-darwin | 3 + configure | 36 - + configure.ac | 32 + gcc/doc/install.texi | 56 - + 7 files changed, 1261 insertions(+), 749 deletions(-) + +Index: gcc-4.3.1/configure.ac +=================================================================== +--- gcc-4.3.1.orig/configure.ac 2008-02-01 19:29:30.000000000 -0800 ++++ gcc-4.3.1/configure.ac 2008-07-21 10:56:15.000000000 -0700 +@@ -1667,6 +1667,38 @@ AC_ARG_WITH([debug-prefix-map], + [DEBUG_PREFIX_CFLAGS_FOR_TARGET=]) + AC_SUBST(DEBUG_PREFIX_CFLAGS_FOR_TARGET) + ++# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS ++# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS ++# might also be empty (or "-g", if a non-GCC C++ compiler is in the path). ++# We want to ensure that TARGET libraries (which we know are built with ++# gcc) are built with "-O2 -g", so include those options when setting ++# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. ++if test "x$CFLAGS_FOR_TARGET" = x; then ++ CFLAGS_FOR_TARGET=$CFLAGS ++ case " $CFLAGS " in ++ *" -O2 "*) ;; ++ *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;; ++ esac ++ case " $CFLAGS " in ++ *" -g "* | *" -g3 "*) ;; ++ *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;; ++ esac ++fi ++AC_SUBST(CFLAGS_FOR_TARGET) ++ ++if test "x$CXXFLAGS_FOR_TARGET" = x; then ++ CXXFLAGS_FOR_TARGET=$CXXFLAGS ++ case " $CXXFLAGS " in ++ *" -O2 "*) ;; ++ *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;; ++ esac ++ case " $CXXFLAGS " in ++ *" -g "* | *" -g3 "*) ;; ++ *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;; ++ esac ++fi ++AC_SUBST(CXXFLAGS_FOR_TARGET) ++ + # Handle --with-headers=XXX. If the value is not "yes", the contents of + # the named directory are copied to $(tooldir)/sys-include. + if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then +Index: gcc-4.3.1/Makefile.def +=================================================================== +--- gcc-4.3.1.orig/Makefile.def 2007-10-23 08:53:18.000000000 -0700 ++++ gcc-4.3.1/Makefile.def 2008-07-21 10:56:15.000000000 -0700 +@@ -511,43 +511,51 @@ bootstrap_stage = { + // compiler probably has never heard of them. + stage_configure_flags='--disable-intermodule $(STAGE1_CHECKING) \ + --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"' ; +- stage_cflags='$(STAGE1_CFLAGS)' ; }; ++ stage_cflags='$(STAGE1_CFLAGS)' ; ++ stage_libcflags='$(STAGE1_LIBCFLAGS)' ; }; + bootstrap_stage = { + id=2 ; prev=1 ; + bootstrap_target=bootstrap2 ; + stage_configure_flags="@stage2_werror_flag@" ; +- stage_cflags="$(STAGE2_CFLAGS)" ; }; ++ stage_cflags="$(STAGE2_CFLAGS)" ; ++ stage_libcflags="$(STAGE2_LIBCFLAGS)" ; }; + bootstrap_stage = { + id=b2g0 ; prev=1 ; + bootstrap_target=bootstrap2-debug ; + stage_configure_flags="@stage2_werror_flag@" ; +- stage_cflags="$(STAGE2_CFLAGS) -g0" ; }; ++ stage_cflags="$(STAGE2_CFLAGS) -g0" ; ++ stage_libcflags="$(STAGE2_LIBCFLAGS) -g0" ; }; + bootstrap_stage = { + id=3 ; prev=2 ; lean=1 ; + compare_target=compare ; + bootstrap_target=bootstrap ; + cleanstrap_target=cleanstrap ; + stage_configure_flags="@stage2_werror_flag@" ; +- stage_cflags="$(STAGE3_CFLAGS)" ; }; ++ stage_cflags="$(STAGE3_CFLAGS)" ; ++ stage_libcflags="$(STAGE3_LIBCFLAGS)" ; }; + bootstrap_stage = { + id=b3g2 ; prev=b2g0 ; lean=1 ; + compare_target=compare-debug ; + bootstrap_target=bootstrap-debug ; + cleanstrap_target=cleanstrap-debug ; + stage_configure_flags="@stage2_werror_flag@" ; +- stage_cflags="$(STAGE3_CFLAGS) -g2" ; }; ++ stage_cflags="$(STAGE3_CFLAGS) -g2" ; ++ stage_libcflags="$(STAGE3_LIBCFLAGS) -g2" ; }; + bootstrap_stage = { + id=4 ; prev=3 ; lean=2 ; + compare_target=compare3 ; + bootstrap_target=bootstrap4 ; + stage_configure_flags="@stage2_werror_flag@" ; +- stage_cflags="$(STAGE4_CFLAGS)" ; }; ++ stage_cflags="$(STAGE4_CFLAGS)" ; ++ stage_libcflags="$(STAGE4_CFLAGS)" ; }; + bootstrap_stage = { + id=profile ; prev=1 ; + stage_configure_flags="@stage2_werror_flag@" ; +- stage_cflags='$(STAGE2_CFLAGS) -fprofile-generate' ; }; ++ stage_cflags='$(STAGE2_CFLAGS) -fprofile-generate' ; ++ stage_libcflags='$(STAGE2_LIBCFLAGS) -fprofile-generate' ; }; + bootstrap_stage = { + id=feedback ; prev=profile ; + bootstrap_target=profiledbootstrap ; + stage_configure_flags="@stage2_werror_flag@" ; +- stage_cflags='$(STAGE3_CFLAGS) -fprofile-use' ; }; ++ stage_cflags='$(STAGE3_CFLAGS) -fprofile-use' ; ++ stage_libcflags='$(STAGE3_LIBCFLAGS) -fprofile-use' ; }; +Index: gcc-4.3.1/Makefile.tpl +=================================================================== +--- gcc-4.3.1.orig/Makefile.tpl 2008-07-21 10:56:14.000000000 -0700 ++++ gcc-4.3.1/Makefile.tpl 2008-07-21 10:56:15.000000000 -0700 +@@ -207,10 +207,10 @@ BASE_TARGET_EXPORTS = \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ +- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ ++ CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ +- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ ++ CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ +@@ -330,14 +330,19 @@ PICFLAG = + # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them + # overrideable (for a bootstrap build stage1 also builds gcc.info). + +-STAGE1_CFLAGS=@stage1_cflags@ + STAGE1_CHECKING=@stage1_checking@ + STAGE1_LANGUAGES=@stage1_languages@ + ++STAGE1_CFLAGS=@stage1_cflags@ + STAGE2_CFLAGS=$(BOOT_CFLAGS) + STAGE3_CFLAGS=$(BOOT_CFLAGS) + STAGE4_CFLAGS=$(BOOT_CFLAGS) + ++STAGE1_LIBCFLAGS=$(CFLAGS_FOR_TARGET) ++STAGE2_LIBCFLAGS=$(CFLAGS_FOR_TARGET) ++STAGE3_LIBCFLAGS=$(CFLAGS_FOR_TARGET) ++STAGE4_LIBCFLAGS=$(CFLAGS_FOR_TARGET) ++ + do-compare = @do_compare@ + do-compare3 = $(do-compare) + do-compare-debug = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2 +@@ -376,18 +381,11 @@ COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_ + COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@ + COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@ + +-# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS +-# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS +-# might also be empty (or "-g", if a non-GCC C++ compiler is in the path). +-# We want to ensure that TARGET libraries (which we know are built with +-# gcc) are built with "-O2 -g", so prepend those options when setting +-# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. +-CFLAGS_FOR_TARGET = -O2 -g $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) \ +- $(DEBUG_PREFIX_CFLAGS_FOR_TARGET) ++CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@ ++CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@ + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ + DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@ +-CXXFLAGS_FOR_TARGET = -O2 -g $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) \ +- $(DEBUG_PREFIX_CFLAGS_FOR_TARGET) ++ + LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) + LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates + LDFLAGS_FOR_TARGET = @LDFLAGS@ +@@ -491,19 +489,20 @@ POSTSTAGE1_FLAGS_TO_PASS = \ + # Flags to pass down to makes which are built with the target environment. + # The double $ decreases the length of the command line; those variables + # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The +-# COMPILER_ prefixed variables are not passed down so we expand them here. ++# *_CFLAGS_FOR_TARGET variables are not passed down and most often empty, ++# so we expand them here. + EXTRA_TARGET_FLAGS = \ + 'AR=$$(AR_FOR_TARGET)' \ + 'AS=$(COMPILER_AS_FOR_TARGET)' \ + 'CC=$$(CC_FOR_TARGET)' \ +- 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ ++ 'CFLAGS=$$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ + 'CXX=$$(CXX_FOR_TARGET)' \ +- 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ ++ 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ + 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ + 'LD=$(COMPILER_LD_FOR_TARGET)' \ + 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \ +- 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ +- 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ ++ 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ ++ 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ + 'NM=$(COMPILER_NM_FOR_TARGET)' \ + 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \ + 'RANLIB=$$(RANLIB_FOR_TARGET)' \ +@@ -851,9 +850,11 @@ configure-stage[+id+]-[+prefix+][+module + fi; \ + [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \ + [+exports+][+ IF prev +] \ +- [+poststage1_exports+][+ ENDIF prev +] \ ++ [+poststage1_exports+][+ ENDIF prev +] [+ IF prefix +] \ ++ CFLAGS="[+stage_libcflags+] $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ ++ CXXFLAGS="[+stage_libcflags+] $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; [+ ELSE +] \ + CFLAGS="[+stage_cflags+]"; export CFLAGS; \ +- LIBCFLAGS="[+stage_cflags+]"; export LIBCFLAGS; \ ++ CXXFLAGS="[+stage_cflags+]"; export CXXFLAGS; [+ ENDIF +] \ + echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \ + $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \ + cd [+subdir+]/[+module+] || exit 1; \ +@@ -890,7 +891,8 @@ all-[+prefix+][+module+]: configure-[+pr + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + [+exports+] \ + (cd [+subdir+]/[+module+] && \ +- $(MAKE) [+args+] [+extra_make_flags+] $(TARGET-[+prefix+][+module+])) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+extra_make_flags+] \ ++ $(TARGET-[+prefix+][+module+])) + @endif [+prefix+][+module+] + + [+ IF bootstrap +] +@@ -910,8 +912,11 @@ all-stage[+id+]-[+prefix+][+module+]: co + [+exports+][+ IF prev +] \ + [+poststage1_exports+][+ ENDIF prev +] \ + cd [+subdir+]/[+module+] && \ +- $(MAKE) [+args+] \ +- CFLAGS="[+stage_cflags+]" LIBCFLAGS="[+stage_cflags+]" [+ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="[+stage_cflags+]" CXXFLAGS="[+stage_cflags+]" \ ++ LIBCFLAGS="[+stage_libcflags+]" \ ++ CFLAGS_FOR_TARGET="[+stage_libcflags+]" \ ++ CXXFLAGS_FOR_TARGET="[+stage_libcflags+]" [+args+] [+ + IF prev +][+poststage1_args+][+ ENDIF prev + +] [+extra_make_flags+] \ + $(TARGET-stage[+id+]-[+prefix+][+module+]) +@@ -961,7 +966,7 @@ clean-stage[+id+]-[+prefix+][+module+]: + [+ all prefix="" subdir="$(HOST_SUBDIR)" + exports="$(HOST_EXPORTS)" + poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)" +- args="$(FLAGS_TO_PASS)" ++ args="$(EXTRA_HOST_FLAGS)" + poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +] + + .PHONY: check-[+module+] maybe-check-[+module+] +@@ -1059,7 +1064,7 @@ maybe-[+make_target+]-[+module+]: [+make + + [+ all prefix="target-" subdir="$(TARGET_SUBDIR)" + exports="$(RAW_CXX_TARGET_EXPORTS)" +- args="$(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +] ++ args="$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +] + [+ ELSE +] + [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)" + check_multilibs=true +@@ -1070,7 +1075,7 @@ maybe-[+make_target+]-[+module+]: [+make + + [+ all prefix="target-" subdir="$(TARGET_SUBDIR)" + exports="$(NORMAL_TARGET_EXPORTS)" +- args="$(TARGET_FLAGS_TO_PASS)" +] ++ args="$(EXTRA_TARGET_FLAGS)" +] + [+ ENDIF +] + + .PHONY: check-target-[+module+] maybe-check-target-[+module+] +Index: gcc-4.3.1/config/mh-ppc-darwin +=================================================================== +--- gcc-4.3.1.orig/config/mh-ppc-darwin 2007-05-23 07:26:31.000000000 -0700 ++++ gcc-4.3.1/config/mh-ppc-darwin 2008-07-21 10:56:15.000000000 -0700 +@@ -2,5 +2,4 @@ + # position-independent-code -- the usual default on Darwin. This fix speeds + # compiles by 3-5%. + +-# Broken because of PR32009. +-# BOOT_CFLAGS=-g -O2 -mdynamic-no-pic ++BOOT_CFLAGS=-g -O2 -mdynamic-no-pic +Index: gcc-4.3.1/gcc/doc/install.texi +=================================================================== +--- gcc-4.3.1.orig/gcc/doc/install.texi 2008-05-22 23:58:10.000000000 -0700 ++++ gcc-4.3.1/gcc/doc/install.texi 2008-07-21 10:56:15.000000000 -0700 +@@ -1772,33 +1772,35 @@ same described above, but object files f + stage2 of the 3-stage bootstrap of the compiler are deleted as + soon as they are no longer needed. + +-If you want to save additional space during the bootstrap and in +-the final installation as well, you can build the compiler binaries +-without debugging information as in the following example. This will save +-roughly 40% of disk space both for the bootstrap and the final installation. +-(Libraries will still contain debugging information.) +- +-@smallexample +- make CFLAGS='-O' LIBCFLAGS='-g -O2' \ +- LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap +-@end smallexample +- +-If you wish to use non-default GCC flags when compiling the stage2 and +-stage3 compilers, set @code{BOOT_CFLAGS} on the command line when doing +-@samp{make}. Non-default optimization flags are less well +-tested here than the default of @samp{-g -O2}, but should still work. +-In a few cases, you may find that you need to specify special flags such +-as @option{-msoft-float} here to complete the bootstrap; or, if the +-native compiler miscompiles the stage1 compiler, you may need to work +-around this, by choosing @code{BOOT_CFLAGS} to avoid the parts of the +-stage1 compiler that were miscompiled, or by using @samp{make ++If you wish to use non-default GCC flags when compiling the stage2 ++and stage3 compilers, set @code{BOOT_CFLAGS} on the command line when ++doing @samp{make}. For example, if you want to save additional space ++during the bootstrap and in the final installation as well, you can ++build the compiler binaries without debugging information as in the ++following example. This will save roughly 40% of disk space both for ++the bootstrap and the final installation. (Libraries will still contain ++debugging information.) ++ ++@smallexample ++ make BOOT_CFLAGS='-O' bootstrap ++@end smallexample ++ ++You can place non-default optimization flags into @code{BOOT_CFLAGS}; they ++are less well tested here than the default of @samp{-g -O2}, but should ++still work. In a few cases, you may find that you need to specify special ++flags such as @option{-msoft-float} here to complete the bootstrap; or, ++if the native compiler miscompiles the stage1 compiler, you may need ++to work around this, by choosing @code{BOOT_CFLAGS} to avoid the parts ++of the stage1 compiler that were miscompiled, or by using @samp{make + bootstrap4} to increase the number of stages of bootstrap. + +-Note that using non-standard @code{CFLAGS} can cause bootstrap to fail +-if these trigger a warning with the new compiler. For example using +-@samp{-O2 -g -mcpu=i686} on @code{i686-pc-linux-gnu} will cause bootstrap +-failure as @option{-mcpu=} is deprecated in 3.4.0 and above. +- ++@code{BOOT_CFLAGS} does not apply to bootstrapped target libraries. ++Since these are always compiled with the compiler currently being ++bootstrapped, you can use @code{CFLAGS_FOR_TARGET} to modify their ++compilation flags, as for non-bootstrapped target libraries. ++Again, if the native compiler miscompiles the stage1 compiler, you may ++need to work around this by avoiding non-working parts of the stage1 ++compiler. Use @code{STAGE1_LIBCFLAGS} to this end. + + If you used the flag @option{--enable-languages=@dots{}} to restrict + the compilers to be built, only those you've actually enabled will be +@@ -2689,8 +2691,8 @@ cross-compilers on the Alpha for 32-bit + a few cases and may not work properly. + + @samp{make compare} may fail on old versions of DEC Unix unless you add +-@option{-save-temps} to @code{CFLAGS}. On these systems, the name of the +-assembler input file is stored in the object file, and that makes ++@option{-save-temps} to @code{BOOT_CFLAGS}. On these systems, the name ++of the assembler input file is stored in the object file, and that makes + comparison fail if it differs between the @code{stage1} and + @code{stage2} compilations. The option @option{-save-temps} forces a + fixed name to be used for the assembler input file, instead of a +Index: gcc-4.3.1/Makefile.in +=================================================================== +--- gcc-4.3.1.orig/Makefile.in 2008-07-21 10:56:14.000000000 -0700 ++++ gcc-4.3.1/Makefile.in 2008-07-21 10:56:15.000000000 -0700 +@@ -204,11 +204,10 @@ BASE_TARGET_EXPORTS = \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ +- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ +- CPP="$(CC_FOR_TARGET) -E"; export CPP; \ ++ CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ +- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ ++ CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ +@@ -328,14 +327,19 @@ PICFLAG = + # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them + # overrideable (for a bootstrap build stage1 also builds gcc.info). + +-STAGE1_CFLAGS=@stage1_cflags@ + STAGE1_CHECKING=@stage1_checking@ + STAGE1_LANGUAGES=@stage1_languages@ + ++STAGE1_CFLAGS=@stage1_cflags@ + STAGE2_CFLAGS=$(BOOT_CFLAGS) + STAGE3_CFLAGS=$(BOOT_CFLAGS) + STAGE4_CFLAGS=$(BOOT_CFLAGS) + ++STAGE1_LIBCFLAGS=$(CFLAGS_FOR_TARGET) ++STAGE2_LIBCFLAGS=$(CFLAGS_FOR_TARGET) ++STAGE3_LIBCFLAGS=$(CFLAGS_FOR_TARGET) ++STAGE4_LIBCFLAGS=$(CFLAGS_FOR_TARGET) ++ + do-compare = @do_compare@ + do-compare3 = $(do-compare) + do-compare-debug = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2 +@@ -374,18 +378,11 @@ COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_ + COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@ + COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@ + +-# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS +-# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS +-# might also be empty (or "-g", if a non-GCC C++ compiler is in the path). +-# We want to ensure that TARGET libraries (which we know are built with +-# gcc) are built with "-O2 -g", so prepend those options when setting +-# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. +-CFLAGS_FOR_TARGET = -O2 -g $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) \ +- $(DEBUG_PREFIX_CFLAGS_FOR_TARGET) ++CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@ ++CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@ + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ + DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@ +-CXXFLAGS_FOR_TARGET = -O2 -g $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) \ +- $(DEBUG_PREFIX_CFLAGS_FOR_TARGET) ++ + LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) + LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates + LDFLAGS_FOR_TARGET = @LDFLAGS@ +@@ -592,19 +589,20 @@ POSTSTAGE1_FLAGS_TO_PASS = \ + # Flags to pass down to makes which are built with the target environment. + # The double $ decreases the length of the command line; those variables + # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The +-# COMPILER_ prefixed variables are not passed down so we expand them here. ++# *_CFLAGS_FOR_TARGET variables are not passed down and most often empty, ++# so we expand them here. + EXTRA_TARGET_FLAGS = \ + 'AR=$$(AR_FOR_TARGET)' \ + 'AS=$(COMPILER_AS_FOR_TARGET)' \ + 'CC=$$(CC_FOR_TARGET)' \ +- 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ ++ 'CFLAGS=$$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ + 'CXX=$$(CXX_FOR_TARGET)' \ +- 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ ++ 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ + 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ + 'LD=$(COMPILER_LD_FOR_TARGET)' \ + 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \ +- 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ +- 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ ++ 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ ++ 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \ + 'NM=$(COMPILER_NM_FOR_TARGET)' \ + 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \ + 'RANLIB=$$(RANLIB_FOR_TARGET)' \ +@@ -2738,7 +2736,8 @@ all-build-libiberty: configure-build-lib + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/libiberty && \ +- $(MAKE) $(TARGET-build-libiberty)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ $(TARGET-build-libiberty)) + @endif build-libiberty + + +@@ -2793,7 +2792,8 @@ all-build-bison: configure-build-bison + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/bison && \ +- $(MAKE) $(TARGET-build-bison)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ $(TARGET-build-bison)) + @endif build-bison + + +@@ -2848,7 +2848,8 @@ all-build-byacc: configure-build-byacc + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/byacc && \ +- $(MAKE) $(TARGET-build-byacc)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ $(TARGET-build-byacc)) + @endif build-byacc + + +@@ -2903,7 +2904,8 @@ all-build-flex: configure-build-flex + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/flex && \ +- $(MAKE) $(TARGET-build-flex)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ $(TARGET-build-flex)) + @endif build-flex + + +@@ -2958,7 +2960,8 @@ all-build-m4: configure-build-m4 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/m4 && \ +- $(MAKE) $(TARGET-build-m4)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ $(TARGET-build-m4)) + @endif build-m4 + + +@@ -3013,7 +3016,8 @@ all-build-texinfo: configure-build-texin + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/texinfo && \ +- $(MAKE) $(TARGET-build-texinfo)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ $(TARGET-build-texinfo)) + @endif build-texinfo + + +@@ -3068,7 +3072,8 @@ all-build-fixincludes: configure-build-f + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/fixincludes && \ +- $(MAKE) $(TARGET-build-fixincludes)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ $(TARGET-build-fixincludes)) + @endif build-fixincludes + + +@@ -3127,7 +3132,8 @@ all-ash: configure-ash + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/ash && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-ash)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-ash)) + @endif ash + + +@@ -3551,7 +3557,8 @@ all-autoconf: configure-autoconf + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/autoconf && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-autoconf)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-autoconf)) + @endif autoconf + + +@@ -3975,7 +3982,8 @@ all-automake: configure-automake + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/automake && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-automake)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-automake)) + @endif automake + + +@@ -4399,7 +4407,8 @@ all-bash: configure-bash + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/bash && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-bash)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-bash)) + @endif bash + + +@@ -4816,9 +4825,9 @@ configure-stage1-bfd: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ +@@ -4847,9 +4856,9 @@ configure-stage2-bfd: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ +@@ -4878,9 +4887,9 @@ configure-stageb2g0-bfd: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ +@@ -4909,9 +4918,9 @@ configure-stage3-bfd: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ +@@ -4940,9 +4949,9 @@ configure-stageb3g2-bfd: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ +@@ -4971,9 +4980,9 @@ configure-stage4-bfd: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ +@@ -5002,9 +5011,9 @@ configure-stageprofile-bfd: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ +@@ -5033,9 +5042,9 @@ configure-stagefeedback-bfd: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/bfd ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ +@@ -5070,7 +5079,8 @@ all-bfd: configure-bfd + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-bfd)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-bfd)) + @endif bfd + + +@@ -5089,8 +5099,11 @@ all-stage1-bfd: configure-stage1-bfd + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ + $(TARGET-stage1-bfd) + + maybe-clean-stage1-bfd: clean-stage1-bfd +@@ -5103,7 +5116,7 @@ clean-stage1-bfd: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean + @endif bfd-bootstrap + +@@ -5123,8 +5136,11 @@ all-stage2-bfd: configure-stage2-bfd + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-bfd) + + maybe-clean-stage2-bfd: clean-stage2-bfd +@@ -5137,7 +5153,7 @@ clean-stage2-bfd: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif bfd-bootstrap +@@ -5158,8 +5174,11 @@ all-stageb2g0-bfd: configure-stageb2g0-b + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb2g0-bfd) + + maybe-clean-stageb2g0-bfd: clean-stageb2g0-bfd +@@ -5172,7 +5191,7 @@ clean-stageb2g0-bfd: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif bfd-bootstrap +@@ -5193,8 +5212,11 @@ all-stage3-bfd: configure-stage3-bfd + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-bfd) + + maybe-clean-stage3-bfd: clean-stage3-bfd +@@ -5207,7 +5229,7 @@ clean-stage3-bfd: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif bfd-bootstrap +@@ -5228,8 +5250,11 @@ all-stageb3g2-bfd: configure-stageb3g2-b + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb3g2-bfd) + + maybe-clean-stageb3g2-bfd: clean-stageb3g2-bfd +@@ -5242,7 +5267,7 @@ clean-stageb3g2-bfd: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif bfd-bootstrap +@@ -5263,8 +5288,11 @@ all-stage4-bfd: configure-stage4-bfd + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-bfd) + + maybe-clean-stage4-bfd: clean-stage4-bfd +@@ -5277,7 +5305,7 @@ clean-stage4-bfd: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif bfd-bootstrap +@@ -5298,8 +5326,11 @@ all-stageprofile-bfd: configure-stagepro + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-bfd) + + maybe-clean-stageprofile-bfd: clean-stageprofile-bfd +@@ -5312,7 +5343,7 @@ clean-stageprofile-bfd: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif bfd-bootstrap +@@ -5333,8 +5364,11 @@ all-stagefeedback-bfd: configure-stagefe + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-bfd) + + maybe-clean-stagefeedback-bfd: clean-stagefeedback-bfd +@@ -5347,7 +5381,7 @@ clean-stagefeedback-bfd: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/bfd && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif bfd-bootstrap +@@ -5754,9 +5788,9 @@ configure-stage1-opcodes: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ +@@ -5785,9 +5819,9 @@ configure-stage2-opcodes: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ +@@ -5816,9 +5850,9 @@ configure-stageb2g0-opcodes: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ +@@ -5847,9 +5881,9 @@ configure-stage3-opcodes: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ +@@ -5878,9 +5912,9 @@ configure-stageb3g2-opcodes: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ +@@ -5909,9 +5943,9 @@ configure-stage4-opcodes: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ +@@ -5940,9 +5974,9 @@ configure-stageprofile-opcodes: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ +@@ -5971,9 +6005,9 @@ configure-stagefeedback-opcodes: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/opcodes ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ +@@ -6008,7 +6042,8 @@ all-opcodes: configure-opcodes + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-opcodes)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-opcodes)) + @endif opcodes + + +@@ -6027,8 +6062,11 @@ all-stage1-opcodes: configure-stage1-opc + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ + $(TARGET-stage1-opcodes) + + maybe-clean-stage1-opcodes: clean-stage1-opcodes +@@ -6041,7 +6079,7 @@ clean-stage1-opcodes: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean + @endif opcodes-bootstrap + +@@ -6061,8 +6099,11 @@ all-stage2-opcodes: configure-stage2-opc + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-opcodes) + + maybe-clean-stage2-opcodes: clean-stage2-opcodes +@@ -6075,7 +6116,7 @@ clean-stage2-opcodes: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif opcodes-bootstrap +@@ -6096,8 +6137,11 @@ all-stageb2g0-opcodes: configure-stageb2 + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb2g0-opcodes) + + maybe-clean-stageb2g0-opcodes: clean-stageb2g0-opcodes +@@ -6110,7 +6154,7 @@ clean-stageb2g0-opcodes: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif opcodes-bootstrap +@@ -6131,8 +6175,11 @@ all-stage3-opcodes: configure-stage3-opc + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-opcodes) + + maybe-clean-stage3-opcodes: clean-stage3-opcodes +@@ -6145,7 +6192,7 @@ clean-stage3-opcodes: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif opcodes-bootstrap +@@ -6166,8 +6213,11 @@ all-stageb3g2-opcodes: configure-stageb3 + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb3g2-opcodes) + + maybe-clean-stageb3g2-opcodes: clean-stageb3g2-opcodes +@@ -6180,7 +6230,7 @@ clean-stageb3g2-opcodes: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif opcodes-bootstrap +@@ -6201,8 +6251,11 @@ all-stage4-opcodes: configure-stage4-opc + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-opcodes) + + maybe-clean-stage4-opcodes: clean-stage4-opcodes +@@ -6215,7 +6268,7 @@ clean-stage4-opcodes: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif opcodes-bootstrap +@@ -6236,8 +6289,11 @@ all-stageprofile-opcodes: configure-stag + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-opcodes) + + maybe-clean-stageprofile-opcodes: clean-stageprofile-opcodes +@@ -6250,7 +6306,7 @@ clean-stageprofile-opcodes: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif opcodes-bootstrap +@@ -6271,8 +6327,11 @@ all-stagefeedback-opcodes: configure-sta + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-opcodes) + + maybe-clean-stagefeedback-opcodes: clean-stagefeedback-opcodes +@@ -6285,7 +6344,7 @@ clean-stagefeedback-opcodes: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/opcodes && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif opcodes-bootstrap +@@ -6692,9 +6751,9 @@ configure-stage1-binutils: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ +@@ -6723,9 +6782,9 @@ configure-stage2-binutils: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ +@@ -6754,9 +6813,9 @@ configure-stageb2g0-binutils: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ +@@ -6785,9 +6844,9 @@ configure-stage3-binutils: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ +@@ -6816,9 +6875,9 @@ configure-stageb3g2-binutils: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ +@@ -6847,9 +6906,9 @@ configure-stage4-binutils: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ +@@ -6878,9 +6937,9 @@ configure-stageprofile-binutils: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ +@@ -6909,9 +6968,9 @@ configure-stagefeedback-binutils: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/binutils ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ +@@ -6946,7 +7005,8 @@ all-binutils: configure-binutils + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-binutils)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-binutils)) + @endif binutils + + +@@ -6965,8 +7025,11 @@ all-stage1-binutils: configure-stage1-bi + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ + $(TARGET-stage1-binutils) + + maybe-clean-stage1-binutils: clean-stage1-binutils +@@ -6979,7 +7042,7 @@ clean-stage1-binutils: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean + @endif binutils-bootstrap + +@@ -6999,8 +7062,11 @@ all-stage2-binutils: configure-stage2-bi + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-binutils) + + maybe-clean-stage2-binutils: clean-stage2-binutils +@@ -7013,7 +7079,7 @@ clean-stage2-binutils: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif binutils-bootstrap +@@ -7034,8 +7100,11 @@ all-stageb2g0-binutils: configure-stageb + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb2g0-binutils) + + maybe-clean-stageb2g0-binutils: clean-stageb2g0-binutils +@@ -7048,7 +7117,7 @@ clean-stageb2g0-binutils: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif binutils-bootstrap +@@ -7069,8 +7138,11 @@ all-stage3-binutils: configure-stage3-bi + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-binutils) + + maybe-clean-stage3-binutils: clean-stage3-binutils +@@ -7083,7 +7155,7 @@ clean-stage3-binutils: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif binutils-bootstrap +@@ -7104,8 +7176,11 @@ all-stageb3g2-binutils: configure-stageb + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb3g2-binutils) + + maybe-clean-stageb3g2-binutils: clean-stageb3g2-binutils +@@ -7118,7 +7193,7 @@ clean-stageb3g2-binutils: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif binutils-bootstrap +@@ -7139,8 +7214,11 @@ all-stage4-binutils: configure-stage4-bi + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-binutils) + + maybe-clean-stage4-binutils: clean-stage4-binutils +@@ -7153,7 +7231,7 @@ clean-stage4-binutils: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif binutils-bootstrap +@@ -7174,8 +7252,11 @@ all-stageprofile-binutils: configure-sta + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-binutils) + + maybe-clean-stageprofile-binutils: clean-stageprofile-binutils +@@ -7188,7 +7269,7 @@ clean-stageprofile-binutils: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif binutils-bootstrap +@@ -7209,8 +7290,11 @@ all-stagefeedback-binutils: configure-st + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-binutils) + + maybe-clean-stagefeedback-binutils: clean-stagefeedback-binutils +@@ -7223,7 +7307,7 @@ clean-stagefeedback-binutils: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/binutils && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif binutils-bootstrap +@@ -7637,7 +7721,8 @@ all-bison: configure-bison + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/bison && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-bison)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-bison)) + @endif bison + + +@@ -8064,7 +8149,8 @@ all-byacc: configure-byacc + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/byacc && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-byacc)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-byacc)) + @endif byacc + + +@@ -8491,7 +8577,8 @@ all-bzip2: configure-bzip2 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/bzip2 && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-bzip2)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-bzip2)) + @endif bzip2 + + +@@ -8915,7 +9002,8 @@ all-dejagnu: configure-dejagnu + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/dejagnu && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-dejagnu)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-dejagnu)) + @endif dejagnu + + +@@ -9339,7 +9427,8 @@ all-diff: configure-diff + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/diff && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-diff)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-diff)) + @endif diff + + +@@ -9763,7 +9852,8 @@ all-dosutils: configure-dosutils + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/dosutils && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-dosutils)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-dosutils)) + @endif dosutils + + +@@ -10181,7 +10271,8 @@ all-etc: configure-etc + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/etc && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-etc)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-etc)) + @endif etc + + +@@ -10605,7 +10696,8 @@ all-fastjar: configure-fastjar + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/fastjar && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-fastjar)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-fastjar)) + @endif fastjar + + +@@ -11032,7 +11124,8 @@ all-fileutils: configure-fileutils + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/fileutils && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-fileutils)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-fileutils)) + @endif fileutils + + +@@ -11456,7 +11549,8 @@ all-findutils: configure-findutils + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/findutils && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-findutils)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-findutils)) + @endif findutils + + +@@ -11880,7 +11974,8 @@ all-find: configure-find + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/find && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-find)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-find)) + @endif find + + +@@ -12304,7 +12399,8 @@ all-fixincludes: configure-fixincludes + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/fixincludes && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-fixincludes)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-fixincludes)) + @endif fixincludes + + +@@ -12712,7 +12808,8 @@ all-flex: configure-flex + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/flex && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-flex)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-flex)) + @endif flex + + +@@ -13132,9 +13229,9 @@ configure-stage1-gas: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ +@@ -13163,9 +13260,9 @@ configure-stage2-gas: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ +@@ -13194,9 +13291,9 @@ configure-stageb2g0-gas: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ +@@ -13225,9 +13322,9 @@ configure-stage3-gas: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ +@@ -13256,9 +13353,9 @@ configure-stageb3g2-gas: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ +@@ -13287,9 +13384,9 @@ configure-stage4-gas: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ +@@ -13318,9 +13415,9 @@ configure-stageprofile-gas: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ +@@ -13349,9 +13446,9 @@ configure-stagefeedback-gas: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/gas ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ +@@ -13386,7 +13483,8 @@ all-gas: configure-gas + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gas)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-gas)) + @endif gas + + +@@ -13405,8 +13503,11 @@ all-stage1-gas: configure-stage1-gas + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ + $(TARGET-stage1-gas) + + maybe-clean-stage1-gas: clean-stage1-gas +@@ -13419,7 +13520,7 @@ clean-stage1-gas: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean + @endif gas-bootstrap + +@@ -13439,8 +13540,11 @@ all-stage2-gas: configure-stage2-gas + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-gas) + + maybe-clean-stage2-gas: clean-stage2-gas +@@ -13453,7 +13557,7 @@ clean-stage2-gas: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gas-bootstrap +@@ -13474,8 +13578,11 @@ all-stageb2g0-gas: configure-stageb2g0-g + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb2g0-gas) + + maybe-clean-stageb2g0-gas: clean-stageb2g0-gas +@@ -13488,7 +13595,7 @@ clean-stageb2g0-gas: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gas-bootstrap +@@ -13509,8 +13616,11 @@ all-stage3-gas: configure-stage3-gas + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-gas) + + maybe-clean-stage3-gas: clean-stage3-gas +@@ -13523,7 +13633,7 @@ clean-stage3-gas: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gas-bootstrap +@@ -13544,8 +13654,11 @@ all-stageb3g2-gas: configure-stageb3g2-g + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb3g2-gas) + + maybe-clean-stageb3g2-gas: clean-stageb3g2-gas +@@ -13558,7 +13671,7 @@ clean-stageb3g2-gas: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gas-bootstrap +@@ -13579,8 +13692,11 @@ all-stage4-gas: configure-stage4-gas + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-gas) + + maybe-clean-stage4-gas: clean-stage4-gas +@@ -13593,7 +13709,7 @@ clean-stage4-gas: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gas-bootstrap +@@ -13614,8 +13730,11 @@ all-stageprofile-gas: configure-stagepro + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-gas) + + maybe-clean-stageprofile-gas: clean-stageprofile-gas +@@ -13628,7 +13747,7 @@ clean-stageprofile-gas: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gas-bootstrap +@@ -13649,8 +13768,11 @@ all-stagefeedback-gas: configure-stagefe + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-gas) + + maybe-clean-stagefeedback-gas: clean-stagefeedback-gas +@@ -13663,7 +13785,7 @@ clean-stagefeedback-gas: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/gas && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gas-bootstrap +@@ -14070,9 +14192,9 @@ configure-stage1-gcc: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ +@@ -14101,9 +14223,9 @@ configure-stage2-gcc: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ +@@ -14132,9 +14254,9 @@ configure-stageb2g0-gcc: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ +@@ -14163,9 +14285,9 @@ configure-stage3-gcc: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ +@@ -14194,9 +14316,9 @@ configure-stageb3g2-gcc: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ +@@ -14225,9 +14347,9 @@ configure-stage4-gcc: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ +@@ -14256,9 +14378,9 @@ configure-stageprofile-gcc: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ +@@ -14287,9 +14409,9 @@ configure-stagefeedback-gcc: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/gcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ +@@ -14324,7 +14446,8 @@ all-gcc: configure-gcc + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) $(TARGET-gcc)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) \ ++ $(TARGET-gcc)) + @endif gcc + + +@@ -14343,8 +14466,11 @@ all-stage1-gcc: configure-stage1-gcc + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) \ + $(TARGET-stage1-gcc) + + maybe-clean-stage1-gcc: clean-stage1-gcc +@@ -14357,7 +14483,7 @@ clean-stage1-gcc: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(EXTRA_GCC_FLAGS) clean + @endif gcc-bootstrap + +@@ -14377,8 +14503,11 @@ all-stage2-gcc: configure-stage2-gcc + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(TARGET-stage2-gcc) + + maybe-clean-stage2-gcc: clean-stage2-gcc +@@ -14391,7 +14520,7 @@ clean-stage2-gcc: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean + @endif gcc-bootstrap +@@ -14412,8 +14541,11 @@ all-stageb2g0-gcc: configure-stageb2g0-g + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(TARGET-stageb2g0-gcc) + + maybe-clean-stageb2g0-gcc: clean-stageb2g0-gcc +@@ -14426,7 +14558,7 @@ clean-stageb2g0-gcc: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean + @endif gcc-bootstrap +@@ -14447,8 +14579,11 @@ all-stage3-gcc: configure-stage3-gcc + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(TARGET-stage3-gcc) + + maybe-clean-stage3-gcc: clean-stage3-gcc +@@ -14461,7 +14596,7 @@ clean-stage3-gcc: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean + @endif gcc-bootstrap +@@ -14482,8 +14617,11 @@ all-stageb3g2-gcc: configure-stageb3g2-g + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(TARGET-stageb3g2-gcc) + + maybe-clean-stageb3g2-gcc: clean-stageb3g2-gcc +@@ -14496,7 +14634,7 @@ clean-stageb3g2-gcc: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean + @endif gcc-bootstrap +@@ -14517,8 +14655,11 @@ all-stage4-gcc: configure-stage4-gcc + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(TARGET-stage4-gcc) + + maybe-clean-stage4-gcc: clean-stage4-gcc +@@ -14531,7 +14672,7 @@ clean-stage4-gcc: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean + @endif gcc-bootstrap +@@ -14552,8 +14693,11 @@ all-stageprofile-gcc: configure-stagepro + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(TARGET-stageprofile-gcc) + + maybe-clean-stageprofile-gcc: clean-stageprofile-gcc +@@ -14566,7 +14710,7 @@ clean-stageprofile-gcc: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean + @endif gcc-bootstrap +@@ -14587,8 +14731,11 @@ all-stagefeedback-gcc: configure-stagefe + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \ + $(TARGET-stagefeedback-gcc) + + maybe-clean-stagefeedback-gcc: clean-stagefeedback-gcc +@@ -14601,7 +14748,7 @@ clean-stagefeedback-gcc: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/gcc && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean + @endif gcc-bootstrap +@@ -15015,7 +15162,8 @@ all-gawk: configure-gawk + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gawk && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gawk)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-gawk)) + @endif gawk + + +@@ -15439,7 +15587,8 @@ all-gettext: configure-gettext + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gettext && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gettext)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-gettext)) + @endif gettext + + +@@ -15856,9 +16005,9 @@ configure-stage1-gmp: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ +@@ -15887,9 +16036,9 @@ configure-stage2-gmp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ +@@ -15918,9 +16067,9 @@ configure-stageb2g0-gmp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ +@@ -15949,9 +16098,9 @@ configure-stage3-gmp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ +@@ -15980,9 +16129,9 @@ configure-stageb3g2-gmp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ +@@ -16011,9 +16160,9 @@ configure-stage4-gmp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ +@@ -16042,9 +16191,9 @@ configure-stageprofile-gmp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ +@@ -16073,9 +16222,9 @@ configure-stagefeedback-gmp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/gmp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp ; \ + cd $(HOST_SUBDIR)/gmp || exit 1; \ +@@ -16110,7 +16259,8 @@ all-gmp: configure-gmp + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gmp)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-gmp)) + @endif gmp + + +@@ -16129,8 +16279,11 @@ all-stage1-gmp: configure-stage1-gmp + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ + $(TARGET-stage1-gmp) + + maybe-clean-stage1-gmp: clean-stage1-gmp +@@ -16143,7 +16296,7 @@ clean-stage1-gmp: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean + @endif gmp-bootstrap + +@@ -16163,8 +16316,11 @@ all-stage2-gmp: configure-stage2-gmp + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-gmp) + + maybe-clean-stage2-gmp: clean-stage2-gmp +@@ -16177,7 +16333,7 @@ clean-stage2-gmp: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gmp-bootstrap +@@ -16198,8 +16354,11 @@ all-stageb2g0-gmp: configure-stageb2g0-g + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb2g0-gmp) + + maybe-clean-stageb2g0-gmp: clean-stageb2g0-gmp +@@ -16212,7 +16371,7 @@ clean-stageb2g0-gmp: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gmp-bootstrap +@@ -16233,8 +16392,11 @@ all-stage3-gmp: configure-stage3-gmp + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-gmp) + + maybe-clean-stage3-gmp: clean-stage3-gmp +@@ -16247,7 +16409,7 @@ clean-stage3-gmp: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gmp-bootstrap +@@ -16268,8 +16430,11 @@ all-stageb3g2-gmp: configure-stageb3g2-g + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb3g2-gmp) + + maybe-clean-stageb3g2-gmp: clean-stageb3g2-gmp +@@ -16282,7 +16447,7 @@ clean-stageb3g2-gmp: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gmp-bootstrap +@@ -16303,8 +16468,11 @@ all-stage4-gmp: configure-stage4-gmp + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-gmp) + + maybe-clean-stage4-gmp: clean-stage4-gmp +@@ -16317,7 +16485,7 @@ clean-stage4-gmp: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gmp-bootstrap +@@ -16338,8 +16506,11 @@ all-stageprofile-gmp: configure-stagepro + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-gmp) + + maybe-clean-stageprofile-gmp: clean-stageprofile-gmp +@@ -16352,7 +16523,7 @@ clean-stageprofile-gmp: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gmp-bootstrap +@@ -16373,8 +16544,11 @@ all-stagefeedback-gmp: configure-stagefe + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-gmp) + + maybe-clean-stagefeedback-gmp: clean-stagefeedback-gmp +@@ -16387,7 +16561,7 @@ clean-stagefeedback-gmp: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/gmp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif gmp-bootstrap +@@ -16788,9 +16962,9 @@ configure-stage1-mpfr: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ +@@ -16819,9 +16993,9 @@ configure-stage2-mpfr: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ +@@ -16850,9 +17024,9 @@ configure-stageb2g0-mpfr: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ +@@ -16881,9 +17055,9 @@ configure-stage3-mpfr: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ +@@ -16912,9 +17086,9 @@ configure-stageb3g2-mpfr: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ +@@ -16943,9 +17117,9 @@ configure-stage4-mpfr: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ +@@ -16974,9 +17148,9 @@ configure-stageprofile-mpfr: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ +@@ -17005,9 +17179,9 @@ configure-stagefeedback-mpfr: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/mpfr ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr ; \ + cd $(HOST_SUBDIR)/mpfr || exit 1; \ +@@ -17042,7 +17216,8 @@ all-mpfr: configure-mpfr + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-mpfr)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-mpfr)) + @endif mpfr + + +@@ -17061,8 +17236,11 @@ all-stage1-mpfr: configure-stage1-mpfr + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ + $(TARGET-stage1-mpfr) + + maybe-clean-stage1-mpfr: clean-stage1-mpfr +@@ -17075,7 +17253,7 @@ clean-stage1-mpfr: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean + @endif mpfr-bootstrap + +@@ -17095,8 +17273,11 @@ all-stage2-mpfr: configure-stage2-mpfr + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-mpfr) + + maybe-clean-stage2-mpfr: clean-stage2-mpfr +@@ -17109,7 +17290,7 @@ clean-stage2-mpfr: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif mpfr-bootstrap +@@ -17130,8 +17311,11 @@ all-stageb2g0-mpfr: configure-stageb2g0- + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb2g0-mpfr) + + maybe-clean-stageb2g0-mpfr: clean-stageb2g0-mpfr +@@ -17144,7 +17328,7 @@ clean-stageb2g0-mpfr: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif mpfr-bootstrap +@@ -17165,8 +17349,11 @@ all-stage3-mpfr: configure-stage3-mpfr + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-mpfr) + + maybe-clean-stage3-mpfr: clean-stage3-mpfr +@@ -17179,7 +17366,7 @@ clean-stage3-mpfr: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif mpfr-bootstrap +@@ -17200,8 +17387,11 @@ all-stageb3g2-mpfr: configure-stageb3g2- + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb3g2-mpfr) + + maybe-clean-stageb3g2-mpfr: clean-stageb3g2-mpfr +@@ -17214,7 +17404,7 @@ clean-stageb3g2-mpfr: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif mpfr-bootstrap +@@ -17235,8 +17425,11 @@ all-stage4-mpfr: configure-stage4-mpfr + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-mpfr) + + maybe-clean-stage4-mpfr: clean-stage4-mpfr +@@ -17249,7 +17442,7 @@ clean-stage4-mpfr: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif mpfr-bootstrap +@@ -17270,8 +17463,11 @@ all-stageprofile-mpfr: configure-stagepr + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-mpfr) + + maybe-clean-stageprofile-mpfr: clean-stageprofile-mpfr +@@ -17284,7 +17480,7 @@ clean-stageprofile-mpfr: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif mpfr-bootstrap +@@ -17305,8 +17501,11 @@ all-stagefeedback-mpfr: configure-stagef + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-mpfr) + + maybe-clean-stagefeedback-mpfr: clean-stagefeedback-mpfr +@@ -17319,7 +17518,7 @@ clean-stagefeedback-mpfr: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/mpfr && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif mpfr-bootstrap +@@ -17727,7 +17926,8 @@ all-gnuserv: configure-gnuserv + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gnuserv && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gnuserv)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-gnuserv)) + @endif gnuserv + + +@@ -18151,7 +18351,8 @@ all-gprof: configure-gprof + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gprof && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gprof)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-gprof)) + @endif gprof + + +@@ -18575,7 +18776,8 @@ all-gzip: configure-gzip + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gzip && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gzip)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-gzip)) + @endif gzip + + +@@ -18999,7 +19201,8 @@ all-hello: configure-hello + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/hello && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-hello)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-hello)) + @endif hello + + +@@ -19423,7 +19626,8 @@ all-indent: configure-indent + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/indent && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-indent)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-indent)) + @endif indent + + +@@ -19840,9 +20044,9 @@ configure-stage1-intl: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ +@@ -19871,9 +20075,9 @@ configure-stage2-intl: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ +@@ -19902,9 +20106,9 @@ configure-stageb2g0-intl: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ +@@ -19933,9 +20137,9 @@ configure-stage3-intl: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ +@@ -19964,9 +20168,9 @@ configure-stageb3g2-intl: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ +@@ -19995,9 +20199,9 @@ configure-stage4-intl: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ +@@ -20026,9 +20230,9 @@ configure-stageprofile-intl: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ +@@ -20057,9 +20261,9 @@ configure-stagefeedback-intl: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/intl ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ +@@ -20094,7 +20298,8 @@ all-intl: configure-intl + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-intl)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-intl)) + @endif intl + + +@@ -20113,8 +20318,11 @@ all-stage1-intl: configure-stage1-intl + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ + $(TARGET-stage1-intl) + + maybe-clean-stage1-intl: clean-stage1-intl +@@ -20127,7 +20335,7 @@ clean-stage1-intl: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean + @endif intl-bootstrap + +@@ -20147,8 +20355,11 @@ all-stage2-intl: configure-stage2-intl + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-intl) + + maybe-clean-stage2-intl: clean-stage2-intl +@@ -20161,7 +20372,7 @@ clean-stage2-intl: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif intl-bootstrap +@@ -20182,8 +20393,11 @@ all-stageb2g0-intl: configure-stageb2g0- + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb2g0-intl) + + maybe-clean-stageb2g0-intl: clean-stageb2g0-intl +@@ -20196,7 +20410,7 @@ clean-stageb2g0-intl: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif intl-bootstrap +@@ -20217,8 +20431,11 @@ all-stage3-intl: configure-stage3-intl + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-intl) + + maybe-clean-stage3-intl: clean-stage3-intl +@@ -20231,7 +20448,7 @@ clean-stage3-intl: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif intl-bootstrap +@@ -20252,8 +20469,11 @@ all-stageb3g2-intl: configure-stageb3g2- + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb3g2-intl) + + maybe-clean-stageb3g2-intl: clean-stageb3g2-intl +@@ -20266,7 +20486,7 @@ clean-stageb3g2-intl: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif intl-bootstrap +@@ -20287,8 +20507,11 @@ all-stage4-intl: configure-stage4-intl + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-intl) + + maybe-clean-stage4-intl: clean-stage4-intl +@@ -20301,7 +20524,7 @@ clean-stage4-intl: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif intl-bootstrap +@@ -20322,8 +20545,11 @@ all-stageprofile-intl: configure-stagepr + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-intl) + + maybe-clean-stageprofile-intl: clean-stageprofile-intl +@@ -20336,7 +20562,7 @@ clean-stageprofile-intl: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif intl-bootstrap +@@ -20357,8 +20583,11 @@ all-stagefeedback-intl: configure-stagef + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-intl) + + maybe-clean-stagefeedback-intl: clean-stagefeedback-intl +@@ -20371,7 +20600,7 @@ clean-stagefeedback-intl: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/intl && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif intl-bootstrap +@@ -20785,7 +21014,8 @@ all-tcl: configure-tcl + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/tcl && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-tcl)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-tcl)) + @endif tcl + + +@@ -21194,7 +21424,8 @@ all-itcl: configure-itcl + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/itcl && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-itcl)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-itcl)) + @endif itcl + + +@@ -21611,9 +21842,9 @@ configure-stage1-ld: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ +@@ -21642,9 +21873,9 @@ configure-stage2-ld: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ +@@ -21673,9 +21904,9 @@ configure-stageb2g0-ld: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ +@@ -21704,9 +21935,9 @@ configure-stage3-ld: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ +@@ -21735,9 +21966,9 @@ configure-stageb3g2-ld: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ +@@ -21766,9 +21997,9 @@ configure-stage4-ld: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ +@@ -21797,9 +22028,9 @@ configure-stageprofile-ld: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ +@@ -21828,9 +22059,9 @@ configure-stagefeedback-ld: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/ld ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ +@@ -21865,7 +22096,8 @@ all-ld: configure-ld + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-ld)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-ld)) + @endif ld + + +@@ -21884,8 +22116,11 @@ all-stage1-ld: configure-stage1-ld + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ + $(TARGET-stage1-ld) + + maybe-clean-stage1-ld: clean-stage1-ld +@@ -21898,7 +22133,7 @@ clean-stage1-ld: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean + @endif ld-bootstrap + +@@ -21918,8 +22153,11 @@ all-stage2-ld: configure-stage2-ld + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-ld) + + maybe-clean-stage2-ld: clean-stage2-ld +@@ -21932,7 +22170,7 @@ clean-stage2-ld: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif ld-bootstrap +@@ -21953,8 +22191,11 @@ all-stageb2g0-ld: configure-stageb2g0-ld + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb2g0-ld) + + maybe-clean-stageb2g0-ld: clean-stageb2g0-ld +@@ -21967,7 +22208,7 @@ clean-stageb2g0-ld: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif ld-bootstrap +@@ -21988,8 +22229,11 @@ all-stage3-ld: configure-stage3-ld + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-ld) + + maybe-clean-stage3-ld: clean-stage3-ld +@@ -22002,7 +22246,7 @@ clean-stage3-ld: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif ld-bootstrap +@@ -22023,8 +22267,11 @@ all-stageb3g2-ld: configure-stageb3g2-ld + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb3g2-ld) + + maybe-clean-stageb3g2-ld: clean-stageb3g2-ld +@@ -22037,7 +22284,7 @@ clean-stageb3g2-ld: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif ld-bootstrap +@@ -22058,8 +22305,11 @@ all-stage4-ld: configure-stage4-ld + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-ld) + + maybe-clean-stage4-ld: clean-stage4-ld +@@ -22072,7 +22322,7 @@ clean-stage4-ld: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif ld-bootstrap +@@ -22093,8 +22343,11 @@ all-stageprofile-ld: configure-stageprof + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-ld) + + maybe-clean-stageprofile-ld: clean-stageprofile-ld +@@ -22107,7 +22360,7 @@ clean-stageprofile-ld: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif ld-bootstrap +@@ -22128,8 +22381,11 @@ all-stagefeedback-ld: configure-stagefee + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-ld) + + maybe-clean-stagefeedback-ld: clean-stagefeedback-ld +@@ -22142,7 +22398,7 @@ clean-stagefeedback-ld: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/ld && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif ld-bootstrap +@@ -22549,9 +22805,9 @@ configure-stage1-libcpp: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ +@@ -22580,9 +22836,9 @@ configure-stage2-libcpp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ +@@ -22611,9 +22867,9 @@ configure-stageb2g0-libcpp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ +@@ -22642,9 +22898,9 @@ configure-stage3-libcpp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ +@@ -22673,9 +22929,9 @@ configure-stageb3g2-libcpp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ +@@ -22704,9 +22960,9 @@ configure-stage4-libcpp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ +@@ -22735,9 +22991,9 @@ configure-stageprofile-libcpp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ +@@ -22766,9 +23022,9 @@ configure-stagefeedback-libcpp: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/libcpp ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ +@@ -22803,7 +23059,8 @@ all-libcpp: configure-libcpp + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libcpp)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-libcpp)) + @endif libcpp + + +@@ -22822,8 +23079,11 @@ all-stage1-libcpp: configure-stage1-libc + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ + $(TARGET-stage1-libcpp) + + maybe-clean-stage1-libcpp: clean-stage1-libcpp +@@ -22836,7 +23096,7 @@ clean-stage1-libcpp: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean + @endif libcpp-bootstrap + +@@ -22856,8 +23116,11 @@ all-stage2-libcpp: configure-stage2-libc + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-libcpp) + + maybe-clean-stage2-libcpp: clean-stage2-libcpp +@@ -22870,7 +23133,7 @@ clean-stage2-libcpp: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libcpp-bootstrap +@@ -22891,8 +23154,11 @@ all-stageb2g0-libcpp: configure-stageb2g + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb2g0-libcpp) + + maybe-clean-stageb2g0-libcpp: clean-stageb2g0-libcpp +@@ -22905,7 +23171,7 @@ clean-stageb2g0-libcpp: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libcpp-bootstrap +@@ -22926,8 +23192,11 @@ all-stage3-libcpp: configure-stage3-libc + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-libcpp) + + maybe-clean-stage3-libcpp: clean-stage3-libcpp +@@ -22940,7 +23209,7 @@ clean-stage3-libcpp: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libcpp-bootstrap +@@ -22961,8 +23230,11 @@ all-stageb3g2-libcpp: configure-stageb3g + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb3g2-libcpp) + + maybe-clean-stageb3g2-libcpp: clean-stageb3g2-libcpp +@@ -22975,7 +23247,7 @@ clean-stageb3g2-libcpp: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libcpp-bootstrap +@@ -22996,8 +23268,11 @@ all-stage4-libcpp: configure-stage4-libc + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-libcpp) + + maybe-clean-stage4-libcpp: clean-stage4-libcpp +@@ -23010,7 +23285,7 @@ clean-stage4-libcpp: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libcpp-bootstrap +@@ -23031,8 +23306,11 @@ all-stageprofile-libcpp: configure-stage + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-libcpp) + + maybe-clean-stageprofile-libcpp: clean-stageprofile-libcpp +@@ -23045,7 +23323,7 @@ clean-stageprofile-libcpp: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libcpp-bootstrap +@@ -23066,8 +23344,11 @@ all-stagefeedback-libcpp: configure-stag + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-libcpp) + + maybe-clean-stagefeedback-libcpp: clean-stagefeedback-libcpp +@@ -23080,7 +23361,7 @@ clean-stagefeedback-libcpp: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/libcpp && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libcpp-bootstrap +@@ -23487,9 +23768,9 @@ configure-stage1-libdecnumber: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ +@@ -23518,9 +23799,9 @@ configure-stage2-libdecnumber: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ +@@ -23549,9 +23830,9 @@ configure-stageb2g0-libdecnumber: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ +@@ -23580,9 +23861,9 @@ configure-stage3-libdecnumber: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ +@@ -23611,9 +23892,9 @@ configure-stageb3g2-libdecnumber: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ +@@ -23642,9 +23923,9 @@ configure-stage4-libdecnumber: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ +@@ -23673,9 +23954,9 @@ configure-stageprofile-libdecnumber: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ +@@ -23704,9 +23985,9 @@ configure-stagefeedback-libdecnumber: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/libdecnumber ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber ; \ + cd $(HOST_SUBDIR)/libdecnumber || exit 1; \ +@@ -23741,7 +24022,8 @@ all-libdecnumber: configure-libdecnumber + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libdecnumber)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-libdecnumber)) + @endif libdecnumber + + +@@ -23760,8 +24042,11 @@ all-stage1-libdecnumber: configure-stage + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ + $(TARGET-stage1-libdecnumber) + + maybe-clean-stage1-libdecnumber: clean-stage1-libdecnumber +@@ -23774,7 +24059,7 @@ clean-stage1-libdecnumber: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean + @endif libdecnumber-bootstrap + +@@ -23794,8 +24079,11 @@ all-stage2-libdecnumber: configure-stage + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-libdecnumber) + + maybe-clean-stage2-libdecnumber: clean-stage2-libdecnumber +@@ -23808,7 +24096,7 @@ clean-stage2-libdecnumber: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libdecnumber-bootstrap +@@ -23829,8 +24117,11 @@ all-stageb2g0-libdecnumber: configure-st + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb2g0-libdecnumber) + + maybe-clean-stageb2g0-libdecnumber: clean-stageb2g0-libdecnumber +@@ -23843,7 +24134,7 @@ clean-stageb2g0-libdecnumber: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libdecnumber-bootstrap +@@ -23864,8 +24155,11 @@ all-stage3-libdecnumber: configure-stage + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-libdecnumber) + + maybe-clean-stage3-libdecnumber: clean-stage3-libdecnumber +@@ -23878,7 +24172,7 @@ clean-stage3-libdecnumber: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libdecnumber-bootstrap +@@ -23899,8 +24193,11 @@ all-stageb3g2-libdecnumber: configure-st + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb3g2-libdecnumber) + + maybe-clean-stageb3g2-libdecnumber: clean-stageb3g2-libdecnumber +@@ -23913,7 +24210,7 @@ clean-stageb3g2-libdecnumber: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libdecnumber-bootstrap +@@ -23934,8 +24231,11 @@ all-stage4-libdecnumber: configure-stage + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-libdecnumber) + + maybe-clean-stage4-libdecnumber: clean-stage4-libdecnumber +@@ -23948,7 +24248,7 @@ clean-stage4-libdecnumber: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libdecnumber-bootstrap +@@ -23969,8 +24269,11 @@ all-stageprofile-libdecnumber: configure + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-libdecnumber) + + maybe-clean-stageprofile-libdecnumber: clean-stageprofile-libdecnumber +@@ -23983,7 +24286,7 @@ clean-stageprofile-libdecnumber: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libdecnumber-bootstrap +@@ -24004,8 +24307,11 @@ all-stagefeedback-libdecnumber: configur + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-libdecnumber) + + maybe-clean-stagefeedback-libdecnumber: clean-stagefeedback-libdecnumber +@@ -24018,7 +24324,7 @@ clean-stagefeedback-libdecnumber: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/libdecnumber && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libdecnumber-bootstrap +@@ -24432,7 +24738,8 @@ all-libgui: configure-libgui + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libgui && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libgui)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-libgui)) + @endif libgui + + +@@ -24849,9 +25156,9 @@ configure-stage1-libiberty: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ +@@ -24880,9 +25187,9 @@ configure-stage2-libiberty: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ +@@ -24911,9 +25218,9 @@ configure-stageb2g0-libiberty: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ +@@ -24942,9 +25249,9 @@ configure-stage3-libiberty: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ +@@ -24973,9 +25280,9 @@ configure-stageb3g2-libiberty: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ +@@ -25004,9 +25311,9 @@ configure-stage4-libiberty: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ +@@ -25035,9 +25342,9 @@ configure-stageprofile-libiberty: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ +@@ -25066,9 +25373,9 @@ configure-stagefeedback-libiberty: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/libiberty ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ +@@ -25103,7 +25410,8 @@ all-libiberty: configure-libiberty + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libiberty)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-libiberty)) + @endif libiberty + + +@@ -25122,8 +25430,11 @@ all-stage1-libiberty: configure-stage1-l + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ + $(TARGET-stage1-libiberty) + + maybe-clean-stage1-libiberty: clean-stage1-libiberty +@@ -25136,7 +25447,7 @@ clean-stage1-libiberty: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean + @endif libiberty-bootstrap + +@@ -25156,8 +25467,11 @@ all-stage2-libiberty: configure-stage2-l + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-libiberty) + + maybe-clean-stage2-libiberty: clean-stage2-libiberty +@@ -25170,7 +25484,7 @@ clean-stage2-libiberty: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libiberty-bootstrap +@@ -25191,8 +25505,11 @@ all-stageb2g0-libiberty: configure-stage + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb2g0-libiberty) + + maybe-clean-stageb2g0-libiberty: clean-stageb2g0-libiberty +@@ -25205,7 +25522,7 @@ clean-stageb2g0-libiberty: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libiberty-bootstrap +@@ -25226,8 +25543,11 @@ all-stage3-libiberty: configure-stage3-l + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-libiberty) + + maybe-clean-stage3-libiberty: clean-stage3-libiberty +@@ -25240,7 +25560,7 @@ clean-stage3-libiberty: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libiberty-bootstrap +@@ -25261,8 +25581,11 @@ all-stageb3g2-libiberty: configure-stage + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb3g2-libiberty) + + maybe-clean-stageb3g2-libiberty: clean-stageb3g2-libiberty +@@ -25275,7 +25598,7 @@ clean-stageb3g2-libiberty: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libiberty-bootstrap +@@ -25296,8 +25619,11 @@ all-stage4-libiberty: configure-stage4-l + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-libiberty) + + maybe-clean-stage4-libiberty: clean-stage4-libiberty +@@ -25310,7 +25636,7 @@ clean-stage4-libiberty: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libiberty-bootstrap +@@ -25331,8 +25657,11 @@ all-stageprofile-libiberty: configure-st + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-libiberty) + + maybe-clean-stageprofile-libiberty: clean-stageprofile-libiberty +@@ -25345,7 +25674,7 @@ clean-stageprofile-libiberty: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libiberty-bootstrap +@@ -25366,8 +25695,11 @@ all-stagefeedback-libiberty: configure-s + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-libiberty) + + maybe-clean-stagefeedback-libiberty: clean-stagefeedback-libiberty +@@ -25380,7 +25712,7 @@ clean-stagefeedback-libiberty: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/libiberty && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif libiberty-bootstrap +@@ -25794,7 +26126,8 @@ all-libtool: configure-libtool + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libtool && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libtool)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-libtool)) + @endif libtool + + +@@ -26218,7 +26551,8 @@ all-m4: configure-m4 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/m4 && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-m4)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-m4)) + @endif m4 + + +@@ -26642,7 +26976,8 @@ all-make: configure-make + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/make && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-make)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-make)) + @endif make + + +@@ -27066,7 +27401,8 @@ all-mmalloc: configure-mmalloc + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/mmalloc && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-mmalloc)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-mmalloc)) + @endif mmalloc + + +@@ -27484,7 +27820,8 @@ all-patch: configure-patch + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/patch && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-patch)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-patch)) + @endif patch + + +@@ -27908,7 +28245,8 @@ all-perl: configure-perl + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/perl && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-perl)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-perl)) + @endif perl + + +@@ -28332,7 +28670,8 @@ all-prms: configure-prms + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/prms && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-prms)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-prms)) + @endif prms + + +@@ -28756,7 +29095,8 @@ all-rcs: configure-rcs + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/rcs && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-rcs)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-rcs)) + @endif rcs + + +@@ -29180,7 +29520,8 @@ all-readline: configure-readline + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/readline && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-readline)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-readline)) + @endif readline + + +@@ -29604,7 +29945,8 @@ all-release: configure-release + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/release && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-release)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-release)) + @endif release + + +@@ -30016,7 +30358,8 @@ all-recode: configure-recode + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/recode && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-recode)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-recode)) + @endif recode + + +@@ -30440,7 +30783,8 @@ all-sed: configure-sed + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/sed && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-sed)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-sed)) + @endif sed + + +@@ -30864,7 +31208,8 @@ all-send-pr: configure-send-pr + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/send-pr && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-send-pr)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-send-pr)) + @endif send-pr + + +@@ -31288,7 +31633,8 @@ all-shellutils: configure-shellutils + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/shellutils && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-shellutils)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-shellutils)) + @endif shellutils + + +@@ -31712,7 +32058,8 @@ all-sid: configure-sid + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/sid && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-sid)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-sid)) + @endif sid + + +@@ -32136,7 +32483,8 @@ all-sim: configure-sim + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/sim && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-sim)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-sim)) + @endif sim + + +@@ -32560,7 +32908,8 @@ all-tar: configure-tar + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/tar && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-tar)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-tar)) + @endif tar + + +@@ -32984,7 +33333,8 @@ all-texinfo: configure-texinfo + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/texinfo && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-texinfo)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-texinfo)) + @endif texinfo + + +@@ -33402,7 +33752,8 @@ all-textutils: configure-textutils + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/textutils && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-textutils)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-textutils)) + @endif textutils + + +@@ -33826,7 +34177,8 @@ all-time: configure-time + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/time && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-time)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-time)) + @endif time + + +@@ -34250,7 +34602,8 @@ all-uudecode: configure-uudecode + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/uudecode && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-uudecode)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-uudecode)) + @endif uudecode + + +@@ -34674,7 +35027,8 @@ all-wdiff: configure-wdiff + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/wdiff && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-wdiff)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-wdiff)) + @endif wdiff + + +@@ -35098,7 +35452,8 @@ all-zip: configure-zip + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/zip && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-zip)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-zip)) + @endif zip + + +@@ -35518,9 +35873,9 @@ configure-stage1-zlib: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ +- $(HOST_EXPORTS) \ ++ $(HOST_EXPORTS) \ + CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE1_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ +@@ -35549,9 +35904,9 @@ configure-stage2-zlib: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ +@@ -35580,9 +35935,9 @@ configure-stageb2g0-zlib: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -g0"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ +@@ -35611,9 +35966,9 @@ configure-stage3-zlib: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ +@@ -35642,9 +35997,9 @@ configure-stageb3g2-zlib: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -g2"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ +@@ -35673,9 +36028,9 @@ configure-stage4-zlib: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ +@@ -35704,9 +36059,9 @@ configure-stageprofile-zlib: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CXXFLAGS; \ + echo Configuring stage profile in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ +@@ -35735,9 +36090,9 @@ configure-stagefeedback-zlib: + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ + $(HOST_EXPORTS) \ +- $(POSTSTAGE1_HOST_EXPORTS) \ ++ $(POSTSTAGE1_HOST_EXPORTS) \ + CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CXXFLAGS; \ + echo Configuring stage feedback in $(HOST_SUBDIR)/zlib ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ +@@ -35772,7 +36127,8 @@ all-zlib: configure-zlib + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-zlib)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-zlib)) + @endif zlib + + +@@ -35791,8 +36147,11 @@ all-stage1-zlib: configure-stage1-zlib + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) \ + $(TARGET-stage1-zlib) + + maybe-clean-stage1-zlib: clean-stage1-zlib +@@ -35805,7 +36164,7 @@ clean-stage1-zlib: + $(MAKE) stage1-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + clean + @endif zlib-bootstrap + +@@ -35825,8 +36184,11 @@ all-stage2-zlib: configure-stage2-zlib + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage2-zlib) + + maybe-clean-stage2-zlib: clean-stage2-zlib +@@ -35839,7 +36201,7 @@ clean-stage2-zlib: + $(MAKE) stage2-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif zlib-bootstrap +@@ -35860,8 +36222,11 @@ all-stageb2g0-zlib: configure-stageb2g0- + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb2g0-zlib) + + maybe-clean-stageb2g0-zlib: clean-stageb2g0-zlib +@@ -35874,7 +36239,7 @@ clean-stageb2g0-zlib: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif zlib-bootstrap +@@ -35895,8 +36260,11 @@ all-stage3-zlib: configure-stage3-zlib + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage3-zlib) + + maybe-clean-stage3-zlib: clean-stage3-zlib +@@ -35909,7 +36277,7 @@ clean-stage3-zlib: + $(MAKE) stage3-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif zlib-bootstrap +@@ -35930,8 +36298,11 @@ all-stageb3g2-zlib: configure-stageb3g2- + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageb3g2-zlib) + + maybe-clean-stageb3g2-zlib: clean-stageb3g2-zlib +@@ -35944,7 +36315,7 @@ clean-stageb3g2-zlib: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif zlib-bootstrap +@@ -35965,8 +36336,11 @@ all-stage4-zlib: configure-stage4-zlib + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stage4-zlib) + + maybe-clean-stage4-zlib: clean-stage4-zlib +@@ -35979,7 +36353,7 @@ clean-stage4-zlib: + $(MAKE) stage4-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif zlib-bootstrap +@@ -36000,8 +36374,11 @@ all-stageprofile-zlib: configure-stagepr + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stageprofile-zlib) + + maybe-clean-stageprofile-zlib: clean-stageprofile-zlib +@@ -36014,7 +36391,7 @@ clean-stageprofile-zlib: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif zlib-bootstrap +@@ -36035,8 +36412,11 @@ all-stagefeedback-zlib: configure-stagef + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" $(POSTSTAGE1_FLAGS_TO_PASS) \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(TARGET-stagefeedback-zlib) + + maybe-clean-stagefeedback-zlib: clean-stagefeedback-zlib +@@ -36049,7 +36429,7 @@ clean-stagefeedback-zlib: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(HOST_SUBDIR)/zlib && \ +- $(MAKE) $(FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_HOST_FLAGS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean + @endif zlib-bootstrap +@@ -36451,7 +36831,8 @@ all-gdb: configure-gdb + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gdb && \ +- $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-gdb)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS) \ ++ $(TARGET-gdb)) + @endif gdb + + +@@ -36875,7 +37256,8 @@ all-expect: configure-expect + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/expect && \ +- $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-expect)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS) \ ++ $(TARGET-expect)) + @endif expect + + +@@ -37299,7 +37681,8 @@ all-guile: configure-guile + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/guile && \ +- $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-guile)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS) \ ++ $(TARGET-guile)) + @endif guile + + +@@ -37723,7 +38106,8 @@ all-tk: configure-tk + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/tk && \ +- $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-tk)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS) \ ++ $(TARGET-tk)) + @endif tk + + +@@ -38147,7 +38531,8 @@ all-libtermcap: configure-libtermcap + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/libtermcap && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libtermcap)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-libtermcap)) + @endif libtermcap + + +@@ -38505,7 +38890,8 @@ all-utils: configure-utils + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/utils && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-utils)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-utils)) + @endif utils + + +@@ -38923,7 +39309,8 @@ all-gnattools: configure-gnattools + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gnattools && \ +- $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gnattools)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) \ ++ $(TARGET-gnattools)) + @endif gnattools + + +@@ -39368,7 +39755,8 @@ all-target-libstdc++-v3: configure-targe + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' $(TARGET-target-libstdc++-v3)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ ++ $(TARGET-target-libstdc++-v3)) + @endif target-libstdc++-v3 + + +@@ -39809,7 +40197,8 @@ all-target-libmudflap: configure-target- + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libmudflap && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libmudflap)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-libmudflap)) + @endif target-libmudflap + + +@@ -40250,7 +40639,8 @@ all-target-libssp: configure-target-libs + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libssp && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libssp)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-libssp)) + @endif target-libssp + + +@@ -40691,7 +41081,8 @@ all-target-newlib: configure-target-newl + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/newlib && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-newlib)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-newlib)) + @endif target-newlib + + +@@ -41137,9 +41528,9 @@ configure-stage1-target-libgcc: + mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \ + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ +- $(NORMAL_TARGET_EXPORTS) \ +- CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE1_CFLAGS)"; export LIBCFLAGS; \ ++ $(NORMAL_TARGET_EXPORTS) \ ++ CFLAGS="$(STAGE1_LIBCFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ ++ CXXFLAGS="$(STAGE1_LIBCFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + echo Configuring stage 1 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ +@@ -41180,9 +41571,9 @@ configure-stage2-target-libgcc: + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ +- \ +- CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ ++ \ ++ CFLAGS="$(STAGE2_LIBCFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ ++ CXXFLAGS="$(STAGE2_LIBCFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + echo Configuring stage 2 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ +@@ -41223,9 +41614,9 @@ configure-stageb2g0-target-libgcc: + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ +- \ +- CFLAGS="$(STAGE2_CFLAGS) -g0"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -g0"; export LIBCFLAGS; \ ++ \ ++ CFLAGS="$(STAGE2_LIBCFLAGS) -g0 $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ ++ CXXFLAGS="$(STAGE2_LIBCFLAGS) -g0 $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + echo Configuring stage b2g0 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ +@@ -41266,9 +41657,9 @@ configure-stage3-target-libgcc: + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ +- \ +- CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ ++ \ ++ CFLAGS="$(STAGE3_LIBCFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ ++ CXXFLAGS="$(STAGE3_LIBCFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + echo Configuring stage 3 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ +@@ -41309,9 +41700,9 @@ configure-stageb3g2-target-libgcc: + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ +- \ +- CFLAGS="$(STAGE3_CFLAGS) -g2"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -g2"; export LIBCFLAGS; \ ++ \ ++ CFLAGS="$(STAGE3_LIBCFLAGS) -g2 $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ ++ CXXFLAGS="$(STAGE3_LIBCFLAGS) -g2 $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + echo Configuring stage b3g2 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ +@@ -41352,9 +41743,9 @@ configure-stage4-target-libgcc: + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ +- \ +- CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ ++ \ ++ CFLAGS="$(STAGE4_CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ ++ CXXFLAGS="$(STAGE4_CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + echo Configuring stage 4 in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ +@@ -41395,9 +41786,9 @@ configure-stageprofile-target-libgcc: + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ +- \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate"; export LIBCFLAGS; \ ++ \ ++ CFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ ++ CXXFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + echo Configuring stage profile in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ +@@ -41438,9 +41829,9 @@ configure-stagefeedback-target-libgcc: + fi; \ + test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ + $(NORMAL_TARGET_EXPORTS) \ +- \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export CFLAGS; \ +- LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use"; export LIBCFLAGS; \ ++ \ ++ CFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ ++ CXXFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + echo Configuring stage feedback in $(TARGET_SUBDIR)/libgcc ; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc ; \ + cd $(TARGET_SUBDIR)/libgcc || exit 1; \ +@@ -41475,7 +41866,8 @@ all-target-libgcc: configure-target-libg + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgcc)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-libgcc)) + @endif target-libgcc + + +@@ -41494,8 +41886,11 @@ all-stage1-target-libgcc: configure-stag + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE1_CFLAGS)" LIBCFLAGS="$(STAGE1_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE1_CFLAGS)" CXXFLAGS="$(STAGE1_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE1_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE1_LIBCFLAGS)" $(EXTRA_TARGET_FLAGS) \ + $(TARGET-stage1-target-libgcc) + + maybe-clean-stage1-target-libgcc: clean-stage1-target-libgcc +@@ -41508,7 +41903,7 @@ clean-stage1-target-libgcc: + $(MAKE) stage1-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_TARGET_FLAGS) \ + clean + @endif target-libgcc-bootstrap + +@@ -41528,8 +41923,11 @@ all-stage2-target-libgcc: configure-stag + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS)" LIBCFLAGS="$(STAGE2_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS)" CXXFLAGS="$(STAGE2_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS)" $(EXTRA_TARGET_FLAGS) \ + $(TARGET-stage2-target-libgcc) + + maybe-clean-stage2-target-libgcc: clean-stage2-target-libgcc +@@ -41542,7 +41940,7 @@ clean-stage2-target-libgcc: + $(MAKE) stage2-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean + @endif target-libgcc-bootstrap +@@ -41563,8 +41961,11 @@ all-stageb2g0-target-libgcc: configure-s + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -g0" LIBCFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -g0" CXXFLAGS="$(STAGE2_CFLAGS) -g0" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -g0" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -g0" $(EXTRA_TARGET_FLAGS) \ + $(TARGET-stageb2g0-target-libgcc) + + maybe-clean-stageb2g0-target-libgcc: clean-stageb2g0-target-libgcc +@@ -41577,7 +41978,7 @@ clean-stageb2g0-target-libgcc: + $(MAKE) stageb2g0-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean + @endif target-libgcc-bootstrap +@@ -41598,8 +41999,11 @@ all-stage3-target-libgcc: configure-stag + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS)" LIBCFLAGS="$(STAGE3_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS)" CXXFLAGS="$(STAGE3_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS)" $(EXTRA_TARGET_FLAGS) \ + $(TARGET-stage3-target-libgcc) + + maybe-clean-stage3-target-libgcc: clean-stage3-target-libgcc +@@ -41612,7 +42016,7 @@ clean-stage3-target-libgcc: + $(MAKE) stage3-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean + @endif target-libgcc-bootstrap +@@ -41633,8 +42037,11 @@ all-stageb3g2-target-libgcc: configure-s + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -g2" LIBCFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -g2" CXXFLAGS="$(STAGE3_CFLAGS) -g2" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -g2" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -g2" $(EXTRA_TARGET_FLAGS) \ + $(TARGET-stageb3g2-target-libgcc) + + maybe-clean-stageb3g2-target-libgcc: clean-stageb3g2-target-libgcc +@@ -41647,7 +42054,7 @@ clean-stageb3g2-target-libgcc: + $(MAKE) stageb3g2-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean + @endif target-libgcc-bootstrap +@@ -41668,8 +42075,11 @@ all-stage4-target-libgcc: configure-stag + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE4_CFLAGS)" LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE4_CFLAGS)" CXXFLAGS="$(STAGE4_CFLAGS)" \ ++ LIBCFLAGS="$(STAGE4_CFLAGS)" \ ++ CFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE4_CFLAGS)" $(EXTRA_TARGET_FLAGS) \ + $(TARGET-stage4-target-libgcc) + + maybe-clean-stage4-target-libgcc: clean-stage4-target-libgcc +@@ -41682,7 +42092,7 @@ clean-stage4-target-libgcc: + $(MAKE) stage4-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean + @endif target-libgcc-bootstrap +@@ -41703,8 +42113,11 @@ all-stageprofile-target-libgcc: configur + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" LIBCFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" CXXFLAGS="$(STAGE2_CFLAGS) -fprofile-generate" \ ++ LIBCFLAGS="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE2_LIBCFLAGS) -fprofile-generate" $(EXTRA_TARGET_FLAGS) \ + $(TARGET-stageprofile-target-libgcc) + + maybe-clean-stageprofile-target-libgcc: clean-stageprofile-target-libgcc +@@ -41717,7 +42130,7 @@ clean-stageprofile-target-libgcc: + $(MAKE) stageprofile-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean + @endif target-libgcc-bootstrap +@@ -41738,8 +42151,11 @@ all-stagefeedback-target-libgcc: configu + $(NORMAL_TARGET_EXPORTS) \ + \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ +- CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" LIBCFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ $(MAKE) $(BASE_FLAGS_TO_PASS) \ ++ CFLAGS="$(STAGE3_CFLAGS) -fprofile-use" CXXFLAGS="$(STAGE3_CFLAGS) -fprofile-use" \ ++ LIBCFLAGS="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" \ ++ CXXFLAGS_FOR_TARGET="$(STAGE3_LIBCFLAGS) -fprofile-use" $(EXTRA_TARGET_FLAGS) \ + $(TARGET-stagefeedback-target-libgcc) + + maybe-clean-stagefeedback-target-libgcc: clean-stagefeedback-target-libgcc +@@ -41752,7 +42168,7 @@ clean-stagefeedback-target-libgcc: + $(MAKE) stagefeedback-start; \ + fi; \ + cd $(TARGET_SUBDIR)/libgcc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) \ ++ $(MAKE) $(EXTRA_TARGET_FLAGS) \ + \ + clean + @endif target-libgcc-bootstrap +@@ -42191,7 +42607,8 @@ all-target-libgfortran: configure-target + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgfortran && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgfortran)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-libgfortran)) + @endif target-libgfortran + + +@@ -42632,7 +43049,8 @@ all-target-libobjc: configure-target-lib + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libobjc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libobjc)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-libobjc)) + @endif target-libobjc + + +@@ -43073,7 +43491,8 @@ all-target-libtermcap: configure-target- + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libtermcap && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libtermcap)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-libtermcap)) + @endif target-libtermcap + + +@@ -43449,7 +43868,8 @@ all-target-winsup: configure-target-wins + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/winsup && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-winsup)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-winsup)) + @endif target-winsup + + +@@ -43890,7 +44310,8 @@ all-target-libgloss: configure-target-li + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgloss && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgloss)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-libgloss)) + @endif target-libgloss + + +@@ -44326,7 +44747,8 @@ all-target-libiberty: configure-target-l + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libiberty && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libiberty)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-libiberty)) + @endif target-libiberty + + +@@ -44767,7 +45189,8 @@ all-target-gperf: configure-target-gperf + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/gperf && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-gperf)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-gperf)) + @endif target-gperf + + +@@ -45208,7 +45631,8 @@ all-target-examples: configure-target-ex + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/examples && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-examples)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-examples)) + @endif target-examples + + +@@ -45639,7 +46063,8 @@ all-target-libffi: configure-target-libf + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libffi && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libffi)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-libffi)) + @endif target-libffi + + +@@ -46080,7 +46505,8 @@ all-target-libjava: configure-target-lib + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(RAW_CXX_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libjava && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' $(TARGET-target-libjava)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' \ ++ $(TARGET-target-libjava)) + @endif target-libjava + + +@@ -46521,7 +46947,8 @@ all-target-zlib: configure-target-zlib + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/zlib && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-zlib)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-zlib)) + @endif target-zlib + + +@@ -46962,7 +47389,8 @@ all-target-boehm-gc: configure-target-bo + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-boehm-gc)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-boehm-gc)) + @endif target-boehm-gc + + +@@ -47403,7 +47831,8 @@ all-target-qthreads: configure-target-qt + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/qthreads && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-qthreads)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-qthreads)) + @endif target-qthreads + + +@@ -47844,7 +48273,8 @@ all-target-rda: configure-target-rda + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/rda && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-rda)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-rda)) + @endif target-rda + + +@@ -48285,7 +48715,8 @@ all-target-libada: configure-target-liba + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libada && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libada)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-libada)) + @endif target-libada + + +@@ -48726,7 +49157,8 @@ all-target-libgomp: configure-target-lib + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(NORMAL_TARGET_EXPORTS) \ + (cd $(TARGET_SUBDIR)/libgomp && \ +- $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgomp)) ++ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ ++ $(TARGET-target-libgomp)) + @endif target-libgomp + + +Index: gcc-4.3.1/configure +=================================================================== +--- gcc-4.3.1.orig/configure 2008-02-01 19:29:30.000000000 -0800 ++++ gcc-4.3.1/configure 2008-07-21 11:22:34.000000000 -0700 +@@ -272,7 +272,7 @@ PACKAGE_STRING= + PACKAGE_BUGREPORT= + + ac_unique_file="move-if-change" +-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S TOPLEVEL_CONFIGURE_ARGUMENTS build_libsubdir build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc stage1_languages SYSROOT_CFLAGS_FOR_TARGET DEBUG_PREFIX_CFLAGS_FOR_TARGET RPATH_ENVVAR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs AR_FOR_BUILD AS_FOR_BUILD CC_FOR_BUILD CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CXX_FOR_BUILD DLLTOOL_FOR_BUILD GCJ_FOR_BUILD GFORTRAN_FOR_BUILD LDFLAGS_FOR_BUILD LD_FOR_BUILD NM_FOR_BUILD RANLIB_FOR_BUILD WINDMC_FOR_BUILD WINDRES_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES WINDMC OBJCOPY OBJDUMP CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET WINDMC_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS' ++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S TOPLEVEL_CONFIGURE_ARGUMENTS build_libsubdir build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc stage1_languages SYSROOT_CFLAGS_FOR_TARGET DEBUG_PREFIX_CFLAGS_FOR_TARGET CFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET RPATH_ENVVAR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs AR_FOR_BUILD AS_FOR_BUILD CC_FOR_BUILD CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CXX_FOR_BUILD DLLTOOL_FOR_BUILD GCJ_FOR_BUILD GFORTRAN_FOR_BUILD LDFLAGS_FOR_BUILD LD_FOR_BUILD NM_FOR_BUILD RANLIB_FOR_BUILD WINDMC_FOR_BUILD WINDRES_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES WINDMC OBJCOPY OBJDUMP CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET WINDMC_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS' + ac_subst_files='serialization_dependencies host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag' + + # Initialize some variables set by options. +@@ -5147,6 +5147,38 @@ else + fi; + + ++# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS ++# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS ++# might also be empty (or "-g", if a non-GCC C++ compiler is in the path). ++# We want to ensure that TARGET libraries (which we know are built with ++# gcc) are built with "-O2 -g", so include those options when setting ++# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. ++if test "x$CFLAGS_FOR_TARGET" = x; then ++ CFLAGS_FOR_TARGET=$CFLAGS ++ case " $CFLAGS " in ++ *" -O2 "*) ;; ++ *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;; ++ esac ++ case " $CFLAGS " in ++ *" -g "* | *" -g3 "*) ;; ++ *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;; ++ esac ++fi ++ ++ ++if test "x$CXXFLAGS_FOR_TARGET" = x; then ++ CXXFLAGS_FOR_TARGET=$CXXFLAGS ++ case " $CXXFLAGS " in ++ *" -O2 "*) ;; ++ *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;; ++ esac ++ case " $CXXFLAGS " in ++ *" -g "* | *" -g3 "*) ;; ++ *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;; ++ esac ++fi ++ ++ + # Handle --with-headers=XXX. If the value is not "yes", the contents of + # the named directory are copied to $(tooldir)/sys-include. + if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then +@@ -12825,6 +12857,8 @@ s,@gmpinc@,$gmpinc,;t t + s,@stage1_languages@,$stage1_languages,;t t + s,@SYSROOT_CFLAGS_FOR_TARGET@,$SYSROOT_CFLAGS_FOR_TARGET,;t t + s,@DEBUG_PREFIX_CFLAGS_FOR_TARGET@,$DEBUG_PREFIX_CFLAGS_FOR_TARGET,;t t ++s,@CFLAGS_FOR_TARGET@,$CFLAGS_FOR_TARGET,;t t ++s,@CXXFLAGS_FOR_TARGET@,$CXXFLAGS_FOR_TARGET,;t t + s,@RPATH_ENVVAR@,$RPATH_ENVVAR,;t t + s,@tooldir@,$tooldir,;t t + s,@build_tooldir@,$build_tooldir,;t t diff --git a/packages/gcc/gcc-cross-initial_4.3.1.bb b/packages/gcc/gcc-cross-initial_4.3.1.bb index c8738ad614..3858d8813b 100644 --- a/packages/gcc/gcc-cross-initial_4.3.1.bb +++ b/packages/gcc/gcc-cross-initial_4.3.1.bb @@ -5,6 +5,7 @@ DEPENDS += "gmp-native mpfr-native" EXTRA_OECONF += " --disable-libmudflap \ --disable-libgomp \ + --enable-decimal-float=no \ --disable-libssp" # Hack till we fix *libc properly diff --git a/packages/openmoko-projects/illume/.mtn2git_empty b/packages/iscsi-target/.mtn2git_empty index e69de29bb2..e69de29bb2 100644 --- a/packages/openmoko-projects/illume/.mtn2git_empty +++ b/packages/iscsi-target/.mtn2git_empty diff --git a/packages/openmoko-projects/tangogps/.mtn2git_empty b/packages/iscsi-target/files/.mtn2git_empty index e69de29bb2..e69de29bb2 100644 --- a/packages/openmoko-projects/tangogps/.mtn2git_empty +++ b/packages/iscsi-target/files/.mtn2git_empty diff --git a/packages/iscsi-target/files/ietd.conf b/packages/iscsi-target/files/ietd.conf new file mode 100644 index 0000000000..0a100ac664 --- /dev/null +++ b/packages/iscsi-target/files/ietd.conf @@ -0,0 +1,17 @@ +Target iqn.2007-01.org.foonas:iSCSI.sda.target1 + Lun 0 Path=/dev/sda,Type=blockio + MaxConnections 1 + HeaderDigest None + DataDigest None + InitialR2T Yes + ImmediateData No + MaxRecvDataSegmentLength 8192 + MaxXmitDataSegmentLength 8192 + MaxBurstLength 262144 + FirstBurstLength 65536 + DefaultTime2Wait 2 + DefaultTime2Retain 20 + MaxOutstandingR2T 8 + DataPDUInOrder Yes + DataSequenceInOrder Yes + ErrorRecoveryLevel 0 diff --git a/packages/iscsi-target/files/init b/packages/iscsi-target/files/init new file mode 100644 index 0000000000..d000adfe3c --- /dev/null +++ b/packages/iscsi-target/files/init @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Start the iSCSI Enterprise Target. +# + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +start_server() +{ + modprobe -q crc32c + modprobe iscsi_trgt + start-stop-daemon --start --quiet --pidfile /var/run/iscsi_trgt.pid --exec /sbin/ietd +} + +stop_server() +{ + ietadm --op delete + start-stop-daemon --stop --quiet --pidfile /var/run/iscsi_trgt.pid --exec /sbin/ietd + sleep 1 + modprobe -r iscsi_trgt +} + +case "$1" in + start) + start_server + ;; + stop) + stop_server + ;; + *) + echo "Usage: {start|stop}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/packages/iscsi-target/files/libs.patch b/packages/iscsi-target/files/libs.patch new file mode 100644 index 0000000000..5108027cc4 --- /dev/null +++ b/packages/iscsi-target/files/libs.patch @@ -0,0 +1,11 @@ +diff -urN iscsitarget-0.4.15/usr/Makefile iscsitarget-0.4.15.new/usr/Makefile +--- iscsitarget-0.4.15/usr/Makefile 2006-07-03 14:09:30.000000000 +0000 ++++ iscsitarget-0.4.15.new/usr/Makefile 2007-07-29 23:16:45.000000000 +0000 +@@ -1,6 +1,6 @@ + CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include + PROGRAMS = ietd ietadm +-LIBS = -lcrypto ++LIBS = -lcrypto $(LDFLAGS) + + all: $(PROGRAMS) + diff --git a/packages/iscsi-target/iscsi-target_0.4.16.bb b/packages/iscsi-target/iscsi-target_0.4.16.bb new file mode 100644 index 0000000000..0e50bfe22b --- /dev/null +++ b/packages/iscsi-target/iscsi-target_0.4.16.bb @@ -0,0 +1,43 @@ + +DESCRIPTION = "iSCSI Enterprise Target is for building an iSCSI storage system on Linux" +HOMEPAGE = "http://iscsitarget.sourceforge.net/" +LICENSE = "GPL" +PR = "r1" + +SRC_URI = "${SOURCEFORGE_MIRROR}/iscsitarget/iscsitarget-${PV}.tar.gz \ + file://libs.patch;patch=1 \ + file://init \ + " + +DEPENDS = " openssl" +S = "${WORKDIR}/iscsitarget-${PV}" + +inherit module + +do_configure() { +} + +CFLAGS = "-isystem${STAGING_KERNEL_DIR}/include -I${STAGING_INCDIR} -L${STAGING_LIBDIR}" +LDFLAGS = "-L${STAGING_LIBDIR}" +FILES_${PN} += " ${base_sbindir}" + +do_compile() { + oe_runmake KSRC=${STAGING_KERNEL_DIR} CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' +} + +do_install() { + # Module + install -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/iscsi + install -m 0644 kernel/iscsi_trgt.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/iscsi/iscsi_trgt.ko + + # Userspace utilities + install -d ${D}${base_sbindir} + install -m 0755 usr/ietd ${D}${base_sbindir}/ietd + install -m 0755 usr/ietadm ${D}${base_sbindir}/ietadm + + # Config files, init scripts + mkdir -p ${D}${sysconfdir}/init.d + install -m 0755 ../init ${D}${sysconfdir}/init.d/iscsi-target + install -m 0644 etc/initiators.allow ${D}${sysconfdir}/ + install -m 0644 etc/initiators.deny ${D}${sysconfdir}/ +} diff --git a/packages/iscsi-target/iscsi-target_svn.bb b/packages/iscsi-target/iscsi-target_svn.bb new file mode 100644 index 0000000000..6671934c48 --- /dev/null +++ b/packages/iscsi-target/iscsi-target_svn.bb @@ -0,0 +1,46 @@ +DESCRIPTION = "iSCSI Enterprise Target is for building an iSCSI storage system on Linux" +HOMEPAGE = "http://iscsitarget.sourceforge.net/" +LICENSE = "GPL" +PR = "r12" + +SRC_URI = "svn://svn.berlios.de/iscsitarget/;module=trunk;rev=HEAD \ + file://libs.patch;patch=1 \ + file://init \ + file://ietd.conf \ + " + +DEPENDS = " openssl" +RDEPENDS = "kernel-module-crc32c kernel-module-libcrc32c" + +S = "${WORKDIR}/trunk" + +inherit module + +do_configure() { +} + +CFLAGS = "-isystem${STAGING_KERNEL_DIR}/include -I${STAGING_INCDIR} -L${STAGING_LIBDIR}" +LDFLAGS = "-L${STAGING_LIBDIR}" +FILES_${PN} += " ${base_sbindir}" + +do_compile() { + oe_runmake KSRC=${STAGING_KERNEL_DIR} CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}' +} + +do_install() { + # Module + install -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/iscsi + install -m 0644 kernel/iscsi_trgt.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/iscsi/iscsi_trgt.ko + + # Userspace utilities + install -d ${D}${base_sbindir} + install -m 0755 usr/ietd ${D}${base_sbindir}/ietd + install -m 0755 usr/ietadm ${D}${base_sbindir}/ietadm + + # Config files, init scripts + mkdir -p ${D}${sysconfdir}/init.d + install -m 0755 ../init ${D}${sysconfdir}/init.d/iscsi-target + install -m 0644 ${WORKDIR}/ietd.conf ${D}${sysconfdir}/ + install -m 0644 etc/initiators.allow ${D}${sysconfdir}/ + install -m 0644 etc/initiators.deny ${D}${sysconfdir}/ +} diff --git a/packages/libusb/libusb-compat-0.0.9+0.1.0-beta1/.mtn2git_empty b/packages/libusb/libusb-compat-0.0.9+0.1.0-beta1/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/libusb/libusb-compat-0.0.9+0.1.0-beta1/.mtn2git_empty diff --git a/packages/libusb/libusb-compat-0.0.9+0.1.0-beta1/0.1.0-beta1-gcc3.4-fix.patch b/packages/libusb/libusb-compat-0.0.9+0.1.0-beta1/0.1.0-beta1-gcc3.4-fix.patch new file mode 100644 index 0000000000..501ba3fb29 --- /dev/null +++ b/packages/libusb/libusb-compat-0.0.9+0.1.0-beta1/0.1.0-beta1-gcc3.4-fix.patch @@ -0,0 +1,13 @@ +Index: libusb-compat-0.1.0-beta1/configure.ac +=================================================================== +--- libusb-compat-0.1.0-beta1.orig/configure.ac 2008-07-21 13:14:42.000000000 +0200 ++++ libusb-compat-0.1.0-beta1/configure.ac 2008-07-21 13:15:03.000000000 +0200 +@@ -55,7 +55,7 @@ + CFLAGS="$saved_cflags" + + AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility]) +-AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow" ++AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wshadow" + AC_SUBST(AM_CFLAGS) + + AC_CONFIG_FILES([libusb.pc] [libusb-config] [Makefile] [libusb/Makefile] [examples/Makefile]) diff --git a/packages/libusb/libusb-compat_0.0.9+0.1.0-beta1.bb b/packages/libusb/libusb-compat_0.0.9+0.1.0-beta1.bb index b42e572196..fec42b1df7 100644 --- a/packages/libusb/libusb-compat_0.0.9+0.1.0-beta1.bb +++ b/packages/libusb/libusb-compat_0.0.9+0.1.0-beta1.bb @@ -5,10 +5,12 @@ SECTION = "libs" LICENSE = "LGPL" PE = "1" +PR = "r1" DEPENDS = "libusb1" SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-compat-0.1.0-beta1.tar.bz2 \ + file://0.1.0-beta1-gcc3.4-fix.patch;patch=1 \ " S = "${WORKDIR}/libusb-compat-0.1.0-beta1" diff --git a/packages/libusb/libusb1-0.9.0/.mtn2git_empty b/packages/libusb/libusb1-0.9.0/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/libusb/libusb1-0.9.0/.mtn2git_empty diff --git a/packages/libusb/libusb1-0.9.0/0.9.0-gcc3.4-compat-fix.patch b/packages/libusb/libusb1-0.9.0/0.9.0-gcc3.4-compat-fix.patch new file mode 100644 index 0000000000..1b06945d1a --- /dev/null +++ b/packages/libusb/libusb1-0.9.0/0.9.0-gcc3.4-compat-fix.patch @@ -0,0 +1,13 @@ +Index: libusb-0.9.0/configure.ac +=================================================================== +--- libusb-0.9.0.orig/configure.ac 2008-07-21 08:04:03.000000000 +0200 ++++ libusb-0.9.0/configure.ac 2008-07-21 08:04:16.000000000 +0200 +@@ -62,7 +62,7 @@ + CFLAGS="$saved_cflags" + + AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility]) +-AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow" ++AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wshadow" + AC_SUBST(AM_CFLAGS) + + AC_CONFIG_FILES([libusb-1.0.pc] [Makefile] [libusb/Makefile] [examples/Makefile] [doc/Makefile]) diff --git a/packages/libusb/libusb1_0.9.0.bb b/packages/libusb/libusb1_0.9.0.bb index 784d9b523b..ce102c0cfc 100644 --- a/packages/libusb/libusb1_0.9.0.bb +++ b/packages/libusb/libusb1_0.9.0.bb @@ -4,8 +4,11 @@ HOMEPAGE = "http://libusb.sf.net" SECTION = "libs" LICENSE = "LGPL" +PR = "r1" + SRC_URI = "\ ${SOURCEFORGE_MIRROR}/libusb/libusb-${PV}.tar.bz2 \ + file://0.9.0-gcc3.4-compat-fix.patch;patch=1 \ " S = "${WORKDIR}/libusb-${PV}" diff --git a/packages/linux/linux-neuros_git.bb b/packages/linux/linux-neuros_git.bb index 2fe367cd49..345e3174ae 100644 --- a/packages/linux/linux-neuros_git.bb +++ b/packages/linux/linux-neuros_git.bb @@ -2,10 +2,10 @@ require linux.inc DESCRIPTION = "Linux kernel for Neuros OSD devices" -SRCREV = "e014243410af1c7c214e6974f5fc2f23c0a1c1ee" +SRCREV = "7ee93e596406d465e5af2c119e13def9af323f6b" PV = "2.6.23-${PR}+git${SRCREV}" -PR = "r7" +PR = "r8" COMPATIBLE_MACHINE = "(neuros-osd|neuros-osd2)" diff --git a/packages/linux/linux-omap2-git/beagleboard/TWL4030-01.patch b/packages/linux/linux-omap2-git/beagleboard/TWL4030-01.patch index b6142ea1f5..c361c33d61 100644 --- a/packages/linux/linux-omap2-git/beagleboard/TWL4030-01.patch +++ b/packages/linux/linux-omap2-git/beagleboard/TWL4030-01.patch @@ -1,42 +1,6 @@ -X-Mozilla-Status: 0001 -X-Mozilla-Status2: 00000000 -Return-Path: <linux-omap-owner@vger.kernel.org> -X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on shovel.geekisp.com -X-Spam-Level: -X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,DKIM_POLICY_SIGNSOME - autolearn=ham version=3.2.1 -Delivered-To: balister.org-philip@balister.org -Received: (qmail 26975 invoked by uid 1003); 18 Jul 2008 01:35:27 -0000 -Received: from vger.kernel.org (209.132.176.167) - by mail.geekisp.com with SMTP; 18 Jul 2008 01:35:27 -0000 -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1756265AbYGRBf0 (ORCPT <rfc822;philip@balister.org>); - Thu, 17 Jul 2008 21:35:26 -0400 -Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751582AbYGRBfZ - (ORCPT <rfc822;linux-omap-outgoing>); - Thu, 17 Jul 2008 21:35:25 -0400 -Received: from utopia.booyaka.com ([72.9.107.138]:49361 "EHLO - utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1752321AbYGRBfX (ORCPT - <rfc822;linux-omap@vger.kernel.org>); Thu, 17 Jul 2008 21:35:23 -0400 -Received: (qmail 13868 invoked by uid 526); 18 Jul 2008 01:35:22 -0000 -MBOX-Line: From nobody Thu Jul 17 19:34:49 2008 -From: Paul Walmsley <paul@pwsan.com> -Subject: [PATCH 1/9] TWL4030: remove superfluous PWR interrupt status clear - before masking -To: linux-omap@vger.kernel.org -Date: Thu, 17 Jul 2008 19:34:49 -0600 -Message-ID: <20080718013448.18943.6984.stgit@localhost.localdomain> -In-Reply-To: <20080718013205.18943.34047.stgit@localhost.localdomain> -References: <20080718013205.18943.34047.stgit@localhost.localdomain> -User-Agent: StGIT/0.14.3.163.g06f9 -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit -Sender: linux-omap-owner@vger.kernel.org -Precedence: bulk -List-ID: <linux-omap.vger.kernel.org> -X-Mailing-List: linux-omap@vger.kernel.org +TWL4030: remove superfluous PWR interrupt status clear before masking + +From: Paul Walmsley <paul@pwsan.com> twl_irq_init() clears PWR interrupt status bits, then masks the interrupts off, then clears the PWR interrupt status bits again. The first clear @@ -77,10 +41,3 @@ index adc45d4..ff662bc 100644 /* PWR_IMR1 */ res = twl4030_i2c_write_u8(TWL4030_MODULE_INT, 0xFF, 0x1); if (res < 0) { - - --- -To unsubscribe from this list: send the line "unsubscribe linux-omap" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html - diff --git a/packages/linux/linux-omap2-git/beagleboard/TWL4030-02.patch b/packages/linux/linux-omap2-git/beagleboard/TWL4030-02.patch index 18b2f589c1..48a59b945b 100644 --- a/packages/linux/linux-omap2-git/beagleboard/TWL4030-02.patch +++ b/packages/linux/linux-omap2-git/beagleboard/TWL4030-02.patch @@ -1,42 +1,6 @@ -X-Mozilla-Status: 0001 -X-Mozilla-Status2: 00000000 -Return-Path: <linux-omap-owner@vger.kernel.org> -X-Spam-Checker-Version: SpamAssassin 3.2.2 (2007-07-23) on - morningsun.geekisp.com -X-Spam-Level: -X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,DKIM_POLICY_SIGNSOME, - DK_POLICY_SIGNSOME,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.2 -Delivered-To: balister.org-philip@balister.org -Received: (qmail 17413 invoked by uid 1003); 18 Jul 2008 01:35:27 -0000 -Received: from vger.kernel.org (209.132.176.167) - by mail.geekisp.com with SMTP; 18 Jul 2008 01:35:27 -0000 -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1757296AbYGRBf1 (ORCPT <rfc822;philip@balister.org>); - Thu, 17 Jul 2008 21:35:27 -0400 -Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751582AbYGRBf0 - (ORCPT <rfc822;linux-omap-outgoing>); - Thu, 17 Jul 2008 21:35:26 -0400 -Received: from utopia.booyaka.com ([72.9.107.138]:49362 "EHLO - utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1754168AbYGRBfY (ORCPT - <rfc822;linux-omap@vger.kernel.org>); Thu, 17 Jul 2008 21:35:24 -0400 -Received: (qmail 13872 invoked by uid 526); 18 Jul 2008 01:35:23 -0000 -MBOX-Line: From nobody Thu Jul 17 19:34:50 2008 -From: Paul Walmsley <paul@pwsan.com> -Subject: [PATCH 2/9] TWL4030: clear TWL GPIO interrupt status registers -To: linux-omap@vger.kernel.org -Date: Thu, 17 Jul 2008 19:34:50 -0600 -Message-ID: <20080718013449.18943.78895.stgit@localhost.localdomain> -In-Reply-To: <20080718013205.18943.34047.stgit@localhost.localdomain> -References: <20080718013205.18943.34047.stgit@localhost.localdomain> -User-Agent: StGIT/0.14.3.163.g06f9 -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit -Sender: linux-omap-owner@vger.kernel.org -Precedence: bulk -List-ID: <linux-omap.vger.kernel.org> -X-Mailing-List: linux-omap@vger.kernel.org +TWL4030: clear TWL GPIO interrupt status registers + +From: Paul Walmsley <paul@pwsan.com> twl_init_irq() does not clear the TWL GPIO ISR registers, but the PIH ISR thinks that it has. This causes any previously-latched GPIO interrupts @@ -105,10 +69,3 @@ index ff662bc..dfc3805 100644 /* install an irq handler for each of the PIH modules */ for (i = TWL4030_IRQ_BASE; i < TWL4030_IRQ_END; i++) { set_irq_chip(i, &twl4030_irq_chip); - - --- -To unsubscribe from this list: send the line "unsubscribe linux-omap" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html - diff --git a/packages/linux/linux-omap2-git/beagleboard/TWL4030-03.patch b/packages/linux/linux-omap2-git/beagleboard/TWL4030-03.patch index 062d99fe5a..fe1bea5398 100644 --- a/packages/linux/linux-omap2-git/beagleboard/TWL4030-03.patch +++ b/packages/linux/linux-omap2-git/beagleboard/TWL4030-03.patch @@ -1,43 +1,6 @@ -X-Mozilla-Status: 0001 -X-Mozilla-Status2: 00000000 -Return-Path: <linux-omap-owner@vger.kernel.org> -X-Spam-Checker-Version: SpamAssassin 3.2.2 (2007-07-23) on - morningsun.geekisp.com -X-Spam-Level: -X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,DKIM_POLICY_SIGNSOME, - DK_POLICY_SIGNSOME,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.2 -Delivered-To: balister.org-philip@balister.org -Received: (qmail 14206 invoked by uid 1003); 18 Jul 2008 01:35:28 -0000 -Received: from vger.kernel.org (209.132.176.167) - by mail.geekisp.com with SMTP; 18 Jul 2008 01:35:28 -0000 -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1751582AbYGRBf1 (ORCPT <rfc822;philip@balister.org>); - Thu, 17 Jul 2008 21:35:27 -0400 -Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754168AbYGRBf1 - (ORCPT <rfc822;linux-omap-outgoing>); - Thu, 17 Jul 2008 21:35:27 -0400 -Received: from utopia.booyaka.com ([72.9.107.138]:49363 "EHLO - utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1754586AbYGRBfY (ORCPT - <rfc822;linux-omap@vger.kernel.org>); Thu, 17 Jul 2008 21:35:24 -0400 -Received: (qmail 13876 invoked by uid 526); 18 Jul 2008 01:35:23 -0000 -MBOX-Line: From nobody Thu Jul 17 19:34:50 2008 -From: Paul Walmsley <paul@pwsan.com> -Subject: [PATCH 3/9] TWL4030: use correct register addresses for BCI IMR - registers -To: linux-omap@vger.kernel.org -Date: Thu, 17 Jul 2008 19:34:50 -0600 -Message-ID: <20080718013450.18943.33123.stgit@localhost.localdomain> -In-Reply-To: <20080718013205.18943.34047.stgit@localhost.localdomain> -References: <20080718013205.18943.34047.stgit@localhost.localdomain> -User-Agent: StGIT/0.14.3.163.g06f9 -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit -Sender: linux-omap-owner@vger.kernel.org -Precedence: bulk -List-ID: <linux-omap.vger.kernel.org> -X-Mailing-List: linux-omap@vger.kernel.org +TWL4030: use correct register addresses for BCI IMR registers + +From: Paul Walmsley <paul@pwsan.com> The existing code to mask and clear BCI interrupts in twl_init_irq() is wrong. It uses the wrong register offsets, it does not mask all of the @@ -117,10 +80,3 @@ index dfc3805..bb0732c 100644 if (res < 0) { pr_err("%s[%d][%d]\n", msg, res, __LINE__); return; - - --- -To unsubscribe from this list: send the line "unsubscribe linux-omap" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html - diff --git a/packages/linux/linux-omap2-git/beagleboard/TWL4030-04.patch b/packages/linux/linux-omap2-git/beagleboard/TWL4030-04.patch index 12d76bfb23..fb65ac98bb 100644 --- a/packages/linux/linux-omap2-git/beagleboard/TWL4030-04.patch +++ b/packages/linux/linux-omap2-git/beagleboard/TWL4030-04.patch @@ -1,42 +1,6 @@ -X-Mozilla-Status: 0001 -X-Mozilla-Status2: 00000000 -Return-Path: <linux-omap-owner@vger.kernel.org> -X-Spam-Checker-Version: SpamAssassin 3.2.2 (2007-07-23) on - morningsun.geekisp.com -X-Spam-Level: -X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,DKIM_POLICY_SIGNSOME, - DK_POLICY_SIGNSOME,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.2 -Delivered-To: balister.org-philip@balister.org -Received: (qmail 21713 invoked by uid 1003); 18 Jul 2008 01:35:29 -0000 -Received: from vger.kernel.org (209.132.176.167) - by mail.geekisp.com with SMTP; 18 Jul 2008 01:35:29 -0000 -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1754758AbYGRBf2 (ORCPT <rfc822;philip@balister.org>); - Thu, 17 Jul 2008 21:35:28 -0400 -Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757008AbYGRBf1 - (ORCPT <rfc822;linux-omap-outgoing>); - Thu, 17 Jul 2008 21:35:27 -0400 -Received: from utopia.booyaka.com ([72.9.107.138]:49364 "EHLO - utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1754758AbYGRBfY (ORCPT - <rfc822;linux-omap@vger.kernel.org>); Thu, 17 Jul 2008 21:35:24 -0400 -Received: (qmail 13880 invoked by uid 526); 18 Jul 2008 01:35:23 -0000 -MBOX-Line: From nobody Thu Jul 17 19:34:51 2008 -From: Paul Walmsley <paul@pwsan.com> -Subject: [PATCH 4/9] TWL4030: clear MADC interrupt status registers upon init -To: linux-omap@vger.kernel.org -Date: Thu, 17 Jul 2008 19:34:51 -0600 -Message-ID: <20080718013450.18943.33397.stgit@localhost.localdomain> -In-Reply-To: <20080718013205.18943.34047.stgit@localhost.localdomain> -References: <20080718013205.18943.34047.stgit@localhost.localdomain> -User-Agent: StGIT/0.14.3.163.g06f9 -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit -Sender: linux-omap-owner@vger.kernel.org -Precedence: bulk -List-ID: <linux-omap.vger.kernel.org> -X-Mailing-List: linux-omap@vger.kernel.org +TWL4030: clear MADC interrupt status registers upon init + +From: Paul Walmsley <paul@pwsan.com> twl_init_irq() does not clear MADC interrupt status registers upon init - fix. @@ -72,10 +36,3 @@ index bb0732c..9d93524 100644 /* key Pad */ /* KEYPAD - IMR1 */ res = twl4030_i2c_write_u8(TWL4030_MODULE_KEYPAD, 0xFF, (0x12)); - - --- -To unsubscribe from this list: send the line "unsubscribe linux-omap" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html - diff --git a/packages/linux/linux-omap2-git/beagleboard/TWL4030-05.patch b/packages/linux/linux-omap2-git/beagleboard/TWL4030-05.patch index b41c836711..02a72ed9df 100644 --- a/packages/linux/linux-omap2-git/beagleboard/TWL4030-05.patch +++ b/packages/linux/linux-omap2-git/beagleboard/TWL4030-05.patch @@ -1,68 +1,54 @@ -X-Mozilla-Status: 0001 -X-Mozilla-Status2: 00000000 -Return-Path: <linux-omap-owner@vger.kernel.org> -X-Spam-Checker-Version: SpamAssassin 3.2.2 (2007-07-23) on - morningsun.geekisp.com -X-Spam-Level: -X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,DKIM_POLICY_SIGNSOME, - DK_POLICY_SIGNSOME,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.2 -Delivered-To: balister.org-philip@balister.org -Received: (qmail 11680 invoked by uid 1003); 18 Jul 2008 01:35:29 -0000 -Received: from vger.kernel.org (209.132.176.167) - by mail.geekisp.com with SMTP; 18 Jul 2008 01:35:29 -0000 -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1755063AbYGRBf2 (ORCPT <rfc822;philip@balister.org>); - Thu, 17 Jul 2008 21:35:28 -0400 -Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754168AbYGRBf2 - (ORCPT <rfc822;linux-omap-outgoing>); - Thu, 17 Jul 2008 21:35:28 -0400 -Received: from utopia.booyaka.com ([72.9.107.138]:49365 "EHLO - utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1755063AbYGRBfZ (ORCPT - <rfc822;linux-omap@vger.kernel.org>); Thu, 17 Jul 2008 21:35:25 -0400 -Received: (qmail 13884 invoked by uid 526); 18 Jul 2008 01:35:23 -0000 -MBOX-Line: From nobody Thu Jul 17 19:34:52 2008 -From: Paul Walmsley <paul@pwsan.com> -Subject: [PATCH 5/9] TWL4030: read and write module ISRs to clear them at init -To: linux-omap@vger.kernel.org -Date: Thu, 17 Jul 2008 19:34:52 -0600 -Message-ID: <20080718013451.18943.18579.stgit@localhost.localdomain> -In-Reply-To: <20080718013205.18943.34047.stgit@localhost.localdomain> -References: <20080718013205.18943.34047.stgit@localhost.localdomain> -User-Agent: StGIT/0.14.3.163.g06f9 -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit -Sender: linux-omap-owner@vger.kernel.org -Precedence: bulk -List-ID: <linux-omap.vger.kernel.org> -X-Mailing-List: linux-omap@vger.kernel.org +TWL4030: use *_SIH_CTRL.COR bit to determine whether to read or write ISR to clear + +From: Paul Walmsley <paul@pwsan.com> TWL4030 interrupt status register bits can be cleared in one of two ways: either by reading from the register, or by writing a 1 to the appropriate bit(s) in the register. This behavior can be altered at any time by the <twlmodule>_SIH_CTRL.COR register bit ("clear-on-read"). -twl4030-core.c does not touch these *_SIH_CTRL registers during boot, -and the TWL4030 TRM is deeply confused as to whether COR=1 means that -the registers are cleared on reads, or cleared on writes. +The TWL4030 TRM is deeply confused as to whether COR=1 means that the +registers are cleared on reads, or cleared on writes. Peter De +Schrijver <peter.de-schrijver> confirms that COR=1 means that the registers +are cleared on read. + +So, for each TWL4030 SIH, check the value of the *_SIH_CTRL.COR bit, and if +it is 1, use reads to clear the ISRs; if it is 0, use writes. + +Also, use WARN_ON() to warn if the read/write failed, and don't skip +the rest of the initialization on failure either. + +Thanks to Peter for his help with this patch. -So, take the cautious way out and both read from and write to the TWL4030 -module ISRs to clear them at startup. Also, use WARN_ON() to warn if the -read/write failed, and don't skip the rest of the initialization on failure -either. Signed-off-by: Paul Walmsley <paul@pwsan.com> --- - drivers/i2c/chips/twl4030-core.c | 128 +++++++++++++++----------------------- - 1 files changed, 51 insertions(+), 77 deletions(-) + drivers/i2c/chips/twl4030-core.c | 183 ++++++++++++++++++++++---------------- + 1 files changed, 106 insertions(+), 77 deletions(-) diff --git a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c -index 9d93524..615fb84 100644 +index 9d93524..eae0634 100644 --- a/drivers/i2c/chips/twl4030-core.c +++ b/drivers/i2c/chips/twl4030-core.c -@@ -712,6 +712,28 @@ static int power_companion_init(void) +@@ -133,6 +133,16 @@ + /* on I2C-1 for 2430SDP */ + #define CONFIG_I2C_TWL4030_ID 1 + ++/* SIH_CTRL registers */ ++#define TWL4030_INT_PWR_SIH_CTRL 0x07 ++#define TWL4030_INTERRUPTS_BCISIHCTRL 0x0d ++#define TWL4030_MADC_MADC_SIH_CTRL 0x67 ++#define TWL4030_KEYPAD_KEYP_SIH_CTRL 0x17 ++#define TWL4030_GPIO_GPIO_SIH_CTRL 0x2d ++ ++#define TWL4030_SIH_CTRL_COR_MASK (1 << 2) ++ ++ + /* Helper functions */ + static int + twl4030_detect_client(struct i2c_adapter *adapter, unsigned char sid); +@@ -712,13 +722,61 @@ static int power_companion_init(void) return e; } @@ -70,28 +56,46 @@ index 9d93524..615fb84 100644 + * twl4030_i2c_clear_isr - clear TWL4030 SIH ISR regs via read + write + * @mod_no: TWL4030 module number + * @reg: register index to clear ++ * @cor: value of the <module>_SIH_CTRL.COR bit (1 or 0) + * -+ * Reads, then writes 0xff to a TWL4030 interrupt status register to ensure -+ * that interrupts are cleared. The read + write is necessary since we -+ * don't know whether the COR bit is set in <module>_SIH_CTRL. Returns -+ * the status from the I2C read operation. ++ * Either reads (cor == 1) or writes (cor == 0) to a TWL4030 interrupt ++ * status register to ensure that any prior interrupts are cleared. ++ * Returns the status from the I2C read operation. + */ -+static int twl4030_i2c_clear_isr(u8 mod_no, u8 reg) ++static int twl4030_i2c_clear_isr(u8 mod_no, u8 reg, u8 cor) +{ -+ int res; + u8 tmp; + -+ res = twl4030_i2c_read_u8(mod_no, &tmp, reg); -+ if (res < 0) -+ return res; ++ return (cor) ? twl4030_i2c_read_u8(mod_no, &tmp, reg) : ++ twl4030_i2c_write_u8(mod_no, 0xff, reg); ++} ++ ++/** ++ * twl4030_read_cor_bit - are TWL module ISRs cleared by reads or writes? ++ * @mod_no: TWL4030 module number ++ * @reg: register index to clear ++ * ++ * Returns 1 if the TWL4030 SIH interrupt status registers (ISRs) for ++ * the specified TWL module are cleared by reads, or 0 if cleared by ++ * writes. ++ */ ++static int twl4030_read_cor_bit(u8 mod_no, u8 reg) ++{ ++ u8 tmp = 0; ++ ++ WARN_ON(twl4030_i2c_read_u8(mod_no, &tmp, reg) < 0); ++ ++ tmp &= TWL4030_SIH_CTRL_COR_MASK; ++ tmp >>= __ffs(TWL4030_SIH_CTRL_COR_MASK); + -+ return twl4030_i2c_write_u8(mod_no, 0xff, reg); ++ return tmp; +} + static void twl_init_irq(void) { int i = 0; -@@ -719,6 +741,13 @@ static void twl_init_irq(void) + int res = 0; ++ int cor; char *msg = "Unable to register interrupt subsystem"; unsigned int irq_num; @@ -102,19 +106,27 @@ index 9d93524..615fb84 100644 + * handlers present. + */ + ++ /* PWR_IMR1 */ res = twl4030_i2c_write_u8(TWL4030_MODULE_INT, 0xFF, 0x1); if (res < 0) { -@@ -735,19 +764,11 @@ static void twl_init_irq(void) +@@ -734,20 +792,18 @@ static void twl_init_irq(void) + } /* Clear off any other pending interrupts on power */ ++ ++ /* Are PWR interrupt status bits cleared by reads or writes? */ ++ cor = twl4030_read_cor_bit(TWL4030_MODULE_INT, ++ TWL4030_INT_PWR_SIH_CTRL); ++ WARN_ON(cor < 0); ++ /* PWR_ISR1 */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_INT, 0xFF, 0x00); - if (res < 0) { - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INT, 0x00) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INT, 0x00, cor) < 0); /* PWR_ISR2 */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_INT, 0xFF, 0x02); @@ -123,21 +135,27 @@ index 9d93524..615fb84 100644 - return; - } - /* POWER HACK (END) */ -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INT, 0x02) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INT, 0x02, cor) < 0); + /* Slave address 0x4A */ /* BCIIMR1A */ -@@ -779,32 +800,16 @@ static void twl_init_irq(void) +@@ -778,33 +834,22 @@ static void twl_init_irq(void) + return; } ++ /* Are BCI interrupt status bits cleared by reads or writes? */ ++ cor = twl4030_read_cor_bit(TWL4030_MODULE_INTERRUPTS, ++ TWL4030_INTERRUPTS_BCISIHCTRL); ++ WARN_ON(cor < 0); ++ /* BCIISR1A */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xFF, 0x0); - if (res < 0) { - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x0) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x0, cor) < 0); /* BCIISR2A */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xFF, 0x1); @@ -145,7 +163,7 @@ index 9d93524..615fb84 100644 - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x1) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x1, cor) < 0); /* BCIISR1B */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xFF, 0x4); @@ -153,7 +171,7 @@ index 9d93524..615fb84 100644 - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x4) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x4, cor) < 0); /* BCIISR2B */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xFF, 0x5); @@ -161,20 +179,26 @@ index 9d93524..615fb84 100644 - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x5) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x5, cor) < 0); /* MAD C */ /* MADC_IMR1 */ -@@ -822,18 +827,10 @@ static void twl_init_irq(void) +@@ -821,19 +866,16 @@ static void twl_init_irq(void) + return; } ++ /* Are MADC interrupt status bits cleared by reads or writes? */ ++ cor = twl4030_read_cor_bit(TWL4030_MODULE_MADC, ++ TWL4030_MADC_MADC_SIH_CTRL); ++ WARN_ON(cor < 0); ++ /* MADC_ISR1 */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_MADC, 0xFF, 0x61); - if (res < 0) { - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, 0x61) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, 0x61, cor) < 0); /* MADC_ISR2 */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_MADC, 0xFF, 0x63); @@ -182,11 +206,11 @@ index 9d93524..615fb84 100644 - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, 0x63) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, 0x63, cor) < 0); /* key Pad */ /* KEYPAD - IMR1 */ -@@ -842,12 +839,10 @@ static void twl_init_irq(void) +@@ -842,12 +884,15 @@ static void twl_init_irq(void) pr_err("%s[%d][%d]\n", msg, res, __LINE__); return; } @@ -197,32 +221,43 @@ index 9d93524..615fb84 100644 - twl4030_i2c_read_u8(TWL4030_MODULE_KEYPAD, &clear, 0x11); - } + ++ /* Are keypad interrupt status bits cleared by reads or writes? */ ++ cor = twl4030_read_cor_bit(TWL4030_MODULE_KEYPAD, ++ TWL4030_KEYPAD_KEYP_SIH_CTRL); ++ WARN_ON(cor < 0); ++ + /* KEYPAD - ISR1 */ + /* XXX does this still need to be done twice for some reason? */ -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, 0x11) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, 0x11, cor) < 0); /* KEYPAD - IMR2 */ res = twl4030_i2c_write_u8(TWL4030_MODULE_KEYPAD, 0xFF, (0x14)); -@@ -856,6 +851,9 @@ static void twl_init_irq(void) +@@ -856,6 +901,9 @@ static void twl_init_irq(void) return; } + /* KEYPAD - ISR2 */ -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, 0x13) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, 0x13, cor) < 0); + /* Slave address 0x49 */ /* GPIO_IMR1A */ res = twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xFF, (0x1C)); -@@ -900,46 +898,22 @@ static void twl_init_irq(void) +@@ -899,47 +947,28 @@ static void twl_init_irq(void) + return; } ++ /* Are GPIO interrupt status bits cleared by reads or writes? */ ++ cor = twl4030_read_cor_bit(TWL4030_MODULE_GPIO, ++ TWL4030_GPIO_GPIO_SIH_CTRL); ++ WARN_ON(cor < 0); ++ /* GPIO_ISR1A */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, 0x19); - if (res < 0) { - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x19) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x19, cor) < 0); /* GPIO_ISR2A */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, 0x1a); @@ -230,7 +265,7 @@ index 9d93524..615fb84 100644 - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x1a) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x1a, cor) < 0); /* GPIO_ISR3A */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, 0x1b); @@ -238,7 +273,7 @@ index 9d93524..615fb84 100644 - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x1b) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x1b, cor) < 0); /* GPIO_ISR1B */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, 0x1f); @@ -246,7 +281,7 @@ index 9d93524..615fb84 100644 - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x1f) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x1f, cor) < 0); /* GPIO_ISR2B */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, 0x20); @@ -254,7 +289,7 @@ index 9d93524..615fb84 100644 - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x20) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x20, cor) < 0); /* GPIO_ISR3B */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, 0x21); @@ -262,14 +297,7 @@ index 9d93524..615fb84 100644 - pr_err("%s[%d][%d]\n", msg, res, __LINE__); - return; - } -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x21) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x21, cor) < 0); /* install an irq handler for each of the PIH modules */ for (i = TWL4030_IRQ_BASE; i < TWL4030_IRQ_END; i++) { - - --- -To unsubscribe from this list: send the line "unsubscribe linux-omap" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html - diff --git a/packages/linux/linux-omap2-git/beagleboard/TWL4030-06.patch b/packages/linux/linux-omap2-git/beagleboard/TWL4030-06.patch index 501437a365..67b837c454 100644 --- a/packages/linux/linux-omap2-git/beagleboard/TWL4030-06.patch +++ b/packages/linux/linux-omap2-git/beagleboard/TWL4030-06.patch @@ -1,41 +1,6 @@ -X-Mozilla-Status: 0001 -X-Mozilla-Status2: 00000000 -Return-Path: <linux-omap-owner@vger.kernel.org> -X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on shovel.geekisp.com -X-Spam-Level: -X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,DKIM_POLICY_SIGNSOME - autolearn=ham version=3.2.1 -Delivered-To: balister.org-philip@balister.org -Received: (qmail 19695 invoked by uid 1003); 18 Jul 2008 01:35:30 -0000 -Received: from vger.kernel.org (209.132.176.167) - by mail.geekisp.com with SMTP; 18 Jul 2008 01:35:30 -0000 -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1756218AbYGRBf3 (ORCPT <rfc822;philip@balister.org>); - Thu, 17 Jul 2008 21:35:29 -0400 -Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754168AbYGRBf3 - (ORCPT <rfc822;linux-omap-outgoing>); - Thu, 17 Jul 2008 21:35:29 -0400 -Received: from utopia.booyaka.com ([72.9.107.138]:49366 "EHLO - utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1756218AbYGRBfZ (ORCPT - <rfc822;linux-omap@vger.kernel.org>); Thu, 17 Jul 2008 21:35:25 -0400 -Received: (qmail 13888 invoked by uid 526); 18 Jul 2008 01:35:23 -0000 -MBOX-Line: From nobody Thu Jul 17 19:34:53 2008 -From: Paul Walmsley <paul@pwsan.com> -Subject: [PATCH 6/9] TWL4030: change init-time IMR mask code to WARN if error -To: linux-omap@vger.kernel.org -Date: Thu, 17 Jul 2008 19:34:53 -0600 -Message-ID: <20080718013452.18943.96350.stgit@localhost.localdomain> -In-Reply-To: <20080718013205.18943.34047.stgit@localhost.localdomain> -References: <20080718013205.18943.34047.stgit@localhost.localdomain> -User-Agent: StGIT/0.14.3.163.g06f9 -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit -Sender: linux-omap-owner@vger.kernel.org -Precedence: bulk -List-ID: <linux-omap.vger.kernel.org> -X-Mailing-List: linux-omap@vger.kernel.org +TWL4030: change init-time IMR mask code to WARN if error + +From: Paul Walmsley <paul@pwsan.com> twl_init_irq() prints error messages and returns if any interrupt mask register writes fail. Change this to generate a warning traceback and @@ -50,11 +15,11 @@ Signed-off-by: Paul Walmsley <paul@pwsan.com> 1 files changed, 18 insertions(+), 82 deletions(-) diff --git a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c -index 615fb84..1906635 100644 +index eae0634..99cc143 100644 --- a/drivers/i2c/chips/twl4030-core.c +++ b/drivers/i2c/chips/twl4030-core.c -@@ -749,18 +749,10 @@ static void twl_init_irq(void) - */ +@@ -778,18 +778,10 @@ static void twl_init_irq(void) + /* PWR_IMR1 */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_INT, 0xFF, 0x1); @@ -73,8 +38,8 @@ index 615fb84..1906635 100644 + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_INT, 0xff, 0x3) < 0); /* Clear off any other pending interrupts on power */ - /* PWR_ISR1 */ -@@ -772,32 +764,16 @@ static void twl_init_irq(void) + +@@ -807,32 +799,16 @@ static void twl_init_irq(void) /* Slave address 0x4A */ /* BCIIMR1A */ @@ -111,9 +76,9 @@ index 615fb84..1906635 100644 - } + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xff, 0x7) < 0); - /* BCIISR1A */ - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x0) < 0); -@@ -813,18 +789,10 @@ static void twl_init_irq(void) + /* Are BCI interrupt status bits cleared by reads or writes? */ + cor = twl4030_read_cor_bit(TWL4030_MODULE_INTERRUPTS, +@@ -853,18 +829,10 @@ static void twl_init_irq(void) /* MAD C */ /* MADC_IMR1 */ @@ -132,9 +97,9 @@ index 615fb84..1906635 100644 - } + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_MADC, 0xff, 0x64) < 0); - /* MADC_ISR1 */ - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, 0x61) < 0); -@@ -834,68 +802,36 @@ static void twl_init_irq(void) + /* Are MADC interrupt status bits cleared by reads or writes? */ + cor = twl4030_read_cor_bit(TWL4030_MODULE_MADC, +@@ -879,11 +847,7 @@ static void twl_init_irq(void) /* key Pad */ /* KEYPAD - IMR1 */ @@ -145,9 +110,10 @@ index 615fb84..1906635 100644 - } + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_KEYPAD, 0xff, 0x12) < 0); - /* KEYPAD - ISR1 */ - /* XXX does this still need to be done twice for some reason? */ - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, 0x11) < 0); + /* Are keypad interrupt status bits cleared by reads or writes? */ + cor = twl4030_read_cor_bit(TWL4030_MODULE_KEYPAD, +@@ -895,57 +859,29 @@ static void twl_init_irq(void) + WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, 0x11, cor) < 0); /* KEYPAD - IMR2 */ - res = twl4030_i2c_write_u8(TWL4030_MODULE_KEYPAD, 0xFF, (0x14)); @@ -158,7 +124,7 @@ index 615fb84..1906635 100644 + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_KEYPAD, 0xff, 0x14) < 0); /* KEYPAD - ISR2 */ - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, 0x13) < 0); + WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, 0x13, cor) < 0); /* Slave address 0x49 */ /* GPIO_IMR1A */ @@ -209,12 +175,5 @@ index 615fb84..1906635 100644 - } + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, 0x24) < 0); - /* GPIO_ISR1A */ - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x19) < 0); - - --- -To unsubscribe from this list: send the line "unsubscribe linux-omap" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html - + /* Are GPIO interrupt status bits cleared by reads or writes? */ + cor = twl4030_read_cor_bit(TWL4030_MODULE_GPIO, diff --git a/packages/linux/linux-omap2-git/beagleboard/TWL4030-07.patch b/packages/linux/linux-omap2-git/beagleboard/TWL4030-07.patch index 2847e84f62..8e4c4d6be4 100644 --- a/packages/linux/linux-omap2-git/beagleboard/TWL4030-07.patch +++ b/packages/linux/linux-omap2-git/beagleboard/TWL4030-07.patch @@ -1,50 +1,13 @@ -X-Mozilla-Status: 0001 -X-Mozilla-Status2: 00000000 -Return-Path: <linux-omap-owner@vger.kernel.org> -X-Spam-Checker-Version: SpamAssassin 3.2.2 (2007-07-23) on - morningsun.geekisp.com -X-Spam-Level: -X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,DKIM_POLICY_SIGNSOME, - DK_POLICY_SIGNSOME,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.2 -Delivered-To: balister.org-philip@balister.org -Received: (qmail 26193 invoked by uid 1003); 18 Jul 2008 01:35:31 -0000 -Received: from vger.kernel.org (209.132.176.167) - by mail.geekisp.com with SMTP; 18 Jul 2008 01:35:31 -0000 -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1752321AbYGRBfb (ORCPT <rfc822;philip@balister.org>); - Thu, 17 Jul 2008 21:35:31 -0400 -Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756854AbYGRBfb - (ORCPT <rfc822;linux-omap-outgoing>); - Thu, 17 Jul 2008 21:35:31 -0400 -Received: from utopia.booyaka.com ([72.9.107.138]:49367 "EHLO - utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1756351AbYGRBfZ (ORCPT - <rfc822;linux-omap@vger.kernel.org>); Thu, 17 Jul 2008 21:35:25 -0400 -Received: (qmail 13892 invoked by uid 526); 18 Jul 2008 01:35:23 -0000 -MBOX-Line: From nobody Thu Jul 17 19:34:54 2008 -From: Paul Walmsley <paul@pwsan.com> -Subject: [PATCH 7/9] TWL4030: move TWL module register defs into separate - include files -To: linux-omap@vger.kernel.org -Date: Thu, 17 Jul 2008 19:34:54 -0600 -Message-ID: <20080718013453.18943.69329.stgit@localhost.localdomain> -In-Reply-To: <20080718013205.18943.34047.stgit@localhost.localdomain> -References: <20080718013205.18943.34047.stgit@localhost.localdomain> -User-Agent: StGIT/0.14.3.163.g06f9 -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit -Sender: linux-omap-owner@vger.kernel.org -Precedence: bulk -List-ID: <linux-omap.vger.kernel.org> -X-Mailing-List: linux-omap@vger.kernel.org +TWL4030: move TWL module register defs into separate include files -twl_init_irq() accesses TWL module IMR and ISR registers. Currently, it -uses "magic numbers" for these register indices, but symbolic constants -are definitely preferred. Rather than duplicating already existing -symbolic constants in twl4030-gpio.c and twl4030-pwrirq.c, move the -existing constants out into include files. This patch should not change -kernel behavior. +From: Paul Walmsley <paul@pwsan.com> + +twl_init_irq() uses "magic numbers" to access TWL module IMR and ISR +registers. Symbolic constants are definitely preferred. + +Rather than duplicating already existing symbolic constants in +twl4030-gpio.c and twl4030-pwrirq.c, move the existing constants out +into include files. This patch should not change kernel behavior. Signed-off-by: Paul Walmsley <paul@pwsan.com> --- @@ -309,10 +272,3 @@ index 0000000..7a13368 +#define TWL4030_INT_PWR_SIH_CTRL 0x7 + +#endif /* End of __TWL4030_PWRIRQ_H */ - - --- -To unsubscribe from this list: send the line "unsubscribe linux-omap" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html - diff --git a/packages/linux/linux-omap2-git/beagleboard/TWL4030-08.patch b/packages/linux/linux-omap2-git/beagleboard/TWL4030-08.patch index 713eebffd6..9af25a762d 100644 --- a/packages/linux/linux-omap2-git/beagleboard/TWL4030-08.patch +++ b/packages/linux/linux-omap2-git/beagleboard/TWL4030-08.patch @@ -1,43 +1,6 @@ -X-Mozilla-Status: 0001 -X-Mozilla-Status2: 00000000 -Return-Path: <linux-omap-owner@vger.kernel.org> -X-Spam-Checker-Version: SpamAssassin 3.2.2 (2007-07-23) on - morningsun.geekisp.com -X-Spam-Level: -X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,DKIM_POLICY_SIGNSOME, - DK_POLICY_SIGNSOME,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.2 -Delivered-To: balister.org-philip@balister.org -Received: (qmail 12254 invoked by uid 1003); 18 Jul 2008 01:35:31 -0000 -Received: from vger.kernel.org (209.132.176.167) - by mail.geekisp.com with SMTP; 18 Jul 2008 01:35:31 -0000 -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1756410AbYGRBfa (ORCPT <rfc822;philip@balister.org>); - Thu, 17 Jul 2008 21:35:30 -0400 -Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757008AbYGRBfa - (ORCPT <rfc822;linux-omap-outgoing>); - Thu, 17 Jul 2008 21:35:30 -0400 -Received: from utopia.booyaka.com ([72.9.107.138]:49368 "EHLO - utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1756410AbYGRBfZ (ORCPT - <rfc822;linux-omap@vger.kernel.org>); Thu, 17 Jul 2008 21:35:25 -0400 -Received: (qmail 13896 invoked by uid 526); 18 Jul 2008 01:35:24 -0000 -MBOX-Line: From nobody Thu Jul 17 19:34:55 2008 -From: Paul Walmsley <paul@pwsan.com> -Subject: [PATCH 8/9] TWL4030: use symbolic ISR/IMR register names during - twl_init_irq() -To: linux-omap@vger.kernel.org -Date: Thu, 17 Jul 2008 19:34:55 -0600 -Message-ID: <20080718013454.18943.7428.stgit@localhost.localdomain> -In-Reply-To: <20080718013205.18943.34047.stgit@localhost.localdomain> -References: <20080718013205.18943.34047.stgit@localhost.localdomain> -User-Agent: StGIT/0.14.3.163.g06f9 -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit -Sender: linux-omap-owner@vger.kernel.org -Precedence: bulk -List-ID: <linux-omap.vger.kernel.org> -X-Mailing-List: linux-omap@vger.kernel.org +TWL4030: use symbolic ISR/IMR register names during twl_init_irq() + +From: Paul Walmsley <paul@pwsan.com> twl_init_irq() uses a bunch of magic numbers as register indices; this has already led to several errors, fixed earlier in this patch series. @@ -47,11 +10,11 @@ not change kernel behavior. Signed-off-by: Paul Walmsley <paul@pwsan.com> --- - drivers/i2c/chips/twl4030-core.c | 181 +++++++++++++++++++------------------- - 1 files changed, 89 insertions(+), 92 deletions(-) + drivers/i2c/chips/twl4030-core.c | 188 +++++++++++++++++++------------------- + 1 files changed, 96 insertions(+), 92 deletions(-) diff --git a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c -index 1906635..5855f5f 100644 +index 99cc143..38c227a 100644 --- a/drivers/i2c/chips/twl4030-core.c +++ b/drivers/i2c/chips/twl4030-core.c @@ -40,6 +40,9 @@ @@ -88,10 +51,25 @@ index 1906635..5855f5f 100644 /* Triton Core internal information (END) */ /* Few power values */ -@@ -748,108 +768,85 @@ static void twl_init_irq(void) +@@ -133,12 +153,10 @@ + /* on I2C-1 for 2430SDP */ + #define CONFIG_I2C_TWL4030_ID 1 + +-/* SIH_CTRL registers */ +-#define TWL4030_INT_PWR_SIH_CTRL 0x07 ++/* SIH_CTRL registers that aren't defined elsewhere */ + #define TWL4030_INTERRUPTS_BCISIHCTRL 0x0d + #define TWL4030_MADC_MADC_SIH_CTRL 0x67 + #define TWL4030_KEYPAD_KEYP_SIH_CTRL 0x17 +-#define TWL4030_GPIO_GPIO_SIH_CTRL 0x2d + + #define TWL4030_SIH_CTRL_COR_MASK (1 << 2) + +@@ -776,135 +794,121 @@ static void twl_init_irq(void) * handlers present. */ +- - /* PWR_IMR1 */ - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_INT, 0xff, 0x1) < 0); - @@ -99,21 +77,27 @@ index 1906635..5855f5f 100644 - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_INT, 0xff, 0x3) < 0); - - /* Clear off any other pending interrupts on power */ -- /* PWR_ISR1 */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INT, 0x00) < 0); -- -- /* PWR_ISR2 */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INT, 0x02) < 0); + /* Mask INT (PWR) interrupts at TWL4030 */ + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_INT, 0xff, + TWL4030_INT_PWR_IMR1) < 0); + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_INT, 0xff, + TWL4030_INT_PWR_IMR2) < 0); + + /* Are PWR interrupt status bits cleared by reads or writes? */ + cor = twl4030_read_cor_bit(TWL4030_MODULE_INT, + TWL4030_INT_PWR_SIH_CTRL); + WARN_ON(cor < 0); + +- /* PWR_ISR1 */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INT, 0x00, cor) < 0); +- +- /* PWR_ISR2 */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INT, 0x02, cor) < 0); + /* Clear TWL4030 INT (PWR) ISRs */ + WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INT, -+ TWL4030_INT_PWR_ISR1) < 0); ++ TWL4030_INT_PWR_ISR1, cor) < 0); + WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INT, -+ TWL4030_INT_PWR_ISR2) < 0); ++ TWL4030_INT_PWR_ISR2, cor) < 0); /* Slave address 0x4A */ @@ -128,18 +112,6 @@ index 1906635..5855f5f 100644 - - /* BCIIMR2B */ - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xff, 0x7) < 0); -- -- /* BCIISR1A */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x0) < 0); -- -- /* BCIISR2A */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x1) < 0); -- -- /* BCIISR1B */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x4) < 0); -- -- /* BCIISR2B */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x5) < 0); + /* Mask BCI interrupts at TWL4030 */ + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xff, + TWL4030_INTERRUPTS_BCIIMR1A) < 0); @@ -149,15 +121,32 @@ index 1906635..5855f5f 100644 + TWL4030_INTERRUPTS_BCIIMR1B) < 0); + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xff, + TWL4030_INTERRUPTS_BCIIMR2B) < 0); + + /* Are BCI interrupt status bits cleared by reads or writes? */ + cor = twl4030_read_cor_bit(TWL4030_MODULE_INTERRUPTS, + TWL4030_INTERRUPTS_BCISIHCTRL); + WARN_ON(cor < 0); + +- /* BCIISR1A */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x0, cor) < 0); +- +- /* BCIISR2A */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x1, cor) < 0); +- +- /* BCIISR1B */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x4, cor) < 0); +- +- /* BCIISR2B */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, 0x5, cor) < 0); + /* Clear TWL4030 BCI ISRs */ + WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, -+ TWL4030_INTERRUPTS_BCIISR1A) < 0); ++ TWL4030_INTERRUPTS_BCIISR1A, cor) < 0); + WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, -+ TWL4030_INTERRUPTS_BCIISR2A) < 0); ++ TWL4030_INTERRUPTS_BCIISR2A, cor) < 0); + WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, -+ TWL4030_INTERRUPTS_BCIISR1B) < 0); ++ TWL4030_INTERRUPTS_BCIISR1B, cor) < 0); + WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, -+ TWL4030_INTERRUPTS_BCIISR2B) < 0); ++ TWL4030_INTERRUPTS_BCIISR2B, cor) < 0); /* MAD C */ - /* MADC_IMR1 */ @@ -165,46 +154,56 @@ index 1906635..5855f5f 100644 - - /* MADC_IMR2 */ - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_MADC, 0xff, 0x64) < 0); -- -- /* MADC_ISR1 */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, 0x61) < 0); -- -- /* MADC_ISR2 */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, 0x63) < 0); + /* Mask MADC interrupts at TWL4030 */ + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_MADC, 0xff, + TWL4030_MADC_IMR1) < 0); + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_MADC, 0xff, + TWL4030_MADC_IMR2) < 0); + + /* Are MADC interrupt status bits cleared by reads or writes? */ + cor = twl4030_read_cor_bit(TWL4030_MODULE_MADC, + TWL4030_MADC_MADC_SIH_CTRL); + WARN_ON(cor < 0); + +- /* MADC_ISR1 */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, 0x61, cor) < 0); +- +- /* MADC_ISR2 */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, 0x63, cor) < 0); + /* Clear TWL4030 MADC ISRs */ + WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, -+ TWL4030_MADC_ISR1) < 0); ++ TWL4030_MADC_ISR1, cor) < 0); + WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, -+ TWL4030_MADC_ISR2) < 0); ++ TWL4030_MADC_ISR2, cor) < 0); /* key Pad */ - /* KEYPAD - IMR1 */ - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_KEYPAD, 0xff, 0x12) < 0); -- -- /* KEYPAD - ISR1 */ + /* Mask keypad interrupts at TWL4030 */ + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_KEYPAD, 0xff, + TWL4030_KEYPAD_KEYP_IMR1) < 0); + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_KEYPAD, 0xff, + TWL4030_KEYPAD_KEYP_IMR2) < 0); + + /* Are keypad interrupt status bits cleared by reads or writes? */ + cor = twl4030_read_cor_bit(TWL4030_MODULE_KEYPAD, + TWL4030_KEYPAD_KEYP_SIH_CTRL); + WARN_ON(cor < 0); + +- /* KEYPAD - ISR1 */ + /* Clear TWL4030 keypad ISRs */ /* XXX does this still need to be done twice for some reason? */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, 0x11) < 0); +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, 0x11, cor) < 0); - - /* KEYPAD - IMR2 */ - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_KEYPAD, 0xff, 0x14) < 0); - - /* KEYPAD - ISR2 */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, 0x13) < 0); +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, 0x13, cor) < 0); + WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, -+ TWL4030_KEYPAD_KEYP_ISR1) < 0); ++ TWL4030_KEYPAD_KEYP_ISR1, cor) < 0); + WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, -+ TWL4030_KEYPAD_KEYP_ISR2) < 0); ++ TWL4030_KEYPAD_KEYP_ISR2, cor) < 0); /* Slave address 0x49 */ - /* GPIO_IMR1A */ @@ -218,30 +217,12 @@ index 1906635..5855f5f 100644 - - /* GPIO_IMR1B */ - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, 0x22) < 0); -- + - /* GPIO_IMR2B */ - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, 0x23) < 0); - - /* GPIO_IMR3B */ - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, 0x24) < 0); -- -- /* GPIO_ISR1A */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x19) < 0); -- -- /* GPIO_ISR2A */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x1a) < 0); -- -- /* GPIO_ISR3A */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x1b) < 0); -- -- /* GPIO_ISR1B */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x1f) < 0); -- -- /* GPIO_ISR2B */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x20) < 0); -- -- /* GPIO_ISR3B */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x21) < 0); + /* Mask GPIO interrupts at TWL4030 */ + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, + REG_GPIO_IMR1A) < 0); @@ -255,21 +236,43 @@ index 1906635..5855f5f 100644 + REG_GPIO_IMR2B) < 0); + WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, + REG_GPIO_IMR3B) < 0); -+ + + /* Are GPIO interrupt status bits cleared by reads or writes? */ + cor = twl4030_read_cor_bit(TWL4030_MODULE_GPIO, +- TWL4030_GPIO_GPIO_SIH_CTRL); ++ REG_GPIO_SIH_CTRL); + WARN_ON(cor < 0); + +- /* GPIO_ISR1A */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x19, cor) < 0); +- +- /* GPIO_ISR2A */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x1a, cor) < 0); +- +- /* GPIO_ISR3A */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x1b, cor) < 0); +- +- /* GPIO_ISR1B */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x1f, cor) < 0); +- +- /* GPIO_ISR2B */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x20, cor) < 0); +- +- /* GPIO_ISR3B */ +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, 0x21, cor) < 0); + /* Clear TWL4030 GPIO ISRs */ -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR1A) < 0); -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR2A) < 0); -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR3A) < 0); -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR1B) < 0); -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR2B) < 0); -+ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR3B) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR1A, ++ cor) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR2A, ++ cor) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR3A, ++ cor) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR1B, ++ cor) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR2B, ++ cor) < 0); ++ WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR3B, ++ cor) < 0); /* install an irq handler for each of the PIH modules */ for (i = TWL4030_IRQ_BASE; i < TWL4030_IRQ_END; i++) { - - --- -To unsubscribe from this list: send the line "unsubscribe linux-omap" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html - diff --git a/packages/linux/linux-omap2-git/beagleboard/TWL4030-09.patch b/packages/linux/linux-omap2-git/beagleboard/TWL4030-09.patch index 3a2eb05fd8..ab6cc6d87b 100644 --- a/packages/linux/linux-omap2-git/beagleboard/TWL4030-09.patch +++ b/packages/linux/linux-omap2-git/beagleboard/TWL4030-09.patch @@ -1,63 +1,28 @@ -X-Mozilla-Status: 0001 -X-Mozilla-Status2: 00000000 -Return-Path: <linux-omap-owner@vger.kernel.org> -X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on shovel.geekisp.com -X-Spam-Level: -X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,DKIM_POLICY_SIGNSOME - autolearn=ham version=3.2.1 -Delivered-To: balister.org-philip@balister.org -Received: (qmail 21557 invoked by uid 1003); 18 Jul 2008 01:35:32 -0000 -Received: from vger.kernel.org (209.132.176.167) - by mail.geekisp.com with SMTP; 18 Jul 2008 01:35:32 -0000 -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1757008AbYGRBfb (ORCPT <rfc822;philip@balister.org>); - Thu, 17 Jul 2008 21:35:31 -0400 -Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756351AbYGRBfb - (ORCPT <rfc822;linux-omap-outgoing>); - Thu, 17 Jul 2008 21:35:31 -0400 -Received: from utopia.booyaka.com ([72.9.107.138]:49369 "EHLO - utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1756783AbYGRBfZ (ORCPT - <rfc822;linux-omap@vger.kernel.org>); Thu, 17 Jul 2008 21:35:25 -0400 -Received: (qmail 13900 invoked by uid 526); 18 Jul 2008 01:35:24 -0000 -MBOX-Line: From nobody Thu Jul 17 19:34:56 2008 -From: Paul Walmsley <paul@pwsan.com> -Subject: [PATCH 9/9] TWL4030: convert early interrupt mask/clear funcs to use - array -To: linux-omap@vger.kernel.org -Date: Thu, 17 Jul 2008 19:34:56 -0600 -Message-ID: <20080718013455.18943.62389.stgit@localhost.localdomain> -In-Reply-To: <20080718013205.18943.34047.stgit@localhost.localdomain> -References: <20080718013205.18943.34047.stgit@localhost.localdomain> -User-Agent: StGIT/0.14.3.163.g06f9 -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit -Sender: linux-omap-owner@vger.kernel.org -Precedence: bulk -List-ID: <linux-omap.vger.kernel.org> -X-Mailing-List: linux-omap@vger.kernel.org +TWL4030: convert early interrupt mask/clear funcs to use array + +From: Paul Walmsley <paul@pwsan.com> Mask/clear TWL module IMRs/ISRs by iterating through arrays rather than -using a block of cut-and-pasted commands. Removes 632 bytes of bloat. +using a block of cut-and-pasted commands. Removes 1056 bytes of bloat. Signed-off-by: Paul Walmsley <paul@pwsan.com> --- - drivers/i2c/chips/twl4030-core.c | 218 ++++++++++++++++++++++++-------------- - 1 files changed, 137 insertions(+), 81 deletions(-) + drivers/i2c/chips/twl4030-core.c | 302 +++++++++++++++++++++++--------------- + 1 files changed, 180 insertions(+), 122 deletions(-) diff --git a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c -index 5855f5f..47d547d 100644 +index 38c227a..776b1dd 100644 --- a/drivers/i2c/chips/twl4030-core.c +++ b/drivers/i2c/chips/twl4030-core.c -@@ -153,6 +153,130 @@ - /* on I2C-1 for 2430SDP */ - #define CONFIG_I2C_TWL4030_ID 1 +@@ -160,6 +160,136 @@ + + #define TWL4030_SIH_CTRL_COR_MASK (1 << 2) +/** + * struct twl4030_mod_iregs - TWL module IMR/ISR regs to mask/clear at init + * @mod_no: TWL4030 module number (e.g., TWL4030_MODULE_GPIO) ++ * @sih_ctrl: address of module SIH_CTRL register + * @reg_cnt: number of IMR/ISR regs + * @imrs: pointer to array of TWL module interrupt mask register indices + * @isrs: pointer to array of TWL module interrupt status register indices @@ -67,6 +32,7 @@ index 5855f5f..47d547d 100644 + */ +struct twl4030_mod_iregs { + const u8 mod_no; ++ const u8 sih_ctrl; + const u8 reg_cnt; + const u8 *imrs; + const u8 *isrs; @@ -147,53 +113,110 @@ index 5855f5f..47d547d 100644 +/* TWL4030 modules that have IMR/ISR registers that must be masked/cleared */ +static const struct twl4030_mod_iregs __initconst twl4030_mod_regs[] = { + { -+ .mod_no = TWL4030_MODULE_INT, -+ .reg_cnt = ARRAY_SIZE(twl4030_int_imr_regs), -+ .imrs = twl4030_int_imr_regs, -+ .isrs = twl4030_int_isr_regs, ++ .mod_no = TWL4030_MODULE_INT, ++ .sih_ctrl = TWL4030_INT_PWR_SIH_CTRL, ++ .reg_cnt = ARRAY_SIZE(twl4030_int_imr_regs), ++ .imrs = twl4030_int_imr_regs, ++ .isrs = twl4030_int_isr_regs, + }, + { -+ .mod_no = TWL4030_MODULE_INTERRUPTS, -+ .reg_cnt = ARRAY_SIZE(twl4030_interrupts_imr_regs), -+ .imrs = twl4030_interrupts_imr_regs, -+ .isrs = twl4030_interrupts_isr_regs, ++ .mod_no = TWL4030_MODULE_INTERRUPTS, ++ .sih_ctrl = TWL4030_INTERRUPTS_BCISIHCTRL, ++ .reg_cnt = ARRAY_SIZE(twl4030_interrupts_imr_regs), ++ .imrs = twl4030_interrupts_imr_regs, ++ .isrs = twl4030_interrupts_isr_regs, + }, + { -+ .mod_no = TWL4030_MODULE_MADC, -+ .reg_cnt = ARRAY_SIZE(twl4030_madc_imr_regs), -+ .imrs = twl4030_madc_imr_regs, -+ .isrs = twl4030_madc_isr_regs, ++ .mod_no = TWL4030_MODULE_MADC, ++ .sih_ctrl = TWL4030_MADC_MADC_SIH_CTRL, ++ .reg_cnt = ARRAY_SIZE(twl4030_madc_imr_regs), ++ .imrs = twl4030_madc_imr_regs, ++ .isrs = twl4030_madc_isr_regs, + }, + { -+ .mod_no = TWL4030_MODULE_KEYPAD, -+ .reg_cnt = ARRAY_SIZE(twl4030_keypad_imr_regs), -+ .imrs = twl4030_keypad_imr_regs, -+ .isrs = twl4030_keypad_isr_regs, ++ .mod_no = TWL4030_MODULE_KEYPAD, ++ .sih_ctrl = TWL4030_KEYPAD_KEYP_SIH_CTRL, ++ .reg_cnt = ARRAY_SIZE(twl4030_keypad_imr_regs), ++ .imrs = twl4030_keypad_imr_regs, ++ .isrs = twl4030_keypad_isr_regs, + }, + { -+ .mod_no = TWL4030_MODULE_GPIO, -+ .reg_cnt = ARRAY_SIZE(twl4030_gpio_imr_regs), -+ .imrs = twl4030_gpio_imr_regs, -+ .isrs = twl4030_gpio_isr_regs, ++ .mod_no = TWL4030_MODULE_GPIO, ++ .sih_ctrl = REG_GPIO_SIH_CTRL, ++ .reg_cnt = ARRAY_SIZE(twl4030_gpio_imr_regs), ++ .imrs = twl4030_gpio_imr_regs, ++ .isrs = twl4030_gpio_isr_regs, + }, +}; + -+ + /* Helper functions */ static int - twl4030_detect_client(struct i2c_adapter *adapter, unsigned char sid); -@@ -756,7 +880,7 @@ static int twl4030_i2c_clear_isr(u8 mod_no, u8 reg) +@@ -779,136 +909,64 @@ static int twl4030_read_cor_bit(u8 mod_no, u8 reg) + return tmp; + } ++/** ++ * twl4030_mask_clear_intrs - mask and clear all TWL4030 interrupts ++ * @t: pointer to twl4030_mod_iregs array ++ * @t_sz: ARRAY_SIZE(t) (starting at 1) ++ * ++ * Mask all TWL4030 interrupt mask registers (IMRs) and clear all ++ * interrupt status registers (ISRs). No return value, but will WARN if ++ * any I2C operations fail. ++ */ ++static void __init twl4030_mask_clear_intrs(const struct twl4030_mod_iregs *t, ++ const u8 t_sz) ++{ ++ int i, j; ++ ++ /* ++ * N.B. - further efficiency is possible here. Eight I2C ++ * operations on BCI and GPIO modules are avoidable if I2C ++ * burst read/write transactions were implemented. Would ++ * probably save about 1ms of boot time and a small amount of ++ * power. ++ */ ++ for (i = 0; i < t_sz; i++) { ++ const struct twl4030_mod_iregs tmr = t[i]; ++ ++ for (j = 0; j < tmr.reg_cnt; j++) { ++ int cor; ++ ++ /* Mask interrupts at the TWL4030 */ ++ WARN_ON(twl4030_i2c_write_u8(tmr.mod_no, 0xff, ++ tmr.imrs[j]) < 0); ++ ++ /* Are ISRs cleared by reads or writes? */ ++ cor = twl4030_read_cor_bit(tmr.mod_no, tmr.sih_ctrl); ++ WARN_ON(cor < 0); ++ ++ /* Clear TWL4030 ISRs */ ++ WARN_ON(twl4030_i2c_clear_isr(tmr.mod_no, ++ tmr.isrs[j], cor) < 0); ++ } ++ } ++ ++ return; ++} ++ ++ static void twl_init_irq(void) { - int i = 0; -+ int i, j; ++ int i; int res = 0; +- int cor; char *msg = "Unable to register interrupt subsystem"; unsigned int irq_num; -@@ -767,86 +891,18 @@ static void twl_init_irq(void) - * since we initially do not have any TWL4030 module interrupt - * handlers present. + + /* +- * For each TWL4030 module with ISR/IMR registers, mask all +- * interrupts and then clear any existing interrupt status bits, +- * since we initially do not have any TWL4030 module interrupt +- * handlers present. ++ * Mask and clear all TWL4030 interrupts since initially we do ++ * not have any TWL4030 module interrupt handlers present */ - - /* Mask INT (PWR) interrupts at TWL4030 */ @@ -201,11 +224,17 @@ index 5855f5f..47d547d 100644 - TWL4030_INT_PWR_IMR1) < 0); - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_INT, 0xff, - TWL4030_INT_PWR_IMR2) < 0); +- +- /* Are PWR interrupt status bits cleared by reads or writes? */ +- cor = twl4030_read_cor_bit(TWL4030_MODULE_INT, +- TWL4030_INT_PWR_SIH_CTRL); +- WARN_ON(cor < 0); +- - /* Clear TWL4030 INT (PWR) ISRs */ - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INT, -- TWL4030_INT_PWR_ISR1) < 0); +- TWL4030_INT_PWR_ISR1, cor) < 0); - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INT, -- TWL4030_INT_PWR_ISR2) < 0); +- TWL4030_INT_PWR_ISR2, cor) < 0); - - /* Slave address 0x4A */ - @@ -218,15 +247,21 @@ index 5855f5f..47d547d 100644 - TWL4030_INTERRUPTS_BCIIMR1B) < 0); - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xff, - TWL4030_INTERRUPTS_BCIIMR2B) < 0); +- +- /* Are BCI interrupt status bits cleared by reads or writes? */ +- cor = twl4030_read_cor_bit(TWL4030_MODULE_INTERRUPTS, +- TWL4030_INTERRUPTS_BCISIHCTRL); +- WARN_ON(cor < 0); +- - /* Clear TWL4030 BCI ISRs */ - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, -- TWL4030_INTERRUPTS_BCIISR1A) < 0); +- TWL4030_INTERRUPTS_BCIISR1A, cor) < 0); - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, -- TWL4030_INTERRUPTS_BCIISR2A) < 0); +- TWL4030_INTERRUPTS_BCIISR2A, cor) < 0); - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, -- TWL4030_INTERRUPTS_BCIISR1B) < 0); +- TWL4030_INTERRUPTS_BCIISR1B, cor) < 0); - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_INTERRUPTS, -- TWL4030_INTERRUPTS_BCIISR2B) < 0); +- TWL4030_INTERRUPTS_BCIISR2B, cor) < 0); - - /* MAD C */ - /* Mask MADC interrupts at TWL4030 */ @@ -234,11 +269,17 @@ index 5855f5f..47d547d 100644 - TWL4030_MADC_IMR1) < 0); - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_MADC, 0xff, - TWL4030_MADC_IMR2) < 0); +- +- /* Are MADC interrupt status bits cleared by reads or writes? */ +- cor = twl4030_read_cor_bit(TWL4030_MODULE_MADC, +- TWL4030_MADC_MADC_SIH_CTRL); +- WARN_ON(cor < 0); +- - /* Clear TWL4030 MADC ISRs */ - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, -- TWL4030_MADC_ISR1) < 0); +- TWL4030_MADC_ISR1, cor) < 0); - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_MADC, -- TWL4030_MADC_ISR2) < 0); +- TWL4030_MADC_ISR2, cor) < 0); - - /* key Pad */ - /* Mask keypad interrupts at TWL4030 */ @@ -246,14 +287,21 @@ index 5855f5f..47d547d 100644 - TWL4030_KEYPAD_KEYP_IMR1) < 0); - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_KEYPAD, 0xff, - TWL4030_KEYPAD_KEYP_IMR2) < 0); +- +- /* Are keypad interrupt status bits cleared by reads or writes? */ +- cor = twl4030_read_cor_bit(TWL4030_MODULE_KEYPAD, +- TWL4030_KEYPAD_KEYP_SIH_CTRL); +- WARN_ON(cor < 0); +- - /* Clear TWL4030 keypad ISRs */ - /* XXX does this still need to be done twice for some reason? */ - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, -- TWL4030_KEYPAD_KEYP_ISR1) < 0); +- TWL4030_KEYPAD_KEYP_ISR1, cor) < 0); - WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_KEYPAD, -- TWL4030_KEYPAD_KEYP_ISR2) < 0); +- TWL4030_KEYPAD_KEYP_ISR2, cor) < 0); - - /* Slave address 0x49 */ +- - /* Mask GPIO interrupts at TWL4030 */ - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, - REG_GPIO_IMR1A) < 0); @@ -268,32 +316,26 @@ index 5855f5f..47d547d 100644 - WARN_ON(twl4030_i2c_write_u8(TWL4030_MODULE_GPIO, 0xff, - REG_GPIO_IMR3B) < 0); - +- /* Are GPIO interrupt status bits cleared by reads or writes? */ +- cor = twl4030_read_cor_bit(TWL4030_MODULE_GPIO, +- REG_GPIO_SIH_CTRL); +- WARN_ON(cor < 0); +- - /* Clear TWL4030 GPIO ISRs */ -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR1A) < 0); -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR2A) < 0); -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR3A) < 0); -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR1B) < 0); -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR2B) < 0); -- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR3B) < 0); -+ for (i = 0; i < ARRAY_SIZE(twl4030_mod_regs); i++) { -+ const struct twl4030_mod_iregs tmr = twl4030_mod_regs[i]; -+ -+ for (j = 0; j < tmr.reg_cnt; j++) { -+ /* Mask interrupts at the TWL4030 */ -+ WARN_ON(twl4030_i2c_write_u8(tmr.mod_no, 0xff, -+ tmr.imrs[j]) < 0); -+ /* Clear TWL4030 ISRs */ -+ WARN_ON(twl4030_i2c_clear_isr(tmr.mod_no, -+ tmr.isrs[j]) < 0); -+ } -+ } +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR1A, +- cor) < 0); +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR2A, +- cor) < 0); +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR3A, +- cor) < 0); +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR1B, +- cor) < 0); +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR2B, +- cor) < 0); +- WARN_ON(twl4030_i2c_clear_isr(TWL4030_MODULE_GPIO, REG_GPIO_ISR3B, +- cor) < 0); ++ twl4030_mask_clear_intrs(twl4030_mod_regs, ++ ARRAY_SIZE(twl4030_mod_regs)); /* install an irq handler for each of the PIH modules */ for (i = TWL4030_IRQ_BASE; i < TWL4030_IRQ_END; i++) { - - --- -To unsubscribe from this list: send the line "unsubscribe linux-omap" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html - diff --git a/packages/linux/linux-omap2-git/beagleboard/mru-clocks1.diff b/packages/linux/linux-omap2-git/beagleboard/mru-clocks1.diff new file mode 100644 index 0000000000..a17cc52c16 --- /dev/null +++ b/packages/linux/linux-omap2-git/beagleboard/mru-clocks1.diff @@ -0,0 +1,25 @@ +From: Mans Rullgard <mans@mansr.com> +Date: Tue, 22 Jul 2008 00:31:11 +0000 (+0100) +Subject: ARM: OMAP: make dpll4_m4_ck programmable with clk_set_rate() +X-Git-Url: http://git.mansr.com/?p=linux-omap;a=commitdiff_plain;h=edc6cd29284f64f524dd410fdc5e6133bc177a8f + +ARM: OMAP: make dpll4_m4_ck programmable with clk_set_rate() + +Filling the set_rate and round_rate fields of dpll4_m4_ck makes +this clock programmable through clk_set_rate(). This is needed +to give omapfb control over the dss1_alwon_fck rate. +--- + +diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h +index 161da12..876eb13 100644 +--- a/arch/arm/mach-omap2/clock34xx.h ++++ b/arch/arm/mach-omap2/clock34xx.h +@@ -815,6 +815,8 @@ static struct clk dpll4_m4_ck = { + .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | + PARENT_CONTROLS_CLOCK, + .recalc = &omap2_clksel_recalc, ++ .set_rate = &omap2_clksel_set_rate, ++ .round_rate = &omap2_clksel_round_rate, + }; + + /* The PWRDN bit is apparently only available on 3430ES2 and above */ diff --git a/packages/linux/linux-omap2-git/beagleboard/mru-clocks2.diff b/packages/linux/linux-omap2-git/beagleboard/mru-clocks2.diff new file mode 100644 index 0000000000..99c8f7c285 --- /dev/null +++ b/packages/linux/linux-omap2-git/beagleboard/mru-clocks2.diff @@ -0,0 +1,62 @@ +From: Mans Rullgard <mans@mansr.com> +Date: Tue, 22 Jul 2008 00:58:18 +0000 (+0100) +Subject: ARM: OMAP: add clk_get_parent() for OMAP2/3 +X-Git-Url: http://git.mansr.com/?p=linux-omap;a=commitdiff_plain;h=76a35ce79194b60e3697378e726e1e510c9349d1 + +ARM: OMAP: add clk_get_parent() for OMAP2/3 + +Signed-off-by: Mans Rullgard <mans@mansr.com> +--- + +diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c +index 577be44..28aec36 100644 +--- a/arch/arm/mach-omap2/clock.c ++++ b/arch/arm/mach-omap2/clock.c +@@ -824,6 +824,11 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) + return 0; + } + ++struct clk *omap2_clk_get_parent(struct clk *clk) ++{ ++ return clk->parent; ++} ++ + /* DPLL rate rounding code */ + + /** +diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h +index 49245f7..4aa69d5 100644 +--- a/arch/arm/mach-omap2/clock.h ++++ b/arch/arm/mach-omap2/clock.h +@@ -29,6 +29,7 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate); + int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent); + int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance); + long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate); ++struct clk *omap2_clk_get_parent(struct clk *clk); + + #ifdef CONFIG_OMAP_RESET_CLOCKS + void omap2_clk_disable_unused(struct clk *clk); +diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c +index 54cc6e1..ed7af21 100644 +--- a/arch/arm/mach-omap2/clock24xx.c ++++ b/arch/arm/mach-omap2/clock24xx.c +@@ -422,6 +422,7 @@ static struct clk_functions omap2_clk_functions = { + .clk_round_rate = omap2_clk_round_rate, + .clk_set_rate = omap2_clk_set_rate, + .clk_set_parent = omap2_clk_set_parent, ++ .clk_get_parent = omap2_clk_get_parent, + .clk_disable_unused = omap2_clk_disable_unused, + #ifdef CONFIG_CPU_FREQ + .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table, +diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c +index 04dedec..08c8c46 100644 +--- a/arch/arm/mach-omap2/clock34xx.c ++++ b/arch/arm/mach-omap2/clock34xx.c +@@ -541,6 +541,7 @@ static struct clk_functions omap2_clk_functions = { + .clk_round_rate = omap2_clk_round_rate, + .clk_set_rate = omap2_clk_set_rate, + .clk_set_parent = omap2_clk_set_parent, ++ .clk_get_parent = omap2_clk_get_parent, + .clk_disable_unused = omap2_clk_disable_unused, + }; + diff --git a/packages/linux/linux-omap2_git.bb b/packages/linux/linux-omap2_git.bb index 88cd433166..c6ffd347de 100644 --- a/packages/linux/linux-omap2_git.bb +++ b/packages/linux/linux-omap2_git.bb @@ -6,7 +6,7 @@ SRCREV = "d3b3ae0fe6c71641da19c8de466ec366d39847e3" PV = "2.6.26" #PV = "2.6.25+2.6.26-rc9+${PR}+git${SRCREV}" -PR = "r45" +PR = "r46" SRC_URI = "git://source.mvista.com/git/linux-omap-2.6.git;protocol=git \ file://defconfig" @@ -41,6 +41,8 @@ SRC_URI_append_beagleboard = " file://no-harry-potter.diff;patch=1 \ file://TWL4030-07.patch;patch=1 \ file://TWL4030-08.patch;patch=1 \ file://TWL4030-09.patch;patch=1 \ + file://mru-clocks1.diff;patch=1 \ + file://mru-clocks2.diff;patch=1 \ " SRC_URI_append_omap3evm = " file://no-harry-potter.diff;patch=1 \ diff --git a/packages/linux/linux-openmoko-devel/0001-squashfs-with-lzma.patch b/packages/linux/linux-openmoko-devel/0001-squashfs-with-lzma.patch new file mode 100644 index 0000000000..04d47fe16f --- /dev/null +++ b/packages/linux/linux-openmoko-devel/0001-squashfs-with-lzma.patch @@ -0,0 +1,5342 @@ + +diff -urN linux-2.6.23/fs/squashfs/LzmaDecode.c linux-2.6.23.sqlzma-ng/fs/squashfs/LzmaDecode.c +--- linux-2.6.23/fs/squashfs/LzmaDecode.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/LzmaDecode.c 2007-11-13 19:45:12.000000000 -0500 +@@ -0,0 +1,584 @@ ++/*
++ LzmaDecode.c
++ LZMA Decoder (optimized for Speed version)
++
++ LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
++ http://www.7-zip.org/
++
++ LZMA SDK is licensed under two licenses:
++ 1) GNU Lesser General Public License (GNU LGPL)
++ 2) Common Public License (CPL)
++ It means that you can select one of these two licenses and
++ follow rules of that license.
++
++ SPECIAL EXCEPTION:
++ Igor Pavlov, as the author of this Code, expressly permits you to
++ statically or dynamically link your Code (or bind by name) to the
++ interfaces of this file without subjecting your linked Code to the
++ terms of the CPL or GNU LGPL. Any modifications or additions
++ to this file, however, are subject to the LGPL or CPL terms.
++*/
++
++#include "LzmaDecode.h"
++
++#define kNumTopBits 24
++#define kTopValue ((UInt32)1 << kNumTopBits)
++
++#define kNumBitModelTotalBits 11
++#define kBitModelTotal (1 << kNumBitModelTotalBits)
++#define kNumMoveBits 5
++
++#define RC_READ_BYTE (*Buffer++)
++
++#define RC_INIT2 Code = 0; Range = 0xFFFFFFFF; \
++ { int i; for(i = 0; i < 5; i++) { RC_TEST; Code = (Code << 8) | RC_READ_BYTE; }}
++
++#ifdef _LZMA_IN_CB
++
++#define RC_TEST { if (Buffer == BufferLim) \
++ { SizeT size; int result = InCallback->Read(InCallback, &Buffer, &size); if (result != LZMA_RESULT_OK) return result; \
++ BufferLim = Buffer + size; if (size == 0) return LZMA_RESULT_DATA_ERROR; }}
++
++#define RC_INIT Buffer = BufferLim = 0; RC_INIT2
++
++#else
++
++#define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; }
++
++#define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2
++
++#endif
++
++#define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; }
++
++#define IfBit0(p) RC_NORMALIZE; bound = (Range >> kNumBitModelTotalBits) * *(p); if (Code < bound)
++#define UpdateBit0(p) Range = bound; *(p) += (kBitModelTotal - *(p)) >> kNumMoveBits;
++#define UpdateBit1(p) Range -= bound; Code -= bound; *(p) -= (*(p)) >> kNumMoveBits;
++
++#define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \
++ { UpdateBit0(p); mi <<= 1; A0; } else \
++ { UpdateBit1(p); mi = (mi + mi) + 1; A1; }
++
++#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
++
++#define RangeDecoderBitTreeDecode(probs, numLevels, res) \
++ { int i = numLevels; res = 1; \
++ do { CProb *p = probs + res; RC_GET_BIT(p, res) } while(--i != 0); \
++ res -= (1 << numLevels); }
++
++
++#define kNumPosBitsMax 4
++#define kNumPosStatesMax (1 << kNumPosBitsMax)
++
++#define kLenNumLowBits 3
++#define kLenNumLowSymbols (1 << kLenNumLowBits)
++#define kLenNumMidBits 3
++#define kLenNumMidSymbols (1 << kLenNumMidBits)
++#define kLenNumHighBits 8
++#define kLenNumHighSymbols (1 << kLenNumHighBits)
++
++#define LenChoice 0
++#define LenChoice2 (LenChoice + 1)
++#define LenLow (LenChoice2 + 1)
++#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
++#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
++#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
++
++
++#define kNumStates 12
++#define kNumLitStates 7
++
++#define kStartPosModelIndex 4
++#define kEndPosModelIndex 14
++#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
++
++#define kNumPosSlotBits 6
++#define kNumLenToPosStates 4
++
++#define kNumAlignBits 4
++#define kAlignTableSize (1 << kNumAlignBits)
++
++#define kMatchMinLen 2
++
++#define IsMatch 0
++#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
++#define IsRepG0 (IsRep + kNumStates)
++#define IsRepG1 (IsRepG0 + kNumStates)
++#define IsRepG2 (IsRepG1 + kNumStates)
++#define IsRep0Long (IsRepG2 + kNumStates)
++#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
++#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
++#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
++#define LenCoder (Align + kAlignTableSize)
++#define RepLenCoder (LenCoder + kNumLenProbs)
++#define Literal (RepLenCoder + kNumLenProbs)
++
++#if Literal != LZMA_BASE_SIZE
++StopCompilingDueBUG
++#endif
++
++int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size)
++{
++ unsigned char prop0;
++ if (size < LZMA_PROPERTIES_SIZE)
++ return LZMA_RESULT_DATA_ERROR;
++ prop0 = propsData[0];
++ if (prop0 >= (9 * 5 * 5))
++ return LZMA_RESULT_DATA_ERROR;
++ {
++ for (propsRes->pb = 0; prop0 >= (9 * 5); propsRes->pb++, prop0 -= (9 * 5));
++ for (propsRes->lp = 0; prop0 >= 9; propsRes->lp++, prop0 -= 9);
++ propsRes->lc = prop0;
++ /*
++ unsigned char remainder = (unsigned char)(prop0 / 9);
++ propsRes->lc = prop0 % 9;
++ propsRes->pb = remainder / 5;
++ propsRes->lp = remainder % 5;
++ */
++ }
++
++ #ifdef _LZMA_OUT_READ
++ {
++ int i;
++ propsRes->DictionarySize = 0;
++ for (i = 0; i < 4; i++)
++ propsRes->DictionarySize += (UInt32)(propsData[1 + i]) << (i * 8);
++ if (propsRes->DictionarySize == 0)
++ propsRes->DictionarySize = 1;
++ }
++ #endif
++ return LZMA_RESULT_OK;
++}
++
++#define kLzmaStreamWasFinishedId (-1)
++
++int LzmaDecode(CLzmaDecoderState *vs,
++ #ifdef _LZMA_IN_CB
++ ILzmaInCallback *InCallback,
++ #else
++ const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
++ #endif
++ unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed)
++{
++ CProb *p = vs->Probs;
++ SizeT nowPos = 0;
++ Byte previousByte = 0;
++ UInt32 posStateMask = (1 << (vs->Properties.pb)) - 1;
++ UInt32 literalPosMask = (1 << (vs->Properties.lp)) - 1;
++ int lc = vs->Properties.lc;
++
++ #ifdef _LZMA_OUT_READ
++
++ UInt32 Range = vs->Range;
++ UInt32 Code = vs->Code;
++ #ifdef _LZMA_IN_CB
++ const Byte *Buffer = vs->Buffer;
++ const Byte *BufferLim = vs->BufferLim;
++ #else
++ const Byte *Buffer = inStream;
++ const Byte *BufferLim = inStream + inSize;
++ #endif
++ int state = vs->State;
++ UInt32 rep0 = vs->Reps[0], rep1 = vs->Reps[1], rep2 = vs->Reps[2], rep3 = vs->Reps[3];
++ int len = vs->RemainLen;
++ UInt32 globalPos = vs->GlobalPos;
++ UInt32 distanceLimit = vs->DistanceLimit;
++
++ Byte *dictionary = vs->Dictionary;
++ UInt32 dictionarySize = vs->Properties.DictionarySize;
++ UInt32 dictionaryPos = vs->DictionaryPos;
++
++ Byte tempDictionary[4];
++
++ #ifndef _LZMA_IN_CB
++ *inSizeProcessed = 0;
++ #endif
++ *outSizeProcessed = 0;
++ if (len == kLzmaStreamWasFinishedId)
++ return LZMA_RESULT_OK;
++
++ if (dictionarySize == 0)
++ {
++ dictionary = tempDictionary;
++ dictionarySize = 1;
++ tempDictionary[0] = vs->TempDictionary[0];
++ }
++
++ if (len == kLzmaNeedInitId)
++ {
++ {
++ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
++ UInt32 i;
++ for (i = 0; i < numProbs; i++)
++ p[i] = kBitModelTotal >> 1;
++ rep0 = rep1 = rep2 = rep3 = 1;
++ state = 0;
++ globalPos = 0;
++ distanceLimit = 0;
++ dictionaryPos = 0;
++ dictionary[dictionarySize - 1] = 0;
++ #ifdef _LZMA_IN_CB
++ RC_INIT;
++ #else
++ RC_INIT(inStream, inSize);
++ #endif
++ }
++ len = 0;
++ }
++ while(len != 0 && nowPos < outSize)
++ {
++ UInt32 pos = dictionaryPos - rep0;
++ if (pos >= dictionarySize)
++ pos += dictionarySize;
++ outStream[nowPos++] = dictionary[dictionaryPos] = dictionary[pos];
++ if (++dictionaryPos == dictionarySize)
++ dictionaryPos = 0;
++ len--;
++ }
++ if (dictionaryPos == 0)
++ previousByte = dictionary[dictionarySize - 1];
++ else
++ previousByte = dictionary[dictionaryPos - 1];
++
++ #else /* if !_LZMA_OUT_READ */
++
++ int state = 0;
++ UInt32 rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1;
++ int len = 0;
++ const Byte *Buffer;
++ const Byte *BufferLim;
++ UInt32 Range;
++ UInt32 Code;
++
++ #ifndef _LZMA_IN_CB
++ *inSizeProcessed = 0;
++ #endif
++ *outSizeProcessed = 0;
++
++ {
++ UInt32 i;
++ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
++ for (i = 0; i < numProbs; i++)
++ p[i] = kBitModelTotal >> 1;
++ }
++
++ #ifdef _LZMA_IN_CB
++ RC_INIT;
++ #else
++ RC_INIT(inStream, inSize);
++ #endif
++
++ #endif /* _LZMA_OUT_READ */
++
++ while(nowPos < outSize)
++ {
++ CProb *prob;
++ UInt32 bound;
++ int posState = (int)(
++ (nowPos
++ #ifdef _LZMA_OUT_READ
++ + globalPos
++ #endif
++ )
++ & posStateMask);
++
++ prob = p + IsMatch + (state << kNumPosBitsMax) + posState;
++ IfBit0(prob)
++ {
++ int symbol = 1;
++ UpdateBit0(prob)
++ prob = p + Literal + (LZMA_LIT_SIZE *
++ (((
++ (nowPos
++ #ifdef _LZMA_OUT_READ
++ + globalPos
++ #endif
++ )
++ & literalPosMask) << lc) + (previousByte >> (8 - lc))));
++
++ if (state >= kNumLitStates)
++ {
++ int matchByte;
++ #ifdef _LZMA_OUT_READ
++ UInt32 pos = dictionaryPos - rep0;
++ if (pos >= dictionarySize)
++ pos += dictionarySize;
++ matchByte = dictionary[pos];
++ #else
++ matchByte = outStream[nowPos - rep0];
++ #endif
++ do
++ {
++ int bit;
++ CProb *probLit;
++ matchByte <<= 1;
++ bit = (matchByte & 0x100);
++ probLit = prob + 0x100 + bit + symbol;
++ RC_GET_BIT2(probLit, symbol, if (bit != 0) break, if (bit == 0) break)
++ }
++ while (symbol < 0x100);
++ }
++ while (symbol < 0x100)
++ {
++ CProb *probLit = prob + symbol;
++ RC_GET_BIT(probLit, symbol)
++ }
++ previousByte = (Byte)symbol;
++
++ outStream[nowPos++] = previousByte;
++ #ifdef _LZMA_OUT_READ
++ if (distanceLimit < dictionarySize)
++ distanceLimit++;
++
++ dictionary[dictionaryPos] = previousByte;
++ if (++dictionaryPos == dictionarySize)
++ dictionaryPos = 0;
++ #endif
++ if (state < 4) state = 0;
++ else if (state < 10) state -= 3;
++ else state -= 6;
++ }
++ else
++ {
++ UpdateBit1(prob);
++ prob = p + IsRep + state;
++ IfBit0(prob)
++ {
++ UpdateBit0(prob);
++ rep3 = rep2;
++ rep2 = rep1;
++ rep1 = rep0;
++ state = state < kNumLitStates ? 0 : 3;
++ prob = p + LenCoder;
++ }
++ else
++ {
++ UpdateBit1(prob);
++ prob = p + IsRepG0 + state;
++ IfBit0(prob)
++ {
++ UpdateBit0(prob);
++ prob = p + IsRep0Long + (state << kNumPosBitsMax) + posState;
++ IfBit0(prob)
++ {
++ #ifdef _LZMA_OUT_READ
++ UInt32 pos;
++ #endif
++ UpdateBit0(prob);
++
++ #ifdef _LZMA_OUT_READ
++ if (distanceLimit == 0)
++ #else
++ if (nowPos == 0)
++ #endif
++ return LZMA_RESULT_DATA_ERROR;
++
++ state = state < kNumLitStates ? 9 : 11;
++ #ifdef _LZMA_OUT_READ
++ pos = dictionaryPos - rep0;
++ if (pos >= dictionarySize)
++ pos += dictionarySize;
++ previousByte = dictionary[pos];
++ dictionary[dictionaryPos] = previousByte;
++ if (++dictionaryPos == dictionarySize)
++ dictionaryPos = 0;
++ #else
++ previousByte = outStream[nowPos - rep0];
++ #endif
++ outStream[nowPos++] = previousByte;
++ #ifdef _LZMA_OUT_READ
++ if (distanceLimit < dictionarySize)
++ distanceLimit++;
++ #endif
++
++ continue;
++ }
++ else
++ {
++ UpdateBit1(prob);
++ }
++ }
++ else
++ {
++ UInt32 distance;
++ UpdateBit1(prob);
++ prob = p + IsRepG1 + state;
++ IfBit0(prob)
++ {
++ UpdateBit0(prob);
++ distance = rep1;
++ }
++ else
++ {
++ UpdateBit1(prob);
++ prob = p + IsRepG2 + state;
++ IfBit0(prob)
++ {
++ UpdateBit0(prob);
++ distance = rep2;
++ }
++ else
++ {
++ UpdateBit1(prob);
++ distance = rep3;
++ rep3 = rep2;
++ }
++ rep2 = rep1;
++ }
++ rep1 = rep0;
++ rep0 = distance;
++ }
++ state = state < kNumLitStates ? 8 : 11;
++ prob = p + RepLenCoder;
++ }
++ {
++ int numBits, offset;
++ CProb *probLen = prob + LenChoice;
++ IfBit0(probLen)
++ {
++ UpdateBit0(probLen);
++ probLen = prob + LenLow + (posState << kLenNumLowBits);
++ offset = 0;
++ numBits = kLenNumLowBits;
++ }
++ else
++ {
++ UpdateBit1(probLen);
++ probLen = prob + LenChoice2;
++ IfBit0(probLen)
++ {
++ UpdateBit0(probLen);
++ probLen = prob + LenMid + (posState << kLenNumMidBits);
++ offset = kLenNumLowSymbols;
++ numBits = kLenNumMidBits;
++ }
++ else
++ {
++ UpdateBit1(probLen);
++ probLen = prob + LenHigh;
++ offset = kLenNumLowSymbols + kLenNumMidSymbols;
++ numBits = kLenNumHighBits;
++ }
++ }
++ RangeDecoderBitTreeDecode(probLen, numBits, len);
++ len += offset;
++ }
++
++ if (state < 4)
++ {
++ int posSlot;
++ state += kNumLitStates;
++ prob = p + PosSlot +
++ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
++ kNumPosSlotBits);
++ RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot);
++ if (posSlot >= kStartPosModelIndex)
++ {
++ int numDirectBits = ((posSlot >> 1) - 1);
++ rep0 = (2 | ((UInt32)posSlot & 1));
++ if (posSlot < kEndPosModelIndex)
++ {
++ rep0 <<= numDirectBits;
++ prob = p + SpecPos + rep0 - posSlot - 1;
++ }
++ else
++ {
++ numDirectBits -= kNumAlignBits;
++ do
++ {
++ RC_NORMALIZE
++ Range >>= 1;
++ rep0 <<= 1;
++ if (Code >= Range)
++ {
++ Code -= Range;
++ rep0 |= 1;
++ }
++ }
++ while (--numDirectBits != 0);
++ prob = p + Align;
++ rep0 <<= kNumAlignBits;
++ numDirectBits = kNumAlignBits;
++ }
++ {
++ int i = 1;
++ int mi = 1;
++ do
++ {
++ CProb *prob3 = prob + mi;
++ RC_GET_BIT2(prob3, mi, ; , rep0 |= i);
++ i <<= 1;
++ }
++ while(--numDirectBits != 0);
++ }
++ }
++ else
++ rep0 = posSlot;
++ if (++rep0 == (UInt32)(0))
++ {
++ /* it's for stream version */
++ len = kLzmaStreamWasFinishedId;
++ break;
++ }
++ }
++
++ len += kMatchMinLen;
++ #ifdef _LZMA_OUT_READ
++ if (rep0 > distanceLimit)
++ #else
++ if (rep0 > nowPos)
++ #endif
++ return LZMA_RESULT_DATA_ERROR;
++
++ #ifdef _LZMA_OUT_READ
++ if (dictionarySize - distanceLimit > (UInt32)len)
++ distanceLimit += len;
++ else
++ distanceLimit = dictionarySize;
++ #endif
++
++ do
++ {
++ #ifdef _LZMA_OUT_READ
++ UInt32 pos = dictionaryPos - rep0;
++ if (pos >= dictionarySize)
++ pos += dictionarySize;
++ previousByte = dictionary[pos];
++ dictionary[dictionaryPos] = previousByte;
++ if (++dictionaryPos == dictionarySize)
++ dictionaryPos = 0;
++ #else
++ previousByte = outStream[nowPos - rep0];
++ #endif
++ len--;
++ outStream[nowPos++] = previousByte;
++ }
++ while(len != 0 && nowPos < outSize);
++ }
++ }
++ RC_NORMALIZE;
++
++ #ifdef _LZMA_OUT_READ
++ vs->Range = Range;
++ vs->Code = Code;
++ vs->DictionaryPos = dictionaryPos;
++ vs->GlobalPos = globalPos + (UInt32)nowPos;
++ vs->DistanceLimit = distanceLimit;
++ vs->Reps[0] = rep0;
++ vs->Reps[1] = rep1;
++ vs->Reps[2] = rep2;
++ vs->Reps[3] = rep3;
++ vs->State = state;
++ vs->RemainLen = len;
++ vs->TempDictionary[0] = tempDictionary[0];
++ #endif
++
++ #ifdef _LZMA_IN_CB
++ vs->Buffer = Buffer;
++ vs->BufferLim = BufferLim;
++ #else
++ *inSizeProcessed = (SizeT)(Buffer - inStream);
++ #endif
++ *outSizeProcessed = nowPos;
++ return LZMA_RESULT_OK;
++}
+diff -urN linux-2.6.23/fs/squashfs/LzmaDecode.h linux-2.6.23.sqlzma-ng/fs/squashfs/LzmaDecode.h +--- linux-2.6.23/fs/squashfs/LzmaDecode.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/LzmaDecode.h 2007-11-13 19:45:12.000000000 -0500 +@@ -0,0 +1,113 @@ ++/*
++ LzmaDecode.h
++ LZMA Decoder interface
++
++ LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
++ http://www.7-zip.org/
++
++ LZMA SDK is licensed under two licenses:
++ 1) GNU Lesser General Public License (GNU LGPL)
++ 2) Common Public License (CPL)
++ It means that you can select one of these two licenses and
++ follow rules of that license.
++
++ SPECIAL EXCEPTION:
++ Igor Pavlov, as the author of this code, expressly permits you to
++ statically or dynamically link your code (or bind by name) to the
++ interfaces of this file without subjecting your linked code to the
++ terms of the CPL or GNU LGPL. Any modifications or additions
++ to this file, however, are subject to the LGPL or CPL terms.
++*/
++
++#ifndef __LZMADECODE_H
++#define __LZMADECODE_H
++
++#include "LzmaTypes.h"
++
++/* #define _LZMA_IN_CB */
++/* Use callback for input data */
++
++/* #define _LZMA_OUT_READ */
++/* Use read function for output data */
++
++/* #define _LZMA_PROB32 */
++/* It can increase speed on some 32-bit CPUs,
++ but memory usage will be doubled in that case */
++
++/* #define _LZMA_LOC_OPT */
++/* Enable local speed optimizations inside code */
++
++#ifdef _LZMA_PROB32
++#define CProb UInt32
++#else
++#define CProb UInt16
++#endif
++
++#define LZMA_RESULT_OK 0
++#define LZMA_RESULT_DATA_ERROR 1
++
++#ifdef _LZMA_IN_CB
++typedef struct _ILzmaInCallback
++{
++ int (*Read)(void *object, const unsigned char **buffer, SizeT *bufferSize);
++} ILzmaInCallback;
++#endif
++
++#define LZMA_BASE_SIZE 1846
++#define LZMA_LIT_SIZE 768
++
++#define LZMA_PROPERTIES_SIZE 5
++
++typedef struct _CLzmaProperties
++{
++ int lc;
++ int lp;
++ int pb;
++ #ifdef _LZMA_OUT_READ
++ UInt32 DictionarySize;
++ #endif
++}CLzmaProperties;
++
++int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size);
++
++#define LzmaGetNumProbs(Properties) (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((Properties)->lc + (Properties)->lp)))
++
++#define kLzmaNeedInitId (-2)
++
++typedef struct _CLzmaDecoderState
++{
++ CLzmaProperties Properties;
++ CProb *Probs;
++
++ #ifdef _LZMA_IN_CB
++ const unsigned char *Buffer;
++ const unsigned char *BufferLim;
++ #endif
++
++ #ifdef _LZMA_OUT_READ
++ unsigned char *Dictionary;
++ UInt32 Range;
++ UInt32 Code;
++ UInt32 DictionaryPos;
++ UInt32 GlobalPos;
++ UInt32 DistanceLimit;
++ UInt32 Reps[4];
++ int State;
++ int RemainLen;
++ unsigned char TempDictionary[4];
++ #endif
++} CLzmaDecoderState;
++
++#ifdef _LZMA_OUT_READ
++#define LzmaDecoderInit(vs) { (vs)->RemainLen = kLzmaNeedInitId; }
++#endif
++
++int LzmaDecode(CLzmaDecoderState *vs,
++ #ifdef _LZMA_IN_CB
++ ILzmaInCallback *inCallback,
++ #else
++ const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
++ #endif
++ unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed);
++
++#endif
+diff -urN linux-2.6.23/fs/squashfs/LzmaTypes.h linux-2.6.23.sqlzma-ng/fs/squashfs/LzmaTypes.h +--- linux-2.6.23/fs/squashfs/LzmaTypes.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/LzmaTypes.h 2007-11-13 19:47:32.000000000 -0500 +@@ -0,0 +1,45 @@ ++/*
++LzmaTypes.h
++
++Types for LZMA Decoder
++
++This file written and distributed to public domain by Igor Pavlov.
++This file is part of LZMA SDK 4.40 (2006-05-01)
++*/
++
++#ifndef __LZMATYPES_H
++#define __LZMATYPES_H
++
++#ifndef _7ZIP_BYTE_DEFINED
++#define _7ZIP_BYTE_DEFINED
++typedef unsigned char Byte;
++#endif
++
++#ifndef _7ZIP_UINT16_DEFINED
++#define _7ZIP_UINT16_DEFINED
++typedef unsigned short UInt16;
++#endif
++
++#ifndef _7ZIP_UINT32_DEFINED
++#define _7ZIP_UINT32_DEFINED
++#ifdef _LZMA_UINT32_IS_ULONG
++typedef unsigned long UInt32;
++#else
++typedef unsigned int UInt32;
++#endif
++#endif
++
++/* #define _LZMA_NO_SYSTEM_SIZE_T */
++/* You can use it, if you don't want <stddef.h> */
++
++#ifndef _7ZIP_SIZET_DEFINED
++#define _7ZIP_SIZET_DEFINED
++#ifdef _LZMA_NO_SYSTEM_SIZE_T
++typedef UInt32 SizeT;
++#else
++#include <stddef.h>
++typedef size_t SizeT;
++#endif
++#endif
++
++#endif
+diff -urN linux-2.6.23/fs/squashfs/Makefile linux-2.6.23.sqlzma-ng/fs/squashfs/Makefile +--- linux-2.6.23/fs/squashfs/Makefile 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/Makefile 2007-11-13 19:52:56.000000000 -0500 +@@ -0,0 +1,10 @@ ++# ++# Makefile for the linux squashfs routines. ++# ++ ++ ++obj-$(CONFIG_SQUASHFS) += unlzma.o sqlzma.o squashfs.o ++unlzma-y += module.o ++sqlzma-y += uncomp.o ++squashfs-y += inode.o ++squashfs-y += squashfs2_0.o +diff -urN linux-2.6.23/fs/squashfs/inode.c linux-2.6.23.sqlzma-ng/fs/squashfs/inode.c +--- linux-2.6.23/fs/squashfs/inode.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/inode.c 2007-11-13 19:14:24.000000000 -0500 +@@ -0,0 +1,2312 @@ ++/* ++ * Squashfs - a compressed read only filesystem for Linux ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 ++ * Phillip Lougher <phillip@lougher.demon.co.uk> ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2, ++ * or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ * inode.c ++ */ ++ ++#include <linux/squashfs_fs.h> ++#include <linux/module.h> ++#include <linux/zlib.h> ++#include <linux/fs.h> ++#include <linux/squashfs_fs_sb.h> ++#include <linux/squashfs_fs_i.h> ++#include <linux/buffer_head.h> ++#include <linux/vfs.h> ++#include <linux/vmalloc.h> ++#include <linux/smp_lock.h> ++#include <linux/sched.h> ++#include <linux/exportfs.h> ++ ++#include "squashfs.h" ++#include "sqlzma.h" ++ ++#undef KeepPreemptive ++#if defined(CONFIG_PREEMPT) && !defined(UnsquashNoPreempt) ++#define KeepPreemptive ++#endif ++ ++struct sqlzma { ++#ifdef KeepPreemptive ++ struct mutex mtx; ++#endif ++ unsigned char read_data[SQUASHFS_FILE_MAX_SIZE]; ++ struct sqlzma_un un; ++}; ++static DEFINE_PER_CPU(struct sqlzma *, sqlzma); ++ ++#define dpri(fmt, args...) /* printk("%s:%d: " fmt, __func__, __LINE__, ##args) */ ++#define dpri_un(un) dpri("un{%d, {%d %p}, {%d %p}, {%d %p}}\n", \ ++ (un)->un_lzma, (un)->un_a[0].sz, (un)->un_a[0].buf, \ ++ (un)->un_a[1].sz, (un)->un_a[1].buf, \ ++ (un)->un_a[2].sz, (un)->un_a[2].buf) ++ ++static int squashfs_cached_blks; ++ ++static void vfs_read_inode(struct inode *i); ++static struct dentry *squashfs_get_parent(struct dentry *child); ++static int squashfs_read_inode(struct inode *i, squashfs_inode_t inode); ++static int squashfs_statfs(struct dentry *, struct kstatfs *); ++static int squashfs_symlink_readpage(struct file *file, struct page *page); ++static long long read_blocklist(struct inode *inode, int index, ++ int readahead_blks, char *block_list, ++ unsigned short **block_p, unsigned int *bsize); ++static int squashfs_readpage(struct file *file, struct page *page); ++static int squashfs_readdir(struct file *, void *, filldir_t); ++static struct dentry *squashfs_lookup(struct inode *, struct dentry *, ++ struct nameidata *); ++static int squashfs_remount(struct super_block *s, int *flags, char *data); ++static void squashfs_put_super(struct super_block *); ++static int squashfs_get_sb(struct file_system_type *,int, const char *, void *, ++ struct vfsmount *); ++static struct inode *squashfs_alloc_inode(struct super_block *sb); ++static void squashfs_destroy_inode(struct inode *inode); ++static int init_inodecache(void); ++static void destroy_inodecache(void); ++ ++static struct file_system_type squashfs_fs_type = { ++ .owner = THIS_MODULE, ++ .name = "squashfs", ++ .get_sb = squashfs_get_sb, ++ .kill_sb = kill_block_super, ++ .fs_flags = FS_REQUIRES_DEV ++}; ++ ++static const unsigned char squashfs_filetype_table[] = { ++ DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_FIFO, DT_SOCK ++}; ++ ++static struct super_operations squashfs_super_ops = { ++ .alloc_inode = squashfs_alloc_inode, ++ .destroy_inode = squashfs_destroy_inode, ++ .statfs = squashfs_statfs, ++ .put_super = squashfs_put_super, ++ .remount_fs = squashfs_remount ++}; ++ ++static struct super_operations squashfs_export_super_ops = { ++ .alloc_inode = squashfs_alloc_inode, ++ .destroy_inode = squashfs_destroy_inode, ++ .statfs = squashfs_statfs, ++ .put_super = squashfs_put_super, ++ .read_inode = vfs_read_inode ++}; ++ ++static struct export_operations squashfs_export_ops = { ++ .get_parent = squashfs_get_parent ++}; ++ ++SQSH_EXTERN const struct address_space_operations squashfs_symlink_aops = { ++ .readpage = squashfs_symlink_readpage ++}; ++ ++SQSH_EXTERN const struct address_space_operations squashfs_aops = { ++ .readpage = squashfs_readpage ++}; ++ ++static const struct file_operations squashfs_dir_ops = { ++ .read = generic_read_dir, ++ .readdir = squashfs_readdir ++}; ++ ++SQSH_EXTERN struct inode_operations squashfs_dir_inode_ops = { ++ .lookup = squashfs_lookup ++}; ++ ++ ++static struct buffer_head *get_block_length(struct super_block *s, ++ int *cur_index, int *offset, int *c_byte) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ unsigned short temp; ++ struct buffer_head *bh; ++ ++ if (!(bh = sb_bread(s, *cur_index))) ++ goto out; ++ ++ if (msblk->devblksize - *offset == 1) { ++ if (msblk->swap) ++ ((unsigned char *) &temp)[1] = *((unsigned char *) ++ (bh->b_data + *offset)); ++ else ++ ((unsigned char *) &temp)[0] = *((unsigned char *) ++ (bh->b_data + *offset)); ++ brelse(bh); ++ if (!(bh = sb_bread(s, ++(*cur_index)))) ++ goto out; ++ if (msblk->swap) ++ ((unsigned char *) &temp)[0] = *((unsigned char *) ++ bh->b_data); ++ else ++ ((unsigned char *) &temp)[1] = *((unsigned char *) ++ bh->b_data); ++ *c_byte = temp; ++ *offset = 1; ++ } else { ++ if (msblk->swap) { ++ ((unsigned char *) &temp)[1] = *((unsigned char *) ++ (bh->b_data + *offset)); ++ ((unsigned char *) &temp)[0] = *((unsigned char *) ++ (bh->b_data + *offset + 1)); ++ } else { ++ ((unsigned char *) &temp)[0] = *((unsigned char *) ++ (bh->b_data + *offset)); ++ ((unsigned char *) &temp)[1] = *((unsigned char *) ++ (bh->b_data + *offset + 1)); ++ } ++ *c_byte = temp; ++ *offset += 2; ++ } ++ ++ if (SQUASHFS_CHECK_DATA(msblk->sblk.flags)) { ++ if (*offset == msblk->devblksize) { ++ brelse(bh); ++ if (!(bh = sb_bread(s, ++(*cur_index)))) ++ goto out; ++ *offset = 0; ++ } ++ if (*((unsigned char *) (bh->b_data + *offset)) != ++ SQUASHFS_MARKER_BYTE) { ++ ERROR("Metadata block marker corrupt @ %x\n", ++ *cur_index); ++ brelse(bh); ++ goto out; ++ } ++ (*offset)++; ++ } ++ return bh; ++ ++out: ++ return NULL; ++} ++ ++ ++SQSH_EXTERN unsigned int squashfs_read_data(struct super_block *s, char *buffer, ++ long long index, unsigned int length, ++ long long *next_index, int srclength) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ struct buffer_head **bh; ++ unsigned int offset = index & ((1 << msblk->devblksize_log2) - 1); ++ unsigned int cur_index = index >> msblk->devblksize_log2; ++ int bytes, avail_bytes, b = 0, k = 0; ++ unsigned int compressed; ++ unsigned int c_byte = length; ++ ++ bh = kmalloc(((sblk->block_size >> msblk->devblksize_log2) + 1) * ++ sizeof(struct buffer_head *), GFP_KERNEL); ++ if (bh == NULL) ++ goto read_failure; ++ ++ if (c_byte) { ++ bytes = msblk->devblksize - offset; ++ compressed = SQUASHFS_COMPRESSED_BLOCK(c_byte); ++ c_byte = SQUASHFS_COMPRESSED_SIZE_BLOCK(c_byte); ++ ++ TRACE("Block @ 0x%llx, %scompressed size %d, src size %d\n", index, ++ compressed ? "" : "un", (unsigned int) c_byte, srclength); ++ ++ if (c_byte > srclength || index < 0 || (index + c_byte) > sblk->bytes_used) ++ goto read_failure; ++ ++ bh[0] = sb_getblk(s, cur_index); ++ if (bh[0] == NULL) ++ goto block_release; ++ ++ for (b = 1; bytes < c_byte; b++) { ++ bh[b] = sb_getblk(s, ++cur_index); ++ if (bh[b] == NULL) ++ goto block_release; ++ bytes += msblk->devblksize; ++ } ++ ll_rw_block(READ, b, bh); ++ } else { ++ if (index < 0 || (index + 2) > sblk->bytes_used) ++ goto read_failure; ++ ++ bh[0] = get_block_length(s, (int *)&cur_index, (int *)&offset, ++ (int *)&c_byte); ++ if (bh[0] == NULL) ++ goto read_failure; ++ ++ bytes = msblk->devblksize - offset; ++ compressed = SQUASHFS_COMPRESSED(c_byte); ++ c_byte = SQUASHFS_COMPRESSED_SIZE(c_byte); ++ ++ TRACE("Block @ 0x%llx, %scompressed size %d\n", index, compressed ++ ? "" : "un", (unsigned int) c_byte); ++ ++ if (c_byte > srclength || (index + c_byte) > sblk->bytes_used) ++ goto read_failure; ++ ++ for (b = 1; bytes < c_byte; b++) { ++ bh[b] = sb_getblk(s, ++cur_index); ++ if (bh[b] == NULL) ++ goto block_release; ++ bytes += msblk->devblksize; ++ } ++ ll_rw_block(READ, b - 1, bh + 1); ++ } ++ ++ if (compressed) { ++ int zlib_err = Z_STREAM_END; ++ int rest, start; ++ enum {Src, Dst}; ++ struct sized_buf sbuf[2]; ++ struct sqlzma *percpu; ++ ++ /* ++ * uncompress block ++ */ ++ ++ for (k = 0; k < b; k++) { ++ wait_on_buffer(bh[k]); ++ if (!buffer_uptodate(bh[k])) ++ goto block_release; ++ } ++ ++ avail_bytes = 0; ++ for (k = 0; !avail_bytes && k < b; k++) { ++ avail_bytes = msblk->devblksize - offset; ++ if (c_byte < avail_bytes) ++ avail_bytes = c_byte; ++ if (avail_bytes) ++ break; ++ offset = 0; ++ brelse(bh[k]); ++ } ++ bytes = 0; ++ if (!avail_bytes) ++ goto block_release; // nothing to be process ++ ++ start = k; ++ /* it disables preemption */ ++ percpu = get_cpu_var(sqlzma); ++#ifdef KeepPreemptive ++ put_cpu_var(sqlzma); ++ mutex_lock(&percpu->mtx); ++#endif ++ ++ for (; k < b; k++) { ++ memcpy(percpu->read_data + bytes, bh[k]->b_data + offset, ++ avail_bytes); ++ bytes += avail_bytes; ++ offset = 0; ++ brelse(bh[k]); ++ avail_bytes = msblk->devblksize - offset; ++ rest = c_byte - bytes; ++ if (rest < avail_bytes) ++ avail_bytes = rest; ++ } ++ ++ sbuf[Src].buf = percpu->read_data; ++ sbuf[Src].sz = bytes; ++ sbuf[Dst].buf = buffer; ++ sbuf[Dst].sz = srclength; ++ dpri_un(&percpu->un); ++ dpri("src %d %p, dst %d %p\n", sbuf[Src].sz, sbuf[Src].buf, ++ sbuf[Dst].sz, sbuf[Dst].buf); ++ zlib_err = sqlzma_un(&percpu->un, sbuf + Src, sbuf + Dst); ++ bytes = percpu->un.un_reslen; ++ ++#ifdef KeepPreemptive ++ mutex_unlock(&percpu->mtx); ++#else ++ put_cpu_var(sqlzma); ++#endif ++ if (unlikely(zlib_err)) { ++ dpri("zlib_err %d\n", zlib_err); ++ goto release_mutex; ++ } ++ } else { ++ int i; ++ ++ for(i = 0; i < b; i++) { ++ wait_on_buffer(bh[i]); ++ if (!buffer_uptodate(bh[i])) ++ goto block_release; ++ } ++ ++ for (bytes = 0; k < b; k++) { ++ avail_bytes = min(c_byte - bytes, msblk->devblksize - offset); ++ ++ memcpy(buffer + bytes, bh[k]->b_data + offset, avail_bytes); ++ bytes += avail_bytes; ++ offset = 0; ++ brelse(bh[k]); ++ } ++ } ++ ++ if (next_index) ++ *next_index = index + c_byte + (length ? 0 : ++ (SQUASHFS_CHECK_DATA(msblk->sblk.flags) ? 3 : 2)); ++ ++ kfree(bh); ++ return bytes; ++ ++release_mutex: ++ //mutex_unlock(&msblk->read_data_mutex); ++ ++block_release: ++ for (; k < b; k++) ++ brelse(bh[k]); ++ ++read_failure: ++ ERROR("sb_bread failed reading block 0x%x\n", cur_index); ++ kfree(bh); ++ return 0; ++} ++ ++ ++SQSH_EXTERN int squashfs_get_cached_block(struct super_block *s, void *buffer, ++ long long block, unsigned int offset, ++ int length, long long *next_block, ++ unsigned int *next_offset) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ int n, i, bytes, return_length = length; ++ long long next_index; ++ ++ TRACE("Entered squashfs_get_cached_block [%llx:%x]\n", block, offset); ++ ++ while (1) { ++ for (i = 0; i < squashfs_cached_blks; i++) ++ if (msblk->block_cache[i].block == block) ++ break; ++ ++ mutex_lock(&msblk->block_cache_mutex); ++ ++ if (i == squashfs_cached_blks) { ++ /* read inode header block */ ++ if (msblk->unused_cache_blks == 0) { ++ mutex_unlock(&msblk->block_cache_mutex); ++ wait_event(msblk->waitq, msblk->unused_cache_blks); ++ continue; ++ } ++ ++ i = msblk->next_cache; ++ for (n = 0; n < squashfs_cached_blks; n++) { ++ if (msblk->block_cache[i].block != SQUASHFS_USED_BLK) ++ break; ++ i = (i + 1) % squashfs_cached_blks; ++ } ++ ++ msblk->next_cache = (i + 1) % squashfs_cached_blks; ++ ++ if (msblk->block_cache[i].block == SQUASHFS_INVALID_BLK) { ++ msblk->block_cache[i].data = vmalloc(SQUASHFS_METADATA_SIZE); ++ if (msblk->block_cache[i].data == NULL) { ++ ERROR("Failed to allocate cache block\n"); ++ mutex_unlock(&msblk->block_cache_mutex); ++ goto out; ++ } ++ } ++ ++ msblk->block_cache[i].block = SQUASHFS_USED_BLK; ++ msblk->unused_cache_blks --; ++ mutex_unlock(&msblk->block_cache_mutex); ++ ++ msblk->block_cache[i].length = squashfs_read_data(s, ++ msblk->block_cache[i].data, block, 0, &next_index, ++ SQUASHFS_METADATA_SIZE); ++ ++ if (msblk->block_cache[i].length == 0) { ++ ERROR("Unable to read cache block [%llx:%x]\n", block, offset); ++ mutex_lock(&msblk->block_cache_mutex); ++ msblk->block_cache[i].block = SQUASHFS_INVALID_BLK; ++ msblk->unused_cache_blks ++; ++ smp_mb(); ++ vfree(msblk->block_cache[i].data); ++ wake_up(&msblk->waitq); ++ mutex_unlock(&msblk->block_cache_mutex); ++ goto out; ++ } ++ ++ mutex_lock(&msblk->block_cache_mutex); ++ msblk->block_cache[i].block = block; ++ msblk->block_cache[i].next_index = next_index; ++ msblk->unused_cache_blks ++; ++ smp_mb(); ++ wake_up(&msblk->waitq); ++ TRACE("Read cache block [%llx:%x]\n", block, offset); ++ } ++ ++ if (msblk->block_cache[i].block != block) { ++ mutex_unlock(&msblk->block_cache_mutex); ++ continue; ++ } ++ ++ bytes = msblk->block_cache[i].length - offset; ++ ++ if (bytes < 1) { ++ mutex_unlock(&msblk->block_cache_mutex); ++ goto out; ++ } else if (bytes >= length) { ++ if (buffer) ++ memcpy(buffer, msblk->block_cache[i].data + offset, length); ++ if (msblk->block_cache[i].length - offset == length) { ++ *next_block = msblk->block_cache[i].next_index; ++ *next_offset = 0; ++ } else { ++ *next_block = block; ++ *next_offset = offset + length; ++ } ++ mutex_unlock(&msblk->block_cache_mutex); ++ goto finish; ++ } else { ++ if (buffer) { ++ memcpy(buffer, msblk->block_cache[i].data + offset, bytes); ++ buffer = (char *) buffer + bytes; ++ } ++ block = msblk->block_cache[i].next_index; ++ mutex_unlock(&msblk->block_cache_mutex); ++ length -= bytes; ++ offset = 0; ++ } ++ } ++ ++finish: ++ return return_length; ++out: ++ return 0; ++} ++ ++ ++static int get_fragment_location(struct super_block *s, unsigned int fragment, ++ long long *fragment_start_block, ++ unsigned int *fragment_size) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ long long start_block = ++ msblk->fragment_index[SQUASHFS_FRAGMENT_INDEX(fragment)]; ++ int offset = SQUASHFS_FRAGMENT_INDEX_OFFSET(fragment); ++ struct squashfs_fragment_entry fragment_entry; ++ ++ if (msblk->swap) { ++ struct squashfs_fragment_entry sfragment_entry; ++ ++ if (!squashfs_get_cached_block(s, &sfragment_entry, start_block, offset, ++ sizeof(sfragment_entry), &start_block, ++ (unsigned int *)&offset)) ++ goto out; ++ SQUASHFS_SWAP_FRAGMENT_ENTRY(&fragment_entry, &sfragment_entry); ++ } else ++ if (!squashfs_get_cached_block(s, &fragment_entry, start_block, offset, ++ sizeof(fragment_entry), &start_block, ++ (unsigned int *)&offset)) ++ goto out; ++ ++ *fragment_start_block = fragment_entry.start_block; ++ *fragment_size = fragment_entry.size; ++ ++ return 1; ++ ++out: ++ return 0; ++} ++ ++ ++SQSH_EXTERN void release_cached_fragment(struct squashfs_sb_info *msblk, ++ struct squashfs_fragment_cache *fragment) ++{ ++ mutex_lock(&msblk->fragment_mutex); ++ fragment->locked --; ++ if (fragment->locked == 0) { ++ msblk->unused_frag_blks ++; ++ smp_mb(); ++ wake_up(&msblk->fragment_wait_queue); ++ } ++ mutex_unlock(&msblk->fragment_mutex); ++} ++ ++ ++SQSH_EXTERN ++struct squashfs_fragment_cache *get_cached_fragment(struct super_block *s, ++ long long start_block, int length) ++{ ++ int i, n; ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ ++ while (1) { ++ mutex_lock(&msblk->fragment_mutex); ++ ++ for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS && ++ msblk->fragment[i].block != start_block; i++); ++ ++ if (i == SQUASHFS_CACHED_FRAGMENTS) { ++ if (msblk->unused_frag_blks == 0) { ++ mutex_unlock(&msblk->fragment_mutex); ++ wait_event(msblk->fragment_wait_queue, msblk->unused_frag_blks); ++ continue; ++ } ++ ++ i = msblk->next_fragment; ++ for (n = 0; n < SQUASHFS_CACHED_FRAGMENTS; n++) { ++ if (msblk->fragment[i].locked == 0) ++ break; ++ i = (i + 1) % SQUASHFS_CACHED_FRAGMENTS; ++ } ++ ++ msblk->next_fragment = (msblk->next_fragment + 1) % ++ SQUASHFS_CACHED_FRAGMENTS; ++ ++ if (msblk->fragment[i].data == NULL) { ++ msblk->fragment[i].data = vmalloc(sblk->block_size); ++ if (msblk->fragment[i].data == NULL) { ++ ERROR("Failed to allocate fragment cache block\n"); ++ mutex_unlock(&msblk->fragment_mutex); ++ goto out; ++ } ++ } ++ ++ msblk->unused_frag_blks --; ++ msblk->fragment[i].block = SQUASHFS_INVALID_BLK; ++ msblk->fragment[i].locked = 1; ++ mutex_unlock(&msblk->fragment_mutex); ++ ++ msblk->fragment[i].length = squashfs_read_data(s, ++ msblk->fragment[i].data, start_block, length, NULL, ++ sblk->block_size); ++ ++ if (msblk->fragment[i].length == 0) { ++ ERROR("Unable to read fragment cache block [%llx]\n", start_block); ++ msblk->fragment[i].locked = 0; ++ msblk->unused_frag_blks ++; ++ smp_mb(); ++ wake_up(&msblk->fragment_wait_queue); ++ goto out; ++ } ++ ++ mutex_lock(&msblk->fragment_mutex); ++ msblk->fragment[i].block = start_block; ++ TRACE("New fragment %d, start block %lld, locked %d\n", ++ i, msblk->fragment[i].block, msblk->fragment[i].locked); ++ mutex_unlock(&msblk->fragment_mutex); ++ break; ++ } ++ ++ if (msblk->fragment[i].locked == 0) ++ msblk->unused_frag_blks --; ++ msblk->fragment[i].locked++; ++ mutex_unlock(&msblk->fragment_mutex); ++ TRACE("Got fragment %d, start block %lld, locked %d\n", i, ++ msblk->fragment[i].block, msblk->fragment[i].locked); ++ break; ++ } ++ ++ return &msblk->fragment[i]; ++ ++out: ++ return NULL; ++} ++ ++ ++static void squashfs_new_inode(struct squashfs_sb_info *msblk, struct inode *i, ++ struct squashfs_base_inode_header *inodeb) ++{ ++ i->i_ino = inodeb->inode_number; ++ i->i_mtime.tv_sec = inodeb->mtime; ++ i->i_atime.tv_sec = inodeb->mtime; ++ i->i_ctime.tv_sec = inodeb->mtime; ++ i->i_uid = msblk->uid[inodeb->uid]; ++ i->i_mode = inodeb->mode; ++ i->i_size = 0; ++ ++ if (inodeb->guid == SQUASHFS_GUIDS) ++ i->i_gid = i->i_uid; ++ else ++ i->i_gid = msblk->guid[inodeb->guid]; ++} ++ ++ ++static squashfs_inode_t squashfs_inode_lookup(struct super_block *s, int ino) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ long long start = msblk->inode_lookup_table[SQUASHFS_LOOKUP_BLOCK(ino - 1)]; ++ int offset = SQUASHFS_LOOKUP_BLOCK_OFFSET(ino - 1); ++ squashfs_inode_t inode; ++ ++ TRACE("Entered squashfs_inode_lookup, inode_number = %d\n", ino); ++ ++ if (msblk->swap) { ++ squashfs_inode_t sinode; ++ ++ if (!squashfs_get_cached_block(s, &sinode, start, offset, ++ sizeof(sinode), &start, (unsigned int *)&offset)) ++ goto out; ++ SQUASHFS_SWAP_INODE_T((&inode), &sinode); ++ } else if (!squashfs_get_cached_block(s, &inode, start, offset, ++ sizeof(inode), &start, (unsigned int *)&offset)) ++ goto out; ++ ++ TRACE("squashfs_inode_lookup, inode = 0x%llx\n", inode); ++ ++ return inode; ++ ++out: ++ return SQUASHFS_INVALID_BLK; ++} ++ ++ ++static void vfs_read_inode(struct inode *i) ++{ ++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; ++ squashfs_inode_t inode = squashfs_inode_lookup(i->i_sb, i->i_ino); ++ ++ TRACE("Entered vfs_read_inode\n"); ++ ++ if(inode != SQUASHFS_INVALID_BLK) ++ (msblk->read_inode)(i, inode); ++} ++ ++ ++static struct dentry *squashfs_get_parent(struct dentry *child) ++{ ++ struct inode *i = child->d_inode; ++ struct inode *parent = iget(i->i_sb, SQUASHFS_I(i)->u.s2.parent_inode); ++ struct dentry *rv; ++ ++ TRACE("Entered squashfs_get_parent\n"); ++ ++ if(parent == NULL) { ++ rv = ERR_PTR(-EACCES); ++ goto out; ++ } ++ ++ rv = d_alloc_anon(parent); ++ if(rv == NULL) ++ rv = ERR_PTR(-ENOMEM); ++ ++out: ++ return rv; ++} ++ ++ ++SQSH_EXTERN struct inode *squashfs_iget(struct super_block *s, ++ squashfs_inode_t inode, unsigned int inode_number) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct inode *i = iget_locked(s, inode_number); ++ ++ TRACE("Entered squashfs_iget\n"); ++ ++ if(i && (i->i_state & I_NEW)) { ++ (msblk->read_inode)(i, inode); ++ unlock_new_inode(i); ++ } ++ ++ return i; ++} ++ ++ ++static int squashfs_read_inode(struct inode *i, squashfs_inode_t inode) ++{ ++ struct super_block *s = i->i_sb; ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ long long block = SQUASHFS_INODE_BLK(inode) + sblk->inode_table_start; ++ unsigned int offset = SQUASHFS_INODE_OFFSET(inode); ++ long long next_block; ++ unsigned int next_offset; ++ union squashfs_inode_header id, sid; ++ struct squashfs_base_inode_header *inodeb = &id.base, *sinodeb = &sid.base; ++ ++ TRACE("Entered squashfs_read_inode\n"); ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodeb, block, offset, ++ sizeof(*sinodeb), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_BASE_INODE_HEADER(inodeb, sinodeb, sizeof(*sinodeb)); ++ } else ++ if (!squashfs_get_cached_block(s, inodeb, block, offset, ++ sizeof(*inodeb), &next_block, &next_offset)) ++ goto failed_read; ++ ++ squashfs_new_inode(msblk, i, inodeb); ++ ++ switch(inodeb->inode_type) { ++ case SQUASHFS_FILE_TYPE: { ++ unsigned int frag_size; ++ long long frag_blk; ++ struct squashfs_reg_inode_header *inodep = &id.reg; ++ struct squashfs_reg_inode_header *sinodep = &sid.reg; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_REG_INODE_HEADER(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, inodep, block, offset, ++ sizeof(*inodep), &next_block, &next_offset)) ++ goto failed_read; ++ ++ frag_blk = SQUASHFS_INVALID_BLK; ++ ++ if (inodep->fragment != SQUASHFS_INVALID_FRAG) ++ if(!get_fragment_location(s, inodep->fragment, &frag_blk, ++ &frag_size)) ++ goto failed_read; ++ ++ i->i_nlink = 1; ++ i->i_size = inodep->file_size; ++ i->i_fop = &generic_ro_fops; ++ i->i_mode |= S_IFREG; ++ i->i_blocks = ((i->i_size - 1) >> 9) + 1; ++ SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk; ++ SQUASHFS_I(i)->u.s1.fragment_size = frag_size; ++ SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->u.s1.block_list_start = next_block; ++ SQUASHFS_I(i)->offset = next_offset; ++ i->i_data.a_ops = &squashfs_aops; ++ ++ TRACE("File inode %x:%x, start_block %llx, " ++ "block_list_start %llx, offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ inodep->start_block, next_block, ++ next_offset); ++ break; ++ } ++ case SQUASHFS_LREG_TYPE: { ++ unsigned int frag_size; ++ long long frag_blk; ++ struct squashfs_lreg_inode_header *inodep = &id.lreg; ++ struct squashfs_lreg_inode_header *sinodep = &sid.lreg; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_LREG_INODE_HEADER(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, inodep, block, offset, ++ sizeof(*inodep), &next_block, &next_offset)) ++ goto failed_read; ++ ++ frag_blk = SQUASHFS_INVALID_BLK; ++ ++ if (inodep->fragment != SQUASHFS_INVALID_FRAG) ++ if (!get_fragment_location(s, inodep->fragment, &frag_blk, ++ &frag_size)) ++ goto failed_read; ++ ++ i->i_nlink = inodep->nlink; ++ i->i_size = inodep->file_size; ++ i->i_fop = &generic_ro_fops; ++ i->i_mode |= S_IFREG; ++ i->i_blocks = ((i->i_size - 1) >> 9) + 1; ++ SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk; ++ SQUASHFS_I(i)->u.s1.fragment_size = frag_size; ++ SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->u.s1.block_list_start = next_block; ++ SQUASHFS_I(i)->offset = next_offset; ++ i->i_data.a_ops = &squashfs_aops; ++ ++ TRACE("File inode %x:%x, start_block %llx, " ++ "block_list_start %llx, offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ inodep->start_block, next_block, ++ next_offset); ++ break; ++ } ++ case SQUASHFS_DIR_TYPE: { ++ struct squashfs_dir_inode_header *inodep = &id.dir; ++ struct squashfs_dir_inode_header *sinodep = &sid.dir; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_DIR_INODE_HEADER(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, inodep, block, offset, ++ sizeof(*inodep), &next_block, &next_offset)) ++ goto failed_read; ++ ++ i->i_nlink = inodep->nlink; ++ i->i_size = inodep->file_size; ++ i->i_op = &squashfs_dir_inode_ops; ++ i->i_fop = &squashfs_dir_ops; ++ i->i_mode |= S_IFDIR; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->offset = inodep->offset; ++ SQUASHFS_I(i)->u.s2.directory_index_count = 0; ++ SQUASHFS_I(i)->u.s2.parent_inode = inodep->parent_inode; ++ ++ TRACE("Directory inode %x:%x, start_block %x, offset " ++ "%x\n", SQUASHFS_INODE_BLK(inode), ++ offset, inodep->start_block, ++ inodep->offset); ++ break; ++ } ++ case SQUASHFS_LDIR_TYPE: { ++ struct squashfs_ldir_inode_header *inodep = &id.ldir; ++ struct squashfs_ldir_inode_header *sinodep = &sid.ldir; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_LDIR_INODE_HEADER(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, inodep, block, offset, ++ sizeof(*inodep), &next_block, &next_offset)) ++ goto failed_read; ++ ++ i->i_nlink = inodep->nlink; ++ i->i_size = inodep->file_size; ++ i->i_op = &squashfs_dir_inode_ops; ++ i->i_fop = &squashfs_dir_ops; ++ i->i_mode |= S_IFDIR; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->offset = inodep->offset; ++ SQUASHFS_I(i)->u.s2.directory_index_start = next_block; ++ SQUASHFS_I(i)->u.s2.directory_index_offset = next_offset; ++ SQUASHFS_I(i)->u.s2.directory_index_count = inodep->i_count; ++ SQUASHFS_I(i)->u.s2.parent_inode = inodep->parent_inode; ++ ++ TRACE("Long directory inode %x:%x, start_block %x, offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ inodep->start_block, inodep->offset); ++ break; ++ } ++ case SQUASHFS_SYMLINK_TYPE: { ++ struct squashfs_symlink_inode_header *inodep = &id.symlink; ++ struct squashfs_symlink_inode_header *sinodep = &sid.symlink; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_SYMLINK_INODE_HEADER(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, inodep, block, offset, ++ sizeof(*inodep), &next_block, &next_offset)) ++ goto failed_read; ++ ++ i->i_nlink = inodep->nlink; ++ i->i_size = inodep->symlink_size; ++ i->i_op = &page_symlink_inode_operations; ++ i->i_data.a_ops = &squashfs_symlink_aops; ++ i->i_mode |= S_IFLNK; ++ SQUASHFS_I(i)->start_block = next_block; ++ SQUASHFS_I(i)->offset = next_offset; ++ ++ TRACE("Symbolic link inode %x:%x, start_block %llx, offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ next_block, next_offset); ++ break; ++ } ++ case SQUASHFS_BLKDEV_TYPE: ++ case SQUASHFS_CHRDEV_TYPE: { ++ struct squashfs_dev_inode_header *inodep = &id.dev; ++ struct squashfs_dev_inode_header *sinodep = &sid.dev; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_DEV_INODE_HEADER(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, inodep, block, offset, ++ sizeof(*inodep), &next_block, &next_offset)) ++ goto failed_read; ++ ++ i->i_nlink = inodep->nlink; ++ i->i_mode |= (inodeb->inode_type == SQUASHFS_CHRDEV_TYPE) ? ++ S_IFCHR : S_IFBLK; ++ init_special_inode(i, i->i_mode, old_decode_dev(inodep->rdev)); ++ ++ TRACE("Device inode %x:%x, rdev %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, inodep->rdev); ++ break; ++ } ++ case SQUASHFS_FIFO_TYPE: ++ case SQUASHFS_SOCKET_TYPE: { ++ struct squashfs_ipc_inode_header *inodep = &id.ipc; ++ struct squashfs_ipc_inode_header *sinodep = &sid.ipc; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, sinodep, block, offset, ++ sizeof(*sinodep), &next_block, &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_IPC_INODE_HEADER(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, inodep, block, offset, ++ sizeof(*inodep), &next_block, &next_offset)) ++ goto failed_read; ++ ++ i->i_nlink = inodep->nlink; ++ i->i_mode |= (inodeb->inode_type == SQUASHFS_FIFO_TYPE) ++ ? S_IFIFO : S_IFSOCK; ++ init_special_inode(i, i->i_mode, 0); ++ break; ++ } ++ default: ++ ERROR("Unknown inode type %d in squashfs_iget!\n", ++ inodeb->inode_type); ++ goto failed_read1; ++ } ++ ++ return 1; ++ ++failed_read: ++ ERROR("Unable to read inode [%llx:%x]\n", block, offset); ++ ++failed_read1: ++ make_bad_inode(i); ++ return 0; ++} ++ ++ ++static int read_inode_lookup_table(struct super_block *s) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ unsigned int length = SQUASHFS_LOOKUP_BLOCK_BYTES(sblk->inodes); ++ ++ TRACE("In read_inode_lookup_table, length %d\n", length); ++ ++ /* Allocate inode lookup table */ ++ msblk->inode_lookup_table = kmalloc(length, GFP_KERNEL); ++ if (msblk->inode_lookup_table == NULL) { ++ ERROR("Failed to allocate inode lookup table\n"); ++ return 0; ++ } ++ ++ if (!squashfs_read_data(s, (char *) msblk->inode_lookup_table, ++ sblk->lookup_table_start, length | ++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, length)) { ++ ERROR("unable to read inode lookup table\n"); ++ return 0; ++ } ++ ++ if (msblk->swap) { ++ int i; ++ long long block; ++ ++ for (i = 0; i < SQUASHFS_LOOKUP_BLOCKS(sblk->inodes); i++) { ++ /* XXX */ ++ SQUASHFS_SWAP_LOOKUP_BLOCKS((&block), ++ &msblk->inode_lookup_table[i], 1); ++ msblk->inode_lookup_table[i] = block; ++ } ++ } ++ ++ return 1; ++} ++ ++ ++static int read_fragment_index_table(struct super_block *s) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ unsigned int length = SQUASHFS_FRAGMENT_INDEX_BYTES(sblk->fragments); ++ ++ if(length == 0) ++ return 1; ++ ++ /* Allocate fragment index table */ ++ msblk->fragment_index = kmalloc(length, GFP_KERNEL); ++ if (msblk->fragment_index == NULL) { ++ ERROR("Failed to allocate fragment index table\n"); ++ return 0; ++ } ++ ++ if (!squashfs_read_data(s, (char *) msblk->fragment_index, ++ sblk->fragment_table_start, length | ++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, length)) { ++ ERROR("unable to read fragment index table\n"); ++ return 0; ++ } ++ ++ if (msblk->swap) { ++ int i; ++ long long fragment; ++ ++ for (i = 0; i < SQUASHFS_FRAGMENT_INDEXES(sblk->fragments); i++) { ++ /* XXX */ ++ SQUASHFS_SWAP_FRAGMENT_INDEXES((&fragment), ++ &msblk->fragment_index[i], 1); ++ msblk->fragment_index[i] = fragment; ++ } ++ } ++ ++ return 1; ++} ++ ++ ++static int readahead_metadata(struct super_block *s) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ int i; ++ ++ squashfs_cached_blks = SQUASHFS_CACHED_BLKS; ++ ++ /* Init inode_table block pointer array */ ++ msblk->block_cache = kmalloc(sizeof(struct squashfs_cache) * ++ squashfs_cached_blks, GFP_KERNEL); ++ if (msblk->block_cache == NULL) { ++ ERROR("Failed to allocate block cache\n"); ++ goto failed; ++ } ++ ++ for (i = 0; i < squashfs_cached_blks; i++) ++ msblk->block_cache[i].block = SQUASHFS_INVALID_BLK; ++ ++ msblk->next_cache = 0; ++ msblk->unused_cache_blks = squashfs_cached_blks; ++ ++ return 1; ++ ++failed: ++ return 0; ++} ++ ++ ++static int supported_squashfs_filesystem(struct squashfs_sb_info *msblk, int silent) ++{ ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ ++ msblk->read_inode = squashfs_read_inode; ++ msblk->read_blocklist = read_blocklist; ++ msblk->read_fragment_index_table = read_fragment_index_table; ++ ++ if (sblk->s_major == 1) { ++ if (!squashfs_1_0_supported(msblk)) { ++ SERROR("Major/Minor mismatch, Squashfs 1.0 filesystems " ++ "are unsupported\n"); ++ SERROR("Please recompile with Squashfs 1.0 support enabled\n"); ++ return 0; ++ } ++ } else if (sblk->s_major == 2) { ++ if (!squashfs_2_0_supported(msblk)) { ++ SERROR("Major/Minor mismatch, Squashfs 2.0 filesystems " ++ "are unsupported\n"); ++ SERROR("Please recompile with Squashfs 2.0 support enabled\n"); ++ return 0; ++ } ++ } else if(sblk->s_major != SQUASHFS_MAJOR || sblk->s_minor > ++ SQUASHFS_MINOR) { ++ SERROR("Major/Minor mismatch, trying to mount newer %d.%d " ++ "filesystem\n", sblk->s_major, sblk->s_minor); ++ SERROR("Please update your kernel\n"); ++ return 0; ++ } ++ ++ return 1; ++} ++ ++ ++static int squashfs_fill_super(struct super_block *s, void *data, int silent) ++{ ++ struct squashfs_sb_info *msblk; ++ struct squashfs_super_block *sblk; ++ int i, err; ++ char b[BDEVNAME_SIZE]; ++ struct inode *root; ++ ++ TRACE("Entered squashfs_fill_superblock\n"); ++ ++ err = -ENOMEM; ++ s->s_fs_info = kzalloc(sizeof(struct squashfs_sb_info), GFP_KERNEL); ++ if (s->s_fs_info == NULL) { ++ ERROR("Failed to allocate superblock\n"); ++ goto failure; ++ } ++ msblk = s->s_fs_info; ++ ++ sblk = &msblk->sblk; ++ ++ msblk->devblksize = sb_min_blocksize(s, BLOCK_SIZE); ++ msblk->devblksize_log2 = ffz(~msblk->devblksize); ++ ++ //mutex_init(&msblk->read_data_mutex); ++ mutex_init(&msblk->read_page_mutex); ++ mutex_init(&msblk->block_cache_mutex); ++ mutex_init(&msblk->fragment_mutex); ++ mutex_init(&msblk->meta_index_mutex); ++ ++ init_waitqueue_head(&msblk->waitq); ++ init_waitqueue_head(&msblk->fragment_wait_queue); ++ ++ /* sblk->bytes_used is checked in squashfs_read_data to ensure reads are not ++ * beyond filesystem end. As we're using squashfs_read_data to read sblk here, ++ * first set sblk->bytes_used to a useful value */ ++ err = -EINVAL; ++ sblk->bytes_used = sizeof(struct squashfs_super_block); ++ if (!squashfs_read_data(s, (char *) sblk, SQUASHFS_START, ++ sizeof(struct squashfs_super_block) | ++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, sizeof(struct squashfs_super_block))) { ++ SERROR("unable to read superblock\n"); ++ goto failed_mount; ++ } ++ ++ /* Check it is a SQUASHFS superblock */ ++ s->s_magic = sblk->s_magic; ++ msblk->swap = 0; ++ dpri("magic 0x%x\n", sblk->s_magic); ++ switch (sblk->s_magic) { ++ struct squashfs_super_block ssblk; ++ ++ case SQUASHFS_MAGIC_SWAP: ++ /*FALLTHROUGH*/ ++ case SQUASHFS_MAGIC_LZMA_SWAP: ++ WARNING("Mounting a different endian SQUASHFS " ++ "filesystem on %s\n", bdevname(s->s_bdev, b)); ++ ++ SQUASHFS_SWAP_SUPER_BLOCK(&ssblk, sblk); ++ memcpy(sblk, &ssblk, sizeof(struct squashfs_super_block)); ++ msblk->swap = 1; ++ /*FALLTHROUGH*/ ++ case SQUASHFS_MAGIC: ++ case SQUASHFS_MAGIC_LZMA: ++ break; ++ default: ++ SERROR("Can't find a SQUASHFS superblock on %s\n", ++ bdevname(s->s_bdev, b)); ++ goto failed_mount; ++ } ++ ++ { ++ struct sqlzma *p; ++ dpri("block_size %d\n", sblk->block_size); ++ BUG_ON(sblk->block_size > sizeof(p->read_data)); ++ } ++ ++ /* Check the MAJOR & MINOR versions */ ++ if(!supported_squashfs_filesystem(msblk, silent)) ++ goto failed_mount; ++ ++ /* Check the filesystem does not extend beyond the end of the ++ block device */ ++ if(sblk->bytes_used < 0 || sblk->bytes_used > i_size_read(s->s_bdev->bd_inode)) ++ goto failed_mount; ++ ++ /* Check the root inode for sanity */ ++ if (SQUASHFS_INODE_OFFSET(sblk->root_inode) > SQUASHFS_METADATA_SIZE) ++ goto failed_mount; ++ ++ TRACE("Found valid superblock on %s\n", bdevname(s->s_bdev, b)); ++ TRACE("Inodes are %scompressed\n", SQUASHFS_UNCOMPRESSED_INODES(sblk->flags) ++ ? "un" : ""); ++ TRACE("Data is %scompressed\n", SQUASHFS_UNCOMPRESSED_DATA(sblk->flags) ++ ? "un" : ""); ++ TRACE("Check data is %spresent in the filesystem\n", ++ SQUASHFS_CHECK_DATA(sblk->flags) ? "" : "not "); ++ TRACE("Filesystem size %lld bytes\n", sblk->bytes_used); ++ TRACE("Block size %d\n", sblk->block_size); ++ TRACE("Number of inodes %d\n", sblk->inodes); ++ if (sblk->s_major > 1) ++ TRACE("Number of fragments %d\n", sblk->fragments); ++ TRACE("Number of uids %d\n", sblk->no_uids); ++ TRACE("Number of gids %d\n", sblk->no_guids); ++ TRACE("sblk->inode_table_start %llx\n", sblk->inode_table_start); ++ TRACE("sblk->directory_table_start %llx\n", sblk->directory_table_start); ++ if (sblk->s_major > 1) ++ TRACE("sblk->fragment_table_start %llx\n", sblk->fragment_table_start); ++ TRACE("sblk->uid_start %llx\n", sblk->uid_start); ++ ++ s->s_maxbytes = MAX_LFS_FILESIZE; ++ s->s_flags |= MS_RDONLY; ++ s->s_op = &squashfs_super_ops; ++ ++ if (readahead_metadata(s) == 0) ++ goto failed_mount; ++ ++ /* Allocate read_page block */ ++ err = -ENOMEM; ++ msblk->read_page = vmalloc(sblk->block_size); ++ if (msblk->read_page == NULL) { ++ ERROR("Failed to allocate read_page block\n"); ++ goto failed_mount; ++ } ++ ++ /* Allocate uid and gid tables */ ++ msblk->uid = kmalloc((sblk->no_uids + sblk->no_guids) * ++ sizeof(unsigned int), GFP_KERNEL); ++ if (msblk->uid == NULL) { ++ ERROR("Failed to allocate uid/gid table\n"); ++ goto failed_mount; ++ } ++ msblk->guid = msblk->uid + sblk->no_uids; ++ ++ dpri("swap %d\n", msblk->swap); ++ err = -EINVAL; ++ if (msblk->swap) { ++ unsigned int *suid; ++ ++ err = -ENOMEM; ++ suid = kmalloc(sizeof(*suid) * (sblk->no_uids + sblk->no_guids), ++ GFP_KERNEL); ++ if (unlikely(!suid)) ++ goto failed_mount; ++ ++ err = -EINVAL; ++ if (!squashfs_read_data(s, (char *)suid, sblk->uid_start, ++ ((sblk->no_uids + sblk->no_guids) * ++ sizeof(unsigned int)) | ++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, (sblk->no_uids + sblk->no_guids) * sizeof(unsigned int))) { ++ ERROR("unable to read uid/gid table\n"); ++ kfree(suid); ++ goto failed_mount; ++ } ++ ++ SQUASHFS_SWAP_DATA(msblk->uid, suid, (sblk->no_uids + ++ sblk->no_guids), (sizeof(unsigned int) * 8)); ++ kfree(suid); ++ } else ++ if (!squashfs_read_data(s, (char *) msblk->uid, sblk->uid_start, ++ ((sblk->no_uids + sblk->no_guids) * ++ sizeof(unsigned int)) | ++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, (sblk->no_uids + sblk->no_guids) * sizeof(unsigned int))) { ++ ERROR("unable to read uid/gid table\n"); ++ goto failed_mount; ++ } ++ ++ ++ if (sblk->s_major == 1 && squashfs_1_0_supported(msblk)) ++ goto allocate_root; ++ ++ err = -ENOMEM; ++ msblk->fragment = kzalloc(sizeof(struct squashfs_fragment_cache) * ++ SQUASHFS_CACHED_FRAGMENTS, GFP_KERNEL); ++ if (msblk->fragment == NULL) { ++ ERROR("Failed to allocate fragment block cache\n"); ++ goto failed_mount; ++ } ++ ++ for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++) { ++ msblk->fragment[i].block = SQUASHFS_INVALID_BLK; ++ } ++ ++ msblk->next_fragment = 0; ++ msblk->unused_frag_blks = SQUASHFS_CACHED_FRAGMENTS; ++ ++ /* Allocate and read fragment index table */ ++ if (msblk->read_fragment_index_table(s) == 0) ++ goto failed_mount; ++ ++ if(sblk->s_major < 3 || sblk->lookup_table_start == SQUASHFS_INVALID_BLK) ++ goto allocate_root; ++ ++ /* Allocate and read inode lookup table */ ++ if (read_inode_lookup_table(s) == 0) ++ goto failed_mount; ++ ++ s->s_op = &squashfs_export_super_ops; ++ s->s_export_op = &squashfs_export_ops; ++ ++allocate_root: ++ dpri("alloate_root\n"); ++ root = new_inode(s); ++ if ((msblk->read_inode)(root, sblk->root_inode) == 0) { ++ iput(root); ++ goto failed_mount; ++ } ++ insert_inode_hash(root); ++ ++ s->s_root = d_alloc_root(root); ++ if (s->s_root == NULL) { ++ ERROR("Root inode create failed\n"); ++ iput(root); ++ goto failed_mount; ++ } ++ ++ TRACE("Leaving squashfs_fill_super\n"); ++ return 0; ++ ++failed_mount: ++ kfree(msblk->inode_lookup_table); ++ kfree(msblk->fragment_index); ++ kfree(msblk->fragment); ++ kfree(msblk->uid); ++ vfree(msblk->read_page); ++ kfree(msblk->block_cache); ++ kfree(msblk->fragment_index_2); ++ kfree(s->s_fs_info); ++ s->s_fs_info = NULL; ++ failure: ++ return err; ++} ++ ++ ++static int squashfs_statfs(struct dentry *dentry, struct kstatfs *buf) ++{ ++ struct squashfs_sb_info *msblk = dentry->d_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ ++ TRACE("Entered squashfs_statfs\n"); ++ ++ buf->f_type = sblk->s_magic; ++ buf->f_bsize = sblk->block_size; ++ buf->f_blocks = ((sblk->bytes_used - 1) >> sblk->block_log) + 1; ++ buf->f_bfree = buf->f_bavail = 0; ++ buf->f_files = sblk->inodes; ++ buf->f_ffree = 0; ++ buf->f_namelen = SQUASHFS_NAME_LEN; ++ ++ return 0; ++} ++ ++ ++static int squashfs_symlink_readpage(struct file *file, struct page *page) ++{ ++ struct inode *inode = page->mapping->host; ++ int index = page->index << PAGE_CACHE_SHIFT, length, bytes, avail_bytes; ++ long long block = SQUASHFS_I(inode)->start_block; ++ int offset = SQUASHFS_I(inode)->offset; ++ void *pageaddr = kmap(page); ++ ++ TRACE("Entered squashfs_symlink_readpage, page index %ld, start block " ++ "%llx, offset %x\n", page->index, ++ SQUASHFS_I(inode)->start_block, ++ SQUASHFS_I(inode)->offset); ++ ++ for (length = 0; length < index; length += bytes) { ++ bytes = squashfs_get_cached_block(inode->i_sb, NULL, block, ++ offset, PAGE_CACHE_SIZE, &block, ++ (unsigned int *)&offset); ++ if (bytes == 0) { ++ ERROR("Unable to read symbolic link [%llx:%x]\n", block, offset); ++ goto skip_read; ++ } ++ } ++ ++ if (length != index) { ++ ERROR("(squashfs_symlink_readpage) length != index\n"); ++ bytes = 0; ++ goto skip_read; ++ } ++ ++ avail_bytes = min_t(int, i_size_read(inode) - length, PAGE_CACHE_SIZE); ++ ++ bytes = squashfs_get_cached_block(inode->i_sb, pageaddr, block, offset, ++ avail_bytes, &block, (unsigned int *)&offset); ++ if (bytes == 0) ++ ERROR("Unable to read symbolic link [%llx:%x]\n", block, offset); ++ ++skip_read: ++ memset(pageaddr + bytes, 0, PAGE_CACHE_SIZE - bytes); ++ kunmap(page); ++ flush_dcache_page(page); ++ SetPageUptodate(page); ++ unlock_page(page); ++ ++ return 0; ++} ++ ++ ++static struct meta_index *locate_meta_index(struct inode *inode, int index, int offset) ++{ ++ struct meta_index *meta = NULL; ++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; ++ int i; ++ ++ mutex_lock(&msblk->meta_index_mutex); ++ ++ TRACE("locate_meta_index: index %d, offset %d\n", index, offset); ++ ++ if (msblk->meta_index == NULL) ++ goto not_allocated; ++ ++ for (i = 0; i < SQUASHFS_META_NUMBER; i ++) { ++ if (msblk->meta_index[i].inode_number == inode->i_ino && ++ msblk->meta_index[i].offset >= offset && ++ msblk->meta_index[i].offset <= index && ++ msblk->meta_index[i].locked == 0) { ++ TRACE("locate_meta_index: entry %d, offset %d\n", i, ++ msblk->meta_index[i].offset); ++ meta = &msblk->meta_index[i]; ++ offset = meta->offset; ++ } ++ } ++ ++ if (meta) ++ meta->locked = 1; ++ ++not_allocated: ++ mutex_unlock(&msblk->meta_index_mutex); ++ ++ return meta; ++} ++ ++ ++static struct meta_index *empty_meta_index(struct inode *inode, int offset, int skip) ++{ ++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; ++ struct meta_index *meta = NULL; ++ int i; ++ ++ mutex_lock(&msblk->meta_index_mutex); ++ ++ TRACE("empty_meta_index: offset %d, skip %d\n", offset, skip); ++ ++ if (msblk->meta_index == NULL) { ++ msblk->meta_index = kmalloc(sizeof(struct meta_index) * ++ SQUASHFS_META_NUMBER, GFP_KERNEL); ++ if (msblk->meta_index == NULL) { ++ ERROR("Failed to allocate meta_index\n"); ++ goto failed; ++ } ++ for (i = 0; i < SQUASHFS_META_NUMBER; i++) { ++ msblk->meta_index[i].inode_number = 0; ++ msblk->meta_index[i].locked = 0; ++ } ++ msblk->next_meta_index = 0; ++ } ++ ++ for (i = SQUASHFS_META_NUMBER; i && ++ msblk->meta_index[msblk->next_meta_index].locked; i --) ++ msblk->next_meta_index = (msblk->next_meta_index + 1) % ++ SQUASHFS_META_NUMBER; ++ ++ if (i == 0) { ++ TRACE("empty_meta_index: failed!\n"); ++ goto failed; ++ } ++ ++ TRACE("empty_meta_index: returned meta entry %d, %p\n", ++ msblk->next_meta_index, ++ &msblk->meta_index[msblk->next_meta_index]); ++ ++ meta = &msblk->meta_index[msblk->next_meta_index]; ++ msblk->next_meta_index = (msblk->next_meta_index + 1) % ++ SQUASHFS_META_NUMBER; ++ ++ meta->inode_number = inode->i_ino; ++ meta->offset = offset; ++ meta->skip = skip; ++ meta->entries = 0; ++ meta->locked = 1; ++ ++failed: ++ mutex_unlock(&msblk->meta_index_mutex); ++ return meta; ++} ++ ++ ++static void release_meta_index(struct inode *inode, struct meta_index *meta) ++{ ++ meta->locked = 0; ++ smp_mb(); ++} ++ ++ ++static int read_block_index(struct super_block *s, int blocks, char *block_list, ++ long long *start_block, int *offset) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ unsigned int *block_listp; ++ int block = 0; ++ ++ if (msblk->swap) { ++ char *sblock_list; ++ ++ sblock_list = kmalloc(blocks << 2, GFP_KERNEL); ++ if (unlikely(!sblock_list)) ++ goto failure; ++ ++ if (!squashfs_get_cached_block(s, sblock_list, *start_block, ++ *offset, blocks << 2, start_block, (unsigned int *)offset)) { ++ ERROR("Fail reading block list [%llx:%x]\n", *start_block, *offset); ++ kfree(sblock_list); ++ goto failure; ++ } ++ SQUASHFS_SWAP_INTS(((unsigned int *)block_list), ++ ((unsigned int *)sblock_list), blocks); ++ kfree(sblock_list); ++ } else { ++ if (!squashfs_get_cached_block(s, block_list, *start_block, ++ *offset, blocks << 2, start_block, (unsigned int *)offset)) { ++ ERROR("Fail reading block list [%llx:%x]\n", *start_block, *offset); ++ goto failure; ++ } ++ } ++ ++ for (block_listp = (unsigned int *) block_list; blocks; ++ block_listp++, blocks --) ++ block += SQUASHFS_COMPRESSED_SIZE_BLOCK(*block_listp); ++ ++ return block; ++ ++failure: ++ return -1; ++} ++ ++ ++#define SIZE 256 ++ ++static inline int calculate_skip(int blocks) { ++ int skip = (blocks - 1) / ((SQUASHFS_SLOTS * SQUASHFS_META_ENTRIES + 1) * SQUASHFS_META_INDEXES); ++ return skip >= 7 ? 7 : skip + 1; ++} ++ ++ ++static int get_meta_index(struct inode *inode, int index, ++ long long *index_block, int *index_offset, ++ long long *data_block, char *block_list) ++{ ++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ int skip = calculate_skip(i_size_read(inode) >> sblk->block_log); ++ int offset = 0; ++ struct meta_index *meta; ++ struct meta_entry *meta_entry; ++ long long cur_index_block = SQUASHFS_I(inode)->u.s1.block_list_start; ++ int cur_offset = SQUASHFS_I(inode)->offset; ++ long long cur_data_block = SQUASHFS_I(inode)->start_block; ++ int i; ++ ++ index /= SQUASHFS_META_INDEXES * skip; ++ ++ while (offset < index) { ++ meta = locate_meta_index(inode, index, offset + 1); ++ ++ if (meta == NULL) { ++ meta = empty_meta_index(inode, offset + 1, skip); ++ if (meta == NULL) ++ goto all_done; ++ } else { ++ if(meta->entries == 0) ++ goto failed; ++ /* XXX */ ++ offset = index < meta->offset + meta->entries ? index : ++ meta->offset + meta->entries - 1; ++ /* XXX */ ++ meta_entry = &meta->meta_entry[offset - meta->offset]; ++ cur_index_block = meta_entry->index_block + sblk->inode_table_start; ++ cur_offset = meta_entry->offset; ++ cur_data_block = meta_entry->data_block; ++ TRACE("get_meta_index: offset %d, meta->offset %d, " ++ "meta->entries %d\n", offset, meta->offset, meta->entries); ++ TRACE("get_meta_index: index_block 0x%llx, offset 0x%x" ++ " data_block 0x%llx\n", cur_index_block, ++ cur_offset, cur_data_block); ++ } ++ ++ for (i = meta->offset + meta->entries; i <= index && ++ i < meta->offset + SQUASHFS_META_ENTRIES; i++) { ++ int blocks = skip * SQUASHFS_META_INDEXES; ++ ++ while (blocks) { ++ int block = blocks > (SIZE >> 2) ? (SIZE >> 2) : blocks; ++ int res = read_block_index(inode->i_sb, block, block_list, ++ &cur_index_block, &cur_offset); ++ ++ if (res == -1) ++ goto failed; ++ ++ cur_data_block += res; ++ blocks -= block; ++ } ++ ++ meta_entry = &meta->meta_entry[i - meta->offset]; ++ meta_entry->index_block = cur_index_block - sblk->inode_table_start; ++ meta_entry->offset = cur_offset; ++ meta_entry->data_block = cur_data_block; ++ meta->entries ++; ++ offset ++; ++ } ++ ++ TRACE("get_meta_index: meta->offset %d, meta->entries %d\n", ++ meta->offset, meta->entries); ++ ++ release_meta_index(inode, meta); ++ } ++ ++all_done: ++ *index_block = cur_index_block; ++ *index_offset = cur_offset; ++ *data_block = cur_data_block; ++ ++ return offset * SQUASHFS_META_INDEXES * skip; ++ ++failed: ++ release_meta_index(inode, meta); ++ return -1; ++} ++ ++ ++static long long read_blocklist(struct inode *inode, int index, ++ int readahead_blks, char *block_list, ++ unsigned short **block_p, unsigned int *bsize) ++{ ++ long long block_ptr; ++ int offset; ++ long long block; ++ int res = get_meta_index(inode, index, &block_ptr, &offset, &block, ++ block_list); ++ ++ TRACE("read_blocklist: res %d, index %d, block_ptr 0x%llx, offset" ++ " 0x%x, block 0x%llx\n", res, index, block_ptr, offset, block); ++ ++ if(res == -1) ++ goto failure; ++ ++ index -= res; ++ ++ while (index) { ++ int blocks = index > (SIZE >> 2) ? (SIZE >> 2) : index; ++ int res = read_block_index(inode->i_sb, blocks, block_list, ++ &block_ptr, &offset); ++ if (res == -1) ++ goto failure; ++ block += res; ++ index -= blocks; ++ } ++ ++ if (read_block_index(inode->i_sb, 1, block_list, &block_ptr, &offset) == -1) ++ goto failure; ++ *bsize = *((unsigned int *) block_list); ++ ++ return block; ++ ++failure: ++ return 0; ++} ++ ++ ++static int squashfs_readpage(struct file *file, struct page *page) ++{ ++ struct inode *inode = page->mapping->host; ++ struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ unsigned char *block_list = NULL; ++ long long block; ++ unsigned int bsize, i; ++ int bytes; ++ int index = page->index >> (sblk->block_log - PAGE_CACHE_SHIFT); ++ void *pageaddr; ++ struct squashfs_fragment_cache *fragment = NULL; ++ char *data_ptr = msblk->read_page; ++ ++ int mask = (1 << (sblk->block_log - PAGE_CACHE_SHIFT)) - 1; ++ int start_index = page->index & ~mask; ++ int end_index = start_index | mask; ++ int file_end = i_size_read(inode) >> sblk->block_log; ++ int sparse = 0; ++ ++ TRACE("Entered squashfs_readpage, page index %lx, start block %llx\n", ++ page->index, SQUASHFS_I(inode)->start_block); ++ ++ if (page->index >= ((i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> ++ PAGE_CACHE_SHIFT)) ++ goto out; ++ ++ if (SQUASHFS_I(inode)->u.s1.fragment_start_block == SQUASHFS_INVALID_BLK ++ || index < file_end) { ++ block_list = kmalloc(SIZE, GFP_KERNEL); ++ if (block_list == NULL) { ++ ERROR("Failed to allocate block_list\n"); ++ goto error_out; ++ } ++ ++ block = (msblk->read_blocklist)(inode, index, 1, block_list, NULL, &bsize); ++ if (block == 0) ++ goto error_out; ++ ++ if (bsize == 0) { /* hole */ ++ bytes = index == file_end ? ++ (i_size_read(inode) & (sblk->block_size - 1)) : sblk->block_size; ++ sparse = 1; ++ } else { ++ mutex_lock(&msblk->read_page_mutex); ++ ++ bytes = squashfs_read_data(inode->i_sb, msblk->read_page, block, ++ bsize, NULL, sblk->block_size); ++ ++ if (bytes == 0) { ++ ERROR("Unable to read page, block %llx, size %x\n", block, bsize); ++ mutex_unlock(&msblk->read_page_mutex); ++ goto error_out; ++ } ++ } ++ } else { ++ fragment = get_cached_fragment(inode->i_sb, ++ SQUASHFS_I(inode)-> u.s1.fragment_start_block, ++ SQUASHFS_I(inode)->u.s1.fragment_size); ++ ++ if (fragment == NULL) { ++ ERROR("Unable to read page, block %llx, size %x\n", ++ SQUASHFS_I(inode)->u.s1.fragment_start_block, ++ (int) SQUASHFS_I(inode)->u.s1.fragment_size); ++ goto error_out; ++ } ++ bytes = i_size_read(inode) & (sblk->block_size - 1); ++ data_ptr = fragment->data + SQUASHFS_I(inode)->u.s1.fragment_offset; ++ } ++ ++ for (i = start_index; i <= end_index && bytes > 0; i++, ++ bytes -= PAGE_CACHE_SIZE, data_ptr += PAGE_CACHE_SIZE) { ++ struct page *push_page; ++ int avail = sparse ? 0 : min_t(unsigned int, bytes, PAGE_CACHE_SIZE); ++ ++ TRACE("bytes %d, i %d, available_bytes %d\n", bytes, i, avail); ++ ++ push_page = (i == page->index) ? page : ++ grab_cache_page_nowait(page->mapping, i); ++ ++ if (!push_page) ++ continue; ++ ++ if (PageUptodate(push_page)) ++ goto skip_page; ++ ++ pageaddr = kmap_atomic(push_page, KM_USER0); ++ memcpy(pageaddr, data_ptr, avail); ++ memset(pageaddr + avail, 0, PAGE_CACHE_SIZE - avail); ++ kunmap_atomic(pageaddr, KM_USER0); ++ flush_dcache_page(push_page); ++ SetPageUptodate(push_page); ++skip_page: ++ unlock_page(push_page); ++ if(i != page->index) ++ page_cache_release(push_page); ++ } ++ ++ if (SQUASHFS_I(inode)->u.s1.fragment_start_block == SQUASHFS_INVALID_BLK ++ || index < file_end) { ++ if (!sparse) ++ mutex_unlock(&msblk->read_page_mutex); ++ kfree(block_list); ++ } else ++ release_cached_fragment(msblk, fragment); ++ ++ return 0; ++ ++error_out: ++ SetPageError(page); ++out: ++ pageaddr = kmap_atomic(page, KM_USER0); ++ memset(pageaddr, 0, PAGE_CACHE_SIZE); ++ kunmap_atomic(pageaddr, KM_USER0); ++ flush_dcache_page(page); ++ if (!PageError(page)) ++ SetPageUptodate(page); ++ unlock_page(page); ++ ++ kfree(block_list); ++ return 0; ++} ++ ++ ++static int get_dir_index_using_offset(struct super_block *s, ++ long long *next_block, unsigned int *next_offset, ++ long long index_start, unsigned int index_offset, int i_count, ++ long long f_pos) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ int i, length = 0; ++ struct squashfs_dir_index index; ++ ++ TRACE("Entered get_dir_index_using_offset, i_count %d, f_pos %d\n", ++ i_count, (unsigned int) f_pos); ++ ++ f_pos =- 3; ++ if (f_pos == 0) ++ goto finish; ++ ++ for (i = 0; i < i_count; i++) { ++ if (msblk->swap) { ++ struct squashfs_dir_index sindex; ++ squashfs_get_cached_block(s, &sindex, index_start, index_offset, ++ sizeof(sindex), &index_start, &index_offset); ++ SQUASHFS_SWAP_DIR_INDEX(&index, &sindex); ++ } else ++ squashfs_get_cached_block(s, &index, index_start, index_offset, ++ sizeof(index), &index_start, &index_offset); ++ ++ if (index.index > f_pos) ++ break; ++ ++ squashfs_get_cached_block(s, NULL, index_start, index_offset, ++ index.size + 1, &index_start, &index_offset); ++ ++ length = index.index; ++ *next_block = index.start_block + sblk->directory_table_start; ++ } ++ ++ *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE; ++ ++finish: ++ return length + 3; ++} ++ ++ ++static int get_dir_index_using_name(struct super_block *s, ++ long long *next_block, unsigned int *next_offset, ++ long long index_start, unsigned int index_offset, int i_count, ++ const char *name, int size) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ int i, length = 0; ++ struct squashfs_dir_index *index; ++ char *str; ++ ++ TRACE("Entered get_dir_index_using_name, i_count %d\n", i_count); ++ ++ str = kmalloc(sizeof(struct squashfs_dir_index) + ++ (SQUASHFS_NAME_LEN + 1) * 2, GFP_KERNEL); ++ if (str == NULL) { ++ ERROR("Failed to allocate squashfs_dir_index\n"); ++ goto failure; ++ } ++ ++ index = (struct squashfs_dir_index *) (str + SQUASHFS_NAME_LEN + 1); ++ strncpy(str, name, size); ++ str[size] = '\0'; ++ ++ for (i = 0; i < i_count; i++) { ++ if (msblk->swap) { ++ struct squashfs_dir_index sindex; ++ squashfs_get_cached_block(s, &sindex, index_start, index_offset, ++ sizeof(sindex), &index_start, &index_offset); ++ SQUASHFS_SWAP_DIR_INDEX(index, &sindex); ++ } else ++ squashfs_get_cached_block(s, index, index_start, index_offset, ++ sizeof(struct squashfs_dir_index), &index_start, &index_offset); ++ ++ squashfs_get_cached_block(s, index->name, index_start, index_offset, ++ index->size + 1, &index_start, &index_offset); ++ ++ index->name[index->size + 1] = '\0'; ++ ++ if (strcmp(index->name, str) > 0) ++ break; ++ ++ length = index->index; ++ *next_block = index->start_block + sblk->directory_table_start; ++ } ++ ++ *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE; ++ kfree(str); ++ ++failure: ++ return length + 3; ++} ++ ++ ++static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) ++{ ++ struct inode *i = file->f_dentry->d_inode; ++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ long long next_block = SQUASHFS_I(i)->start_block + ++ sblk->directory_table_start; ++ int next_offset = SQUASHFS_I(i)->offset, length = 0, dir_count; ++ struct squashfs_dir_header dirh; ++ struct squashfs_dir_entry *dire; ++ ++ TRACE("Entered squashfs_readdir [%llx:%x]\n", next_block, next_offset); ++ ++ dire = kmalloc(sizeof(struct squashfs_dir_entry) + ++ SQUASHFS_NAME_LEN + 1, GFP_KERNEL); ++ if (dire == NULL) { ++ ERROR("Failed to allocate squashfs_dir_entry\n"); ++ goto finish; ++ } ++ ++ while(file->f_pos < 3) { ++ char *name; ++ int size, i_ino; ++ ++ if(file->f_pos == 0) { ++ name = "."; ++ size = 1; ++ i_ino = i->i_ino; ++ } else { ++ name = ".."; ++ size = 2; ++ i_ino = SQUASHFS_I(i)->u.s2.parent_inode; ++ } ++ TRACE("Calling filldir(%x, %s, %d, %d, %d, %d)\n", ++ (unsigned int) dirent, name, size, (int) ++ file->f_pos, i_ino, squashfs_filetype_table[1]); ++ ++ if (filldir(dirent, name, size, file->f_pos, i_ino, ++ squashfs_filetype_table[1]) < 0) { ++ TRACE("Filldir returned less than 0\n"); ++ goto finish; ++ } ++ file->f_pos += size; ++ } ++ ++ length = get_dir_index_using_offset(i->i_sb, &next_block, ++ (unsigned int *)&next_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_start, ++ SQUASHFS_I(i)->u.s2.directory_index_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_count, file->f_pos); ++ ++ while (length < i_size_read(i)) { ++ /* read directory header */ ++ if (msblk->swap) { ++ struct squashfs_dir_header sdirh; ++ ++ if (!squashfs_get_cached_block(i->i_sb, &sdirh, next_block, ++ next_offset, sizeof(sdirh), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdirh); ++ SQUASHFS_SWAP_DIR_HEADER(&dirh, &sdirh); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, &dirh, next_block, ++ next_offset, sizeof(dirh), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(dirh); ++ } ++ ++ dir_count = dirh.count + 1; ++ while (dir_count--) { ++ if (msblk->swap) { ++ struct squashfs_dir_entry sdire; ++ if (!squashfs_get_cached_block(i->i_sb, &sdire, next_block, ++ next_offset, sizeof(sdire), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdire); ++ SQUASHFS_SWAP_DIR_ENTRY(dire, &sdire); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, dire, next_block, ++ next_offset, sizeof(*dire), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(*dire); ++ } ++ ++ if (!squashfs_get_cached_block(i->i_sb, dire->name, next_block, ++ next_offset, dire->size + 1, &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += dire->size + 1; ++ ++ if (file->f_pos >= length) ++ continue; ++ ++ dire->name[dire->size + 1] = '\0'; ++ ++ TRACE("Calling filldir(%x, %s, %d, %d, %x:%x, %d, %d)\n", ++ (unsigned int) dirent, dire->name, dire->size + 1, ++ (int) file->f_pos, dirh.start_block, dire->offset, ++ dirh.inode_number + dire->inode_number, ++ squashfs_filetype_table[dire->type]); ++ ++ if (filldir(dirent, dire->name, dire->size + 1, file->f_pos, ++ dirh.inode_number + dire->inode_number, ++ squashfs_filetype_table[dire->type]) < 0) { ++ TRACE("Filldir returned less than 0\n"); ++ goto finish; ++ } ++ file->f_pos = length; ++ } ++ } ++ ++finish: ++ kfree(dire); ++ return 0; ++ ++failed_read: ++ ERROR("Unable to read directory block [%llx:%x]\n", next_block, ++ next_offset); ++ kfree(dire); ++ return 0; ++} ++ ++ ++static struct dentry *squashfs_lookup(struct inode *i, struct dentry *dentry, ++ struct nameidata *nd) ++{ ++ const unsigned char *name = dentry->d_name.name; ++ int len = dentry->d_name.len; ++ struct inode *inode = NULL; ++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ long long next_block = SQUASHFS_I(i)->start_block + ++ sblk->directory_table_start; ++ int next_offset = SQUASHFS_I(i)->offset, length = 0, dir_count; ++ struct squashfs_dir_header dirh; ++ struct squashfs_dir_entry *dire; ++ ++ TRACE("Entered squashfs_lookup [%llx:%x]\n", next_block, next_offset); ++ ++ dire = kmalloc(sizeof(struct squashfs_dir_entry) + ++ SQUASHFS_NAME_LEN + 1, GFP_KERNEL); ++ if (dire == NULL) { ++ ERROR("Failed to allocate squashfs_dir_entry\n"); ++ goto exit_lookup; ++ } ++ ++ if (len > SQUASHFS_NAME_LEN) ++ goto exit_lookup; ++ ++ length = get_dir_index_using_name(i->i_sb, &next_block, (unsigned int *)&next_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_start, ++ SQUASHFS_I(i)->u.s2.directory_index_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_count, name, len); ++ ++ while (length < i_size_read(i)) { ++ /* read directory header */ ++ if (msblk->swap) { ++ struct squashfs_dir_header sdirh; ++ if (!squashfs_get_cached_block(i->i_sb, &sdirh, next_block, ++ next_offset, sizeof(sdirh), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdirh); ++ SQUASHFS_SWAP_DIR_HEADER(&dirh, &sdirh); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, &dirh, next_block, ++ next_offset, sizeof(dirh), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(dirh); ++ } ++ ++ dir_count = dirh.count + 1; ++ while (dir_count--) { ++ if (msblk->swap) { ++ struct squashfs_dir_entry sdire; ++ if (!squashfs_get_cached_block(i->i_sb, &sdire, next_block, ++ next_offset, sizeof(sdire), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdire); ++ SQUASHFS_SWAP_DIR_ENTRY(dire, &sdire); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, dire, next_block, ++ next_offset, sizeof(*dire), &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += sizeof(*dire); ++ } ++ ++ if (!squashfs_get_cached_block(i->i_sb, dire->name, next_block, ++ next_offset, dire->size + 1, &next_block, ++ (unsigned int *)&next_offset)) ++ goto failed_read; ++ ++ length += dire->size + 1; ++ ++ if (name[0] < dire->name[0]) ++ goto exit_lookup; ++ ++ if ((len == dire->size + 1) && !strncmp(name, dire->name, len)) { ++ squashfs_inode_t ino = SQUASHFS_MKINODE(dirh.start_block, ++ dire->offset); ++ ++ TRACE("calling squashfs_iget for directory entry %s, inode" ++ " %x:%x, %d\n", name, dirh.start_block, dire->offset, ++ dirh.inode_number + dire->inode_number); ++ ++ inode = squashfs_iget(i->i_sb, ino, dirh.inode_number + dire->inode_number); ++ ++ goto exit_lookup; ++ } ++ } ++ } ++ ++exit_lookup: ++ kfree(dire); ++ if (inode) ++ return d_splice_alias(inode, dentry); ++ d_add(dentry, inode); ++ return ERR_PTR(0); ++ ++failed_read: ++ ERROR("Unable to read directory block [%llx:%x]\n", next_block, ++ next_offset); ++ goto exit_lookup; ++} ++ ++ ++static int squashfs_remount(struct super_block *s, int *flags, char *data) ++{ ++ *flags |= MS_RDONLY; ++ return 0; ++} ++ ++ ++static void squashfs_put_super(struct super_block *s) ++{ ++ int i; ++ ++ if (s->s_fs_info) { ++ struct squashfs_sb_info *sbi = s->s_fs_info; ++ if (sbi->block_cache) ++ for (i = 0; i < squashfs_cached_blks; i++) ++ if (sbi->block_cache[i].block != SQUASHFS_INVALID_BLK) ++ vfree(sbi->block_cache[i].data); ++ if (sbi->fragment) ++ for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++) ++ vfree(sbi->fragment[i].data); ++ kfree(sbi->fragment); ++ kfree(sbi->block_cache); ++ vfree(sbi->read_page); ++ kfree(sbi->uid); ++ kfree(sbi->fragment_index); ++ kfree(sbi->fragment_index_2); ++ kfree(sbi->meta_index); ++ kfree(s->s_fs_info); ++ s->s_fs_info = NULL; ++ } ++} ++ ++ ++static int squashfs_get_sb(struct file_system_type *fs_type, int flags, ++ const char *dev_name, void *data, struct vfsmount *mnt) ++{ ++ return get_sb_bdev(fs_type, flags, dev_name, data, squashfs_fill_super, ++ mnt); ++} ++ ++static void free_sqlzma(void) ++{ ++ int cpu; ++ struct sqlzma *p; ++ ++ for_each_online_cpu(cpu) { ++ p = per_cpu(sqlzma, cpu); ++ if (p) { ++#ifdef KeepPreemptive ++ mutex_destroy(&p->mtx); ++#endif ++ sqlzma_fin(&p->un); ++ kfree(p); ++ } ++ } ++} ++ ++static int __init init_squashfs_fs(void) ++{ ++ struct sqlzma *p; ++ int cpu; ++ int err = init_inodecache(); ++ if (err) ++ goto out; ++ ++ for_each_online_cpu(cpu) { ++ dpri("%d: %p\n", cpu, per_cpu(sqlzma, cpu)); ++ err = -ENOMEM; ++ p = kmalloc(sizeof(struct sqlzma), GFP_KERNEL); ++ if (p) { ++#ifdef KeepPreemptive ++ mutex_init(&p->mtx); ++#endif ++ err = sqlzma_init(&p->un, 1, 0); ++ if (unlikely(err)) { ++ ERROR("Failed to intialize uncompress workspace\n"); ++ break; ++ } ++ per_cpu(sqlzma, cpu) = p; ++ err = 0; ++ } else ++ break; ++ } ++ if (unlikely(err)) { ++ free_sqlzma(); ++ goto out; ++ } ++ ++ printk(KERN_INFO "squashfs: version 3.3 (2007/10/31) " ++ "Phillip Lougher\n" ++ "squashfs: LZMA suppport for slax.org by jro\n"); ++ ++ err = register_filesystem(&squashfs_fs_type); ++ if (err) { ++ free_sqlzma(); ++ destroy_inodecache(); ++ } ++ ++out: ++ return err; ++} ++ ++ ++static void __exit exit_squashfs_fs(void) ++{ ++ unregister_filesystem(&squashfs_fs_type); ++ free_sqlzma(); ++ destroy_inodecache(); ++} ++ ++ ++static struct kmem_cache * squashfs_inode_cachep; ++ ++ ++static struct inode *squashfs_alloc_inode(struct super_block *sb) ++{ ++ struct squashfs_inode_info *ei; ++ ei = kmem_cache_alloc(squashfs_inode_cachep, GFP_KERNEL); ++ return ei ? &ei->vfs_inode : NULL; ++} ++ ++ ++static void squashfs_destroy_inode(struct inode *inode) ++{ ++ kmem_cache_free(squashfs_inode_cachep, SQUASHFS_I(inode)); ++} ++ ++ ++static void init_once(struct kmem_cache *cachep, void *foo) ++{ ++ struct squashfs_inode_info *ei = foo; ++ ++ inode_init_once(&ei->vfs_inode); ++} ++ ++ ++static int __init init_inodecache(void) ++{ ++ squashfs_inode_cachep = kmem_cache_create("squashfs_inode_cache", ++ sizeof(struct squashfs_inode_info), 0, ++ SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT, init_once); ++ if (squashfs_inode_cachep == NULL) ++ return -ENOMEM; ++ return 0; ++} ++ ++ ++static void destroy_inodecache(void) ++{ ++ kmem_cache_destroy(squashfs_inode_cachep); ++} ++ ++ ++module_init(init_squashfs_fs); ++module_exit(exit_squashfs_fs); ++MODULE_DESCRIPTION("squashfs 3.2-r2-CVS, a compressed read-only filesystem, and LZMA suppport for slax.org"); ++MODULE_AUTHOR("Phillip Lougher <phillip@lougher.demon.co.uk>, and LZMA suppport for slax.org by jro"); ++MODULE_LICENSE("GPL"); +diff -urN linux-2.6.23/fs/squashfs/module.c linux-2.6.23.sqlzma-ng/fs/squashfs/module.c +--- linux-2.6.23/fs/squashfs/module.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/module.c 2007-11-13 19:51:33.000000000 -0500 +@@ -0,0 +1,36 @@ ++ ++/* ++ * Copyright (C) 2006-2007 Junjiro Okajima ++ * Copyright (C) 2006-2007 Tomas Matejicek, slax.org ++ * ++ * LICENSE follows the described one in lzma.txt. ++ */ ++ ++/* $Id: module.c,v 1.1 2007/11/05 05:43:36 jro Exp $ */ ++ ++#include <linux/init.h> ++#include <linux/module.h> ++ ++#include "LzmaDecode.c" ++ ++EXPORT_SYMBOL(LzmaDecodeProperties); ++EXPORT_SYMBOL(LzmaDecode); ++ ++#if 0 ++static int __init unlzma_init(void) ++{ ++ return 0; ++} ++ ++static void __exit unlzma_exit(void) ++{ ++} ++ ++module_init(unlzma_init); ++module_exit(unlzma_exit); ++#endif ++ ++MODULE_LICENSE("GPL"); ++MODULE_VERSION("$Id: module.c,v 1.1 2007/11/05 05:43:36 jro Exp $"); ++MODULE_DESCRIPTION("LZMA uncompress. " ++ "A tiny wrapper for LzmaDecode.c in LZMA SDK from www.7-zip.org."); +diff -urN linux-2.6.23/fs/squashfs/sqlzma.h linux-2.6.23.sqlzma-ng/fs/squashfs/sqlzma.h +--- linux-2.6.23/fs/squashfs/sqlzma.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/sqlzma.h 2007-11-13 19:09:21.000000000 -0500 +@@ -0,0 +1,83 @@ ++/* ++ * Copyright (C) 2006 Junjiro Okajima ++ * Copyright (C) 2006 Tomas Matejicek, slax.org ++ * ++ * LICENSE follows the described one in lzma. ++ */ ++ ++/* $Id: sqlzma.h,v 1.15 2007/11/09 14:42:12 jro Exp $ */ ++ ++#ifndef __sqlzma_h__ ++#define __sqlzma_h__ ++ ++#ifndef __KERNEL__ ++#include <stdlib.h> ++#include <string.h> ++#include <zlib.h> ++#ifdef _REENTRANT ++#include <pthread.h> ++#endif ++#else ++#include <linux/zlib.h> ++#endif ++#define _7ZIP_BYTE_DEFINED ++ ++/* ++ * detect the compression method automatically by the first byte of compressed ++ * data. ++ * according to rfc1950, the first byte of zlib compression must be 0x?8. ++ */ ++#define is_lzma(c) (c == 0x5d) ++ ++/* ---------------------------------------------------------------------- */ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#ifndef __KERNEL__ ++/* for mksquashfs only */ ++struct sqlzma_opts { ++ unsigned int try_lzma:1; ++ unsigned int dicsize; ++}; ++int sqlzma_cm(struct sqlzma_opts *opts, z_stream *stream, Bytef *next_in, uInt ++ avail_in, Bytef *next_out, uInt avail_out); ++#endif ++ ++/* ---------------------------------------------------------------------- */ ++/* ++ * Three patterns for sqlzma uncompression. very dirty code. ++ * - kernel space (squashfs kernel module) ++ * - user space with pthread (mksquashfs) ++ * - user space without pthread (unsquashfs) ++ */ ++ ++struct sized_buf { ++ unsigned int sz; ++ unsigned char *buf; ++}; ++ ++enum {SQUN_PROB, SQUN_RESULT, SQUN_LAST}; ++struct sqlzma_un { ++ int un_lzma; ++ struct sized_buf un_a[SQUN_LAST]; ++ unsigned char un_prob[31960]; /* unlzma 64KB - 1MB */ ++ z_stream un_stream; ++#define un_cmbuf un_stream.next_in ++#define un_cmlen un_stream.avail_in ++#define un_resbuf un_stream.next_out ++#define un_resroom un_stream.avail_out ++#define un_reslen un_stream.total_out ++}; ++ ++int sqlzma_init(struct sqlzma_un *un, int do_lzma, unsigned int res_sz); ++int sqlzma_un(struct sqlzma_un *un, struct sized_buf *src, struct sized_buf *dst); ++void sqlzma_fin(struct sqlzma_un *un); ++ ++/* ---------------------------------------------------------------------- */ ++ ++#ifdef __cplusplus ++}; ++#endif ++#endif +diff -urN linux-2.6.23/fs/squashfs/squashfs.h linux-2.6.23.sqlzma-ng/fs/squashfs/squashfs.h +--- linux-2.6.23/fs/squashfs/squashfs.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/squashfs.h 2007-11-13 18:58:41.000000000 -0500 +@@ -0,0 +1,86 @@ ++/* ++ * Squashfs - a compressed read only filesystem for Linux ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 ++ * Phillip Lougher <phillip@lougher.demon.co.uk> ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2, ++ * or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ * squashfs.h ++ */ ++ ++#ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY ++#undef CONFIG_SQUASHFS_1_0_COMPATIBILITY ++#endif ++ ++#ifdef SQUASHFS_TRACE ++#define TRACE(s, args...) printk(KERN_NOTICE "SQUASHFS: "s, ## args) ++#else ++#define TRACE(s, args...) {} ++#endif ++ ++#define ERROR(s, args...) printk(KERN_ERR "SQUASHFS error: "s, ## args) ++ ++#define SERROR(s, args...) do { \ ++ if (!silent) \ ++ printk(KERN_ERR "SQUASHFS error: "s, ## args);\ ++ } while(0) ++ ++#define WARNING(s, args...) printk(KERN_WARNING "SQUASHFS: "s, ## args) ++ ++static inline struct squashfs_inode_info *SQUASHFS_I(struct inode *inode) ++{ ++ return list_entry(inode, struct squashfs_inode_info, vfs_inode); ++} ++ ++#if defined(CONFIG_SQUASHFS_1_0_COMPATIBILITY ) || defined(CONFIG_SQUASHFS_2_0_COMPATIBILITY) ++#define SQSH_EXTERN ++extern unsigned int squashfs_read_data(struct super_block *s, char *buffer, ++ long long index, unsigned int length, ++ long long *next_index, int srclength); ++extern int squashfs_get_cached_block(struct super_block *s, void *buffer, ++ long long block, unsigned int offset, ++ int length, long long *next_block, ++ unsigned int *next_offset); ++extern void release_cached_fragment(struct squashfs_sb_info *msblk, struct ++ squashfs_fragment_cache *fragment); ++extern struct squashfs_fragment_cache *get_cached_fragment(struct super_block ++ *s, long long start_block, ++ int length); ++extern struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode, unsigned int inode_number); ++extern const struct address_space_operations squashfs_symlink_aops; ++extern const struct address_space_operations squashfs_aops; ++extern struct inode_operations squashfs_dir_inode_ops; ++#else ++#define SQSH_EXTERN static ++#endif ++ ++#ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY ++extern int squashfs_1_0_supported(struct squashfs_sb_info *msblk); ++#else ++static inline int squashfs_1_0_supported(struct squashfs_sb_info *msblk) ++{ ++ return 0; ++} ++#endif ++ ++#ifdef CONFIG_SQUASHFS_2_0_COMPATIBILITY ++extern int squashfs_2_0_supported(struct squashfs_sb_info *msblk); ++#else ++static inline int squashfs_2_0_supported(struct squashfs_sb_info *msblk) ++{ ++ return 0; ++} ++#endif +diff -urN linux-2.6.23/fs/squashfs/squashfs2_0.c linux-2.6.23.sqlzma-ng/fs/squashfs/squashfs2_0.c +--- linux-2.6.23/fs/squashfs/squashfs2_0.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/squashfs2_0.c 2007-11-13 18:58:41.000000000 -0500 +@@ -0,0 +1,740 @@ ++/* ++ * Squashfs - a compressed read only filesystem for Linux ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 ++ * Phillip Lougher <phillip@lougher.demon.co.uk> ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2, ++ * or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ * squashfs2_0.c ++ */ ++ ++#include <linux/squashfs_fs.h> ++#include <linux/module.h> ++#include <linux/zlib.h> ++#include <linux/fs.h> ++#include <linux/squashfs_fs_sb.h> ++#include <linux/squashfs_fs_i.h> ++ ++#include "squashfs.h" ++static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir); ++static struct dentry *squashfs_lookup_2(struct inode *, struct dentry *, ++ struct nameidata *); ++ ++static struct file_operations squashfs_dir_ops_2 = { ++ .read = generic_read_dir, ++ .readdir = squashfs_readdir_2 ++}; ++ ++static struct inode_operations squashfs_dir_inode_ops_2 = { ++ .lookup = squashfs_lookup_2 ++}; ++ ++static unsigned char squashfs_filetype_table[] = { ++ DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_FIFO, DT_SOCK ++}; ++ ++static int read_fragment_index_table_2(struct super_block *s) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ ++ if (!(msblk->fragment_index_2 = kmalloc(SQUASHFS_FRAGMENT_INDEX_BYTES_2 ++ (sblk->fragments), GFP_KERNEL))) { ++ ERROR("Failed to allocate uid/gid table\n"); ++ return 0; ++ } ++ ++ if (SQUASHFS_FRAGMENT_INDEX_BYTES_2(sblk->fragments) && ++ !squashfs_read_data(s, (char *) ++ msblk->fragment_index_2, ++ sblk->fragment_table_start, ++ SQUASHFS_FRAGMENT_INDEX_BYTES_2 ++ (sblk->fragments) | ++ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, SQUASHFS_FRAGMENT_INDEX_BYTES_2(sblk->fragments))) { ++ ERROR("unable to read fragment index table\n"); ++ return 0; ++ } ++ ++ if (msblk->swap) { ++ int i; ++ unsigned int fragment; ++ ++ for (i = 0; i < SQUASHFS_FRAGMENT_INDEXES_2(sblk->fragments); ++ i++) { ++ SQUASHFS_SWAP_FRAGMENT_INDEXES_2((&fragment), ++ &msblk->fragment_index_2[i], 1); ++ msblk->fragment_index_2[i] = fragment; ++ } ++ } ++ ++ return 1; ++} ++ ++ ++static int get_fragment_location_2(struct super_block *s, unsigned int fragment, ++ long long *fragment_start_block, ++ unsigned int *fragment_size) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ long long start_block = ++ msblk->fragment_index_2[SQUASHFS_FRAGMENT_INDEX_2(fragment)]; ++ int offset = SQUASHFS_FRAGMENT_INDEX_OFFSET_2(fragment); ++ struct squashfs_fragment_entry_2 fragment_entry; ++ ++ if (msblk->swap) { ++ struct squashfs_fragment_entry_2 sfragment_entry; ++ ++ if (!squashfs_get_cached_block(s, (char *) &sfragment_entry, ++ start_block, offset, ++ sizeof(sfragment_entry), &start_block, ++ &offset)) ++ goto out; ++ SQUASHFS_SWAP_FRAGMENT_ENTRY_2(&fragment_entry, &sfragment_entry); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) &fragment_entry, ++ start_block, offset, ++ sizeof(fragment_entry), &start_block, ++ &offset)) ++ goto out; ++ ++ *fragment_start_block = fragment_entry.start_block; ++ *fragment_size = fragment_entry.size; ++ ++ return 1; ++ ++out: ++ return 0; ++} ++ ++ ++static void squashfs_new_inode(struct squashfs_sb_info *msblk, struct inode *i, ++ struct squashfs_base_inode_header_2 *inodeb, unsigned int ino) ++{ ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ ++ i->i_ino = ino; ++ i->i_mtime.tv_sec = sblk->mkfs_time; ++ i->i_atime.tv_sec = sblk->mkfs_time; ++ i->i_ctime.tv_sec = sblk->mkfs_time; ++ i->i_uid = msblk->uid[inodeb->uid]; ++ i->i_mode = inodeb->mode; ++ i->i_nlink = 1; ++ i->i_size = 0; ++ if (inodeb->guid == SQUASHFS_GUIDS) ++ i->i_gid = i->i_uid; ++ else ++ i->i_gid = msblk->guid[inodeb->guid]; ++} ++ ++ ++static int squashfs_read_inode_2(struct inode *i, squashfs_inode_t inode) ++{ ++ struct super_block *s = i->i_sb; ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ unsigned int block = SQUASHFS_INODE_BLK(inode) + ++ sblk->inode_table_start; ++ unsigned int offset = SQUASHFS_INODE_OFFSET(inode); ++ unsigned int ino = SQUASHFS_MK_VFS_INODE(block - ++ sblk->inode_table_start, offset); ++ long long next_block; ++ unsigned int next_offset; ++ union squashfs_inode_header_2 id, sid; ++ struct squashfs_base_inode_header_2 *inodeb = &id.base, ++ *sinodeb = &sid.base; ++ ++ TRACE("Entered squashfs_read_inode_2\n"); ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, (char *) sinodeb, block, ++ offset, sizeof(*sinodeb), &next_block, ++ &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_BASE_INODE_HEADER_2(inodeb, sinodeb, ++ sizeof(*sinodeb)); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) inodeb, block, ++ offset, sizeof(*inodeb), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ squashfs_new_inode(msblk, i, inodeb, ino); ++ ++ switch(inodeb->inode_type) { ++ case SQUASHFS_FILE_TYPE: { ++ struct squashfs_reg_inode_header_2 *inodep = &id.reg; ++ struct squashfs_reg_inode_header_2 *sinodep = &sid.reg; ++ long long frag_blk; ++ unsigned int frag_size = 0; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, (char *) ++ sinodep, block, offset, ++ sizeof(*sinodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_REG_INODE_HEADER_2(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) ++ inodep, block, offset, ++ sizeof(*inodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ frag_blk = SQUASHFS_INVALID_BLK; ++ if (inodep->fragment != SQUASHFS_INVALID_FRAG && ++ !get_fragment_location_2(s, ++ inodep->fragment, &frag_blk, &frag_size)) ++ goto failed_read; ++ ++ i->i_size = inodep->file_size; ++ i->i_fop = &generic_ro_fops; ++ i->i_mode |= S_IFREG; ++ i->i_mtime.tv_sec = inodep->mtime; ++ i->i_atime.tv_sec = inodep->mtime; ++ i->i_ctime.tv_sec = inodep->mtime; ++ i->i_blocks = ((i->i_size - 1) >> 9) + 1; ++ SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk; ++ SQUASHFS_I(i)->u.s1.fragment_size = frag_size; ++ SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->u.s1.block_list_start = next_block; ++ SQUASHFS_I(i)->offset = next_offset; ++ i->i_data.a_ops = &squashfs_aops; ++ ++ TRACE("File inode %x:%x, start_block %x, " ++ "block_list_start %llx, offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ inodep->start_block, next_block, ++ next_offset); ++ break; ++ } ++ case SQUASHFS_DIR_TYPE: { ++ struct squashfs_dir_inode_header_2 *inodep = &id.dir; ++ struct squashfs_dir_inode_header_2 *sinodep = &sid.dir; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, (char *) ++ sinodep, block, offset, ++ sizeof(*sinodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_DIR_INODE_HEADER_2(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) ++ inodep, block, offset, ++ sizeof(*inodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ i->i_size = inodep->file_size; ++ i->i_op = &squashfs_dir_inode_ops_2; ++ i->i_fop = &squashfs_dir_ops_2; ++ i->i_mode |= S_IFDIR; ++ i->i_mtime.tv_sec = inodep->mtime; ++ i->i_atime.tv_sec = inodep->mtime; ++ i->i_ctime.tv_sec = inodep->mtime; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->offset = inodep->offset; ++ SQUASHFS_I(i)->u.s2.directory_index_count = 0; ++ SQUASHFS_I(i)->u.s2.parent_inode = 0; ++ ++ TRACE("Directory inode %x:%x, start_block %x, offset " ++ "%x\n", SQUASHFS_INODE_BLK(inode), ++ offset, inodep->start_block, ++ inodep->offset); ++ break; ++ } ++ case SQUASHFS_LDIR_TYPE: { ++ struct squashfs_ldir_inode_header_2 *inodep = &id.ldir; ++ struct squashfs_ldir_inode_header_2 *sinodep = &sid.ldir; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, (char *) ++ sinodep, block, offset, ++ sizeof(*sinodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_LDIR_INODE_HEADER_2(inodep, ++ sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) ++ inodep, block, offset, ++ sizeof(*inodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ i->i_size = inodep->file_size; ++ i->i_op = &squashfs_dir_inode_ops_2; ++ i->i_fop = &squashfs_dir_ops_2; ++ i->i_mode |= S_IFDIR; ++ i->i_mtime.tv_sec = inodep->mtime; ++ i->i_atime.tv_sec = inodep->mtime; ++ i->i_ctime.tv_sec = inodep->mtime; ++ SQUASHFS_I(i)->start_block = inodep->start_block; ++ SQUASHFS_I(i)->offset = inodep->offset; ++ SQUASHFS_I(i)->u.s2.directory_index_start = next_block; ++ SQUASHFS_I(i)->u.s2.directory_index_offset = ++ next_offset; ++ SQUASHFS_I(i)->u.s2.directory_index_count = ++ inodep->i_count; ++ SQUASHFS_I(i)->u.s2.parent_inode = 0; ++ ++ TRACE("Long directory inode %x:%x, start_block %x, " ++ "offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ inodep->start_block, inodep->offset); ++ break; ++ } ++ case SQUASHFS_SYMLINK_TYPE: { ++ struct squashfs_symlink_inode_header_2 *inodep = ++ &id.symlink; ++ struct squashfs_symlink_inode_header_2 *sinodep = ++ &sid.symlink; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, (char *) ++ sinodep, block, offset, ++ sizeof(*sinodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_SYMLINK_INODE_HEADER_2(inodep, ++ sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) ++ inodep, block, offset, ++ sizeof(*inodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ i->i_size = inodep->symlink_size; ++ i->i_op = &page_symlink_inode_operations; ++ i->i_data.a_ops = &squashfs_symlink_aops; ++ i->i_mode |= S_IFLNK; ++ SQUASHFS_I(i)->start_block = next_block; ++ SQUASHFS_I(i)->offset = next_offset; ++ ++ TRACE("Symbolic link inode %x:%x, start_block %llx, " ++ "offset %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ next_block, next_offset); ++ break; ++ } ++ case SQUASHFS_BLKDEV_TYPE: ++ case SQUASHFS_CHRDEV_TYPE: { ++ struct squashfs_dev_inode_header_2 *inodep = &id.dev; ++ struct squashfs_dev_inode_header_2 *sinodep = &sid.dev; ++ ++ if (msblk->swap) { ++ if (!squashfs_get_cached_block(s, (char *) ++ sinodep, block, offset, ++ sizeof(*sinodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ SQUASHFS_SWAP_DEV_INODE_HEADER_2(inodep, sinodep); ++ } else ++ if (!squashfs_get_cached_block(s, (char *) ++ inodep, block, offset, ++ sizeof(*inodep), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ i->i_mode |= (inodeb->inode_type == ++ SQUASHFS_CHRDEV_TYPE) ? S_IFCHR : ++ S_IFBLK; ++ init_special_inode(i, i->i_mode, ++ old_decode_dev(inodep->rdev)); ++ ++ TRACE("Device inode %x:%x, rdev %x\n", ++ SQUASHFS_INODE_BLK(inode), offset, ++ inodep->rdev); ++ break; ++ } ++ case SQUASHFS_FIFO_TYPE: ++ case SQUASHFS_SOCKET_TYPE: { ++ ++ i->i_mode |= (inodeb->inode_type == SQUASHFS_FIFO_TYPE) ++ ? S_IFIFO : S_IFSOCK; ++ init_special_inode(i, i->i_mode, 0); ++ break; ++ } ++ default: ++ ERROR("Unknown inode type %d in squashfs_iget!\n", ++ inodeb->inode_type); ++ goto failed_read1; ++ } ++ ++ return 1; ++ ++failed_read: ++ ERROR("Unable to read inode [%x:%x]\n", block, offset); ++ ++failed_read1: ++ return 0; ++} ++ ++ ++static int get_dir_index_using_offset(struct super_block *s, long long ++ *next_block, unsigned int *next_offset, ++ long long index_start, ++ unsigned int index_offset, int i_count, ++ long long f_pos) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ int i, length = 0; ++ struct squashfs_dir_index_2 index; ++ ++ TRACE("Entered get_dir_index_using_offset, i_count %d, f_pos %d\n", ++ i_count, (unsigned int) f_pos); ++ ++ if (f_pos == 0) ++ goto finish; ++ ++ for (i = 0; i < i_count; i++) { ++ if (msblk->swap) { ++ struct squashfs_dir_index_2 sindex; ++ squashfs_get_cached_block(s, (char *) &sindex, ++ index_start, index_offset, ++ sizeof(sindex), &index_start, ++ &index_offset); ++ SQUASHFS_SWAP_DIR_INDEX_2(&index, &sindex); ++ } else ++ squashfs_get_cached_block(s, (char *) &index, ++ index_start, index_offset, ++ sizeof(index), &index_start, ++ &index_offset); ++ ++ if (index.index > f_pos) ++ break; ++ ++ squashfs_get_cached_block(s, NULL, index_start, index_offset, ++ index.size + 1, &index_start, ++ &index_offset); ++ ++ length = index.index; ++ *next_block = index.start_block + sblk->directory_table_start; ++ } ++ ++ *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE; ++ ++finish: ++ return length; ++} ++ ++ ++static int get_dir_index_using_name(struct super_block *s, long long ++ *next_block, unsigned int *next_offset, ++ long long index_start, ++ unsigned int index_offset, int i_count, ++ const char *name, int size) ++{ ++ struct squashfs_sb_info *msblk = s->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ int i, length = 0; ++ struct squashfs_dir_index_2 *index; ++ char *str; ++ ++ TRACE("Entered get_dir_index_using_name, i_count %d\n", i_count); ++ ++ if (!(str = kmalloc(sizeof(struct squashfs_dir_index) + ++ (SQUASHFS_NAME_LEN + 1) * 2, GFP_KERNEL))) { ++ ERROR("Failed to allocate squashfs_dir_index\n"); ++ goto failure; ++ } ++ ++ index = (struct squashfs_dir_index_2 *) (str + SQUASHFS_NAME_LEN + 1); ++ strncpy(str, name, size); ++ str[size] = '\0'; ++ ++ for (i = 0; i < i_count; i++) { ++ if (msblk->swap) { ++ struct squashfs_dir_index_2 sindex; ++ squashfs_get_cached_block(s, (char *) &sindex, ++ index_start, index_offset, ++ sizeof(sindex), &index_start, ++ &index_offset); ++ SQUASHFS_SWAP_DIR_INDEX_2(index, &sindex); ++ } else ++ squashfs_get_cached_block(s, (char *) index, ++ index_start, index_offset, ++ sizeof(struct squashfs_dir_index_2), ++ &index_start, &index_offset); ++ ++ squashfs_get_cached_block(s, index->name, index_start, ++ index_offset, index->size + 1, ++ &index_start, &index_offset); ++ ++ index->name[index->size + 1] = '\0'; ++ ++ if (strcmp(index->name, str) > 0) ++ break; ++ ++ length = index->index; ++ *next_block = index->start_block + sblk->directory_table_start; ++ } ++ ++ *next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE; ++ kfree(str); ++failure: ++ return length; ++} ++ ++ ++static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir) ++{ ++ struct inode *i = file->f_dentry->d_inode; ++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ long long next_block = SQUASHFS_I(i)->start_block + ++ sblk->directory_table_start; ++ int next_offset = SQUASHFS_I(i)->offset, length = 0, ++ dir_count; ++ struct squashfs_dir_header_2 dirh; ++ struct squashfs_dir_entry_2 *dire; ++ ++ TRACE("Entered squashfs_readdir_2 [%llx:%x]\n", next_block, next_offset); ++ ++ if (!(dire = kmalloc(sizeof(struct squashfs_dir_entry) + ++ SQUASHFS_NAME_LEN + 1, GFP_KERNEL))) { ++ ERROR("Failed to allocate squashfs_dir_entry\n"); ++ goto finish; ++ } ++ ++ length = get_dir_index_using_offset(i->i_sb, &next_block, &next_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_start, ++ SQUASHFS_I(i)->u.s2.directory_index_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_count, ++ file->f_pos); ++ ++ while (length < i_size_read(i)) { ++ /* read directory header */ ++ if (msblk->swap) { ++ struct squashfs_dir_header_2 sdirh; ++ ++ if (!squashfs_get_cached_block(i->i_sb, (char *) &sdirh, ++ next_block, next_offset, sizeof(sdirh), ++ &next_block, &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdirh); ++ SQUASHFS_SWAP_DIR_HEADER_2(&dirh, &sdirh); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, (char *) &dirh, ++ next_block, next_offset, sizeof(dirh), ++ &next_block, &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(dirh); ++ } ++ ++ dir_count = dirh.count + 1; ++ while (dir_count--) { ++ if (msblk->swap) { ++ struct squashfs_dir_entry_2 sdire; ++ if (!squashfs_get_cached_block(i->i_sb, (char *) ++ &sdire, next_block, next_offset, ++ sizeof(sdire), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdire); ++ SQUASHFS_SWAP_DIR_ENTRY_2(dire, &sdire); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, (char *) ++ dire, next_block, next_offset, ++ sizeof(*dire), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(*dire); ++ } ++ ++ if (!squashfs_get_cached_block(i->i_sb, dire->name, ++ next_block, next_offset, ++ dire->size + 1, &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ length += dire->size + 1; ++ ++ if (file->f_pos >= length) ++ continue; ++ ++ dire->name[dire->size + 1] = '\0'; ++ ++ TRACE("Calling filldir(%x, %s, %d, %d, %x:%x, %d)\n", ++ (unsigned int) dirent, dire->name, ++ dire->size + 1, (int) file->f_pos, ++ dirh.start_block, dire->offset, ++ squashfs_filetype_table[dire->type]); ++ ++ if (filldir(dirent, dire->name, dire->size + 1, ++ file->f_pos, SQUASHFS_MK_VFS_INODE( ++ dirh.start_block, dire->offset), ++ squashfs_filetype_table[dire->type]) ++ < 0) { ++ TRACE("Filldir returned less than 0\n"); ++ goto finish; ++ } ++ file->f_pos = length; ++ } ++ } ++ ++finish: ++ kfree(dire); ++ return 0; ++ ++failed_read: ++ ERROR("Unable to read directory block [%llx:%x]\n", next_block, ++ next_offset); ++ kfree(dire); ++ return 0; ++} ++ ++ ++static struct dentry *squashfs_lookup_2(struct inode *i, struct dentry *dentry, ++ struct nameidata *nd) ++{ ++ const unsigned char *name = dentry->d_name.name; ++ int len = dentry->d_name.len; ++ struct inode *inode = NULL; ++ struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ long long next_block = SQUASHFS_I(i)->start_block + ++ sblk->directory_table_start; ++ int next_offset = SQUASHFS_I(i)->offset, length = 0, ++ dir_count; ++ struct squashfs_dir_header_2 dirh; ++ struct squashfs_dir_entry_2 *dire; ++ int sorted = sblk->s_major == 2 && sblk->s_minor >= 1; ++ ++ TRACE("Entered squashfs_lookup_2 [%llx:%x]\n", next_block, next_offset); ++ ++ if (!(dire = kmalloc(sizeof(struct squashfs_dir_entry) + ++ SQUASHFS_NAME_LEN + 1, GFP_KERNEL))) { ++ ERROR("Failed to allocate squashfs_dir_entry\n"); ++ goto exit_loop; ++ } ++ ++ if (len > SQUASHFS_NAME_LEN) ++ goto exit_loop; ++ ++ length = get_dir_index_using_name(i->i_sb, &next_block, &next_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_start, ++ SQUASHFS_I(i)->u.s2.directory_index_offset, ++ SQUASHFS_I(i)->u.s2.directory_index_count, name, ++ len); ++ ++ while (length < i_size_read(i)) { ++ /* read directory header */ ++ if (msblk->swap) { ++ struct squashfs_dir_header_2 sdirh; ++ if (!squashfs_get_cached_block(i->i_sb, (char *) &sdirh, ++ next_block, next_offset, sizeof(sdirh), ++ &next_block, &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdirh); ++ SQUASHFS_SWAP_DIR_HEADER_2(&dirh, &sdirh); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, (char *) &dirh, ++ next_block, next_offset, sizeof(dirh), ++ &next_block, &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(dirh); ++ } ++ ++ dir_count = dirh.count + 1; ++ while (dir_count--) { ++ if (msblk->swap) { ++ struct squashfs_dir_entry_2 sdire; ++ if (!squashfs_get_cached_block(i->i_sb, (char *) ++ &sdire, next_block,next_offset, ++ sizeof(sdire), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(sdire); ++ SQUASHFS_SWAP_DIR_ENTRY_2(dire, &sdire); ++ } else { ++ if (!squashfs_get_cached_block(i->i_sb, (char *) ++ dire, next_block,next_offset, ++ sizeof(*dire), &next_block, ++ &next_offset)) ++ goto failed_read; ++ ++ length += sizeof(*dire); ++ } ++ ++ if (!squashfs_get_cached_block(i->i_sb, dire->name, ++ next_block, next_offset, dire->size + 1, ++ &next_block, &next_offset)) ++ goto failed_read; ++ ++ length += dire->size + 1; ++ ++ if (sorted && name[0] < dire->name[0]) ++ goto exit_loop; ++ ++ if ((len == dire->size + 1) && !strncmp(name, ++ dire->name, len)) { ++ squashfs_inode_t ino = ++ SQUASHFS_MKINODE(dirh.start_block, ++ dire->offset); ++ unsigned int inode_number = SQUASHFS_MK_VFS_INODE(dirh.start_block, ++ dire->offset); ++ ++ TRACE("calling squashfs_iget for directory " ++ "entry %s, inode %x:%x, %lld\n", name, ++ dirh.start_block, dire->offset, ino); ++ ++ inode = squashfs_iget(i->i_sb, ino, inode_number); ++ ++ goto exit_loop; ++ } ++ } ++ } ++ ++exit_loop: ++ kfree(dire); ++ d_add(dentry, inode); ++ return ERR_PTR(0); ++ ++failed_read: ++ ERROR("Unable to read directory block [%llx:%x]\n", next_block, ++ next_offset); ++ goto exit_loop; ++} ++ ++ ++int squashfs_2_0_supported(struct squashfs_sb_info *msblk) ++{ ++ struct squashfs_super_block *sblk = &msblk->sblk; ++ ++ msblk->read_inode = squashfs_read_inode_2; ++ msblk->read_fragment_index_table = read_fragment_index_table_2; ++ ++ sblk->bytes_used = sblk->bytes_used_2; ++ sblk->uid_start = sblk->uid_start_2; ++ sblk->guid_start = sblk->guid_start_2; ++ sblk->inode_table_start = sblk->inode_table_start_2; ++ sblk->directory_table_start = sblk->directory_table_start_2; ++ sblk->fragment_table_start = sblk->fragment_table_start_2; ++ ++ return 1; ++} +diff -urN linux-2.6.23/fs/squashfs/uncomp.c linux-2.6.23.sqlzma-ng/fs/squashfs/uncomp.c +--- linux-2.6.23/fs/squashfs/uncomp.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/fs/squashfs/uncomp.c 2007-11-13 19:40:29.000000000 -0500 +@@ -0,0 +1,221 @@ ++/* ++ * Copyright (C) 2006, 2007 Junjiro Okajima ++ * Copyright (C) 2006, 2007 Tomas Matejicek, slax.org ++ * ++ * LICENSE follows the described one in lzma.txt. ++ */ ++ ++/* $Id: uncomp.c,v 1.1 2007/11/05 05:43:36 jro Exp $ */ ++ ++/* extract some parts from lzma443/C/7zip/Compress/LZMA_C/LzmaTest.c */ ++ ++#ifndef __KERNEL__ ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++#include <errno.h> ++#include <assert.h> ++#include <pthread.h> ++#define unlikely(x) __builtin_expect(!!(x), 0) ++#define BUG_ON(x) assert(!(x)) ++/* sqlzma buffers are always larger than a page. true? */ ++#define kmalloc(sz,gfp) malloc(sz) ++#define kfree(p) free(p) ++#define zlib_inflate(s, f) inflate(s, f) ++#define zlib_inflateInit(s) inflateInit(s) ++#define zlib_inflateReset(s) inflateReset(s) ++#define zlib_inflateEnd(s) inflateEnd(s) ++#else ++#include <linux/init.h> ++#include <linux/module.h> ++#include <linux/kernel.h> ++#include <linux/vmalloc.h> ++#ifndef WARN_ON_ONCE ++#define WARN_ON_ONCE(b) WARN_ON(b) ++#endif ++#endif /* __KERNEL__ */ ++ ++#include "sqlzma.h" ++#include "LzmaDecode.h" ++ ++static int LzmaUncompress(struct sqlzma_un *un) ++{ ++ int err, i, ret; ++ SizeT outSize, inProcessed, outProcessed, srclen; ++ /* it's about 24-80 bytes structure, if int is 32-bit */ ++ CLzmaDecoderState state; ++ unsigned char *dst, *src, a[8]; ++ struct sized_buf *sbuf; ++ ++ /* Decode LZMA properties and allocate memory */ ++ err = -EINVAL; ++ src = un->un_cmbuf; ++ ret = LzmaDecodeProperties(&state.Properties, src, LZMA_PROPERTIES_SIZE); ++ src += LZMA_PROPERTIES_SIZE; ++ if (unlikely(ret != LZMA_RESULT_OK)) ++ goto out; ++ i = LzmaGetNumProbs(&state.Properties); ++ if (unlikely(i <= 0)) ++ i = 1; ++ i *= sizeof(CProb); ++ sbuf = un->un_a + SQUN_PROB; ++ if (unlikely(sbuf->sz < i)) { ++ if (sbuf->buf && sbuf->buf != un->un_prob) ++ kfree(sbuf->buf); ++#ifdef __KERNEL__ ++ printk("%s:%d: %d --> %d\n", __func__, __LINE__, sbuf->sz, i); ++#else ++ printf("%d --> %d\n", sbuf->sz, i); ++#endif ++ err = -ENOMEM; ++ sbuf->sz = 0; ++ sbuf->buf = kmalloc(i, GFP_ATOMIC); ++ if (unlikely(!sbuf->buf)) ++ goto out; ++ sbuf->sz = i; ++ } ++ state.Probs = (void*)sbuf->buf; ++ ++ /* Read uncompressed size */ ++ memcpy(a, src, sizeof(a)); ++ src += sizeof(a); ++ outSize = a[0] | (a[1] << 8) | (a[2] << 16) | (a[3] << 24); ++ ++ err = -EINVAL; ++ dst = un->un_resbuf; ++ if (unlikely(!dst || outSize > un->un_reslen)) ++ goto out; ++ un->un_reslen = outSize; ++ srclen = un->un_cmlen - (src - un->un_cmbuf); ++ ++ /* Decompress */ ++ err = LzmaDecode(&state, src, srclen, &inProcessed, dst, outSize, ++ &outProcessed); ++ if (err) ++ err = -EINVAL; ++ ++ out: ++#ifndef __KERNEL__ ++ if (err) ++ fprintf(stderr, "err %d\n", err); ++#endif ++ return err; ++} ++ ++int sqlzma_un(struct sqlzma_un *un, struct sized_buf *src, ++ struct sized_buf *dst) ++{ ++ int err, by_lzma = 0; ++ if (un->un_lzma && is_lzma(*src->buf)) { ++ by_lzma = 1; ++ un->un_cmbuf = src->buf; ++ un->un_cmlen = src->sz; ++ un->un_resbuf = dst->buf; ++ un->un_reslen = dst->sz; ++ ++ /* this library is thread-safe */ ++ err = LzmaUncompress(un); ++ goto out; ++ } ++ ++ err = zlib_inflateReset(&un->un_stream); ++ if (unlikely(err != Z_OK)) ++ goto out; ++ un->un_stream.next_in = src->buf; ++ un->un_stream.avail_in = src->sz; ++ un->un_stream.next_out = dst->buf; ++ un->un_stream.avail_out = dst->sz; ++ err = zlib_inflate(&un->un_stream, Z_FINISH); ++ if (err == Z_STREAM_END) ++ err = 0; ++ ++ out: ++ if (err) { ++#ifdef __KERNEL__ ++ WARN_ON_ONCE(1); ++#else ++ char a[64] = "ZLIB "; ++ if (by_lzma) { ++ strcpy(a, "LZMA "); ++#ifdef _REENTRANT ++ strerror_r(err, a + 5, sizeof(a) - 5); ++#else ++ strncat(a, strerror(err), sizeof(a) - 5); ++#endif ++ } else ++ strncat(a, zError(err), sizeof(a) - 5); ++ fprintf(stderr, "%s: %.*s\n", __func__, sizeof(a), a); ++#endif ++ } ++ return err; ++} ++ ++int sqlzma_init(struct sqlzma_un *un, int do_lzma, unsigned int res_sz) ++{ ++ int err; ++ ++ err = -ENOMEM; ++ un->un_lzma = do_lzma; ++ memset(un->un_a, 0, sizeof(un->un_a)); ++ un->un_a[SQUN_PROB].buf = un->un_prob; ++ un->un_a[SQUN_PROB].sz = sizeof(un->un_prob); ++ if (res_sz) { ++ un->un_a[SQUN_RESULT].buf = kmalloc(res_sz, GFP_KERNEL); ++ if (unlikely(!un->un_a[SQUN_RESULT].buf)) ++ return err; ++ un->un_a[SQUN_RESULT].sz = res_sz; ++ } ++ ++ un->un_stream.next_in = NULL; ++ un->un_stream.avail_in = 0; ++#ifdef __KERNEL__ ++ un->un_stream.workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL); ++ if (unlikely(!un->un_stream.workspace)) ++ return err; ++#else ++ un->un_stream.opaque = NULL; ++ un->un_stream.zalloc = Z_NULL; ++ un->un_stream.zfree = Z_NULL; ++#endif ++ err = zlib_inflateInit(&un->un_stream); ++ if (unlikely(err == Z_MEM_ERROR)) ++ return -ENOMEM; ++ BUG_ON(err); ++ return err; ++} ++ ++void sqlzma_fin(struct sqlzma_un *un) ++{ ++ int i; ++ for (i = 0; i < SQUN_LAST; i++) ++ if (un->un_a[i].buf && un->un_a[i].buf != un->un_prob) ++ kfree(un->un_a[i].buf); ++ BUG_ON(zlib_inflateEnd(&un->un_stream) != Z_OK); ++} ++ ++#ifdef __KERNEL__ ++EXPORT_SYMBOL(sqlzma_un); ++EXPORT_SYMBOL(sqlzma_init); ++EXPORT_SYMBOL(sqlzma_fin); ++ ++#if 0 ++static int __init sqlzma_init(void) ++{ ++ return 0; ++} ++ ++static void __exit sqlzma_exit(void) ++{ ++} ++ ++module_init(sqlzma_init); ++module_exit(sqlzma_exit); ++#endif ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Junjiro Okajima <sfjro at users dot sf dot net>"); ++MODULE_VERSION("$Id: uncomp.c,v 1.1 2007/11/05 05:43:36 jro Exp $"); ++MODULE_DESCRIPTION("LZMA uncompress for squashfs. " ++ "Some functions for squashfs to support LZMA and " ++ "a tiny wrapper for LzmaDecode.c in LZMA SDK from www.7-zip.org."); ++#endif +diff -urN linux-2.6.23/include/linux/squashfs_fs.h linux-2.6.23.sqlzma-ng/include/linux/squashfs_fs.h +--- linux-2.6.23/include/linux/squashfs_fs.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/include/linux/squashfs_fs.h 2007-11-13 19:12:41.000000000 -0500 +@@ -0,0 +1,937 @@ ++#ifndef SQUASHFS_FS ++#define SQUASHFS_FS ++ ++/* ++ * Squashfs ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 ++ * Phillip Lougher <phillip@lougher.demon.co.uk> ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2, ++ * or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ * squashfs_fs.h ++ */ ++ ++#ifndef CONFIG_SQUASHFS_2_0_COMPATIBILITY ++#define CONFIG_SQUASHFS_2_0_COMPATIBILITY ++#endif ++ ++#define SQUASHFS_CACHED_FRAGMENTS CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE ++#define SQUASHFS_MAJOR 3 ++#define SQUASHFS_MINOR 1 ++#define SQUASHFS_MAGIC 0x73717368 ++#define SQUASHFS_MAGIC_SWAP 0x68737173 ++#define SQUASHFS_MAGIC_LZMA 0x71736873 ++#define SQUASHFS_MAGIC_LZMA_SWAP 0x73687371 ++#define SQUASHFS_START 0 ++ ++/* size of metadata (inode and directory) blocks */ ++#define SQUASHFS_METADATA_SIZE 8192 ++#define SQUASHFS_METADATA_LOG 13 ++ ++/* default size of data blocks */ ++#define SQUASHFS_FILE_SIZE 131072 ++#define SQUASHFS_FILE_LOG 17 ++ ++#define SQUASHFS_FILE_MAX_SIZE 1048576 ++ ++/* Max number of uids and gids */ ++#define SQUASHFS_UIDS 256 ++#define SQUASHFS_GUIDS 255 ++ ++/* Max length of filename (not 255) */ ++#define SQUASHFS_NAME_LEN 256 ++ ++#define SQUASHFS_INVALID ((long long) 0xffffffffffff) ++#define SQUASHFS_INVALID_FRAG ((unsigned int) 0xffffffff) ++#define SQUASHFS_INVALID_BLK ((long long) -1) ++#define SQUASHFS_USED_BLK ((long long) -2) ++ ++/* Filesystem flags */ ++#define SQUASHFS_NOI 0 ++#define SQUASHFS_NOD 1 ++#define SQUASHFS_CHECK 2 ++#define SQUASHFS_NOF 3 ++#define SQUASHFS_NO_FRAG 4 ++#define SQUASHFS_ALWAYS_FRAG 5 ++#define SQUASHFS_DUPLICATE 6 ++#define SQUASHFS_EXPORT 7 ++ ++#define SQUASHFS_BIT(flag, bit) ((flag >> bit) & 1) ++ ++#define SQUASHFS_UNCOMPRESSED_INODES(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_NOI) ++ ++#define SQUASHFS_UNCOMPRESSED_DATA(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_NOD) ++ ++#define SQUASHFS_UNCOMPRESSED_FRAGMENTS(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_NOF) ++ ++#define SQUASHFS_NO_FRAGMENTS(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_NO_FRAG) ++ ++#define SQUASHFS_ALWAYS_FRAGMENTS(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_ALWAYS_FRAG) ++ ++#define SQUASHFS_DUPLICATES(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_DUPLICATE) ++ ++#define SQUASHFS_EXPORTABLE(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_EXPORT) ++ ++#define SQUASHFS_CHECK_DATA(flags) SQUASHFS_BIT(flags, \ ++ SQUASHFS_CHECK) ++ ++#define SQUASHFS_MKFLAGS(noi, nod, check_data, nof, no_frag, always_frag, \ ++ duplicate_checking, exportable) (noi | (nod << 1) | (check_data << 2) \ ++ | (nof << 3) | (no_frag << 4) | (always_frag << 5) | \ ++ (duplicate_checking << 6) | (exportable << 7)) ++ ++/* Max number of types and file types */ ++#define SQUASHFS_DIR_TYPE 1 ++#define SQUASHFS_FILE_TYPE 2 ++#define SQUASHFS_SYMLINK_TYPE 3 ++#define SQUASHFS_BLKDEV_TYPE 4 ++#define SQUASHFS_CHRDEV_TYPE 5 ++#define SQUASHFS_FIFO_TYPE 6 ++#define SQUASHFS_SOCKET_TYPE 7 ++#define SQUASHFS_LDIR_TYPE 8 ++#define SQUASHFS_LREG_TYPE 9 ++ ++/* 1.0 filesystem type definitions */ ++#define SQUASHFS_TYPES 5 ++#define SQUASHFS_IPC_TYPE 0 ++ ++/* Flag whether block is compressed or uncompressed, bit is set if block is ++ * uncompressed */ ++#define SQUASHFS_COMPRESSED_BIT (1 << 15) ++ ++#define SQUASHFS_COMPRESSED_SIZE(B) (((B) & ~SQUASHFS_COMPRESSED_BIT) ? \ ++ (B) & ~SQUASHFS_COMPRESSED_BIT : SQUASHFS_COMPRESSED_BIT) ++ ++#define SQUASHFS_COMPRESSED(B) (!((B) & SQUASHFS_COMPRESSED_BIT)) ++ ++#define SQUASHFS_COMPRESSED_BIT_BLOCK (1 << 24) ++ ++#define SQUASHFS_COMPRESSED_SIZE_BLOCK(B) ((B) & \ ++ ~SQUASHFS_COMPRESSED_BIT_BLOCK) ++ ++#define SQUASHFS_COMPRESSED_BLOCK(B) (!((B) & SQUASHFS_COMPRESSED_BIT_BLOCK)) ++ ++/* ++ * Inode number ops. Inodes consist of a compressed block number, and an ++ * uncompressed offset within that block ++ */ ++#define SQUASHFS_INODE_BLK(a) ((unsigned int) ((a) >> 16)) ++ ++#define SQUASHFS_INODE_OFFSET(a) ((unsigned int) ((a) & 0xffff)) ++ ++#define SQUASHFS_MKINODE(A, B) ((squashfs_inode_t)(((squashfs_inode_t) (A)\ ++ << 16) + (B))) ++ ++/* Compute 32 bit VFS inode number from squashfs inode number */ ++#define SQUASHFS_MK_VFS_INODE(a, b) ((unsigned int) (((a) << 8) + \ ++ ((b) >> 2) + 1)) ++/* XXX */ ++ ++/* Translate between VFS mode and squashfs mode */ ++#define SQUASHFS_MODE(a) ((a) & 0xfff) ++ ++/* fragment and fragment table defines */ ++#define SQUASHFS_FRAGMENT_BYTES(A) ((A) * sizeof(struct squashfs_fragment_entry)) ++ ++#define SQUASHFS_FRAGMENT_INDEX(A) (SQUASHFS_FRAGMENT_BYTES(A) / \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_FRAGMENT_INDEX_OFFSET(A) (SQUASHFS_FRAGMENT_BYTES(A) % \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_FRAGMENT_INDEXES(A) ((SQUASHFS_FRAGMENT_BYTES(A) + \ ++ SQUASHFS_METADATA_SIZE - 1) / \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_FRAGMENT_INDEX_BYTES(A) (SQUASHFS_FRAGMENT_INDEXES(A) *\ ++ sizeof(long long)) ++ ++/* inode lookup table defines */ ++#define SQUASHFS_LOOKUP_BYTES(A) ((A) * sizeof(squashfs_inode_t)) ++ ++#define SQUASHFS_LOOKUP_BLOCK(A) (SQUASHFS_LOOKUP_BYTES(A) / \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_LOOKUP_BLOCK_OFFSET(A) (SQUASHFS_LOOKUP_BYTES(A) % \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_LOOKUP_BLOCKS(A) ((SQUASHFS_LOOKUP_BYTES(A) + \ ++ SQUASHFS_METADATA_SIZE - 1) / \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_LOOKUP_BLOCK_BYTES(A) (SQUASHFS_LOOKUP_BLOCKS(A) *\ ++ sizeof(long long)) ++ ++/* cached data constants for filesystem */ ++#define SQUASHFS_CACHED_BLKS 8 ++ ++#define SQUASHFS_MAX_FILE_SIZE_LOG 64 ++ ++#define SQUASHFS_MAX_FILE_SIZE ((long long) 1 << \ ++ (SQUASHFS_MAX_FILE_SIZE_LOG - 2)) ++ ++#define SQUASHFS_MARKER_BYTE 0xff ++ ++/* meta index cache */ ++#define SQUASHFS_META_INDEXES (SQUASHFS_METADATA_SIZE / sizeof(unsigned int)) ++#define SQUASHFS_META_ENTRIES 31 ++#define SQUASHFS_META_NUMBER 8 ++#define SQUASHFS_SLOTS 4 ++ ++struct meta_entry { ++ long long data_block; ++ unsigned int index_block; ++ unsigned short offset; ++ unsigned short pad; ++}; ++ ++struct meta_index { ++ unsigned int inode_number; ++ unsigned int offset; ++ unsigned short entries; ++ unsigned short skip; ++ unsigned short locked; ++ unsigned short pad; ++ struct meta_entry meta_entry[SQUASHFS_META_ENTRIES]; ++}; ++ ++ ++/* ++ * definitions for structures on disk ++ */ ++ ++typedef long long squashfs_block_t; ++typedef long long squashfs_inode_t; ++ ++struct squashfs_super_block { ++ unsigned int s_magic; ++ unsigned int inodes; ++ unsigned int bytes_used_2; ++ unsigned int uid_start_2; ++ unsigned int guid_start_2; ++ unsigned int inode_table_start_2; ++ unsigned int directory_table_start_2; ++ unsigned int s_major:16; ++ unsigned int s_minor:16; ++ unsigned int block_size_1:16; ++ unsigned int block_log:16; ++ unsigned int flags:8; ++ unsigned int no_uids:8; ++ unsigned int no_guids:8; ++ unsigned int mkfs_time /* time of filesystem creation */; ++ squashfs_inode_t root_inode; ++ unsigned int block_size; ++ unsigned int fragments; ++ unsigned int fragment_table_start_2; ++ long long bytes_used; ++ long long uid_start; ++ long long guid_start; ++ long long inode_table_start; ++ long long directory_table_start; ++ long long fragment_table_start; ++ long long lookup_table_start; ++} __attribute__ ((packed)); ++ ++struct squashfs_dir_index { ++ unsigned int index; ++ unsigned int start_block; ++ unsigned char size; ++ unsigned char name[0]; ++} __attribute__ ((packed)); ++ ++#define SQUASHFS_BASE_INODE_HEADER \ ++ unsigned int inode_type:4; \ ++ unsigned int mode:12; \ ++ unsigned int uid:8; \ ++ unsigned int guid:8; \ ++ unsigned int mtime; \ ++ unsigned int inode_number; ++ ++struct squashfs_base_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++} __attribute__ ((packed)); ++ ++struct squashfs_ipc_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ unsigned int nlink; ++} __attribute__ ((packed)); ++ ++struct squashfs_dev_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ unsigned int nlink; ++ unsigned short rdev; ++} __attribute__ ((packed)); ++ ++struct squashfs_symlink_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ unsigned int nlink; ++ unsigned short symlink_size; ++ char symlink[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_reg_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ squashfs_block_t start_block; ++ unsigned int fragment; ++ unsigned int offset; ++ unsigned int file_size; ++ unsigned short block_list[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_lreg_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ unsigned int nlink; ++ squashfs_block_t start_block; ++ unsigned int fragment; ++ unsigned int offset; ++ long long file_size; ++ unsigned short block_list[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_dir_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ unsigned int nlink; ++ unsigned int file_size:19; ++ unsigned int offset:13; ++ unsigned int start_block; ++ unsigned int parent_inode; ++} __attribute__ ((packed)); ++ ++struct squashfs_ldir_inode_header { ++ SQUASHFS_BASE_INODE_HEADER; ++ unsigned int nlink; ++ unsigned int file_size:27; ++ unsigned int offset:13; ++ unsigned int start_block; ++ unsigned int i_count:16; ++ unsigned int parent_inode; ++ struct squashfs_dir_index index[0]; ++} __attribute__ ((packed)); ++ ++union squashfs_inode_header { ++ struct squashfs_base_inode_header base; ++ struct squashfs_dev_inode_header dev; ++ struct squashfs_symlink_inode_header symlink; ++ struct squashfs_reg_inode_header reg; ++ struct squashfs_lreg_inode_header lreg; ++ struct squashfs_dir_inode_header dir; ++ struct squashfs_ldir_inode_header ldir; ++ struct squashfs_ipc_inode_header ipc; ++}; ++ ++struct squashfs_dir_entry { ++ unsigned int offset:13; ++ unsigned int type:3; ++ unsigned int size:8; ++ unsigned int inode_number:16; ++ char name[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_dir_header { ++ unsigned int count:8; ++ unsigned int start_block; ++ unsigned int inode_number; ++} __attribute__ ((packed)); ++ ++struct squashfs_fragment_entry { ++ long long start_block; ++ unsigned int size; ++ unsigned int pending; ++} __attribute__ ((packed)); ++ ++extern int squashfs_uncompress_block(void *d, int dstlen, void *s, int srclen); ++extern int squashfs_uncompress_init(void); ++extern int squashfs_uncompress_exit(void); ++ ++/* ++ * macros to convert each packed bitfield structure from little endian to big ++ * endian and vice versa. These are needed when creating or using a filesystem ++ * on a machine with different byte ordering to the target architecture. ++ * ++ */ ++ ++#define SQUASHFS_SWAP_START \ ++ int bits;\ ++ int b_pos;\ ++ unsigned long long val;\ ++ unsigned char *s;\ ++ unsigned char *d; ++ ++#define SQUASHFS_SWAP_SUPER_BLOCK(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_super_block));\ ++ SQUASHFS_SWAP((s)->s_magic, d, 0, 32);\ ++ SQUASHFS_SWAP((s)->inodes, d, 32, 32);\ ++ SQUASHFS_SWAP((s)->bytes_used_2, d, 64, 32);\ ++ SQUASHFS_SWAP((s)->uid_start_2, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->guid_start_2, d, 128, 32);\ ++ SQUASHFS_SWAP((s)->inode_table_start_2, d, 160, 32);\ ++ SQUASHFS_SWAP((s)->directory_table_start_2, d, 192, 32);\ ++ SQUASHFS_SWAP((s)->s_major, d, 224, 16);\ ++ SQUASHFS_SWAP((s)->s_minor, d, 240, 16);\ ++ SQUASHFS_SWAP((s)->block_size_1, d, 256, 16);\ ++ SQUASHFS_SWAP((s)->block_log, d, 272, 16);\ ++ SQUASHFS_SWAP((s)->flags, d, 288, 8);\ ++ SQUASHFS_SWAP((s)->no_uids, d, 296, 8);\ ++ SQUASHFS_SWAP((s)->no_guids, d, 304, 8);\ ++ SQUASHFS_SWAP((s)->mkfs_time, d, 312, 32);\ ++ SQUASHFS_SWAP((s)->root_inode, d, 344, 64);\ ++ SQUASHFS_SWAP((s)->block_size, d, 408, 32);\ ++ SQUASHFS_SWAP((s)->fragments, d, 440, 32);\ ++ SQUASHFS_SWAP((s)->fragment_table_start_2, d, 472, 32);\ ++ SQUASHFS_SWAP((s)->bytes_used, d, 504, 64);\ ++ SQUASHFS_SWAP((s)->uid_start, d, 568, 64);\ ++ SQUASHFS_SWAP((s)->guid_start, d, 632, 64);\ ++ SQUASHFS_SWAP((s)->inode_table_start, d, 696, 64);\ ++ SQUASHFS_SWAP((s)->directory_table_start, d, 760, 64);\ ++ SQUASHFS_SWAP((s)->fragment_table_start, d, 824, 64);\ ++ SQUASHFS_SWAP((s)->lookup_table_start, d, 888, 64);\ ++} ++ ++#define SQUASHFS_SWAP_BASE_INODE_CORE(s, d, n)\ ++ SQUASHFS_MEMSET(s, d, n);\ ++ SQUASHFS_SWAP((s)->inode_type, d, 0, 4);\ ++ SQUASHFS_SWAP((s)->mode, d, 4, 12);\ ++ SQUASHFS_SWAP((s)->uid, d, 16, 8);\ ++ SQUASHFS_SWAP((s)->guid, d, 24, 8);\ ++ SQUASHFS_SWAP((s)->mtime, d, 32, 32);\ ++ SQUASHFS_SWAP((s)->inode_number, d, 64, 32); ++ ++#define SQUASHFS_SWAP_BASE_INODE_HEADER(s, d, n) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, n)\ ++} ++ ++#define SQUASHFS_SWAP_IPC_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_ipc_inode_header))\ ++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\ ++} ++ ++#define SQUASHFS_SWAP_DEV_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_dev_inode_header)); \ ++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->rdev, d, 128, 16);\ ++} ++ ++#define SQUASHFS_SWAP_SYMLINK_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_symlink_inode_header));\ ++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->symlink_size, d, 128, 16);\ ++} ++ ++#define SQUASHFS_SWAP_REG_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_reg_inode_header));\ ++ SQUASHFS_SWAP((s)->start_block, d, 96, 64);\ ++ SQUASHFS_SWAP((s)->fragment, d, 160, 32);\ ++ SQUASHFS_SWAP((s)->offset, d, 192, 32);\ ++ SQUASHFS_SWAP((s)->file_size, d, 224, 32);\ ++} ++ ++#define SQUASHFS_SWAP_LREG_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_lreg_inode_header));\ ++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 128, 64);\ ++ SQUASHFS_SWAP((s)->fragment, d, 192, 32);\ ++ SQUASHFS_SWAP((s)->offset, d, 224, 32);\ ++ SQUASHFS_SWAP((s)->file_size, d, 256, 64);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_dir_inode_header));\ ++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->file_size, d, 128, 19);\ ++ SQUASHFS_SWAP((s)->offset, d, 147, 13);\ ++ SQUASHFS_SWAP((s)->start_block, d, 160, 32);\ ++ SQUASHFS_SWAP((s)->parent_inode, d, 192, 32);\ ++} ++ ++#define SQUASHFS_SWAP_LDIR_INODE_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE(s, d, \ ++ sizeof(struct squashfs_ldir_inode_header));\ ++ SQUASHFS_SWAP((s)->nlink, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->file_size, d, 128, 27);\ ++ SQUASHFS_SWAP((s)->offset, d, 155, 13);\ ++ SQUASHFS_SWAP((s)->start_block, d, 168, 32);\ ++ SQUASHFS_SWAP((s)->i_count, d, 200, 16);\ ++ SQUASHFS_SWAP((s)->parent_inode, d, 216, 32);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_INDEX(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_index));\ ++ SQUASHFS_SWAP((s)->index, d, 0, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 32, 32);\ ++ SQUASHFS_SWAP((s)->size, d, 64, 8);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_HEADER(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_header));\ ++ SQUASHFS_SWAP((s)->count, d, 0, 8);\ ++ SQUASHFS_SWAP((s)->start_block, d, 8, 32);\ ++ SQUASHFS_SWAP((s)->inode_number, d, 40, 32);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_ENTRY(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_entry));\ ++ SQUASHFS_SWAP((s)->offset, d, 0, 13);\ ++ SQUASHFS_SWAP((s)->type, d, 13, 3);\ ++ SQUASHFS_SWAP((s)->size, d, 16, 8);\ ++ SQUASHFS_SWAP((s)->inode_number, d, 24, 16);\ ++} ++ ++#define SQUASHFS_SWAP_FRAGMENT_ENTRY(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_fragment_entry));\ ++ SQUASHFS_SWAP((s)->start_block, d, 0, 64);\ ++ SQUASHFS_SWAP((s)->size, d, 64, 32);\ ++} ++ ++#define SQUASHFS_SWAP_INODE_T(s, d) SQUASHFS_SWAP_LONG_LONGS(s, d, 1) ++ ++#define SQUASHFS_SWAP_SHORTS(s, d, n) {\ ++ int entry;\ ++ int bit_position;\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, n * 2);\ ++ for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += \ ++ 16)\ ++ SQUASHFS_SWAP(s[entry], d, bit_position, 16);\ ++} ++ ++#define SQUASHFS_SWAP_INTS(s, d, n) {\ ++ int entry;\ ++ int bit_position;\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, n * 4);\ ++ for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += \ ++ 32)\ ++ SQUASHFS_SWAP(s[entry], d, bit_position, 32);\ ++} ++ ++#define SQUASHFS_SWAP_LONG_LONGS(s, d, n) {\ ++ int entry;\ ++ int bit_position;\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, n * 8);\ ++ for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += \ ++ 64)\ ++ SQUASHFS_SWAP(s[entry], d, bit_position, 64);\ ++} ++ ++#define SQUASHFS_SWAP_DATA(s, d, n, bits) {\ ++ int entry;\ ++ int bit_position;\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, n * bits / 8);\ ++ for(entry = 0, bit_position = 0; entry < n; entry++, bit_position += \ ++ bits)\ ++ SQUASHFS_SWAP(s[entry], d, bit_position, bits);\ ++} ++ ++#define SQUASHFS_SWAP_FRAGMENT_INDEXES(s, d, n) SQUASHFS_SWAP_LONG_LONGS(s, d, n) ++#define SQUASHFS_SWAP_LOOKUP_BLOCKS(s, d, n) SQUASHFS_SWAP_LONG_LONGS(s, d, n) ++ ++#ifdef CONFIG_SQUASHFS_1_0_COMPATIBILITY ++ ++struct squashfs_base_inode_header_1 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:4; /* index into uid table */ ++ unsigned int guid:4; /* index into guid table */ ++} __attribute__ ((packed)); ++ ++struct squashfs_ipc_inode_header_1 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:4; /* index into uid table */ ++ unsigned int guid:4; /* index into guid table */ ++ unsigned int type:4; ++ unsigned int offset:4; ++} __attribute__ ((packed)); ++ ++struct squashfs_dev_inode_header_1 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:4; /* index into uid table */ ++ unsigned int guid:4; /* index into guid table */ ++ unsigned short rdev; ++} __attribute__ ((packed)); ++ ++struct squashfs_symlink_inode_header_1 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:4; /* index into uid table */ ++ unsigned int guid:4; /* index into guid table */ ++ unsigned short symlink_size; ++ char symlink[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_reg_inode_header_1 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:4; /* index into uid table */ ++ unsigned int guid:4; /* index into guid table */ ++ unsigned int mtime; ++ unsigned int start_block; ++ unsigned int file_size:32; ++ unsigned short block_list[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_dir_inode_header_1 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:4; /* index into uid table */ ++ unsigned int guid:4; /* index into guid table */ ++ unsigned int file_size:19; ++ unsigned int offset:13; ++ unsigned int mtime; ++ unsigned int start_block:24; ++} __attribute__ ((packed)); ++ ++union squashfs_inode_header_1 { ++ struct squashfs_base_inode_header_1 base; ++ struct squashfs_dev_inode_header_1 dev; ++ struct squashfs_symlink_inode_header_1 symlink; ++ struct squashfs_reg_inode_header_1 reg; ++ struct squashfs_dir_inode_header_1 dir; ++ struct squashfs_ipc_inode_header_1 ipc; ++}; ++ ++#define SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, n) \ ++ SQUASHFS_MEMSET(s, d, n);\ ++ SQUASHFS_SWAP((s)->inode_type, d, 0, 4);\ ++ SQUASHFS_SWAP((s)->mode, d, 4, 12);\ ++ SQUASHFS_SWAP((s)->uid, d, 16, 4);\ ++ SQUASHFS_SWAP((s)->guid, d, 20, 4); ++ ++#define SQUASHFS_SWAP_BASE_INODE_HEADER_1(s, d, n) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, n)\ ++} ++ ++#define SQUASHFS_SWAP_IPC_INODE_HEADER_1(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \ ++ sizeof(struct squashfs_ipc_inode_header_1));\ ++ SQUASHFS_SWAP((s)->type, d, 24, 4);\ ++ SQUASHFS_SWAP((s)->offset, d, 28, 4);\ ++} ++ ++#define SQUASHFS_SWAP_DEV_INODE_HEADER_1(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \ ++ sizeof(struct squashfs_dev_inode_header_1));\ ++ SQUASHFS_SWAP((s)->rdev, d, 24, 16);\ ++} ++ ++#define SQUASHFS_SWAP_SYMLINK_INODE_HEADER_1(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \ ++ sizeof(struct squashfs_symlink_inode_header_1));\ ++ SQUASHFS_SWAP((s)->symlink_size, d, 24, 16);\ ++} ++ ++#define SQUASHFS_SWAP_REG_INODE_HEADER_1(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \ ++ sizeof(struct squashfs_reg_inode_header_1));\ ++ SQUASHFS_SWAP((s)->mtime, d, 24, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 56, 32);\ ++ SQUASHFS_SWAP((s)->file_size, d, 88, 32);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_INODE_HEADER_1(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_1(s, d, \ ++ sizeof(struct squashfs_dir_inode_header_1));\ ++ SQUASHFS_SWAP((s)->file_size, d, 24, 19);\ ++ SQUASHFS_SWAP((s)->offset, d, 43, 13);\ ++ SQUASHFS_SWAP((s)->mtime, d, 56, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 88, 24);\ ++} ++ ++#endif ++ ++#ifdef CONFIG_SQUASHFS_2_0_COMPATIBILITY ++ ++struct squashfs_dir_index_2 { ++ unsigned int index:27; ++ unsigned int start_block:29; ++ unsigned char size; ++ unsigned char name[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_base_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++} __attribute__ ((packed)); ++ ++struct squashfs_ipc_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++} __attribute__ ((packed)); ++ ++struct squashfs_dev_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++ unsigned short rdev; ++} __attribute__ ((packed)); ++ ++struct squashfs_symlink_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++ unsigned short symlink_size; ++ char symlink[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_reg_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++ unsigned int mtime; ++ unsigned int start_block; ++ unsigned int fragment; ++ unsigned int offset; ++ unsigned int file_size:32; ++ unsigned short block_list[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_dir_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++ unsigned int file_size:19; ++ unsigned int offset:13; ++ unsigned int mtime; ++ unsigned int start_block:24; ++} __attribute__ ((packed)); ++ ++struct squashfs_ldir_inode_header_2 { ++ unsigned int inode_type:4; ++ unsigned int mode:12; /* protection */ ++ unsigned int uid:8; /* index into uid table */ ++ unsigned int guid:8; /* index into guid table */ ++ unsigned int file_size:27; ++ unsigned int offset:13; ++ unsigned int mtime; ++ unsigned int start_block:24; ++ unsigned int i_count:16; ++ struct squashfs_dir_index_2 index[0]; ++} __attribute__ ((packed)); ++ ++union squashfs_inode_header_2 { ++ struct squashfs_base_inode_header_2 base; ++ struct squashfs_dev_inode_header_2 dev; ++ struct squashfs_symlink_inode_header_2 symlink; ++ struct squashfs_reg_inode_header_2 reg; ++ struct squashfs_dir_inode_header_2 dir; ++ struct squashfs_ldir_inode_header_2 ldir; ++ struct squashfs_ipc_inode_header_2 ipc; ++}; ++ ++struct squashfs_dir_header_2 { ++ unsigned int count:8; ++ unsigned int start_block:24; ++} __attribute__ ((packed)); ++ ++struct squashfs_dir_entry_2 { ++ unsigned int offset:13; ++ unsigned int type:3; ++ unsigned int size:8; ++ char name[0]; ++} __attribute__ ((packed)); ++ ++struct squashfs_fragment_entry_2 { ++ unsigned int start_block; ++ unsigned int size; ++} __attribute__ ((packed)); ++ ++#define SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, n)\ ++ SQUASHFS_MEMSET(s, d, n);\ ++ SQUASHFS_SWAP((s)->inode_type, d, 0, 4);\ ++ SQUASHFS_SWAP((s)->mode, d, 4, 12);\ ++ SQUASHFS_SWAP((s)->uid, d, 16, 8);\ ++ SQUASHFS_SWAP((s)->guid, d, 24, 8);\ ++ ++#define SQUASHFS_SWAP_BASE_INODE_HEADER_2(s, d, n) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, n)\ ++} ++ ++#define SQUASHFS_SWAP_IPC_INODE_HEADER_2(s, d) \ ++ SQUASHFS_SWAP_BASE_INODE_HEADER_2(s, d, sizeof(struct squashfs_ipc_inode_header_2)) ++ ++#define SQUASHFS_SWAP_DEV_INODE_HEADER_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \ ++ sizeof(struct squashfs_dev_inode_header_2)); \ ++ SQUASHFS_SWAP((s)->rdev, d, 32, 16);\ ++} ++ ++#define SQUASHFS_SWAP_SYMLINK_INODE_HEADER_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \ ++ sizeof(struct squashfs_symlink_inode_header_2));\ ++ SQUASHFS_SWAP((s)->symlink_size, d, 32, 16);\ ++} ++ ++#define SQUASHFS_SWAP_REG_INODE_HEADER_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \ ++ sizeof(struct squashfs_reg_inode_header_2));\ ++ SQUASHFS_SWAP((s)->mtime, d, 32, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 64, 32);\ ++ SQUASHFS_SWAP((s)->fragment, d, 96, 32);\ ++ SQUASHFS_SWAP((s)->offset, d, 128, 32);\ ++ SQUASHFS_SWAP((s)->file_size, d, 160, 32);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_INODE_HEADER_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \ ++ sizeof(struct squashfs_dir_inode_header_2));\ ++ SQUASHFS_SWAP((s)->file_size, d, 32, 19);\ ++ SQUASHFS_SWAP((s)->offset, d, 51, 13);\ ++ SQUASHFS_SWAP((s)->mtime, d, 64, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 96, 24);\ ++} ++ ++#define SQUASHFS_SWAP_LDIR_INODE_HEADER_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_SWAP_BASE_INODE_CORE_2(s, d, \ ++ sizeof(struct squashfs_ldir_inode_header_2));\ ++ SQUASHFS_SWAP((s)->file_size, d, 32, 27);\ ++ SQUASHFS_SWAP((s)->offset, d, 59, 13);\ ++ SQUASHFS_SWAP((s)->mtime, d, 72, 32);\ ++ SQUASHFS_SWAP((s)->start_block, d, 104, 24);\ ++ SQUASHFS_SWAP((s)->i_count, d, 128, 16);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_INDEX_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_index_2));\ ++ SQUASHFS_SWAP((s)->index, d, 0, 27);\ ++ SQUASHFS_SWAP((s)->start_block, d, 27, 29);\ ++ SQUASHFS_SWAP((s)->size, d, 56, 8);\ ++} ++#define SQUASHFS_SWAP_DIR_HEADER_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_header_2));\ ++ SQUASHFS_SWAP((s)->count, d, 0, 8);\ ++ SQUASHFS_SWAP((s)->start_block, d, 8, 24);\ ++} ++ ++#define SQUASHFS_SWAP_DIR_ENTRY_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_dir_entry_2));\ ++ SQUASHFS_SWAP((s)->offset, d, 0, 13);\ ++ SQUASHFS_SWAP((s)->type, d, 13, 3);\ ++ SQUASHFS_SWAP((s)->size, d, 16, 8);\ ++} ++ ++#define SQUASHFS_SWAP_FRAGMENT_ENTRY_2(s, d) {\ ++ SQUASHFS_SWAP_START\ ++ SQUASHFS_MEMSET(s, d, sizeof(struct squashfs_fragment_entry_2));\ ++ SQUASHFS_SWAP((s)->start_block, d, 0, 32);\ ++ SQUASHFS_SWAP((s)->size, d, 32, 32);\ ++} ++ ++#define SQUASHFS_SWAP_FRAGMENT_INDEXES_2(s, d, n) SQUASHFS_SWAP_INTS(s, d, n) ++ ++/* fragment and fragment table defines */ ++#define SQUASHFS_FRAGMENT_BYTES_2(A) (A * sizeof(struct squashfs_fragment_entry_2)) ++ ++#define SQUASHFS_FRAGMENT_INDEX_2(A) (SQUASHFS_FRAGMENT_BYTES_2(A) / \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_FRAGMENT_INDEX_OFFSET_2(A) (SQUASHFS_FRAGMENT_BYTES_2(A) % \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_FRAGMENT_INDEXES_2(A) ((SQUASHFS_FRAGMENT_BYTES_2(A) + \ ++ SQUASHFS_METADATA_SIZE - 1) / \ ++ SQUASHFS_METADATA_SIZE) ++ ++#define SQUASHFS_FRAGMENT_INDEX_BYTES_2(A) (SQUASHFS_FRAGMENT_INDEXES_2(A) *\ ++ sizeof(int)) ++ ++#endif ++ ++#ifdef __KERNEL__ ++ ++/* ++ * macros used to swap each structure entry, taking into account ++ * bitfields and different bitfield placing conventions on differing ++ * architectures ++ */ ++ ++#include <asm/byteorder.h> ++ ++#ifdef __BIG_ENDIAN ++ /* convert from little endian to big endian */ ++#define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, \ ++ tbits, b_pos) ++#else ++ /* convert from big endian to little endian */ ++#define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, \ ++ tbits, 64 - tbits - b_pos) ++#endif ++ ++#define _SQUASHFS_SWAP(value, p, pos, tbits, SHIFT) {\ ++ b_pos = pos % 8;\ ++ val = 0;\ ++ s = (unsigned char *)p + (pos / 8);\ ++ d = ((unsigned char *) &val) + 7;\ ++ for(bits = 0; bits < (tbits + b_pos); bits += 8) \ ++ *d-- = *s++;\ ++ value = (val >> (SHIFT))/* & ((1 << tbits) - 1)*/;\ ++} ++ ++#define SQUASHFS_MEMSET(s, d, n) memset(s, 0, n); ++ ++#endif ++#endif +diff -urN linux-2.6.23/include/linux/squashfs_fs_i.h linux-2.6.23.sqlzma-ng/include/linux/squashfs_fs_i.h +--- linux-2.6.23/include/linux/squashfs_fs_i.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/include/linux/squashfs_fs_i.h 2007-11-13 18:58:41.000000000 -0500 +@@ -0,0 +1,45 @@ ++#ifndef SQUASHFS_FS_I ++#define SQUASHFS_FS_I ++/* ++ * Squashfs ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 ++ * Phillip Lougher <phillip@lougher.demon.co.uk> ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2, ++ * or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ * squashfs_fs_i.h ++ */ ++ ++struct squashfs_inode_info { ++ long long start_block; ++ unsigned int offset; ++ union { ++ struct { ++ long long fragment_start_block; ++ unsigned int fragment_size; ++ unsigned int fragment_offset; ++ long long block_list_start; ++ } s1; ++ struct { ++ long long directory_index_start; ++ unsigned int directory_index_offset; ++ unsigned int directory_index_count; ++ unsigned int parent_inode; ++ } s2; ++ } u; ++ struct inode vfs_inode; ++}; ++#endif +diff -urN linux-2.6.23/include/linux/squashfs_fs_sb.h linux-2.6.23.sqlzma-ng/include/linux/squashfs_fs_sb.h +--- linux-2.6.23/include/linux/squashfs_fs_sb.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.23.sqlzma-ng/include/linux/squashfs_fs_sb.h 2007-11-13 19:19:28.000000000 -0500 +@@ -0,0 +1,76 @@ ++#ifndef SQUASHFS_FS_SB ++#define SQUASHFS_FS_SB ++/* ++ * Squashfs ++ * ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 ++ * Phillip Lougher <phillip@lougher.demon.co.uk> ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2, ++ * or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ * squashfs_fs_sb.h ++ */ ++ ++#include <linux/squashfs_fs.h> ++ ++struct squashfs_cache { ++ long long block; ++ int length; ++ long long next_index; ++ char *data; ++}; ++ ++struct squashfs_fragment_cache { ++ long long block; ++ int length; ++ unsigned int locked; ++ char *data; ++}; ++ ++struct squashfs_sb_info { ++ struct squashfs_super_block sblk; ++ int devblksize; ++ int devblksize_log2; ++ int swap; ++ struct squashfs_cache *block_cache; ++ struct squashfs_fragment_cache *fragment; ++ int next_cache; ++ int next_fragment; ++ int next_meta_index; ++ unsigned int *uid; ++ unsigned int *guid; ++ long long *fragment_index; ++ unsigned int *fragment_index_2; ++ char *read_page; ++ //struct mutex read_data_mutex; ++ struct mutex read_page_mutex; ++ struct mutex block_cache_mutex; ++ struct mutex fragment_mutex; ++ struct mutex meta_index_mutex; ++ wait_queue_head_t waitq; ++ wait_queue_head_t fragment_wait_queue; ++ struct meta_index *meta_index; ++ //z_stream stream; ++ long long *inode_lookup_table; ++ int unused_cache_blks; ++ int unused_frag_blks; ++ int (*read_inode)(struct inode *i, squashfs_inode_t \ ++ inode); ++ long long (*read_blocklist)(struct inode *inode, int \ ++ index, int readahead_blks, char *block_list, \ ++ unsigned short **block_p, unsigned int *bsize); ++ int (*read_fragment_index_table)(struct super_block *s); ++}; ++#endif + diff --git a/packages/linux/linux-openmoko-devel/0002-squashfs-initrd.patch b/packages/linux/linux-openmoko-devel/0002-squashfs-initrd.patch new file mode 100644 index 0000000000..cd2c678058 --- /dev/null +++ b/packages/linux/linux-openmoko-devel/0002-squashfs-initrd.patch @@ -0,0 +1,55 @@ +diff -urN linux-2.6.23/init/do_mounts_rd.c linux-2.6.23.sqlzma-ng/init/do_mounts_rd.c +--- linux-2.6.23/init/do_mounts_rd.c 2007-10-09 16:31:38.000000000 -0400 ++++ linux-2.6.23.sqlzma-ng/init/do_mounts_rd.c 2007-11-13 18:58:41.000000000 -0500 +@@ -5,6 +5,7 @@ + #include <linux/ext2_fs.h> + #include <linux/romfs_fs.h> + #include <linux/cramfs_fs.h> ++#include <linux/squashfs_fs.h> + #include <linux/initrd.h> + #include <linux/string.h> + +@@ -39,6 +40,7 @@ + * numbers could not be found. + * + * We currently check for the following magic numbers: ++ * squashfs + * minix + * ext2 + * romfs +@@ -53,6 +55,7 @@ + struct ext2_super_block *ext2sb; + struct romfs_super_block *romfsb; + struct cramfs_super *cramfsb; ++ struct squashfs_super_block *squashfsb; + int nblocks = -1; + unsigned char *buf; + +@@ -64,6 +67,7 @@ + ext2sb = (struct ext2_super_block *) buf; + romfsb = (struct romfs_super_block *) buf; + cramfsb = (struct cramfs_super *) buf; ++ squashfsb = (struct squashfs_super_block *) buf; + memset(buf, 0xe5, size); + + /* +@@ -101,6 +105,18 @@ + goto done; + } + ++ /* squashfs is at block zero too */ ++ if (squashfsb->s_magic == SQUASHFS_MAGIC) { ++ printk(KERN_NOTICE ++ "RAMDISK: squashfs filesystem found at block %d\n", ++ start_block); ++ if (squashfsb->s_major < 3) ++ nblocks = (squashfsb->bytes_used_2+BLOCK_SIZE-1)>>BLOCK_SIZE_BITS; ++ else ++ nblocks = (squashfsb->bytes_used+BLOCK_SIZE-1)>>BLOCK_SIZE_BITS; ++ goto done; ++ } ++ + /* + * Read block 1 to test for minix and ext2 superblock + */ + diff --git a/packages/linux/linux-openmoko-devel/0003-squashfs-force-O2.patch b/packages/linux/linux-openmoko-devel/0003-squashfs-force-O2.patch new file mode 100644 index 0000000000..550077b9fa --- /dev/null +++ b/packages/linux/linux-openmoko-devel/0003-squashfs-force-O2.patch @@ -0,0 +1,17 @@ +The kernel patch from the squashfs-3.1r2 release did not compile on my +armeb-linux-gcc 4.1.1 when optimizing for size (-Os). This works around +that problem by using optimization flag -O2 instead for these two files. + +Signed-off-by: Leon Woestenberg <leonw@mailcan.com> + +Index: linux-2.6.19/fs/squashfs/Makefile +=================================================================== +--- linux-2.6.19.orig/fs/squashfs/Makefile ++++ linux-2.6.19/fs/squashfs/Makefile +@@ -5,3 +5,6 @@ + obj-$(CONFIG_SQUASHFS) += squashfs.o + squashfs-y += inode.o + squashfs-y += squashfs2_0.o ++ ++CFLAGS_squashfs2_0.o = "-O2" ++CFLAGS_inode.o = "-O2" diff --git a/packages/linux/linux-openmoko-devel/0004-squashfs-Kconfig.patch b/packages/linux/linux-openmoko-devel/0004-squashfs-Kconfig.patch new file mode 100644 index 0000000000..f2b3db9942 --- /dev/null +++ b/packages/linux/linux-openmoko-devel/0004-squashfs-Kconfig.patch @@ -0,0 +1,61 @@ +diff -urN linux-2.6.23/fs/Kconfig linux-2.6.23.sqlzma-ng/fs/Kconfig +--- linux-2.6.23/fs/Kconfig 2007-10-09 16:31:38.000000000 -0400 ++++ linux-2.6.23.sqlzma-ng/fs/Kconfig 2007-11-13 18:58:41.000000000 -0500 +@@ -1364,6 +1364,56 @@ + + If unsure, say N. + ++config SQUASHFS ++ tristate "SquashFS 3.3 - Squashed file system support" ++ select ZLIB_INFLATE ++ help ++ Saying Y here includes support for SquashFS 3.3 (a Compressed ++ Read-Only File System). Squashfs is a highly compressed read-only ++ filesystem for Linux. It uses zlib compression to compress both ++ files, inodes and directories. Inodes in the system are very small ++ and all blocks are packed to minimise data overhead. Block sizes ++ greater than 4K are supported up to a maximum of 1 Mbytes (default ++ block size 128K). SquashFS 3.3 supports 64 bit filesystems and files ++ (larger than 4GB), full uid/gid information, hard links and timestamps. ++ ++ Squashfs is intended for general read-only filesystem use, for ++ archival use (i.e. in cases where a .tar.gz file may be used), and in ++ embedded systems where low overhead is needed. Further information ++ and filesystem tools are available from http://squashfs.sourceforge.net. ++ ++ If you want to compile this as a module ( = code which can be ++ inserted in and removed from the running kernel whenever you want), ++ say M here and read <file:Documentation/modules.txt>. The module ++ will be called squashfs. Note that the root file system (the one ++ containing the directory /) cannot be compiled as a module. ++ ++ If unsure, say N. ++ ++config SQUASHFS_EMBEDDED ++ ++ bool "Additional option for memory-constrained systems" ++ depends on SQUASHFS ++ default n ++ help ++ Saying Y here allows you to specify cache size. ++ ++ If unsure, say N. ++ ++config SQUASHFS_FRAGMENT_CACHE_SIZE ++ int "Number of fragments cached" if SQUASHFS_EMBEDDED ++ depends on SQUASHFS ++ default "3" ++ help ++ By default SquashFS caches the last 3 fragments read from ++ the filesystem. Increasing this amount may mean SquashFS ++ has to re-read fragments less often from disk, at the expense ++ of extra system memory. Decreasing this amount will mean ++ SquashFS uses less memory at the expense of extra reads from disk. ++ ++ Note there must be at least one cached fragment. Anything ++ much more than three will probably not make much difference. ++ + config VXFS_FS + tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)" + depends on BLOCK + diff --git a/packages/linux/linux-openmoko-devel/0005-squashfs-Makefile.patch b/packages/linux/linux-openmoko-devel/0005-squashfs-Makefile.patch new file mode 100644 index 0000000000..b0ec4cebb8 --- /dev/null +++ b/packages/linux/linux-openmoko-devel/0005-squashfs-Makefile.patch @@ -0,0 +1,12 @@ +diff -urN linux-2.6.24/fs/Makefile linux-2.6.24.sqlzma-ng/fs/Makefile +--- linux-2.6.24/fs/Makefile 2007-11-13 21:24:14.000000000 -0500 ++++ linux-2.6.24.sqlzma-ng/fs/Makefile 2007-11-13 21:19:15.000000000 -0500 +@@ -72,6 +72,7 @@ + obj-$(CONFIG_JBD2) += jbd2/ + obj-$(CONFIG_EXT2_FS) += ext2/ + obj-$(CONFIG_CRAMFS) += cramfs/ ++obj-$(CONFIG_SQUASHFS) += squashfs/ + obj-y += ramfs/ + obj-$(CONFIG_HUGETLBFS) += hugetlbfs/ + obj-$(CONFIG_CODA_FS) += coda/ + diff --git a/packages/linux/linux-openmoko-devel/defconfig-oe b/packages/linux/linux-openmoko-devel/defconfig-oe index 1741cbab88..4154639d3e 100644 --- a/packages/linux/linux-openmoko-devel/defconfig-oe +++ b/packages/linux/linux-openmoko-devel/defconfig-oe @@ -1484,7 +1484,7 @@ CONFIG_RTC_DRV_S3C=m # # File systems # -CONFIG_EXT2_FS=m +CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT2_FS_XIP is not set CONFIG_EXT3_FS=y @@ -1604,6 +1604,7 @@ CONFIG_CIFS_WEAK_PW_HASH=y # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set +CONFIG_SQUASHFS=m # # Partition Types diff --git a/packages/linux/linux-openmoko-devel_git.bb b/packages/linux/linux-openmoko-devel_git.bb index f8a315f558..c68b5c2e69 100644 --- a/packages/linux/linux-openmoko-devel_git.bb +++ b/packages/linux/linux-openmoko-devel_git.bb @@ -2,53 +2,24 @@ require linux.inc require linux-openmoko.inc DESCRIPTION = "Linux 2.6.x (development) kernel for the Openmoko Neo Smartphones" + DEFAULT_PREFERENCE = "-1" KERNEL_RELEASE = "2.6.24" KERNEL_VERSION = "${KERNEL_RELEASE}" -# If you use a rc, you will need to use this: PV = "${KERNEL_RELEASE}+gitr${SRCREV}" -PR = "r2" - -KERNEL_IMAGETYPE = "uImage" -UBOOT_ENTRYPOINT = "30008000" +PR = "r4" SRC_URI = "\ git://git.openmoko.org/git/kernel.git;protocol=git;branch=andy \ - file://defconfig-oe" + \ + file://0001-squashfs-with-lzma.patch;patch=1 \ + file://0002-squashfs-initrd.patch;patch=1 \ + file://0003-squashfs-force-O2.patch;patch=1 \ + file://0004-squashfs-Kconfig.patch;patch=1 \ + file://0005-squashfs-Makefile.patch;patch=1 \ + \ + file://defconfig-oe \ +" S = "${WORKDIR}/git" - -############################################################## -# kernel image resides on a seperate flash partition -# -FILES_kernel-image = "" -ALLOW_EMPTY = "1" - -COMPATIBLE_HOST = "arm.*-linux" -COMPATIBLE_MACHINE = 'om-gta01|om-gta02' - -CMDLINE = "unused -- bootloader passes ATAG list" - -############################################################### -# module configs specific to this kernel -# - -# usb -module_autoload_ohci-hcd = "ohci-hcd" -module_autoload_hci_usb = "hci_usb" -module_autoload_g_ether = "g_ether" -# audio -module_autoload_snd-soc-neo1973-wm8753 = "snd-soc-neo1973-wm8753" -# sd/mmc -module_autoload_s3cmci = "s3cmci" - -do_configure_prepend() { - install -m 0644 ${WORKDIR}/defconfig-oe ${WORKDIR}/defconfig - if [ ${MACHINE} == "om-gta01" ]; then - echo -n "fixing up configuration for Openmoko GTA01..." - sed -i -e s,CONFIG_S3C_LOWLEVEL_UART_PORT=2,CONFIG_S3C_LOWLEVEL_UART_PORT=0, ${WORKDIR}/defconfig - sed -i -e s,CONFIG_DEBUG_S3C_UART=2,CONFIG_DEBUG_S3C_UART=0, ${WORKDIR}/defconfig - echo "done" - fi -} diff --git a/packages/linux/linux-openmoko.inc b/packages/linux/linux-openmoko.inc index 69d7845f04..b4863ca0c8 100644 --- a/packages/linux/linux-openmoko.inc +++ b/packages/linux/linux-openmoko.inc @@ -1,9 +1,54 @@ +############################################################## +# kernel image parameters. It resides on a seperate flash partition +# +KERNEL_IMAGETYPE = "uImage" +UBOOT_ENTRYPOINT = "30008000" + +FILES_kernel-image = "" +ALLOW_EMPTY = "1" + +COMPATIBLE_HOST = "arm.*-linux" +COMPATIBLE_MACHINE = 'om-gta01|om-gta02' + +CMDLINE = "unused -- bootloader passes ATAG list" + +############################################################### +# module configs specific to this kernel +# + +# usb +module_autoload_ohci-hcd = "ohci-hcd" +module_autoload_hci_usb = "hci_usb" +module_autoload_g_ether = "g_ether" +# audio (GTA01) +module_autoload_snd-soc-neo1973-wm8753 = "snd-soc-neo1973-wm8753" +# audio (GTA02) +module_autoload_snd-soc-neo1973-gta02-wm8753 = "snd-soc-neo1973-gta02-wm8753" +# sd/mmc +module_autoload_s3cmci = "s3cmci" + +################################################################ # extra stuff we need for openmoko that is not in linux.inc +# + +# fix deconfig if we're on GTA01 +do_configure_prepend() { + install -m 0644 ${WORKDIR}/defconfig-oe ${WORKDIR}/defconfig + if [ ${MACHINE} == "om-gta01" ]; then + echo -n "fixing up configuration for Openmoko GTA01..." + sed -i -e s,CONFIG_S3C_LOWLEVEL_UART_PORT=2,CONFIG_S3C_LOWLEVEL_UART_PORT=0, ${WORKDIR}/defconfig + sed -i -e s,CONFIG_DEBUG_S3C_UART=2,CONFIG_DEBUG_S3C_UART=0, ${WORKDIR}/defconfig + echo "done" + fi +} + +# symlink the latest uImage (should go to linux.inc IMO) do_deploy_append() { rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin ln -sf ${DEPLOY_DIR_IMAGE}/uImage-${PV}-${PR}-${MACHINE_ARCH}.bin ${DEPLOY_DIR_IMAGE}/uImage-${MACHINE_ARCH}-latest.bin } +# opkg flash update service RDEPENDS_kernel-image += "mtd-utils" pkg_postinst_kernel-image () { diff --git a/packages/linux/linux-openmoko/defconfig-oe b/packages/linux/linux-openmoko/defconfig-oe new file mode 100644 index 0000000000..4154639d3e --- /dev/null +++ b/packages/linux/linux-openmoko/defconfig-oe @@ -0,0 +1,1771 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.24 +# Mon Feb 25 07:03:56 2008 +# +CONFIG_ARM=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_GENERIC_GPIO=y +# CONFIG_GENERIC_TIME is not set +# CONFIG_GENERIC_CLOCKEVENTS is not set +CONFIG_MMU=y +CONFIG_NO_IOPORT=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_ZONE_DMA=y +CONFIG_FIQ=y +CONFIG_VECTORS_BASE=0xffff0000 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="oe" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_USER_NS is not set +# CONFIG_PID_NS is not set +# CONFIG_AUDIT is not set +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_CGROUPS is not set +# CONFIG_FAIR_GROUP_SCHED is not set +# CONFIG_SYSFS_DEPRECATED is not set +# CONFIG_RELAY is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +# CONFIG_EMBEDDED is not set +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_ANON_INODES=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y +CONFIG_BLOCK=y +# CONFIG_LBD is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_LSF is not set +# CONFIG_BLK_DEV_BSG is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=m +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=m +# CONFIG_DEFAULT_AS is not set +CONFIG_DEFAULT_DEADLINE=y +# CONFIG_DEFAULT_CFQ is not set +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="deadline" + +# +# System Type +# +# CONFIG_ARCH_AAEC2000 is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_AT91 is not set +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CO285 is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_EP93XX is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_NETX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_IOP13XX is not set +# CONFIG_ARCH_IOP32X is not set +# CONFIG_ARCH_IOP33X is not set +# CONFIG_ARCH_IXP23XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_KS8695 is not set +# CONFIG_ARCH_NS9XXX is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_PNX4008 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_SA1100 is not set +CONFIG_ARCH_S3C2410=y +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_LH7A40X is not set +# CONFIG_ARCH_DAVINCI is not set +# CONFIG_ARCH_OMAP is not set +CONFIG_PLAT_S3C24XX=y +CONFIG_CPU_S3C244X=y +CONFIG_S3C2410_DMA=y +# CONFIG_S3C2410_DMA_DEBUG is not set +CONFIG_MACH_SMDK=y +CONFIG_MACH_NEO1973=y +CONFIG_PLAT_S3C=y +CONFIG_CPU_LLSERIAL_S3C2410=y +CONFIG_CPU_LLSERIAL_S3C2440=y + +# +# Boot options +# +# CONFIG_S3C_BOOT_WATCHDOG is not set +# CONFIG_S3C_BOOT_ERROR_RESET is not set + +# +# Power management +# +# CONFIG_S3C2410_PM_CHECK is not set +CONFIG_S3C_LOWLEVEL_UART_PORT=2 + +# +# S3C2400 Machines +# +CONFIG_CPU_S3C2410=y +CONFIG_CPU_S3C2410_DMA=y +CONFIG_S3C2410_PM=y +CONFIG_S3C2410_GPIO=y +CONFIG_S3C2410_CLOCK=y +CONFIG_S3C2410_PWM=y + +# +# S3C2410 Machines +# +# CONFIG_ARCH_SMDK2410 is not set +# CONFIG_ARCH_H1940 is not set +# CONFIG_MACH_N30 is not set +# CONFIG_ARCH_BAST is not set +# CONFIG_MACH_OTOM is not set +# CONFIG_MACH_AML_M5900 is not set +# CONFIG_MACH_VR1000 is not set +CONFIG_MACH_QT2410=y +CONFIG_MACH_NEO1973_GTA01=y + +# +# S3C2412 Machines +# +# CONFIG_MACH_SMDK2413 is not set +# CONFIG_MACH_SMDK2412 is not set +# CONFIG_MACH_VSTMS is not set +CONFIG_CPU_S3C2440=y +CONFIG_S3C2440_DMA=y +CONFIG_S3C2440_C_FIQ=y + +# +# S3C2440 Machines +# +# CONFIG_MACH_ANUBIS is not set +# CONFIG_MACH_OSIRIS is not set +# CONFIG_MACH_RX3715 is not set +CONFIG_ARCH_S3C2440=y +# CONFIG_MACH_NEXCODER_2440 is not set +CONFIG_SMDK2440_CPU2440=y +# CONFIG_MACH_HXD8 is not set +CONFIG_MACH_NEO1973_GTA02=y +# CONFIG_NEO1973_GTA02_2440 is not set +CONFIG_CPU_S3C2442=y + +# +# S3C2442 Machines +# +CONFIG_SMDK2440_CPU2442=y + +# +# S3C2443 Machines +# +# CONFIG_MACH_SMDK2443 is not set + +# +# Processor Type +# +CONFIG_CPU_32=y +CONFIG_CPU_ARM920T=y +CONFIG_CPU_32v4T=y +CONFIG_CPU_ABRT_EV4T=y +CONFIG_CPU_CACHE_V4WT=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_V4WB=y +CONFIG_CPU_TLB_V4WBI=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y + +# +# Processor Features +# +CONFIG_ARM_THUMB=y +# CONFIG_CPU_ICACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_WRITETHROUGH is not set +# CONFIG_OUTER_CACHE is not set + +# +# Bus support +# +# CONFIG_PCI_SYSCALL is not set +# CONFIG_ARCH_SUPPORTS_MSI is not set +# CONFIG_PCCARD is not set + +# +# Kernel Features +# +# CONFIG_TICK_ONESHOT is not set +CONFIG_PREEMPT=y +CONFIG_NO_IDLE_HZ=y +CONFIG_HZ=200 +CONFIG_AEABI=y +CONFIG_OABI_COMPAT=y +# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set +CONFIG_SPLIT_PTLOCK_CPUS=4096 +# CONFIG_RESOURCES_64BIT is not set +CONFIG_ZONE_DMA_FLAG=1 +CONFIG_BOUNCE=y +CONFIG_VIRT_TO_BUS=y +CONFIG_ALIGNMENT_TRAP=y + +# +# Boot options +# +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CMDLINE="unused -- bootloader passes ATAG list" +# CONFIG_XIP_KERNEL is not set +CONFIG_KEXEC=y +CONFIG_ATAGS_PROC=y + +# +# Floating point emulation +# + +# +# At least one emulation must be selected +# +CONFIG_FPE_NWFPE=y +# CONFIG_FPE_NWFPE_XP is not set +# CONFIG_FPE_FASTFPE is not set + +# +# Userspace binary formats +# +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_AOUT is not set +# CONFIG_BINFMT_MISC is not set + +# +# Power management options +# +CONFIG_PM=y +CONFIG_PM_LEGACY=y +CONFIG_PM_DEBUG=y +# CONFIG_PM_VERBOSE is not set +CONFIG_PM_SLEEP=y +CONFIG_SUSPEND_UP_POSSIBLE=y +CONFIG_SUSPEND=y +CONFIG_APM_EMULATION=y + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +CONFIG_UNIX=y +CONFIG_XFRM=y +# CONFIG_XFRM_USER is not set +# CONFIG_XFRM_SUB_POLICY is not set +CONFIG_XFRM_MIGRATE=y +CONFIG_NET_KEY=m +CONFIG_NET_KEY_MIGRATE=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_ASK_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_FIB_HASH=y +CONFIG_IP_MULTIPLE_TABLES=y +# CONFIG_IP_ROUTE_MULTIPATH is not set +# CONFIG_IP_ROUTE_VERBOSE is not set +CONFIG_IP_PNP=y +# CONFIG_IP_PNP_DHCP is not set +# CONFIG_IP_PNP_BOOTP is not set +# CONFIG_IP_PNP_RARP is not set +CONFIG_NET_IPIP=m +CONFIG_NET_IPGRE=m +# CONFIG_NET_IPGRE_BROADCAST is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +CONFIG_INET_AH=m +CONFIG_INET_ESP=m +CONFIG_INET_IPCOMP=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INET_TUNNEL=m +CONFIG_INET_XFRM_MODE_TRANSPORT=m +CONFIG_INET_XFRM_MODE_TUNNEL=m +CONFIG_INET_XFRM_MODE_BEET=m +# CONFIG_INET_LRO is not set +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +CONFIG_TCP_MD5SIG=y +# CONFIG_IP_VS is not set +CONFIG_IPV6=m +# CONFIG_IPV6_PRIVACY is not set +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=m +CONFIG_INET6_ESP=m +CONFIG_INET6_IPCOMP=m +# CONFIG_IPV6_MIP6 is not set +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_MODE_TRANSPORT=m +CONFIG_INET6_XFRM_MODE_TUNNEL=m +CONFIG_INET6_XFRM_MODE_BEET=m +# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set +CONFIG_IPV6_SIT=m +CONFIG_IPV6_TUNNEL=m +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_NETWORK_SECMARK is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_NETLINK_QUEUE=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NF_CONNTRACK_ENABLED=m +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CT_ACCT=y +CONFIG_NF_CONNTRACK_MARK=y +CONFIG_NF_CONNTRACK_EVENTS=y +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_CT_PROTO_SCTP=m +# CONFIG_NF_CT_PROTO_UDPLITE is not set +# CONFIG_NF_CONNTRACK_AMANDA is not set +CONFIG_NF_CONNTRACK_FTP=m +CONFIG_NF_CONNTRACK_H323=m +CONFIG_NF_CONNTRACK_IRC=m +CONFIG_NF_CONNTRACK_NETBIOS_NS=m +CONFIG_NF_CONNTRACK_PPTP=m +CONFIG_NF_CONNTRACK_SANE=m +CONFIG_NF_CONNTRACK_SIP=m +CONFIG_NF_CONNTRACK_TFTP=m +CONFIG_NF_CT_NETLINK=m +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_DSCP=m +CONFIG_NETFILTER_XT_TARGET_MARK=m +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_DCCP=m +CONFIG_NETFILTER_XT_MATCH_DSCP=m +CONFIG_NETFILTER_XT_MATCH_ESP=m +CONFIG_NETFILTER_XT_MATCH_HELPER=m +CONFIG_NETFILTER_XT_MATCH_LENGTH=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_POLICY=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m +CONFIG_NETFILTER_XT_MATCH_QUOTA=m +CONFIG_NETFILTER_XT_MATCH_REALM=m +CONFIG_NETFILTER_XT_MATCH_SCTP=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m +CONFIG_NETFILTER_XT_MATCH_STRING=m +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m +# CONFIG_NETFILTER_XT_MATCH_TIME is not set +# CONFIG_NETFILTER_XT_MATCH_U32 is not set +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m + +# +# IP: Netfilter Configuration +# +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_PROC_COMPAT=y +# CONFIG_IP_NF_QUEUE is not set +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MATCH_IPRANGE=m +CONFIG_IP_NF_MATCH_TOS=m +# CONFIG_IP_NF_MATCH_RECENT is not set +CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_AH=m +CONFIG_IP_NF_MATCH_TTL=m +CONFIG_IP_NF_MATCH_OWNER=m +CONFIG_IP_NF_MATCH_ADDRTYPE=m +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IP_NF_TARGET_LOG=m +CONFIG_IP_NF_TARGET_ULOG=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_NETMAP=m +CONFIG_IP_NF_TARGET_SAME=m +CONFIG_NF_NAT_SNMP_BASIC=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_TFTP=m +# CONFIG_NF_NAT_AMANDA is not set +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_SIP=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_TARGET_TOS=m +CONFIG_IP_NF_TARGET_ECN=m +CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_CLUSTERIP=m +# CONFIG_IP_NF_RAW is not set +# CONFIG_IP_NF_ARPTABLES is not set + +# +# IPv6: Netfilter Configuration (EXPERIMENTAL) +# +CONFIG_NF_CONNTRACK_IPV6=m +# CONFIG_IP6_NF_QUEUE is not set +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MATCH_RT=m +CONFIG_IP6_NF_MATCH_OPTS=m +CONFIG_IP6_NF_MATCH_FRAG=m +CONFIG_IP6_NF_MATCH_HL=m +CONFIG_IP6_NF_MATCH_OWNER=m +CONFIG_IP6_NF_MATCH_IPV6HEADER=m +CONFIG_IP6_NF_MATCH_AH=m +CONFIG_IP6_NF_MATCH_MH=m +CONFIG_IP6_NF_MATCH_EUI64=m +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_TARGET_LOG=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_TARGET_HL=m +# CONFIG_IP6_NF_RAW is not set +# CONFIG_IP_DCCP is not set +# CONFIG_IP_SCTP is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +CONFIG_NET_SCHED=y + +# +# Queueing/Scheduling +# +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_HTB=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_PRIO=m +# CONFIG_NET_SCH_RR is not set +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_SCH_GRED=m +CONFIG_NET_SCH_DSMARK=m +CONFIG_NET_SCH_NETEM=m +CONFIG_NET_SCH_INGRESS=m + +# +# Classification +# +CONFIG_NET_CLS=y +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_CLS_TCINDEX=m +CONFIG_NET_CLS_ROUTE4=m +CONFIG_NET_CLS_ROUTE=y +CONFIG_NET_CLS_FW=m +CONFIG_NET_CLS_U32=m +CONFIG_CLS_U32_PERF=y +CONFIG_CLS_U32_MARK=y +CONFIG_NET_CLS_RSVP=m +CONFIG_NET_CLS_RSVP6=m +# CONFIG_NET_EMATCH is not set +# CONFIG_NET_CLS_ACT is not set +# CONFIG_NET_CLS_POLICE is not set +# CONFIG_NET_CLS_IND is not set +CONFIG_NET_SCH_FIFO=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +CONFIG_BT=m +CONFIG_BT_L2CAP=m +CONFIG_BT_SCO=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=m + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIUSB=m +CONFIG_BT_HCIUSB_SCO=y +# CONFIG_BT_HCIBTSDIO is not set +# CONFIG_BT_HCIUART is not set +# CONFIG_BT_HCIBCM203X is not set +# CONFIG_BT_HCIBPA10X is not set +# CONFIG_BT_HCIBFUSB is not set +# CONFIG_BT_HCIVHCI is not set +# CONFIG_AF_RXRPC is not set +CONFIG_FIB_RULES=y + +# +# Wireless +# +# CONFIG_CFG80211 is not set +CONFIG_WIRELESS_EXT=y +# CONFIG_MAC80211 is not set +# CONFIG_IEEE80211 is not set +# CONFIG_RFKILL is not set +# CONFIG_NET_9P is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=m +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +CONFIG_CONNECTOR=m +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_PARTITIONS=y +# CONFIG_MTD_REDBOOT_PARTS is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_AFS_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_MTD_OOPS is not set + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=y +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=y +# CONFIG_MTD_CFI_AMDSTD is not set +# CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +CONFIG_MTD_ABSENT=y + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_START=0x8000000 +CONFIG_MTD_PHYSMAP_LEN=0 +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 +# CONFIG_MTD_ARM_INTEGRATOR is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_DATAFLASH is not set +# CONFIG_MTD_M25P80 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_VERIFY_WRITE=y +# CONFIG_MTD_NAND_ECC_SMC is not set +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +CONFIG_MTD_NAND_IDS=y +CONFIG_MTD_NAND_S3C2410=y +# CONFIG_MTD_NAND_S3C2410_DEBUG is not set +CONFIG_MTD_NAND_S3C2410_HWECC=y +# CONFIG_MTD_NAND_S3C2410_CLKSTOP is not set +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_NANDSIM is not set +# CONFIG_MTD_NAND_PLATFORM is not set +# CONFIG_MTD_ALAUDA is not set +# CONFIG_MTD_ONENAND is not set + +# +# UBI - Unsorted block images +# +# CONFIG_MTD_UBI is not set +# CONFIG_PARPORT is not set +CONFIG_PNP=y +CONFIG_PNP_DEBUG=y + +# +# Protocols +# +# CONFIG_PNPACPI is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=m +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_UB=m +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +CONFIG_MISC_DEVICES=y +# CONFIG_EEPROM_93CX6 is not set +# CONFIG_IDE is not set + +# +# SCSI device support +# +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=m +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_TGT is not set +# CONFIG_SCSI_NETLINK is not set +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=m +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +CONFIG_BLK_DEV_SR=m +# CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_CHR_DEV_SG=m +# CONFIG_CHR_DEV_SCH is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SCSI_WAIT_SCAN=m + +# +# SCSI Transports +# +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +CONFIG_SCSI_LOWLEVEL=y +# CONFIG_ISCSI_TCP is not set +# CONFIG_SCSI_DEBUG is not set +# CONFIG_ATA is not set +# CONFIG_MD is not set +CONFIG_NETDEVICES=y +# CONFIG_NETDEVICES_MULTIQUEUE is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_MACVLAN is not set +# CONFIG_EQUALIZER is not set +CONFIG_TUN=m +# CONFIG_VETH is not set +# CONFIG_NET_SB1000 is not set +# CONFIG_PHYLIB is not set +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_AX88796 is not set +# CONFIG_SMC91X is not set +# CONFIG_DM9000 is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +CONFIG_NET_PCI=y +# CONFIG_B44 is not set +CONFIG_CS89x0=m +# CONFIG_NETDEV_1000 is not set +# CONFIG_NETDEV_10000 is not set + +# +# Wireless LAN +# +# CONFIG_WLAN_PRE80211 is not set +# CONFIG_WLAN_80211 is not set + +# +# USB Network Adapters +# +CONFIG_USB_CATC=m +CONFIG_USB_KAWETH=m +CONFIG_USB_PEGASUS=m +CONFIG_USB_RTL8150=m +CONFIG_USB_USBNET=y +CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_CDCETHER=m +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_GL620A=m +CONFIG_USB_NET_NET1080=m +CONFIG_USB_NET_PLUSB=m +CONFIG_USB_NET_MCS7830=m +CONFIG_USB_NET_RNDIS_HOST=m +CONFIG_USB_NET_CDC_SUBSET=m +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_BELKIN=y +CONFIG_USB_ARMLINUX=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y +CONFIG_USB_NET_ZAURUS=m +# CONFIG_WAN is not set +CONFIG_PPP=m +CONFIG_PPP_MULTILINK=y +CONFIG_PPP_FILTER=y +CONFIG_PPP_ASYNC=m +CONFIG_PPP_SYNC_TTY=m +CONFIG_PPP_DEFLATE=m +CONFIG_PPP_BSDCOMP=m +CONFIG_PPP_MPPE=m +# CONFIG_PPPOE is not set +# CONFIG_PPPOL2TP is not set +# CONFIG_SLIP is not set +CONFIG_SLHC=m +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_ISDN is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set +# CONFIG_INPUT_POLLDEV is not set + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +CONFIG_INPUT_MOUSEDEV_SCREEN_X=480 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=640 +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +CONFIG_INPUT_EVBUG=m + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +CONFIG_KEYBOARD_STOWAWAY=m +CONFIG_KEYBOARD_GPIO=m +CONFIG_KEYBOARD_NEO1973=y +CONFIG_KEYBOARD_QT2410=y +CONFIG_INPUT_MOUSE=y +# CONFIG_MOUSE_PS2 is not set +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_APPLETOUCH is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_MOUSE_GPIO is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_FILTER=y +CONFIG_TOUCHSCREEN_FILTER_MEDIAN=y +CONFIG_TOUCHSCREEN_FILTER_MEAN=y +# CONFIG_TOUCHSCREEN_ADS7846 is not set +# CONFIG_TOUCHSCREEN_FUJITSU is not set +CONFIG_TOUCHSCREEN_S3C2410=y +# CONFIG_TOUCHSCREEN_S3C2410_DEBUG is not set +# CONFIG_TOUCHSCREEN_GUNZE is not set +# CONFIG_TOUCHSCREEN_ELO is not set +# CONFIG_TOUCHSCREEN_MTOUCH is not set +# CONFIG_TOUCHSCREEN_MK712 is not set +# CONFIG_TOUCHSCREEN_PENMOUNT is not set +# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set +# CONFIG_TOUCHSCREEN_TOUCHWIN is not set +# CONFIG_TOUCHSCREEN_UCB1400 is not set +# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set +CONFIG_INPUT_MISC=y +# CONFIG_INPUT_ATI_REMOTE is not set +# CONFIG_INPUT_ATI_REMOTE2 is not set +# CONFIG_INPUT_KEYSPAN_REMOTE is not set +# CONFIG_INPUT_POWERMATE is not set +# CONFIG_INPUT_YEALINK is not set +CONFIG_INPUT_UINPUT=m +CONFIG_INPUT_LIS302DL=y + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +# CONFIG_SERIO_SERPORT is not set +# CONFIG_SERIO_RAW is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_NR_TTY_DEVICES=4 +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_8250 is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_S3C2410=y +CONFIG_SERIAL_S3C2410_CONSOLE=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +# CONFIG_LEGACY_PTYS is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_NVRAM is not set +# CONFIG_R3964 is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y + +# +# I2C Algorithms +# +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_GPIO is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +CONFIG_I2C_S3C2410=y +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_TINY_USB is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_SENSORS_DS1337 is not set +# CONFIG_SENSORS_DS1374 is not set +# CONFIG_DS1682 is not set +# CONFIG_SENSORS_EEPROM is not set +CONFIG_SENSORS_PCF50606=y +CONFIG_SENSORS_PCF50633=y +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_MAX6875 is not set +# CONFIG_SENSORS_TSL2550 is not set +CONFIG_SENSORS_TSL256X=m +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# SPI support +# +CONFIG_SPI=y +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_MASTER=y + +# +# SPI Master Controller Drivers +# +CONFIG_SPI_BITBANG=y +CONFIG_SPI_S3C24XX=y +CONFIG_SPI_S3C24XX_GPIO=y + +# +# SPI Protocol Masters +# +# CONFIG_SPI_AT25 is not set +# CONFIG_SPI_SPIDEV is not set +# CONFIG_SPI_TLE62X0 is not set +# CONFIG_W1 is not set +CONFIG_POWER_SUPPLY=y +# CONFIG_POWER_SUPPLY_DEBUG is not set +# CONFIG_PDA_POWER is not set +# CONFIG_APM_POWER is not set +# CONFIG_BATTERY_DS2760 is not set +CONFIG_BATTERY_BQ27000_HDQ=y +CONFIG_GTA02_HDQ=y +# CONFIG_HWMON is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +# CONFIG_SOFT_WATCHDOG is not set +CONFIG_S3C2410_WATCHDOG=m + +# +# USB-based Watchdog Cards +# +# CONFIG_USBPCWATCHDOG is not set + +# +# Sonics Silicon Backplane +# +CONFIG_SSB_POSSIBLE=y +# CONFIG_SSB is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_SM501 is not set +CONFIG_MFD_GLAMO=y +CONFIG_MFD_GLAMO_FB=y +CONFIG_MFD_GLAMO_SPI_GPIO=y +CONFIG_MFD_GLAMO_SPI_FB=y +CONFIG_MFD_GLAMO_MCI=y + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set +# CONFIG_DVB_CORE is not set +CONFIG_DAB=y +# CONFIG_USB_DABUSB is not set + +# +# Graphics support +# +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_SYS_FOPS is not set +CONFIG_FB_DEFERRED_IO=y +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +# CONFIG_FB_UVESA is not set +# CONFIG_FB_S1D13XXX is not set +CONFIG_FB_S3C2410=y +# CONFIG_FB_S3C2410_DEBUG is not set +# CONFIG_FB_VIRTUAL is not set +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_LCD_CLASS_DEVICE=y +# CONFIG_LCD_LTV350QV is not set +CONFIG_BACKLIGHT_CLASS_DEVICE=y +# CONFIG_BACKLIGHT_CORGI is not set +CONFIG_BACKLIGHT_GTA01=y + +# +# Display device support +# +# CONFIG_DISPLAY_SUPPORT is not set +CONFIG_DISPLAY_JBT6K74=y + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +CONFIG_FONTS=y +# CONFIG_FONT_8x8 is not set +# CONFIG_FONT_8x16 is not set +CONFIG_FONT_6x11=y +# CONFIG_FONT_7x14 is not set +# CONFIG_FONT_PEARL_8x8 is not set +# CONFIG_FONT_ACORN_8x8 is not set +# CONFIG_FONT_MINI_4x6 is not set +# CONFIG_FONT_SUN8x16 is not set +# CONFIG_FONT_SUN12x22 is not set +# CONFIG_FONT_10x18 is not set +# CONFIG_LOGO is not set + +# +# Sound +# +CONFIG_SOUND=y + +# +# Advanced Linux Sound Architecture +# +CONFIG_SND=m +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +# CONFIG_SND_SEQUENCER is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_OSS_PLUGINS=y +# CONFIG_SND_DYNAMIC_MINORS is not set +CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_VERBOSE_PROCFS=y +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set + +# +# Generic devices +# +# CONFIG_SND_DUMMY is not set +# CONFIG_SND_MTPAV is not set +# CONFIG_SND_SERIAL_U16550 is not set +# CONFIG_SND_MPU401 is not set + +# +# ALSA ARM devices +# + +# +# SPI devices +# + +# +# USB devices +# +# CONFIG_SND_USB_AUDIO is not set +# CONFIG_SND_USB_CAIAQ is not set + +# +# System on Chip audio support +# +CONFIG_SND_SOC=m +CONFIG_SND_S3C24XX_SOC=m +CONFIG_SND_S3C24XX_SOC_I2S=m +CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753=m +CONFIG_SND_S3C24XX_SOC_NEO1973_GTA02_WM8753=m + +# +# SoC Audio support for SuperH +# +CONFIG_SND_SOC_WM8753=m + +# +# Open Sound System +# +# CONFIG_SOUND_PRIME is not set +CONFIG_HID_SUPPORT=y +CONFIG_HID=y +# CONFIG_HID_DEBUG is not set +# CONFIG_HIDRAW is not set + +# +# USB Input Devices +# +CONFIG_USB_HID=m +# CONFIG_USB_HIDINPUT_POWERBOOK is not set +# CONFIG_HID_FF is not set +# CONFIG_USB_HIDDEV is not set + +# +# USB HID Boot Protocol drivers +# +# CONFIG_USB_KBD is not set +# CONFIG_USB_MOUSE is not set +CONFIG_USB_SUPPORT=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +# CONFIG_USB_ARCH_HAS_EHCI is not set +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +CONFIG_USB_DEVICE_CLASS=y +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_SUSPEND=y +# CONFIG_USB_PERSIST is not set +# CONFIG_USB_OTG is not set + +# +# USB Host Controller Drivers +# +# CONFIG_USB_ISP116X_HCD is not set +CONFIG_USB_OHCI_HCD=m +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_R8A66597_HCD is not set + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' +# + +# +# may also be needed; see USB_STORAGE Help for more information +# +CONFIG_USB_STORAGE=m +# CONFIG_USB_STORAGE_DEBUG is not set +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_FREECOM=y +# CONFIG_USB_STORAGE_ISD200 is not set +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_USBAT=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_JUMPSHOT=y +CONFIG_USB_STORAGE_ALAUDA=y +CONFIG_USB_STORAGE_KARMA=y +CONFIG_USB_LIBUSUAL=y + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set +CONFIG_USB_MON=y + +# +# USB port drivers +# + +# +# USB Serial Converter support +# +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_AIRCABLE=m +CONFIG_USB_SERIAL_AIRPRIME=m +CONFIG_USB_SERIAL_ARK3116=m +CONFIG_USB_SERIAL_BELKIN=m +# CONFIG_USB_SERIAL_CH341 is not set +CONFIG_USB_SERIAL_WHITEHEAT=m +CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m +CONFIG_USB_SERIAL_CP2101=m +CONFIG_USB_SERIAL_CYPRESS_M8=m +CONFIG_USB_SERIAL_EMPEG=m +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_FUNSOFT=m +CONFIG_USB_SERIAL_VISOR=m +CONFIG_USB_SERIAL_IPAQ=m +CONFIG_USB_SERIAL_IR=m +CONFIG_USB_SERIAL_EDGEPORT=m +CONFIG_USB_SERIAL_EDGEPORT_TI=m +CONFIG_USB_SERIAL_GARMIN=m +CONFIG_USB_SERIAL_IPW=m +CONFIG_USB_SERIAL_KEYSPAN_PDA=m +CONFIG_USB_SERIAL_KEYSPAN=m +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +CONFIG_USB_SERIAL_KLSI=m +CONFIG_USB_SERIAL_KOBIL_SCT=m +CONFIG_USB_SERIAL_MCT_U232=m +CONFIG_USB_SERIAL_MOS7720=m +CONFIG_USB_SERIAL_MOS7840=m +CONFIG_USB_SERIAL_NAVMAN=m +CONFIG_USB_SERIAL_PL2303=m +# CONFIG_USB_SERIAL_OTI6858 is not set +CONFIG_USB_SERIAL_HP4X=m +CONFIG_USB_SERIAL_SAFE=m +CONFIG_USB_SERIAL_SAFE_PADDED=y +CONFIG_USB_SERIAL_SIERRAWIRELESS=m +CONFIG_USB_SERIAL_TI=m +CONFIG_USB_SERIAL_CYBERJACK=m +CONFIG_USB_SERIAL_XIRCOM=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_SERIAL_OMNINET=m +# CONFIG_USB_SERIAL_DEBUG is not set +CONFIG_USB_EZUSB=y + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +CONFIG_USB_BERRY_CHARGE=m +# CONFIG_USB_LED is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGET is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_LD is not set +CONFIG_USB_TRANCEVIBRATOR=m +CONFIG_USB_IOWARRIOR=m +# CONFIG_USB_TEST is not set + +# +# USB DSL modem support +# + +# +# USB Gadget Support +# +CONFIG_USB_GADGET=y +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +CONFIG_USB_GADGET_SELECTED=y +# CONFIG_USB_GADGET_AMD5536UDC is not set +# CONFIG_USB_GADGET_ATMEL_USBA is not set +# CONFIG_USB_GADGET_FSL_USB2 is not set +# CONFIG_USB_GADGET_NET2280 is not set +# CONFIG_USB_GADGET_PXA2XX is not set +# CONFIG_USB_GADGET_M66592 is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_OMAP is not set +CONFIG_USB_GADGET_S3C2410=y +CONFIG_USB_S3C2410=y +# CONFIG_USB_S3C2410_DEBUG is not set +# CONFIG_USB_GADGET_AT91 is not set +# CONFIG_USB_GADGET_DUMMY_HCD is not set +# CONFIG_USB_GADGET_DUALSPEED is not set +# CONFIG_USB_ZERO is not set +CONFIG_USB_ETH=y +CONFIG_USB_ETH_RNDIS=y +# CONFIG_USB_GADGETFS is not set +# CONFIG_USB_FILE_STORAGE is not set +# CONFIG_USB_G_SERIAL is not set +# CONFIG_USB_MIDI_GADGET is not set + +# +# SDIO support +# +CONFIG_SDIO=y +CONFIG_SDIO_S3C24XX=y +CONFIG_SDIO_S3C24XX_DMA=y +CONFIG_SDIO_AR6000_WLAN=y +CONFIG_MMC=y +# CONFIG_MMC_DEBUG is not set +CONFIG_MMC_UNSAFE_RESUME=y + +# +# MMC/SD Card Drivers +# +CONFIG_MMC_BLOCK=y +CONFIG_MMC_BLOCK_BOUNCE=y +# CONFIG_SDIO_UART is not set + +# +# MMC/SD Host Controller Drivers +# +# CONFIG_MMC_SPI is not set +CONFIG_MMC_S3C=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y + +# +# LED drivers +# +CONFIG_LEDS_S3C24XX=m +# CONFIG_LEDS_GPIO is not set +CONFIG_LEDS_NEO1973_VIBRATOR=y +CONFIG_LEDS_NEO1973_GTA02=y + +# +# LED Triggers +# +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=y +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set +CONFIG_RTC_LIB=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +CONFIG_RTC_DEBUG=y + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set +# CONFIG_RTC_DRV_TEST is not set + +# +# I2C RTC drivers +# +# CONFIG_RTC_DRV_DS1307 is not set +# CONFIG_RTC_DRV_DS1374 is not set +# CONFIG_RTC_DRV_DS1672 is not set +# CONFIG_RTC_DRV_MAX6900 is not set +# CONFIG_RTC_DRV_RS5C372 is not set +# CONFIG_RTC_DRV_ISL1208 is not set +# CONFIG_RTC_DRV_X1205 is not set +# CONFIG_RTC_DRV_PCF8563 is not set +# CONFIG_RTC_DRV_PCF8583 is not set +# CONFIG_RTC_DRV_M41T80 is not set + +# +# SPI RTC drivers +# +# CONFIG_RTC_DRV_RS5C348 is not set +# CONFIG_RTC_DRV_MAX6902 is not set + +# +# Platform RTC drivers +# +# CONFIG_RTC_DRV_CMOS is not set +# CONFIG_RTC_DRV_DS1553 is not set +# CONFIG_RTC_DRV_STK17TA8 is not set +# CONFIG_RTC_DRV_DS1742 is not set +# CONFIG_RTC_DRV_M48T86 is not set +# CONFIG_RTC_DRV_M48T59 is not set +# CONFIG_RTC_DRV_V3020 is not set + +# +# on-CPU RTC drivers +# +CONFIG_RTC_DRV_S3C=m + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=y +# CONFIG_EXT3_FS_XATTR is not set +# CONFIG_EXT4DEV_FS is not set +CONFIG_JBD=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +CONFIG_FS_POSIX_ACL=y +# CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_MINIX_FS is not set +CONFIG_ROMFS_FS=y +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +# CONFIG_AUTOFS_FS is not set +CONFIG_AUTOFS4_FS=m +CONFIG_FUSE_FS=m + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +# CONFIG_ZISOFS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_SYSCTL=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_CONFIGFS_FS=m + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_YAFFS_FS=y +CONFIG_YAFFS_YAFFS1=y +CONFIG_YAFFS_9BYTE_TAGS=y +CONFIG_YAFFS_YAFFS2=y +CONFIG_YAFFS_AUTO_YAFFS2=y +# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set +CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10 +# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set +# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set +CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_SUMMARY=y +# CONFIG_JFFS2_FS_XATTR is not set +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +CONFIG_JFFS2_ZLIB=y +# CONFIG_JFFS2_LZO is not set +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +CONFIG_CRAMFS=y +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +CONFIG_NFS_V4=y +# CONFIG_NFS_DIRECTIO is not set +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V3_ACL is not set +CONFIG_NFSD_V4=y +CONFIG_NFSD_TCP=y +CONFIG_ROOT_NFS=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=m +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +# CONFIG_SUNRPC_BIND34 is not set +CONFIG_RPCSEC_GSS_KRB5=y +# CONFIG_RPCSEC_GSS_SPKM3 is not set +# CONFIG_SMB_FS is not set +CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set +CONFIG_CIFS_WEAK_PW_HASH=y +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_EXPERIMENTAL is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +CONFIG_SQUASHFS=m + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +CONFIG_NLS_CODEPAGE_850=m +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set +CONFIG_NLS_ISO8859_1=y +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +CONFIG_NLS_UTF8=m +# CONFIG_DLM is not set +CONFIG_INSTRUMENTATION=y +# CONFIG_PROFILING is not set +# CONFIG_MARKERS is not set + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_ENABLE_WARN_DEPRECATED=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +CONFIG_DETECT_SOFTLOCKUP=y +# CONFIG_SCHED_DEBUG is not set +# CONFIG_SCHEDSTATS is not set +CONFIG_TIMER_STATS=y +# CONFIG_DEBUG_SLAB is not set +CONFIG_DEBUG_PREEMPT=y +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_SG is not set +CONFIG_FRAME_POINTER=y +CONFIG_FORCED_INLINING=y +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SAMPLES is not set +# CONFIG_DEBUG_USER is not set +CONFIG_DEBUG_ERRORS=y +# CONFIG_DEBUG_LL is not set +CONFIG_DEBUG_S3C_UART=2 + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_CRYPTO=y +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_NULL=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_SHA1=m +CONFIG_CRYPTO_SHA256=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_CBC=y +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_LRW=m +# CONFIG_CRYPTO_XTS is not set +# CONFIG_CRYPTO_CRYPTD is not set +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_ANUBIS=m +# CONFIG_CRYPTO_SEED is not set +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_TEST=m +# CONFIG_CRYPTO_AUTHENC is not set +CONFIG_CRYPTO_HW=y + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_CRC_CCITT=m +CONFIG_CRC16=m +# CONFIG_CRC_ITU_T is not set +CONFIG_CRC32=y +# CONFIG_CRC7 is not set +CONFIG_LIBCRC32C=m +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_TEXTSEARCH=y +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_PLIST=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_DMA=y diff --git a/packages/linux/linux-openmoko_2.6.24+git.bb b/packages/linux/linux-openmoko_2.6.24+git.bb index b1faefbd20..79e2cde8dc 100644 --- a/packages/linux/linux-openmoko_2.6.24+git.bb +++ b/packages/linux/linux-openmoko_2.6.24+git.bb @@ -3,55 +3,21 @@ require linux-openmoko.inc DESCRIPTION = "Linux 2.6.x (development) kernel for FIC SmartPhones shipping w/ Openmoko" -PV = "${KERNEL_RELEASE}+gitr${SRCREV}" -PR = "r0" - -SRC_URI = "git://git.openmoko.org/git/kernel.git;protocol=git;branch=stable \ - file://0001-squashfs-with-lzma.patch;patch=1 \ - file://0002-squashfs-initrd.patch;patch=1 \ - file://0003-squashfs-force-O2.patch;patch=1 \ - file://0004-squashfs-Kconfig.patch;patch=1 \ - file://0005-squashfs-Makefile.patch;patch=1" - -S = "${WORKDIR}/git" - -do_configure_prepend() { - cp -f ${S}/defconfig-${CONFIG_NAME} ${WORKDIR}/defconfig - echo CONFIG_SQUASHFS=m >>${WORKDIR}/defconfig -} - -############################################################## -# kernel image resides on a seperate flash partition (for now) -# -ALLOW_EMPTY = "1" - -CMDLINE = "unused -- bootloader passes ATAG list" - -COMPATIBLE_HOST = "arm.*-linux" -COMPATIBLE_MACHINE = "om-gta01|om-gta02" -DEFAULT_PREFERENCE = "1" - -KERNEL_IMAGETYPE = "uImage" KERNEL_RELEASE = "2.6.24" KERNEL_VERSION = "${KERNEL_RELEASE}" -CONFIG_NAME_om-gta01 = "gta01" -CONFIG_NAME_om-gta02 = "gta02" - -UBOOT_ENTRYPOINT = "30008000" - -############################################################### -# module configs specific to this kernel -# - -# usb -module_autoload_ohci-hcd = "ohci-hcd" -module_autoload_hci_usb = "hci_usb" -module_autoload_g_ether = "g_ether" -# audio -module_autoload_snd-soc-neo1973-wm8753 = "snd-soc-neo1973-wm8753" -module_autoload_snd-soc-neo1973-gta02-wm8753 = "snd-soc-neo1973-gta02-wm8753" -module_autoload_snd-pcm-oss = "snd-pcm-oss" -module_autoload_snd-mixer-oss = "snd-mixer-oss" -# sd/mmc -module_autoload_s3cmci = "s3cmci" +PV = "${KERNEL_RELEASE}+gitr${SRCREV}" +PR = "r4" + +SRC_URI = "\ + git://git.openmoko.org/git/kernel.git;protocol=git;branch=stable \ + \ + file://0001-squashfs-with-lzma.patch;patch=1 \ + file://0002-squashfs-initrd.patch;patch=1 \ + file://0003-squashfs-force-O2.patch;patch=1 \ + file://0004-squashfs-Kconfig.patch;patch=1 \ + file://0005-squashfs-Makefile.patch;patch=1 \ + \ + file://defconfig-oe \ +" +S = "${WORKDIR}/git" diff --git a/packages/linux/linux_2.6.25.bb b/packages/linux/linux_2.6.25.bb index e228860a49..dc9a35e3bb 100644 --- a/packages/linux/linux_2.6.25.bb +++ b/packages/linux/linux_2.6.25.bb @@ -1,6 +1,6 @@ require linux.inc -PR = "r2" +PR = "r3" # Mark archs/machines that this kernel supports DEFAULT_PREFERENCE = "-1" @@ -10,6 +10,7 @@ DEFAULT_PREFERENCE_sequoia = "1" DEFAULT_PREFERENCE_cm-x270 = "1" DEFAULT_PREFERENCE_alix = "1" DEFAULT_PREFERENCE_at32stk1000 = "1" +DEFAULT_PREFERENCE_at91-l9260 = "1" SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.25.tar.bz2 \ file://defconfig" @@ -32,6 +33,10 @@ SRC_URI_append_at32stk1000 = " \ http://avr32linux.org/twiki/pub/Main/LinuxPatches/linux-2.6.25.6.atmel.1.patch.bz2;patch=1 \ " +SRC_URI_append_at91-l9260 = " \ + http://maxim.org.za/AT91RM9200/2.6/2.6.25-at91.patch.gz;patch=1 \ +" + CMDLINE_cm-x270 = "console=${CMX270_CONSOLE_SERIAL_PORT},38400 monitor=1 mem=64M mtdparts=physmap-flash.0:256k(boot)ro,0x180000(kernel),-(root);cm-x270-nand:64m(app),-(data) rdinit=/sbin/init root=mtd3 rootfstype=jffs2" FILES_kernel-image_cm-x270 = "" diff --git a/packages/mythtv/mythtv.inc b/packages/mythtv/mythtv.inc index 4ceda5d421..9b7a0a768e 100644 --- a/packages/mythtv/mythtv.inc +++ b/packages/mythtv/mythtv.inc @@ -2,15 +2,13 @@ DESCRIPTION = "A full featured personal video recorder system." HOMEPAGE = "http://www.mythtv.org" LICENSE = "GPL" SECTION = "x11/multimedia" -DEPENDS = "libxinerama lame libxv libxxf86vm libxvmc lirc qt-x11-free" -RDEPENDS_${PN} = "qt-x11-plugins-sqldrivers qt-x11-plugins-imageformats" +DEPENDS = "jack alsa-lib lame libxinerama libxv libxxf86vm libxvmc lirc" +#RDEPENDS_${PN} = "qt-x11-plugins-sqldrivers qt-x11-plugins-imageformats" SRC_URI = "http://www.mythtv.org/mc/mythtv-${PV}.tar.bz2" -inherit qmake qt3x11 +inherit qmake2 qt4x11 -# there is a -march=586 somewhere in the source tree -COMPATIBLE_HOST = 'i.86.*-linux' QMAKE_PROFILES = "mythtv.pro" @@ -22,7 +20,7 @@ def mythtv_arch(d): elif arch == "x86_64": arch = "x86" elif arch == "arm": - arch = "armv4l" + arch = "${BASE_PACKAGE_ARCH}" return arch MYTHTV_ARCH := "${@mythtv_arch(d)}" diff --git a/packages/mythtv/mythtv/.mtn2git_empty b/packages/mythtv/mythtv/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/mythtv/mythtv/.mtn2git_empty diff --git a/packages/mythtv/mythtv/configure.patch b/packages/mythtv/mythtv/configure.patch new file mode 100644 index 0000000000..16f5076880 --- /dev/null +++ b/packages/mythtv/mythtv/configure.patch @@ -0,0 +1,131 @@ +--- /tmp/configure 2008-07-22 10:27:56.000000000 +0200 ++++ mythtv/configure 2008-07-22 12:50:43.000000000 +0200 +@@ -476,12 +476,13 @@ + } + + check_cmd(){ +- log "$@" ++ echo "Checking $@" ++ log "$@" + "$@" >>$logfile 2>&1 + } + + check_cc(){ +- log check_cc "$@" ++ log check_cc "$@" + cat >$TMPC + log_file $TMPC + check_cmd $cc $CFLAGS $ECFLAGS $OPTFLAGS "$@" -c -o $TMPO $TMPC +@@ -1117,11 +1118,11 @@ + fi + + # machine +-arch=`uname -m` ++disabled cross_compile && arch=`uname -m` + arch_raw="$arch" + cpu="generic" + cpu_override="no" +-processor=`uname -p 2>/dev/null` ++disabled cross_compile && processor=`uname -p 2>/dev/null` + processor_flags="" + tune="generic" + +@@ -1214,7 +1215,7 @@ + # build settings + SHFLAGS='-shared -Wl,-soname,$@' + VHOOKSHFLAGS='$(SHFLAGS)' +-LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil' ++#LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil' + FFSERVERLDFLAGS=-Wl,-E + LDCONFIG="ldconfig" + LIBPREF="lib" +@@ -1714,7 +1715,7 @@ + + has_library() + { +- if test -f /etc/ld.so.conf ; then ++ if test -f /etc/ld.so.conf && disabled cross_compile ; then + LIBPATHS=`cat /etc/ld.so.conf | grep -v "#" | grep -v "include"` + else + LIBPATHS='' +@@ -1725,7 +1726,7 @@ + LIBPATHS="$LIBPATHS `echo $DYLD_LIBRARY_PATH | sed s/':'/' '/g` " + + # recurse down just one level, should be enough in most cases +- if test -f /etc/ld.so.conf ; then ++ if test -f /etc/ld.so.conf && disabled cross_compile ; then + INCL=`cat /etc/ld.so.conf | grep -v "#" | grep "^include"` + SRCH=`echo "$INCL" | sed '{ s/^include \//\//; s/^include /\/etc\//}'` + for x in $SRCH ; do +@@ -1734,29 +1735,31 @@ + done + fi + +- LIBPATHS="`echo $LIBPATHS /$libdir_name /usr/$libdir_name /usr/local/$libdir_name /usr/X11R6/$libdir_name | sed s/'\/ '/' '/g` " ++ enabled cross_compile || LIBPATHS="`echo $LIBPATHS /$libdir_name /usr/$libdir_name /usr/local/$libdir_name /usr/X11R6/$libdir_name | sed s/'\/ '/' '/g` " + +- HAS_IT="no" ++ HAS_IT="yes" + for LIBPATH in $LIBPATHS ; do + if test x`ls $LIBPATH/$1* 2> /dev/null | head -n 1` != x"" ; then + HAS_IT="yes" + fi + done ++ echo "$1: $HAS_IT" + expr $HAS_IT : "yes" > /dev/null + } + + has_header() + { +- HPATHS="/usr/local/include /usr/include /usr/include/g++-v3 /usr/X11R6/include" ++ enabled cross_compile || HPATHS="/usr/local/include /usr/include /usr/include/g++-v3 /usr/X11R6/include" + INCL=`echo $DYLD_LIBRARY_PATH $LD_LIBRARY_PATH | sed s/':'/' '/g` + HPATHS="$HPATHS "$(echo $INCL | sed "s/$libdir_name/include/g") + +- HAS_IT="no" ++ HAS_IT="yes" + for HPATH in $HPATHS ; do + if test x`ls $HPATH/$1* 2> /dev/null | head -n 1` != x"" ; then + HAS_IT="yes" + fi + done ++ echo "$1: $HAS_IT" + expr $HAS_IT : "yes" > /dev/null + } + +@@ -1863,13 +1866,15 @@ + if test x"$cmov" = x"default"; then + disable cmov + if enabled cpu_override; then +- is_x86_cmov_cpu "$cpu" && enable cmov ++ disabled cross_compile && is_x86_cmov_cpu "$cpu" && enable cmov + disabled cmov || is_x86_slow_cmov_cpu "$cpu" || enable fast_cmov + elif expr "$processor_flags" : ".*cmov" > /dev/null ; then +- enable cmov ++ disabled cross_compile && enable cmov + fi + fi + ++enabled cross_compile && disable cmov ++ + # use different default ARCHFLAGS for CPU missing cmov (Via C3 ...) + if test x"$arch" = x"x86_32" && disabled cmov && disabled cpu_override; then + ARCHFLAGS="-march=i586" +@@ -2254,7 +2259,7 @@ + EOF + + if $cc $CFLAGS $ECFLAGS -o $TMPE $TMPC 2>/dev/null ; then +-$TMPE && cpuclipspositive="yes" ++enabled cross_compile || $TMPE && cpuclipspositive="yes" + fi + + # test negative wrap +@@ -2269,7 +2274,7 @@ + EOF + + if $cc $CFLAGS $ECFLAGS -o $TMPE $TMPC 2>/dev/null ; then +-$TMPE && cpuclipsnegative="yes" ++enabled cross_compile || $TMPE && cpuclipsnegative="yes" + fi + + # test for distcc diff --git a/packages/mythtv/mythtv_0.21.bb b/packages/mythtv/mythtv_0.21.bb new file mode 100644 index 0000000000..a33c446813 --- /dev/null +++ b/packages/mythtv/mythtv_0.21.bb @@ -0,0 +1,68 @@ +require mythtv.inc + +PR = "r0" + +#SRC_URI += "file://configure.patch;patch=1 \ +# file://libmyth-libdir.patch;patch=1" + +# Seen on the mythtv web page: +# http://www.mythtv.org/mc/fix-mythweb-in-0.20.diff;patch=1 + +QMAKE_PROFILES = "mythtv.pro" + +mythlibs = "mythavutil mythavcodec mythavformat myth mythtv mythui mythfreemheg mythupnp mythlivemedia" +PACKAGES =+ "mythtv-backend mythtv-frontend mythtv-bin mythtv-filters mythtv-data" + +FILES_mythtv-backend = "${bindir}/mythbackend ${bindir}/mythcommflag ${bindir}/mythfilldatabase ${bindir}/mythtranscode" +FILES_mythtv-frontend = "${bindir}/mythfrontend ${datadir}/mythtv/i18n/mythfrontend_* ${datadir}/mythtv/*.ttf" +RDEPENDS_mythtv-frontend = "qt-x11-plugins-sqldrivers qt-x11-plugins-imageformats" +FILES_mythtv-bin = "${bindir}" +FILES_mythtv-filters = "${libdir}/mythtv/filters" +FILES_mythtv-data = "${datadir}" +RDEPENDS_${PN} = "mythtv-backend mythtv-frontend mythtv-bin mythtv-filters mythtv-data" +ALLOW_EMPTY_${PN} = "1" + +PACKAGES_DYNAMIC = "mythtv-theme-*" + +python __anonymous () { + import bb + + mythlibs = bb.data.getVar('mythlibs', d).split() + pv = bb.data.expand(bb.data.getVar("PV", d), d) + + for m in mythlibs: + bb.data.setVar("FILES_lib%s%s" % (m, pv), "${libdir}/lib%s-%s.so.*" % (m, pv), d) + bb.data.setVar("FILES_lib%s%s-dev" % (m, pv), "${libdir}/lib%s-%s.*" % (m, pv), d) + + packages = " ".join(map(lambda x: "lib%s%s lib%s%s-dev" % (x, pv, x, pv), mythlibs) + bb.data.getVar("PACKAGES", d).split()) + + bb.data.setVar("PACKAGES", packages, d) +} +do_configure_prepend() { +# it's not autotools anyway, so we call ./configure directly + find . -name "Makefile"|xargs rm -f + ./configure --prefix=/usr \ + --mandir=/usr/man \ + --cpu=${MYTHTV_ARCH} \ + --disable-altivec \ + --enable-v4l \ + --enable-audio-oss \ + --enable-proc-opt \ + --enable-dvb \ + --cross-compile \ + --dvb-path=${STAGING_INCDIR} + + sed 's!PREFIX =.*!PREFIX = ${prefix}!;/INCLUDEPATH += $${PREFIX}\/include/d' < settings.pro > settings.pro.new + mv settings.pro.new settings.pro +} + +python populate_packages_prepend () { + new_packages = [] + + def the_hook(file, pkg, pattern, format, basename): + new_packages.append(pkg) + + do_split_packages(d, root=bb.data.expand('${datadir}/mythtv/themes', d), file_regex='(.*)', output_pattern='mythtv-theme-%s', description='MythTV theme %s', allow_dirs=True, hook=the_hook, prepend=True) + + bb.data.setVar("RDEPENDS_${PN}", "%s %s" % (bb.data.getVar("RDEPENDS_${PN}", d), " ".join(new_packages)), d) +} diff --git a/packages/mythtv/mythtv_svn.bb b/packages/mythtv/mythtv_svn.bb new file mode 100644 index 0000000000..24a8b3d220 --- /dev/null +++ b/packages/mythtv/mythtv_svn.bb @@ -0,0 +1,93 @@ +require mythtv.inc + +DEFAULT_PREFERENCE = "-1" + +PV = "0.21+svnr${SRCREV}" +PR = "r0" + +SRCREV = "17880" +SRC_URI = "svn://svn.mythtv.org/svn/trunk;module=mythtv;proto=http" + +SRC_URI += "file://configure.patch;patch=1 \ + " + +S = "${WORKDIR}/mythtv" + +QMAKE_PROFILES = "mythtv.pro" + +mythlibs = "mythavutil mythavcodec mythavformat myth mythtv mythui mythfreemheg mythupnp mythlivemedia" +PACKAGES =+ "mythtv-backend mythtv-frontend mythtv-bin mythtv-filters mythtv-data" + +FILES_mythtv-backend = "${bindir}/mythbackend ${bindir}/mythcommflag ${bindir}/mythfilldatabase ${bindir}/mythtranscode" +FILES_mythtv-frontend = "${bindir}/mythfrontend ${datadir}/mythtv/i18n/mythfrontend_* ${datadir}/mythtv/*.ttf" +RDEPENDS_mythtv-frontend = "qt-x11-plugins-sqldrivers qt-x11-plugins-imageformats" +FILES_mythtv-bin = "${bindir}" +FILES_mythtv-filters = "${libdir}/mythtv/filters" +FILES_mythtv-data = "${datadir}" +RDEPENDS_${PN} = "mythtv-backend mythtv-frontend mythtv-bin mythtv-filters mythtv-data" +ALLOW_EMPTY_${PN} = "1" + +PACKAGES_DYNAMIC = "mythtv-theme-*" + +python __anonymous () { + import bb + + mythlibs = bb.data.getVar('mythlibs', d).split() + pv = bb.data.expand(bb.data.getVar("PV", d), d) + + for m in mythlibs: + bb.data.setVar("FILES_lib%s%s" % (m, pv), "${libdir}/lib%s-%s.so.*" % (m, pv), d) + bb.data.setVar("FILES_lib%s%s-dev" % (m, pv), "${libdir}/lib%s-%s.*" % (m, pv), d) + + packages = " ".join(map(lambda x: "lib%s%s lib%s%s-dev" % (x, pv, x, pv), mythlibs) + bb.data.getVar("PACKAGES", d).split()) + + bb.data.setVar("PACKAGES", packages, d) +} + +EXTRA_OECONF_armv5te = " --enable-armv5te " +EXTRA_OECONF_armv6 = " --enable-armv6 " +EXTRA_OECONF_armv7a = --enable-armv6" + +#build with support for the iwmmxt instruction and pxa270fb overlay support (pxa270 and up) +#not every iwmmxt machine has the lcd connected to pxafb, but building the module doesn't hurt +MY_ARCH := "${PACKAGE_ARCH}" +PACKAGE_ARCH = "${@base_contains('MACHINE_FEATURES', 'iwmmxt', 'iwmmxt', '${MY_ARCH}',d)}" + +MY_TARGET_CC_ARCH := "${TARGET_CC_ARCH}" +TARGET_CC_ARCH = "${@base_contains('MACHINE_FEATURES', 'iwmmxt', '-march=iwmmxt -mtune=iwmmxt', '${MY_TARGET_CC_ARCH}',d)}" + +EXTRA_OECONF_append = " ${@base_contains('MACHINE_FEATURES', 'iwmmxt', '--enable-pxa --enable-iwmmxt', '',d)} " + + +do_configure_prepend() { +# it's not autotools anyway, so we call ./configure directly + find . -name "Makefile"|xargs rm -f + ./configure --prefix=/usr \ + --mandir=/usr/man \ + --cpu=${MYTHTV_ARCH} \ + --arch=${MYTHTV_ARCH} \ + --disable-altivec \ + --disable-strip \ + --enable-v4l \ + --enable-audio-oss \ + --enable-proc-opt \ + --enable-dvb \ + --enable-libmp3lame \ + --cross-compile \ + --dvb-path=${STAGING_INCDIR} \ + ${EXTRA_OECONF} + + sed 's!PREFIX =.*!PREFIX = ${prefix}!;/INCLUDEPATH += $${PREFIX}\/include/d' < settings.pro > settings.pro.new + mv settings.pro.new settings.pro +} + +python populate_packages_prepend () { + new_packages = [] + + def the_hook(file, pkg, pattern, format, basename): + new_packages.append(pkg) + + do_split_packages(d, root=bb.data.expand('${datadir}/mythtv/themes', d), file_regex='(.*)', output_pattern='mythtv-theme-%s', description='MythTV theme %s', allow_dirs=True, hook=the_hook, prepend=True) + + bb.data.setVar("RDEPENDS_${PN}", "%s %s" % (bb.data.getVar("RDEPENDS_${PN}", d), " ".join(new_packages)), d) +} diff --git a/packages/openmoko-projects/illume_svn.bb b/packages/openmoko-projects/illume_svn.bb index f3fb611e09..b58bc2c1d6 100644 --- a/packages/openmoko-projects/illume_svn.bb +++ b/packages/openmoko-projects/illume_svn.bb @@ -1,25 +1,50 @@ -DESCRIPTION = "Illume - Mobile UI module for Enlightenment" -HOMEPAGE = "http://illume.projects.openmoko.org/" +DESCRIPTION = "Illume - A mobile UI module for the Enlightenment Window Manager" +HOMEPAGE = "http://illume.projects.openmoko.org" +AUTHOR = "Rasterman" LICENSE = "MIT/BSD" DEPENDS = "e-wm eet evas ecore edje embryo efreet edbus edje-native embryo-native" -RRECOMMENDS = "wamerican" PV = "0.0+svnr${SRCREV}" -PR = "r6" - -SRC_URI = "svn://svn.projects.openmoko.org/svnroot/;module=${PN};proto=https" +PR = "r7" +SRC_URI = "svn://svn.projects.openmoko.org/svnroot/;module=${PN};proto=http" S = "${WORKDIR}/${PN}" inherit autotools pkgconfig -EXTRA_OECONF = "--x-includes=${STAGING_INCDIR}/X11 \ - --x-libraries=${STAGING_LIBDIR} \ - --enable-simple-x11 \ - --with-edje-cc=${STAGING_BINDIR_NATIVE}/edje_cc" +EXTRA_OECONF = "\ + --x-includes=${STAGING_INCDIR}/X11 \ + --x-libraries=${STAGING_LIBDIR} \ + --enable-simple-x11 \ + --with-edje-cc=${STAGING_BINDIR_NATIVE}/edje_cc \ +" + +RRECOMMENDS_${PN} = "\ + wamerican \ + ${PN}-config \ + ${PN}-dicts-default \ + ${PN}-keyboards-default \ + ${PN}-keyboards-numbers \ +" + +PACKAGES =+ "\ + ${PN}-config \ + ${PN}-dicts-default \ + ${PN}-keyboards-default \ + ${PN}-keyboards-numbers \ +" +PACKAGE_ARCH_${PN}-config = "all" +PACKAGE_ARCH_${PN}-dicts-default = "all" +PACKAGE_ARCH_${PN}-keyboards-default = "all" +PACKAGE_ARCH_${PN}-keyboards-numbers = "all" + +FILES_${PN}-config = "${datadir}/enlightenment/data/config/*/* ${datadir}/illume" +FILES_${PN}-dicts-default = "${libdir}/enlightenment/modules/illume/dicts/Default.dic" +FILES_${PN}-keyboards-default = "${libdir}/enlightenment/modules/illume/keyboards/Default.kbd" +FILES_${PN}-keyboards-numbers = "${libdir}/enlightenment/modules/illume/keyboards/Numbers.kbd" -FILES_${PN} = "${libdir}/enlightenment/modules/*/*.edj \ - ${libdir}/enlightenment/modules/*/*.desktop \ - ${libdir}/enlightenment/modules/*/*/* \ - ${datadir}/enlightenment/data/config/*/* \ - ${datadir}/${PN} " +FILES_${PN} = "\ + ${libdir}/enlightenment/modules/*/*.edj \ + ${libdir}/enlightenment/modules/*/*.desktop \ + ${libdir}/enlightenment/modules/*/*/* \ +" FILES_${PN}-dbg += "${libdir}/enlightenment/modules/*/*/.debug/" diff --git a/packages/openmoko-projects/tangogps/global-config-h.patch b/packages/openmoko-projects/tangogps/global-config-h.patch deleted file mode 100644 index 973710c942..0000000000 --- a/packages/openmoko-projects/tangogps/global-config-h.patch +++ /dev/null @@ -1,30 +0,0 @@ -Index: tangoGPS-0.7/src/globals.c -=================================================================== ---- tangoGPS-0.7.orig/src/globals.c 2008-03-13 14:21:02.000000000 +0800 -+++ tangoGPS-0.7/src/globals.c 2008-03-13 14:28:49.000000000 +0800 -@@ -3,11 +3,11 @@ - * License GPLv2 - ****************************************************************************/ - -+#include "globals.h" -+ - #include <gtk/gtk.h> - #include <gps.h> - --#include "globals.h" -- - GdkPixmap *pixmap = NULL; - GtkWidget *window1 = NULL; - GtkWidget *window2 = NULL; -Index: tangoGPS-0.7/src/globals.h -=================================================================== ---- tangoGPS-0.7.orig/src/globals.h 2008-03-13 14:27:46.000000000 +0800 -+++ tangoGPS-0.7/src/globals.h 2008-03-13 14:27:48.000000000 +0800 -@@ -1,3 +1,7 @@ -+#ifdef HAVE_CONFIG_H -+# include <config.h> -+#endif -+ - #include <gtk/gtk.h> - #include <gconf/gconf-client.h> - diff --git a/packages/openmoko-projects/tangogps_0.7.bb b/packages/openmoko-projects/tangogps_0.7.bb deleted file mode 100644 index 63513ffe00..0000000000 --- a/packages/openmoko-projects/tangogps_0.7.bb +++ /dev/null @@ -1,17 +0,0 @@ -DESCRIPTION = "tangoGPS map" -AUTHOR = "Marcus Bauer <marcus.bauer@gmail.com>" -HOMEPAGE = "http://tangogps.org/" -SECTION = "openmoko/pim" -PRIORITY = "optional" -LICENSE = "GPLv2" -DEPENDS = "curl gtk+ gpsd" -PR = "r1" - -SRC_URI = "http://tangogps.org/tangoGPS-0.7.tar.gz \ - file://global-config-h.patch;patch=1" - -S = "${WORKDIR}/tangoGPS-0.7" - -inherit autotools - -CPPFLAGS += "-I${STAGING_INCDIR}/gconf/2/" diff --git a/packages/python/python-2.5-manifest.inc b/packages/python/python-2.5-manifest.inc index 06c187fe91..95a7bd8e0b 100644 --- a/packages/python/python-2.5-manifest.inc +++ b/packages/python/python-2.5-manifest.inc @@ -1,5 +1,5 @@ ######################################################################################################################## -### AUTO-GENERATED by '../../contrib/python/generate-manifest-2.5.py' [(C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>] on Thu May 1 12:24:55 2008 +### AUTO-GENERATED by '../../contrib/python/generate-manifest-2.5.py' [(C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>] on Mon Jul 21 17:03:43 2008 ### ### Visit THE Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy ### @@ -8,9 +8,9 @@ ######################################################################################################################## -PROVIDES+="python-profile python-threading python-distutils python-textutils python-codecs python-ctypes python-pickle python-datetime python-core python-io python-compiler python-compression python-re python-xmlrpc python-terminal python-email python-image python-tests python-core-dbg python-resource python-devel python-math python-hotshot python-unixadmin python-syslog python-tkinter python-gdbm python-fcntl python-netclient python-pprint python-netserver python-curses python-smtpd python-html python-readline python-subprocess python-pydoc python-logging python-mailbox python-xml python-mime python-sqlite3 python-sqlite3-tests python-unittest python-stringold python-robotparser python-lib-old-and-deprecated python-compile python-debugger python-shell python-bsddb python-mmap python-zlib python-db python-crypt python-idle python-lang python-audio " +PROVIDES+="python-profile python-threading python-distutils python-textutils python-codecs python-ctypes python-pickle python-datetime python-core python-io python-compiler python-compression python-re python-xmlrpc python-terminal python-email python-image python-doctest python-tests python-core-dbg python-resource python-devel python-difflib python-math python-hotshot python-unixadmin python-syslog python-tkinter python-gdbm python-fcntl python-netclient python-pprint python-netserver python-curses python-smtpd python-html python-readline python-subprocess python-pydoc python-logging python-mailbox python-xml python-mime python-sqlite3 python-sqlite3-tests python-unittest python-stringold python-robotparser python-lib-old-and-deprecated python-compile python-debugger python-shell python-bsddb python-mmap python-zlib python-db python-crypt python-idle python-lang python-audio " -PACKAGES="python-profile python-threading python-distutils python-textutils python-codecs python-ctypes python-pickle python-datetime python-core python-io python-compiler python-compression python-re python-xmlrpc python-terminal python-email python-image python-tests python-core-dbg python-resource python-devel python-math python-hotshot python-unixadmin python-syslog python-tkinter python-gdbm python-fcntl python-netclient python-pprint python-netserver python-curses python-smtpd python-html python-readline python-subprocess python-pydoc python-logging python-mailbox python-xml python-mime python-sqlite3 python-sqlite3-tests python-unittest python-stringold python-robotparser python-lib-old-and-deprecated python-compile python-debugger python-shell python-bsddb python-mmap python-zlib python-db python-crypt python-idle python-lang python-audio " +PACKAGES="python-profile python-threading python-distutils python-textutils python-codecs python-ctypes python-pickle python-datetime python-core python-io python-compiler python-compression python-re python-xmlrpc python-terminal python-email python-image python-doctest python-tests python-core-dbg python-resource python-devel python-difflib python-math python-hotshot python-unixadmin python-syslog python-tkinter python-gdbm python-fcntl python-netclient python-pprint python-netserver python-curses python-smtpd python-html python-readline python-subprocess python-pydoc python-logging python-mailbox python-xml python-mime python-sqlite3 python-sqlite3-tests python-unittest python-stringold python-robotparser python-lib-old-and-deprecated python-compile python-debugger python-shell python-bsddb python-mmap python-zlib python-db python-crypt python-idle python-lang python-audio " DESCRIPTION_python-profile="Python Basic Profiling Support" PR_python-profile="ml0" @@ -97,6 +97,11 @@ PR_python-image="ml0" RDEPENDS_python-image="python-core" FILES_python-image="${libdir}/python2.5/colorsys.* ${libdir}/python2.5/imghdr.* ${libdir}/python2.5/lib-dynload/imageop.so ${libdir}/python2.5/lib-dynload/rgbimg.so " +DESCRIPTION_python-doctest="Python framework for running examples in docstrings." +PR_python-doctest="ml0" +RDEPENDS_python-doctest="python-core python-lang python-io python-re python-unittest python-debugger python-difflib" +FILES_python-doctest="${libdir}/python2.5/doctest.* " + DESCRIPTION_python-tests="Python Tests" PR_python-tests="ml0" RDEPENDS_python-tests="python-core" @@ -117,6 +122,11 @@ PR_python-devel="ml0" RDEPENDS_python-devel="python-core" FILES_python-devel="${includedir} ${libdir}/python2.5/config " +DESCRIPTION_python-difflib="Python helpers for computing deltas between objects." +PR_python-difflib="ml0" +RDEPENDS_python-difflib="python-lang python-re" +FILES_python-difflib="${libdir}/python2.5/difflib.* " + DESCRIPTION_python-math="Python Math Support" PR_python-math="ml0" RDEPENDS_python-math="python-core" @@ -253,8 +263,8 @@ RDEPENDS_python-compile="python-core" FILES_python-compile="${libdir}/python2.5/py_compile.* ${libdir}/python2.5/compileall.* " DESCRIPTION_python-debugger="Python Debugger" -PR_python-debugger="ml0" -RDEPENDS_python-debugger="python-core python-io python-lang python-re python-stringold python-shell" +PR_python-debugger="ml1" +RDEPENDS_python-debugger="python-core python-io python-lang python-re python-stringold python-shell python-pprint" FILES_python-debugger="${libdir}/python2.5/bdb.* ${libdir}/python2.5/pdb.* " DESCRIPTION_python-shell="Python Shell-Like Functionality" diff --git a/packages/python/python_2.5.2.bb b/packages/python/python_2.5.2.bb index 9617871fff..b47ed0b7cf 100644 --- a/packages/python/python_2.5.2.bb +++ b/packages/python/python_2.5.2.bb @@ -6,7 +6,7 @@ PRIORITY = "optional" DEPENDS = "python-native readline zlib gdbm openssl sqlite3 tcl tk" DEPENDS_sharprom = "python-native readline zlib gdbm openssl" # bump this on every change in contrib/python/generate-manifest-2.5.py -PR = "ml6" +PR = "ml7" PYTHON_MAJMIN = "2.5" diff --git a/packages/tasks/task-base.bb b/packages/tasks/task-base.bb index 9c9c3e43bb..69dfd0133d 100644 --- a/packages/tasks/task-base.bb +++ b/packages/tasks/task-base.bb @@ -1,5 +1,5 @@ DESCRIPTION = "Merge machine and distro options to create a basic machine task/package" -PR = "r70" +PR = "r71" inherit task diff --git a/packages/tasks/task-boot.bb b/packages/tasks/task-boot.bb index cb4db34e64..4c17eeaa04 100644 --- a/packages/tasks/task-boot.bb +++ b/packages/tasks/task-boot.bb @@ -1,5 +1,5 @@ DESCRIPTION = "Basic task to get a device booting" -PR = "r44" +PR = "r45" inherit task diff --git a/packages/u-boot/u-boot-mkimage-openmoko-native_oe.bb b/packages/u-boot/u-boot-mkimage-openmoko-native_oe.bb index 08c0062fab..8b5564c14c 100644 --- a/packages/u-boot/u-boot-mkimage-openmoko-native_oe.bb +++ b/packages/u-boot/u-boot-mkimage-openmoko-native_oe.bb @@ -1,4 +1,4 @@ -require u-boot-openmoko_svn.bb +require u-boot-openmoko_git.bb inherit native diff --git a/packages/u-boot/u-boot-openmoko-devel_git.bb b/packages/u-boot/u-boot-openmoko-devel_git.bb index c1a5cefe77..3659241dfa 100644 --- a/packages/u-boot/u-boot-openmoko-devel_git.bb +++ b/packages/u-boot/u-boot-openmoko-devel_git.bb @@ -1,72 +1,8 @@ -DESCRIPTION = "U-boot bootloader w/ Neo1973 (GTA01) and Neo FreeRunner (GTA02) support" -AUTHOR = "Harald Welte <laforge@openmoko.org>" -LICENSE = "GPL" -SECTION = "bootloader" -PRIORITY = "optional" -PROVIDES = "virtual/bootloader" -LOCALVERSION = "+git${SRCREV}" -PV = "1.3.1${LOCALVERSION}" -PR = "r1" +require u-boot-openmoko.inc -UBOOT_MACHINES = "gta01bv2 gta01bv3 gta01bv4 gta02v2 gta02v4 gta02v5" - -DEFAULT_PREFERENCE = "-1" - -SRCREV_FORMAT = "git.openmoko.org" - -SRCREV = "1dd080c17b105da5cd4720307fa62de38276796a" - -SRC_URI = "git://git.openmoko.org/git/u-boot.git;protocol=git;branch=andy \ - file://uboot-20070311-tools_makefile_ln_sf.patch;patch=1 \ +SRC_URI = "\ + git://git.openmoko.org/git/u-boot.git;protocol=git;branch=andy \ file://makefile-no-dirafter.patch;patch=1 \ " S = "${WORKDIR}/git" -EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX}" -TARGET_LDFLAGS = "" - -do_svnrev() { - mv -f tools/setlocalversion tools/setlocalversion.old - echo "echo ${LOCALVERSION}" >>tools/setlocalversion -} - -do_compile () { - chmod +x board/neo1973/gta*/split_by_variant.sh - for mach in ${UBOOT_MACHINES} - do - oe_runmake ${mach}_config - oe_runmake clean - find board -name lowlevel_foo.bin -exec rm '{}' \; - oe_runmake all - oe_runmake u-boot.udfu - if [ -f u-boot.udfu ]; then - mv u-boot.udfu u-boot_${mach}.bin - else - mv u-boot.bin u-boot_${mach}.bin - fi - if [ -f board/${mach}/lowlevel_foo.bin ]; then - mv board/${mach}/lowlevel_foo.bin lowlevel_foo_${mach}.bin - else - find board -name lowlevel_foo.bin -exec mv '{}' lowlevel_foo_${mach}.bin \; - fi - done -} - -do_deploy () { - install -d ${DEPLOY_DIR_IMAGE} - for mach in ${UBOOT_MACHINES} - do - install -m 0644 ${S}/u-boot_${mach}.bin ${DEPLOY_DIR_IMAGE}/u-boot-${mach}-${PV}-${PR}.bin - ln -sf ${DEPLOY_DIR_IMAGE}/u-boot-${mach}-${PV}-${PR}.bin ${DEPLOY_DIR_IMAGE}/uboot-${mach}-latest.bin - if [ -f ${S}/lowlevel_foo_${mach}.bin ]; then - install -m 0644 ${S}/lowlevel_foo_${mach}.bin ${DEPLOY_DIR_IMAGE}/lowlevel_foo-${mach}-${PV}-${PR}.bin - ln -sf ${DEPLOY_DIR_IMAGE}/lowlevel_foo-${mach}-${PV}-${PR}.bin ${DEPLOY_DIR_IMAGE}/lowlevel-foo-${mach}-latest.bin - fi - done - install -m 0755 tools/mkimage ${STAGING_BINDIR_NATIVE}/uboot-mkimage -} - -do_deploy[dirs] = "${S}" -addtask deploy before do_package after do_install -addtask quilt before do_patch after do_unpack -addtask svnrev before do_patch after do_quilt diff --git a/packages/u-boot/u-boot-openmoko_svn.bb b/packages/u-boot/u-boot-openmoko.inc index ba172c094e..c25afd38f6 100644 --- a/packages/u-boot/u-boot-openmoko_svn.bb +++ b/packages/u-boot/u-boot-openmoko.inc @@ -1,40 +1,20 @@ DESCRIPTION = "U-boot bootloader w/ Neo1973 (GTA01) and Neo FreeRunner (GTA02) support" -AUTHOR = "Harald Welte <laforge@openmoko.org>" +AUTHOR = "Harald Welte <laforge@openmoko.org> et. al." LICENSE = "GPL" SECTION = "bootloader" PRIORITY = "optional" PROVIDES = "virtual/bootloader" -LOCALVERSION = "+git${SRCDATE}+svnr${SRCREV}" +LOCALVERSION = "+gitr${SRCREV}" PV = "1.3.1${LOCALVERSION}" -PR = "r1" - -SRCREV_FORMAT = "patches" +PR = "r0" UBOOT_MACHINES = "gta01bv2 gta01bv3 gta01bv4 gta02v2 gta02v4 gta02v5" DEFAULT_PREFERENCE = "-1" -BLESSED_GIT_REV = "928d1d77f8623c120d8763e20e1ca58df9c5c4c6" - -SRC_URI = "\ - -git://www.denx.de/git/u-boot.git/;protocol=git;name=upstream;tag=${BLESSED_GIT_REV} \ - svn://svn.openmoko.org/trunk/src/target/u-boot;module=patches;proto=http;name=patches \ - file://uboot-eabi-fix-HACK.patch;patch=1;maxrev=3773 \ - file://uboot-20070311-tools_makefile_ln_sf.patch;patch=1 \ - file://makefile-no-dirafter.patch;patch=1 \ - file://boot-menu-gfx-fix-openmoko-bug-1140.patch;patch=1;maxrev=3775 \ -" -S = "${WORKDIR}/git" - EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX}" TARGET_LDFLAGS = "" -do_quilt() { - mv ${WORKDIR}/patches ${S}/patches && cd ${S} && quilt push -av - rm -Rf patches .pc -} - do_svnrev() { mv -f tools/setlocalversion tools/setlocalversion.old echo "echo ${LOCALVERSION}" >>tools/setlocalversion diff --git a/packages/u-boot/u-boot-openmoko_1.2.0+git+svn.bb b/packages/u-boot/u-boot-openmoko_1.2.0+git+svn.bb deleted file mode 100644 index 2610e16040..0000000000 --- a/packages/u-boot/u-boot-openmoko_1.2.0+git+svn.bb +++ /dev/null @@ -1,86 +0,0 @@ -DESCRIPTION = "U-boot bootloader w/ Neo1973 (GTA01) support" -AUTHOR = "Harald Welte <laforge@openmoko.org>, Openmoko <openmoko-kernel@lists.openmoko.org>" -LICENSE = "GPL" -SECTION = "bootloader" -PRIORITY = "optional" - -UBOOT_UPSTREAM_REV = "f34024d4a328e6edd906456da98d2c537155c4f7" -UBOOT_OPENMOKO_REV = "2943" -UBOOT_MACHINES = "gta01bv2 gta01bv3 gta01bv4" - -LOCALVERSION = "+git${UBOOT_UPSTREAM_REV}+svn${UBOOT_OPENMOKO_REV}" -PV = "1.2.0${LOCALVERSION}" -PR = "r2" - -PROVIDES = "virtual/bootloader" -S = "${WORKDIR}/git" - -SRC_URI = "\ - git://www.denx.de/git/u-boot.git;protocol=git;tag=${UBOOT_UPSTREAM_REV} \ - svn://svn.openmoko.org/trunk/src/target/u-boot;module=patches;rev=${UBOOT_OPENMOKO_REV};proto=http \ - file://uboot-eabi-fix-HACK.patch \ - file://uboot-20070311-tools_makefile_ln_sf.patch;patch=1 \ - file://makefile-no-dirafter.patch;patch=1 \ -" - -EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX}" -TARGET_LDFLAGS = "" - -do_quilt() { - mv ${WORKDIR}/patches ${S}/patches && cd ${S} && quilt push -av - rm -Rf patches .pc -} - -do_svnrev() { - mv -f tools/setlocalversion tools/setlocalversion.old - echo "echo ${LOCALVERSION}" >>tools/setlocalversion -} - -do_configure_prepend() { - find . -name "*.mk" -exec sed -i 's,-mabi=apcs-gnu,,' {} \; - find . -name "Makefile" -exec sed -i 's,-mabi=apcs-gnu,,' {} \; - cat ${WORKDIR}/uboot-eabi-fix-HACK.patch |patch -p1 -} - -do_compile () { - chmod +x board/neo1973/gta*/split_by_variant.sh - for mach in ${UBOOT_MACHINES} - do - oe_runmake ${mach}_config - oe_runmake clean - find board -name lowlevel_foo.bin -exec rm '{}' \; - oe_runmake all - oe_runmake u-boot.udfu - if [ -f u-boot.udfu ]; then - mv u-boot.udfu u-boot_${mach}.bin - else - mv u-boot.bin u-boot_${mach}.bin - fi - if [ -f board/${mach}/lowlevel_foo.bin ]; then - mv board/${mach}/lowlevel_foo.bin \ - lowlevel_foo_${mach}.bin - else - find board -name lowlevel_foo.bin \ - -exec mv '{}' lowlevel_foo_${mach}.bin \; - fi - done -} - -do_deploy () { - install -d ${DEPLOY_DIR_IMAGE} - for mach in ${UBOOT_MACHINES} - do - install -m 0644 ${S}/u-boot_${mach}.bin ${DEPLOY_DIR_IMAGE}/u-boot-${mach}-${PV}-${PR}.bin - ln -sf ${DEPLOY_DIR_IMAGE}/u-boot-${mach}-${PV}-${PR}.bin ${DEPLOY_DIR_IMAGE}/uboot-${mach}-latest.bin - if [ -f ${S}/lowlevel_foo_${mach}.bin ]; then - install -m 0644 ${S}/lowlevel_foo_${mach}.bin ${DEPLOY_DIR_IMAGE}/lowlevel_foo-${mach}-${PV}-${PR}.bin - ln -sf ${DEPLOY_DIR_IMAGE}/lowlevel_foo-${mach}-${PV}-${PR}.bin ${DEPLOY_DIR_IMAGE}/lowlevel-foo-${mach}-latest.bin - fi - done - install -m 0755 tools/mkimage ${STAGING_BINDIR_NATIVE}/uboot-mkimage -} - -do_deploy[dirs] = "${S}" -addtask deploy before do_package after do_install -addtask quilt before do_patch after do_unpack -addtask svnrev before do_patch after do_quilt diff --git a/packages/u-boot/u-boot-openmoko_1.3.1+git+svn.bb b/packages/u-boot/u-boot-openmoko_1.3.1+git+svn.bb deleted file mode 100644 index 502a62b6ea..0000000000 --- a/packages/u-boot/u-boot-openmoko_1.3.1+git+svn.bb +++ /dev/null @@ -1,77 +0,0 @@ -DESCRIPTION = "U-boot bootloader w/ Neo1973 (GTA01) and Neo FreeRunner (GTA02) support" -AUTHOR = "Harald Welte <laforge@openmoko.org>, Openmoko <openmoko-kernel@lists.openmoko.org>" -LICENSE = "GPL" -SECTION = "bootloader" -PRIORITY = "optional" - -UBOOT_UPSTREAM_REV = "b29661fc1151077776454288051bc9a488351ce8" -UBOOT_MACHINES = "gta01bv2 gta01bv3 gta01bv4 gta02v2 gta02v3 gta02v4 gta02v5" -SRCREV_FORMAT = "patchset" - -PV = "1.3.1+svnr${SRCREV}+git${UBOOT_UPSTREAM_REV}" -PR = "r3" - -PROVIDES = "virtual/bootloader" -S = "${WORKDIR}/git" - -SRC_URI = "\ - git://www.denx.de/git/u-boot.git;protocol=git;tag=${UBOOT_UPSTREAM_REV};name=upstream \ - svn://svn.openmoko.org/trunk/src/target/u-boot;module=patches;proto=http;name=patchset \ - file://uboot-20070311-tools_makefile_ln_sf.patch;patch=1 \ -" - -EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX}" -TARGET_LDFLAGS = "" - -do_quilt() { - mv ${WORKDIR}/patches ${S}/patches && cd ${S} && quilt push -av - rm -Rf patches .pc -} - -do_svnrev() { - mv -f tools/setlocalversion tools/setlocalversion.old - echo "echo ${LOCALVERSION}" >>tools/setlocalversion -} - -do_compile () { - chmod +x board/neo1973/gta*/split_by_variant.sh - for mach in ${UBOOT_MACHINES} - do - oe_runmake ${mach}_config - oe_runmake clean - find board -name lowlevel_foo.bin -exec rm '{}' \; - oe_runmake all - oe_runmake u-boot.udfu - if [ -f u-boot.udfu ]; then - mv u-boot.udfu u-boot_${mach}.bin - else - mv u-boot.bin u-boot_${mach}.bin - fi - if [ -f board/${mach}/lowlevel_foo.bin ]; then - mv board/${mach}/lowlevel_foo.bin \ - lowlevel_foo_${mach}.bin - else - find board -name lowlevel_foo.bin \ - -exec mv '{}' lowlevel_foo_${mach}.bin \; - fi - done -} - -do_deploy () { - install -d ${DEPLOY_DIR_IMAGE} - for mach in ${UBOOT_MACHINES} - do - install -m 0644 ${S}/u-boot_${mach}.bin ${DEPLOY_DIR_IMAGE}/u-boot-${mach}-${PV}-${PR}.bin - ln -sf ${DEPLOY_DIR_IMAGE}/u-boot-${mach}-${PV}-${PR}.bin ${DEPLOY_DIR_IMAGE}/uboot-${mach}-latest.bin - if [ -f ${S}/lowlevel_foo_${mach}.bin ]; then - install -m 0644 ${S}/lowlevel_foo_${mach}.bin ${DEPLOY_DIR_IMAGE}/lowlevel_foo-${mach}-${PV}-${PR}.bin - ln -sf ${DEPLOY_DIR_IMAGE}/lowlevel_foo-${mach}-${PV}-${PR}.bin ${DEPLOY_DIR_IMAGE}/lowlevel-foo-${mach}-latest.bin - fi - done - install -m 0755 tools/mkimage ${STAGING_BINDIR_NATIVE}/uboot-mkimage -} - -do_deploy[dirs] = "${S}" -addtask deploy before do_package after do_install -addtask quilt before do_patch after do_unpack -addtask svnrev before do_patch after do_quilt diff --git a/packages/u-boot/u-boot-openmoko_git.bb b/packages/u-boot/u-boot-openmoko_git.bb new file mode 100644 index 0000000000..8555f5fdc2 --- /dev/null +++ b/packages/u-boot/u-boot-openmoko_git.bb @@ -0,0 +1,7 @@ +require u-boot-openmoko.inc + +SRC_URI = "\ + git://git.openmoko.org/git/u-boot.git;protocol=git;branch=stable \ + file://makefile-no-dirafter.patch;patch=1 \ +" +S = "${WORKDIR}/git" diff --git a/packages/vlc/vlc-davinci_0.8.6h.bb b/packages/vlc/vlc-davinci_0.8.6h.bb index 9d64cb4901..28c4a8a38c 100644 --- a/packages/vlc/vlc-davinci_0.8.6h.bb +++ b/packages/vlc/vlc-davinci_0.8.6h.bb @@ -19,7 +19,8 @@ S = "${WORKDIR}/git" inherit autotools EXTRA_OECONF = "\ - --with-contrib \ + --enable-libtool \ + --with-contrib \ --disable-dvdread \ --disable-wxwidgets \ --disable-skins2 \ @@ -53,10 +54,6 @@ do_stage() { autotools_stage_all } -do_compile() { - ${S}/compile -} - RCONFLICTS_${PN} = "vlc" FILES_${PN} += "${bindir}/vlc \ |