From 8d89651ef729e560ad96dcfc002fcde6ff7f923b Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Thu, 8 Oct 2015 22:46:13 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- .gitreview | 4 + COPYING.MIT | 17 + README | 14 + meta-aarch64/conf/layer.conf | 14 + meta-aarch64/conf/machine/genericarmv8.conf | 37 + meta-aarch64/conf/machine/genericarmv8b.conf | 8 + .../conf/machine/include/arm64/arch-armv8.inc | 20 + .../recipes-core/openjdk/openjdk-8-common.inc | 267 + meta-aarch64/recipes-core/openjdk/openjdk-8_0.1.bb | 29 + .../packagegroups/packagegroup-core-sdk.bbappend | 16 + .../kexec-tools/files/add-arm64-support.patch | 521 + .../kexec-tools/kexec-tools_2.0.7.bbappend | 5 + .../recipes-kernel/sysprof/sysprof_git.bbappend | 1 + .../0001-libatomic_ops-Aarch64-basic-port.patch | 232 + .../pulseaudio/libatomics-ops_7.2.bbappend | 5 + meta-aarch64/recipes-qt/qt4/files/aarch64.patch | 39 + .../recipes-qt/qt4/qt4-x11-free_4.8.6.bbappend | 5 + .../recipes-support/emacs/emacs_23.4.bbappend | 1 + meta-bigendian/conf/layer.conf | 9 + .../initscripts/initscripts_1.0.bbappend | 1 + .../python/python-numpy_1.7.0.bbappend | 8 + .../python/python/python_ffi_armeb_be8.patch | 34 + .../recipes-devtools/python/python_2.7.3.bbappend | 3 + .../strace/strace/strace-4.8-arm-be8.patch | 37 + .../recipes-devtools/strace/strace_%.bbappend | 3 + .../libffi/libffi/libffi_armeb_be8.patch | 37 + .../recipes-gnome/libffi/libffi_3.1.bbappend | 3 + .../recipes-kernel/sysprof/sysprof_git.bbappend | 1 + meta-linaro-integration/README | 15 + meta-linaro-integration/conf/layer.conf | 16 + .../recipes-core/busybox/busybox_%.bbappend | 3 + .../recipes-core/busybox/files/linaro.cfg | 6 + .../recipes-overlayed/acpica/acpica_20140828.bb | 34 + ...lter-to-allow-destination-directory-as-ar.patch | 59 + .../acpica/acpitests/aapits-linux.patch | 336 + .../acpica/acpitests/aapits-makefile.patch | 34 + .../recipes-overlayed/acpica/acpitests_20140828.bb | 37 + .../recipes-overlayed/acpica/files/no-werror.patch | 32 + .../firefox/firefox/configure.patch | 7345 +++++++ ...Add-a-2-minutes-timeout-on-xpcshell-tests.patch | 44 + ...-preferences-directory-for-applications-p.patch | 34 + .../Add-soname-to-appropriate-libraries.patch | 168 + ...com-being-excluded-from-linked-libraries-.patch | 25 + ...-sessionstore-data-to-keep-windows-out-of.patch | 35 + ...Use-Preprocessor.py-filters-in-defines-an.patch | 117 + ...things-during-configure-when-using-libxul.patch | 149 + ...me-detection-of-2-bytes-wchar_t-and-char1.patch | 69 + .../Don-t-build-example-component.patch | 20 + ...-out-when-run-time-libsqlite-is-older-tha.patch | 30 + .../Don-t-install-system-profile.patch | 21 + ...ter-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch | 24 + ...t-to-build-against-nanojit-headers-in-dis.patch | 36 + ...round-to-avoid-installing-test-idl-and-in.patch | 71 + ...sition-to-etc-appname-searchplugins-more-.patch | 73 + ...em-libjpeg-libpng-and-zlib-version-checki.patch | 42 + ...shell-when-running-make-install-from-js-s.patch | 32 + ...sing-nanojit-and-.tbl-headers-from-js-src.patch | 85 + ...bution-search-plugins-from-etc-appname-se.patch | 50 + ...ble-for-xulrunner-base-version-in-various.patch | 39 + ...files-don-t-need-to-require-the-version-o.patch | 47 + ...reference-files-to-set-locked-prefs-with-.patch | 115 + ...-with-mesa-assuming-users-will-have-updat.patch | 26 + ...ous-Run-items-in-application-handlers-con.patch | 57 + ...Try-getting-general.useragent.locale-as-a.patch | 41 + ...Use-YARR-interpreter-instead-of-PCRE-on-p.patch | 285 + ...Block-OpenGL-1-drivers-explicitly-to-stee.patch | 69 + ...Fix-for-error-ftruncate-was-not-declared-.patch | 26 + ...Try-creating-a-named-cursor-before-a-bitm.patch | 85 + ...Don-t-crash-an-app-using-libxul-because-o.patch | 23 + ...Bump-required-libvpx-version-to-1.0.0.-r-.patch | 47 + ...gcc-4.7-build-failures-missing-headers-.-.patch | 52 + ...Allow-to-build-with-system-python-ply-lib.patch | 82 + ...Allow-the-Nouveau-driver-with-Mesa-8.0.1-.patch | 24 + ...Block-the-Nouveau-3D-driver-as-it-s-insta.patch | 56 + ...fix-build-failures-with-Clang-and-GCC-4.7.patch | 76 + ...47322-Fix-jemalloc-mmap-wrapper-for-s390x.patch | 25 + ...Only-export-TabMessageUtils.h-in-mozilla-.patch | 49 + ...sts-using-CurProcD-where-GreD-should-be-u.patch | 49 + ...ent-libraries-with-their-real-path-to-avo.patch | 23 + ...-launch-applications-set-in-HOME-.mailcap.patch | 47 + ...a11y-disabled-in-Gnome-3-when-GNOME_ACCES.patch | 351 + ...hich-phishing-shavar-to-use-depending-on-.patch | 74 + ..._DISPLAYNAME-to-fill-appstrings.propertie.patch | 61 + .../recipes-overlayed/firefox/firefox/mozconfig | 60 + .../firefox/firefox/mozilla-firefox.desktop | 11 + .../firefox/firefox/mozilla-firefox.png | Bin 0 -> 4323 bytes .../Add-xptcall-support-for-SH4-processors.patch | 522 + .../Allow-ipc-code-to-build-on-GNU-Hurd.patch | 48 + .../Allow-ipc-code-to-build-on-GNU-kfreebsd.patch | 52 + ...Don-t-require-16-bytes-alignment-for-VMFr.patch | 21 + ...-Fix-ARMAssembler-getOp2RegScale-on-ARMv5.patch | 25 + ...Fix-build-failure-on-platforms-without-YA.patch | 20 + ...Avoid-invalid-conversion-from-const-size_.patch | 24 + ...Avoid-R_SPARC_WDISP22-relocation-in-Tramp.patch | 29 + ...Crash-on-s390x-nsXPCComponents-AttachNewC.patch | 78 + ...Add-support-for-GNU-kFreeBSD-and-GNU-Hurd.patch | 23 + ...Properly-align-XPCLazyCallContext-mData.-.patch | 40 + ...-Linux-failure-to-build-because-of-ipc-ch.patch | 31 + .../firefox/firefox/powerpc_va_list.patch | 44 + ...-disable-extensions-in-system-directories.patch | 21 + ....locale.matchOS-and-report-the-locale-cor.patch | 23 + ...ral.useragent.locale-prefs-from-firefox-..patch | 31 + .../firefox/prefs/Set-DPI-to-system-settings.patch | 21 + .../Set-javascript.options.showInConsole.patch | 20 + .../recipes-overlayed/firefox/firefox/vendor.js | 6 + .../firefox/firefox_10.0.11esr.bb | 153 + ...e-the-return-values-and-the-log-info-in-t.patch | 73 + ...e-hardware-reduced-mode-check-function-in.patch | 67 + ...sing-FACS-table-can-be-ignored-under-some.patch | 85 + .../recipes-overlayed/fwts/fwts_git.bb | 26 + .../recipes-overlayed/kexec/kexec-tools.inc | 17 + .../kexec/kexec-tools/add-arm64-support.patch | 521 + ...kexec-tools-Refine-kdump-device_tree-sort.patch | 82 + .../recipes-overlayed/kexec/kexec-tools_2.0.7.bb | 17 + .../recipes-overlayed/libpng/libpng_1.6.13.bb | 28 + .../libunwind/libunwind-1.1/AArch64-port.patch | 2529 +++ .../Support-building-with-older-compilers.patch | 72 + .../recipes-overlayed/libunwind/libunwind.inc | 31 + .../recipes-overlayed/libunwind/libunwind_1.1.bb | 9 + .../nss-myhostname/nss-myhostname_0.3.bb | 29 + .../recipes-overlayed/pm-qa/pm-qa_git.bb | 65 + .../recipes-overlayed/shadow/files/securetty | 233 + .../shadow/shadow-securetty_%.bbappend | 3 + .../include/external-linaro-toolchain-versions.inc | 111 + .../conf/distro/include/tcmode-external-linaro.inc | 101 + meta-linaro-toolchain/conf/layer.conf | 13 + .../glibc/glibc-initial_linaro-2.20.bb | 11 + .../0001-R_ARM_TLS_DTPOFF32.patch | 56 + ...n-libm-err-tab.pl-with-specific-dirs-in-S.patch | 33 + .../glibc-linaro-2.20/GLRO_dl_debug_mask.patch | 529 + .../glibc-linaro-2.20/IO-acquire-lock-fix.patch | 17 + .../add_resource_h_to_wait_h.patch | 20 + .../eglibc-header-bootstrap.patch | 85 + .../eglibc-install-pic-archives.patch | 109 + .../eglibc-ppc8xx-cache-line-workaround.patch | 68 + .../glibc-linaro-2.20/eglibc-resolv-dynamic.patch | 54 + .../eglibc-sh4-fpscr_values.patch | 42 + .../eglibc-use-option-groups.patch | 16577 ++++++++++++++++ .../glibc/glibc-linaro-2.20/eglibc.patch | 602 + .../glibc/glibc-linaro-2.20/etc/ld.so.conf | 0 .../glibc-linaro-2.20/fix-tibetian-locales.patch | 38 + .../glibc-linaro-2.20/fix_am_rootsbindir.patch | 29 + .../glibc/glibc-linaro-2.20/fsl-ppc-no-fsqrt.patch | 100 + .../glibc/glibc-linaro-2.20/generate-supported.mk | 11 + .../glibc/glibc-linaro-2.20/glibc.fix_sqrt2.patch | 1516 ++ .../glibc/glibc-linaro-2.20/grok_gold.patch | 34 + .../glibc/glibc-linaro-2.20/initgroups_keys.patch | 20 + .../glibc/glibc-linaro-2.20/ld-search-order.patch | 56 + .../glibc-linaro-2.20/mips-rld-map-check.patch | 27 + .../glibc/glibc-linaro-2.20/multilib_readlib.patch | 19 + .../glibc/glibc-linaro-2.20/option-groups.patch | 1397 ++ .../glibc/glibc-linaro-2.20/ppc-sqrt_finite.patch | 184 + .../glibc-linaro-2.20/ppc_slow_ieee754_sqrt.patch | 365 + .../ppce6500-32b_slow_ieee754_sqrt.patch | 47 + .../glibc/glibc-linaro-2.20/relocatable_sdk.patch | 108 + .../relocatable_sdk_fix_openpath.patch | 41 + .../timezone-re-written-tzselect-as-posix-sh.patch | 38 + .../recipes-core/glibc/glibc-locale_linaro-2.20.bb | 1 + .../recipes-core/glibc/glibc-mtrace_linaro-2.20.bb | 1 + .../glibc/glibc-scripts_linaro-2.20.bb | 1 + .../recipes-core/glibc/glibc_linaro-2.20.bb | 173 + .../glibc/ldconfig-native-2.12.1/32and64bit.patch | 331 + .../glibc/ldconfig-native-2.12.1/README | 8 + .../endian-ness_handling.patch | 454 + .../ldconfig-native-2.12.1/endianess-header.patch | 113 + .../glibc/ldconfig-native-2.12.1/flag_fix.patch | 24 + .../ldconfig-default-to-all-multilib-dirs.patch | 37 + .../ldconfig-native-2.12.1.tar.bz2 | Bin 0 -> 21491 bytes .../glibc/ldconfig-native-2.12.1/ldconfig.patch | 471 + .../ldconfig_aux-cache_path_fix.patch | 36 + .../recipes-core/glibc/ldconfig-native_2.12.1.bb | 32 + .../recipes-core/glibc/site_config/funcs | 474 + .../recipes-core/glibc/site_config/headers | 156 + .../recipes-core/glibc/site_config/types | 21 + .../binutils-cross-canadian_linaro-2.24.bb | 3 + .../binutils/binutils-cross_linaro-2.24.bb | 3 + .../binutils/binutils-crosssdk_linaro-2.24.bb | 13 + .../binutils/binutils-linaro-2.24.inc | 47 + .../0001-AArch64-Define-LP64-BE-linker-name.patch | 18 + .../0001-AArch64-Define-LP64-LE-loader-name.patch | 20 + ...ild-breakage-from-bfd_set_section_vma-cha.patch | 31 + .../binutils-linaro-2.24/binutils-armv5e.patch | 25 + .../binutils-linaro-2.24/binutils-poison.patch | 259 + .../binutils-uclibc-100-uclibc-conf.patch | 40 + ...binutils-uclibc-300-001_ld_makefile_patch.patch | 55 + ...binutils-uclibc-300-006_better_file_error.patch | 45 + ...ils-uclibc-300-012_check_ldrunpath_length.patch | 49 + .../binutils-uclibc-gas-needs-libm.patch | 38 + .../binutils-uninitialised-warning.patch | 50 + .../binutils-xlp-support.patch | 402 + .../binutils-linaro-2.24/fix-pr15815.patch | 36 + .../binutils-linaro-2.24/fix-pr16428.patch | 123 + .../binutils-linaro-2.24/fix-pr16476.patch | 220 + .../binutils/binutils-linaro-2.24/fix-pr2404.patch | 76 + .../binutils-linaro-2.24/libiberty_path_fix.patch | 22 + .../binutils-linaro-2.24/libtool-2.4-update.patch | 19317 +++++++++++++++++++ .../binutils-linaro-2.24/libtool-rpath-fix.patch | 39 + .../mips64-default-ld-emulation.patch | 54 + .../binutils-linaro-2.24/relocatable_sdk.patch | 49 + .../replace_macros_with_static_inline.patch | 188 + .../binutils/binutils_linaro-2.24.bb | 39 + .../external-linaro-toolchain.bb | 376 + .../external-linaro-toolchain/files/SUPPORTED | 1 + .../gcc/gcc-cross-canadian_linaro-4.8.bb | 2 + .../gcc/gcc-cross-canadian_linaro-4.9.bb | 2 + .../gcc/gcc-cross-initial_linaro-4.8.bb | 3 + .../gcc/gcc-cross-initial_linaro-4.9.bb | 3 + .../recipes-devtools/gcc/gcc-cross_linaro-4.8.bb | 3 + .../recipes-devtools/gcc/gcc-cross_linaro-4.9.bb | 3 + .../gcc/gcc-crosssdk-initial_linaro-4.8.bb | 4 + .../gcc/gcc-crosssdk-initial_linaro-4.9.bb | 4 + .../gcc/gcc-crosssdk_linaro-4.8.bb | 2 + .../gcc/gcc-crosssdk_linaro-4.9.bb | 2 + .../recipes-devtools/gcc/gcc-linaro-4.8.inc | 73 + .../0001-AArch64-Define-BE-loader-name.patch | 42 + .../0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch | 39 + .../gcc/gcc-linaro-4.8/0002-uclibc-conf.patch | 53 + .../0003-gcc-uclibc-locale-ctype_touplow_t.patch | 87 + .../gcc/gcc-linaro-4.8/0004-uclibc-locale.patch | 2862 +++ .../gcc-linaro-4.8/0005-uclibc-locale-no__x.patch | 257 + .../0006-uclibc-locale-wchar_fix.patch | 68 + .../gcc-linaro-4.8/0007-uclibc-locale-update.patch | 542 + .../gcc-linaro-4.8/0008-missing-execinfo_h.patch | 28 + .../gcc/gcc-linaro-4.8/0009-c99-snprintf.patch | 28 + .../0010-c99-complex-ugly-hack.patch | 29 + .../gcc/gcc-linaro-4.8/0011-index_macro.patch | 44 + .../0012-libmudflap-susv3-legacy.patch | 64 + .../gcc-linaro-4.8/0013-libstdc-namespace.patch | 54 + .../gcc/gcc-linaro-4.8/0014-sh-pr24836.patch | 29 + ...GET_ENDIAN_OPTION-for-determining-MULTILI.patch | 29 + .../0016-gcc-poison-system-directories.patch | 224 + .../0017-gcc-poison-dir-extend.patch | 39 + .../0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch | 73 + .../gcc-linaro-4.8/0019-64-bit-multilib-hack.patch | 82 + .../gcc/gcc-linaro-4.8/0020-optional-libstdc.patch | 102 + ...0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch | 59 + .../gcc-linaro-4.8/0022-COLLECT_GCC_OPTIONS.patch | 38 + ...efaults.h-in-B-instead-of-S-and-t-oe-in-B.patch | 88 + .../gcc/gcc-linaro-4.8/0024-PR-target-32219.patch | 67 + .../0025-fortran-cross-compile-hack.patch | 46 + .../gcc-linaro-4.8/0026-libgcc-sjlj-check.patch | 74 + .../gcc-linaro-4.8/0027-cpp-honor-sysroot.patch | 54 + .../0028-MIPS64-Default-to-N64-ABI.patch | 31 + ...C_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch | 190 + ...0030-gcc-Fix-argument-list-too-long-error.patch | 40 + .../gcc/gcc-linaro-4.8/0031-Disable-sdt.patch | 45 + .../gcc/gcc-linaro-4.8/0032-libtool.patch | 42 + ...4-pass-fix-v4bx-to-linker-to-support-EABI.patch | 43 + ...tilib-config-files-from-B-instead-of-usin.patch | 102 + .../gcc-linaro-4.8/0035-wcast-qual-PR-55383.patch | 55 + .../gcc/gcc-linaro-4.8/0037-gcc-4.8-PR56797.patch | 66 + .../gcc-linaro-4.8/0038-gcc-4.8-build-args.patch | 41 + .../gcc/gcc-linaro-4.8/0039-gcc-4.8-PR57717.patch | 23 + .../gcc/gcc-linaro-4.8/0040-fix-g++-sysroot.patch | 40 + .../gcc-linaro-4.8/0041-libtool-avoid-libdir.patch | 19 + .../gcc/gcc-linaro-4.8/0042-pr57748.patch | 78 + .../gcc/gcc-linaro-4.8/0043-cpp.patch | 40 + .../gcc/gcc-linaro-4.8/0044-gengtypes.patch | 97 + .../0045-gcc-4.8-PR57717-PowerPC-E500v2.patch | 21 + .../0046-libatomic-deptracking.patch | 41 + .../gcc/gcc-linaro-4.8/0047-repomembug.patch | 53 + .../0048-PR58854_fix_arm_apcs_epilogue.patch | 23 + ...AltiVec-generation-on-powepc-linux-target.patch | 42 + .../gcc/gcc-linaro-4.8/0050-PR-target-58595.patch | 101 + .../AArch64-Define-BE-loader-name-default-be.patch | 38 + .../gcc/gcc-linaro-4.8/gcc-4.8-PR56797.patch | 66 + .../gcc/gcc-linaro-4.8/use-lib-for-aarch64.patch | 14 + .../recipes-devtools/gcc/gcc-linaro-4.9.inc | 73 + .../0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch | 42 + .../gcc/gcc-linaro-4.9/0002-uclibc-conf.patch | 53 + .../0003-gcc-uclibc-locale-ctype_touplow_t.patch | 87 + .../gcc/gcc-linaro-4.9/0004-uclibc-locale.patch | 2862 +++ .../gcc-linaro-4.9/0005-uclibc-locale-no__x.patch | 257 + .../0006-uclibc-locale-wchar_fix.patch | 68 + .../gcc-linaro-4.9/0007-uclibc-locale-update.patch | 542 + .../gcc-linaro-4.9/0008-missing-execinfo_h.patch | 28 + .../gcc/gcc-linaro-4.9/0009-c99-snprintf.patch | 28 + .../0010-c99-complex-ugly-hack.patch | 29 + .../gcc/gcc-linaro-4.9/0011-index_macro.patch | 44 + .../gcc-linaro-4.9/0013-libstdc-namespace.patch | 54 + .../gcc/gcc-linaro-4.9/0014-sh-pr24836.patch | 45 + ...GET_ENDIAN_OPTION-for-determining-MULTILI.patch | 39 + .../0016-gcc-poison-system-directories.patch | 190 + .../0017-gcc-poison-dir-extend.patch | 39 + .../0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch | 73 + .../gcc-linaro-4.9/0019-64-bit-multilib-hack.patch | 82 + .../gcc/gcc-linaro-4.9/0020-optional-libstdc.patch | 98 + ...0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch | 59 + .../gcc-linaro-4.9/0022-COLLECT_GCC_OPTIONS.patch | 38 + ...efaults.h-in-B-instead-of-S-and-t-oe-in-B.patch | 88 + .../gcc/gcc-linaro-4.9/0024-PR-target-32219.patch | 62 + .../0025-fortran-cross-compile-hack.patch | 46 + .../gcc-linaro-4.9/0026-libgcc-sjlj-check.patch | 74 + .../gcc-linaro-4.9/0027-cpp-honor-sysroot.patch | 54 + .../0028-MIPS64-Default-to-N64-ABI.patch | 31 + ...C_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch | 228 + ...0030-gcc-Fix-argument-list-too-long-error.patch | 40 + .../gcc/gcc-linaro-4.9/0031-Disable-sdt.patch | 113 + .../gcc/gcc-linaro-4.9/0032-libtool.patch | 42 + ...4-pass-fix-v4bx-to-linker-to-support-EABI.patch | 40 + ...tilib-config-files-from-B-instead-of-usin.patch | 102 + .../gcc/gcc-linaro-4.9/0037-gcc-4.8-PR56797.patch | 66 + .../gcc/gcc-linaro-4.9/0040-fix-g++-sysroot.patch | 40 + .../gcc-linaro-4.9/0041-libtool-avoid-libdir.patch | 19 + .../gcc/gcc-linaro-4.9/0043-cpp.patch | 40 + .../gcc/gcc-linaro-4.9/0044-gengtypes.patch | 97 + .../0046-libatomic-deptracking.patch | 41 + .../gcc/gcc-linaro-4.9/0047-repomembug.patch | 53 + ...AltiVec-generation-on-powepc-linux-target.patch | 42 + ...Use-dbx_reg_number-for-spanning-registers.patch | 80 + .../gcc/gcc-linaro-4.9/0051-eabispe.patch | 23 + ...-E500-SPE-errors-with-the-_Decimal64-type.patch | 98 + ...fault-from-calling-free-on-non-malloc-d-a.patch | 66 + ...Makefile.in-fix-parallel-building-failure.patch | 61 + .../0055-PR-rtl-optimization-61801.patch | 36 + .../0056-top-level-reorder_gcc-bug-61144.patch | 31 + .../gcc/gcc-linaro-4.9/0058-gcc-r212171.patch | 113 + .../0059-gcc-PR-rtl-optimization-63348.patch | 59 + .../AArch64-Define-BE-loader-name-default-be.patch | 38 + .../gcc/gcc-linaro-4.9/use-lib-for-aarch64.patch | 13 + .../recipes-devtools/gcc/gcc-linaro-common-4.8.inc | 2 + .../recipes-devtools/gcc/gcc-linaro-common-4.9.inc | 2 + .../recipes-devtools/gcc/gcc-runtime_linaro-4.8.bb | 2 + .../recipes-devtools/gcc/gcc-runtime_linaro-4.9.bb | 2 + .../recipes-devtools/gcc/gcc-source_linaro-4.8.bb | 3 + .../recipes-devtools/gcc/gcc-source_linaro-4.9.bb | 3 + .../recipes-devtools/gcc/gcc_linaro-4.8.bb | 4 + .../recipes-devtools/gcc/gcc_linaro-4.9.bb | 4 + .../gcc/libgcc-initial_linaro-4.8.bb | 3 + .../gcc/libgcc-initial_linaro-4.9.bb | 3 + .../recipes-devtools/gcc/libgcc_linaro-4.8.bb | 2 + .../recipes-devtools/gcc/libgcc_linaro-4.9.bb | 2 + .../recipes-devtools/gcc/libgfortran_linaro-4.8.bb | 4 + .../recipes-devtools/gcc/libgfortran_linaro-4.9.bb | 4 + .../gdb/gdb-7.8/sim-install-6.6.patch | 14 + .../gdb/gdb-cross-canadian_linaro-7.8.bb | 3 + .../recipes-devtools/gdb/gdb-cross_linaro-7.8.bb | 4 + .../recipes-devtools/gdb/gdb-linaro-7.8.inc | 20 + .../recipes-devtools/gdb/gdb_linaro-7.8.bb | 23 + meta-linaro/conf/layer.conf | 15 + meta-linaro/conf/machine/genericarmv7a.conf | 34 + meta-linaro/conf/machine/genericarmv7ab.conf | 7 + meta-linaro/conf/machine/lng-rt-x86-64.conf | 4 + meta-linaro/conf/machine/lng-x86-64.conf | 4 + meta-linaro/conf/machine/lng.inc | 6 + .../initrdscripts/files/init-boot-linaro.sh | 41 + .../initrdscripts/initramfs-boot-linaro_1.0.bb | 13 + .../3f08ffb4a4741d147634761dc053ed386243a0de.patch | 42 + .../qemu/files/enable-i386-linux-user.patch | 55 + .../recipes-devtools/qemu/files/fdt_header.patch | 39 + .../fix-libcap-header-issue-on-some-distro.patch | 84 + .../recipes-devtools/qemu/files/init-info.patch | 18 + .../qemu/files/larger_default_ram_size.patch | 22 + .../recipes-devtools/qemu/files/no-strip.patch | 15 + .../recipes-devtools/qemu/files/powerpc_rom.bin | Bin 0 -> 4096 bytes .../qemu/files/relocatable_sdk.patch | 34 + ...-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch | 79 + .../qemu/files/target-ppc_fix_bit_extraction.patch | 70 + meta-linaro/recipes-devtools/qemu/qemu_git.bb | 28 + .../arndale-pre-boot_0.0.2.20130101.bb | 24 + .../recipes-extra/calibrator/calibrator_0.9e.bb | 27 + .../files/fix_conflicting_types_for_round.patch | 95 + meta-linaro/recipes-extra/daq-odp/daq-odp.bb | 18 + meta-linaro/recipes-extra/dwarfutils/README | 18 + meta-linaro/recipes-extra/dwarfutils/dwarf.inc | 12 + .../dwarfutils/dwarfdump/fix-dump.patch | 25 + .../dwarfutils/dwarfdump2/fix-dump.patch | 27 + .../dwarfutils/dwarfdump2_20121130.bb | 22 + .../recipes-extra/dwarfutils/dwarfdump_20121130.bb | 22 + .../recipes-extra/dwarfutils/dwarfgen_20121130.bb | 13 + .../dwarfutils/libdwarf/fix-gennames.patch | 22 + .../recipes-extra/dwarfutils/libdwarf_20121130.bb | 13 + .../recipes-extra/efibootmgr/efibootmgr_0.5.4.bb | 33 + .../efibootmgr/files/docbook-fixes.patch | 22 + ...Remove-device-path-padding-on-non-Itanium.patch | 28 + ...r-0.5.4-Work-around-broken-Apple-firmware.patch | 30 + ...mgr-0.5.4-fix-disk-minor-number-discovery.patch | 29 + .../efibootmgr-0.5.4-fix-minor-memory-leak.patch | 29 + ...ar-does-not-check-for-failed-status-with-.patch | 47 + .../efibootmgr-0.5.4-support-4k-sectors.patch | 176 + .../recipes-extra/efibootmgr/files/ldflags.patch | 11 + .../files/w-keep-existing-mbr-signature.patch | 20 + .../ganglia/ganglia/gmetad-example.conf | 122 + .../recipes-extra/ganglia/ganglia/gmetad.init | 48 + .../ganglia/ganglia/gmond-example.conf | 383 + .../recipes-extra/ganglia/ganglia/gmond.init | 46 + meta-linaro/recipes-extra/ganglia/ganglia_3.6.0.bb | 70 + ...hrw-check-for-libdwarf-in-our-place-first.patch | 32 + meta-linaro/recipes-extra/hiphopvm/hiphopvm_git.bb | 67 + meta-linaro/recipes-extra/idlestat/idlestat_git.bb | 16 + .../recipes-extra/latency-test/latency-test_git.bb | 19 + .../recipes-extra/libevent/files/LICENSE.txt | 74 + .../libevent/files/libevent-1.4.14.fb-changes.diff | 611 + .../recipes-extra/libevent/libevent-fb_1.4.14b.bb | 20 + .../files/70-persistent-net.rules | 43 + .../lng-network-config/lng-network-config_0.1.bb | 11 + .../recipes-extra/lshw/files/cross-compile.patch | 39 + meta-linaro/recipes-extra/lshw/lshw_02.16.bb | 33 + .../meta-toolchain-hhvm/meta-toolchain-hhvm.bb | 4 + ...packagegroup-core-standalone-hhvm-sdk-target.bb | 57 + meta-linaro/recipes-extra/odp/odp.bb | 24 + .../recipes-extra/powerdebug/powerdebug_0.7.3.bb | 22 + .../recipes-extra/stress/files/texinfo.patch | 79 + meta-linaro/recipes-extra/stress/stress_1.0.4.bb | 14 + meta-linaro/recipes-extra/trinity/trinity_1.3.bb | 42 + meta-linaro/recipes-extra/usecpu/usecpu_git.bb | 18 + meta-linaro/recipes-kernel/gator/gator/gator.init | 48 + meta-linaro/recipes-kernel/gator/gator_git.bb | 33 + meta-linaro/recipes-kernel/linux/bootwrapper.inc | 67 + meta-linaro/recipes-kernel/linux/linaro-kernel.inc | 15 + .../linux/linaro-lng-rt-x86-64_git.bb | 9 + .../recipes-kernel/linux/linaro-lng-x86-64_git.bb | 9 + meta-linaro/recipes-kernel/linux/linaro-lng.inc | 31 + .../recipes-kernel/linux/linux-linaro-aarch64.bb | 22 + .../linux/linux-linaro-stable-vexpress_git.bb | 16 + .../linux/linux-linaro-vexpress_git.bb | 16 + .../0001-perf-tools-Fix-arm64-build-error.patch | 42 + ...tools-Fix-build-breakage-on-arm64-targets.patch | 45 + meta-linaro/recipes-kernel/perf/perf.bbappend | 21 + .../recipes-kernel/trace-cmd/kernelshark_2.3.2.bb | 23 + .../recipes-kernel/trace-cmd/trace-cmd_2.3.2.bb | 21 + .../auto-serial-console/auto-console-login | 6 + .../auto-serial-console/auto-getty | 38 + .../auto-serial-console/auto-root-login | 3 + .../auto-serial-console/auto-serial-console | 29 + .../auto-serial-console/autogetty | 5 + .../auto-serial-console/auto-serial-console_0.1.bb | 48 + .../files-injection/files-injection.bb | 22 + .../files-injection/files/files-to-inject.tar.xz | Bin 0 -> 196 bytes .../files-injection/files/files-to-inject/empty | 0 .../recipes-linaro/images/linaro-image-alip.bb | 9 + .../recipes-linaro/images/linaro-image-arago.bb | 20 + .../recipes-linaro/images/linaro-image-common.inc | 93 + .../recipes-linaro/images/linaro-image-kvm.bb | 6 + .../recipes-linaro/images/linaro-image-lamp.bb | 20 + .../recipes-linaro/images/linaro-image-leg-java.bb | 29 + .../recipes-linaro/images/linaro-image-lng.bb | 64 + .../images/linaro-image-minimal-initramfs.bb | 39 + .../recipes-linaro/images/linaro-image-minimal.bb | 2 + .../recipes-linaro/images/linaro-image-sdk.bb | 12 + .../images/linaro-image-toolchain-benchmark.bb | 18 + .../recipes-linaro/images/linaro-sysroot-alip.bb | 19 + .../recipes-linaro/images/linaro-sysroot-lamp.bb | 24 + .../recipes-linaro/linaro-lava-tests/files/LICENSE | 19 + .../recipes-linaro/linaro-lava-tests/files/hello.c | 8 + .../linaro-lava-tests/files/hello.cc | 8 + .../linaro-lava-tests/files/info.php | 5 + .../linaro-lava-tests/files/mysql.php | 9 + .../linaro-lava-tests/linaro-lava-tests.bb | 22 + meta-linaro/recipes-support/confuse/confuse_2.7.bb | 16 + meta-linaro/recipes-support/rt-app/rt-app_git.bb | 13 + 451 files changed, 81675 insertions(+) create mode 100644 .gitreview create mode 100644 COPYING.MIT create mode 100644 README create mode 100644 meta-aarch64/conf/layer.conf create mode 100644 meta-aarch64/conf/machine/genericarmv8.conf create mode 100644 meta-aarch64/conf/machine/genericarmv8b.conf create mode 100644 meta-aarch64/conf/machine/include/arm64/arch-armv8.inc create mode 100644 meta-aarch64/recipes-core/openjdk/openjdk-8-common.inc create mode 100644 meta-aarch64/recipes-core/openjdk/openjdk-8_0.1.bb create mode 100644 meta-aarch64/recipes-core/packagegroups/packagegroup-core-sdk.bbappend create mode 100644 meta-aarch64/recipes-kernel/kexec-tools/files/add-arm64-support.patch create mode 100644 meta-aarch64/recipes-kernel/kexec-tools/kexec-tools_2.0.7.bbappend create mode 100644 meta-aarch64/recipes-kernel/sysprof/sysprof_git.bbappend create mode 100644 meta-aarch64/recipes-multimedia/pulseaudio/files/0001-libatomic_ops-Aarch64-basic-port.patch create mode 100644 meta-aarch64/recipes-multimedia/pulseaudio/libatomics-ops_7.2.bbappend create mode 100644 meta-aarch64/recipes-qt/qt4/files/aarch64.patch create mode 100644 meta-aarch64/recipes-qt/qt4/qt4-x11-free_4.8.6.bbappend create mode 100644 meta-aarch64/recipes-support/emacs/emacs_23.4.bbappend create mode 100644 meta-bigendian/conf/layer.conf create mode 100644 meta-bigendian/recipes-core/initscripts/initscripts_1.0.bbappend create mode 100644 meta-bigendian/recipes-devtools/python/python-numpy_1.7.0.bbappend create mode 100644 meta-bigendian/recipes-devtools/python/python/python_ffi_armeb_be8.patch create mode 100644 meta-bigendian/recipes-devtools/python/python_2.7.3.bbappend create mode 100644 meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch create mode 100644 meta-bigendian/recipes-devtools/strace/strace_%.bbappend create mode 100644 meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch create mode 100644 meta-bigendian/recipes-gnome/libffi/libffi_3.1.bbappend create mode 100644 meta-bigendian/recipes-kernel/sysprof/sysprof_git.bbappend create mode 100644 meta-linaro-integration/README create mode 100644 meta-linaro-integration/conf/layer.conf create mode 100644 meta-linaro-integration/recipes-core/busybox/busybox_%.bbappend create mode 100644 meta-linaro-integration/recipes-core/busybox/files/linaro.cfg create mode 100644 meta-linaro-integration/recipes-overlayed/acpica/acpica_20140828.bb create mode 100644 meta-linaro-integration/recipes-overlayed/acpica/acpitests/0001-aaptisrun-alter-to-allow-destination-directory-as-ar.patch create mode 100644 meta-linaro-integration/recipes-overlayed/acpica/acpitests/aapits-linux.patch create mode 100644 meta-linaro-integration/recipes-overlayed/acpica/acpitests/aapits-makefile.patch create mode 100644 meta-linaro-integration/recipes-overlayed/acpica/acpitests_20140828.bb create mode 100644 meta-linaro-integration/recipes-overlayed/acpica/files/no-werror.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/configure.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Add-a-2-minutes-timeout-on-xpcshell-tests.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Add-another-preferences-directory-for-applications-p.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Add-soname-to-appropriate-libraries.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Avoid-libxpcom-being-excluded-from-linked-libraries-.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Avoid-wrong-sessionstore-data-to-keep-windows-out-of.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Bug-508942-Use-Preprocessor.py-filters-in-defines-an.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Check-less-things-during-configure-when-using-libxul.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Do-build-time-detection-of-2-bytes-wchar_t-and-char1.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-build-example-component.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-install-system-profile.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Fix-tracejit-to-build-against-nanojit-headers-in-dis.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Gross-workaround-to-avoid-installing-test-idl-and-in.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Handle-transition-to-etc-appname-searchplugins-more-.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Ignore-system-libjpeg-libpng-and-zlib-version-checki.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Install-js-shell-when-running-make-install-from-js-s.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Install-missing-nanojit-and-.tbl-headers-from-js-src.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Load-distribution-search-plugins-from-etc-appname-se.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Use-a-variable-for-xulrunner-base-version-in-various.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/pkg-config-files-don-t-need-to-require-the-version-o.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Allow-.js-preference-files-to-set-locked-prefs-with-.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Allow-webGL-with-mesa-assuming-users-will-have-updat.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Avoid-spurious-Run-items-in-application-handlers-con.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-515232-Try-getting-general.useragent.locale-as-a.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-691898-Use-YARR-interpreter-instead-of-PCRE-on-p.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-696636-Block-OpenGL-1-drivers-explicitly-to-stee.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-706724-Fix-for-error-ftruncate-was-not-declared-.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-709259-Try-creating-a-named-cursor-before-a-bitm.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-720682-Don-t-crash-an-app-using-libxul-because-o.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-722127-Bump-required-libvpx-version-to-1.0.0.-r-.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-725655-gcc-4.7-build-failures-missing-headers-.-.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-728229-Allow-to-build-with-system-python-ply-lib.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-729817-Allow-the-Nouveau-driver-with-Mesa-8.0.1-.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-729817-Block-the-Nouveau-3D-driver-as-it-s-insta.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-734490-fix-build-failures-with-Clang-and-GCC-4.7.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-747322-Fix-jemalloc-mmap-wrapper-for-s390x.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-761082-Only-export-TabMessageUtils.h-in-mozilla-.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Fix-some-tests-using-CurProcD-where-GreD-should-be-u.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Load-dependent-libraries-with-their-real-path-to-avo.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Properly-launch-applications-set-in-HOME-.mailcap.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/bug-693343-a11y-disabled-in-Gnome-3-when-GNOME_ACCES.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/iceweasel-branding/Determine-which-phishing-shavar-to-use-depending-on-.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/iceweasel-branding/Use-MOZ_APP_DISPLAYNAME-to-fill-appstrings.propertie.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/mozconfig create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/mozilla-firefox.desktop create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/mozilla-firefox.png create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Add-xptcall-support-for-SH4-processors.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-Hurd.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-698923-Don-t-require-16-bytes-alignment-for-VMFr.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703531-Fix-ARMAssembler-getOp2RegScale-on-ARMv5.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703534-Fix-build-failure-on-platforms-without-YA.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703833-Avoid-invalid-conversion-from-const-size_.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703842-Avoid-R_SPARC_WDISP22-relocation-in-Tramp.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-706787-Crash-on-s390x-nsXPCComponents-AttachNewC.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-711353-Add-support-for-GNU-kFreeBSD-and-GNU-Hurd.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-747870-Properly-align-XPCLazyCallContext-mData.-.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/powerpc_va_list.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Don-t-auto-disable-extensions-in-system-directories.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Enable-intl.locale.matchOS-and-report-the-locale-cor.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Remove-general.useragent.locale-prefs-from-firefox-..patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Set-DPI-to-system-settings.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Set-javascript.options.showInConsole.patch create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox/vendor.js create mode 100644 meta-linaro-integration/recipes-overlayed/firefox/firefox_10.0.11esr.bb create mode 100644 meta-linaro-integration/recipes-overlayed/fwts/files/0001-ACPI-improve-the-return-values-and-the-log-info-in-t.patch create mode 100644 meta-linaro-integration/recipes-overlayed/fwts/files/0002-ACPI-add-the-hardware-reduced-mode-check-function-in.patch create mode 100644 meta-linaro-integration/recipes-overlayed/fwts/files/0003-ACPI-a-missing-FACS-table-can-be-ignored-under-some.patch create mode 100644 meta-linaro-integration/recipes-overlayed/fwts/fwts_git.bb create mode 100644 meta-linaro-integration/recipes-overlayed/kexec/kexec-tools.inc create mode 100644 meta-linaro-integration/recipes-overlayed/kexec/kexec-tools/add-arm64-support.patch create mode 100644 meta-linaro-integration/recipes-overlayed/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch create mode 100644 meta-linaro-integration/recipes-overlayed/kexec/kexec-tools_2.0.7.bb create mode 100644 meta-linaro-integration/recipes-overlayed/libpng/libpng_1.6.13.bb create mode 100644 meta-linaro-integration/recipes-overlayed/libunwind/libunwind-1.1/AArch64-port.patch create mode 100644 meta-linaro-integration/recipes-overlayed/libunwind/libunwind-1.1/Support-building-with-older-compilers.patch create mode 100644 meta-linaro-integration/recipes-overlayed/libunwind/libunwind.inc create mode 100644 meta-linaro-integration/recipes-overlayed/libunwind/libunwind_1.1.bb create mode 100644 meta-linaro-integration/recipes-overlayed/nss-myhostname/nss-myhostname_0.3.bb create mode 100644 meta-linaro-integration/recipes-overlayed/pm-qa/pm-qa_git.bb create mode 100644 meta-linaro-integration/recipes-overlayed/shadow/files/securetty create mode 100644 meta-linaro-integration/recipes-overlayed/shadow/shadow-securetty_%.bbappend create mode 100644 meta-linaro-toolchain/conf/distro/include/external-linaro-toolchain-versions.inc create mode 100644 meta-linaro-toolchain/conf/distro/include/tcmode-external-linaro.inc create mode 100644 meta-linaro-toolchain/conf/layer.conf create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-initial_linaro-2.20.bb create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/0001-R_ARM_TLS_DTPOFF32.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/GLRO_dl_debug_mask.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/IO-acquire-lock-fix.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/add_resource_h_to_wait_h.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-header-bootstrap.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-install-pic-archives.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-ppc8xx-cache-line-workaround.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-resolv-dynamic.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-sh4-fpscr_values.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-use-option-groups.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/etc/ld.so.conf create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/fix-tibetian-locales.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/fix_am_rootsbindir.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/fsl-ppc-no-fsqrt.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/generate-supported.mk create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/glibc.fix_sqrt2.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/grok_gold.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/initgroups_keys.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ld-search-order.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/mips-rld-map-check.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/multilib_readlib.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/option-groups.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ppc-sqrt_finite.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ppc_slow_ieee754_sqrt.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ppce6500-32b_slow_ieee754_sqrt.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/relocatable_sdk.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/relocatable_sdk_fix_openpath.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/timezone-re-written-tzselect-as-posix-sh.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-locale_linaro-2.20.bb create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-mtrace_linaro-2.20.bb create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc-scripts_linaro-2.20.bb create mode 100644 meta-linaro-toolchain/recipes-core/glibc/glibc_linaro-2.20.bb create mode 100644 meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/README create mode 100644 meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 create mode 100644 meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch create mode 100644 meta-linaro-toolchain/recipes-core/glibc/ldconfig-native_2.12.1.bb create mode 100644 meta-linaro-toolchain/recipes-core/glibc/site_config/funcs create mode 100644 meta-linaro-toolchain/recipes-core/glibc/site_config/headers create mode 100644 meta-linaro-toolchain/recipes-core/glibc/site_config/types create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-cross-canadian_linaro-2.24.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-cross_linaro-2.24.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-crosssdk_linaro-2.24.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24.inc create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/0001-AArch64-Define-LP64-BE-linker-name.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/0001-AArch64-Define-LP64-LE-loader-name.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/0001-Fix-MMIX-build-breakage-from-bfd_set_section_vma-cha.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-armv5e.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-poison.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-100-uclibc-conf.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-300-001_ld_makefile_patch.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-300-006_better_file_error.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-300-012_check_ldrunpath_length.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-gas-needs-libm.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uninitialised-warning.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-xlp-support.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr15815.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr16428.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr16476.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr2404.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/libiberty_path_fix.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/libtool-2.4-update.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/libtool-rpath-fix.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/mips64-default-ld-emulation.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/relocatable_sdk.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/replace_macros_with_static_inline.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/binutils/binutils_linaro-2.24.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/external-linaro-toolchain.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/files/SUPPORTED create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.9.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.9.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.9.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.9.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.9.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8.inc create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0001-AArch64-Define-BE-loader-name.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0002-uclibc-conf.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0003-gcc-uclibc-locale-ctype_touplow_t.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0004-uclibc-locale.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0005-uclibc-locale-no__x.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0006-uclibc-locale-wchar_fix.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0007-uclibc-locale-update.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0008-missing-execinfo_h.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0009-c99-snprintf.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0010-c99-complex-ugly-hack.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0011-index_macro.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0012-libmudflap-susv3-legacy.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0013-libstdc-namespace.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0014-sh-pr24836.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0016-gcc-poison-system-directories.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0017-gcc-poison-dir-extend.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0019-64-bit-multilib-hack.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0020-optional-libstdc.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0022-COLLECT_GCC_OPTIONS.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0024-PR-target-32219.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0025-fortran-cross-compile-hack.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0026-libgcc-sjlj-check.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0027-cpp-honor-sysroot.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0028-MIPS64-Default-to-N64-ABI.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0030-gcc-Fix-argument-list-too-long-error.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0031-Disable-sdt.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0032-libtool.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0035-wcast-qual-PR-55383.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0037-gcc-4.8-PR56797.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0038-gcc-4.8-build-args.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0039-gcc-4.8-PR57717.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0040-fix-g++-sysroot.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0041-libtool-avoid-libdir.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0042-pr57748.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0043-cpp.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0044-gengtypes.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0045-gcc-4.8-PR57717-PowerPC-E500v2.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0046-libatomic-deptracking.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0047-repomembug.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0048-PR58854_fix_arm_apcs_epilogue.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0050-PR-target-58595.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/AArch64-Define-BE-loader-name-default-be.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/gcc-4.8-PR56797.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/use-lib-for-aarch64.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9.inc create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0002-uclibc-conf.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0004-uclibc-locale.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0005-uclibc-locale-no__x.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0006-uclibc-locale-wchar_fix.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0007-uclibc-locale-update.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0008-missing-execinfo_h.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0009-c99-snprintf.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0010-c99-complex-ugly-hack.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0011-index_macro.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0013-libstdc-namespace.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0014-sh-pr24836.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0016-gcc-poison-system-directories.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0017-gcc-poison-dir-extend.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0019-64-bit-multilib-hack.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0020-optional-libstdc.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0022-COLLECT_GCC_OPTIONS.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0024-PR-target-32219.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0025-fortran-cross-compile-hack.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0026-libgcc-sjlj-check.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0027-cpp-honor-sysroot.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0028-MIPS64-Default-to-N64-ABI.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0030-gcc-Fix-argument-list-too-long-error.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0031-Disable-sdt.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0032-libtool.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0037-gcc-4.8-PR56797.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0040-fix-g++-sysroot.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0041-libtool-avoid-libdir.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0043-cpp.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0044-gengtypes.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0046-libatomic-deptracking.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0047-repomembug.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0051-eabispe.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0052-Fix-GCC-targeting-E500-SPE-errors-with-the-_Decimal64-type.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0055-PR-rtl-optimization-61801.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0056-top-level-reorder_gcc-bug-61144.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0058-gcc-r212171.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0059-gcc-PR-rtl-optimization-63348.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/AArch64-Define-BE-loader-name-default-be.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/use-lib-for-aarch64.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.8.inc create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.9.inc create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.9.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-source_linaro-4.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc-source_linaro-4.9.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.9.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/libgcc-initial_linaro-4.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/libgcc-initial_linaro-4.9.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.9.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/libgfortran_linaro-4.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gcc/libgfortran_linaro-4.9.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gdb/gdb-7.8/sim-install-6.6.patch create mode 100644 meta-linaro-toolchain/recipes-devtools/gdb/gdb-cross-canadian_linaro-7.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gdb/gdb-cross_linaro-7.8.bb create mode 100644 meta-linaro-toolchain/recipes-devtools/gdb/gdb-linaro-7.8.inc create mode 100644 meta-linaro-toolchain/recipes-devtools/gdb/gdb_linaro-7.8.bb create mode 100644 meta-linaro/conf/layer.conf create mode 100644 meta-linaro/conf/machine/genericarmv7a.conf create mode 100644 meta-linaro/conf/machine/genericarmv7ab.conf create mode 100644 meta-linaro/conf/machine/lng-rt-x86-64.conf create mode 100644 meta-linaro/conf/machine/lng-x86-64.conf create mode 100644 meta-linaro/conf/machine/lng.inc create mode 100755 meta-linaro/recipes-core/initrdscripts/files/init-boot-linaro.sh create mode 100644 meta-linaro/recipes-core/initrdscripts/initramfs-boot-linaro_1.0.bb create mode 100644 meta-linaro/recipes-devtools/qemu/files/3f08ffb4a4741d147634761dc053ed386243a0de.patch create mode 100644 meta-linaro/recipes-devtools/qemu/files/enable-i386-linux-user.patch create mode 100644 meta-linaro/recipes-devtools/qemu/files/fdt_header.patch create mode 100644 meta-linaro/recipes-devtools/qemu/files/fix-libcap-header-issue-on-some-distro.patch create mode 100644 meta-linaro/recipes-devtools/qemu/files/init-info.patch create mode 100644 meta-linaro/recipes-devtools/qemu/files/larger_default_ram_size.patch create mode 100644 meta-linaro/recipes-devtools/qemu/files/no-strip.patch create mode 100644 meta-linaro/recipes-devtools/qemu/files/powerpc_rom.bin create mode 100644 meta-linaro/recipes-devtools/qemu/files/relocatable_sdk.patch create mode 100644 meta-linaro/recipes-devtools/qemu/files/target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch create mode 100644 meta-linaro/recipes-devtools/qemu/files/target-ppc_fix_bit_extraction.patch create mode 100644 meta-linaro/recipes-devtools/qemu/qemu_git.bb create mode 100644 meta-linaro/recipes-extra/arndale-pre-boot/arndale-pre-boot_0.0.2.20130101.bb create mode 100644 meta-linaro/recipes-extra/calibrator/calibrator_0.9e.bb create mode 100644 meta-linaro/recipes-extra/calibrator/files/fix_conflicting_types_for_round.patch create mode 100644 meta-linaro/recipes-extra/daq-odp/daq-odp.bb create mode 100644 meta-linaro/recipes-extra/dwarfutils/README create mode 100644 meta-linaro/recipes-extra/dwarfutils/dwarf.inc create mode 100644 meta-linaro/recipes-extra/dwarfutils/dwarfdump/fix-dump.patch create mode 100644 meta-linaro/recipes-extra/dwarfutils/dwarfdump2/fix-dump.patch create mode 100644 meta-linaro/recipes-extra/dwarfutils/dwarfdump2_20121130.bb create mode 100644 meta-linaro/recipes-extra/dwarfutils/dwarfdump_20121130.bb create mode 100644 meta-linaro/recipes-extra/dwarfutils/dwarfgen_20121130.bb create mode 100644 meta-linaro/recipes-extra/dwarfutils/libdwarf/fix-gennames.patch create mode 100644 meta-linaro/recipes-extra/dwarfutils/libdwarf_20121130.bb create mode 100644 meta-linaro/recipes-extra/efibootmgr/efibootmgr_0.5.4.bb create mode 100644 meta-linaro/recipes-extra/efibootmgr/files/docbook-fixes.patch create mode 100644 meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-Remove-device-path-padding-on-non-Itanium.patch create mode 100644 meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-Work-around-broken-Apple-firmware.patch create mode 100644 meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-fix-disk-minor-number-discovery.patch create mode 100644 meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-fix-minor-memory-leak.patch create mode 100644 meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-make_boot_var-does-not-check-for-failed-status-with-.patch create mode 100644 meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-support-4k-sectors.patch create mode 100644 meta-linaro/recipes-extra/efibootmgr/files/ldflags.patch create mode 100644 meta-linaro/recipes-extra/efibootmgr/files/w-keep-existing-mbr-signature.patch create mode 100644 meta-linaro/recipes-extra/ganglia/ganglia/gmetad-example.conf create mode 100755 meta-linaro/recipes-extra/ganglia/ganglia/gmetad.init create mode 100644 meta-linaro/recipes-extra/ganglia/ganglia/gmond-example.conf create mode 100755 meta-linaro/recipes-extra/ganglia/ganglia/gmond.init create mode 100644 meta-linaro/recipes-extra/ganglia/ganglia_3.6.0.bb create mode 100644 meta-linaro/recipes-extra/hiphopvm/files/hrw-check-for-libdwarf-in-our-place-first.patch create mode 100644 meta-linaro/recipes-extra/hiphopvm/hiphopvm_git.bb create mode 100644 meta-linaro/recipes-extra/idlestat/idlestat_git.bb create mode 100644 meta-linaro/recipes-extra/latency-test/latency-test_git.bb create mode 100644 meta-linaro/recipes-extra/libevent/files/LICENSE.txt create mode 100644 meta-linaro/recipes-extra/libevent/files/libevent-1.4.14.fb-changes.diff create mode 100644 meta-linaro/recipes-extra/libevent/libevent-fb_1.4.14b.bb create mode 100644 meta-linaro/recipes-extra/lng-network-config/files/70-persistent-net.rules create mode 100644 meta-linaro/recipes-extra/lng-network-config/lng-network-config_0.1.bb create mode 100644 meta-linaro/recipes-extra/lshw/files/cross-compile.patch create mode 100644 meta-linaro/recipes-extra/lshw/lshw_02.16.bb create mode 100644 meta-linaro/recipes-extra/meta-toolchain-hhvm/meta-toolchain-hhvm.bb create mode 100644 meta-linaro/recipes-extra/meta-toolchain-hhvm/packagegroup-core-standalone-hhvm-sdk-target.bb create mode 100644 meta-linaro/recipes-extra/odp/odp.bb create mode 100644 meta-linaro/recipes-extra/powerdebug/powerdebug_0.7.3.bb create mode 100644 meta-linaro/recipes-extra/stress/files/texinfo.patch create mode 100644 meta-linaro/recipes-extra/stress/stress_1.0.4.bb create mode 100644 meta-linaro/recipes-extra/trinity/trinity_1.3.bb create mode 100644 meta-linaro/recipes-extra/usecpu/usecpu_git.bb create mode 100755 meta-linaro/recipes-kernel/gator/gator/gator.init create mode 100644 meta-linaro/recipes-kernel/gator/gator_git.bb create mode 100644 meta-linaro/recipes-kernel/linux/bootwrapper.inc create mode 100644 meta-linaro/recipes-kernel/linux/linaro-kernel.inc create mode 100644 meta-linaro/recipes-kernel/linux/linaro-lng-rt-x86-64_git.bb create mode 100644 meta-linaro/recipes-kernel/linux/linaro-lng-x86-64_git.bb create mode 100644 meta-linaro/recipes-kernel/linux/linaro-lng.inc create mode 100644 meta-linaro/recipes-kernel/linux/linux-linaro-aarch64.bb create mode 100644 meta-linaro/recipes-kernel/linux/linux-linaro-stable-vexpress_git.bb create mode 100644 meta-linaro/recipes-kernel/linux/linux-linaro-vexpress_git.bb create mode 100644 meta-linaro/recipes-kernel/perf/files/0001-perf-tools-Fix-arm64-build-error.patch create mode 100644 meta-linaro/recipes-kernel/perf/files/0001-perf-tools-Fix-build-breakage-on-arm64-targets.patch create mode 100644 meta-linaro/recipes-kernel/perf/perf.bbappend create mode 100644 meta-linaro/recipes-kernel/trace-cmd/kernelshark_2.3.2.bb create mode 100644 meta-linaro/recipes-kernel/trace-cmd/trace-cmd_2.3.2.bb create mode 100755 meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-console-login create mode 100755 meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-getty create mode 100755 meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-root-login create mode 100755 meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-serial-console create mode 100644 meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/autogetty create mode 100644 meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console_0.1.bb create mode 100644 meta-linaro/recipes-linaro/files-injection/files-injection.bb create mode 100644 meta-linaro/recipes-linaro/files-injection/files/files-to-inject.tar.xz create mode 100644 meta-linaro/recipes-linaro/files-injection/files/files-to-inject/empty create mode 100644 meta-linaro/recipes-linaro/images/linaro-image-alip.bb create mode 100644 meta-linaro/recipes-linaro/images/linaro-image-arago.bb create mode 100644 meta-linaro/recipes-linaro/images/linaro-image-common.inc create mode 100644 meta-linaro/recipes-linaro/images/linaro-image-kvm.bb create mode 100644 meta-linaro/recipes-linaro/images/linaro-image-lamp.bb create mode 100644 meta-linaro/recipes-linaro/images/linaro-image-leg-java.bb create mode 100644 meta-linaro/recipes-linaro/images/linaro-image-lng.bb create mode 100644 meta-linaro/recipes-linaro/images/linaro-image-minimal-initramfs.bb create mode 100644 meta-linaro/recipes-linaro/images/linaro-image-minimal.bb create mode 100644 meta-linaro/recipes-linaro/images/linaro-image-sdk.bb create mode 100644 meta-linaro/recipes-linaro/images/linaro-image-toolchain-benchmark.bb create mode 100644 meta-linaro/recipes-linaro/images/linaro-sysroot-alip.bb create mode 100644 meta-linaro/recipes-linaro/images/linaro-sysroot-lamp.bb create mode 100644 meta-linaro/recipes-linaro/linaro-lava-tests/files/LICENSE create mode 100644 meta-linaro/recipes-linaro/linaro-lava-tests/files/hello.c create mode 100644 meta-linaro/recipes-linaro/linaro-lava-tests/files/hello.cc create mode 100644 meta-linaro/recipes-linaro/linaro-lava-tests/files/info.php create mode 100644 meta-linaro/recipes-linaro/linaro-lava-tests/files/mysql.php create mode 100644 meta-linaro/recipes-linaro/linaro-lava-tests/linaro-lava-tests.bb create mode 100644 meta-linaro/recipes-support/confuse/confuse_2.7.bb create mode 100644 meta-linaro/recipes-support/rt-app/rt-app_git.bb diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..f3a82fb --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.linaro.org +port=29418 +project=openembedded/meta-linaro diff --git a/COPYING.MIT b/COPYING.MIT new file mode 100644 index 0000000..fb950dc --- /dev/null +++ b/COPYING.MIT @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README b/README new file mode 100644 index 0000000..a5efb1d --- /dev/null +++ b/README @@ -0,0 +1,14 @@ +This repository contains Linaro layers for OpenEmbedded. + +meta-aarch64: + + This repo provides support for AArch64 (64-bit ARM) architecture + +meta-linaro: + + This repo provides additional recipes required for Linaro targets. + +meta-linaro-toolchain: + + This layer adds support for building with GCC Linaro and Linaro external + toolchain. diff --git a/meta-aarch64/conf/layer.conf b/meta-aarch64/conf/layer.conf new file mode 100644 index 0000000..010a700 --- /dev/null +++ b/meta-aarch64/conf/layer.conf @@ -0,0 +1,14 @@ +BBPATH .= ":${LAYERDIR}" +BBFILES += "\ + ${LAYERDIR}/recipes*/*/*.bb \ + ${LAYERDIR}/recipes*/*/*.bbappend \ + " + +BBFILE_COLLECTIONS += "aarch64" +BBFILE_PATTERN_aarch64 := "^${LAYERDIR}/" +BBFILE_PRIORITY_aarch64 = "20" + +# do not error out on bbappends for missing recipes (mysql5) +BB_DANGLINGAPPENDS_WARNONLY = "true" + +LAYERDEPENDS_aarch64 = "linaro linaro-toolchain" diff --git a/meta-aarch64/conf/machine/genericarmv8.conf b/meta-aarch64/conf/machine/genericarmv8.conf new file mode 100644 index 0000000..466900a --- /dev/null +++ b/meta-aarch64/conf/machine/genericarmv8.conf @@ -0,0 +1,37 @@ +#@TYPE: Machine +#@NAME: generic armv8 machine +#@DESCRIPTION: generic machine to be used by linaro-media-create + +require conf/machine/include/arm64/arch-armv8.inc + +PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg" + +XSERVER ?= "xserver-xorg \ + mesa-driver-swrast \ + xf86-input-evdev \ + xf86-input-mouse \ + xf86-video-fbdev \ + xf86-input-keyboard" + +MACHINE_FEATURES = "" + +# Don't include kernels in standard images +RDEPENDS_kernel-base = "" + +PREFERRED_PROVIDER_virtual/kernel ?= "linux-linaro-aarch64" + +KERNEL_IMAGETYPE = "Image" + +# We have to disable SERIAL_CONSOLE due to auto-serial-console +#SERIAL_CONSOLE = "115200 ttyAMA0" + +# Force auto-serial-console to be used by all image types +# Ideally this would be part of core oe or as a bbclassappend, +# but as we don't have an easy way to append a class, defining +# it here +EXTRA_IMAGE_FEATURES += "autoserial" +FEATURE_PACKAGES_autoserial = "auto-serial-console" + +# we do not want to have getty running on tty1 as we run +# auto-serial-console there +USE_VT = "0" diff --git a/meta-aarch64/conf/machine/genericarmv8b.conf b/meta-aarch64/conf/machine/genericarmv8b.conf new file mode 100644 index 0000000..e70de08 --- /dev/null +++ b/meta-aarch64/conf/machine/genericarmv8b.conf @@ -0,0 +1,8 @@ +#@TYPE: Machine +#@NAME: generic armv8 big endian machine +#@DESCRIPTION: generic machine to be used by linaro-media-create +DEFAULTTUNE = "aarch64_be" + +PREFERRED_PROVIDER_virtual/kernel ?= "linux-dummy" + +require conf/machine/genericarmv8.conf diff --git a/meta-aarch64/conf/machine/include/arm64/arch-armv8.inc b/meta-aarch64/conf/machine/include/arm64/arch-armv8.inc new file mode 100644 index 0000000..c86142a --- /dev/null +++ b/meta-aarch64/conf/machine/include/arm64/arch-armv8.inc @@ -0,0 +1,20 @@ +DEFAULTTUNE ?= "aarch64" + +ARMPKGARCH ?= "aarch64" + +TUNEVALID[aarch64] = "Enable instructions for aarch64" +TUNEVALID[bigendian] = "Enable big-endian mode." +TUNECONFLICTS[aarch64] = "" +MACHINEOVERRIDES .= "${@bb.utils.contains("TUNE_FEATURES", "aarch64", ":aarch64", "" ,d)}" + +# Little Endian base configs +AVAILTUNES += "aarch64 aarch64_be" +TUNE_FEATURES_tune-aarch64 ?= "aarch64" +TUNE_FEATURES_tune-aarch64_be ?= "${TUNE_FEATURES_tune-aarch64} bigendian" + +ARMPKGSFX_ENDIAN = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", "_be", "", d)}" + +TUNE_ARCH = "aarch64${ARMPKGSFX_ENDIAN}" +TUNE_PKGARCH = "aarch64${ARMPKGSFX_ENDIAN}" + +PACKAGE_EXTRA_ARCHS = "aarch64${ARMPKGSFX_ENDIAN}" diff --git a/meta-aarch64/recipes-core/openjdk/openjdk-8-common.inc b/meta-aarch64/recipes-core/openjdk/openjdk-8-common.inc new file mode 100644 index 0000000..f251e14 --- /dev/null +++ b/meta-aarch64/recipes-core/openjdk/openjdk-8-common.inc @@ -0,0 +1,267 @@ +DESCRIPTION = "Java runtime based upon the OpenJDK8" +HOMEPAGE = "http://openjdk.java.net/projects/jdk8" +LICENSE = "GPL-2.0-with-classpath-exception" +PRIORITY = "optional" +SECTION = "libs" +INHIBIT_PACKAGE_STRIP = "1" +#INHIBIT_PACKAGE_DEBUG_SPLIT = "1" + +INC_PR = "r16" + +SRC_URI = " \ + ${OPENJDK_URI} \ + " + +libdir_jvm ?= "${libdir}/jvm" + +JDKPN = "openjdk-8" +JDK_DIR = "java-8-openjdk" +JDK_HOME = "${libdir_jvm}/${JDK_DIR}" + +PN = "${JDKPN}-jre" +PROVIDES += "${JDKPN}" + +DEPENDS = " \ + zip-native \ + zlib \ + jpeg libpng giflib \ + gtk+ glib-2.0 \ + cups fontconfig \ + libxt libxinerama libxrender libxtst libxi \ + freetype alsa-lib libffi libxt \ + " + +# No package should directly depend on this (it should require +# java2-runtime instead). +PRIVATE_LIBS = "\ + libunpack.so libverify.so libjava.so libzip.so libnpt.so \ + libjava_crw_demo.so libhprof.so libnet.so libnio.so \ + libmanagement.so libinstrument.so libjsound.so libjsoundalsa.so \ + libj2pcsc.so libj2pkcs11.so libj2gss.so libmlib_image.so \ + libawt.so libsplashscreen.so libfreetype.so.6 libfontmanager.so \ + libjpeg.so liblcms.so librmi.so libjawt.so libjaas_unix.so \ + libattach.so libjdwp.so libdt_socket.so libhpi.so libjli.so \ + libmawt.so libjvm.so \ + libversionCheck.so libcompiledMethodLoad.so libgctest.so \ + libheapViewer.so libheapTracker.so libminst.so libmtrace.so \ + libwaiters.so libhprof.so \ + " + +COMPATIBLE_HOST = "(aarch64).*-linux" +JAVA_HOME[unexport] = "1" +S="${WORKDIR}/openjdk8-aarch64-port-snapshot" + +# The compiler tests in do_configure seem to drop TARGET_CC_ARCH from $CC, so add it into CFLAGS. +CFLAGS =+ "${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}" +CXXFLAGS =+ "${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}" +export EXTRA_CFLAGS = "${TOOLCHAIN_OPTIONS}" +ASNEEDED = "" + +do_configure() { + unset MAKE + bash ./configure --with-debug-level=release --with-jvm-variants=client,server --with-sys-root=${STAGING_DIR_TARGET} --openjdk-target=${TARGET_SYS} --with-zlib=system --with-stdc++lib=dynamic --disable-ccache --disable-zip-debug-info +} + +do_compile() { + make \ + LOG=debug \ + ALT_SDT_H=/openjdk/path/to/a/nonexistent/directory \ + EXTRA_CFLAGS='${EXTRA_CFLAGS}' \ + CC='${CC}' \ + CXX='${CXX}' \ + LD='${CC} ${LDFLAGS}' \ + LDCXX='${CXX} ${LDFLAGS}' \ + LDEXE='${CC} ${LDFLAGS}' \ + LDEXECXX='${CXX} ${LDFLAGS}' \ + images + +} + +do_install() { + install -d ${D}${libdir_jvm} + install -d ${D}${JDK_HOME}/jtreg + install -d ${D}${JDK_HOME}/jtreg/hotspot + install -d ${D}${JDK_HOME}/jtreg/jdk + cp -R ${S}/build/${BUILD_DIR}/j2sdk-image/* ${D}${JDK_HOME} + cp -R ${S}/hotspot/test ${D}${JDK_HOME}/jtreg/hotspot + cp -R ${S}/jdk/test ${D}${JDK_HOME}/jtreg/jdk +# The OpenJDK build does its own thing with debuginfo files; as we +# default to a 'release' build we remove these files. + find ${D}${JDK_HOME} -name \*.debuginfo -print | xargs rm +# The upstream Mercurial repo has various incompatible binaries checked in. +# Remove these otherwise bitbake complains about mismatched architecture, et al. + find ${D}${JDK_HOME}/jtreg -name \*.so -print | xargs rm + rm ${D}${JDK_HOME}/jtreg/jdk/test/sun/management/jmxremote/bootstrap/linux-i586/launcher + rm ${D}${JDK_HOME}/jtreg/jdk/test/sun/management/jmxremote/bootstrap/linux-amd64/launcher + rm ${D}${JDK_HOME}/jtreg/jdk/test/sun/management/jmxremote/bootstrap/solaris-sparcv9/launcher + rm ${D}${JDK_HOME}/jtreg/jdk/test/sun/management/jmxremote/bootstrap/solaris-amd64/launcher + chmod -R u+rw,go+r ${D}${JDK_HOME} +} + +PACKAGES = " \ + ${JDKPN}-jdk \ + ${JDKPN}-doc \ + ${JDKPN}-source \ + ${JDKPN}-demo \ + ${JDKPN}-jtreg \ + ${JDKPN}-jre \ + " + +FILES_${JDKPN}-jdk = " \ + ${JDK_HOME}/bin \ + ${JDK_HOME}/lib \ + ${JDK_HOME}/include \ + ${JDK_HOME}/ASSEMBLY_EXCEPTION \ + ${JDK_HOME}/release \ + ${JDK_HOME}/THIRD_PARTY_README \ + ${JDK_HOME}/LICENSE \ + " + +FILES_${JDKPN}-doc = " \ + ${JDK_HOME}/man \ + " + +FILES_${JDKPN}-source = " \ + ${JDK_HOME}/src.zip \ + " + +FILES_${JDKPN}-demo = " \ + ${JDK_HOME}/demo \ + ${JDK_HOME}/sample \ + " + +FILES_${JDKPN}-jtreg = " \ + ${JDK_HOME}/jtreg \ + " + +FILES_${PN} = " \ + ${JDK_HOME}/jre \ + " + +INSANE_SKIP_${JDKPN}-jdk = "dev-so" +INSANE_SKIP_${JDKPN}-jre = "dev-so" + +RPROVIDES_${JDKPN}-jre = "java2-runtime java2-vm" +RPROVIDES_${JDKPN}-jdk = "java2-runtime java2-vm" +RDEPENDS_${JDKPN}-demo = "java2-runtime" + +RRECOMMENDS_${JDKPN}-jre = "liberation-fonts" +RRECOMMENDS_${JDKPN}-jdk = "liberation-fonts" + +inherit update-alternatives + +pkg_postinst_${JDKPN}-jre () { + update-alternatives --install ${bindir}/java java ${JDK_HOME}/jre/bin/java 75 + update-alternatives --install ${bindir}/jjs jjs ${JDK_HOME}/jre/bin/jjs 75 + update-alternatives --install ${bindir}/keytool keytool ${JDK_HOME}/jre/bin/keytool 75 + update-alternatives --install ${bindir}/orbd orbd ${JDK_HOME}/jre/bin/orbd 75 + update-alternatives --install ${bindir}/pack200 pack200 ${JDK_HOME}/jre/bin/pack200 75 + update-alternatives --install ${bindir}/policytool policytool ${JDK_HOME}/jre/bin/policytool 75 + update-alternatives --install ${bindir}/rmid rmid ${JDK_HOME}/jre/bin/rmid 75 + update-alternatives --install ${bindir}/rmiregistry rmiregistry ${JDK_HOME}/jre/bin/rmiregistry 75 + update-alternatives --install ${bindir}/servertool servertool ${JDK_HOME}/jre/bin/servertool 75 + update-alternatives --install ${bindir}/tnameserv tnameserv ${JDK_HOME}/jre/bin/tnameserv 75 + update-alternatives --install ${bindir}/unpack200 unpack200 ${JDK_HOME}/jre/bin/unpack200 75 +} + +pkg_prerm_${JDKPN}-jre () { + update-alternatives --remove java ${JDK_HOME}/jre/bin/java + update-alternatives --remove jjs ${JDK_HOME}/jre/bin/jjs + update-alternatives --remove keytool ${JDK_HOME}/jre/bin/keytool + update-alternatives --remove orbd ${JDK_HOME}/jre/bin/orbd + update-alternatives --remove pack200 ${JDK_HOME}/jre/bin/pack200 + update-alternatives --remove policytool ${JDK_HOME}/jre/bin/policytool + update-alternatives --remove rmid ${JDK_HOME}/jre/bin/rmid + update-alternatives --remove rmiregistry ${JDK_HOME}/jre/bin/rmiregistry + update-alternatives --remove servertool ${JDK_HOME}/jre/bin/servertool + update-alternatives --remove tnameserv ${JDK_HOME}/jre/bin/tnameserv + update-alternatives --remove unpack200 ${JDK_HOME}/jre/bin/unpack200 +} + +pkg_postinst_${JDKPN}-jdk () { + update-alternatives --install ${bindir}/appletviewer appletviewer ${JDK_HOME}/bin/appletviewer 100 + update-alternatives --install ${bindir}/extcheck extcheck ${JDK_HOME}/bin/extcheck 100 + update-alternatives --install ${bindir}/idlj idlj ${JDK_HOME}/bin/idlj 100 + update-alternatives --install ${bindir}/jar jar ${JDK_HOME}/bin/jar 100 + update-alternatives --install ${bindir}/jarsigner jarsigner ${JDK_HOME}/bin/jarsigner 100 + update-alternatives --install ${bindir}/java java ${JDK_HOME}/bin/java 100 + update-alternatives --install ${bindir}/javac javac ${JDK_HOME}/bin/javac 100 + update-alternatives --install ${bindir}/javadoc javadoc ${JDK_HOME}/bin/javadoc 100 + update-alternatives --install ${bindir}/javah javah ${JDK_HOME}/bin/javah 100 + update-alternatives --install ${bindir}/javap javap ${JDK_HOME}/bin/javap 100 + update-alternatives --install ${bindir}/java-rmi.cgi java-rmi.cgi ${JDK_HOME}/bin/java-rmi.cgi 100 + update-alternatives --install ${bindir}/jcmd jcmd ${JDK_HOME}/bin/jcmd 100 + update-alternatives --install ${bindir}/jconsole jconsole ${JDK_HOME}/bin/jconsole 100 + update-alternatives --install ${bindir}/jdb jdb ${JDK_HOME}/bin/jdb 100 + update-alternatives --install ${bindir}/jdeps jdeps ${JDK_HOME}/bin/jdeps 100 + update-alternatives --install ${bindir}/jhat jhat ${JDK_HOME}/bin/jhat 100 + update-alternatives --install ${bindir}/jinfo jinfo ${JDK_HOME}/bin/jinfo 100 + update-alternatives --install ${bindir}/jjs jjs ${JDK_HOME}/bin/jjs 100 + update-alternatives --install ${bindir}/jmap jmap ${JDK_HOME}/bin/jmap 100 + update-alternatives --install ${bindir}/jps jps ${JDK_HOME}/bin/jps 100 + update-alternatives --install ${bindir}/jrunscript jrunscript ${JDK_HOME}/bin/jrunscript 100 + update-alternatives --install ${bindir}/jsadebugd jsadebugd ${JDK_HOME}/bin/jsadebugd 100 + update-alternatives --install ${bindir}/jstack jstack ${JDK_HOME}/bin/jstack 100 + update-alternatives --install ${bindir}/jstat jstat ${JDK_HOME}/bin/jstat 100 + update-alternatives --install ${bindir}/jstatd jstatd ${JDK_HOME}/bin/jstatd 100 + update-alternatives --install ${bindir}/keytool keytool ${JDK_HOME}/bin/keytool 100 + update-alternatives --install ${bindir}/native2ascii native2ascii ${JDK_HOME}/bin/native2ascii 100 + update-alternatives --install ${bindir}/orbd orbd ${JDK_HOME}/bin/orbd 100 + update-alternatives --install ${bindir}/pack200 pack200 ${JDK_HOME}/bin/pack200 100 + update-alternatives --install ${bindir}/policytool policytool ${JDK_HOME}/bin/policytool 100 + update-alternatives --install ${bindir}/rmic rmic ${JDK_HOME}/bin/rmic 100 + update-alternatives --install ${bindir}/rmid rmid ${JDK_HOME}/bin/rmid 100 + update-alternatives --install ${bindir}/rmiregistry rmiregistry ${JDK_HOME}/bin/rmiregistry 100 + update-alternatives --install ${bindir}/schemagen schemagen ${JDK_HOME}/bin/schemagen 100 + update-alternatives --install ${bindir}/serialver serialver ${JDK_HOME}/bin/serialver 100 + update-alternatives --install ${bindir}/servertool servertool ${JDK_HOME}/bin/servertool 100 + update-alternatives --install ${bindir}/tnameserv tnameserv ${JDK_HOME}/bin/tnameserv 100 + update-alternatives --install ${bindir}/unpack200 unpack200 ${JDK_HOME}/bin/unpack200 100 + update-alternatives --install ${bindir}/wsgen wsgen ${JDK_HOME}/bin/wsgen 100 + update-alternatives --install ${bindir}/wsimport wsimport ${JDK_HOME}/bin/wsimport 100 + update-alternatives --install ${bindir}/xjc xjc ${JDK_HOME}/bin/xjc 100 +} + +pkg_prerm_${JDKPN}-jdk () { + update-alternatives --remove appletviewer ${JDK_HOME}/bin/appletviewer + update-alternatives --remove extcheck ${JDK_HOME}/bin/extcheck + update-alternatives --remove idlj ${JDK_HOME}/bin/idlj + update-alternatives --remove jar ${JDK_HOME}/bin/jar + update-alternatives --remove jarsigner ${JDK_HOME}/bin/jarsigner + update-alternatives --remove java ${JDK_HOME}/bin/java + update-alternatives --remove javac ${JDK_HOME}/bin/javac + update-alternatives --remove javadoc ${JDK_HOME}/bin/javadoc + update-alternatives --remove javah ${JDK_HOME}/bin/javah + update-alternatives --remove javap ${JDK_HOME}/bin/javap + update-alternatives --remove java-rmi.cgi ${JDK_HOME}/bin/java-rmi.cgi + update-alternatives --remove jcmd ${JDK_HOME}/bin/jcmd + update-alternatives --remove jconsole ${JDK_HOME}/bin/jconsole + update-alternatives --remove jdb ${JDK_HOME}/bin/jdb + update-alternatives --remove jdeps ${JDK_HOME}/bin/jdeps + update-alternatives --remove jhat ${JDK_HOME}/bin/jhat + update-alternatives --remove jinfo ${JDK_HOME}/bin/jinfo + update-alternatives --remove jjs ${JDK_HOME}/bin/jjs + update-alternatives --remove jmap ${JDK_HOME}/bin/jmap + update-alternatives --remove jps ${JDK_HOME}/bin/jps + update-alternatives --remove jrunscript ${JDK_HOME}/bin/jrunscript + update-alternatives --remove jsadebugd ${JDK_HOME}/bin/jsadebugd + update-alternatives --remove jstack ${JDK_HOME}/bin/jstack + update-alternatives --remove jstat ${JDK_HOME}/bin/jstat + update-alternatives --remove jstatd ${JDK_HOME}/bin/jstatd + update-alternatives --remove keytool ${JDK_HOME}/bin/keytool + update-alternatives --remove native2ascii ${JDK_HOME}/bin/native2ascii + update-alternatives --remove orbd ${JDK_HOME}/bin/orbd + update-alternatives --remove pack200 ${JDK_HOME}/bin/pack200 + update-alternatives --remove policytool ${JDK_HOME}/bin/policytool + update-alternatives --remove rmic ${JDK_HOME}/bin/rmic + update-alternatives --remove rmid ${JDK_HOME}/bin/rmid + update-alternatives --remove rmiregistry ${JDK_HOME}/bin/rmiregistry + update-alternatives --remove schemagen ${JDK_HOME}/bin/schemagen + update-alternatives --remove serialver ${JDK_HOME}/bin/serialver + update-alternatives --remove servertool ${JDK_HOME}/bin/servertool + update-alternatives --remove tnameserv ${JDK_HOME}/bin/tnameserv + update-alternatives --remove unpack200 ${JDK_HOME}/bin/unpack200 + update-alternatives --remove wsgen ${JDK_HOME}/bin/wsgen + update-alternatives --remove wsimport ${JDK_HOME}/bin/wsimport + update-alternatives --remove xjc ${JDK_HOME}/bin/xjc +} diff --git a/meta-aarch64/recipes-core/openjdk/openjdk-8_0.1.bb b/meta-aarch64/recipes-core/openjdk/openjdk-8_0.1.bb new file mode 100644 index 0000000..44eef03 --- /dev/null +++ b/meta-aarch64/recipes-core/openjdk/openjdk-8_0.1.bb @@ -0,0 +1,29 @@ +require openjdk-8-common.inc + +PR = "${INC_PR}.0" + +OPENJDK_URI = "\ + hg://hg.openjdk.java.net/aarch64-port;protocol=http;destsuffix=hg/jdk8;name=jdk8;module=jdk8 \ + hg://hg.openjdk.java.net/aarch64-port;protocol=http;destsuffix=hg/corba;name=corba;module=jdk8/corba \ + hg://hg.openjdk.java.net/aarch64-port;protocol=http;destsuffix=hg/hotspot;name=hotspot;module=jdk8/hotspot \ + hg://hg.openjdk.java.net/aarch64-port;protocol=http;destsuffix=hg/jaxp;name=jaxp;module=jdk8/jaxp \ + hg://hg.openjdk.java.net/aarch64-port;protocol=http;destsuffix=hg/jaxws;name=jaxws;module=jdk8/jaxws \ + hg://hg.openjdk.java.net/aarch64-port;protocol=http;destsuffix=hg/jdk;name=jdk;module=jdk8/jdk \ + hg://hg.openjdk.java.net/aarch64-port;protocol=http;destsuffix=hg/langtools;name=langtools;module=jdk8/langtools \ + hg://hg.openjdk.java.net/aarch64-port;protocol=http;destsuffix=hg/nashorn;name=nashorn;module=jdk8/nashorn \ + " + +SRCREV_jdk8 = "${AUTOREV}" +SRCREV_corba = "${AUTOREV}" +SRCREV_hotspot = "${AUTOREV}" +SRCREV_jaxp = "${AUTOREV}" +SRCREV_jaxws = "${AUTOREV}" +SRCREV_jdk = "${AUTOREV}" +SRCREV_langtools = "${AUTOREV}" +SRCREV_nashorn = "${AUTOREV}" + +S = "${WORKDIR}/jdk8" + +LIC_FILES_CHKSUM="file://LICENSE;md5=7b4baeedfe2d40cb03536573bc2c89b1" + +BUILD_DIR="linux-aarch64-normal-clientANDserver-release/images" diff --git a/meta-aarch64/recipes-core/packagegroups/packagegroup-core-sdk.bbappend b/meta-aarch64/recipes-core/packagegroups/packagegroup-core-sdk.bbappend new file mode 100644 index 0000000..5d50b62 --- /dev/null +++ b/meta-aarch64/recipes-core/packagegroups/packagegroup-core-sdk.bbappend @@ -0,0 +1,16 @@ +INCPR = "1" + +RDEPENDS_packagegroup-core-sdk = "\ + packagegroup-core-buildessential \ + coreutils \ + ccache \ + diffutils \ + intltool \ + perl-module-re \ + perl-module-text-wrap \ + findutils \ + quilt \ + less \ + ldd \ + file \ + tcl" diff --git a/meta-aarch64/recipes-kernel/kexec-tools/files/add-arm64-support.patch b/meta-aarch64/recipes-kernel/kexec-tools/files/add-arm64-support.patch new file mode 100644 index 0000000..30b0229 --- /dev/null +++ b/meta-aarch64/recipes-kernel/kexec-tools/files/add-arm64-support.patch @@ -0,0 +1,521 @@ +From 98215763db92c85668fd217cfc719322ce54e704 Mon Sep 17 00:00:00 2001 +From: Geoff Levand +Date: Tue, 13 May 2014 10:59:52 -0700 +Subject: [PATCH 1/1] Add arm64 support + +Signed-off-by: Geoff Levand +Signed-off-by: Fathi Boudra +--- + configure.ac | 3 + kexec/Makefile | 1 + kexec/arch/arm64/Makefile | 31 +++++ + kexec/arch/arm64/include/arch/options.h | 30 ++++ + kexec/arch/arm64/kexec-arm64.c | 194 ++++++++++++++++++++++++++++++++ + kexec/arch/arm64/kexec-arm64.h | 28 ++++ + kexec/arch/arm64/kexec-elf-arm64.c | 147 ++++++++++++++++++++++++ + kexec/kexec-syscall.h | 9 + + 8 files changed, 441 insertions(+), 2 deletions(-) + create mode 100644 kexec/arch/arm64/Makefile + create mode 100644 kexec/arch/arm64/include/arch/options.h + create mode 100644 kexec/arch/arm64/kexec-arm64.c + create mode 100644 kexec/arch/arm64/kexec-arm64.h + create mode 100644 kexec/arch/arm64/kexec-elf-arm64.c + +--- a/configure.ac ++++ b/configure.ac +@@ -35,6 +35,9 @@ case $target_cpu in + ARCH="ppc64" + SUBARCH="LE" + ;; ++ aarch64* ) ++ ARCH="arm64" ++ ;; + arm* ) + ARCH="arm" + ;; +--- a/kexec/Makefile ++++ b/kexec/Makefile +@@ -71,6 +71,7 @@ KEXEC_SRCS += $($(ARCH)_FS2DT) + + include $(srcdir)/kexec/arch/alpha/Makefile + include $(srcdir)/kexec/arch/arm/Makefile ++include $(srcdir)/kexec/arch/arm64/Makefile + include $(srcdir)/kexec/arch/i386/Makefile + include $(srcdir)/kexec/arch/ia64/Makefile + include $(srcdir)/kexec/arch/m68k/Makefile +--- /dev/null ++++ b/kexec/arch/arm64/Makefile +@@ -0,0 +1,31 @@ ++ ++arm64_FS2DT += kexec/fs2dt.c ++arm64_FS2DT_INCLUDE += -include $(srcdir)/kexec/arch/arm64/kexec-arm64.h ++ ++arm64_KEXEC_SRCS += \ ++ kexec/arch/arm64/kexec-arm64.c \ ++ kexec/arch/arm64/kexec-elf-arm64.c ++ ++arm64_ARCH_REUSE_INITRD = ++arm64_ADD_SEGMENT = ++arm64_VIRT_TO_PHYS = ++ ++dist += $(arm64_KEXEC_SRCS) \ ++ kexec/arch/arm64/Makefile \ ++ kexec/arch/arm64/kexec-arm64.h ++ ++ifdef HAVE_LIBFDT ++ ++LIBS += -lfdt ++ ++else ++ ++include $(srcdir)/kexec/libfdt/Makefile.libfdt ++ ++libfdt_SRCS += $(LIBFDT_SRCS:%=kexec/libfdt/%) ++ ++arm64_CPPFLAGS = -I$(srcdir)/kexec/libfdt ++ ++arm64_KEXEC_SRCS += $(libfdt_SRCS) ++ ++endif +--- /dev/null ++++ b/kexec/arch/arm64/include/arch/options.h +@@ -0,0 +1,30 @@ ++#ifndef KEXEC_ARCH_ARM64_OPTIONS_H ++#define KEXEC_ARCH_ARM64_OPTIONS_H ++ ++#define OPT_APPEND ((OPT_MAX)+0) ++#define OPT_RAMDISK ((OPT_MAX)+1) ++#define OPT_DTB ((OPT_MAX)+2) ++#define OPT_ARCH_MAX ((OPT_MAX)+3) ++ ++#define KEXEC_ARCH_OPTIONS \ ++ KEXEC_OPTIONS \ ++ { "append", 1, NULL, OPT_APPEND }, \ ++ { "command-line", 1, NULL, OPT_APPEND }, \ ++ { "dtb", 1, NULL, OPT_DTB }, \ ++ { "initrd", 1, NULL, OPT_RAMDISK }, \ ++ { "ramdisk", 1, NULL, OPT_RAMDISK }, \ ++ ++#define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR /* Only accept long arch options. */ ++ ++#define KEXEC_ALL_OPTIONS KEXEC_ARCH_OPTIONS ++#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR ++ ++struct arm64_opts { ++ const char *command_line; ++ const char *ramdisk; ++ const char *dtb; ++}; ++ ++struct arm64_opts arm64_opts; ++ ++#endif /* KEXEC_ARCH_ARM64_OPTIONS_H */ +--- /dev/null ++++ b/kexec/arch/arm64/kexec-arm64.c +@@ -0,0 +1,194 @@ ++/* ++ * ARM64 kexec support. ++ */ ++ ++#define _GNU_SOURCE ++ ++#include ++#include ++#include ++#include ++#include ++ ++//#include ++ ++#include "../../kexec.h" ++#include "../../kexec-syscall.h" ++#include "kexec-arm64.h" ++#include "arch/options.h" ++ ++/* Global varables the core kexec routines expect. */ ++ ++unsigned char reuse_initrd; ++off_t initrd_base = 0; ++off_t initrd_size = 0; ++ ++struct memory_ranges usablemem_rgns = { ++}; ++ ++const struct arch_map_entry arches[] = { ++ { "aarch64", KEXEC_ARCH_ARM64 }, ++ { NULL, 0 }, ++}; ++ ++/* arm64 global varables. */ ++ ++struct arm64_opts arm64_opts; ++ ++void arch_usage(void) ++{ ++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__); ++ ++ printf( ++" --append=STRING Set the kernel command line to STRING.\n" ++" --command-line=STRING Set the kernel command line to STRING.\n" ++" --dtb=FILE Use FILE as the device tree blob.\n" ++" --initrd=FILE Use FILE as the kernel initial ramdisk.\n" ++" --ramdisk=FILE Use FILE as the kernel initial ramdisk.\n"); ++ ++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__); ++} ++ ++int arch_process_options(int argc, char **argv) ++{ ++ static const char short_options[] = KEXEC_OPT_STR ""; ++ static const struct option options[] = { ++ KEXEC_ARCH_OPTIONS ++ { 0 } ++ }; ++ int opt; ++ ++ for (opt = 0; opt != -1; ) { ++ opt = getopt_long(argc, argv, short_options, options, 0); ++ ++ switch (opt) { ++ case OPT_APPEND: ++ arm64_opts.command_line = optarg; ++ break; ++ case OPT_RAMDISK: ++ arm64_opts.ramdisk = optarg; ++ break; ++ case OPT_DTB: ++ arm64_opts.dtb = optarg; ++ break; ++ default: ++ break; /* Ignore core and unknown options */ ++ } ++ } ++ ++ dbgprintf("%s:%d: command_line: %s\n", __func__, __LINE__, ++ arm64_opts.command_line); ++ dbgprintf("%s:%d: ramdisk: %s\n", __func__, __LINE__, ++ arm64_opts.ramdisk); ++ dbgprintf("%s:%d: dtb: %s\n", __func__, __LINE__, arm64_opts.dtb); ++ ++ return 0; ++} ++ ++void arch_reuse_initrd(void) ++{ ++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__); ++ reuse_initrd = 1; ++} ++ ++unsigned long virt_to_phys(unsigned long v) ++{ ++ const unsigned long memstart_addr = 0x080000000UL; // FIXME: get from memory_range/DT ++ const unsigned long page_offset = 0xffffffc000000000UL; // FIXME: from where??? ++ unsigned long p = (v & ~page_offset) + memstart_addr; ++ ++ fprintf(stderr, "%s:%d: %016lx -> %016lx\n", __func__, __LINE__, v, p); ++ return p; ++} ++ ++void add_segment(struct kexec_info *info, const void *buf, size_t bufsz, ++ unsigned long base, size_t memsz) ++{ ++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__); ++ add_segment_phys_virt(info, buf, bufsz, base, memsz, 1); ++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__); ++} ++ ++int get_memory_ranges(struct memory_range **range, int *ranges, ++ unsigned long kexec_flags) ++{ ++ /* FIXME: Should get this info from device tree. */ ++ static struct memory_range memory_range[KEXEC_SEGMENT_MAX]; ++ const char *iomem; ++ int range_count = 0; ++ char line[MAX_LINE]; ++ FILE *fp; ++ ++ iomem = proc_iomem(); ++ fp = fopen(iomem, "r"); ++ ++ if (!fp) { ++ fprintf(stderr, "Cannot open %s: %s\n", iomem, strerror(errno)); ++ return -1; ++ } ++ ++ dbgprintf("memory ranges:\n"); ++ ++ while(fgets(line, sizeof(line), fp) != 0) { ++ struct memory_range r; ++ char *str; ++ int consumed; ++ ++ if (range_count >= KEXEC_SEGMENT_MAX) ++ break; ++ ++ if (sscanf(line, "%Lx-%Lx : %n", &r.start, &r.end, &consumed) ++ != 2) ++ continue; ++ ++ str = line + consumed; ++ r.end++; ++ ++ if (memcmp(str, "System RAM\n", 11)) { ++ dbgprintf(" Skip: %016Lx - %016Lx : %s", r.start, r.end, ++ str); ++ continue; ++ } ++ ++ r.type = RANGE_RAM; ++ memory_range[range_count] = r; ++ range_count++; ++ ++ dbgprintf(" Add: %016Lx - %016Lx : %s", r.start, r.end, str); ++ } ++ ++ fclose(fp); ++ *range = memory_range; ++ *ranges = range_count; ++ ++ return 0; ++} ++ ++struct file_type file_type[] = { ++ { "elf-arm64", elf_arm64_probe, elf_arm64_load, elf_arm64_usage }, ++}; ++ ++int file_types = sizeof(file_type) / sizeof(file_type[0]); ++ ++int arch_compat_trampoline(struct kexec_info *info) ++{ ++ return 0; ++} ++int machine_verify_elf_rel(struct mem_ehdr *ehdr) ++{ ++ return 0; ++} ++ ++void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type, ++ void *location, unsigned long address, unsigned long value) ++{ ++} ++ ++void arch_update_purgatory(struct kexec_info *UNUSED(info)) ++{ ++} ++ ++int is_crashkernel_mem_reserved(void) ++{ ++ return 0; ++} +--- /dev/null ++++ b/kexec/arch/arm64/kexec-arm64.h +@@ -0,0 +1,28 @@ ++/* ++ * ARM64 kexec support. ++ */ ++ ++#if !defined(KEXEC_ARM64_H) ++#define KEXEC_ARM64_H ++ ++/* #include FIXME: this is broken */ ++#include ++ ++#include "../../kexec.h" ++ ++#define KEXEC_SEGMENT_MAX 16 /* FIXME: this should come from */ ++ ++#define BOOT_BLOCK_VERSION 17 ++#define BOOT_BLOCK_LAST_COMP_VERSION 16 ++#define COMMAND_LINE_SIZE 512 ++ ++int elf_arm64_probe(const char *buf, off_t len); ++int elf_arm64_load(int argc, char **argv, const char *buf, off_t len, ++ struct kexec_info *info); ++void elf_arm64_usage(void); ++ ++struct memory_ranges usablemem_rgns; ++off_t initrd_base; ++off_t initrd_size; ++ ++#endif +--- /dev/null ++++ b/kexec/arch/arm64/kexec-elf-arm64.c +@@ -0,0 +1,147 @@ ++/* ++ * ARM64 kexec support. ++ */ ++ ++#define _GNU_SOURCE ++ ++#include ++#include ++#include ++ ++#include "kexec-arm64.h" ++ ++#include "../../kexec-syscall.h" ++#include "../../fs2dt.h" ++ ++#include "arch/options.h" ++ ++#if !defined(EM_AARCH64) ++# define EM_AARCH64 183 ++#endif ++ ++int elf_arm64_probe(const char *buf, off_t len) ++{ ++ int result; ++ struct mem_ehdr ehdr; ++ ++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__); ++ ++ result = build_elf_exec_info(buf, len, &ehdr, 0); ++ ++ if (result < 0) { ++ dbgprintf("Not an ELF executable\n"); ++ goto out; ++ } ++ ++ if (ehdr.e_machine != EM_AARCH64) { ++ dbgprintf("Not an AARCH64 executable\n"); ++ result = -1; ++ goto out; ++ } ++ ++ result = 0; ++ ++out: ++ free_elf_info(&ehdr); ++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__); ++ return result; ++} ++ ++static off_t round_up(off_t v) ++{ ++ return _ALIGN_DOWN(v + getpagesize(), getpagesize()); ++} ++ ++int elf_arm64_load(int argc, char **argv, const char *buf, off_t len, ++ struct kexec_info *info) ++{ ++ char *dtb_buf; ++ off_t dtb_base; ++ off_t dtb_size; ++ struct mem_ehdr ehdr; ++ int result; ++ //unsigned int command_line_len = strlen(arm64_opts.command_line) + 1; ++ ++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__); ++ ++ if (info->kexec_flags & KEXEC_ON_CRASH) { ++ fprintf(stderr, "kexec: kdump not yet supported on arm64\n"); ++ return -1; ++ } ++ ++ result = build_elf_exec_info(buf, len, &ehdr, 0); ++ ++ if (result < 0) { ++ free_elf_info(&ehdr); ++ fprintf(stderr, "%s:%d: build_elf_exec_info failed\n", __func__, ++ __LINE__); ++ return result; ++ } ++ ++ elf_exec_build_load(info, &ehdr, buf, len, 0); ++ ++ info->entry = (void*)0x80080000UL; // FIXME ++ ++ initrd_base = 0; ++ initrd_size = 0; ++ ++ if (arm64_opts.ramdisk) { ++ char *buf; ++ ++ buf = slurp_file(arm64_opts.ramdisk, &initrd_size); ++ ++ if (!buf) ++ fprintf(stderr, "kexec: empty ramdisk file\n"); ++ else { ++ initrd_base = locate_hole(info, initrd_size, 0, 0, -1, -1); ++ ++ add_segment_phys_virt(info, buf, initrd_size, initrd_base, ++ initrd_size, 0); ++ } ++ } ++ ++ fprintf(stderr, "%s:%d: initrd_base: %lx, initrd_size: %lx\n", __func__, ++ __LINE__, (unsigned long)initrd_base, (unsigned long)initrd_size); ++ ++ if (arm64_opts.dtb) ++ dtb_buf = slurp_file(arm64_opts.dtb, &dtb_size); ++ else ++ create_flatten_tree(&dtb_buf, &dtb_size, ++ arm64_opts.command_line); ++ ++ fprintf(stderr, "%s:%d: dt magic: %x : %x\n", __func__, __LINE__, ++ fdt32_to_cpu(*(uint32_t*)dtb_buf), *(uint32_t*)dtb_buf); ++ ++ result = fdt_check_header(dtb_buf); ++ ++ if (result) { ++ fprintf(stderr, "Invalid FDT.\n"); ++ return -1; ++ } ++ ++ if (arm64_opts.command_line) { ++ // FIXME: need to handle command line... ++ fprintf(stderr, "%s:%d: command line support TODO\n", __func__, __LINE__); ++ } ++ ++if (1) { ++ dtb_base = (unsigned long)info->entry + round_up(0xA43FA0); // computed kernel mem size. ++ ++ fprintf(stderr, "%s:%d: dtb_base: %lx, dtb_size: %lx\n", __func__, ++ __LINE__, (unsigned long)dtb_base, (unsigned long)dtb_size); ++} else { ++ dtb_base = locate_hole(info, dtb_size, 0, 0, -1, -1); ++ ++ fprintf(stderr, "%s:%d: dtb_base: %lx, dtb_size: %lx\n", __func__, ++ __LINE__, (unsigned long)dtb_base, (unsigned long)dtb_size); ++} ++ add_segment_phys_virt(info, dtb_buf, dtb_size, dtb_base, dtb_size, 0); ++ ++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__); ++ return 0; ++} ++ ++void elf_arm64_usage(void) ++{ ++ fprintf(stderr, "%s:%d\n", __func__, __LINE__); ++} +--- a/kexec/kexec-syscall.h ++++ b/kexec/kexec-syscall.h +@@ -39,8 +39,8 @@ + #ifdef __s390__ + #define __NR_kexec_load 277 + #endif +-#ifdef __arm__ +-#define __NR_kexec_load __NR_SYSCALL_BASE + 347 ++#if defined(__arm__) || defined(__arm64__) ++#define __NR_kexec_load __NR_SYSCALL_BASE + 347 + #endif + #if defined(__mips__) + #define __NR_kexec_load 4311 +@@ -76,6 +76,8 @@ static inline long kexec_load(void *entr + #define KEXEC_ARCH_PPC64 (21 << 16) + #define KEXEC_ARCH_IA_64 (50 << 16) + #define KEXEC_ARCH_ARM (40 << 16) ++#define KEXEC_ARCH_ARM64 (183 << 16) ++/* #define KEXEC_ARCH_AARCH64 (183 << 16) */ + #define KEXEC_ARCH_S390 (22 << 16) + #define KEXEC_ARCH_SH (42 << 16) + #define KEXEC_ARCH_MIPS_LE (10 << 16) +@@ -121,5 +123,8 @@ static inline long kexec_load(void *entr + #ifdef __m68k__ + #define KEXEC_ARCH_NATIVE KEXEC_ARCH_68K + #endif ++#if defined(__arm64__) ++#define KEXEC_ARCH_NATIVE KEXEC_ARCH_ARM64 ++#endif + + #endif /* KEXEC_SYSCALL_H */ diff --git a/meta-aarch64/recipes-kernel/kexec-tools/kexec-tools_2.0.7.bbappend b/meta-aarch64/recipes-kernel/kexec-tools/kexec-tools_2.0.7.bbappend new file mode 100644 index 0000000..6417ffa --- /dev/null +++ b/meta-aarch64/recipes-kernel/kexec-tools/kexec-tools_2.0.7.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI_append = " file://add-arm64-support.patch" + +COMPATIBLE_HOST = "(x86_64|i.86|arm|aarch64|powerpc|mips).*-(linux|freebsd.*)" diff --git a/meta-aarch64/recipes-kernel/sysprof/sysprof_git.bbappend b/meta-aarch64/recipes-kernel/sysprof/sysprof_git.bbappend new file mode 100644 index 0000000..8db9345 --- /dev/null +++ b/meta-aarch64/recipes-kernel/sysprof/sysprof_git.bbappend @@ -0,0 +1 @@ +COMPATIBLE_HOST_aarch64 = "0" diff --git a/meta-aarch64/recipes-multimedia/pulseaudio/files/0001-libatomic_ops-Aarch64-basic-port.patch b/meta-aarch64/recipes-multimedia/pulseaudio/files/0001-libatomic_ops-Aarch64-basic-port.patch new file mode 100644 index 0000000..0769377 --- /dev/null +++ b/meta-aarch64/recipes-multimedia/pulseaudio/files/0001-libatomic_ops-Aarch64-basic-port.patch @@ -0,0 +1,232 @@ +From aac120d778ae5fc619b2fb8ef18ea18d3d5d20cc Mon Sep 17 00:00:00 2001 +From: Yvan Roux +Date: Wed, 23 Jan 2013 17:14:16 +0100 +Subject: [PATCH] Aarch64 basic port + +Adapted-for-OpenEmbedded-by: Marcin Juszkiewicz + +--- + src/atomic_ops.h | 4 + src/atomic_ops/sysdeps/Makefile.am | 1 + src/atomic_ops/sysdeps/gcc/aarch64.h | 184 +++++++++++++++++++++++++++++++++++ + 3 files changed, 189 insertions(+) + create mode 100644 src/atomic_ops/sysdeps/gcc/aarch64.h + +--- libatomic_ops-7.2.orig/src/atomic_ops.h ++++ libatomic_ops-7.2/src/atomic_ops.h +@@ -242,10 +242,14 @@ + # endif /* __m68k__ */ + # if defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) \ + || defined(__powerpc64__) || defined(__ppc64__) + # include "atomic_ops/sysdeps/gcc/powerpc.h" + # endif /* __powerpc__ */ ++# if defined(__aarch64__) ++# include "atomic_ops/sysdeps/gcc/aarch64.h" ++# define AO_CAN_EMUL_CAS ++# endif /* __aarch64__ */ + # if defined(__arm__) && !defined(AO_USE_PTHREAD_DEFS) + # include "atomic_ops/sysdeps/gcc/arm.h" + # define AO_CAN_EMUL_CAS + # endif /* __arm__ */ + # if defined(__cris__) || defined(CRIS) +--- libatomic_ops-7.2.orig/src/atomic_ops/sysdeps/Makefile.am ++++ libatomic_ops-7.2/src/atomic_ops/sysdeps/Makefile.am +@@ -24,10 +24,11 @@ nobase_sysdep_HEADERS= generic_pthread.h + standard_ao_double_t.h \ + README \ + \ + armcc/arm_v6.h \ + \ ++ gcc/aarch64.h \ + gcc/alpha.h gcc/arm.h gcc/avr32.h gcc/cris.h \ + gcc/hexagon.h gcc/hppa.h gcc/ia64.h gcc/m68k.h \ + gcc/mips.h gcc/powerpc.h gcc/s390.h \ + gcc/sh.h gcc/sparc.h gcc/x86.h gcc/x86_64.h \ + \ +--- /dev/null ++++ libatomic_ops-7.2/src/atomic_ops/sysdeps/gcc/aarch64.h +@@ -0,0 +1,184 @@ ++/* ++ * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. ++ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. ++ * Copyright (c) 1999-2003 by Hewlett-Packard Company. All rights reserved. ++ * ++ * ++ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED ++ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. ++ * ++ * Permission is hereby granted to use or copy this program ++ * for any purpose, provided the above notices are retained on all copies. ++ * Permission to modify the code and to distribute modified code is granted, ++ * provided the above notices are retained, and a notice that the code was ++ * modified is included with the above copyright notice. ++ * ++ */ ++ ++#include "../read_ordered.h" ++ ++#include "../test_and_set_t_is_ao_t.h" ++ ++AO_INLINE void ++AO_nop_full(void) ++{ ++# ifndef AO_UNIPROCESSOR ++__sync_synchronize (); ++# endif ++} ++#define AO_HAVE_nop_full ++ ++AO_INLINE AO_t ++AO_load(const volatile AO_t *addr) ++{ ++ return __atomic_load_n (addr, __ATOMIC_RELAXED); ++} ++#define AO_HAVE_load ++ ++AO_INLINE AO_t ++AO_load_acquire(const volatile AO_t *addr) ++{ ++ return __atomic_load_n (addr, __ATOMIC_ACQUIRE); ++} ++#define AO_HAVE_load_acquire ++ ++AO_INLINE void ++ AO_store(volatile AO_t *addr, AO_t value) ++{ ++ __atomic_store_n(addr, value, __ATOMIC_RELAXED); ++} ++#define AO_HAVE_store ++ ++AO_INLINE void ++ AO_store_release(volatile AO_t *addr, AO_t value) ++{ ++ __atomic_store_n(addr, value, __ATOMIC_RELEASE); ++} ++#define AO_HAVE_store_release ++ ++AO_INLINE AO_TS_VAL_t ++AO_test_and_set(volatile AO_TS_t *addr) ++{ ++ return __atomic_test_and_set(addr, __ATOMIC_RELAXED); ++} ++# define AO_HAVE_test_and_set ++ ++AO_INLINE AO_TS_VAL_t ++AO_test_and_set_acquire(volatile AO_TS_t *addr) ++{ ++ return __atomic_test_and_set(addr, __ATOMIC_ACQUIRE); ++} ++# define AO_HAVE_test_and_set_acquire ++ ++AO_INLINE AO_TS_VAL_t ++AO_test_and_set_release(volatile AO_TS_t *addr) ++{ ++ return __atomic_test_and_set(addr, __ATOMIC_RELEASE); ++} ++# define AO_HAVE_test_and_set_release ++ ++AO_INLINE AO_TS_VAL_t ++AO_test_and_set_full(volatile AO_TS_t *addr) ++{ ++ return __atomic_test_and_set(addr, __ATOMIC_SEQ_CST); ++} ++# define AO_HAVE_test_and_set_full ++ ++AO_INLINE AO_t ++AO_fetch_and_add(volatile AO_t *p, AO_t incr) ++{ ++ return __atomic_fetch_add(p, incr, __ATOMIC_RELAXED); ++} ++#define AO_HAVE_fetch_and_add ++ ++AO_INLINE AO_t ++AO_fetch_and_add_acquire(volatile AO_t *p, AO_t incr) ++{ ++ return __atomic_fetch_add(p, incr, __ATOMIC_ACQUIRE); ++} ++#define AO_HAVE_fetch_and_add_acquire ++ ++AO_INLINE AO_t ++AO_fetch_and_add_release(volatile AO_t *p, AO_t incr) ++{ ++ return __atomic_fetch_add(p, incr, __ATOMIC_RELEASE); ++} ++#define AO_HAVE_fetch_and_add_release ++ ++AO_INLINE AO_t ++AO_fetch_and_add_full(volatile AO_t *p, AO_t incr) ++{ ++ return __atomic_fetch_add(p, incr, __ATOMIC_SEQ_CST); ++} ++#define AO_HAVE_fetch_and_add_full ++ ++AO_INLINE AO_t ++AO_fetch_and_add1(volatile AO_t *p) ++{ ++ return __atomic_fetch_add(p, 1, __ATOMIC_RELAXED); ++} ++#define AO_HAVE_fetch_and_add1 ++ ++AO_INLINE AO_t ++AO_fetch_and_add1_acquire(volatile AO_t *p) ++{ ++ return __atomic_fetch_add(p, 1, __ATOMIC_ACQUIRE); ++} ++#define AO_HAVE_fetch_and_add1_acquire ++ ++AO_INLINE AO_t ++AO_fetch_and_add1_release(volatile AO_t *p) ++{ ++ return __atomic_fetch_add(p, 1, __ATOMIC_RELEASE); ++} ++#define AO_HAVE_fetch_and_add1_release ++ ++AO_INLINE AO_t ++AO_fetch_and_add1_full(volatile AO_t *p) ++{ ++ return __atomic_fetch_add(p, 1, __ATOMIC_SEQ_CST); ++} ++#define AO_HAVE_fetch_and_add1_full ++ ++AO_INLINE AO_t ++AO_fetch_and_sub1(volatile AO_t *p) ++{ ++ return __atomic_fetch_sub(p, 1, __ATOMIC_RELAXED); ++} ++#define AO_HAVE_fetch_and_sub1 ++ ++AO_INLINE AO_t ++AO_fetch_and_sub1_acquire(volatile AO_t *p) ++{ ++ return __atomic_fetch_sub(p, 1, __ATOMIC_ACQUIRE); ++} ++#define AO_HAVE_fetch_and_sub1_acquire ++ ++AO_INLINE AO_t ++AO_fetch_and_sub1_release(volatile AO_t *p) ++{ ++ return __atomic_fetch_sub(p, 1, __ATOMIC_RELEASE); ++} ++#define AO_HAVE_fetch_and_sub1_release ++ ++AO_INLINE AO_t ++AO_fetch_and_sub1_full(volatile AO_t *p) ++{ ++ return __atomic_fetch_sub(p, 1, __ATOMIC_SEQ_CST); ++} ++#define AO_HAVE_fetch_and_sub1_full ++ ++/* Returns nonzero if the comparison succeeded. */ ++AO_INLINE int ++AO_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val) ++{ ++ return __sync_bool_compare_and_swap(addr, old_val, new_val); ++} ++# define AO_HAVE_compare_and_swap ++ ++AO_INLINE AO_t ++AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val) ++{ ++ return __sync_val_compare_and_swap(addr, old_val, new_val); ++} ++# define AO_HAVE_fetch_compare_and_swap diff --git a/meta-aarch64/recipes-multimedia/pulseaudio/libatomics-ops_7.2.bbappend b/meta-aarch64/recipes-multimedia/pulseaudio/libatomics-ops_7.2.bbappend new file mode 100644 index 0000000..6a7932d --- /dev/null +++ b/meta-aarch64/recipes-multimedia/pulseaudio/libatomics-ops_7.2.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI_append = " \ + file://0001-libatomic_ops-Aarch64-basic-port.patch \ +" diff --git a/meta-aarch64/recipes-qt/qt4/files/aarch64.patch b/meta-aarch64/recipes-qt/qt4/files/aarch64.patch new file mode 100644 index 0000000..2c970fe --- /dev/null +++ b/meta-aarch64/recipes-qt/qt4/files/aarch64.patch @@ -0,0 +1,39 @@ +From d780ac54b5dd1cf45eb59103f014f811c407d38c Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Sun, 10 Aug 2014 10:35:33 +0200 +Subject: [PATCH] JavaScriptCore: add Aarch64 support + +Signed-off-by: Koen Kooi +--- + src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h +index e8b03be..01a839f 100644 +--- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h ++++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h +@@ -373,6 +373,11 @@ + #define WTF_CPU_NEEDS_ALIGNED_ACCESS 1 + #endif + ++/* CPU(AARCH64) - Aarch64 */ ++#if defined(__aarch64__) ++#define WTF_CPU_AARCH64 1 ++#endif ++ + /* ==== OS() - underlying operating system; only to be used for mandated low-level services like + virtual memory, not to choose a GUI toolkit ==== */ + +@@ -1003,7 +1008,8 @@ + || CPU(SPARC64) \ + || CPU(S390X) \ + || CPU(PPC64) \ +- || CPU(MIPS64) ++ || CPU(MIPS64) \ ++ || CPU(AARCH64) + #define WTF_USE_JSVALUE64 1 + #else + #define WTF_USE_JSVALUE32_64 1 +-- +1.9.0 + diff --git a/meta-aarch64/recipes-qt/qt4/qt4-x11-free_4.8.6.bbappend b/meta-aarch64/recipes-qt/qt4/qt4-x11-free_4.8.6.bbappend new file mode 100644 index 0000000..d969143 --- /dev/null +++ b/meta-aarch64/recipes-qt/qt4/qt4-x11-free_4.8.6.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI_append = " \ + file://aarch64.patch \ +" diff --git a/meta-aarch64/recipes-support/emacs/emacs_23.4.bbappend b/meta-aarch64/recipes-support/emacs/emacs_23.4.bbappend new file mode 100644 index 0000000..8db9345 --- /dev/null +++ b/meta-aarch64/recipes-support/emacs/emacs_23.4.bbappend @@ -0,0 +1 @@ +COMPATIBLE_HOST_aarch64 = "0" diff --git a/meta-bigendian/conf/layer.conf b/meta-bigendian/conf/layer.conf new file mode 100644 index 0000000..f374010 --- /dev/null +++ b/meta-bigendian/conf/layer.conf @@ -0,0 +1,9 @@ +# We have a conf and classes directory, append to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have a recipes directory, add to BBFILES +BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend" + +BBFILE_COLLECTIONS += "bigendian" +BBFILE_PATTERN_bigendian := "^${LAYERDIR}/" +BBFILE_PRIORITY_bigendian = "20" diff --git a/meta-bigendian/recipes-core/initscripts/initscripts_1.0.bbappend b/meta-bigendian/recipes-core/initscripts/initscripts_1.0.bbappend new file mode 100644 index 0000000..355fbab --- /dev/null +++ b/meta-bigendian/recipes-core/initscripts/initscripts_1.0.bbappend @@ -0,0 +1 @@ +SRC_URI_append_armeb = " file://arm/alignment.sh" diff --git a/meta-bigendian/recipes-devtools/python/python-numpy_1.7.0.bbappend b/meta-bigendian/recipes-devtools/python/python-numpy_1.7.0.bbappend new file mode 100644 index 0000000..aa9df9a --- /dev/null +++ b/meta-bigendian/recipes-devtools/python/python-numpy_1.7.0.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += " ${CONFIGFILESURI} " + +CONFIGFILESURI_armeb = " \ + file://config.h \ + file://numpyconfig.h \ +" diff --git a/meta-bigendian/recipes-devtools/python/python/python_ffi_armeb_be8.patch b/meta-bigendian/recipes-devtools/python/python/python_ffi_armeb_be8.patch new file mode 100644 index 0000000..afd090b --- /dev/null +++ b/meta-bigendian/recipes-devtools/python/python/python_ffi_armeb_be8.patch @@ -0,0 +1,34 @@ +Index: Python-2.7.3/Modules/_ctypes/libffi/src/arm/ffi.c +=================================================================== +--- Python-2.7.3.orig/Modules/_ctypes/libffi/src/arm/ffi.c ++++ Python-2.7.3/Modules/_ctypes/libffi/src/arm/ffi.c +@@ -272,7 +272,7 @@ ffi_prep_incoming_args_SYSV(char *stack, + } + + /* How to make a trampoline. */ +- ++#if !(defined(__ARMEB__) && defined(__ARM_ARCH_7A__)) + #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ + ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ +@@ -284,7 +284,19 @@ ffi_prep_incoming_args_SYSV(char *stack, + *(unsigned int*) &__tramp[16] = __fun; \ + __clear_cache((&__tramp[0]), (&__tramp[19])); \ + }) +- ++#else /* armv7 big endian: be8 instructions are still little endian */ ++#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ ++({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ ++ unsigned int __fun = (unsigned int)(FUN); \ ++ unsigned int __ctx = (unsigned int)(CTX); \ ++ *(unsigned int*) &__tramp[0] = 0x0f002de9; /* swab(0xe92d000f, 4) - stmfd sp!, {r0-r3} */ \ ++ *(unsigned int*) &__tramp[4] = 0x00009fe5; /* swab(0xe59f0000, 4) - ldr r0, [pc] */ \ ++ *(unsigned int*) &__tramp[8] = 0x00f09fe5; /* swab(0xe59ff000, 4) - ldr pc, [pc] */ \ ++ *(unsigned int*) &__tramp[12] = __ctx; \ ++ *(unsigned int*) &__tramp[16] = __fun; \ ++ __clear_cache((&__tramp[0]), (&__tramp[19])); \ ++ }) ++#endif + + /* the cif must already be prep'ed */ + diff --git a/meta-bigendian/recipes-devtools/python/python_2.7.3.bbappend b/meta-bigendian/recipes-devtools/python/python_2.7.3.bbappend new file mode 100644 index 0000000..db79a4a --- /dev/null +++ b/meta-bigendian/recipes-devtools/python/python_2.7.3.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://python_ffi_armeb_be8.patch" diff --git a/meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch b/meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch new file mode 100644 index 0000000..bda4807 --- /dev/null +++ b/meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch @@ -0,0 +1,37 @@ +strace: fix system call matching code in get_scno for be8 arm + +on ARM V7 operating in big endian mode strace does not work: + +root@genericarmv7ab:~# strace ls +pid 1356 unknown syscall trap 0x000000ef + +it happens because ARM V7 when runs as big endian operates in be8 mode, +where instruction are still in little endian form. Strace get_scno reads +instructions and matches it to certain pattern, but in armeb case it needs +to byteswap it before that. + +Signed-off-by: Victor Kamensky +Signed-off-by: Riku Voipio +--- + syscall.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/syscall.c ++++ b/syscall.c +@@ -1374,6 +1374,16 @@ get_scno(struct tcb *tcp) + scno = ptrace(PTRACE_PEEKTEXT, tcp->pid, (void *)(arm_regs.ARM_pc - 4), NULL); + if (errno) + return -1; ++ ++#if defined(__ARMEB__) && defined(__ARM_ARCH_7A__) ++ /* We running big endian arm on ARMv7: instructions are ++ * in little endian form so we need to byteswap it. Note ++ * on older ARM like V5 Xscale code is in big endian form ++ * byte swap is not needed in this case. I.e be8 vs be32. ++ */ ++ scno = __builtin_bswap32(scno); ++#endif /* __ARMEB__ && __ARM_ARCH_7A__ */ ++ + /* EABI syscall convention? */ + if (scno != 0xef000000) { + /* No, it's OABI */ diff --git a/meta-bigendian/recipes-devtools/strace/strace_%.bbappend b/meta-bigendian/recipes-devtools/strace/strace_%.bbappend new file mode 100644 index 0000000..3f3d73e --- /dev/null +++ b/meta-bigendian/recipes-devtools/strace/strace_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://strace-4.8-arm-be8.patch" diff --git a/meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch b/meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch new file mode 100644 index 0000000..7efa58e --- /dev/null +++ b/meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch @@ -0,0 +1,37 @@ +Index: libffi-3.0.13/src/arm/ffi.c +=================================================================== +--- libffi-3.0.13.orig/src/arm/ffi.c ++++ libffi-3.0.13/src/arm/ffi.c +@@ -582,6 +582,7 @@ ffi_closure_free (void *ptr) + + #else + ++#if !(defined(__ARMEB__) && defined(__ARM_ARCH_7A__)) + #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ + ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ +@@ -595,7 +596,23 @@ ffi_closure_free (void *ptr) + /* Clear instruction \ + mapping. */ \ + }) +- ++#else /* armv7 big endian: be8 instructions are still little endian */ ++#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ ++({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ ++ unsigned int __fun = (unsigned int)(FUN); \ ++ unsigned int __ctx = (unsigned int)(CTX); \ ++ unsigned char *insns = (unsigned char *)(CTX); \ ++ *(unsigned int*) &__tramp[0] = 0x0f002de9; /* swab(0xe92d000f, 4) - stmfd sp!, {r0-r3} */ \ ++ *(unsigned int*) &__tramp[4] = 0x00009fe5; /* swab(0xe59f0000, 4) - ldr r0, [pc] */ \ ++ *(unsigned int*) &__tramp[8] = 0x00f09fe5; /* swab(0xe59ff000, 4) - ldr pc, [pc] */ \ ++ *(unsigned int*) &__tramp[12] = __ctx; \ ++ *(unsigned int*) &__tramp[16] = __fun; \ ++ __clear_cache((&__tramp[0]), (&__tramp[19])); /* Clear data mapping. */ \ ++ __clear_cache(insns, insns + 3 * sizeof (unsigned int)); \ ++ /* Clear instruction \ ++ mapping. */ \ ++ }) ++#endif + #endif + + /* the cif must already be prep'ed */ diff --git a/meta-bigendian/recipes-gnome/libffi/libffi_3.1.bbappend b/meta-bigendian/recipes-gnome/libffi/libffi_3.1.bbappend new file mode 100644 index 0000000..05b2f11 --- /dev/null +++ b/meta-bigendian/recipes-gnome/libffi/libffi_3.1.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://libffi_armeb_be8.patch" diff --git a/meta-bigendian/recipes-kernel/sysprof/sysprof_git.bbappend b/meta-bigendian/recipes-kernel/sysprof/sysprof_git.bbappend new file mode 100644 index 0000000..3a9227f --- /dev/null +++ b/meta-bigendian/recipes-kernel/sysprof/sysprof_git.bbappend @@ -0,0 +1 @@ +SRC_URI_append_armeb = " file://rmb-arm.patch" diff --git a/meta-linaro-integration/README b/meta-linaro-integration/README new file mode 100644 index 0000000..fdca8c7 --- /dev/null +++ b/meta-linaro-integration/README @@ -0,0 +1,15 @@ +Integration layer for Linaro Builds & Baselines +=============================================== + + +This layer is meant to fix or workaround integration issues which would normally go into a DISTRO layer. The B&B builds use OE-core distroless, but some tweaks are needed: + +1) Enable busybox httpd, the CI loop depends on it +2) Overlay/bbappend recipes till fixes go upstream + +OE-core is extremely non-transparent when fixes will go in or get rejected, meta-openembedded is better but depends on a CI loop (test-dependencies) that currently takes 15 days to complete. Due to our use of monthly cycles and the effort to maintain forks recipes will get overlayed/bbappended with our changes here. + +Topic specific bbappends like aarch64 or bigendian should remain in their respective layers since those are BSP type changes, not DISTRO type changes. + + + diff --git a/meta-linaro-integration/conf/layer.conf b/meta-linaro-integration/conf/layer.conf new file mode 100644 index 0000000..edb8f29 --- /dev/null +++ b/meta-linaro-integration/conf/layer.conf @@ -0,0 +1,16 @@ +BBPATH .= ":${LAYERDIR}" +BBFILES += "\ + ${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend \ + " + +BBFILE_COLLECTIONS += "linaro-integration" +BBFILE_PATTERN_linaro-integration := "^${LAYERDIR}/" +BBFILE_PRIORITY_linaro-integration = "30" + +# do not error out on bbappends for missing recipes +BB_DANGLINGAPPENDS_WARNONLY = "true" + +SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \ + gcc-cross-${TARGET_ARCH}->glibc \ +" diff --git a/meta-linaro-integration/recipes-core/busybox/busybox_%.bbappend b/meta-linaro-integration/recipes-core/busybox/busybox_%.bbappend new file mode 100644 index 0000000..0fd4571 --- /dev/null +++ b/meta-linaro-integration/recipes-core/busybox/busybox_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += "file://linaro.cfg" diff --git a/meta-linaro-integration/recipes-core/busybox/files/linaro.cfg b/meta-linaro-integration/recipes-core/busybox/files/linaro.cfg new file mode 100644 index 0000000..d652fa2 --- /dev/null +++ b/meta-linaro-integration/recipes-core/busybox/files/linaro.cfg @@ -0,0 +1,6 @@ +CONFIG_DPKG_DEB=y +CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY=y +CONFIG_SETSID=y +CONFIG_HTTPD=y +CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -b" diff --git a/meta-linaro-integration/recipes-overlayed/acpica/acpica_20140828.bb b/meta-linaro-integration/recipes-overlayed/acpica/acpica_20140828.bb new file mode 100644 index 0000000..fb19c88 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/acpica/acpica_20140828.bb @@ -0,0 +1,34 @@ +SUMMARY = "ACPICA tools for the development and debug of ACPI tables" +DESCRIPTION = "The ACPI Component Architecture (ACPICA) project provides an \ +OS-independent reference implementation of the Advanced Configuration and \ +Power Interface Specification (ACPI). ACPICA code contains those portions of \ +ACPI meant to be directly integrated into the host OS as a kernel-resident \ +subsystem, and a small set of tools to assist in developing and debugging \ +ACPI tables." +HOMEPAGE = "http://www.acpica.org/" +SECTION = "console/tools" +LICENSE = "BSD | GPLv2" +LIC_FILES_CHKSUM = "file://generate/unix/readme.txt;md5=204407e197c1a01154a48f6c6280c3aa" +DEPENDS = "bison flex" + +SRC_URI = "https://acpica.org/sites/acpica/files/acpica-unix2-${PV}.tar.gz \ + file://no-werror.patch \ + " +SRC_URI[md5sum] = "6f05f0d10166a1b1ff6107f3d1cdf1e5" +SRC_URI[sha256sum] = "01d8867656c5ba41dec307c4383ce676196ad4281ac2c9dec9f5be5fac6d888e" + +S = "${WORKDIR}/acpica-unix2-${PV}" + +EXTRA_OEMAKE = "CC='${CC}' 'OPT_CFLAGS=-Wall'" + +do_install() { + install -D -p -m0755 generate/unix/bin*/iasl ${D}${bindir}/iasl + install -D -p -m0755 generate/unix/bin*/acpibin ${D}${bindir}/acpibin + install -D -p -m0755 generate/unix/bin*/acpiexec ${D}${bindir}/acpiexec + install -D -p -m0755 generate/unix/bin*/acpihelp ${D}${bindir}/acpihelp + install -D -p -m0755 generate/unix/bin*/acpinames ${D}${bindir}/acpinames + install -D -p -m0755 generate/unix/bin*/acpisrc ${D}${bindir}/acpisrc + install -D -p -m0755 generate/unix/bin*/acpixtract ${D}${bindir}/acpixtract +} + +COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" diff --git a/meta-linaro-integration/recipes-overlayed/acpica/acpitests/0001-aaptisrun-alter-to-allow-destination-directory-as-ar.patch b/meta-linaro-integration/recipes-overlayed/acpica/acpitests/0001-aaptisrun-alter-to-allow-destination-directory-as-ar.patch new file mode 100644 index 0000000..47c2dd2 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/acpica/acpitests/0001-aaptisrun-alter-to-allow-destination-directory-as-ar.patch @@ -0,0 +1,59 @@ +From b74f3c497d3fb689d12aed26dd5b8614ca6ac96e Mon Sep 17 00:00:00 2001 +From: Graeme Gregory +Date: Tue, 25 Nov 2014 12:49:42 +0000 +Subject: [PATCH] aaptisrun : alter to allow destination directory as argument + +Also search for appits in $PATH + +Upstream-status: Inapropriate [LAVA use only, upstream unmaintained] +Signed-off-by: Graeme Gregory +--- + tests/aapits/bin/aapitsrun | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/tests/aapits/bin/aapitsrun b/tests/aapits/bin/aapitsrun +index cfa999e..3a97a0f 100755 +--- a/tests/aapits/bin/aapitsrun ++++ b/tests/aapits/bin/aapitsrun +@@ -20,7 +20,7 @@ + + # Init variables of utility + +-AAPITSDIR=../tmp ++AAPITSDIR="$1" + + AAPITSOUT=${AAPITSDIR}/raw.out + AAPITSSUM=${AAPITSDIR}/sum.out +@@ -56,6 +56,8 @@ TESTS_NUMBERS="$AT_INIT_TEST_NUM $AT_MEMM_TEST_NUM $AT_TBLM_TEST_NUM $AT_NSPM_TE + + # Check the working directory + ++mkdir -p "$AAPITSDIR/aml" || true ++ + if [ ! -d "$AAPITSDIR" ]; then + echo "There is no directory $AAPITSDIR, run make in ../asl" + exit 1 +@@ -68,7 +70,7 @@ if [ ! -d "$AAPITSAML" ]; then + exit 1 + fi + +-AAPITS=./aapits ++AAPITS=`which aapits` + + # Check access to AapiTS utility + +@@ -144,8 +144,8 @@ echo "tests_fail=$tests_fail" + echo "tests_none=$tests_none" + echo "tests_fault=$tests_fault" + +-echo "End AAPI TS: " $TS_FMT_INIDATE:$TS_FMT_INITIME > $AAPITSOUT +-echo "End AAPI TS: " $TS_FMT_INIDATE:$TS_FMT_INITIME > $AAPITSSUM ++echo "End AAPI TS: " $TS_FMT_INIDATE:$TS_FMT_INITIME >> $AAPITSOUT ++echo "End AAPI TS: " $TS_FMT_INIDATE:$TS_FMT_INITIME >> $AAPITSSUM + echo "End AAPI TS: " $TS_FMT_INIDATE:$TS_FMT_INITIME + + exit 0 + +-- +2.1.1 + diff --git a/meta-linaro-integration/recipes-overlayed/acpica/acpitests/aapits-linux.patch b/meta-linaro-integration/recipes-overlayed/acpica/acpitests/aapits-linux.patch new file mode 100644 index 0000000..7c5d6b0 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/acpica/acpitests/aapits-linux.patch @@ -0,0 +1,336 @@ +From: Al Stone +Date: Mon, 7 Apr 2014 19:09:37 +0000 +Subject: [PATCH 1/2] Fixup aapits build + +From http://git.linaro.org/people/al.stone/acpica-tools.git +Upstream-status: Unknown + +diff -urN acpica-unix2-20130626/tests/aapits/atexec.c acpica-unix2-20130626-aapits/tests/aapits/atexec.c +--- acpica-unix2-20130626/tests/aapits/atexec.c 2013-01-17 12:48:28.000000000 -0700 ++++ acpica-unix2-20130626-aapits/tests/aapits/atexec.c 2013-07-25 13:44:23.023894441 -0600 +@@ -639,6 +639,7 @@ + } + + ++#if ACPI_MACHINE_WIDTH == 32 + /******************************************************************************* + * + * FUNCTION: AtBuildLocalRSDT +@@ -757,8 +758,9 @@ + LocalRSDT->Header.Checksum = (UINT8)~LocalRSDT->Header.Checksum; + } + } ++#endif + + + /******************************************************************************* + * + * FUNCTION: AtBuildLocalXSDT +@@ -1424,7 +1426,7 @@ + ACPI_WARNING ((AE_INFO, + "Request on [%4.4s] is beyond region limit Req-%X+%X, Base=%X, Len-%X\n", + (RegionObject->Region.Node)->Name.Ascii, (UINT32) Address, +- ByteWidth, (UINT32) BufferAddress, Length)); ++ ByteWidth, (UINT32) BufferAddress, (UINT32) Length)); + + return (AE_AML_REGION_LIMIT); + } +@@ -1792,7 +1796,9 @@ + Path, Obj.Integer.Value, Value); + #else + printf ("API Error: Value of %s is 0x%llx instead of expected 0x%llx\n", +- Path, Obj.Integer.Value, Value); ++ Path, ++ (long long unsigned int) Obj.Integer.Value, ++ (long long unsigned int) Value); + #endif + Status = AE_ERROR; + } +@@ -1871,7 +1877,7 @@ + { + TestErrors++; + printf ("Test Error: cannot allocate buffer of %d bytes\n", +- Results.Length); ++ (int) Results.Length); + return (AE_NO_MEMORY); + } + Results.Pointer = Object; +@@ -1952,7 +1956,8 @@ + { + printf ("AtCheckBuffer: unexpected length %d of Buffer vs" + " calculated %d bytes\n", +- Results.Length, ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof (ACPI_OBJECT) + Length)); ++ (int)Results.Length, ++ (int)(ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof (ACPI_OBJECT) + Length))); + } + + /* Initialize the return buffer structure */ +@@ -1961,7 +1968,7 @@ + { + TestErrors++; + printf ("Test Error: cannot allocate buffer of %d bytes\n", +- Results.Length); ++ (int) Results.Length); + return (AE_NO_MEMORY); + } + Results.Pointer = Object; +diff -urN acpica-unix2-20130626/tests/aapits/atinit.c acpica-unix2-20130626-aapits/tests/aapits/atinit.c +--- acpica-unix2-20130626/tests/aapits/atinit.c 2013-01-17 12:48:28.000000000 -0700 ++++ acpica-unix2-20130626-aapits/tests/aapits/atinit.c 2013-07-25 13:20:19.706705960 -0600 +@@ -3024,7 +3024,7 @@ + AapiErrors++; + printf ("API Error: AcpiGetSystemInfo() returned" + " Length %d, expected %d\n", +- OutBuffer.Length, sizeof (Info)); ++ (int) OutBuffer.Length, (int) sizeof (Info)); + return (AE_ERROR); + } + +@@ -3046,7 +3046,7 @@ + AapiErrors++; + printf ("API Error: AcpiGetSystemInfo() returned" + " Length %d, expected %d\n", +- OutBuffer.Length, sizeof (Info)); ++ (int) OutBuffer.Length, (int) sizeof (Info)); + return (AE_ERROR); + } + +@@ -3066,7 +3066,7 @@ + AapiErrors++; + printf ("API Error: AcpiGetSystemInfo() returned" + " Length %d, expected %d\n", +- OutBuffer.Length, sizeof (Info)); ++ (int) OutBuffer.Length, (int) sizeof (Info)); + return (AE_ERROR); + } + else if (OutBuffer.Pointer != &Info) +@@ -3149,7 +3149,7 @@ + AapiErrors++; + printf ("API Error: AcpiGetSystemInfo() returned" + " Length %d, expected %d\n", +- OutBuffer.Length, sizeof (Info)); ++ (int) OutBuffer.Length, (int) sizeof (Info)); + return (AE_ERROR); + } + else if (OutBuffer.Pointer != &Info) +@@ -3214,7 +3214,7 @@ + AapiErrors++; + printf ("API Error: AcpiGetSystemInfo() returned" + " Length %d, expected %d\n", +- OutBuffer.Length, sizeof (ACPI_SYSTEM_INFO)); ++ (int) OutBuffer.Length, (int) sizeof (ACPI_SYSTEM_INFO)); + return (AE_ERROR); + } + else +diff -urN acpica-unix2-20130626/tests/aapits/atmain.c acpica-unix2-20130626-aapits/tests/aapits/atmain.c +--- acpica-unix2-20130626/tests/aapits/atmain.c 2013-01-17 12:48:28.000000000 -0700 ++++ acpica-unix2-20130626-aapits/tests/aapits/atmain.c 2013-07-25 13:18:22.083323948 -0600 +@@ -315,7 +315,7 @@ + { + printf ("ACPICA API TS err: test num %ld of test case %ld" + " is not implemented\n", +- test_num, test_case); ++ (long int) test_num, (long int) test_case); + return (AtRetNotImpl); + } + +@@ -430,7 +432,7 @@ + if (test_case < 1 || test_case > AT_TEST_CASE_NUM) + { + printf ("ACPICA API TS err: test case %ld is out of range 1 - %d\n", +- test_case, AT_TEST_CASE_NUM); ++ (long int) test_case, (int) AT_TEST_CASE_NUM); + return (AtRetBadParam); + } + +@@ -438,7 +440,7 @@ + if (test_num < 0 || test_num > AtTestCase[test_case].TestsNum) + { + printf ("ACPICA API TS err: test num %ld is out of range 0 - %d\n", +- test_num, AtTestCase[test_case].TestsNum); ++ (long int) test_num, AtTestCase[test_case].TestsNum); + return (AtRetBadParam); + } + +diff -urN acpica-unix2-20130626/tests/aapits/atnamespace.c acpica-unix2-20130626-aapits/tests/aapits/atnamespace.c +--- acpica-unix2-20130626/tests/aapits/atnamespace.c 2013-01-17 12:48:28.000000000 -0700 ++++ acpica-unix2-20130626-aapits/tests/aapits/atnamespace.c 2013-07-25 13:24:15.366466707 -0600 +@@ -2535,7 +2535,8 @@ + #else + printf ("API Error: Address of %s (0x%llX) != (0x%llX)\n", + PathNames[2 * i + 1], +- Info->Address, ExpectedInfo[i].Address); ++ (long long unsigned int) Info->Address, ++ (long long unsigned int) ExpectedInfo[i].Address); + #endif + #else + printf ("API Error: Address of %s (0x%X) != (0x%X)\n", +@@ -2908,7 +2909,8 @@ + TestErrors++; + printf ("AtGetNextObjectTypeCommon: different numbers of entities" + "in TypesNames (%d) and LevelTypes0000 (%d)\n", +- TypesCount, sizeof (LevelTypes0000) / sizeof (ACPI_OBJECT_TYPE)); ++ TypesCount, ++ (int) (sizeof (LevelTypes0000) / sizeof (ACPI_OBJECT_TYPE))); + return (AE_ERROR); + } + +@@ -4192,7 +4194,9 @@ + Pathname, Obj.Integer.Value, Value); + #else + printf ("API Error: Value of %s is 0x%llx instead of expected 0x%llx\n", +- Pathname, Obj.Integer.Value, Value); ++ Pathname, ++ (long long unsigned int) Obj.Integer.Value, ++ (long long unsigned int) Value); + #endif + Status = AE_ERROR; + } +@@ -5199,7 +5203,7 @@ + { + AapiErrors++; + printf ("API Error: AcpiOsAllocate(%d) returned NULL\n", +- OutName.Length); ++ (int) OutName.Length); + return (AE_ERROR); + } + } +diff -urN acpica-unix2-20130626/tests/aapits/atosxfctrl.c acpica-unix2-20130626-aapits/tests/aapits/atosxfctrl.c +--- acpica-unix2-20130626/tests/aapits/atosxfctrl.c 2013-01-17 12:48:28.000000000 -0700 ++++ acpica-unix2-20130626-aapits/tests/aapits/atosxfctrl.c 2013-07-25 13:30:00.375492751 -0600 +@@ -737,13 +737,15 @@ + #if ACPI_MACHINE_WIDTH == 64 + #ifdef _MSC_VER + printf("OsxfCtrlFingReg: unexpected Width %d of Reg 0x%I64x\n", ++ Width, Address); + #else + printf("OsxfCtrlFingReg: unexpected Width %d of Reg 0x%llx\n", ++ Width, (long long unsigned int) Address); + #endif + #else + printf("OsxfCtrlFingReg: unexpected Width %d of Reg 0x%x\n", +-#endif + Width, Address); ++#endif + return (NULL); + } + +@@ -764,15 +766,19 @@ + #ifdef _MSC_VER + printf("OsxfCtrlFingReg: intersection Regs (0x%I64x: 0x%x)" + " and (0x%I64x: 0x%x)\n", ++ Reg->Address, Reg->Width, Address, Width); + #else + printf("OsxfCtrlFingReg: intersection Regs (0x%llx: 0x%x)" + " and (0x%llx: 0x%x)\n", ++ (long long unsigned int) Reg->Address, ++ Reg->Width, ++ (long long unsigned int) Address, Width); + #endif + #else + printf("OsxfCtrlFingReg: intersection Regs (0x%x: 0x%x)" + " and (0x%x: 0x%x)\n", +-#endif + Reg->Address, Reg->Width, Address, Width); ++#endif + return (NULL); + } + } +@@ -786,13 +792,15 @@ + #if ACPI_MACHINE_WIDTH == 64 + #ifdef _MSC_VER + printf("OsxfCtrlFingReg: no memory for Reg (0x%I64x: 0x%x)\n", ++ Reg->Address, Reg->Width); + #else + printf("OsxfCtrlFingReg: no memory for Reg (0x%llx: 0x%x)\n", ++ (long long unsigned int) Reg->Address, Reg->Width); + #endif + #else + printf("OsxfCtrlFingReg: no memory for Reg (0x%x: 0x%x)\n", +-#endif + Reg->Address, Reg->Width); ++#endif + return (NULL); + } + Reg->Type = Type; +@@ -932,14 +940,19 @@ + #if ACPI_MACHINE_WIDTH == 64 + #ifdef _MSC_VER + printf("%.2u (%s Address 0x%I64x: Width %.2u) r/w counts: %u/%u\n", ++ i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO", ++ Reg->Address, Reg->Width, Reg->ReadCount, Reg->WriteCount); + #else + printf("%.2u (%s Address 0x%llx: Width %.2u) r/w counts: %u/%u\n", ++ i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO", ++ (long long unsigned int) Reg->Address, ++ Reg->Width, Reg->ReadCount, Reg->WriteCount); + #endif + #else + printf("%.2u (%s Address 0x%.4x: Width %.2u) r/w counts: %u/%u\n", +-#endif + i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO", + Reg->Address, Reg->Width, Reg->ReadCount, Reg->WriteCount); ++#endif + Reg = Reg->Next; + i++; + } +diff -urN acpica-unix2-20130626/tests/aapits/atresource.c acpica-unix2-20130626-aapits/tests/aapits/atresource.c +--- acpica-unix2-20130626/tests/aapits/atresource.c 2013-01-17 12:48:29.000000000 -0700 ++++ acpica-unix2-20130626-aapits/tests/aapits/atresource.c 2013-07-25 13:25:49.423565947 -0600 +@@ -174,7 +174,7 @@ + AapiErrors++; + printf ("API Error: AcpiGetCurrentResources(%s) returned Length %d," + " expected %d\n", +- Pathname, OutBuffer.Length, RT0000_DEV0_CRS_LEN); ++ Pathname, (int) OutBuffer.Length, RT0000_DEV0_CRS_LEN); + return (AE_ERROR); + } + +@@ -490,7 +490,7 @@ + AapiErrors++; + printf ("API Error: AcpiGetCurrentResources(%s) returned Length %d," + " expected %d\n", +- Pathname, OutBuffer.Length, RT0000_DEV0_CRS_LEN); ++ Pathname, (int) OutBuffer.Length, RT0000_DEV0_CRS_LEN); + return (AE_ERROR); + } + +@@ -689,7 +689,7 @@ + AapiErrors++; + printf ("Api Error: Resource->Length (%d) != %d\n", + CurrentResource->Length, +- ACPI_ROUND_UP_TO_NATIVE_WORD (ACPI_RS_SIZE (ACPI_RESOURCE_IRQ))); ++ (int) (ACPI_ROUND_UP_TO_NATIVE_WORD (ACPI_RS_SIZE (ACPI_RESOURCE_IRQ)))); + } + + if (CurrentResource->Data.Irq.Triggering != 0) /* Level-Triggered */ +@@ -981,7 +981,7 @@ + AapiErrors++; + printf ("API Error: AcpiGetPossibleResources(%s) returned Length %d," + " expected %d\n", +- Pathname, OutBuffer.Length, RT0000_DEV0_CRS_LEN); ++ Pathname, (int) OutBuffer.Length, RT0000_DEV0_CRS_LEN); + return (AE_ERROR); + } + +@@ -1923,7 +1923,7 @@ + AapiErrors++; + printf ("API Error: AcpiGetIrqRoutingTable(%s) returned Length %d," + " expected %d\n", +- Pathname, OutBuffer.Length, 0xA48); ++ Pathname, (int) OutBuffer.Length, 0xA48); + return (AE_ERROR); + } + +diff -urN acpica-unix2-20130626/tests/aapits/Makefile acpica-unix2-20130626-aapits/tests/aapits/Makefile +--- acpica-unix2-20130626/tests/aapits/Makefile 2013-01-17 12:48:29.000000000 -0700 ++++ acpica-unix2-20130626-aapits/tests/aapits/Makefile 2013-07-25 15:17:09.309236422 -0600 +@@ -194,7 +194,7 @@ + CFLAGS+= -Wall -g -D_LINUX -DNDEBUG -D_CONSOLE -DACPI_APITS -DACPI_EXEC_APP -D_MULTI_THREADED -Wstrict-prototypes -I../../source/include + + +-acpiexec : $(patsubst %.c,%.o, $(SRCS)) ++$(PROG) : $(patsubst %.c,%.o, $(SRCS)) + $(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG) + + CLEANFILES= $(PROG) diff --git a/meta-linaro-integration/recipes-overlayed/acpica/acpitests/aapits-makefile.patch b/meta-linaro-integration/recipes-overlayed/acpica/acpitests/aapits-makefile.patch new file mode 100644 index 0000000..4d9e997 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/acpica/acpitests/aapits-makefile.patch @@ -0,0 +1,34 @@ +From: Al Stone +Date: Mon, 7 Apr 2014 19:09:37 +0000 +Subject: [PATCH 1/2] Fixup aapits build + +From http://git.linaro.org/people/al.stone/acpica-tools.git +Upstream-status: Unknown + +diff -urN acpica-unix2-20140325/tests/aapits/Makefile acpica-unix2-20140325/tests/aapits/Makefile +--- acpica-unix2-20140325/tests/aapits/Makefile 2014-04-05 14:23:14.683636794 -0600 ++++ acpica-unix2-20140325-aapits/tests/aapits/Makefile 2014-04-05 15:10:57.879184598 -0600 +@@ -16,6 +16,7 @@ + atosxfwrap.c \ + osunixxf.c \ + ../../source/common/ahids.c \ ++ ../../source/common/ahuuids.c \ + ../../source/common/cmfsize.c \ + ../../source/common/getopt.c \ + ../../source/components/hardware/hwtimer.c \ +@@ -174,6 +175,7 @@ + ../../source/components/utilities/utexcep.c \ + ../../source/components/utilities/utfileio.c \ + ../../source/components/utilities/utglobal.c \ ++ ../../source/components/utilities/uthex.c \ + ../../source/components/utilities/utids.c \ + ../../source/components/utilities/utinit.c \ + ../../source/components/utilities/utlock.c \ +@@ -189,6 +191,7 @@ + ../../source/components/utilities/utstate.c \ + ../../source/components/utilities/utstring.c \ + ../../source/components/utilities/uttrack.c \ ++ ../../source/components/utilities/utuuid.c \ + ../../source/components/utilities/utxface.c \ + ../../source/components/utilities/utxferror.c \ + ../../source/components/utilities/utxfinit.c \ diff --git a/meta-linaro-integration/recipes-overlayed/acpica/acpitests_20140828.bb b/meta-linaro-integration/recipes-overlayed/acpica/acpitests_20140828.bb new file mode 100644 index 0000000..3f5701b --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/acpica/acpitests_20140828.bb @@ -0,0 +1,37 @@ +SUMMARY = "Test suite used to validate ACPICA" +HOMEPAGE = "http://www.acpica.org/" + +LICENSE = "Intel" +LIC_FILES_CHKSUM = "file://tests/aapits/atexec.c;beginline=1;endline=115;md5=e92bcdfcd01d117d1bda3e814bb2030a" + +DEPENDS = "bison flex" + +SRC_URI = "https://acpica.org/sites/acpica/files/acpitests-unix-${PV}.tar.gz;name=acpitests \ + https://acpica.org/sites/acpica/files/acpica-unix2-${PV}.tar.gz;name=acpica \ + file://aapits-linux.patch \ + file://aapits-makefile.patch \ + file://0001-aaptisrun-alter-to-allow-destination-directory-as-ar.patch \ + " +SRC_URI[acpitests.md5sum] = "db9d6fdaa8e3eb101d700ee5ba4938ed" +SRC_URI[acpitests.sha256sum] = "e576c74bf1bf1c9f7348bf9419e05c8acfece7105abcdc052e66670c7af2cf00" +SRC_URI[acpica.md5sum] = "6f05f0d10166a1b1ff6107f3d1cdf1e5" +SRC_URI[acpica.sha256sum] = "01d8867656c5ba41dec307c4383ce676196ad4281ac2c9dec9f5be5fac6d888e" + +S = "${WORKDIR}/acpitests-unix-${PV}" + +EXTRA_OEMAKE = "CC='${CC}' 'OPT_CFLAGS=-Wall'" + +# The Makefiles expect a specific layout +do_compile() { + cp -af ${WORKDIR}/acpica-unix2-${PV}/source ${S} + cd tests/aapits + oe_runmake +} + +do_install() { + install -d ${D}${bindir} + install -m0755 tests/aapits/bin/aapits ${D}${bindir} + install -m0755 tests/aapits/bin/aapitsrun ${D}${bindir} +} + +COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" diff --git a/meta-linaro-integration/recipes-overlayed/acpica/files/no-werror.patch b/meta-linaro-integration/recipes-overlayed/acpica/files/no-werror.patch new file mode 100644 index 0000000..5d28f47 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/acpica/files/no-werror.patch @@ -0,0 +1,32 @@ +Description: remove -Werror flag +Forwarded: not-needed +Author: Fathi Boudra + +--- + generate/unix/iasl/Makefile | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/generate/unix/iasl/Makefile ++++ b/generate/unix/iasl/Makefile +@@ -266,19 +266,19 @@ $(OBJDIR)/prparser.y.h: $(OBJDIR)/prpars + # by the utilities above and they are not necessarily ANSI C, etc. + # + $(OBJDIR)/aslcompilerlex.o : $(OBJDIR)/aslcompilerlex.c +- $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< ++ $(CC) -c $(CFLAGS) -Wall -o$@ $< + + $(OBJDIR)/aslcompilerparse.o : $(OBJDIR)/aslcompilerparse.c +- $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< ++ $(CC) -c $(CFLAGS) -Wall -o$@ $< + + $(OBJDIR)/dtparserlex.o : $(OBJDIR)/dtparserlex.c +- $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< ++ $(CC) -c $(CFLAGS) -Wall -o$@ $< + + $(OBJDIR)/dtparserparse.o : $(OBJDIR)/dtparserparse.c +- $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< ++ $(CC) -c $(CFLAGS) -Wall -o$@ $< + + $(OBJDIR)/prparserlex.o : $(OBJDIR)/prparserlex.c +- $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< ++ $(CC) -c $(CFLAGS) -Wall -o$@ $< diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/configure.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/configure.patch new file mode 100644 index 0000000..966b728 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/configure.patch @@ -0,0 +1,7345 @@ +diff --git a/configure b/configure +index 4855c99..a5282b6 100755 +--- a/configure ++++ b/configure +@@ -54,6 +54,8 @@ ac_help="$ac_help + 600: Windows Vista + 601: Windows 7" + ac_help="$ac_help ++ --with-system-ply Use system installed python ply library" ++ac_help="$ac_help + --enable-macos-target=VER (default=10.5) + Set the minimum MacOS version needed at runtime" + ac_help="$ac_help +@@ -998,7 +1000,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + echo $ac_n "checking host system type""... $ac_c" 1>&6 +-echo "configure:1002: checking host system type" >&5 ++echo "configure:1004: checking host system type" >&5 + + host_alias=$host + case "$host_alias" in +@@ -1019,7 +1021,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$host" 1>&6 + + echo $ac_n "checking target system type""... $ac_c" 1>&6 +-echo "configure:1023: checking target system type" >&5 ++echo "configure:1025: checking target system type" >&5 + + target_alias=$target + case "$target_alias" in +@@ -1037,7 +1039,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$target" 1>&6 + + echo $ac_n "checking build system type""... $ac_c" 1>&6 +-echo "configure:1041: checking build system type" >&5 ++echo "configure:1043: checking build system type" >&5 + + build_alias=$build + case "$build_alias" in +@@ -1117,7 +1119,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1121: checking for $ac_word" >&5 ++echo "configure:1123: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1247,7 +1249,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1251: checking for $ac_word" >&5 ++echo "configure:1253: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1405,7 +1407,7 @@ case "$target" in + + if test -z "$android_toolchain" ; then + echo $ac_n "checking for android toolchain directory""... $ac_c" 1>&6 +-echo "configure:1409: checking for android toolchain directory" >&5 ++echo "configure:1411: checking for android toolchain directory" >&5 + + kernel_name=`uname -s | tr "[:upper:]" "[:lower:]"` + +@@ -1425,7 +1427,7 @@ echo "configure:1409: checking for android toolchain directory" >&5 + + if test -z "$android_platform" ; then + echo $ac_n "checking for android platform directory""... $ac_c" 1>&6 +-echo "configure:1429: checking for android platform directory" >&5 ++echo "configure:1431: checking for android platform directory" >&5 + + android_platform="$android_ndk"/build/platforms/android-"$android_version"/arch-"$target_cpu" + +@@ -1497,7 +1499,7 @@ EOF + # Extract the first word of "objcopy", so it can be a program name with args. + set dummy objcopy; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1501: checking for $ac_word" >&5 ++echo "configure:1503: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_OBJCOPY'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1554,13 +1556,13 @@ if test -n "$CROSS_COMPILE" -a "$target" != "$host"; then + _SAVE_LDFLAGS="$LDFLAGS" + + echo $ac_n "checking for host c compiler""... $ac_c" 1>&6 +-echo "configure:1558: checking for host c compiler" >&5 ++echo "configure:1560: checking for host c compiler" >&5 + for ac_prog in $HOST_CC gcc cc /usr/ucb/cc cl icc + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1564: checking for $ac_word" >&5 ++echo "configure:1566: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_HOST_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1595,13 +1597,13 @@ test -n "$HOST_CC" || HOST_CC="""" + fi + echo "$ac_t""$HOST_CC" 1>&6 + echo $ac_n "checking for host c++ compiler""... $ac_c" 1>&6 +-echo "configure:1599: checking for host c++ compiler" >&5 ++echo "configure:1601: checking for host c++ compiler" >&5 + for ac_prog in $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1605: checking for $ac_word" >&5 ++echo "configure:1607: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_HOST_CXX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1653,7 +1655,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1657: checking for $ac_word" >&5 ++echo "configure:1659: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_HOST_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1688,7 +1690,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1692: checking for $ac_word" >&5 ++echo "configure:1694: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_HOST_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1723,16 +1725,16 @@ test -n "$HOST_AR" || HOST_AR="ar" + LDFLAGS="$HOST_LDFLAGS" + + echo $ac_n "checking whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works""... $ac_c" 1>&6 +-echo "configure:1727: checking whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5 ++echo "configure:1729: checking whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_prog_hostcc_works=1 echo "$ac_t""yes" 1>&6 + else +@@ -1747,16 +1749,16 @@ rm -f conftest* + CFLAGS="$HOST_CXXFLAGS" + + echo $ac_n "checking whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works""... $ac_c" 1>&6 +-echo "configure:1751: checking whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works" >&5 ++echo "configure:1753: checking whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_prog_hostcxx_works=1 echo "$ac_t""yes" 1>&6 + else +@@ -1785,7 +1787,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1789: checking for $ac_word" >&5 ++echo "configure:1791: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1819,7 +1821,7 @@ test -n "$CC" || CC=":" + # Extract the first word of "gcc", so it can be a program name with args. + set dummy gcc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1823: checking for $ac_word" >&5 ++echo "configure:1825: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1849,7 +1851,7 @@ if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. + set dummy cc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1853: checking for $ac_word" >&5 ++echo "configure:1855: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1900,7 +1902,7 @@ fi + # Extract the first word of "cl", so it can be a program name with args. + set dummy cl; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1904: checking for $ac_word" >&5 ++echo "configure:1906: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1932,7 +1934,7 @@ fi + fi + + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +-echo "configure:1936: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ++echo "configure:1938: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +@@ -1943,12 +1945,12 @@ cross_compiling=$ac_cv_prog_cc_cross + + cat > conftest.$ac_ext << EOF + +-#line 1947 "configure" ++#line 1949 "configure" + #include "confdefs.h" + + main(){return(0);} + EOF +-if { (eval echo configure:1952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:1954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then +@@ -1974,12 +1976,12 @@ if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } + fi + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +-echo "configure:1978: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "configure:1980: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 + echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 + cross_compiling=$ac_cv_prog_cc_cross + + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +-echo "configure:1983: checking whether we are using GNU C" >&5 ++echo "configure:1985: checking whether we are using GNU C" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1988,7 +1990,7 @@ else + yes; + #endif + EOF +-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes + else + ac_cv_prog_gcc=no +@@ -2007,7 +2009,7 @@ ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +-echo "configure:2011: checking whether ${CC-cc} accepts -g" >&5 ++echo "configure:2013: checking whether ${CC-cc} accepts -g" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2043,7 +2045,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2047: checking for $ac_word" >&5 ++echo "configure:2049: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2079,7 +2081,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2083: checking for $ac_word" >&5 ++echo "configure:2085: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2111,7 +2113,7 @@ test -n "$CXX" || CXX="gcc" + + + echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +-echo "configure:2115: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ++echo "configure:2117: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 + + ac_ext=C + # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +@@ -2122,12 +2124,12 @@ cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext << EOF + +-#line 2126 "configure" ++#line 2128 "configure" + #include "confdefs.h" + + int main(){return(0);} + EOF +-if { (eval echo configure:2131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cxx_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then +@@ -2153,12 +2155,12 @@ if test $ac_cv_prog_cxx_works = no; then + { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } + fi + echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +-echo "configure:2157: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "configure:2159: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 + echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 + cross_compiling=$ac_cv_prog_cxx_cross + + echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 +-echo "configure:2162: checking whether we are using GNU C++" >&5 ++echo "configure:2164: checking whether we are using GNU C++" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2167,7 +2169,7 @@ else + yes; + #endif + EOF +-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gxx=yes + else + ac_cv_prog_gxx=no +@@ -2186,7 +2188,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS= + echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 +-echo "configure:2190: checking whether ${CXX-g++} accepts -g" >&5 ++echo "configure:2192: checking whether ${CXX-g++} accepts -g" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2227,7 +2229,7 @@ for ac_declaration in \ + 'void exit (int);' + do + cat > conftest.$ac_ext < + $ac_declaration +@@ -2235,7 +2237,7 @@ int main() { + exit (42); + ; return 0; } + EOF +-if { (eval echo configure:2239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:2241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : + else + echo "configure: failed program was:" >&5 +@@ -2245,14 +2247,14 @@ else + fi + rm -f conftest* + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:2258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + break + else +@@ -2281,7 +2283,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2285: checking for $ac_word" >&5 ++echo "configure:2287: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2316,7 +2318,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2320: checking for $ac_word" >&5 ++echo "configure:2322: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2351,7 +2353,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2355: checking for $ac_word" >&5 ++echo "configure:2357: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2405,7 +2407,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2409: checking for $ac_word" >&5 ++echo "configure:2411: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2440,7 +2442,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2444: checking for $ac_word" >&5 ++echo "configure:2446: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2475,7 +2477,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2479: checking for $ac_word" >&5 ++echo "configure:2481: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2513,7 +2515,7 @@ else + # Extract the first word of "gcc", so it can be a program name with args. + set dummy gcc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2517: checking for $ac_word" >&5 ++echo "configure:2519: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2543,7 +2545,7 @@ if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. + set dummy cc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2547: checking for $ac_word" >&5 ++echo "configure:2549: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2594,7 +2596,7 @@ fi + # Extract the first word of "cl", so it can be a program name with args. + set dummy cl; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2598: checking for $ac_word" >&5 ++echo "configure:2600: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2626,7 +2628,7 @@ fi + fi + + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +-echo "configure:2630: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ++echo "configure:2632: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +@@ -2637,12 +2639,12 @@ cross_compiling=$ac_cv_prog_cc_cross + + cat > conftest.$ac_ext << EOF + +-#line 2641 "configure" ++#line 2643 "configure" + #include "confdefs.h" + + main(){return(0);} + EOF +-if { (eval echo configure:2646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then +@@ -2668,12 +2670,12 @@ if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } + fi + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +-echo "configure:2672: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "configure:2674: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 + echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 + cross_compiling=$ac_cv_prog_cc_cross + + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +-echo "configure:2677: checking whether we are using GNU C" >&5 ++echo "configure:2679: checking whether we are using GNU C" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2682,7 +2684,7 @@ else + yes; + #endif + EOF +-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes + else + ac_cv_prog_gcc=no +@@ -2701,7 +2703,7 @@ ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +-echo "configure:2705: checking whether ${CC-cc} accepts -g" >&5 ++echo "configure:2707: checking whether ${CC-cc} accepts -g" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2737,7 +2739,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2741: checking for $ac_word" >&5 ++echo "configure:2743: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2769,7 +2771,7 @@ test -n "$CXX" || CXX="gcc" + + + echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +-echo "configure:2773: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ++echo "configure:2775: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 + + ac_ext=C + # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +@@ -2780,12 +2782,12 @@ cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext << EOF + +-#line 2784 "configure" ++#line 2786 "configure" + #include "confdefs.h" + + int main(){return(0);} + EOF +-if { (eval echo configure:2789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cxx_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then +@@ -2811,12 +2813,12 @@ if test $ac_cv_prog_cxx_works = no; then + { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } + fi + echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +-echo "configure:2815: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "configure:2817: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 + echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 + cross_compiling=$ac_cv_prog_cxx_cross + + echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 +-echo "configure:2820: checking whether we are using GNU C++" >&5 ++echo "configure:2822: checking whether we are using GNU C++" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2825,7 +2827,7 @@ else + yes; + #endif + EOF +-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gxx=yes + else + ac_cv_prog_gxx=no +@@ -2844,7 +2846,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS= + echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 +-echo "configure:2848: checking whether ${CXX-g++} accepts -g" >&5 ++echo "configure:2850: checking whether ${CXX-g++} accepts -g" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2885,7 +2887,7 @@ for ac_declaration in \ + 'void exit (int);' + do + cat > conftest.$ac_ext < + $ac_declaration +@@ -2893,7 +2895,7 @@ int main() { + exit (42); + ; return 0; } + EOF +-if { (eval echo configure:2897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:2899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : + else + echo "configure: failed program was:" >&5 +@@ -2903,14 +2905,14 @@ else + fi + rm -f conftest* + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:2916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + break + else +@@ -2929,7 +2931,7 @@ fi + # Extract the first word of "ranlib", so it can be a program name with args. + set dummy ranlib; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2933: checking for $ac_word" >&5 ++echo "configure:2935: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2961,7 +2963,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2965: checking for $ac_word" >&5 ++echo "configure:2967: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3015,7 +3017,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:3019: checking for $ac_word" >&5 ++echo "configure:3021: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3050,7 +3052,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:3054: checking for $ac_word" >&5 ++echo "configure:3056: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3085,7 +3087,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:3089: checking for $ac_word" >&5 ++echo "configure:3091: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3120,7 +3122,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:3124: checking for $ac_word" >&5 ++echo "configure:3126: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3268,7 +3270,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:3272: checking for $ac_word" >&5 ++echo "configure:3274: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_MIDL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3310,14 +3312,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a + cross_compiling=$ac_cv_prog_cc_cross + + cat > conftest.$ac_ext < + int main() { + printf("Hello World\n"); + ; return 0; } + EOF +-if { (eval echo configure:3321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : + else + echo "configure: failed program was:" >&5 +@@ -3335,14 +3337,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes + cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext < + int main() { + unsigned *test = new unsigned(42); + ; return 0; } + EOF +-if { (eval echo configure:3346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : + else + echo "configure: failed program was:" >&5 +@@ -3473,7 +3475,7 @@ EOF + _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'` + # Add flags if necessary + echo $ac_n "checking for midl flags""... $ac_c" 1>&6 +-echo "configure:3477: checking for midl flags" >&5 ++echo "configure:3479: checking for midl flags" >&5 + case "$target" in + i*86-*) + if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then +@@ -3500,19 +3502,19 @@ echo "configure:3477: checking for midl flags" >&5 + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:3504: checking for $ac_hdr" >&5 ++echo "configure:3506: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:3516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -3544,7 +3546,7 @@ EOF + # This is done because the Windows 7 beta SDK reports its + # NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should + echo $ac_n "checking for highest Windows version supported by this SDK""... $ac_c" 1>&6 +-echo "configure:3548: checking for highest Windows version supported by this SDK" >&5 ++echo "configure:3550: checking for highest Windows version supported by this SDK" >&5 + if eval "test \"`echo '$''{'ac_cv_winsdk_maxver'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3574,19 +3576,19 @@ echo "$ac_t""$ac_cv_winsdk_maxver" 1>&6 + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:3578: checking for $ac_hdr" >&5 ++echo "configure:3580: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:3590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -3623,7 +3625,7 @@ EOF + unset _MSVC_VER_FILTER + + echo $ac_n "checking for std::_Throw""... $ac_c" 1>&6 +-echo "configure:3627: checking for std::_Throw" >&5 ++echo "configure:3629: checking for std::_Throw" >&5 + if eval "test \"`echo '$''{'ac_cv_have_std__Throw'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3639,14 +3641,14 @@ cross_compiling=$ac_cv_prog_cxx_cross + _SAVE_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0" + cat > conftest.$ac_ext < + int main() { + std::_Throw(std::exception()); return 0; + ; return 0; } + EOF +-if { (eval echo configure:3650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_have_std__Throw="yes" + else +@@ -3671,7 +3673,7 @@ echo "$ac_t""$ac_cv_have_std__Throw" 1>&6 + + if test "$ac_cv_have_std__Throw" = "yes"; then + echo $ac_n "checking for |class __declspec(dllimport) exception| bug""... $ac_c" 1>&6 +-echo "configure:3675: checking for |class __declspec(dllimport) exception| bug" >&5 ++echo "configure:3677: checking for |class __declspec(dllimport) exception| bug" >&5 + if eval "test \"`echo '$''{'ac_cv_have_dllimport_exception_bug'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3687,14 +3689,14 @@ cross_compiling=$ac_cv_prog_cxx_cross + _SAVE_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0" + cat > conftest.$ac_ext < + int main() { + std::vector v; return v.at(1); + ; return 0; } + EOF +-if { (eval echo configure:3698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:3700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_have_dllimport_exception_bug="no" + else +@@ -3726,7 +3728,7 @@ EOF + fi + else + echo $ac_n "checking for overridable _RAISE""... $ac_c" 1>&6 +-echo "configure:3730: checking for overridable _RAISE" >&5 ++echo "configure:3732: checking for overridable _RAISE" >&5 + if eval "test \"`echo '$''{'ac_cv_have__RAISE'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3742,7 +3744,7 @@ cross_compiling=$ac_cv_prog_cxx_cross + _SAVE_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0" + cat > conftest.$ac_ext < + #undef _RAISE +@@ -3753,7 +3755,7 @@ int main() { + std::vector v; return v.at(1); + ; return 0; } + EOF +-if { (eval echo configure:3757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_have__RAISE="no" + else +@@ -3795,9 +3797,9 @@ EOF + _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'` + _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'` + echo $ac_n "checking for w32api version >= $W32API_VERSION""... $ac_c" 1>&6 +-echo "configure:3799: checking for w32api version >= $W32API_VERSION" >&5 ++echo "configure:3801: checking for w32api version >= $W32API_VERSION" >&5 + cat > conftest.$ac_ext < + int main() { +@@ -3809,7 +3811,7 @@ int main() { + + ; return 0; } + EOF +-if { (eval echo configure:3813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + res=yes + else +@@ -3825,7 +3827,7 @@ rm -f conftest* + fi + # Check windres version + echo $ac_n "checking for windres version >= $WINDRES_VERSION""... $ac_c" 1>&6 +-echo "configure:3829: checking for windres version >= $WINDRES_VERSION" >&5 ++echo "configure:3831: checking for windres version >= $WINDRES_VERSION" >&5 + _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'` + echo "$ac_t""$_WINDRES_VERSION" 1>&6 + _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'` +@@ -3864,7 +3866,7 @@ EOF + # If the maximum version supported by this SDK is lower than the target + # version, error out + echo $ac_n "checking for Windows SDK being recent enough""... $ac_c" 1>&6 +-echo "configure:3868: checking for Windows SDK being recent enough" >&5 ++echo "configure:3870: checking for Windows SDK being recent enough" >&5 + if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then + echo "$ac_t"""yes"" 1>&6 + else +@@ -3893,7 +3895,7 @@ EOF + esac + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +-echo "configure:3897: checking how to run the C preprocessor" >&5 ++echo "configure:3899: checking how to run the C preprocessor" >&5 + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= +@@ -3908,13 +3910,13 @@ else + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:3918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:3920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -3925,13 +3927,13 @@ else + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:3935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:3937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -3942,13 +3944,13 @@ else + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:3952: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:3954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -3973,7 +3975,7 @@ fi + echo "$ac_t""$CPP" 1>&6 + + echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 +-echo "configure:3977: checking how to run the C++ preprocessor" >&5 ++echo "configure:3979: checking how to run the C++ preprocessor" >&5 + if test -z "$CXXCPP"; then + if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -3986,12 +3988,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes + cross_compiling=$ac_cv_prog_cxx_cross + CXXCPP="${CXX-g++} -E" + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:3995: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:3997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -4068,7 +4070,7 @@ fi # COMPILE_ENVIRONMENT + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +-echo "configure:4072: checking for a BSD compatible install" >&5 ++echo "configure:4074: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -4121,7 +4123,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +-echo "configure:4125: checking whether ln -s works" >&5 ++echo "configure:4127: checking whether ln -s works" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -4144,7 +4146,7 @@ fi + + if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then + echo $ac_n "checking for minimum required perl version >= $PERL_VERSION""... $ac_c" 1>&6 +-echo "configure:4148: checking for minimum required perl version >= $PERL_VERSION" >&5 ++echo "configure:4150: checking for minimum required perl version >= $PERL_VERSION" >&5 + _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5` + _perl_res=$? + echo "$ac_t""$_perl_version" 1>&6 +@@ -4155,7 +4157,7 @@ fi + fi + + echo $ac_n "checking for full perl installation""... $ac_c" 1>&6 +-echo "configure:4159: checking for full perl installation" >&5 ++echo "configure:4161: checking for full perl installation" >&5 + _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5` + _perl_res=$? + if test "$_perl_res" != 0; then +@@ -4170,7 +4172,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:4174: checking for $ac_word" >&5 ++echo "configure:4176: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PYTHON'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -4222,6 +4224,25 @@ if test -z "$PYTHON"; then + { echo "configure: error: python was not found in \$PATH" 1>&2; exit 1; } + fi + ++# Check whether --with-system-ply or --without-system-ply was given. ++if test "${with_system_ply+set}" = set; then ++ withval="$with_system_ply" ++ if test "$withval" = "yes"; then ++ if $PYTHON -c 'import ply' 2>&5; then ++ MOZ_SYSTEM_PLY=1 ++ else ++ { echo "configure: error: python ply library is not found but --with-system-ply was requested" 1>&2; exit 1; } ++ fi ++ elif test "$withval" = "no"; then ++ : ++ else ++ { echo "configure: error: Option, system-ply, does not take an argument ($withval)." 1>&2; exit 1; } ++ fi ++fi ++ ++ ++ ++ + if test -z "$COMPILE_ENVIRONMENT"; then + NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py' + fi +@@ -4230,7 +4251,7 @@ fi + # Extract the first word of "doxygen", so it can be a program name with args. + set dummy doxygen; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:4234: checking for $ac_word" >&5 ++echo "configure:4255: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_DOXYGEN'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -4279,7 +4300,7 @@ fi + # Extract the first word of "autoconf", so it can be a program name with args. + set dummy autoconf; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:4283: checking for $ac_word" >&5 ++echo "configure:4304: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_AUTOCONF'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -4330,7 +4351,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:4334: checking for $ac_word" >&5 ++echo "configure:4355: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_UNZIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -4386,7 +4407,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:4390: checking for $ac_word" >&5 ++echo "configure:4411: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_ZIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -4440,7 +4461,7 @@ fi + # Extract the first word of "makedepend", so it can be a program name with args. + set dummy makedepend; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:4444: checking for $ac_word" >&5 ++echo "configure:4465: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_SYSTEM_MAKEDEPEND'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -4488,7 +4509,7 @@ fi + # Extract the first word of "xargs", so it can be a program name with args. + set dummy xargs; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:4492: checking for $ac_word" >&5 ++echo "configure:4513: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_XARGS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -4540,7 +4561,7 @@ fi + # Extract the first word of "rpmbuild", so it can be a program name with args. + set dummy rpmbuild; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:4544: checking for $ac_word" >&5 ++echo "configure:4565: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_RPMBUILD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -4613,7 +4634,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:4617: checking for $ac_word" >&5 ++echo "configure:4638: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PBBUILD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -4665,7 +4686,7 @@ done + # Extract the first word of "sdp", so it can be a program name with args. + set dummy sdp; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:4669: checking for $ac_word" >&5 ++echo "configure:4690: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_SDP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -4786,7 +4807,7 @@ tools are selected during the Xcode/Developer Tools installation." 1>&2; exit 1; + + + echo $ac_n "checking for valid compiler/Mac OS X SDK combination""... $ac_c" 1>&6 +-echo "configure:4790: checking for valid compiler/Mac OS X SDK combination" >&5 ++echo "configure:4811: checking for valid compiler/Mac OS X SDK combination" >&5 + ac_ext=C + # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CXXCPP $CPPFLAGS' +@@ -4795,14 +4816,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes + cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:4806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:4827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + result=yes + else +@@ -4829,7 +4850,7 @@ fi + fi # COMPILE_ENVIRONMENT + + echo $ac_n "checking whether the C compiler is clang older than version 2.9""... $ac_c" 1>&6 +-echo "configure:4833: checking whether the C compiler is clang older than version 2.9" >&5 ++echo "configure:4854: checking whether the C compiler is clang older than version 2.9" >&5 + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +@@ -4839,7 +4860,7 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a + cross_compiling=$ac_cv_prog_cc_cross + + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:4877: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + result="no" + else +@@ -4874,7 +4895,7 @@ if test "$result" = "yes"; then + MOZ_NO_THEORA_ASM=1 + fi + echo $ac_n "checking bad gcc versions""... $ac_c" 1>&6 +-echo "configure:4878: checking bad gcc versions" >&5 ++echo "configure:4899: checking bad gcc versions" >&5 + if `$CC --version | grep -q "Apple Inc. build 5658"`; then + echo "$ac_t""Apple build 5658" 1>&6 + MOZ_NO_THEORA_ASM=1 +@@ -4901,7 +4922,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:4905: checking for $ac_word" >&5 ++echo "configure:4926: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_GMAKE'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -4957,7 +4978,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:4961: checking for $ac_word" >&5 ++echo "configure:4982: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_GMAKE'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -5020,7 +5041,7 @@ if test "$COMPILE_ENVIRONMENT"; then + # Uses ac_ vars as temps to allow command line to override cache and checks. + # --without-x overrides everything else, but does not touch the cache. + echo $ac_n "checking for X""... $ac_c" 1>&6 +-echo "configure:5024: checking for X" >&5 ++echo "configure:5045: checking for X" >&5 + + # Check whether --with-x or --without-x was given. + if test "${with_x+set}" = set; then +@@ -5082,12 +5103,12 @@ if test "$ac_x_includes" = NO; then + + # First, try using that file with no special directory specified. + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:5091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:5112: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -5156,14 +5177,14 @@ if test "$ac_x_libraries" = NO; then + ac_save_LIBS="$LIBS" + LIBS="-l$x_direct_test_library $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + LIBS="$ac_save_LIBS" + # We can link X programs with no special library path. +@@ -5269,17 +5290,17 @@ else + case "`(uname -sr) 2>/dev/null`" in + "SunOS 5"*) + echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 +-echo "configure:5273: checking whether -R must be followed by a space" >&5 ++echo "configure:5294: checking whether -R must be followed by a space" >&5 + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_R_nospace=yes + else +@@ -5295,14 +5316,14 @@ rm -f conftest* + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_R_space=yes + else +@@ -5334,7 +5355,7 @@ rm -f conftest* + # libraries were built with DECnet support. And karl@cs.umb.edu says + # the Alpha needs dnet_stub (dnet does not exist). + echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 +-echo "configure:5338: checking for dnet_ntoa in -ldnet" >&5 ++echo "configure:5359: checking for dnet_ntoa in -ldnet" >&5 + ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -5342,7 +5363,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-ldnet $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -5375,7 +5396,7 @@ fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 +-echo "configure:5379: checking for dnet_ntoa in -ldnet_stub" >&5 ++echo "configure:5400: checking for dnet_ntoa in -ldnet_stub" >&5 + ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -5383,7 +5404,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-ldnet_stub $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -5423,12 +5444,12 @@ fi + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to dickey@clark.net. + echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 +-echo "configure:5427: checking for gethostbyname" >&5 ++echo "configure:5448: checking for gethostbyname" >&5 + if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_gethostbyname=yes" + else +@@ -5472,7 +5493,7 @@ fi + + if test $ac_cv_func_gethostbyname = no; then + echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 +-echo "configure:5476: checking for gethostbyname in -lnsl" >&5 ++echo "configure:5497: checking for gethostbyname in -lnsl" >&5 + ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -5480,7 +5501,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lnsl $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -5521,12 +5542,12 @@ fi + # -lsocket must be given before -lnsl if both are needed. + # We assume that if connect needs -lnsl, so does gethostbyname. + echo $ac_n "checking for connect""... $ac_c" 1>&6 +-echo "configure:5525: checking for connect" >&5 ++echo "configure:5546: checking for connect" >&5 + if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_connect=yes" + else +@@ -5570,7 +5591,7 @@ fi + + if test $ac_cv_func_connect = no; then + echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 +-echo "configure:5574: checking for connect in -lsocket" >&5 ++echo "configure:5595: checking for connect in -lsocket" >&5 + ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -5578,7 +5599,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lsocket $X_EXTRA_LIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -5613,12 +5634,12 @@ fi + + # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. + echo $ac_n "checking for remove""... $ac_c" 1>&6 +-echo "configure:5617: checking for remove" >&5 ++echo "configure:5638: checking for remove" >&5 + if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_remove=yes" + else +@@ -5662,7 +5683,7 @@ fi + + if test $ac_cv_func_remove = no; then + echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 +-echo "configure:5666: checking for remove in -lposix" >&5 ++echo "configure:5687: checking for remove in -lposix" >&5 + ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -5670,7 +5691,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lposix $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -5705,12 +5726,12 @@ fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + echo $ac_n "checking for shmat""... $ac_c" 1>&6 +-echo "configure:5709: checking for shmat" >&5 ++echo "configure:5730: checking for shmat" >&5 + if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_shmat=yes" + else +@@ -5754,7 +5775,7 @@ fi + + if test $ac_cv_func_shmat = no; then + echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 +-echo "configure:5758: checking for shmat in -lipc" >&5 ++echo "configure:5779: checking for shmat in -lipc" >&5 + ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -5762,7 +5783,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lipc $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -5806,7 +5827,7 @@ fi + # libraries we check for below, so use a different variable. + # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. + echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 +-echo "configure:5810: checking for IceConnectionNumber in -lICE" >&5 ++echo "configure:5831: checking for IceConnectionNumber in -lICE" >&5 + ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -5814,7 +5835,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lICE $X_EXTRA_LIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:5850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -6220,14 +6241,14 @@ no) + _SAVE_CFLAGS="$CFLAGS" + CFLAGS="$arch_flag" + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:6252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + MOZ_THUMB2=1 + else +@@ -6296,16 +6317,16 @@ if test -n "$all_flags"; then + _SAVE_CFLAGS="$CFLAGS" + CFLAGS="$all_flags" + echo $ac_n "checking whether the chosen combination of compiler flags ($all_flags) works""... $ac_c" 1>&6 +-echo "configure:6300: checking whether the chosen combination of compiler flags ($all_flags) works" >&5 ++echo "configure:6321: checking whether the chosen combination of compiler flags ($all_flags) works" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:6330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6 + else +@@ -6328,18 +6349,18 @@ fi + + if test "$CPU_ARCH" = "arm"; then + echo $ac_n "checking for ARM SIMD support in compiler""... $ac_c" 1>&6 +-echo "configure:6332: checking for ARM SIMD support in compiler" >&5 ++echo "configure:6353: checking for ARM SIMD support in compiler" >&5 + # We try to link so that this also fails when + # building with LTO. + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:6364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + result="yes" + else +@@ -6359,18 +6380,18 @@ EOF + fi + + echo $ac_n "checking for ARM NEON support in compiler""... $ac_c" 1>&6 +-echo "configure:6363: checking for ARM NEON support in compiler" >&5 ++echo "configure:6384: checking for ARM NEON support in compiler" >&5 + # We try to link so that this also fails when + # building with LTO. + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:6395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + result="yes" + else +@@ -6521,7 +6542,7 @@ if test "$GNU_CXX"; then + _USE_CPP_INCLUDE_FLAG=1 + + echo $ac_n "checking whether the compiler supports -Wno-invalid-offsetof""... $ac_c" 1>&6 +-echo "configure:6525: checking whether the compiler supports -Wno-invalid-offsetof" >&5 ++echo "configure:6546: checking whether the compiler supports -Wno-invalid-offsetof" >&5 + if eval "test \"`echo '$''{'ac_has_wno_invalid_offsetof'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -6537,14 +6558,14 @@ cross_compiling=$ac_cv_prog_cxx_cross + _SAVE_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof" + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:6569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_has_wno_invalid_offsetof="yes" + else +@@ -6571,7 +6592,7 @@ echo "$ac_t""$ac_has_wno_invalid_offsetof" 1>&6 + fi + + echo $ac_n "checking whether the compiler supports -Wno-variadic-macros""... $ac_c" 1>&6 +-echo "configure:6575: checking whether the compiler supports -Wno-variadic-macros" >&5 ++echo "configure:6596: checking whether the compiler supports -Wno-variadic-macros" >&5 + if eval "test \"`echo '$''{'ac_has_wno_variadic_macros'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -6587,14 +6608,14 @@ cross_compiling=$ac_cv_prog_cxx_cross + _SAVE_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-variadic-macros" + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:6619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_has_wno_variadic_macros="yes" + else +@@ -6621,7 +6642,7 @@ echo "$ac_t""$ac_has_wno_variadic_macros" 1>&6 + fi + + echo $ac_n "checking whether the compiler supports -Werror=return-type""... $ac_c" 1>&6 +-echo "configure:6625: checking whether the compiler supports -Werror=return-type" >&5 ++echo "configure:6646: checking whether the compiler supports -Werror=return-type" >&5 + if eval "test \"`echo '$''{'ac_has_werror_return_type'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -6637,14 +6658,14 @@ cross_compiling=$ac_cv_prog_cxx_cross + _SAVE_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -Werror=return-type" + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:6669: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_has_werror_return_type="yes" + else +@@ -6680,7 +6701,7 @@ MKSHLIB_UNFORCE_ALL= + if test "$COMPILE_ENVIRONMENT"; then + if test "$GNU_CC"; then + echo $ac_n "checking whether ld has archive extraction flags""... $ac_c" 1>&6 +-echo "configure:6684: checking whether ld has archive extraction flags" >&5 ++echo "configure:6705: checking whether ld has archive extraction flags" >&5 + if eval "test \"`echo '$''{'ac_cv_mkshlib_force_and_unforce'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -6697,14 +6718,14 @@ LOOP_INPUT + LDFLAGS=$force + LIBS=$unforce + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:6729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_mkshlib_force_and_unforce=$line; break + else +@@ -6737,7 +6758,7 @@ configure_static_assert_macros=' + ' + + echo $ac_n "checking that static assertion macros used in autoconf tests work""... $ac_c" 1>&6 +-echo "configure:6741: checking that static assertion macros used in autoconf tests work" >&5 ++echo "configure:6762: checking that static assertion macros used in autoconf tests work" >&5 + if eval "test \"`echo '$''{'ac_cv_static_assertion_macros_work'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -6751,14 +6772,14 @@ cross_compiling=$ac_cv_prog_cc_cross + + ac_cv_static_assertion_macros_work="yes" + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:6783: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : + else + echo "configure: failed program was:" >&5 +@@ -6768,14 +6789,14 @@ else + fi + rm -f conftest* + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:6800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_static_assertion_macros_work="no" + else +@@ -6791,14 +6812,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes + cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:6823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : + else + echo "configure: failed program was:" >&5 +@@ -6808,14 +6829,14 @@ else + fi + rm -f conftest* + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:6840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_static_assertion_macros_work="no" + else +@@ -6849,16 +6870,16 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a + cross_compiling=$ac_cv_prog_cc_cross + + echo $ac_n "checking for 64-bit OS""... $ac_c" 1>&6 +-echo "configure:6853: checking for 64-bit OS" >&5 ++echo "configure:6874: checking for 64-bit OS" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:6883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + result="yes" + else +@@ -6929,19 +6950,19 @@ fi + if test -n "$MOZ_VALGRIND"; then + ac_safe=`echo "valgrind/valgrind.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for valgrind/valgrind.h""... $ac_c" 1>&6 +-echo "configure:6933: checking for valgrind/valgrind.h" >&5 ++echo "configure:6954: checking for valgrind/valgrind.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:6945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:6966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -7129,7 +7150,7 @@ case "$host" in + esac + + echo $ac_n "checking for Python version >= $PYTHON_VERSION but not 3.x""... $ac_c" 1>&6 +-echo "configure:7133: checking for Python version >= $PYTHON_VERSION but not 3.x" >&5 ++echo "configure:7154: checking for Python version >= $PYTHON_VERSION but not 3.x" >&5 + + $PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1] or sys.version[:2] != '2.')" $PYTHON_VERSION + _python_res=$? +@@ -7207,9 +7228,9 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes + cross_compiling=$ac_cv_prog_cxx_cross + + echo $ac_n "checking for IBM XLC/C++ compiler version >= 9.0.0.7""... $ac_c" 1>&6 +-echo "configure:7211: checking for IBM XLC/C++ compiler version >= 9.0.0.7" >&5 ++echo "configure:7232: checking for IBM XLC/C++ compiler version >= 9.0.0.7" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:7243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + _BAD_COMPILER= + else +@@ -7256,19 +7277,19 @@ cross_compiling=$ac_cv_prog_cc_cross + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:7260: checking for $ac_hdr" >&5 ++echo "configure:7281: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:7272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:7293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -7335,12 +7356,12 @@ EOF + STRIP="$STRIP -x -S" + # Check whether we're targeting OS X or iOS + echo $ac_n "checking for iOS target""... $ac_c" 1>&6 +-echo "configure:7339: checking for iOS target" >&5 ++echo "configure:7360: checking for iOS target" >&5 + if eval "test \"`echo '$''{'ac_cv_ios_target'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if !(TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) +@@ -7350,7 +7371,7 @@ int main() { + + ; return 0; } + EOF +-if { (eval echo configure:7354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:7375: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_ios_target="yes" + else +@@ -7397,18 +7418,18 @@ EOF + echo "Skipping -dead_strip because DTrace is enabled. See bug 403132." + else + echo $ac_n "checking for -dead_strip option to ld""... $ac_c" 1>&6 +-echo "configure:7401: checking for -dead_strip option to ld" >&5 ++echo "configure:7422: checking for -dead_strip option to ld" >&5 + _SAVE_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-dead_strip" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:7433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + _HAVE_DEAD_STRIP=1 + else +@@ -7731,19 +7752,19 @@ EOF + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:7735: checking for $ac_hdr" >&5 ++echo "configure:7756: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:7747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:7768: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -7904,19 +7925,19 @@ EOF + _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__" + + echo $ac_n "checking for __declspec(dllexport)""... $ac_c" 1>&6 +-echo "configure:7908: checking for __declspec(dllexport)" >&5 ++echo "configure:7929: checking for __declspec(dllexport)" >&5 + if eval "test \"`echo '$''{'ac_os2_declspec'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:7941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_os2_declspec="yes" + else +@@ -7958,14 +7979,14 @@ EOF + _SAVE_LDFLAGS=$LDFLAGS + LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS" + cat > conftest.$ac_ext < + int main() { + printf("Hello World\n"); + ; return 0; } + EOF +-if { (eval echo configure:7969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:7990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + : + else + echo "configure: failed program was:" >&5 +@@ -7993,7 +8014,7 @@ rm -f conftest* + CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'` + CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'` + echo $ac_n "checking for Sun C++ compiler version >= 5.9""... $ac_c" 1>&6 +-echo "configure:7997: checking for Sun C++ compiler version >= 5.9" >&5 ++echo "configure:8018: checking for Sun C++ compiler version >= 5.9" >&5 + + ac_ext=C + # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +@@ -8003,7 +8024,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes + cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + _BAD_COMPILER= + else +@@ -8029,7 +8050,7 @@ rm -f conftest* + _res="yes" + fi + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + _ABOVE_SS12U1= + else +@@ -8166,12 +8187,12 @@ fi + + if test -z "$SKIP_COMPILER_CHECKS"; then + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +-echo "configure:8170: checking for ANSI C header files" >&5 ++echo "configure:8191: checking for ANSI C header files" >&5 + if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -8179,7 +8200,7 @@ else + #include + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:8183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:8204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -8196,7 +8217,7 @@ rm -f conftest* + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat > conftest.$ac_ext < + EOF +@@ -8214,7 +8235,7 @@ fi + if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat > conftest.$ac_ext < + EOF +@@ -8235,7 +8256,7 @@ if test "$cross_compiling" = yes; then + : + else + cat > conftest.$ac_ext < + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +@@ -8246,7 +8267,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); + exit (0); } + + EOF +-if { (eval echo configure:8250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:8271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + : + else +@@ -8270,12 +8291,12 @@ EOF + fi + + echo $ac_n "checking for working const""... $ac_c" 1>&6 +-echo "configure:8274: checking for working const" >&5 ++echo "configure:8295: checking for working const" >&5 + if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes + else +@@ -8345,12 +8366,12 @@ EOF + fi + + echo $ac_n "checking for mode_t""... $ac_c" 1>&6 +-echo "configure:8349: checking for mode_t" >&5 ++echo "configure:8370: checking for mode_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS +@@ -8378,12 +8399,12 @@ EOF + fi + + echo $ac_n "checking for off_t""... $ac_c" 1>&6 +-echo "configure:8382: checking for off_t" >&5 ++echo "configure:8403: checking for off_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS +@@ -8411,12 +8432,12 @@ EOF + fi + + echo $ac_n "checking for pid_t""... $ac_c" 1>&6 +-echo "configure:8415: checking for pid_t" >&5 ++echo "configure:8436: checking for pid_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS +@@ -8444,12 +8465,12 @@ EOF + fi + + echo $ac_n "checking for size_t""... $ac_c" 1>&6 +-echo "configure:8448: checking for size_t" >&5 ++echo "configure:8469: checking for size_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS +@@ -8484,12 +8505,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes + cross_compiling=$ac_cv_prog_cxx_cross + + echo $ac_n "checking for __stdcall""... $ac_c" 1>&6 +-echo "configure:8488: checking for __stdcall" >&5 ++echo "configure:8509: checking for __stdcall" >&5 + if eval "test \"`echo '$''{'ac_cv___stdcall'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < struct foo; + template <> struct foo {}; +@@ -8498,7 +8519,7 @@ int main() { + + ; return 0; } + EOF +-if { (eval echo configure:8502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8523: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv___stdcall=true + else +@@ -8527,12 +8548,12 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a + cross_compiling=$ac_cv_prog_cc_cross + + echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 +-echo "configure:8531: checking for ssize_t" >&5 ++echo "configure:8552: checking for ssize_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -8540,7 +8561,7 @@ int main() { + ssize_t foo = 0; + ; return 0; } + EOF +-if { (eval echo configure:8544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_ssize_t=true + else +@@ -8562,12 +8583,12 @@ else + echo "$ac_t""no" 1>&6 + fi + echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 +-echo "configure:8566: checking for st_blksize in struct stat" >&5 ++echo "configure:8587: checking for st_blksize in struct stat" >&5 + if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -8575,7 +8596,7 @@ int main() { + struct stat s; s.st_blksize; + ; return 0; } + EOF +-if { (eval echo configure:8579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_st_blksize=yes + else +@@ -8596,12 +8617,12 @@ EOF + fi + + echo $ac_n "checking for siginfo_t""... $ac_c" 1>&6 +-echo "configure:8600: checking for siginfo_t" >&5 ++echo "configure:8621: checking for siginfo_t" >&5 + if eval "test \"`echo '$''{'ac_cv_siginfo_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < +@@ -8609,7 +8630,7 @@ int main() { + siginfo_t* info; + ; return 0; } + EOF +-if { (eval echo configure:8613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_siginfo_t=true + else +@@ -8632,12 +8653,12 @@ else + fi + + echo $ac_n "checking for int16_t""... $ac_c" 1>&6 +-echo "configure:8636: checking for int16_t" >&5 ++echo "configure:8657: checking for int16_t" >&5 + if eval "test \"`echo '$''{'ac_cv_int16_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -8645,7 +8666,7 @@ int main() { + int16_t foo = 0; + ; return 0; } + EOF +-if { (eval echo configure:8649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8670: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_int16_t=true + else +@@ -8667,12 +8688,12 @@ else + echo "$ac_t""no" 1>&6 + fi + echo $ac_n "checking for int32_t""... $ac_c" 1>&6 +-echo "configure:8671: checking for int32_t" >&5 ++echo "configure:8692: checking for int32_t" >&5 + if eval "test \"`echo '$''{'ac_cv_int32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -8680,7 +8701,7 @@ int main() { + int32_t foo = 0; + ; return 0; } + EOF +-if { (eval echo configure:8684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_int32_t=true + else +@@ -8702,12 +8723,12 @@ else + echo "$ac_t""no" 1>&6 + fi + echo $ac_n "checking for int64_t""... $ac_c" 1>&6 +-echo "configure:8706: checking for int64_t" >&5 ++echo "configure:8727: checking for int64_t" >&5 + if eval "test \"`echo '$''{'ac_cv_int64_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -8715,7 +8736,7 @@ int main() { + int64_t foo = 0; + ; return 0; } + EOF +-if { (eval echo configure:8719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_int64_t=true + else +@@ -8737,12 +8758,12 @@ else + echo "$ac_t""no" 1>&6 + fi + echo $ac_n "checking for int64""... $ac_c" 1>&6 +-echo "configure:8741: checking for int64" >&5 ++echo "configure:8762: checking for int64" >&5 + if eval "test \"`echo '$''{'ac_cv_int64'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -8750,7 +8771,7 @@ int main() { + int64 foo = 0; + ; return 0; } + EOF +-if { (eval echo configure:8754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_int64=true + else +@@ -8772,12 +8793,12 @@ else + echo "$ac_t""no" 1>&6 + fi + echo $ac_n "checking for uint""... $ac_c" 1>&6 +-echo "configure:8776: checking for uint" >&5 ++echo "configure:8797: checking for uint" >&5 + if eval "test \"`echo '$''{'ac_cv_uint'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -8785,7 +8806,7 @@ int main() { + uint foo = 0; + ; return 0; } + EOF +-if { (eval echo configure:8789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_uint=true + else +@@ -8807,12 +8828,12 @@ else + echo "$ac_t""no" 1>&6 + fi + echo $ac_n "checking for uint_t""... $ac_c" 1>&6 +-echo "configure:8811: checking for uint_t" >&5 ++echo "configure:8832: checking for uint_t" >&5 + if eval "test \"`echo '$''{'ac_cv_uint_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -8820,7 +8841,7 @@ int main() { + uint_t foo = 0; + ; return 0; } + EOF +-if { (eval echo configure:8824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_uint_t=true + else +@@ -8842,12 +8863,12 @@ else + echo "$ac_t""no" 1>&6 + fi + echo $ac_n "checking for uint16_t""... $ac_c" 1>&6 +-echo "configure:8846: checking for uint16_t" >&5 ++echo "configure:8867: checking for uint16_t" >&5 + if eval "test \"`echo '$''{'ac_cv_uint16_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -8855,7 +8876,7 @@ int main() { + uint16_t foo = 0; + ; return 0; } + EOF +-if { (eval echo configure:8859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_uint16_t=true + else +@@ -8886,12 +8907,12 @@ cross_compiling=$ac_cv_prog_cxx_cross + + + echo $ac_n "checking for uname.domainname""... $ac_c" 1>&6 +-echo "configure:8890: checking for uname.domainname" >&5 ++echo "configure:8911: checking for uname.domainname" >&5 + if eval "test \"`echo '$''{'ac_cv_have_uname_domainname_field'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { +@@ -8899,7 +8920,7 @@ int main() { + (void)uname(res); if (res != 0) { domain = res->domainname; } + ; return 0; } + EOF +-if { (eval echo configure:8903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_have_uname_domainname_field=true + else +@@ -8923,12 +8944,12 @@ else + fi + + echo $ac_n "checking for uname.__domainname""... $ac_c" 1>&6 +-echo "configure:8927: checking for uname.__domainname" >&5 ++echo "configure:8948: checking for uname.__domainname" >&5 + if eval "test \"`echo '$''{'ac_cv_have_uname_us_domainname_field'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { +@@ -8936,7 +8957,7 @@ int main() { + (void)uname(res); if (res != 0) { domain = res->__domainname; } + ; return 0; } + EOF +-if { (eval echo configure:8940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:8961: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_have_uname_us_domainname_field=true + else +@@ -8996,19 +9017,19 @@ if test "$GNU_CXX"; then + if test -z "$_MOZ_USE_RTTI"; then + CXXFLAGS="$CXXFLAGS $_MOZ_RTTI_FLAGS" + echo $ac_n "checking for gcc c++0x headers bug without rtti""... $ac_c" 1>&6 +-echo "configure:9000: checking for gcc c++0x headers bug without rtti" >&5 ++echo "configure:9021: checking for gcc c++0x headers bug without rtti" >&5 + if eval "test \"`echo '$''{'ac_cv_cxx0x_headers_bug'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:9012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cxx0x_headers_bug="no" + else +@@ -9029,12 +9050,12 @@ echo "$ac_t""$ac_cv_cxx0x_headers_bug" 1>&6 + fi + + echo $ac_n "checking for usable char16_t (2 bytes, unsigned)""... $ac_c" 1>&6 +-echo "configure:9033: checking for usable char16_t (2 bytes, unsigned)" >&5 ++echo "configure:9054: checking for usable char16_t (2 bytes, unsigned)" >&5 + if eval "test \"`echo '$''{'ac_cv_have_usable_char16_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < u'\x0') + ; return 0; } + EOF +-if { (eval echo configure:9049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_have_usable_char16_t="yes" + else +@@ -9070,12 +9091,12 @@ fi + + + echo $ac_n "checking for usable wchar_t (2 bytes, unsigned)""... $ac_c" 1>&6 +-echo "configure:9074: checking for usable wchar_t (2 bytes, unsigned)" >&5 ++echo "configure:9095: checking for usable wchar_t (2 bytes, unsigned)" >&5 + if eval "test \"`echo '$''{'ac_cv_have_usable_wchar_v2'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + $configure_static_assert_macros +@@ -9084,7 +9105,7 @@ CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2); + CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0) + ; return 0; } + EOF +-if { (eval echo configure:9088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_have_usable_wchar_v2="yes" + else +@@ -9109,12 +9130,12 @@ elif test "$ac_cv_have_usable_char16_t" != "yes"; then + CXXFLAGS="$CXXFLAGS -fshort-wchar" + + echo $ac_n "checking for compiler -fshort-wchar option""... $ac_c" 1>&6 +-echo "configure:9113: checking for compiler -fshort-wchar option" >&5 ++echo "configure:9134: checking for compiler -fshort-wchar option" >&5 + if eval "test \"`echo '$''{'ac_cv_have_usable_wchar_option_v2'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + $configure_static_assert_macros +@@ -9123,7 +9144,7 @@ CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2); + CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0) + ; return 0; } + EOF +-if { (eval echo configure:9127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:9148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_have_usable_wchar_option_v2="yes" + else +@@ -9166,7 +9187,7 @@ cross_compiling=$ac_cv_prog_cc_cross + + if test "$GNU_CC"; then + echo $ac_n "checking for visibility(hidden) attribute""... $ac_c" 1>&6 +-echo "configure:9170: checking for visibility(hidden) attribute" >&5 ++echo "configure:9191: checking for visibility(hidden) attribute" >&5 + if eval "test \"`echo '$''{'ac_cv_visibility_hidden'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -9191,7 +9212,7 @@ EOF + + + echo $ac_n "checking for visibility(default) attribute""... $ac_c" 1>&6 +-echo "configure:9195: checking for visibility(default) attribute" >&5 ++echo "configure:9216: checking for visibility(default) attribute" >&5 + if eval "test \"`echo '$''{'ac_cv_visibility_default'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -9216,7 +9237,7 @@ EOF + + + echo $ac_n "checking for visibility pragma support""... $ac_c" 1>&6 +-echo "configure:9220: checking for visibility pragma support" >&5 ++echo "configure:9241: checking for visibility pragma support" >&5 + if eval "test \"`echo '$''{'ac_cv_visibility_pragma'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -9241,7 +9262,7 @@ fi + echo "$ac_t""$ac_cv_visibility_pragma" 1>&6 + if test "$ac_cv_visibility_pragma" = "yes"; then + echo $ac_n "checking For gcc visibility bug with class-level attributes (GCC bug 26905)""... $ac_c" 1>&6 +-echo "configure:9245: checking For gcc visibility bug with class-level attributes (GCC bug 26905)" >&5 ++echo "configure:9266: checking For gcc visibility bug with class-level attributes (GCC bug 26905)" >&5 + if eval "test \"`echo '$''{'ac_cv_have_visibility_class_bug'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -9269,7 +9290,7 @@ fi + echo "$ac_t""$ac_cv_have_visibility_class_bug" 1>&6 + + echo $ac_n "checking For x86_64 gcc visibility bug with builtins (GCC bug 20297)""... $ac_c" 1>&6 +-echo "configure:9273: checking For x86_64 gcc visibility bug with builtins (GCC bug 20297)" >&5 ++echo "configure:9294: checking For x86_64 gcc visibility bug with builtins (GCC bug 20297)" >&5 + if eval "test \"`echo '$''{'ac_cv_have_visibility_builtin_bug'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -9323,7 +9344,7 @@ fi # Sun Studio on Solaris + if test "$GNU_CC"; then + + echo $ac_n "checking for gcc PR49911""... $ac_c" 1>&6 +-echo "configure:9327: checking for gcc PR49911" >&5 ++echo "configure:9348: checking for gcc PR49911" >&5 + ac_have_gcc_pr49911="no" + + ac_ext=C +@@ -9340,7 +9361,7 @@ if test "$cross_compiling" = yes; then + true + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:9406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + true + else +@@ -9417,19 +9438,19 @@ if test "$GNU_CC"; then + CFLAGS_save="${CFLAGS}" + CFLAGS="${CFLAGS} -Werror" + echo $ac_n "checking for __force_align_arg_pointer__ attribute""... $ac_c" 1>&6 +-echo "configure:9421: checking for __force_align_arg_pointer__ attribute" >&5 ++echo "configure:9442: checking for __force_align_arg_pointer__ attribute" >&5 + if eval "test \"`echo '$''{'ac_cv_force_align_arg_pointer'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_force_align_arg_pointer="yes" + else +@@ -9456,12 +9477,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +-echo "configure:9460: checking for $ac_hdr that defines DIR" >&5 ++echo "configure:9481: checking for $ac_hdr that defines DIR" >&5 + if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include <$ac_hdr> +@@ -9469,7 +9490,7 @@ int main() { + DIR *dirp = 0; + ; return 0; } + EOF +-if { (eval echo configure:9473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=yes" + else +@@ -9494,7 +9515,7 @@ done + # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. + if test $ac_header_dirent = dirent.h; then + echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +-echo "configure:9498: checking for opendir in -ldir" >&5 ++echo "configure:9519: checking for opendir in -ldir" >&5 + ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -9502,7 +9523,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-ldir $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:9538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -9535,7 +9556,7 @@ fi + + else + echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 +-echo "configure:9539: checking for opendir in -lx" >&5 ++echo "configure:9560: checking for opendir in -lx" >&5 + ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -9543,7 +9564,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lx $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:9579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -9586,19 +9607,19 @@ esac + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:9590: checking for $ac_hdr" >&5 ++echo "configure:9611: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:9602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -9628,19 +9649,19 @@ EOF + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:9632: checking for $ac_hdr" >&5 ++echo "configure:9653: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:9644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -9670,19 +9691,19 @@ EOF + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:9674: checking for $ac_hdr" >&5 ++echo "configure:9695: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:9686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -9712,19 +9733,19 @@ EOF + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:9716: checking for $ac_hdr" >&5 ++echo "configure:9737: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:9728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -9754,19 +9775,19 @@ EOF + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:9758: checking for $ac_hdr" >&5 ++echo "configure:9779: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:9770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -9796,19 +9817,19 @@ EOF + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:9800: checking for $ac_hdr" >&5 ++echo "configure:9821: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:9812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -9839,19 +9860,19 @@ EOF + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:9843: checking for $ac_hdr" >&5 ++echo "configure:9864: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:9855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -9882,19 +9903,19 @@ EOF + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:9886: checking for $ac_hdr" >&5 ++echo "configure:9907: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:9898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -9924,19 +9945,19 @@ EOF + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:9928: checking for $ac_hdr" >&5 ++echo "configure:9949: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:9940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:9961: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -9967,19 +9988,19 @@ EOF + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:9971: checking for $ac_hdr" >&5 ++echo "configure:9992: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:9983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:10004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -10016,19 +10037,19 @@ cross_compiling=$ac_cv_prog_cxx_cross + NEW_H=new.h + ac_safe=`echo "new" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for new""... $ac_c" 1>&6 +-echo "configure:10020: checking for new" >&5 ++echo "configure:10041: checking for new" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:10032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:10053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -10069,19 +10090,19 @@ fi + if test "x$enable_dtrace" = "xyes"; then + ac_safe=`echo "sys/sdt.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for sys/sdt.h""... $ac_c" 1>&6 +-echo "configure:10073: checking for sys/sdt.h" >&5 ++echo "configure:10094: checking for sys/sdt.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:10085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:10106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -10120,19 +10141,19 @@ case $target in + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:10124: checking for $ac_hdr" >&5 ++echo "configure:10145: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:10136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:10157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -10166,7 +10187,7 @@ case $target in + ;; + *) + echo $ac_n "checking for gethostbyname_r in -lc_r""... $ac_c" 1>&6 +-echo "configure:10170: checking for gethostbyname_r in -lc_r" >&5 ++echo "configure:10191: checking for gethostbyname_r in -lc_r" >&5 + ac_lib_var=`echo c_r'_'gethostbyname_r | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -10174,7 +10195,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lc_r $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -10223,14 +10244,14 @@ case $target in + *) + + echo $ac_n "checking for library containing dlopen""... $ac_c" 1>&6 +-echo "configure:10227: checking for library containing dlopen" >&5 ++echo "configure:10248: checking for library containing dlopen" >&5 + if eval "test \"`echo '$''{'ac_cv_search_dlopen'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_func_search_save_LIBS="$LIBS" + ac_cv_search_dlopen="no" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_search_dlopen="none required" + else +@@ -10252,7 +10273,7 @@ rm -f conftest* + test "$ac_cv_search_dlopen" = "no" && for i in dl; do + LIBS="-l$i $ac_func_search_save_LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_search_dlopen="-l$i" + break +@@ -10281,19 +10302,19 @@ if test "$ac_cv_search_dlopen" != "no"; then + test "$ac_cv_search_dlopen" = "none required" || LIBS="$ac_cv_search_dlopen $LIBS" + ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 +-echo "configure:10285: checking for dlfcn.h" >&5 ++echo "configure:10306: checking for dlfcn.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:10297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:10318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -10327,12 +10348,12 @@ CFLAGS="$CFLAGS -D_GNU_SOURCE" + for ac_func in dladdr memmem + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:10331: checking for $ac_func" >&5 ++echo "configure:10352: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -10386,7 +10407,7 @@ if test ! "$GNU_CXX"; then + case $target in + *-aix*) + echo $ac_n "checking for demangle in -lC_r""... $ac_c" 1>&6 +-echo "configure:10390: checking for demangle in -lC_r" >&5 ++echo "configure:10411: checking for demangle in -lC_r" >&5 + ac_lib_var=`echo C_r'_'demangle | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -10394,7 +10415,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lC_r $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -10435,7 +10456,7 @@ fi + ;; + *) + echo $ac_n "checking for demangle in -lC""... $ac_c" 1>&6 +-echo "configure:10439: checking for demangle in -lC" >&5 ++echo "configure:10460: checking for demangle in -lC" >&5 + ac_lib_var=`echo C'_'demangle | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -10443,7 +10464,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lC $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -10490,7 +10511,7 @@ case $target in + ;; + *) + echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 +-echo "configure:10494: checking for socket in -lsocket" >&5 ++echo "configure:10515: checking for socket in -lsocket" >&5 + ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -10498,7 +10519,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lsocket $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -10555,7 +10576,7 @@ EOF + _SAVE_LDFLAGS="$LDFLAGS" + LDFLAGS="$XLDFLAGS $LDFLAGS" + echo $ac_n "checking for XDrawLines in -lX11""... $ac_c" 1>&6 +-echo "configure:10559: checking for XDrawLines in -lX11" >&5 ++echo "configure:10580: checking for XDrawLines in -lX11" >&5 + ac_lib_var=`echo X11'_'XDrawLines | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -10563,7 +10584,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lX11 $XLIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -10596,7 +10617,7 @@ MISSING_X="$MISSING_X -lX11" + fi + + echo $ac_n "checking for XextAddDisplay in -lXext""... $ac_c" 1>&6 +-echo "configure:10600: checking for XextAddDisplay in -lXext" >&5 ++echo "configure:10621: checking for XextAddDisplay in -lXext" >&5 + ac_lib_var=`echo Xext'_'XextAddDisplay | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -10604,7 +10625,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lXext $XLIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -10638,7 +10659,7 @@ fi + + + echo $ac_n "checking for XtFree in -lXt""... $ac_c" 1>&6 +-echo "configure:10642: checking for XtFree in -lXt" >&5 ++echo "configure:10663: checking for XtFree in -lXt" >&5 + ac_lib_var=`echo Xt'_'XtFree | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -10646,7 +10667,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lXt $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -10678,7 +10699,7 @@ else + + unset ac_cv_lib_Xt_XtFree + echo $ac_n "checking for IceFlush in -lICE""... $ac_c" 1>&6 +-echo "configure:10682: checking for IceFlush in -lICE" >&5 ++echo "configure:10703: checking for IceFlush in -lICE" >&5 + ac_lib_var=`echo ICE'_'IceFlush | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -10686,7 +10707,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lICE $XT_LIBS $XLIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -10718,7 +10739,7 @@ else + fi + + echo $ac_n "checking for SmcCloseConnection in -lSM""... $ac_c" 1>&6 +-echo "configure:10722: checking for SmcCloseConnection in -lSM" >&5 ++echo "configure:10743: checking for SmcCloseConnection in -lSM" >&5 + ac_lib_var=`echo SM'_'SmcCloseConnection | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -10726,7 +10747,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lSM $XT_LIBS $XLIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -10758,7 +10779,7 @@ else + fi + + echo $ac_n "checking for XtFree in -lXt""... $ac_c" 1>&6 +-echo "configure:10762: checking for XtFree in -lXt" >&5 ++echo "configure:10783: checking for XtFree in -lXt" >&5 + ac_lib_var=`echo Xt'_'XtFree | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -10766,7 +10787,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lXt $X_PRE_LIBS $XT_LIBS $XLIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -10811,7 +10832,7 @@ fi + esac + + echo $ac_n "checking for XShmCreateImage in -lXext""... $ac_c" 1>&6 +-echo "configure:10815: checking for XShmCreateImage in -lXext" >&5 ++echo "configure:10836: checking for XShmCreateImage in -lXext" >&5 + ac_lib_var=`echo Xext'_'XShmCreateImage | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -10819,7 +10840,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lXext $XLIBS $XEXT_LIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -10853,19 +10874,19 @@ fi + + ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6 +-echo "configure:10857: checking for X11/extensions/scrnsaver.h" >&5 ++echo "configure:10878: checking for X11/extensions/scrnsaver.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:10869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:10890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -10880,7 +10901,7 @@ fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + echo $ac_n "checking for XScreenSaverQueryInfo in -lXss""... $ac_c" 1>&6 +-echo "configure:10884: checking for XScreenSaverQueryInfo in -lXss" >&5 ++echo "configure:10905: checking for XScreenSaverQueryInfo in -lXss" >&5 + ac_lib_var=`echo Xss'_'XScreenSaverQueryInfo | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -10888,7 +10909,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lXss $XEXT_LIBS $XLIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:10924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -10971,7 +10992,7 @@ fi + # Extract the first word of "freetype-config", so it can be a program name with args. + set dummy freetype-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:10975: checking for $ac_word" >&5 ++echo "configure:10996: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_FT2_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -11007,7 +11028,7 @@ fi + + min_ft_version=6.1.0 + echo $ac_n "checking for FreeType - version >= $min_ft_version""... $ac_c" 1>&6 +-echo "configure:11011: checking for FreeType - version >= $min_ft_version" >&5 ++echo "configure:11032: checking for FreeType - version >= $min_ft_version" >&5 + no_ft="" + if test "$FT2_CONFIG" = "no" ; then + no_ft=yes +@@ -11055,7 +11076,7 @@ else + echo $ac_n "cross compiling; assumed OK... $ac_c" + else + cat > conftest.$ac_ext < +@@ -11081,7 +11102,7 @@ main() + } + + EOF +-if { (eval echo configure:11085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:11106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + : + else +@@ -11131,12 +11152,12 @@ fi + CFLAGS="$CFLAGS $FT2_CFLAGS" + + echo $ac_n "checking for FT_Bitmap_Size.y_ppem""... $ac_c" 1>&6 +-echo "configure:11135: checking for FT_Bitmap_Size.y_ppem" >&5 ++echo "configure:11156: checking for FT_Bitmap_Size.y_ppem" >&5 + if eval "test \"`echo '$''{'ac_cv_member_FT_Bitmap_Size_y_ppem'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include FT_FREETYPE_H +@@ -11146,7 +11167,7 @@ FT_Bitmap_Size s; + return 1 + ; return 0; } + EOF +-if { (eval echo configure:11150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:11171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_member_FT_Bitmap_Size_y_ppem=yes + else +@@ -11172,12 +11193,12 @@ EOF + for ac_func in FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:11176: checking for $ac_func" >&5 ++echo "configure:11197: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:11225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -11245,7 +11266,7 @@ darwin*) + *) + + echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 +-echo "configure:11249: checking for pthread_create in -lpthreads" >&5 ++echo "configure:11270: checking for pthread_create in -lpthreads" >&5 + echo " + #include + #include +@@ -11268,7 +11289,7 @@ echo " + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 +-echo "configure:11272: checking for pthread_create in -lpthread" >&5 ++echo "configure:11293: checking for pthread_create in -lpthread" >&5 + echo " + #include + #include +@@ -11291,7 +11312,7 @@ echo " + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 +-echo "configure:11295: checking for pthread_create in -lc_r" >&5 ++echo "configure:11316: checking for pthread_create in -lc_r" >&5 + echo " + #include + #include +@@ -11314,7 +11335,7 @@ echo " + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 +-echo "configure:11318: checking for pthread_create in -lc" >&5 ++echo "configure:11339: checking for pthread_create in -lc" >&5 + echo " + #include + #include +@@ -11373,7 +11394,7 @@ then + rm -f conftest* + ac_cv_have_dash_pthread=no + echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6 +-echo "configure:11377: checking whether ${CC-cc} accepts -pthread" >&5 ++echo "configure:11398: checking whether ${CC-cc} accepts -pthread" >&5 + echo 'int main() { return 0; }' | cat > conftest.c + ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 + if test $? -eq 0; then +@@ -11396,7 +11417,7 @@ echo "configure:11377: checking whether ${CC-cc} accepts -pthread" >&5 + ac_cv_have_dash_pthreads=no + if test "$ac_cv_have_dash_pthread" = "no"; then + echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 +-echo "configure:11400: checking whether ${CC-cc} accepts -pthreads" >&5 ++echo "configure:11421: checking whether ${CC-cc} accepts -pthreads" >&5 + echo 'int main() { return 0; }' | cat > conftest.c + ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 + if test $? -eq 0; then +@@ -11479,13 +11500,13 @@ fi + + if test $ac_cv_prog_gcc = yes; then + echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 +-echo "configure:11483: checking whether ${CC-cc} needs -traditional" >&5 ++echo "configure:11504: checking whether ${CC-cc} needs -traditional" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_pattern="Autoconf.*'x'" + cat > conftest.$ac_ext < + Autoconf TIOCGETP +@@ -11503,7 +11524,7 @@ rm -f conftest* + + if test $ac_cv_prog_gcc_traditional = no; then + cat > conftest.$ac_ext < + Autoconf TCGETA +@@ -11525,7 +11546,7 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 + fi + + echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 +-echo "configure:11529: checking for 8-bit clean memcmp" >&5 ++echo "configure:11550: checking for 8-bit clean memcmp" >&5 + if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -11533,7 +11554,7 @@ else + ac_cv_func_memcmp_clean=no + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:11568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_func_memcmp_clean=yes + else +@@ -11563,12 +11584,12 @@ test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" + for ac_func in random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:11567: checking for $ac_func" >&5 ++echo "configure:11588: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:11616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -11618,12 +11639,12 @@ done + for ac_func in flockfile getpagesize + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:11622: checking for $ac_func" >&5 ++echo "configure:11643: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:11671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -11673,12 +11694,12 @@ done + for ac_func in localtime_r strtok_r + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:11677: checking for $ac_func" >&5 ++echo "configure:11698: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:11726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -11729,12 +11750,12 @@ done + _SAVE_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -lrt" + echo $ac_n "checking for clock_gettime(CLOCK_MONOTONIC) and -lrt""... $ac_c" 1>&6 +-echo "configure:11733: checking for clock_gettime(CLOCK_MONOTONIC) and -lrt" >&5 ++echo "configure:11754: checking for clock_gettime(CLOCK_MONOTONIC) and -lrt" >&5 + if eval "test \"`echo '$''{'ac_cv_have_clock_monotonic'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { +@@ -11742,7 +11763,7 @@ int main() { + clock_gettime(CLOCK_MONOTONIC, &ts); + ; return 0; } + EOF +-if { (eval echo configure:11746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:11767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_have_clock_monotonic=yes + else +@@ -11777,19 +11798,19 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes + cross_compiling=$ac_cv_prog_cxx_cross + + echo $ac_n "checking for wcrtomb""... $ac_c" 1>&6 +-echo "configure:11781: checking for wcrtomb" >&5 ++echo "configure:11802: checking for wcrtomb" >&5 + if eval "test \"`echo '$''{'ac_cv_have_wcrtomb'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + mbstate_t ps={0};wcrtomb(0,'f',&ps); + ; return 0; } + EOF +-if { (eval echo configure:11793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:11814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_have_wcrtomb="yes" + else +@@ -11809,19 +11830,19 @@ EOF + + fi + echo $ac_n "checking for mbrtowc""... $ac_c" 1>&6 +-echo "configure:11813: checking for mbrtowc" >&5 ++echo "configure:11834: checking for mbrtowc" >&5 + if eval "test \"`echo '$''{'ac_cv_have_mbrtowc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + mbstate_t ps={0};mbrtowc(0,0,0,&ps); + ; return 0; } + EOF +-if { (eval echo configure:11825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:11846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_have_mbrtowc="yes" + else +@@ -11850,12 +11871,12 @@ cross_compiling=$ac_cv_prog_cc_cross + fi + + echo $ac_n "checking for res_ninit()""... $ac_c" 1>&6 +-echo "configure:11854: checking for res_ninit()" >&5 ++echo "configure:11875: checking for res_ninit()" >&5 + if eval "test \"`echo '$''{'ac_cv_func_res_ninit'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:11892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_res_ninit=yes + else +@@ -11897,12 +11918,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes + cross_compiling=$ac_cv_prog_cxx_cross + + echo $ac_n "checking for gnu_get_libc_version()""... $ac_c" 1>&6 +-echo "configure:11901: checking for gnu_get_libc_version()" >&5 ++echo "configure:11922: checking for gnu_get_libc_version()" >&5 + if eval "test \"`echo '$''{'ac_cv_func_gnu_get_libc_version'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:11938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_gnu_get_libc_version=yes + else +@@ -11942,7 +11963,7 @@ case $target_os in + *) + + echo $ac_n "checking for iconv in -lc""... $ac_c" 1>&6 +-echo "configure:11946: checking for iconv in -lc" >&5 ++echo "configure:11967: checking for iconv in -lc" >&5 + ac_lib_var=`echo c'_'iconv | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -11950,7 +11971,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lc $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:11989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -11983,7 +12004,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + else + echo "$ac_t""no" 1>&6 + echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6 +-echo "configure:11987: checking for iconv in -liconv" >&5 ++echo "configure:12008: checking for iconv in -liconv" >&5 + ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -11991,7 +12012,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-liconv $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:12030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -12024,7 +12045,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + else + echo "$ac_t""no" 1>&6 + echo $ac_n "checking for libiconv in -liconv""... $ac_c" 1>&6 +-echo "configure:12028: checking for libiconv in -liconv" >&5 ++echo "configure:12049: checking for libiconv in -liconv" >&5 + ac_lib_var=`echo iconv'_'libiconv | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -12032,7 +12053,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-liconv $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:12071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -12073,12 +12094,12 @@ fi + _SAVE_LIBS=$LIBS + LIBS="$LIBS $_ICONV_LIBS" + echo $ac_n "checking for iconv()""... $ac_c" 1>&6 +-echo "configure:12077: checking for iconv()" >&5 ++echo "configure:12098: checking for iconv()" >&5 + if eval "test \"`echo '$''{'ac_cv_func_iconv'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < +@@ -12092,7 +12113,7 @@ int main() { + + ; return 0; } + EOF +-if { (eval echo configure:12096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:12117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_iconv=yes + else +@@ -12116,12 +12137,12 @@ EOF + LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS" + LIBICONV="$_ICONV_LIBS" + echo $ac_n "checking for iconv() with const input""... $ac_c" 1>&6 +-echo "configure:12120: checking for iconv() with const input" >&5 ++echo "configure:12141: checking for iconv() with const input" >&5 + if eval "test \"`echo '$''{'ac_cv_func_const_iconv'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < +@@ -12136,7 +12157,7 @@ int main() { + + ; return 0; } + EOF +-if { (eval echo configure:12140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_func_const_iconv=yes + else +@@ -12165,19 +12186,19 @@ esac + + + echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6 +-echo "configure:12169: checking for nl_langinfo and CODESET" >&5 ++echo "configure:12190: checking for nl_langinfo and CODESET" >&5 + if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + char* cs = nl_langinfo(CODESET); + ; return 0; } + EOF +-if { (eval echo configure:12181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:12202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_langinfo_codeset=yes + else +@@ -12209,7 +12230,7 @@ cross_compiling=$ac_cv_prog_cc_cross + + + echo $ac_n "checking for an implementation of va_copy()""... $ac_c" 1>&6 +-echo "configure:12213: checking for an implementation of va_copy()" >&5 ++echo "configure:12234: checking for an implementation of va_copy()" >&5 + if eval "test \"`echo '$''{'ac_cv_va_copy'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -12219,7 +12240,7 @@ else + + else + cat > conftest.$ac_ext < +@@ -12233,7 +12254,7 @@ else + } + int main() { f (0, 42); return 0; } + EOF +-if { (eval echo configure:12237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:12258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_va_copy=yes + else +@@ -12250,7 +12271,7 @@ fi + + echo "$ac_t""$ac_cv_va_copy" 1>&6 + echo $ac_n "checking for an implementation of __va_copy()""... $ac_c" 1>&6 +-echo "configure:12254: checking for an implementation of __va_copy()" >&5 ++echo "configure:12275: checking for an implementation of __va_copy()" >&5 + if eval "test \"`echo '$''{'ac_cv___va_copy'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -12260,7 +12281,7 @@ else + + else + cat > conftest.$ac_ext < +@@ -12274,7 +12295,7 @@ else + } + int main() { f (0, 42); return 0; } + EOF +-if { (eval echo configure:12278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:12299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv___va_copy=yes + else +@@ -12291,7 +12312,7 @@ fi + + echo "$ac_t""$ac_cv___va_copy" 1>&6 + echo $ac_n "checking whether va_lists can be copied by value""... $ac_c" 1>&6 +-echo "configure:12295: checking whether va_lists can be copied by value" >&5 ++echo "configure:12316: checking whether va_lists can be copied by value" >&5 + if eval "test \"`echo '$''{'ac_cv_va_val_copy'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -12301,7 +12322,7 @@ else + + else + cat > conftest.$ac_ext < +@@ -12315,7 +12336,7 @@ else + } + int main() { f (0, 42); return 0; } + EOF +-if { (eval echo configure:12319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:12340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_va_val_copy=yes + else +@@ -12370,12 +12391,12 @@ ARM_ABI_PREFIX= + if test "$GNU_CC"; then + if test "$CPU_ARCH" = "arm" ; then + echo $ac_n "checking for ARM EABI""... $ac_c" 1>&6 +-echo "configure:12374: checking for ARM EABI" >&5 ++echo "configure:12395: checking for ARM EABI" >&5 + if eval "test \"`echo '$''{'ac_cv_gcc_arm_eabi'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_gcc_arm_eabi="yes" + else +@@ -12413,12 +12434,12 @@ echo "$ac_t""$ac_cv_gcc_arm_eabi" 1>&6 + fi + + echo $ac_n "checking for modern C++ template specialization syntax support""... $ac_c" 1>&6 +-echo "configure:12417: checking for modern C++ template specialization syntax support" >&5 ++echo "configure:12438: checking for modern C++ template specialization syntax support" >&5 + if eval "test \"`echo '$''{'ac_cv_cpp_modern_specialize_template_syntax'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < struct X { int a; }; + class Y {}; +@@ -12428,7 +12449,7 @@ X int_x; + X y_x; + ; return 0; } + EOF +-if { (eval echo configure:12432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cpp_modern_specialize_template_syntax=yes + else +@@ -12450,12 +12471,12 @@ fi + + + echo $ac_n "checking whether partial template specialization works""... $ac_c" 1>&6 +-echo "configure:12454: checking whether partial template specialization works" >&5 ++echo "configure:12475: checking whether partial template specialization works" >&5 + if eval "test \"`echo '$''{'ac_cv_cpp_partial_specialization'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < class Foo {}; + template class Foo {}; +@@ -12463,7 +12484,7 @@ int main() { + return 0; + ; return 0; } + EOF +-if { (eval echo configure:12467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cpp_partial_specialization=yes + else +@@ -12484,12 +12505,12 @@ EOF + fi + + echo $ac_n "checking whether the C++ \"using\" keyword resolves ambiguity""... $ac_c" 1>&6 +-echo "configure:12488: checking whether the C++ \"using\" keyword resolves ambiguity" >&5 ++echo "configure:12509: checking whether the C++ \"using\" keyword resolves ambiguity" >&5 + if eval "test \"`echo '$''{'ac_cv_cpp_ambiguity_resolving_using'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cpp_ambiguity_resolving_using=yes + else +@@ -12526,7 +12547,7 @@ EOF + fi + + echo $ac_n "checking for C++ dynamic_cast to void*""... $ac_c" 1>&6 +-echo "configure:12530: checking for C++ dynamic_cast to void*" >&5 ++echo "configure:12551: checking for C++ dynamic_cast to void*" >&5 + if eval "test \"`echo '$''{'ac_cv_cpp_dynamic_cast_void_ptr'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -12534,7 +12555,7 @@ else + ac_cv_cpp_dynamic_cast_void_ptr=no + else + cat > conftest.$ac_ext <(suby)))); + } + EOF +-if { (eval echo configure:12554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:12575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_cpp_dynamic_cast_void_ptr=yes + else +@@ -12574,19 +12595,19 @@ fi + + + echo $ac_n "checking whether C++ requires implementation of unused virtual methods""... $ac_c" 1>&6 +-echo "configure:12578: checking whether C++ requires implementation of unused virtual methods" >&5 ++echo "configure:12599: checking whether C++ requires implementation of unused virtual methods" >&5 + if eval "test \"`echo '$''{'ac_cv_cpp_unused_required'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:12611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_cpp_unused_required=no + else +@@ -12609,12 +12630,12 @@ fi + + + echo $ac_n "checking for trouble comparing to zero near std::operator!=()""... $ac_c" 1>&6 +-echo "configure:12613: checking for trouble comparing to zero near std::operator!=()" >&5 ++echo "configure:12634: checking for trouble comparing to zero near std::operator!=()" >&5 + if eval "test \"`echo '$''{'ac_cv_trouble_comparing_to_zero'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + template class Foo {}; +@@ -12625,7 +12646,7 @@ int main() { + Foo f; return (0 != f); + ; return 0; } + EOF +-if { (eval echo configure:12629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_trouble_comparing_to_zero=no + else +@@ -12652,19 +12673,19 @@ fi + _SAVE_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS" + echo $ac_n "checking for __thread keyword for TLS variables""... $ac_c" 1>&6 +-echo "configure:12656: checking for __thread keyword for TLS variables" >&5 ++echo "configure:12677: checking for __thread keyword for TLS variables" >&5 + if eval "test \"`echo '$''{'ac_cv_thread_keyword'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:12689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_thread_keyword=yes + else +@@ -12701,19 +12722,19 @@ fi + MALLOC_H= + ac_safe=`echo "malloc.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for malloc.h""... $ac_c" 1>&6 +-echo "configure:12705: checking for malloc.h" >&5 ++echo "configure:12726: checking for malloc.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:12717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -12736,19 +12757,19 @@ fi + if test "$MALLOC_H" = ""; then + ac_safe=`echo "malloc/malloc.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for malloc/malloc.h""... $ac_c" 1>&6 +-echo "configure:12740: checking for malloc/malloc.h" >&5 ++echo "configure:12761: checking for malloc/malloc.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:12752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -12771,19 +12792,19 @@ fi + if test "$MALLOC_H" = ""; then + ac_safe=`echo "sys/malloc.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for sys/malloc.h""... $ac_c" 1>&6 +-echo "configure:12775: checking for sys/malloc.h" >&5 ++echo "configure:12796: checking for sys/malloc.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:12787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -12816,12 +12837,12 @@ MOZ_ALLOCATING_FUNCS="strndup posix_memalign memalign valloc" + for ac_func in strndup posix_memalign memalign valloc + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:12820: checking for $ac_func" >&5 ++echo "configure:12841: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:12872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -12874,19 +12895,19 @@ done + + + echo $ac_n "checking for __attribute__((always_inline))""... $ac_c" 1>&6 +-echo "configure:12878: checking for __attribute__((always_inline))" >&5 ++echo "configure:12899: checking for __attribute__((always_inline))" >&5 + if eval "test \"`echo '$''{'ac_cv_attribute_always_inline'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_attribute_always_inline=yes + else +@@ -12901,19 +12922,19 @@ fi + echo "$ac_t""$ac_cv_attribute_always_inline" 1>&6 + + echo $ac_n "checking for __attribute__((malloc))""... $ac_c" 1>&6 +-echo "configure:12905: checking for __attribute__((malloc))" >&5 ++echo "configure:12926: checking for __attribute__((malloc))" >&5 + if eval "test \"`echo '$''{'ac_cv_attribute_malloc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_attribute_malloc=yes + else +@@ -12928,19 +12949,19 @@ fi + echo "$ac_t""$ac_cv_attribute_malloc" 1>&6 + + echo $ac_n "checking for __attribute__((warn_unused_result))""... $ac_c" 1>&6 +-echo "configure:12932: checking for __attribute__((warn_unused_result))" >&5 ++echo "configure:12953: checking for __attribute__((warn_unused_result))" >&5 + if eval "test \"`echo '$''{'ac_cv_attribute_warn_unused'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_attribute_warn_unused=yes + else +@@ -12955,19 +12976,19 @@ fi + echo "$ac_t""$ac_cv_attribute_warn_unused" 1>&6 + + echo $ac_n "checking for __attribute__((noreturn))""... $ac_c" 1>&6 +-echo "configure:12959: checking for __attribute__((noreturn))" >&5 ++echo "configure:12980: checking for __attribute__((noreturn))" >&5 + if eval "test \"`echo '$''{'ac_cv_attribute_noreturn'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:12992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_attribute_noreturn=yes + else +@@ -12991,19 +13012,19 @@ cross_compiling=$ac_cv_prog_cc_cross + + + echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 +-echo "configure:12995: checking for LC_MESSAGES" >&5 ++echo "configure:13016: checking for LC_MESSAGES" >&5 + if eval "test \"`echo '$''{'ac_cv_i18n_lc_messages'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + int category = LC_MESSAGES; + ; return 0; } + EOF +-if { (eval echo configure:13007: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:13028: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_i18n_lc_messages=yes + else +@@ -13026,12 +13047,12 @@ fi + for ac_func in localeconv + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:13030: checking for $ac_func" >&5 ++echo "configure:13051: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:13079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -13173,6 +13194,7 @@ fi + + if test -n "$LIBXUL_SDK"; then + LIBXUL_DIST="$LIBXUL_SDK" ++ SKIP_LIBRARY_CHECKS=1 + else + LIBXUL_DIST="$MOZ_BUILD_ROOT/dist" + fi +@@ -13243,7 +13265,7 @@ fi + # Extract the first word of "nspr-config", so it can be a program name with args. + set dummy nspr-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:13247: checking for $ac_word" >&5 ++echo "configure:13269: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_NSPR_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -13278,7 +13300,7 @@ fi + + min_nspr_version=4.8.8 + echo $ac_n "checking for NSPR - version >= $min_nspr_version""... $ac_c" 1>&6 +-echo "configure:13282: checking for NSPR - version >= $min_nspr_version" >&5 ++echo "configure:13304: checking for NSPR - version >= $min_nspr_version" >&5 + + no_nspr="" + if test "$NSPR_CONFIG" != "no"; then +@@ -13337,7 +13359,7 @@ if test -n "$MOZ_NATIVE_NSPR"; then + _SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $NSPR_CFLAGS" + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:13372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + MOZ_NATIVE_NSPR=1 + else +@@ -13358,6 +13380,10 @@ fi + rm -f conftest* + CFLAGS=$_SAVE_CFLAGS + else ++ if test -n "$LIBXUL_SDK"; then ++ NSPR_CFLAGS="-I$LIBXUL_SDK_DIR/sdk/include" ++ NSPR_LIBS="-L$LIBXUL_SDK_DIR/sdk/lib -lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION" ++ else + if test "$OS_ARCH" = "WINNT"; then + NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr" + if test -n "$GNU_CC"; then +@@ -13369,6 +13395,7 @@ else + NSPR_CFLAGS='`$(LIBXUL_DIST)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`' + NSPR_LIBS='`$(LIBXUL_DIST)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`' + fi ++ fi + fi + + # Check whether --with-system-libevent or --without-system-libevent was given. +@@ -13391,19 +13418,19 @@ else + LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS" + ac_safe=`echo "event.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for event.h""... $ac_c" 1>&6 +-echo "configure:13395: checking for event.h" >&5 ++echo "configure:13422: checking for event.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:13407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:13434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -13426,7 +13453,7 @@ fi + fi + + echo $ac_n "checking for event_init in -levent""... $ac_c" 1>&6 +-echo "configure:13430: checking for event_init in -levent" >&5 ++echo "configure:13457: checking for event_init in -levent" >&5 + ac_lib_var=`echo event'_'event_init | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -13434,7 +13461,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-levent $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:13476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -13528,7 +13555,7 @@ fi + # Extract the first word of "nss-config", so it can be a program name with args. + set dummy nss-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:13532: checking for $ac_word" >&5 ++echo "configure:13559: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_NSS_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -13563,7 +13590,7 @@ fi + + min_nss_version=3.13.1 + echo $ac_n "checking for NSS - version >= $min_nss_version""... $ac_c" 1>&6 +-echo "configure:13567: checking for NSS - version >= $min_nss_version" >&5 ++echo "configure:13594: checking for NSS - version >= $min_nss_version" >&5 + + no_nss="" + if test "$NSS_CONFIG" = "no"; then +@@ -13636,13 +13663,13 @@ fi + + + echo $ac_n "checking for YASM assembler""... $ac_c" 1>&6 +-echo "configure:13640: checking for YASM assembler" >&5 ++echo "configure:13667: checking for YASM assembler" >&5 + for ac_prog in yasm + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:13646: checking for $ac_word" >&5 ++echo "configure:13673: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_YASM'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -13704,7 +13731,7 @@ if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then + SYSTEM_JPEG= + else + echo $ac_n "checking for jpeg_destroy_compress in -ljpeg""... $ac_c" 1>&6 +-echo "configure:13708: checking for jpeg_destroy_compress in -ljpeg" >&5 ++echo "configure:13735: checking for jpeg_destroy_compress in -ljpeg" >&5 + ac_lib_var=`echo jpeg'_'jpeg_destroy_compress | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -13712,7 +13739,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-ljpeg $JPEG_LIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:13754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -13746,10 +13773,10 @@ fi + + fi + +-if test "$SYSTEM_JPEG" = 1; then ++if test "$SYSTEM_JPEG" = 0; then + LIBS="$JPEG_LIBS $LIBS" + cat > conftest.$ac_ext < + #include +@@ -13760,7 +13787,7 @@ int main() { + #endif + ; return 0; } + EOF +-if { (eval echo configure:13764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:13791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + SYSTEM_JPEG=1 + else +@@ -13798,7 +13825,7 @@ if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then + SYSTEM_ZLIB= + else + echo $ac_n "checking for gzread in -lz""... $ac_c" 1>&6 +-echo "configure:13802: checking for gzread in -lz" >&5 ++echo "configure:13829: checking for gzread in -lz" >&5 + ac_lib_var=`echo z'_'gzread | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -13806,7 +13833,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lz $ZLIB_LIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:13848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -13839,10 +13866,10 @@ SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS= + fi + + fi +-if test "$SYSTEM_ZLIB" = 1; then ++if test "$SYSTEM_ZLIB" = 0; then + LIBS="$ZLIB_LIBS $LIBS" + cat > conftest.$ac_ext < + #include +@@ -13853,7 +13880,7 @@ int main() { + #endif + ; return 0; } + EOF +-if { (eval echo configure:13857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:13884: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + SYSTEM_ZLIB=1 + else +@@ -13891,7 +13918,7 @@ if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then + SYSTEM_BZ2= + else + echo $ac_n "checking for BZ2_bzread in -lbz2""... $ac_c" 1>&6 +-echo "configure:13895: checking for BZ2_bzread in -lbz2" >&5 ++echo "configure:13922: checking for BZ2_bzread in -lbz2" >&5 + ac_lib_var=`echo bz2'_'BZ2_bzread | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -13899,7 +13926,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lbz2 $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:13941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -13962,7 +13989,7 @@ if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then + else + _SAVE_PNG_LIBS=$PNG_LIBS + echo $ac_n "checking for png_get_valid in -lpng""... $ac_c" 1>&6 +-echo "configure:13966: checking for png_get_valid in -lpng" >&5 ++echo "configure:13993: checking for png_get_valid in -lpng" >&5 + ac_lib_var=`echo png'_'png_get_valid | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -13970,7 +13997,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lpng $PNG_LIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -14003,7 +14030,7 @@ else + fi + + echo $ac_n "checking for png_get_acTL in -lpng""... $ac_c" 1>&6 +-echo "configure:14007: checking for png_get_acTL in -lpng" >&5 ++echo "configure:14034: checking for png_get_acTL in -lpng" >&5 + ac_lib_var=`echo png'_'png_get_acTL | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -14011,7 +14038,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lpng $_SAVE_PNG_LIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:14053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -14051,10 +14078,10 @@ else + fi + + fi +-if test "$SYSTEM_PNG" = 1; then ++if test "$SYSTEM_PNG" = 0; then + LIBS="$PNG_LIBS $LIBS" + cat > conftest.$ac_ext < + #include +@@ -14068,7 +14095,7 @@ int main() { + #endif + ; return 0; } + EOF +-if { (eval echo configure:14072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:14099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + SYSTEM_PNG=1 + else +@@ -14110,7 +14137,7 @@ if test -n "$SYSTEM_HUNSPELL"; then + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:14114: checking for $ac_word" >&5 ++echo "configure:14141: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -14154,19 +14181,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for hunspell""... $ac_c" 1>&6 +-echo "configure:14158: checking for hunspell" >&5 ++echo "configure:14185: checking for hunspell" >&5 + + if $PKG_CONFIG --exists "hunspell" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_HUNSPELL_CFLAGS""... $ac_c" 1>&6 +-echo "configure:14165: checking MOZ_HUNSPELL_CFLAGS" >&5 ++echo "configure:14192: checking MOZ_HUNSPELL_CFLAGS" >&5 + MOZ_HUNSPELL_CFLAGS=`$PKG_CONFIG --cflags "hunspell"` + echo "$ac_t""$MOZ_HUNSPELL_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_HUNSPELL_LIBS""... $ac_c" 1>&6 +-echo "configure:14170: checking MOZ_HUNSPELL_LIBS" >&5 ++echo "configure:14197: checking MOZ_HUNSPELL_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_HUNSPELL_LIBS="`$PKG_CONFIG --libs \"hunspell\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_HUNSPELL_LIBS" 1>&6 +@@ -14222,7 +14249,7 @@ if test -n "$MOZ_NATIVE_FFI"; then + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:14226: checking for $ac_word" >&5 ++echo "configure:14253: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -14266,19 +14293,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for libffi > 3.0.9""... $ac_c" 1>&6 +-echo "configure:14270: checking for libffi > 3.0.9" >&5 ++echo "configure:14297: checking for libffi > 3.0.9" >&5 + + if $PKG_CONFIG --exists "libffi > 3.0.9" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_FFI_CFLAGS""... $ac_c" 1>&6 +-echo "configure:14277: checking MOZ_FFI_CFLAGS" >&5 ++echo "configure:14304: checking MOZ_FFI_CFLAGS" >&5 + MOZ_FFI_CFLAGS=`$PKG_CONFIG --cflags "libffi > 3.0.9"` + echo "$ac_t""$MOZ_FFI_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_FFI_LIBS""... $ac_c" 1>&6 +-echo "configure:14282: checking MOZ_FFI_LIBS" >&5 ++echo "configure:14309: checking MOZ_FFI_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_FFI_LIBS="`$PKG_CONFIG --libs \"libffi > 3.0.9\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_FFI_LIBS" 1>&6 +@@ -14314,7 +14341,7 @@ echo "configure:14282: checking MOZ_FFI_LIBS" >&5 + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:14318: checking for $ac_word" >&5 ++echo "configure:14345: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -14358,19 +14385,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for libffi >= 3.0.9""... $ac_c" 1>&6 +-echo "configure:14362: checking for libffi >= 3.0.9" >&5 ++echo "configure:14389: checking for libffi >= 3.0.9" >&5 + + if $PKG_CONFIG --exists "libffi >= 3.0.9" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_FFI_CFLAGS""... $ac_c" 1>&6 +-echo "configure:14369: checking MOZ_FFI_CFLAGS" >&5 ++echo "configure:14396: checking MOZ_FFI_CFLAGS" >&5 + MOZ_FFI_CFLAGS=`$PKG_CONFIG --cflags "libffi >= 3.0.9"` + echo "$ac_t""$MOZ_FFI_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_FFI_LIBS""... $ac_c" 1>&6 +-echo "configure:14374: checking MOZ_FFI_LIBS" >&5 ++echo "configure:14401: checking MOZ_FFI_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_FFI_LIBS="`$PKG_CONFIG --libs \"libffi >= 3.0.9\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_FFI_LIBS" 1>&6 +@@ -14542,7 +14569,7 @@ fi + + + echo $ac_n "checking for application to build""... $ac_c" 1>&6 +-echo "configure:14546: checking for application to build" >&5 ++echo "configure:14573: checking for application to build" >&5 + if test -z "$MOZ_BUILD_APP"; then + echo "$ac_t""browser" 1>&6 + MOZ_BUILD_APP=browser +@@ -14560,7 +14587,7 @@ fi + # Allow the application to influence configure with a confvars.sh script. + + echo $ac_n "checking if app-specific confvars.sh exists""... $ac_c" 1>&6 +-echo "configure:14564: checking if app-specific confvars.sh exists" >&5 ++echo "configure:14591: checking if app-specific confvars.sh exists" >&5 + if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then + echo "$ac_t""${srcdir}/${MOZ_BUILD_APP}/confvars.sh" 1>&6 + . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" +@@ -14828,7 +14855,7 @@ if test "$COMPILE_ENVIRONMENT"; then + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:14832: checking for $ac_word" >&5 ++echo "configure:14859: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -14872,19 +14899,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for directfb >= 1.1.0""... $ac_c" 1>&6 +-echo "configure:14876: checking for directfb >= 1.1.0" >&5 ++echo "configure:14903: checking for directfb >= 1.1.0" >&5 + + if $PKG_CONFIG --exists "directfb >= 1.1.0" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_DFB_CFLAGS""... $ac_c" 1>&6 +-echo "configure:14883: checking MOZ_DFB_CFLAGS" >&5 ++echo "configure:14910: checking MOZ_DFB_CFLAGS" >&5 + MOZ_DFB_CFLAGS=`$PKG_CONFIG --cflags "directfb >= 1.1.0"` + echo "$ac_t""$MOZ_DFB_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_DFB_LIBS""... $ac_c" 1>&6 +-echo "configure:14888: checking MOZ_DFB_LIBS" >&5 ++echo "configure:14915: checking MOZ_DFB_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_DFB_LIBS="`$PKG_CONFIG --libs \"directfb >= 1.1.0\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_DFB_LIBS" 1>&6 +@@ -14922,7 +14949,7 @@ echo "configure:14888: checking MOZ_DFB_LIBS" >&5 + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:14926: checking for $ac_word" >&5 ++echo "configure:14953: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -14966,19 +14993,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES""... $ac_c" 1>&6 +-echo "configure:14970: checking for gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES" >&5 ++echo "configure:14997: checking for gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES" >&5 + + if $PKG_CONFIG --exists "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_GTK2_CFLAGS""... $ac_c" 1>&6 +-echo "configure:14977: checking MOZ_GTK2_CFLAGS" >&5 ++echo "configure:15004: checking MOZ_GTK2_CFLAGS" >&5 + MOZ_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES"` + echo "$ac_t""$MOZ_GTK2_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_GTK2_LIBS""... $ac_c" 1>&6 +-echo "configure:14982: checking MOZ_GTK2_LIBS" >&5 ++echo "configure:15009: checking MOZ_GTK2_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_GTK2_LIBS="`$PKG_CONFIG --libs \"gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_GTK2_LIBS" 1>&6 +@@ -15033,6 +15060,7 @@ EOF + fi + + ++if test -z "$LIBXUL_SDK"; then + if test "$MOZ_ENABLE_GTK2" + then + MOZ_ENABLE_STARTUP_NOTIFICATION= +@@ -15057,7 +15085,7 @@ fi + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:15061: checking for $ac_word" >&5 ++echo "configure:15089: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -15101,19 +15129,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION""... $ac_c" 1>&6 +-echo "configure:15105: checking for libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION" >&5 ++echo "configure:15133: checking for libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION" >&5 + + if $PKG_CONFIG --exists "libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_STARTUP_NOTIFICATION_CFLAGS""... $ac_c" 1>&6 +-echo "configure:15112: checking MOZ_STARTUP_NOTIFICATION_CFLAGS" >&5 ++echo "configure:15140: checking MOZ_STARTUP_NOTIFICATION_CFLAGS" >&5 + MOZ_STARTUP_NOTIFICATION_CFLAGS=`$PKG_CONFIG --cflags "libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION"` + echo "$ac_t""$MOZ_STARTUP_NOTIFICATION_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_STARTUP_NOTIFICATION_LIBS""... $ac_c" 1>&6 +-echo "configure:15117: checking MOZ_STARTUP_NOTIFICATION_LIBS" >&5 ++echo "configure:15145: checking MOZ_STARTUP_NOTIFICATION_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_STARTUP_NOTIFICATION_LIBS="`$PKG_CONFIG --libs \"libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_STARTUP_NOTIFICATION_LIBS" 1>&6 +@@ -15159,6 +15187,7 @@ EOF + + TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS" + fi ++fi + + + +@@ -15179,7 +15208,7 @@ fi + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:15183: checking for $ac_word" >&5 ++echo "configure:15212: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -15223,19 +15252,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for QtGui QtNetwork QtCore QtOpenGL""... $ac_c" 1>&6 +-echo "configure:15227: checking for QtGui QtNetwork QtCore QtOpenGL" >&5 ++echo "configure:15256: checking for QtGui QtNetwork QtCore QtOpenGL" >&5 + + if $PKG_CONFIG --exists "QtGui QtNetwork QtCore QtOpenGL" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_QT_CFLAGS""... $ac_c" 1>&6 +-echo "configure:15234: checking MOZ_QT_CFLAGS" >&5 ++echo "configure:15263: checking MOZ_QT_CFLAGS" >&5 + MOZ_QT_CFLAGS=`$PKG_CONFIG --cflags "QtGui QtNetwork QtCore QtOpenGL"` + echo "$ac_t""$MOZ_QT_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_QT_LIBS""... $ac_c" 1>&6 +-echo "configure:15239: checking MOZ_QT_LIBS" >&5 ++echo "configure:15268: checking MOZ_QT_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_QT_LIBS="`$PKG_CONFIG --libs \"QtGui QtNetwork QtCore QtOpenGL\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_QT_LIBS" 1>&6 +@@ -15269,7 +15298,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:15273: checking for $ac_word" >&5 ++echo "configure:15302: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_HOST_MOC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -15324,7 +15353,7 @@ incorrect" 1>&2; exit 1; } + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:15328: checking for $ac_word" >&5 ++echo "configure:15357: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -15368,19 +15397,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for qmsystem2""... $ac_c" 1>&6 +-echo "configure:15372: checking for qmsystem2" >&5 ++echo "configure:15401: checking for qmsystem2" >&5 + + if $PKG_CONFIG --exists "qmsystem2" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking _QMSYSTEM2_CFLAGS""... $ac_c" 1>&6 +-echo "configure:15379: checking _QMSYSTEM2_CFLAGS" >&5 ++echo "configure:15408: checking _QMSYSTEM2_CFLAGS" >&5 + _QMSYSTEM2_CFLAGS=`$PKG_CONFIG --cflags "qmsystem2"` + echo "$ac_t""$_QMSYSTEM2_CFLAGS" 1>&6 + + echo $ac_n "checking _QMSYSTEM2_LIBS""... $ac_c" 1>&6 +-echo "configure:15384: checking _QMSYSTEM2_LIBS" >&5 ++echo "configure:15413: checking _QMSYSTEM2_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + _QMSYSTEM2_LIBS="`$PKG_CONFIG --libs \"qmsystem2\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$_QMSYSTEM2_LIBS" 1>&6 +@@ -15427,7 +15456,7 @@ EOF + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:15431: checking for $ac_word" >&5 ++echo "configure:15460: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -15471,19 +15500,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for QtNetwork >= 4.7""... $ac_c" 1>&6 +-echo "configure:15475: checking for QtNetwork >= 4.7" >&5 ++echo "configure:15504: checking for QtNetwork >= 4.7" >&5 + + if $PKG_CONFIG --exists "QtNetwork >= 4.7" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking _QTNETWORK_CFLAGS""... $ac_c" 1>&6 +-echo "configure:15482: checking _QTNETWORK_CFLAGS" >&5 ++echo "configure:15511: checking _QTNETWORK_CFLAGS" >&5 + _QTNETWORK_CFLAGS=`$PKG_CONFIG --cflags "QtNetwork >= 4.7"` + echo "$ac_t""$_QTNETWORK_CFLAGS" 1>&6 + + echo $ac_n "checking _QTNETWORK_LIBS""... $ac_c" 1>&6 +-echo "configure:15487: checking _QTNETWORK_LIBS" >&5 ++echo "configure:15516: checking _QTNETWORK_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + _QTNETWORK_LIBS="`$PKG_CONFIG --libs \"QtNetwork >= 4.7\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$_QTNETWORK_LIBS" 1>&6 +@@ -15528,7 +15557,7 @@ EOF + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:15532: checking for $ac_word" >&5 ++echo "configure:15561: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -15572,19 +15601,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for QtSensors QtFeedback QtLocation""... $ac_c" 1>&6 +-echo "configure:15576: checking for QtSensors QtFeedback QtLocation" >&5 ++echo "configure:15605: checking for QtSensors QtFeedback QtLocation" >&5 + + if $PKG_CONFIG --exists "QtSensors QtFeedback QtLocation" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking _QTMOBILITY_CFLAGS""... $ac_c" 1>&6 +-echo "configure:15583: checking _QTMOBILITY_CFLAGS" >&5 ++echo "configure:15612: checking _QTMOBILITY_CFLAGS" >&5 + _QTMOBILITY_CFLAGS=`$PKG_CONFIG --cflags "QtSensors QtFeedback QtLocation"` + echo "$ac_t""$_QTMOBILITY_CFLAGS" 1>&6 + + echo $ac_n "checking _QTMOBILITY_LIBS""... $ac_c" 1>&6 +-echo "configure:15588: checking _QTMOBILITY_LIBS" >&5 ++echo "configure:15617: checking _QTMOBILITY_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + _QTMOBILITY_LIBS="`$PKG_CONFIG --libs \"QtSensors QtFeedback QtLocation\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$_QTMOBILITY_LIBS" 1>&6 +@@ -15619,7 +15648,7 @@ echo "configure:15588: checking _QTMOBILITY_LIBS" >&5 + MOZ_QT_LIBS="$MOZ_QT_LIBS $_QTMOBILITY_LIBS" + else + echo $ac_n "checking for main in -lQtSensors""... $ac_c" 1>&6 +-echo "configure:15623: checking for main in -lQtSensors" >&5 ++echo "configure:15652: checking for main in -lQtSensors" >&5 + ac_lib_var=`echo QtSensors'_'main | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -15627,14 +15656,14 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lQtSensors $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:15667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -15689,6 +15718,15 @@ fi + + + ++if test "$MOZ_ENABLE_GTK2" && test -z "$LIBXUL_SDK" ++then ++ cat >> confdefs.h <<\EOF ++#define MOZ_X11 1 ++EOF ++ ++ MOZ_X11=1 ++fi ++ + + # Components and Features + +@@ -15778,7 +15816,7 @@ if test "${enable_pango+set}" = set; then + fi + + +-if test "$MOZ_ENABLE_GTK2" ++if test "$MOZ_ENABLE_GTK2" && test -z "$LIBXUL_SDK" + then + + +@@ -15788,7 +15826,7 @@ then + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:15792: checking for $ac_word" >&5 ++echo "configure:15830: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -15832,19 +15870,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for pango >= $PANGO_VERSION""... $ac_c" 1>&6 +-echo "configure:15836: checking for pango >= $PANGO_VERSION" >&5 ++echo "configure:15874: checking for pango >= $PANGO_VERSION" >&5 + + if $PKG_CONFIG --exists "pango >= $PANGO_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking _PANGOCHK_CFLAGS""... $ac_c" 1>&6 +-echo "configure:15843: checking _PANGOCHK_CFLAGS" >&5 ++echo "configure:15881: checking _PANGOCHK_CFLAGS" >&5 + _PANGOCHK_CFLAGS=`$PKG_CONFIG --cflags "pango >= $PANGO_VERSION"` + echo "$ac_t""$_PANGOCHK_CFLAGS" 1>&6 + + echo $ac_n "checking _PANGOCHK_LIBS""... $ac_c" 1>&6 +-echo "configure:15848: checking _PANGOCHK_LIBS" >&5 ++echo "configure:15886: checking _PANGOCHK_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + _PANGOCHK_LIBS="`$PKG_CONFIG --libs \"pango >= $PANGO_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$_PANGOCHK_LIBS" 1>&6 +@@ -15880,7 +15918,7 @@ echo "configure:15848: checking _PANGOCHK_LIBS" >&5 + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:15884: checking for $ac_word" >&5 ++echo "configure:15922: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -15924,19 +15962,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION""... $ac_c" 1>&6 +-echo "configure:15928: checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" >&5 ++echo "configure:15966: checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" >&5 + + if $PKG_CONFIG --exists "pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_PANGO_CFLAGS""... $ac_c" 1>&6 +-echo "configure:15935: checking MOZ_PANGO_CFLAGS" >&5 ++echo "configure:15973: checking MOZ_PANGO_CFLAGS" >&5 + MOZ_PANGO_CFLAGS=`$PKG_CONFIG --cflags "pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION"` + echo "$ac_t""$MOZ_PANGO_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_PANGO_LIBS""... $ac_c" 1>&6 +-echo "configure:15940: checking MOZ_PANGO_LIBS" >&5 ++echo "configure:15978: checking MOZ_PANGO_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_PANGO_LIBS="`$PKG_CONFIG --libs \"pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_PANGO_LIBS" 1>&6 +@@ -15980,7 +16018,7 @@ EOF + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:15984: checking for $ac_word" >&5 ++echo "configure:16022: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -16024,19 +16062,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for freetype2 > 6.1.0 fontconfig""... $ac_c" 1>&6 +-echo "configure:16028: checking for freetype2 > 6.1.0 fontconfig" >&5 ++echo "configure:16066: checking for freetype2 > 6.1.0 fontconfig" >&5 + + if $PKG_CONFIG --exists "freetype2 > 6.1.0 fontconfig" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking FT2_CFLAGS""... $ac_c" 1>&6 +-echo "configure:16035: checking FT2_CFLAGS" >&5 ++echo "configure:16073: checking FT2_CFLAGS" >&5 + FT2_CFLAGS=`$PKG_CONFIG --cflags "freetype2 > 6.1.0 fontconfig"` + echo "$ac_t""$FT2_CFLAGS" 1>&6 + + echo $ac_n "checking FT2_LIBS""... $ac_c" 1>&6 +-echo "configure:16040: checking FT2_LIBS" >&5 ++echo "configure:16078: checking FT2_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + FT2_LIBS="`$PKG_CONFIG --libs \"freetype2 > 6.1.0 fontconfig\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$FT2_LIBS" 1>&6 +@@ -16080,7 +16118,7 @@ then + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:16084: checking for $ac_word" >&5 ++echo "configure:16122: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -16124,19 +16162,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION""... $ac_c" 1>&6 +-echo "configure:16128: checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" >&5 ++echo "configure:16166: checking for pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" >&5 + + if $PKG_CONFIG --exists "pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_PANGO_CFLAGS""... $ac_c" 1>&6 +-echo "configure:16135: checking MOZ_PANGO_CFLAGS" >&5 ++echo "configure:16173: checking MOZ_PANGO_CFLAGS" >&5 + MOZ_PANGO_CFLAGS=`$PKG_CONFIG --cflags "pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION"` + echo "$ac_t""$MOZ_PANGO_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_PANGO_LIBS""... $ac_c" 1>&6 +-echo "configure:16140: checking MOZ_PANGO_LIBS" >&5 ++echo "configure:16178: checking MOZ_PANGO_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_PANGO_LIBS="`$PKG_CONFIG --libs \"pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_PANGO_LIBS" 1>&6 +@@ -16180,6 +16218,7 @@ EOF + fi + + ++if test -z "$LIBXUL_SDK"; then + if test "$MOZ_X11" + then + if test "$MOZ_ENABLE_GTK2" +@@ -16209,7 +16248,7 @@ fi + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:16213: checking for $ac_word" >&5 ++echo "configure:16252: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -16253,19 +16292,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION""... $ac_c" 1>&6 +-echo "configure:16257: checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" >&5 ++echo "configure:16296: checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" >&5 + + if $PKG_CONFIG --exists "gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_GNOMEVFS_CFLAGS""... $ac_c" 1>&6 +-echo "configure:16264: checking MOZ_GNOMEVFS_CFLAGS" >&5 ++echo "configure:16303: checking MOZ_GNOMEVFS_CFLAGS" >&5 + MOZ_GNOMEVFS_CFLAGS=`$PKG_CONFIG --cflags "gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION"` + echo "$ac_t""$MOZ_GNOMEVFS_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_GNOMEVFS_LIBS""... $ac_c" 1>&6 +-echo "configure:16269: checking MOZ_GNOMEVFS_LIBS" >&5 ++echo "configure:16308: checking MOZ_GNOMEVFS_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_GNOMEVFS_LIBS="`$PKG_CONFIG --libs \"gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_GNOMEVFS_LIBS" 1>&6 +@@ -16315,7 +16354,7 @@ EOF + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:16319: checking for $ac_word" >&5 ++echo "configure:16358: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -16359,19 +16398,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION""... $ac_c" 1>&6 +-echo "configure:16363: checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" >&5 ++echo "configure:16402: checking for gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" >&5 + + if $PKG_CONFIG --exists "gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_GNOMEVFS_CFLAGS""... $ac_c" 1>&6 +-echo "configure:16370: checking MOZ_GNOMEVFS_CFLAGS" >&5 ++echo "configure:16409: checking MOZ_GNOMEVFS_CFLAGS" >&5 + MOZ_GNOMEVFS_CFLAGS=`$PKG_CONFIG --cflags "gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION"` + echo "$ac_t""$MOZ_GNOMEVFS_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_GNOMEVFS_LIBS""... $ac_c" 1>&6 +-echo "configure:16375: checking MOZ_GNOMEVFS_LIBS" >&5 ++echo "configure:16414: checking MOZ_GNOMEVFS_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_GNOMEVFS_LIBS="`$PKG_CONFIG --libs \"gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_GNOMEVFS_LIBS" 1>&6 +@@ -16430,7 +16469,7 @@ fi + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:16434: checking for $ac_word" >&5 ++echo "configure:16473: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -16474,19 +16513,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for gtk+-2.0 >= 2.14""... $ac_c" 1>&6 +-echo "configure:16478: checking for gtk+-2.0 >= 2.14" >&5 ++echo "configure:16517: checking for gtk+-2.0 >= 2.14" >&5 + + if $PKG_CONFIG --exists "gtk+-2.0 >= 2.14" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking _GTKCHECK_CFLAGS""... $ac_c" 1>&6 +-echo "configure:16485: checking _GTKCHECK_CFLAGS" >&5 ++echo "configure:16524: checking _GTKCHECK_CFLAGS" >&5 + _GTKCHECK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.14"` + echo "$ac_t""$_GTKCHECK_CFLAGS" 1>&6 + + echo $ac_n "checking _GTKCHECK_LIBS""... $ac_c" 1>&6 +-echo "configure:16490: checking _GTKCHECK_LIBS" >&5 ++echo "configure:16529: checking _GTKCHECK_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + _GTKCHECK_LIBS="`$PKG_CONFIG --libs \"gtk+-2.0 >= 2.14\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$_GTKCHECK_LIBS" 1>&6 +@@ -16521,7 +16560,7 @@ echo "configure:16490: checking _GTKCHECK_LIBS" >&5 + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:16525: checking for $ac_word" >&5 ++echo "configure:16564: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -16565,19 +16604,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for gio-2.0 >= $GIO_VERSION""... $ac_c" 1>&6 +-echo "configure:16569: checking for gio-2.0 >= $GIO_VERSION" >&5 ++echo "configure:16608: checking for gio-2.0 >= $GIO_VERSION" >&5 + + if $PKG_CONFIG --exists "gio-2.0 >= $GIO_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_GIO_CFLAGS""... $ac_c" 1>&6 +-echo "configure:16576: checking MOZ_GIO_CFLAGS" >&5 ++echo "configure:16615: checking MOZ_GIO_CFLAGS" >&5 + MOZ_GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 >= $GIO_VERSION"` + echo "$ac_t""$MOZ_GIO_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_GIO_LIBS""... $ac_c" 1>&6 +-echo "configure:16581: checking MOZ_GIO_LIBS" >&5 ++echo "configure:16620: checking MOZ_GIO_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_GIO_LIBS="`$PKG_CONFIG --libs \"gio-2.0 >= $GIO_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_GIO_LIBS" 1>&6 +@@ -16646,7 +16685,7 @@ fi + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:16650: checking for $ac_word" >&5 ++echo "configure:16689: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -16690,19 +16729,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for gconf-2.0 >= $GCONF_VERSION gobject-2.0 ""... $ac_c" 1>&6 +-echo "configure:16694: checking for gconf-2.0 >= $GCONF_VERSION gobject-2.0 " >&5 ++echo "configure:16733: checking for gconf-2.0 >= $GCONF_VERSION gobject-2.0 " >&5 + + if $PKG_CONFIG --exists "gconf-2.0 >= $GCONF_VERSION gobject-2.0 " ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_GCONF_CFLAGS""... $ac_c" 1>&6 +-echo "configure:16701: checking MOZ_GCONF_CFLAGS" >&5 ++echo "configure:16740: checking MOZ_GCONF_CFLAGS" >&5 + MOZ_GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 >= $GCONF_VERSION gobject-2.0 "` + echo "$ac_t""$MOZ_GCONF_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_GCONF_LIBS""... $ac_c" 1>&6 +-echo "configure:16706: checking MOZ_GCONF_LIBS" >&5 ++echo "configure:16745: checking MOZ_GCONF_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_GCONF_LIBS="`$PKG_CONFIG --libs \"gconf-2.0 >= $GCONF_VERSION gobject-2.0 \" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_GCONF_LIBS" 1>&6 +@@ -16780,7 +16819,7 @@ fi + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:16784: checking for $ac_word" >&5 ++echo "configure:16823: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -16824,19 +16863,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for libproxy-1.0""... $ac_c" 1>&6 +-echo "configure:16828: checking for libproxy-1.0" >&5 ++echo "configure:16867: checking for libproxy-1.0" >&5 + + if $PKG_CONFIG --exists "libproxy-1.0" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_LIBPROXY_CFLAGS""... $ac_c" 1>&6 +-echo "configure:16835: checking MOZ_LIBPROXY_CFLAGS" >&5 ++echo "configure:16874: checking MOZ_LIBPROXY_CFLAGS" >&5 + MOZ_LIBPROXY_CFLAGS=`$PKG_CONFIG --cflags "libproxy-1.0"` + echo "$ac_t""$MOZ_LIBPROXY_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_LIBPROXY_LIBS""... $ac_c" 1>&6 +-echo "configure:16840: checking MOZ_LIBPROXY_LIBS" >&5 ++echo "configure:16879: checking MOZ_LIBPROXY_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_LIBPROXY_LIBS="`$PKG_CONFIG --libs \"libproxy-1.0\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_LIBPROXY_LIBS" 1>&6 +@@ -16914,7 +16953,7 @@ then + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:16918: checking for $ac_word" >&5 ++echo "configure:16957: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -16958,19 +16997,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for libnotify >= $LIBNOTIFY_VERSION""... $ac_c" 1>&6 +-echo "configure:16962: checking for libnotify >= $LIBNOTIFY_VERSION" >&5 ++echo "configure:17001: checking for libnotify >= $LIBNOTIFY_VERSION" >&5 + + if $PKG_CONFIG --exists "libnotify >= $LIBNOTIFY_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_LIBNOTIFY_CFLAGS""... $ac_c" 1>&6 +-echo "configure:16969: checking MOZ_LIBNOTIFY_CFLAGS" >&5 ++echo "configure:17008: checking MOZ_LIBNOTIFY_CFLAGS" >&5 + MOZ_LIBNOTIFY_CFLAGS=`$PKG_CONFIG --cflags "libnotify >= $LIBNOTIFY_VERSION"` + echo "$ac_t""$MOZ_LIBNOTIFY_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_LIBNOTIFY_LIBS""... $ac_c" 1>&6 +-echo "configure:16974: checking MOZ_LIBNOTIFY_LIBS" >&5 ++echo "configure:17013: checking MOZ_LIBNOTIFY_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_LIBNOTIFY_LIBS="`$PKG_CONFIG --libs \"libnotify >= $LIBNOTIFY_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_LIBNOTIFY_LIBS" 1>&6 +@@ -17045,7 +17084,7 @@ fi + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:17049: checking for $ac_word" >&5 ++echo "configure:17088: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -17089,19 +17128,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for libgnomeui-2.0 >= $GNOMEUI_VERSION""... $ac_c" 1>&6 +-echo "configure:17093: checking for libgnomeui-2.0 >= $GNOMEUI_VERSION" >&5 ++echo "configure:17132: checking for libgnomeui-2.0 >= $GNOMEUI_VERSION" >&5 + + if $PKG_CONFIG --exists "libgnomeui-2.0 >= $GNOMEUI_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_GNOMEUI_CFLAGS""... $ac_c" 1>&6 +-echo "configure:17100: checking MOZ_GNOMEUI_CFLAGS" >&5 ++echo "configure:17139: checking MOZ_GNOMEUI_CFLAGS" >&5 + MOZ_GNOMEUI_CFLAGS=`$PKG_CONFIG --cflags "libgnomeui-2.0 >= $GNOMEUI_VERSION"` + echo "$ac_t""$MOZ_GNOMEUI_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_GNOMEUI_LIBS""... $ac_c" 1>&6 +-echo "configure:17105: checking MOZ_GNOMEUI_LIBS" >&5 ++echo "configure:17144: checking MOZ_GNOMEUI_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_GNOMEUI_LIBS="`$PKG_CONFIG --libs \"libgnomeui-2.0 >= $GNOMEUI_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_GNOMEUI_LIBS" 1>&6 +@@ -17179,7 +17218,7 @@ fi + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:17183: checking for $ac_word" >&5 ++echo "configure:17222: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -17223,19 +17262,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for dbus-1 >= $DBUS_VERSION""... $ac_c" 1>&6 +-echo "configure:17227: checking for dbus-1 >= $DBUS_VERSION" >&5 ++echo "configure:17266: checking for dbus-1 >= $DBUS_VERSION" >&5 + + if $PKG_CONFIG --exists "dbus-1 >= $DBUS_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_DBUS_CFLAGS""... $ac_c" 1>&6 +-echo "configure:17234: checking MOZ_DBUS_CFLAGS" >&5 ++echo "configure:17273: checking MOZ_DBUS_CFLAGS" >&5 + MOZ_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= $DBUS_VERSION"` + echo "$ac_t""$MOZ_DBUS_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_DBUS_LIBS""... $ac_c" 1>&6 +-echo "configure:17239: checking MOZ_DBUS_LIBS" >&5 ++echo "configure:17278: checking MOZ_DBUS_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_DBUS_LIBS="`$PKG_CONFIG --libs \"dbus-1 >= $DBUS_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_DBUS_LIBS" 1>&6 +@@ -17270,7 +17309,7 @@ echo "configure:17239: checking MOZ_DBUS_LIBS" >&5 + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:17274: checking for $ac_word" >&5 ++echo "configure:17313: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -17314,19 +17353,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for dbus-glib-1 >= $DBUS_VERSION""... $ac_c" 1>&6 +-echo "configure:17318: checking for dbus-glib-1 >= $DBUS_VERSION" >&5 ++echo "configure:17357: checking for dbus-glib-1 >= $DBUS_VERSION" >&5 + + if $PKG_CONFIG --exists "dbus-glib-1 >= $DBUS_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_DBUS_GLIB_CFLAGS""... $ac_c" 1>&6 +-echo "configure:17325: checking MOZ_DBUS_GLIB_CFLAGS" >&5 ++echo "configure:17364: checking MOZ_DBUS_GLIB_CFLAGS" >&5 + MOZ_DBUS_GLIB_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1 >= $DBUS_VERSION"` + echo "$ac_t""$MOZ_DBUS_GLIB_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_DBUS_GLIB_LIBS""... $ac_c" 1>&6 +-echo "configure:17330: checking MOZ_DBUS_GLIB_LIBS" >&5 ++echo "configure:17369: checking MOZ_DBUS_GLIB_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_DBUS_GLIB_LIBS="`$PKG_CONFIG --libs \"dbus-glib-1 >= $DBUS_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_DBUS_GLIB_LIBS" 1>&6 +@@ -17367,6 +17406,9 @@ fi + + + ++fi # LIBXUL_SDK ++ ++ + # Check whether --enable-crypto or --disable-crypto was given. + if test "${enable_crypto+set}" = set; then + enableval="$enable_crypto" +@@ -17556,7 +17598,7 @@ EOF + esac + + echo $ac_n "checking __attribute__ ((aligned ())) support""... $ac_c" 1>&6 +-echo "configure:17560: checking __attribute__ ((aligned ())) support" >&5 ++echo "configure:17602: checking __attribute__ ((aligned ())) support" >&5 + if eval "test \"`echo '$''{'ac_cv_c_attribute_aligned'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -17566,14 +17608,14 @@ else + for ac_cv_c_attr_align_try in 64 32 16 8; do + echo "trying $ac_cv_c_attr_align_try" + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}" + else +@@ -17651,19 +17693,19 @@ EOF + MOZ_NATIVE_LIBVPX_DEC_TEST= + ac_safe=`echo "vpx/vpx_decoder.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for vpx/vpx_decoder.h""... $ac_c" 1>&6 +-echo "configure:17655: checking for vpx/vpx_decoder.h" >&5 ++echo "configure:17697: checking for vpx/vpx_decoder.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:17667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -17686,7 +17728,7 @@ fi + fi + + echo $ac_n "checking for vpx_codec_dec_init_ver in -lvpx""... $ac_c" 1>&6 +-echo "configure:17690: checking for vpx_codec_dec_init_ver in -lvpx" >&5 ++echo "configure:17732: checking for vpx_codec_dec_init_ver in -lvpx" >&5 + ac_lib_var=`echo vpx'_'vpx_codec_dec_init_ver | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -17694,7 +17736,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lvpx $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:17751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -17727,14 +17769,14 @@ else + fi + + if test -n "$MOZ_NATIVE_LIBVPX_DEC_TEST" ; then +- echo $ac_n "checking for libvpx version >= v0.9.7""... $ac_c" 1>&6 +-echo "configure:17732: checking for libvpx version >= v0.9.7" >&5 ++ echo $ac_n "checking for libvpx version >= v1.0.0""... $ac_c" 1>&6 ++echo "configure:17774: checking for libvpx version >= v1.0.0" >&5 + cat > conftest.$ac_ext < +- #if !defined(VPX_CODEC_USE_INPUT_PARTITION) ++ #if !defined(VPX_CODEC_USE_INPUT_FRAGMENTS) + #error "test failed." + #endif + +@@ -17742,7 +17784,7 @@ int main() { + return 0; + ; return 0; } + EOF +-if { (eval echo configure:17746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:17788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6 + MOZ_NATIVE_LIBVPX=1 +@@ -17753,7 +17795,7 @@ else + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 +- { echo "configure: error: --with-system-libvpx requested but it is not v0.9.7 or later" 1>&2; exit 1; } ++ { echo "configure: error: --with-system-libvpx requested but it is not v1.0.0 or later" 1>&2; exit 1; } + fi + rm -f conftest* + fi +@@ -17918,6 +17960,7 @@ EOF + fi + + ++if test -z "$LIBXUL_SDK"; then + if test -n "$MOZ_SYDNEYAUDIO"; then + case "$target_os" in + linux*) +@@ -17927,7 +17970,7 @@ linux*) + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:17931: checking for $ac_word" >&5 ++echo "configure:17974: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -17971,19 +18014,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for alsa""... $ac_c" 1>&6 +-echo "configure:17975: checking for alsa" >&5 ++echo "configure:18018: checking for alsa" >&5 + + if $PKG_CONFIG --exists "alsa" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_ALSA_CFLAGS""... $ac_c" 1>&6 +-echo "configure:17982: checking MOZ_ALSA_CFLAGS" >&5 ++echo "configure:18025: checking MOZ_ALSA_CFLAGS" >&5 + MOZ_ALSA_CFLAGS=`$PKG_CONFIG --cflags "alsa"` + echo "$ac_t""$MOZ_ALSA_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_ALSA_LIBS""... $ac_c" 1>&6 +-echo "configure:17987: checking MOZ_ALSA_LIBS" >&5 ++echo "configure:18030: checking MOZ_ALSA_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_ALSA_LIBS="`$PKG_CONFIG --libs \"alsa\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_ALSA_LIBS" 1>&6 +@@ -18016,6 +18059,7 @@ echo "configure:17987: checking MOZ_ALSA_LIBS" >&5 + ;; + esac + fi ++fi + + # Check whether --enable-permissions or --disable-permissions was given. + if test "${enable_permissions+set}" = set; then +@@ -18117,7 +18161,7 @@ fi + # Extract the first word of "java", so it can be a program name with args. + set dummy java; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:18121: checking for $ac_word" >&5 ++echo "configure:18165: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_JAVA'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -18166,7 +18210,7 @@ fi + # Extract the first word of "javac", so it can be a program name with args. + set dummy javac; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:18170: checking for $ac_word" >&5 ++echo "configure:18214: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_JAVAC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -18215,7 +18259,7 @@ fi + # Extract the first word of "jar", so it can be a program name with args. + set dummy jar; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:18219: checking for $ac_word" >&5 ++echo "configure:18263: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_JAR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -18405,7 +18449,7 @@ EOF + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:18409: checking for $ac_word" >&5 ++echo "configure:18453: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -18449,19 +18493,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for gthread-2.0""... $ac_c" 1>&6 +-echo "configure:18453: checking for gthread-2.0" >&5 ++echo "configure:18497: checking for gthread-2.0" >&5 + + if $PKG_CONFIG --exists "gthread-2.0" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_GTHREAD_CFLAGS""... $ac_c" 1>&6 +-echo "configure:18460: checking MOZ_GTHREAD_CFLAGS" >&5 ++echo "configure:18504: checking MOZ_GTHREAD_CFLAGS" >&5 + MOZ_GTHREAD_CFLAGS=`$PKG_CONFIG --cflags "gthread-2.0"` + echo "$ac_t""$MOZ_GTHREAD_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_GTHREAD_LIBS""... $ac_c" 1>&6 +-echo "configure:18465: checking MOZ_GTHREAD_LIBS" >&5 ++echo "configure:18509: checking MOZ_GTHREAD_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_GTHREAD_LIBS="`$PKG_CONFIG --libs \"gthread-2.0\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_GTHREAD_LIBS" 1>&6 +@@ -18497,19 +18541,19 @@ echo "configure:18465: checking MOZ_GTHREAD_LIBS" >&5 + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:18501: checking for $ac_hdr" >&5 ++echo "configure:18545: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:18513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:18557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -18622,13 +18666,13 @@ fi + + if test -n "$LIBJPEG_TURBO_X86_ASM" -o -n "$LIBJPEG_TURBO_X64_ASM" ; then + echo $ac_n "checking for YASM assembler""... $ac_c" 1>&6 +-echo "configure:18626: checking for YASM assembler" >&5 ++echo "configure:18670: checking for YASM assembler" >&5 + for ac_prog in yasm + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:18632: checking for $ac_word" >&5 ++echo "configure:18676: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_LIBJPEG_TURBO_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -18832,7 +18876,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:18836: checking for $ac_word" >&5 ++echo "configure:18880: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_MAKENSISU'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -18891,7 +18935,7 @@ done + MAKENSISU_MINOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $2 }'` + fi + echo $ac_n "checking for Unicode NSIS with major version == $REQ_NSIS_MAJOR_VER and minor version >= $MIN_NSIS_MINOR_VER""... $ac_c" 1>&6 +-echo "configure:18895: checking for Unicode NSIS with major version == $REQ_NSIS_MAJOR_VER and minor version >= $MIN_NSIS_MINOR_VER" >&5 ++echo "configure:18939: checking for Unicode NSIS with major version == $REQ_NSIS_MAJOR_VER and minor version >= $MIN_NSIS_MINOR_VER" >&5 + if test "$MAKENSISU_VER" = "" || + test ! "$MAKENSISU_MAJOR_VER" = "$REQ_NSIS_MAJOR_VER" -o \ + ! "$MAKENSISU_MINOR_VER" -ge $MIN_NSIS_MINOR_VER; then +@@ -18904,13 +18948,13 @@ fi + + + echo $ac_n "checking for tar archiver""... $ac_c" 1>&6 +-echo "configure:18908: checking for tar archiver" >&5 ++echo "configure:18952: checking for tar archiver" >&5 + for ac_prog in gnutar gtar tar + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:18914: checking for $ac_word" >&5 ++echo "configure:18958: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -18947,13 +18991,13 @@ echo "$ac_t""$TAR" 1>&6 + + + echo $ac_n "checking for wget""... $ac_c" 1>&6 +-echo "configure:18951: checking for wget" >&5 ++echo "configure:18995: checking for wget" >&5 + for ac_prog in wget + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:18957: checking for $ac_word" >&5 ++echo "configure:19001: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_WGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -19145,7 +19189,7 @@ else + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:19149: checking for $ac_word" >&5 ++echo "configure:19193: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -19189,19 +19233,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for sqlite3 >= $SQLITE_VERSION""... $ac_c" 1>&6 +-echo "configure:19193: checking for sqlite3 >= $SQLITE_VERSION" >&5 ++echo "configure:19237: checking for sqlite3 >= $SQLITE_VERSION" >&5 + + if $PKG_CONFIG --exists "sqlite3 >= $SQLITE_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking SQLITE_CFLAGS""... $ac_c" 1>&6 +-echo "configure:19200: checking SQLITE_CFLAGS" >&5 ++echo "configure:19244: checking SQLITE_CFLAGS" >&5 + SQLITE_CFLAGS=`$PKG_CONFIG --cflags "sqlite3 >= $SQLITE_VERSION"` + echo "$ac_t""$SQLITE_CFLAGS" 1>&6 + + echo $ac_n "checking SQLITE_LIBS""... $ac_c" 1>&6 +-echo "configure:19205: checking SQLITE_LIBS" >&5 ++echo "configure:19249: checking SQLITE_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + SQLITE_LIBS="`$PKG_CONFIG --libs \"sqlite3 >= $SQLITE_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$SQLITE_LIBS" 1>&6 +@@ -19232,7 +19276,7 @@ echo "configure:19205: checking SQLITE_LIBS" >&5 + + + echo $ac_n "checking for SQLITE_SECURE_DELETE support in system SQLite""... $ac_c" 1>&6 +-echo "configure:19236: checking for SQLITE_SECURE_DELETE support in system SQLite" >&5 ++echo "configure:19280: checking for SQLITE_SECURE_DELETE support in system SQLite" >&5 + _SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $SQLITE_CFLAGS" + _SAVE_LIBS="$LIBS" +@@ -19246,7 +19290,7 @@ else + + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:19303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_sqlite_secure_delete=yes + else +@@ -19278,7 +19322,7 @@ fi + fi + + echo $ac_n "checking for SQLITE_THREADSAFE support in system SQLite""... $ac_c" 1>&6 +-echo "configure:19282: checking for SQLITE_THREADSAFE support in system SQLite" >&5 ++echo "configure:19326: checking for SQLITE_THREADSAFE support in system SQLite" >&5 + _SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $SQLITE_CFLAGS" + _SAVE_LIBS="$LIBS" +@@ -19292,7 +19336,7 @@ else + + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:19349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_sqlite_threadsafe=yes + else +@@ -19324,7 +19368,7 @@ fi + fi + + echo $ac_n "checking for SQLITE_ENABLE_FTS3 support in system SQLite""... $ac_c" 1>&6 +-echo "configure:19328: checking for SQLITE_ENABLE_FTS3 support in system SQLite" >&5 ++echo "configure:19372: checking for SQLITE_ENABLE_FTS3 support in system SQLite" >&5 + _SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $SQLITE_CFLAGS" + _SAVE_LIBS="$LIBS" +@@ -19338,7 +19382,7 @@ else + + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:19395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_sqlite_enable_fts3=yes + else +@@ -19370,7 +19414,7 @@ fi + fi + + echo $ac_n "checking for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite""... $ac_c" 1>&6 +-echo "configure:19374: checking for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite" >&5 ++echo "configure:19418: checking for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite" >&5 + _SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $SQLITE_CFLAGS" + _SAVE_LIBS="$LIBS" +@@ -19384,7 +19428,7 @@ else + + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:19441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_sqlite_enable_unlock_notify=yes + else +@@ -19516,7 +19560,7 @@ if test -n "$MOZ_ENABLE_LIBCONIC"; then + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:19520: checking for $ac_word" >&5 ++echo "configure:19564: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -19560,19 +19604,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for conic""... $ac_c" 1>&6 +-echo "configure:19564: checking for conic" >&5 ++echo "configure:19608: checking for conic" >&5 + + if $PKG_CONFIG --exists "conic" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking LIBCONIC_CFLAGS""... $ac_c" 1>&6 +-echo "configure:19571: checking LIBCONIC_CFLAGS" >&5 ++echo "configure:19615: checking LIBCONIC_CFLAGS" >&5 + LIBCONIC_CFLAGS=`$PKG_CONFIG --cflags "conic"` + echo "$ac_t""$LIBCONIC_CFLAGS" 1>&6 + + echo $ac_n "checking LIBCONIC_LIBS""... $ac_c" 1>&6 +-echo "configure:19576: checking LIBCONIC_LIBS" >&5 ++echo "configure:19620: checking LIBCONIC_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + LIBCONIC_LIBS="`$PKG_CONFIG --libs \"conic\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$LIBCONIC_LIBS" 1>&6 +@@ -19658,19 +19702,19 @@ EOF + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:19662: checking for $ac_hdr" >&5 ++echo "configure:19706: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:19674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:19718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -19697,7 +19741,7 @@ EOF + done + + echo $ac_n "checking for XCompositeRedirectWindow in -lXcomposite""... $ac_c" 1>&6 +-echo "configure:19701: checking for XCompositeRedirectWindow in -lXcomposite" >&5 ++echo "configure:19745: checking for XCompositeRedirectWindow in -lXcomposite" >&5 + ac_lib_var=`echo Xcomposite'_'XCompositeRedirectWindow | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -19705,7 +19749,7 @@ else + ac_save_LIBS="$LIBS" + LIBS="-lXcomposite $XLIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:19764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else +@@ -19746,7 +19790,7 @@ fi + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:19750: checking for $ac_word" >&5 ++echo "configure:19794: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -19790,19 +19834,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for libhildonmime""... $ac_c" 1>&6 +-echo "configure:19794: checking for libhildonmime" >&5 ++echo "configure:19838: checking for libhildonmime" >&5 + + if $PKG_CONFIG --exists "libhildonmime" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking LIBHILDONMIME_CFLAGS""... $ac_c" 1>&6 +-echo "configure:19801: checking LIBHILDONMIME_CFLAGS" >&5 ++echo "configure:19845: checking LIBHILDONMIME_CFLAGS" >&5 + LIBHILDONMIME_CFLAGS=`$PKG_CONFIG --cflags "libhildonmime"` + echo "$ac_t""$LIBHILDONMIME_CFLAGS" 1>&6 + + echo $ac_n "checking LIBHILDONMIME_LIBS""... $ac_c" 1>&6 +-echo "configure:19806: checking LIBHILDONMIME_LIBS" >&5 ++echo "configure:19850: checking LIBHILDONMIME_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + LIBHILDONMIME_LIBS="`$PKG_CONFIG --libs \"libhildonmime\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$LIBHILDONMIME_LIBS" 1>&6 +@@ -19844,7 +19888,7 @@ echo "configure:19806: checking LIBHILDONMIME_LIBS" >&5 + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:19848: checking for $ac_word" >&5 ++echo "configure:19892: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -19888,19 +19932,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for libosso""... $ac_c" 1>&6 +-echo "configure:19892: checking for libosso" >&5 ++echo "configure:19936: checking for libosso" >&5 + + if $PKG_CONFIG --exists "libosso" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking LIBOSSO_CFLAGS""... $ac_c" 1>&6 +-echo "configure:19899: checking LIBOSSO_CFLAGS" >&5 ++echo "configure:19943: checking LIBOSSO_CFLAGS" >&5 + LIBOSSO_CFLAGS=`$PKG_CONFIG --cflags "libosso"` + echo "$ac_t""$LIBOSSO_CFLAGS" 1>&6 + + echo $ac_n "checking LIBOSSO_LIBS""... $ac_c" 1>&6 +-echo "configure:19904: checking LIBOSSO_LIBS" >&5 ++echo "configure:19948: checking LIBOSSO_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + LIBOSSO_LIBS="`$PKG_CONFIG --libs \"libosso\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$LIBOSSO_LIBS" 1>&6 +@@ -19941,7 +19985,7 @@ echo "configure:19904: checking LIBOSSO_LIBS" >&5 + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:19945: checking for $ac_word" >&5 ++echo "configure:19989: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -19985,19 +20029,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for hildon-fm-2""... $ac_c" 1>&6 +-echo "configure:19989: checking for hildon-fm-2" >&5 ++echo "configure:20033: checking for hildon-fm-2" >&5 + + if $PKG_CONFIG --exists "hildon-fm-2" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking LIBHILDONFM_CFLAGS""... $ac_c" 1>&6 +-echo "configure:19996: checking LIBHILDONFM_CFLAGS" >&5 ++echo "configure:20040: checking LIBHILDONFM_CFLAGS" >&5 + LIBHILDONFM_CFLAGS=`$PKG_CONFIG --cflags "hildon-fm-2"` + echo "$ac_t""$LIBHILDONFM_CFLAGS" 1>&6 + + echo $ac_n "checking LIBHILDONFM_LIBS""... $ac_c" 1>&6 +-echo "configure:20001: checking LIBHILDONFM_LIBS" >&5 ++echo "configure:20045: checking LIBHILDONFM_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + LIBHILDONFM_LIBS="`$PKG_CONFIG --libs \"hildon-fm-2\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$LIBHILDONFM_LIBS" 1>&6 +@@ -20041,7 +20085,7 @@ echo "configure:20001: checking LIBHILDONFM_LIBS" >&5 + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:20045: checking for $ac_word" >&5 ++echo "configure:20089: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -20085,19 +20129,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for ContentManager QtSparql""... $ac_c" 1>&6 +-echo "configure:20089: checking for ContentManager QtSparql" >&5 ++echo "configure:20133: checking for ContentManager QtSparql" >&5 + + if $PKG_CONFIG --exists "ContentManager QtSparql" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking LIBCONTENTMANAGER_CFLAGS""... $ac_c" 1>&6 +-echo "configure:20096: checking LIBCONTENTMANAGER_CFLAGS" >&5 ++echo "configure:20140: checking LIBCONTENTMANAGER_CFLAGS" >&5 + LIBCONTENTMANAGER_CFLAGS=`$PKG_CONFIG --cflags "ContentManager QtSparql"` + echo "$ac_t""$LIBCONTENTMANAGER_CFLAGS" 1>&6 + + echo $ac_n "checking LIBCONTENTMANAGER_LIBS""... $ac_c" 1>&6 +-echo "configure:20101: checking LIBCONTENTMANAGER_LIBS" >&5 ++echo "configure:20145: checking LIBCONTENTMANAGER_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + LIBCONTENTMANAGER_LIBS="`$PKG_CONFIG --libs \"ContentManager QtSparql\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$LIBCONTENTMANAGER_LIBS" 1>&6 +@@ -20160,7 +20204,7 @@ fi + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:20164: checking for $ac_word" >&5 ++echo "configure:20208: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -20204,19 +20248,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for contentaction-0.1""... $ac_c" 1>&6 +-echo "configure:20208: checking for contentaction-0.1" >&5 ++echo "configure:20252: checking for contentaction-0.1" >&5 + + if $PKG_CONFIG --exists "contentaction-0.1" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking LIBCONTENTACTION_CFLAGS""... $ac_c" 1>&6 +-echo "configure:20215: checking LIBCONTENTACTION_CFLAGS" >&5 ++echo "configure:20259: checking LIBCONTENTACTION_CFLAGS" >&5 + LIBCONTENTACTION_CFLAGS=`$PKG_CONFIG --cflags "contentaction-0.1"` + echo "$ac_t""$LIBCONTENTACTION_CFLAGS" 1>&6 + + echo $ac_n "checking LIBCONTENTACTION_LIBS""... $ac_c" 1>&6 +-echo "configure:20220: checking LIBCONTENTACTION_LIBS" >&5 ++echo "configure:20264: checking LIBCONTENTACTION_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + LIBCONTENTACTION_LIBS="`$PKG_CONFIG --libs \"contentaction-0.1\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$LIBCONTENTACTION_LIBS" 1>&6 +@@ -20277,7 +20321,7 @@ fi + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:20281: checking for $ac_word" >&5 ++echo "configure:20325: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -20321,19 +20365,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for meegotouchcore""... $ac_c" 1>&6 +-echo "configure:20325: checking for meegotouchcore" >&5 ++echo "configure:20369: checking for meegotouchcore" >&5 + + if $PKG_CONFIG --exists "meegotouchcore" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking MOZ_MEEGOTOUCH_CFLAGS""... $ac_c" 1>&6 +-echo "configure:20332: checking MOZ_MEEGOTOUCH_CFLAGS" >&5 ++echo "configure:20376: checking MOZ_MEEGOTOUCH_CFLAGS" >&5 + MOZ_MEEGOTOUCH_CFLAGS=`$PKG_CONFIG --cflags "meegotouchcore"` + echo "$ac_t""$MOZ_MEEGOTOUCH_CFLAGS" 1>&6 + + echo $ac_n "checking MOZ_MEEGOTOUCH_LIBS""... $ac_c" 1>&6 +-echo "configure:20337: checking MOZ_MEEGOTOUCH_LIBS" >&5 ++echo "configure:20381: checking MOZ_MEEGOTOUCH_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + MOZ_MEEGOTOUCH_LIBS="`$PKG_CONFIG --libs \"meegotouchcore\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$MOZ_MEEGOTOUCH_LIBS" 1>&6 +@@ -20381,7 +20425,7 @@ EOF + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:20385: checking for $ac_word" >&5 ++echo "configure:20429: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -20425,19 +20469,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for liblocation""... $ac_c" 1>&6 +-echo "configure:20429: checking for liblocation" >&5 ++echo "configure:20473: checking for liblocation" >&5 + + if $PKG_CONFIG --exists "liblocation" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking LIBLOCATION_CFLAGS""... $ac_c" 1>&6 +-echo "configure:20436: checking LIBLOCATION_CFLAGS" >&5 ++echo "configure:20480: checking LIBLOCATION_CFLAGS" >&5 + LIBLOCATION_CFLAGS=`$PKG_CONFIG --cflags "liblocation"` + echo "$ac_t""$LIBLOCATION_CFLAGS" 1>&6 + + echo $ac_n "checking LIBLOCATION_LIBS""... $ac_c" 1>&6 +-echo "configure:20441: checking LIBLOCATION_LIBS" >&5 ++echo "configure:20485: checking LIBLOCATION_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + LIBLOCATION_LIBS="`$PKG_CONFIG --libs \"liblocation\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$LIBLOCATION_LIBS" 1>&6 +@@ -20485,7 +20529,7 @@ EOF + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:20489: checking for $ac_word" >&5 ++echo "configure:20533: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -20529,19 +20573,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri""... $ac_c" 1>&6 +-echo "configure:20533: checking for ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri" >&5 ++echo "configure:20577: checking for ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri" >&5 + + if $PKG_CONFIG --exists "ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking LIBMEEGOTOUCHSHARE_CFLAGS""... $ac_c" 1>&6 +-echo "configure:20540: checking LIBMEEGOTOUCHSHARE_CFLAGS" >&5 ++echo "configure:20584: checking LIBMEEGOTOUCHSHARE_CFLAGS" >&5 + LIBMEEGOTOUCHSHARE_CFLAGS=`$PKG_CONFIG --cflags "ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri"` + echo "$ac_t""$LIBMEEGOTOUCHSHARE_CFLAGS" 1>&6 + + echo $ac_n "checking LIBMEEGOTOUCHSHARE_LIBS""... $ac_c" 1>&6 +-echo "configure:20545: checking LIBMEEGOTOUCHSHARE_LIBS" >&5 ++echo "configure:20589: checking LIBMEEGOTOUCHSHARE_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + LIBMEEGOTOUCHSHARE_LIBS="`$PKG_CONFIG --libs \"ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$LIBMEEGOTOUCHSHARE_LIBS" 1>&6 +@@ -20661,18 +20705,18 @@ MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED" + + if test -n "$MOZ_DEBUG"; then + echo $ac_n "checking for valid debug flags""... $ac_c" 1>&6 +-echo "configure:20665: checking for valid debug flags" >&5 ++echo "configure:20709: checking for valid debug flags" >&5 + _SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS" + cat > conftest.$ac_ext < + int main() { + printf("Hello World\n"); + ; return 0; } + EOF +-if { (eval echo configure:20676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:20720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + _results=yes + else +@@ -20757,18 +20801,18 @@ fi + if test "$COMPILE_ENVIRONMENT"; then + if test -n "$MOZ_OPTIMIZE"; then + echo $ac_n "checking for valid optimization flags""... $ac_c" 1>&6 +-echo "configure:20761: checking for valid optimization flags" >&5 ++echo "configure:20805: checking for valid optimization flags" >&5 + _SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS" + cat > conftest.$ac_ext < + int main() { + printf("Hello World\n"); + ; return 0; } + EOF +-if { (eval echo configure:20772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:20816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + _results=yes + else +@@ -20837,7 +20881,7 @@ fi + + if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$MOZ_DISABLE_ICF"; then + echo $ac_n "checking whether the linker supports Identical Code Folding""... $ac_c" 1>&6 +-echo "configure:20841: checking whether the linker supports Identical Code Folding" >&5 ++echo "configure:20885: checking whether the linker supports Identical Code Folding" >&5 + if eval "test \"`echo '$''{'LD_SUPPORTS_ICF'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -20846,7 +20890,7 @@ else + 'int main() {return foo() - bar();}' > conftest.${ac_ext} + # If the linker supports ICF, foo and bar symbols will have + # the same address +- if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS -Wl,--icf=safe -ffunction-sections conftest.${ac_ext} $LIBS 1>&2'; { (eval echo configure:20850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && ++ if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS -Wl,--icf=safe -ffunction-sections conftest.${ac_ext} $LIBS 1>&2'; { (eval echo configure:20894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && + test -s conftest${ac_exeext} && + objdump -t conftest${ac_exeext} | awk '{a[$6] = $1} END {if (a["foo"] && (a["foo"] != a["bar"])) { exit 1 }}'; then + LD_SUPPORTS_ICF=yes +@@ -20867,15 +20911,15 @@ fi + + if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -n "$MOZ_DEBUG_FLAGS"; then + echo $ac_n "checking whether removing dead symbols breaks debugging""... $ac_c" 1>&6 +-echo "configure:20871: checking whether removing dead symbols breaks debugging" >&5 ++echo "configure:20915: checking whether removing dead symbols breaks debugging" >&5 + if eval "test \"`echo '$''{'GC_SECTIONS_BREAKS_DEBUG_RANGES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + echo 'int foo() {return 42;}' \ + 'int bar() {return 1;}' \ + 'int main() {return foo();}' > conftest.${ac_ext} +- if { ac_try='${CC-cc} -o conftest.${ac_objext} $CFLAGS $MOZ_DEBUG_FLAGS -ffunction-sections -c conftest.${ac_ext} 1>&2'; { (eval echo configure:20878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && +- { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS $MOZ_DEBUG_FLAGS -Wl,--gc-sections conftest.${ac_objext} $LIBS 1>&2'; { (eval echo configure:20879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && ++ if { ac_try='${CC-cc} -o conftest.${ac_objext} $CFLAGS $MOZ_DEBUG_FLAGS -ffunction-sections -c conftest.${ac_ext} 1>&2'; { (eval echo configure:20922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && ++ { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS $MOZ_DEBUG_FLAGS -Wl,--gc-sections conftest.${ac_objext} $LIBS 1>&2'; { (eval echo configure:20923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && + test -s conftest${ac_exeext} -a -s conftest.${ac_objext}; then + if test "`$PYTHON "$_topsrcdir"/build/unix/check_debug_ranges.py conftest.${ac_objext} conftest.${ac_ext}`" = \ + "`$PYTHON "$_topsrcdir"/build/unix/check_debug_ranges.py conftest${ac_exeext} conftest.${ac_ext}`"; then +@@ -21007,7 +21051,7 @@ if test "${enable_jemalloc+set}" = set; then + fi + + +-if test "$NS_TRACE_MALLOC"; then ++if test "$NS_TRACE_MALLOC" || test "$LIBXUL_SDK"; then + MOZ_MEMORY= + fi + +@@ -21045,7 +21089,7 @@ EOF + fi + else + echo $ac_n "checking size of int *""... $ac_c" 1>&6 +-echo "configure:21049: checking size of int *" >&5 ++echo "configure:21093: checking size of int *" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_int_p'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -21053,7 +21097,7 @@ else + ac_cv_sizeof_int_p=4 + else + cat > conftest.$ac_ext < + int main() +@@ -21064,7 +21108,7 @@ int main() + return(0); + } + EOF +-if { (eval echo configure:21068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:21112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_sizeof_int_p=`cat conftestval` + else +@@ -21365,7 +21409,7 @@ do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:21369: checking for $ac_word" >&5 ++echo "configure:21413: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_CCACHE'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -21519,12 +21563,12 @@ fi + + if test "$USE_ELF_HACK" = 1; then + echo $ac_n "checking whether linker creates PT_GNU_RELRO segments""... $ac_c" 1>&6 +-echo "configure:21523: checking whether linker creates PT_GNU_RELRO segments" >&5 ++echo "configure:21567: checking whether linker creates PT_GNU_RELRO segments" >&5 + if eval "test \"`echo '$''{'LINK_WITH_PT_GNU_RELRO'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + echo "int main() {return 0;}" > conftest.${ac_ext} +- if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.${ac_ext} $LIBS 1>&2'; { (eval echo configure:21528: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && ++ if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.${ac_ext} $LIBS 1>&2'; { (eval echo configure:21572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && + test -s conftest${ac_exeext}; then + if readelf -l conftest${ac_exeext} | grep GNU_RELRO > /dev/null; then + LINK_WITH_PT_GNU_RELRO=yes +@@ -21652,12 +21696,12 @@ cross_compiling=$ac_cv_prog_cxx_cross + for ac_func in __cxa_demangle + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:21656: checking for $ac_func" >&5 ++echo "configure:21700: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:21731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -21731,19 +21775,19 @@ fi + if test -z "$SKIP_LIBRARY_CHECKS"; then + ac_safe=`echo "unwind.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for unwind.h""... $ac_c" 1>&6 +-echo "configure:21735: checking for unwind.h" >&5 ++echo "configure:21779: checking for unwind.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:21747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:21791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -21760,12 +21804,12 @@ fi + for ac_func in _Unwind_Backtrace + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:21764: checking for $ac_func" >&5 ++echo "configure:21808: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:21836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -21949,7 +21993,7 @@ if test -z "$SKIP_COMPILER_CHECKS"; then + # Compiler Options + + echo $ac_n "checking for gcc -pipe support""... $ac_c" 1>&6 +-echo "configure:21953: checking for gcc -pipe support" >&5 ++echo "configure:21997: checking for gcc -pipe support" >&5 + if test -n "$GNU_CC" -a -n "$GNU_CXX" -a -n "$GNU_AS"; then + echo '#include ' > dummy-hello.c + echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c +@@ -21964,14 +22008,14 @@ if test -n "$GNU_CC" -a -n "$GNU_CXX" -a -n "$GNU_AS"; then + _SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -pipe" + cat > conftest.$ac_ext < + int main() { + printf("Hello World\n"); + ; return 0; } + EOF +-if { (eval echo configure:21975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:22019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + _res_gcc_pipe="yes" + else +@@ -22001,16 +22045,16 @@ _SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction" + + echo $ac_n "checking whether C compiler supports -fprofile-generate""... $ac_c" 1>&6 +-echo "configure:22005: checking whether C compiler supports -fprofile-generate" >&5 ++echo "configure:22049: checking whether C compiler supports -fprofile-generate" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:22058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + PROFILE_GEN_CFLAGS="-fprofile-generate" + result="yes" +@@ -22074,16 +22118,16 @@ if test "$_PEDANTIC"; then + _SAVE_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long" + echo $ac_n "checking whether C++ compiler has -pedantic long long bug""... $ac_c" 1>&6 +-echo "configure:22078: checking whether C++ compiler has -pedantic long long bug" >&5 ++echo "configure:22122: checking whether C++ compiler has -pedantic long long bug" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:22131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + result="no" + else +@@ -22110,12 +22154,12 @@ fi + _SAVE_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}" + echo $ac_n "checking for correct overload resolution with const and templates""... $ac_c" 1>&6 +-echo "configure:22114: checking for correct overload resolution with const and templates" >&5 ++echo "configure:22158: checking for correct overload resolution with const and templates" >&5 + if eval "test \"`echo '$''{'ac_nscap_nonconst_opeq_bug'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < +@@ -22145,7 +22189,7 @@ int main() { + + ; return 0; } + EOF +-if { (eval echo configure:22149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:22193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_nscap_nonconst_opeq_bug="no" + else +@@ -22182,18 +22226,18 @@ cross_compiling=$ac_cv_prog_cc_cross + + + echo $ac_n "checking what kind of list files are supported by the linker""... $ac_c" 1>&6 +-echo "configure:22186: checking what kind of list files are supported by the linker" >&5 ++echo "configure:22230: checking what kind of list files are supported by the linker" >&5 + if eval "test \"`echo '$''{'EXPAND_LIBS_LIST_STYLE'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + echo "int main() {return 0;}" > conftest.${ac_ext} +- if { ac_try='${CC-cc} -o conftest.${OBJ_SUFFIX} -c $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&2'; { (eval echo configure:22191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.${OBJ_SUFFIX}; then ++ if { ac_try='${CC-cc} -o conftest.${OBJ_SUFFIX} -c $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&2'; { (eval echo configure:22235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.${OBJ_SUFFIX}; then + echo "INPUT(conftest.${OBJ_SUFFIX})" > conftest.list +- if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.list $LIBS 1>&2'; { (eval echo configure:22193: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest${ac_exeext}; then ++ if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.list $LIBS 1>&2'; { (eval echo configure:22237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest${ac_exeext}; then + EXPAND_LIBS_LIST_STYLE=linkerscript + else + echo "conftest.${OBJ_SUFFIX}" > conftest.list +- if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&2'; { (eval echo configure:22197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest${ac_exeext}; then ++ if { ac_try='${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&2'; { (eval echo configure:22241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest${ac_exeext}; then + EXPAND_LIBS_LIST_STYLE=list + else + EXPAND_LIBS_LIST_STYLE=none +@@ -22323,7 +22367,7 @@ XPCOM_LIBS="$LIBXUL_LIBS" + # Standalone module options (Not for building Mozilla) + + +-if test -z "$SKIP_PATH_CHECKS"; then ++if test -z "$SKIP_PATH_CHECKS" && test -z "$LIBXUL_SDK"; then + if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then + if test "$MOZ_ENABLE_GTK2" -o "$USE_ELF_DYNSTR_GC" ; then + succeeded=no +@@ -22332,7 +22376,7 @@ if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:22336: checking for $ac_word" >&5 ++echo "configure:22380: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -22376,19 +22420,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for glib-2.0 >= 1.3.7 gobject-2.0""... $ac_c" 1>&6 +-echo "configure:22380: checking for glib-2.0 >= 1.3.7 gobject-2.0" >&5 ++echo "configure:22424: checking for glib-2.0 >= 1.3.7 gobject-2.0" >&5 + + if $PKG_CONFIG --exists "glib-2.0 >= 1.3.7 gobject-2.0" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking GLIB_CFLAGS""... $ac_c" 1>&6 +-echo "configure:22387: checking GLIB_CFLAGS" >&5 ++echo "configure:22431: checking GLIB_CFLAGS" >&5 + GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 1.3.7 gobject-2.0"` + echo "$ac_t""$GLIB_CFLAGS" 1>&6 + + echo $ac_n "checking GLIB_LIBS""... $ac_c" 1>&6 +-echo "configure:22392: checking GLIB_LIBS" >&5 ++echo "configure:22436: checking GLIB_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + GLIB_LIBS="`$PKG_CONFIG --libs \"glib-2.0 >= 1.3.7 gobject-2.0\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$GLIB_LIBS" 1>&6 +@@ -22473,7 +22517,7 @@ fi + # Extract the first word of "glib-config", so it can be a program name with args. + set dummy glib-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:22477: checking for $ac_word" >&5 ++echo "configure:22521: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -22508,7 +22552,7 @@ fi + + min_glib_version=${GLIB_VERSION} + echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6 +-echo "configure:22512: checking for GLIB - version >= $min_glib_version" >&5 ++echo "configure:22556: checking for GLIB - version >= $min_glib_version" >&5 + no_glib="" + if test "$GLIB_CONFIG" = "no" ; then + no_glib=yes +@@ -22531,7 +22575,7 @@ echo "configure:22512: checking for GLIB - version >= $min_glib_version" >&5 + echo $ac_n "cross compiling; assumed OK... $ac_c" + else + cat > conftest.$ac_ext < +@@ -22607,7 +22651,7 @@ main () + } + + EOF +-if { (eval echo configure:22611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:22655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + : + else +@@ -22641,7 +22685,7 @@ fi + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$LIBS $GLIB_LIBS" + cat > conftest.$ac_ext < +@@ -22651,7 +22695,7 @@ int main() { + return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); + ; return 0; } + EOF +-if { (eval echo configure:22655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:22699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GLIB or finding the wrong" +@@ -22739,19 +22783,19 @@ fi + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:22743: checking for $ac_hdr" >&5 ++echo "configure:22787: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:22755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:22799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -22825,19 +22869,19 @@ EOF + + ac_safe=`echo "d3d9.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for d3d9.h""... $ac_c" 1>&6 +-echo "configure:22829: checking for d3d9.h" >&5 ++echo "configure:22873: checking for d3d9.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:22841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:22885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -22861,19 +22905,19 @@ fi + if test -n "$WIN32_D2D_SURFACE_FEATURE"; then + ac_safe=`echo "d3d10.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for d3d10.h""... $ac_c" 1>&6 +-echo "configure:22865: checking for d3d10.h" >&5 ++echo "configure:22909: checking for d3d10.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:22877: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:22921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -22957,7 +23001,7 @@ EOF + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:22961: checking for $ac_word" >&5 ++echo "configure:23005: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -23001,19 +23045,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for pixman-1 >= 0.19.2""... $ac_c" 1>&6 +-echo "configure:23005: checking for pixman-1 >= 0.19.2" >&5 ++echo "configure:23049: checking for pixman-1 >= 0.19.2" >&5 + + if $PKG_CONFIG --exists "pixman-1 >= 0.19.2" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking PIXMAN_CFLAGS""... $ac_c" 1>&6 +-echo "configure:23012: checking PIXMAN_CFLAGS" >&5 ++echo "configure:23056: checking PIXMAN_CFLAGS" >&5 + PIXMAN_CFLAGS=`$PKG_CONFIG --cflags "pixman-1 >= 0.19.2"` + echo "$ac_t""$PIXMAN_CFLAGS" 1>&6 + + echo $ac_n "checking PIXMAN_LIBS""... $ac_c" 1>&6 +-echo "configure:23017: checking PIXMAN_LIBS" >&5 ++echo "configure:23061: checking PIXMAN_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + PIXMAN_LIBS="`$PKG_CONFIG --libs \"pixman-1 >= 0.19.2\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$PIXMAN_LIBS" 1>&6 +@@ -23060,7 +23104,7 @@ else + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:23064: checking for $ac_word" >&5 ++echo "configure:23108: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -23104,19 +23148,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for cairo >= $CAIRO_VERSION pixman-1 freetype2 fontconfig""... $ac_c" 1>&6 +-echo "configure:23108: checking for cairo >= $CAIRO_VERSION pixman-1 freetype2 fontconfig" >&5 ++echo "configure:23152: checking for cairo >= $CAIRO_VERSION pixman-1 freetype2 fontconfig" >&5 + + if $PKG_CONFIG --exists "cairo >= $CAIRO_VERSION pixman-1 freetype2 fontconfig" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking CAIRO_CFLAGS""... $ac_c" 1>&6 +-echo "configure:23115: checking CAIRO_CFLAGS" >&5 ++echo "configure:23159: checking CAIRO_CFLAGS" >&5 + CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo >= $CAIRO_VERSION pixman-1 freetype2 fontconfig"` + echo "$ac_t""$CAIRO_CFLAGS" 1>&6 + + echo $ac_n "checking CAIRO_LIBS""... $ac_c" 1>&6 +-echo "configure:23120: checking CAIRO_LIBS" >&5 ++echo "configure:23164: checking CAIRO_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + CAIRO_LIBS="`$PKG_CONFIG --libs \"cairo >= $CAIRO_VERSION pixman-1 freetype2 fontconfig\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$CAIRO_LIBS" 1>&6 +@@ -23153,7 +23197,7 @@ echo "configure:23120: checking CAIRO_LIBS" >&5 + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:23157: checking for $ac_word" >&5 ++echo "configure:23201: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -23197,19 +23241,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for cairo-tee >= $CAIRO_VERSION""... $ac_c" 1>&6 +-echo "configure:23201: checking for cairo-tee >= $CAIRO_VERSION" >&5 ++echo "configure:23245: checking for cairo-tee >= $CAIRO_VERSION" >&5 + + if $PKG_CONFIG --exists "cairo-tee >= $CAIRO_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking CAIRO_TEE_CFLAGS""... $ac_c" 1>&6 +-echo "configure:23208: checking CAIRO_TEE_CFLAGS" >&5 ++echo "configure:23252: checking CAIRO_TEE_CFLAGS" >&5 + CAIRO_TEE_CFLAGS=`$PKG_CONFIG --cflags "cairo-tee >= $CAIRO_VERSION"` + echo "$ac_t""$CAIRO_TEE_CFLAGS" 1>&6 + + echo $ac_n "checking CAIRO_TEE_LIBS""... $ac_c" 1>&6 +-echo "configure:23213: checking CAIRO_TEE_LIBS" >&5 ++echo "configure:23257: checking CAIRO_TEE_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + CAIRO_TEE_LIBS="`$PKG_CONFIG --libs \"cairo-tee >= $CAIRO_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$CAIRO_TEE_LIBS" 1>&6 +@@ -23245,7 +23289,7 @@ echo "configure:23213: checking CAIRO_TEE_LIBS" >&5 + # Extract the first word of "pkg-config", so it can be a program name with args. + set dummy pkg-config; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:23249: checking for $ac_word" >&5 ++echo "configure:23293: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -23289,19 +23333,19 @@ fi + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo $ac_n "checking for cairo-xlib-xrender >= $CAIRO_VERSION""... $ac_c" 1>&6 +-echo "configure:23293: checking for cairo-xlib-xrender >= $CAIRO_VERSION" >&5 ++echo "configure:23337: checking for cairo-xlib-xrender >= $CAIRO_VERSION" >&5 + + if $PKG_CONFIG --exists "cairo-xlib-xrender >= $CAIRO_VERSION" ; then + echo "$ac_t""yes" 1>&6 + succeeded=yes + + echo $ac_n "checking CAIRO_XRENDER_CFLAGS""... $ac_c" 1>&6 +-echo "configure:23300: checking CAIRO_XRENDER_CFLAGS" >&5 ++echo "configure:23344: checking CAIRO_XRENDER_CFLAGS" >&5 + CAIRO_XRENDER_CFLAGS=`$PKG_CONFIG --cflags "cairo-xlib-xrender >= $CAIRO_VERSION"` + echo "$ac_t""$CAIRO_XRENDER_CFLAGS" 1>&6 + + echo $ac_n "checking CAIRO_XRENDER_LIBS""... $ac_c" 1>&6 +-echo "configure:23305: checking CAIRO_XRENDER_LIBS" >&5 ++echo "configure:23349: checking CAIRO_XRENDER_LIBS" >&5 + ## Remove evil flags like -Wl,--export-dynamic + CAIRO_XRENDER_LIBS="`$PKG_CONFIG --libs \"cairo-xlib-xrender >= $CAIRO_VERSION\" |sed s/-Wl,--export-dynamic//g`" + echo "$ac_t""$CAIRO_XRENDER_LIBS" 1>&6 +@@ -23454,19 +23498,19 @@ if test -z "$SKIP_LIBRARY_CHECKS" -a "$NECKO_WIFI" -a "$OS_ARCH" = "Linux" + then + ac_safe=`echo "iwlib.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for iwlib.h""... $ac_c" 1>&6 +-echo "configure:23458: checking for iwlib.h" >&5 ++echo "configure:23502: checking for iwlib.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:23470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:23514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -23924,9 +23968,9 @@ EOF + + + echo $ac_n "checking for posix_fallocate""... $ac_c" 1>&6 +-echo "configure:23928: checking for posix_fallocate" >&5 ++echo "configure:23972: checking for posix_fallocate" >&5 + cat > conftest.$ac_ext < +@@ -23934,7 +23978,7 @@ int main() { + posix_fallocate(0, 0, 0); + ; return 0; } + EOF +-if { (eval echo configure:23938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:23982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv___posix_fallocate=true + else +@@ -23955,12 +23999,12 @@ else + echo "$ac_t""no" 1>&6 + fi + +-if test "$COMPILE_ENVIRONMENT"; then ++if test "$COMPILE_ENVIRONMENT" && test -z "$LIBXUL_SDK"; then + if test "$MOZ_X11"; then + _SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $XCFLAGS" + cat > conftest.$ac_ext < +@@ -23979,7 +24023,7 @@ int main() { + + ; return 0; } + EOF +-if { (eval echo configure:23983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:24027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : + else + echo "configure: failed program was:" >&5 +@@ -23999,19 +24043,19 @@ fi # MOZ_X11 + if test -n "$MOZ_WEBGL_GLX"; then + ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6 +-echo "configure:24003: checking for GL/glx.h" >&5 ++echo "configure:24047: checking for GL/glx.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + + ; return 0; } + EOF +-if { (eval echo configure:24015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:24059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else +@@ -24037,7 +24081,7 @@ fi + fi # MOZ_WEBGL_GLX + fi # COMPILE_ENVIRONMENT + +-if test "$USE_FC_FREETYPE"; then ++if test "$USE_FC_FREETYPE" && test -z "$LIBXUL_SDK"; then + if test "$COMPILE_ENVIRONMENT"; then + _SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS" +@@ -24045,17 +24089,17 @@ if test "$USE_FC_FREETYPE"; then + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:24049: checking for $ac_hdr" >&5 ++echo "configure:24093: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:24059: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:24103: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -24509,6 +24553,7 @@ s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g + s%@INSTALL_DATA@%$INSTALL_DATA%g + s%@LN_S@%$LN_S%g + s%@PYTHON@%$PYTHON%g ++s%@MOZ_SYSTEM_PLY@%$MOZ_SYSTEM_PLY%g + s%@NSINSTALL_BIN@%$NSINSTALL_BIN%g + s%@DOXYGEN@%$DOXYGEN%g + s%@AUTOCONF@%$AUTOCONF%g diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Add-a-2-minutes-timeout-on-xpcshell-tests.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Add-a-2-minutes-timeout-on-xpcshell-tests.patch new file mode 100644 index 0000000..84a45df --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Add-a-2-minutes-timeout-on-xpcshell-tests.patch @@ -0,0 +1,44 @@ +From: Mike Hommey +Date: Mon, 27 Dec 2010 10:44:28 +0100 +Subject: Add a 2 minutes timeout on xpcshell tests + +--- + testing/xpcshell/runxpcshelltests.py | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/testing/xpcshell/runxpcshelltests.py b/testing/xpcshell/runxpcshelltests.py +index ea15466..e1babbb 100644 +--- a/testing/xpcshell/runxpcshelltests.py ++++ b/testing/xpcshell/runxpcshelltests.py +@@ -38,7 +38,7 @@ + # + # ***** END LICENSE BLOCK ***** */ + +-import re, sys, os, os.path, logging, shutil, signal, math, time ++import re, sys, os, os.path, logging, shutil, signal, math, time, select + from glob import glob + from optparse import OptionParser + from subprocess import Popen, PIPE, STDOUT +@@ -510,7 +510,21 @@ class XPCShellTests(object): + # - don't move this line above launchProcess, or child will inherit the SIG_IGN + signal.signal(signal.SIGINT, markGotSIGINT) + # |stderr == None| as |pStderr| was either |None| or redirected to |stdout|. +- stdout, stderr = self.communicate(proc) ++ if pStdout == PIPE: ++ stdout = "" ++ while True: ++ (r, w, e) = select.select([proc.stdout], [], [], 120) ++ if len(r) == 0: ++ stdout += "TEST-UNEXPECTED-FAIL | %s | application timed out after 120 seconds with no output" % (test) ++ proc.kill() ++ break ++ line = proc.stdout.read(1) ++ if line == "": ++ break ++ stdout += line ++ proc.wait() ++ else: ++ stdout, stderr = self.communicate(proc) + signal.signal(signal.SIGINT, signal.SIG_DFL) + + if interactive: diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Add-another-preferences-directory-for-applications-p.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Add-another-preferences-directory-for-applications-p.patch new file mode 100644 index 0000000..799b0e5 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Add-another-preferences-directory-for-applications-p.patch @@ -0,0 +1,34 @@ +From: Mike Hommey +Date: Sat, 21 Jun 2008 03:09:21 +0200 +Subject: Add another preferences directory for applications: + preferences/syspref + +It was existing in previous versions of iceweasel as a symlink to +/etc/iceweasel/pref. + +This has the side effect to make these preferences there work again, and +to disable the "set as default browser" dialog. +--- + toolkit/xre/nsXREDirProvider.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp +index 45bdfb1..da71bdd 100644 +--- a/toolkit/xre/nsXREDirProvider.cpp ++++ b/toolkit/xre/nsXREDirProvider.cpp +@@ -603,6 +603,7 @@ nsXREDirProvider::LoadAppBundleDirs() + } + + static const char *const kAppendPrefDir[] = { "defaults", "preferences", nsnull }; ++static const char *const kAppendSysPrefDir[] = { "defaults", "syspref", nsnull }; + + #ifdef DEBUG_bsmedberg + static void +@@ -644,6 +645,7 @@ nsXREDirProvider::GetFilesInternal(const char* aProperty, + LoadAppDirIntoArray(mXULAppDir, kAppendPrefDir, directories); + LoadDirsIntoArray(mAppBundleDirectories, + kAppendPrefDir, directories); ++ LoadAppDirIntoArray(mXULAppDir, kAppendSysPrefDir, directories); + + rv = NS_NewArrayEnumerator(aResult, directories); + } diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Add-soname-to-appropriate-libraries.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Add-soname-to-appropriate-libraries.patch new file mode 100644 index 0000000..430585e --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Add-soname-to-appropriate-libraries.patch @@ -0,0 +1,168 @@ +From: Mike Hommey +Date: Thu, 13 Mar 2008 08:22:05 +0100 +Subject: Add soname to appropriate libraries. + +This is a stripped down version, compared to the dpatch version, because we +actually are never going to use minor and micro version numbers. Also, we +now don't set a SO version on libxul and libxpcom because they will now +be dlloaded() by the standalone xpcomglue. +--- + config/makefiles/target_libs.mk | 4 +++- + config/rules.mk | 16 +++++++++++++++- + js/src/Makefile.in | 4 ++++ + js/src/config/makefiles/target_libs.mk | 4 +++- + js/src/config/rules.mk | 16 +++++++++++++++- + 5 files changed, 40 insertions(+), 4 deletions(-) + +diff --git a/config/makefiles/target_libs.mk b/config/makefiles/target_libs.mk +index 707fdd1..254e2d3 100644 +--- a/config/makefiles/target_libs.mk ++++ b/config/makefiles/target_libs.mk +@@ -80,7 +80,7 @@ GARBAGE += $(foreach lib,$(LIBRARY),$(EXPORT_LIBRARY)/$(lib)) + endif + endif # EXPORT_LIBRARY + +-libs:: $(SUBMAKEFILES) $(MAKE_DIRS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(HOST_PROGRAM) $(PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(SIMPLE_PROGRAMS) $(JAVA_LIBRARY) ++libs:: $(SUBMAKEFILES) $(MAKE_DIRS) $(HOST_LIBRARY) $(LIBRARY) $(UNVERSIONED_LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(HOST_PROGRAM) $(PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(SIMPLE_PROGRAMS) $(JAVA_LIBRARY) + ifndef NO_DIST_INSTALL + ifdef LIBRARY + ifdef EXPORT_LIBRARY # Stage libs that will be linked into a static build +@@ -109,8 +109,10 @@ ifndef NO_INSTALL_IMPORT_LIBRARY + endif + else + $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/lib ++ $(call MKSHLINKS,$(DIST)/lib) + endif + $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET) ++ $(call MKSHLINKS,$(FINAL_TARGET)) + endif # IS_COMPONENT + endif # SHARED_LIBRARY + ifdef PROGRAM +diff --git a/config/rules.mk b/config/rules.mk +index d1b969b..c64b4d5 100644 +--- a/config/rules.mk ++++ b/config/rules.mk +@@ -290,6 +290,18 @@ else + SHARED_LIBRARY := $(DLL_PREFIX)$(SHARED_LIBRARY_NAME)$(DLL_SUFFIX) + endif + ++ifdef SO_VERSION ++UNVERSIONED_LIBRARY := $(notdir $(SHARED_LIBRARY)) ++ ++ifeq ($(strip $(SHARED_LIBRARY)),$(strip $(SDK_LIBRARY))) ++SDK_LIBRARY := $(SHARED_LIBRARY) ++endif ++ ++SHARED_LIBRARY := $(SHARED_LIBRARY).$(SO_VERSION) ++ ++MKSHLINKS = rm -f $(1)/$(UNVERSIONED_LIBRARY); ln -s $(SHARED_LIBRARY) $(1)/$(UNVERSIONED_LIBRARY) ++endif ++ + ifeq ($(OS_ARCH),OS2) + DEF_FILE := $(SHARED_LIBRARY:.dll=.def) + endif +@@ -380,7 +392,7 @@ SIMPLE_PROGRAMS := + endif + + ifndef TARGETS +-TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(JAVA_LIBRARY) ++TARGETS = $(LIBRARY) $(UNVERSIONED_LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(JAVA_LIBRARY) + endif + + ifndef OBJS +@@ -1059,6 +1071,8 @@ endif + # so instead of deleting .o files after repacking them into a dylib, we make + # symlinks back to the originals. The symlinks are a no-op for stabs debugging, + # so no need to conditionalize on OS version or debugging format. ++$(UNVERSIONED_LIBRARY): $(SHARED_LIBRARY) ++ $(call MKSHLINKS,.) + + $(SHARED_LIBRARY): $(OBJS) $(LOBJS) $(DEF_FILE) $(RESFILE) $(SHARED_LIBRARY_LIBS_DEPS) $(LIBRARY) $(EXTRA_DEPS) $(DSO_LDOPTS_DEPS) $(GLOBAL_DEPS) + ifndef INCREMENTAL_LINKER +diff --git a/js/src/Makefile.in b/js/src/Makefile.in +index fc48cbd..1200ae6 100644 +--- a/js/src/Makefile.in ++++ b/js/src/Makefile.in +@@ -74,6 +74,7 @@ MODULE = js + LIBRARY_NAME = mozjs + STATIC_LIBRARY_NAME = js_static + GRE_MODULE = 1 ++SO_VERSION = $(JS_SO_VERSION) + + LIBS = $(NSPR_LIBS) + +@@ -922,6 +923,9 @@ ifneq (,$(LIBRARY)) + endif + ifneq (,$(SHARED_LIBRARY)) + $(SYSINSTALL) $(SHARED_LIBRARY) $(DESTDIR)$(libdir) ++ifneq (,$(UNVERSIONED_LIBRARY)) ++ ln -s $(SHARED_LIBRARY) $(DESTDIR)$(libdir)/$(UNVERSIONED_LIBRARY) ++endif + endif + ifneq (,$(IMPORT_LIBRARY)) + $(SYSINSTALL) $(IMPORT_LIBRARY) $(DESTDIR)$(libdir) +diff --git a/js/src/config/makefiles/target_libs.mk b/js/src/config/makefiles/target_libs.mk +index 707fdd1..254e2d3 100644 +--- a/js/src/config/makefiles/target_libs.mk ++++ b/js/src/config/makefiles/target_libs.mk +@@ -80,7 +80,7 @@ GARBAGE += $(foreach lib,$(LIBRARY),$(EXPORT_LIBRARY)/$(lib)) + endif + endif # EXPORT_LIBRARY + +-libs:: $(SUBMAKEFILES) $(MAKE_DIRS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(HOST_PROGRAM) $(PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(SIMPLE_PROGRAMS) $(JAVA_LIBRARY) ++libs:: $(SUBMAKEFILES) $(MAKE_DIRS) $(HOST_LIBRARY) $(LIBRARY) $(UNVERSIONED_LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(HOST_PROGRAM) $(PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(SIMPLE_PROGRAMS) $(JAVA_LIBRARY) + ifndef NO_DIST_INSTALL + ifdef LIBRARY + ifdef EXPORT_LIBRARY # Stage libs that will be linked into a static build +@@ -109,8 +109,10 @@ ifndef NO_INSTALL_IMPORT_LIBRARY + endif + else + $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/lib ++ $(call MKSHLINKS,$(DIST)/lib) + endif + $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET) ++ $(call MKSHLINKS,$(FINAL_TARGET)) + endif # IS_COMPONENT + endif # SHARED_LIBRARY + ifdef PROGRAM +diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk +index d1b969b..c64b4d5 100644 +--- a/js/src/config/rules.mk ++++ b/js/src/config/rules.mk +@@ -290,6 +290,18 @@ else + SHARED_LIBRARY := $(DLL_PREFIX)$(SHARED_LIBRARY_NAME)$(DLL_SUFFIX) + endif + ++ifdef SO_VERSION ++UNVERSIONED_LIBRARY := $(notdir $(SHARED_LIBRARY)) ++ ++ifeq ($(strip $(SHARED_LIBRARY)),$(strip $(SDK_LIBRARY))) ++SDK_LIBRARY := $(SHARED_LIBRARY) ++endif ++ ++SHARED_LIBRARY := $(SHARED_LIBRARY).$(SO_VERSION) ++ ++MKSHLINKS = rm -f $(1)/$(UNVERSIONED_LIBRARY); ln -s $(SHARED_LIBRARY) $(1)/$(UNVERSIONED_LIBRARY) ++endif ++ + ifeq ($(OS_ARCH),OS2) + DEF_FILE := $(SHARED_LIBRARY:.dll=.def) + endif +@@ -380,7 +392,7 @@ SIMPLE_PROGRAMS := + endif + + ifndef TARGETS +-TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(JAVA_LIBRARY) ++TARGETS = $(LIBRARY) $(UNVERSIONED_LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(JAVA_LIBRARY) + endif + + ifndef OBJS +@@ -1059,6 +1071,8 @@ endif + # so instead of deleting .o files after repacking them into a dylib, we make + # symlinks back to the originals. The symlinks are a no-op for stabs debugging, + # so no need to conditionalize on OS version or debugging format. ++$(UNVERSIONED_LIBRARY): $(SHARED_LIBRARY) ++ $(call MKSHLINKS,.) + + $(SHARED_LIBRARY): $(OBJS) $(LOBJS) $(DEF_FILE) $(RESFILE) $(SHARED_LIBRARY_LIBS_DEPS) $(LIBRARY) $(EXTRA_DEPS) $(DSO_LDOPTS_DEPS) $(GLOBAL_DEPS) + ifndef INCREMENTAL_LINKER diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Avoid-libxpcom-being-excluded-from-linked-libraries-.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Avoid-libxpcom-being-excluded-from-linked-libraries-.patch new file mode 100644 index 0000000..09cf8bf --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Avoid-libxpcom-being-excluded-from-linked-libraries-.patch @@ -0,0 +1,25 @@ +From: Mike Hommey +Date: Wed, 12 Mar 2008 23:18:23 +0100 +Subject: Avoid libxpcom being excluded from linked libraries by + -Wl,--as-needed + +Force libxpcom to be linked to xulrunner-bin and xpcshell so that it is +loaded in most cases. +--- + xulrunner/app/Makefile.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/xulrunner/app/Makefile.in b/xulrunner/app/Makefile.in +index d6efcbb..eae02da 100644 +--- a/xulrunner/app/Makefile.in ++++ b/xulrunner/app/Makefile.in +@@ -83,7 +83,9 @@ endif + LIBS += \ + $(EXTRA_DSO_LIBS) \ + $(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \ ++ -Wl,--no-as-needed \ + $(XPCOM_LIBS) \ ++ -Wl,--as-needed \ + $(NSPR_LIBS) \ + $(NULL) + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Avoid-wrong-sessionstore-data-to-keep-windows-out-of.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Avoid-wrong-sessionstore-data-to-keep-windows-out-of.patch new file mode 100644 index 0000000..0084e99 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Avoid-wrong-sessionstore-data-to-keep-windows-out-of.patch @@ -0,0 +1,35 @@ +From: Mike Hommey +Date: Thu, 12 Nov 2009 17:18:31 +0100 +Subject: Avoid wrong sessionstore data to keep windows out of user sight + +It happens that sessionstore can keep wrong information for the window +position or minimized state. Workaround this until the real bug is found +and fixed (probably in xulrunner). + +Closes: #552426, #553453 +--- + browser/components/sessionstore/src/nsSessionStore.js | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/browser/components/sessionstore/src/nsSessionStore.js b/browser/components/sessionstore/src/nsSessionStore.js +index a62821b..0878209 100644 +--- a/browser/components/sessionstore/src/nsSessionStore.js ++++ b/browser/components/sessionstore/src/nsSessionStore.js +@@ -3460,7 +3460,7 @@ SessionStoreService.prototype = { + aWindow.resizeTo(aWidth, aHeight); + } + if (!isNaN(aLeft) && !isNaN(aTop) && (aLeft != win_("screenX") || aTop != win_("screenY"))) { +- aWindow.moveTo(aLeft, aTop); ++ aWindow.moveTo((aLeft < -aWidth) ? 0 : aLeft, (aTop < -aHeight) ? 0 : aTop); + } + if (aSizeMode && win_("sizemode") != aSizeMode) + { +@@ -3470,8 +3470,6 @@ SessionStoreService.prototype = { + aWindow.maximize(); + break; + case "minimized": +- aWindow.minimize(); +- break; + case "normal": + aWindow.restore(); + break; diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Bug-508942-Use-Preprocessor.py-filters-in-defines-an.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Bug-508942-Use-Preprocessor.py-filters-in-defines-an.patch new file mode 100644 index 0000000..b20704a --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Bug-508942-Use-Preprocessor.py-filters-in-defines-an.patch @@ -0,0 +1,117 @@ +From: Mike Hommey +Date: Sat, 21 Apr 2012 12:11:40 +0200 +Subject: Bug 508942 - Use Preprocessor.py filters in #defines and #includes + +Original patch by Markus Stange. +--- + config/Preprocessor.py | 11 ++++++++--- + config/tests/unit-Preprocessor.py | 9 +++++++++ + js/src/config/Preprocessor.py | 11 ++++++++--- + 3 files changed, 25 insertions(+), 6 deletions(-) + +diff --git a/config/Preprocessor.py b/config/Preprocessor.py +index 752e83f..f238111 100644 +--- a/config/Preprocessor.py ++++ b/config/Preprocessor.py +@@ -134,6 +134,11 @@ class Preprocessor: + rv.out = self.out + return rv + ++ def applyFilters(self, aLine): ++ for f in self.filters: ++ aLine = f[1](aLine) ++ return aLine ++ + def write(self, aLine): + """ + Internal method for handling output. +@@ -146,8 +151,7 @@ class Preprocessor: + 'file': self.context['FILE'], + 'le': self.LE}) + self.writtenLines = ln +- for f in self.filters: +- aLine = f[1](aLine) ++ aLine = self.applyFilters(aLine) + # ensure our line ending. Only need to handle \n, as we're reading + # with universal line ending support, at least for files. + aLine = re.sub('\n', self.LE, aLine) +@@ -242,7 +246,7 @@ class Preprocessor: + raise Preprocessor.Error(self, 'SYNTAX_DEF', args) + val = 1 + if m.group('value'): +- val = m.group('value') ++ val = self.applyFilters(m.group('value')) + try: + val = int(val) + except: +@@ -423,6 +427,7 @@ class Preprocessor: + if isName: + try: + args = str(args) ++ args = self.applyFilters(args) + if not os.path.isabs(args): + args = os.path.join(self.context['DIRECTORY'], args) + args = open(args, 'rU') +diff --git a/config/tests/unit-Preprocessor.py b/config/tests/unit-Preprocessor.py +index d2f95f0..0ae2f88 100644 +--- a/config/tests/unit-Preprocessor.py ++++ b/config/tests/unit-Preprocessor.py +@@ -404,6 +404,15 @@ FAIL + self.pp.do_include(f) + self.assertEqual(self.pp.out.getvalue(), "first\rsecond\r") + ++ def test_filterDefine(self): ++ f = NamedIO('filterDefine.in', '''#filter substitution ++#define VAR AS ++#define VAR2 P@VAR@ ++@VAR2@S ++''') ++ self.pp.do_include(f) ++ self.assertEqual(self.pp.out.getvalue(), "PASS\n") ++ + def test_number_value_equals(self): + f = NamedIO("number_value_equals.in", """#define FOO 1000 + #if FOO == 1000 +diff --git a/js/src/config/Preprocessor.py b/js/src/config/Preprocessor.py +index 752e83f..f238111 100644 +--- a/js/src/config/Preprocessor.py ++++ b/js/src/config/Preprocessor.py +@@ -134,6 +134,11 @@ class Preprocessor: + rv.out = self.out + return rv + ++ def applyFilters(self, aLine): ++ for f in self.filters: ++ aLine = f[1](aLine) ++ return aLine ++ + def write(self, aLine): + """ + Internal method for handling output. +@@ -146,8 +151,7 @@ class Preprocessor: + 'file': self.context['FILE'], + 'le': self.LE}) + self.writtenLines = ln +- for f in self.filters: +- aLine = f[1](aLine) ++ aLine = self.applyFilters(aLine) + # ensure our line ending. Only need to handle \n, as we're reading + # with universal line ending support, at least for files. + aLine = re.sub('\n', self.LE, aLine) +@@ -242,7 +246,7 @@ class Preprocessor: + raise Preprocessor.Error(self, 'SYNTAX_DEF', args) + val = 1 + if m.group('value'): +- val = m.group('value') ++ val = self.applyFilters(m.group('value')) + try: + val = int(val) + except: +@@ -423,6 +427,7 @@ class Preprocessor: + if isName: + try: + args = str(args) ++ args = self.applyFilters(args) + if not os.path.isabs(args): + args = os.path.join(self.context['DIRECTORY'], args) + args = open(args, 'rU') diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Check-less-things-during-configure-when-using-libxul.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Check-less-things-during-configure-when-using-libxul.patch new file mode 100644 index 0000000..5952ac6 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Check-less-things-during-configure-when-using-libxul.patch @@ -0,0 +1,149 @@ +From: Mike Hommey +Date: Sat, 19 Apr 2008 23:01:20 +0200 +Subject: Check less things during configure when using libxul-sdk + +We don't need to check e.g. cairo or pango when using libxul-sdk, since +we won't be building most of the toolkit. +--- + configure.in | 30 +++++++++++++++++++++++++----- + 1 file changed, 25 insertions(+), 5 deletions(-) + +diff --git a/configure.in b/configure.in +index 6b155e0..18872c4 100644 +--- a/configure.in ++++ b/configure.in +@@ -4190,6 +4190,7 @@ AC_SUBST(LIBXUL_SDK) + + if test -n "$LIBXUL_SDK"; then + LIBXUL_DIST="$LIBXUL_SDK" ++ SKIP_LIBRARY_CHECKS=1 + else + LIBXUL_DIST="$MOZ_BUILD_ROOT/dist" + fi +@@ -4224,6 +4225,10 @@ if test -n "$MOZ_NATIVE_NSPR"; then + AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT or including prtypes.h does not provide it])) + CFLAGS=$_SAVE_CFLAGS + else ++ if test -n "$LIBXUL_SDK"; then ++ NSPR_CFLAGS="-I$LIBXUL_SDK_DIR/sdk/include" ++ NSPR_LIBS="-L$LIBXUL_SDK_DIR/sdk/lib -lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION" ++ else + if test "$OS_ARCH" = "WINNT"; then + NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr" + if test -n "$GNU_CC"; then +@@ -4235,6 +4240,7 @@ else + NSPR_CFLAGS='`$(LIBXUL_DIST)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`' + NSPR_LIBS='`$(LIBXUL_DIST)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`' + fi ++ fi + fi + + dnl system libevent Support +@@ -4935,6 +4941,7 @@ dnl ======================================================== + dnl = startup-notification support module + dnl ======================================================== + ++if test -z "$LIBXUL_SDK"; then + if test "$MOZ_ENABLE_GTK2" + then + MOZ_ENABLE_STARTUP_NOTIFICATION= +@@ -4963,6 +4970,7 @@ then + + TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS" + fi ++fi + AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION) + AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS) + AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS) +@@ -5060,6 +5068,12 @@ AC_SUBST(MOZ_QT_LIBS) + AC_SUBST(MOC) + + AC_SUBST(MOZ_DFB) ++ ++if test "$MOZ_ENABLE_GTK2" && test -z "$LIBXUL_SDK" ++then ++ AC_DEFINE(MOZ_X11) ++ MOZ_X11=1 ++fi + AC_SUBST(MOZ_X11) + + dnl ======================================================== +@@ -5145,7 +5159,7 @@ MOZ_ARG_DISABLE_BOOL(pango, + dnl ======================================================== + dnl = Pango + dnl ======================================================== +-if test "$MOZ_ENABLE_GTK2" ++if test "$MOZ_ENABLE_GTK2" && test -z "$LIBXUL_SDK" + then + AC_SUBST(MOZ_PANGO) + +@@ -5186,6 +5200,7 @@ dnl ======================================================== + dnl = GnomeVFS, GIO and GConf support module + dnl ======================================================== + ++if test -z "$LIBXUL_SDK"; then + if test "$MOZ_X11" + then + dnl build the gnomevfs extension by default only when the +@@ -5424,6 +5439,9 @@ AC_SUBST(MOZ_DBUS_LIBS) + AC_SUBST(MOZ_DBUS_GLIB_CFLAGS) + AC_SUBST(MOZ_DBUS_GLIB_LIBS) + ++fi # LIBXUL_SDK ++ ++ + dnl ======================================================== + dnl = Build Personal Security Manager + dnl ======================================================== +@@ -5796,6 +5814,7 @@ dnl = Check alsa availability on Linux if using sydneyaudio + dnl ======================================================== + + dnl If using sydneyaudio with Linux, ensure that the alsa library is available ++if test -z "$LIBXUL_SDK"; then + if test -n "$MOZ_SYDNEYAUDIO"; then + case "$target_os" in + linux*) +@@ -5805,6 +5824,7 @@ linux*) + ;; + esac + fi ++fi + + dnl ======================================================== + dnl Permissions System +@@ -7045,7 +7065,7 @@ MOZ_ARG_ENABLE_BOOL(jemalloc, + MOZ_MEMORY=1, + MOZ_MEMORY=) + +-if test "$NS_TRACE_MALLOC"; then ++if test "$NS_TRACE_MALLOC" || test "$LIBXUL_SDK"; then + MOZ_MEMORY= + fi + +@@ -7920,7 +7940,7 @@ MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla)) + dnl Check for GLib. + dnl ======================================================== + +-if test -z "$SKIP_PATH_CHECKS"; then ++if test -z "$SKIP_PATH_CHECKS" && test -z "$LIBXUL_SDK"; then + if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then + if test "$MOZ_ENABLE_GTK2" -o "$USE_ELF_DYNSTR_GC" ; then + PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0) +@@ -8610,7 +8630,7 @@ else + fi + + dnl Check for missing components +-if test "$COMPILE_ENVIRONMENT"; then ++if test "$COMPILE_ENVIRONMENT" && test -z "$LIBXUL_SDK"; then + if test "$MOZ_X11"; then + dnl ==================================================== + dnl = Check if X headers exist +@@ -8649,7 +8669,7 @@ if test -n "$MOZ_WEBGL_GLX"; then + fi # MOZ_WEBGL_GLX + fi # COMPILE_ENVIRONMENT + +-if test "$USE_FC_FREETYPE"; then ++if test "$USE_FC_FREETYPE" && test -z "$LIBXUL_SDK"; then + if test "$COMPILE_ENVIRONMENT"; then + _SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS" diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Do-build-time-detection-of-2-bytes-wchar_t-and-char1.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Do-build-time-detection-of-2-bytes-wchar_t-and-char1.patch new file mode 100644 index 0000000..99408b4 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Do-build-time-detection-of-2-bytes-wchar_t-and-char1.patch @@ -0,0 +1,69 @@ +From: Mike Hommey +Date: Wed, 14 Apr 2010 08:59:59 +0200 +Subject: Do build time detection of 2-bytes wchar_t and char16_t support + +https://bugzilla.mozilla.org/show_bug.cgi?id=559278 +Closes: #577677 +--- + xpcom/base/nscore.h | 22 ++++++++++++++++++++++ + xpcom/glue/nsStringAPI.h | 1 + + xpcom/string/public/nsLiteralString.h | 1 + + 3 files changed, 24 insertions(+) + +diff --git a/xpcom/base/nscore.h b/xpcom/base/nscore.h +index 9cde77d..40d3aaa 100644 +--- a/xpcom/base/nscore.h ++++ b/xpcom/base/nscore.h +@@ -391,6 +391,28 @@ typedef PRUint32 nsrefcnt; + #define HAVE_CPP_2BYTE_WCHAR_T + #endif + ++#ifdef __GNUC__ ++/* char16_t is only available in gcc 4.4+ with experimental c++0x support ++ * (-std=c++0x or -std=gnu++0x) */ ++#if defined(HAVE_CPP_CHAR16_T) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)) ++#warning libxul SDK was configured with char16_t support, but now building without ++#undef HAVE_CPP_CHAR16_T ++#elif ! defined(HAVE_CPP_CHAR16_T) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && defined(__GXX_EXPERIMENTAL_CXX0X__) ++#warning libxul SDK was configured without char16_t support, but now building with ++#define HAVE_CPP_CHAR16_T ++#endif ++ ++/* When gcc is not given -fshort-wchar, wchar_t is not 2-bytes wide */ ++#if defined(HAVE_CPP_2BYTE_WCHAR_T) && (__SIZEOF_WCHAR_T__ != 2) ++#warning libxul SDK was configured with 2-byte wchar_t, but now building without ++#undef HAVE_CPP_2BYTE_WCHAR_T ++#elif ! defined(HAVE_CPP_2BYTE_WCHAR_T) && (__SIZEOF_WCHAR_T__ == 2) ++#warning libxul SDK was configured without 2-byte wchar_t, but now building with ++#define HAVE_CPP_2BYTE_WCHAR_T ++#endif ++ ++#endif ++ + #ifndef __PRUNICHAR__ + #define __PRUNICHAR__ + /* For now, don't use wchar_t on Unix because it breaks the Netscape +diff --git a/xpcom/glue/nsStringAPI.h b/xpcom/glue/nsStringAPI.h +index 272c9eb..0590fc5 100644 +--- a/xpcom/glue/nsStringAPI.h ++++ b/xpcom/glue/nsStringAPI.h +@@ -1109,6 +1109,7 @@ private: + #define NS_NAMED_MULTILINE_LITERAL_STRING(n,s) const nsDependentString n(reinterpret_cast(s), PRUint32((sizeof(s)/2)-1)) + typedef nsDependentString nsLiteralString; + #else ++ #warning Using conversions for literal strings. Please consider using 2-bytes wchar_t or char16_t instead + #define NS_LL(s) s + #define NS_MULTILINE_LITERAL_STRING(s) NS_ConvertASCIItoUTF16(s, PRUint32(sizeof(s)-1)) + #define NS_MULTILINE_LITERAL_STRING_INIT(n,s) n(s, PRUint32(sizeof(s)-1)) +diff --git a/xpcom/string/public/nsLiteralString.h b/xpcom/string/public/nsLiteralString.h +index 7808f24..2cf1f7b 100644 +--- a/xpcom/string/public/nsLiteralString.h ++++ b/xpcom/string/public/nsLiteralString.h +@@ -91,6 +91,7 @@ literal_string( const nsACString::char_type* aPtr, PRUint32 aLength ) + #define NS_NAMED_MULTILINE_LITERAL_STRING(n,s) const nsDependentString n(reinterpret_cast(s), PRUint32((sizeof(s)/2)-1)) + typedef nsDependentString nsLiteralString; + #else ++ #warning Using conversions for literal strings. Please consider using 2-bytes wchar_t or char16_t instead + #define NS_LL(s) s + #define NS_MULTILINE_LITERAL_STRING(s) NS_ConvertASCIItoUTF16(s, PRUint32(sizeof(s)-1)) + #define NS_MULTILINE_LITERAL_STRING_INIT(n,s) n(s, PRUint32(sizeof(s)-1)) diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-build-example-component.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-build-example-component.patch new file mode 100644 index 0000000..daadb5f --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-build-example-component.patch @@ -0,0 +1,20 @@ +From: Mike Hommey +Date: Wed, 12 Mar 2008 23:20:52 +0100 +Subject: Don't build example component + +--- + xulrunner/Makefile.in | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/xulrunner/Makefile.in b/xulrunner/Makefile.in +index 0af55ea..176ace0 100644 +--- a/xulrunner/Makefile.in ++++ b/xulrunner/Makefile.in +@@ -47,7 +47,6 @@ PARALLEL_DIRS = \ + app \ + setup \ + stub \ +- examples \ + $(NULL) + + ifeq ($(OS_ARCH),WINNT) diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch new file mode 100644 index 0000000..dd5661f --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch @@ -0,0 +1,30 @@ +From: Mike Hommey +Date: Mon, 22 Mar 2010 11:45:42 +0100 +Subject: Don't error-out when run-time libsqlite is older than build-time + libsqlite + +In Debian, we have shlibs to handle this. +--- + storage/src/mozStorageService.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/storage/src/mozStorageService.cpp b/storage/src/mozStorageService.cpp +index 7c0a7a0..0121765 100644 +--- a/storage/src/mozStorageService.cpp ++++ b/storage/src/mozStorageService.cpp +@@ -222,6 +222,7 @@ Service::getSingleton() + return gService; + } + ++#if 0 + // Ensure that we are using the same version of SQLite that we compiled with + // or newer. Our configure check ensures we are using a new enough version + // at compile time. +@@ -237,6 +238,7 @@ Service::getSingleton() + } + ::PR_Abort(); + } ++#endif + + gService = new Service(); + if (gService) { diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-install-system-profile.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-install-system-profile.patch new file mode 100644 index 0000000..5be5f5a --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-install-system-profile.patch @@ -0,0 +1,21 @@ +From: Mike Hommey +Date: Wed, 12 Mar 2008 23:25:15 +0100 +Subject: Don't install system profile + +--- + xulrunner/app/Makefile.in | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/xulrunner/app/Makefile.in b/xulrunner/app/Makefile.in +index eae02da..2d5b8f4 100644 +--- a/xulrunner/app/Makefile.in ++++ b/xulrunner/app/Makefile.in +@@ -48,8 +48,6 @@ VPATH = @srcdir@ + + include $(DEPTH)/config/autoconf.mk + +-DIRS = profile +- + PREF_JS_EXPORTS = $(srcdir)/xulrunner.js + GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/,xulrunner.js) + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch new file mode 100644 index 0000000..2b13be9 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch @@ -0,0 +1,24 @@ +From: Mike Hommey +Date: Sat, 27 Sep 2008 17:17:39 +0200 +Subject: Don't register plugins if the MOZILLA_DISABLE_PLUGINS environment + variable is set + +--- + dom/plugins/base/nsPluginHost.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp +index 992bcd4..18081a2 100644 +--- a/dom/plugins/base/nsPluginHost.cpp ++++ b/dom/plugins/base/nsPluginHost.cpp +@@ -407,6 +407,10 @@ nsPluginHost::nsPluginHost() + } + } + ++ const char *env = PR_GetEnv("MOZILLA_DISABLE_PLUGINS"); ++ if (env && env[0]) ++ mPluginsDisabled = PR_TRUE; ++ + nsCOMPtr obsService = + mozilla::services::GetObserverService(); + if (obsService) { diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Fix-tracejit-to-build-against-nanojit-headers-in-dis.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Fix-tracejit-to-build-against-nanojit-headers-in-dis.patch new file mode 100644 index 0000000..1a13d45 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Fix-tracejit-to-build-against-nanojit-headers-in-dis.patch @@ -0,0 +1,36 @@ +From: Mike Hommey +Date: Wed, 10 Nov 2010 08:41:03 +0100 +Subject: Fix tracejit to build against nanojit headers in + dist/include/nanojit + +--- + js/src/tracejit/Writer.cpp | 2 +- + js/src/tracejit/Writer.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/js/src/tracejit/Writer.cpp b/js/src/tracejit/Writer.cpp +index 8f6476e..df0c8e2 100644 +--- a/js/src/tracejit/Writer.cpp ++++ b/js/src/tracejit/Writer.cpp +@@ -42,7 +42,7 @@ + #include "jscompartment.h" + #include "jsiter.h" + #include "Writer.h" +-#include "nanojit.h" ++#include "nanojit/nanojit.h" + #include "jsobjinlines.h" + + #include "vm/ArgumentsObject.h" +diff --git a/js/src/tracejit/Writer.h b/js/src/tracejit/Writer.h +index ab96acc..56d2641 100644 +--- a/js/src/tracejit/Writer.h ++++ b/js/src/tracejit/Writer.h +@@ -42,7 +42,7 @@ + + #include "jsstr.h" + #include "jstypedarray.h" +-#include "nanojit.h" ++#include "nanojit/nanojit.h" + + namespace js { + namespace tjit { diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Gross-workaround-to-avoid-installing-test-idl-and-in.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Gross-workaround-to-avoid-installing-test-idl-and-in.patch new file mode 100644 index 0000000..cb6fdde --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Gross-workaround-to-avoid-installing-test-idl-and-in.patch @@ -0,0 +1,71 @@ +From: Mike Hommey +Date: Wed, 27 Jan 2010 17:47:57 +0100 +Subject: Gross workaround to avoid installing test idl and include files in + the SDK + +https://bugzilla.mozilla.org/show_bug.cgi?id=542749 +--- + config/rules.mk | 12 +++++++++++- + js/src/config/rules.mk | 12 +++++++++++- + 2 files changed, 22 insertions(+), 2 deletions(-) + +diff --git a/config/rules.mk b/config/rules.mk +index c64b4d5..1b8bfc0 100644 +--- a/config/rules.mk ++++ b/config/rules.mk +@@ -64,6 +64,16 @@ ifdef SDK_HEADERS + EXPORTS += $(SDK_HEADERS) + endif + ++ifneq (,$(findstring sample,$(MODULE))$(findstring test,$(MODULE))$(findstring Test,$(MODULE))) ++INCLUDE_DIR := $(DIST)/include/testing ++IDL_DIR := $(DIST)/tests/idl ++LOCAL_INCLUDES += -I$(XPIDL_GEN_DIR) -I$(INCLUDE_DIR) ++override MOZ_JAVAXPCOM := ++XPIDL_FLAGS += -I$(DIST)/idl ++else ++INCLUDE_DIR := $(DIST)/include ++endif ++ + REPORT_BUILD = @echo $(notdir $<) + + ifeq ($(OS_ARCH),OS2) +@@ -1525,7 +1535,7 @@ ifndef NO_DIST_INSTALL + export:: $(XPIDLSRCS) $(IDL_DIR) + $(INSTALL) $(IFLAGS1) $^ + +-export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) $(DIST)/include ++export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) $(INCLUDE_DIR) + $(INSTALL) $(IFLAGS1) $^ + endif # NO_DIST_INSTALL + +diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk +index c64b4d5..1b8bfc0 100644 +--- a/js/src/config/rules.mk ++++ b/js/src/config/rules.mk +@@ -64,6 +64,16 @@ ifdef SDK_HEADERS + EXPORTS += $(SDK_HEADERS) + endif + ++ifneq (,$(findstring sample,$(MODULE))$(findstring test,$(MODULE))$(findstring Test,$(MODULE))) ++INCLUDE_DIR := $(DIST)/include/testing ++IDL_DIR := $(DIST)/tests/idl ++LOCAL_INCLUDES += -I$(XPIDL_GEN_DIR) -I$(INCLUDE_DIR) ++override MOZ_JAVAXPCOM := ++XPIDL_FLAGS += -I$(DIST)/idl ++else ++INCLUDE_DIR := $(DIST)/include ++endif ++ + REPORT_BUILD = @echo $(notdir $<) + + ifeq ($(OS_ARCH),OS2) +@@ -1525,7 +1535,7 @@ ifndef NO_DIST_INSTALL + export:: $(XPIDLSRCS) $(IDL_DIR) + $(INSTALL) $(IFLAGS1) $^ + +-export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) $(DIST)/include ++export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) $(INCLUDE_DIR) + $(INSTALL) $(IFLAGS1) $^ + endif # NO_DIST_INSTALL + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Handle-transition-to-etc-appname-searchplugins-more-.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Handle-transition-to-etc-appname-searchplugins-more-.patch new file mode 100644 index 0000000..7259c97 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Handle-transition-to-etc-appname-searchplugins-more-.patch @@ -0,0 +1,73 @@ +From: Mike Hommey +Date: Sun, 15 Apr 2012 11:38:32 +0200 +Subject: Handle transition to /etc//searchplugins more gracefully + +Closes: #666675. +--- + toolkit/components/search/nsSearchService.js | 32 ++++++++++++++++++++++++-- + 1 file changed, 30 insertions(+), 2 deletions(-) + +diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js +index 2807835..8fa31ca 100644 +--- a/toolkit/components/search/nsSearchService.js ++++ b/toolkit/components/search/nsSearchService.js +@@ -710,6 +710,7 @@ function getMozParamPref(prefName) + * + * @see nsIBrowserSearchService.idl + */ ++let gForceCacheInvalidation = false; + let gEnginesLoaded = false; + function notifyAction(aEngine, aVerb) { + if (gEnginesLoaded) { +@@ -2012,6 +2013,20 @@ Engine.prototype = { + **/ + _initWithJSON: function SRCH_ENG__initWithJSON(aJson) { + this.__id = aJson._id; ++ try { ++ let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); ++ file.initWithPath(this.__id); ++ let loadDirs = []; ++ let locations = getDir(NS_APP_SEARCH_DIR_LIST, Ci.nsISimpleEnumerator); ++ while (locations.hasMoreElements()) { ++ let dir = locations.getNext().QueryInterface(Ci.nsIFile); ++ loadDirs.push(dir); ++ } ++ if (loadDirs.some(function (element) element.equals(file.parent))) { ++ this.__id = "[app]/" + file.leafName; ++ gForceCacheInvalidation = true; ++ } ++ } catch (e) { } + this._name = aJson._name; + this._description = aJson.description; + if (aJson._hasPreferredIcon == undefined) +@@ -2306,8 +2321,19 @@ Engine.prototype = { + this.__installLocation = SEARCH_APP_DIR; + else if (this._file.parent.equals(getDir(NS_APP_USER_SEARCH_DIR))) + this.__installLocation = SEARCH_PROFILE_DIR; +- else +- this.__installLocation = SEARCH_IN_EXTENSION; ++ else { ++ let loadDirs = []; ++ let locations = getDir(NS_APP_SEARCH_DIR_LIST, Ci.nsISimpleEnumerator); ++ while (locations.hasMoreElements()) { ++ let dir = locations.getNext().QueryInterface(Ci.nsIFile); ++ loadDirs.push(dir); ++ } ++ let parent = this._file.parent; ++ if (loadDirs.some(function (element) !element.equals(parent))) ++ this.__installLocation = SEARCH_APP_DIR; ++ else ++ this.__installLocation = SEARCH_IN_EXTENSION; ++ } + } + + return this.__installLocation; +@@ -2471,6 +2497,8 @@ function SearchService() { + } + gEnginesLoaded = true; + this._addObservers(); ++ if (gForceCacheInvalidation) ++ this._batchCacheInvalidation(); + } + SearchService.prototype = { + classID: Components.ID("{7319788a-fe93-4db3-9f39-818cf08f4256}"), diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Ignore-system-libjpeg-libpng-and-zlib-version-checki.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Ignore-system-libjpeg-libpng-and-zlib-version-checki.patch new file mode 100644 index 0000000..76368cb --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Ignore-system-libjpeg-libpng-and-zlib-version-checki.patch @@ -0,0 +1,42 @@ +From: Mike Hommey +Date: Thu, 13 Mar 2008 07:33:42 +0100 +Subject: Ignore system libjpeg, libpng and zlib version checking + +Make sure we won't be bitten by upstream changing libjpeg, libpng or zlib +internal version, which makes system library not used even though +--with-system-* argument is given to configure. +--- + configure.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/configure.in b/configure.in +index 18872c4..5c20d46 100644 +--- a/configure.in ++++ b/configure.in +@@ -4357,7 +4357,7 @@ else + AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS) + fi + +-if test "$SYSTEM_JPEG" = 1; then ++if test "$SYSTEM_JPEG" = 0; then + LIBS="$JPEG_LIBS $LIBS" + AC_TRY_COMPILE([ #include + #include +@@ -4397,7 +4397,7 @@ else + AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"], + [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS) + fi +-if test "$SYSTEM_ZLIB" = 1; then ++if test "$SYSTEM_ZLIB" = 0; then + LIBS="$ZLIB_LIBS $LIBS" + AC_TRY_COMPILE([ #include + #include +@@ -4473,7 +4473,7 @@ else + AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]), + $_SAVE_PNG_LIBS) + fi +-if test "$SYSTEM_PNG" = 1; then ++if test "$SYSTEM_PNG" = 0; then + LIBS="$PNG_LIBS $LIBS" + AC_TRY_COMPILE([ #include + #include diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Install-js-shell-when-running-make-install-from-js-s.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Install-js-shell-when-running-make-install-from-js-s.patch new file mode 100644 index 0000000..92052f2 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Install-js-shell-when-running-make-install-from-js-s.patch @@ -0,0 +1,32 @@ +From: Mike Hommey +Date: Fri, 26 Feb 2010 16:25:15 +0100 +Subject: Install js shell when running make install from js/src + +--- + js/src/Makefile.in | 1 + + js/src/shell/Makefile.in | 3 +++ + 2 files changed, 4 insertions(+) + +diff --git a/js/src/Makefile.in b/js/src/Makefile.in +index 0f83fd6..d61492d 100644 +--- a/js/src/Makefile.in ++++ b/js/src/Makefile.in +@@ -940,6 +940,7 @@ endif + ifneq (,$(IMPORT_LIBRARY)) + $(SYSINSTALL) $(IMPORT_LIBRARY) $(DESTDIR)$(libdir) + endif ++ $(MAKE) -C shell install + + # Extra dependancies and rules for auto-generated headers + host_jskwgen.$(OBJ_SUFFIX): jsversion.h jskeyword.tbl +diff --git a/js/src/shell/Makefile.in b/js/src/shell/Makefile.in +index 4df10ed..504e259 100644 +--- a/js/src/shell/Makefile.in ++++ b/js/src/shell/Makefile.in +@@ -78,3 +78,6 @@ endif + # People expect the js shell to wind up in the top-level JS dir. + libs:: + $(INSTALL) $(IFLAGS2) $(PROGRAM) $(DEPTH) ++ ++install:: $(PROGRAM) ++ $(SYSINSTALL) $^ $(DESTDIR)$(bindir) diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Install-missing-nanojit-and-.tbl-headers-from-js-src.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Install-missing-nanojit-and-.tbl-headers-from-js-src.patch new file mode 100644 index 0000000..6dc7737 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Install-missing-nanojit-and-.tbl-headers-from-js-src.patch @@ -0,0 +1,85 @@ +From: Mike Hommey +Date: Thu, 28 Jan 2010 18:08:38 +0100 +Subject: Install missing nanojit and .tbl headers from js/src + +https://bugzilla.mozilla.org/show_bug.cgi?id=542789 +--- + js/src/Makefile.in | 44 +++++++++++++++++++++++++++----------------- + 1 file changed, 27 insertions(+), 17 deletions(-) + +diff --git a/js/src/Makefile.in b/js/src/Makefile.in +index 1200ae6..0f83fd6 100644 +--- a/js/src/Makefile.in ++++ b/js/src/Makefile.in +@@ -230,6 +230,7 @@ INSTALLED_HEADERS = \ + jsxdrapi.h \ + jsval.h \ + prmjtime.h \ ++ jskeyword.tbl \ + $(NULL) + + ###################################################### +@@ -296,21 +297,21 @@ VPATH += \ + + INSTALLED_HEADERS += \ + jsbuiltins.h \ +- Assembler.h \ +- Allocator.h \ +- CodeAlloc.h \ +- Containers.h \ +- LIR.h \ +- LIRopcode.tbl \ +- avmplus.h \ +- Fragmento.h \ +- Native.h \ +- NativeCommon.h \ +- Native$(NANOJIT_ARCH).h \ +- njconfig.h \ +- njcpudetect.h \ +- RegAlloc.h \ +- nanojit.h \ ++ nanojit/Assembler.h \ ++ nanojit/Allocator.h \ ++ nanojit/CodeAlloc.h \ ++ nanojit/Containers.h \ ++ nanojit/LIR.h \ ++ nanojit/LIRopcode.tbl \ ++ nanojit/avmplus.h \ ++ nanojit/Fragmento.h \ ++ nanojit/Native.h \ ++ nanojit/NativeCommon.h \ ++ nanojit/Native$(NANOJIT_ARCH).h \ ++ nanojit/njconfig.h \ ++ nanojit/njcpudetect.h \ ++ nanojit/RegAlloc.h \ ++ nanojit/nanojit.h \ + VMPI.h \ + Writer.h \ + $(NULL) +@@ -545,7 +546,11 @@ else + CPPSRCS += pm_stub.cpp + endif + +-EXPORTS = $(INSTALLED_HEADERS) ++EXPORTS = $(filter-out nanojit/%,$(INSTALLED_HEADERS)) ++ifdef ENABLE_TRACEJIT ++EXPORTS_NAMESPACES += nanojit ++EXPORTS_nanojit = $(filter nanojit/%,$(INSTALLED_HEADERS)) ++endif # ENABLE_TRACEJIT + + DASH_R = -r + +@@ -911,7 +916,12 @@ js-config: js-config.in Makefile $(DEPTH)/config/autoconf.mk $(topsrcdir)/config + SCRIPTS = js-config + SDK_BINARY = js-config + +-install:: $(INSTALLED_HEADERS) ++ifdef ENABLE_TRACEJIT ++install:: $(filter nanojit/%,$(INSTALLED_HEADERS)) ++ $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(MODULE)/nanojit ++endif ++ ++install:: $(filter-out nanojit/%,$(INSTALLED_HEADERS)) + $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(MODULE) + + install:: $(SCRIPTS) diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Load-distribution-search-plugins-from-etc-appname-se.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Load-distribution-search-plugins-from-etc-appname-se.patch new file mode 100644 index 0000000..940eac7 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Load-distribution-search-plugins-from-etc-appname-se.patch @@ -0,0 +1,50 @@ +From: Mike Hommey +Date: Fri, 30 Mar 2012 15:44:54 +0200 +Subject: Load distribution search plugins from /etc//searchplugins + +--- + .../components/dirprovider/DirectoryProvider.cpp | 22 ++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +diff --git a/browser/components/dirprovider/DirectoryProvider.cpp b/browser/components/dirprovider/DirectoryProvider.cpp +index 1373adc..cde4587 100644 +--- a/browser/components/dirprovider/DirectoryProvider.cpp ++++ b/browser/components/dirprovider/DirectoryProvider.cpp +@@ -38,7 +38,8 @@ + #include "nsIDirectoryService.h" + #include "DirectoryProvider.h" + +-#include "nsIFile.h" ++#include "nsIXULAppInfo.h" ++#include "nsILocalFile.h" + #include "nsISimpleEnumerator.h" + #include "nsIPrefService.h" + #include "nsIPrefBranch.h" +@@ -166,13 +167,22 @@ AppendFileKey(const char *key, nsIProperties* aDirSvc, + static void + AppendDistroSearchDirs(nsIProperties* aDirSvc, nsCOMArray &array) + { +- nsCOMPtr searchPlugins; +- nsresult rv = aDirSvc->Get(NS_XPCOM_CURRENT_PROCESS_DIR, +- NS_GET_IID(nsIFile), +- getter_AddRefs(searchPlugins)); ++ nsCOMPtr searchPlugins; ++ nsresult rv = NS_NewLocalFile(NS_LITERAL_STRING("/etc"), false, ++ getter_AddRefs(searchPlugins)); + if (NS_FAILED(rv)) + return; +- searchPlugins->AppendNative(NS_LITERAL_CSTRING("distribution")); ++ nsCOMPtr appInfo = do_GetService("@mozilla.org/xre/app-info;1"); ++ if (!appInfo) ++ return; ++ ++ nsCAutoString name; ++ rv = appInfo->GetName(name); ++ if (NS_FAILED(rv)) ++ return; ++ ToLowerCase(name); ++ ++ searchPlugins->AppendNative(name); + searchPlugins->AppendNative(NS_LITERAL_CSTRING("searchplugins")); + + bool exists; diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Use-a-variable-for-xulrunner-base-version-in-various.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Use-a-variable-for-xulrunner-base-version-in-various.patch new file mode 100644 index 0000000..d35c478 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/Use-a-variable-for-xulrunner-base-version-in-various.patch @@ -0,0 +1,39 @@ +From: Mike Hommey +Date: Mon, 14 Jul 2008 15:20:46 +0200 +Subject: Use a variable for xulrunner base version in various places + +--- + config/autoconf.mk.in | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in +index fccb1a9..ca251cb 100644 +--- a/config/autoconf.mk.in ++++ b/config/autoconf.mk.in +@@ -55,6 +55,7 @@ MOZ_APP_PROFILE = @MOZ_APP_PROFILE@ + MOZ_APP_UA_NAME = @MOZ_APP_UA_NAME@ + MOZ_APP_VERSION = @MOZ_APP_VERSION@ + MOZ_APP_MAXVERSION = @MOZ_APP_MAXVERSION@ ++MOZ_APP_BASE_VERSION = $(firstword $(subst ., ,$(MOZ_APP_VERSION))).$(word 2,$(subst ., ,$(MOZ_APP_VERSION))) + MOZ_UA_BUILDID = @MOZ_UA_BUILDID@ + MOZ_MACBUNDLE_NAME = @MOZ_MACBUNDLE_NAME@ + +@@ -63,14 +64,14 @@ MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + bindir = @bindir@ +-includedir = @includedir@/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) ++includedir = @includedir@/$(MOZ_APP_NAME)-$(MOZ_APP_BASE_VERSION) + libdir = @libdir@ + datadir = @datadir@ + mandir = @mandir@ +-idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) ++idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_BASE_VERSION) + +-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) +-sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION) ++installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_BASE_VERSION) ++sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_BASE_VERSION) + + DIST = $(DEPTH)/dist + LIBXUL_SDK = @LIBXUL_SDK@ diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/pkg-config-files-don-t-need-to-require-the-version-o.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/pkg-config-files-don-t-need-to-require-the-version-o.patch new file mode 100644 index 0000000..a90e53b --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/debian-hacks/pkg-config-files-don-t-need-to-require-the-version-o.patch @@ -0,0 +1,47 @@ +From: Mike Hommey +Date: Tue, 7 Sep 2010 08:52:43 +0200 +Subject: pkg-config files don't need to require the version of nspr xulrunner + was built against + +--- + xulrunner/installer/libxul.pc.in | 2 +- + xulrunner/installer/mozilla-js.pc.in | 2 +- + xulrunner/installer/mozilla-nss.pc.in | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/xulrunner/installer/libxul.pc.in b/xulrunner/installer/libxul.pc.in +index ccce9aa..631382d 100644 +--- a/xulrunner/installer/libxul.pc.in ++++ b/xulrunner/installer/libxul.pc.in +@@ -6,6 +6,6 @@ idldir=%idldir% + Name: libxul + Description: The Mozilla Runtime and Embedding Engine + Version: %MOZILLA_VERSION% +-Requires: %NSPR_NAME% >= %NSPR_VERSION% ++Requires: %NSPR_NAME% + Libs: -L${sdkdir}/lib %MOZ_XUL_LINK% + Cflags: -I${includedir} %WCHAR_CFLAGS% +diff --git a/xulrunner/installer/mozilla-js.pc.in b/xulrunner/installer/mozilla-js.pc.in +index c1428f1..9eb0a79 100644 +--- a/xulrunner/installer/mozilla-js.pc.in ++++ b/xulrunner/installer/mozilla-js.pc.in +@@ -5,6 +5,6 @@ includedir=%includedir% + Name: JavaScript + Description: The Mozilla JavaScript Library + Version: %MOZILLA_VERSION% +-Requires: %NSPR_NAME% >= %NSPR_VERSION% ++Requires: %NSPR_NAME% + Libs: -L${sdkdir}/lib %MOZ_JS_LINK% + Cflags: -I${includedir} -DXP_UNIX -DJS_THREADSAFE +diff --git a/xulrunner/installer/mozilla-nss.pc.in b/xulrunner/installer/mozilla-nss.pc.in +index 088832a..927305f 100644 +--- a/xulrunner/installer/mozilla-nss.pc.in ++++ b/xulrunner/installer/mozilla-nss.pc.in +@@ -5,6 +5,6 @@ includedir=%includedir% + Name: NSS + Description: Mozilla Network Security Services + Version: %MOZILLA_VERSION% +-Requires: %NSPR_NAME% >= %NSPR_VERSION% ++Requires: %NSPR_NAME% + Libs: -L${sdkdir}/lib -lsmime3 -lssl3 -lnss3 -lnssutil3 + Cflags: -I${includedir} diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Allow-.js-preference-files-to-set-locked-prefs-with-.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Allow-.js-preference-files-to-set-locked-prefs-with-.patch new file mode 100644 index 0000000..78190c4 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Allow-.js-preference-files-to-set-locked-prefs-with-.patch @@ -0,0 +1,115 @@ +From: Mike Hommey +Date: Sat, 21 Jun 2008 02:48:46 +0200 +Subject: Allow .js preference files to set locked prefs with lockPref() + +--- + modules/libpref/src/prefapi.cpp | 5 ++++- + modules/libpref/src/prefapi.h | 3 ++- + modules/libpref/src/prefread.cpp | 11 ++++++++--- + modules/libpref/src/prefread.h | 6 ++++-- + 4 files changed, 18 insertions(+), 7 deletions(-) + +diff --git a/modules/libpref/src/prefapi.cpp b/modules/libpref/src/prefapi.cpp +index 5ecc914..885bdf4 100644 +--- a/modules/libpref/src/prefapi.cpp ++++ b/modules/libpref/src/prefapi.cpp +@@ -976,7 +976,10 @@ void PREF_ReaderCallback(void *closure, + const char *pref, + PrefValue value, + PrefType type, +- bool isDefault) ++ bool isDefault, ++ bool isLocked) + { + pref_HashPref(pref, value, type, isDefault); ++ if (isLocked) ++ PREF_LockPref(pref, true); + } +diff --git a/modules/libpref/src/prefapi.h b/modules/libpref/src/prefapi.h +index 22a88d3..2b20c4e 100644 +--- a/modules/libpref/src/prefapi.h ++++ b/modules/libpref/src/prefapi.h +@@ -208,7 +208,8 @@ void PREF_ReaderCallback( void *closure, + const char *pref, + PrefValue value, + PrefType type, +- bool isDefault); ++ bool isDefault, ++ bool isLocked); + + PR_END_EXTERN_C + #endif +diff --git a/modules/libpref/src/prefread.cpp b/modules/libpref/src/prefread.cpp +index 893d256..d4ef51a 100644 +--- a/modules/libpref/src/prefread.cpp ++++ b/modules/libpref/src/prefread.cpp +@@ -75,6 +75,7 @@ enum { + #define BITS_PER_HEX_DIGIT 4 + + static const char kUserPref[] = "user_pref"; ++static const char kLockPref[] = "lockPref"; + static const char kPref[] = "pref"; + static const char kTrue[] = "true"; + static const char kFalse[] = "false"; +@@ -161,7 +162,7 @@ pref_DoCallback(PrefParseState *ps) + default: + break; + } +- (*ps->reader)(ps->closure, ps->lb, value, ps->vtype, ps->fdefault); ++ (*ps->reader)(ps->closure, ps->lb, value, ps->vtype, ps->fdefault, ps->flock); + return true; + } + +@@ -220,6 +221,7 @@ PREF_ParseBuf(PrefParseState *ps, const char *buf, int bufLen) + ps->vb = NULL; + ps->vtype = PREF_INVALID; + ps->fdefault = false; ++ ps->flock = false; + } + switch (c) { + case '/': /* begin comment block or line? */ +@@ -230,7 +232,9 @@ PREF_ParseBuf(PrefParseState *ps, const char *buf, int bufLen) + break; + case 'u': /* indicating user_pref */ + case 'p': /* indicating pref */ +- ps->smatch = (c == 'u' ? kUserPref : kPref); ++ case 'l': /* indicating lockPref */ ++ ps->smatch = (c == 'u' ? kUserPref : ++ (c == 'p' ? kPref : kLockPref)); + ps->sindex = 1; + ps->nextstate = PREF_PARSE_UNTIL_OPEN_PAREN; + state = PREF_PARSE_MATCH_STRING; +@@ -274,7 +278,8 @@ PREF_ParseBuf(PrefParseState *ps, const char *buf, int bufLen) + /* name parsing */ + case PREF_PARSE_UNTIL_NAME: + if (c == '\"' || c == '\'') { +- ps->fdefault = (ps->smatch == kPref); ++ ps->fdefault = (ps->smatch != kUserPref); ++ ps->flock = (ps->smatch == kLockPref); + ps->quotechar = c; + ps->nextstate = PREF_PARSE_UNTIL_COMMA; /* return here when done */ + state = PREF_PARSE_QUOTED_STRING; +diff --git a/modules/libpref/src/prefread.h b/modules/libpref/src/prefread.h +index 50f4d54..93a1702 100644 +--- a/modules/libpref/src/prefread.h ++++ b/modules/libpref/src/prefread.h +@@ -62,7 +62,8 @@ typedef void (*PrefReader)(void *closure, + const char *pref, + PrefValue val, + PrefType type, +- bool defPref); ++ bool defPref, ++ bool lockPref); + + /* structure fields are private */ + typedef struct PrefParseState { +@@ -82,7 +83,8 @@ typedef struct PrefParseState { + char *lbend; /* line buffer end */ + char *vb; /* value buffer (ptr into lb) */ + PrefType vtype; /* PREF_STRING,INT,BOOL */ +- bool fdefault; /* true if (default) pref */ ++ bool fdefault; /* true if (default) pref */ ++ bool flock; /* true if pref to be locked */ + } PrefParseState; + + /** diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Allow-webGL-with-mesa-assuming-users-will-have-updat.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Allow-webGL-with-mesa-assuming-users-will-have-updat.patch new file mode 100644 index 0000000..54ec57d --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Allow-webGL-with-mesa-assuming-users-will-have-updat.patch @@ -0,0 +1,26 @@ +From: Mike Hommey +Date: Fri, 31 Aug 2012 09:01:08 +0200 +Subject: Allow webGL with mesa, assuming users will have updated to 8.0.4-2 + on wheezy + +The version in squeeze-backports is not affected by CVE-2012-2864, and the +version in squeeze is blacklisted. +--- + widget/src/xpwidgets/GfxInfoX11.cpp | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/widget/src/xpwidgets/GfxInfoX11.cpp b/widget/src/xpwidgets/GfxInfoX11.cpp +index a2d5e0b..27a0fd0 100644 +--- a/widget/src/xpwidgets/GfxInfoX11.cpp ++++ b/widget/src/xpwidgets/GfxInfoX11.cpp +@@ -310,10 +310,6 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, + } + + if (mIsMesa) { +- if (aFeature == nsIGfxInfo::FEATURE_WEBGL_OPENGL) { +- *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; +- aSuggestedDriverVersion.AssignLiteral("Not Mesa"); +- } + if (mIsNouveau && version(mMajorVersion, mMinorVersion) < version(8,0)) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aSuggestedDriverVersion.AssignLiteral("Mesa 8.0"); diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Avoid-spurious-Run-items-in-application-handlers-con.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Avoid-spurious-Run-items-in-application-handlers-con.patch new file mode 100644 index 0000000..6225dad --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Avoid-spurious-Run-items-in-application-handlers-con.patch @@ -0,0 +1,57 @@ +From: Mike Hommey +Date: Thu, 10 Jul 2008 21:40:08 +0200 +Subject: Avoid spurious "Run" items in application handlers configuration + pane + +--- + browser/components/preferences/applications.js | 1 + + uriloader/exthandler/nsHandlerService.js | 11 +++++------ + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/browser/components/preferences/applications.js b/browser/components/preferences/applications.js +index abfec20..40cd81a 100644 +--- a/browser/components/preferences/applications.js ++++ b/browser/components/preferences/applications.js +@@ -1345,6 +1345,7 @@ var gApplicationsPane = { + return aExecutable && + aExecutable.exists() && + aExecutable.isExecutable() && ++ aExecutable.isFile() && + // XXXben - we need to compare this with the running instance executable + // just don't know how to do that via script... + // XXXmano TBD: can probably add this to nsIShellService +diff --git a/uriloader/exthandler/nsHandlerService.js b/uriloader/exthandler/nsHandlerService.js +index c4e62f6..589ba31 100644 +--- a/uriloader/exthandler/nsHandlerService.js ++++ b/uriloader/exthandler/nsHandlerService.js +@@ -658,25 +658,24 @@ HandlerService.prototype = { + + try { + file.initWithPath(aPath); +- +- if (file.exists()) +- return file; + } + catch(ex) { + // Note: for historical reasons, we don't actually check to see + // if the exception is NS_ERROR_FILE_UNRECOGNIZED_PATH, which is what + // nsILocalFile::initWithPath throws when a path is relative. +- + file = this._dirSvc.get("XCurProcD", Ci.nsIFile); + + try { + file.append(aPath); +- if (file.exists()) +- return file; + } + catch(ex) {} + } + ++ if (file && file.exists() && ++ file.isExecutable() && ++ file.isFile()) ++ return file; ++ + return null; + }, + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-515232-Try-getting-general.useragent.locale-as-a.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-515232-Try-getting-general.useragent.locale-as-a.patch new file mode 100644 index 0000000..87cf894 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-515232-Try-getting-general.useragent.locale-as-a.patch @@ -0,0 +1,41 @@ +From: Mike Hommey +Date: Sun, 26 Feb 2012 09:20:44 +0100 +Subject: Bug 515232 - Try getting general.useragent.locale as a complex value + first in DirectoryProvider.cpp + +--- + browser/components/dirprovider/DirectoryProvider.cpp | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/browser/components/dirprovider/DirectoryProvider.cpp b/browser/components/dirprovider/DirectoryProvider.cpp +index 1373adc..5df1419 100644 +--- a/browser/components/dirprovider/DirectoryProvider.cpp ++++ b/browser/components/dirprovider/DirectoryProvider.cpp +@@ -56,6 +56,7 @@ + #include "nsServiceManagerUtils.h" + #include "nsStringAPI.h" + #include "nsXULAppAPI.h" ++#include "nsIPrefLocalizedString.h" + + namespace mozilla { + namespace browser { +@@ -200,7 +201,18 @@ AppendDistroSearchDirs(nsIProperties* aDirSvc, nsCOMArray &array) + localePlugins->AppendNative(NS_LITERAL_CSTRING("locale")); + + nsCString locale; +- rv = prefs->GetCharPref("general.useragent.locale", getter_Copies(locale)); ++ nsCOMPtr prefString; ++ rv = prefs->GetComplexValue("general.useragent.locale", ++ NS_GET_IID(nsIPrefLocalizedString), ++ getter_AddRefs(prefString)); ++ if (NS_SUCCEEDED(rv)) { ++ nsAutoString wLocale; ++ prefString->GetData(getter_Copies(wLocale)); ++ CopyUTF16toUTF8(wLocale, locale); ++ } else { ++ rv = prefs->GetCharPref("general.useragent.locale", getter_Copies(locale)); ++ } ++ + if (NS_SUCCEEDED(rv)) { + + nsCOMPtr curLocalePlugins; diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-691898-Use-YARR-interpreter-instead-of-PCRE-on-p.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-691898-Use-YARR-interpreter-instead-of-PCRE-on-p.patch new file mode 100644 index 0000000..dab2016 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-691898-Use-YARR-interpreter-instead-of-PCRE-on-p.patch @@ -0,0 +1,285 @@ +From: Mike Hommey +Date: Sat, 24 Dec 2011 09:56:58 +0100 +Subject: Bug 691898 - Use YARR interpreter instead of PCRE on platforms where + YARR JIT is not supported + +--- + js/src/Makefile.in | 21 +++++++++++++-------- + js/src/vm/RegExpObject-inl.h | 28 ++++++---------------------- + js/src/vm/RegExpObject.cpp | 36 ------------------------------------ + js/src/vm/RegExpObject.h | 27 ++++++--------------------- + js/src/yarr/wtfbridge.h | 2 -- + 5 files changed, 25 insertions(+), 89 deletions(-) + +diff --git a/js/src/Makefile.in b/js/src/Makefile.in +index fc48cbd..49f0bdc 100644 +--- a/js/src/Makefile.in ++++ b/js/src/Makefile.in +@@ -416,15 +416,20 @@ CPPSRCS += checks.cc \ + + ifeq (,$(filter arm% sparc %86 x86_64,$(TARGET_CPU))) + +-VPATH += $(srcdir)/yarr/pcre \ ++VPATH += $(srcdir)/assembler \ ++ $(srcdir)/assembler/wtf \ ++ $(srcdir)/yarr \ + $(NULL) + + CPPSRCS += \ +- pcre_compile.cpp \ +- pcre_exec.cpp \ +- pcre_tables.cpp \ +- pcre_xclass.cpp \ +- pcre_ucp_searchfuncs.cpp \ ++ Assertions.cpp \ ++ OSAllocatorOS2.cpp \ ++ OSAllocatorPosix.cpp \ ++ OSAllocatorWin.cpp \ ++ PageBlock.cpp \ ++ YarrInterpreter.cpp \ ++ YarrPattern.cpp \ ++ YarrSyntaxChecker.cpp \ + $(NULL) + else + +@@ -1015,10 +1020,10 @@ endif + # Needed to "configure" it correctly. Unfortunately these + # flags wind up being applied to all code in js/src, not just + # the code in js/src/assembler. +-CXXFLAGS += -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 ++CXXFLAGS += -DUSE_SYSTEM_MALLOC=1 + + ifneq (,$(ENABLE_YARR_JIT)$(ENABLE_TRACEJIT)$(ENABLE_METHODJIT)) +-CXXFLAGS += -DENABLE_JIT=1 ++CXXFLAGS += -DENABLE_JIT=1 -DENABLE_ASSEMBLER=1 + endif + + INCLUDES += -I$(srcdir)/assembler -I$(srcdir)/yarr +diff --git a/js/src/vm/RegExpObject-inl.h b/js/src/vm/RegExpObject-inl.h +index 5f7817d..91108a7 100644 +--- a/js/src/vm/RegExpObject-inl.h ++++ b/js/src/vm/RegExpObject-inl.h +@@ -327,6 +327,7 @@ RegExpPrivate::create(JSContext *cx, JSString *source, RegExpFlag flags, TokenSt + return RetType(self); + } + ++#if ENABLE_YARR_JIT + /* This function should be deleted once bad Android platforms phase out. See bug 604774. */ + inline bool + RegExpPrivateCode::isJITRuntimeEnabled(JSContext *cx) +@@ -337,12 +338,12 @@ RegExpPrivateCode::isJITRuntimeEnabled(JSContext *cx) + return true; + #endif + } ++#endif + + inline bool + RegExpPrivateCode::compile(JSContext *cx, JSLinearString &pattern, TokenStream *ts, + uintN *parenCount, RegExpFlag flags) + { +-#if ENABLE_YARR_JIT + /* Parse the pattern. */ + ErrorCode yarrError; + YarrPattern yarrPattern(pattern, bool(flags & IgnoreCaseFlag), bool(flags & MultilineFlag), +@@ -359,7 +360,7 @@ RegExpPrivateCode::compile(JSContext *cx, JSLinearString &pattern, TokenStream * + * case we have to bytecode compile it. + */ + +-#ifdef JS_METHODJIT ++#if ENABLE_YARR_JIT && defined(JS_METHODJIT) + if (isJITRuntimeEnabled(cx) && !yarrPattern.m_containsBackreferences) { + if (!cx->compartment->ensureJaegerCompartmentExists(cx)) + return false; +@@ -371,21 +372,11 @@ RegExpPrivateCode::compile(JSContext *cx, JSLinearString &pattern, TokenStream * + } + #endif + ++#if ENABLE_YARR_JIT + codeBlock.setFallBack(true); ++#endif + byteCode = byteCompile(yarrPattern, cx->compartment->regExpAllocator).get(); + return true; +-#else /* !defined(ENABLE_YARR_JIT) */ +- int error = 0; +- compiled = jsRegExpCompile(pattern.chars(), pattern.length(), +- ignoreCase() ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase, +- multiline() ? JSRegExpMultiline : JSRegExpSingleLine, +- parenCount, &error); +- if (error) { +- reportPCREError(cx, error); +- return false; +- } +- return true; +-#endif + } + + inline bool +@@ -431,19 +422,12 @@ RegExpPrivateCode::execute(JSContext *cx, const jschar *chars, size_t start, siz + else + result = JSC::Yarr::execute(codeBlock, chars, start, length, output); + #else +- result = jsRegExpExecute(cx, compiled, chars, length, start, output, outputCount); ++ result = JSC::Yarr::interpret(byteCode, chars, start, length, output); + #endif + + if (result == -1) + return Success_NotFound; + +-#if !ENABLE_YARR_JIT +- if (result < 0) { +- reportPCREError(cx, result); +- return Error; +- } +-#endif +- + JS_ASSERT(result >= 0); + return Success; + } +diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp +index f75c6a5..7631dd5 100644 +--- a/js/src/vm/RegExpObject.cpp ++++ b/js/src/vm/RegExpObject.cpp +@@ -251,7 +251,6 @@ Class js::RegExpClass = { + NULL /* trace */ + }; + +-#if ENABLE_YARR_JIT + void + RegExpPrivateCode::reportYarrError(JSContext *cx, TokenStream *ts, ErrorCode error) + { +@@ -283,41 +282,6 @@ RegExpPrivateCode::reportYarrError(JSContext *cx, TokenStream *ts, ErrorCode err + } + } + +-#else /* !ENABLE_YARR_JIT */ +- +-void +-RegExpPrivateCode::reportPCREError(JSContext *cx, int error) +-{ +-#define REPORT(msg_) \ +- JS_ReportErrorFlagsAndNumberUC(cx, JSREPORT_ERROR, js_GetErrorMessage, NULL, msg_); \ +- return +- switch (error) { +- case -2: REPORT(JSMSG_REGEXP_TOO_COMPLEX); +- case 0: JS_NOT_REACHED("Precondition violation: an error must have occurred."); +- case 1: REPORT(JSMSG_TRAILING_SLASH); +- case 2: REPORT(JSMSG_TRAILING_SLASH); +- case 3: REPORT(JSMSG_REGEXP_TOO_COMPLEX); +- case 4: REPORT(JSMSG_BAD_QUANTIFIER); +- case 5: REPORT(JSMSG_BAD_QUANTIFIER); +- case 6: REPORT(JSMSG_BAD_CLASS_RANGE); +- case 7: REPORT(JSMSG_REGEXP_TOO_COMPLEX); +- case 8: REPORT(JSMSG_BAD_CLASS_RANGE); +- case 9: REPORT(JSMSG_BAD_QUANTIFIER); +- case 10: REPORT(JSMSG_UNMATCHED_RIGHT_PAREN); +- case 11: REPORT(JSMSG_REGEXP_TOO_COMPLEX); +- case 12: REPORT(JSMSG_UNMATCHED_RIGHT_PAREN); +- case 13: REPORT(JSMSG_REGEXP_TOO_COMPLEX); +- case 14: REPORT(JSMSG_MISSING_PAREN); +- case 15: REPORT(JSMSG_BAD_BACKREF); +- case 16: REPORT(JSMSG_REGEXP_TOO_COMPLEX); +- case 17: REPORT(JSMSG_REGEXP_TOO_COMPLEX); +- default: +- JS_NOT_REACHED("Precondition violation: unknown PCRE error code."); +- } +-#undef REPORT +-} +-#endif /* ENABLE_YARR_JIT */ +- + bool + js::ParseRegExpFlags(JSContext *cx, JSString *flagStr, RegExpFlag *flagsOut) + { +diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h +index 1449d56..279f3c0 100644 +--- a/js/src/vm/RegExpObject.h ++++ b/js/src/vm/RegExpObject.h +@@ -49,8 +49,6 @@ + #include "yarr/Yarr.h" + #if ENABLE_YARR_JIT + #include "yarr/YarrJIT.h" +-#else +-#include "yarr/pcre/pcre.h" + #endif + + namespace js { +@@ -153,48 +151,39 @@ ResetRegExpObject(JSContext *cx, AlreadyIncRefed rep); + /* Abstracts away the gross |RegExpPrivate| backend details. */ + class RegExpPrivateCode + { +-#if ENABLE_YARR_JIT + typedef JSC::Yarr::BytecodePattern BytecodePattern; + typedef JSC::Yarr::ErrorCode ErrorCode; ++ typedef JSC::Yarr::YarrPattern YarrPattern; ++#if ENABLE_YARR_JIT + typedef JSC::Yarr::JSGlobalData JSGlobalData; + typedef JSC::Yarr::YarrCodeBlock YarrCodeBlock; +- typedef JSC::Yarr::YarrPattern YarrPattern; + + /* Note: Native code is valid only if |codeBlock.isFallBack() == false|. */ + YarrCodeBlock codeBlock; +- BytecodePattern *byteCode; +-#else +- JSRegExp *compiled; + #endif ++ BytecodePattern *byteCode; + + public: + RegExpPrivateCode() + : + #if ENABLE_YARR_JIT + codeBlock(), +- byteCode(NULL) +-#else +- compiled(NULL) + #endif ++ byteCode(NULL) + { } + + ~RegExpPrivateCode() { + #if ENABLE_YARR_JIT + codeBlock.release(); ++#endif + if (byteCode) + Foreground::delete_(byteCode); +-#else +- if (compiled) +- jsRegExpFree(compiled); +-#endif + } + + #if ENABLE_YARR_JIT + static inline bool isJITRuntimeEnabled(JSContext *cx); +- void reportYarrError(JSContext *cx, TokenStream *ts, JSC::Yarr::ErrorCode error); +-#else +- void reportPCREError(JSContext *cx, int error); + #endif ++ void reportYarrError(JSContext *cx, TokenStream *ts, JSC::Yarr::ErrorCode error); + + inline bool compile(JSContext *cx, JSLinearString &pattern, TokenStream *ts, uintN *parenCount, + RegExpFlag flags); +@@ -205,11 +194,7 @@ class RegExpPrivateCode + int *output, size_t outputCount); + + static size_t getOutputSize(size_t pairCount) { +-#if ENABLE_YARR_JIT + return pairCount * 2; +-#else +- return pairCount * 3; /* Should be x2, but PCRE has... needs. */ +-#endif + } + }; + +diff --git a/js/src/yarr/wtfbridge.h b/js/src/yarr/wtfbridge.h +index ac41d08..fb8eb86 100644 +--- a/js/src/yarr/wtfbridge.h ++++ b/js/src/yarr/wtfbridge.h +@@ -49,9 +49,7 @@ + #include "jsprvtd.h" + #include "vm/String.h" + #include "assembler/wtf/Platform.h" +-#if ENABLE_YARR_JIT + #include "assembler/jit/ExecutableAllocator.h" +-#endif + + namespace JSC { namespace Yarr { + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-696636-Block-OpenGL-1-drivers-explicitly-to-stee.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-696636-Block-OpenGL-1-drivers-explicitly-to-stee.patch new file mode 100644 index 0000000..4f0ffc9 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-696636-Block-OpenGL-1-drivers-explicitly-to-stee.patch @@ -0,0 +1,69 @@ +From: Benoit Jacob +Date: Thu, 23 Feb 2012 17:21:30 -0500 +Subject: Bug 696636 - Block OpenGL 1 drivers explicitly to steer clear of + crashes - r=mattwoodrow + +--- + widget/src/xpwidgets/GfxInfoX11.cpp | 14 +++++++++++++- + widget/src/xpwidgets/GfxInfoX11.h | 2 +- + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/widget/src/xpwidgets/GfxInfoX11.cpp b/widget/src/xpwidgets/GfxInfoX11.cpp +index 018b8fa..4974c5f 100644 +--- a/widget/src/xpwidgets/GfxInfoX11.cpp ++++ b/widget/src/xpwidgets/GfxInfoX11.cpp +@@ -61,6 +61,7 @@ pid_t glxtest_pid = 0; + nsresult + GfxInfo::Init() + { ++ mGLMajorVersion = 0; + mMajorVersion = 0; + mMinorVersion = 0; + mRevisionVersion = 0; +@@ -195,6 +196,9 @@ GfxInfo::GetData() + CrashReporter::AppendAppNotesToCrashReport(note); + #endif + ++ // determine the major OpenGL version. That's the first integer in the version string. ++ mGLMajorVersion = strtol(mVersion.get(), 0, 10); ++ + // determine driver type (vendor) and where in the version string + // the actual driver version numbers should be expected to be found (whereToReadVersionNumbers) + const char *whereToReadVersionNumbers = nsnull; +@@ -219,7 +223,7 @@ GfxInfo::GetData() + whereToReadVersionNumbers = mVersion.get(); + } + +- // read major.minor version numbers ++ // read major.minor version numbers of the driver (not to be confused with the OpenGL version) + if (whereToReadVersionNumbers) { + // copy into writable buffer, for tokenization + strncpy(buf, whereToReadVersionNumbers, buf_size); +@@ -275,6 +279,14 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, + + OperatingSystem os = DRIVER_OS_LINUX; + ++ if (mGLMajorVersion == 1) { ++ // We're on OpenGL 1. In most cases that indicates really old hardware. ++ // We better block them, rather than rely on them to fail gracefully, because they don't! ++ // see bug 696636 ++ *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; ++ return NS_OK; ++ } ++ + // Disable OpenGL layers when we don't have texture_from_pixmap because it regresses performance. + if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS && !mHasTextureFromPixmap) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; +diff --git a/widget/src/xpwidgets/GfxInfoX11.h b/widget/src/xpwidgets/GfxInfoX11.h +index 2525db0..03878ff 100644 +--- a/widget/src/xpwidgets/GfxInfoX11.h ++++ b/widget/src/xpwidgets/GfxInfoX11.h +@@ -95,7 +95,7 @@ private: + nsCString mAdapterDescription; + bool mIsMesa, mIsNVIDIA, mIsFGLRX; + bool mHasTextureFromPixmap; +- int mMajorVersion, mMinorVersion, mRevisionVersion; ++ int mGLMajorVersion, mMajorVersion, mMinorVersion, mRevisionVersion; + + void AddCrashReportAnnotations(); + }; diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-706724-Fix-for-error-ftruncate-was-not-declared-.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-706724-Fix-for-error-ftruncate-was-not-declared-.patch new file mode 100644 index 0000000..0d3bd9f --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-706724-Fix-for-error-ftruncate-was-not-declared-.patch @@ -0,0 +1,26 @@ +From: aceman +Date: Wed, 11 Jan 2012 10:46:54 +0100 +Subject: =?UTF-8?q?Bug=20706724=20-=20Fix=20for=20error:=20=E2=80=98ftruncat?= + =?UTF-8?q?e=E2=80=99=20was=20not=20declared=20in=20this=20scope.=20r=3Dbenj?= + =?UTF-8?q?amin?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + ipc/chromium/src/base/file_util.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ipc/chromium/src/base/file_util.cc b/ipc/chromium/src/base/file_util.cc +index 1154fed..6067a4a 100644 +--- a/ipc/chromium/src/base/file_util.cc ++++ b/ipc/chromium/src/base/file_util.cc +@@ -8,7 +8,7 @@ + #include + #endif + #include +-#if defined(ANDROID) ++#if defined(ANDROID) || defined(OS_POSIX) + #include + #endif + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-709259-Try-creating-a-named-cursor-before-a-bitm.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-709259-Try-creating-a-named-cursor-before-a-bitm.patch new file mode 100644 index 0000000..23c90a2 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-709259-Try-creating-a-named-cursor-before-a-bitm.patch @@ -0,0 +1,85 @@ +From: Chris Coulson +Date: Wed, 14 Dec 2011 11:34:31 +0100 +Subject: Bug 709259 - Try creating a named cursor before a bitmap cursor. + r=karlt + +--- + widget/src/gtk2/nsGtkCursors.h | 31 +++++++++++++++++-------------- + widget/src/gtk2/nsWindow.cpp | 14 +++++++++++--- + 2 files changed, 28 insertions(+), 17 deletions(-) + +diff --git a/widget/src/gtk2/nsGtkCursors.h b/widget/src/gtk2/nsGtkCursors.h +index b8065eb..eff43ba 100644 +--- a/widget/src/gtk2/nsGtkCursors.h ++++ b/widget/src/gtk2/nsGtkCursors.h +@@ -46,6 +46,7 @@ typedef struct { + const unsigned char *mask_bits; + int hot_x; + int hot_y; ++ const char *hash; + } nsGtkCursor; + + /* MOZ_CURSOR_HAND_GRAB */ +@@ -415,21 +416,23 @@ enum { + MOZ_CURSOR_NONE + }; + +-// create custom pixmap cursor ++// create custom pixmap cursor. The hash values must stay in sync with the ++// bitmap data above. To see the hash function, have a look at XcursorImageHash ++// in libXcursor + static const nsGtkCursor GtkCursors[] = { +- { moz_hand_grab_bits, moz_hand_grab_mask_bits, 10, 10 }, +- { moz_hand_grabbing_bits, moz_hand_grabbing_mask_bits, 10, 10 }, +- { moz_copy_bits, moz_copy_mask_bits, 2, 2 }, +- { moz_alias_bits, moz_alias_mask_bits, 2, 2 }, +- { moz_menu_bits, moz_menu_mask_bits, 2, 2 }, +- { moz_spinning_bits, moz_spinning_mask_bits, 2, 2 }, +- { moz_zoom_in_bits, moz_zoom_in_mask_bits, 6, 6 }, +- { moz_zoom_out_bits, moz_zoom_out_mask_bits, 6, 6 }, +- { moz_not_allowed_bits, moz_not_allowed_mask_bits, 9, 9 }, +- { moz_vertical_text_bits, moz_vertical_text_mask_bits, 8, 4 }, +- { moz_nesw_resize_bits, moz_nesw_resize_mask_bits, 8, 8 }, +- { moz_nwse_resize_bits, moz_nwse_resize_mask_bits, 8, 8 }, +- { moz_none_bits, moz_none_mask_bits, 0, 0 } ++ { moz_hand_grab_bits, moz_hand_grab_mask_bits, 10, 10, "5aca4d189052212118709018842178c0" }, ++ { moz_hand_grabbing_bits, moz_hand_grabbing_mask_bits, 10, 10, "208530c400c041818281048008011002" }, ++ { moz_copy_bits, moz_copy_mask_bits, 2, 2, "08ffe1cb5fe6fc01f906f1c063814ccf" }, ++ { moz_alias_bits, moz_alias_mask_bits, 2, 2, "0876e1c15ff2fc01f906f1c363074c0f" }, ++ { moz_menu_bits, moz_menu_mask_bits, 2, 2, "08ffe1e65f80fcfdf9fff11263e74c48" }, ++ { moz_spinning_bits, moz_spinning_mask_bits, 2, 2, "08e8e1c95fe2fc01f976f1e063a24ccd" }, ++ { moz_zoom_in_bits, moz_zoom_in_mask_bits, 6, 6, "f41c0e382c94c0958e07017e42b00462" }, ++ { moz_zoom_out_bits, moz_zoom_out_mask_bits, 6, 6, "f41c0e382c97c0938e07017e42800402" }, ++ { moz_not_allowed_bits, moz_not_allowed_mask_bits, 9, 9, "03b6e0fcb3499374a867d041f52298f0" }, ++ { moz_vertical_text_bits, moz_vertical_text_mask_bits, 8, 4, "048008013003cff3c00c801001200000" }, ++ { moz_nesw_resize_bits, moz_nesw_resize_mask_bits, 8, 8, "50585d75b494802d0151028115016902" }, ++ { moz_nwse_resize_bits, moz_nwse_resize_mask_bits, 8, 8, "38c5dff7c7b8962045400281044508d2" }, ++ { moz_none_bits, moz_none_mask_bits, 0, 0, NULL } + }; + + #endif /* nsGtkCursors_h__ */ +diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp +index 2fd6f64..25f1c2a 100644 +--- a/widget/src/gtk2/nsWindow.cpp ++++ b/widget/src/gtk2/nsWindow.cpp +@@ -5602,9 +5602,17 @@ get_gtk_cursor(nsCursor aCursor) + break; + } + +- // if by now we don't have a xcursor, this means we have to make a +- // custom one +- if (newType != 0xff) { ++ // If by now we don't have a xcursor, this means we have to make a custom ++ // one. First, we try creating a named cursor based on the hash of our ++ // custom bitmap, as libXcursor has some magic to convert bitmapped cursors ++ // to themed cursors ++ if (newType != 0xFF && GtkCursors[newType].hash) { ++ gdkcursor = gdk_cursor_new_from_name(gdk_display_get_default(), ++ GtkCursors[newType].hash); ++ } ++ ++ // If we still don't have a xcursor, we now really create a bitmap cursor ++ if (newType != 0xff && !gdkcursor) { + GdkPixbuf * cursor_pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 32, 32); + if (!cursor_pixbuf) + return NULL; diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-720682-Don-t-crash-an-app-using-libxul-because-o.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-720682-Don-t-crash-an-app-using-libxul-because-o.patch new file mode 100644 index 0000000..7bc22a6 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-720682-Don-t-crash-an-app-using-libxul-because-o.patch @@ -0,0 +1,23 @@ +From: Mike Hommey +Date: Sat, 25 Feb 2012 10:34:52 +0100 +Subject: Bug 720682 - Don't crash an app using libxul because of the lack of + je_malloc_usable_size_in_advance + +--- + storage/src/mozStorageService.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/storage/src/mozStorageService.cpp b/storage/src/mozStorageService.cpp +index 7c0a7a0..8a1aa65 100644 +--- a/storage/src/mozStorageService.cpp ++++ b/storage/src/mozStorageService.cpp +@@ -367,7 +367,8 @@ static int sqliteMemSize(void* p) + + static int sqliteMemRoundup(int n) + { +- n = je_malloc_usable_size_in_advance(n); ++ if (je_malloc_usable_size_in_advance) ++ n = je_malloc_usable_size_in_advance(n); + + // jemalloc can return blocks of size 2 and 4, but SQLite requires that all + // allocations be 8-aligned. So we round up sub-8 requests to 8. This diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-722127-Bump-required-libvpx-version-to-1.0.0.-r-.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-722127-Bump-required-libvpx-version-to-1.0.0.-r-.patch new file mode 100644 index 0000000..cef3817 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-722127-Bump-required-libvpx-version-to-1.0.0.-r-.patch @@ -0,0 +1,47 @@ +From: ojab +Date: Mon, 30 Jan 2012 15:53:21 +0100 +Subject: Bug 722127 - Bump required libvpx version to 1.0.0. r=tterribe + +--- + configure.in | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/configure.in b/configure.in +index 6b155e0..d83926e 100644 +--- a/configure.in ++++ b/configure.in +@@ -5616,20 +5616,20 @@ if test -n "$MOZ_WEBM"; then + [MOZ_NATIVE_LIBVPX_DEC_TEST=1], + ([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found])) + if test -n "$MOZ_NATIVE_LIBVPX_DEC_TEST" ; then +- AC_MSG_CHECKING([for libvpx version >= v0.9.7]) ++ AC_MSG_CHECKING([for libvpx version >= v1.0.0]) + dnl We need at least v0.9.7 to fix several crash bugs (for which we +- dnl had local patches prior to v0.9.7). ++ dnl had local patches prior to v1.0.0). + dnl + dnl This is a terrible test for the library version, but we don't + dnl have a good one. There is no version number in a public header, + dnl and testing the headers still doesn't guarantee we link against + dnl the right version. While we could call vpx_codec_version() at + dnl run-time, that would break cross-compiling. There are no +- dnl additional exported symbols between the v0.9.7 release and the +- dnl v0.9.6 one to check for. ++ dnl additional exported decoder symbols between the v1.0.0 release ++ dnl and the v0.9.7 one to check for. + AC_TRY_COMPILE([ + #include +- #if !defined(VPX_CODEC_USE_INPUT_PARTITION) ++ #if !defined(VPX_CODEC_USE_INPUT_FRAGMENTS) + #error "test failed." + #endif + ], +@@ -5639,7 +5639,7 @@ if test -n "$MOZ_WEBM"; then + MOZ_LIBVPX_INCLUDES="-I${LIBVPX_DIR}/include" + MOZ_LIBVPX_LIBS="-L${LIBVPX_DIR}/lib -lvpx"], + [AC_MSG_RESULT([no]) +- AC_MSG_ERROR([--with-system-libvpx requested but it is not v0.9.7 or later])]) ++ AC_MSG_ERROR([--with-system-libvpx requested but it is not v1.0.0 or later])]) + fi + CFLAGS=$_SAVE_CFLAGS + LDFLAGS=$_SAVE_LDFLAGS diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-725655-gcc-4.7-build-failures-missing-headers-.-.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-725655-gcc-4.7-build-failures-missing-headers-.-.patch new file mode 100644 index 0000000..1db1a28 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-725655-gcc-4.7-build-failures-missing-headers-.-.patch @@ -0,0 +1,52 @@ +From: =?UTF-8?q?Martin=20Str=C3=A1nsk=C3=BD?= +Date: Fri, 10 Feb 2012 16:07:41 +0100 +Subject: Bug 725655 - gcc 4.7 build failures (missing headers). r=benjamin + +--- + ipc/chromium/src/base/file_util_linux.cc | 3 +++ + ipc/chromium/src/base/message_pump_libevent.cc | 3 +++ + ipc/chromium/src/base/time_posix.cc | 3 +++ + 3 files changed, 9 insertions(+) + +diff --git a/ipc/chromium/src/base/file_util_linux.cc b/ipc/chromium/src/base/file_util_linux.cc +index cca706f..171e44f 100644 +--- a/ipc/chromium/src/base/file_util_linux.cc ++++ b/ipc/chromium/src/base/file_util_linux.cc +@@ -5,6 +5,9 @@ + #include "base/file_util.h" + + #include ++#if defined(ANDROID) || defined(OS_POSIX) ++#include ++#endif + + #include + #include +diff --git a/ipc/chromium/src/base/message_pump_libevent.cc b/ipc/chromium/src/base/message_pump_libevent.cc +index 6194f79..9f31dbb 100644 +--- a/ipc/chromium/src/base/message_pump_libevent.cc ++++ b/ipc/chromium/src/base/message_pump_libevent.cc +@@ -6,6 +6,9 @@ + + #include + #include ++#if defined(ANDROID) || defined(OS_POSIX) ++#include ++#endif + + #include "eintr_wrapper.h" + #include "base/logging.h" +diff --git a/ipc/chromium/src/base/time_posix.cc b/ipc/chromium/src/base/time_posix.cc +index 8d1a1d5..abf2a56 100644 +--- a/ipc/chromium/src/base/time_posix.cc ++++ b/ipc/chromium/src/base/time_posix.cc +@@ -13,6 +13,9 @@ + #else + #include + #endif ++#if defined(ANDROID) || defined(OS_POSIX) ++#include ++#endif + + #include + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-728229-Allow-to-build-with-system-python-ply-lib.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-728229-Allow-to-build-with-system-python-ply-lib.patch new file mode 100644 index 0000000..b3e4c52 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-728229-Allow-to-build-with-system-python-ply-lib.patch @@ -0,0 +1,82 @@ +From: Mike Hommey +Date: Fri, 17 Feb 2012 16:53:34 +0100 +Subject: Bug 728229 - Allow to build with system python ply library + +--- + config/autoconf.mk.in | 2 ++ + configure.in | 10 ++++++++++ + xpcom/idl-parser/Makefile.in | 2 ++ + xpcom/typelib/xpidl/Makefile.in | 2 ++ + 4 files changed, 16 insertions(+) + +diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in +index fccb1a9..e13dce4 100644 +--- a/config/autoconf.mk.in ++++ b/config/autoconf.mk.in +@@ -685,6 +685,8 @@ JS_SHARED_LIBRARY = @JS_SHARED_LIBRARY@ + + MOZ_INSTRUMENT_EVENT_LOOP = @MOZ_INSTRUMENT_EVENT_LOOP@ + ++MOZ_SYSTEM_PLY = @MOZ_SYSTEM_PLY@ ++ + # We only want to do the pymake sanity on Windows, other os's can cope + ifeq ($(HOST_OS_ARCH),WINNT) + # Ensure invariants between GNU Make and pymake +diff --git a/configure.in b/configure.in +index d83926e..3c32ae8 100644 +--- a/configure.in ++++ b/configure.in +@@ -1021,6 +1021,16 @@ if test -z "$PYTHON"; then + AC_MSG_ERROR([python was not found in \$PATH]) + fi + ++MOZ_ARG_WITH_BOOL(system-ply, ++[ --with-system-ply Use system installed python ply library], ++ [if $PYTHON -c 'import ply' 2>&5; then ++ MOZ_SYSTEM_PLY=1 ++ else ++ AC_MSG_ERROR([python ply library is not found but --with-system-ply was requested]) ++ fi]) ++ ++AC_SUBST(MOZ_SYSTEM_PLY) ++ + if test -z "$COMPILE_ENVIRONMENT"; then + NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py' + fi +diff --git a/xpcom/idl-parser/Makefile.in b/xpcom/idl-parser/Makefile.in +index 20ca148..f5ff178 100644 +--- a/xpcom/idl-parser/Makefile.in ++++ b/xpcom/idl-parser/Makefile.in +@@ -47,10 +47,12 @@ PARSER_SRCS = \ + xpidl.py \ + $(NULL) + ++ifndef MOZ_SYSTEM_PLY + PLY_PROGS = \ + $(topsrcdir)/other-licenses/ply/ply/lex.py \ + $(topsrcdir)/other-licenses/ply/ply/yacc.py \ + $(NULL) ++endif + + include $(topsrcdir)/config/rules.mk + +diff --git a/xpcom/typelib/xpidl/Makefile.in b/xpcom/typelib/xpidl/Makefile.in +index 30f1a66..bcae13a 100644 +--- a/xpcom/typelib/xpidl/Makefile.in ++++ b/xpcom/typelib/xpidl/Makefile.in +@@ -52,6 +52,7 @@ SDK_BINARY = \ + $(DEPTH)/xpcom/idl-parser/xpidlyacc.py \ + $(NULL) + ++ifndef MOZ_SYSTEM_PLY + $(SDK_BIN_DIR)/ply:: + $(NSINSTALL) -D $@ + +@@ -63,6 +64,7 @@ PLY_SRCS = \ + + export:: $(PLY_SRCS) $(SDK_BIN_DIR)/ply + $(INSTALL) $(IFLAGS2) $^ ++endif + + include $(topsrcdir)/config/rules.mk + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-729817-Allow-the-Nouveau-driver-with-Mesa-8.0.1-.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-729817-Allow-the-Nouveau-driver-with-Mesa-8.0.1-.patch new file mode 100644 index 0000000..40b010d --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-729817-Allow-the-Nouveau-driver-with-Mesa-8.0.1-.patch @@ -0,0 +1,24 @@ +From: Zack Weinberg +Date: Fri, 9 Mar 2012 11:07:16 +0100 +Subject: Bug 729817 - Allow the Nouveau driver with Mesa >= 8.0.1 - r=bjacob + +--- + widget/src/xpwidgets/GfxInfoX11.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/widget/src/xpwidgets/GfxInfoX11.cpp b/widget/src/xpwidgets/GfxInfoX11.cpp +index c6b2ad3..a2d5e0b 100644 +--- a/widget/src/xpwidgets/GfxInfoX11.cpp ++++ b/widget/src/xpwidgets/GfxInfoX11.cpp +@@ -314,9 +314,9 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aSuggestedDriverVersion.AssignLiteral("Not Mesa"); + } +- if (mIsNouveau) { ++ if (mIsNouveau && version(mMajorVersion, mMinorVersion) < version(8,0)) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; +- aSuggestedDriverVersion.AssignLiteral(""); ++ aSuggestedDriverVersion.AssignLiteral("Mesa 8.0"); + } else if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(7,10,3)) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aSuggestedDriverVersion.AssignLiteral("Mesa 7.10.3"); diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-729817-Block-the-Nouveau-3D-driver-as-it-s-insta.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-729817-Block-the-Nouveau-3D-driver-as-it-s-insta.patch new file mode 100644 index 0000000..7e2f3a6 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-729817-Block-the-Nouveau-3D-driver-as-it-s-insta.patch @@ -0,0 +1,56 @@ +From: Benoit Jacob +Date: Thu, 23 Feb 2012 17:23:29 -0500 +Subject: Bug 729817 - Block the Nouveau 3D driver as it's installed by + default on OpenSuse 12.1 and crashes - r=mattwoodrow + +--- + widget/src/xpwidgets/GfxInfoX11.cpp | 8 +++++++- + widget/src/xpwidgets/GfxInfoX11.h | 2 +- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/widget/src/xpwidgets/GfxInfoX11.cpp b/widget/src/xpwidgets/GfxInfoX11.cpp +index 4974c5f..c6b2ad3 100644 +--- a/widget/src/xpwidgets/GfxInfoX11.cpp ++++ b/widget/src/xpwidgets/GfxInfoX11.cpp +@@ -68,6 +68,7 @@ GfxInfo::Init() + mIsMesa = false; + mIsNVIDIA = false; + mIsFGLRX = false; ++ mIsNouveau = false; + mHasTextureFromPixmap = false; + return GfxInfoBase::Init(); + } +@@ -208,6 +209,8 @@ GfxInfo::GetData() + // with Mesa, the version string contains "Mesa major.minor" and that's all the version information we get: + // there is no actual driver version info. + whereToReadVersionNumbers = Mesa_in_version_string + strlen("Mesa"); ++ if (strcasestr(mVendor.get(), "nouveau")) ++ mIsNouveau = true; + } else if (strstr(mVendor.get(), "NVIDIA Corporation")) { + mIsNVIDIA = true; + // with the NVIDIA driver, the version string contains "NVIDIA major.minor" +@@ -311,7 +314,10 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aSuggestedDriverVersion.AssignLiteral("Not Mesa"); + } +- if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(7,10,3)) { ++ if (mIsNouveau) { ++ *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; ++ aSuggestedDriverVersion.AssignLiteral(""); ++ } else if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(7,10,3)) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aSuggestedDriverVersion.AssignLiteral("Mesa 7.10.3"); + } +diff --git a/widget/src/xpwidgets/GfxInfoX11.h b/widget/src/xpwidgets/GfxInfoX11.h +index 03878ff..68bf976 100644 +--- a/widget/src/xpwidgets/GfxInfoX11.h ++++ b/widget/src/xpwidgets/GfxInfoX11.h +@@ -93,7 +93,7 @@ private: + nsCString mRenderer; + nsCString mVersion; + nsCString mAdapterDescription; +- bool mIsMesa, mIsNVIDIA, mIsFGLRX; ++ bool mIsMesa, mIsNVIDIA, mIsFGLRX, mIsNouveau; + bool mHasTextureFromPixmap; + int mGLMajorVersion, mMajorVersion, mMinorVersion, mRevisionVersion; + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-734490-fix-build-failures-with-Clang-and-GCC-4.7.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-734490-fix-build-failures-with-Clang-and-GCC-4.7.patch new file mode 100644 index 0000000..a2ee22e --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-734490-fix-build-failures-with-Clang-and-GCC-4.7.patch @@ -0,0 +1,76 @@ +From: Stefan +Date: Thu, 15 Mar 2012 11:01:08 -0700 +Subject: Bug 734490: fix build failures with Clang and GCC 4.7 in + TestPoisonArea.cpp. r=zwol + +--- + layout/base/tests/TestPoisonArea.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/layout/base/tests/TestPoisonArea.cpp b/layout/base/tests/TestPoisonArea.cpp +index f81ce1b..6cf4afd 100644 +--- a/layout/base/tests/TestPoisonArea.cpp ++++ b/layout/base/tests/TestPoisonArea.cpp +@@ -397,7 +397,7 @@ ReservePoisonArea() + uintptr_t result = (((uintptr_t(0x7FFFFFFFu) << 31) << 1 | + uintptr_t(0xF0DEAFFFu)) & + ~uintptr_t(PAGESIZE-1)); +- printf("INFO | poison area assumed at 0x%.*"PRIxPTR"\n", SIZxPTR, result); ++ printf("INFO | poison area assumed at 0x%.*" PRIxPTR "\n", SIZxPTR, result); + return result; + } else { + // First see if we can allocate the preferred poison address from the OS. +@@ -405,7 +405,7 @@ ReservePoisonArea() + void *result = ReserveRegion(candidate, false); + if (result == (void *)candidate) { + // success - inaccessible page allocated +- printf("INFO | poison area allocated at 0x%.*"PRIxPTR ++ printf("INFO | poison area allocated at 0x%.*" PRIxPTR + " (preferred addr)\n", SIZxPTR, (uintptr_t)result); + return candidate; + } +@@ -416,7 +416,7 @@ ReservePoisonArea() + // success - selected page cannot be usable memory + if (result != MAP_FAILED) + ReleaseRegion(result); +- printf("INFO | poison area assumed at 0x%.*"PRIxPTR ++ printf("INFO | poison area assumed at 0x%.*" PRIxPTR + " (preferred addr)\n", SIZxPTR, candidate); + return candidate; + } +@@ -424,7 +424,7 @@ ReservePoisonArea() + // The preferred address is already in use. Did the OS give us a + // consolation prize? + if (result != MAP_FAILED) { +- printf("INFO | poison area allocated at 0x%.*"PRIxPTR ++ printf("INFO | poison area allocated at 0x%.*" PRIxPTR + " (consolation prize)\n", SIZxPTR, (uintptr_t)result); + return (uintptr_t)result; + } +@@ -433,7 +433,7 @@ ReservePoisonArea() + // the address. + result = ReserveRegion(0, false); + if (result != MAP_FAILED) { +- printf("INFO | poison area allocated at 0x%.*"PRIxPTR ++ printf("INFO | poison area allocated at 0x%.*" PRIxPTR + " (fallback)\n", SIZxPTR, (uintptr_t)result); + return (uintptr_t)result; + } +@@ -455,7 +455,7 @@ ReservePositiveControl() + printf("ERROR | allocating positive control | %s\n", LastErrMsg()); + return 0; + } +- printf("INFO | positive control allocated at 0x%.*"PRIxPTR"\n", ++ printf("INFO | positive control allocated at 0x%.*" PRIxPTR "\n", + SIZxPTR, (uintptr_t)result); + return (uintptr_t)result; + } +@@ -486,7 +486,7 @@ ReserveNegativeControl() + return 0; + } + +- printf("INFO | negative control allocated at 0x%.*"PRIxPTR"\n", ++ printf("INFO | negative control allocated at 0x%.*" PRIxPTR "\n", + SIZxPTR, (uintptr_t)result); + return (uintptr_t)result; + } diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-747322-Fix-jemalloc-mmap-wrapper-for-s390x.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-747322-Fix-jemalloc-mmap-wrapper-for-s390x.patch new file mode 100644 index 0000000..17b6678 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-747322-Fix-jemalloc-mmap-wrapper-for-s390x.patch @@ -0,0 +1,25 @@ +From: Mike Hommey +Date: Fri, 20 Apr 2012 11:26:22 +0200 +Subject: Bug 747322 - Fix jemalloc mmap wrapper for s390x + +--- + memory/jemalloc/jemalloc.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/memory/jemalloc/jemalloc.c b/memory/jemalloc/jemalloc.c +index d792728..147e18f 100644 +--- a/memory/jemalloc/jemalloc.c ++++ b/memory/jemalloc/jemalloc.c +@@ -403,9 +403,9 @@ void *_mmap(void *addr, size_t length, int prot, int flags, + struct { + void *addr; + size_t length; +- int prot; +- int flags; +- int fd; ++ long prot; ++ long flags; ++ long fd; + off_t offset; + } args = { addr, length, prot, flags, fd, offset }; + return (void *) syscall(SYS_mmap, &args); diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-761082-Only-export-TabMessageUtils.h-in-mozilla-.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-761082-Only-export-TabMessageUtils.h-in-mozilla-.patch new file mode 100644 index 0000000..ac855b2 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Bug-761082-Only-export-TabMessageUtils.h-in-mozilla-.patch @@ -0,0 +1,49 @@ +From: Mike Hommey +Date: Thu, 7 Jun 2012 10:41:59 +0200 +Subject: Bug 761082 - Only export TabMessageUtils.h in mozilla/dom. r=cjones + +--- + dom/ipc/Makefile.in | 2 +- + dom/ipc/PBrowser.ipdl | 2 +- + dom/ipc/TabMessageUtils.cpp | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dom/ipc/Makefile.in b/dom/ipc/Makefile.in +index 8d02e8b..ea37fad 100644 +--- a/dom/ipc/Makefile.in ++++ b/dom/ipc/Makefile.in +@@ -53,7 +53,7 @@ DIRS += tests + endif + endif + +-EXPORTS = TabMessageUtils.h PCOMContentPermissionRequestChild.h ++EXPORTS = PCOMContentPermissionRequestChild.h + + EXPORTS_NAMESPACES = mozilla/dom + +diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl +index f9a25fc..10a8592 100644 +--- a/dom/ipc/PBrowser.ipdl ++++ b/dom/ipc/PBrowser.ipdl +@@ -44,7 +44,7 @@ include protocol PContentPermissionRequest; + include protocol PRenderFrame; + include protocol POfflineCacheUpdate; + +-include "TabMessageUtils.h"; ++include "mozilla/dom/TabMessageUtils.h"; + include "gfxMatrix.h"; + include "mozilla/net/NeckoMessageUtils.h"; + include "IPC/nsGUIEventIPC.h"; +diff --git a/dom/ipc/TabMessageUtils.cpp b/dom/ipc/TabMessageUtils.cpp +index 201d7d4..44b7e44 100644 +--- a/dom/ipc/TabMessageUtils.cpp ++++ b/dom/ipc/TabMessageUtils.cpp +@@ -36,7 +36,7 @@ + * + * ***** END LICENSE BLOCK ***** */ + +-#include "TabMessageUtils.h" ++#include "mozilla/dom/TabMessageUtils.h" + #include "nsCOMPtr.h" + #include "nsIDOMEvent.h" + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Fix-some-tests-using-CurProcD-where-GreD-should-be-u.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Fix-some-tests-using-CurProcD-where-GreD-should-be-u.patch new file mode 100644 index 0000000..c1002a9 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Fix-some-tests-using-CurProcD-where-GreD-should-be-u.patch @@ -0,0 +1,49 @@ +From: Mike Hommey +Date: Thu, 14 Jul 2011 17:18:56 +0200 +Subject: Fix some tests using CurProcD where GreD should be used + +--- + dom/plugins/test/unit/head_plugins.js | 2 +- + netwerk/test/unit/test_socks.js | 2 +- + toolkit/mozapps/extensions/test/xpcshell/test_plugins.js | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dom/plugins/test/unit/head_plugins.js b/dom/plugins/test/unit/head_plugins.js +index ddb78f5..ca32106 100644 +--- a/dom/plugins/test/unit/head_plugins.js ++++ b/dom/plugins/test/unit/head_plugins.js +@@ -38,7 +38,7 @@ + + // Finds the test plugin library + function get_test_plugin() { +- var plugins = gDirSvc.get("CurProcD", Ci.nsILocalFile); ++ var plugins = gDirSvc.get("GreD", Ci.nsILocalFile); + plugins.append("plugins"); + do_check_true(plugins.exists()); + var plugin = plugins.clone(); +diff --git a/netwerk/test/unit/test_socks.js b/netwerk/test/unit/test_socks.js +index bbaeffa..f692d97 100644 +--- a/netwerk/test/unit/test_socks.js ++++ b/netwerk/test/unit/test_socks.js +@@ -36,7 +36,7 @@ function runScriptSubprocess(script, args) + { + // logic copied from ted's crashreporter unit test + var ds = new DirectoryService(); +- var bin = ds.get("CurProcD", Ci.nsILocalFile); ++ var bin = ds.get("GreD", Ci.nsILocalFile); + + bin.append("xpcshell"); + if (!bin.exists()) { +diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_plugins.js b/toolkit/mozapps/extensions/test/xpcshell/test_plugins.js +index 71e9ac1..0bde3e2 100644 +--- a/toolkit/mozapps/extensions/test/xpcshell/test_plugins.js ++++ b/toolkit/mozapps/extensions/test/xpcshell/test_plugins.js +@@ -18,7 +18,7 @@ function run_test() { + + // Finds the test plugin library + function get_test_plugin() { +- var plugins = Services.dirsvc.get("CurProcD", AM_Ci.nsILocalFile); ++ var plugins = Services.dirsvc.get("GreD", AM_Ci.nsILocalFile); + plugins.append("plugins"); + do_check_true(plugins.exists()); + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Load-dependent-libraries-with-their-real-path-to-avo.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Load-dependent-libraries-with-their-real-path-to-avo.patch new file mode 100644 index 0000000..216792f --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Load-dependent-libraries-with-their-real-path-to-avo.patch @@ -0,0 +1,23 @@ +From: Mike Hommey +Date: Sat, 25 Feb 2012 12:03:56 +0100 +Subject: Load dependent libraries with their real path to avoid confusing gdb + when they are symlinks + +--- + xpcom/glue/standalone/nsGlueLinkingDlopen.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xpcom/glue/standalone/nsGlueLinkingDlopen.cpp b/xpcom/glue/standalone/nsGlueLinkingDlopen.cpp +index 959bd69..61b18f8 100644 +--- a/xpcom/glue/standalone/nsGlueLinkingDlopen.cpp ++++ b/xpcom/glue/standalone/nsGlueLinkingDlopen.cpp +@@ -206,6 +206,9 @@ preload(const char *file) + static void + ReadDependentCB(const char *aDependentLib, bool do_preload) + { ++ char lib[MAXPATHLEN]; ++ if (realpath(aDependentLib, lib)) ++ aDependentLib = lib; + #if defined(LINUX) && !defined(ANDROID) + if (do_preload) + preload(aDependentLib); diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Properly-launch-applications-set-in-HOME-.mailcap.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Properly-launch-applications-set-in-HOME-.mailcap.patch new file mode 100644 index 0000000..8ed4881 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/Properly-launch-applications-set-in-HOME-.mailcap.patch @@ -0,0 +1,47 @@ +From: Mike Hommey +Date: Sat, 22 Nov 2008 09:35:23 +0100 +Subject: Properly launch applications set in $HOME/.mailcap + +Replaces the previous patch in a much simpler way. +--- + uriloader/exthandler/unix/nsMIMEInfoUnix.cpp | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +index 5d7f758..81b8efb 100644 +--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp ++++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +@@ -99,6 +99,12 @@ nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI) + NS_IMETHODIMP + nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval) + { ++ // if mDefaultApplication is set, it means the application has been set from ++ // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to ++ // give the GNOME answer. ++ if (mDefaultApplication) ++ return nsMIMEInfoImpl::GetHasDefaultHandler(_retval); ++ + *_retval = false; + nsRefPtr mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType); + if (!mimeInfo) { +@@ -132,13 +138,18 @@ nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval) + } + #endif + +- // If we didn't find a VFS handler, fallback. +- return nsMIMEInfoImpl::GetHasDefaultHandler(_retval); ++ return NS_OK; + } + + nsresult + nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile *aFile) + { ++ // if mDefaultApplication is set, it means the application has been set from ++ // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to ++ // give the GNOME answer. ++ if (mDefaultApplication) ++ return nsMIMEInfoImpl::LaunchDefaultWithFile(aFile); ++ + nsCAutoString nativePath; + aFile->GetNativePath(nativePath); + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/bug-693343-a11y-disabled-in-Gnome-3-when-GNOME_ACCES.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/bug-693343-a11y-disabled-in-Gnome-3-when-GNOME_ACCES.patch new file mode 100644 index 0000000..2fdc6ae --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/fixes/bug-693343-a11y-disabled-in-Gnome-3-when-GNOME_ACCES.patch @@ -0,0 +1,351 @@ +From: Trevor Saunders +Date: Wed, 4 Jan 2012 20:54:17 -0500 +Subject: bug 693343 - a11y disabled in Gnome 3 when GNOME_ACCESSIBILITY is + unset patch=mgorse, tbsaunde r=tbsaunde, karlt + +--- + accessible/src/atk/Makefile.in | 4 + + accessible/src/atk/nsApplicationAccessibleWrap.cpp | 156 ++++++++++++++++---- + accessible/src/base/nsAccessibilityService.h | 15 ++ + widget/src/gtk2/nsWindow.cpp | 48 +----- + widget/src/gtk2/nsWindow.h | 3 - + 5 files changed, 157 insertions(+), 69 deletions(-) + +diff --git a/accessible/src/atk/Makefile.in b/accessible/src/atk/Makefile.in +index 4934fd1..9fe1f48 100644 +--- a/accessible/src/atk/Makefile.in ++++ b/accessible/src/atk/Makefile.in +@@ -92,6 +92,10 @@ include $(topsrcdir)/config/rules.mk + CFLAGS += $(MOZ_GTK2_CFLAGS) + CXXFLAGS += $(MOZ_GTK2_CFLAGS) + ++ifdef MOZ_ENABLE_DBUS ++CXXFLAGS += $(MOZ_DBUS_CFLAGS) ++endif ++ + LOCAL_INCLUDES += \ + -I$(srcdir) \ + -I$(srcdir)/../base \ +diff --git a/accessible/src/atk/nsApplicationAccessibleWrap.cpp b/accessible/src/atk/nsApplicationAccessibleWrap.cpp +index c8ee40c..5937883 100644 +--- a/accessible/src/atk/nsApplicationAccessibleWrap.cpp ++++ b/accessible/src/atk/nsApplicationAccessibleWrap.cpp +@@ -44,7 +44,7 @@ + #include "nsMai.h" + #include "prlink.h" + #include "prenv.h" +-#include "nsIPrefBranch.h" ++#include "nsIGConfService.h" + #include "nsIServiceManager.h" + #include "nsAutoPtr.h" + #include "nsAccessibilityService.h" +@@ -52,6 +52,11 @@ + + #include + #include ++#ifdef MOZ_ENABLE_DBUS ++#include ++#endif ++ ++using namespace mozilla::a11y; + + typedef GType (* AtkGetTypeType) (void); + GType g_atk_hyperlink_impl_type = G_TYPE_INVALID; +@@ -60,11 +65,6 @@ static PRLibrary *sATKLib = nsnull; + static const char sATKLibName[] = "libatk-1.0.so.0"; + static const char sATKHyperlinkImplGetTypeSymbol[] = + "atk_hyperlink_impl_get_type"; +-static const char sAccEnv [] = "GNOME_ACCESSIBILITY"; +-static const char sSysPrefService [] = +- "@mozilla.org/system-preference-service;1"; +-static const char sAccessibilityKey [] = +- "config.use_system_prefs.accessibility"; + + /* gail function pointer */ + static guint (* gail_add_global_event_listener) (GSignalEmissionHook listener, +@@ -614,26 +614,7 @@ toplevel_event_watcher(GSignalInvocationHint* ihint, + bool + nsApplicationAccessibleWrap::Init() + { +- // XXX following code is copied from widget/src/gtk2/nsWindow.cpp +- // we should put it to somewhere that can be used from both modules +- // see bug 390761 +- +- // check if accessibility enabled/disabled by environment variable +- bool isGnomeATEnabled = false; +- const char *envValue = PR_GetEnv(sAccEnv); +- if (envValue) { +- isGnomeATEnabled = !!atoi(envValue); +- } else { +- //check gconf-2 setting +- nsresult rv; +- nsCOMPtr sysPrefService = +- do_GetService(sSysPrefService, &rv); +- if (NS_SUCCEEDED(rv) && sysPrefService) { +- sysPrefService->GetBoolPref(sAccessibilityKey, &isGnomeATEnabled); +- } +- } +- +- if (isGnomeATEnabled) { ++ if (ShouldA11yBeEnabled()) { + // load and initialize gail library + nsresult rv = LoadGtkModule(sGail); + if (NS_SUCCEEDED(rv)) { +@@ -882,3 +863,126 @@ LoadGtkModule(GnomeAccessibilityModule& aModule) + } + return NS_OK; + } ++ ++namespace mozilla { ++namespace a11y { ++ ++ static const char sAccEnv [] = "GNOME_ACCESSIBILITY"; ++#ifdef MOZ_ENABLE_DBUS ++static DBusPendingCall *sPendingCall = nsnull; ++#endif ++ ++void ++PreInit() ++{ ++#ifdef MOZ_ENABLE_DBUS ++ static bool sChecked = FALSE; ++ if (sChecked) ++ return; ++ ++ sChecked = TRUE; ++ ++ // dbus is only checked if GNOME_ACCESSIBILITY is unset ++ if (PR_GetEnv(sAccEnv) || !PR_GetEnv("DBUS_SESSION_BUS_ADDRESS")) ++ return; ++ ++ DBusConnection* bus = dbus_bus_get(DBUS_BUS_SESSION, nsnull); ++ if (!bus) ++ return; ++ ++ dbus_connection_set_exit_on_disconnect(bus, FALSE); ++ ++ DBusMessage *message; ++ message = dbus_message_new_method_call("org.a11y.Bus", "/org/a11y/bus", ++ "org.freedesktop.DBus.Properties", ++ "Get"); ++ if (!message) ++ goto dbus_done; ++ ++ static const char* iface = "org.a11y.Status"; ++ static const char* member = "IsEnabled"; ++ dbus_message_append_args(message, DBUS_TYPE_STRING, &iface, ++ DBUS_TYPE_STRING, &member, DBUS_TYPE_INVALID); ++ dbus_connection_send_with_reply(bus, message, &sPendingCall, 1000); ++ dbus_message_unref(message); ++ ++dbus_done: ++ dbus_connection_unref(bus); ++#endif ++} ++ ++bool ++ShouldA11yBeEnabled() ++{ ++ static bool sChecked = false, sShouldEnable = false; ++ if (sChecked) ++ return sShouldEnable; ++ ++ sChecked = true; ++ ++ // check if accessibility enabled/disabled by environment variable ++ const char* envValue = PR_GetEnv(sAccEnv); ++ if (envValue) ++ return sShouldEnable = !!atoi(envValue); ++ ++#ifdef MOZ_ENABLE_DBUS ++ PreInit(); ++ bool dbusSuccess = false; ++ DBusMessage *reply = nsnull; ++ if (!sPendingCall) ++ goto dbus_done; ++ ++ dbus_pending_call_block(sPendingCall); ++ reply = dbus_pending_call_steal_reply(sPendingCall); ++ dbus_pending_call_unref(sPendingCall); ++ sPendingCall = nsnull; ++ if (!reply || ++ dbus_message_get_type(reply) != DBUS_MESSAGE_TYPE_METHOD_RETURN || ++ strcmp(dbus_message_get_signature (reply), DBUS_TYPE_VARIANT_AS_STRING)) ++ goto dbus_done; ++ ++ DBusMessageIter iter, iter_variant, iter_struct; ++ dbus_bool_t dResult; ++ dbus_message_iter_init(reply, &iter); ++ dbus_message_iter_recurse (&iter, &iter_variant); ++ switch (dbus_message_iter_get_arg_type(&iter_variant)) { ++ case DBUS_TYPE_STRUCT: ++ // at-spi2-core 2.2.0-2.2.1 had a bug where it returned a struct ++ dbus_message_iter_recurse(&iter_variant, &iter_struct); ++ if (dbus_message_iter_get_arg_type(&iter_struct) == DBUS_TYPE_BOOLEAN) { ++ dbus_message_iter_get_basic(&iter_struct, &dResult); ++ sShouldEnable = dResult; ++ dbusSuccess = true; ++ } ++ ++ break; ++ case DBUS_TYPE_BOOLEAN: ++ dbus_message_iter_get_basic(&iter_variant, &dResult); ++ sShouldEnable = dResult; ++ dbusSuccess = true; ++ break; ++ default: ++ break; ++ } ++ ++dbus_done: ++ if (reply) ++ dbus_message_unref(reply); ++ ++ if (dbusSuccess) ++ return sShouldEnable; ++#endif ++ ++ //check gconf-2 setting ++static const char sGconfAccessibilityKey[] = ++ "/desktop/gnome/interface/accessibility"; ++ nsresult rv = NS_OK; ++ nsCOMPtr gconf = ++ do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv); ++ if (NS_SUCCEEDED(rv) && gconf) ++ gconf->GetBool(NS_LITERAL_CSTRING(sGconfAccessibilityKey), &sShouldEnable); ++ ++ return sShouldEnable; ++} ++} // namespace a11y ++} // namespace mozilla +diff --git a/accessible/src/base/nsAccessibilityService.h b/accessible/src/base/nsAccessibilityService.h +index 841814a..4284c80 100644 +--- a/accessible/src/base/nsAccessibilityService.h ++++ b/accessible/src/base/nsAccessibilityService.h +@@ -56,6 +56,21 @@ namespace a11y { + */ + FocusManager* FocusMgr(); + ++#ifdef MOZ_ACCESSIBILITY_ATK ++/** ++ * Perform initialization that should be done as soon as possible, in order ++ * to minimize startup time. ++ * XXX: this function and the next defined in nsApplicationAccessibleWrap.cpp ++ */ ++void PreInit(); ++ ++/** ++ * Is platform accessibility enabled. ++ * Only used on linux with atk for now. ++ */ ++bool ShouldA11yBeEnabled(); ++#endif ++ + } // namespace a11y + } // namespace mozilla + +diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp +index 25f1c2a..8f8cd40 100644 +--- a/widget/src/gtk2/nsWindow.cpp ++++ b/widget/src/gtk2/nsWindow.cpp +@@ -110,19 +110,10 @@ + #include "nsIPropertyBag2.h" + + #ifdef ACCESSIBILITY +-#include "nsIAccessibilityService.h" ++#include "nsAccessibilityService.h" + #include "nsIAccessibleDocument.h" +-#include "prenv.h" +-#include "stdlib.h" + + using namespace mozilla; +- +-static bool sAccessibilityChecked = false; +-/* static */ +-bool nsWindow::sAccessibilityEnabled = false; +-static const char sSysPrefService [] = "@mozilla.org/system-preference-service;1"; +-static const char sAccEnv [] = "GNOME_ACCESSIBILITY"; +-static const char sAccessibilityKey [] = "config.use_system_prefs.accessibility"; + #endif + + /* For SetIcon */ +@@ -1116,9 +1107,8 @@ nsWindow::Show(bool aState) + } + + #ifdef ACCESSIBILITY +- if (aState && sAccessibilityEnabled) { ++ if (aState && a11y::ShouldA11yBeEnabled()) + CreateRootAccessible(); +- } + #endif + + NativeShow(aState); +@@ -3890,6 +3880,11 @@ nsWindow::Create(nsIWidget *aParent, + + NS_ASSERTION(!mWindowGroup, "already have window group (leaking it)"); + ++#ifdef ACCESSIBILITY ++ // Send a DBus message to check whether a11y is enabled ++ a11y::PreInit(); ++#endif ++ + // Ensure that the toolkit is created. + nsGTKToolkit::GetToolkit(); + +@@ -4283,33 +4278,6 @@ nsWindow::Create(nsIWidget *aParent, + if (!mIsTopLevel) + Resize(mBounds.x, mBounds.y, mBounds.width, mBounds.height, false); + +-#ifdef ACCESSIBILITY +- nsresult rv; +- if (!sAccessibilityChecked) { +- sAccessibilityChecked = true; +- +- //check if accessibility enabled/disabled by environment variable +- const char *envValue = PR_GetEnv(sAccEnv); +- if (envValue) { +- sAccessibilityEnabled = atoi(envValue) != 0; +- LOG(("Accessibility Env %s=%s\n", sAccEnv, envValue)); +- } +- //check gconf-2 setting +- else { +- nsCOMPtr sysPrefService = +- do_GetService(sSysPrefService, &rv); +- if (NS_SUCCEEDED(rv) && sysPrefService) { +- +- // do the work to get gconf setting. +- // will be done soon later. +- sysPrefService->GetBoolPref(sAccessibilityKey, +- &sAccessibilityEnabled); +- } +- +- } +- } +-#endif +- + #ifdef MOZ_DFB + if (!mDFB) { + DirectFBCreate( &mDFB ); +@@ -6517,7 +6485,7 @@ nsWindow::DispatchAccessibleEvent() + void + nsWindow::DispatchEventToRootAccessible(PRUint32 aEventType) + { +- if (!sAccessibilityEnabled) { ++ if (!a11y::ShouldA11yBeEnabled()) { + return; + } + +diff --git a/widget/src/gtk2/nsWindow.h b/widget/src/gtk2/nsWindow.h +index a72eca7..577acbf 100644 +--- a/widget/src/gtk2/nsWindow.h ++++ b/widget/src/gtk2/nsWindow.h +@@ -345,9 +345,6 @@ public: + #endif + NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent); + +-#ifdef ACCESSIBILITY +- static bool sAccessibilityEnabled; +-#endif + protected: + // Helper for SetParent and ReparentNativeWidget. + void ReparentNativeWidgetInternal(nsIWidget* aNewParent, diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/iceweasel-branding/Determine-which-phishing-shavar-to-use-depending-on-.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/iceweasel-branding/Determine-which-phishing-shavar-to-use-depending-on-.patch new file mode 100644 index 0000000..69d01f6 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/iceweasel-branding/Determine-which-phishing-shavar-to-use-depending-on-.patch @@ -0,0 +1,74 @@ +From: Mike Hommey +Date: Thu, 1 Apr 2010 15:34:59 +0200 +Subject: Determine which phishing shavar to use depending on + MOZ_OFFICIAL_BRANDING + +--- + browser/app/Makefile.in | 4 ++++ + browser/app/profile/firefox.js | 4 ++++ + browser/components/safebrowsing/Makefile.in | 4 ++++ + browser/components/safebrowsing/content/application.js | 4 ++++ + 4 files changed, 16 insertions(+) + +diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in +index 95055cb..a6066f7 100644 +--- a/browser/app/Makefile.in ++++ b/browser/app/Makefile.in +@@ -191,6 +191,10 @@ ifdef MOZILLA_OFFICIAL + DEFINES += -DMOZILLA_OFFICIAL + endif + ++ifdef MOZ_OFFICIAL_BRANDING ++DEFINES += -DMOZ_OFFICIAL_BRANDING ++endif ++ + ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) + libs:: + $(INSTALL) $(IFLAGS1) $(DIST)/branding/mozicon128.png $(DIST)/bin/icons +diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js +index 4f3aac3..7ba75fa 100644 +--- a/browser/app/profile/firefox.js ++++ b/browser/app/profile/firefox.js +@@ -742,7 +742,11 @@ pref("urlclassifier.alternate_error_page", "blocked"); + pref("urlclassifier.gethashnoise", 4); + + // The list of tables that use the gethash request to confirm partial results. ++#ifdef MOZ_OFFICIAL_BRANDING + pref("urlclassifier.gethashtables", "goog-phish-shavar,goog-malware-shavar"); ++#else ++pref("urlclassifier.gethashtables", "googpub-phish-shavar,goog-malware-shavar"); ++#endif + + // If an urlclassifier table has not been updated in this number of seconds, + // a gethash request will be forced to check that the result is still in +diff --git a/browser/components/safebrowsing/Makefile.in b/browser/components/safebrowsing/Makefile.in +index 2d526c2..3b6ca17 100644 +--- a/browser/components/safebrowsing/Makefile.in ++++ b/browser/components/safebrowsing/Makefile.in +@@ -51,6 +51,10 @@ ifdef MOZILLA_OFFICIAL + DEFINES += -DOFFICIAL_BUILD=1 + endif + ++ifdef MOZ_OFFICIAL_BRANDING ++DEFINES += -DMOZ_OFFICIAL_BRANDING ++endif ++ + EXTRA_COMPONENTS = \ + src/nsSafebrowsingApplication.manifest \ + $(NULL) +diff --git a/browser/components/safebrowsing/content/application.js b/browser/components/safebrowsing/content/application.js +index d353cbc..ec32c92 100644 +--- a/browser/components/safebrowsing/content/application.js ++++ b/browser/components/safebrowsing/content/application.js +@@ -109,7 +109,11 @@ PROT_Application.prototype.initialize = function() { + this.malwareWarden.maybeToggleUpdateChecking(); + + this.phishWarden = new PROT_PhishingWarden(); ++#ifdef MOZ_OFFICIAL_BRANDING + this.phishWarden.registerBlackTable("goog-phish-shavar"); ++#else ++ this.phishWarden.registerBlackTable("googpub-phish-shavar"); ++#endif + this.phishWarden.maybeToggleUpdateChecking(); + } + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/iceweasel-branding/Use-MOZ_APP_DISPLAYNAME-to-fill-appstrings.propertie.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/iceweasel-branding/Use-MOZ_APP_DISPLAYNAME-to-fill-appstrings.propertie.patch new file mode 100644 index 0000000..277a35c --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/iceweasel-branding/Use-MOZ_APP_DISPLAYNAME-to-fill-appstrings.propertie.patch @@ -0,0 +1,61 @@ +From: Mike Hommey +Date: Sat, 19 Feb 2011 11:02:30 +0100 +Subject: Use MOZ_APP_DISPLAYNAME to fill appstrings.properties + +--- + browser/locales/Makefile.in | 2 ++ + .../en-US/chrome/overrides/appstrings.properties | 20 ++++++++++---------- + 2 files changed, 12 insertions(+), 10 deletions(-) + +diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in +index b30a715..9f7befb 100644 +--- a/browser/locales/Makefile.in ++++ b/browser/locales/Makefile.in +@@ -69,6 +69,8 @@ SUBMAKEFILES += \ + $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \ + $(NULL) + ++DEFINES += -DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) ++ + # This makefile uses variable overrides from the libs-% target to + # build non-default locales to non-default dist/ locations. Be aware! + +diff --git a/browser/locales/en-US/chrome/overrides/appstrings.properties b/browser/locales/en-US/chrome/overrides/appstrings.properties +index 87e9538..ac979f9 100644 +--- a/browser/locales/en-US/chrome/overrides/appstrings.properties ++++ b/browser/locales/en-US/chrome/overrides/appstrings.properties +@@ -35,24 +35,24 @@ + # ***** END LICENSE BLOCK ***** + + malformedURI=The URL is not valid and cannot be loaded. +-fileNotFound=Firefox can't find the file at %S. +-dnsNotFound=Firefox can't find the server at %S. +-protocolNotFound=Firefox doesn't know how to open this address, because the protocol (%S) isn't associated with any program. +-connectionFailure=Firefox can't establish a connection to the server at %S. ++#expand fileNotFound=__MOZ_APP_DISPLAYNAME__ can't find the file at %S. ++#expand dnsNotFound=__MOZ_APP_DISPLAYNAME__ can't find the server at %S. ++#expand protocolNotFound=__MOZ_APP_DISPLAYNAME__ doesn't know how to open this address, because the protocol (%S) isn't associated with any program. ++#expand connectionFailure=__MOZ_APP_DISPLAYNAME__ can't establish a connection to the server at %S. + netInterrupt=The connection to %S was interrupted while the page was loading. + netTimeout=The server at %S is taking too long to respond. +-redirectLoop=Firefox has detected that the server is redirecting the request for this address in a way that will never complete. ++#expand redirectLoop=__MOZ_APP_DISPLAYNAME__ has detected that the server is redirecting the request for this address in a way that will never complete. + ## LOCALIZATION NOTE (confirmRepostPrompt): In this item, don't translate "%S" + confirmRepostPrompt=To display this page, %S must send information that will repeat any action (such as a search or order confirmation) that was performed earlier. + resendButton.label=Resend +-unknownSocketType=Firefox doesn't know how to communicate with the server. ++#expand unknownSocketType=__MOZ_APP_DISPLAYNAME__ doesn't know how to communicate with the server. + netReset=The connection to the server was reset while the page was loading. + notCached=This document is no longer available. +-netOffline=Firefox is currently in offline mode and can't browse the Web. ++#expand netOffline=__MOZ_APP_DISPLAYNAME__ is currently in offline mode and can't browse the Web. + isprinting=The document cannot change while Printing or in Print Preview. +-deniedPortAccess=This address uses a network port which is normally used for purposes other than Web browsing. Firefox has canceled the request for your protection. +-proxyResolveFailure=Firefox is configured to use a proxy server that can't be found. +-proxyConnectFailure=Firefox is configured to use a proxy server that is refusing connections. ++#expand deniedPortAccess=This address uses a network port which is normally used for purposes other than Web browsing. __MOZ_APP_DISPLAYNAME__ has canceled the request for your protection. ++#expand proxyResolveFailure=__MOZ_APP_DISPLAYNAME__ is configured to use a proxy server that can't be found. ++#expand proxyConnectFailure=__MOZ_APP_DISPLAYNAME__ is configured to use a proxy server that is refusing connections. + contentEncodingError=The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression. + unsafeContentType=The page you are trying to view cannot be shown because it is contained in a file type that may not be safe to open. Please contact the website owners to inform them of this problem. + externalProtocolTitle=External Protocol Request diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/mozconfig b/meta-linaro-integration/recipes-overlayed/firefox/firefox/mozconfig new file mode 100644 index 0000000..cc71f48 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/mozconfig @@ -0,0 +1,60 @@ +. $topsrcdir/browser/config/mozconfig + +# From xulrunner.mozconfig +ac_add_options --prefix=@prefix@ +ac_add_options --enable-default-toolkit=cairo-gtk2 +ac_add_options --enable-pango +ac_add_options --enable-system-cairo # MOZ_TREE_CAIRO= +ac_add_options --with-system-jpeg # MOZ_NATIVE_JPEG=1 +ac_add_options --with-system-zlib # MOZ_NATIVE_ZLIB=1 +ac_add_options --with-system-bz2 # MOZ_NATIVE_BZ2=1 +#ac_add_options --with-system-nspr # MOZ_NATIVE_NSPR=1 +#ac_add_options --with-system-nss # MOZ_NATIVE_NSS=1 +ac_add_options --enable-svg +ac_add_options --enable-mathml +ac_add_options --disable-pedantic +ac_add_options --disable-long-long-warning +ac_add_options --disable-gnomevfs +ac_add_options --disable-gconf +#ac_add_options --enable-gio +ac_add_options --disable-gio +#ac_add_options --enable-gnomeui +ac_add_options --disable-gnomeui +ac_add_options --disable-mochitest +ac_add_options --disable-debug +ac_add_options --enable-canvas +ac_add_options --enable-readline +ac_add_options --disable-installer +ac_add_options --disable-javaxpcom +ac_add_options --disable-elf-dynstr-gc +#ac_add_options --enable-system-hunspell # MOZ_NATIVE_HUNSPELL=1 +ac_add_options --disable-system-hunspell # MOZ_NATIVE_HUNSPELL=1 +ac_add_options --disable-crashreporter +#ac_add_options --enable-system-sqlite # MOZ_NATIVE_SQLITE=1 +ac_add_options --disable-strip +ac_add_options --disable-install-strip +ac_add_options --enable-url-classifier +ac_add_options --enable-startup-notification +ac_add_options --enable-system-ffi # MOZ_NATIVE_FFI=1 +ac_add_options --with-system-libevent=@STAGING_DIR_TARGET@@prefix@ # MOZ_NATIVE_LIBEVENT=1 +ac_add_options --with-system-libvpx # MOZ_NATIVE_LIBVPX=1 +#ac_add_options --enable-shared-js + +# From iceweasel.mozconfig +ac_add_options --with-user-appdir=.mozilla +ac_add_options --disable-installer +ac_add_options --disable-strip +ac_add_options --disable-install-strip +ac_add_options --disable-tests +ac_add_options --enable-extensions=default +ac_add_options --enable-single-profile +ac_add_options --disable-profilesharing +ac_add_options --disable-updater +ac_add_options --disable-elf-dynstr-gc +#ac_add_options --with-branding=debian/branding +ac_add_options --enable-official-branding +ac_add_options --disable-necko-wifi +ac_add_options --disable-crashreporter +ac_add_options --disable-webm +ac_add_options --enable-chrome-format=jar +ac_add_options --disable-libjpeg-turbo diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/mozilla-firefox.desktop b/meta-linaro-integration/recipes-overlayed/firefox/firefox/mozilla-firefox.desktop new file mode 100644 index 0000000..77420e6 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/mozilla-firefox.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Firefox Browser +Comment=Firefox Web Browser +Exec=firefox +Terminal=false +MultipleArgs=false +Type=Application +Icon=mozilla-firefox.png +Categories=Application;Internet;Network; +SingleInstance=true + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/mozilla-firefox.png b/meta-linaro-integration/recipes-overlayed/firefox/firefox/mozilla-firefox.png new file mode 100644 index 0000000..f8b2e21 Binary files /dev/null and b/meta-linaro-integration/recipes-overlayed/firefox/firefox/mozilla-firefox.png differ diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Add-xptcall-support-for-SH4-processors.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Add-xptcall-support-for-SH4-processors.patch new file mode 100644 index 0000000..9e2f26c --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Add-xptcall-support-for-SH4-processors.patch @@ -0,0 +1,522 @@ +From: Mike Hommey +Date: Fri, 30 Apr 2010 11:03:50 +0200 +Subject: Add xptcall support for SH4 processors + +Closes: #553593 +https://bugzilla.mozilla.org/show_bug.cgi?id=382214 +--- + xpcom/reflect/xptcall/src/md/unix/Makefile.in | 11 + + .../xptcall/src/md/unix/xptcinvoke_linux_sh.cpp | 203 +++++++++++++++ + .../xptcall/src/md/unix/xptcstubs_linux_sh.cpp | 271 ++++++++++++++++++++ + 3 files changed, 485 insertions(+) + create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_sh.cpp + create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_sh.cpp + +diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in +index 6c50821..44d6ab1 100644 +--- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in ++++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in +@@ -430,6 +430,17 @@ CPPSRCS := xptcinvoke_linux_s390x.cpp xptcstubs_linux_s390x.cpp + CXXFLAGS += -fno-strict-aliasing -fno-inline -fomit-frame-pointer -mbackchain + endif + ++############ ++# SuperH ++############ ++# ++# ++# Currently, tested on sh4 and sh4a (non sh4al and sh4al-dsp..) ++ifeq ($(OS_ARCH),Linux) ++ifneq (,$(filter sh4 sh4a,$(OS_TEST))) ++CPPSRCS := xptcinvoke_linux_sh.cpp xptcstubs_linux_sh.cpp ++endif ++endif + + # we don't want the shared lib, but we want to force the creation of a static lib. + FORCE_STATIC_LIB = 1 +diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_sh.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_sh.cpp +new file mode 100644 +index 0000000..ca4807d +--- /dev/null ++++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_sh.cpp +@@ -0,0 +1,203 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- ++ * ++ * ***** BEGIN LICENSE BLOCK ***** ++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1 ++ * ++ * The contents of this file are subject to the Mozilla Public License Version ++ * 1.1 (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * http://www.mozilla.org/MPL/ ++ * ++ * Software distributed under the License is distributed on an "AS IS" basis, ++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License ++ * for the specific language governing rights and limitations under the ++ * License. ++ * ++ * The Original Code is mozilla.org code. ++ * ++ * The Initial Developer of the Original Code is ++ * Netscape Communications Corporation. ++ * Portions created by the Initial Developer are Copyright (C) 1998 ++ * the Initial Developer. All Rights Reserved. ++ * ++ * Contributor(s): ++ * - Copyright (C) 2008-2009 STMicroelectronics ++ * ++ * Alternatively, the contents of this file may be used under the terms of ++ * either of the GNU General Public License Version 2 or later (the "GPL"), ++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), ++ * in which case the provisions of the GPL or the LGPL are applicable instead ++ * of those above. If you wish to allow use of your version of this file only ++ * under the terms of either the GPL or the LGPL, and not to allow others to ++ * use your version of this file under the terms of the MPL, indicate your ++ * decision by deleting the provisions above and replace them with the notice ++ * and other provisions required by the GPL or the LGPL. If you do not delete ++ * the provisions above, a recipient may use your version of this file under ++ * the terms of any one of the MPL, the GPL or the LGPL. ++ * ++ * Based on the neutroni port, however that assumed that the compiler was pushing params ++ * onto the stack. Change to take this into account. ++ * ++ * ***** END LICENSE BLOCK ***** */ ++ ++#include "xptcprivate.h" ++ ++extern "C" { ++ ++const int c_int_register_params = 4; ++const int c_float_register_params = 8; ++ ++static PRUint32 __attribute__((__used__)) ++copy_to_stack(PRUint32 **that,PRUint32 methodIndex,PRUint32 paramCount, nsXPTCVariant* s,PRUint32* data) ++{ ++ int intCount = 1; // Because of that ++ int floatCount = 0; ++ PRUint32 *intRegParams=data+1 ; ++ float *floatRegParams = (float *)(data+4); ++ ++ /* Push the that register into the right place so it can be restored on exit */ ++ *data= (PRUint32)(that); ++ data+=12; /* 4 integer registers, and 8 floating point registers */ ++ ++ for ( PRUint32 i = 0; i < paramCount; ++i, ++s ) ++ { ++ nsXPTType type = s->IsPtrData() ? nsXPTType::T_I32 : s->type; ++ ++ switch ( type ) { ++ case nsXPTType::T_I64: ++ case nsXPTType::T_U64: ++ // Space to pass in registers? ++ if ( (c_int_register_params - intCount) >= 2 ) { ++ *((PRInt64 *) intRegParams) = s->val.i64; ++ intRegParams += 2; ++ intCount += 2; ++ } ++ else { ++ *((PRInt64*) data) = s->val.i64; ++ data += 2; ++ } ++ break; ++ case nsXPTType::T_FLOAT: ++ // Space to pass in registers? ++ if ( floatCount < c_float_register_params ) { ++ *floatRegParams = s->val.f; ++ ++floatCount; ++ ++floatRegParams; ++ } ++ else { ++ *((float*) data) = s->val.f; ++ ++data; ++ } ++ break; ++ case nsXPTType::T_DOUBLE: ++ // Space to pass in registers? ++ if ( (c_float_register_params - floatCount) >= 2 ) { ++ if ( (floatCount & 1) != 0 ) { ++ ++floatCount; ++ ++floatRegParams; ++ } ++ *(double *)floatRegParams = s->val.d; ++ floatCount += 2; ++ floatRegParams += 2; ++ } ++ else { ++ *((double *) data) = s->val.d; ++ data += 2; ++ } ++ break; ++ default: // 32 (non-float) value ++ PRInt32 value = (PRInt32) (s->IsPtrData() ? s->ptr : s->val.p); ++ // Space to pass in registers? ++ if ( intCount < c_int_register_params ) { ++ *intRegParams = value; ++ ++intRegParams; ++ ++intCount; ++ } ++ else { ++ *data = value; ++ ++data; ++ } ++ break; ++ } ++ } ++ ++ /* Now calculate the return address ++ * Dereference that to get vtable pointer ++ */ ++ return *( (*(that))+(methodIndex) ); ++ ++} ++ ++} ++ ++ /* This was originally done as a C function, but the original code was ++ * relying on how the compiler laid out the stack. Later versions of ++ * gcc do a better job of optimising and never push the parameters on the ++ * stack. So it is simpler to just write the whole thing in assembler anyway ++ */ ++ ++ /* Because the SH processor passes the first few parameters in registers ++ it is a bit tricky setting things up right. To make things easier, ++ all the hard work will be done by copy_to_stack above. We pass to it ++ a chunk of memory, the bottom of which will be copied to registers r4 to r7 ++ and fr4 to fr11 before calling the target function. ++ */ ++ ++/* r4= that, r5=methodIndex,r6=paramCount,r7=params */ ++ ++ __asm__ ( ++ ++ ++ /* Make space for parameters to be passed to the method. Assume worst case ++ 8 bytes per parameter. Also leave space for 4 longs and 8 floats that ++ will be put into registers. The worst case is all int64 parameters ++ and even in this case 8 bytes are passed in registers so we can ++ deduct this from our allocation. ++ */ ++ ".section .text\n" ++ ".balign 4\n" ++ ".global NS_InvokeByIndex_P\n" ++ "NS_InvokeByIndex_P:\n" ++ "mov.l r14, @-r15 \n\t" // Push frame ++ "sts.l pr, @-r15 \n\t" // Push link ++ "mov.l r8, @-r15 \n\t" // Save ++ "mov r15, r14\n\t" // Set frame ++ "mov #3, r1 \n\t" // Assume worse case, all params are 64bit, hence *8 ++ "mov r6, r2\n\t" ++ "shld r1, r2 \n\t" ++ "mov r2, r8 \n\t" // Save stack drop ++ "add #48, r2 \n\t" // Space for 4 longs, 8 floats ++ "sub r2, r15 \n\t" // Drop stack ++ "mov.l 1f, r1 \n\t" // Get address of copy_to_stack_function ++ "jsr @r1 \n\t" ++ "mov.l r15, @-r15 \n\t" // Params will be dumped here ++ "add #4, r15 \n\t" // Pop stack ptr param. r0 contains method address ++ ++ /* Now everything is laid out nicely in the stack. We just have to ++ load values at the top end of the memory area into registers and ++ make the call. We may load more things into registers than needed, ++ but nobody will care about that. ++ */ ++ ++ "mov.l @r15+, r4 \n\t" // that ++ "mov.l @r15+, r5 \n\t" ++ "mov.l @r15+, r6 \n\t" ++ "mov.l @r15+, r7 \n\t" ++ "fmov.s @r15+, fr5 \n\t" ++ "fmov.s @r15+, fr4 \n\t" ++ "fmov.s @r15+, fr7 \n\t" ++ "fmov.s @r15+, fr6 \n\t" ++ "fmov.s @r15+, fr9 \n\t" ++ "fmov.s @r15+, fr8 \n\t" ++ "fmov.s @r15+, fr11 \n\t" ++ "jsr @r0 \n\t" // Invoke method ++ "fmov.s @r15+, fr10 \n\t" ++ "add r8, r15\n\t" // Pop stack back ++ "mov.l @r15+, r8\n\t" // Restore r8 ++ "lds.l @r15+, pr\n\t" ++ "rts\n\t" ++ "mov.l @r15+, r14\n\t" ++ ".balign 4\n\t" ++ "1: .long copy_to_stack \n\t" ++ ); ++ +diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_sh.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_sh.cpp +new file mode 100644 +index 0000000..cf9fcea +--- /dev/null ++++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_sh.cpp +@@ -0,0 +1,271 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ***** BEGIN LICENSE BLOCK ***** ++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1 ++ * ++ * The contents of this file are subject to the Mozilla Public License Version ++ * 1.1 (the "License"); you may not use this file except in compliance with ++ * the License. You may obtain a copy of the License at ++ * http://www.mozilla.org/MPL/ ++ * ++ * Software distributed under the License is distributed on an "AS IS" basis, ++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License ++ * for the specific language governing rights and limitations under the ++ * License. ++ * ++ * The Original Code is mozilla.org code. ++ * ++ * The Initial Developer of the Original Code is ++ * Netscape Communications Corporation. ++ * Portions created by the Initial Developer are Copyright (C) 1999 ++ * the Initial Developer. All Rights Reserved. ++ * ++ * Contributor(s): ++ * - Copyright (C) 2008-2009 STMicroelectronics ++ * ++ * Alternatively, the contents of this file may be used under the terms of ++ * either of the GNU General Public License Version 2 or later (the "GPL"), ++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), ++ * in which case the provisions of the GPL or the LGPL are applicable instead ++ * of those above. If you wish to allow use of your version of this file only ++ * under the terms of either the GPL or the LGPL, and not to allow others to ++ * use your version of this file under the terms of the MPL, indicate your ++ * decision by deleting the provisions above and replace them with the notice ++ * and other provisions required by the GPL or the LGPL. If you do not delete ++ * the provisions above, a recipient may use your version of this file under ++ * the terms of any one of the MPL, the GPL or the LGPL. ++ * ++ * Based on the neutrino code, with some bug fixes and using the C preprocessor ++ * like all the other ports rather than the python script. ++ * ++ * ***** END LICENSE BLOCK ***** */ ++ ++#include "xptcprivate.h" ++#include "xptiprivate.h" ++ ++const int c_int_register_params = 3; ++const int c_float_register_params = 8; ++ ++/* ++ Dispatch function for all stubs. ++ ++ The parameters to the original function are spread between 'data' which ++ is value of the stack pointer when the stub was called, intRegParams which ++ points to an area containing the values of r5, r6 and r7 when the stub was ++ called and floatRegParams which points to an area containing the values ++ of float registers fr4 to fr11 when the stub was called. ++ ++ */ ++extern "C" nsresult ++PrepareAndDispatch(nsXPTCStubBase* self, int methodIndex, PRUint32* data, ++ PRUint32 *intRegParams, float *floatRegParams) ++{ ++#define PARAM_BUFFER_COUNT 16 ++ ++ nsresult result = NS_ERROR_FAILURE; ++ int intCount = 0; ++ int floatCount = 0; ++ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; ++ nsXPTCMiniVariant* dispatchParams = NULL; ++ const nsXPTMethodInfo* info; ++ PRUint8 paramCount; ++ PRUint8 i; ++ ++ NS_ASSERTION(self,"no self"); ++ ++ self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info); ++ NS_ASSERTION(info,"no interface info"); ++ ++ paramCount = info->GetParamCount(); ++ ++ // setup variant array pointer ++ if(paramCount > PARAM_BUFFER_COUNT) ++ dispatchParams = new nsXPTCMiniVariant[paramCount]; ++ else ++ dispatchParams = paramBuffer; ++ NS_ASSERTION(dispatchParams,"no place for params"); ++ ++ for ( i = 0; i < paramCount; ++i ) { ++ const nsXPTParamInfo& param = info->GetParam(i); ++ nsXPTCMiniVariant* dp = &dispatchParams[i]; ++ nsXPTType type = param.IsOut() ? nsXPTType::T_I32 : param.GetType(); ++ ++ switch ( type ) { ++ case nsXPTType::T_I64: ++ case nsXPTType::T_U64: ++ // Was this passed in a register? ++ if ( (c_int_register_params - intCount) >= 2 ) { ++ dp->val.i64 = *((PRInt64 *) intRegParams); ++ intRegParams += 2; ++ intCount += 2; ++ } ++ else { ++ dp->val.i64 = *((PRInt64*) data); ++ data += 2; ++ } ++ break; ++ case nsXPTType::T_FLOAT: ++ // Was this passed in a register? ++ if ( floatCount < c_float_register_params ) { ++ dp->val.f = *floatRegParams; ++ ++floatCount; ++ ++floatRegParams; ++ } ++ else { ++ dp->val.f = *((float*) data); ++ ++data; ++ } ++ break; ++ case nsXPTType::T_DOUBLE: ++ // Was this passed in a register? ++ if ( (c_float_register_params - floatCount) >= 2 ) { ++ if ( floatCount & 1 != 0 ) { ++ ++floatCount; ++ ++floatRegParams; ++ } ++ dp->val.d = *(double *)floatRegParams; ++ floatCount += 2; ++ floatRegParams += 2; ++ } ++ else { ++ dp->val.d = *((double *) data); ++ data += 2; ++ } ++ break; ++ default: // 32-bit (non-float) value ++ // Was this passed in a register? ++ if ( intCount < c_int_register_params ) { ++ dp->val.i32 = *intRegParams; ++ ++intRegParams; ++ ++intCount; ++ } ++ else { ++ dp->val.i32 = *data; ++ ++data; ++ } ++ break; ++ } ++ } ++ ++ result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams); ++ ++ if(dispatchParams != paramBuffer) ++ delete [] dispatchParams; ++ ++ return result; ++} ++ ++ ++__asm__ ( ++ ".text\n" ++ ".little\n" ++ ".section .rodata\n" ++ ++ ".globl SharedStub\n" ++ ".type SharedStub, @function\n" ++ "SharedStub:\n" ++ "mov r15, r1\n" ++ "mov.l r14,@-r15\n" ++ "sts.l pr,@-r15\n" ++ "mov r15, r14\n" ++ ++ /* Some parameters might have been passed in registers, so push them ++ * all onto the stack, PrepareAndDispatch can then work out whats what ++ * given method type information. ++ */ ++ "mov.l r7, @-r15\n" ++ "mov.l r6, @-r15\n" ++ "mov.l r5, @-r15\n" ++ "mov r15, r7\n" /* r7 = PrepareAndDispatch intRegParams param */ ++ ++ "fmov.s fr10, @-r15\n" ++ "fmov.s fr11, @-r15\n" ++ "fmov.s fr8, @-r15\n" ++ "fmov.s fr9, @-r15\n" ++ "fmov.s fr6, @-r15\n" ++ "fmov.s fr7, @-r15\n" ++ "fmov.s fr4, @-r15\n" ++ "fmov.s fr5, @-r15\n" ++ "mov.l r15, @-r15\n" /* PrepareAndDispatch floatRegParams param */ ++ ++ "mov r1, r6\n" /* r6 = PrepareAndDispatch data param */ ++ ++ "mov.l 1f, r1\n" ++ "jsr @r1\n" /* Note, following instruction is executed first*/ ++ "mov r2, r5\n" /* r5 = PrepareAndDispatch methodIndex param */ ++ ++ "mov r14,r15\n" ++ "lds.l @r15+,pr\n" ++ "mov.l @r15+,r14\n" ++ "rts\n" ++ "nop\n" ++ ".align 2\n" ++ "1:\n" ++ ".long PrepareAndDispatch\n" ++ ); ++ ++#define STUB_ENTRY(n) \ ++__asm__( \ ++ ".text\n" \ ++ ".align 1 \n" \ ++ ".if " #n " < 10\n\t" \ ++ ".globl _ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \ ++ ".type _ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n"\ ++ "_ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \ ++ ".elseif " #n " < 100\n\t" \ ++ ".globl _ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \ ++ ".type _ZN14nsXPTCStubBase6Stub" #n "Ev,@function\n"\ ++ "_ZN14nsXPTCStubBase6Stub" #n "Ev:\n\t" \ ++ ".elseif " #n " < 1000\n\t" \ ++ ".globl _ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \ ++ ".type _ZN14nsXPTCStubBase7Stub" #n "Ev,@function\n"\ ++ "_ZN14nsXPTCStubBase7Stub" #n "Ev:\n\t" \ ++ ".else\n\t" \ ++ ".err \"stub number " #n " >= 1000 not yet supported\"\n\t" \ ++ ".endif\n\t" \ ++ "mov.l 1f, r1 \n" \ ++ ".if "#n" < 128 \n" \ ++ "jmp @r1 \n" \ ++ " mov #"#n",r2 \n" \ ++ ".elseif "#n" < 256 \n" \ ++ "mov #"#n", r2 \n" \ ++ "jmp @r1 \n" \ ++ " extu.b r2, r2 \n" \ ++ ".else \n" \ ++ "mov #"#n" & 0xff,r2 \n" \ ++ "extu.b r2, r2 \n" \ ++ "mov #"#n">>8, r3 \n" \ ++ "shll8 r3 \n" \ ++ "jmp @r1 \n" \ ++ " or r3, r2 \n" \ ++ ".endif \n" \ ++ ".if "#n" % 20 == 0\n" \ ++ ".align 2\n" \ ++ "1:\n" \ ++ ".long SharedStub\n" \ ++ ".endif\n" \ ++ ); ++ ++ ++/* Due to the fact that the SH4 can only load forward labels, we have ++ * to use sentinel_entry to output the last label. A better solution ++ * would be to introduce a STUB_LAST macro in the defs.in file, but ++ * this will do for now ++ */ ++ ++#define SENTINEL_ENTRY(n) \ ++__asm__( \ ++".if "#n" == 0 \n" \ ++ ".text \n" \ ++ ".align 2\n" \ ++ "1:\n" \ ++ ".long SharedStub\n" \ ++".endif\n" \ ++); \ ++ \ ++nsresult nsXPTCStubBase::Sentinel##n() \ ++{ \ ++ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ ++ return NS_ERROR_NOT_IMPLEMENTED; \ ++} ++ ++#include "xptcstubsdef.inc" diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-Hurd.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-Hurd.patch new file mode 100644 index 0000000..bf73dc0 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-Hurd.patch @@ -0,0 +1,48 @@ +From: Mike Hommey +Date: Fri, 5 Aug 2011 11:24:58 +0200 +Subject: Allow ipc code to build on GNU/Hurd + +--- + ipc/chromium/src/base/debug_util_posix.cc | 1 - + ipc/chromium/src/base/third_party/nspr/prcpucfg.h | 2 +- + ipc/chromium/src/build/build_config.h | 2 +- + 3 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/ipc/chromium/src/base/debug_util_posix.cc b/ipc/chromium/src/base/debug_util_posix.cc +index 72a4ebf..5a45ac9 100644 +--- a/ipc/chromium/src/base/debug_util_posix.cc ++++ b/ipc/chromium/src/base/debug_util_posix.cc +@@ -17,7 +17,6 @@ + #include + #if MOZ_HAVE_EXECINFO_H + #include +-#include + #endif + + #include "base/basictypes.h" +diff --git a/ipc/chromium/src/base/third_party/nspr/prcpucfg.h b/ipc/chromium/src/base/third_party/nspr/prcpucfg.h +index 30fef1b..c7e47ba 100644 +--- a/ipc/chromium/src/base/third_party/nspr/prcpucfg.h ++++ b/ipc/chromium/src/base/third_party/nspr/prcpucfg.h +@@ -34,7 +34,7 @@ + #include "base/third_party/nspr/prcpucfg_win.h" + #elif defined(__APPLE__) + #include "base/third_party/nspr/prcpucfg_mac.h" +-#elif defined(__linux__) || defined(ANDROID) || defined(__GLIBC__) ++#elif defined(__linux__) || defined(ANDROID) || defined(__GLIBC__) || defined(__GNU__) + #include "base/third_party/nspr/prcpucfg_linux.h" + #elif defined(__OpenBSD__) + #include "base/third_party/nspr/prcpucfg_openbsd.h" +diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h +index 4ef0c76..463b3d9 100644 +--- a/ipc/chromium/src/build/build_config.h ++++ b/ipc/chromium/src/build/build_config.h +@@ -17,7 +17,7 @@ + // A set of macros to use for platform detection. + #if defined(__APPLE__) + #define OS_MACOSX 1 +-#elif defined(__linux__) || defined(ANDROID) || defined(__GLIBC__) ++#elif defined(__linux__) || defined(ANDROID) || defined(__GLIBC__) || defined(__GNU__) + #define OS_LINUX 1 + #elif defined(__OpenBSD__) + #define OS_OPENBSD 1 diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch new file mode 100644 index 0000000..5c680f6 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch @@ -0,0 +1,52 @@ +From: Mike Hommey +Date: Thu, 30 Jun 2011 18:29:22 +0200 +Subject: Allow ipc code to build on GNU/kfreebsd + +--- + ipc/chromium/src/base/platform_thread_posix.cc | 4 ++++ + ipc/chromium/src/base/third_party/nspr/prcpucfg.h | 2 +- + ipc/chromium/src/build/build_config.h | 2 +- + 3 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/ipc/chromium/src/base/platform_thread_posix.cc b/ipc/chromium/src/base/platform_thread_posix.cc +index e3f49c7..f1d3b2f 100644 +--- a/ipc/chromium/src/base/platform_thread_posix.cc ++++ b/ipc/chromium/src/base/platform_thread_posix.cc +@@ -37,7 +37,11 @@ PlatformThreadId PlatformThread::CurrentId() { + // TODO(BSD): find a better thread ID + return (intptr_t)(pthread_self()); + #elif defined(OS_LINUX) ++#ifdef __NR_gettid + return syscall(__NR_gettid); ++#else ++ return getpid(); ++#endif + #endif + } + +diff --git a/ipc/chromium/src/base/third_party/nspr/prcpucfg.h b/ipc/chromium/src/base/third_party/nspr/prcpucfg.h +index ef40994..30fef1b 100644 +--- a/ipc/chromium/src/base/third_party/nspr/prcpucfg.h ++++ b/ipc/chromium/src/base/third_party/nspr/prcpucfg.h +@@ -34,7 +34,7 @@ + #include "base/third_party/nspr/prcpucfg_win.h" + #elif defined(__APPLE__) + #include "base/third_party/nspr/prcpucfg_mac.h" +-#elif defined(__linux__) || defined(ANDROID) ++#elif defined(__linux__) || defined(ANDROID) || defined(__GLIBC__) + #include "base/third_party/nspr/prcpucfg_linux.h" + #elif defined(__OpenBSD__) + #include "base/third_party/nspr/prcpucfg_openbsd.h" +diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h +index 0952ab1..4ef0c76 100644 +--- a/ipc/chromium/src/build/build_config.h ++++ b/ipc/chromium/src/build/build_config.h +@@ -17,7 +17,7 @@ + // A set of macros to use for platform detection. + #if defined(__APPLE__) + #define OS_MACOSX 1 +-#elif defined(__linux__) || defined(ANDROID) ++#elif defined(__linux__) || defined(ANDROID) || defined(__GLIBC__) + #define OS_LINUX 1 + #elif defined(__OpenBSD__) + #define OS_OPENBSD 1 diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-698923-Don-t-require-16-bytes-alignment-for-VMFr.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-698923-Don-t-require-16-bytes-alignment-for-VMFr.patch new file mode 100644 index 0000000..83907bf --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-698923-Don-t-require-16-bytes-alignment-for-VMFr.patch @@ -0,0 +1,21 @@ +From: Mike Hommey +Date: Fri, 18 Nov 2011 11:27:29 +0100 +Subject: Bug 698923 - Don't require 16 bytes alignment for VMFrame on sparc + +--- + js/src/methodjit/MethodJIT.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/js/src/methodjit/MethodJIT.cpp b/js/src/methodjit/MethodJIT.cpp +index 4f7f5db..c3d01cb 100644 +--- a/js/src/methodjit/MethodJIT.cpp ++++ b/js/src/methodjit/MethodJIT.cpp +@@ -257,7 +257,7 @@ JS_STATIC_ASSERT(offsetof(FrameRegs, sp) == 0); + #if defined(__GNUC__) && !defined(_WIN64) + + /* If this assert fails, you need to realign VMFrame to 16 bytes. */ +-#ifdef JS_CPU_ARM ++#if defined(JS_CPU_ARM) || defined(JS_CPU_SPARC) + JS_STATIC_ASSERT(sizeof(VMFrame) % 8 == 0); + #else + JS_STATIC_ASSERT(sizeof(VMFrame) % 16 == 0); diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703531-Fix-ARMAssembler-getOp2RegScale-on-ARMv5.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703531-Fix-ARMAssembler-getOp2RegScale-on-ARMv5.patch new file mode 100644 index 0000000..509b46a --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703531-Fix-ARMAssembler-getOp2RegScale-on-ARMv5.patch @@ -0,0 +1,25 @@ +From: Mike Hommey +Date: Fri, 18 Nov 2011 11:32:09 +0100 +Subject: Bug 703531 - Fix ARMAssembler::getOp2RegScale on < ARMv5 + +--- + js/src/assembler/assembler/ARMAssembler.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/js/src/assembler/assembler/ARMAssembler.cpp b/js/src/assembler/assembler/ARMAssembler.cpp +index 78b8a7d..0458446 100644 +--- a/js/src/assembler/assembler/ARMAssembler.cpp ++++ b/js/src/assembler/assembler/ARMAssembler.cpp +@@ -112,10 +112,10 @@ ARMWord ARMAssembler::getOp2RegScale(RegisterID reg, ARMWord scale) + : // No clobbers. + ); + #else +- ARMWord lz = 0; // Accumulate leading zeroes. ++ lz = 0; // Accumulate leading zeroes. + for (ARMWord s = 16; s > 0; s /= 2) { + ARMWord mask = 0xffffffff << (32-lz-s); +- if ((x & mask) == 0) { ++ if ((scale & mask) == 0) { + lz += s; + } + } diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703534-Fix-build-failure-on-platforms-without-YA.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703534-Fix-build-failure-on-platforms-without-YA.patch new file mode 100644 index 0000000..981e7a7 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703534-Fix-build-failure-on-platforms-without-YA.patch @@ -0,0 +1,20 @@ +From: Mike Hommey +Date: Fri, 18 Nov 2011 11:55:49 +0100 +Subject: Bug 703534 - Fix build failure on platforms without YARR JIT + +--- + js/src/jscompartment.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/js/src/jscompartment.cpp b/js/src/jscompartment.cpp +index 721c38e..af5a96e 100644 +--- a/js/src/jscompartment.cpp ++++ b/js/src/jscompartment.cpp +@@ -50,7 +50,6 @@ + #include "jswatchpoint.h" + #include "jswrapper.h" + #include "assembler/wtf/Platform.h" +-#include "assembler/jit/ExecutableAllocator.h" + #include "yarr/BumpPointerAllocator.h" + #include "methodjit/MethodJIT.h" + #include "methodjit/PolyIC.h" diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703833-Avoid-invalid-conversion-from-const-size_.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703833-Avoid-invalid-conversion-from-const-size_.patch new file mode 100644 index 0000000..e4e339e --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703833-Avoid-invalid-conversion-from-const-size_.patch @@ -0,0 +1,24 @@ +From: Mike Hommey +Date: Sat, 19 Nov 2011 09:44:10 +0100 +Subject: Bug 703833 - Avoid invalid conversion from 'const size_t*' to 'const + jsuword*' on s390 + +--- + js/src/jsgc.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp +index e8818d1..f25f0a5 100644 +--- a/js/src/jsgc.cpp ++++ b/js/src/jsgc.cpp +@@ -1052,8 +1052,8 @@ MarkStackRangeConservatively(JSTracer *trc, Value *beginv, Value *endv) + ~AutoSkipChecking() { runtime->gcCheckCompartment = savedCompartment; } + } as(trc->context->runtime); + +- const jsuword *begin = beginv->payloadWord(); +- const jsuword *end = endv->payloadWord(); ++ const jsuword *begin = (const jsuword *) beginv->payloadWord(); ++ const jsuword *end = (const jsuword *) endv->payloadWord();; + #ifdef JS_NUNBOX32 + /* + * With 64-bit jsvals on 32-bit systems, we can optimize a bit by diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703842-Avoid-R_SPARC_WDISP22-relocation-in-Tramp.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703842-Avoid-R_SPARC_WDISP22-relocation-in-Tramp.patch new file mode 100644 index 0000000..c687ff4 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-703842-Avoid-R_SPARC_WDISP22-relocation-in-Tramp.patch @@ -0,0 +1,29 @@ +From: Mike Hommey +Date: Sat, 19 Nov 2011 09:37:34 +0100 +Subject: Bug 703842 - Avoid R_SPARC_WDISP22 relocation in TrampolineSparc.s + +--- + js/src/methodjit/TrampolineSparc.s | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/js/src/methodjit/TrampolineSparc.s b/js/src/methodjit/TrampolineSparc.s +index 0fa9cfd..1b15369 100644 +--- a/js/src/methodjit/TrampolineSparc.s ++++ b/js/src/methodjit/TrampolineSparc.s +@@ -112,7 +112,7 @@ throwpoline_exit: + JaegerInterpolineScripted: + ld [%l0 + 0x10], %l0 /* Load f->prev_ */ + st %l0, [%fp - 36] /* Update f->regs->fp_ */ +- ba JaegerInterpoline ++ ba interpoline_enter + nop + .size JaegerInterpolineScripted, . - JaegerInterpolineScripted + +@@ -120,6 +120,7 @@ JaegerInterpolineScripted: + .global JaegerInterpoline + .type JaegerInterpoline, #function + JaegerInterpoline: ++interpoline_enter: + mov %o0,%o2 + mov %l3,%o0 + mov %l2,%o1 diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-706787-Crash-on-s390x-nsXPCComponents-AttachNewC.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-706787-Crash-on-s390x-nsXPCComponents-AttachNewC.patch new file mode 100644 index 0000000..c20e218 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-706787-Crash-on-s390x-nsXPCComponents-AttachNewC.patch @@ -0,0 +1,78 @@ +From: Martin Stransky +Date: Mon, 5 Dec 2011 10:49:56 +0100 +Subject: Bug 706787 - Crash on s390x + (nsXPCComponents::AttachNewComponentsObject() fails). r=glandium + +--- + .../xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp | 50 ++++---------------- + 1 file changed, 9 insertions(+), 41 deletions(-) + +diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp +index c12482a..ec9dd98 100644 +--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp ++++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp +@@ -194,55 +194,23 @@ invoke_copy_to_stack(PRUint32 paramCount, nsXPTCVariant* s, PRUint64* d_ov, PRUi + } + } + ++typedef nsresult (*vtable_func)(nsISupports *, PRUint64, PRUint64, PRUint64, PRUint64, double, double, double, double); ++ + EXPORT_XPCOM_API(nsresult) + NS_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, + PRUint32 paramCount, nsXPTCVariant* params) + { +- PRUint64 *vtable = *(PRUint64 **)that; +- PRUint64 method = vtable[methodIndex]; ++ vtable_func *vtable = *reinterpret_cast(that); ++ vtable_func method = vtable[methodIndex]; + PRUint64 overflow = invoke_count_words (paramCount, params); ++ PRUint64 *stack_space = reinterpret_cast(__builtin_alloca((overflow + 8 /* 4 64-bits gpr + 4 64-bits fpr */) * 8)); + PRUint64 result; + +- __asm__ __volatile__ +- ( +- "lgr 7,15\n\t" +- "aghi 7,-64\n\t" +- +- "lgr 3,%3\n\t" +- "sllg 3,3,3\n\t" +- "lcgr 3,3\n\t" +- "lg 2,0(15)\n\t" +- "la 15,0(3,7)\n\t" +- "stg 2,0(15)\n\t" +- +- "lgr 2,%1\n\t" +- "lgr 3,%2\n\t" +- "la 4,160(15)\n\t" +- "lgr 5,%3\n\t" +- "basr 14,%4\n\t" +- +- "lgr 2,%5\n\t" +- "ld 0,192(7)\n\t" +- "ld 2,200(7)\n\t" +- "ld 4,208(7)\n\t" +- "ld 6,216(7)\n\t" +- "lmg 3,6,160(7)\n\t" +- "basr 14,%6\n\t" ++ invoke_copy_to_stack(paramCount, params, stack_space, overflow); + +- "la 15,64(7)\n\t" ++ PRUint64 *d_gpr = stack_space + overflow; ++ double *d_fpr = reinterpret_cast(d_gpr + 4); + +- "lgr %0,2\n\t" +- : "=r" (result) +- : "r" ((PRUint64)paramCount), +- "r" (params), +- "r" (overflow), +- "a" (invoke_copy_to_stack), +- "a" (that), +- "a" (method) +- : "2", "3", "4", "5", "6", "7", "14", "cc", "memory", +- "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7" +- ); +- +- return result; ++ return method(that, d_gpr[0], d_gpr[1], d_gpr[2], d_gpr[3], d_fpr[0], d_fpr[1], d_fpr[2], d_fpr[3]); + } + diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-711353-Add-support-for-GNU-kFreeBSD-and-GNU-Hurd.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-711353-Add-support-for-GNU-kFreeBSD-and-GNU-Hurd.patch new file mode 100644 index 0000000..721caf4 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-711353-Add-support-for-GNU-kFreeBSD-and-GNU-Hurd.patch @@ -0,0 +1,23 @@ +From: Mike Hommey +Date: Fri, 16 Dec 2011 11:29:43 +0100 +Subject: Bug 711353 - Add support for GNU/kFreeBSD and GNU/Hurd to + gfx/angle/src/compiler/osinclude.h + +--- + gfx/angle/src/compiler/osinclude.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gfx/angle/src/compiler/osinclude.h b/gfx/angle/src/compiler/osinclude.h +index dacdc22..6e84774 100644 +--- a/gfx/angle/src/compiler/osinclude.h ++++ b/gfx/angle/src/compiler/osinclude.h +@@ -16,7 +16,8 @@ + #define ANGLE_OS_WIN + #elif defined(__APPLE__) || defined(__linux__) || \ + defined(__FreeBSD__) || defined(__OpenBSD__) || \ +- defined(__sun) || defined(ANDROID) ++ defined(__sun) || defined(ANDROID) || \ ++ defined(__GLIBC__) || defined(__GNU__) + #define ANGLE_OS_POSIX + #else + #error Unsupported platform. diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-747870-Properly-align-XPCLazyCallContext-mData.-.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-747870-Properly-align-XPCLazyCallContext-mData.-.patch new file mode 100644 index 0000000..ea01a1c --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Bug-747870-Properly-align-XPCLazyCallContext-mData.-.patch @@ -0,0 +1,40 @@ +From: Mike Hommey +Date: Mon, 23 Apr 2012 12:32:10 +0200 +Subject: Bug 747870 - Properly align XPCLazyCallContext::mData. r=bholley + +--- + js/xpconnect/src/xpcprivate.h | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h +index d57f66e..ca23216 100644 +--- a/js/xpconnect/src/xpcprivate.h ++++ b/js/xpconnect/src/xpcprivate.h +@@ -1328,12 +1328,13 @@ public: + XPCCallContext &GetXPCCallContext() + { + if (!mCcx) { ++ XPCCallContext *data = mData.addr(); + mCcxToDestroy = mCcx = +- new (mData) XPCCallContext(mCallerLanguage, mCx, +- mCallBeginRequest == CALL_BEGINREQUEST, +- mObj, +- mFlattenedJSObject, mWrapper, +- mTearOff); ++ new (data) XPCCallContext(mCallerLanguage, mCx, ++ mCallBeginRequest == CALL_BEGINREQUEST, ++ mObj, ++ mFlattenedJSObject, mWrapper, ++ mTearOff); + if (!mCcx->IsValid()) { + NS_ERROR("This is not supposed to fail!"); + } +@@ -1361,7 +1362,7 @@ private: + JSObject *mFlattenedJSObject; + XPCWrappedNative *mWrapper; + XPCWrappedNativeTearOff *mTearOff; +- char mData[sizeof(XPCCallContext)]; ++ mozilla::AlignedStorage2 mData; + }; + + /*************************************************************************** diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch new file mode 100644 index 0000000..6ef2226 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/porting/Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch @@ -0,0 +1,31 @@ +From: Mike Hommey +Date: Fri, 18 Nov 2011 11:28:30 +0100 +Subject: Fix GNU/non-Linux failure to build because of + ipc/chromium/src/base/dir_reader_posix.h + +--- + ipc/chromium/src/base/dir_reader_posix.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ipc/chromium/src/base/dir_reader_posix.h b/ipc/chromium/src/base/dir_reader_posix.h +index f591ae0..4b74a08 100644 +--- a/ipc/chromium/src/base/dir_reader_posix.h ++++ b/ipc/chromium/src/base/dir_reader_posix.h +@@ -18,7 +18,7 @@ + // seems worse than falling back to enumerating all file descriptors so we will + // probably never implement this on the Mac. + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) && defined(__linux__) + #include "base/dir_reader_linux.h" + #else + #include "base/dir_reader_fallback.h" +@@ -26,7 +26,7 @@ + + namespace base { + +-#if defined(OS_LINUX) ++#if defined(OS_LINUX) && defined(__linux__) + typedef DirReaderLinux DirReaderPosix; + #else + typedef DirReaderFallback DirReaderPosix; diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/powerpc_va_list.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/powerpc_va_list.patch new file mode 100644 index 0000000..e91e09a --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/powerpc_va_list.patch @@ -0,0 +1,44 @@ +--- mozilla-release.ORIG/xpcom/glue/nsTextFormatter.cpp 2009-07-30 09:30:35.000000000 -0600 ++++ mozilla-release/xpcom/glue/nsTextFormatter.cpp 2010-03-24 15:48:24.000000000 -0600 +@@ -70,7 +70,10 @@ + ** Note: on some platforms va_list is defined as an array, + ** and requires array notation. + */ +- ++#if defined(__powerpc__) ++#define HAVE_VA_LIST_AS_ARRAY ++#endif ++ + #ifdef HAVE_VA_COPY + #define VARARGS_ASSIGN(foo, bar) VA_COPY(foo,bar) + #elif defined(HAVE_VA_LIST_AS_ARRAY) + +diff -ur mozilla-release.ORIG/js/src/jsapi.cpp mozilla-release/js/src/jsapi.cpp +--- mozilla-release.ORIG/js/src/jsapi.cpp 2012-02-15 23:40:35.000000000 -0700 ++++ mozilla-release/js/src/jsapi.cpp 2012-03-01 17:01:41.716770994 -0700 +@@ -108,6 +108,10 @@ + #include "jsxml.h" + #endif + ++#if defined(__powerpc__) ++#define HAVE_VA_LIST_AS_ARRAY ++#endif ++ + using namespace js; + using namespace js::gc; + using namespace js::types; + +diff -ur mozilla-release.ORIG/js/src/jsprf.cpp mozilla-release/js/src/jsprf.cpp +--- mozilla-release.ORIG/js/src/jsprf.cpp 2012-02-15 23:40:35.000000000 -0700 ++++ mozilla-release/js/src/jsprf.cpp 2012-03-01 17:01:41.348769842 -0700 +@@ -57,6 +57,10 @@ + ** Note: on some platforms va_list is defined as an array, + ** and requires array notation. + */ ++#if defined(__powerpc__) ++#define HAVE_VA_LIST_AS_ARRAY ++#endif ++ + #ifdef HAVE_VA_COPY + #define VARARGS_ASSIGN(foo, bar) VA_COPY(foo,bar) + #elif defined(HAVE_VA_LIST_AS_ARRAY) diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Don-t-auto-disable-extensions-in-system-directories.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Don-t-auto-disable-extensions-in-system-directories.patch new file mode 100644 index 0000000..f01ac83 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Don-t-auto-disable-extensions-in-system-directories.patch @@ -0,0 +1,21 @@ +From: Mike Hommey +Date: Fri, 17 Feb 2012 17:47:15 +0100 +Subject: Don't auto-disable extensions in system directories + +--- + browser/app/profile/firefox.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js +index 3d979c2..6d72e8d 100644 +--- a/browser/app/profile/firefox.js ++++ b/browser/app/profile/firefox.js +@@ -88,7 +88,7 @@ pref("extensions.hotfix.certs.1.sha1Fingerprint", "CA:C4:7D:BF:63:4D:24:E9:DC:93 + // Disable add-ons installed into the shared user and shared system areas by + // default. This does not include the application directory. See the SCOPE + // constants in AddonManager.jsm for values to use here +-pref("extensions.autoDisableScopes", 15); ++pref("extensions.autoDisableScopes", 3); + + // Dictionary download preference + pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/"); diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Enable-intl.locale.matchOS-and-report-the-locale-cor.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Enable-intl.locale.matchOS-and-report-the-locale-cor.patch new file mode 100644 index 0000000..773b61a --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Enable-intl.locale.matchOS-and-report-the-locale-cor.patch @@ -0,0 +1,23 @@ +From: Mike Hommey +Date: Thu, 13 Mar 2008 20:28:02 +0100 +Subject: Enable intl.locale.matchOS, and report the locale correctly + +https://bugzilla.mozilla.org/show_bug.cgi?id=331779 +--- + xulrunner/app/xulrunner.js | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/xulrunner/app/xulrunner.js b/xulrunner/app/xulrunner.js +index 880593c..0a0f5a9 100644 +--- a/xulrunner/app/xulrunner.js ++++ b/xulrunner/app/xulrunner.js +@@ -39,7 +39,8 @@ + // We need to override the default values of these preferences since all.js + // assumes these are in the navigator package, which for us is nonexistent. + // XXX(darin): perhaps all.js should not be seamonkey specific +-pref("general.useragent.locale", "@AB_CD@"); ++pref("intl.locale.matchOS", true); ++pref("general.useragent.locale", "chrome://global/locale/intl.properties"); + pref("xpinstall.dialog.confirm", "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul"); + pref("xpinstall.dialog.progress.chrome", "chrome://mozapps/content/extensions/extensions.xul"); + pref("xpinstall.dialog.progress.skin", "chrome://mozapps/content/extensions/extensions.xul"); diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Remove-general.useragent.locale-prefs-from-firefox-..patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Remove-general.useragent.locale-prefs-from-firefox-..patch new file mode 100644 index 0000000..68034fc --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Remove-general.useragent.locale-prefs-from-firefox-..patch @@ -0,0 +1,31 @@ +From: Mike Hommey +Date: Sat, 18 Oct 2008 14:30:06 +0200 +Subject: Remove general.useragent.locale prefs from firefox*.js + +It is better defined in the GRE provided by xulrunner-1.9 +--- + browser/app/profile/firefox.js | 1 - + browser/locales/en-US/firefox-l10n.js | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js +index 4f3aac3..3d979c2 100644 +--- a/browser/app/profile/firefox.js ++++ b/browser/app/profile/firefox.js +@@ -229,7 +229,6 @@ pref("keyword.enabled", true); + // "use the search service's default engine" + pref("keyword.URL", ""); + +-pref("general.useragent.locale", "@AB_CD@"); + pref("general.skins.selectedSkin", "classic/1.0"); + + pref("general.smoothScroll", false); +diff --git a/browser/locales/en-US/firefox-l10n.js b/browser/locales/en-US/firefox-l10n.js +index e9027aa..a683b7f 100644 +--- a/browser/locales/en-US/firefox-l10n.js ++++ b/browser/locales/en-US/firefox-l10n.js +@@ -36,4 +36,3 @@ + + #filter substitution + +-pref("general.useragent.locale", "@AB_CD@"); diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Set-DPI-to-system-settings.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Set-DPI-to-system-settings.patch new file mode 100644 index 0000000..9058cd4 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Set-DPI-to-system-settings.patch @@ -0,0 +1,21 @@ +From: Mike Hommey +Date: Thu, 13 Mar 2008 20:30:19 +0100 +Subject: Set DPI to system settings + +--- + modules/libpref/src/init/all.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js +index 3c0a70c..10b82bb 100644 +--- a/modules/libpref/src/init/all.js ++++ b/modules/libpref/src/init/all.js +@@ -1397,7 +1397,7 @@ pref("layout.css.visited_links_enabled", true); + // A value of 0 means use the system DPI. A positive value is used as the DPI. + // This sets the physical size of a device pixel and thus controls the + // interpretation of physical units such as "pt". +-pref("layout.css.dpi", -1); ++pref("layout.css.dpi", 0); + + // Set the number of device pixels per CSS pixel. A value <= 0 means choose + // automatically based on user settings for the platform (e.g., "UI scale factor" diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Set-javascript.options.showInConsole.patch b/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Set-javascript.options.showInConsole.patch new file mode 100644 index 0000000..cee79cf --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/prefs/Set-javascript.options.showInConsole.patch @@ -0,0 +1,20 @@ +From: Mike Hommey +Date: Sat, 8 Dec 2007 19:24:40 +0100 +Subject: Set javascript.options.showInConsole + +--- + modules/libpref/src/init/all.js | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js +index e8160c2..3c0a70c 100644 +--- a/modules/libpref/src/init/all.js ++++ b/modules/libpref/src/init/all.js +@@ -627,6 +627,7 @@ pref("javascript.options.strict", false); + pref("javascript.options.strict.debug", true); + #endif + pref("javascript.options.relimit", true); ++pref("javascript.options.showInConsole", true); + pref("javascript.options.tracejit.content", false); + pref("javascript.options.tracejit.chrome", false); + pref("javascript.options.methodjit.content", true); diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox/vendor.js b/meta-linaro-integration/recipes-overlayed/firefox/firefox/vendor.js new file mode 100644 index 0000000..5de0eb8 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox/vendor.js @@ -0,0 +1,6 @@ +pref("general.useragent.compatMode.firefox", true); +pref("distribution.searchplugins.defaultLocale", "en-US"); +// Forbid application updates +lockPref("app.update.enabled", false); +lockPref("extensions.update.enabled", false); +lockPref("extensions.autoDisableScopes", 10); diff --git a/meta-linaro-integration/recipes-overlayed/firefox/firefox_10.0.11esr.bb b/meta-linaro-integration/recipes-overlayed/firefox/firefox_10.0.11esr.bb new file mode 100644 index 0000000..98da1a4 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/firefox/firefox_10.0.11esr.bb @@ -0,0 +1,153 @@ +# Copyright (C) 2009-2013, O.S. Systems Software Ltda. All Rights Reserved +# Released under the MIT license (see packages/COPYING) + +DESCRIPTION ?= "Browser made by mozilla" +DEPENDS += "alsa-lib curl startup-notification libevent cairo libnotify libvpx virtual/libgl nss nspr" + +LICENSE = "MPLv1 | GPLv2+ | LGPLv2.1+" +LIC_FILES_CHKSUM = "file://toolkit/content/license.html;endline=39;md5=9cb02f27e77e702043b827c9418bfbf8" + +SRC_URI = "ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/source/firefox-${PV}.source.tar.bz2;name=archive \ + file://mozilla-${PN}.png \ + file://mozilla-${PN}.desktop \ + file://fixes/Allow-.js-preference-files-to-set-locked-prefs-with-.patch \ + file://fixes/Avoid-spurious-Run-items-in-application-handlers-con.patch \ + file://fixes/Properly-launch-applications-set-in-HOME-.mailcap.patch \ + file://fixes/Fix-some-tests-using-CurProcD-where-GreD-should-be-u.patch \ + file://fixes/Bug-691898-Use-YARR-interpreter-instead-of-PCRE-on-p.patch \ + file://fixes/Bug-722127-Bump-required-libvpx-version-to-1.0.0.-r-.patch \ + file://fixes/Bug-728229-Allow-to-build-with-system-python-ply-lib.patch \ + file://fixes/Bug-720682-Don-t-crash-an-app-using-libxul-because-o.patch \ + file://fixes/Bug-696636-Block-OpenGL-1-drivers-explicitly-to-stee.patch \ + file://fixes/Load-dependent-libraries-with-their-real-path-to-avo.patch \ + file://fixes/Bug-515232-Try-getting-general.useragent.locale-as-a.patch \ + file://fixes/Bug-729817-Block-the-Nouveau-3D-driver-as-it-s-insta.patch \ + file://fixes/Bug-729817-Allow-the-Nouveau-driver-with-Mesa-8.0.1-.patch \ + file://fixes/Bug-747322-Fix-jemalloc-mmap-wrapper-for-s390x.patch \ + file://fixes/Bug-725655-gcc-4.7-build-failures-missing-headers-.-.patch \ + file://fixes/Bug-734490-fix-build-failures-with-Clang-and-GCC-4.7.patch \ + file://fixes/Bug-706724-Fix-for-error-ftruncate-was-not-declared-.patch \ + file://fixes/Bug-709259-Try-creating-a-named-cursor-before-a-bitm.patch \ + file://fixes/Bug-761082-Only-export-TabMessageUtils.h-in-mozilla-.patch \ + file://fixes/bug-693343-a11y-disabled-in-Gnome-3-when-GNOME_ACCES.patch \ + file://fixes/Allow-webGL-with-mesa-assuming-users-will-have-updat.patch \ + file://iceweasel-branding/Use-MOZ_APP_DISPLAYNAME-to-fill-appstrings.propertie.patch \ + file://iceweasel-branding/Determine-which-phishing-shavar-to-use-depending-on-.patch \ + file://porting/Add-xptcall-support-for-SH4-processors.patch \ + file://porting/Allow-ipc-code-to-build-on-GNU-kfreebsd.patch \ + file://porting/Allow-ipc-code-to-build-on-GNU-Hurd.patch \ + file://porting/Bug-698923-Don-t-require-16-bytes-alignment-for-VMFr.patch \ + file://porting/Fix-GNU-non-Linux-failure-to-build-because-of-ipc-ch.patch \ + file://porting/Bug-703531-Fix-ARMAssembler-getOp2RegScale-on-ARMv5.patch \ + file://porting/Bug-703534-Fix-build-failure-on-platforms-without-YA.patch \ + file://porting/Bug-703842-Avoid-R_SPARC_WDISP22-relocation-in-Tramp.patch \ + file://porting/Bug-703833-Avoid-invalid-conversion-from-const-size_.patch \ + file://porting/Bug-711353-Add-support-for-GNU-kFreeBSD-and-GNU-Hurd.patch \ + file://porting/Bug-747870-Properly-align-XPCLazyCallContext-mData.-.patch \ + file://porting/Bug-706787-Crash-on-s390x-nsXPCComponents-AttachNewC.patch \ + file://prefs/Remove-general.useragent.locale-prefs-from-firefox-..patch \ + file://prefs/Enable-intl.locale.matchOS-and-report-the-locale-cor.patch \ + file://prefs/Set-javascript.options.showInConsole.patch \ + file://prefs/Set-DPI-to-system-settings.patch \ + file://prefs/Don-t-auto-disable-extensions-in-system-directories.patch \ + file://debian-hacks/Check-less-things-during-configure-when-using-libxul.patch \ + file://debian-hacks/Avoid-wrong-sessionstore-data-to-keep-windows-out-of.patch \ + file://debian-hacks/Avoid-libxpcom-being-excluded-from-linked-libraries-.patch \ + file://debian-hacks/Don-t-build-example-component.patch \ + file://debian-hacks/Don-t-install-system-profile.patch \ + file://debian-hacks/Ignore-system-libjpeg-libpng-and-zlib-version-checki.patch \ + file://debian-hacks/Add-soname-to-appropriate-libraries.patch \ + file://debian-hacks/Add-another-preferences-directory-for-applications-p.patch \ + file://debian-hacks/Gross-workaround-to-avoid-installing-test-idl-and-in.patch \ + file://debian-hacks/Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch \ + file://debian-hacks/Install-missing-nanojit-and-.tbl-headers-from-js-src.patch \ + file://debian-hacks/Use-a-variable-for-xulrunner-base-version-in-various.patch \ + file://debian-hacks/Install-js-shell-when-running-make-install-from-js-s.patch \ + file://debian-hacks/Don-t-error-out-when-run-time-libsqlite-is-older-tha.patch \ + file://debian-hacks/Do-build-time-detection-of-2-bytes-wchar_t-and-char1.patch \ + file://debian-hacks/pkg-config-files-don-t-need-to-require-the-version-o.patch \ + file://debian-hacks/Add-a-2-minutes-timeout-on-xpcshell-tests.patch \ + file://debian-hacks/Fix-tracejit-to-build-against-nanojit-headers-in-dis.patch \ + file://debian-hacks/Load-distribution-search-plugins-from-etc-appname-se.patch \ + file://debian-hacks/Handle-transition-to-etc-appname-searchplugins-more-.patch \ + file://debian-hacks/Bug-508942-Use-Preprocessor.py-filters-in-defines-an.patch \ + file://configure.patch \ + file://powerpc_va_list.patch \ + file://vendor.js" + +SRC_URI[archive.md5sum] = "2f0e3a1dd7480e03f374c0121b4155e2" +SRC_URI[archive.sha256sum] = "94b4d5a339d97dc56fd349f93407c3af4f408a4a8409a64e3680d564d37594f8" + +S = "${WORKDIR}/mozilla-esr10" + +inherit mozilla + +EXTRA_OEMAKE = "installdir=${libdir}/${PN}" + +ARM_INSTRUCTION_SET = "arm" +TARGET_CC_ARCH += " -I${STAGING_INCDIR}/freetype2" + +do_install() { + oe_runmake DESTDIR="${D}" destdir="${D}" install + install -d ${D}${datadir}/applications + install -d ${D}${datadir}/pixmaps + install -m 0644 ${WORKDIR}/mozilla-${PN}.desktop ${D}${datadir}/applications/ + install -m 0644 ${WORKDIR}/mozilla-${PN}.png ${D}${datadir}/pixmaps/ + install -m 0644 ${WORKDIR}/vendor.js ${D}${libdir}/${PN}/defaults/pref/ + rm -f ${D}${libdir}/${PN}/TestGtkEmbed + rm -f ${D}${libdir}/${PN}/defaults/pref/firefox-l10n.js + + # use locale settings + grep -Rl intl.locale.matchOS ${D}${libdir}/${PN}/ \ + | grep '.js$' \ + | xargs sed -i 's/\(pref("intl.locale.matchOS",\s*\)false)/\1true)/g' + + # disable application updating + grep -Rl app.update.enabled ${D}${libdir}/${PN}/ \ + | grep '.js$' \ + | xargs sed -i 's/\(pref("app.update.enabled",\s*\)true)/\1false)/g' +} + +PACKAGES += "${PN}-inspector" + +FILES_${PN}-inspector = "${libdir}/${PN}/chrome/inspector* \ + ${libdir}/${PN}/components/*nspector* \ + ${libdir}/${PN}/extensions/inspector* \ + ${libdir}/${PN}/defaults/preferences/inspector*" +FILES_${PN} = "${bindir}/${PN} \ + ${datadir}/applications/ \ + ${datadir}/pixmaps/ \ + ${libdir}/${PN}/* \ + ${libdir}/${PN}/.autoreg \ + ${bindir}/defaults" +FILES_${PN}-dev += "${datadir}/idl ${bindir}/${PN}-config ${libdir}/${PN}-devel-*" +FILES_${PN}-staticdev += "${libdir}/${PN}-devel-*/sdk/lib/*.a" +FILES_${PN}-dbg += "${libdir}/${PN}/.debug \ + ${libdir}/${PN}/*/.debug \ + ${libdir}/${PN}/*/*/.debug \ + ${libdir}/${PN}/*/*/*/.debug \ + ${libdir}/${PN}-devel-*/*/.debug \ + ${libdir}/${PN}-devel-*/*/*/.debug \ + ${libdir}/${PN}-devel-*/*/*/*/.debug \ + ${bindir}/.debug" + +# We don't build XUL as system shared lib, so we can mark all libs as private +PRIVATE_LIBS = "libmozjs.so \ + libxpcom.so \ + libnspr4.so \ + libxul.so \ + libmozalloc.so \ + libplc4.so \ + libplds4.so" + +# mark libraries also provided by nss as private too +PRIVATE_LIBS += " \ + libfreebl3.so \ + libnss3.so \ + libnssckbi.so \ + libsmime3.so \ + libnssutil3.so \ + libnssdbm3.so \ + libssl3.so \ + libsoftokn3.so \ +" diff --git a/meta-linaro-integration/recipes-overlayed/fwts/files/0001-ACPI-improve-the-return-values-and-the-log-info-in-t.patch b/meta-linaro-integration/recipes-overlayed/fwts/files/0001-ACPI-improve-the-return-values-and-the-log-info-in-t.patch new file mode 100644 index 0000000..4138358 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/fwts/files/0001-ACPI-improve-the-return-values-and-the-log-info-in-t.patch @@ -0,0 +1,73 @@ +From e5a46ebd6dfeda4dbcec135d6482dfca7832999b Mon Sep 17 00:00:00 2001 +From: Fu Wei +Date: Tue, 25 Nov 2014 16:53:51 +0800 +Subject: [PATCH 1/3] ACPI: improve the return values and the log info in the + fwts_acpi_handle_fadt_tables function. + +If the 32-bit or/and 64-bit point is/are null, reture FWTS_NULL_POINTER instead of FWTS_ERROR. +Add the error log message for loading FACS/DSDT fail. + +It is a prerequisite for ignoring a missing FACS table in hardware-reduced mode. + +Upstream-status: Accepted [14.12.00] +Signed-off-by: Fu Wei + +--- + src/lib/src/fwts_acpi_tables.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c +index 56498e0..96a117e 100644 +--- a/src/lib/src/fwts_acpi_tables.c ++++ b/src/lib/src/fwts_acpi_tables.c +@@ -311,19 +311,19 @@ static int fwts_acpi_handle_fadt_tables( + } + /* Is it sane? */ + if (addr == 0) { +- fwts_log_error(fw, "Failed to load %s: Cannot determine " ++ fwts_log_warning(fw, "Failed to load %s: Cannot determine " + "address of %s from FADT, fields %s and %s are zero.", + name, name, name_addr32, name_addr64); +- return FWTS_ERROR; ++ return FWTS_NULL_POINTER; + } + } else if ((addr32 != NULL) && (fadt->header.length >= 44)) { + addr = (off_t)*addr32; + /* Is it sane? */ + if (addr == 0) { +- fwts_log_error(fw, "Failed to load %s: Cannot determine " ++ fwts_log_warning(fw, "Failed to load %s: Cannot determine " + "address of %s from FADT, field %s is zero.", + name, name, name_addr32); +- return FWTS_ERROR; ++ return FWTS_NULL_POINTER; + } + } else if (fadt->header.length < 44) { + fwts_log_error(fw, "Failed to load %s: FADT is too small and " +@@ -333,7 +333,7 @@ static int fwts_acpi_handle_fadt_tables( + } else { + /* This should not happen, addr64 or addr32 are NULL */ + fwts_log_error(fw, "Failed to load %s: fwts error with FADT.", name); +- return FWTS_ERROR; ++ return FWTS_NULL_POINTER; + } + + /* Sane address found, load and add the table */ +@@ -375,12 +375,14 @@ static int fwts_acpi_handle_fadt( + "FACS", "FIRMWARE_CTRL", "X_FIRMWARE_CTRL", + &fadt->firmware_control, &fadt->x_firmware_ctrl, + provenance) != FWTS_OK) { ++ fwts_log_error(fw, "Failed to load FACS!"); + return FWTS_ERROR; + } + /* Determine DSDT addr and load it */ + if (fwts_acpi_handle_fadt_tables(fw, fadt, + "DSDT", "DSTD", "X_DSDT", + &fadt->dsdt, &fadt->x_dsdt, provenance) != FWTS_OK) { ++ fwts_log_error(fw, "Failed to load DSDT!"); + return FWTS_ERROR; + } + return FWTS_OK; +-- +2.1.1 + diff --git a/meta-linaro-integration/recipes-overlayed/fwts/files/0002-ACPI-add-the-hardware-reduced-mode-check-function-in.patch b/meta-linaro-integration/recipes-overlayed/fwts/files/0002-ACPI-add-the-hardware-reduced-mode-check-function-in.patch new file mode 100644 index 0000000..0e0805b --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/fwts/files/0002-ACPI-add-the-hardware-reduced-mode-check-function-in.patch @@ -0,0 +1,67 @@ +From ff40052c103ed67677b9c4a17cdcee62ca8f6aed Mon Sep 17 00:00:00 2001 +From: Fu Wei +Date: Tue, 25 Nov 2014 17:12:24 +0800 +Subject: [PATCH 2/3] ACPI: add the hardware reduced mode check function in + src/lib/src/fwts_acpi_tables.c. + +It is a prerequisite for ignoring a missing FACS table in hardware-reduced mode. + +Upstream-status: Accepted [14.12.00] +Signed-off-by: Fu Wei +--- + src/lib/include/fwts_acpi.h | 1 + + src/lib/include/fwts_acpi_tables.h | 2 ++ + src/lib/src/fwts_acpi_tables.c | 14 ++++++++++++++ + 3 files changed, 17 insertions(+) + +diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h +index 24ebc84..73a3461 100644 +--- a/src/lib/include/fwts_acpi.h ++++ b/src/lib/include/fwts_acpi.h +@@ -46,6 +46,7 @@ extern const char *fwts_acpi_fadt_preferred_pm_profile[]; + + #define FWTS_ACPI_FADT_PREFERRED_PM_PROFILE(x) \ + ((x) > 8) ? "Reserved" : fwts_acpi_fadt_preferred_pm_profile[x] ++#define FWTS_ACPI_FADT_FLAGS_HW_REDUCED_ACPI (1<<20) + + /* 5.2.3.1 Generic Address Structure */ + typedef struct { +diff --git a/src/lib/include/fwts_acpi_tables.h b/src/lib/include/fwts_acpi_tables.h +index 6977e87..798dfc5 100644 +--- a/src/lib/include/fwts_acpi_tables.h ++++ b/src/lib/include/fwts_acpi_tables.h +@@ -45,4 +45,6 @@ int fwts_acpi_find_table_by_addr(fwts_framework *fw, const uint64_t addr, fwts_a + int fwts_acpi_get_table(fwts_framework *fw, const int index, fwts_acpi_table_info **info); + uint8_t fwts_acpi_checksum(const uint8_t *data, const int length); + ++fwts_bool fwts_acpi_is_reduced_hardware(const fwts_acpi_table_fadt *fadt); ++ + #endif +diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c +index 96a117e..7f73a10 100644 +--- a/src/lib/src/fwts_acpi_tables.c ++++ b/src/lib/src/fwts_acpi_tables.c +@@ -275,6 +275,20 @@ int fwts_acpi_free_tables(void) + } + + /* ++ * fwts_acpi_is_reduced_hardware() ++ * Check the ACPI tables for HW_REDUCED_ACPI bit in flag field. ++ */ ++fwts_bool fwts_acpi_is_reduced_hardware(const fwts_acpi_table_fadt *fadt) ++{ ++ if ((fadt->header.revision >= 5) && ++ (fadt->header.length >= 116)&& ++ (fadt->flags && FWTS_ACPI_FADT_FLAGS_HW_REDUCED_ACPI)) { ++ return FWTS_TRUE; ++ } ++ return FWTS_FALSE; ++} ++ ++/* + * fwts_acpi_handle_fadt_tables() + * depending on whether 32 or 64 bit address is usable, get the table + * address and load it. This handles the DSDT and FACS as pointed to +-- +2.1.1 + diff --git a/meta-linaro-integration/recipes-overlayed/fwts/files/0003-ACPI-a-missing-FACS-table-can-be-ignored-under-some.patch b/meta-linaro-integration/recipes-overlayed/fwts/files/0003-ACPI-a-missing-FACS-table-can-be-ignored-under-some.patch new file mode 100644 index 0000000..2a54533 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/fwts/files/0003-ACPI-a-missing-FACS-table-can-be-ignored-under-some.patch @@ -0,0 +1,85 @@ +From 778310b83da2358a4e25444fcf9101e16f0a8b5b Mon Sep 17 00:00:00 2001 +From: Fu Wei +Date: Tue, 25 Nov 2014 17:24:20 +0800 +Subject: [PATCH 3/3] ACPI: a missing FACS table can be ignored under some + circumstances + +Both of the FADT fields FIRMWARE_CTRL and X_FIRMWARE_CTRL are +allowed to be null, if and only if ACPI is operating in hardware- +reduced mode. If the ACPI tables are from before ACPI 5.0, or if +ACPI is not operating in hardware-reduced mode, at least one of the +FIRMWARE_CTRL or X_FIRMWARE_CTRL fields _must_ be non-null. + +This patch corrects the logic to ensure that a missing FACS is only +allowed under the proper circumstances. + +Upstream-status: Accepted [14.12.00] +Signed-off-by: Fu Wei +--- + src/acpi/acpitables/acpitables.c | 5 +++-- + src/lib/src/fwts_acpi_tables.c | 24 +++++++++++++++++------- + 2 files changed, 20 insertions(+), 9 deletions(-) + +diff --git a/src/acpi/acpitables/acpitables.c b/src/acpi/acpitables/acpitables.c +index 255261c..3d261cb 100644 +--- a/src/acpi/acpitables/acpitables.c ++++ b/src/acpi/acpitables/acpitables.c +@@ -75,10 +75,11 @@ static void acpi_table_check_fadt(fwts_framework *fw, fwts_acpi_table_info *tabl + + if (fadt->firmware_control == 0) { + if (table->length >= 140) { +- if (fadt->x_firmware_ctrl == 0) { ++ if ((fadt->x_firmware_ctrl == 0) && !(fwts_acpi_is_reduced_hardware(fadt))) { + fwts_failed(fw, LOG_LEVEL_CRITICAL, "FADTFACSZero", "FADT 32 bit FIRMWARE_CONTROL and 64 bit X_FIRMWARE_CONTROL (FACS address) are null."); + fwts_advice(fw, "The 32 bit FIRMWARE_CTRL or 64 bit X_FIRMWARE_CTRL should point to a valid " +- "Firmware ACPI Control Structure (FACS). This is a firmware bug and needs to be fixed."); ++ "Firmware ACPI Control Structure (FACS) when ACPI hardware reduced mode is not set. " ++ "This is a firmware bug and needs to be fixed."); + } + } else { + fwts_failed(fw, LOG_LEVEL_MEDIUM, "FADT32BitFACSNull", "FADT 32 bit FIRMWARE_CONTROL is null."); +diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c +index 7f73a10..a8285f1 100644 +--- a/src/lib/src/fwts_acpi_tables.c ++++ b/src/lib/src/fwts_acpi_tables.c +@@ -373,6 +373,7 @@ static int fwts_acpi_handle_fadt( + const fwts_acpi_table_provenance provenance) + { + static uint64_t facs_last_phys_addr; /* default to zero */ ++ int result = FWTS_ERROR; + + /* + * The FADT handling may occur twice if it appears +@@ -384,13 +385,22 @@ static int fwts_acpi_handle_fadt( + + facs_last_phys_addr = phys_addr; + +- /* Determine FACS addr and load it */ +- if (fwts_acpi_handle_fadt_tables(fw, fadt, +- "FACS", "FIRMWARE_CTRL", "X_FIRMWARE_CTRL", +- &fadt->firmware_control, &fadt->x_firmware_ctrl, +- provenance) != FWTS_OK) { +- fwts_log_error(fw, "Failed to load FACS!"); +- return FWTS_ERROR; ++ /* Determine FACS addr and load it. ++ * Will ignore the missing FACS in the hardware-reduced mode. ++ */ ++ result = fwts_acpi_handle_fadt_tables(fw, fadt, ++ "FACS", "FIRMWARE_CTRL", "X_FIRMWARE_CTRL", ++ &fadt->firmware_control, &fadt->x_firmware_ctrl, ++ provenance); ++ if ( result != FWTS_OK) { ++ if ((result == FWTS_NULL_POINTER) && ++ fwts_acpi_is_reduced_hardware(fadt)) { ++ fwts_log_info(fw, "Ignore the missing FACS. " ++ "It is optional in hardware-reduced mode"); ++ } else { ++ fwts_log_error(fw, "Failed to load FACS!"); ++ return FWTS_ERROR; ++ } + } + /* Determine DSDT addr and load it */ + if (fwts_acpi_handle_fadt_tables(fw, fadt, +-- +2.1.1 + diff --git a/meta-linaro-integration/recipes-overlayed/fwts/fwts_git.bb b/meta-linaro-integration/recipes-overlayed/fwts/fwts_git.bb new file mode 100644 index 0000000..2825da6 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/fwts/fwts_git.bb @@ -0,0 +1,26 @@ +SUMMARY = "Firmware testsuite" +DESCRIPTION = "The tool fwts comprises of over fifty tests that are designed to exercise and test different aspects of a machine's firmware. Many of these tests need super user access to read BIOS data and ACPI tables, so the tool requires running with super user privileges (e.g. with sudo)." +HOMEPAGE = "https://wiki.ubuntu.com/Kernel/Reference/fwts" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://src/main.c;beginline=1;endline=16;md5=deb8af5388e838d133eaa036f4d1496f" + +PV = "14.09.00" + +SRCREV = "cf14f3b4bab716dea95de772ad52786c1cbe862a" +SRC_URI = "git://kernel.ubuntu.com/hwe/fwts.git \ + file://0001-ACPI-improve-the-return-values-and-the-log-info-in-t.patch \ + file://0002-ACPI-add-the-hardware-reduced-mode-check-function-in.patch \ + file://0003-ACPI-a-missing-FACS-table-can-be-ignored-under-some.patch \ + " + +S = "${WORKDIR}/git" + +DEPENDS = "libpcre json-c glib-2.0" + +inherit autotools-brokensep + +FILES_${PN} += "${libdir}/fwts/lib*${SOLIBS}" +FILES_${PN}-dev += "${libdir}/fwts/lib*${SOLIBSDEV} ${libdir}/fwts/lib*.la" +FILES_${PN}-staticdev += "${libdir}/fwts/lib*a" +FILES_${PN}-dbg += "${libdir}/fwts/.debug" diff --git a/meta-linaro-integration/recipes-overlayed/kexec/kexec-tools.inc b/meta-linaro-integration/recipes-overlayed/kexec/kexec-tools.inc new file mode 100644 index 0000000..695c11e --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/kexec/kexec-tools.inc @@ -0,0 +1,17 @@ +SUMMARY = "Kexec fast reboot tools" +DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel" +AUTHOR = "Eric Biederman" +HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/" +SECTION = "kernel/userland" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \ + file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09" +DEPENDS = "zlib xz" + +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz" + +inherit autotools-brokensep + +COMPATIBLE_HOST = "(x86_64|i.86|arm|aarch64|powerpc|mips).*-(linux|freebsd.*)" + +INSANE_SKIP_${PN} = "arch" diff --git a/meta-linaro-integration/recipes-overlayed/kexec/kexec-tools/add-arm64-support.patch b/meta-linaro-integration/recipes-overlayed/kexec/kexec-tools/add-arm64-support.patch new file mode 100644 index 0000000..30b0229 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/kexec/kexec-tools/add-arm64-support.patch @@ -0,0 +1,521 @@ +From 98215763db92c85668fd217cfc719322ce54e704 Mon Sep 17 00:00:00 2001 +From: Geoff Levand +Date: Tue, 13 May 2014 10:59:52 -0700 +Subject: [PATCH 1/1] Add arm64 support + +Signed-off-by: Geoff Levand +Signed-off-by: Fathi Boudra +--- + configure.ac | 3 + kexec/Makefile | 1 + kexec/arch/arm64/Makefile | 31 +++++ + kexec/arch/arm64/include/arch/options.h | 30 ++++ + kexec/arch/arm64/kexec-arm64.c | 194 ++++++++++++++++++++++++++++++++ + kexec/arch/arm64/kexec-arm64.h | 28 ++++ + kexec/arch/arm64/kexec-elf-arm64.c | 147 ++++++++++++++++++++++++ + kexec/kexec-syscall.h | 9 + + 8 files changed, 441 insertions(+), 2 deletions(-) + create mode 100644 kexec/arch/arm64/Makefile + create mode 100644 kexec/arch/arm64/include/arch/options.h + create mode 100644 kexec/arch/arm64/kexec-arm64.c + create mode 100644 kexec/arch/arm64/kexec-arm64.h + create mode 100644 kexec/arch/arm64/kexec-elf-arm64.c + +--- a/configure.ac ++++ b/configure.ac +@@ -35,6 +35,9 @@ case $target_cpu in + ARCH="ppc64" + SUBARCH="LE" + ;; ++ aarch64* ) ++ ARCH="arm64" ++ ;; + arm* ) + ARCH="arm" + ;; +--- a/kexec/Makefile ++++ b/kexec/Makefile +@@ -71,6 +71,7 @@ KEXEC_SRCS += $($(ARCH)_FS2DT) + + include $(srcdir)/kexec/arch/alpha/Makefile + include $(srcdir)/kexec/arch/arm/Makefile ++include $(srcdir)/kexec/arch/arm64/Makefile + include $(srcdir)/kexec/arch/i386/Makefile + include $(srcdir)/kexec/arch/ia64/Makefile + include $(srcdir)/kexec/arch/m68k/Makefile +--- /dev/null ++++ b/kexec/arch/arm64/Makefile +@@ -0,0 +1,31 @@ ++ ++arm64_FS2DT += kexec/fs2dt.c ++arm64_FS2DT_INCLUDE += -include $(srcdir)/kexec/arch/arm64/kexec-arm64.h ++ ++arm64_KEXEC_SRCS += \ ++ kexec/arch/arm64/kexec-arm64.c \ ++ kexec/arch/arm64/kexec-elf-arm64.c ++ ++arm64_ARCH_REUSE_INITRD = ++arm64_ADD_SEGMENT = ++arm64_VIRT_TO_PHYS = ++ ++dist += $(arm64_KEXEC_SRCS) \ ++ kexec/arch/arm64/Makefile \ ++ kexec/arch/arm64/kexec-arm64.h ++ ++ifdef HAVE_LIBFDT ++ ++LIBS += -lfdt ++ ++else ++ ++include $(srcdir)/kexec/libfdt/Makefile.libfdt ++ ++libfdt_SRCS += $(LIBFDT_SRCS:%=kexec/libfdt/%) ++ ++arm64_CPPFLAGS = -I$(srcdir)/kexec/libfdt ++ ++arm64_KEXEC_SRCS += $(libfdt_SRCS) ++ ++endif +--- /dev/null ++++ b/kexec/arch/arm64/include/arch/options.h +@@ -0,0 +1,30 @@ ++#ifndef KEXEC_ARCH_ARM64_OPTIONS_H ++#define KEXEC_ARCH_ARM64_OPTIONS_H ++ ++#define OPT_APPEND ((OPT_MAX)+0) ++#define OPT_RAMDISK ((OPT_MAX)+1) ++#define OPT_DTB ((OPT_MAX)+2) ++#define OPT_ARCH_MAX ((OPT_MAX)+3) ++ ++#define KEXEC_ARCH_OPTIONS \ ++ KEXEC_OPTIONS \ ++ { "append", 1, NULL, OPT_APPEND }, \ ++ { "command-line", 1, NULL, OPT_APPEND }, \ ++ { "dtb", 1, NULL, OPT_DTB }, \ ++ { "initrd", 1, NULL, OPT_RAMDISK }, \ ++ { "ramdisk", 1, NULL, OPT_RAMDISK }, \ ++ ++#define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR /* Only accept long arch options. */ ++ ++#define KEXEC_ALL_OPTIONS KEXEC_ARCH_OPTIONS ++#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR ++ ++struct arm64_opts { ++ const char *command_line; ++ const char *ramdisk; ++ const char *dtb; ++}; ++ ++struct arm64_opts arm64_opts; ++ ++#endif /* KEXEC_ARCH_ARM64_OPTIONS_H */ +--- /dev/null ++++ b/kexec/arch/arm64/kexec-arm64.c +@@ -0,0 +1,194 @@ ++/* ++ * ARM64 kexec support. ++ */ ++ ++#define _GNU_SOURCE ++ ++#include ++#include ++#include ++#include ++#include ++ ++//#include ++ ++#include "../../kexec.h" ++#include "../../kexec-syscall.h" ++#include "kexec-arm64.h" ++#include "arch/options.h" ++ ++/* Global varables the core kexec routines expect. */ ++ ++unsigned char reuse_initrd; ++off_t initrd_base = 0; ++off_t initrd_size = 0; ++ ++struct memory_ranges usablemem_rgns = { ++}; ++ ++const struct arch_map_entry arches[] = { ++ { "aarch64", KEXEC_ARCH_ARM64 }, ++ { NULL, 0 }, ++}; ++ ++/* arm64 global varables. */ ++ ++struct arm64_opts arm64_opts; ++ ++void arch_usage(void) ++{ ++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__); ++ ++ printf( ++" --append=STRING Set the kernel command line to STRING.\n" ++" --command-line=STRING Set the kernel command line to STRING.\n" ++" --dtb=FILE Use FILE as the device tree blob.\n" ++" --initrd=FILE Use FILE as the kernel initial ramdisk.\n" ++" --ramdisk=FILE Use FILE as the kernel initial ramdisk.\n"); ++ ++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__); ++} ++ ++int arch_process_options(int argc, char **argv) ++{ ++ static const char short_options[] = KEXEC_OPT_STR ""; ++ static const struct option options[] = { ++ KEXEC_ARCH_OPTIONS ++ { 0 } ++ }; ++ int opt; ++ ++ for (opt = 0; opt != -1; ) { ++ opt = getopt_long(argc, argv, short_options, options, 0); ++ ++ switch (opt) { ++ case OPT_APPEND: ++ arm64_opts.command_line = optarg; ++ break; ++ case OPT_RAMDISK: ++ arm64_opts.ramdisk = optarg; ++ break; ++ case OPT_DTB: ++ arm64_opts.dtb = optarg; ++ break; ++ default: ++ break; /* Ignore core and unknown options */ ++ } ++ } ++ ++ dbgprintf("%s:%d: command_line: %s\n", __func__, __LINE__, ++ arm64_opts.command_line); ++ dbgprintf("%s:%d: ramdisk: %s\n", __func__, __LINE__, ++ arm64_opts.ramdisk); ++ dbgprintf("%s:%d: dtb: %s\n", __func__, __LINE__, arm64_opts.dtb); ++ ++ return 0; ++} ++ ++void arch_reuse_initrd(void) ++{ ++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__); ++ reuse_initrd = 1; ++} ++ ++unsigned long virt_to_phys(unsigned long v) ++{ ++ const unsigned long memstart_addr = 0x080000000UL; // FIXME: get from memory_range/DT ++ const unsigned long page_offset = 0xffffffc000000000UL; // FIXME: from where??? ++ unsigned long p = (v & ~page_offset) + memstart_addr; ++ ++ fprintf(stderr, "%s:%d: %016lx -> %016lx\n", __func__, __LINE__, v, p); ++ return p; ++} ++ ++void add_segment(struct kexec_info *info, const void *buf, size_t bufsz, ++ unsigned long base, size_t memsz) ++{ ++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__); ++ add_segment_phys_virt(info, buf, bufsz, base, memsz, 1); ++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__); ++} ++ ++int get_memory_ranges(struct memory_range **range, int *ranges, ++ unsigned long kexec_flags) ++{ ++ /* FIXME: Should get this info from device tree. */ ++ static struct memory_range memory_range[KEXEC_SEGMENT_MAX]; ++ const char *iomem; ++ int range_count = 0; ++ char line[MAX_LINE]; ++ FILE *fp; ++ ++ iomem = proc_iomem(); ++ fp = fopen(iomem, "r"); ++ ++ if (!fp) { ++ fprintf(stderr, "Cannot open %s: %s\n", iomem, strerror(errno)); ++ return -1; ++ } ++ ++ dbgprintf("memory ranges:\n"); ++ ++ while(fgets(line, sizeof(line), fp) != 0) { ++ struct memory_range r; ++ char *str; ++ int consumed; ++ ++ if (range_count >= KEXEC_SEGMENT_MAX) ++ break; ++ ++ if (sscanf(line, "%Lx-%Lx : %n", &r.start, &r.end, &consumed) ++ != 2) ++ continue; ++ ++ str = line + consumed; ++ r.end++; ++ ++ if (memcmp(str, "System RAM\n", 11)) { ++ dbgprintf(" Skip: %016Lx - %016Lx : %s", r.start, r.end, ++ str); ++ continue; ++ } ++ ++ r.type = RANGE_RAM; ++ memory_range[range_count] = r; ++ range_count++; ++ ++ dbgprintf(" Add: %016Lx - %016Lx : %s", r.start, r.end, str); ++ } ++ ++ fclose(fp); ++ *range = memory_range; ++ *ranges = range_count; ++ ++ return 0; ++} ++ ++struct file_type file_type[] = { ++ { "elf-arm64", elf_arm64_probe, elf_arm64_load, elf_arm64_usage }, ++}; ++ ++int file_types = sizeof(file_type) / sizeof(file_type[0]); ++ ++int arch_compat_trampoline(struct kexec_info *info) ++{ ++ return 0; ++} ++int machine_verify_elf_rel(struct mem_ehdr *ehdr) ++{ ++ return 0; ++} ++ ++void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type, ++ void *location, unsigned long address, unsigned long value) ++{ ++} ++ ++void arch_update_purgatory(struct kexec_info *UNUSED(info)) ++{ ++} ++ ++int is_crashkernel_mem_reserved(void) ++{ ++ return 0; ++} +--- /dev/null ++++ b/kexec/arch/arm64/kexec-arm64.h +@@ -0,0 +1,28 @@ ++/* ++ * ARM64 kexec support. ++ */ ++ ++#if !defined(KEXEC_ARM64_H) ++#define KEXEC_ARM64_H ++ ++/* #include FIXME: this is broken */ ++#include ++ ++#include "../../kexec.h" ++ ++#define KEXEC_SEGMENT_MAX 16 /* FIXME: this should come from */ ++ ++#define BOOT_BLOCK_VERSION 17 ++#define BOOT_BLOCK_LAST_COMP_VERSION 16 ++#define COMMAND_LINE_SIZE 512 ++ ++int elf_arm64_probe(const char *buf, off_t len); ++int elf_arm64_load(int argc, char **argv, const char *buf, off_t len, ++ struct kexec_info *info); ++void elf_arm64_usage(void); ++ ++struct memory_ranges usablemem_rgns; ++off_t initrd_base; ++off_t initrd_size; ++ ++#endif +--- /dev/null ++++ b/kexec/arch/arm64/kexec-elf-arm64.c +@@ -0,0 +1,147 @@ ++/* ++ * ARM64 kexec support. ++ */ ++ ++#define _GNU_SOURCE ++ ++#include ++#include ++#include ++ ++#include "kexec-arm64.h" ++ ++#include "../../kexec-syscall.h" ++#include "../../fs2dt.h" ++ ++#include "arch/options.h" ++ ++#if !defined(EM_AARCH64) ++# define EM_AARCH64 183 ++#endif ++ ++int elf_arm64_probe(const char *buf, off_t len) ++{ ++ int result; ++ struct mem_ehdr ehdr; ++ ++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__); ++ ++ result = build_elf_exec_info(buf, len, &ehdr, 0); ++ ++ if (result < 0) { ++ dbgprintf("Not an ELF executable\n"); ++ goto out; ++ } ++ ++ if (ehdr.e_machine != EM_AARCH64) { ++ dbgprintf("Not an AARCH64 executable\n"); ++ result = -1; ++ goto out; ++ } ++ ++ result = 0; ++ ++out: ++ free_elf_info(&ehdr); ++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__); ++ return result; ++} ++ ++static off_t round_up(off_t v) ++{ ++ return _ALIGN_DOWN(v + getpagesize(), getpagesize()); ++} ++ ++int elf_arm64_load(int argc, char **argv, const char *buf, off_t len, ++ struct kexec_info *info) ++{ ++ char *dtb_buf; ++ off_t dtb_base; ++ off_t dtb_size; ++ struct mem_ehdr ehdr; ++ int result; ++ //unsigned int command_line_len = strlen(arm64_opts.command_line) + 1; ++ ++ fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__); ++ ++ if (info->kexec_flags & KEXEC_ON_CRASH) { ++ fprintf(stderr, "kexec: kdump not yet supported on arm64\n"); ++ return -1; ++ } ++ ++ result = build_elf_exec_info(buf, len, &ehdr, 0); ++ ++ if (result < 0) { ++ free_elf_info(&ehdr); ++ fprintf(stderr, "%s:%d: build_elf_exec_info failed\n", __func__, ++ __LINE__); ++ return result; ++ } ++ ++ elf_exec_build_load(info, &ehdr, buf, len, 0); ++ ++ info->entry = (void*)0x80080000UL; // FIXME ++ ++ initrd_base = 0; ++ initrd_size = 0; ++ ++ if (arm64_opts.ramdisk) { ++ char *buf; ++ ++ buf = slurp_file(arm64_opts.ramdisk, &initrd_size); ++ ++ if (!buf) ++ fprintf(stderr, "kexec: empty ramdisk file\n"); ++ else { ++ initrd_base = locate_hole(info, initrd_size, 0, 0, -1, -1); ++ ++ add_segment_phys_virt(info, buf, initrd_size, initrd_base, ++ initrd_size, 0); ++ } ++ } ++ ++ fprintf(stderr, "%s:%d: initrd_base: %lx, initrd_size: %lx\n", __func__, ++ __LINE__, (unsigned long)initrd_base, (unsigned long)initrd_size); ++ ++ if (arm64_opts.dtb) ++ dtb_buf = slurp_file(arm64_opts.dtb, &dtb_size); ++ else ++ create_flatten_tree(&dtb_buf, &dtb_size, ++ arm64_opts.command_line); ++ ++ fprintf(stderr, "%s:%d: dt magic: %x : %x\n", __func__, __LINE__, ++ fdt32_to_cpu(*(uint32_t*)dtb_buf), *(uint32_t*)dtb_buf); ++ ++ result = fdt_check_header(dtb_buf); ++ ++ if (result) { ++ fprintf(stderr, "Invalid FDT.\n"); ++ return -1; ++ } ++ ++ if (arm64_opts.command_line) { ++ // FIXME: need to handle command line... ++ fprintf(stderr, "%s:%d: command line support TODO\n", __func__, __LINE__); ++ } ++ ++if (1) { ++ dtb_base = (unsigned long)info->entry + round_up(0xA43FA0); // computed kernel mem size. ++ ++ fprintf(stderr, "%s:%d: dtb_base: %lx, dtb_size: %lx\n", __func__, ++ __LINE__, (unsigned long)dtb_base, (unsigned long)dtb_size); ++} else { ++ dtb_base = locate_hole(info, dtb_size, 0, 0, -1, -1); ++ ++ fprintf(stderr, "%s:%d: dtb_base: %lx, dtb_size: %lx\n", __func__, ++ __LINE__, (unsigned long)dtb_base, (unsigned long)dtb_size); ++} ++ add_segment_phys_virt(info, dtb_buf, dtb_size, dtb_base, dtb_size, 0); ++ ++ fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__); ++ return 0; ++} ++ ++void elf_arm64_usage(void) ++{ ++ fprintf(stderr, "%s:%d\n", __func__, __LINE__); ++} +--- a/kexec/kexec-syscall.h ++++ b/kexec/kexec-syscall.h +@@ -39,8 +39,8 @@ + #ifdef __s390__ + #define __NR_kexec_load 277 + #endif +-#ifdef __arm__ +-#define __NR_kexec_load __NR_SYSCALL_BASE + 347 ++#if defined(__arm__) || defined(__arm64__) ++#define __NR_kexec_load __NR_SYSCALL_BASE + 347 + #endif + #if defined(__mips__) + #define __NR_kexec_load 4311 +@@ -76,6 +76,8 @@ static inline long kexec_load(void *entr + #define KEXEC_ARCH_PPC64 (21 << 16) + #define KEXEC_ARCH_IA_64 (50 << 16) + #define KEXEC_ARCH_ARM (40 << 16) ++#define KEXEC_ARCH_ARM64 (183 << 16) ++/* #define KEXEC_ARCH_AARCH64 (183 << 16) */ + #define KEXEC_ARCH_S390 (22 << 16) + #define KEXEC_ARCH_SH (42 << 16) + #define KEXEC_ARCH_MIPS_LE (10 << 16) +@@ -121,5 +123,8 @@ static inline long kexec_load(void *entr + #ifdef __m68k__ + #define KEXEC_ARCH_NATIVE KEXEC_ARCH_68K + #endif ++#if defined(__arm64__) ++#define KEXEC_ARCH_NATIVE KEXEC_ARCH_ARM64 ++#endif + + #endif /* KEXEC_SYSCALL_H */ diff --git a/meta-linaro-integration/recipes-overlayed/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch b/meta-linaro-integration/recipes-overlayed/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch new file mode 100644 index 0000000..ab1fe96 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch @@ -0,0 +1,82 @@ +kexec-tools: Refine kdump device_tree sort + +The commit b02d735bf was to rearrange the device-tree entries, and +assumed that these entries are sorted in the ascending order. but +acctually when I was validating kexec and kdump, the order of +serial node still is changed. So the patch is to sort these entries +by the directory name in ascending order. + +Upstream-Status: Pending + +Signed-off-by: Yang Wei +Signed-off-by: Chong Lu +--- + kexec/arch/ppc/fs2dt.c | 13 ++++++++++--- + kexec/fs2dt.c | 13 ++++++++++--- + 2 files changed, 20 insertions(+), 6 deletions(-) + +diff --git a/kexec/arch/ppc/fs2dt.c b/kexec/arch/ppc/fs2dt.c +index 4121c7d..cc04b04 100644 +--- a/kexec/arch/ppc/fs2dt.c ++++ b/kexec/arch/ppc/fs2dt.c +@@ -296,6 +296,9 @@ static int comparefunc(const void *dentry1, const void *dentry2) + { + char *str1 = (*(struct dirent **)dentry1)->d_name; + char *str2 = (*(struct dirent **)dentry2)->d_name; ++ char* ptr1 = strchr(str1, '@'); ++ char* ptr2 = strchr(str2, '@'); ++ int len1, len2; + + /* + * strcmp scans from left to right and fails to idetify for some +@@ -303,9 +306,13 @@ static int comparefunc(const void *dentry1, const void *dentry2) + * Therefore, we get the wrong sorted order like memory@10000000 and + * memory@f000000. + */ +- if (strchr(str1, '@') && strchr(str2, '@') && +- (strlen(str1) > strlen(str2))) +- return 1; ++ if (ptr1 && ptr2) { ++ len1 = ptr1 - str1; ++ len2 = ptr2 - str2; ++ if (!strncmp(str1, str2, len1 >len2 ? len1: len2) && ++ (strlen(str1) > strlen(str2))) ++ return 1; ++ } + + return strcmp(str1, str2); + } +diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c +index 5e6b98d..1c0345b 100644 +--- a/kexec/fs2dt.c ++++ b/kexec/fs2dt.c +@@ -475,6 +475,9 @@ static int comparefunc(const struct dirent **dentry1, + { + char *str1 = (*(struct dirent **)dentry1)->d_name; + char *str2 = (*(struct dirent **)dentry2)->d_name; ++ char* ptr1 = strchr(str1, '@'); ++ char* ptr2 = strchr(str2, '@'); ++ int len1, len2; + + /* + * strcmp scans from left to right and fails to idetify for some +@@ -482,9 +485,13 @@ static int comparefunc(const struct dirent **dentry1, + * Therefore, we get the wrong sorted order like memory@10000000 and + * memory@f000000. + */ +- if (strchr(str1, '@') && strchr(str2, '@') && +- (strlen(str1) > strlen(str2))) +- return 1; ++ if (ptr1 && ptr2) { ++ len1 = ptr1 - str1; ++ len2 = ptr2 - str2; ++ if (!strncmp(str1, str2, len1 >len2 ? len1: len2) && ++ (strlen(str1) > strlen(str2))) ++ return 1; ++ } + + return strcmp(str1, str2); + } +-- +1.7.9.5 + diff --git a/meta-linaro-integration/recipes-overlayed/kexec/kexec-tools_2.0.7.bb b/meta-linaro-integration/recipes-overlayed/kexec/kexec-tools_2.0.7.bb new file mode 100644 index 0000000..f0ece0d --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/kexec/kexec-tools_2.0.7.bb @@ -0,0 +1,17 @@ +require kexec-tools.inc +export LDFLAGS = "-L${STAGING_LIBDIR}" +EXTRA_OECONF = " --with-zlib=yes" + +SRC_URI += "file://kexec-tools-Refine-kdump-device_tree-sort.patch" + +SRC_URI[md5sum] = "2309ba43981cb6d39d07ac3a9aac30ab" +SRC_URI[sha256sum] = "dde5c38be39882c6c91f0129647349c4e1943b077d3020af1970b481ee954eb0" + +PACKAGES =+ "kexec kdump vmcore-dmesg" + +ALLOW_EMPTY_${PN} = "1" +RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg" + +FILES_kexec = "${sbindir}/kexec" +FILES_kdump = "${sbindir}/kdump" +FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg" diff --git a/meta-linaro-integration/recipes-overlayed/libpng/libpng_1.6.13.bb b/meta-linaro-integration/recipes-overlayed/libpng/libpng_1.6.13.bb new file mode 100644 index 0000000..8798a96 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/libpng/libpng_1.6.13.bb @@ -0,0 +1,28 @@ +SUMMARY = "PNG image format decoding library" +HOMEPAGE = "http://www.libpng.org/" +SECTION = "libs" +LICENSE = "Libpng" +LIC_FILES_CHKSUM = "file://LICENSE;md5=46401ee4b225b9ec066cb96cf1025c0f \ + file://png.h;endline=15;md5=8167a17735fc618d1df109f8b0f839a6 \ + file://png.h;beginline=229;endline=343;md5=5cdf8564a14e2f00339e4437a83b4913" +DEPENDS = "zlib" +LIBV = "16" + +SRC_URI = "${SOURCEFORGE_MIRROR}/project/libpng/libpng${LIBV}/${PV}/libpng-${PV}.tar.xz \ + " + +SRC_URI[md5sum] = "9822c25466f060142359f80ed142c9e5" +SRC_URI[sha256sum] = "d9c8ce54a5fc8052ed794ca65b553384a74c0608b09ae163cbbb07176018e625" + +BINCONFIG = "${bindir}/libpng-config ${bindir}/libpng16-config" + +inherit autotools binconfig-disabled pkgconfig + +# Work around missing symbols +EXTRA_OECONF_append = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}" + +PACKAGES =+ "${PN}-tools" + +FILES_${PN}-tools = "${bindir}/png-fix-itxt ${bindir}/pngfix" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-linaro-integration/recipes-overlayed/libunwind/libunwind-1.1/AArch64-port.patch b/meta-linaro-integration/recipes-overlayed/libunwind/libunwind-1.1/AArch64-port.patch new file mode 100644 index 0000000..228ec32 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/libunwind/libunwind-1.1/AArch64-port.patch @@ -0,0 +1,2529 @@ +From ac6c0a6535975f1dc2da6e4e2766614baac2a14a Mon Sep 17 00:00:00 2001 +From: Yvan Roux +Date: Sat, 11 May 2013 09:18:23 -0600 +Subject: [PATCH] AArch64 port. + +Upstream-Status: Backport + +--- + Makefile.am | 6 + README | 1 + configure.ac | 6 + include/libunwind-aarch64.h | 187 ++++++++++++++++++++++ + include/libunwind.h.in | 4 + include/tdep-aarch64/dwarf-config.h | 52 ++++++ + include/tdep-aarch64/jmpbuf.h | 33 +++ + include/tdep-aarch64/libunwind_i.h | 294 +++++++++++++++++++++++++++++++++++ + include/tdep/dwarf-config.h | 4 + include/tdep/jmpbuf.h | 2 + include/tdep/libunwind_i.h.in | 4 + src/Makefile.am | 39 ++++ + src/aarch64/Gcreate_addr_space.c | 60 +++++++ + src/aarch64/Gget_proc_info.c | 39 ++++ + src/aarch64/Gget_save_loc.c | 100 +++++++++++ + src/aarch64/Gglobal.c | 57 ++++++ + src/aarch64/Ginit.c | 187 ++++++++++++++++++++++ + src/aarch64/Ginit_local.c | 55 ++++++ + src/aarch64/Ginit_remote.c | 45 +++++ + src/aarch64/Gis_signal_frame.c | 64 +++++++ + src/aarch64/Gregs.c | 113 +++++++++++++ + src/aarch64/Gresume.c | 177 +++++++++++++++++++++ + src/aarch64/Gstep.c | 129 +++++++++++++++ + src/aarch64/Lcreate_addr_space.c | 5 + src/aarch64/Lget_proc_info.c | 5 + src/aarch64/Lget_save_loc.c | 5 + src/aarch64/Lglobal.c | 5 + src/aarch64/Linit.c | 5 + src/aarch64/Linit_local.c | 5 + src/aarch64/Linit_remote.c | 5 + src/aarch64/Lis_signal_frame.c | 5 + src/aarch64/Lregs.c | 5 + src/aarch64/Lresume.c | 5 + src/aarch64/Lstep.c | 5 + src/aarch64/gen-offsets.c | 68 ++++++++ + src/aarch64/init.h | 127 +++++++++++++++ + src/aarch64/is_fpreg.c | 32 +++ + src/aarch64/offsets.h | 49 +++++ + src/aarch64/regname.c | 106 ++++++++++++ + src/aarch64/siglongjmp.S | 12 + + src/aarch64/unwind_i.h | 43 +++++ + src/coredump/_UCD_access_reg_linux.c | 5 + src/ptrace/_UPT_reg_offset.c | 36 ++++ + 43 files changed, 2184 insertions(+), 7 deletions(-) + create mode 100644 include/libunwind-aarch64.h + create mode 100644 include/tdep-aarch64/dwarf-config.h + create mode 100644 include/tdep-aarch64/jmpbuf.h + create mode 100644 include/tdep-aarch64/libunwind_i.h + create mode 100644 src/aarch64/Gcreate_addr_space.c + create mode 100644 src/aarch64/Gget_proc_info.c + create mode 100644 src/aarch64/Gget_save_loc.c + create mode 100644 src/aarch64/Gglobal.c + create mode 100644 src/aarch64/Ginit.c + create mode 100644 src/aarch64/Ginit_local.c + create mode 100644 src/aarch64/Ginit_remote.c + create mode 100644 src/aarch64/Gis_signal_frame.c + create mode 100644 src/aarch64/Gregs.c + create mode 100644 src/aarch64/Gresume.c + create mode 100644 src/aarch64/Gstep.c + create mode 100644 src/aarch64/Lcreate_addr_space.c + create mode 100644 src/aarch64/Lget_proc_info.c + create mode 100644 src/aarch64/Lget_save_loc.c + create mode 100644 src/aarch64/Lglobal.c + create mode 100644 src/aarch64/Linit.c + create mode 100644 src/aarch64/Linit_local.c + create mode 100644 src/aarch64/Linit_remote.c + create mode 100644 src/aarch64/Lis_signal_frame.c + create mode 100644 src/aarch64/Lregs.c + create mode 100644 src/aarch64/Lresume.c + create mode 100644 src/aarch64/Lstep.c + create mode 100644 src/aarch64/gen-offsets.c + create mode 100644 src/aarch64/init.h + create mode 100644 src/aarch64/is_fpreg.c + create mode 100644 src/aarch64/offsets.h + create mode 100644 src/aarch64/regname.c + create mode 100644 src/aarch64/siglongjmp.S + create mode 100644 src/aarch64/unwind_i.h + +--- a/Makefile.am ++++ b/Makefile.am +@@ -2,6 +2,9 @@ include_HEADERS = include/libunwind-dyna + include/libunwind-ptrace.h \ + include/libunwind-coredump.h + ++if ARCH_AARCH64 ++include_HEADERS += include/libunwind-aarch64.h ++endif + if ARCH_ARM + include_HEADERS += include/libunwind-arm.h + endif +@@ -41,6 +44,9 @@ SUBDIRS = src tests doc + noinst_HEADERS = include/dwarf.h include/dwarf_i.h include/dwarf-eh.h \ + include/compiler.h include/libunwind_i.h include/mempool.h \ + include/remote.h \ ++ include/tdep-aarch64/dwarf-config.h \ ++ include/tdep-aarch64/jmpbuf.h \ ++ include/tdep-aarch64/libunwind_i.h \ + include/tdep-arm/dwarf-config.h include/tdep-arm/ex_tables.h \ + include/tdep-arm/jmpbuf.h include/tdep-arm/libunwind_i.h \ + include/tdep-ia64/jmpbuf.h include/tdep-ia64/rse.h \ +--- a/README ++++ b/README +@@ -9,6 +9,7 @@ several architecture/operating-system co + Linux/IA-64: Fully tested and supported. + Linux/PARISC: Works well, but C library missing unwind-info. + HP-UX/IA-64: Mostly works but known to have some serious limitations. ++ Linux/AArch64: Newly added. + Linux/PPC64: Newly added. + Linux/SuperH: Newly added. + FreeBSD/i386: Newly added. +--- a/configure.ac ++++ b/configure.ac +@@ -104,7 +104,7 @@ SET_ARCH([$target_cpu],[target_arch]) + + AC_ARG_ENABLE(coredump, + AS_HELP_STRING([--enable-coredump],[building libunwind-coredump library]),, +- [AS_CASE([$host_arch], [arm*|mips*|sh*|x86*], [enable_coredump=yes], [enable_coredump=no])] ++ [AS_CASE([$host_arch], [aarch64*|arm*|mips*|sh*|x86*], [enable_coredump=yes], [enable_coredump=no])] + ) + + AC_MSG_CHECKING([if we should build libunwind-coredump]) +@@ -121,6 +121,7 @@ AC_MSG_RESULT([$target_os]) + + AM_CONDITIONAL(BUILD_COREDUMP, test x$enable_coredump = xyes) + AM_CONDITIONAL(REMOTE_ONLY, test x$target_arch != x$host_arch) ++AM_CONDITIONAL(ARCH_AARCH64, test x$target_arch = xaarch64) + AM_CONDITIONAL(ARCH_ARM, test x$target_arch = xarm) + AM_CONDITIONAL(ARCH_IA64, test x$target_arch = xia64) + AM_CONDITIONAL(ARCH_HPPA, test x$target_arch = xhppa) +@@ -137,7 +138,7 @@ AM_CONDITIONAL(OS_FREEBSD, expr x$target + AC_MSG_CHECKING([for ELF helper width]) + case "${target_arch}" in + (arm|hppa|ppc32|x86|sh) use_elf32=yes; AC_MSG_RESULT([32]);; +-(ia64|ppc64|x86_64) use_elf64=yes; AC_MSG_RESULT([64]);; ++(aarch64|ia64|ppc64|x86_64) use_elf64=yes; AC_MSG_RESULT([64]);; + (mips) use_elfxx=yes; AC_MSG_RESULT([xx]);; + *) AC_MSG_ERROR([Unknown ELF target: ${target_arch}]) + esac +@@ -186,6 +187,7 @@ AS_HELP_STRING([--enable-cxx-exceptions] + # C++ exception handling doesn't work too well on x86 + case $target_arch in + x86*) enable_cxx_exceptions=no;; ++ aarch64*) enable_cxx_exceptions=no;; + arm*) enable_cxx_exceptions=no;; + mips*) enable_cxx_exceptions=no;; + *) enable_cxx_exceptions=yes;; +--- /dev/null ++++ b/include/libunwind-aarch64.h +@@ -0,0 +1,187 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2001-2004 Hewlett-Packard Co ++ Contributed by David Mosberger-Tang ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#ifndef LIBUNWIND_H ++#define LIBUNWIND_H ++ ++#if defined(__cplusplus) || defined(c_plusplus) ++extern "C" { ++#endif ++ ++#include ++#include ++#include ++ ++#define UNW_TARGET aarch64 ++#define UNW_TARGET_AARCH64 1 ++ ++#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ ++ ++/* This needs to be big enough to accommodate "struct cursor", while ++ leaving some slack for future expansion. Changing this value will ++ require recompiling all users of this library. Stack allocation is ++ relatively cheap and unwind-state copying is relatively rare, so we ++ want to err on making it rather too big than too small. */ ++ ++#define UNW_TDEP_CURSOR_LEN 4096 ++ ++typedef uint64_t unw_word_t; ++typedef int64_t unw_sword_t; ++ ++typedef long double unw_tdep_fpreg_t; ++ ++typedef struct ++ { ++ /* no aarch64-specific auxiliary proc-info */ ++ } ++unw_tdep_proc_info_t; ++ ++typedef enum ++ { ++ /* 64-bit general registers. */ ++ UNW_AARCH64_X0, ++ UNW_AARCH64_X1, ++ UNW_AARCH64_X2, ++ UNW_AARCH64_X3, ++ UNW_AARCH64_X4, ++ UNW_AARCH64_X5, ++ UNW_AARCH64_X6, ++ UNW_AARCH64_X7, ++ UNW_AARCH64_X8, ++ ++ /* Temporary registers. */ ++ UNW_AARCH64_X9, ++ UNW_AARCH64_X10, ++ UNW_AARCH64_X11, ++ UNW_AARCH64_X12, ++ UNW_AARCH64_X13, ++ UNW_AARCH64_X14, ++ UNW_AARCH64_X15, ++ ++ /* Intra-procedure-call temporary registers. */ ++ UNW_AARCH64_X16, ++ UNW_AARCH64_X17, ++ ++ /* Callee-saved registers. */ ++ UNW_AARCH64_X18, ++ UNW_AARCH64_X19, ++ UNW_AARCH64_X20, ++ UNW_AARCH64_X21, ++ UNW_AARCH64_X22, ++ UNW_AARCH64_X23, ++ UNW_AARCH64_X24, ++ UNW_AARCH64_X25, ++ UNW_AARCH64_X26, ++ UNW_AARCH64_X27, ++ UNW_AARCH64_X28, ++ ++ /* 64-bit frame pointer. */ ++ UNW_AARCH64_X29, ++ ++ /* 64-bit link register. */ ++ UNW_AARCH64_X30, ++ ++ /* 64-bit stack pointer. */ ++ UNW_AARCH64_SP = 31, ++ UNW_AARCH64_PC, ++ UNW_AARCH64_PSTATE, ++ ++ /* 128-bit FP/Advanced SIMD registers. */ ++ UNW_AARCH64_V0 = 64, ++ UNW_AARCH64_V1, ++ UNW_AARCH64_V2, ++ UNW_AARCH64_V3, ++ UNW_AARCH64_V4, ++ UNW_AARCH64_V5, ++ UNW_AARCH64_V6, ++ UNW_AARCH64_V7, ++ UNW_AARCH64_V8, ++ UNW_AARCH64_V9, ++ UNW_AARCH64_V10, ++ UNW_AARCH64_V11, ++ UNW_AARCH64_V12, ++ UNW_AARCH64_V13, ++ UNW_AARCH64_V14, ++ UNW_AARCH64_V15, ++ UNW_AARCH64_V16, ++ UNW_AARCH64_V17, ++ UNW_AARCH64_V18, ++ UNW_AARCH64_V19, ++ UNW_AARCH64_V20, ++ UNW_AARCH64_V21, ++ UNW_AARCH64_V22, ++ UNW_AARCH64_V23, ++ UNW_AARCH64_V24, ++ UNW_AARCH64_V25, ++ UNW_AARCH64_V26, ++ UNW_AARCH64_V27, ++ UNW_AARCH64_V28, ++ UNW_AARCH64_V29, ++ UNW_AARCH64_V30, ++ UNW_AARCH64_V31, ++ ++ UNW_AARCH64_FPSR, ++ UNW_AARCH64_FPCR, ++ ++ /* For AArch64, the CFA is the value of SP (x31) at the call site of the ++ previous frame. */ ++ UNW_AARCH64_CFA = UNW_AARCH64_SP, ++ ++ UNW_TDEP_LAST_REG = UNW_AARCH64_FPCR, ++ ++ UNW_TDEP_IP = UNW_AARCH64_X30, ++ UNW_TDEP_SP = UNW_AARCH64_SP, ++ UNW_TDEP_EH = UNW_AARCH64_X0, ++ ++ } ++aarch64_regnum_t; ++ ++/* Use R0 through R3 to pass exception handling information. */ ++#define UNW_TDEP_NUM_EH_REGS 4 ++ ++typedef struct unw_tdep_save_loc ++ { ++ /* Additional target-dependent info on a save location. */ ++ } ++unw_tdep_save_loc_t; ++ ++ ++/* On AArch64, we can directly use ucontext_t as the unwind context. */ ++typedef ucontext_t unw_tdep_context_t; ++ ++#include "libunwind-common.h" ++#include "libunwind-dynamic.h" ++ ++#define unw_tdep_getcontext(uc) (getcontext (uc), 0) ++#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) ++ ++extern int unw_tdep_is_fpreg (int); ++ ++#if defined(__cplusplus) || defined(c_plusplus) ++} ++#endif ++ ++#endif /* LIBUNWIND_H */ +--- a/include/libunwind.h.in ++++ b/include/libunwind.h.in +@@ -3,7 +3,9 @@ + + #ifndef UNW_REMOTE_ONLY + +-#if defined __arm__ ++#if defined __aarch64__ ++#include "libunwind-aarch64.h" ++#elif defined __arm__ + # include "libunwind-arm.h" + #elif defined __hppa__ + # include "libunwind-hppa.h" +--- /dev/null ++++ b/include/tdep-aarch64/dwarf-config.h +@@ -0,0 +1,52 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ Copyright (C) 2012 Tommi Rantala ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#ifndef dwarf_config_h ++#define dwarf_config_h ++ ++/* This matches the value udes by GCC (see ++ gcc/config/aarch64/aarch64.h:DWARF_FRAME_REGISTERS. */ ++#define DWARF_NUM_PRESERVED_REGS 97 ++ ++/* Return TRUE if the ADDR_SPACE uses big-endian byte-order. */ ++#define dwarf_is_big_endian(addr_space) 0 ++ ++#define dwarf_to_unw_regnum(reg) (((reg) <= UNW_AARCH64_V31) ? (reg) : 0) ++ ++/* Convert a pointer to a dwarf_cursor structure to a pointer to ++ unw_cursor_t. */ ++#define dwarf_to_cursor(c) ((unw_cursor_t *) (c)) ++ ++typedef struct dwarf_loc ++ { ++ unw_word_t val; ++#ifndef UNW_LOCAL_ONLY ++ unw_word_t type; /* see DWARF_LOC_TYPE_* macros. */ ++#endif ++ } ++dwarf_loc_t; ++ ++#endif /* dwarf_config_h */ +--- /dev/null ++++ b/include/tdep-aarch64/jmpbuf.h +@@ -0,0 +1,33 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++/* Use glibc's jump-buffer indices; NPTL peeks at SP: */ ++ ++/* FIXME for AArch64 */ ++ ++#define JB_SP 13 ++#define JB_RP 14 ++#define JB_MASK_SAVED 15 ++#define JB_MASK 16 +--- /dev/null ++++ b/include/tdep-aarch64/libunwind_i.h +@@ -0,0 +1,294 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2001-2005 Hewlett-Packard Co ++ Contributed by David Mosberger-Tang ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#ifndef AARCH64_LIBUNWIND_I_H ++#define AARCH64_LIBUNWIND_I_H ++ ++/* Target-dependent definitions that are internal to libunwind but need ++ to be shared with target-independent code. */ ++ ++#include ++#include ++ ++#include "elf64.h" ++#include "mempool.h" ++#include "dwarf.h" ++ ++typedef struct ++ { ++ /* no aarch64-specific fast trace */ ++ } ++unw_tdep_frame_t; ++ ++#ifdef UNW_LOCAL_ONLY ++ ++typedef unw_word_t aarch64_loc_t; ++ ++#else /* !UNW_LOCAL_ONLY */ ++ ++typedef struct aarch64_loc ++ { ++ unw_word_t w0, w1; ++ } ++aarch64_loc_t; ++ ++#endif /* !UNW_LOCAL_ONLY */ ++ ++struct unw_addr_space ++ { ++ struct unw_accessors acc; ++ int big_endian; ++ unw_caching_policy_t caching_policy; ++#ifdef HAVE_ATOMIC_OPS_H ++ AO_t cache_generation; ++#else ++ uint32_t cache_generation; ++#endif ++ unw_word_t dyn_generation; /* see dyn-common.h */ ++ unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ ++ struct dwarf_rs_cache global_cache; ++ struct unw_debug_frame_list *debug_frames; ++ }; ++ ++struct cursor ++ { ++ struct dwarf_cursor dwarf; /* must be first */ ++ enum ++ { ++ AARCH64_SCF_NONE, ++ AARCH64_SCF_LINUX_RT_SIGFRAME, ++ } ++ sigcontext_format; ++ unw_word_t sigcontext_addr; ++ unw_word_t sigcontext_sp; ++ unw_word_t sigcontext_pc; ++ }; ++ ++#define DWARF_GET_LOC(l) ((l).val) ++ ++#ifdef UNW_LOCAL_ONLY ++# define DWARF_NULL_LOC DWARF_LOC (0, 0) ++# define DWARF_IS_NULL_LOC(l) (DWARF_GET_LOC (l) == 0) ++# define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r) }) ++# define DWARF_IS_REG_LOC(l) 0 ++# define DWARF_REG_LOC(c,r) (DWARF_LOC((unw_word_t) \ ++ tdep_uc_addr((c)->as_arg, (r)), 0)) ++# define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), 0) ++# define DWARF_FPREG_LOC(c,r) (DWARF_LOC((unw_word_t) \ ++ tdep_uc_addr((c)->as_arg, (r)), 0)) ++ ++static inline int ++dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) ++{ ++ if (!DWARF_GET_LOC (loc)) ++ return -1; ++ *val = *(unw_fpreg_t *) DWARF_GET_LOC (loc); ++ return 0; ++} ++ ++static inline int ++dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) ++{ ++ if (!DWARF_GET_LOC (loc)) ++ return -1; ++ *(unw_fpreg_t *) DWARF_GET_LOC (loc) = val; ++ return 0; ++} ++ ++static inline int ++dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) ++{ ++ if (!DWARF_GET_LOC (loc)) ++ return -1; ++ *val = *(unw_word_t *) DWARF_GET_LOC (loc); ++ return 0; ++} ++ ++static inline int ++dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) ++{ ++ if (!DWARF_GET_LOC (loc)) ++ return -1; ++ *(unw_word_t *) DWARF_GET_LOC (loc) = val; ++ return 0; ++} ++ ++#else /* !UNW_LOCAL_ONLY */ ++# define DWARF_LOC_TYPE_FP (1 << 0) ++# define DWARF_LOC_TYPE_REG (1 << 1) ++# define DWARF_NULL_LOC DWARF_LOC (0, 0) ++# define DWARF_IS_NULL_LOC(l) \ ++ ({ dwarf_loc_t _l = (l); _l.val == 0 && _l.type == 0; }) ++# define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r), .type = (t) }) ++# define DWARF_IS_REG_LOC(l) (((l).type & DWARF_LOC_TYPE_REG) != 0) ++# define DWARF_IS_FP_LOC(l) (((l).type & DWARF_LOC_TYPE_FP) != 0) ++# define DWARF_REG_LOC(c,r) DWARF_LOC((r), DWARF_LOC_TYPE_REG) ++# define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), 0) ++# define DWARF_FPREG_LOC(c,r) DWARF_LOC((r), (DWARF_LOC_TYPE_REG \ ++ | DWARF_LOC_TYPE_FP)) ++ ++static inline int ++dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) ++{ ++ char *valp = (char *) &val; ++ unw_word_t addr; ++ int ret; ++ ++ if (DWARF_IS_NULL_LOC (loc)) ++ return -UNW_EBADREG; ++ ++ if (DWARF_IS_REG_LOC (loc)) ++ return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc), ++ val, 0, c->as_arg); ++ ++ addr = DWARF_GET_LOC (loc); ++ if ((ret = (*c->as->acc.access_mem) (c->as, addr + 0, (unw_word_t *) valp, ++ 0, c->as_arg)) < 0) ++ return ret; ++ ++ return (*c->as->acc.access_mem) (c->as, addr + 4, (unw_word_t *) valp + 1, 0, ++ c->as_arg); ++} ++ ++static inline int ++dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) ++{ ++ char *valp = (char *) &val; ++ unw_word_t addr; ++ int ret; ++ ++ if (DWARF_IS_NULL_LOC (loc)) ++ return -UNW_EBADREG; ++ ++ if (DWARF_IS_REG_LOC (loc)) ++ return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc), ++ &val, 1, c->as_arg); ++ ++ addr = DWARF_GET_LOC (loc); ++ if ((ret = (*c->as->acc.access_mem) (c->as, addr + 0, (unw_word_t *) valp, ++ 1, c->as_arg)) < 0) ++ return ret; ++ ++ return (*c->as->acc.access_mem) (c->as, addr + 4, (unw_word_t *) valp + 1, ++ 1, c->as_arg); ++} ++ ++static inline int ++dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) ++{ ++ if (DWARF_IS_NULL_LOC (loc)) ++ return -UNW_EBADREG; ++ ++ /* If a code-generator were to save a value of type unw_word_t in a ++ floating-point register, we would have to support this case. I ++ suppose it could happen with MMX registers, but does it really ++ happen? */ ++ assert (!DWARF_IS_FP_LOC (loc)); ++ ++ if (DWARF_IS_REG_LOC (loc)) ++ return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, ++ 0, c->as_arg); ++ else ++ return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val, ++ 0, c->as_arg); ++} ++ ++static inline int ++dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) ++{ ++ if (DWARF_IS_NULL_LOC (loc)) ++ return -UNW_EBADREG; ++ ++ /* If a code-generator were to save a value of type unw_word_t in a ++ floating-point register, we would have to support this case. I ++ suppose it could happen with MMX registers, but does it really ++ happen? */ ++ assert (!DWARF_IS_FP_LOC (loc)); ++ ++ if (DWARF_IS_REG_LOC (loc)) ++ return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), &val, ++ 1, c->as_arg); ++ else ++ return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), &val, ++ 1, c->as_arg); ++} ++ ++#endif /* !UNW_LOCAL_ONLY */ ++ ++ ++ ++#define tdep_getcontext_trace unw_getcontext ++#define tdep_init_done UNW_OBJ(init_done) ++#define tdep_init UNW_OBJ(init) ++/* Platforms that support UNW_INFO_FORMAT_TABLE need to define ++ tdep_search_unwind_table. */ ++#define tdep_search_unwind_table dwarf_search_unwind_table ++#define tdep_find_unwind_table dwarf_find_unwind_table ++#define tdep_uc_addr UNW_OBJ(uc_addr) ++#define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) ++#define tdep_access_reg UNW_OBJ(access_reg) ++#define tdep_access_fpreg UNW_OBJ(access_fpreg) ++#define tdep_fetch_frame(c,ip,n) do {} while(0) ++#define tdep_cache_frame(c,rs) do {} while(0) ++#define tdep_reuse_frame(c,rs) do {} while(0) ++#define tdep_stash_frame(c,rs) do {} while(0) ++#define tdep_trace(cur,addr,n) (-UNW_ENOINFO) ++ ++#ifdef UNW_LOCAL_ONLY ++# define tdep_find_proc_info(c,ip,n) \ ++ dwarf_find_proc_info((c)->as, (ip), &(c)->pi, (n), \ ++ (c)->as_arg) ++# define tdep_put_unwind_info(as,pi,arg) \ ++ dwarf_put_unwind_info((as), (pi), (arg)) ++#else ++# define tdep_find_proc_info(c,ip,n) \ ++ (*(c)->as->acc.find_proc_info)((c)->as, (ip), &(c)->pi, (n), \ ++ (c)->as_arg) ++# define tdep_put_unwind_info(as,pi,arg) \ ++ (*(as)->acc.put_unwind_info)((as), (pi), (arg)) ++#endif ++ ++#define tdep_get_as(c) ((c)->dwarf.as) ++#define tdep_get_as_arg(c) ((c)->dwarf.as_arg) ++#define tdep_get_ip(c) ((c)->dwarf.ip) ++#define tdep_big_endian(as) ((as)->big_endian) ++ ++extern int tdep_init_done; ++ ++extern void tdep_init (void); ++extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, ++ unw_dyn_info_t *di, unw_proc_info_t *pi, ++ int need_unwind_info, void *arg); ++extern void *tdep_uc_addr (unw_tdep_context_t *uc, int reg); ++extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, ++ unsigned long *segbase, unsigned long *mapoff, ++ char *path, size_t pathlen); ++extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, ++ unw_word_t *valp, int write); ++extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, ++ unw_fpreg_t *valp, int write); ++ ++#endif /* AARCH64_LIBUNWIND_I_H */ +--- a/include/tdep/dwarf-config.h ++++ b/include/tdep/dwarf-config.h +@@ -1,7 +1,9 @@ + /* Provide a real file - not a symlink - as it would cause multiarch conflicts + when multiple different arch releases are installed simultaneously. */ + +-#if defined __arm__ ++#if defined __aarch64__ ++# include "tdep-aarch64/dwarf-config.h" ++#elif defined __arm__ + # include "tdep-arm/dwarf-config.h" + #elif defined __hppa__ + # include "tdep-hppa/dwarf-config.h" +--- a/include/tdep/jmpbuf.h ++++ b/include/tdep/jmpbuf.h +@@ -3,6 +3,8 @@ + + #ifndef UNW_REMOTE_ONLY + ++#if defined __aarch64__ ++# include "tdep-aarch64/jmpbuf.h" + #if defined __arm__ + # include "tdep-arm/jmpbuf.h" + #elif defined __hppa__ +--- a/include/tdep/libunwind_i.h.in ++++ b/include/tdep/libunwind_i.h.in +@@ -3,7 +3,9 @@ + + #ifndef UNW_REMOTE_ONLY + +-#if defined __arm__ ++#if defined __aarch64__ ++# include "tdep-aarch64/libunwind_i.h" ++#elif defined __arm__ + # include "tdep-arm/libunwind_i.h" + #elif defined __hppa__ + # include "tdep-hppa/libunwind_i.h" +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -170,6 +170,28 @@ libunwind_elfxx_la_SOURCES = elfxx.c + noinst_LTLIBRARIES += $(LIBUNWIND_ELF) + libunwind_la_LIBADD += $(LIBUNWIND_ELF) + ++# The list of files that go into libunwind and libunwind-aarch64: ++noinst_HEADERS += aarch64/init.h aarch64/offsets.h aarch64/unwind_i.h ++libunwind_la_SOURCES_aarch64_common = $(libunwind_la_SOURCES_common) \ ++ aarch64/is_fpreg.c aarch64/regname.c ++ ++# The list of files that go into libunwind: ++libunwind_la_SOURCES_aarch64 = $(libunwind_la_SOURCES_aarch64_common) \ ++ $(libunwind_la_SOURCES_local) \ ++ aarch64/Lcreate_addr_space.c aarch64/Lget_proc_info.c \ ++ aarch64/Lget_save_loc.c aarch64/Lglobal.c aarch64/Linit.c \ ++ aarch64/Linit_local.c aarch64/Linit_remote.c \ ++ aarch64/Lis_signal_frame.c aarch64/Lregs.c aarch64/Lresume.c \ ++ aarch64/Lstep.c ++ ++libunwind_aarch64_la_SOURCES_aarch64 = $(libunwind_la_SOURCES_aarch64_common) \ ++ $(libunwind_la_SOURCES_generic) \ ++ aarch64/Gcreate_addr_space.c aarch64/Gget_proc_info.c \ ++ aarch64/Gget_save_loc.c aarch64/Gglobal.c aarch64/Ginit.c \ ++ aarch64/Ginit_local.c aarch64/Ginit_remote.c \ ++ aarch64/Gis_signal_frame.c aarch64/Gregs.c aarch64/Gresume.c \ ++ aarch64/Gstep.c ++ + # The list of files that go into libunwind and libunwind-arm: + noinst_HEADERS += arm/init.h arm/offsets.h arm/unwind_i.h + libunwind_la_SOURCES_arm_common = $(libunwind_la_SOURCES_common) \ +@@ -418,6 +440,18 @@ if OS_FREEBSD + libunwind_coredump_la_SOURCES += coredump/_UCD_access_reg_freebsd.c + endif + ++if ARCH_AARCH64 ++ lib_LTLIBRARIES += libunwind-aarch64.la ++ libunwind_la_SOURCES = $(libunwind_la_SOURCES_aarch64) ++ libunwind_aarch64_la_SOURCES = $(libunwind_aarch64_la_SOURCES_aarch64) ++ libunwind_aarch64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION) ++ libunwind_aarch64_la_LIBADD = libunwind-dwarf-generic.la ++ libunwind_aarch64_la_LIBADD += libunwind-elf64.la ++if !REMOTE_ONLY ++ libunwind_aarch64_la_LIBADD += libunwind.la -lc ++endif ++ libunwind_setjmp_la_SOURCES += aarch64/siglongjmp.S ++else + if ARCH_ARM + lib_LTLIBRARIES += libunwind-arm.la + libunwind_la_SOURCES = $(libunwind_la_SOURCES_arm) +@@ -545,6 +579,7 @@ endif # ARCH_MIPS + endif # ARCH_HPPA + endif # ARCH_IA64 + endif # ARCH_ARM ++endif # ARCH_AARCH64 + + # libunwind-setjmp depends on libunwind-$(arch). Therefore must be added + # at the end. +@@ -567,7 +602,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I + AM_CCASFLAGS = $(AM_CPPFLAGS) + noinst_HEADERS += unwind/unwind-internal.h + +-EXTRA_DIST = $(libunwind_la_SOURCES_arm) \ ++EXTRA_DIST = $(libunwind_la_SOURCES_aarch64) \ ++ $(libunwind_la_SOURCES_arm) \ + $(libunwind_la_SOURCES_hppa) \ + $(libunwind_la_SOURCES_ia64) \ + $(libunwind_la_SOURCES_mips) \ +@@ -579,6 +615,7 @@ EXTRA_DIST = $(libunwind_la_SOURCES_arm) + $(libunwind_la_SOURCES_common) \ + $(libunwind_la_SOURCES_local) \ + $(libunwind_la_SOURCES_generic) \ ++ $(libunwind_aarch64_la_SOURCES_aarch64) \ + $(libunwind_arm_la_SOURCES_arm) \ + $(libunwind_hppa_la_SOURCES_hppa) \ + $(libunwind_ia64_la_SOURCES_ia64) \ +--- /dev/null ++++ b/src/aarch64/Gcreate_addr_space.c +@@ -0,0 +1,60 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2012 Tommi Rantala ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include ++#include ++ ++#include "unwind_i.h" ++ ++PROTECTED unw_addr_space_t ++unw_create_addr_space (unw_accessors_t *a, int byte_order) ++{ ++#ifdef UNW_LOCAL_ONLY ++ return NULL; ++#else ++ unw_addr_space_t as; ++ ++ /* AArch64 supports little-endian and big-endian. */ ++ if (byte_order != 0 && byte_order != __LITTLE_ENDIAN ++ && byte_order != __BIG_ENDIAN) ++ return NULL; ++ ++ as = malloc (sizeof (*as)); ++ if (!as) ++ return NULL; ++ ++ memset (as, 0, sizeof (*as)); ++ ++ as->acc = *a; ++ ++ /* Default to little-endian for AArch64. */ ++ if (byte_order == 0 || byte_order == __LITTLE_ENDIAN) ++ as->big_endian = 0; ++ else ++ as->big_endian = 1; ++ ++ return as; ++#endif ++} +--- /dev/null ++++ b/src/aarch64/Gget_proc_info.c +@@ -0,0 +1,39 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include "unwind_i.h" ++ ++PROTECTED int ++unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi) ++{ ++ struct cursor *c = (struct cursor *) cursor; ++ int ret; ++ ++ ret = dwarf_make_proc_info (&c->dwarf); ++ if (ret < 0) ++ return ret; ++ ++ *pi = c->dwarf.pi; ++ return 0; ++} +--- /dev/null ++++ b/src/aarch64/Gget_save_loc.c +@@ -0,0 +1,100 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ Copyright (C) 2012 Tommi Rantala ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include "unwind_i.h" ++ ++PROTECTED int ++unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) ++{ ++ struct cursor *c = (struct cursor *) cursor; ++ dwarf_loc_t loc; ++ ++ switch (reg) ++ { ++ case UNW_AARCH64_X0: ++ case UNW_AARCH64_X1: ++ case UNW_AARCH64_X2: ++ case UNW_AARCH64_X3: ++ case UNW_AARCH64_X4: ++ case UNW_AARCH64_X5: ++ case UNW_AARCH64_X6: ++ case UNW_AARCH64_X7: ++ case UNW_AARCH64_X8: ++ case UNW_AARCH64_X9: ++ case UNW_AARCH64_X10: ++ case UNW_AARCH64_X11: ++ case UNW_AARCH64_X12: ++ case UNW_AARCH64_X13: ++ case UNW_AARCH64_X14: ++ case UNW_AARCH64_X15: ++ case UNW_AARCH64_X16: ++ case UNW_AARCH64_X17: ++ case UNW_AARCH64_X18: ++ case UNW_AARCH64_X19: ++ case UNW_AARCH64_X20: ++ case UNW_AARCH64_X21: ++ case UNW_AARCH64_X22: ++ case UNW_AARCH64_X23: ++ case UNW_AARCH64_X24: ++ case UNW_AARCH64_X25: ++ case UNW_AARCH64_X26: ++ case UNW_AARCH64_X27: ++ case UNW_AARCH64_X28: ++ case UNW_AARCH64_X29: ++ case UNW_AARCH64_X30: ++ case UNW_AARCH64_SP: ++ case UNW_AARCH64_PC: ++ case UNW_AARCH64_PSTATE: ++ loc = c->dwarf.loc[reg]; ++ break; ++ ++ default: ++ loc = DWARF_NULL_LOC; /* default to "not saved" */ ++ break; ++ } ++ ++ memset (sloc, 0, sizeof (*sloc)); ++ ++ if (DWARF_IS_NULL_LOC (loc)) ++ { ++ sloc->type = UNW_SLT_NONE; ++ return 0; ++ } ++ ++#if !defined(UNW_LOCAL_ONLY) ++ if (DWARF_IS_REG_LOC (loc)) ++ { ++ sloc->type = UNW_SLT_REG; ++ sloc->u.regnum = DWARF_GET_LOC (loc); ++ } ++ else ++#endif ++ { ++ sloc->type = UNW_SLT_MEMORY; ++ sloc->u.addr = DWARF_GET_LOC (loc); ++ } ++ return 0; ++} +--- /dev/null ++++ b/src/aarch64/Gglobal.c +@@ -0,0 +1,57 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ Copyright (C) 2012 Tommi Rantala ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include "unwind_i.h" ++#include "dwarf_i.h" ++ ++HIDDEN define_lock (aarch64_lock); ++HIDDEN int tdep_init_done; ++ ++HIDDEN void ++tdep_init (void) ++{ ++ intrmask_t saved_mask; ++ ++ sigfillset (&unwi_full_mask); ++ ++ lock_acquire (&aarch64_lock, saved_mask); ++ { ++ if (tdep_init_done) ++ /* another thread else beat us to it... */ ++ goto out; ++ ++ mi_init (); ++ ++ dwarf_init (); ++ ++#ifndef UNW_REMOTE_ONLY ++ aarch64_local_addr_space_init (); ++#endif ++ tdep_init_done = 1; /* signal that we're initialized... */ ++ } ++ out: ++ lock_release (&aarch64_lock, saved_mask); ++} +--- /dev/null ++++ b/src/aarch64/Ginit.c +@@ -0,0 +1,187 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ Copyright (C) 2012 Tommi Rantala ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include ++#include ++ ++#include "unwind_i.h" ++ ++#ifdef UNW_REMOTE_ONLY ++ ++/* unw_local_addr_space is a NULL pointer in this case. */ ++PROTECTED unw_addr_space_t unw_local_addr_space; ++ ++#else /* !UNW_REMOTE_ONLY */ ++ ++static struct unw_addr_space local_addr_space; ++ ++PROTECTED unw_addr_space_t unw_local_addr_space = &local_addr_space; ++ ++static inline void * ++uc_addr (ucontext_t *uc, int reg) ++{ ++ if (reg >= UNW_AARCH64_X0 && reg <= UNW_AARCH64_V31) ++ return &uc->uc_mcontext.regs[reg]; ++ else ++ return NULL; ++} ++ ++# ifdef UNW_LOCAL_ONLY ++ ++HIDDEN void * ++tdep_uc_addr (ucontext_t *uc, int reg) ++{ ++ return uc_addr (uc, reg); ++} ++ ++# endif /* UNW_LOCAL_ONLY */ ++ ++HIDDEN unw_dyn_info_list_t _U_dyn_info_list; ++ ++/* XXX fix me: there is currently no way to locate the dyn-info list ++ by a remote unwinder. On ia64, this is done via a special ++ unwind-table entry. Perhaps something similar can be done with ++ DWARF2 unwind info. */ ++ ++static void ++put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) ++{ ++ /* it's a no-op */ ++} ++ ++static int ++get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, ++ void *arg) ++{ ++ *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list; ++ return 0; ++} ++ ++static int ++access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *val, int write, ++ void *arg) ++{ ++ if (write) ++ { ++ Debug (16, "mem[%lx] <- %lx\n", addr, *val); ++ *(unw_word_t *) addr = *val; ++ } ++ else ++ { ++ *val = *(unw_word_t *) addr; ++ Debug (16, "mem[%lx] -> %lx\n", addr, *val); ++ } ++ return 0; ++} ++ ++static int ++access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, int write, ++ void *arg) ++{ ++ unw_word_t *addr; ++ ucontext_t *uc = arg; ++ ++ if (unw_is_fpreg (reg)) ++ goto badreg; ++ ++ if (!(addr = uc_addr (uc, reg))) ++ goto badreg; ++ ++ if (write) ++ { ++ *(unw_word_t *) addr = *val; ++ Debug (12, "%s <- %lx\n", unw_regname (reg), *val); ++ } ++ else ++ { ++ *val = *(unw_word_t *) addr; ++ Debug (12, "%s -> %lx\n", unw_regname (reg), *val); ++ } ++ return 0; ++ ++ badreg: ++ Debug (1, "bad register number %u\n", reg); ++ return -UNW_EBADREG; ++} ++ ++static int ++access_fpreg (unw_addr_space_t as, unw_regnum_t reg, unw_fpreg_t *val, ++ int write, void *arg) ++{ ++ ucontext_t *uc = arg; ++ unw_fpreg_t *addr; ++ ++ if (!unw_is_fpreg (reg)) ++ goto badreg; ++ ++ if (!(addr = uc_addr (uc, reg))) ++ goto badreg; ++ ++ if (write) ++ { ++ Debug (12, "%s <- %08lx.%08lx.%08lx\n", unw_regname (reg), ++ ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]); ++ *(unw_fpreg_t *) addr = *val; ++ } ++ else ++ { ++ *val = *(unw_fpreg_t *) addr; ++ Debug (12, "%s -> %08lx.%08lx.%08lx\n", unw_regname (reg), ++ ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]); ++ } ++ return 0; ++ ++ badreg: ++ Debug (1, "bad register number %u\n", reg); ++ /* attempt to access a non-preserved register */ ++ return -UNW_EBADREG; ++} ++ ++static int ++get_static_proc_name (unw_addr_space_t as, unw_word_t ip, ++ char *buf, size_t buf_len, unw_word_t *offp, ++ void *arg) ++{ ++ return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp); ++} ++ ++HIDDEN void ++aarch64_local_addr_space_init (void) ++{ ++ memset (&local_addr_space, 0, sizeof (local_addr_space)); ++ local_addr_space.caching_policy = UNW_CACHE_GLOBAL; ++ local_addr_space.acc.find_proc_info = dwarf_find_proc_info; ++ local_addr_space.acc.put_unwind_info = put_unwind_info; ++ local_addr_space.acc.get_dyn_info_list_addr = get_dyn_info_list_addr; ++ local_addr_space.acc.access_mem = access_mem; ++ local_addr_space.acc.access_reg = access_reg; ++ local_addr_space.acc.access_fpreg = access_fpreg; ++ local_addr_space.acc.resume = aarch64_local_resume; ++ local_addr_space.acc.get_proc_name = get_static_proc_name; ++ unw_flush_cache (&local_addr_space, 0, 0); ++} ++ ++#endif /* !UNW_REMOTE_ONLY */ +--- /dev/null ++++ b/src/aarch64/Ginit_local.c +@@ -0,0 +1,55 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ Copyright (C) 2011-2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include "unwind_i.h" ++#include "init.h" ++ ++#ifdef UNW_REMOTE_ONLY ++ ++PROTECTED int ++unw_init_local (unw_cursor_t *cursor, unw_context_t *uc) ++{ ++ return -UNW_EINVAL; ++} ++ ++#else /* !UNW_REMOTE_ONLY */ ++ ++PROTECTED int ++unw_init_local (unw_cursor_t *cursor, unw_context_t *uc) ++{ ++ struct cursor *c = (struct cursor *) cursor; ++ ++ if (!tdep_init_done) ++ tdep_init (); ++ ++ Debug (1, "(cursor=%p)\n", c); ++ ++ c->dwarf.as = unw_local_addr_space; ++ c->dwarf.as_arg = uc; ++ ++ return common_init (c, 1); ++} ++ ++#endif /* !UNW_REMOTE_ONLY */ +--- /dev/null ++++ b/src/aarch64/Ginit_remote.c +@@ -0,0 +1,45 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include "init.h" ++#include "unwind_i.h" ++ ++PROTECTED int ++unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg) ++{ ++#ifdef UNW_LOCAL_ONLY ++ return -UNW_EINVAL; ++#else /* !UNW_LOCAL_ONLY */ ++ struct cursor *c = (struct cursor *) cursor; ++ ++ if (!tdep_init_done) ++ tdep_init (); ++ ++ Debug (1, "(cursor=%p)\n", c); ++ ++ c->dwarf.as = as; ++ c->dwarf.as_arg = as_arg; ++ return common_init (c, 0); ++#endif /* !UNW_LOCAL_ONLY */ ++} +--- /dev/null ++++ b/src/aarch64/Gis_signal_frame.c +@@ -0,0 +1,64 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2012 Tommi Rantala ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include "unwind_i.h" ++ ++/* The restorer stub will always have the form: ++ ++ d2801168 movz x8, #0x8b ++ d4000001 svc #0x0 ++*/ ++ ++PROTECTED int ++unw_is_signal_frame (unw_cursor_t *cursor) ++{ ++#ifdef __linux__ ++ struct cursor *c = (struct cursor *) cursor; ++ unw_word_t w0, ip; ++ unw_addr_space_t as; ++ unw_accessors_t *a; ++ void *arg; ++ int ret; ++ ++ as = c->dwarf.as; ++ a = unw_get_accessors (as); ++ arg = c->dwarf.as_arg; ++ ++ ip = c->dwarf.ip; ++ ++ ret = (*a->access_mem) (as, ip, &w0, 0, arg); ++ if (ret < 0) ++ return ret; ++ ++ /* FIXME: distinguish 32bit insn vs 64bit registers. */ ++ if (w0 != 0xd4000001d2801168) ++ return 0; ++ ++ return 1; ++ ++#else ++ return -UNW_ENOINFO; ++#endif ++} +--- /dev/null ++++ b/src/aarch64/Gregs.c +@@ -0,0 +1,113 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ Copyright (C) 2012 Tommi Rantala ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include "unwind_i.h" ++ ++HIDDEN int ++tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, ++ int write) ++{ ++ dwarf_loc_t loc = DWARF_NULL_LOC; ++ unsigned int mask; ++ ++ switch (reg) ++ { ++ case UNW_AARCH64_X0: ++ case UNW_AARCH64_X1: ++ case UNW_AARCH64_X2: ++ case UNW_AARCH64_X3: ++ mask = 1 << reg; ++ if (write) ++ { ++ c->dwarf.eh_args[reg] = *valp; ++ c->dwarf.eh_valid_mask |= mask; ++ return 0; ++ } ++ else if ((c->dwarf.eh_valid_mask & mask) != 0) ++ { ++ *valp = c->dwarf.eh_args[reg]; ++ return 0; ++ } ++ else ++ loc = c->dwarf.loc[reg]; ++ break; ++ ++ case UNW_AARCH64_X4: ++ case UNW_AARCH64_X5: ++ case UNW_AARCH64_X6: ++ case UNW_AARCH64_X7: ++ case UNW_AARCH64_X8: ++ case UNW_AARCH64_X9: ++ case UNW_AARCH64_X10: ++ case UNW_AARCH64_X11: ++ case UNW_AARCH64_X12: ++ case UNW_AARCH64_X13: ++ case UNW_AARCH64_X14: ++ case UNW_AARCH64_X15: ++ case UNW_AARCH64_X16: ++ case UNW_AARCH64_X17: ++ case UNW_AARCH64_X18: ++ case UNW_AARCH64_X19: ++ case UNW_AARCH64_X20: ++ case UNW_AARCH64_X21: ++ case UNW_AARCH64_X22: ++ case UNW_AARCH64_X23: ++ case UNW_AARCH64_X24: ++ case UNW_AARCH64_X25: ++ case UNW_AARCH64_X26: ++ case UNW_AARCH64_X27: ++ case UNW_AARCH64_X28: ++ case UNW_AARCH64_X29: ++ case UNW_AARCH64_X30: ++ case UNW_AARCH64_PC: ++ case UNW_AARCH64_PSTATE: ++ loc = c->dwarf.loc[reg]; ++ break; ++ ++ case UNW_AARCH64_SP: ++ if (write) ++ return -UNW_EREADONLYREG; ++ *valp = c->dwarf.cfa; ++ return 0; ++ ++ default: ++ Debug (1, "bad register number %u\n", reg); ++ return -UNW_EBADREG; ++ } ++ ++ if (write) ++ return dwarf_put (&c->dwarf, loc, *valp); ++ else ++ return dwarf_get (&c->dwarf, loc, valp); ++} ++ ++HIDDEN int ++tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, unw_fpreg_t *valp, ++ int write) ++{ ++ Debug (1, "bad register number %u\n", reg); ++ return -UNW_EBADREG; ++} +--- /dev/null ++++ b/src/aarch64/Gresume.c +@@ -0,0 +1,177 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ Copyright (C) 2011-2013 Linaro Limited ++ Copyright (C) 2012 Tommi Rantala ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include "unwind_i.h" ++#include "offsets.h" ++ ++#ifndef UNW_REMOTE_ONLY ++ ++HIDDEN inline int ++aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) ++{ ++#ifdef __linux__ ++ struct cursor *c = (struct cursor *) cursor; ++ unw_tdep_context_t *uc = c->dwarf.as_arg; ++ ++ if (c->sigcontext_format == AARCH64_SCF_NONE) ++ { ++ /* Since there are no signals involved here we restore the non scratch ++ registers only. */ ++ unsigned long regs[11]; ++ regs[0] = uc->uc_mcontext.regs[19]; ++ regs[1] = uc->uc_mcontext.regs[20]; ++ regs[2] = uc->uc_mcontext.regs[21]; ++ regs[3] = uc->uc_mcontext.regs[22]; ++ regs[4] = uc->uc_mcontext.regs[23]; ++ regs[5] = uc->uc_mcontext.regs[24]; ++ regs[6] = uc->uc_mcontext.regs[25]; ++ regs[7] = uc->uc_mcontext.regs[26]; ++ regs[8] = uc->uc_mcontext.regs[27]; ++ regs[9] = uc->uc_mcontext.regs[28]; ++ regs[10] = uc->uc_mcontext.regs[30]; /* LR */ ++ unsigned long sp = uc->uc_mcontext.sp; ++ ++ struct regs_overlay { ++ char x[sizeof(regs)]; ++ }; ++ ++ asm volatile ( ++ "ldp x19, x20, [%0]\n" ++ "ldp x21, x22, [%0,16]\n" ++ "ldp x23, x24, [%0,32]\n" ++ "ldp x25, x26, [%0,48]\n" ++ "ldp x27, x28, [%0,64]\n" ++ "ldr x30, [%0,80]\n" ++ "mov sp, %1\n" ++ "ret \n" ++ : ++ : "r" (regs), ++ "r" (sp), ++ "m" (*(struct regs_overlay *)regs) ++ ); ++ } ++ else ++ { ++ struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr; ++ ++ if (c->dwarf.eh_valid_mask & 0x1) sc->regs[0] = c->dwarf.eh_args[0]; ++ if (c->dwarf.eh_valid_mask & 0x2) sc->regs[1] = c->dwarf.eh_args[1]; ++ if (c->dwarf.eh_valid_mask & 0x4) sc->regs[2] = c->dwarf.eh_args[2]; ++ if (c->dwarf.eh_valid_mask & 0x8) sc->regs[3] = c->dwarf.eh_args[3]; ++ ++ sc->regs[4] = uc->uc_mcontext.regs[4]; ++ sc->regs[5] = uc->uc_mcontext.regs[5]; ++ sc->regs[6] = uc->uc_mcontext.regs[6]; ++ sc->regs[7] = uc->uc_mcontext.regs[7]; ++ sc->regs[8] = uc->uc_mcontext.regs[8]; ++ sc->regs[9] = uc->uc_mcontext.regs[9]; ++ sc->regs[10] = uc->uc_mcontext.regs[10]; ++ sc->regs[11] = uc->uc_mcontext.regs[11]; ++ sc->regs[12] = uc->uc_mcontext.regs[12]; ++ sc->regs[13] = uc->uc_mcontext.regs[13]; ++ sc->regs[14] = uc->uc_mcontext.regs[14]; ++ sc->regs[15] = uc->uc_mcontext.regs[15]; ++ sc->regs[16] = uc->uc_mcontext.regs[16]; ++ sc->regs[17] = uc->uc_mcontext.regs[17]; ++ sc->regs[18] = uc->uc_mcontext.regs[18]; ++ sc->regs[19] = uc->uc_mcontext.regs[19]; ++ sc->regs[20] = uc->uc_mcontext.regs[20]; ++ sc->regs[21] = uc->uc_mcontext.regs[21]; ++ sc->regs[22] = uc->uc_mcontext.regs[22]; ++ sc->regs[23] = uc->uc_mcontext.regs[23]; ++ sc->regs[24] = uc->uc_mcontext.regs[24]; ++ sc->regs[25] = uc->uc_mcontext.regs[25]; ++ sc->regs[26] = uc->uc_mcontext.regs[26]; ++ sc->regs[27] = uc->uc_mcontext.regs[27]; ++ sc->regs[28] = uc->uc_mcontext.regs[28]; ++ sc->regs[29] = uc->uc_mcontext.regs[29]; ++ sc->regs[30] = uc->uc_mcontext.regs[30]; ++ sc->sp = uc->uc_mcontext.sp; ++ sc->pc = uc->uc_mcontext.pc; ++ sc->pstate = uc->uc_mcontext.pstate; ++ ++ asm volatile ( ++ "mov sp, %0\n" ++ "ret %1\n" ++ : : "r" (c->sigcontext_sp), "r" (c->sigcontext_pc) ++ ); ++ } ++ unreachable(); ++#else ++ printf ("%s: implement me\n", __FUNCTION__); ++#endif ++ return -UNW_EINVAL; ++} ++ ++#endif /* !UNW_REMOTE_ONLY */ ++ ++static inline void ++establish_machine_state (struct cursor *c) ++{ ++ unw_addr_space_t as = c->dwarf.as; ++ void *arg = c->dwarf.as_arg; ++ unw_fpreg_t fpval; ++ unw_word_t val; ++ int reg; ++ ++ Debug (8, "copying out cursor state\n"); ++ ++ for (reg = 0; reg <= UNW_AARCH64_PSTATE; ++reg) ++ { ++ Debug (16, "copying %s %d\n", unw_regname (reg), reg); ++ if (unw_is_fpreg (reg)) ++ { ++ if (tdep_access_fpreg (c, reg, &fpval, 0) >= 0) ++ as->acc.access_fpreg (as, reg, &fpval, 1, arg); ++ } ++ else ++ { ++ if (tdep_access_reg (c, reg, &val, 0) >= 0) ++ as->acc.access_reg (as, reg, &val, 1, arg); ++ } ++ } ++} ++ ++PROTECTED int ++unw_resume (unw_cursor_t *cursor) ++{ ++ struct cursor *c = (struct cursor *) cursor; ++ ++ Debug (1, "(cursor=%p)\n", c); ++ ++ if (!c->dwarf.ip) ++ { ++ /* This can happen easily when the frame-chain gets truncated ++ due to bad or missing unwind-info. */ ++ Debug (1, "refusing to resume execution at address 0\n"); ++ return -UNW_EINVAL; ++ } ++ ++ establish_machine_state (c); ++ ++ return (*c->dwarf.as->acc.resume) (c->dwarf.as, (unw_cursor_t *) c, ++ c->dwarf.as_arg); ++} +--- /dev/null ++++ b/src/aarch64/Gstep.c +@@ -0,0 +1,129 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ Copyright (C) 2011-2013 Linaro Limited ++ Copyright (C) 2012 Tommi Rantala ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include "unwind_i.h" ++#include "offsets.h" ++ ++PROTECTED int ++unw_handle_signal_frame (unw_cursor_t *cursor) ++{ ++ struct cursor *c = (struct cursor *) cursor; ++ int ret; ++ unw_word_t sc_addr, sp, sp_addr = c->dwarf.cfa; ++ struct dwarf_loc sp_loc = DWARF_LOC (sp_addr, 0); ++ ++ if ((ret = dwarf_get (&c->dwarf, sp_loc, &sp)) < 0) ++ return -UNW_EUNSPEC; ++ ++ ret = unw_is_signal_frame (cursor); ++ Debug(1, "unw_is_signal_frame()=%d\n", ret); ++ ++ /* Save the SP and PC to be able to return execution at this point ++ later in time (unw_resume). */ ++ c->sigcontext_sp = c->dwarf.cfa; ++ c->sigcontext_pc = c->dwarf.ip; ++ ++ if (ret) ++ { ++ c->sigcontext_format = AARCH64_SCF_LINUX_RT_SIGFRAME; ++ sc_addr = sp_addr + sizeof (siginfo_t) + LINUX_UC_MCONTEXT_OFF; ++ } ++ else ++ return -UNW_EUNSPEC; ++ ++ c->sigcontext_addr = sc_addr; ++ ++ /* Update the dwarf cursor. ++ Set the location of the registers to the corresponding addresses of the ++ uc_mcontext / sigcontext structure contents. */ ++ c->dwarf.loc[UNW_AARCH64_X0] = DWARF_LOC (sc_addr + LINUX_SC_X0_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X1] = DWARF_LOC (sc_addr + LINUX_SC_X1_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X2] = DWARF_LOC (sc_addr + LINUX_SC_X2_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X3] = DWARF_LOC (sc_addr + LINUX_SC_X3_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X4] = DWARF_LOC (sc_addr + LINUX_SC_X4_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X5] = DWARF_LOC (sc_addr + LINUX_SC_X5_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X6] = DWARF_LOC (sc_addr + LINUX_SC_X6_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X7] = DWARF_LOC (sc_addr + LINUX_SC_X7_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X8] = DWARF_LOC (sc_addr + LINUX_SC_X8_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X9] = DWARF_LOC (sc_addr + LINUX_SC_X9_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X10] = DWARF_LOC (sc_addr + LINUX_SC_X10_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X11] = DWARF_LOC (sc_addr + LINUX_SC_X11_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X12] = DWARF_LOC (sc_addr + LINUX_SC_X12_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X13] = DWARF_LOC (sc_addr + LINUX_SC_X13_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X14] = DWARF_LOC (sc_addr + LINUX_SC_X14_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X15] = DWARF_LOC (sc_addr + LINUX_SC_X15_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X16] = DWARF_LOC (sc_addr + LINUX_SC_X16_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X17] = DWARF_LOC (sc_addr + LINUX_SC_X17_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X18] = DWARF_LOC (sc_addr + LINUX_SC_X18_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X19] = DWARF_LOC (sc_addr + LINUX_SC_X19_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X20] = DWARF_LOC (sc_addr + LINUX_SC_X20_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X21] = DWARF_LOC (sc_addr + LINUX_SC_X21_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X22] = DWARF_LOC (sc_addr + LINUX_SC_X22_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X23] = DWARF_LOC (sc_addr + LINUX_SC_X23_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X24] = DWARF_LOC (sc_addr + LINUX_SC_X24_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X25] = DWARF_LOC (sc_addr + LINUX_SC_X25_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X26] = DWARF_LOC (sc_addr + LINUX_SC_X26_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X27] = DWARF_LOC (sc_addr + LINUX_SC_X27_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X28] = DWARF_LOC (sc_addr + LINUX_SC_X28_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X29] = DWARF_LOC (sc_addr + LINUX_SC_X29_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_X30] = DWARF_LOC (sc_addr + LINUX_SC_X30_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_SP] = DWARF_LOC (sc_addr + LINUX_SC_SP_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_PC] = DWARF_LOC (sc_addr + LINUX_SC_PC_OFF, 0); ++ c->dwarf.loc[UNW_AARCH64_PSTATE] = DWARF_LOC (sc_addr + LINUX_SC_PSTATE_OFF, 0); ++ ++ /* Set SP/CFA and PC/IP. */ ++ dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_SP], &c->dwarf.cfa); ++ dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip); ++ ++ c->dwarf.pi_valid = 0; ++ ++ return 1; ++} ++ ++PROTECTED int ++unw_step (unw_cursor_t *cursor) ++{ ++ struct cursor *c = (struct cursor *) cursor; ++ int ret; ++ ++ Debug (1, "(cursor=%p, ip=0x%016lx, cfa=0x%016lx))\n", ++ c, c->dwarf.ip, c->dwarf.cfa); ++ ++ /* Check if this is a signal frame. */ ++ if (unw_is_signal_frame (cursor)) ++ return unw_handle_signal_frame (cursor); ++ ++ ret = dwarf_step (&c->dwarf); ++ Debug(1, "dwarf_step()=%d\n", ret); ++ ++ if (unlikely (ret == -UNW_ESTOPUNWIND)) ++ return ret; ++ ++ if (unlikely (ret < 0)) ++ return 0; ++ ++ return (c->dwarf.ip == 0) ? 0 : 1; ++} +--- /dev/null ++++ b/src/aarch64/Lcreate_addr_space.c +@@ -0,0 +1,5 @@ ++#define UNW_LOCAL_ONLY ++#include ++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) ++#include "Gcreate_addr_space.c" ++#endif +--- /dev/null ++++ b/src/aarch64/Lget_proc_info.c +@@ -0,0 +1,5 @@ ++#define UNW_LOCAL_ONLY ++#include ++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) ++#include "Gget_proc_info.c" ++#endif +--- /dev/null ++++ b/src/aarch64/Lget_save_loc.c +@@ -0,0 +1,5 @@ ++#define UNW_LOCAL_ONLY ++#include ++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) ++#include "Gget_save_loc.c" ++#endif +--- /dev/null ++++ b/src/aarch64/Lglobal.c +@@ -0,0 +1,5 @@ ++#define UNW_LOCAL_ONLY ++#include ++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) ++#include "Gglobal.c" ++#endif +--- /dev/null ++++ b/src/aarch64/Linit.c +@@ -0,0 +1,5 @@ ++#define UNW_LOCAL_ONLY ++#include ++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) ++#include "Ginit.c" ++#endif +--- /dev/null ++++ b/src/aarch64/Linit_local.c +@@ -0,0 +1,5 @@ ++#define UNW_LOCAL_ONLY ++#include ++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) ++#include "Ginit_local.c" ++#endif +--- /dev/null ++++ b/src/aarch64/Linit_remote.c +@@ -0,0 +1,5 @@ ++#define UNW_LOCAL_ONLY ++#include ++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) ++#include "Ginit_remote.c" ++#endif +--- /dev/null ++++ b/src/aarch64/Lis_signal_frame.c +@@ -0,0 +1,5 @@ ++#define UNW_LOCAL_ONLY ++#include ++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) ++#include "Gis_signal_frame.c" ++#endif +--- /dev/null ++++ b/src/aarch64/Lregs.c +@@ -0,0 +1,5 @@ ++#define UNW_LOCAL_ONLY ++#include ++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) ++#include "Gregs.c" ++#endif +--- /dev/null ++++ b/src/aarch64/Lresume.c +@@ -0,0 +1,5 @@ ++#define UNW_LOCAL_ONLY ++#include ++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) ++#include "Gresume.c" ++#endif +--- /dev/null ++++ b/src/aarch64/Lstep.c +@@ -0,0 +1,5 @@ ++#define UNW_LOCAL_ONLY ++#include ++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) ++#include "Gstep.c" ++#endif +--- /dev/null ++++ b/src/aarch64/gen-offsets.c +@@ -0,0 +1,68 @@ ++#include ++#include ++#include ++#include ++ ++#define UC(N,X) \ ++ printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X)) ++ ++#define SC(N,X) \ ++ printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X)) ++ ++int ++main (void) ++{ ++ printf ( ++"/* Linux-specific definitions: */\n\n" ++ ++"/* Define various structure offsets to simplify cross-compilation. */\n\n" ++ ++"/* Offsets for AArch64 Linux \"ucontext_t\": */\n\n"); ++ ++ UC ("FLAGS", uc_flags); ++ UC ("LINK", uc_link); ++ UC ("STACK", uc_stack); ++ UC ("MCONTEXT", uc_mcontext); ++ UC ("SIGMASK", uc_sigmask); ++ ++ printf ("\n/* Offsets for AArch64 Linux \"struct sigcontext\": */\n\n"); ++ ++ SC ("R0", regs[0]); ++ SC ("R1", regs[1]); ++ SC ("R2", regs[2]); ++ SC ("R3", regs[3]); ++ SC ("R4", regs[4]); ++ SC ("R5", regs[5]); ++ SC ("R6", regs[6]); ++ SC ("R7", regs[7]); ++ SC ("R8", regs[8]); ++ SC ("R9", regs[9]); ++ SC ("R10", regs[10]); ++ SC ("R11", regs[11]); ++ SC ("R12", regs[12]); ++ SC ("R13", regs[13]); ++ SC ("R14", regs[14]); ++ SC ("R15", regs[15]); ++ SC ("R16", regs[16]); ++ SC ("R17", regs[17]); ++ SC ("R18", regs[18]); ++ SC ("R19", regs[19]); ++ SC ("R20", regs[20]); ++ SC ("R21", regs[21]); ++ SC ("R22", regs[22]); ++ SC ("R23", regs[23]); ++ SC ("R24", regs[24]); ++ SC ("R25", regs[25]); ++ SC ("R26", regs[26]); ++ SC ("R27", regs[27]); ++ SC ("R28", regs[28]); ++ SC ("R29", regs[29]); ++ SC ("R30", regs[30]); ++ SC ("R31", regs[31]); ++ ++ SC ("PC", pc); ++ SC ("SP", sp); ++ SC ("Fault", fault_address); ++ SC ("state", pstate); ++ return 0; ++} +--- /dev/null ++++ b/src/aarch64/init.h +@@ -0,0 +1,127 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2012 Tommi Rantala ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include "unwind_i.h" ++ ++static inline int ++common_init (struct cursor *c, unsigned use_prev_instr) ++{ ++ int ret, i; ++ ++ c->dwarf.loc[UNW_AARCH64_X0] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X0); ++ c->dwarf.loc[UNW_AARCH64_X1] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X1); ++ c->dwarf.loc[UNW_AARCH64_X2] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X2); ++ c->dwarf.loc[UNW_AARCH64_X3] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X3); ++ c->dwarf.loc[UNW_AARCH64_X4] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X4); ++ c->dwarf.loc[UNW_AARCH64_X5] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X5); ++ c->dwarf.loc[UNW_AARCH64_X6] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X6); ++ c->dwarf.loc[UNW_AARCH64_X7] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X7); ++ c->dwarf.loc[UNW_AARCH64_X8] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X8); ++ c->dwarf.loc[UNW_AARCH64_X9] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X9); ++ c->dwarf.loc[UNW_AARCH64_X10] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X10); ++ c->dwarf.loc[UNW_AARCH64_X11] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X11); ++ c->dwarf.loc[UNW_AARCH64_X12] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X12); ++ c->dwarf.loc[UNW_AARCH64_X13] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X13); ++ c->dwarf.loc[UNW_AARCH64_X14] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X14); ++ c->dwarf.loc[UNW_AARCH64_X15] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X15); ++ c->dwarf.loc[UNW_AARCH64_X16] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X16); ++ c->dwarf.loc[UNW_AARCH64_X17] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X17); ++ c->dwarf.loc[UNW_AARCH64_X18] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X18); ++ c->dwarf.loc[UNW_AARCH64_X19] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X19); ++ c->dwarf.loc[UNW_AARCH64_X20] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X20); ++ c->dwarf.loc[UNW_AARCH64_X21] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X21); ++ c->dwarf.loc[UNW_AARCH64_X22] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X22); ++ c->dwarf.loc[UNW_AARCH64_X23] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X23); ++ c->dwarf.loc[UNW_AARCH64_X24] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X24); ++ c->dwarf.loc[UNW_AARCH64_X25] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X25); ++ c->dwarf.loc[UNW_AARCH64_X26] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X26); ++ c->dwarf.loc[UNW_AARCH64_X27] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X27); ++ c->dwarf.loc[UNW_AARCH64_X28] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X28); ++ c->dwarf.loc[UNW_AARCH64_X29] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X29); ++ c->dwarf.loc[UNW_AARCH64_X30] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X30); ++ c->dwarf.loc[UNW_AARCH64_SP] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_SP); ++ c->dwarf.loc[UNW_AARCH64_PC] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_PC); ++ c->dwarf.loc[UNW_AARCH64_PSTATE] = DWARF_REG_LOC (&c->dwarf, ++ UNW_AARCH64_PSTATE); ++ c->dwarf.loc[UNW_AARCH64_V0] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V0); ++ c->dwarf.loc[UNW_AARCH64_V1] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V1); ++ c->dwarf.loc[UNW_AARCH64_V2] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V2); ++ c->dwarf.loc[UNW_AARCH64_V3] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V3); ++ c->dwarf.loc[UNW_AARCH64_V4] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V4); ++ c->dwarf.loc[UNW_AARCH64_V5] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V5); ++ c->dwarf.loc[UNW_AARCH64_V6] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V6); ++ c->dwarf.loc[UNW_AARCH64_V7] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V7); ++ c->dwarf.loc[UNW_AARCH64_V8] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V8); ++ c->dwarf.loc[UNW_AARCH64_V9] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V9); ++ c->dwarf.loc[UNW_AARCH64_V10] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V10); ++ c->dwarf.loc[UNW_AARCH64_V11] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V11); ++ c->dwarf.loc[UNW_AARCH64_V12] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V12); ++ c->dwarf.loc[UNW_AARCH64_V13] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V13); ++ c->dwarf.loc[UNW_AARCH64_V14] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V14); ++ c->dwarf.loc[UNW_AARCH64_V15] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V15); ++ c->dwarf.loc[UNW_AARCH64_V16] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V16); ++ c->dwarf.loc[UNW_AARCH64_V17] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V17); ++ c->dwarf.loc[UNW_AARCH64_V18] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V18); ++ c->dwarf.loc[UNW_AARCH64_V19] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V19); ++ c->dwarf.loc[UNW_AARCH64_V20] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V20); ++ c->dwarf.loc[UNW_AARCH64_V21] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V21); ++ c->dwarf.loc[UNW_AARCH64_V22] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V22); ++ c->dwarf.loc[UNW_AARCH64_V23] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V23); ++ c->dwarf.loc[UNW_AARCH64_V24] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V24); ++ c->dwarf.loc[UNW_AARCH64_V25] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V25); ++ c->dwarf.loc[UNW_AARCH64_V26] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V26); ++ c->dwarf.loc[UNW_AARCH64_V27] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V27); ++ c->dwarf.loc[UNW_AARCH64_V28] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V28); ++ c->dwarf.loc[UNW_AARCH64_V29] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V29); ++ c->dwarf.loc[UNW_AARCH64_V30] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V30); ++ c->dwarf.loc[UNW_AARCH64_V31] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V31); ++ ++ for (i = UNW_AARCH64_PSTATE + 1; i < UNW_AARCH64_V0; ++i) ++ c->dwarf.loc[i] = DWARF_NULL_LOC; ++ ++ ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip); ++ if (ret < 0) ++ return ret; ++ ++ ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_SP], &c->dwarf.cfa); ++ if (ret < 0) ++ return ret; ++ ++ c->sigcontext_format = AARCH64_SCF_NONE; ++ c->sigcontext_addr = 0; ++ c->sigcontext_sp = 0; ++ c->sigcontext_pc = 0; ++ ++ c->dwarf.args_size = 0; ++ c->dwarf.ret_addr_column = 0; ++ c->dwarf.stash_frames = 0; ++ c->dwarf.use_prev_instr = use_prev_instr; ++ c->dwarf.pi_valid = 0; ++ c->dwarf.pi_is_dynamic = 0; ++ c->dwarf.hint = 0; ++ c->dwarf.prev_rs = 0; ++ ++ return 0; ++} +--- /dev/null ++++ b/src/aarch64/is_fpreg.c +@@ -0,0 +1,32 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include "libunwind_i.h" ++ ++PROTECTED int ++unw_is_fpreg (int regnum) ++{ ++ return (regnum >= UNW_AARCH64_V0 && regnum <= UNW_AARCH64_V31); ++} +--- /dev/null ++++ b/src/aarch64/offsets.h +@@ -0,0 +1,49 @@ ++/* Linux-specific definitions: */ ++ ++/* Define various structure offsets to simplify cross-compilation. */ ++ ++/* Offsets for AArch64 Linux "ucontext_t": */ ++ ++#define LINUX_UC_FLAGS_OFF 0x0 ++#define LINUX_UC_LINK_OFF 0x8 ++#define LINUX_UC_STACK_OFF 0x10 ++#define LINUX_UC_SIGMASK_OFF 0x28 ++#define LINUX_UC_MCONTEXT_OFF 0xb0 ++ ++/* Offsets for AArch64 Linux "struct sigcontext": */ ++ ++#define LINUX_SC_FAULTADDRESS_OFF 0x00 ++#define LINUX_SC_X0_OFF 0x008 ++#define LINUX_SC_X1_OFF 0x010 ++#define LINUX_SC_X2_OFF 0x018 ++#define LINUX_SC_X3_OFF 0x020 ++#define LINUX_SC_X4_OFF 0x028 ++#define LINUX_SC_X5_OFF 0x030 ++#define LINUX_SC_X6_OFF 0x038 ++#define LINUX_SC_X7_OFF 0x040 ++#define LINUX_SC_X8_OFF 0x048 ++#define LINUX_SC_X9_OFF 0x050 ++#define LINUX_SC_X10_OFF 0x058 ++#define LINUX_SC_X11_OFF 0x060 ++#define LINUX_SC_X12_OFF 0x068 ++#define LINUX_SC_X13_OFF 0x070 ++#define LINUX_SC_X14_OFF 0x078 ++#define LINUX_SC_X15_OFF 0x080 ++#define LINUX_SC_X16_OFF 0x088 ++#define LINUX_SC_X17_OFF 0x090 ++#define LINUX_SC_X18_OFF 0x098 ++#define LINUX_SC_X19_OFF 0x0a0 ++#define LINUX_SC_X20_OFF 0x0a8 ++#define LINUX_SC_X21_OFF 0x0b0 ++#define LINUX_SC_X22_OFF 0x0b8 ++#define LINUX_SC_X23_OFF 0x0c0 ++#define LINUX_SC_X24_OFF 0x0c8 ++#define LINUX_SC_X25_OFF 0x0d0 ++#define LINUX_SC_X26_OFF 0x0d8 ++#define LINUX_SC_X27_OFF 0x0e0 ++#define LINUX_SC_X28_OFF 0x0e8 ++#define LINUX_SC_X29_OFF 0x0f0 ++#define LINUX_SC_X30_OFF 0x0f8 ++#define LINUX_SC_SP_OFF 0x100 ++#define LINUX_SC_PC_OFF 0x108 ++#define LINUX_SC_PSTATE_OFF 0x110 +--- /dev/null ++++ b/src/aarch64/regname.c +@@ -0,0 +1,106 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2012 Tommi Rantala ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#include "unwind_i.h" ++ ++static const char *const regname[] = ++ { ++ [UNW_AARCH64_X0] = "x0", ++ [UNW_AARCH64_X1] = "x1", ++ [UNW_AARCH64_X2] = "x2", ++ [UNW_AARCH64_X3] = "x3", ++ [UNW_AARCH64_X4] = "x4", ++ [UNW_AARCH64_X5] = "x5", ++ [UNW_AARCH64_X6] = "x6", ++ [UNW_AARCH64_X7] = "x7", ++ [UNW_AARCH64_X8] = "x8", ++ [UNW_AARCH64_X9] = "x9", ++ [UNW_AARCH64_X10] = "x10", ++ [UNW_AARCH64_X11] = "x11", ++ [UNW_AARCH64_X12] = "x12", ++ [UNW_AARCH64_X13] = "x13", ++ [UNW_AARCH64_X14] = "x14", ++ [UNW_AARCH64_X15] = "x15", ++ [UNW_AARCH64_X16] = "ip0", ++ [UNW_AARCH64_X17] = "ip1", ++ [UNW_AARCH64_X18] = "x18", ++ [UNW_AARCH64_X19] = "x19", ++ [UNW_AARCH64_X20] = "x20", ++ [UNW_AARCH64_X21] = "x21", ++ [UNW_AARCH64_X22] = "x22", ++ [UNW_AARCH64_X23] = "x23", ++ [UNW_AARCH64_X24] = "x24", ++ [UNW_AARCH64_X25] = "x25", ++ [UNW_AARCH64_X26] = "x26", ++ [UNW_AARCH64_X27] = "x27", ++ [UNW_AARCH64_X28] = "x28", ++ [UNW_AARCH64_X29] = "fp", ++ [UNW_AARCH64_X30] = "lr", ++ [UNW_AARCH64_SP] = "sp", ++ [UNW_AARCH64_PC] = "pc", ++ [UNW_AARCH64_V0] = "v0", ++ [UNW_AARCH64_V1] = "v1", ++ [UNW_AARCH64_V2] = "v2", ++ [UNW_AARCH64_V3] = "v3", ++ [UNW_AARCH64_V4] = "v4", ++ [UNW_AARCH64_V5] = "v5", ++ [UNW_AARCH64_V6] = "v6", ++ [UNW_AARCH64_V7] = "v7", ++ [UNW_AARCH64_V8] = "v8", ++ [UNW_AARCH64_V9] = "v9", ++ [UNW_AARCH64_V10] = "v10", ++ [UNW_AARCH64_V11] = "v11", ++ [UNW_AARCH64_V12] = "v12", ++ [UNW_AARCH64_V13] = "v13", ++ [UNW_AARCH64_V14] = "v14", ++ [UNW_AARCH64_V15] = "v15", ++ [UNW_AARCH64_V16] = "v16", ++ [UNW_AARCH64_V17] = "v17", ++ [UNW_AARCH64_V18] = "v18", ++ [UNW_AARCH64_V19] = "v19", ++ [UNW_AARCH64_V20] = "v20", ++ [UNW_AARCH64_V21] = "v21", ++ [UNW_AARCH64_V22] = "v22", ++ [UNW_AARCH64_V23] = "v23", ++ [UNW_AARCH64_V24] = "v24", ++ [UNW_AARCH64_V25] = "v25", ++ [UNW_AARCH64_V26] = "v26", ++ [UNW_AARCH64_V27] = "v27", ++ [UNW_AARCH64_V28] = "v28", ++ [UNW_AARCH64_V29] = "v29", ++ [UNW_AARCH64_V30] = "v30", ++ [UNW_AARCH64_V31] = "v31", ++ [UNW_AARCH64_FPSR] = "fpsr", ++ [UNW_AARCH64_FPCR] = "fpcr", ++ }; ++ ++PROTECTED const char * ++unw_regname (unw_regnum_t reg) ++{ ++ if (reg < (unw_regnum_t) ARRAY_SIZE (regname) && regname[reg] != NULL) ++ return regname[reg]; ++ else ++ return "???"; ++} +--- /dev/null ++++ b/src/aarch64/siglongjmp.S +@@ -0,0 +1,12 @@ ++ /* Dummy implementation for now. */ ++ ++ .global _UI_siglongjmp_cont ++ .global _UI_longjmp_cont ++ ++_UI_siglongjmp_cont: ++_UI_longjmp_cont: ++ ret ++#ifdef __linux__ ++ /* We do not need executable stack. */ ++ .section .note.GNU-stack,"",%progbits ++#endif +--- /dev/null ++++ b/src/aarch64/unwind_i.h +@@ -0,0 +1,43 @@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ Copyright (C) 2013 Linaro Limited ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#ifndef unwind_i_h ++#define unwind_i_h ++ ++#include ++ ++#include ++ ++#include "libunwind_i.h" ++ ++#define aarch64_lock UNW_OBJ(lock) ++#define aarch64_local_resume UNW_OBJ(local_resume) ++#define aarch64_local_addr_space_init UNW_OBJ(local_addr_space_init) ++ ++extern void aarch64_local_addr_space_init (void); ++extern int aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, ++ void *arg); ++ ++#endif /* unwind_i_h */ +--- a/src/coredump/_UCD_access_reg_linux.c ++++ b/src/coredump/_UCD_access_reg_linux.c +@@ -39,7 +39,10 @@ _UCD_access_reg (unw_addr_space_t as, + return -UNW_EINVAL; + } + +-#if defined(UNW_TARGET_ARM) ++#if defined(UNW_TARGET_AARCH64) ++ if (regnum < 0 || regnum >= UNW_AARCH64_FPCR) ++ goto badreg; ++#elif defined(UNW_TARGET_ARM) + if (regnum < 0 || regnum >= 16) + goto badreg; + #elif defined(UNW_TARGET_SH) +--- a/src/ptrace/_UPT_reg_offset.c ++++ b/src/ptrace/_UPT_reg_offset.c +@@ -1,6 +1,7 @@ + /* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang ++ Copyright (C) 2013 Linaro Limited + + This file is part of libunwind. + +@@ -501,6 +502,41 @@ const int _UPT_reg_offset[UNW_REG_LAST + + [UNW_ARM_R15] = 0x3c, + #elif defined(UNW_TARGET_MIPS) + #elif defined(UNW_TARGET_SH) ++#elif defined(UNW_TARGET_AARCH64) ++ [UNW_AARCH64_X0] = 0x00, ++ [UNW_AARCH64_X1] = 0x08, ++ [UNW_AARCH64_X2] = 0x10, ++ [UNW_AARCH64_X3] = 0x18, ++ [UNW_AARCH64_X4] = 0x20, ++ [UNW_AARCH64_X5] = 0x28, ++ [UNW_AARCH64_X6] = 0x30, ++ [UNW_AARCH64_X7] = 0x38, ++ [UNW_AARCH64_X8] = 0x40, ++ [UNW_AARCH64_X9] = 0x48, ++ [UNW_AARCH64_X10] = 0x50, ++ [UNW_AARCH64_X11] = 0x58, ++ [UNW_AARCH64_X12] = 0x60, ++ [UNW_AARCH64_X13] = 0x68, ++ [UNW_AARCH64_X14] = 0x70, ++ [UNW_AARCH64_X15] = 0x78, ++ [UNW_AARCH64_X16] = 0x80, ++ [UNW_AARCH64_X17] = 0x88, ++ [UNW_AARCH64_X18] = 0x90, ++ [UNW_AARCH64_X19] = 0x98, ++ [UNW_AARCH64_X20] = 0xa0, ++ [UNW_AARCH64_X21] = 0xa8, ++ [UNW_AARCH64_X22] = 0xb0, ++ [UNW_AARCH64_X23] = 0xb8, ++ [UNW_AARCH64_X24] = 0xc0, ++ [UNW_AARCH64_X25] = 0xc8, ++ [UNW_AARCH64_X26] = 0xd0, ++ [UNW_AARCH64_X27] = 0xd8, ++ [UNW_AARCH64_X28] = 0xe0, ++ [UNW_AARCH64_X29] = 0xe8, ++ [UNW_AARCH64_X30] = 0xf0, ++ [UNW_AARCH64_SP] = 0xf8, ++ [UNW_AARCH64_PC] = 0x100, ++ [UNW_AARCH64_PSTATE] = 0x108 + #else + # error Fix me. + #endif diff --git a/meta-linaro-integration/recipes-overlayed/libunwind/libunwind-1.1/Support-building-with-older-compilers.patch b/meta-linaro-integration/recipes-overlayed/libunwind/libunwind-1.1/Support-building-with-older-compilers.patch new file mode 100644 index 0000000..268b702 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/libunwind/libunwind-1.1/Support-building-with-older-compilers.patch @@ -0,0 +1,72 @@ +From 10b064ffe902d5af31bb49bd8e4f03c545f8d462 Mon Sep 17 00:00:00 2001 +From: Ladislav Michl +Date: Tue, 13 Nov 2012 11:19:47 +0100 +Subject: [PATCH] Support building with older compilers. + +Add a check for __builtin_unreachable. + +Upstream-Status: Pending +--- + configure.ac | 11 +++++++++++ + include/libunwind_i.h | 6 ++++++ + src/arm/Gresume.c | 2 +- + src/sh/Gresume.c | 2 +- + 4 files changed, 19 insertions(+), 2 deletions(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -285,6 +285,17 @@ if test x$have__builtin___clear_cache = + fi + AC_MSG_RESULT([$have__builtin___clear_cache]) + ++AC_MSG_CHECKING([for __builtin_unreachable]) ++AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM([[]], [[__builtin_unreachable()]])], ++ [have__builtin_unreachable=yes], ++ [have__builtin_unreachable=no]) ++if test x$have__builtin_unreachable = xyes; then ++ AC_DEFINE([HAVE__BUILTIN_UNREACHABLE], [1], ++ [Defined if __builtin_unreachable() is available]) ++fi ++AC_MSG_RESULT([$have__builtin_unreachable]) ++ + AC_MSG_CHECKING([for __sync atomics]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[]], [[ +--- a/include/libunwind_i.h ++++ b/include/libunwind_i.h +@@ -72,6 +72,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE + # endif + #endif + ++#if defined(HAVE__BUILTIN_UNREACHABLE) ++# define unreachable() __builtin_unreachable() ++#else ++# define unreachable() do { } while (1) ++#endif ++ + #ifdef DEBUG + # define UNW_DEBUG 1 + #else +--- a/src/arm/Gresume.c ++++ b/src/arm/Gresume.c +@@ -96,7 +96,7 @@ arm_local_resume (unw_addr_space_t as, u + : : "r" (c->sigcontext_sp), "r" (c->sigcontext_pc) + ); + } +- __builtin_unreachable(); ++ unreachable(); + #else + printf ("%s: implement me\n", __FUNCTION__); + #endif +--- a/src/sh/Gresume.c ++++ b/src/sh/Gresume.c +@@ -109,7 +109,7 @@ sh_local_resume (unw_addr_space_t as, un + "r" (c->sigcontext_pc) + ); + } +- __builtin_unreachable(); ++ unreachable(); + #endif + return -UNW_EINVAL; + } diff --git a/meta-linaro-integration/recipes-overlayed/libunwind/libunwind.inc b/meta-linaro-integration/recipes-overlayed/libunwind/libunwind.inc new file mode 100644 index 0000000..6743b21 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/libunwind/libunwind.inc @@ -0,0 +1,31 @@ +DESCRIPTION = "a portable and efficient C programming interface (API) to determine the call-chain of a program" +HOMEPAGE = "http://www.nongnu.org/libunwind" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3fced11d6df719b47505837a51c16ae5" + +SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz" + +inherit autotools + +PACKAGECONFIG ??= "" +PACKAGECONFIG[lzma] = "--enable-minidebuginfo,--disable-minidebuginfo,lzma" + +EXTRA_OECONF_arm = "--enable-debug-frame" +EXTRA_OECONF_aarch64 = "--enable-debug-frame" + +CFLAGS += "${ATOMICOPS}" +ATOMICOPS_armv5 = "-DAO_USE_PTHREAD_DEFS=1" +ATOMICOPS_armv4 = "-DAO_USE_PTHREAD_DEFS=1" +ATOMICOPS ?= "" + +LDFLAGS += "${LIBATOMICS}" +LIBATOMICS_armv5 = "-latomic_ops" +LIBATOMICS_armv4 = "-latomic_ops" +LIBATOMICS ?= "" + +DEPENDS += "${DEPLIBATOMICS}" +DEPLIBATOMICS_armv5 = "libatomics-ops" +DEPLIBATOMICS_armv4 = "libatomics-ops" +DEPLIBATOMICS ?= "" + +BBCLASSEXTEND = "native" diff --git a/meta-linaro-integration/recipes-overlayed/libunwind/libunwind_1.1.bb b/meta-linaro-integration/recipes-overlayed/libunwind/libunwind_1.1.bb new file mode 100644 index 0000000..2e52430 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/libunwind/libunwind_1.1.bb @@ -0,0 +1,9 @@ +require libunwind.inc + +SRC_URI += "\ + file://Support-building-with-older-compilers.patch \ + file://AArch64-port.patch \ +" + +SRC_URI[md5sum] = "fb4ea2f6fbbe45bf032cd36e586883ce" +SRC_URI[sha256sum] = "9dfe0fcae2a866de9d3942c66995e4b460230446887dbdab302d41a8aee8d09a" diff --git a/meta-linaro-integration/recipes-overlayed/nss-myhostname/nss-myhostname_0.3.bb b/meta-linaro-integration/recipes-overlayed/nss-myhostname/nss-myhostname_0.3.bb new file mode 100644 index 0000000..b9ddeaf --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/nss-myhostname/nss-myhostname_0.3.bb @@ -0,0 +1,29 @@ +SUMMARY = "Name Service Switch module for resolving the local hostname" +DESCRIPTION = "plugin for the GNU Name Service Switch (NSS) functionality of \ +the GNU C Library (glibc) providing host name resolution for the locally \ +configured system hostname as returned by gethostname(2)." +HOMEPAGE = "http://0pointer.de/lennart/projects/nss-myhostname/" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1" + +SRC_URI = "http://0pointer.de/lennart/projects/nss-myhostname/nss-myhostname-${PV}.tar.gz" + +SRC_URI[md5sum] = "d4ab9ac36c053ab8fb836db1cbd4a48f" +SRC_URI[sha256sum] = "2ba744ea8d578d1c57c85884e94a3042ee17843a5294434d3a7f6c4d67e7caf2" + +inherit autotools + +# /etc/nsswitch.conf needs to be present +RDEPENDS_${PN} = "base-files" + +pkg_postinst_${PN} () { + sed -e '/^hosts:/s/\s*\//' \ + -e 's/\(^hosts:.*\)\(\\)\(.*\)\(\\)\(.*\)/\1\2 myhostname \3\4\5/' \ + -i ${D}${sysconfdir}/nsswitch.conf +} + +pkg_prerm_${PN} () { + sed -e '/^hosts:/s/\s*\//' \ + -e '/^hosts:/s/\s*myhostname//' \ + -i ${D}${sysconfdir}/nsswitch.conf +} diff --git a/meta-linaro-integration/recipes-overlayed/pm-qa/pm-qa_git.bb b/meta-linaro-integration/recipes-overlayed/pm-qa/pm-qa_git.bb new file mode 100644 index 0000000..dc16aef --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/pm-qa/pm-qa_git.bb @@ -0,0 +1,65 @@ +DESCRIPTION = "Utilities for testing Power Management" +HOMEPAGE = "https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQa" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +PV = "0.4.14" + +BRANCH ?= "master" + +# Corresponds to tag pm-qa-v0.4.14 +SRCREV = "9111d1930f02337394cf16e84ad2a27f33607cbb" + +SRC_URI = "git://git.linaro.org/power/pm-qa.git;protocol=git;branch=${BRANCH}" + +S = "${WORKDIR}/git" + +CFLAGS += "-pthread" + +do_compile () { + # Find all the .c files in this project and build them. + for x in `find . -name "*.c"` + do + util=`echo ${x} | sed s/.c$//` + oe_runmake ${util} + done +} + +do_install () { + install -d ${D}${bindir} + install -d ${D}${libdir}/${PN} + + # Install the compiled binaries that were built in the previous step + for x in `find . -name "*.c"` + do + util=`echo ${x} | sed s/.c$//` + util_basename=`basename ${util}` + install -m 0755 ${util} ${D}${bindir}/${util_basename} + done + + # Install the helper scripts in a subdirectory of $libdir + for script in `find . -name "*.sh" | grep include` + do + # Remove hardcoded relative paths + sed -i -e 's#..\/utils\/##' ${script} + + script_basename=`basename ${script}` + install -m 0755 $script ${D}${libdir}/${PN}/${script_basename} + done + + # Install the shell scripts NOT in the $libdir directory since those + # will be installed elsewhere + for script in `find . -name "*.sh" | grep -v include` + do + # if the script includes any helper scripts from the $libdir + # directory then change the source path to the absolute path + # to reflect the install location of the helper scripts. + sed -i -e "s#source ../include#source ${libdir}/${PN}#g" ${script} + # Remove hardcoded relative paths + sed -i -e 's#..\/utils\/##' ${script} + + script_basename=`basename ${script}` + install -m 0755 $script ${D}${bindir}/${script_basename} + done +} diff --git a/meta-linaro-integration/recipes-overlayed/shadow/files/securetty b/meta-linaro-integration/recipes-overlayed/shadow/files/securetty new file mode 100644 index 0000000..c36f6e0 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/shadow/files/securetty @@ -0,0 +1,233 @@ +# /etc/securetty: list of terminals on which root is allowed to login. +# See securetty(5) and login(1). +console + +# Standard serial ports +ttyS0 +ttyS1 +ttyS2 +ttyS3 + +# ARM AMBA SoCs +ttyAMA0 +ttyAMA1 +ttyAMA2 +ttyAMA3 + +# QCOM Socs +ttyHSL0 +ttyHSL1 +ttyHSL2 +ttyHSL3 +ttyMSM0 +ttyMSM1 +ttyMSM2 + +# Samsung ARM SoCs +ttySAC0 +ttySAC1 +ttySAC2 +ttySAC3 + +# STM SoCs +ttyAS0 +ttyAS1 +ttyAS2 +ttyAS3 + +# TI OMAP SoCs +ttyO0 +ttyO1 +ttyO2 +ttyO3 + +# SBSA compatible UART +ttySBSA0 + +# USB dongles +ttyUSB0 +ttyUSB1 +ttyUSB2 + +# USB serial gadget +ttyGS0 + +# PowerMac +ttyPZ0 +ttyPZ1 +ttyPZ2 +ttyPZ3 + +# Embedded MPC platforms +ttyPSC0 +ttyPSC1 +ttyPSC2 +ttyPSC3 +ttyPSC4 +ttyPSC5 + +# PA-RISC mux ports +ttyB0 +ttyB1 + +# Standard hypervisor virtual console +hvc0 + +# Oldstyle Xen console +xvc0 + +# Standard consoles +tty1 +tty2 +tty3 +tty4 +tty5 +tty6 +tty7 +tty8 +tty9 +tty10 +tty11 +tty12 +tty13 +tty14 +tty15 +tty16 +tty17 +tty18 +tty19 +tty20 +tty21 +tty22 +tty23 +tty24 +tty25 +tty26 +tty27 +tty28 +tty29 +tty30 +tty31 +tty32 +tty33 +tty34 +tty35 +tty36 +tty37 +tty38 +tty39 +tty40 +tty41 +tty42 +tty43 +tty44 +tty45 +tty46 +tty47 +tty48 +tty49 +tty50 +tty51 +tty52 +tty53 +tty54 +tty55 +tty56 +tty57 +tty58 +tty59 +tty60 +tty61 +tty62 +tty63 + +# Local X displays (allows empty passwords with pam_unix's nullok_secure) +pts/0 +pts/1 +pts/2 +pts/3 + +# Embedded Freescale i.MX ports +ttymxc0 +ttymxc1 +ttymxc2 +ttymxc3 +ttymxc4 +ttymxc5 + +# Freescale lpuart ports +ttyLP0 +ttyLP1 +ttyLP2 +ttyLP3 +ttyLP4 +ttyLP5 + +# Standard serial ports, with devfs +tts/0 +tts/1 + +# Standard consoles, with devfs +vc/1 +vc/2 +vc/3 +vc/4 +vc/5 +vc/6 +vc/7 +vc/8 +vc/9 +vc/10 +vc/11 +vc/12 +vc/13 +vc/14 +vc/15 +vc/16 +vc/17 +vc/18 +vc/19 +vc/20 +vc/21 +vc/22 +vc/23 +vc/24 +vc/25 +vc/26 +vc/27 +vc/28 +vc/29 +vc/30 +vc/31 +vc/32 +vc/33 +vc/34 +vc/35 +vc/36 +vc/37 +vc/38 +vc/39 +vc/40 +vc/41 +vc/42 +vc/43 +vc/44 +vc/45 +vc/46 +vc/47 +vc/48 +vc/49 +vc/50 +vc/51 +vc/52 +vc/53 +vc/54 +vc/55 +vc/56 +vc/57 +vc/58 +vc/59 +vc/60 +vc/61 +vc/62 +vc/63 diff --git a/meta-linaro-integration/recipes-overlayed/shadow/shadow-securetty_%.bbappend b/meta-linaro-integration/recipes-overlayed/shadow/shadow-securetty_%.bbappend new file mode 100644 index 0000000..2350ab8 --- /dev/null +++ b/meta-linaro-integration/recipes-overlayed/shadow/shadow-securetty_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += "file://securetty" diff --git a/meta-linaro-toolchain/conf/distro/include/external-linaro-toolchain-versions.inc b/meta-linaro-toolchain/conf/distro/include/external-linaro-toolchain-versions.inc new file mode 100644 index 0000000..6165520 --- /dev/null +++ b/meta-linaro-toolchain/conf/distro/include/external-linaro-toolchain-versions.inc @@ -0,0 +1,111 @@ +def elt_run(d, cmd, *args): + import bb.process + import subprocess + + topdir = d.getVar('TOPDIR', True) + toolchain_path = d.getVar('EXTERNAL_TOOLCHAIN', True) + if not toolchain_path: + return 'UNKNOWN', 'UNKNOWN' + + target_prefix = d.getVar('TARGET_PREFIX', True) + path = os.path.join(toolchain_path, 'bin', target_prefix + cmd) + args = [path] + list(args) + + return bb.process.run(args, cwd=topdir, stderr=subprocess.PIPE) + +def elt_get_version(d): + try: + stdout, stderr = elt_run(d, 'gcc', '-v') + except bb.process.CmdError as exc: + bb.error('Failed to obtain external Linaro toolchain version: %s' % exc) + return 'UNKNOWN' + else: + last_line = stderr.splitlines()[-1] + return last_line + +def elt_get_main_version(d): + version = elt_get_version(d) + if version != 'UNKNOWN': + if version.split()[5] != '(crosstool-NG': + return version.split()[7].split(')')[0] + else: + return version.split()[6].split('-')[3] + else: + return version + +def elt_get_gcc_version(d): + version = elt_get_version(d) + if version != 'UNKNOWN': + return version.split()[2] + else: + return version + +def elt_get_libc_version(d): + import os,bb + syspath = bb.data.expand('${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}', d) + if not syspath: + return 'UNKNOWN' + + libpath = syspath + '/libc/lib/' + bb.data.expand('${ELT_TARGET_SYS}/', d) + + if os.path.exists(libpath): + for file in os.listdir(libpath): + if file.find('libc-') == 0: + return file[5:-3] + + libpath = syspath + '/libc/lib/' + + if os.path.exists(libpath): + for file in os.listdir(libpath): + if file.find('libc-') == 0: + return file[5:-3] + return 'UNKNOWN' + +def elt_get_kernel_version(d): + import os,bb + syspath = bb.data.expand('${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}', d) + if not syspath: + return 'UNKNOWN' + + vf = syspath + '/libc/usr/include/linux/version.h' + + try: + f = open(vf, 'r') + except (OSError, IOError): + return 'UNKNOWN' + + l = f.readlines(); + f.close(); + for s in l: + if s.find('LINUX_VERSION_CODE') > 0: + ver = int(s.split()[2]) + maj = ver / 65536 + ver = ver % 65536 + min = ver / 256 + ver = ver % 256 + return str(maj)+'.'+str(min)+'.'+str(ver) + return 'UNKNOWN' + +def elt_get_gdb_version(d): + try: + stdout, stderr = elt_run(d, 'gdb', '-v') + except bb.process.CmdError: + return 'UNKNOWN' + else: + first_line = stdout.splitlines()[0] + return first_line.split()[-1] + +python external_linaro_toolchain_version_handler () { + if not isinstance(e, bb.event.ConfigParsed): + return + d = e.data + ld = d.createCopy() + ld.finalize() + + d.setVar('ELT_VER_MAIN', elt_get_main_version(ld)) + d.setVar('ELT_VER_GCC', elt_get_gcc_version(ld)) + d.setVar('ELT_VER_LIBC', elt_get_libc_version(ld)) + d.setVar('ELT_VER_KERNEL', elt_get_kernel_version(ld)) + d.setVar('ELT_VER_GDB', elt_get_gdb_version(ld)) +} +addhandler external_linaro_toolchain_version_handler diff --git a/meta-linaro-toolchain/conf/distro/include/tcmode-external-linaro.inc b/meta-linaro-toolchain/conf/distro/include/tcmode-external-linaro.inc new file mode 100644 index 0000000..19be8af --- /dev/null +++ b/meta-linaro-toolchain/conf/distro/include/tcmode-external-linaro.inc @@ -0,0 +1,101 @@ +# +# Configuration to use an external Linaro binary toolchain +# + +EXTERNAL_TOOLCHAIN ?= "/usr/local/linaro-binary-toolchain/${TARGET_ARCH}" + +TOOLCHAIN_PATH_ADD = "${EXTERNAL_TOOLCHAIN}/bin:" +PATH =. "${TOOLCHAIN_PATH_ADD}" + +ELT_TARGET_SYS_arm ?= "arm-linux-gnueabihf" +ELT_TARGET_SYS_aarch64 ?= "aarch64-linux-gnu" +ELT_TARGET_SYS = "${TARGET_SYS}" +TARGET_PREFIX = "${ELT_TARGET_SYS}-" + +GCCMULTILIB_forcevariable = "--disable-multilib" +IMAGE_LINGUAS_forcevariable = "" + +PREFERRED_PROVIDER_linux-libc-headers = "external-linaro-toolchain" +PREFERRED_PROVIDER_linux-libc-headers-dev = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++ = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs = "external-linaro-toolchain" +PREFERRED_PROVIDER_glibc = "external-linaro-toolchain" +PREFERRED_PROVIDER_libgcc = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/libc = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/libintl = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/libiconv = "external-linaro-toolchain" +PREFERRED_PROVIDER_glibc-thread-db = "external-linaro-toolchain" +PREFERRED_PROVIDER_virtual/linux-libc-headers = "external-linaro-toolchain" + +TARGET_CPPFLAGS_prepend = " -isystem${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/include " +TARGET_LDFLAGS_prepend = " -L${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/lib -Wl,-rpath-link,${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/lib " + +TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}" + +DISTRO_FEATURES_LIBC = "ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-crypt \ + libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse \ + libc-getlogin libc-idn libc-inet-anl libc-libm libc-libm-big \ + libc-memusage libc-nis libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams libc-sunrpc \ + libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc \ + libc-posix-wchar-io" + +ENABLE_BINARY_LOCALE_GENERATION = "0" +GLIBC_INTERNAL_USE_BINARY_LOCALE = "precompiled" + +ERROR_QA[type] ?= "list" +python toolchain_metadata_setup () { + import subprocess + if not isinstance(e, bb.event.ConfigParsed): + return + + d = e.data + l = d.createCopy() + l.finalize() + oe_import(l) + + external_toolchain = l.getVar('EXTERNAL_TOOLCHAIN', True) + if not external_toolchain or external_toolchain == 'UNDEFINED': + bb.fatal("Error: EXTERNAL_TOOLCHAIN must be set to the path to your linaro toolchain") + + if not os.path.exists(external_toolchain): + bb.fatal("Error: EXTERNAL_TOOLCHAIN path '%s' does not exist" % external_toolchain) + + # The external toolchain may not have been built with the oe-core preferred + # gnu hash setting, so ensure that the corresponding sanity check is not an error. + error_qa = oe.data.typed_value('ERROR_QA', l) + if 'ldflags' in error_qa: + error_qa.remove('ldflags') + d.setVar('ERROR_QA', ' '.join(error_qa)) +} +addhandler toolchain_metadata_setup + +def populate_toolchain_links(d): + import errno + import os + from glob import glob + + d = d.createCopy() + d.finalize() + + pattern = bb.data.expand('${EXTERNAL_TOOLCHAIN}/bin/${TARGET_PREFIX}*', d) + files = glob(pattern) + if not files: + bb.fatal("Unable to populate toolchain binary symlinks") + + bindir = d.getVar('STAGING_BINDIR_TOOLCHAIN', True) + bb.mkdirhier(bindir) + for f in files: + base = os.path.basename(f) + newpath = os.path.join(bindir, base) + try: + os.symlink(f, newpath) + except OSError as exc: + if exc.errno == errno.EEXIST: + break + bb.fatal("Unable to populate toolchain binary symlink for %s: %s" % (newpath, exc)) + +require conf/distro/include/external-linaro-toolchain-versions.inc diff --git a/meta-linaro-toolchain/conf/layer.conf b/meta-linaro-toolchain/conf/layer.conf new file mode 100644 index 0000000..7e96dcd --- /dev/null +++ b/meta-linaro-toolchain/conf/layer.conf @@ -0,0 +1,13 @@ +BBPATH .= ":${LAYERDIR}" +BBFILES += "\ + ${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend \ + " + +BBFILE_COLLECTIONS += "linaro-toolchain" +BBFILE_PATTERN_linaro-toolchain := "^${LAYERDIR}/" +BBFILE_PRIORITY_linaro-toolchain = "30" + +# do not error out on bbappends for missing recipes +BB_DANGLINGAPPENDS_WARNONLY = "true" + diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-initial_linaro-2.20.bb b/meta-linaro-toolchain/recipes-core/glibc/glibc-initial_linaro-2.20.bb new file mode 100644 index 0000000..a31ba68 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-initial_linaro-2.20.bb @@ -0,0 +1,11 @@ +require glibc_${PV}.bb +require recipes-core/glibc/glibc-initial.inc + +DEPENDS += "kconfig-frontends-native" + +# main glibc recipes muck with TARGET_CPPFLAGS to point into +# final target sysroot but we +# are not there when building glibc-initial +# so reset it here + +TARGET_CPPFLAGS = "" diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/0001-R_ARM_TLS_DTPOFF32.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/0001-R_ARM_TLS_DTPOFF32.patch new file mode 100644 index 0000000..3922cb8 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/0001-R_ARM_TLS_DTPOFF32.patch @@ -0,0 +1,56 @@ + +Quote from bug 1443 which explains what the patch does : + + We build some random program and link it with -lust. When we run it, + it dies with a SIGSEGV before reaching main(). + + Libust.so depends on liburcu-bp.so from the usermode-rcu package. + Although libust.so is not prelinked, liburcu-bp.so IS prelinked; this + is critical. + + Libust.so uses a TLS / __thread variable that is defined in liburcu- + bp.so. There are special ARM-specific relocation types that allow two + shared libraries to share thread-specific data. This is critical too. + + One more critical issue: although liburcu-bp.so is prelinked, we can't + load it at its prelinked address, because we also link against + librt.so, and librt.so uses that address. + + The dynamic linker is forced to relink liburcu-bp.so at a different + address. In the course of relinking, it processes the special ARM + relocation record mentioned above. The prelinker has already filled + in the information, which is a short offset into a table of thread- + specific data that is allocated per-thread for each library that uses + TLS. Because the normal behavior of a relocation is to add the symbol + value to an addend stored at the address being relocated, we end up + adding the short offset to itself, doubling it. + + Now we have an awkward situation. The libust.so library doesn't know + about the addend, so its TLS data for this element is correct. The + liburcu-bp.so library has a different offset for the element. When we + go to initialize the element for the first time in liburcu-bp.so, we + write the address of the result at the doubled (broken) offset. + Later, when we refer to the address from libust.so, we check the value + at the correct offset, but it's NULL, so we eat hot SIGSEGV. + +Upstream-Status: Pending + +Signed-off-by: Andrei Dinu +--- + .../libc/ports/sysdeps/arm/dl-machine.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +ndex 8d905e8..dcfa71e 100644 +Index: git/sysdeps/arm/dl-machine.h +=================================================================== +--- git.orig/sysdeps/arm/dl-machine.h 2014-08-27 05:30:47.748070587 +0000 ++++ git/sysdeps/arm/dl-machine.h 2014-08-27 05:30:47.740070587 +0000 +@@ -495,7 +495,7 @@ + + case R_ARM_TLS_DTPOFF32: + if (sym != NULL) +- *reloc_addr += sym->st_value; ++ *reloc_addr = sym->st_value; + break; + + case R_ARM_TLS_TPOFF32: diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch new file mode 100644 index 0000000..f341282 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch @@ -0,0 +1,33 @@ +From 713d822908d1b2ae8403af7f9375c7054ed3dd49 Mon Sep 17 00:00:00 2001 +From: Ting Liu +Date: Wed, 19 Dec 2012 04:39:57 -0600 +Subject: [PATCH] eglibc: run libm-err-tab.pl with specific dirs in ${S} + +libm-err-tab.pl will parse all the files named "libm-test-ulps" +in the given dir recursively. To avoid parsing the one in +${S}/.pc/ (it does exist after eglibc adds aarch64 support, +${S}/.pc/aarch64-0001-glibc-fsf-v1-eaf6f205.patch/ports/sysdeps/ +aarch64/libm-test-ulps), run libm-err-tab.pl with specific dirs +in ${S}. + +Upstream-Status: inappropriate [OE specific] + +Signed-off-by: Ting Liu +--- + manual/Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: git/manual/Makefile +=================================================================== +--- git.orig/manual/Makefile 2014-08-29 10:35:18.728070587 -0700 ++++ git/manual/Makefile 2014-08-29 10:35:18.720070587 -0700 +@@ -105,7 +105,8 @@ + $(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\ + $(dir)/libm-test-ulps)) + pwd=`pwd`; \ +- $(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp ++ $(PERL) $< $$pwd/../ports > $(objpfx)libm-err-tmp ++ $(PERL) $< $$pwd/../sysdeps >> $(objpfx)libm-err-tmp + $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi + touch $@ + diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/GLRO_dl_debug_mask.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/GLRO_dl_debug_mask.patch new file mode 100644 index 0000000..e858bfa --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/GLRO_dl_debug_mask.patch @@ -0,0 +1,529 @@ +Its controlled by __OPTION_EGLIBC_RTLD_DEBUG +so we should use GLRO_dl_debug_mask + +Singed-off-by: Khem Raj + +Upstream-Status: Pending +Index: git/elf/dl-open.c +=================================================================== +--- git.orig/elf/dl-open.c 2014-08-27 05:03:59.732070587 +0000 ++++ git/elf/dl-open.c 2014-08-27 05:05:25.656070587 +0000 +@@ -147,7 +147,7 @@ + ns->_ns_main_searchlist->r_list[new_nlist++] = map; + + /* We modify the global scope. Report this. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_SCOPES)) + _dl_debug_printf ("\nadd %s [%lu] to global scope\n", + map->l_name, map->l_ns); + } +@@ -243,7 +243,7 @@ + if (__glibc_unlikely (new->l_searchlist.r_list != NULL)) + { + /* Let the user know about the opencount. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES)) + _dl_debug_printf ("opening file=%s [%lu]; direct_opencount=%u\n\n", + new->l_name, new->l_ns, new->l_direct_opencount); + +@@ -294,7 +294,7 @@ + LIBC_PROBE (map_complete, 3, args->nsid, r, new); + + /* Print scope information. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_SCOPES)) + _dl_show_scope (new, 0); + + /* Only do lazy relocation if `LD_BIND_NOW' is not set. */ +@@ -511,7 +511,7 @@ + } + + /* Print scope information. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_SCOPES)) + _dl_show_scope (imap, from_scope); + } + +@@ -584,7 +584,7 @@ + #endif + + /* Let the user know about the opencount. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES)) + _dl_debug_printf ("opening file=%s [%lu]; direct_opencount=%u\n\n", + new->l_name, new->l_ns, new->l_direct_opencount); + } +Index: git/elf/rtld.c +=================================================================== +--- git.orig/elf/rtld.c 2014-08-27 05:03:59.732070587 +0000 ++++ git/elf/rtld.c 2014-08-27 05:12:33.812070587 +0000 +@@ -321,7 +321,7 @@ + } + #endif + +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_STATISTICS)) + { + #ifndef HP_TIMING_NONAVAIL + print_statistics (&rtld_total_time); +@@ -1699,7 +1699,7 @@ + after relocation. */ + struct link_map *l; + +- if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK) ++ if (GLRO_dl_debug_mask & DL_DEBUG_PRELINK) + { + struct r_scope_elem *scope = &main_map->l_searchlist; + +@@ -1729,7 +1729,7 @@ + _dl_printf ("\n"); + } + } +- else if (GLRO(dl_debug_mask) & DL_DEBUG_UNUSED) ++ else if (GLRO_dl_debug_mask & DL_DEBUG_UNUSED) + { + /* Look through the dependencies of the main executable + and determine which of them is not actually +@@ -1837,7 +1837,7 @@ + } + } + +- if ((GLRO(dl_debug_mask) & DL_DEBUG_PRELINK) ++ if ((GLRO_dl_debug_mask & DL_DEBUG_PRELINK) + && rtld_multiple_ref) + { + /* Mark the link map as not yet relocated again. */ +@@ -1970,7 +1970,7 @@ + if (r_list == r_listend && liblist == liblistend) + prelinked = true; + +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS)) + _dl_debug_printf ("\nprelink checking: %s\n", + prelinked ? "ok" : "failed"); + } +@@ -1988,7 +1988,7 @@ + GLRO(dl_init_all_dirs) = GL(dl_all_dirs); + + /* Print scope information. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_SCOPES)) + { + _dl_debug_printf ("\nInitial object scopes\n"); + +@@ -2262,7 +2262,7 @@ + if (debopts[cnt].len == len + && memcmp (dl_debug, debopts[cnt].name, len) == 0) + { +- GLRO(dl_debug_mask) |= debopts[cnt].mask; ++ GLRO_dl_debug_mask |= debopts[cnt].mask; + any_debug = 1; + break; + } +@@ -2283,7 +2283,7 @@ + ++dl_debug; + } + +- if (GLRO(dl_debug_mask) & DL_DEBUG_UNUSED) ++ if (GLRO_dl_debug_mask & DL_DEBUG_UNUSED) + { + /* In order to get an accurate picture of whether a particular + DT_NEEDED entry is actually used we have to process both +@@ -2291,7 +2291,7 @@ + GLRO(dl_lazy) = 0; + } + +- if (GLRO(dl_debug_mask) & DL_DEBUG_HELP) ++ if (GLRO_dl_debug_mask & DL_DEBUG_HELP) + { + size_t cnt; + +@@ -2490,7 +2490,7 @@ + { + mode = trace; + GLRO(dl_verbose) = 1; +- GLRO(dl_debug_mask) |= DL_DEBUG_PRELINK; ++ GLRO_dl_debug_mask |= DL_DEBUG_PRELINK; + GLRO(dl_trace_prelink) = &envline[17]; + } + break; +@@ -2537,7 +2537,7 @@ + if (__access ("/etc/suid-debug", F_OK) != 0) + { + unsetenv ("MALLOC_CHECK_"); +- GLRO(dl_debug_mask) = 0; ++ GLRO_dl_debug_mask = 0; + } + + if (mode != normal) +Index: git/elf/dl-lookup.c +=================================================================== +--- git.orig/elf/dl-lookup.c 2014-08-27 05:03:59.732070587 +0000 ++++ git/elf/dl-lookup.c 2014-08-27 05:13:07.644070587 +0000 +@@ -300,7 +300,7 @@ + hash table. */ + if (__glibc_unlikely (tab->size)) + { +- assert (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK); ++ assert (GLRO_dl_debug_mask & DL_DEBUG_PRELINK); + goto success; + } + #endif +@@ -375,7 +375,7 @@ + continue; + + /* Print some debugging info if wanted. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SYMBOLS)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_SYMBOLS)) + _dl_debug_printf ("symbol=%s; lookup in file=%s [%lu]\n", + undef_name, DSO_FILENAME (map->l_name), + map->l_ns); +@@ -698,7 +698,7 @@ + } + + /* Display information if we are debugging. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES)) + _dl_debug_printf ("\ + \nfile=%s [%lu]; needed by %s [%lu] (relocation dependency)\n\n", + DSO_FILENAME (map->l_name), +@@ -802,7 +802,7 @@ + { + if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK) + && skip_map == NULL +- && !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED)) ++ && !(GLRO_dl_debug_mask & DL_DEBUG_UNUSED)) + { + /* We could find no value for a strong reference. */ + const char *reference_name = undef_map ? undef_map->l_name : ""; +@@ -873,7 +873,7 @@ + if (__glibc_unlikely (current_value.m->l_used == 0)) + current_value.m->l_used = 1; + +- if (__glibc_unlikely (GLRO(dl_debug_mask) ++ if (__glibc_unlikely (GLRO_dl_debug_mask + & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK))) + _dl_debug_bindings (undef_name, undef_map, ref, + ¤t_value, version, type_class, protected); +@@ -938,7 +938,7 @@ + { + const char *reference_name = undef_map->l_name; + +- if (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS) ++ if (GLRO_dl_debug_mask & DL_DEBUG_BINDINGS) + { + _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'", + DSO_FILENAME (reference_name), +@@ -952,7 +952,7 @@ + _dl_debug_printf_c ("\n"); + } + #ifdef SHARED +- if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK) ++ if (GLRO_dl_debug_mask & DL_DEBUG_PRELINK) + { + int conflict = 0; + struct sym_val val = { NULL, NULL }; +Index: git/elf/get-dynamic-info.h +=================================================================== +--- git.orig/elf/get-dynamic-info.h 2014-08-27 05:03:59.732070587 +0000 ++++ git/elf/get-dynamic-info.h 2014-08-27 05:03:59.728070587 +0000 +@@ -157,7 +157,7 @@ + them. Therefore to avoid breaking existing applications the + best we can do is add a warning during debugging with the + intent of notifying the user of the problem. */ +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0) ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0) + && l->l_flags_1 & ~DT_1_SUPPORTED_MASK) + _dl_debug_printf ("\nWARNING: Unsupported flag value(s) of 0x%x in DT_FLAGS_1.\n", + l->l_flags_1 & ~DT_1_SUPPORTED_MASK); +Index: git/csu/libc-start.c +=================================================================== +--- git.orig/csu/libc-start.c 2014-08-27 04:59:01.412070587 +0000 ++++ git/csu/libc-start.c 2014-08-27 05:09:28.936070587 +0000 +@@ -238,7 +238,7 @@ + + /* Call the initializer of the program, if any. */ + #ifdef SHARED +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0)) ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_IMPCALLS, 0)) + GLRO(dl_debug_printf) ("\ninitialize program: %s\n\n", argv[0]); + #endif + if (init) +@@ -261,7 +261,7 @@ + #endif + + #ifdef SHARED +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_IMPCALLS)) + GLRO(dl_debug_printf) ("\ntransferring control: %s\n\n", argv[0]); + #endif + +Index: git/elf/dl-cache.c +=================================================================== +--- git.orig/elf/dl-cache.c 2014-08-27 04:59:01.568070587 +0000 ++++ git/elf/dl-cache.c 2014-08-27 05:10:14.384070587 +0000 +@@ -187,7 +187,7 @@ + const char *best; + + /* Print a message if the loading of libs is traced. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS)) + _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE); + + if (cache == NULL) +@@ -285,7 +285,7 @@ + } + + /* Print our result if wanted. */ +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0) ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0) + && best != NULL) + _dl_debug_printf (" trying file=%s\n", best); + +Index: git/elf/dl-close.c +=================================================================== +--- git.orig/elf/dl-close.c 2014-08-27 04:59:01.568070587 +0000 ++++ git/elf/dl-close.c 2014-08-27 05:10:26.456070587 +0000 +@@ -125,7 +125,7 @@ + dl_close_state = rerun; + + /* There are still references to this object. Do nothing more. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES)) + _dl_debug_printf ("\nclosing file=%s; direct_opencount=%u\n", + map->l_name, map->l_direct_opencount); + +@@ -257,7 +257,7 @@ + if (imap->l_init_called) + { + /* When debugging print a message first. */ +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_IMPCALLS, + 0)) + _dl_debug_printf ("\ncalling fini: %s [%lu]\n\n", + imap->l_name, nsid); +@@ -664,7 +664,7 @@ + free (imap->l_reldeps); + + /* Print debugging message. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES)) + _dl_debug_printf ("\nfile=%s [%lu]; destroying link map\n", + imap->l_name, imap->l_ns); + +Index: git/elf/dl-conflict.c +=================================================================== +--- git.orig/elf/dl-conflict.c 2014-08-27 04:59:01.568070587 +0000 ++++ git/elf/dl-conflict.c 2014-08-27 05:10:37.652070587 +0000 +@@ -32,7 +32,7 @@ + ElfW(Rela) *conflictend) + { + #if ! ELF_MACHINE_NO_RELA +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_RELOC)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_RELOC)) + _dl_debug_printf ("\nconflict processing: %s\n", DSO_FILENAME (l->l_name)); + + { +Index: git/elf/dl-deps.c +=================================================================== +--- git.orig/elf/dl-deps.c 2014-08-27 04:59:01.568070587 +0000 ++++ git/elf/dl-deps.c 2014-08-27 05:10:48.260070587 +0000 +@@ -127,7 +127,7 @@ + else \ + { \ + /* This is for DT_AUXILIARY. */ \ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS)) \ ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS)) \ + _dl_debug_printf (N_("\ + cannot load auxiliary `%s' because of empty dynamic string token " \ + "substitution\n"), __str); \ +@@ -303,7 +303,7 @@ + args.name = name; + + /* Say that we are about to load an auxiliary library. */ +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, + 0)) + _dl_debug_printf ("load auxiliary object=%s" + " requested by file=%s\n", +@@ -520,7 +520,7 @@ + runp->map->l_reserved = 0; + } + +- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK, 0) != 0 ++ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_PRELINK, 0) != 0 + && map == GL(dl_ns)[LM_ID_BASE]._ns_loaded) + { + /* If we are to compute conflicts, we have to build local scope +Index: git/elf/dl-error.c +=================================================================== +--- git.orig/elf/dl-error.c 2014-08-27 04:59:01.568070587 +0000 ++++ git/elf/dl-error.c 2014-08-27 05:11:06.752070587 +0000 +@@ -139,7 +139,7 @@ + _dl_signal_cerror (int errcode, const char *objname, const char *occation, + const char *errstring) + { +- if (__builtin_expect (GLRO(dl_debug_mask) ++ if (__builtin_expect (GLRO_dl_debug_mask + & ~(DL_DEBUG_STATISTICS|DL_DEBUG_PRELINK), 0)) + _dl_debug_printf ("%s: error: %s: %s (%s)\n", objname, occation, + errstring, receiver ? "continued" : "fatal"); +Index: git/elf/dl-fini.c +=================================================================== +--- git.orig/elf/dl-fini.c 2014-08-27 04:59:01.568070587 +0000 ++++ git/elf/dl-fini.c 2014-08-27 05:11:17.544070587 +0000 +@@ -234,7 +234,7 @@ + || l->l_info[DT_FINI] != NULL) + { + /* When debugging print a message first. */ +- if (__builtin_expect (GLRO(dl_debug_mask) ++ if (__builtin_expect (GLRO_dl_debug_mask + & DL_DEBUG_IMPCALLS, 0)) + _dl_debug_printf ("\ncalling fini: %s [%lu]\n\n", + DSO_FILENAME (l->l_name), +@@ -286,7 +286,7 @@ + goto again; + } + +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_STATISTICS)) + _dl_debug_printf ("\nruntime linker statistics:\n" + " final number of relocations: %lu\n" + "final number of relocations from cache: %lu\n", +Index: git/elf/dl-init.c +=================================================================== +--- git.orig/elf/dl-init.c 2014-08-27 04:59:01.568070587 +0000 ++++ git/elf/dl-init.c 2014-08-27 05:11:28.372070587 +0000 +@@ -52,7 +52,7 @@ + return; + + /* Print a debug message if wanted. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_IMPCALLS)) + _dl_debug_printf ("\ncalling init: %s\n\n", + DSO_FILENAME (l->l_name)); + +@@ -102,7 +102,7 @@ + ElfW(Addr) *addrs; + unsigned int cnt; + +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_IMPCALLS)) + _dl_debug_printf ("\ncalling preinit: %s\n\n", + DSO_FILENAME (main_map->l_name)); + +Index: git/elf/dl-load.c +=================================================================== +--- git.orig/elf/dl-load.c 2014-08-27 04:59:01.572070587 +0000 ++++ git/elf/dl-load.c 2014-08-27 05:11:41.156070587 +0000 +@@ -957,7 +957,7 @@ + } + + /* Print debugging message. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES)) + _dl_debug_printf ("file=%s [%lu]; generating link map\n", name, nsid); + + /* This is the ELF header. We read it in `open_verify'. */ +@@ -1361,7 +1361,7 @@ + + l->l_entry += l->l_addr; + +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES)) + _dl_debug_printf ("\ + dynamic: 0x%0*lx base: 0x%0*lx size: 0x%0*Zx\n\ + entry: 0x%0*lx phdr: 0x%0*lx phnum: %*u\n\n", +@@ -1787,7 +1787,7 @@ + + /* If we are debugging the search for libraries print the path + now if it hasn't happened now. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS) + && current_what != this_dir->what) + { + current_what = this_dir->what; +@@ -1808,7 +1808,7 @@ + - buf); + + /* Print name we try if this is wanted. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS)) + _dl_debug_printf (" trying file=%s\n", buf); + + fd = open_verify (buf, fbp, loader, whatcode, mode, +@@ -1953,7 +1953,7 @@ + } + + /* Display information if we are debugging. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES) + && loader != NULL) + _dl_debug_printf ((mode & __RTLD_CALLMAP) == 0 + ? "\nfile=%s [%lu]; needed by %s [%lu]\n" +@@ -1995,7 +1995,7 @@ + + size_t namelen = strlen (name) + 1; + +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS)) + _dl_debug_printf ("find library=%s [%lu]; searching\n", name, nsid); + + fd = -1; +@@ -2122,7 +2122,7 @@ + &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); + + /* Add another newline when we are tracing the library loading. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS)) + _dl_debug_printf ("\n"); + } + else +@@ -2155,7 +2155,7 @@ + if (__glibc_unlikely (fd == -1)) + { + if (trace_mode +- && __glibc_likely ((GLRO(dl_debug_mask) & DL_DEBUG_PRELINK) == 0)) ++ && __glibc_likely ((GLRO_dl_debug_mask & DL_DEBUG_PRELINK) == 0)) + { + /* We haven't found an appropriate library. But since we + are only interested in the list of libraries this isn't +Index: git/elf/dl-object.c +=================================================================== +--- git.orig/elf/dl-object.c 2014-08-27 04:59:01.572070587 +0000 ++++ git/elf/dl-object.c 2014-08-27 05:11:51.756070587 +0000 +@@ -98,7 +98,7 @@ + new->l_type = type; + /* If we set the bit now since we know it is never used we avoid + dirtying the cache line later. */ +- if ((GLRO(dl_debug_mask) & DL_DEBUG_UNUSED) == 0) ++ if ((GLRO_dl_debug_mask & DL_DEBUG_UNUSED) == 0) + new->l_used = 1; + new->l_loader = loader; + #if NO_TLS_OFFSET != 0 +Index: git/elf/dl-reloc.c +=================================================================== +--- git.orig/elf/dl-reloc.c 2014-08-27 04:59:01.572070587 +0000 ++++ git/elf/dl-reloc.c 2014-08-27 05:12:07.056070587 +0000 +@@ -183,7 +183,7 @@ + && __builtin_expect (l->l_info[DT_BIND_NOW] != NULL, 0)) + lazy = 0; + +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_RELOC)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_RELOC)) + _dl_debug_printf ("\nrelocation processing: %s%s\n", + DSO_FILENAME (l->l_name), lazy ? " (lazy)" : ""); + +Index: git/elf/dl-version.c +=================================================================== +--- git.orig/elf/dl-version.c 2014-08-27 04:59:01.608070587 +0000 ++++ git/elf/dl-version.c 2014-08-27 05:12:19.568070587 +0000 +@@ -82,7 +82,7 @@ + int result = 0; + + /* Display information about what we are doing while debugging. */ +- if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_VERSIONS)) ++ if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_VERSIONS)) + _dl_debug_printf ("\ + checking for version `%s' in file %s [%lu] required by file %s [%lu]\n", + string, DSO_FILENAME (map->l_name), diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/IO-acquire-lock-fix.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/IO-acquire-lock-fix.patch new file mode 100644 index 0000000..ffbaba1 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/IO-acquire-lock-fix.patch @@ -0,0 +1,17 @@ +import http://sourceware.org/ml/libc-ports/2007-12/msg00000.html + +Upstream-Status: Pending + +Index: git/bits/stdio-lock.h +=================================================================== +--- git.orig/bits/stdio-lock.h 2014-08-29 10:33:57.960070587 -0700 ++++ git/bits/stdio-lock.h 2014-08-29 10:33:57.952070587 -0700 +@@ -49,6 +49,8 @@ + _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp)); \ + _IO_flockfile (_fp) + ++# define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp) ++ + # define _IO_release_lock(_fp) \ + _IO_funlockfile (_fp); \ + _IO_cleanup_region_end (0) diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/add_resource_h_to_wait_h.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/add_resource_h_to_wait_h.patch new file mode 100644 index 0000000..4559de7 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/add_resource_h_to_wait_h.patch @@ -0,0 +1,20 @@ +The older versions of perf still require sys/resource.h to be +present in this header, the newer version of perf in 3.2 and +beyond directly include sys/resource.h + +Upstream-Status: Inapproriate [older kernel/perf specific] + +Signed-off-by: Saul Wold + +Index: git/posix/sys/wait.h +=================================================================== +--- git.orig/posix/sys/wait.h 2014-08-29 10:35:10.432070587 -0700 ++++ git/posix/sys/wait.h 2014-08-29 10:35:10.424070587 -0700 +@@ -27,6 +27,7 @@ + __BEGIN_DECLS + + #include ++#include + + /* These macros could also be defined in . */ + #if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8) diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-header-bootstrap.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-header-bootstrap.patch new file mode 100644 index 0000000..e1aa139 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-header-bootstrap.patch @@ -0,0 +1,85 @@ +Taken from EGLIBC, r1484 + r1525 + + 2007-02-20 Jim Blandy + + * Makefile (install-headers): Preserve old behavior: depend on + $(inst_includedir)/gnu/stubs.h only if install-bootstrap-headers + is set; otherwise, place gnu/stubs.h on the 'install-others' list. + + 2007-02-16 Jim Blandy + + * Makefile: Amend make install-headers to install everything + necessary for building a cross-compiler. Install gnu/stubs.h as + part of 'install-headers', not 'install-others'. + If install-bootstrap-headers is 'yes', install a dummy copy of + gnu/stubs.h, instead of computing the real thing. + * include/stubs-bootstrap.h: New file. + +Upstream-Status: Pending + +Index: git/Makefile +=================================================================== +--- git.orig/Makefile 2014-08-27 18:35:18.908070587 +0000 ++++ git/Makefile 2014-08-27 18:35:19.340070587 +0000 +@@ -69,9 +69,18 @@ + vpath %.h $(subdir-dirs) + + # What to install. +-install-others = $(inst_includedir)/gnu/stubs.h + install-bin-script = + ++# If we're bootstrapping, install a dummy gnu/stubs.h along with the ++# other headers, so 'make install-headers' produces a useable include ++# tree. Otherwise, install gnu/stubs.h later, after the rest of the ++# build is done. ++ifeq ($(install-bootstrap-headers),yes) ++install-headers: $(inst_includedir)/gnu/stubs.h ++else ++install-others = $(inst_includedir)/gnu/stubs.h ++endif ++ + ifeq (yes,$(build-shared)) + headers += gnu/lib-names.h + endif +@@ -151,6 +160,16 @@ + + subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs) + ++# gnu/stubs.h depends (via the subdir 'stubs' targets) on all the .o ++# files in EGLIBC. For bootstrapping a GCC/EGLIBC pair, an empty ++# gnu/stubs.h is good enough. ++ifeq ($(install-bootstrap-headers),yes) ++$(inst_includedir)/gnu/stubs.h: include/stubs-bootstrap.h $(+force) ++ $(make-target-directory) ++ $(INSTALL_DATA) $< $@ ++ ++installed-stubs = ++else + ifndef abi-variants + installed-stubs = $(inst_includedir)/gnu/stubs.h + else +@@ -177,6 +196,7 @@ + + install-others-nosubdir: $(installed-stubs) + endif ++endif + + + # Since stubs.h is never needed when building the library, we simplify the +Index: git/include/stubs-bootstrap.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/include/stubs-bootstrap.h 2014-08-27 18:35:19.340070587 +0000 +@@ -0,0 +1,12 @@ ++/* Placeholder stubs.h file for bootstrapping. ++ ++ When bootstrapping a GCC/EGLIBC pair, GCC requires that the EGLIBC ++ headers be installed, but we can't fully build EGLIBC without that ++ GCC. So we run the command: ++ ++ make install-headers install-bootstrap-headers=yes ++ ++ to install the headers GCC needs, but avoid building certain ++ difficult headers. The header depends, via the ++ EGLIBC subdir 'stubs' make targets, on every .o file in EGLIBC, but ++ an empty stubs.h like this will do fine for GCC. */ diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-install-pic-archives.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-install-pic-archives.patch new file mode 100644 index 0000000..9a31255 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-install-pic-archives.patch @@ -0,0 +1,109 @@ +2008-02-07 Joseph Myers + + * Makerules (install-extras, install-map): New variables. + (installed-libcs): Add libc_pic.a. + (install-lib): Include _pic.a files for versioned shared + libraries. + (install-map-nosubdir, install-extras-nosubdir): Add rules for + installing extra files. + (install-no-libc.a-nosubdir): Depend on install-map-nosubdir and + install-extras-nosubdir. + + +2008-04-01 Maxim Kuvyrkov + + * Makerules (install-lib): Don't install libpthread_pic.a. + (install-map): Don't install libpthread_pic.map. + +Upstream-Status: Pending + +Index: git/Makerules +=================================================================== +--- git.orig/Makerules 2014-08-27 18:49:22.552070587 +0000 ++++ git/Makerules 2014-08-27 18:49:27.308070587 +0000 +@@ -612,6 +631,9 @@ + $(common-objpfx)libc.so: $(common-objpfx)libc.map + endif + common-generated += libc.so libc_pic.os ++ifndef subdir ++install-extras := soinit.o sofini.o ++endif + ifdef libc.so-version + $(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so + $(make-link) +@@ -834,6 +856,7 @@ + installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\ + $(inst_libdir)/$(patsubst %,$(libtype$o),\ + $(libprefix)$(libc-name))) ++installed-libcs := $(installed-libcs) $(inst_libdir)/libc_pic.a + install: $(installed-libcs) + $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force) + $(make-target-directory) +@@ -862,6 +885,22 @@ + install-lib.so-versioned := $(filter $(versioned), $(install-lib.so)) + install-lib.so-unversioned := $(filter-out $(versioned), $(install-lib.so)) + ++# Install the _pic.a files for versioned libraries, and corresponding ++# .map files. ++# libpthread_pic.a breaks mklibs, so don't install it and its map. ++install-lib := $(install-lib) $(install-lib.so-versioned:%.so=%_pic.a) ++install-lib := $(filter-out libpthread_pic.a,$(install-lib)) ++# Despite having a soname libhurduser and libmachuser do not use symbol ++# versioning, so don't install the corresponding .map files. ++ifeq ($(build-shared),yes) ++install-map := $(patsubst %.so,%.map,\ ++ $(foreach L,$(install-lib.so-versioned),$(notdir $L))) ++install-map := $(filter-out libhurduser.map libmachuser.map libpthread.map,$(install-map)) ++ifndef subdir ++install-map := $(install-map) libc.map ++endif ++endif ++ + # For versioned libraries, we install three files: + # $(inst_libdir)/libfoo.so -- for linking, symlink or ld script + # $(inst_slibdir)/libfoo.so.NN -- for loading by SONAME, symlink +@@ -1103,9 +1142,22 @@ + endif # headers-nonh + endif # headers + ++ifdef install-map ++$(addprefix $(inst_libdir)/,$(patsubst lib%.map,lib%_pic.map,$(install-map))): \ ++ $(inst_libdir)/lib%_pic.map: $(common-objpfx)lib%.map $(+force) ++ $(do-install) ++endif ++ ++ifdef install-extras ++$(addprefix $(inst_libdir)/libc_pic/,$(install-extras)): \ ++ $(inst_libdir)/libc_pic/%.o: $(elfobjdir)/%.os $(+force) ++ $(do-install) ++endif ++ + .PHONY: install-bin-nosubdir install-bin-script-nosubdir \ + install-rootsbin-nosubdir install-sbin-nosubdir install-lib-nosubdir \ +- install-data-nosubdir install-headers-nosubdir ++ install-data-nosubdir install-headers-nosubdir install-map-nosubdir \ ++ install-extras-nosubdir + install-bin-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin)) + install-bin-script-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin-script)) + install-rootsbin-nosubdir: \ +@@ -1118,6 +1170,10 @@ + install-headers-nosubdir: $(addprefix $(inst_includedir)/,$(headers)) + install-others-nosubdir: $(install-others) + install-others-programs-nosubdir: $(install-others-programs) ++install-map-nosubdir: $(addprefix $(inst_libdir)/,\ ++ $(patsubst lib%.map,lib%_pic.map,$(install-map))) ++install-extras-nosubdir: $(addprefix $(inst_libdir)/libc_pic/,\ ++ $(install-extras)) + + # We need all the `-nosubdir' targets so that `install' in the parent + # doesn't depend on several things which each iterate over the subdirs. +@@ -1127,7 +1183,8 @@ + + .PHONY: install install-no-libc.a-nosubdir + install-no-libc.a-nosubdir: install-headers-nosubdir install-data-nosubdir \ +- install-lib-nosubdir install-others-nosubdir ++ install-lib-nosubdir install-others-nosubdir \ ++ install-map-nosubdir install-extras-nosubdir + ifeq ($(build-programs),yes) + install-no-libc.a-nosubdir: install-bin-nosubdir install-bin-script-nosubdir \ + install-rootsbin-nosubdir install-sbin-nosubdir \ diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-ppc8xx-cache-line-workaround.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-ppc8xx-cache-line-workaround.patch new file mode 100644 index 0000000..bb83d6d --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-ppc8xx-cache-line-workaround.patch @@ -0,0 +1,68 @@ +2007-06-13 Nathan Sidwell + Mark Shinwell + + * sysdeps/unix/sysv/linux/powerpc/libc-start.c + (__libc_start_main): Detect 8xx parts and clear + __cache_line_size if detected. + * sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c + (DL_PLATFORM_AUXV): Likewise. + +Upstream-Status: Pending + +Index: git/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c +=================================================================== +--- git.orig/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c 2014-08-27 18:49:23.996070587 +0000 ++++ git/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c 2014-08-27 18:49:27.332070587 +0000 +@@ -24,9 +24,21 @@ + /* Scan the Aux Vector for the "Data Cache Block Size" entry. If found + verify that the static extern __cache_line_size is defined by checking + for not NULL. If it is defined then assign the cache block size +- value to __cache_line_size. */ ++ value to __cache_line_size. This is used by memset to ++ optimize setting to zero. We have to detect 8xx processors, which ++ have buggy dcbz implementations that cannot report page faults ++ correctly. That requires reading SPR, which is a privileged ++ operation. Fortunately 2.2.18 and later emulates PowerPC mfspr ++ reads from the PVR register. */ + #define DL_PLATFORM_AUXV \ + case AT_DCACHEBSIZE: \ ++ if (__LINUX_KERNEL_VERSION >= 0x020218) \ ++ { \ ++ unsigned pvr = 0; \ ++ asm ("mfspr %0, 287" : "=r" (pvr)); \ ++ if ((pvr & 0xffff0000) == 0x00500000) \ ++ break; \ ++ } \ + __cache_line_size = av->a_un.a_val; \ + break; + +Index: git/sysdeps/unix/sysv/linux/powerpc/libc-start.c +=================================================================== +--- git.orig/sysdeps/unix/sysv/linux/powerpc/libc-start.c 2014-08-27 18:49:23.996070587 +0000 ++++ git/sysdeps/unix/sysv/linux/powerpc/libc-start.c 2014-08-27 18:49:27.332070587 +0000 +@@ -68,11 +68,24 @@ + rtld_fini = NULL; + } + +- /* Initialize the __cache_line_size variable from the aux vector. */ ++ /* Initialize the __cache_line_size variable from the aux vector. ++ This is used by memset to optimize setting to zero. We have to ++ detect 8xx processors, which have buggy dcbz implementations that ++ cannot report page faults correctly. That requires reading SPR, ++ which is a privileged operation. Fortunately 2.2.18 and later ++ emulates PowerPC mfspr reads from the PVR register. */ + for (ElfW (auxv_t) * av = auxvec; av->a_type != AT_NULL; ++av) + switch (av->a_type) + { + case AT_DCACHEBSIZE: ++ if (__LINUX_KERNEL_VERSION >= 0x020218) ++ { ++ unsigned pvr = 0; ++ ++ asm ("mfspr %0, 287" : "=r" (pvr) :); ++ if ((pvr & 0xffff0000) == 0x00500000) ++ break; ++ } + __cache_line_size = av->a_un.a_val; + break; + } diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-resolv-dynamic.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-resolv-dynamic.patch new file mode 100644 index 0000000..a73bceb --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-resolv-dynamic.patch @@ -0,0 +1,54 @@ +cherry-picked from http://www.eglibc.org/archives/patches/msg00772.html + +It hasnt yet been merged into glibc + +Signed-off-by: Khem Raj + +Upstream-Status: Pending + +Index: git/resolv/res_libc.c +=================================================================== +--- git.orig/resolv/res_libc.c 2014-08-27 18:35:15.492070587 +0000 ++++ git/resolv/res_libc.c 2014-08-27 18:35:19.204070587 +0000 +@@ -22,12 +22,13 @@ + #include + #include + #include +- ++#include + + /* The following bit is copied from res_data.c (where it is #ifdef'ed + out) since res_init() should go into libc.so but the rest of that + file should not. */ + ++__libc_lock_define_initialized (static, lock); + extern unsigned long long int __res_initstamp attribute_hidden; + /* We have atomic increment operations on 64-bit platforms. */ + #if __WORDSIZE == 64 +@@ -35,7 +36,6 @@ + # define atomicincunlock(lock) (void) 0 + # define atomicinc(var) catomic_increment (&(var)) + #else +-__libc_lock_define_initialized (static, lock); + # define atomicinclock(lock) __libc_lock_lock (lock) + # define atomicincunlock(lock) __libc_lock_unlock (lock) + # define atomicinc(var) ++var +@@ -94,7 +94,18 @@ + int + __res_maybe_init (res_state resp, int preinit) + { ++ static time_t last_mtime; ++ struct stat statbuf; ++ int ret; ++ + if (resp->options & RES_INIT) { ++ ret = stat (_PATH_RESCONF, &statbuf); ++ __libc_lock_lock (lock); ++ if ((ret == 0) && (last_mtime != statbuf.st_mtime)) { ++ last_mtime = statbuf.st_mtime; ++ atomicinc (__res_initstamp); ++ } ++ __libc_lock_unlock (lock); + if (__res_initstamp != resp->_u._ext.initstamp) { + if (resp->nscount > 0) + __res_iclose (resp, true); diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-sh4-fpscr_values.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-sh4-fpscr_values.patch new file mode 100644 index 0000000..bfb813e --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-sh4-fpscr_values.patch @@ -0,0 +1,42 @@ +2010-09-29 Nobuhiro Iwamatsu + Andrew Stubbs + + Resolve SH's __fpscr_values to symbol in libc.so. + + * sysdeps/sh/sh4/fpu/fpu_control.h: Add C++ __set_fpscr prototype. + * sysdeps/unix/sysv/linux/sh/Versions (GLIBC_2.2): Add __fpscr_values. + * sysdeps/unix/sysv/linux/sh/sysdep.S (___fpscr_values): New constant. + +Upstream-Status: Pending + +Index: git/sysdeps/unix/sysv/linux/sh/sysdep.S +=================================================================== +--- git.orig/sysdeps/unix/sysv/linux/sh/sysdep.S 2014-08-27 18:49:24.036070587 +0000 ++++ git/sysdeps/unix/sysv/linux/sh/sysdep.S 2014-08-27 18:49:27.332070587 +0000 +@@ -30,3 +30,14 @@ + + #define __syscall_error __syscall_error_1 + #include ++ ++ .data ++ .align 3 ++ .globl ___fpscr_values ++ .type ___fpscr_values, @object ++ .size ___fpscr_values, 8 ++___fpscr_values: ++ .long 0 ++ .long 0x80000 ++weak_alias (___fpscr_values, __fpscr_values) ++ +Index: git/sysdeps/unix/sysv/linux/sh/Versions +=================================================================== +--- git.orig/sysdeps/unix/sysv/linux/sh/Versions 2014-08-27 18:49:24.028070587 +0000 ++++ git/sysdeps/unix/sysv/linux/sh/Versions 2014-08-27 18:49:27.332070587 +0000 +@@ -2,6 +2,7 @@ + GLIBC_2.2 { + # functions used in other libraries + __xstat64; __fxstat64; __lxstat64; ++ __fpscr_values; + + # a* + alphasort64; diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-use-option-groups.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-use-option-groups.patch new file mode 100644 index 0000000..40c7832 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc-use-option-groups.patch @@ -0,0 +1,16577 @@ +Forward port eglibc options groups support + +Upstream-Status: Pending + +Index: git/argp/argp-fmtstream.c +=================================================================== +--- git.orig/argp/argp-fmtstream.c 2014-08-29 20:00:42.976070587 -0700 ++++ git/argp/argp-fmtstream.c 2014-08-29 20:01:15.188070587 -0700 +@@ -42,6 +42,7 @@ + #ifdef _LIBC + # include + # include ++# include + # define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a) + #endif + +@@ -100,7 +101,11 @@ + __argp_fmtstream_update (fs); + if (fs->p > fs->buf) + { ++#ifdef _LIBC + __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf); ++#else ++ fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream); ++#endif + } + free (fs->buf); + free (fs); +@@ -145,9 +150,17 @@ + size_t i; + for (i = 0; i < pad; i++) + { ++#ifdef _LIBC + if (_IO_fwide (fs->stream, 0) > 0) +- putwc_unlocked (L' ', fs->stream); ++ { ++#if ! _LIBC || __OPTION_POSIX_WIDE_CHAR_DEVICE_IO ++ putwc_unlocked (L' ', fs->stream); ++#else ++ abort (); ++#endif ++ } + else ++#endif + putc_unlocked (' ', fs->stream); + } + } +@@ -308,9 +321,17 @@ + *nl++ = ' '; + else + for (i = 0; i < fs->wmargin; ++i) ++#ifdef _LIBC + if (_IO_fwide (fs->stream, 0) > 0) +- putwc_unlocked (L' ', fs->stream); ++ { ++#ifdef OPTION_POSIX_WIDE_CHAR_DEVICE_IO ++ putwc_unlocked (L' ', fs->stream); ++#else ++ abort (); ++#endif ++ } + else ++#endif + putc_unlocked (' ', fs->stream); + + /* Copy the tail of the original buffer into the current buffer +Index: git/argp/argp-help.c +=================================================================== +--- git.orig/argp/argp-help.c 2014-08-29 20:00:42.976070587 -0700 ++++ git/argp/argp-help.c 2014-08-29 20:01:15.188070587 -0700 +@@ -51,6 +51,7 @@ + #ifdef _LIBC + # include <../libio/libioP.h> + # include ++# include + #endif + + #ifndef _ +@@ -1702,7 +1703,7 @@ + } + + char * +-__argp_short_program_name (void) ++(__argp_short_program_name) (void) + { + # if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + return program_invocation_short_name; +@@ -1873,9 +1874,17 @@ + #endif + } + ++#ifdef _LIBC + if (_IO_fwide (stream, 0) > 0) +- putwc_unlocked (L'\n', stream); ++ { ++#if ! _LIBC || __OPTION_POSIX_WIDE_CHAR_DEVICE_IO ++ putwc_unlocked (L'\n', stream); ++#else ++ abort (); ++#endif ++ } + else ++#endif + putc_unlocked ('\n', stream); + + #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) +Index: git/argp/argp-namefrob.h +=================================================================== +--- git.orig/argp/argp-namefrob.h 2014-08-29 20:00:42.976070587 -0700 ++++ git/argp/argp-namefrob.h 2014-08-29 20:01:15.192070587 -0700 +@@ -76,10 +76,12 @@ + #undef __argp_fmtstream_wmargin + #define __argp_fmtstream_wmargin argp_fmtstream_wmargin + ++#if 0 + #include "mempcpy.h" + #include "strcase.h" + #include "strchrnul.h" + #include "strndup.h" ++#endif + + /* normal libc functions we call */ + #undef __flockfile +Index: git/argp/Makefile +=================================================================== +--- git.orig/argp/Makefile 2014-08-29 20:00:42.976070587 -0700 ++++ git/argp/Makefile 2014-08-29 20:01:15.192070587 -0700 +@@ -18,6 +18,8 @@ + # + # Makefile for argp. + # ++include ../option-groups.mak ++ + subdir := argp + + include ../Makeconfig +Index: git/catgets/Makefile +=================================================================== +--- git.orig/catgets/Makefile 2014-08-29 20:00:43.008070587 -0700 ++++ git/catgets/Makefile 2014-08-29 20:01:15.192070587 -0700 +@@ -22,20 +22,23 @@ + + include ../Makeconfig + ++include ../option-groups.mak ++ + headers = nl_types.h +-routines = catgets open_catalog +-others = gencat +-install-bin = gencat +-extra-objs = $(gencat-modules:=.o) ++routines-$(OPTION_EGLIBC_CATGETS) := catgets open_catalog ++others-$(OPTION_EGLIBC_CATGETS) := gencat ++install-bin-$(OPTION_EGLIBC_CATGETS) := gencat ++extra-objs-$(OPTION_EGLIBC_CATGETS) := $(gencat-modules:=.o) + +-tests = tst-catgets +-test-srcs = test-gencat ++tests-$(OPTION_EGLIBC_CATGETS) := tst-catgets ++test-srcs-$(OPTION_EGLIBC_CATGETS) := test-gencat + ++ifeq (y,$(OPTION_EGLIBC_CATGETS)) + ifeq ($(run-built-tests),yes) + tests-special += $(objpfx)de/libc.cat $(objpfx)test1.cat $(objpfx)test2.cat \ + $(objpfx)sample.SJIS.cat $(objpfx)test-gencat.out + endif +- ++endif + gencat-modules = xmalloc + + # To find xmalloc.c +Index: git/crypt/crypt-entry.c +=================================================================== +--- git.orig/crypt/crypt-entry.c 2014-08-29 20:00:43.028070587 -0700 ++++ git/crypt/crypt-entry.c 2014-08-29 20:01:15.192070587 -0700 +@@ -27,6 +27,7 @@ + #include + #endif + #include ++#include + #include + #include + +@@ -76,9 +77,11 @@ + const char *salt; + struct crypt_data * __restrict data; + { ++#if __OPTION_EGLIBC_CRYPT_UFC + ufc_long res[4]; + char ktab[9]; + ufc_long xx = 25; /* to cope with GCC long long compiler bugs */ ++#endif /*__OPTION_EGLIBC_CRYPT_UFC*/ + + #ifdef _LIBC + /* Try to find out whether we have to use MD5 encryption replacement. */ +@@ -105,6 +108,7 @@ + sizeof (struct crypt_data)); + #endif + ++#if __OPTION_EGLIBC_CRYPT_UFC + /* + * Hack DES tables according to salt + */ +@@ -144,6 +148,10 @@ + */ + _ufc_output_conversion_r (res[0], res[1], salt, data); + return data->crypt_3_buf; ++#else /* __OPTION_EGLIBC_CRYPT_UFC */ ++ __set_errno (ENOSYS); ++ return NULL; ++#endif /* __OPTION_EGLIBC_CRYPT_UFC */ + } + weak_alias (__crypt_r, crypt_r) + +@@ -168,7 +176,12 @@ + return __sha512_crypt (key, salt); + #endif + ++#if __OPTION_EGLIBC_CRYPT_UFC + return __crypt_r (key, salt, &_ufc_foobar); ++#else /* __OPTION_EGLIBC_CRYPT_UFC */ ++ __set_errno (ENOSYS); ++ return NULL; ++#endif /* __OPTION_EGLIBC_CRYPT_UFC */ + } + + +Index: git/crypt/Makefile +=================================================================== +--- git.orig/crypt/Makefile 2014-08-29 20:00:43.024070587 -0700 ++++ git/crypt/Makefile 2014-08-29 20:01:15.192070587 -0700 +@@ -18,21 +18,25 @@ + # + # Sub-makefile for crypt() portion of the library. + # ++include ../option-groups.mak ++ + subdir := crypt + + include ../Makeconfig + + headers := crypt.h + +-extra-libs := libcrypt +-extra-libs-others := $(extra-libs) ++extra-libs-$(OPTION_EGLIBC_CRYPT) := libcrypt ++extra-libs-others-y := $(extra-libs-y) + +-libcrypt-routines := crypt-entry md5-crypt sha256-crypt sha512-crypt crypt \ +- crypt_util ++libcrypt-routines :=crypt-entry md5-crypt sha256-crypt sha512-crypt crypt_common ++libcrypt-routines-$(OPTION_EGLIBC_CRYPT_UFC) := crypt crypt_util ++libcrypt-routines += $(libcrypt-routines-y) + +-tests := cert md5c-test sha256c-test sha512c-test badsalttest ++tests-$(OPTION_EGLIBC_CRYPT) := md5c-test sha256c-test sha512c-test badsalttest ++tests-$(OPTION_EGLIBC_CRYPT_UFC) += cert + +-ifeq ($(crypt-in-libc),yes) ++ifeq ($(crypt-in-libc)$(OPTION_EGLIBC_CRYPT),yesy) + routines += $(libcrypt-routines) + endif + +@@ -44,7 +48,7 @@ + else + libcrypt-routines += md5 sha256 sha512 + +-tests += md5test sha256test sha512test ++tests-$(OPTION_EGLIBC_CRYPT) += md5test sha256test sha512test + + # The test md5test-giant uses up to 400 MB of RSS and runs on a fast + # machine over a minute. +@@ -64,8 +68,10 @@ + $(objpfx)sha512test: $(patsubst %, $(objpfx)%.o,$(sha512-routines)) + endif + ++ifeq ($(OPTION_EGLIBC_CRYPT),y) + ifeq (yes,$(build-shared)) + $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.so + else + $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.a + endif ++endif # eglibc: OPTION_EGLIBC_CRYPT +Index: git/csu/Makefile +=================================================================== +--- git.orig/csu/Makefile 2014-08-29 20:00:43.032070587 -0700 ++++ git/csu/Makefile 2014-08-29 20:01:15.192070587 -0700 +@@ -22,6 +22,8 @@ + # crtn.o, special "initializer" and "finalizer" files used in the link + # to make the .init and .fini sections work right. + ++include ../option-groups.mak ++ + subdir := csu + + include ../Makeconfig +Index: git/debug/Makefile +=================================================================== +--- git.orig/debug/Makefile 2014-08-29 20:00:43.036070587 -0700 ++++ git/debug/Makefile 2014-08-29 20:01:15.192070587 -0700 +@@ -18,6 +18,8 @@ + # + # Sub-makefile for debug portion of the library. + # ++include ../option-groups.mak ++ + subdir := debug + + include ../Makeconfig +@@ -27,7 +29,7 @@ + # Note that ptsname_r_chk and getlogin_r are not here, but in + # login/Makefile instead. If that subdir is omitted from the + # build, its _FORTIFY_SOURCE support will be too. +-routines = backtrace backtracesyms backtracesymsfd noophooks \ ++routines = noophooks \ + memcpy_chk memmove_chk mempcpy_chk memset_chk stpcpy_chk \ + strcat_chk strcpy_chk strncat_chk strncpy_chk stpncpy_chk \ + sprintf_chk vsprintf_chk snprintf_chk vsnprintf_chk \ +@@ -36,20 +38,27 @@ + read_chk pread_chk pread64_chk recv_chk recvfrom_chk \ + readlink_chk readlinkat_chk getwd_chk getcwd_chk \ + realpath_chk fread_chk fread_u_chk \ +- wctomb_chk wcscpy_chk wmemcpy_chk wmemmove_chk wmempcpy_chk \ +- wcpcpy_chk wcsncpy_chk wcscat_chk wcsncat_chk wmemset_chk \ +- wcpncpy_chk \ +- swprintf_chk vswprintf_chk wprintf_chk fwprintf_chk \ +- vwprintf_chk vfwprintf_chk fgetws_chk fgetws_u_chk \ + confstr_chk getgroups_chk ttyname_r_chk \ +- gethostname_chk getdomainname_chk wcrtomb_chk mbsnrtowcs_chk \ +- wcsnrtombs_chk mbsrtowcs_chk wcsrtombs_chk mbstowcs_chk \ +- wcstombs_chk asprintf_chk vasprintf_chk dprintf_chk \ ++ gethostname_chk getdomainname_chk \ ++ asprintf_chk vasprintf_chk dprintf_chk \ + vdprintf_chk obprintf_chk \ + longjmp_chk ____longjmp_chk \ + fdelt_chk poll_chk ppoll_chk \ + stack_chk_fail fortify_fail \ + $(static-only-routines) ++routines-$(OPTION_EGLIBC_BACKTRACE) += backtrace backtracesyms backtracesymsfd ++routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \ ++ += wprintf_chk fwprintf_chk \ ++ vwprintf_chk vfwprintf_chk fgetws_chk fgetws_u_chk ++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \ ++ += wctomb_chk wcscpy_chk wmemcpy_chk wmemmove_chk wmempcpy_chk \ ++ wcpcpy_chk wcsncpy_chk wcscat_chk wcsncat_chk wmemset_chk \ ++ wcpncpy_chk \ ++ swprintf_chk vswprintf_chk \ ++ wcrtomb_chk mbsnrtowcs_chk \ ++ wcsnrtombs_chk mbsrtowcs_chk wcsrtombs_chk mbstowcs_chk \ ++ wcstombs_chk ++ + static-only-routines := warning-nop stack_chk_fail_local + + CFLAGS-backtrace.c = -fno-omit-frame-pointer +@@ -129,11 +138,15 @@ + LDFLAGS-tst-backtrace5 = -rdynamic + LDFLAGS-tst-backtrace6 = -rdynamic + +-tests = backtrace-tst tst-longjmp_chk tst-chk1 tst-chk2 tst-chk3 \ +- tst-lfschk1 tst-lfschk2 tst-lfschk3 test-strcpy_chk test-stpcpy_chk \ +- tst-chk4 tst-chk5 tst-chk6 tst-lfschk4 tst-lfschk5 tst-lfschk6 \ +- tst-longjmp_chk2 tst-backtrace2 tst-backtrace3 tst-backtrace4 \ +- tst-backtrace5 tst-backtrace6 ++tests = tst-longjmp_chk test-strcpy_chk test-stpcpy_chk tst-longjmp_chk2 ++tests-$(OPTION_EGLIBC_LOCALE_CODE) \ ++ += tst-chk1 tst-chk2 tst-chk3 tst-lfschk1 tst-lfschk2 tst-lfschk3 ++tests-$(OPTION_EGLIBC_BACKTRACE) \ ++ += backtrace-tst tst-backtrace2 tst-backtrace3 tst-backtrace4 \ ++ tst-backtrace5 tst-backtrace6 ++ifeq (yy,$(OPTION_EGLIBC_LOCALE_CODE)$(OPTION_EGLIBC_CXX_TESTS)) ++tests += tst-chk4 tst-chk5 tst-chk6 tst-lfschk4 tst-lfschk5 tst-lfschk6 ++endif + + tests-ifunc := $(stpcpy_chk strcpy_chk:%=test-%-ifunc) + tests += $(tests-ifunc) +Index: git/debug/segfault.c +=================================================================== +--- git.orig/debug/segfault.c 2014-08-29 20:00:46.280070587 -0700 ++++ git/debug/segfault.c 2014-08-29 20:01:15.192070587 -0700 +@@ -30,6 +30,7 @@ + #include + #include <_itoa.h> + #include ++#include + + /* This file defines macros to access the content of the sigcontext element + passed up by the signal handler. */ +@@ -91,6 +92,7 @@ + REGISTER_DUMP; + #endif + ++#if __OPTION_EGLIBC_BACKTRACE + WRITE_STRING ("\nBacktrace:\n"); + + /* Get the backtrace. */ +@@ -113,6 +115,7 @@ + + /* Now generate nicely formatted output. */ + __backtrace_symbols_fd (arr + i, cnt - i, fd); ++#endif + + #ifdef HAVE_PROC_SELF + /* Now the link map. */ +Index: git/debug/tst-chk1.c +=================================================================== +--- git.orig/debug/tst-chk1.c 2014-08-29 20:00:46.288070587 -0700 ++++ git/debug/tst-chk1.c 2014-08-29 20:01:15.192070587 -0700 +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + + + #define obstack_chunk_alloc malloc +@@ -307,6 +308,7 @@ + snprintf (buf + 8, l0 + 3, "%d", num2); + CHK_FAIL_END + ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR + CHK_FAIL_START + swprintf (wbuf + 8, 3, L"%d", num1); + CHK_FAIL_END +@@ -314,6 +316,7 @@ + CHK_FAIL_START + swprintf (wbuf + 8, l0 + 3, L"%d", num1); + CHK_FAIL_END ++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */ + # endif + + memcpy (buf, str1 + 2, l0 + 9); +@@ -381,6 +384,7 @@ + CHK_FAIL_END + #endif + ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR + + /* These ops can be done without runtime checking of object size. */ + wmemcpy (wbuf, L"abcdefghij", 10); +@@ -605,6 +609,7 @@ + CHK_FAIL_END + #endif + ++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */ + + /* Now checks for %n protection. */ + +@@ -1192,6 +1197,7 @@ + # endif + #endif + ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR + if (setlocale (LC_ALL, "de_DE.UTF-8") != NULL) + { + assert (MB_CUR_MAX <= 10); +@@ -1348,6 +1354,7 @@ + puts ("cannot set locale"); + ret = 1; + } ++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */ + + int fd = posix_openpt (O_RDWR); + if (fd != -1) +Index: git/dlfcn/Makefile +=================================================================== +--- git.orig/dlfcn/Makefile 2014-08-29 20:00:46.312070587 -0700 ++++ git/dlfcn/Makefile 2014-08-29 20:01:15.192070587 -0700 +@@ -15,6 +15,8 @@ + # License along with the GNU C Library; if not, see + # . + ++include ../option-groups.mak ++ + subdir := dlfcn + + include ../Makeconfig +@@ -36,7 +38,9 @@ + ifeq (yes,$(build-shared)) + tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \ + bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \ +- bug-atexit3 tstatexit bug-dl-leaf ++ tstatexit bug-dl-leaf ++ ++tests-$(OPTION_EGLIBC_CXX_TESTS) += bug-atexit3 + endif + modules-names = glreflib1 glreflib2 glreflib3 failtestmod defaultmod1 \ + defaultmod2 errmsg1mod modatexit modcxaatexit \ +Index: git/elf/dl-support.c +=================================================================== +--- git.orig/elf/dl-support.c 2014-08-29 20:00:46.384070587 -0700 ++++ git/elf/dl-support.c 2014-08-29 20:01:15.192070587 -0700 +@@ -19,6 +19,7 @@ + /* This file defines some things that for the dynamic linker are defined in + rtld.c and dl-sysdep.c in ways appropriate to bootstrap dynamic linking. */ + ++#include + #include + #include + #include +@@ -42,7 +43,9 @@ + const char *_dl_platform; + size_t _dl_platformlen; + ++#if __OPTION_EGLIBC_RTLD_DEBUG + int _dl_debug_mask; ++#endif + int _dl_lazy; + ElfW(Addr) _dl_use_load_bias = -2; + int _dl_dynamic_weak; +Index: git/elf/rtld.c +=================================================================== +--- git.orig/elf/rtld.c 2014-08-29 20:01:14.708070587 -0700 ++++ git/elf/rtld.c 2014-08-29 20:01:15.196070587 -0700 +@@ -16,6 +16,7 @@ + License along with the GNU C Library; if not, see + . */ + ++#include + #include + #include + #include +@@ -2200,6 +2201,7 @@ + objname, errstring); + } + ++#if __OPTION_EGLIBC_RTLD_DEBUG + /* Nonzero if any of the debugging options is enabled. */ + static int any_debug attribute_relro; + +@@ -2309,6 +2311,7 @@ + _exit (0); + } + } ++#endif /* __OPTION_EGLIBC_RTLD_DEBUG */ + + static void + process_dl_audit (char *str) +@@ -2376,12 +2379,14 @@ + break; + + case 5: ++#if __OPTION_EGLIBC_RTLD_DEBUG + /* Debugging of the dynamic linker? */ + if (memcmp (envline, "DEBUG", 5) == 0) + { + process_dl_debug (&envline[6]); + break; + } ++#endif + if (memcmp (envline, "AUDIT", 5) == 0) + process_dl_audit (&envline[6]); + break; +@@ -2490,7 +2495,9 @@ + { + mode = trace; + GLRO(dl_verbose) = 1; ++#if __OPTION_EGLIBC_RTLD_DEBUG + GLRO_dl_debug_mask |= DL_DEBUG_PRELINK; ++#endif + GLRO(dl_trace_prelink) = &envline[17]; + } + break; +@@ -2537,12 +2544,15 @@ + if (__access ("/etc/suid-debug", F_OK) != 0) + { + unsetenv ("MALLOC_CHECK_"); ++#if __OPTION_EGLIBC_RTLD_DEBUG + GLRO_dl_debug_mask = 0; ++#endif + } + + if (mode != normal) + _exit (5); + } ++#if __OPTION_EGLIBC_RTLD_DEBUG + /* If we have to run the dynamic linker in debugging mode and the + LD_DEBUG_OUTPUT environment variable is given, we write the debug + messages to this file. */ +@@ -2567,6 +2577,7 @@ + /* We use standard output if opening the file failed. */ + GLRO(dl_debug_fd) = STDOUT_FILENO; + } ++#endif /* __OPTION_EGLIBC_RTLD_DEBUG */ + } + + +Index: git/extra-lib.mk +=================================================================== +--- git.orig/extra-lib.mk 2014-08-29 20:00:46.544070587 -0700 ++++ git/extra-lib.mk 2014-08-29 20:01:15.196070587 -0700 +@@ -25,7 +25,9 @@ + extra-objs := $(extra-objs) + + # The modules that go in $(lib). +-all-$(lib)-routines := $($(lib)-routines) $($(lib)-sysdep_routines) ++all-$(lib)-routines := $($(lib)-routines) \ ++ $($(lib)-routines-y) \ ++ $($(lib)-sysdep_routines) + + # Add each flavor of library to the lists of things to build and install. + install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) +@@ -101,7 +103,7 @@ + endif + + # This will define `libof-ROUTINE := LIB' for each of the routines. +-cpp-srcs-left := $($(lib)-routines) $($(lib)-sysdep_routines) ++cpp-srcs-left := $(all-$(lib)-routines) + ifneq (,$(cpp-srcs-left)) + include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) + endif +Index: git/grp/Makefile +=================================================================== +--- git.orig/grp/Makefile 2014-08-29 20:00:46.556070587 -0700 ++++ git/grp/Makefile 2014-08-29 20:01:15.196070587 -0700 +@@ -18,6 +18,8 @@ + # + # Sub-makefile for grp portion of the library. + # ++include ../option-groups.mak ++ + subdir := grp + + include ../Makeconfig +@@ -29,6 +31,9 @@ + getgrent_r getgrgid_r getgrnam_r fgetgrent_r + + tests := testgrp ++ifneq (y,$(OPTION_EGLIBC_NSSWITCH)) ++LDLIBS-testgrp += $(shell cat $(common-objpfx)nss/fixed-nsswitch-libs) ++endif + + ifeq (yes,$(build-shared)) + test-srcs := tst_fgetgrent +Index: git/hesiod/Makefile +=================================================================== +--- git.orig/hesiod/Makefile 2014-08-29 20:00:46.580070587 -0700 ++++ git/hesiod/Makefile 2014-08-29 20:01:15.196070587 -0700 +@@ -18,12 +18,14 @@ + # + # Sub-makefile for hesiod portion of the library. + # ++include ../option-groups.mak ++ + subdir := hesiod + + include ../Makeconfig + +-extra-libs := libnss_hesiod +-extra-libs-others = $(extra-libs) ++extra-libs-$(OPTION_EGLIBC_INET) += libnss_hesiod ++extra-libs-others-y += $(extra-libs-y) + + subdir-dirs = nss_hesiod + vpath %.c nss_hesiod +Index: git/iconv/gconv_db.c +=================================================================== +--- git.orig/iconv/gconv_db.c 2014-08-29 20:00:46.604070587 -0700 ++++ git/iconv/gconv_db.c 2014-08-29 20:01:15.196070587 -0700 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -828,9 +829,11 @@ + /* Free all resources if necessary. */ + libc_freeres_fn (free_mem) + { ++#if __OPTION_EGLIBC_LOCALE_CODE + /* First free locale memory. This needs to be done before freeing derivations, + as ctype cleanup functions dereference steps arrays which we free below. */ + _nl_locale_subfreeres (); ++#endif + + /* finddomain.c has similar problem. */ + extern void _nl_finddomain_subfreeres (void) attribute_hidden; +Index: git/iconv/gconv_trans.c +=================================================================== +--- git.orig/iconv/gconv_trans.c 2014-08-29 20:00:46.612070587 -0700 ++++ git/iconv/gconv_trans.c 2014-08-29 20:01:15.196070587 -0700 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + #include + #include "gconv_int.h" +@@ -59,6 +60,7 @@ + PTR_DEMANGLE (fct); + #endif + ++#if __OPTION_EGLIBC_LOCALE_CODE + /* If there is no transliteration information in the locale don't do + anything and return the error. */ + size = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_TAB_SIZE); +@@ -194,6 +196,7 @@ + sorted. */ + break; + } ++#endif + + /* One last chance: use the default replacement. */ + if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN) != 0) +Index: git/iconv/iconv_prog.c +=================================================================== +--- git.orig/iconv/iconv_prog.c 2014-08-29 20:00:46.612070587 -0700 ++++ git/iconv/iconv_prog.c 2014-08-29 20:01:15.196070587 -0700 +@@ -35,6 +35,7 @@ + #ifdef _POSIX_MAPPED_FILES + # include + #endif ++#include + #include + #include + #include "iconv_prog.h" +@@ -221,10 +222,17 @@ + bool to_wrong = + (iconv_open (to_code, "UTF-8") == (iconv_t) -1 + && errno == EINVAL); ++#if __OPTION_EGLIBC_LOCALE_CODE + const char *from_pretty = + (from_code[0] ? from_code : nl_langinfo (CODESET)); + const char *to_pretty = + (orig_to_code[0] ? orig_to_code : nl_langinfo (CODESET)); ++#else ++ const char *from_pretty = ++ (from_code[0] ? from_code : "ANSI_X3.4-1968"); ++ const char *to_pretty = ++ (orig_to_code[0] ? orig_to_code : "ANSI_X3.4-1968"); ++#endif + + if (from_wrong) + { +Index: git/iconv/Makefile +=================================================================== +--- git.orig/iconv/Makefile 2014-08-29 20:00:46.600070587 -0700 ++++ git/iconv/Makefile 2014-08-29 20:01:15.196070587 -0700 +@@ -18,6 +18,8 @@ + # + # Makefile for iconv. + # ++include ../option-groups.mak ++ + subdir := iconv + + include ../Makeconfig +@@ -57,6 +59,9 @@ + CPPFLAGS-strtab = -DNOT_IN_libc + CPPFLAGS-charmap = -DNOT_IN_libc + CPPFLAGS-charmap-dir = -DNOT_IN_libc ++ifneq (y,$(OPTION_EGLIBC_SPAWN)) ++CPPFLAGS-charmap-dir.c += -DNO_UNCOMPRESS ++endif + + ifeq ($(run-built-tests),yes) + xtests-special += $(objpfx)test-iconvconfig.out +Index: git/iconvdata/Makefile +=================================================================== +--- git.orig/iconvdata/Makefile 2014-08-29 20:00:46.628070587 -0700 ++++ git/iconvdata/Makefile 2014-08-29 20:01:15.196070587 -0700 +@@ -18,12 +18,15 @@ + # + # Makefile for iconv data and code. + # ++include ../option-groups.mak ++ + subdir := iconvdata + + include ../Makeconfig + + # Names of all the shared objects which implement the transformations. +-modules := ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 \ ++modules-$(OPTION_EGLIBC_CHARSETS) \ ++ := ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 \ + ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-10 \ + ISO8859-11 ISO8859-13 ISO8859-14 ISO8859-15 ISO8859-16 \ + T.61 ISO_6937 SJIS KOI-8 HP-ROMAN8 HP-ROMAN9 EBCDIC-AT-DE \ +@@ -63,11 +66,13 @@ + MAC-CENTRALEUROPE KOI8-RU ISO8859-9E \ + CP770 CP771 CP772 CP773 CP774 + +-modules.so := $(addsuffix .so, $(modules)) ++modules.so := $(addsuffix .so, $(modules-y)) + + ifeq (yes,$(build-shared)) + tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \ +- tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 ++ tst-iconv6 bug-iconv5 bug-iconv8 bug-iconv9 ++tests-$(OPTION_EGLIBC_LOCALE_CODE) += bug-iconv6 tst-iconv7 ++ + ifeq ($(have-thread-library),yes) + tests += bug-iconv3 + endif +@@ -130,13 +135,13 @@ + # Rule to generate the shared objects. + charmaps = ../localedata/charmaps + -include $(objpfx)iconv-rules +-extra-modules-left := $(modules) ++extra-modules-left := $(modules-y) + include extra-module.mk + + + extra-objs += $(modules.so) +-install-others = $(addprefix $(inst_gconvdir)/, $(modules.so)) \ +- $(inst_gconvdir)/gconv-modules ++install-others-y += $(addprefix $(inst_gconvdir)/, $(modules.so)) ++install-others-$(OPTION_EGLIBC_CHARSETS) += $(inst_gconvdir)/gconv-modules + + # We can build the conversion tables for numerous charsets automatically. + +@@ -204,7 +209,7 @@ + ifndef avoid-generated + $(objpfx)iconv-rules: Makefile + $(make-target-directory) +- { echo $(filter-out lib%, $(modules)); \ ++ { echo $(filter-out lib%, $(modules-y)); \ + echo 8bit $(gen-8bit-modules); \ + echo 8bit-gap $(gen-8bit-gap-modules); } | \ + LC_ALL=C \ +@@ -247,7 +252,7 @@ + $(do-install-program) + $(inst_gconvdir)/gconv-modules: gconv-modules $(+force) + $(do-install) +-ifeq (no,$(cross-compiling)) ++# eglibc: ifeq (no,$(cross-compiling)) + # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary + # if this libc has more gconv modules than the previously installed one. + if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \ +@@ -256,9 +261,9 @@ + $(common-objpfx)iconv/iconvconfig \ + $(addprefix --prefix=,$(install_root)); \ + fi +-else +- @echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache' +-endif ++# eglibc: else ++# eglibc: @echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache' ++# eglibc: endif + + endif # build-shared = yes + +Index: git/include/netdb.h +=================================================================== +--- git.orig/include/netdb.h 2014-08-29 20:00:47.152070587 -0700 ++++ git/include/netdb.h 2014-08-29 20:01:15.196070587 -0700 +@@ -232,6 +232,10 @@ + (const char *name, int af, struct hostent *host, \ + char *buffer, size_t buflen, int *errnop, \ + int *h_errnop); \ ++extern enum nss_status _nss_ ## service ## _gethostbyname3_r \ ++ (const char *name, int af, struct hostent *result, \ ++ char *buffer, size_t buflen, int *errnop, \ ++ int *h_errnop, int32_t *ttlp, char **canonp); \ + extern enum nss_status _nss_ ## service ## _gethostbyname_r \ + (const char *name, struct hostent *host, char *buffer, \ + size_t buflen, int *errnop, int *h_errnop); \ +Index: git/inet/Makefile +=================================================================== +--- git.orig/inet/Makefile 2014-08-29 20:00:47.176070587 -0700 ++++ git/inet/Makefile 2014-08-29 20:01:15.200070587 -0700 +@@ -18,6 +18,8 @@ + # + # Sub-makefile for inet portion of the library. + # ++include ../option-groups.mak ++ + subdir := inet + + include ../Makeconfig +@@ -27,7 +29,8 @@ + netinet/tcp.h netinet/ip.h $(wildcard arpa/*.h protocols/*.h) \ + aliases.h ifaddrs.h netinet/ip6.h netinet/icmp6.h bits/in.h + +-routines := htonl htons \ ++routines-$(OPTION_EGLIBC_INET) \ ++ += htonl htons \ + inet_lnaof inet_mkadr \ + inet_netof inet_ntoa inet_net herrno herrno-loc \ + gethstbyad gethstbyad_r gethstbynm gethstbynm2 gethstbynm2_r \ +@@ -41,18 +44,23 @@ + getrpcent_r getrpcbyname_r getrpcbynumber_r \ + ether_aton ether_aton_r ether_hton ether_line \ + ether_ntoa ether_ntoa_r ether_ntoh \ +- rcmd rexec ruserpass \ + getnetgrent_r getnetgrent \ +- getaliasent_r getaliasent getaliasname getaliasname_r \ +- in6_addr getnameinfo if_index ifaddrs inet6_option \ ++ in6_addr getnameinfo if_index ifaddrs \ + getipv4sourcefilter setipv4sourcefilter \ +- getsourcefilter setsourcefilter inet6_opt inet6_rth ++ getsourcefilter setsourcefilter ++routines-$(OPTION_EGLIBC_RCMD) \ ++ += rcmd rexec ruserpass ++routines-$(OPTION_EGLIBC_DB_ALIASES) \ ++ += getaliasent_r getaliasent getaliasname getaliasname_r ++routines-$(OPTION_EGLIBC_ADVANCED_INET6) \ ++ += inet6_option inet6_opt inet6_rth + +-aux := check_pf check_native ifreq ++aux-$(OPTION_EGLIBC_INET) += check_pf check_native ifreq + + tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \ +- tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \ ++ tst-gethnm test-ifaddrs bug-if1 tst-ether_line \ + tst-getni1 tst-getni2 tst-inet6_rth tst-checks ++tests-$(OPTION_EGLIBC_ADVANCED_INET6) += test-inet6_opt + + include ../Rules + +Index: git/intl/dcigettext.c +=================================================================== +--- git.orig/intl/dcigettext.c 2014-08-29 20:00:47.224070587 -0700 ++++ git/intl/dcigettext.c 2014-08-29 20:01:15.200070587 -0700 +@@ -77,6 +77,10 @@ + #endif + #include "hash-string.h" + ++#ifdef _LIBC ++# include ++#endif ++ + /* Thread safetyness. */ + #ifdef _LIBC + # include +@@ -449,9 +453,11 @@ + #endif + + #ifdef _LIBC ++#if __OPTION_EGLIBC_LOCALE_CODE + __libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden) + __libc_rwlock_rdlock (__libc_setlocale_lock); + #endif ++#endif + + __libc_rwlock_rdlock (_nl_state_lock); + +@@ -470,7 +476,11 @@ + search.category = category; + # ifdef HAVE_PER_THREAD_LOCALE + # ifdef _LIBC ++# if __OPTION_EGLIBC_LOCALE_CODE + localename = strdupa (__current_locale_name (category)); ++# else ++ localename = "C"; ++# endif + # endif + search.localename = localename; + # endif +@@ -494,7 +504,9 @@ + retval = (char *) (*foundp)->translation; + + # ifdef _LIBC ++#if __OPTION_EGLIBC_LOCALE_CODE + __libc_rwlock_unlock (__libc_setlocale_lock); ++#endif + # endif + __libc_rwlock_unlock (_nl_state_lock); + return retval; +@@ -611,7 +623,9 @@ + { + no_translation: + FREE_BLOCKS (block_list); ++#if __OPTION_EGLIBC_LOCALE_CODE + __libc_rwlock_unlock (__libc_setlocale_lock); ++#endif + __libc_rwlock_unlock (_nl_state_lock); + __set_errno (saved_errno); + return (plural == 0 +@@ -730,7 +744,9 @@ + if (plural) + retval = plural_lookup (domain, n, retval, retlen); + ++#if __OPTION_EGLIBC_LOCALE_CODE + __libc_rwlock_unlock (__libc_setlocale_lock); ++#endif + __libc_rwlock_unlock (_nl_state_lock); + return retval; + } +@@ -1361,7 +1377,11 @@ + `LC_xxx', and `LANG'. On some systems this can be done by the + `setlocale' function itself. */ + #ifdef _LIBC ++# if __OPTION_EGLIBC_LOCALE_CODE + retval = __current_locale_name (category); ++# else ++ retval = "C"; ++# endif + #else + retval = _nl_locale_name (category, categoryname); + #endif +Index: git/intl/Makefile +=================================================================== +--- git.orig/intl/Makefile 2014-08-29 20:00:47.220070587 -0700 ++++ git/intl/Makefile 2014-08-29 20:01:15.200070587 -0700 +@@ -16,6 +16,7 @@ + # . + + # Makefile for intl subdirectory: message handling code from GNU gettext. ++include ../option-groups.mak + + subdir = intl + +@@ -48,7 +49,7 @@ + $(objpfx)plural.o: plural.c + + ifeq ($(run-built-tests),yes) +-ifeq (yes,$(build-shared)) ++ifeq (yyyes,$(OPTION_EGLIBC_LOCALES)$(OPTION_EGLIBC_LOCALE_CODE)$(build-shared)) + ifneq ($(strip $(MSGFMT)),:) + tests-special += $(objpfx)tst-translit.out $(objpfx)tst-gettext.out \ + $(objpfx)tst-gettext2.out $(objpfx)tst-codeset.out \ +Index: git/io/Makefile +=================================================================== +--- git.orig/io/Makefile 2014-08-29 20:00:47.244070587 -0700 ++++ git/io/Makefile 2014-08-29 20:01:15.200070587 -0700 +@@ -18,6 +18,8 @@ + # + # Sub-makefile for I/O portion of the library. + # ++include ../option-groups.mak ++ + subdir := io + + include ../Makeconfig +@@ -36,7 +38,7 @@ + fxstatat fxstatat64 \ + statfs fstatfs statfs64 fstatfs64 \ + statvfs fstatvfs statvfs64 fstatvfs64 \ +- umask chmod fchmod lchmod fchmodat \ ++ umask chmod fchmod fchmodat \ + mkdir mkdirat \ + open open_2 open64 open64_2 openat openat_2 openat64 openat64_2 \ + read write lseek lseek64 access euidaccess faccessat \ +@@ -49,11 +51,13 @@ + ttyname ttyname_r isatty \ + link linkat symlink symlinkat readlink readlinkat \ + unlink unlinkat rmdir \ +- ftw ftw64 fts poll ppoll \ ++ poll ppoll \ + posix_fadvise posix_fadvise64 \ + posix_fallocate posix_fallocate64 \ + sendfile sendfile64 \ + utimensat futimens ++routines-$(OPTION_EGLIBC_BSD) += lchmod ++routines-$(OPTION_EGLIBC_FTRAVERSE) += ftw ftw64 fts + + aux := have_o_cloexec + +@@ -64,18 +68,22 @@ + fstatat fstatat64 mknod mknodat + + others := pwd +-test-srcs := ftwtest ++test-srcs-$(OPTION_EGLIBC_FTRAVERSE) := ftwtest + tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ +- tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 tst-statvfs \ ++ tst-fcntl tst-statvfs \ + tst-openat tst-unlinkat tst-fstatat tst-futimesat \ + tst-renameat tst-fchownat tst-fchmodat tst-faccessat \ + tst-symlinkat tst-linkat tst-readlinkat tst-mkdirat \ +- tst-mknodat tst-mkfifoat tst-ttyname_r bug-ftw5 \ ++ tst-mknodat tst-mkfifoat tst-ttyname_r \ + tst-posix_fallocate ++tests-$(OPTION_EGLIBC_FTRAVERSE) += bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 \ ++ bug-ftw5 + + ifeq ($(run-built-tests),yes) ++ifeq (y,$(OPTION_EGLIBC_FTRAVERSE)) + tests-special += $(objpfx)ftwtest.out + endif ++endif + + include ../Rules + +Index: git/libidn/Makefile +=================================================================== +--- git.orig/libidn/Makefile 2014-08-29 20:00:47.316070587 -0700 ++++ git/libidn/Makefile 2014-08-29 20:01:15.200070587 -0700 +@@ -16,6 +16,7 @@ + # . + + # Makefile for libidn subdirectory of GNU C Library. ++include ../option-groups.mak + + subdir := libidn + +@@ -23,8 +24,8 @@ + + routines = idn-stub + +-extra-libs = libcidn +-extra-libs-others = $(extra-libs) ++extra-libs-$(OPTION_EGLIBC_IDN) = libcidn ++extra-libs-others-y = $(extra-libs-y) + + libcidn-routines := punycode toutf8 nfkc stringprep rfc3454 profiles idna \ + iconvme +Index: git/libidn/toutf8.c +=================================================================== +--- git.orig/libidn/toutf8.c 2014-08-29 20:00:47.332070587 -0700 ++++ git/libidn/toutf8.c 2014-08-29 20:01:15.200070587 -0700 +@@ -33,6 +33,11 @@ + /* Get strlen. */ + #include + ++/* Get __OPTION_EGLIBC_LOCALE_CODE. */ ++#ifdef _LIBC ++# include ++#endif ++ + /* Get iconv_string. */ + #include "iconvme.h" + +@@ -47,7 +52,11 @@ + #endif + + #ifdef _LIBC +-# define stringprep_locale_charset() nl_langinfo (CODESET) ++# if __OPTION_EGLIBC_LOCALE_CODE ++# define stringprep_locale_charset() nl_langinfo (CODESET) ++# else ++# define stringprep_locale_charset() "ANSI_X3.4-1968" ++# endif + #else + /** + * stringprep_locale_charset - return charset used in current locale +Index: git/libio/fileops.c +=================================================================== +--- git.orig/libio/fileops.c 2014-08-29 20:00:47.352070587 -0700 ++++ git/libio/fileops.c 2014-08-29 20:01:15.200070587 -0700 +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include + #if _LIBC + # include "../wcsmbs/wcsmbsload.h" +@@ -174,7 +175,7 @@ + + /* Free buffer. */ + #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T +- if (fp->_mode > 0) ++ if (_IO_is_wide (fp)) + { + if (_IO_have_wbackup (fp)) + _IO_free_wbackup_area (fp); +@@ -359,6 +360,7 @@ + cs = strstr (last_recognized + 1, ",ccs="); + if (cs != NULL) + { ++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + /* Yep. Load the appropriate conversions and set the orientation + to wide. */ + struct gconv_fcts fcts; +@@ -423,6 +425,12 @@ + + /* Set the mode now. */ + result->_mode = 1; ++#else ++ /* Treat this as if we couldn't find the given character set. */ ++ (void) _IO_file_close_it (fp); ++ __set_errno (EINVAL); ++ return NULL; ++#endif + } + } + +Index: git/libio/__fpurge.c +=================================================================== +--- git.orig/libio/__fpurge.c 2014-08-29 20:00:47.336070587 -0700 ++++ git/libio/__fpurge.c 2014-08-29 20:01:15.200070587 -0700 +@@ -21,7 +21,7 @@ + void + __fpurge (FILE *fp) + { +- if (fp->_mode > 0) ++ if (_IO_is_wide (fp)) + { + /* Wide-char stream. */ + if (_IO_in_backup (fp)) +Index: git/libio/iofwide.c +=================================================================== +--- git.orig/libio/iofwide.c 2014-08-29 20:00:47.360070587 -0700 ++++ git/libio/iofwide.c 2014-08-29 20:01:15.200070587 -0700 +@@ -26,6 +26,7 @@ + + #include + #ifdef _LIBC ++# include + # include + # include + #endif +@@ -43,6 +44,8 @@ + #endif + + ++#if ! defined _LIBC || __OPTION_POSIX_C_LANG_WIDE_CHAR ++ + /* Prototypes of libio's codecvt functions. */ + static enum __codecvt_result do_out (struct _IO_codecvt *codecvt, + __mbstate_t *statep, +@@ -513,3 +516,26 @@ + return MB_CUR_MAX; + #endif + } ++ ++#else ++/* OPTION_POSIX_C_LANG_WIDE_CHAR is disabled. */ ++ ++#undef _IO_fwide ++int ++_IO_fwide (fp, mode) ++ _IO_FILE *fp; ++ int mode; ++{ ++ /* Die helpfully if the user tries to create a wide stream; I ++ disbelieve that most users check the return value from ++ 'fwide (fp, 1)'. */ ++ assert (mode <= 0); ++ ++ /* We can only make streams byte-oriented, which is trivial. */ ++ if (mode < 0) ++ fp->_mode = -1; ++ ++ return fp->_mode; ++} ++ ++#endif +Index: git/libio/ioseekoff.c +=================================================================== +--- git.orig/libio/ioseekoff.c 2014-08-29 20:00:47.364070587 -0700 ++++ git/libio/ioseekoff.c 2014-08-29 20:01:15.200070587 -0700 +@@ -60,7 +60,7 @@ + else + abort (); + } +- if (_IO_fwide (fp, 0) < 0) ++ if (! _IO_is_wide (fp)) + _IO_free_backup_area (fp); + else + _IO_free_wbackup_area (fp); +Index: git/libio/ioseekpos.c +=================================================================== +--- git.orig/libio/ioseekpos.c 2014-08-29 20:00:47.364070587 -0700 ++++ git/libio/ioseekpos.c 2014-08-29 20:01:15.200070587 -0700 +@@ -35,7 +35,7 @@ + /* If we have a backup buffer, get rid of it, since the __seekoff + callback may not know to do the right thing about it. + This may be over-kill, but it'll do for now. TODO */ +- if (_IO_fwide (fp, 0) <= 0) ++ if (! _IO_is_wide (fp)) + { + if (_IO_have_backup (fp)) + _IO_free_backup_area (fp); +Index: git/libio/iosetbuffer.c +=================================================================== +--- git.orig/libio/iosetbuffer.c 2014-08-29 20:00:47.364070587 -0700 ++++ git/libio/iosetbuffer.c 2014-08-29 20:01:15.204070587 -0700 +@@ -24,6 +24,8 @@ + This exception applies to code released by its copyright holders + in files containing the exception. */ + ++#include ++ + #include "libioP.h" + + void +@@ -38,9 +40,11 @@ + if (!buf) + size = 0; + (void) _IO_SETBUF (fp, buf, size); ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR + if (_IO_vtable_offset (fp) == 0 && fp->_mode == 0 && _IO_CHECK_WIDE (fp)) + /* We also have to set the buffer using the wide char function. */ + (void) _IO_WSETBUF (fp, buf, size); ++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */ + _IO_release_lock (fp); + } + libc_hidden_def (_IO_setbuffer) +Index: git/libio/libioP.h +=================================================================== +--- git.orig/libio/libioP.h 2014-08-29 20:00:47.372070587 -0700 ++++ git/libio/libioP.h 2014-08-29 20:01:15.204070587 -0700 +@@ -42,6 +42,10 @@ + /*# include */ + #endif + ++#if defined _LIBC ++# include ++#endif ++ + #include + + #include "iolibio.h" +@@ -508,8 +512,20 @@ + + + #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T ++ ++/* _IO_is_wide (fp) is roughly equivalent to '_IO_fwide (fp, 0) > 0', ++ except that when OPTION_POSIX_C_LANG_WIDE_CHAR is disabled, it ++ expands to a constant, allowing the compiler to realize that it can ++ eliminate code that references wide stream handling functions. ++ This, in turn, allows us to omit them. */ ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR ++# define _IO_is_wide(_f) ((_f)->_mode > 0) ++#else ++# define _IO_is_wide(_f) (0) ++#endif ++ + # define _IO_do_flush(_f) \ +- ((_f)->_mode <= 0 \ ++ (! _IO_is_wide (_f) \ + ? _IO_do_write(_f, (_f)->_IO_write_base, \ + (_f)->_IO_write_ptr-(_f)->_IO_write_base) \ + : _IO_wdo_write(_f, (_f)->_wide_data->_IO_write_base, \ +Index: git/libio/Makefile +=================================================================== +--- git.orig/libio/Makefile 2014-08-29 20:00:47.332070587 -0700 ++++ git/libio/Makefile 2014-08-29 20:01:15.204070587 -0700 +@@ -18,6 +18,8 @@ + # + # Specific makefile for libio. + # ++include ../option-groups.mak ++ + subdir := libio + + include ../Makeconfig +@@ -27,16 +29,13 @@ + + routines := \ + filedoalloc iofclose iofdopen iofflush iofgetpos iofgets iofopen \ +- iofopncook iofputs iofread iofsetpos ioftell wfiledoalloc \ ++ iofopncook iofputs iofread iofsetpos ioftell \ + iofwrite iogetdelim iogetline iogets iopadn iopopen ioputs \ + ioseekoff ioseekpos iosetbuffer iosetvbuf ioungetc \ + iovsprintf iovsscanf \ + iofgetpos64 iofopen64 iofsetpos64 \ +- fputwc fputwc_u getwc getwc_u getwchar getwchar_u iofgetws iofgetws_u \ +- iofputws iofputws_u iogetwline iowpadn ioungetwc putwc putwc_u \ +- putwchar putwchar_u putchar putchar_u fwprintf swprintf vwprintf \ +- wprintf wscanf fwscanf vwscanf vswprintf iovswscanf swscanf wgenops \ +- wstrops wfileops iofwide fwide wmemstream \ ++ putchar putchar_u \ ++ iofwide \ + \ + clearerr feof ferror fileno fputc freopen fseek getc getchar \ + memstream pclose putc putchar rewind setbuf setlinebuf vasprintf \ +@@ -47,25 +46,48 @@ + __fpurge __fpending __fsetlocking \ + \ + libc_fatal fmemopen +- +-tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \ +- tst_wprintf2 tst-widetext test-fmemopen tst-ext tst-ext2 \ +- tst-fgetws tst-ungetwc1 tst-ungetwc2 tst-swscanf tst-sscanf \ +- tst-mmap-setvbuf bug-ungetwc1 bug-ungetwc2 tst-atime tst-eof \ +- tst-freopen bug-rewind bug-rewind2 bug-ungetc bug-fseek \ +- tst-mmap-eofsync tst-mmap-fflushsync bug-mmap-fflush \ +- tst-mmap2-eofsync tst-mmap-offend bug-fopena+ bug-wfflush \ +- bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 tst-fopenloc2 \ +- tst-memstream1 tst-memstream2 \ +- tst-wmemstream1 tst-wmemstream2 \ +- bug-memstream1 bug-wmemstream1 \ +- tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \ +- tst-fwrite-error tst-ftell-partial-wide tst-ftell-active-handler \ +- tst-ftell-append ++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) += \ ++ wfiledoalloc \ ++ iowpadn \ ++ swprintf \ ++ vswprintf iovswscanf swscanf wgenops \ ++ wstrops wfileops wmemstream ++routines-$(call option-disabled, OPTION_POSIX_C_LANG_WIDE_CHAR) += \ ++ wdummyfileops ++routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) += \ ++ fputwc fputwc_u getwc getwc_u getwchar getwchar_u iofgetws iofgetws_u \ ++ iofputws iofputws_u iogetwline ioungetwc putwc putwc_u \ ++ putwchar putwchar_u fwprintf vwprintf \ ++ wprintf wscanf fwscanf vwscanf \ ++ fwide ++ ++tests = test-fmemopen tst-ext tst-ext2 \ ++ tst-mmap-setvbuf tst-atime tst-eof \ ++ tst-freopen bug-ungetc bug-fseek \ ++ tst-mmap-eofsync tst-mmap-fflushsync bug-mmap-fflush \ ++ tst-mmap2-eofsync tst-mmap-offend bug-fopena+ \ ++ bug-ungetc2 bug-ungetc3 bug-ungetc4 \ ++ tst-memstream1 tst-memstream2 \ ++ bug-memstream1 tst-popen1 tst-fwrite-error \ ++ tst-ftell-active-handler tst-ftell-append ++tests-$(OPTION_EGLIBC_LOCALE_CODE) \ ++ += tst-swscanf tst-fgetws tst-setvbuf1 \ ++ tst-ungetwc1 tst-ungetwc2 bug-ftell bug-ungetwc2 \ ++ tst-widetext ++tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \ ++ += bug-rewind bug-rewind2 bug-ungetwc1 \ ++ bug-wfflush bug-wmemstream1 tst-fopenloc2 \ ++ tst_getwc \ ++ tst_putwc tst_wprintf tst_wprintf2 tst_wscanf \ ++ tst-fgetwc bug-wsetpos tst-fseek tst-ftell-partial-wide ++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \ ++ += tst_swprintf tst_swscanf \ ++ tst-sscanf \ ++ tst-wmemstream1 tst-wmemstream2 + ifeq (yes,$(build-shared)) + # Add test-fopenloc only if shared library is enabled since it depends on + # shared localedata objects. +-tests += tst-fopenloc ++tests-$(OPTION_EGLIBC_LOCALE_CODE) += tst-fopenloc + endif + test-srcs = test-freopen + +@@ -164,13 +186,17 @@ + oldiofsetpos64 + + ifeq ($(run-built-tests),yes) ++ifeq (y,$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO)) + tests-special += $(objpfx)test-freopen.out ++endif ++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE)) + ifeq (yes,$(build-shared)) + # Run tst-fopenloc-cmp.out and tst-openloc-mem.out only if shared + # library is enabled since they depend on tst-fopenloc.out. + tests-special += $(objpfx)tst-fopenloc-cmp.out $(objpfx)tst-fopenloc-mem.out + endif + endif ++endif + + include ../Rules + +Index: git/libio/wdummyfileops.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/libio/wdummyfileops.c 2014-08-29 20:01:15.204070587 -0700 +@@ -0,0 +1,161 @@ ++/* Copyright (C) 2007 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. ++ ++ As a special exception, if you link the code in this file with ++ files compiled with a GNU compiler to produce an executable, ++ that does not cause the resulting executable to be covered by ++ the GNU Lesser General Public License. This exception does not ++ however invalidate any other reasons why the executable file ++ might be covered by the GNU Lesser General Public License. ++ This exception applies to code released by its copyright holders ++ in files containing the exception. */ ++ ++#include ++#include ++#include ++#include ++ ++static void __THROW __attribute__ ((__noreturn__)) ++_IO_wfile_wide_char_support_disabled (void) ++{ ++ static const char errstr[] ++ = ("The application tried to use wide character I/O, but libc.so" ++ " was compiled\n" ++ "with the OPTION_POSIX_C_LANG_WIDE_CHAR option group disabled.\n"); ++ __libc_write (STDERR_FILENO, errstr, sizeof (errstr) - 1); ++ abort (); ++} ++ ++static void ++_IO_wfile_disabled_void_int (_IO_FILE *fp, int x) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static int ++_IO_wfile_disabled_int_int (_IO_FILE *fp, int x) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static int ++_IO_wfile_disabled_int_none (_IO_FILE *fp) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static _IO_size_t ++_IO_wfile_disabled_xsputn (_IO_FILE *fp, const void *data, _IO_size_t n) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static _IO_size_t ++_IO_wfile_disabled_xsgetn (_IO_FILE *fp, void *data, _IO_size_t n) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static _IO_off64_t ++_IO_wfile_disabled_seekoff (_IO_FILE *fp, _IO_off64_t off, int dir, int mode) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static _IO_off64_t ++_IO_wfile_disabled_seekpos (_IO_FILE *fp, _IO_off64_t pos, int flags) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static _IO_FILE * ++_IO_wfile_disabled_setbuf (_IO_FILE *fp, char *buffer, _IO_ssize_t length) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static _IO_ssize_t ++_IO_wfile_disabled_read (_IO_FILE *fp, void *buffer, _IO_ssize_t length) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static _IO_ssize_t ++_IO_wfile_disabled_write (_IO_FILE *fp, const void *buffer, _IO_ssize_t length) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static _IO_off64_t ++_IO_wfile_disabled_seek (_IO_FILE *fp, _IO_off64_t offset, int mode) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static int ++_IO_wfile_disabled_close (_IO_FILE *fp) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static int ++_IO_wfile_disabled_stat (_IO_FILE *fp, void *buf) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static int ++_IO_wfile_disabled_showmanyc (_IO_FILE *fp) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static void ++_IO_wfile_disabled_imbue (_IO_FILE *fp, void *locale) ++{ ++ _IO_wfile_wide_char_support_disabled (); ++} ++ ++static const struct _IO_jump_t _IO_wfile_jumps_disabled = ++{ ++ JUMP_INIT_DUMMY, ++ JUMP_INIT(finish, _IO_wfile_disabled_void_int), ++ JUMP_INIT(overflow, _IO_wfile_disabled_int_int), ++ JUMP_INIT(underflow, _IO_wfile_disabled_int_none), ++ JUMP_INIT(uflow, _IO_wfile_disabled_int_none), ++ JUMP_INIT(pbackfail, _IO_wfile_disabled_int_int), ++ JUMP_INIT(xsputn, _IO_wfile_disabled_xsputn), ++ JUMP_INIT(xsgetn, _IO_wfile_disabled_xsgetn), ++ JUMP_INIT(seekoff, _IO_wfile_disabled_seekoff), ++ JUMP_INIT(seekpos, _IO_wfile_disabled_seekpos), ++ JUMP_INIT(setbuf, _IO_wfile_disabled_setbuf), ++ JUMP_INIT(sync, _IO_wfile_disabled_int_none), ++ JUMP_INIT(doallocate, _IO_wfile_disabled_int_none), ++ JUMP_INIT(read, _IO_wfile_disabled_read), ++ JUMP_INIT(write, _IO_wfile_disabled_write), ++ JUMP_INIT(seek, _IO_wfile_disabled_seek), ++ JUMP_INIT(close, _IO_wfile_disabled_close), ++ JUMP_INIT(stat, _IO_wfile_disabled_stat), ++ JUMP_INIT(showmanyc, _IO_wfile_disabled_showmanyc), ++ JUMP_INIT(imbue, _IO_wfile_disabled_imbue) ++}; ++ ++strong_alias (_IO_wfile_jumps_disabled, _IO_wfile_jumps) ++libc_hidden_data_def (_IO_wfile_jumps) ++strong_alias (_IO_wfile_jumps_disabled, _IO_wfile_jumps_mmap) ++strong_alias (_IO_wfile_jumps_disabled, _IO_wfile_jumps_maybe_mmap) +Index: git/locale/catnames.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/locale/catnames.c 2014-08-29 20:01:15.204070587 -0700 +@@ -0,0 +1,48 @@ ++/* Copyright (C) 2006 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include "localeinfo.h" ++ ++/* Define an array of category names (also the environment variable names). */ ++const union catnamestr_t _nl_category_names attribute_hidden = ++ { ++ { ++#define DEFINE_CATEGORY(category, category_name, items, a) \ ++ category_name, ++#include "categories.def" ++#undef DEFINE_CATEGORY ++ } ++ }; ++ ++const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden = ++ { ++#define DEFINE_CATEGORY(category, category_name, items, a) \ ++ [category] = offsetof (union catnamestr_t, CATNAMEMF (__LINE__)), ++#include "categories.def" ++#undef DEFINE_CATEGORY ++ }; ++ ++/* An array of their lengths, for convenience. */ ++const uint8_t _nl_category_name_sizes[] attribute_hidden = ++ { ++#define DEFINE_CATEGORY(category, category_name, items, a) \ ++ [category] = sizeof (category_name) - 1, ++#include "categories.def" ++#undef DEFINE_CATEGORY ++ [LC_ALL] = sizeof ("LC_ALL") - 1 ++ }; +Index: git/locale/C-ctype.c +=================================================================== +--- git.orig/locale/C-ctype.c 2014-08-29 20:00:47.396070587 -0700 ++++ git/locale/C-ctype.c 2014-08-29 20:01:15.204070587 -0700 +@@ -19,8 +19,11 @@ + #include "localeinfo.h" + #include + #include ++#include + ++#if __OPTION_EGLIBC_LOCALE_CODE + #include "C-translit.h" ++#endif + + /* This table's entries are taken from POSIX.2 Table 2-6 + ``LC_CTYPE Category Definition in the POSIX Locale''. +@@ -647,6 +650,7 @@ + { .word = L'7' }, + { .word = L'8' }, + { .word = L'9' }, ++#if __OPTION_EGLIBC_LOCALE_CODE + /* _NL_CTYPE_TRANSLIT_TAB_SIZE */ + { .word = NTRANSLIT }, + /* _NL_CTYPE_TRANSLIT_FROM_IDX */ +@@ -657,6 +661,22 @@ + { .wstr = translit_to_idx }, + /* _NL_CTYPE_TRANSLIT_TO_TBL */ + { .wstr = (uint32_t *) translit_to_tbl }, ++#else ++ /* If the locale code isn't enabled, we don't have the ++ transliteration code in iconv/gconv_trans.c anyway, so there's ++ no need for the transliteration tables here. We'll fall back ++ on the default missing replacement, '?'. */ ++ /* _NL_CTYPE_TRANSLIT_TAB_SIZE */ ++ { .word = 0 }, ++ /* _NL_CTYPE_TRANSLIT_FROM_IDX */ ++ { .wstr = NULL }, ++ /* _NL_CTYPE_TRANSLIT_FROM_TBL */ ++ { .wstr = NULL }, ++ /* _NL_CTYPE_TRANSLIT_TO_IDX */ ++ { .wstr = NULL }, ++ /* _NL_CTYPE_TRANSLIT_TO_TBL */ ++ { .wstr = NULL }, ++#endif + /* _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN */ + { .word = 1 }, + /* _NL_CTYPE_TRANSLIT_DEFAULT_MISSING */ +Index: git/locale/dummy-setlocale.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/locale/dummy-setlocale.c 2014-08-29 20:01:15.204070587 -0700 +@@ -0,0 +1,33 @@ ++/* Copyright (C) 2006 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++char * ++setlocale (int category, const char *locale) ++{ ++ if (! locale ++ || locale[0] == '\0' ++ || strcmp (locale, "C") == 0 ++ || strcmp (locale, "POSIX") == 0) ++ return (char *) "C"; ++ else ++ return NULL; ++} ++libc_hidden_def (setlocale) +Index: git/locale/localeinfo.h +=================================================================== +--- git.orig/locale/localeinfo.h 2014-08-29 20:00:47.404070587 -0700 ++++ git/locale/localeinfo.h 2014-08-29 20:01:15.204070587 -0700 +@@ -224,7 +224,7 @@ + unused. We can manage this playing some tricks with weak references. + But with thread-local locale settings, it becomes quite ungainly unless + we can use __thread variables. So only in that case do we attempt this. */ +-#ifndef SHARED ++#if !defined SHARED && !defined IN_GLIBC_LOCALEDEF + # include + # define NL_CURRENT_INDIRECT 1 + #endif +Index: git/locale/Makefile +=================================================================== +--- git.orig/locale/Makefile 2014-08-29 20:00:47.400070587 -0700 ++++ git/locale/Makefile 2014-08-29 20:01:15.204070587 -0700 +@@ -18,27 +18,43 @@ + # + # Makefile for locales. + # ++include ../option-groups.mak ++ + subdir := locale + + include ../Makeconfig + + headers = locale.h bits/locale.h langinfo.h xlocale.h +-routines = setlocale findlocale loadlocale loadarchive \ +- localeconv nl_langinfo nl_langinfo_l mb_cur_max \ +- newlocale duplocale freelocale uselocale +-tests = tst-C-locale tst-locname tst-duplocale ++# catnames is needed by OPTION_EGLIBC_LOCALE_CODE and by the 'intl' code. ++# If we put the latter in an option group, too, we can omit catnames ++# when both option groups are disabled. libstdc++-v3 needs mb_cur_max. ++routines-y := catnames mb_cur_max ++routines-$(OPTION_EGLIBC_LOCALE_CODE) \ ++ += setlocale findlocale loadlocale loadarchive \ ++ localeconv nl_langinfo nl_langinfo_l \ ++ newlocale duplocale freelocale uselocale ++ifneq (y,$(OPTION_EGLIBC_LOCALE_CODE)) ++routines-y += dummy-setlocale ++endif ++tests-$(OPTION_EGLIBC_LOCALE_CODE) += tst-C-locale tst-locname tst-duplocale + categories = ctype messages monetary numeric time paper name \ + address telephone measurement identification collate +-aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \ +- xlocale localename global-locale coll-lookup +-others = localedef locale ++# C-messages belongs in an intl option group. ++aux-y := C-ctype C-time \ ++ SYS_libc C_name xlocale global-locale coll-lookup ++aux-$(OPTION_EGLIBC_LOCALE_CODE) \ ++ += $(filter-out $(aux-y), \ ++ $(categories:%=lc-%) $(categories:%=C-%)) \ ++ localename ++others-$(OPTION_EGLIBC_LOCALE_CODE) = localedef locale + #others-static = localedef locale +-install-bin = localedef locale +-extra-objs = $(localedef-modules:=.o) $(localedef-aux:=.o) \ ++install-bin = $(others-y) ++extra-objs-$(OPTION_EGLIBC_LOCALE_CODE) \ ++ = $(localedef-modules:=.o) $(localedef-aux:=.o) \ + $(locale-modules:=.o) $(lib-modules:=.o) + +-extra-libs = libBrokenLocale +-extra-libs-others = $(extra-libs) ++extra-libs-$(OPTION_EGLIBC_LOCALE_CODE) = libBrokenLocale ++extra-libs-others = $(extra-libs-y) + + libBrokenLocale-routines = broken_cur_max + +@@ -94,6 +110,9 @@ + CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts + CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts + CFLAGS-charmap-dir.c = -Wno-write-strings ++ifneq (y,$(OPTION_EGLIBC_SPAWN)) ++CFLAGS-charmap-dir.c += -DNO_UNCOMPRESS ++endif + + # This makes sure -DNOT_IN_libc et al are passed for all these modules. + cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \ +Index: git/locale/programs/charmap-dir.c +=================================================================== +--- git.orig/locale/programs/charmap-dir.c 2014-08-29 20:00:47.408070587 -0700 ++++ git/locale/programs/charmap-dir.c 2014-08-29 20:01:15.204070587 -0700 +@@ -19,7 +19,9 @@ + #include + #include + #include ++#ifndef NO_UNCOMPRESS + #include ++#endif + #include + #include + #include +@@ -156,6 +158,7 @@ + return closedir (dir); + } + ++#ifndef NO_UNCOMPRESS + /* Creates a subprocess decompressing the given pathname, and returns + a stream reading its output (the decompressed data). */ + static +@@ -204,6 +207,7 @@ + } + return NULL; + } ++#endif + + /* Opens a charmap for reading, given its name (not an alias name). */ + FILE * +@@ -226,6 +230,7 @@ + if (stream != NULL) + return stream; + ++#ifndef NO_UNCOMPRESS + memcpy (p, ".gz", 4); + stream = fopen_uncompressed (pathname, "gzip"); + if (stream != NULL) +@@ -235,6 +240,7 @@ + stream = fopen_uncompressed (pathname, "bzip2"); + if (stream != NULL) + return stream; ++#endif + + return NULL; + } +@@ -263,8 +269,8 @@ + char *alias = NULL; + char junk[BUFSIZ]; + +- if (fscanf (stream, " %ms", &alias) == 1 +- || fscanf (stream, "%% alias %ms", &alias) == 1) ++ if (fscanf (stream, " %as", &alias) == 1 ++ || fscanf (stream, "%% alias %as", &alias) == 1) + { + aliases = (char **) xrealloc (aliases, + (naliases + 2) * sizeof (char *)); +Index: git/locale/programs/ld-collate.c +=================================================================== +--- git.orig/locale/programs/ld-collate.c 2014-08-29 20:00:47.408070587 -0700 ++++ git/locale/programs/ld-collate.c 2014-08-29 20:01:15.208070587 -0700 +@@ -350,7 +350,7 @@ + } + if (wcs != NULL) + { +- size_t nwcs = wcslen ((wchar_t *) wcs); ++ size_t nwcs = wcslen_uint32 (wcs); + uint32_t zero = 0; + /* Handle as a single character. */ + if (nwcs == 0) +@@ -1776,8 +1776,7 @@ + + if ((*eptr)->nwcs == runp->nwcs) + { +- int c = wmemcmp ((wchar_t *) (*eptr)->wcs, +- (wchar_t *) runp->wcs, runp->nwcs); ++ int c = wmemcmp_uint32 ((*eptr)->wcs, runp->wcs, runp->nwcs); + + if (c == 0) + { +@@ -2010,9 +2009,9 @@ + one consecutive entry. */ + if (runp->wcnext != NULL + && runp->nwcs == runp->wcnext->nwcs +- && wmemcmp ((wchar_t *) runp->wcs, +- (wchar_t *)runp->wcnext->wcs, +- runp->nwcs - 1) == 0 ++ && wmemcmp_uint32 (runp->wcs, ++ runp->wcnext->wcs, ++ runp->nwcs - 1) == 0 + && (runp->wcs[runp->nwcs - 1] + == runp->wcnext->wcs[runp->nwcs - 1] + 1)) + { +@@ -2036,9 +2035,9 @@ + runp = runp->wcnext; + while (runp->wcnext != NULL + && runp->nwcs == runp->wcnext->nwcs +- && wmemcmp ((wchar_t *) runp->wcs, +- (wchar_t *)runp->wcnext->wcs, +- runp->nwcs - 1) == 0 ++ && wmemcmp_uint32 (runp->wcs, ++ runp->wcnext->wcs, ++ runp->nwcs - 1) == 0 + && (runp->wcs[runp->nwcs - 1] + == runp->wcnext->wcs[runp->nwcs - 1] + 1)); + +Index: git/locale/programs/ld-ctype.c +=================================================================== +--- git.orig/locale/programs/ld-ctype.c 2014-08-29 20:00:47.408070587 -0700 ++++ git/locale/programs/ld-ctype.c 2014-08-29 20:01:15.208070587 -0700 +@@ -957,7 +957,7 @@ + allocate_arrays (ctype, charmap, ctype->repertoire); + + default_missing_len = (ctype->default_missing +- ? wcslen ((wchar_t *) ctype->default_missing) ++ ? wcslen_uint32 (ctype->default_missing) + : 0); + + init_locale_data (&file, nelems); +@@ -1968,7 +1968,7 @@ + ignore = 1; + else + /* This value is usable. */ +- obstack_grow (ob, to_wstr, wcslen ((wchar_t *) to_wstr) * 4); ++ obstack_grow (ob, to_wstr, wcslen_uint32 (to_wstr) * 4); + + first = 0; + } +@@ -2516,8 +2516,8 @@ + } + + handle_tok_digit: +- class_bit = _ISwdigit; +- class256_bit = _ISdigit; ++ class_bit = BITw (tok_digit); ++ class256_bit = BIT (tok_digit); + handle_digits = 1; + goto read_charclass; + +@@ -4001,8 +4001,7 @@ + + while (idx < number) + { +- int res = wcscmp ((const wchar_t *) sorted[idx]->from, +- (const wchar_t *) runp->from); ++ int res = wcscmp_uint32 (sorted[idx]->from, runp->from); + if (res == 0) + { + replace = 1; +@@ -4039,11 +4038,11 @@ + for (cnt = 0; cnt < number; ++cnt) + { + struct translit_to_t *srunp; +- from_len += wcslen ((const wchar_t *) sorted[cnt]->from) + 1; ++ from_len += wcslen_uint32 (sorted[cnt]->from) + 1; + srunp = sorted[cnt]->to; + while (srunp != NULL) + { +- to_len += wcslen ((const wchar_t *) srunp->str) + 1; ++ to_len += wcslen_uint32 (srunp->str) + 1; + srunp = srunp->next; + } + /* Plus one for the extra NUL character marking the end of +@@ -4067,18 +4066,18 @@ + ctype->translit_from_idx[cnt] = from_len; + ctype->translit_to_idx[cnt] = to_len; + +- len = wcslen ((const wchar_t *) sorted[cnt]->from) + 1; +- wmemcpy ((wchar_t *) &ctype->translit_from_tbl[from_len], +- (const wchar_t *) sorted[cnt]->from, len); ++ len = wcslen_uint32 (sorted[cnt]->from) + 1; ++ wmemcpy_uint32 (&ctype->translit_from_tbl[from_len], ++ sorted[cnt]->from, len); + from_len += len; + + ctype->translit_to_idx[cnt] = to_len; + srunp = sorted[cnt]->to; + while (srunp != NULL) + { +- len = wcslen ((const wchar_t *) srunp->str) + 1; +- wmemcpy ((wchar_t *) &ctype->translit_to_tbl[to_len], +- (const wchar_t *) srunp->str, len); ++ len = wcslen_uint32 (srunp->str) + 1; ++ wmemcpy_uint32 (&ctype->translit_to_tbl[to_len], ++ srunp->str, len); + to_len += len; + srunp = srunp->next; + } +Index: git/locale/programs/ld-messages.c +=================================================================== +--- git.orig/locale/programs/ld-messages.c 2014-08-29 20:00:47.412070587 -0700 ++++ git/locale/programs/ld-messages.c 2014-08-29 20:01:15.208070587 -0700 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include + +@@ -124,6 +125,7 @@ + } + else + { ++#if __OPTION_POSIX_REGEXP + int result; + regex_t re; + +@@ -140,6 +142,7 @@ + } + else if (result != 0) + regfree (&re); ++#endif + } + + if (messages->noexpr == NULL) +@@ -158,6 +161,7 @@ + } + else + { ++#if __OPTION_POSIX_REGEXP + int result; + regex_t re; + +@@ -174,6 +178,7 @@ + } + else if (result != 0) + regfree (&re); ++#endif + } + } + +Index: git/locale/programs/ld-time.c +=================================================================== +--- git.orig/locale/programs/ld-time.c 2014-08-29 20:00:47.412070587 -0700 ++++ git/locale/programs/ld-time.c 2014-08-29 20:01:15.208070587 -0700 +@@ -215,8 +215,10 @@ + } + else + { ++ static const uint32_t wt_fmt_ampm[] ++ = { '%','I',':','%','M',':','%','S',' ','%','p',0 }; + time->t_fmt_ampm = "%I:%M:%S %p"; +- time->wt_fmt_ampm = (const uint32_t *) L"%I:%M:%S %p"; ++ time->wt_fmt_ampm = wt_fmt_ampm; + } + } + +@@ -226,7 +228,7 @@ + const int days_per_month[12] = { 31, 29, 31, 30, 31, 30, + 31, 31, 30, 31 ,30, 31 }; + size_t idx; +- wchar_t *wstr; ++ uint32_t *wstr; + + time->era_entries = + (struct era_data *) xmalloc (time->num_era +@@ -464,18 +466,18 @@ + } + + /* Now generate the wide character name and format. */ +- wstr = wcschr ((wchar_t *) time->wera[idx], L':');/* end direction */ +- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end offset */ +- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end start */ +- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end end */ ++ wstr = wcschr_uint32 (time->wera[idx], L':'); /* end direction */ ++ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end offset */ ++ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end start */ ++ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end end */ + if (wstr != NULL) + { +- time->era_entries[idx].wname = (uint32_t *) wstr + 1; +- wstr = wcschr (wstr + 1, L':'); /* end name */ ++ time->era_entries[idx].wname = wstr + 1; ++ wstr = wcschr_uint32 (wstr + 1, L':'); /* end name */ + if (wstr != NULL) + { + *wstr = L'\0'; +- time->era_entries[idx].wformat = (uint32_t *) wstr + 1; ++ time->era_entries[idx].wformat = wstr + 1; + } + else + time->era_entries[idx].wname = +@@ -530,7 +532,16 @@ + if (time->date_fmt == NULL) + time->date_fmt = "%a %b %e %H:%M:%S %Z %Y"; + if (time->wdate_fmt == NULL) +- time->wdate_fmt = (const uint32_t *) L"%a %b %e %H:%M:%S %Z %Y"; ++ { ++ static const uint32_t wdate_fmt[] = ++ { '%','a',' ', ++ '%','b',' ', ++ '%','e',' ', ++ '%','H',':','%','M',':','%','S',' ', ++ '%','Z',' ', ++ '%','Y',0 }; ++ time->wdate_fmt = wdate_fmt; ++ } + } + + +Index: git/locale/programs/linereader.c +=================================================================== +--- git.orig/locale/programs/linereader.c 2014-08-29 20:00:47.412070587 -0700 ++++ git/locale/programs/linereader.c 2014-08-29 20:01:15.208070587 -0700 +@@ -595,7 +595,7 @@ + { + int return_widestr = lr->return_widestr; + char *buf; +- wchar_t *buf2 = NULL; ++ uint32_t *buf2 = NULL; + size_t bufact; + size_t bufmax = 56; + +Index: git/locale/programs/localedef.c +=================================================================== +--- git.orig/locale/programs/localedef.c 2014-08-29 20:00:47.416070587 -0700 ++++ git/locale/programs/localedef.c 2014-08-29 20:01:15.208070587 -0700 +@@ -114,6 +114,7 @@ + #define OPT_LIST_ARCHIVE 309 + #define OPT_LITTLE_ENDIAN 400 + #define OPT_BIG_ENDIAN 401 ++#define OPT_UINT32_ALIGN 402 + + /* Definitions of arguments for argp functions. */ + static const struct argp_option options[] = +@@ -150,6 +151,8 @@ + N_("Generate little-endian output") }, + { "big-endian", OPT_BIG_ENDIAN, NULL, 0, + N_("Generate big-endian output") }, ++ { "uint32-align", OPT_UINT32_ALIGN, "ALIGNMENT", 0, ++ N_("Set the target's uint32_t alignment in bytes (default 4)") }, + { NULL, 0, NULL, 0, NULL } + }; + +@@ -239,12 +242,14 @@ + ctype locale. (P1003.2 4.35.5.2) */ + setlocale (LC_CTYPE, "POSIX"); + ++#ifndef NO_SYSCONF + /* Look whether the system really allows locale definitions. POSIX + defines error code 3 for this situation so I think it must be + a fatal error (see P1003.2 4.35.8). */ + if (sysconf (_SC_2_LOCALEDEF) < 0) + WITH_CUR_LOCALE (error (3, 0, _("\ + FATAL: system does not define `_POSIX2_LOCALEDEF'"))); ++#endif + + /* Process charmap file. */ + charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1); +@@ -338,6 +343,9 @@ + case OPT_BIG_ENDIAN: + set_big_endian (true); + break; ++ case OPT_UINT32_ALIGN: ++ uint32_align_mask = strtol (arg, NULL, 0) - 1; ++ break; + case 'c': + force_output = 1; + break; +Index: git/locale/programs/locfile.c +=================================================================== +--- git.orig/locale/programs/locfile.c 2014-08-29 20:00:47.432070587 -0700 ++++ git/locale/programs/locfile.c 2014-08-29 20:01:15.208070587 -0700 +@@ -544,6 +544,9 @@ + machine running localedef. */ + bool swap_endianness_p; + ++/* The target's value of __align__(uint32_t) - 1. */ ++unsigned int uint32_align_mask = 3; ++ + /* When called outside a start_locale_structure/end_locale_structure + or start_locale_prelude/end_locale_prelude block, record that the + next byte in FILE's obstack will be the first byte of a new element. +@@ -621,7 +624,7 @@ + void + add_locale_wstring (struct locale_file *file, const uint32_t *string) + { +- add_locale_uint32_array (file, string, wcslen ((const wchar_t *) string) + 1); ++ add_locale_uint32_array (file, string, wcslen_uint32 (string) + 1); + } + + /* Record that FILE's next element is the 32-bit integer VALUE. */ +Index: git/locale/programs/locfile.h +=================================================================== +--- git.orig/locale/programs/locfile.h 2014-08-29 20:00:47.432070587 -0700 ++++ git/locale/programs/locfile.h 2014-08-29 20:01:15.208070587 -0700 +@@ -71,6 +71,8 @@ + + extern bool swap_endianness_p; + ++extern unsigned int uint32_align_mask; ++ + /* Change the output to be big-endian if BIG_ENDIAN is true and + little-endian otherwise. */ + static inline void +@@ -275,4 +277,49 @@ + const struct charmap_t *charmap, + const char *output_path); + ++static inline size_t ++wcslen_uint32 (const uint32_t *str) ++{ ++ size_t len = 0; ++ while (str[len] != 0) ++ len++; ++ return len; ++} ++ ++static inline int ++wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) ++{ ++ while (n-- != 0) ++ { ++ int diff = *s1++ - *s2++; ++ if (diff != 0) ++ return diff; ++ } ++ return 0; ++} ++ ++static inline int ++wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) ++{ ++ while (*s1 != 0 && *s1 == *s2) ++ s1++, s2++; ++ return *s1 - *s2; ++} ++ ++static inline uint32_t * ++wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) ++{ ++ return memcpy (s1, s2, n * sizeof (uint32_t)); ++} ++ ++static inline uint32_t * ++wcschr_uint32 (const uint32_t *s, uint32_t ch) ++{ ++ do ++ if (*s == ch) ++ return (uint32_t *) s; ++ while (*s++ != 0); ++ return 0; ++} ++ + #endif /* locfile.h */ +Index: git/locale/setlocale.c +=================================================================== +--- git.orig/locale/setlocale.c 2014-08-29 20:00:47.432070587 -0700 ++++ git/locale/setlocale.c 2014-08-29 20:01:15.208070587 -0700 +@@ -64,36 +64,6 @@ + #endif + + +-/* Define an array of category names (also the environment variable names). */ +-const union catnamestr_t _nl_category_names attribute_hidden = +- { +- { +-#define DEFINE_CATEGORY(category, category_name, items, a) \ +- category_name, +-#include "categories.def" +-#undef DEFINE_CATEGORY +- } +- }; +- +-const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden = +- { +-#define DEFINE_CATEGORY(category, category_name, items, a) \ +- [category] = offsetof (union catnamestr_t, CATNAMEMF (__LINE__)), +-#include "categories.def" +-#undef DEFINE_CATEGORY +- }; +- +-/* An array of their lengths, for convenience. */ +-const uint8_t _nl_category_name_sizes[] attribute_hidden = +- { +-#define DEFINE_CATEGORY(category, category_name, items, a) \ +- [category] = sizeof (category_name) - 1, +-#include "categories.def" +-#undef DEFINE_CATEGORY +- [LC_ALL] = sizeof ("LC_ALL") - 1 +- }; +- +- + #ifdef NL_CURRENT_INDIRECT + # define WEAK_POSTLOAD(postload) weak_extern (postload) + #else +Index: git/locale/xlocale.c +=================================================================== +--- git.orig/locale/xlocale.c 2014-08-29 20:00:47.436070587 -0700 ++++ git/locale/xlocale.c 2014-08-29 20:01:15.208070587 -0700 +@@ -18,6 +18,7 @@ + . */ + + #include ++#include + #include "localeinfo.h" + + #define DEFINE_CATEGORY(category, category_name, items, a) \ +@@ -25,6 +26,19 @@ + #include "categories.def" + #undef DEFINE_CATEGORY + ++/* If the locale support code isn't enabled, don't generate strong ++ reference to the C locale_data structures here; let the Makefile ++ decide which ones to include. (In the static linking case, the ++ strong reference to the 'class', 'toupper', and 'tolower' tables ++ will cause C-ctype.o to be brought in, as it should be, even when ++ the reference to _nl_C_LC_CTYPE will be weak.) */ ++#if ! __OPTION_EGLIBC_LOCALE_CODE ++# define DEFINE_CATEGORY(category, category_name, items, a) \ ++ weak_extern (_nl_C_##category) ++# include "categories.def" ++# undef DEFINE_CATEGORY ++#endif ++ + /* Defined in locale/C-ctype.c. */ + extern const char _nl_C_LC_CTYPE_class[] attribute_hidden; + extern const char _nl_C_LC_CTYPE_toupper[] attribute_hidden; +@@ -52,3 +66,26 @@ + .__ctype_tolower = (const int *) _nl_C_LC_CTYPE_tolower + 128, + .__ctype_toupper = (const int *) _nl_C_LC_CTYPE_toupper + 128 + }; ++ ++ ++#if ! __OPTION_EGLIBC_LOCALE_CODE ++/* When locale code is enabled, these are each defined in the ++ appropriate lc-CATEGORY.c file, so that static links (when __thread ++ is supported) bring in only those lc-CATEGORY.o files for ++ categories the program actually uses; look for NL_CURRENT_INDIRECT ++ in localeinfo.h. ++ ++ When locale code is disabled, the _nl_C_CATEGORY objects are the ++ only possible referents. At the moment, there isn't a way to get ++ __OPTION_EGLIBC_LOCALE_CODE defined in every compilation unit that ++ #includes localeinfo.h, so we can't just turn off ++ NL_CURRENT_INDIRECT. So we'll define the _nl_current_CATEGORY ++ pointers here. */ ++#if defined (NL_CURRENT_INDIRECT) ++#define DEFINE_CATEGORY(category, category_name, items, a) \ ++ __thread struct __locale_data * const *_nl_current_##category \ ++ attribute_hidden = &_nl_C_locobj.__locales[category]; ++#include "categories.def" ++#undef DEFINE_CATEGORY ++#endif ++#endif /* __OPTION_EGLIBC_LOCALE_CODE */ +Index: git/localedata/Makefile +=================================================================== +--- git.orig/localedata/Makefile 2014-08-29 20:00:47.444070587 -0700 ++++ git/localedata/Makefile 2014-08-29 20:01:15.212070587 -0700 +@@ -21,12 +21,22 @@ + + include ../Makeconfig + +-# List with all available character set descriptions. +-charmaps := $(wildcard charmaps/[A-I]*) $(wildcard charmaps/[J-Z]*) ++include ../option-groups.mak + + # List with all available character set descriptions. +-locales := $(wildcard locales/*) ++all-charmaps := $(wildcard charmaps/[A-I]*) $(wildcard charmaps/[J-Z]*) ++ ++all-locales := $(wildcard locales/*) + ++# If the EGLIBC_LOCALES option group is not enabled, trim the ++# list of charmap and locale source files. ++ifeq ($(OPTION_EGLIBC_LOCALES),y) ++charmaps := $(all-charmaps) ++locales := $(all-locales) ++else ++charmaps := ++locales := locales/POSIX ++endif + + subdir-dirs = tests-mbwc + vpath %.c tests-mbwc +@@ -71,14 +81,20 @@ + tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans \ + tst_wctype tst_wcwidth + +-tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \ ++# Since these tests build their own locale files, they're not ++# dependent on the OPTION_EGLIBC_LOCALES option group. But they do ++# need the locale functions to be present. ++tests-$(OPTION_EGLIBC_LOCALE_CODE) \ ++ += $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \ + tst-leaks tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \ + tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \ + tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3 \ + tst-wctype ++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE)) + tests-static = bug-setlocale1-static + tests += $(tests-static) +-ifeq (yes,$(build-shared)) ++endif ++ifeq (yesy,$(build-shared)$(OPTION_EGLIBC_LOCALE_CODE)) + ifneq (no,$(PERL)) + tests-special += $(objpfx)mtrace-tst-leaks.out + endif +@@ -92,12 +108,14 @@ + + tests: $(objdir)/iconvdata/gconv-modules + ++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE)) + tests-special += $(objpfx)sort-test.out $(objpfx)tst-fmon.out \ + $(objpfx)tst-locale.out $(objpfx)tst-rpmatch.out \ + $(objpfx)tst-trans.out $(objpfx)tst-ctype.out \ + $(objpfx)tst-langinfo.out $(objpfx)tst-langinfo-static.out \ + $(objpfx)tst-numeric.out + tests-static += tst-langinfo-static ++endif + + ifeq ($(run-built-tests),yes) + # We have to generate locales +@@ -143,9 +161,13 @@ + $(addprefix $(objpfx),$(CTYPE_FILES)): %: \ + gen-locale.sh $(common-objpfx)locale/localedef Makefile \ + $(addprefix charmaps/,$(CHARMAPS)) $(addprefix locales/,$(LOCALE_SRCS)) +- @$(SHELL) gen-locale.sh $(common-objpfx) \ +- '$(built-program-cmd-before-env)' '$(run-program-env)' \ +- '$(built-program-cmd-after-env)' $@; \ ++ @$(SHELL) gen-locale.sh $(common-objpfx) \ ++ '$(if $(cross-localedef), \ ++ $(cross-localedef), \ ++ $(built-program-cmd-before-env) \ ++ $(run-program-env) \ ++ $(built-program-cmd-after-env))' \ ++ $@; \ + $(evaluate-test) + + $(addsuffix .out,$(addprefix $(objpfx),$(tests))): %: \ +@@ -213,6 +235,11 @@ + + include SUPPORTED + ++# Only install locale data if OPTION_EGLIBC_LOCALES is selected. ++ifneq ($(OPTION_EGLIBC_LOCALES),y) ++SUPPORTED-LOCALES := ++endif ++ + INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES)) + + # Sometimes the whole collection of locale files should be installed. +Index: git/login/Makefile +=================================================================== +--- git.orig/login/Makefile 2014-08-29 20:00:47.736070587 -0700 ++++ git/login/Makefile 2014-08-29 20:01:15.212070587 -0700 +@@ -18,6 +18,7 @@ + # + # Sub-makefile for login portion of the library. + # ++include ../option-groups.mak + + subdir := login + +@@ -25,14 +26,16 @@ + + headers := utmp.h bits/utmp.h lastlog.h pty.h + +-routines := getlogin getlogin_r setlogin getlogin_r_chk \ +- getutent getutent_r getutid getutline getutid_r getutline_r \ +- utmp_file utmpname updwtmp getpt grantpt unlockpt ptsname \ +- ptsname_r_chk ++routines := getpt grantpt unlockpt ptsname ptsname_r_chk ++routines-$(OPTION_EGLIBC_UTMP) \ ++ += getutent getutent_r getutid getutline getutid_r getutline_r \ ++ utmp_file utmpname updwtmp ++routines-$(OPTION_EGLIBC_GETLOGIN) += getlogin getlogin_r getlogin_r_chk ++routines-$(OPTION_EGLIBC_BSD) += setlogin + + CFLAGS-grantpt.c = -DLIBEXECDIR='"$(libexecdir)"' + +-others = utmpdump ++others-$(OPTION_EGLIBC_UTMP) += utmpdump + + ifeq (yes,$(build-pt-chown)) + others += pt_chown +@@ -46,8 +49,8 @@ + tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname + + # Build the -lutil library with these extra functions. +-extra-libs := libutil +-extra-libs-others := $(extra-libs) ++extra-libs-$(OPTION_EGLIBC_UTMP) := libutil ++extra-libs-others := $(extra-libs-y) + + libutil-routines:= login login_tty logout logwtmp openpty forkpty + +Index: git/Makeconfig +=================================================================== +--- git.orig/Makeconfig 2014-08-29 20:00:42.956070587 -0700 ++++ git/Makeconfig 2014-08-29 20:01:15.212070587 -0700 +@@ -582,7 +582,7 @@ + # and run on the build system, causes that program with those + # arguments to be run on the host for which the library is built. + ifndef test-wrapper +-test-wrapper = ++test-wrapper = $(cross-test-wrapper) + endif + # Likewise, but the name of the program is preceded by + # = assignments for environment variables. +@@ -1057,6 +1057,24 @@ + libm = $(common-objpfx)math/libm.a + endif + ++# Generate a header file that #defines preprocessor symbols indicating ++# which option groups are enabled. Note that the option-groups.config file ++# may not exist at all. ++before-compile += $(common-objpfx)gnu/option-groups.h ++common-generated += gnu/option-groups.h gnu/option-groups.stmp ++headers += gnu/option-groups.h ++$(common-objpfx)gnu/option-groups.h: $(common-objpfx)gnu/option-groups.stmp; @: ++$(common-objpfx)gnu/option-groups.stmp: \ ++ $(..)scripts/option-groups.awk \ ++ $(..)option-groups.defaults \ ++ $(wildcard $(common-objpfx)option-groups.config) ++ $(make-target-directory) ++ @rm -f ${@:stmp=T} $@ ++ LC_ALL=C $(AWK) -f $^ > ${@:stmp=T} ++ $(move-if-change) ${@:stmp=T} ${@:stmp=h} ++ touch $@ ++ ++ + # These are the subdirectories containing the library source. The order + # is more or less arbitrary. The sorting step will take care of the + # dependencies. +Index: git/Makerules +=================================================================== +--- git.orig/Makerules 2014-08-29 20:00:42.960070587 -0700 ++++ git/Makerules 2014-08-29 20:01:15.212070587 -0700 +@@ -379,6 +379,25 @@ + endef + endif + ++# Include targets in the selected option groups. ++aux += $(aux-y) ++extra-libs += $(extra-libs-y) ++extra-libs-others += $(extra-libs-others-y) ++extra-objs += $(extra-objs-y) ++install-bin += $(install-bin-y) ++install-others += $(install-others-y) ++install-sbin += $(install-sbin-y) ++modules += $(modules-y) ++others += $(others-y) ++others-pie += $(others-pie-y) ++routines += $(routines-y) ++static-only-routines += $(static-only-routines-y) ++sysdep_routines += $(sysdep_routines-y) ++test-srcs += $(test-srcs-y) ++tests += $(tests-y) ++xtests += $(xtests-y) ++ ++ + # Modify the list of routines we build for different targets + + ifeq (yes,$(build-shared)) +Index: git/malloc/Makefile +=================================================================== +--- git.orig/malloc/Makefile 2014-08-29 20:00:47.760070587 -0700 ++++ git/malloc/Makefile 2014-08-29 20:01:15.212070587 -0700 +@@ -18,6 +18,8 @@ + # + # Makefile for malloc routines + # ++include ../option-groups.mak ++ + subdir := malloc + + include ../Makeconfig +@@ -36,9 +38,15 @@ + non-lib.a := libmcheck.a + + # Additional library. ++ifeq ($(OPTION_EGLIBC_MEMUSAGE),y) + extra-libs = libmemusage + extra-libs-others = $(extra-libs) + ++ifdef OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE ++CPPFLAGS-memusage += -D__OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE=$(OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE) ++endif ++endif ++ + libmemusage-routines = memusage + libmemusage-inhibit-o = $(filter-out .os,$(object-suffixes)) + +@@ -67,7 +75,7 @@ + # Unless we get a test for the availability of libgd which also works + # for cross-compiling we disable the memusagestat generation in this + # situation. +-ifneq ($(cross-compiling),yes) ++ifeq ($(cross-compiling)$(OPTION_EGLIBC_MEMUSAGE),noy) + # If the gd library is available we build the `memusagestat' program. + ifneq ($(LIBGD),no) + others: $(objpfx)memusage +Index: git/malloc/memusage.c +=================================================================== +--- git.orig/malloc/memusage.c 2014-08-29 20:00:47.768070587 -0700 ++++ git/malloc/memusage.c 2014-08-29 20:01:15.212070587 -0700 +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + + #include + +@@ -93,7 +94,11 @@ + #define peak_stack peak_use[1] + #define peak_total peak_use[2] + +-#define DEFAULT_BUFFER_SIZE 32768 ++#ifndef __OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE ++# define DEFAULT_BUFFER_SIZE 32768 ++#else ++# define DEFAULT_BUFFER_SIZE __OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE ++#endif + static size_t buffer_size; + + static int fd = -1; +Index: git/malloc/memusage.sh +=================================================================== +--- git.orig/malloc/memusage.sh 2014-08-29 20:00:47.768070587 -0700 ++++ git/malloc/memusage.sh 2014-08-29 20:01:15.212070587 -0700 +@@ -35,7 +35,7 @@ + + # Print help message + do_help() { +- echo $"Usage: memusage [OPTION]... PROGRAM [PROGRAMOPTION]... ++ printf $"Usage: memusage [OPTION]... PROGRAM [PROGRAMOPTION]... + Profile memory usage of PROGRAM. + + -n,--progname=NAME Name of the program file to profile +Index: git/math/Makefile +=================================================================== +--- git.orig/math/Makefile 2014-08-29 20:00:47.836070587 -0700 ++++ git/math/Makefile 2014-08-29 20:01:15.212070587 -0700 +@@ -21,6 +21,8 @@ + + include ../Makeconfig + ++include ../option-groups.mak ++ + # Installed header files. + headers := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \ + bits/huge_valf.h bits/huge_vall.h bits/inf.h bits/nan.h \ +@@ -33,8 +35,8 @@ + + # Build the -lm library. + +-extra-libs := libm +-extra-libs-others = $(extra-libs) ++extra-libs-$(OPTION_EGLIBC_LIBM) := libm ++extra-libs-others-$(OPTION_EGLIBC_LIBM) = $(extra-libs-$(OPTION_EGLIBC_LIBM)) + + libm-support = k_standard s_lib_version s_matherr s_signgam \ + fclrexcpt fgetexcptflg fraiseexcpt fsetexcptflg \ +Index: git/misc/err.c +=================================================================== +--- git.orig/misc/err.c 2014-08-29 20:00:48.232070587 -0700 ++++ git/misc/err.c 2014-08-29 20:01:15.212070587 -0700 +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + #include + #define flockfile(s) _IO_flockfile (s) +@@ -37,6 +38,7 @@ + va_end (ap); \ + } + ++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + static void + convert_and_print (const char *format, __gnuc_va_list ap) + { +@@ -81,6 +83,7 @@ + + __vfwprintf (stderr, wformat, ap); + } ++#endif + + void + vwarnx (const char *format, __gnuc_va_list ap) +@@ -88,9 +91,13 @@ + flockfile (stderr); + if (_IO_fwide (stderr, 0) > 0) + { ++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + __fwprintf (stderr, L"%s: ", __progname); + convert_and_print (format, ap); + putwc_unlocked (L'\n', stderr); ++#else ++ abort (); ++#endif + } + else + { +@@ -111,6 +118,7 @@ + flockfile (stderr); + if (_IO_fwide (stderr, 0) > 0) + { ++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + __fwprintf (stderr, L"%s: ", __progname); + if (format) + { +@@ -119,6 +127,9 @@ + } + __set_errno (error); + __fwprintf (stderr, L"%m\n"); ++#else ++ abort (); ++#endif + } + else + { +Index: git/misc/error.c +=================================================================== +--- git.orig/misc/error.c 2014-08-29 20:00:48.232070587 -0700 ++++ git/misc/error.c 2014-08-29 20:01:15.212070587 -0700 +@@ -35,6 +35,7 @@ + #endif + + #ifdef _LIBC ++# include + # include + # include + # include +@@ -205,6 +206,7 @@ + #if _LIBC + if (_IO_fwide (stderr, 0) > 0) + { ++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + size_t len = strlen (message) + 1; + wchar_t *wmessage = NULL; + mbstate_t st; +@@ -265,6 +267,9 @@ + + if (use_malloc) + free (wmessage); ++#else ++ abort (); ++#endif + } + else + #endif +Index: git/misc/Makefile +=================================================================== +--- git.orig/misc/Makefile 2014-08-29 20:00:48.232070587 -0700 ++++ git/misc/Makefile 2014-08-29 20:01:15.212070587 -0700 +@@ -19,6 +19,10 @@ + # Sub-makefile for misc portion of the library. + # + ++# Some system-dependent implementations of these functions use option ++# groups (see sysdeps/unix/sysv/linux/Makefile, for example). ++include ../option-groups.mak ++ + subdir := misc + + include ../Makeconfig +@@ -46,40 +50,47 @@ + select pselect \ + acct chroot fsync sync fdatasync syncfs reboot \ + gethostid sethostid \ +- revoke vhangup \ ++ vhangup \ + swapon swapoff mktemp mkstemp mkstemp64 mkdtemp \ + mkostemp mkostemp64 mkstemps mkstemps64 mkostemps mkostemps64 \ + ualarm usleep \ + gtty stty \ + ptrace \ +- fstab mntent mntent_r \ ++ mntent mntent_r \ + utimes lutimes futimes futimesat \ + truncate ftruncate truncate64 ftruncate64 \ +- chflags fchflags \ + insremque getttyent getusershell getpass ttyslot \ + syslog syscall daemon \ + mmap mmap64 munmap mprotect msync madvise mincore remap_file_pages\ + mlock munlock mlockall munlockall \ +- efgcvt efgcvt_r qefgcvt qefgcvt_r \ + hsearch hsearch_r tsearch lsearch \ + err error ustat \ +- getsysstats dirname regexp \ ++ getsysstats dirname \ + getloadavg getclktck \ + fgetxattr flistxattr fremovexattr fsetxattr getxattr \ + listxattr lgetxattr llistxattr lremovexattr lsetxattr \ + removexattr setxattr getauxval ifunc-impl-list + ++routines-$(OPTION_POSIX_REGEXP) += regexp ++routines-$(OPTION_EGLIBC_FSTAB) += fstab ++routines-$(OPTION_EGLIBC_BSD) += chflags fchflags revoke ++routines-$(OPTION_EGLIBC_FCVT) += efgcvt efgcvt_r qefgcvt qefgcvt_r ++ + generated += tst-error1.mtrace tst-error1-mem.out + + aux := init-misc + install-lib := libg.a + gpl2lgpl := error.c error.h + +-tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \ +- tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1 ++tests := tst-dirname tst-tsearch tst-fdset tst-mntent tst-hsearch \ ++ tst-pselect tst-insremque tst-mntent2 bug-hsearch1 ++tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) += tst-error1 ++tests-$(OPTION_EGLIBC_FCVT) += tst-efgcvt + ifeq ($(run-built-tests),yes) ++ifeq (y,$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO)) + tests-special += $(objpfx)tst-error1-mem.out + endif ++endif + + CFLAGS-select.c = -fexceptions -fasynchronous-unwind-tables + CFLAGS-tsearch.c = $(uses-callbacks) +Index: git/misc/sys/xattr.h +=================================================================== +--- git.orig/misc/sys/xattr.h 2014-08-29 20:00:52.644070587 -0700 ++++ git/misc/sys/xattr.h 2014-08-29 20:01:15.216070587 -0700 +@@ -26,7 +26,6 @@ + + /* The following constants should be used for the fifth parameter of + `*setxattr'. */ +-#ifndef __USE_KERNEL_XATTR_DEFS + enum + { + XATTR_CREATE = 1, /* set value, fail if attr already exists. */ +@@ -34,7 +33,6 @@ + XATTR_REPLACE = 2 /* set value, fail if attr does not exist. */ + #define XATTR_REPLACE XATTR_REPLACE + }; +-#endif + + /* Set the attribute NAME of the file pointed to by PATH to VALUE (which + is SIZE bytes long). Return 0 on success, -1 for errors. */ +Index: git/misc/tst-efgcvt.c +=================================================================== +--- git.orig/misc/tst-efgcvt.c 2014-08-29 20:00:52.652070587 -0700 ++++ git/misc/tst-efgcvt.c 2014-08-29 20:01:15.216070587 -0700 +@@ -59,7 +59,7 @@ + { 123.01, -4, 3, "" }, + { 126.71, -4, 3, "" }, + { 0.0, 4, 1, "0000" }, +-#if DBL_MANT_DIG == 53 ++#if DBL_MANT_DIG == 53 && !(defined __powerpc__ && defined __NO_FPRS__ && !defined _SOFT_FLOAT && !defined _SOFT_DOUBLE) + { 0x1p-1074, 3, -323, "494" }, + { -0x1p-1074, 3, -323, "494" }, + #endif +Index: git/nis/Makefile +=================================================================== +--- git.orig/nis/Makefile 2014-08-29 20:00:52.660070587 -0700 ++++ git/nis/Makefile 2014-08-29 20:01:15.216070587 -0700 +@@ -18,6 +18,8 @@ + # + # Makefile for NIS/NIS+ part. + # ++include ../option-groups.mak ++ + subdir := nis + + include ../Makeconfig +@@ -30,19 +32,26 @@ + + # These are the databases available for the nis (and perhaps later nisplus) + # service. This must be a superset of the services in nss. +-databases = proto service hosts network grp pwd rpc ethers \ +- spwd netgrp alias publickey ++databases-y := proto service hosts network grp pwd rpc ethers \ ++ spwd netgrp publickey ++databases-$(OPTION_EGLIBC_DB_ALIASES) += alias + + # Specify rules for the nss_* modules. +-services := nis nisplus compat ++# The 'compat' module includes nis support, and the 'nss' directory ++# includes a bare-bones "files" library, so we'll include 'compat' in ++# OPTION_EGLIBC_NIS. ++services-y := ++services-$(OPTION_EGLIBC_NIS) += nis nisplus compat ++ ++extra-libs-$(OPTION_EGLIBC_NIS) += libnsl ++extra-libs-y += $(services-y:%=libnss_%) + +-extra-libs = libnsl $(services:%=libnss_%) + # These libraries will be built in the `others' pass rather than + # the `lib' pass, because they depend on libc.so being built already. +-extra-libs-others = $(extra-libs) ++extra-libs-others-y += $(extra-libs-y) + + # The sources are found in the appropriate subdir. +-subdir-dirs = $(services:%=nss_%) ++subdir-dirs = $(services-y:%=nss_%) + vpath %.c $(subdir-dirs) + + libnsl-routines = yp_xdr ypclnt ypupdate_xdr \ +@@ -60,11 +69,11 @@ + libnss_compat-routines := $(addprefix compat-,grp pwd spwd initgroups) + libnss_compat-inhibit-o = $(filter-out .os,$(object-suffixes)) + +-libnss_nis-routines := $(addprefix nis-,$(databases)) nis-initgroups \ ++libnss_nis-routines := $(addprefix nis-,$(databases-y)) nis-initgroups \ + nss-nis + libnss_nis-inhibit-o = $(filter-out .os,$(object-suffixes)) + +-libnss_nisplus-routines := $(addprefix nisplus-,$(databases)) nisplus-parser \ ++libnss_nisplus-routines := $(addprefix nisplus-,$(databases-y)) nisplus-parser \ + nss-nisplus nisplus-initgroups + libnss_nisplus-inhibit-o = $(filter-out .os,$(object-suffixes)) + +@@ -80,12 +89,12 @@ + # Target-specific variable setting to link objects using deprecated + # RPC interfaces with the version of libc.so that makes them available + # for new links: +-$(services:%=$(objpfx)libnss_%.so) $(objpfx)libnsl.so: \ ++$(services-y:%=$(objpfx)libnss_%.so) $(objpfx)libnsl.so: \ + libc-for-link = $(libnsl-libc) + + + ifeq ($(build-shared),yes) +-$(others:%=$(objpfx)%): $(objpfx)libnsl.so$(libnsl.so-version) ++$(others-y:%=$(objpfx)%): $(objpfx)libnsl.so$(libnsl.so-version) + else +-$(others:%=$(objpfx)%): $(objpfx)libnsl.a ++$(others-y:%=$(objpfx)%): $(objpfx)libnsl.a + endif +Index: git/nptl/Makefile +=================================================================== +--- git.orig/nptl/Makefile 2014-08-29 20:00:52.704070587 -0700 ++++ git/nptl/Makefile 2014-08-29 20:01:15.216070587 -0700 +@@ -18,6 +18,8 @@ + # + # Sub-makefile for NPTL portion of the library. + # ++include ../option-groups.mak ++ + subdir := nptl + + include ../Makeconfig +@@ -116,7 +118,7 @@ + pt-raise pt-system \ + flockfile ftrylockfile funlockfile \ + sigaction \ +- herrno res pt-allocrtsig \ ++ pt-allocrtsig \ + pthread_kill_other_threads \ + pthread_getaffinity pthread_setaffinity \ + pthread_attr_getaffinity pthread_attr_setaffinity \ +@@ -136,6 +138,8 @@ + # pthread_setgid pthread_setegid pthread_setregid \ + # pthread_setresgid + ++libpthread-routines-$(OPTION_EGLIBC_INET) := herrno res ++ + libpthread-shared-only-routines = version pt-allocrtsig unwind-forcedunwind + libpthread-static-only-routines = pthread_atfork + +@@ -210,7 +214,7 @@ + tst-mutexpi1 tst-mutexpi2 tst-mutexpi3 tst-mutexpi4 tst-mutexpi5 \ + tst-mutexpi5a tst-mutexpi6 tst-mutexpi7 tst-mutexpi7a tst-mutexpi8 \ + tst-mutexpi9 \ +- tst-spin1 tst-spin2 tst-spin3 tst-spin4 \ ++ tst-spin1 tst-spin2 tst-spin3 \ + tst-cond1 tst-cond2 tst-cond3 tst-cond4 tst-cond5 tst-cond6 tst-cond7 \ + tst-cond8 tst-cond9 tst-cond10 tst-cond11 tst-cond12 tst-cond13 \ + tst-cond14 tst-cond15 tst-cond16 tst-cond17 tst-cond18 tst-cond19 \ +@@ -244,14 +248,14 @@ + tst-cancel6 tst-cancel7 tst-cancel8 tst-cancel9 tst-cancel10 \ + tst-cancel11 tst-cancel12 tst-cancel13 tst-cancel14 tst-cancel15 \ + tst-cancel16 tst-cancel17 tst-cancel18 tst-cancel19 tst-cancel20 \ +- tst-cancel21 tst-cancel22 tst-cancel23 tst-cancel24 tst-cancel25 \ ++ tst-cancel21 tst-cancel22 tst-cancel23 tst-cancel25 \ + tst-cancel-self tst-cancel-self-cancelstate \ + tst-cancel-self-canceltype tst-cancel-self-testcancel \ + tst-cleanup0 tst-cleanup1 tst-cleanup2 tst-cleanup3 tst-cleanup4 \ + tst-flock1 tst-flock2 \ + tst-signal1 tst-signal2 tst-signal3 tst-signal4 tst-signal5 \ + tst-signal6 tst-signal7 \ +- tst-exec1 tst-exec2 tst-exec3 tst-exec4 \ ++ tst-exec2 tst-exec3 tst-exec4 \ + tst-exit1 tst-exit2 tst-exit3 \ + tst-stdio1 tst-stdio2 \ + tst-stack1 tst-stack2 tst-stack3 tst-pthread-getattr \ +@@ -259,13 +263,12 @@ + tst-unload \ + tst-dlsym1 \ + tst-sysconf \ +- tst-locale1 tst-locale2 \ ++ tst-locale2 \ + tst-umask1 \ + tst-popen1 \ + tst-clock1 \ + tst-context1 \ + tst-sched1 \ +- tst-backtrace1 \ + tst-abstime \ + tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \ + tst-getpid1 tst-getpid2 tst-getpid3 \ +@@ -275,6 +278,17 @@ + tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 + test-srcs = tst-oddstacklimit + ++# This test uses the posix_spawn functions. ++tests-$(OPTION_EGLIBC_SPAWN) += tst-exec1 ++ ++# This test uses the 'backtrace' functions. ++tests-$(OPTION_EGLIBC_BACKTRACE) += tst-backtrace1 ++ ++# This test is written in C++. ++tests-$(OPTION_EGLIBC_CXX_TESTS) += tst-cancel24 ++ ++tests-$(OPTION_EGLIBC_LOCALE_CODE) += tst-locale1 ++ + # Files which must not be linked with libpthread. + tests-nolibpthread = tst-unload + +Index: git/nptl/pthread_create.c +=================================================================== +--- git.orig/nptl/pthread_create.c 2014-08-29 20:00:52.764070587 -0700 ++++ git/nptl/pthread_create.c 2014-08-29 20:01:15.216070587 -0700 +@@ -31,6 +31,7 @@ + #include + #include + ++#include + #include + + #include +@@ -240,8 +241,10 @@ + THREAD_SETMEM (pd, cpuclock_offset, now); + #endif + ++#if __OPTION_EGLIBC_INET + /* Initialize resolver state pointer. */ + __resp = &pd->res; ++#endif + + /* Initialize pointers to locale data. */ + __ctype_init (); +@@ -322,8 +325,10 @@ + /* Run the destructor for the thread-local data. */ + __nptl_deallocate_tsd (); + ++#if __OPTION_EGLIBC_INET + /* Clean up any state libc stored in thread-local variables. */ + __libc_thread_freeres (); ++#endif + + /* If this is the last thread we terminate the process now. We + do not notify the debugger, it might just irritate it if there +Index: git/nscd/Makefile +=================================================================== +--- git.orig/nscd/Makefile 2014-08-29 20:00:52.948070587 -0700 ++++ git/nscd/Makefile 2014-08-29 20:01:15.216070587 -0700 +@@ -18,14 +18,17 @@ + # + # Sub-makefile for nscd portion of the library. + # ++include ../option-groups.mak ++ + subdir := nscd + + include ../Makeconfig + + ifneq ($(use-nscd),no) +-routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \ ++routines-$(OPTION_EGLIBC_INET) += \ ++ nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \ + nscd_initgroups nscd_getserv_r nscd_netgroup +-aux := nscd_helper ++aux-$(OPTION_EGLIBC_INET) += nscd_helper + endif + + # To find xmalloc.c +@@ -37,14 +40,18 @@ + dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \ + xmalloc xstrdup aicache initgrcache gai res_hconf \ + netgroupcache +- ++ifneq (y,$(OPTION_EGLIBC_NIS)) ++# If we haven't build libnsl.so, then we'll need to include our ++# own copy of nis_hash. ++nscd-modules += nis_hash ++endif + ifeq ($(build-nscd)$(have-thread-library),yesyes) + +-others += nscd +-others-pie += nscd +-install-sbin := nscd ++others-$(OPTION_EGLIBC_INET) += nscd ++others-pie-$(OPTION_EGLIBC_INET) += nscd ++install-sbin-$(OPTION_EGLIBC_INET) += nscd + +-extra-objs = $(nscd-modules:=.o) ++extra-objs-$(OPTION_EGLIBC_INET) += $(nscd-modules:=.o) + + endif + +@@ -101,7 +108,15 @@ + $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o) + + ifeq ($(build-shared),yes) +-$(objpfx)nscd: $(shared-thread-library) $(common-objpfx)nis/libnsl.so ++$(objpfx)nscd: $(shared-thread-library) ++else ++$(objpfx)nscd: $(static-thread-library) ++endif ++ ++ifeq (y,$(OPTION_EGLIBC_NIS)) ++ifeq ($(build-shared),yes) ++$(objpfx)nscd: $(common-objpfx)nis/libnsl.so + else +-$(objpfx)nscd: $(static-thread-library) $(common-objpfx)nis/libnsl.a ++$(objpfx)nscd: $(common-objpfx)nis/libnsl.a ++endif + endif +Index: git/nscd/nis_hash.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/nscd/nis_hash.c 2014-08-29 20:01:15.216070587 -0700 +@@ -0,0 +1,3 @@ ++/* If OPTION_EGLIBC_NIS is disabled, nscd can't get this from libnsl.so; ++ we need our own copy. */ ++#include "../nis/nis_hash.c" +Index: git/nss/fixed-nsswitch.conf +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/nss/fixed-nsswitch.conf 2014-08-29 20:01:15.216070587 -0700 +@@ -0,0 +1,22 @@ ++# /etc/nsswitch.conf ++# ++# Example configuration for fixed name service. ++# See the description of OPTION_EGLIBC_NSSWITCH in option-groups.def ++# for details. ++# ++ ++aliases: files ++ ++passwd: files ++group: files ++shadow: files ++ ++hosts: files dns ++networks: files dns ++ ++protocols: files ++services: files ++ethers: files ++rpc: files ++ ++netgroup: files +Index: git/nss/fixed-nsswitch.functions +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/nss/fixed-nsswitch.functions 2014-08-29 20:01:15.216070587 -0700 +@@ -0,0 +1,121 @@ ++/* List of functions defined for fixed NSS in GNU C Library. ++ Copyright (C) 1996, 1997, 1998, 2005 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++/* When OPTION_EGLIBC_NSSWITCH is disabled (see option-groups.def), ++ EGLIBC does not use the 'dlopen' and 'dlsym' functions to look for ++ database query functions in the individual name service libraries. ++ Instead, it uses a set of functions chosen at compile time, as ++ directed by the OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS file. This ++ file is a sample of what you might use there. ++ ++ This file is C source code; it should only contain invocations of ++ the following macros: ++ ++ - DEFINE_ENT (DATABASE, SERVICE, X) ++ ++ Declare the 'setXent', 'getXent_r', and 'endXent' functions that ++ query DATABASE using the service library 'libnss_SERVICE.so.2'. ++ DATABASE should be the full name of the database as it appears in ++ 'nsswitch.conf', like 'passwd' or 'aliases'. ++ ++ (The non-reentrant 'getXent' functions are implemented in terms ++ of the reentrant 'getXent_r' functions, so there is no need to ++ refer to them explicitly here.) ++ ++ - DEFINE_GETBY (DATABASE, SERVICE, X, KEY) ++ ++ Declare the 'getXbyKEY_r' functions that query DATABASE using ++ SERVICE. DATABASE and SERVICE are as described above. ++ ++ (The non-reentrant 'getXbyKEY' functions are implemented in terms ++ of the reentrant 'getXbyKEY_r' functions, so there is no need to ++ refer to them explicitly here.) ++ ++ Use the special key 'name3' for the service library function that ++ implements the 'getaddrinfo' function. ++ ++ - DEFINE_GET (DATABASE, SERVICE, QUERY) ++ ++ Declare the 'getQUERY_r' functions that query DATABASE using ++ SERVICE. This is used for functions like 'getpwnam'. ++ ++ (The non-reentrant 'getQUERY' functions are implemented in terms ++ of the reentrant 'getQUERY_r' functions, so there is no need to ++ refer to them explicitly here.) ++ ++ This sample file only includes functions that consult the files in ++ '/etc', and the Domain Name System (DNS). */ ++ ++/* aliases */ ++DEFINE_ENT (aliases, files, alias) ++DEFINE_GETBY (aliases, files, alias, name) ++ ++/* ethers */ ++DEFINE_ENT (ethers, files, ether) ++ ++/* group */ ++DEFINE_ENT (group, files, gr) ++DEFINE_GET (group, files, grgid) ++DEFINE_GET (group, files, grnam) ++ ++/* hosts */ ++DEFINE_ENT (hosts, files, host) ++DEFINE_GETBY (hosts, files, host, addr) ++DEFINE_GETBY (hosts, files, host, name) ++DEFINE_GETBY (hosts, files, host, name2) ++DEFINE_GET (hosts, files, hostton) ++DEFINE_GET (hosts, files, ntohost) ++DEFINE_GETBY (hosts, dns, host, addr) ++DEFINE_GETBY (hosts, dns, host, name) ++DEFINE_GETBY (hosts, dns, host, name2) ++DEFINE_GETBY (hosts, dns, host, name3) ++ ++/* netgroup */ ++DEFINE_ENT (netgroup, files, netgr) ++ ++/* networks */ ++DEFINE_ENT (networks, files, net) ++DEFINE_GETBY (networks, files, net, name) ++DEFINE_GETBY (networks, files, net, addr) ++DEFINE_GETBY (networks, dns, net, name) ++DEFINE_GETBY (networks, dns, net, addr) ++ ++/* protocols */ ++DEFINE_ENT (protocols, files, proto) ++DEFINE_GETBY (protocols, files, proto, name) ++DEFINE_GETBY (protocols, files, proto, number) ++ ++/* passwd */ ++DEFINE_ENT (passwd, files, pw) ++DEFINE_GET (passwd, files, pwnam) ++DEFINE_GET (passwd, files, pwuid) ++ ++/* rpc */ ++DEFINE_ENT (rpc, files, rpc) ++DEFINE_GETBY (rpc, files, rpc, name) ++DEFINE_GETBY (rpc, files, rpc, number) ++ ++/* services */ ++DEFINE_ENT (services, files, serv) ++DEFINE_GETBY (services, files, serv, name) ++DEFINE_GETBY (services, files, serv, port) ++ ++/* shadow */ ++DEFINE_ENT (shadow, files, sp) ++DEFINE_GET (shadow, files, spnam) +Index: git/nss/gen-fixed-nsswitch.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/nss/gen-fixed-nsswitch.c 2014-08-29 20:01:15.216070587 -0700 +@@ -0,0 +1,803 @@ ++/* gen-fixed-nsswitch.c --- generate fixed name service data structures ++ Copyright (C) 1996-1999, 2001-2006, 2007 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#define _GNU_SOURCE ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "gnu/lib-names.h" ++#include "nss.h" ++ ++/* Provide a fallback definition to allow this file to be compiled outside ++ libc. */ ++#ifndef internal_function ++# define internal_function ++#endif ++ ++ ++/* Simple utilities. */ ++ ++void __attribute__ ((noreturn)) ++error (const char *message) ++{ ++ fprintf (stderr, "%s\n", message); ++ exit (1); ++} ++ ++ ++void * ++check_alloc (void *p) ++{ ++ if (p) ++ return p; ++ else ++ error ("out of memory"); ++} ++ ++void * ++xmalloc (size_t size) ++{ ++ return check_alloc (malloc (size)); ++} ++ ++ ++/* Format ARGS according to FORMAT, and return the result as a ++ malloc'ed string. */ ++char * ++saprintf (const char *format, ...) ++{ ++ va_list args; ++ size_t len; ++ char *buf; ++ ++ va_start (args, format); ++ len = vsnprintf (NULL, 0, format, args); ++ va_end (args); ++ ++ buf = xmalloc (len + 1); ++ va_start (args, format); ++ assert (len == vsnprintf (buf, len + 1, format, args)); ++ va_end (args); ++ ++ return buf; ++} ++ ++ ++ ++/* Data structures representing the configuration file in memory. */ ++ ++/* These are copied from nsswitch.h. ++ ++ We could simply #include that file, but this program runs on the ++ build machine and links against the build machine's libraries, ++ whereas that header is meant for use by target code; it uses ++ 'libc_hidden_proto', 'internal_function', and related hair. Since ++ we've copied the parsing code, we might as well copy the data ++ structure definitions as well. */ ++ ++/* Actions performed after lookup finished. */ ++typedef enum ++{ ++ NSS_ACTION_CONTINUE, ++ NSS_ACTION_RETURN ++} lookup_actions; ++ ++ ++typedef struct service_library ++{ ++ /* Name of service (`files', `dns', `nis', ...). */ ++ const char *name; ++ /* Pointer to the loaded shared library. */ ++ void *lib_handle; ++ /* And the link to the next entry. */ ++ struct service_library *next; ++} service_library; ++ ++ ++/* For mapping a function name to a function pointer. It is known in ++ nsswitch.c:nss_lookup_function that a string pointer for the lookup key ++ is the first member. */ ++typedef struct ++{ ++ const char *fct_name; ++ void *fct_ptr; ++} known_function; ++ ++ ++typedef struct service_user ++{ ++ /* And the link to the next entry. */ ++ struct service_user *next; ++ /* Action according to result. */ ++ lookup_actions actions[5]; ++ /* Link to the underlying library object. */ ++ service_library *library; ++ /* Collection of known functions. ++ ++ With OPTION_EGLIBC_NSSWITCH enabled, this is the root of a ++ 'tsearch'-style tree. ++ ++ With OPTION_EGLIBC_NSSWITCH disabled, this is an array of ++ pointers to known_function structures, NULL-terminated. */ ++ union ++ { ++ void *tree; ++ const known_function **array; ++ } known; ++ /* Name of the service (`files', `dns', `nis', ...). */ ++ const char *name; ++} service_user; ++ ++/* To access the action based on the status value use this macro. */ ++#define nss_next_action(ni, status) ((ni)->actions[2 + status]) ++ ++ ++typedef struct name_database_entry ++{ ++ /* And the link to the next entry. */ ++ struct name_database_entry *next; ++ /* List of service to be used. */ ++ service_user *service; ++ /* Name of the database. */ ++ const char *name; ++} name_database_entry; ++ ++ ++typedef struct name_database ++{ ++ /* List of all known databases. */ ++ name_database_entry *entry; ++ /* List of libraries with service implementation. */ ++ service_library *library; ++} name_database; ++ ++ ++ ++/* Gathering the contents of the FIXED_FUNCTIONS file. */ ++ ++/* It should be possible to generate this list automatically by ++ looking at the services and databases used in the nsswitch.conf ++ file, and having a hard-coded set of queries supported on each ++ database. */ ++ ++/* We #include the FIXED_FUNCTIONS file several times to build an ++ array of function structures holding its data. */ ++enum function_kind { ++ fk_end = 0, /* Last entry. */ ++ fk_setent, /* Like setpwent. */ ++ fk_getent, /* Like getpwent. */ ++ fk_endent, /* Like endpwent. */ ++ fk_getby, /* Like gethostbyname. */ ++ fk_get /* Like getpwnam. */ ++}; ++ ++ ++struct function { ++ /* What kind of function this is. */ ++ enum function_kind kind; ++ ++ /* The database and service of the function being hardwired in. */ ++ char *database, *service; ++ ++ /* The kind of entry being queried, for 'fk_setent', 'fk_getent', ++ 'fk_endent', and 'fk_getby' functions. */ ++ char *entry; ++ ++ /* The key, for 'fk_getby' entries. */ ++ char *key; ++ ++ /* The value and key, for 'fk_get' entries. */ ++ char *value_and_key; ++}; ++ ++ ++const struct function functions[] = ++ { ++ ++#define DEFINE_ENT(database, service, entry) \ ++ { fk_setent, #database, #service, #entry }, \ ++ { fk_getent, #database, #service, #entry }, \ ++ { fk_endent, #database, #service, #entry }, ++#define DEFINE_GETBY(database, service, entry, key) \ ++ { fk_getby, #database, #service, #entry, #key }, ++#define DEFINE_GET(database, service, value_and_key) \ ++ { fk_get, #database, #service, NULL, NULL, #value_and_key }, ++ ++#include FIXED_FUNCTIONS ++ ++#undef DEFINE_ENT ++#undef DEFINE_GETBY ++#undef DEFINE_GET ++ ++ { fk_end } ++ }; ++ ++ ++/* Parsing the config file. Functions copied from nsswitch.c. */ ++ ++#define __strchrnul strchrnul ++#define __getline getline ++#define __strncasecmp strncasecmp ++ ++/* Prototypes for the local functions. */ ++static name_database *nss_parse_file (const char *fname) internal_function; ++static name_database_entry *nss_getline (char *line) internal_function; ++static service_user *nss_parse_service_list (const char *line) ++ internal_function; ++ ++static name_database * ++internal_function ++nss_parse_file (const char *fname) ++{ ++ FILE *fp; ++ name_database *result; ++ name_database_entry *last; ++ char *line; ++ size_t len; ++ ++ /* Open the configuration file. */ ++ fp = fopen (fname, "rc"); ++ if (fp == NULL) ++ return NULL; ++ ++ // /* No threads use this stream. */ ++ // __fsetlocking (fp, FSETLOCKING_BYCALLER); ++ ++ result = (name_database *) xmalloc (sizeof (name_database)); ++ ++ result->entry = NULL; ++ result->library = NULL; ++ last = NULL; ++ line = NULL; ++ len = 0; ++ do ++ { ++ name_database_entry *this; ++ ssize_t n; ++ ++ n = __getline (&line, &len, fp); ++ if (n < 0) ++ break; ++ if (line[n - 1] == '\n') ++ line[n - 1] = '\0'; ++ ++ /* Because the file format does not know any form of quoting we ++ can search forward for the next '#' character and if found ++ make it terminating the line. */ ++ *__strchrnul (line, '#') = '\0'; ++ ++ /* If the line is blank it is ignored. */ ++ if (line[0] == '\0') ++ continue; ++ ++ /* Each line completely specifies the actions for a database. */ ++ this = nss_getline (line); ++ if (this != NULL) ++ { ++ if (last != NULL) ++ last->next = this; ++ else ++ result->entry = this; ++ ++ last = this; ++ } ++ } ++ while (!feof_unlocked (fp)); ++ ++ /* Free the buffer. */ ++ free (line); ++ /* Close configuration file. */ ++ fclose (fp); ++ ++ return result; ++} ++ ++ ++/* Read the source names: ++ `( ( "[" "!"? ( "=" )+ "]" )? )*' ++ */ ++static service_user * ++internal_function ++nss_parse_service_list (const char *line) ++{ ++ service_user *result = NULL, **nextp = &result; ++ ++ while (1) ++ { ++ service_user *new_service; ++ const char *name; ++ ++ while (isspace (line[0])) ++ ++line; ++ if (line[0] == '\0') ++ /* No source specified. */ ++ return result; ++ ++ /* Read identifier. */ ++ name = line; ++ while (line[0] != '\0' && !isspace (line[0]) && line[0] != '[') ++ ++line; ++ if (name == line) ++ return result; ++ ++ ++ new_service = (service_user *) xmalloc (sizeof (*new_service)); ++ new_service->name = (char *) xmalloc (line - name + 1); ++ ++ *((char *) __mempcpy ((char *) new_service->name, name, line - name)) ++ = '\0'; ++ ++ /* Set default actions. */ ++ new_service->actions[2 + NSS_STATUS_TRYAGAIN] = NSS_ACTION_CONTINUE; ++ new_service->actions[2 + NSS_STATUS_UNAVAIL] = NSS_ACTION_CONTINUE; ++ new_service->actions[2 + NSS_STATUS_NOTFOUND] = NSS_ACTION_CONTINUE; ++ new_service->actions[2 + NSS_STATUS_SUCCESS] = NSS_ACTION_RETURN; ++ new_service->actions[2 + NSS_STATUS_RETURN] = NSS_ACTION_RETURN; ++ new_service->library = NULL; ++ new_service->known.tree = NULL; ++ new_service->next = NULL; ++ ++ while (isspace (line[0])) ++ ++line; ++ ++ if (line[0] == '[') ++ { ++ /* Read criterions. */ ++ do ++ ++line; ++ while (line[0] != '\0' && isspace (line[0])); ++ ++ do ++ { ++ int not; ++ enum nss_status status; ++ lookup_actions action; ++ ++ /* Grok ! before name to mean all statii but that one. */ ++ not = line[0] == '!'; ++ if (not) ++ ++line; ++ ++ /* Read status name. */ ++ name = line; ++ while (line[0] != '\0' && !isspace (line[0]) && line[0] != '=' ++ && line[0] != ']') ++ ++line; ++ ++ /* Compare with known statii. */ ++ if (line - name == 7) ++ { ++ if (__strncasecmp (name, "SUCCESS", 7) == 0) ++ status = NSS_STATUS_SUCCESS; ++ else if (__strncasecmp (name, "UNAVAIL", 7) == 0) ++ status = NSS_STATUS_UNAVAIL; ++ else ++ return result; ++ } ++ else if (line - name == 8) ++ { ++ if (__strncasecmp (name, "NOTFOUND", 8) == 0) ++ status = NSS_STATUS_NOTFOUND; ++ else if (__strncasecmp (name, "TRYAGAIN", 8) == 0) ++ status = NSS_STATUS_TRYAGAIN; ++ else ++ return result; ++ } ++ else ++ return result; ++ ++ while (isspace (line[0])) ++ ++line; ++ if (line[0] != '=') ++ return result; ++ do ++ ++line; ++ while (isspace (line[0])); ++ ++ name = line; ++ while (line[0] != '\0' && !isspace (line[0]) && line[0] != '=' ++ && line[0] != ']') ++ ++line; ++ ++ if (line - name == 6 && __strncasecmp (name, "RETURN", 6) == 0) ++ action = NSS_ACTION_RETURN; ++ else if (line - name == 8 ++ && __strncasecmp (name, "CONTINUE", 8) == 0) ++ action = NSS_ACTION_CONTINUE; ++ else ++ return result; ++ ++ if (not) ++ { ++ /* Save the current action setting for this status, ++ set them all to the given action, and reset this one. */ ++ const lookup_actions save = new_service->actions[2 + status]; ++ new_service->actions[2 + NSS_STATUS_TRYAGAIN] = action; ++ new_service->actions[2 + NSS_STATUS_UNAVAIL] = action; ++ new_service->actions[2 + NSS_STATUS_NOTFOUND] = action; ++ new_service->actions[2 + NSS_STATUS_SUCCESS] = action; ++ new_service->actions[2 + status] = save; ++ } ++ else ++ new_service->actions[2 + status] = action; ++ ++ /* Skip white spaces. */ ++ while (isspace (line[0])) ++ ++line; ++ } ++ while (line[0] != ']'); ++ ++ /* Skip the ']'. */ ++ ++line; ++ } ++ ++ *nextp = new_service; ++ nextp = &new_service->next; ++ } ++} ++ ++static name_database_entry * ++internal_function ++nss_getline (char *line) ++{ ++ const char *name; ++ name_database_entry *result; ++ size_t len; ++ ++ /* Ignore leading white spaces. ATTENTION: this is different from ++ what is implemented in Solaris. The Solaris man page says a line ++ beginning with a white space character is ignored. We regard ++ this as just another misfeature in Solaris. */ ++ while (isspace (line[0])) ++ ++line; ++ ++ /* Recognize ` ":"'. */ ++ name = line; ++ while (line[0] != '\0' && !isspace (line[0]) && line[0] != ':') ++ ++line; ++ if (line[0] == '\0' || name == line) ++ /* Syntax error. */ ++ return NULL; ++ *line++ = '\0'; ++ ++ len = strlen (name) + 1; ++ ++ result = (name_database_entry *) xmalloc (sizeof (*result)); ++ result->name = (char *) xmalloc (len); ++ ++ /* Save the database name. */ ++ memcpy ((char *) result->name, name, len); ++ ++ /* Parse the list of services. */ ++ result->service = nss_parse_service_list (line); ++ ++ result->next = NULL; ++ return result; ++} ++ ++ ++ ++/* Generating code for statically initialized nsswitch structures. */ ++ ++ ++/* Return the service-neutral suffix of the name of the service ++ library function referred to by the function F. The result is ++ allocated with malloc. */ ++char * ++known_function_suffix (const struct function *f) ++{ ++ switch (f->kind) ++ { ++ case fk_setent: ++ return saprintf ("set%sent", f->entry); ++ ++ case fk_getent: ++ return saprintf ("get%sent_r", f->entry); ++ ++ case fk_endent: ++ return saprintf ("end%sent", f->entry); ++ ++ case fk_getby: ++ return saprintf ("get%sby%s_r", f->entry, f->key); ++ ++ case fk_get: ++ return saprintf ("get%s_r", f->value_and_key); ++ ++ default: ++ abort (); ++ } ++} ++ ++ ++/* Return the name of the service library function referred to by the ++ function F. The result is allocated with malloc. */ ++char * ++known_function_name (const struct function *f) ++{ ++ return saprintf ("_nss_%s_%s", f->service, known_function_suffix (f)); ++} ++ ++ ++/* Write initialized known_function structures to OUT for ++ all the functions we'll use. */ ++void ++generate_known_functions (FILE *out) ++{ ++ int i; ++ ++ /* First, generate weak references to the functions. The service ++ libraries depend on libc, and if these references weren't weak, ++ we'd be making libc depend circularly on the service ++ libraries. */ ++ for (i = 0; functions[i].kind; i++) ++ { ++ char *name = known_function_name (&functions[i]); ++ fprintf (out, "typeof (%s) %s __attribute__ ((weak));\n", ++ name, name); ++ } ++ fputs ("\n", out); ++ ++ /* Then, a table mapping names to functions. */ ++ fputs ("static const known_function fixed_known_functions[] = {\n", ++ out); ++ for (i = 0; functions[i].kind; i++) ++ { ++ const struct function *f = &functions[i]; ++ char *suffix = known_function_suffix (f); ++ ++ fprintf (out, " /* %2d */ { \"%s\", _nss_%s_%s },\n", ++ i, suffix, f->service, suffix); ++ } ++ fputs ("};\n", out); ++ fputs ("\n", out); ++} ++ ++ ++/* Print code to OUT for an initialized array of pointers to the ++ 'known_function' structures needed for USER, which is for ++ DATABASE. Return its name, allocated with malloc. */ ++char * ++generate_known_function_list (FILE *out, ++ const name_database_entry *database, ++ const service_user *user) ++{ ++ char *list_name = saprintf ("fixed_%s_%s_known_funcs", ++ database->name, user->name); ++ fprintf (out, "static const known_function *%s[] = {\n", ++ list_name); ++ int i; ++ for (i = 0; functions[i].kind; i++) ++ if (strcmp (functions[i].database, database->name) == 0 ++ && strcmp (functions[i].service, user->name) == 0) ++ fprintf (out, " &fixed_known_functions[%d], /* %s */\n", ++ i, known_function_name (&functions[i])); ++ fputs (" NULL\n", out); ++ fputs ("};\n", out); ++ fputs ("\n", out); ++ ++ return list_name; ++} ++ ++ ++/* Return the name of the status value STATUS, as a statically ++ allocated string. */ ++const char * ++lookup_status_name (enum nss_status status) ++{ ++ switch (status) ++ { ++ case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN"; ++ case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL"; ++ case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND"; ++ case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS"; ++ case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN"; ++ default: abort (); ++ }; ++} ++ ++ ++/* Return the name of ACTION as a statically allocated string. */ ++const char * ++lookup_action_name (lookup_actions action) ++{ ++ switch (action) ++ { ++ case NSS_ACTION_CONTINUE: return "NSS_ACTION_CONTINUE"; ++ case NSS_ACTION_RETURN: return "NSS_ACTION_RETURN"; ++ default: abort (); ++ } ++} ++ ++ ++/* Print code to OUT for the list of service_user structures starting ++ with USER, which are all for DATABASE. Return the name of the ++ first structure in that list, or zero if USER is NULL. */ ++char * ++generate_service_user_list (FILE *out, ++ name_database_entry *database, ++ service_user *user) ++{ ++ if (user) ++ { ++ /* Generate the tail of the list. */ ++ char *next_name = generate_service_user_list (out, database, user->next); ++ /* Generate our known function list. */ ++ char *known_function_list_name = ++ generate_known_function_list (out, database, user); ++ ++ char *name = saprintf ("fixed_%s_%s_user", database->name, user->name); ++ ++ fprintf (out, "static const service_user %s = {\n", name); ++ if (next_name) ++ fprintf (out, " (service_user *) &%s,\n", next_name); ++ else ++ fprintf (out, " NULL, /* no next entry */\n"); ++ fputs (" {\n", out); ++ int i; ++ for (i = 0; i < sizeof (user->actions) / sizeof (user->actions[0]); i++) ++ fprintf (out, " %s, /* %s */\n", ++ lookup_action_name (user->actions[i]), ++ lookup_status_name (i - 2)); ++ fputs (" },\n", out); ++ fprintf (out, " NULL, /* we never need the service library */\n"); ++ fprintf (out, " { .array = %s },\n", known_function_list_name); ++ fprintf (out, " \"%s\"\n", user->name); ++ fputs ("};\n", out); ++ fputs ("\n", out); ++ ++ return name; ++ } ++ else ++ return NULL; ++} ++ ++ ++/* Print code to OUT for the list of name_database_entry structures ++ starting with DATABASE. Return the name of the first structure ++ in that list, or zero if DATABASE is NULL. */ ++char * ++generate_name_database_entries (FILE *out, name_database_entry *database) ++{ ++ if (database) ++ { ++ char *next_name = generate_name_database_entries (out, database->next); ++ char *service_user_name ++ = generate_service_user_list (out, database, database->service); ++ char *name = saprintf ("fixed_%s_name_database", database->name); ++ ++ fprintf (out, "static const name_database_entry %s = {\n", name); ++ ++ if (next_name) ++ fprintf (out, " (name_database_entry *) &%s,\n", next_name); ++ else ++ fprintf (out, " NULL,\n"); ++ ++ if (service_user_name) ++ fprintf (out, " (service_user *) &%s,\n", service_user_name); ++ else ++ fprintf (out, " NULL,\n"); ++ ++ fprintf (out, " \"%s\"\n", database->name); ++ fprintf (out, "};\n"); ++ fputs ("\n", out); ++ ++ return name; ++ } ++ else ++ return NULL; ++} ++ ++ ++void ++generate_name_database (FILE *out, name_database *service_table) ++{ ++ /* Produce a linked list of the known name_database_entry ++ structures. */ ++ char *entries = generate_name_database_entries (out, service_table->entry); ++ ++ /* Now produce the main structure that points to them all. */ ++ fprintf (out, "static const name_database fixed_name_database = {\n"); ++ if (entries) ++ fprintf (out, " (name_database_entry *) &%s,\n", entries); ++ else ++ fprintf (out, " NULL,\n"); ++ fputs (" NULL /* we don't need the libraries */\n" ++ "};\n", ++ out); ++} ++ ++ ++ ++/* Generating the list of service libraries we generate references to. */ ++ ++/* String with revision number of the shared object files. */ ++static const char *const nss_shlib_revision = LIBNSS_FILES_SO + 15; ++ ++void ++generate_service_lib_list (FILE *out, name_database *service_table) ++{ ++ int i, j; ++ int printed_any = 0; ++ ++ for (i = 0; functions[i].kind; i++) ++ { ++ /* Mention each service library only once. */ ++ for (j = 0; j < i; j++) ++ if (strcmp (functions[i].service, functions[j].service) == 0) ++ break; ++ ++ if (j >= i) ++ { ++ if (printed_any) ++ putc (' ', out); ++ fprintf (out, "-lnss_%s", ++ functions[i].service, ++ nss_shlib_revision); ++ printed_any = 1; ++ } ++ } ++} ++ ++ ++/* Main. */ ++ ++int ++main (int argc, char **argv) ++{ ++ if (argc != 4) ++ { ++ fprintf (stderr, "usage: gen-fixed-nsswitch HEADER SERVLIBS CONFIG\n"); ++ exit (1); ++ } ++ ++ name_database *service_table = nss_parse_file (argv[3]); ++ ++ FILE *header = fopen (argv[1], "w"); ++ if (! header) ++ { ++ fprintf (stderr, ++ "gen-fixed-nsswitch: couldn't open output file %s: %s\n", ++ argv[1], strerror (errno)); ++ exit (1); ++ } ++ fputs ("/* Generated by nss/gen-fixed-nsswitch.c. */\n", header); ++ fputs ("\n", header); ++ generate_known_functions (header); ++ generate_name_database (header, service_table); ++ fclose (header); ++ ++ FILE *service_lib_list = fopen (argv[2], "w"); ++ if (! service_lib_list) ++ { ++ fprintf (stderr, ++ "gen-fixed-nsswitch: couldn't open output file %s: %s\n", ++ argv[2], strerror (errno)); ++ exit (1); ++ } ++ generate_service_lib_list (service_lib_list, service_table); ++ fclose (service_lib_list); ++ ++ return 0; ++} +Index: git/nss/getent.c +=================================================================== +--- git.orig/nss/getent.c 2014-08-29 20:00:52.976070587 -0700 ++++ git/nss/getent.c 2014-08-29 20:01:15.216070587 -0700 +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + + /* Get libc version number. */ + #include +@@ -91,6 +92,7 @@ + fprintf (stream, gettext ("Written by %s.\n"), "Thorsten Kukuk"); + } + ++#if __OPTION_EGLIBC_DB_ALIASES + /* This is for aliases */ + static void + print_aliases (struct aliasent *alias) +@@ -135,7 +137,9 @@ + + return result; + } ++#endif /* __OPTION_EGLIBC_DB_ALIASES */ + ++#if __OPTION_EGLIBC_INET + /* This is for ethers */ + static int + ethers_keys (int number, char *key[]) +@@ -179,6 +183,7 @@ + + return result; + } ++#endif /* __OPTION_EGLIBC_INET */ + + /* This is for group */ + static void +@@ -301,6 +306,7 @@ + return result; + } + ++#if __OPTION_EGLIBC_INET + /* This is for hosts */ + static void + print_hosts (struct hostent *host) +@@ -598,6 +604,7 @@ + + return result; + } ++#endif /* __OPTION_EGLIBC_INET */ + + /* Now is all for passwd */ + static void +@@ -650,6 +657,7 @@ + return result; + } + ++#if __OPTION_EGLIBC_INET + /* This is for protocols */ + static void + print_protocols (struct protoent *proto) +@@ -805,6 +813,7 @@ + + return result; + } ++#endif /* __OPTION_EGLIBC_INET */ + + /* This is for shadow */ + static void +@@ -871,21 +880,34 @@ + } databases[] = + { + #define D(name) { #name, name ## _keys }, +-D(ahosts) +-D(ahostsv4) +-D(ahostsv6) +-D(aliases) +-D(ethers) ++ ++#if __OPTION_EGLIBC_INET ++#define DN(name) D(name) ++#else ++#define DN(name) ++#endif ++ ++#if __OPTION_EGLIBC_DB_ALIASES ++#define DA(name) D(name) ++#else ++#define DA(name) ++#endif ++ ++DN(ahosts) ++DN(ahostsv4) ++DN(ahostsv6) ++DA(aliases) ++DN(ethers) + D(group) + D(gshadow) +-D(hosts) ++DN(hosts) + D(initgroups) +-D(netgroup) +-D(networks) ++DN(netgroup) ++DN(networks) + D(passwd) +-D(protocols) +-D(rpc) +-D(services) ++DN(protocols) ++DN(rpc) ++DN(services) + D(shadow) + #undef D + { NULL, NULL } +Index: git/nss/getnssent_r.c +=================================================================== +--- git.orig/nss/getnssent_r.c 2014-08-29 20:00:52.976070587 -0700 ++++ git/nss/getnssent_r.c 2014-08-29 20:01:15.220070587 -0700 +@@ -16,6 +16,7 @@ + . */ + + #include ++#include + #include + #include "nsswitch.h" + +@@ -59,11 +60,13 @@ + } fct; + int no_more; + ++#if __OPTION_EGLIBC_INET + if (res && __res_maybe_init (&_res, 0) == -1) + { + __set_h_errno (NETDB_INTERNAL); + return; + } ++#endif /* __OPTION_EGLIBC_INET */ + + /* Cycle through the services and run their `setXXent' functions until + we find an available service. */ +@@ -101,11 +104,13 @@ + } fct; + int no_more; + ++#if __OPTION_EGLIBC_INET + if (res && __res_maybe_init (&_res, 0) == -1) + { + __set_h_errno (NETDB_INTERNAL); + return; + } ++#endif /* __OPTION_EGLIBC_INET */ + + /* Cycle through all the services and run their endXXent functions. */ + no_more = setup (func_name, lookup_fct, &fct.ptr, nip, startp, 1); +@@ -141,12 +146,14 @@ + int no_more; + enum nss_status status; + ++#if __OPTION_EGLIBC_INET + if (res && __res_maybe_init (&_res, 0) == -1) + { + *h_errnop = NETDB_INTERNAL; + *result = NULL; + return errno; + } ++#endif /* __OPTION_EGLIBC_INET */ + + /* Initialize status to return if no more functions are found. */ + status = NSS_STATUS_NOTFOUND; +@@ -161,7 +168,7 @@ + int is_last_nip = *nip == *last_nip; + + status = DL_CALL_FCT (fct.f, +- (resbuf, buffer, buflen, &errno, &h_errno)); ++ (resbuf, buffer, buflen, &errno, h_errnop)); + + /* The status is NSS_STATUS_TRYAGAIN and errno is ERANGE the + provided buffer is too small. In this case we should give +Index: git/nss/Makefile +=================================================================== +--- git.orig/nss/Makefile 2014-08-29 20:00:52.972070587 -0700 ++++ git/nss/Makefile 2014-08-29 20:01:15.220070587 -0700 +@@ -18,29 +18,36 @@ + # + # Makefile for name service switch. + # ++include ../option-groups.mak ++ + subdir := nss + + include ../Makeconfig + + headers := nss.h + +-# This is the trivial part which goes into libc itself. +-routines = nsswitch getnssent getnssent_r digits_dots \ +- $(addsuffix -lookup,$(databases)) +- + # These are the databases that go through nss dispatch. + # Caution: if you add a database here, you must add its real name + # in databases.def, too. +-databases = proto service hosts network grp pwd rpc ethers \ +- spwd netgrp key alias sgrp ++databases-y = grp pwd spwd sgrp ++databases-$(OPTION_EGLIBC_INET) \ ++ += proto service hosts network rpc ethers \ ++ netgrp key ++databases-$(OPTION_EGLIBC_DB_ALIASES) += alias ++ ++# This is the trivial part which goes into libc itself. ++routines-y += nsswitch getnssent getnssent_r \ ++ $(addsuffix -lookup,$(databases-y)) ++routines-$(OPTION_EGLIBC_INET) += digits_dots + + others := getent makedb + install-bin := getent makedb + makedb-modules = xmalloc hash-string + extra-objs += $(makedb-modules:=.o) + +-tests = test-netdb tst-nss-test1 test-digits-dots +-xtests = bug-erange ++tests = tst-nss-test1 ++tests-$(OPTION_EGLIBC_INET) += test-netdb test-digits-dots ++xtests-$(OPTION_EGLIBC_INET) += bug-erange + + # Specify rules for the nss_* modules. We have some services. + services := files db +@@ -55,7 +62,7 @@ + vpath %.c $(subdir-dirs) ../locale/programs ../intl + + +-libnss_files-routines := $(addprefix files-,$(databases)) \ ++libnss_files-routines := $(addprefix files-,$(databases-y)) \ + files-initgroups files-have_o_cloexec files-init + + libnss_db-dbs := $(addprefix db-,\ +@@ -78,6 +85,45 @@ + tests += $(tests-static) + endif + ++ifneq ($(OPTION_EGLIBC_NSSWITCH),y) ++ ++ifndef OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG ++$(error OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG variable left unset) ++endif ++ ++ifndef OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS ++$(error OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS variable left unset) ++endif ++ ++ifeq (,$(wildcard $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG))) ++$(warning OPTION_EGLIBC_NSSWITCH is disabled, but fixed config file) ++$(error does not exist: $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG)) ++endif ++ ++ifeq (,$(wildcard $(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS))) ++$(warning OPTION_EGLIBC_NSSWITCH is disabled, but fixed functions file) ++$(error does not exist: $(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS)) ++endif ++ ++before-compile := $(objpfx)fixed-nsswitch.h ++generated := fixed-nsswitch.h ++$(objpfx)fixed-nsswitch.h $(objfpx)fixed-nsswitch-libs: \ ++ $(objpfx)gen-fixed-nsswitch \ ++ $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG) ++ $< $(objpfx)fixed-nsswitch.h \ ++ $(objpfx)fixed-nsswitch-libs \ ++ $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG) ++ ++$(objpfx)gen-fixed-nsswitch: gen-fixed-nsswitch.c \ ++ $(common-objpfx)option-groups.config \ ++ $(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS) ++ $(native-compile) ++gen-fixed-nsswitch-CFLAGS = \ ++ -g3 -O -Wall \ ++ -I $(objpfx) \ ++ -DFIXED_FUNCTIONS='"$(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS)"' ++endif ++ + include ../Rules + + ifeq (yes,$(have-selinux)) +Index: git/nss/nsswitch.c +=================================================================== +--- git.orig/nss/nsswitch.c 2014-08-29 20:00:53.004070587 -0700 ++++ git/nss/nsswitch.c 2014-08-29 20:01:15.220070587 -0700 +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -41,6 +42,15 @@ + #include "../nscd/nscd_proto.h" + #include + ++/* When OPTION_EGLIBC_NSSWITCH is disabled, we use fixed tables of ++ databases and services, generated at library build time. Thus: ++ - We can't reconfigure individual databases, so we don't need a ++ name-to-database map. ++ - We never add databases or service libraries, or look up functions ++ at runtime, so there's no need for a lock to protect our tables. ++ See ../option-groups.def for the details. */ ++#if __OPTION_EGLIBC_NSSWITCH ++ + /* Prototypes for the local functions. */ + static name_database *nss_parse_file (const char *fname) internal_function; + static name_database_entry *nss_getline (char *line) internal_function; +@@ -79,6 +89,9 @@ + + __libc_lock_define_initialized (static, lock) + ++#define lock_nsswitch __libc_lock_lock (lock) ++#define unlock_nsswitch __libc_lock_unlock (lock) ++ + #if !defined DO_STATIC_NSS || defined SHARED + /* String with revision number of the shared object files. */ + static const char *const __nss_shlib_revision = LIBNSS_FILES_SO + 15; +@@ -93,6 +106,20 @@ + __libc_freeres. */ + static name_database_entry *defconfig_entries; + ++#else /* __OPTION_EGLIBC_NSSWITCH */ ++ ++/* Bring in the statically initialized service table we generated at ++ build time. */ ++#include "fixed-nsswitch.h" ++ ++const static name_database *service_table = &fixed_name_database; ++ ++/* Nothing ever changes, so there's no need to lock anything. */ ++#define lock_nsswitch (0) ++#define unlock_nsswitch (0) ++ ++#endif /* __OPTION_EGLIBC_NSSWITCH */ ++ + + #ifdef USE_NSCD + /* Nonzero if this is the nscd process. */ +@@ -109,20 +136,22 @@ + const char *defconfig, service_user **ni) + { + /* Prevent multiple threads to change the service table. */ +- __libc_lock_lock (lock); ++ lock_nsswitch; + + /* Reconsider database variable in case some other thread called + `__nss_configure_lookup' while we waited for the lock. */ + if (*ni != NULL) + { +- __libc_lock_unlock (lock); ++ unlock_nsswitch; + return 0; + } + ++#if __OPTION_EGLIBC_NSSWITCH + /* Are we initialized yet? */ + if (service_table == NULL) + /* Read config file. */ + service_table = nss_parse_file (_PATH_NSSWITCH_CONF); ++#endif + + /* Test whether configuration data is available. */ + if (service_table != NULL) +@@ -144,6 +173,7 @@ + *ni = entry->service; + } + ++#if __OPTION_EGLIBC_NSSWITCH + /* No configuration data is available, either because nsswitch.conf + doesn't exist or because it doesn't have a line for this database. + +@@ -166,13 +196,23 @@ + { + entry->next = defconfig_entries; + entry->service = *ni; +- entry->name[0] = '\0'; ++ entry->name = ""; + defconfig_entries = entry; + } + } + } ++#else ++ /* Without the dynamic behavior, we can't process defconfig. The ++ databases the user specified at library build time are all you ++ get. */ ++ if (*ni == NULL) ++ { ++ unlock_nsswitch; ++ return -1; ++ } ++#endif + +- __libc_lock_unlock (lock); ++ unlock_nsswitch; + + return *ni != NULL ? 0 : -1; + } +@@ -252,6 +292,7 @@ + libc_hidden_def (__nss_next2) + + ++#if __OPTION_EGLIBC_NSSWITCH + int + attribute_compat_text_section + __nss_next (service_user **ni, const char *fct_name, void **fctp, int status, +@@ -300,13 +341,13 @@ + } + + /* Prevent multiple threads to change the service table. */ +- __libc_lock_lock (lock); ++ lock_nsswitch; + + /* Install new rules. */ + *databases[cnt].dbp = new_db; + __nss_database_custom[cnt] = true; + +- __libc_lock_unlock (lock); ++ unlock_nsswitch; + + return 0; + } +@@ -402,7 +443,7 @@ + void **found, *result; + + /* We now modify global data. Protect it. */ +- __libc_lock_lock (lock); ++ lock_nsswitch; + + /* Search the tree of functions previously requested. Data in the + tree are `known_function' structures, whose first member is a +@@ -413,7 +454,7 @@ + enough to a pointer to our structure to use as a lookup key that + will be passed to `known_compare' (above). */ + +- found = __tsearch (&fct_name, &ni->known, &known_compare); ++ found = __tsearch (&fct_name, &ni->known.tree, &known_compare); + if (found == NULL) + /* This means out-of-memory. */ + result = NULL; +@@ -440,7 +481,7 @@ + #endif + /* Oops. We can't instantiate this node properly. + Remove it from the tree. */ +- __tdelete (&fct_name, &ni->known, &known_compare); ++ __tdelete (&fct_name, &ni->known.tree, &known_compare); + free (known); + result = NULL; + } +@@ -520,13 +561,43 @@ + } + + /* Remove the lock. */ +- __libc_lock_unlock (lock); ++ unlock_nsswitch; + + return result; + } + libc_hidden_def (__nss_lookup_function) + + ++#else /* below if ! __OPTION_EGLIBC_NSSWITCH */ ++ ++ ++int ++__nss_configure_lookup (const char *dbname, const char *service_line) ++{ ++ /* We can't dynamically configure lookup without ++ OPTION_EGLIBC_NSSWITCH. */ ++ __set_errno (EINVAL); ++ return -1; ++} ++ ++ ++void * ++__nss_lookup_function (service_user *ni, const char *fct_name) ++{ ++ int i; ++ const known_function **known = ni->known.array; ++ ++ for (i = 0; known[i]; i++) ++ if (strcmp (fct_name, known[i]->fct_name) == 0) ++ return known[i]->fct_ptr; ++ ++ return NULL; ++} ++libc_hidden_def (__nss_lookup_function) ++#endif ++ ++ ++#if __OPTION_EGLIBC_NSSWITCH + static name_database * + internal_function + nss_parse_file (const char *fname) +@@ -632,8 +703,10 @@ + + (line - name + 1)); + if (new_service == NULL) + return result; ++ new_service->name = (char *) (new_service + 1); + +- *((char *) __mempcpy (new_service->name, name, line - name)) = '\0'; ++ *((char *) __mempcpy ((char *) new_service->name, name, line - name)) ++ = '\0'; + + /* Set default actions. */ + new_service->actions[2 + NSS_STATUS_TRYAGAIN] = NSS_ACTION_CONTINUE; +@@ -642,7 +715,7 @@ + new_service->actions[2 + NSS_STATUS_SUCCESS] = NSS_ACTION_RETURN; + new_service->actions[2 + NSS_STATUS_RETURN] = NSS_ACTION_RETURN; + new_service->library = NULL; +- new_service->known = NULL; ++ new_service->known.tree = NULL; + new_service->next = NULL; + + while (isspace (line[0])) +@@ -778,9 +851,10 @@ + result = (name_database_entry *) malloc (sizeof (name_database_entry) + len); + if (result == NULL) + return NULL; ++ result->name = (char *) (result + 1); + + /* Save the database name. */ +- memcpy (result->name, name, len); ++ memcpy ((char *) result->name, name, len); + + /* Parse the list of services. */ + result->service = nss_parse_service_list (line); +@@ -816,6 +890,7 @@ + return *currentp; + } + #endif ++#endif /* __OPTION_EGLIBC_NSSWITCH */ + + + #if defined SHARED && defined USE_NSCD +@@ -834,6 +909,7 @@ + } + + ++#if __OPTION_EGLIBC_INET + /* Called by nscd and nscd alone. */ + void + __nss_disable_nscd (void (*cb) (size_t, struct traced_file *)) +@@ -857,8 +933,10 @@ + __nss_not_use_nscd_services = -1; + __nss_not_use_nscd_netgroup = -1; + } ++#endif /* __OPTION_EGLIBC_INET */ + #endif + ++#if __OPTION_EGLIBC_NSSWITCH + static void + free_database_entries (name_database_entry *entry) + { +@@ -871,8 +949,8 @@ + { + service_user *olds = service; + +- if (service->known != NULL) +- __tdestroy (service->known, free); ++ if (service->known.tree != NULL) ++ __tdestroy (service->known.tree, free); + + service = service->next; + free (olds); +@@ -926,3 +1004,4 @@ + + free (top); + } ++#endif /* __OPTION_EGLIBC_NSSWITCH */ +Index: git/nss/nsswitch.h +=================================================================== +--- git.orig/nss/nsswitch.h 2014-08-29 20:00:53.012070587 -0700 ++++ git/nss/nsswitch.h 2014-08-29 20:01:15.220070587 -0700 +@@ -65,10 +65,20 @@ + lookup_actions actions[5]; + /* Link to the underlying library object. */ + service_library *library; +- /* Collection of known functions. */ +- void *known; ++ /* Collection of known functions. ++ ++ With OPTION_EGLIBC_NSSWITCH enabled, this is the root of a ++ 'tsearch'-style tree. ++ ++ With OPTION_EGLIBC_NSSWITCH disabled, this is an array of ++ pointers to known_function structures, NULL-terminated. */ ++ union ++ { ++ void *tree; ++ const known_function **array; ++ } known; + /* Name of the service (`files', `dns', `nis', ...). */ +- char name[0]; ++ const char *name; + } service_user; + + /* To access the action based on the status value use this macro. */ +@@ -82,7 +92,7 @@ + /* List of service to be used. */ + service_user *service; + /* Name of the database. */ +- char name[0]; ++ const char *name; + } name_database_entry; + + +Index: git/posix/bug-regex1.c +=================================================================== +--- git.orig/posix/bug-regex1.c 2014-08-29 20:00:53.184070587 -0700 ++++ git/posix/bug-regex1.c 2014-08-29 20:01:15.220070587 -0700 +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + + int + main (void) +@@ -17,7 +18,9 @@ + memset (®ex, '\0', sizeof (regex)); + + setlocale (LC_ALL, "de_DE.ISO-8859-1"); ++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + fwide (stdout, -1); ++#endif + + re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_DEBUG); + +Index: git/posix/bug-regex6.c +=================================================================== +--- git.orig/posix/bug-regex6.c 2014-08-29 20:00:53.204070587 -0700 ++++ git/posix/bug-regex6.c 2014-08-29 20:01:15.220070587 -0700 +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + + int +@@ -30,7 +31,12 @@ + regex_t re; + regmatch_t mat[10]; + int i, j, ret = 0; +- const char *locales[] = { "C", "de_DE.UTF-8" }; ++ const char *locales[] = { ++ "C", ++#if __OPTION_EGLIBC_LOCALE_CODE ++ "de_DE.UTF-8" ++#endif ++ }; + const char *string = "http://www.regex.com/pattern/matching.html#intro"; + regmatch_t expect[10] = { + { 0, 48 }, { 0, 5 }, { 0, 4 }, { 5, 20 }, { 7, 20 }, { 20, 42 }, +Index: git/posix/fnmatch.c +=================================================================== +--- git.orig/posix/fnmatch.c 2014-08-29 20:00:53.208070587 -0700 ++++ git/posix/fnmatch.c 2014-08-29 20:01:15.220070587 -0700 +@@ -30,6 +30,10 @@ + #include + #include + ++#if defined _LIBC ++# include ++#endif ++ + #if defined STDC_HEADERS || defined _LIBC + # include + #endif +@@ -131,7 +135,7 @@ + # define ISWCTYPE(WC, WT) iswctype (WC, WT) + # endif + +-# if (HAVE_MBSTATE_T && HAVE_MBSRTOWCS) || _LIBC ++# if (HAVE_MBSTATE_T && HAVE_MBSRTOWCS) || (_LIBC && __OPTION_EGLIBC_LOCALE_CODE) + /* In this case we are implementing the multibyte character handling. */ + # define HANDLE_MULTIBYTE 1 + # endif +Index: git/posix/fnmatch_loop.c +=================================================================== +--- git.orig/posix/fnmatch_loop.c 2014-08-29 20:00:53.220070587 -0700 ++++ git/posix/fnmatch_loop.c 2014-08-29 20:01:15.220070587 -0700 +@@ -15,6 +15,8 @@ + License along with the GNU C Library; if not, see + . */ + ++#include ++ + #include + + struct STRUCT +@@ -54,10 +56,15 @@ + const char *collseq = (const char *) + _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC); + # else ++# if __OPTION_EGLIBC_LOCALE_CODE + const UCHAR *collseq = (const UCHAR *) + _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQMB); +-# endif +-#endif ++# define COLLSEQ_BYTE_LOOKUP(ix) (collseq[(ix)]) ++# else ++# define COLLSEQ_BYTE_LOOKUP(ix) (ix) ++# endif /* __OPTION_EGLIBC_LOCALE_CODE */ ++# endif /* WIDE_CHAR_VERSION */ ++#endif /* _LIBC */ + + while ((c = *p++) != L('\0')) + { +@@ -277,7 +284,7 @@ + /* Leave room for the null. */ + CHAR str[CHAR_CLASS_MAX_LENGTH + 1]; + size_t c1 = 0; +-#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) ++#if defined _LIBC ? __OPTION_POSIX_C_LANG_WIDE_CHAR : (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) + wctype_t wt; + #endif + const CHAR *startp = p; +@@ -307,7 +314,7 @@ + } + str[c1] = L('\0'); + +-#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) ++#if defined _LIBC ? __OPTION_POSIX_C_LANG_WIDE_CHAR : (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) + wt = IS_CHAR_CLASS (str); + if (wt == 0) + /* Invalid character class name. */ +@@ -681,8 +688,10 @@ + else + lcollseq = __collseq_table_lookup (collseq, cold); + # else +- fcollseq = collseq[fn]; +- lcollseq = is_seqval ? cold : collseq[(UCHAR) cold]; ++ fcollseq = COLLSEQ_BYTE_LOOKUP (fn); ++ lcollseq = (is_seqval ++ ? cold ++ : COLLSEQ_BYTE_LOOKUP ((UCHAR) cold)); + # endif + + is_seqval = 0; +@@ -858,7 +867,7 @@ + goto matched; + } + # else +- hcollseq = collseq[cend]; ++ hcollseq = COLLSEQ_BYTE_LOOKUP (cend); + # endif + } + +Index: git/posix/glob.c +=================================================================== +--- git.orig/posix/glob.c 2014-08-29 20:00:53.232070587 -0700 ++++ git/posix/glob.c 2014-08-29 20:01:15.220070587 -0700 +@@ -25,6 +25,9 @@ + #include + #include + #include ++#ifdef _LIBC ++# include ++#endif + + /* Outcomment the following line for production quality code. */ + /* #define NDEBUG 1 */ +@@ -607,6 +610,7 @@ + if (home_dir == NULL || home_dir[0] == '\0') + home_dir = "c:/users/default"; /* poor default */ + # else ++# if ! _LIBC || __OPTION_EGLIBC_GETLOGIN + if (home_dir == NULL || home_dir[0] == '\0') + { + int success; +@@ -623,19 +627,19 @@ + if (success) + { + struct passwd *p; +-# if defined HAVE_GETPWNAM_R || defined _LIBC ++# if defined HAVE_GETPWNAM_R || defined _LIBC + long int pwbuflen = GETPW_R_SIZE_MAX (); + char *pwtmpbuf; + struct passwd pwbuf; + int malloc_pwtmpbuf = 0; + int save = errno; + +-# ifndef _LIBC ++# ifndef _LIBC + if (pwbuflen == -1) + /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX. + Try a moderate value. */ + pwbuflen = 1024; +-# endif ++# endif + if (__libc_use_alloca (alloca_used + pwbuflen)) + pwtmpbuf = alloca_account (pwbuflen, alloca_used); + else +@@ -682,9 +686,9 @@ + } + __set_errno (save); + } +-# else ++# else + p = getpwnam (name); +-# endif ++# endif + if (p != NULL) + { + if (!malloc_pwtmpbuf) +@@ -713,6 +717,7 @@ + } + } + } ++# endif /* ! _LIBC || __OPTION_EGLIBC_GETLOGIN */ + if (home_dir == NULL || home_dir[0] == '\0') + { + if (flags & GLOB_TILDE_CHECK) +Index: git/posix/Makefile +=================================================================== +--- git.orig/posix/Makefile 2014-08-29 20:00:53.160070587 -0700 ++++ git/posix/Makefile 2014-08-29 20:01:15.220070587 -0700 +@@ -18,6 +18,8 @@ + # + # Sub-makefile for POSIX portion of the library. + # ++include ../option-groups.mak ++ + subdir := posix + + include ../Makeconfig +@@ -43,13 +45,24 @@ + getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid \ + getresuid getresgid setresuid setresgid \ + pathconf sysconf fpathconf \ +- glob glob64 fnmatch regex \ ++ glob glob64 fnmatch \ + confstr \ + getopt getopt1 getopt_init \ + sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax \ + sched_primin sched_rr_gi sched_getaffinity sched_setaffinity \ +- getaddrinfo gai_strerror wordexp \ + pread pwrite pread64 pwrite64 \ ++ posix_madvise \ ++ get_child_max sched_cpucount sched_cpualloc sched_cpufree ++ ++routines-$(OPTION_EGLIBC_INET) += getaddrinfo gai_strerror ++ ++ifeq (y,$(OPTION_POSIX_REGEXP_GLIBC)) ++routines-$(OPTION_POSIX_REGEXP) += regex ++else ++routines-$(OPTION_POSIX_REGEXP) += xregex ++endif ++ ++routines-$(OPTION_EGLIBC_SPAWN) += \ + spawn_faction_init spawn_faction_destroy spawn_faction_addclose \ + spawn_faction_addopen spawn_faction_adddup2 \ + spawnattr_init spawnattr_destroy \ +@@ -57,41 +70,53 @@ + spawnattr_getflags spawnattr_setflags \ + spawnattr_getpgroup spawnattr_setpgroup spawn spawnp spawni \ + spawnattr_getsigmask spawnattr_getschedpolicy spawnattr_getschedparam \ +- spawnattr_setsigmask spawnattr_setschedpolicy spawnattr_setschedparam \ +- posix_madvise \ +- get_child_max sched_cpucount sched_cpualloc sched_cpufree ++ spawnattr_setsigmask spawnattr_setschedpolicy spawnattr_setschedparam ++routines-$(OPTION_EGLIBC_WORDEXP) += wordexp + + aux := init-posix environ +-tests := tstgetopt testfnm runtests runptests \ ++tests := tstgetopt testfnm runtests \ + tst-preadwrite tst-preadwrite64 test-vfork regexbug1 \ +- tst-getlogin tst-mmap tst-getaddrinfo tst-truncate \ +- tst-truncate64 tst-fork tst-fnmatch tst-regexloc tst-dir \ +- tst-chmod bug-regex1 bug-regex2 bug-regex3 bug-regex4 \ +- tst-gnuglob tst-regex bug-regex5 bug-regex6 bug-regex7 \ +- bug-regex8 bug-regex9 bug-regex10 bug-regex11 bug-regex12 \ +- bug-regex13 bug-regex14 bug-regex15 bug-regex16 \ +- bug-regex17 bug-regex18 bug-regex19 bug-regex20 \ +- bug-regex21 bug-regex22 bug-regex23 bug-regex24 \ +- bug-regex25 bug-regex26 bug-regex27 bug-regex28 \ +- bug-regex29 bug-regex30 bug-regex31 bug-regex32 \ +- bug-regex33 tst-nice tst-nanosleep tst-regex2 \ +- transbug tst-rxspencer tst-pcre tst-boost \ +- bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \ +- tst-getaddrinfo2 bug-glob1 bug-glob2 bug-glob3 tst-sysconf \ ++ tst-getlogin tst-mmap tst-truncate \ ++ tst-truncate64 tst-fork tst-dir \ ++ tst-chmod bug-regex2 bug-regex3 bug-regex4 \ ++ tst-gnuglob bug-regex6 bug-regex7 \ ++ bug-regex8 bug-regex9 bug-regex10 bug-regex12 \ ++ bug-regex14 bug-regex15 \ ++ bug-regex21 bug-regex24 \ ++ bug-regex27 bug-regex28 bug-regex29 bug-regex30 \ ++ bug-regex31 \ ++ tst-nice tst-nanosleep \ ++ transbug \ ++ tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \ ++ bug-glob1 bug-glob2 bug-glob3 tst-sysconf \ + tst-execvp1 tst-execvp2 tst-execlp1 tst-execlp2 \ + tst-execv1 tst-execv2 tst-execl1 tst-execl2 \ + tst-execve1 tst-execve2 tst-execle1 tst-execle2 \ +- tst-execvp3 tst-execvp4 tst-rfc3484 tst-rfc3484-2 \ +- tst-rfc3484-3 \ +- tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \ ++ tst-execvp3 tst-execvp4 \ ++ tst-fnmatch2 tst-cpucount tst-cpuset \ + bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \ + bug-getopt5 tst-getopt_long1 bug-regex34 bug-regex35 \ + tst-pathconf tst-getaddrinfo4 tst-rxspencer-no-utf8 \ + tst-fnmatch3 bug-regex36 +-xtests := bug-ga2 ++tests-$(OPTION_EGLIBC_LOCALE_CODE) \ ++ += tst-fnmatch tst-regexloc bug-regex1 bug-regex5 \ ++ bug-regex23 bug-regex25 bug-regex32 bug-regex33 ++tests-$(OPTION_EGLIBC_INET) \ ++ += tst-getaddrinfo bug-ga1 tst-getaddrinfo2 \ ++ tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 tst-getaddrinfo3 ++tests-$(OPTION_POSIX_REGEXP_GLIBC) \ ++ += runptests bug-regex11 bug-regex13 bug-regex16 \ ++ tst-regex2 tst-rxspencer tst-pcre tst-boost ++ifeq (yy,$(OPTION_EGLIBC_LOCALE_CODE)$(OPTION_POSIX_REGEXP_GLIBC)) ++tests += tst-regex bug-regex17 bug-regex18 bug-regex19 bug-regex20 \ ++ bug-regex22 bug-regex26 ++endif ++xtests-$(OPTION_EGLIBC_INET) += bug-ga2 + ifeq (yes,$(build-shared)) + test-srcs := globtest +-tests += wordexp-test tst-exec tst-spawn ++tests += tst-exec ++tests-$(OPTION_EGLIBC_SPAWN) += tst-spawn ++tests-$(OPTION_EGLIBC_WORDEXP) += wordexp-test + endif + tests-static = tst-exec-static tst-spawn-static + tests += $(tests-static) +@@ -117,7 +142,10 @@ + + ifeq ($(run-built-tests),yes) + ifeq (yes,$(build-shared)) +-tests-special += $(objpfx)globtest.out $(objpfx)wordexp-tst.out ++tests-special += $(objpfx)globtest.out ++ifeq (y,$(OPTION_EGLIBC_WORDEXP)) ++tests-special += $(objpfx)wordexp-tst.out ++endif + endif + endif + +@@ -125,12 +153,16 @@ + # XXX Please note that for now we ignore the result of this test. + tests-special += $(objpfx)annexc.out + ifeq ($(run-built-tests),yes) +-tests-special += $(objpfx)bug-regex2-mem.out $(objpfx)bug-regex14-mem.out \ ++tests-special += $(objpfx)bug-regex2-mem.out \ + $(objpfx)bug-regex21-mem.out $(objpfx)bug-regex31-mem.out \ +- $(objpfx)tst-rxspencer-no-utf8-mem.out $(objpfx)tst-pcre-mem.out \ +- $(objpfx)tst-boost-mem.out $(objpfx)tst-getconf.out \ ++ $(objpfx)tst-getconf.out \ + $(objpfx)bug-glob2-mem.out $(objpfx)tst-vfork3-mem.out \ + $(objpfx)tst-fnmatch-mem.out $(objpfx)bug-regex36-mem.out ++ifeq (y,$(OPTION_POSIX_REGEXP_GLIBC)) ++tests-special += $(objpfx)bug-regex14-mem $(objpfx)tst-rxspencer-no-utf8-mem \ ++ $(objpfx)tst-pcre-mem $(objpfx)tst-boost-mem ++endif ++ + xtests-special += $(objpfx)bug-ga2-mem.out + endif + +@@ -143,6 +175,8 @@ + $(SHELL) $< $(common-objpfx) '$(test-via-rtld-prefix)' \ + '$(test-program-prefix)' '$(test-wrapper-env)'; \ + $(evaluate-test) ++LDLIBS-globtest += $(shell cat $(common-objpfx)nss/fixed-nsswitch-libs) ++ + $(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test + $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \ + '$(run-program-env)' '$(test-program-prefix-after-env)'; \ +@@ -205,7 +239,10 @@ + tst-chmod-ARGS = $(objdir) + tst-vfork3-ARGS = --test-dir=$(objpfx) + +-tst-rxspencer-ARGS = --utf8 rxspencer/tests ++tst-rxspencer-ARGS = rxspencer/tests ++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE)) ++tst-rxspencer-ARGS += --utf8 ++endif + tst-rxspencer-no-utf8-ARGS = rxspencer/tests + tst-pcre-ARGS = PCRE.tests + tst-boost-ARGS = BOOST.tests +Index: git/posix/regcomp.c +=================================================================== +--- git.orig/posix/regcomp.c 2014-08-29 20:00:53.264070587 -0700 ++++ git/posix/regcomp.c 2014-08-29 20:01:15.224070587 -0700 +@@ -18,6 +18,7 @@ + . */ + + #include ++#include + + static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern, + size_t length, reg_syntax_t syntax); +@@ -305,7 +306,7 @@ + { + re_dfa_t *dfa = (re_dfa_t *) bufp->buffer; + int node_cnt; +- int icase = (dfa->mb_cur_max == 1 && (bufp->syntax & RE_ICASE)); ++ int icase = (dfa_mb_cur_max (dfa) == 1 && (bufp->syntax & RE_ICASE)); + for (node_cnt = 0; node_cnt < init_state->nodes.nelem; ++node_cnt) + { + int node = init_state->nodes.elems[node_cnt]; +@@ -315,9 +316,9 @@ + { + re_set_fastmap (fastmap, icase, dfa->nodes[node].opr.c); + #ifdef RE_ENABLE_I18N +- if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1) ++ if ((bufp->syntax & RE_ICASE) && dfa_mb_cur_max (dfa) > 1) + { +- unsigned char *buf = alloca (dfa->mb_cur_max), *p; ++ unsigned char *buf = alloca (dfa_mb_cur_max (dfa)), *p; + wchar_t wc; + mbstate_t state; + +@@ -348,7 +349,11 @@ + re_set_fastmap (fastmap, icase, ch); + } + } +-#ifdef RE_ENABLE_I18N ++ ++ /* When OPTION_EGLIBC_LOCALE_CODE is disabled, the current ++ locale is always C, which has no rules and no multi-byte ++ characters. */ ++#if defined RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE + else if (type == COMPLEX_BRACKET) + { + re_charset_t *cset = dfa->nodes[node].opr.mbcset; +@@ -376,7 +381,7 @@ + i.e. where we would not find an invalid sequence. This only + applies to multibyte character sets; for single byte character + sets, the SIMPLE_BRACKET again suffices. */ +- if (dfa->mb_cur_max > 1 ++ if (dfa_mb_cur_max (dfa) > 1 + && (cset->nchar_classes || cset->non_match || cset->nranges + # ifdef _LIBC + || cset->nequiv_classes +@@ -404,7 +409,7 @@ + memset (&state, '\0', sizeof (state)); + if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1) + re_set_fastmap (fastmap, icase, *(unsigned char *) buf); +- if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1) ++ if ((bufp->syntax & RE_ICASE) && dfa_mb_cur_max (dfa) > 1) + { + if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state) + != (size_t) -1) +@@ -413,7 +418,7 @@ + } + } + } +-#endif /* RE_ENABLE_I18N */ ++#endif /* RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE */ + else if (type == OP_PERIOD + #ifdef RE_ENABLE_I18N + || type == OP_UTF8_PERIOD +@@ -856,11 +861,15 @@ + + dfa->mb_cur_max = MB_CUR_MAX; + #ifdef _LIBC +- if (dfa->mb_cur_max == 6 ++ if (dfa_mb_cur_max (dfa) == 6 + && strcmp (_NL_CURRENT (LC_CTYPE, _NL_CTYPE_CODESET_NAME), "UTF-8") == 0) + dfa->is_utf8 = 1; ++# if __OPTION_EGLIBC_LOCALE_CODE + dfa->map_notascii = (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_TO_NONASCII) + != 0); ++# else ++ dfa->map_notascii = 0; ++# endif + #else + # ifdef HAVE_LANGINFO_CODESET + codeset_name = nl_langinfo (CODESET); +@@ -886,7 +895,7 @@ + #endif + + #ifdef RE_ENABLE_I18N +- if (dfa->mb_cur_max > 1) ++ if (dfa_mb_cur_max (dfa) > 1) + { + if (dfa->is_utf8) + dfa->sb_char = (re_bitset_ptr_t) utf8_sb_map; +@@ -1784,7 +1793,7 @@ + token->word_char = 0; + #ifdef RE_ENABLE_I18N + token->mb_partial = 0; +- if (input->mb_cur_max > 1 && ++ if (string_mb_cur_max (input) > 1 && + !re_string_first_byte (input, re_string_cur_idx (input))) + { + token->type = CHARACTER; +@@ -1805,7 +1814,7 @@ + token->opr.c = c2; + token->type = CHARACTER; + #ifdef RE_ENABLE_I18N +- if (input->mb_cur_max > 1) ++ if (string_mb_cur_max (input) > 1) + { + wint_t wc = re_string_wchar_at (input, + re_string_cur_idx (input) + 1); +@@ -1919,7 +1928,7 @@ + + token->type = CHARACTER; + #ifdef RE_ENABLE_I18N +- if (input->mb_cur_max > 1) ++ if (string_mb_cur_max (input) > 1) + { + wint_t wc = re_string_wchar_at (input, re_string_cur_idx (input)); + token->word_char = IS_WIDE_WORD_CHAR (wc) != 0; +@@ -2019,7 +2028,7 @@ + token->opr.c = c; + + #ifdef RE_ENABLE_I18N +- if (input->mb_cur_max > 1 && ++ if (string_mb_cur_max (input) > 1 && + !re_string_first_byte (input, re_string_cur_idx (input))) + { + token->type = CHARACTER; +@@ -2242,7 +2251,7 @@ + return NULL; + } + #ifdef RE_ENABLE_I18N +- if (dfa->mb_cur_max > 1) ++ if (dfa_mb_cur_max (dfa) > 1) + { + while (!re_string_eoi (regexp) + && !re_string_first_byte (regexp, re_string_cur_idx (regexp))) +@@ -2380,7 +2389,7 @@ + *err = REG_ESPACE; + return NULL; + } +- if (dfa->mb_cur_max > 1) ++ if (dfa_mb_cur_max (dfa) > 1) + dfa->has_mb_node = 1; + break; + case OP_WORD: +@@ -2686,7 +2695,7 @@ + However, for !_LIBC we have no collation elements: if the + character set is single byte, the single byte character set + that we build below suffices. parse_bracket_exp passes +- no MBCSET if dfa->mb_cur_max == 1. */ ++ no MBCSET if dfa_mb_cur_max (dfa) == 1. */ + if (mbcset) + { + /* Check the space of the arrays. */ +@@ -2782,7 +2791,13 @@ + reg_syntax_t syntax, reg_errcode_t *err) + { + #ifdef _LIBC ++#if __OPTION_EGLIBC_LOCALE_CODE + const unsigned char *collseqmb; ++# define COLLSEQMB_LOOKUP(ix) (collseqmb[(ix)]) ++#else ++# define COLLSEQMB_LOOKUP(ix) (ix) ++#endif ++ + const char *collseqwc; + uint32_t nrules; + int32_t table_size; +@@ -2830,18 +2845,20 @@ + if (MB_CUR_MAX == 1) + */ + if (nrules == 0) +- return collseqmb[br_elem->opr.ch]; ++ return COLLSEQMB_LOOKUP (br_elem->opr.ch); + else + { + wint_t wc = __btowc (br_elem->opr.ch); + return __collseq_table_lookup (collseqwc, wc); + } + } ++#if __OPTION_EGLIBC_LOCALE_CODE + else if (br_elem->type == MB_CHAR) + { + if (nrules != 0) + return __collseq_table_lookup (collseqwc, br_elem->opr.wch); + } ++#endif + else if (br_elem->type == COLL_SYM) + { + size_t sym_name_len = strlen ((char *) br_elem->opr.name); +@@ -2872,11 +2889,11 @@ + { + /* No valid character. Match it as a single byte + character. */ +- return collseqmb[br_elem->opr.name[0]]; ++ return COLLSEQMB_LOOKUP (br_elem->opr.name[0]); + } + } + else if (sym_name_len == 1) +- return collseqmb[br_elem->opr.name[0]]; ++ return COLLSEQMB_LOOKUP (br_elem->opr.name[0]); + } + return UINT_MAX; + } +@@ -2916,7 +2933,7 @@ + However, if we have no collation elements, and the character set + is single byte, the single byte character set that we + build below suffices. */ +- if (nrules > 0 || dfa->mb_cur_max > 1) ++ if (nrules > 0 || dfa_mb_cur_max (dfa) > 1) + { + /* Check the space of the arrays. */ + if (BE (*range_alloc == mbcset->nranges, 0)) +@@ -2953,7 +2970,7 @@ + if (MB_CUR_MAX == 1) + */ + if (nrules == 0) +- ch_collseq = collseqmb[ch]; ++ ch_collseq = COLLSEQMB_LOOKUP (ch); + else + ch_collseq = __collseq_table_lookup (collseqwc, __btowc (ch)); + if (start_collseq <= ch_collseq && ch_collseq <= end_collseq) +@@ -3031,7 +3048,10 @@ + re_bitset_ptr_t sbcset; + #ifdef RE_ENABLE_I18N + re_charset_t *mbcset; +- int coll_sym_alloc = 0, range_alloc = 0, mbchar_alloc = 0; ++ int coll_sym_alloc = 0, range_alloc = 0; ++#if __OPTION_EGLIBC_LOCALE_CODE ++ int mbchar_alloc = 0; ++#endif + int equiv_class_alloc = 0, char_class_alloc = 0; + #endif /* not RE_ENABLE_I18N */ + int non_match = 0; +@@ -3039,9 +3059,15 @@ + int token_len; + int first_round = 1; + #ifdef _LIBC ++#if __OPTION_EGLIBC_LOCALE_CODE + collseqmb = (const unsigned char *) + _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQMB); + nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); ++#else ++ /* This is true when OPTION_EGLIBC_LOCALE_CODE is disabled, but the ++ compiler can't figure that out. */ ++ nrules = 0; ++#endif + if (nrules) + { + /* +@@ -3169,7 +3195,7 @@ + #else + # ifdef RE_ENABLE_I18N + *err = build_range_exp (sbcset, +- dfa->mb_cur_max > 1 ? mbcset : NULL, ++ dfa_mb_cur_max (dfa) > 1 ? mbcset : NULL, + &range_alloc, &start_elem, &end_elem); + # else + *err = build_range_exp (sbcset, &start_elem, &end_elem); +@@ -3185,7 +3211,7 @@ + case SB_CHAR: + bitset_set (sbcset, start_elem.opr.ch); + break; +-#ifdef RE_ENABLE_I18N ++#if defined RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE + case MB_CHAR: + /* Check whether the array has enough space. */ + if (BE (mbchar_alloc == mbcset->nmbchars, 0)) +@@ -3203,7 +3229,7 @@ + } + mbcset->mbchars[mbcset->nmbchars++] = start_elem.opr.wch; + break; +-#endif /* RE_ENABLE_I18N */ ++#endif /* RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE */ + case EQUIV_CLASS: + *err = build_equiv_class (sbcset, + #ifdef RE_ENABLE_I18N +@@ -3253,11 +3279,11 @@ + + #ifdef RE_ENABLE_I18N + /* Ensure only single byte characters are set. */ +- if (dfa->mb_cur_max > 1) ++ if (dfa_mb_cur_max (dfa) > 1) + bitset_mask (sbcset, dfa->sb_char); + + if (mbcset->nmbchars || mbcset->ncoll_syms || mbcset->nequiv_classes +- || mbcset->nranges || (dfa->mb_cur_max > 1 && (mbcset->nchar_classes ++ || mbcset->nranges || (dfa_mb_cur_max (dfa) > 1 && (mbcset->nchar_classes + || mbcset->non_match))) + { + bin_tree_t *mbc_tree; +@@ -3326,7 +3352,7 @@ + re_token_t *token, int token_len, re_dfa_t *dfa, + reg_syntax_t syntax, int accept_hyphen) + { +-#ifdef RE_ENABLE_I18N ++#if defined RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE + int cur_char_size; + cur_char_size = re_string_char_size_at (regexp, re_string_cur_idx (regexp)); + if (cur_char_size > 1) +@@ -3336,7 +3362,7 @@ + re_string_skip_bytes (regexp, cur_char_size); + return REG_NOERROR; + } +-#endif /* RE_ENABLE_I18N */ ++#endif /* RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE */ + re_string_skip_bytes (regexp, token_len); /* Skip a token. */ + if (token->type == OP_OPEN_COLL_ELEM || token->type == OP_OPEN_CHAR_CLASS + || token->type == OP_OPEN_EQUIV_CLASS) +@@ -3416,7 +3442,9 @@ + build_equiv_class (bitset_t sbcset, const unsigned char *name) + #endif /* not RE_ENABLE_I18N */ + { +-#ifdef _LIBC ++ /* When __OPTION_EGLIBC_LOCALE_CODE is disabled, only the C locale ++ is supported; it has no collation rules. */ ++#if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE + uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); + if (nrules != 0) + { +@@ -3488,7 +3516,7 @@ + mbcset->equiv_classes[mbcset->nequiv_classes++] = idx1; + } + else +-#endif /* _LIBC */ ++#endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */ + { + if (BE (strlen ((const char *) name) != 1, 0)) + return REG_ECOLLATE; +@@ -3522,7 +3550,7 @@ + && (strcmp (name, "upper") == 0 || strcmp (name, "lower") == 0)) + name = "alpha"; + +-#ifdef RE_ENABLE_I18N ++#if defined RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE + /* Check the space of the arrays. */ + if (BE (*char_class_alloc == mbcset->nchar_classes, 0)) + { +@@ -3538,7 +3566,7 @@ + *char_class_alloc = new_char_class_alloc; + } + mbcset->char_classes[mbcset->nchar_classes++] = __wctype (name); +-#endif /* RE_ENABLE_I18N */ ++#endif /* RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE */ + + #define BUILD_CHARCLASS_LOOP(ctype_func) \ + do { \ +@@ -3649,7 +3677,7 @@ + + #ifdef RE_ENABLE_I18N + /* Ensure only single byte characters are set. */ +- if (dfa->mb_cur_max > 1) ++ if (dfa_mb_cur_max (dfa) > 1) + bitset_mask (sbcset, dfa->sb_char); + #endif + +@@ -3661,7 +3689,7 @@ + goto build_word_op_espace; + + #ifdef RE_ENABLE_I18N +- if (dfa->mb_cur_max > 1) ++ if (dfa_mb_cur_max (dfa) > 1) + { + bin_tree_t *mbc_tree; + /* Build a tree for complex bracket. */ +Index: git/posix/regexec.c +=================================================================== +--- git.orig/posix/regexec.c 2014-08-29 20:00:53.268070587 -0700 ++++ git/posix/regexec.c 2014-08-29 20:01:15.224070587 -0700 +@@ -18,6 +18,7 @@ + . */ + + #include ++#include + + static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags, + int n) internal_function; +@@ -186,11 +187,11 @@ + static int check_node_accept_bytes (const re_dfa_t *dfa, int node_idx, + const re_string_t *input, int idx) + internal_function; +-# ifdef _LIBC ++# if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE + static unsigned int find_collation_sequence_value (const unsigned char *mbs, + size_t name_len) + internal_function; +-# endif /* _LIBC */ ++# endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */ + #endif /* RE_ENABLE_I18N */ + static int group_nodes_into_DFAstates (const re_dfa_t *dfa, + const re_dfastate_t *state, +@@ -255,25 +256,9 @@ + return err != REG_NOERROR; + } + +-#ifdef _LIBC +-# include +-versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4); +- +-# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) +-__typeof__ (__regexec) __compat_regexec; +- +-int +-attribute_compat_text_section +-__compat_regexec (const regex_t *__restrict preg, +- const char *__restrict string, size_t nmatch, +- regmatch_t pmatch[], int eflags) +-{ +- return regexec (preg, string, nmatch, pmatch, +- eflags & (REG_NOTBOL | REG_NOTEOL)); +-} +-compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0); +-# endif +-#endif ++/* EGLIBC: The code that used to be here was move to a separate file ++ so that it can be shared with xregex.c. */ ++#include "regexec-compat.c" + + /* Entry points for GNU code. */ + +@@ -728,7 +713,7 @@ + incr = (range < 0) ? -1 : 1; + left_lim = (range < 0) ? start + range : start; + right_lim = (range < 0) ? start : start + range; +- sb = dfa->mb_cur_max == 1; ++ sb = dfa_mb_cur_max (dfa) == 1; + match_kind = + (fastmap + ? ((sb || !(preg->syntax & RE_ICASE || t) ? 4 : 0) +@@ -3448,7 +3433,7 @@ + if (BE (dest_states_word[i] == NULL && err != REG_NOERROR, 0)) + goto out_free; + +- if (dest_states[i] != dest_states_word[i] && dfa->mb_cur_max > 1) ++ if (dest_states[i] != dest_states_word[i] && dfa_mb_cur_max (dfa) > 1) + need_word_trtable = 1; + + dest_states_nl[i] = re_acquire_state_context (&err, dfa, &follows, +@@ -3590,7 +3575,7 @@ + else if (type == OP_PERIOD) + { + #ifdef RE_ENABLE_I18N +- if (dfa->mb_cur_max > 1) ++ if (dfa_mb_cur_max (dfa) > 1) + bitset_merge (accepts, dfa->sb_char); + else + #endif +@@ -3641,7 +3626,7 @@ + continue; + } + #ifdef RE_ENABLE_I18N +- if (dfa->mb_cur_max > 1) ++ if (dfa_mb_cur_max (dfa) > 1) + for (j = 0; j < BITSET_WORDS; ++j) + any_set |= (accepts[j] &= (dfa->word_char[j] | ~dfa->sb_char[j])); + else +@@ -3660,7 +3645,7 @@ + continue; + } + #ifdef RE_ENABLE_I18N +- if (dfa->mb_cur_max > 1) ++ if (dfa_mb_cur_max (dfa) > 1) + for (j = 0; j < BITSET_WORDS; ++j) + any_set |= (accepts[j] &= ~(dfa->word_char[j] & dfa->sb_char[j])); + else +@@ -3832,12 +3817,6 @@ + if (node->type == COMPLEX_BRACKET) + { + const re_charset_t *cset = node->opr.mbcset; +-# ifdef _LIBC +- const unsigned char *pin +- = ((const unsigned char *) re_string_get_buffer (input) + str_idx); +- int j; +- uint32_t nrules; +-# endif /* _LIBC */ + int match_len = 0; + wchar_t wc = ((cset->nranges || cset->nchar_classes || cset->nmbchars) + ? re_string_wchar_at (input, str_idx) : 0); +@@ -3849,6 +3828,7 @@ + match_len = char_len; + goto check_node_accept_bytes_match; + } ++#if __OPTION_EGLIBC_LOCALE_CODE + /* match with character_class? */ + for (i = 0; i < cset->nchar_classes; ++i) + { +@@ -3859,8 +3839,16 @@ + goto check_node_accept_bytes_match; + } + } ++#endif ++ ++ /* When __OPTION_EGLIBC_LOCALE_CODE is disabled, only the C ++ locale is supported; it has no collation rules. */ ++# if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE ++ const unsigned char *pin ++ = ((const unsigned char *) re_string_get_buffer (input) + str_idx); ++ int j; ++ uint32_t nrules; + +-# ifdef _LIBC + nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); + if (nrules != 0) + { +@@ -3953,8 +3941,12 @@ + } + } + else +-# endif /* _LIBC */ ++# endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */ + { ++ /* In the _LIBC version, if OPTION_EGLIBC_LOCALE_CODE is ++ disabled, there can be no multibyte range endpoints, and ++ cset->nranges is always zero. */ ++#if __OPTION_EGLIBC_LOCALE_CODE + /* match with range expression? */ + #if __GNUC__ >= 2 + wchar_t cmp_buf[] = {L'\0', L'\0', wc, L'\0', L'\0', L'\0'}; +@@ -3973,6 +3965,7 @@ + goto check_node_accept_bytes_match; + } + } ++#endif /* __OPTION_EGLIBC_LOCALE_CODE */ + } + check_node_accept_bytes_match: + if (!cset->non_match) +@@ -3988,7 +3981,7 @@ + return 0; + } + +-# ifdef _LIBC ++# if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE + static unsigned int + internal_function + find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len) +@@ -4046,7 +4039,7 @@ + return UINT_MAX; + } + } +-# endif /* _LIBC */ ++# endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */ + #endif /* RE_ENABLE_I18N */ + + /* Check whether the node accepts the byte which is IDX-th +@@ -4137,7 +4130,7 @@ + if (pstr->icase) + { + #ifdef RE_ENABLE_I18N +- if (pstr->mb_cur_max > 1) ++ if (string_mb_cur_max (pstr) > 1) + { + ret = build_wcs_upper_buffer (pstr); + if (BE (ret != REG_NOERROR, 0)) +@@ -4150,7 +4143,7 @@ + else + { + #ifdef RE_ENABLE_I18N +- if (pstr->mb_cur_max > 1) ++ if (string_mb_cur_max (pstr) > 1) + build_wcs_buffer (pstr); + else + #endif /* RE_ENABLE_I18N */ +Index: git/posix/regexec-compat.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/posix/regexec-compat.c 2014-08-29 20:01:15.224070587 -0700 +@@ -0,0 +1,39 @@ ++/* Extended regular expression matching and search library. ++ Copyright (C) 2008 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Isamu Hasegawa . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#ifdef _LIBC ++# include ++versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4); ++ ++# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) ++__typeof__ (__regexec) __compat_regexec; ++ ++int ++attribute_compat_text_section ++__compat_regexec (const regex_t *__restrict preg, ++ const char *__restrict string, size_t nmatch, ++ regmatch_t pmatch[], int eflags) ++{ ++ return regexec (preg, string, nmatch, pmatch, ++ eflags & (REG_NOTBOL | REG_NOTEOL)); ++} ++compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0); ++# endif ++#endif +Index: git/posix/regex.h +=================================================================== +--- git.orig/posix/regex.h 2014-08-29 20:00:53.264070587 -0700 ++++ git/posix/regex.h 2014-08-29 20:01:15.224070587 -0700 +@@ -21,6 +21,7 @@ + #define _REGEX_H 1 + + #include ++#include + + /* Allow the use in C++ code. */ + #ifdef __cplusplus +@@ -156,6 +157,8 @@ + treated as 'a\{1'. */ + # define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1) + ++/* EGLIBC: Old regex implementation does not support these. */ ++# ifdef __OPTION_POSIX_REGEXP_GLIBC + /* If this bit is set, then ignore case when matching. + If not set, then case is significant. */ + # define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1) +@@ -172,6 +175,7 @@ + /* If this bit is set, then no_sub will be set to 1 during + re_compile_pattern. */ + # define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1) ++# endif /* __OPTION_POSIX_REGEXP_GLIBC */ + #endif + + /* This global variable defines the particular regexp syntax to use (for +@@ -231,8 +235,13 @@ + (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \ + | RE_INTERVALS | RE_NO_EMPTY_RANGES) + ++#ifdef __OPTION_POSIX_REGEXP_GLIBC + #define RE_SYNTAX_POSIX_BASIC \ + (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP) ++#else ++#define RE_SYNTAX_POSIX_BASIC \ ++ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM) ++#endif + + /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes + RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this +@@ -298,9 +307,11 @@ + /* Like REG_NOTBOL, except for the end-of-line. */ + #define REG_NOTEOL (1 << 1) + ++#ifdef __OPTION_POSIX_REGEXP_GLIBC + /* Use PMATCH[0] to delimit the start and end of the search in the + buffer. */ + #define REG_STARTEND (1 << 2) ++#endif + + + /* If any error codes are removed, changed, or added, update the +Index: git/posix/regex_internal.c +=================================================================== +--- git.orig/posix/regex_internal.c 2014-08-29 20:00:53.264070587 -0700 ++++ git/posix/regex_internal.c 2014-08-29 20:01:15.224070587 -0700 +@@ -43,8 +43,8 @@ + int init_buf_len; + + /* Ensure at least one character fits into the buffers. */ +- if (init_len < dfa->mb_cur_max) +- init_len = dfa->mb_cur_max; ++ if (init_len < dfa_mb_cur_max (dfa)) ++ init_len = dfa_mb_cur_max (dfa); + init_buf_len = (len + 1 < init_len) ? len + 1: init_len; + re_string_construct_common (str, len, pstr, trans, icase, dfa); + +@@ -55,7 +55,7 @@ + pstr->word_char = dfa->word_char; + pstr->word_ops_used = dfa->word_ops_used; + pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str; +- pstr->valid_len = (pstr->mbs_allocated || dfa->mb_cur_max > 1) ? 0 : len; ++ pstr->valid_len = (pstr->mbs_allocated || dfa_mb_cur_max (dfa) > 1) ? 0 : len; + pstr->valid_raw_len = pstr->valid_len; + return REG_NOERROR; + } +@@ -82,7 +82,7 @@ + if (icase) + { + #ifdef RE_ENABLE_I18N +- if (dfa->mb_cur_max > 1) ++ if (dfa_mb_cur_max (dfa) > 1) + { + while (1) + { +@@ -91,7 +91,7 @@ + return ret; + if (pstr->valid_raw_len >= len) + break; +- if (pstr->bufs_len > pstr->valid_len + dfa->mb_cur_max) ++ if (pstr->bufs_len > pstr->valid_len + dfa_mb_cur_max (dfa)) + break; + ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2); + if (BE (ret != REG_NOERROR, 0)) +@@ -105,7 +105,7 @@ + else + { + #ifdef RE_ENABLE_I18N +- if (dfa->mb_cur_max > 1) ++ if (dfa_mb_cur_max (dfa) > 1) + build_wcs_buffer (pstr); + else + #endif /* RE_ENABLE_I18N */ +@@ -130,7 +130,7 @@ + re_string_realloc_buffers (re_string_t *pstr, int new_buf_len) + { + #ifdef RE_ENABLE_I18N +- if (pstr->mb_cur_max > 1) ++ if (string_mb_cur_max (pstr) > 1) + { + wint_t *new_wcs; + +@@ -177,7 +177,7 @@ + pstr->trans = trans; + pstr->icase = icase ? 1 : 0; + pstr->mbs_allocated = (trans != NULL || icase); +- pstr->mb_cur_max = dfa->mb_cur_max; ++ pstr->mb_cur_max = dfa_mb_cur_max (dfa); + pstr->is_utf8 = dfa->is_utf8; + pstr->map_notascii = dfa->map_notascii; + pstr->stop = pstr->len; +@@ -203,7 +203,7 @@ + { + #ifdef _LIBC + unsigned char buf[MB_LEN_MAX]; +- assert (MB_LEN_MAX >= pstr->mb_cur_max); ++ assert (MB_LEN_MAX >= string_mb_cur_max (pstr)); + #else + unsigned char buf[64]; + #endif +@@ -226,7 +226,7 @@ + { + int i, ch; + +- for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i) ++ for (i = 0; i < string_mb_cur_max (pstr) && i < remain_len; ++i) + { + ch = pstr->raw_mbs [pstr->raw_mbs_idx + byte_idx + i]; + buf[i] = pstr->mbs[byte_idx + i] = pstr->trans[ch]; +@@ -275,7 +275,7 @@ + size_t mbclen; + #ifdef _LIBC + char buf[MB_LEN_MAX]; +- assert (MB_LEN_MAX >= pstr->mb_cur_max); ++ assert (MB_LEN_MAX >= string_mb_cur_max (pstr)); + #else + char buf[64]; + #endif +@@ -369,7 +369,7 @@ + { + int i, ch; + +- for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i) ++ for (i = 0; i < string_mb_cur_max (pstr) && i < remain_len; ++i) + { + ch = pstr->raw_mbs [pstr->raw_mbs_idx + src_idx + i]; + buf[i] = pstr->trans[ch]; +@@ -567,8 +567,9 @@ + } + + /* This function re-construct the buffers. +- Concretely, convert to wide character in case of pstr->mb_cur_max > 1, +- convert to upper case in case of REG_ICASE, apply translation. */ ++ Concretely, convert to wide character in case of ++ string_mb_cur_max (pstr) > 1, convert to upper case in case of ++ REG_ICASE, apply translation. */ + + static reg_errcode_t + internal_function __attribute_warn_unused_result__ +@@ -579,7 +580,7 @@ + { + /* Reset buffer. */ + #ifdef RE_ENABLE_I18N +- if (pstr->mb_cur_max > 1) ++ if (string_mb_cur_max (pstr) > 1) + memset (&pstr->cur_state, '\0', sizeof (mbstate_t)); + #endif /* RE_ENABLE_I18N */ + pstr->len = pstr->raw_len; +@@ -670,7 +671,7 @@ + pstr->tip_context = re_string_context_at (pstr, offset - 1, + eflags); + #ifdef RE_ENABLE_I18N +- if (pstr->mb_cur_max > 1) ++ if (string_mb_cur_max (pstr) > 1) + memmove (pstr->wcs, pstr->wcs + offset, + (pstr->valid_len - offset) * sizeof (wint_t)); + #endif /* RE_ENABLE_I18N */ +@@ -699,7 +700,7 @@ + #endif + pstr->valid_len = 0; + #ifdef RE_ENABLE_I18N +- if (pstr->mb_cur_max > 1) ++ if (string_mb_cur_max (pstr) > 1) + { + int wcs_idx; + wint_t wc = WEOF; +@@ -711,7 +712,7 @@ + /* Special case UTF-8. Multi-byte chars start with any + byte other than 0x80 - 0xbf. */ + raw = pstr->raw_mbs + pstr->raw_mbs_idx; +- end = raw + (offset - pstr->mb_cur_max); ++ end = raw + (offset - string_mb_cur_max (pstr)); + if (end < pstr->raw_mbs) + end = pstr->raw_mbs; + p = raw + offset - 1; +@@ -803,7 +804,7 @@ + + /* Then build the buffers. */ + #ifdef RE_ENABLE_I18N +- if (pstr->mb_cur_max > 1) ++ if (string_mb_cur_max (pstr) > 1) + { + if (pstr->icase) + { +@@ -841,7 +842,7 @@ + return re_string_peek_byte (pstr, idx); + + #ifdef RE_ENABLE_I18N +- if (pstr->mb_cur_max > 1 ++ if (string_mb_cur_max (pstr) > 1 + && ! re_string_is_single_byte_char (pstr, pstr->cur_idx + idx)) + return re_string_peek_byte (pstr, idx); + #endif +@@ -930,7 +931,7 @@ + return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF + : CONTEXT_NEWLINE | CONTEXT_ENDBUF); + #ifdef RE_ENABLE_I18N +- if (input->mb_cur_max > 1) ++ if (string_mb_cur_max (input) > 1) + { + wint_t wc; + int wc_idx = idx; +@@ -1444,7 +1445,7 @@ + dfa->nodes[dfa->nodes_len].constraint = 0; + #ifdef RE_ENABLE_I18N + dfa->nodes[dfa->nodes_len].accept_mb = +- (type == OP_PERIOD && dfa->mb_cur_max > 1) || type == COMPLEX_BRACKET; ++ (type == OP_PERIOD && dfa_mb_cur_max (dfa) > 1) || type == COMPLEX_BRACKET; + #endif + dfa->nexts[dfa->nodes_len] = -1; + re_node_set_init_empty (dfa->edests + dfa->nodes_len); +Index: git/posix/regex_internal.h +=================================================================== +--- git.orig/posix/regex_internal.h 2014-08-29 20:00:53.264070587 -0700 ++++ git/posix/regex_internal.h 2014-08-29 20:01:15.224070587 -0700 +@@ -26,6 +26,10 @@ + #include + #include + ++#if defined _LIBC ++# include ++#endif ++ + #if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC + # include + #endif +@@ -370,6 +374,13 @@ + }; + typedef struct re_string_t re_string_t; + ++/* When OPTION_EGLIBC_LOCALE_CODE is disabled, this is always 1; ++ help the compiler make use of that fact. */ ++#if __OPTION_EGLIBC_LOCALE_CODE ++# define string_mb_cur_max(str) ((str)->mb_cur_max + 0) ++#else ++# define string_mb_cur_max(str) (1) ++#endif + + struct re_dfa_t; + typedef struct re_dfa_t re_dfa_t; +@@ -655,6 +666,14 @@ + __libc_lock_define (, lock) + }; + ++/* When OPTION_EGLIBC_LOCALE_CODE is disabled, this is always 1; ++ help the compiler make use of that fact. */ ++#if __OPTION_EGLIBC_LOCALE_CODE ++# define dfa_mb_cur_max(dfa) ((dfa)->mb_cur_max + 0) ++#else ++# define dfa_mb_cur_max(dfa) (1) ++#endif ++ + #define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set)) + #define re_node_set_remove(set,id) \ + (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1)) +@@ -715,7 +734,7 @@ + re_string_char_size_at (const re_string_t *pstr, int idx) + { + int byte_idx; +- if (pstr->mb_cur_max == 1) ++ if (string_mb_cur_max (pstr) == 1) + return 1; + for (byte_idx = 1; idx + byte_idx < pstr->valid_len; ++byte_idx) + if (pstr->wcs[idx + byte_idx] != WEOF) +@@ -727,7 +746,7 @@ + internal_function __attribute__ ((pure, unused)) + re_string_wchar_at (const re_string_t *pstr, int idx) + { +- if (pstr->mb_cur_max == 1) ++ if (string_mb_cur_max (pstr) == 1) + return (wint_t) pstr->mbs[idx]; + return (wint_t) pstr->wcs[idx]; + } +Index: git/posix/xregex.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/posix/xregex.c 2014-08-29 20:01:15.228070587 -0700 +@@ -0,0 +1,8212 @@ ++/* Extended regular expression matching and search library, ++ version 0.12. ++ (Implements POSIX draft P1003.2/D11.2, except for some of the ++ internationalization features.) ++ ++ Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, ++ 2002, 2005 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA. */ ++ ++/* AIX requires this to be the first thing in the file. */ ++#if defined _AIX && !defined __GNUC__ && !defined REGEX_MALLOC ++ #pragma alloca ++#endif ++ ++#undef _GNU_SOURCE ++#define _GNU_SOURCE ++ ++#ifndef INSIDE_RECURSION ++# ifdef HAVE_CONFIG_H ++# include ++# endif ++#endif ++ ++/*#include */ ++ ++#ifndef INSIDE_RECURSION ++ ++# if defined STDC_HEADERS && !defined emacs ++# include ++# else ++/* We need this for `regex.h', and perhaps for the Emacs include files. */ ++# include ++# endif ++ ++# define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC) ++ ++/* For platform which support the ISO C amendement 1 functionality we ++ support user defined character classes. */ ++# if WIDE_CHAR_SUPPORT ++/* Solaris 2.5 has a bug: must be included before . */ ++# include ++# include ++# endif ++ ++# ifdef _LIBC ++/* We have to keep the namespace clean. */ ++# define regfree(preg) __regfree (preg) ++# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef) ++# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags) ++# define regerror(errcode, preg, errbuf, errbuf_size) \ ++ __regerror(errcode, preg, errbuf, errbuf_size) ++# define re_set_registers(bu, re, nu, st, en) \ ++ __re_set_registers (bu, re, nu, st, en) ++# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \ ++ __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) ++# define re_match(bufp, string, size, pos, regs) \ ++ __re_match (bufp, string, size, pos, regs) ++# define re_search(bufp, string, size, startpos, range, regs) \ ++ __re_search (bufp, string, size, startpos, range, regs) ++# define re_compile_pattern(pattern, length, bufp) \ ++ __re_compile_pattern (pattern, length, bufp) ++# define re_set_syntax(syntax) __re_set_syntax (syntax) ++# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \ ++ __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop) ++# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp) ++ ++# define btowc __btowc ++ ++/* We are also using some library internals. */ ++# include ++# include ++# include ++# include ++# endif ++ ++/* This is for other GNU distributions with internationalized messages. */ ++# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC ++# include ++# ifdef _LIBC ++# undef gettext ++# define gettext(msgid) __dcgettext ("libc", msgid, LC_MESSAGES) ++# endif ++# else ++# define gettext(msgid) (msgid) ++# endif ++ ++# ifndef gettext_noop ++/* This define is so xgettext can find the internationalizable ++ strings. */ ++# define gettext_noop(String) String ++# endif ++ ++/* The `emacs' switch turns on certain matching commands ++ that make sense only in Emacs. */ ++# ifdef emacs ++ ++# include "lisp.h" ++# include "buffer.h" ++# include "syntax.h" ++ ++# else /* not emacs */ ++ ++/* If we are not linking with Emacs proper, ++ we can't use the relocating allocator ++ even if config.h says that we can. */ ++# undef REL_ALLOC ++ ++# if defined STDC_HEADERS || defined _LIBC ++# include ++# else ++char *malloc (); ++char *realloc (); ++# endif ++ ++/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow. ++ If nothing else has been done, use the method below. */ ++# ifdef INHIBIT_STRING_HEADER ++# if !(defined HAVE_BZERO && defined HAVE_BCOPY) ++# if !defined bzero && !defined bcopy ++# undef INHIBIT_STRING_HEADER ++# endif ++# endif ++# endif ++ ++/* This is the normal way of making sure we have a bcopy and a bzero. ++ This is used in most programs--a few other programs avoid this ++ by defining INHIBIT_STRING_HEADER. */ ++# ifndef INHIBIT_STRING_HEADER ++# if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC ++# include ++# ifndef bzero ++# ifndef _LIBC ++# define bzero(s, n) (memset (s, '\0', n), (s)) ++# else ++# define bzero(s, n) __bzero (s, n) ++# endif ++# endif ++# else ++# include ++# ifndef memcmp ++# define memcmp(s1, s2, n) bcmp (s1, s2, n) ++# endif ++# ifndef memcpy ++# define memcpy(d, s, n) (bcopy (s, d, n), (d)) ++# endif ++# endif ++# endif ++ ++/* Define the syntax stuff for \<, \>, etc. */ ++ ++/* This must be nonzero for the wordchar and notwordchar pattern ++ commands in re_match_2. */ ++# ifndef Sword ++# define Sword 1 ++# endif ++ ++# ifdef SWITCH_ENUM_BUG ++# define SWITCH_ENUM_CAST(x) ((int)(x)) ++# else ++# define SWITCH_ENUM_CAST(x) (x) ++# endif ++ ++# endif /* not emacs */ ++ ++# if defined _LIBC || HAVE_LIMITS_H ++# include ++# endif ++ ++# ifndef MB_LEN_MAX ++# define MB_LEN_MAX 1 ++# endif ++ ++/* Get the interface, including the syntax bits. */ ++# include "regex.h" ++ ++/* isalpha etc. are used for the character classes. */ ++# include ++ ++/* Jim Meyering writes: ++ ++ "... Some ctype macros are valid only for character codes that ++ isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when ++ using /bin/cc or gcc but without giving an ansi option). So, all ++ ctype uses should be through macros like ISPRINT... If ++ STDC_HEADERS is defined, then autoconf has verified that the ctype ++ macros don't need to be guarded with references to isascii. ... ++ Defining isascii to 1 should let any compiler worth its salt ++ eliminate the && through constant folding." ++ Solaris defines some of these symbols so we must undefine them first. */ ++ ++# undef ISASCII ++# if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII) ++# define ISASCII(c) 1 ++# else ++# define ISASCII(c) isascii(c) ++# endif ++ ++# ifdef isblank ++# define ISBLANK(c) (ISASCII (c) && isblank (c)) ++# else ++# define ISBLANK(c) ((c) == ' ' || (c) == '\t') ++# endif ++# ifdef isgraph ++# define ISGRAPH(c) (ISASCII (c) && isgraph (c)) ++# else ++# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) ++# endif ++ ++# undef ISPRINT ++# define ISPRINT(c) (ISASCII (c) && isprint (c)) ++# define ISDIGIT(c) (ISASCII (c) && isdigit (c)) ++# define ISALNUM(c) (ISASCII (c) && isalnum (c)) ++# define ISALPHA(c) (ISASCII (c) && isalpha (c)) ++# define ISCNTRL(c) (ISASCII (c) && iscntrl (c)) ++# define ISLOWER(c) (ISASCII (c) && islower (c)) ++# define ISPUNCT(c) (ISASCII (c) && ispunct (c)) ++# define ISSPACE(c) (ISASCII (c) && isspace (c)) ++# define ISUPPER(c) (ISASCII (c) && isupper (c)) ++# define ISXDIGIT(c) (ISASCII (c) && isxdigit (c)) ++ ++# ifdef _tolower ++# define TOLOWER(c) _tolower(c) ++# else ++# define TOLOWER(c) tolower(c) ++# endif ++ ++# ifndef NULL ++# define NULL (void *)0 ++# endif ++ ++/* We remove any previous definition of `SIGN_EXTEND_CHAR', ++ since ours (we hope) works properly with all combinations of ++ machines, compilers, `char' and `unsigned char' argument types. ++ (Per Bothner suggested the basic approach.) */ ++# undef SIGN_EXTEND_CHAR ++# if __STDC__ ++# define SIGN_EXTEND_CHAR(c) ((signed char) (c)) ++# else /* not __STDC__ */ ++/* As in Harbison and Steele. */ ++# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128) ++# endif ++ ++# ifndef emacs ++/* How many characters in the character set. */ ++# define CHAR_SET_SIZE 256 ++ ++# ifdef SYNTAX_TABLE ++ ++extern char *re_syntax_table; ++ ++# else /* not SYNTAX_TABLE */ ++ ++static char re_syntax_table[CHAR_SET_SIZE]; ++ ++static void init_syntax_once (void); ++ ++static void ++init_syntax_once (void) ++{ ++ register int c; ++ static int done = 0; ++ ++ if (done) ++ return; ++ bzero (re_syntax_table, sizeof re_syntax_table); ++ ++ for (c = 0; c < CHAR_SET_SIZE; ++c) ++ if (ISALNUM (c)) ++ re_syntax_table[c] = Sword; ++ ++ re_syntax_table['_'] = Sword; ++ ++ done = 1; ++} ++ ++# endif /* not SYNTAX_TABLE */ ++ ++# define SYNTAX(c) re_syntax_table[(unsigned char) (c)] ++ ++# endif /* emacs */ ++ ++/* Integer type for pointers. */ ++# if !defined _LIBC && !defined HAVE_UINTPTR_T ++typedef unsigned long int uintptr_t; ++# endif ++ ++/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we ++ use `alloca' instead of `malloc'. This is because using malloc in ++ re_search* or re_match* could cause memory leaks when C-g is used in ++ Emacs; also, malloc is slower and causes storage fragmentation. On ++ the other hand, malloc is more portable, and easier to debug. ++ ++ Because we sometimes use alloca, some routines have to be macros, ++ not functions -- `alloca'-allocated space disappears at the end of the ++ function it is called in. */ ++ ++# ifdef REGEX_MALLOC ++ ++# define REGEX_ALLOCATE malloc ++# define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize) ++# define REGEX_FREE free ++ ++# else /* not REGEX_MALLOC */ ++ ++/* Emacs already defines alloca, sometimes. */ ++# ifndef alloca ++ ++/* Make alloca work the best possible way. */ ++# ifdef __GNUC__ ++# define alloca __builtin_alloca ++# else /* not __GNUC__ */ ++# if HAVE_ALLOCA_H ++# include ++# endif /* HAVE_ALLOCA_H */ ++# endif /* not __GNUC__ */ ++ ++# endif /* not alloca */ ++ ++# define REGEX_ALLOCATE alloca ++ ++/* Assumes a `char *destination' variable. */ ++# define REGEX_REALLOCATE(source, osize, nsize) \ ++ (destination = (char *) alloca (nsize), \ ++ memcpy (destination, source, osize)) ++ ++/* No need to do anything to free, after alloca. */ ++# define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */ ++ ++# endif /* not REGEX_MALLOC */ ++ ++/* Define how to allocate the failure stack. */ ++ ++# if defined REL_ALLOC && defined REGEX_MALLOC ++ ++# define REGEX_ALLOCATE_STACK(size) \ ++ r_alloc (&failure_stack_ptr, (size)) ++# define REGEX_REALLOCATE_STACK(source, osize, nsize) \ ++ r_re_alloc (&failure_stack_ptr, (nsize)) ++# define REGEX_FREE_STACK(ptr) \ ++ r_alloc_free (&failure_stack_ptr) ++ ++# else /* not using relocating allocator */ ++ ++# ifdef REGEX_MALLOC ++ ++# define REGEX_ALLOCATE_STACK malloc ++# define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize) ++# define REGEX_FREE_STACK free ++ ++# else /* not REGEX_MALLOC */ ++ ++# define REGEX_ALLOCATE_STACK alloca ++ ++# define REGEX_REALLOCATE_STACK(source, osize, nsize) \ ++ REGEX_REALLOCATE (source, osize, nsize) ++/* No need to explicitly free anything. */ ++# define REGEX_FREE_STACK(arg) ++ ++# endif /* not REGEX_MALLOC */ ++# endif /* not using relocating allocator */ ++ ++ ++/* True if `size1' is non-NULL and PTR is pointing anywhere inside ++ `string1' or just past its end. This works if PTR is NULL, which is ++ a good thing. */ ++# define FIRST_STRING_P(ptr) \ ++ (size1 && string1 <= (ptr) && (ptr) <= string1 + size1) ++ ++/* (Re)Allocate N items of type T using malloc, or fail. */ ++# define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t))) ++# define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t))) ++# define RETALLOC_IF(addr, n, t) \ ++ if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t) ++# define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t))) ++ ++# define BYTEWIDTH 8 /* In bits. */ ++ ++# define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) ++ ++# undef MAX ++# undef MIN ++# define MAX(a, b) ((a) > (b) ? (a) : (b)) ++# define MIN(a, b) ((a) < (b) ? (a) : (b)) ++ ++typedef char boolean; ++# define false 0 ++# define true 1 ++ ++static reg_errcode_t byte_regex_compile (const char *pattern, size_t size, ++ reg_syntax_t syntax, ++ struct re_pattern_buffer *bufp); ++ ++static int byte_re_match_2_internal (struct re_pattern_buffer *bufp, ++ const char *string1, int size1, ++ const char *string2, int size2, ++ int pos, ++ struct re_registers *regs, ++ int stop); ++static int byte_re_search_2 (struct re_pattern_buffer *bufp, ++ const char *string1, int size1, ++ const char *string2, int size2, ++ int startpos, int range, ++ struct re_registers *regs, int stop); ++static int byte_re_compile_fastmap (struct re_pattern_buffer *bufp); ++ ++#ifdef MBS_SUPPORT ++static reg_errcode_t wcs_regex_compile (const char *pattern, size_t size, ++ reg_syntax_t syntax, ++ struct re_pattern_buffer *bufp); ++ ++ ++static int wcs_re_match_2_internal (struct re_pattern_buffer *bufp, ++ const char *cstring1, int csize1, ++ const char *cstring2, int csize2, ++ int pos, ++ struct re_registers *regs, ++ int stop, ++ wchar_t *string1, int size1, ++ wchar_t *string2, int size2, ++ int *mbs_offset1, int *mbs_offset2); ++static int wcs_re_search_2 (struct re_pattern_buffer *bufp, ++ const char *string1, int size1, ++ const char *string2, int size2, ++ int startpos, int range, ++ struct re_registers *regs, int stop); ++static int wcs_re_compile_fastmap (struct re_pattern_buffer *bufp); ++#endif ++ ++/* These are the command codes that appear in compiled regular ++ expressions. Some opcodes are followed by argument bytes. A ++ command code can specify any interpretation whatsoever for its ++ arguments. Zero bytes may appear in the compiled regular expression. */ ++ ++typedef enum ++{ ++ no_op = 0, ++ ++ /* Succeed right away--no more backtracking. */ ++ succeed, ++ ++ /* Followed by one byte giving n, then by n literal bytes. */ ++ exactn, ++ ++# ifdef MBS_SUPPORT ++ /* Same as exactn, but contains binary data. */ ++ exactn_bin, ++# endif ++ ++ /* Matches any (more or less) character. */ ++ anychar, ++ ++ /* Matches any one char belonging to specified set. First ++ following byte is number of bitmap bytes. Then come bytes ++ for a bitmap saying which chars are in. Bits in each byte ++ are ordered low-bit-first. A character is in the set if its ++ bit is 1. A character too large to have a bit in the map is ++ automatically not in the set. */ ++ /* ifdef MBS_SUPPORT, following element is length of character ++ classes, length of collating symbols, length of equivalence ++ classes, length of character ranges, and length of characters. ++ Next, character class element, collating symbols elements, ++ equivalence class elements, range elements, and character ++ elements follow. ++ See regex_compile function. */ ++ charset, ++ ++ /* Same parameters as charset, but match any character that is ++ not one of those specified. */ ++ charset_not, ++ ++ /* Start remembering the text that is matched, for storing in a ++ register. Followed by one byte with the register number, in ++ the range 0 to one less than the pattern buffer's re_nsub ++ field. Then followed by one byte with the number of groups ++ inner to this one. (This last has to be part of the ++ start_memory only because we need it in the on_failure_jump ++ of re_match_2.) */ ++ start_memory, ++ ++ /* Stop remembering the text that is matched and store it in a ++ memory register. Followed by one byte with the register ++ number, in the range 0 to one less than `re_nsub' in the ++ pattern buffer, and one byte with the number of inner groups, ++ just like `start_memory'. (We need the number of inner ++ groups here because we don't have any easy way of finding the ++ corresponding start_memory when we're at a stop_memory.) */ ++ stop_memory, ++ ++ /* Match a duplicate of something remembered. Followed by one ++ byte containing the register number. */ ++ duplicate, ++ ++ /* Fail unless at beginning of line. */ ++ begline, ++ ++ /* Fail unless at end of line. */ ++ endline, ++ ++ /* Succeeds if at beginning of buffer (if emacs) or at beginning ++ of string to be matched (if not). */ ++ begbuf, ++ ++ /* Analogously, for end of buffer/string. */ ++ endbuf, ++ ++ /* Followed by two byte relative address to which to jump. */ ++ jump, ++ ++ /* Same as jump, but marks the end of an alternative. */ ++ jump_past_alt, ++ ++ /* Followed by two-byte relative address of place to resume at ++ in case of failure. */ ++ /* ifdef MBS_SUPPORT, the size of address is 1. */ ++ on_failure_jump, ++ ++ /* Like on_failure_jump, but pushes a placeholder instead of the ++ current string position when executed. */ ++ on_failure_keep_string_jump, ++ ++ /* Throw away latest failure point and then jump to following ++ two-byte relative address. */ ++ /* ifdef MBS_SUPPORT, the size of address is 1. */ ++ pop_failure_jump, ++ ++ /* Change to pop_failure_jump if know won't have to backtrack to ++ match; otherwise change to jump. This is used to jump ++ back to the beginning of a repeat. If what follows this jump ++ clearly won't match what the repeat does, such that we can be ++ sure that there is no use backtracking out of repetitions ++ already matched, then we change it to a pop_failure_jump. ++ Followed by two-byte address. */ ++ /* ifdef MBS_SUPPORT, the size of address is 1. */ ++ maybe_pop_jump, ++ ++ /* Jump to following two-byte address, and push a dummy failure ++ point. This failure point will be thrown away if an attempt ++ is made to use it for a failure. A `+' construct makes this ++ before the first repeat. Also used as an intermediary kind ++ of jump when compiling an alternative. */ ++ /* ifdef MBS_SUPPORT, the size of address is 1. */ ++ dummy_failure_jump, ++ ++ /* Push a dummy failure point and continue. Used at the end of ++ alternatives. */ ++ push_dummy_failure, ++ ++ /* Followed by two-byte relative address and two-byte number n. ++ After matching N times, jump to the address upon failure. */ ++ /* ifdef MBS_SUPPORT, the size of address is 1. */ ++ succeed_n, ++ ++ /* Followed by two-byte relative address, and two-byte number n. ++ Jump to the address N times, then fail. */ ++ /* ifdef MBS_SUPPORT, the size of address is 1. */ ++ jump_n, ++ ++ /* Set the following two-byte relative address to the ++ subsequent two-byte number. The address *includes* the two ++ bytes of number. */ ++ /* ifdef MBS_SUPPORT, the size of address is 1. */ ++ set_number_at, ++ ++ wordchar, /* Matches any word-constituent character. */ ++ notwordchar, /* Matches any char that is not a word-constituent. */ ++ ++ wordbeg, /* Succeeds if at word beginning. */ ++ wordend, /* Succeeds if at word end. */ ++ ++ wordbound, /* Succeeds if at a word boundary. */ ++ notwordbound /* Succeeds if not at a word boundary. */ ++ ++# ifdef emacs ++ ,before_dot, /* Succeeds if before point. */ ++ at_dot, /* Succeeds if at point. */ ++ after_dot, /* Succeeds if after point. */ ++ ++ /* Matches any character whose syntax is specified. Followed by ++ a byte which contains a syntax code, e.g., Sword. */ ++ syntaxspec, ++ ++ /* Matches any character whose syntax is not that specified. */ ++ notsyntaxspec ++# endif /* emacs */ ++} re_opcode_t; ++#endif /* not INSIDE_RECURSION */ ++ ++ ++#ifdef BYTE ++# define CHAR_T char ++# define UCHAR_T unsigned char ++# define COMPILED_BUFFER_VAR bufp->buffer ++# define OFFSET_ADDRESS_SIZE 2 ++# define PREFIX(name) byte_##name ++# define ARG_PREFIX(name) name ++# define PUT_CHAR(c) putchar (c) ++#else ++# ifdef WCHAR ++# define CHAR_T wchar_t ++# define UCHAR_T wchar_t ++# define COMPILED_BUFFER_VAR wc_buffer ++# define OFFSET_ADDRESS_SIZE 1 /* the size which STORE_NUMBER macro use */ ++# define CHAR_CLASS_SIZE ((__alignof__(wctype_t)+sizeof(wctype_t))/sizeof(CHAR_T)+1) ++# define PREFIX(name) wcs_##name ++# define ARG_PREFIX(name) c##name ++/* Should we use wide stream?? */ ++# define PUT_CHAR(c) printf ("%C", c); ++# define TRUE 1 ++# define FALSE 0 ++# else ++# ifdef MBS_SUPPORT ++# define WCHAR ++# define INSIDE_RECURSION ++# include "xregex.c" ++# undef INSIDE_RECURSION ++# endif ++# define BYTE ++# define INSIDE_RECURSION ++# include "xregex.c" ++# undef INSIDE_RECURSION ++# endif ++#endif ++ ++#ifdef INSIDE_RECURSION ++/* Common operations on the compiled pattern. */ ++ ++/* Store NUMBER in two contiguous bytes starting at DESTINATION. */ ++/* ifdef MBS_SUPPORT, we store NUMBER in 1 element. */ ++ ++# ifdef WCHAR ++# define STORE_NUMBER(destination, number) \ ++ do { \ ++ *(destination) = (UCHAR_T)(number); \ ++ } while (0) ++# else /* BYTE */ ++# define STORE_NUMBER(destination, number) \ ++ do { \ ++ (destination)[0] = (number) & 0377; \ ++ (destination)[1] = (number) >> 8; \ ++ } while (0) ++# endif /* WCHAR */ ++ ++/* Same as STORE_NUMBER, except increment DESTINATION to ++ the byte after where the number is stored. Therefore, DESTINATION ++ must be an lvalue. */ ++/* ifdef MBS_SUPPORT, we store NUMBER in 1 element. */ ++ ++# define STORE_NUMBER_AND_INCR(destination, number) \ ++ do { \ ++ STORE_NUMBER (destination, number); \ ++ (destination) += OFFSET_ADDRESS_SIZE; \ ++ } while (0) ++ ++/* Put into DESTINATION a number stored in two contiguous bytes starting ++ at SOURCE. */ ++/* ifdef MBS_SUPPORT, we store NUMBER in 1 element. */ ++ ++# ifdef WCHAR ++# define EXTRACT_NUMBER(destination, source) \ ++ do { \ ++ (destination) = *(source); \ ++ } while (0) ++# else /* BYTE */ ++# define EXTRACT_NUMBER(destination, source) \ ++ do { \ ++ (destination) = *(source) & 0377; \ ++ (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \ ++ } while (0) ++# endif ++ ++# ifdef DEBUG ++static void PREFIX(extract_number) (int *dest, UCHAR_T *source); ++static void ++PREFIX(extract_number) (int *dest, UCHAR_T *source) ++{ ++# ifdef WCHAR ++ *dest = *source; ++# else /* BYTE */ ++ int temp = SIGN_EXTEND_CHAR (*(source + 1)); ++ *dest = *source & 0377; ++ *dest += temp << 8; ++# endif ++} ++ ++# ifndef EXTRACT_MACROS /* To debug the macros. */ ++# undef EXTRACT_NUMBER ++# define EXTRACT_NUMBER(dest, src) PREFIX(extract_number) (&dest, src) ++# endif /* not EXTRACT_MACROS */ ++ ++# endif /* DEBUG */ ++ ++/* Same as EXTRACT_NUMBER, except increment SOURCE to after the number. ++ SOURCE must be an lvalue. */ ++ ++# define EXTRACT_NUMBER_AND_INCR(destination, source) \ ++ do { \ ++ EXTRACT_NUMBER (destination, source); \ ++ (source) += OFFSET_ADDRESS_SIZE; \ ++ } while (0) ++ ++# ifdef DEBUG ++static void PREFIX(extract_number_and_incr) (int *destination, ++ UCHAR_T **source); ++static void ++PREFIX(extract_number_and_incr) (int *destination, UCHAR_T **source) ++{ ++ PREFIX(extract_number) (destination, *source); ++ *source += OFFSET_ADDRESS_SIZE; ++} ++ ++# ifndef EXTRACT_MACROS ++# undef EXTRACT_NUMBER_AND_INCR ++# define EXTRACT_NUMBER_AND_INCR(dest, src) \ ++ PREFIX(extract_number_and_incr) (&dest, &src) ++# endif /* not EXTRACT_MACROS */ ++ ++# endif /* DEBUG */ ++ ++ ++ ++/* If DEBUG is defined, Regex prints many voluminous messages about what ++ it is doing (if the variable `debug' is nonzero). If linked with the ++ main program in `iregex.c', you can enter patterns and strings ++ interactively. And if linked with the main program in `main.c' and ++ the other test files, you can run the already-written tests. */ ++ ++# ifdef DEBUG ++ ++# ifndef DEFINED_ONCE ++ ++/* We use standard I/O for debugging. */ ++# include ++ ++/* It is useful to test things that ``must'' be true when debugging. */ ++# include ++ ++static int debug; ++ ++# define DEBUG_STATEMENT(e) e ++# define DEBUG_PRINT1(x) if (debug) printf (x) ++# define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2) ++# define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3) ++# define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4) ++# endif /* not DEFINED_ONCE */ ++ ++# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \ ++ if (debug) PREFIX(print_partial_compiled_pattern) (s, e) ++# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \ ++ if (debug) PREFIX(print_double_string) (w, s1, sz1, s2, sz2) ++ ++ ++/* Print the fastmap in human-readable form. */ ++ ++# ifndef DEFINED_ONCE ++void ++print_fastmap (char *fastmap) ++{ ++ unsigned was_a_range = 0; ++ unsigned i = 0; ++ ++ while (i < (1 << BYTEWIDTH)) ++ { ++ if (fastmap[i++]) ++ { ++ was_a_range = 0; ++ putchar (i - 1); ++ while (i < (1 << BYTEWIDTH) && fastmap[i]) ++ { ++ was_a_range = 1; ++ i++; ++ } ++ if (was_a_range) ++ { ++ printf ("-"); ++ putchar (i - 1); ++ } ++ } ++ } ++ putchar ('\n'); ++} ++# endif /* not DEFINED_ONCE */ ++ ++ ++/* Print a compiled pattern string in human-readable form, starting at ++ the START pointer into it and ending just before the pointer END. */ ++ ++void ++PREFIX(print_partial_compiled_pattern) (UCHAR_T *start, UCHAR_T *end) ++{ ++ int mcnt, mcnt2; ++ UCHAR_T *p1; ++ UCHAR_T *p = start; ++ UCHAR_T *pend = end; ++ ++ if (start == NULL) ++ { ++ printf ("(null)\n"); ++ return; ++ } ++ ++ /* Loop over pattern commands. */ ++ while (p < pend) ++ { ++# ifdef _LIBC ++ printf ("%td:\t", p - start); ++# else ++ printf ("%ld:\t", (long int) (p - start)); ++# endif ++ ++ switch ((re_opcode_t) *p++) ++ { ++ case no_op: ++ printf ("/no_op"); ++ break; ++ ++ case exactn: ++ mcnt = *p++; ++ printf ("/exactn/%d", mcnt); ++ do ++ { ++ putchar ('/'); ++ PUT_CHAR (*p++); ++ } ++ while (--mcnt); ++ break; ++ ++# ifdef MBS_SUPPORT ++ case exactn_bin: ++ mcnt = *p++; ++ printf ("/exactn_bin/%d", mcnt); ++ do ++ { ++ printf("/%lx", (long int) *p++); ++ } ++ while (--mcnt); ++ break; ++# endif /* MBS_SUPPORT */ ++ ++ case start_memory: ++ mcnt = *p++; ++ printf ("/start_memory/%d/%ld", mcnt, (long int) *p++); ++ break; ++ ++ case stop_memory: ++ mcnt = *p++; ++ printf ("/stop_memory/%d/%ld", mcnt, (long int) *p++); ++ break; ++ ++ case duplicate: ++ printf ("/duplicate/%ld", (long int) *p++); ++ break; ++ ++ case anychar: ++ printf ("/anychar"); ++ break; ++ ++ case charset: ++ case charset_not: ++ { ++# ifdef WCHAR ++ int i, length; ++ wchar_t *workp = p; ++ printf ("/charset [%s", ++ (re_opcode_t) *(workp - 1) == charset_not ? "^" : ""); ++ p += 5; ++ length = *workp++; /* the length of char_classes */ ++ for (i=0 ; ibuffer; ++ ++ PREFIX(print_partial_compiled_pattern) (buffer, buffer ++ + bufp->used / sizeof(UCHAR_T)); ++ printf ("%ld bytes used/%ld bytes allocated.\n", ++ bufp->used, bufp->allocated); ++ ++ if (bufp->fastmap_accurate && bufp->fastmap) ++ { ++ printf ("fastmap: "); ++ print_fastmap (bufp->fastmap); ++ } ++ ++# ifdef _LIBC ++ printf ("re_nsub: %Zd\t", bufp->re_nsub); ++# else ++ printf ("re_nsub: %ld\t", (long int) bufp->re_nsub); ++# endif ++ printf ("regs_alloc: %d\t", bufp->regs_allocated); ++ printf ("can_be_null: %d\t", bufp->can_be_null); ++ printf ("newline_anchor: %d\n", bufp->newline_anchor); ++ printf ("no_sub: %d\t", bufp->no_sub); ++ printf ("not_bol: %d\t", bufp->not_bol); ++ printf ("not_eol: %d\t", bufp->not_eol); ++ printf ("syntax: %lx\n", bufp->syntax); ++ /* Perhaps we should print the translate table? */ ++} ++ ++ ++void ++PREFIX(print_double_string) (const CHAR_T *where, const CHAR_T *string1, ++ int size1, const CHAR_T *string2, int size2) ++{ ++ int this_char; ++ ++ if (where == NULL) ++ printf ("(null)"); ++ else ++ { ++ int cnt; ++ ++ if (FIRST_STRING_P (where)) ++ { ++ for (this_char = where - string1; this_char < size1; this_char++) ++ PUT_CHAR (string1[this_char]); ++ ++ where = string2; ++ } ++ ++ cnt = 0; ++ for (this_char = where - string2; this_char < size2; this_char++) ++ { ++ PUT_CHAR (string2[this_char]); ++ if (++cnt > 100) ++ { ++ fputs ("...", stdout); ++ break; ++ } ++ } ++ } ++} ++ ++# ifndef DEFINED_ONCE ++void ++printchar (int c) ++{ ++ putc (c, stderr); ++} ++# endif ++ ++# else /* not DEBUG */ ++ ++# ifndef DEFINED_ONCE ++# undef assert ++# define assert(e) ++ ++# define DEBUG_STATEMENT(e) ++# define DEBUG_PRINT1(x) ++# define DEBUG_PRINT2(x1, x2) ++# define DEBUG_PRINT3(x1, x2, x3) ++# define DEBUG_PRINT4(x1, x2, x3, x4) ++# endif /* not DEFINED_ONCE */ ++# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) ++# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) ++ ++# endif /* not DEBUG */ ++ ++ ++ ++# ifdef WCHAR ++/* This convert a multibyte string to a wide character string. ++ And write their correspondances to offset_buffer(see below) ++ and write whether each wchar_t is binary data to is_binary. ++ This assume invalid multibyte sequences as binary data. ++ We assume offset_buffer and is_binary is already allocated ++ enough space. */ ++ ++static size_t convert_mbs_to_wcs (CHAR_T *dest, const unsigned char* src, ++ size_t len, int *offset_buffer, ++ char *is_binary); ++static size_t ++convert_mbs_to_wcs (CHAR_T *dest, const unsigned char*src, size_t len, ++ int *offset_buffer, char *is_binary) ++ /* It hold correspondances between src(char string) and ++ dest(wchar_t string) for optimization. ++ e.g. src = "xxxyzz" ++ dest = {'X', 'Y', 'Z'} ++ (each "xxx", "y" and "zz" represent one multibyte character ++ corresponding to 'X', 'Y' and 'Z'.) ++ offset_buffer = {0, 0+3("xxx"), 0+3+1("y"), 0+3+1+2("zz")} ++ = {0, 3, 4, 6} ++ */ ++{ ++ wchar_t *pdest = dest; ++ const unsigned char *psrc = src; ++ size_t wc_count = 0; ++ ++ mbstate_t mbs; ++ int i, consumed; ++ size_t mb_remain = len; ++ size_t mb_count = 0; ++ ++ /* Initialize the conversion state. */ ++ memset (&mbs, 0, sizeof (mbstate_t)); ++ ++ offset_buffer[0] = 0; ++ for( ; mb_remain > 0 ; ++wc_count, ++pdest, mb_remain -= consumed, ++ psrc += consumed) ++ { ++#ifdef _LIBC ++ consumed = __mbrtowc (pdest, psrc, mb_remain, &mbs); ++#else ++ consumed = mbrtowc (pdest, psrc, mb_remain, &mbs); ++#endif ++ ++ if (consumed <= 0) ++ /* failed to convert. maybe src contains binary data. ++ So we consume 1 byte manualy. */ ++ { ++ *pdest = *psrc; ++ consumed = 1; ++ is_binary[wc_count] = TRUE; ++ } ++ else ++ is_binary[wc_count] = FALSE; ++ /* In sjis encoding, we use yen sign as escape character in ++ place of reverse solidus. So we convert 0x5c(yen sign in ++ sjis) to not 0xa5(yen sign in UCS2) but 0x5c(reverse ++ solidus in UCS2). */ ++ if (consumed == 1 && (int) *psrc == 0x5c && (int) *pdest == 0xa5) ++ *pdest = (wchar_t) *psrc; ++ ++ offset_buffer[wc_count + 1] = mb_count += consumed; ++ } ++ ++ /* Fill remain of the buffer with sentinel. */ ++ for (i = wc_count + 1 ; i <= len ; i++) ++ offset_buffer[i] = mb_count + 1; ++ ++ return wc_count; ++} ++ ++# endif /* WCHAR */ ++ ++#else /* not INSIDE_RECURSION */ ++ ++/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can ++ also be assigned to arbitrarily: each pattern buffer stores its own ++ syntax, so it can be changed between regex compilations. */ ++/* This has no initializer because initialized variables in Emacs ++ become read-only after dumping. */ ++reg_syntax_t re_syntax_options; ++ ++ ++/* Specify the precise syntax of regexps for compilation. This provides ++ for compatibility for various utilities which historically have ++ different, incompatible syntaxes. ++ ++ The argument SYNTAX is a bit mask comprised of the various bits ++ defined in regex.h. We return the old syntax. */ ++ ++reg_syntax_t ++re_set_syntax (reg_syntax_t syntax) ++{ ++ reg_syntax_t ret = re_syntax_options; ++ ++ re_syntax_options = syntax; ++# ifdef DEBUG ++ if (syntax & RE_DEBUG) ++ debug = 1; ++ else if (debug) /* was on but now is not */ ++ debug = 0; ++# endif /* DEBUG */ ++ return ret; ++} ++# ifdef _LIBC ++weak_alias (__re_set_syntax, re_set_syntax) ++# endif ++ ++/* This table gives an error message for each of the error codes listed ++ in regex.h. Obviously the order here has to be same as there. ++ POSIX doesn't require that we do anything for REG_NOERROR, ++ but why not be nice? */ ++ ++static const char *re_error_msgid[] = ++ { ++ gettext_noop ("Success"), /* REG_NOERROR */ ++ gettext_noop ("No match"), /* REG_NOMATCH */ ++ gettext_noop ("Invalid regular expression"), /* REG_BADPAT */ ++ gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */ ++ gettext_noop ("Invalid character class name"), /* REG_ECTYPE */ ++ gettext_noop ("Trailing backslash"), /* REG_EESCAPE */ ++ gettext_noop ("Invalid back reference"), /* REG_ESUBREG */ ++ gettext_noop ("Unmatched [ or [^"), /* REG_EBRACK */ ++ gettext_noop ("Unmatched ( or \\("), /* REG_EPAREN */ ++ gettext_noop ("Unmatched \\{"), /* REG_EBRACE */ ++ gettext_noop ("Invalid content of \\{\\}"), /* REG_BADBR */ ++ gettext_noop ("Invalid range end"), /* REG_ERANGE */ ++ gettext_noop ("Memory exhausted"), /* REG_ESPACE */ ++ gettext_noop ("Invalid preceding regular expression"), /* REG_BADRPT */ ++ gettext_noop ("Premature end of regular expression"), /* REG_EEND */ ++ gettext_noop ("Regular expression too big"), /* REG_ESIZE */ ++ gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */ ++ }; ++ ++#endif /* INSIDE_RECURSION */ ++ ++#ifndef DEFINED_ONCE ++/* Avoiding alloca during matching, to placate r_alloc. */ ++ ++/* Define MATCH_MAY_ALLOCATE unless we need to make sure that the ++ searching and matching functions should not call alloca. On some ++ systems, alloca is implemented in terms of malloc, and if we're ++ using the relocating allocator routines, then malloc could cause a ++ relocation, which might (if the strings being searched are in the ++ ralloc heap) shift the data out from underneath the regexp ++ routines. ++ ++ Here's another reason to avoid allocation: Emacs ++ processes input from X in a signal handler; processing X input may ++ call malloc; if input arrives while a matching routine is calling ++ malloc, then we're scrod. But Emacs can't just block input while ++ calling matching routines; then we don't notice interrupts when ++ they come in. So, Emacs blocks input around all regexp calls ++ except the matching calls, which it leaves unprotected, in the ++ faith that they will not malloc. */ ++ ++/* Normally, this is fine. */ ++# define MATCH_MAY_ALLOCATE ++ ++/* When using GNU C, we are not REALLY using the C alloca, no matter ++ what config.h may say. So don't take precautions for it. */ ++# ifdef __GNUC__ ++# undef C_ALLOCA ++# endif ++ ++/* The match routines may not allocate if (1) they would do it with malloc ++ and (2) it's not safe for them to use malloc. ++ Note that if REL_ALLOC is defined, matching would not use malloc for the ++ failure stack, but we would still use it for the register vectors; ++ so REL_ALLOC should not affect this. */ ++# if (defined C_ALLOCA || defined REGEX_MALLOC) && defined emacs ++# undef MATCH_MAY_ALLOCATE ++# endif ++#endif /* not DEFINED_ONCE */ ++ ++#ifdef INSIDE_RECURSION ++/* Failure stack declarations and macros; both re_compile_fastmap and ++ re_match_2 use a failure stack. These have to be macros because of ++ REGEX_ALLOCATE_STACK. */ ++ ++ ++/* Number of failure points for which to initially allocate space ++ when matching. If this number is exceeded, we allocate more ++ space, so it is not a hard limit. */ ++# ifndef INIT_FAILURE_ALLOC ++# define INIT_FAILURE_ALLOC 5 ++# endif ++ ++/* Roughly the maximum number of failure points on the stack. Would be ++ exactly that if always used MAX_FAILURE_ITEMS items each time we failed. ++ This is a variable only so users of regex can assign to it; we never ++ change it ourselves. */ ++ ++ ++# ifndef DEFINED_ONCE ++ ++# ifdef INT_IS_16BIT ++# define RE_M_F_TYPE long int ++# else ++# define RE_M_F_TYPE int ++# endif /* INT_IS_16BIT */ ++ ++# ifdef MATCH_MAY_ALLOCATE ++/* 4400 was enough to cause a crash on Alpha OSF/1, ++ whose default stack limit is 2mb. */ ++# define RE_M_F_DEFAULT 4000 ++# else ++# define RE_M_F_DEFAULT 2000 ++# endif /* MATCH_MAY_ALLOCATE */ ++ ++# include ++ ++# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3) ++link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.") ++RE_M_F_TYPE re_max_failures = RE_M_F_DEFAULT; ++# else ++RE_M_F_TYPE re_max_failures attribute_hidden = RE_M_F_DEFAULT; ++# endif /* SHLIB_COMPAT */ ++ ++# undef RE_M_F_TYPE ++# undef RE_M_F_DEFAULT ++ ++# endif /* DEFINED_ONCE */ ++ ++# ifdef INT_IS_16BIT ++ ++union PREFIX(fail_stack_elt) ++{ ++ UCHAR_T *pointer; ++ long int integer; ++}; ++ ++typedef union PREFIX(fail_stack_elt) PREFIX(fail_stack_elt_t); ++ ++typedef struct ++{ ++ PREFIX(fail_stack_elt_t) *stack; ++ unsigned long int size; ++ unsigned long int avail; /* Offset of next open position. */ ++} PREFIX(fail_stack_type); ++ ++# else /* not INT_IS_16BIT */ ++ ++union PREFIX(fail_stack_elt) ++{ ++ UCHAR_T *pointer; ++ int integer; ++}; ++ ++typedef union PREFIX(fail_stack_elt) PREFIX(fail_stack_elt_t); ++ ++typedef struct ++{ ++ PREFIX(fail_stack_elt_t) *stack; ++ unsigned size; ++ unsigned avail; /* Offset of next open position. */ ++} PREFIX(fail_stack_type); ++ ++# endif /* INT_IS_16BIT */ ++ ++# ifndef DEFINED_ONCE ++# define FAIL_STACK_EMPTY() (fail_stack.avail == 0) ++# define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0) ++# define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size) ++# endif ++ ++ ++/* Define macros to initialize and free the failure stack. ++ Do `return -2' if the alloc fails. */ ++ ++# ifdef MATCH_MAY_ALLOCATE ++# define INIT_FAIL_STACK() \ ++ do { \ ++ fail_stack.stack = (PREFIX(fail_stack_elt_t) *) \ ++ REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (PREFIX(fail_stack_elt_t))); \ ++ \ ++ if (fail_stack.stack == NULL) \ ++ return -2; \ ++ \ ++ fail_stack.size = INIT_FAILURE_ALLOC; \ ++ fail_stack.avail = 0; \ ++ } while (0) ++ ++# define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack) ++# else ++# define INIT_FAIL_STACK() \ ++ do { \ ++ fail_stack.avail = 0; \ ++ } while (0) ++ ++# define RESET_FAIL_STACK() ++# endif ++ ++ ++/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items. ++ ++ Return 1 if succeeds, and 0 if either ran out of memory ++ allocating space for it or it was already too large. ++ ++ REGEX_REALLOCATE_STACK requires `destination' be declared. */ ++ ++# define DOUBLE_FAIL_STACK(fail_stack) \ ++ ((fail_stack).size > (unsigned) (re_max_failures * MAX_FAILURE_ITEMS) \ ++ ? 0 \ ++ : ((fail_stack).stack = (PREFIX(fail_stack_elt_t) *) \ ++ REGEX_REALLOCATE_STACK ((fail_stack).stack, \ ++ (fail_stack).size * sizeof (PREFIX(fail_stack_elt_t)), \ ++ ((fail_stack).size << 1) * sizeof (PREFIX(fail_stack_elt_t))),\ ++ \ ++ (fail_stack).stack == NULL \ ++ ? 0 \ ++ : ((fail_stack).size <<= 1, \ ++ 1))) ++ ++ ++/* Push pointer POINTER on FAIL_STACK. ++ Return 1 if was able to do so and 0 if ran out of memory allocating ++ space to do so. */ ++# define PUSH_PATTERN_OP(POINTER, FAIL_STACK) \ ++ ((FAIL_STACK_FULL () \ ++ && !DOUBLE_FAIL_STACK (FAIL_STACK)) \ ++ ? 0 \ ++ : ((FAIL_STACK).stack[(FAIL_STACK).avail++].pointer = POINTER, \ ++ 1)) ++ ++/* Push a pointer value onto the failure stack. ++ Assumes the variable `fail_stack'. Probably should only ++ be called from within `PUSH_FAILURE_POINT'. */ ++# define PUSH_FAILURE_POINTER(item) \ ++ fail_stack.stack[fail_stack.avail++].pointer = (UCHAR_T *) (item) ++ ++/* This pushes an integer-valued item onto the failure stack. ++ Assumes the variable `fail_stack'. Probably should only ++ be called from within `PUSH_FAILURE_POINT'. */ ++# define PUSH_FAILURE_INT(item) \ ++ fail_stack.stack[fail_stack.avail++].integer = (item) ++ ++/* Push a fail_stack_elt_t value onto the failure stack. ++ Assumes the variable `fail_stack'. Probably should only ++ be called from within `PUSH_FAILURE_POINT'. */ ++# define PUSH_FAILURE_ELT(item) \ ++ fail_stack.stack[fail_stack.avail++] = (item) ++ ++/* These three POP... operations complement the three PUSH... operations. ++ All assume that `fail_stack' is nonempty. */ ++# define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer ++# define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer ++# define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail] ++ ++/* Used to omit pushing failure point id's when we're not debugging. */ ++# ifdef DEBUG ++# define DEBUG_PUSH PUSH_FAILURE_INT ++# define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT () ++# else ++# define DEBUG_PUSH(item) ++# define DEBUG_POP(item_addr) ++# endif ++ ++ ++/* Push the information about the state we will need ++ if we ever fail back to it. ++ ++ Requires variables fail_stack, regstart, regend, reg_info, and ++ num_regs_pushed be declared. DOUBLE_FAIL_STACK requires `destination' ++ be declared. ++ ++ Does `return FAILURE_CODE' if runs out of memory. */ ++ ++# define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \ ++ do { \ ++ char *destination; \ ++ /* Must be int, so when we don't save any registers, the arithmetic \ ++ of 0 + -1 isn't done as unsigned. */ \ ++ /* Can't be int, since there is not a shred of a guarantee that int \ ++ is wide enough to hold a value of something to which pointer can \ ++ be assigned */ \ ++ active_reg_t this_reg; \ ++ \ ++ DEBUG_STATEMENT (failure_id++); \ ++ DEBUG_STATEMENT (nfailure_points_pushed++); \ ++ DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \ ++ DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\ ++ DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\ ++ \ ++ DEBUG_PRINT2 (" slots needed: %ld\n", NUM_FAILURE_ITEMS); \ ++ DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \ ++ \ ++ /* Ensure we have enough space allocated for what we will push. */ \ ++ while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \ ++ { \ ++ if (!DOUBLE_FAIL_STACK (fail_stack)) \ ++ return failure_code; \ ++ \ ++ DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \ ++ (fail_stack).size); \ ++ DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\ ++ } \ ++ \ ++ /* Push the info, starting with the registers. */ \ ++ DEBUG_PRINT1 ("\n"); \ ++ \ ++ if (1) \ ++ for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \ ++ this_reg++) \ ++ { \ ++ DEBUG_PRINT2 (" Pushing reg: %lu\n", this_reg); \ ++ DEBUG_STATEMENT (num_regs_pushed++); \ ++ \ ++ DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \ ++ PUSH_FAILURE_POINTER (regstart[this_reg]); \ ++ \ ++ DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \ ++ PUSH_FAILURE_POINTER (regend[this_reg]); \ ++ \ ++ DEBUG_PRINT2 (" info: %p\n ", \ ++ reg_info[this_reg].word.pointer); \ ++ DEBUG_PRINT2 (" match_null=%d", \ ++ REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \ ++ DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \ ++ DEBUG_PRINT2 (" matched_something=%d", \ ++ MATCHED_SOMETHING (reg_info[this_reg])); \ ++ DEBUG_PRINT2 (" ever_matched=%d", \ ++ EVER_MATCHED_SOMETHING (reg_info[this_reg])); \ ++ DEBUG_PRINT1 ("\n"); \ ++ PUSH_FAILURE_ELT (reg_info[this_reg].word); \ ++ } \ ++ \ ++ DEBUG_PRINT2 (" Pushing low active reg: %ld\n", lowest_active_reg);\ ++ PUSH_FAILURE_INT (lowest_active_reg); \ ++ \ ++ DEBUG_PRINT2 (" Pushing high active reg: %ld\n", highest_active_reg);\ ++ PUSH_FAILURE_INT (highest_active_reg); \ ++ \ ++ DEBUG_PRINT2 (" Pushing pattern %p:\n", pattern_place); \ ++ DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ ++ PUSH_FAILURE_POINTER (pattern_place); \ ++ \ ++ DEBUG_PRINT2 (" Pushing string %p: `", string_place); \ ++ DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \ ++ size2); \ ++ DEBUG_PRINT1 ("'\n"); \ ++ PUSH_FAILURE_POINTER (string_place); \ ++ \ ++ DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \ ++ DEBUG_PUSH (failure_id); \ ++ } while (0) ++ ++# ifndef DEFINED_ONCE ++/* This is the number of items that are pushed and popped on the stack ++ for each register. */ ++# define NUM_REG_ITEMS 3 ++ ++/* Individual items aside from the registers. */ ++# ifdef DEBUG ++# define NUM_NONREG_ITEMS 5 /* Includes failure point id. */ ++# else ++# define NUM_NONREG_ITEMS 4 ++# endif ++ ++/* We push at most this many items on the stack. */ ++/* We used to use (num_regs - 1), which is the number of registers ++ this regexp will save; but that was changed to 5 ++ to avoid stack overflow for a regexp with lots of parens. */ ++# define MAX_FAILURE_ITEMS (5 * NUM_REG_ITEMS + NUM_NONREG_ITEMS) ++ ++/* We actually push this many items. */ ++# define NUM_FAILURE_ITEMS \ ++ (((0 \ ++ ? 0 : highest_active_reg - lowest_active_reg + 1) \ ++ * NUM_REG_ITEMS) \ ++ + NUM_NONREG_ITEMS) ++ ++/* How many items can still be added to the stack without overflowing it. */ ++# define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail) ++# endif /* not DEFINED_ONCE */ ++ ++ ++/* Pops what PUSH_FAIL_STACK pushes. ++ ++ We restore into the parameters, all of which should be lvalues: ++ STR -- the saved data position. ++ PAT -- the saved pattern position. ++ LOW_REG, HIGH_REG -- the highest and lowest active registers. ++ REGSTART, REGEND -- arrays of string positions. ++ REG_INFO -- array of information about each subexpression. ++ ++ Also assumes the variables `fail_stack' and (if debugging), `bufp', ++ `pend', `string1', `size1', `string2', and `size2'. */ ++# define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\ ++{ \ ++ DEBUG_STATEMENT (unsigned failure_id;) \ ++ active_reg_t this_reg; \ ++ const UCHAR_T *string_temp; \ ++ \ ++ assert (!FAIL_STACK_EMPTY ()); \ ++ \ ++ /* Remove failure points and point to how many regs pushed. */ \ ++ DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \ ++ DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \ ++ DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \ ++ \ ++ assert (fail_stack.avail >= NUM_NONREG_ITEMS); \ ++ \ ++ DEBUG_POP (&failure_id); \ ++ DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \ ++ \ ++ /* If the saved string location is NULL, it came from an \ ++ on_failure_keep_string_jump opcode, and we want to throw away the \ ++ saved NULL, thus retaining our current position in the string. */ \ ++ string_temp = POP_FAILURE_POINTER (); \ ++ if (string_temp != NULL) \ ++ str = (const CHAR_T *) string_temp; \ ++ \ ++ DEBUG_PRINT2 (" Popping string %p: `", str); \ ++ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ ++ DEBUG_PRINT1 ("'\n"); \ ++ \ ++ pat = (UCHAR_T *) POP_FAILURE_POINTER (); \ ++ DEBUG_PRINT2 (" Popping pattern %p:\n", pat); \ ++ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ ++ \ ++ /* Restore register info. */ \ ++ high_reg = (active_reg_t) POP_FAILURE_INT (); \ ++ DEBUG_PRINT2 (" Popping high active reg: %ld\n", high_reg); \ ++ \ ++ low_reg = (active_reg_t) POP_FAILURE_INT (); \ ++ DEBUG_PRINT2 (" Popping low active reg: %ld\n", low_reg); \ ++ \ ++ if (1) \ ++ for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \ ++ { \ ++ DEBUG_PRINT2 (" Popping reg: %ld\n", this_reg); \ ++ \ ++ reg_info[this_reg].word = POP_FAILURE_ELT (); \ ++ DEBUG_PRINT2 (" info: %p\n", \ ++ reg_info[this_reg].word.pointer); \ ++ \ ++ regend[this_reg] = (const CHAR_T *) POP_FAILURE_POINTER (); \ ++ DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \ ++ \ ++ regstart[this_reg] = (const CHAR_T *) POP_FAILURE_POINTER (); \ ++ DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \ ++ } \ ++ else \ ++ { \ ++ for (this_reg = highest_active_reg; this_reg > high_reg; this_reg--) \ ++ { \ ++ reg_info[this_reg].word.integer = 0; \ ++ regend[this_reg] = 0; \ ++ regstart[this_reg] = 0; \ ++ } \ ++ highest_active_reg = high_reg; \ ++ } \ ++ \ ++ set_regs_matched_done = 0; \ ++ DEBUG_STATEMENT (nfailure_points_popped++); \ ++} /* POP_FAILURE_POINT */ ++ ++/* Structure for per-register (a.k.a. per-group) information. ++ Other register information, such as the ++ starting and ending positions (which are addresses), and the list of ++ inner groups (which is a bits list) are maintained in separate ++ variables. ++ ++ We are making a (strictly speaking) nonportable assumption here: that ++ the compiler will pack our bit fields into something that fits into ++ the type of `word', i.e., is something that fits into one item on the ++ failure stack. */ ++ ++ ++/* Declarations and macros for re_match_2. */ ++ ++typedef union ++{ ++ PREFIX(fail_stack_elt_t) word; ++ struct ++ { ++ /* This field is one if this group can match the empty string, ++ zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */ ++# define MATCH_NULL_UNSET_VALUE 3 ++ unsigned match_null_string_p : 2; ++ unsigned is_active : 1; ++ unsigned matched_something : 1; ++ unsigned ever_matched_something : 1; ++ } bits; ++} PREFIX(register_info_type); ++ ++# ifndef DEFINED_ONCE ++# define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p) ++# define IS_ACTIVE(R) ((R).bits.is_active) ++# define MATCHED_SOMETHING(R) ((R).bits.matched_something) ++# define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something) ++ ++ ++/* Call this when have matched a real character; it sets `matched' flags ++ for the subexpressions which we are currently inside. Also records ++ that those subexprs have matched. */ ++# define SET_REGS_MATCHED() \ ++ do \ ++ { \ ++ if (!set_regs_matched_done) \ ++ { \ ++ active_reg_t r; \ ++ set_regs_matched_done = 1; \ ++ for (r = lowest_active_reg; r <= highest_active_reg; r++) \ ++ { \ ++ MATCHED_SOMETHING (reg_info[r]) \ ++ = EVER_MATCHED_SOMETHING (reg_info[r]) \ ++ = 1; \ ++ } \ ++ } \ ++ } \ ++ while (0) ++# endif /* not DEFINED_ONCE */ ++ ++/* Registers are set to a sentinel when they haven't yet matched. */ ++static CHAR_T PREFIX(reg_unset_dummy); ++# define REG_UNSET_VALUE (&PREFIX(reg_unset_dummy)) ++# define REG_UNSET(e) ((e) == REG_UNSET_VALUE) ++ ++/* Subroutine declarations and macros for regex_compile. */ ++static void PREFIX(store_op1) (re_opcode_t op, UCHAR_T *loc, int arg); ++static void PREFIX(store_op2) (re_opcode_t op, UCHAR_T *loc, ++ int arg1, int arg2); ++static void PREFIX(insert_op1) (re_opcode_t op, UCHAR_T *loc, ++ int arg, UCHAR_T *end); ++static void PREFIX(insert_op2) (re_opcode_t op, UCHAR_T *loc, ++ int arg1, int arg2, UCHAR_T *end); ++static boolean PREFIX(at_begline_loc_p) (const CHAR_T *pattern, ++ const CHAR_T *p, ++ reg_syntax_t syntax); ++static boolean PREFIX(at_endline_loc_p) (const CHAR_T *p, ++ const CHAR_T *pend, ++ reg_syntax_t syntax); ++# ifdef WCHAR ++static reg_errcode_t wcs_compile_range (CHAR_T range_start, ++ const CHAR_T **p_ptr, ++ const CHAR_T *pend, ++ char *translate, ++ reg_syntax_t syntax, ++ UCHAR_T *b, ++ CHAR_T *char_set); ++static void insert_space (int num, CHAR_T *loc, CHAR_T *end); ++# else /* BYTE */ ++static reg_errcode_t byte_compile_range (unsigned int range_start, ++ const char **p_ptr, ++ const char *pend, ++ RE_TRANSLATE_TYPE translate, ++ reg_syntax_t syntax, ++ unsigned char *b); ++# endif /* WCHAR */ ++ ++/* Fetch the next character in the uncompiled pattern---translating it ++ if necessary. Also cast from a signed character in the constant ++ string passed to us by the user to an unsigned char that we can use ++ as an array index (in, e.g., `translate'). */ ++/* ifdef MBS_SUPPORT, we translate only if character <= 0xff, ++ because it is impossible to allocate 4GB array for some encodings ++ which have 4 byte character_set like UCS4. */ ++# ifndef PATFETCH ++# ifdef WCHAR ++# define PATFETCH(c) \ ++ do {if (p == pend) return REG_EEND; \ ++ c = (UCHAR_T) *p++; \ ++ if (translate && (c <= 0xff)) c = (UCHAR_T) translate[c]; \ ++ } while (0) ++# else /* BYTE */ ++# define PATFETCH(c) \ ++ do {if (p == pend) return REG_EEND; \ ++ c = (unsigned char) *p++; \ ++ if (translate) c = (unsigned char) translate[c]; \ ++ } while (0) ++# endif /* WCHAR */ ++# endif ++ ++/* Fetch the next character in the uncompiled pattern, with no ++ translation. */ ++# define PATFETCH_RAW(c) \ ++ do {if (p == pend) return REG_EEND; \ ++ c = (UCHAR_T) *p++; \ ++ } while (0) ++ ++/* Go backwards one character in the pattern. */ ++# define PATUNFETCH p-- ++ ++ ++/* If `translate' is non-null, return translate[D], else just D. We ++ cast the subscript to translate because some data is declared as ++ `char *', to avoid warnings when a string constant is passed. But ++ when we use a character as a subscript we must make it unsigned. */ ++/* ifdef MBS_SUPPORT, we translate only if character <= 0xff, ++ because it is impossible to allocate 4GB array for some encodings ++ which have 4 byte character_set like UCS4. */ ++ ++# ifndef TRANSLATE ++# ifdef WCHAR ++# define TRANSLATE(d) \ ++ ((translate && ((UCHAR_T) (d)) <= 0xff) \ ++ ? (char) translate[(unsigned char) (d)] : (d)) ++# else /* BYTE */ ++# define TRANSLATE(d) \ ++ (translate ? (char) translate[(unsigned char) (d)] : (char) (d)) ++# endif /* WCHAR */ ++# endif ++ ++ ++/* Macros for outputting the compiled pattern into `buffer'. */ ++ ++/* If the buffer isn't allocated when it comes in, use this. */ ++# define INIT_BUF_SIZE (32 * sizeof(UCHAR_T)) ++ ++/* Make sure we have at least N more bytes of space in buffer. */ ++# ifdef WCHAR ++# define GET_BUFFER_SPACE(n) \ ++ while (((unsigned long)b - (unsigned long)COMPILED_BUFFER_VAR \ ++ + (n)*sizeof(CHAR_T)) > bufp->allocated) \ ++ EXTEND_BUFFER () ++# else /* BYTE */ ++# define GET_BUFFER_SPACE(n) \ ++ while ((unsigned long) (b - bufp->buffer + (n)) > bufp->allocated) \ ++ EXTEND_BUFFER () ++# endif /* WCHAR */ ++ ++/* Make sure we have one more byte of buffer space and then add C to it. */ ++# define BUF_PUSH(c) \ ++ do { \ ++ GET_BUFFER_SPACE (1); \ ++ *b++ = (UCHAR_T) (c); \ ++ } while (0) ++ ++ ++/* Ensure we have two more bytes of buffer space and then append C1 and C2. */ ++# define BUF_PUSH_2(c1, c2) \ ++ do { \ ++ GET_BUFFER_SPACE (2); \ ++ *b++ = (UCHAR_T) (c1); \ ++ *b++ = (UCHAR_T) (c2); \ ++ } while (0) ++ ++ ++/* As with BUF_PUSH_2, except for three bytes. */ ++# define BUF_PUSH_3(c1, c2, c3) \ ++ do { \ ++ GET_BUFFER_SPACE (3); \ ++ *b++ = (UCHAR_T) (c1); \ ++ *b++ = (UCHAR_T) (c2); \ ++ *b++ = (UCHAR_T) (c3); \ ++ } while (0) ++ ++/* Store a jump with opcode OP at LOC to location TO. We store a ++ relative address offset by the three bytes the jump itself occupies. */ ++# define STORE_JUMP(op, loc, to) \ ++ PREFIX(store_op1) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE))) ++ ++/* Likewise, for a two-argument jump. */ ++# define STORE_JUMP2(op, loc, to, arg) \ ++ PREFIX(store_op2) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)), arg) ++ ++/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */ ++# define INSERT_JUMP(op, loc, to) \ ++ PREFIX(insert_op1) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)), b) ++ ++/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */ ++# define INSERT_JUMP2(op, loc, to, arg) \ ++ PREFIX(insert_op2) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)),\ ++ arg, b) ++ ++/* This is not an arbitrary limit: the arguments which represent offsets ++ into the pattern are two bytes long. So if 2^16 bytes turns out to ++ be too small, many things would have to change. */ ++/* Any other compiler which, like MSC, has allocation limit below 2^16 ++ bytes will have to use approach similar to what was done below for ++ MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up ++ reallocating to 0 bytes. Such thing is not going to work too well. ++ You have been warned!! */ ++# ifndef DEFINED_ONCE ++# if defined _MSC_VER && !defined WIN32 ++/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes. ++ The REALLOC define eliminates a flurry of conversion warnings, ++ but is not required. */ ++# define MAX_BUF_SIZE 65500L ++# define REALLOC(p,s) realloc ((p), (size_t) (s)) ++# else ++# define MAX_BUF_SIZE (1L << 16) ++# define REALLOC(p,s) realloc ((p), (s)) ++# endif ++ ++/* Extend the buffer by twice its current size via realloc and ++ reset the pointers that pointed into the old block to point to the ++ correct places in the new one. If extending the buffer results in it ++ being larger than MAX_BUF_SIZE, then flag memory exhausted. */ ++# if __BOUNDED_POINTERS__ ++# define SET_HIGH_BOUND(P) (__ptrhigh (P) = __ptrlow (P) + bufp->allocated) ++# define MOVE_BUFFER_POINTER(P) \ ++ (__ptrlow (P) += incr, SET_HIGH_BOUND (P), __ptrvalue (P) += incr) ++# define ELSE_EXTEND_BUFFER_HIGH_BOUND \ ++ else \ ++ { \ ++ SET_HIGH_BOUND (b); \ ++ SET_HIGH_BOUND (begalt); \ ++ if (fixup_alt_jump) \ ++ SET_HIGH_BOUND (fixup_alt_jump); \ ++ if (laststart) \ ++ SET_HIGH_BOUND (laststart); \ ++ if (pending_exact) \ ++ SET_HIGH_BOUND (pending_exact); \ ++ } ++# else ++# define MOVE_BUFFER_POINTER(P) (P) += incr ++# define ELSE_EXTEND_BUFFER_HIGH_BOUND ++# endif ++# endif /* not DEFINED_ONCE */ ++ ++# ifdef WCHAR ++# define EXTEND_BUFFER() \ ++ do { \ ++ UCHAR_T *old_buffer = COMPILED_BUFFER_VAR; \ ++ int wchar_count; \ ++ if (bufp->allocated + sizeof(UCHAR_T) > MAX_BUF_SIZE) \ ++ return REG_ESIZE; \ ++ bufp->allocated <<= 1; \ ++ if (bufp->allocated > MAX_BUF_SIZE) \ ++ bufp->allocated = MAX_BUF_SIZE; \ ++ /* How many characters the new buffer can have? */ \ ++ wchar_count = bufp->allocated / sizeof(UCHAR_T); \ ++ if (wchar_count == 0) wchar_count = 1; \ ++ /* Truncate the buffer to CHAR_T align. */ \ ++ bufp->allocated = wchar_count * sizeof(UCHAR_T); \ ++ RETALLOC (COMPILED_BUFFER_VAR, wchar_count, UCHAR_T); \ ++ bufp->buffer = (char*)COMPILED_BUFFER_VAR; \ ++ if (COMPILED_BUFFER_VAR == NULL) \ ++ return REG_ESPACE; \ ++ /* If the buffer moved, move all the pointers into it. */ \ ++ if (old_buffer != COMPILED_BUFFER_VAR) \ ++ { \ ++ int incr = COMPILED_BUFFER_VAR - old_buffer; \ ++ MOVE_BUFFER_POINTER (b); \ ++ MOVE_BUFFER_POINTER (begalt); \ ++ if (fixup_alt_jump) \ ++ MOVE_BUFFER_POINTER (fixup_alt_jump); \ ++ if (laststart) \ ++ MOVE_BUFFER_POINTER (laststart); \ ++ if (pending_exact) \ ++ MOVE_BUFFER_POINTER (pending_exact); \ ++ } \ ++ ELSE_EXTEND_BUFFER_HIGH_BOUND \ ++ } while (0) ++# else /* BYTE */ ++# define EXTEND_BUFFER() \ ++ do { \ ++ UCHAR_T *old_buffer = COMPILED_BUFFER_VAR; \ ++ if (bufp->allocated == MAX_BUF_SIZE) \ ++ return REG_ESIZE; \ ++ bufp->allocated <<= 1; \ ++ if (bufp->allocated > MAX_BUF_SIZE) \ ++ bufp->allocated = MAX_BUF_SIZE; \ ++ bufp->buffer = (UCHAR_T *) REALLOC (COMPILED_BUFFER_VAR, \ ++ bufp->allocated); \ ++ if (COMPILED_BUFFER_VAR == NULL) \ ++ return REG_ESPACE; \ ++ /* If the buffer moved, move all the pointers into it. */ \ ++ if (old_buffer != COMPILED_BUFFER_VAR) \ ++ { \ ++ int incr = COMPILED_BUFFER_VAR - old_buffer; \ ++ MOVE_BUFFER_POINTER (b); \ ++ MOVE_BUFFER_POINTER (begalt); \ ++ if (fixup_alt_jump) \ ++ MOVE_BUFFER_POINTER (fixup_alt_jump); \ ++ if (laststart) \ ++ MOVE_BUFFER_POINTER (laststart); \ ++ if (pending_exact) \ ++ MOVE_BUFFER_POINTER (pending_exact); \ ++ } \ ++ ELSE_EXTEND_BUFFER_HIGH_BOUND \ ++ } while (0) ++# endif /* WCHAR */ ++ ++# ifndef DEFINED_ONCE ++/* Since we have one byte reserved for the register number argument to ++ {start,stop}_memory, the maximum number of groups we can report ++ things about is what fits in that byte. */ ++# define MAX_REGNUM 255 ++ ++/* But patterns can have more than `MAX_REGNUM' registers. We just ++ ignore the excess. */ ++typedef unsigned regnum_t; ++ ++ ++/* Macros for the compile stack. */ ++ ++/* Since offsets can go either forwards or backwards, this type needs to ++ be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */ ++/* int may be not enough when sizeof(int) == 2. */ ++typedef long pattern_offset_t; ++ ++typedef struct ++{ ++ pattern_offset_t begalt_offset; ++ pattern_offset_t fixup_alt_jump; ++ pattern_offset_t inner_group_offset; ++ pattern_offset_t laststart_offset; ++ regnum_t regnum; ++} compile_stack_elt_t; ++ ++ ++typedef struct ++{ ++ compile_stack_elt_t *stack; ++ unsigned size; ++ unsigned avail; /* Offset of next open position. */ ++} compile_stack_type; ++ ++ ++# define INIT_COMPILE_STACK_SIZE 32 ++ ++# define COMPILE_STACK_EMPTY (compile_stack.avail == 0) ++# define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size) ++ ++/* The next available element. */ ++# define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) ++ ++# endif /* not DEFINED_ONCE */ ++ ++/* Set the bit for character C in a list. */ ++# ifndef DEFINED_ONCE ++# define SET_LIST_BIT(c) \ ++ (b[((unsigned char) (c)) / BYTEWIDTH] \ ++ |= 1 << (((unsigned char) c) % BYTEWIDTH)) ++# endif /* DEFINED_ONCE */ ++ ++/* Get the next unsigned number in the uncompiled pattern. */ ++# define GET_UNSIGNED_NUMBER(num) \ ++ { \ ++ while (p != pend) \ ++ { \ ++ PATFETCH (c); \ ++ if (c < '0' || c > '9') \ ++ break; \ ++ if (num <= RE_DUP_MAX) \ ++ { \ ++ if (num < 0) \ ++ num = 0; \ ++ num = num * 10 + c - '0'; \ ++ } \ ++ } \ ++ } ++ ++# ifndef DEFINED_ONCE ++# if WIDE_CHAR_SUPPORT ++/* The GNU C library provides support for user-defined character classes ++ and the functions from ISO C amendement 1. */ ++# ifdef CHARCLASS_NAME_MAX ++# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX ++# else ++/* This shouldn't happen but some implementation might still have this ++ problem. Use a reasonable default value. */ ++# define CHAR_CLASS_MAX_LENGTH 256 ++# endif ++ ++# ifdef _LIBC ++# define IS_CHAR_CLASS(string) __wctype (string) ++# else ++# define IS_CHAR_CLASS(string) wctype (string) ++# endif ++# else ++# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ ++ ++# define IS_CHAR_CLASS(string) \ ++ (STREQ (string, "alpha") || STREQ (string, "upper") \ ++ || STREQ (string, "lower") || STREQ (string, "digit") \ ++ || STREQ (string, "alnum") || STREQ (string, "xdigit") \ ++ || STREQ (string, "space") || STREQ (string, "print") \ ++ || STREQ (string, "punct") || STREQ (string, "graph") \ ++ || STREQ (string, "cntrl") || STREQ (string, "blank")) ++# endif ++# endif /* DEFINED_ONCE */ ++ ++# ifndef MATCH_MAY_ALLOCATE ++ ++/* If we cannot allocate large objects within re_match_2_internal, ++ we make the fail stack and register vectors global. ++ The fail stack, we grow to the maximum size when a regexp ++ is compiled. ++ The register vectors, we adjust in size each time we ++ compile a regexp, according to the number of registers it needs. */ ++ ++static PREFIX(fail_stack_type) fail_stack; ++ ++/* Size with which the following vectors are currently allocated. ++ That is so we can make them bigger as needed, ++ but never make them smaller. */ ++# ifdef DEFINED_ONCE ++static int regs_allocated_size; ++ ++static const char ** regstart, ** regend; ++static const char ** old_regstart, ** old_regend; ++static const char **best_regstart, **best_regend; ++static const char **reg_dummy; ++# endif /* DEFINED_ONCE */ ++ ++static PREFIX(register_info_type) *PREFIX(reg_info); ++static PREFIX(register_info_type) *PREFIX(reg_info_dummy); ++ ++/* Make the register vectors big enough for NUM_REGS registers, ++ but don't make them smaller. */ ++ ++static void ++PREFIX(regex_grow_registers) (int num_regs) ++{ ++ if (num_regs > regs_allocated_size) ++ { ++ RETALLOC_IF (regstart, num_regs, const char *); ++ RETALLOC_IF (regend, num_regs, const char *); ++ RETALLOC_IF (old_regstart, num_regs, const char *); ++ RETALLOC_IF (old_regend, num_regs, const char *); ++ RETALLOC_IF (best_regstart, num_regs, const char *); ++ RETALLOC_IF (best_regend, num_regs, const char *); ++ RETALLOC_IF (PREFIX(reg_info), num_regs, PREFIX(register_info_type)); ++ RETALLOC_IF (reg_dummy, num_regs, const char *); ++ RETALLOC_IF (PREFIX(reg_info_dummy), num_regs, PREFIX(register_info_type)); ++ ++ regs_allocated_size = num_regs; ++ } ++} ++ ++# endif /* not MATCH_MAY_ALLOCATE */ ++ ++# ifndef DEFINED_ONCE ++static boolean group_in_compile_stack (compile_stack_type compile_stack, ++ regnum_t regnum); ++# endif /* not DEFINED_ONCE */ ++ ++/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX. ++ Returns one of error codes defined in `regex.h', or zero for success. ++ ++ Assumes the `allocated' (and perhaps `buffer') and `translate' ++ fields are set in BUFP on entry. ++ ++ If it succeeds, results are put in BUFP (if it returns an error, the ++ contents of BUFP are undefined): ++ `buffer' is the compiled pattern; ++ `syntax' is set to SYNTAX; ++ `used' is set to the length of the compiled pattern; ++ `fastmap_accurate' is zero; ++ `re_nsub' is the number of subexpressions in PATTERN; ++ `not_bol' and `not_eol' are zero; ++ ++ The `fastmap' and `newline_anchor' fields are neither ++ examined nor set. */ ++ ++/* Return, freeing storage we allocated. */ ++# ifdef WCHAR ++# define FREE_STACK_RETURN(value) \ ++ return (free(pattern), free(mbs_offset), free(is_binary), free (compile_stack.stack), value) ++# else ++# define FREE_STACK_RETURN(value) \ ++ return (free (compile_stack.stack), value) ++# endif /* WCHAR */ ++ ++static reg_errcode_t ++PREFIX(regex_compile) (const char *ARG_PREFIX(pattern), ++ size_t ARG_PREFIX(size), reg_syntax_t syntax, ++ struct re_pattern_buffer *bufp) ++{ ++ /* We fetch characters from PATTERN here. Even though PATTERN is ++ `char *' (i.e., signed), we declare these variables as unsigned, so ++ they can be reliably used as array indices. */ ++ register UCHAR_T c, c1; ++ ++#ifdef WCHAR ++ /* A temporary space to keep wchar_t pattern and compiled pattern. */ ++ CHAR_T *pattern, *COMPILED_BUFFER_VAR; ++ size_t size; ++ /* offset buffer for optimization. See convert_mbs_to_wc. */ ++ int *mbs_offset = NULL; ++ /* It hold whether each wchar_t is binary data or not. */ ++ char *is_binary = NULL; ++ /* A flag whether exactn is handling binary data or not. */ ++ char is_exactn_bin = FALSE; ++#endif /* WCHAR */ ++ ++ /* A random temporary spot in PATTERN. */ ++ const CHAR_T *p1; ++ ++ /* Points to the end of the buffer, where we should append. */ ++ register UCHAR_T *b; ++ ++ /* Keeps track of unclosed groups. */ ++ compile_stack_type compile_stack; ++ ++ /* Points to the current (ending) position in the pattern. */ ++#ifdef WCHAR ++ const CHAR_T *p; ++ const CHAR_T *pend; ++#else /* BYTE */ ++ const CHAR_T *p = pattern; ++ const CHAR_T *pend = pattern + size; ++#endif /* WCHAR */ ++ ++ /* How to translate the characters in the pattern. */ ++ RE_TRANSLATE_TYPE translate = bufp->translate; ++ ++ /* Address of the count-byte of the most recently inserted `exactn' ++ command. This makes it possible to tell if a new exact-match ++ character can be added to that command or if the character requires ++ a new `exactn' command. */ ++ UCHAR_T *pending_exact = 0; ++ ++ /* Address of start of the most recently finished expression. ++ This tells, e.g., postfix * where to find the start of its ++ operand. Reset at the beginning of groups and alternatives. */ ++ UCHAR_T *laststart = 0; ++ ++ /* Address of beginning of regexp, or inside of last group. */ ++ UCHAR_T *begalt; ++ ++ /* Address of the place where a forward jump should go to the end of ++ the containing expression. Each alternative of an `or' -- except the ++ last -- ends with a forward jump of this sort. */ ++ UCHAR_T *fixup_alt_jump = 0; ++ ++ /* Counts open-groups as they are encountered. Remembered for the ++ matching close-group on the compile stack, so the same register ++ number is put in the stop_memory as the start_memory. */ ++ regnum_t regnum = 0; ++ ++#ifdef WCHAR ++ /* Initialize the wchar_t PATTERN and offset_buffer. */ ++ p = pend = pattern = TALLOC(csize + 1, CHAR_T); ++ mbs_offset = TALLOC(csize + 1, int); ++ is_binary = TALLOC(csize + 1, char); ++ if (pattern == NULL || mbs_offset == NULL || is_binary == NULL) ++ { ++ free(pattern); ++ free(mbs_offset); ++ free(is_binary); ++ return REG_ESPACE; ++ } ++ pattern[csize] = L'\0'; /* sentinel */ ++ size = convert_mbs_to_wcs(pattern, cpattern, csize, mbs_offset, is_binary); ++ pend = p + size; ++ if (size < 0) ++ { ++ free(pattern); ++ free(mbs_offset); ++ free(is_binary); ++ return REG_BADPAT; ++ } ++#endif ++ ++#ifdef DEBUG ++ DEBUG_PRINT1 ("\nCompiling pattern: "); ++ if (debug) ++ { ++ unsigned debug_count; ++ ++ for (debug_count = 0; debug_count < size; debug_count++) ++ PUT_CHAR (pattern[debug_count]); ++ putchar ('\n'); ++ } ++#endif /* DEBUG */ ++ ++ /* Initialize the compile stack. */ ++ compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t); ++ if (compile_stack.stack == NULL) ++ { ++#ifdef WCHAR ++ free(pattern); ++ free(mbs_offset); ++ free(is_binary); ++#endif ++ return REG_ESPACE; ++ } ++ ++ compile_stack.size = INIT_COMPILE_STACK_SIZE; ++ compile_stack.avail = 0; ++ ++ /* Initialize the pattern buffer. */ ++ bufp->syntax = syntax; ++ bufp->fastmap_accurate = 0; ++ bufp->not_bol = bufp->not_eol = 0; ++ ++ /* Set `used' to zero, so that if we return an error, the pattern ++ printer (for debugging) will think there's no pattern. We reset it ++ at the end. */ ++ bufp->used = 0; ++ ++ /* Always count groups, whether or not bufp->no_sub is set. */ ++ bufp->re_nsub = 0; ++ ++#if !defined emacs && !defined SYNTAX_TABLE ++ /* Initialize the syntax table. */ ++ init_syntax_once (); ++#endif ++ ++ if (bufp->allocated == 0) ++ { ++ if (bufp->buffer) ++ { /* If zero allocated, but buffer is non-null, try to realloc ++ enough space. This loses if buffer's address is bogus, but ++ that is the user's responsibility. */ ++#ifdef WCHAR ++ /* Free bufp->buffer and allocate an array for wchar_t pattern ++ buffer. */ ++ free(bufp->buffer); ++ COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE/sizeof(UCHAR_T), ++ UCHAR_T); ++#else ++ RETALLOC (COMPILED_BUFFER_VAR, INIT_BUF_SIZE, UCHAR_T); ++#endif /* WCHAR */ ++ } ++ else ++ { /* Caller did not allocate a buffer. Do it for them. */ ++ COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE / sizeof(UCHAR_T), ++ UCHAR_T); ++ } ++ ++ if (!COMPILED_BUFFER_VAR) FREE_STACK_RETURN (REG_ESPACE); ++#ifdef WCHAR ++ bufp->buffer = (char*)COMPILED_BUFFER_VAR; ++#endif /* WCHAR */ ++ bufp->allocated = INIT_BUF_SIZE; ++ } ++#ifdef WCHAR ++ else ++ COMPILED_BUFFER_VAR = (UCHAR_T*) bufp->buffer; ++#endif ++ ++ begalt = b = COMPILED_BUFFER_VAR; ++ ++ /* Loop through the uncompiled pattern until we're at the end. */ ++ while (p != pend) ++ { ++ PATFETCH (c); ++ ++ switch (c) ++ { ++ case '^': ++ { ++ if ( /* If at start of pattern, it's an operator. */ ++ p == pattern + 1 ++ /* If context independent, it's an operator. */ ++ || syntax & RE_CONTEXT_INDEP_ANCHORS ++ /* Otherwise, depends on what's come before. */ ++ || PREFIX(at_begline_loc_p) (pattern, p, syntax)) ++ BUF_PUSH (begline); ++ else ++ goto normal_char; ++ } ++ break; ++ ++ ++ case '$': ++ { ++ if ( /* If at end of pattern, it's an operator. */ ++ p == pend ++ /* If context independent, it's an operator. */ ++ || syntax & RE_CONTEXT_INDEP_ANCHORS ++ /* Otherwise, depends on what's next. */ ++ || PREFIX(at_endline_loc_p) (p, pend, syntax)) ++ BUF_PUSH (endline); ++ else ++ goto normal_char; ++ } ++ break; ++ ++ ++ case '+': ++ case '?': ++ if ((syntax & RE_BK_PLUS_QM) ++ || (syntax & RE_LIMITED_OPS)) ++ goto normal_char; ++ handle_plus: ++ case '*': ++ /* If there is no previous pattern... */ ++ if (!laststart) ++ { ++ if (syntax & RE_CONTEXT_INVALID_OPS) ++ FREE_STACK_RETURN (REG_BADRPT); ++ else if (!(syntax & RE_CONTEXT_INDEP_OPS)) ++ goto normal_char; ++ } ++ ++ { ++ /* Are we optimizing this jump? */ ++ boolean keep_string_p = false; ++ ++ /* 1 means zero (many) matches is allowed. */ ++ char zero_times_ok = 0, many_times_ok = 0; ++ ++ /* If there is a sequence of repetition chars, collapse it ++ down to just one (the right one). We can't combine ++ interval operators with these because of, e.g., `a{2}*', ++ which should only match an even number of `a's. */ ++ ++ for (;;) ++ { ++ zero_times_ok |= c != '+'; ++ many_times_ok |= c != '?'; ++ ++ if (p == pend) ++ break; ++ ++ PATFETCH (c); ++ ++ if (c == '*' ++ || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?'))) ++ ; ++ ++ else if (syntax & RE_BK_PLUS_QM && c == '\\') ++ { ++ if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); ++ ++ PATFETCH (c1); ++ if (!(c1 == '+' || c1 == '?')) ++ { ++ PATUNFETCH; ++ PATUNFETCH; ++ break; ++ } ++ ++ c = c1; ++ } ++ else ++ { ++ PATUNFETCH; ++ break; ++ } ++ ++ /* If we get here, we found another repeat character. */ ++ } ++ ++ /* Star, etc. applied to an empty pattern is equivalent ++ to an empty pattern. */ ++ if (!laststart) ++ break; ++ ++ /* Now we know whether or not zero matches is allowed ++ and also whether or not two or more matches is allowed. */ ++ if (many_times_ok) ++ { /* More than one repetition is allowed, so put in at the ++ end a backward relative jump from `b' to before the next ++ jump we're going to put in below (which jumps from ++ laststart to after this jump). ++ ++ But if we are at the `*' in the exact sequence `.*\n', ++ insert an unconditional jump backwards to the ., ++ instead of the beginning of the loop. This way we only ++ push a failure point once, instead of every time ++ through the loop. */ ++ assert (p - 1 > pattern); ++ ++ /* Allocate the space for the jump. */ ++ GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); ++ ++ /* We know we are not at the first character of the pattern, ++ because laststart was nonzero. And we've already ++ incremented `p', by the way, to be the character after ++ the `*'. Do we have to do something analogous here ++ for null bytes, because of RE_DOT_NOT_NULL? */ ++ if (TRANSLATE (*(p - 2)) == TRANSLATE ('.') ++ && zero_times_ok ++ && p < pend && TRANSLATE (*p) == TRANSLATE ('\n') ++ && !(syntax & RE_DOT_NEWLINE)) ++ { /* We have .*\n. */ ++ STORE_JUMP (jump, b, laststart); ++ keep_string_p = true; ++ } ++ else ++ /* Anything else. */ ++ STORE_JUMP (maybe_pop_jump, b, laststart - ++ (1 + OFFSET_ADDRESS_SIZE)); ++ ++ /* We've added more stuff to the buffer. */ ++ b += 1 + OFFSET_ADDRESS_SIZE; ++ } ++ ++ /* On failure, jump from laststart to b + 3, which will be the ++ end of the buffer after this jump is inserted. */ ++ /* ifdef WCHAR, 'b + 1 + OFFSET_ADDRESS_SIZE' instead of ++ 'b + 3'. */ ++ GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); ++ INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump ++ : on_failure_jump, ++ laststart, b + 1 + OFFSET_ADDRESS_SIZE); ++ pending_exact = 0; ++ b += 1 + OFFSET_ADDRESS_SIZE; ++ ++ if (!zero_times_ok) ++ { ++ /* At least one repetition is required, so insert a ++ `dummy_failure_jump' before the initial ++ `on_failure_jump' instruction of the loop. This ++ effects a skip over that instruction the first time ++ we hit that loop. */ ++ GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); ++ INSERT_JUMP (dummy_failure_jump, laststart, laststart + ++ 2 + 2 * OFFSET_ADDRESS_SIZE); ++ b += 1 + OFFSET_ADDRESS_SIZE; ++ } ++ } ++ break; ++ ++ ++ case '.': ++ laststart = b; ++ BUF_PUSH (anychar); ++ break; ++ ++ ++ case '[': ++ { ++ boolean had_char_class = false; ++#ifdef WCHAR ++ CHAR_T range_start = 0xffffffff; ++#else ++ unsigned int range_start = 0xffffffff; ++#endif ++ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); ++ ++#ifdef WCHAR ++ /* We assume a charset(_not) structure as a wchar_t array. ++ charset[0] = (re_opcode_t) charset(_not) ++ charset[1] = l (= length of char_classes) ++ charset[2] = m (= length of collating_symbols) ++ charset[3] = n (= length of equivalence_classes) ++ charset[4] = o (= length of char_ranges) ++ charset[5] = p (= length of chars) ++ ++ charset[6] = char_class (wctype_t) ++ charset[6+CHAR_CLASS_SIZE] = char_class (wctype_t) ++ ... ++ charset[l+5] = char_class (wctype_t) ++ ++ charset[l+6] = collating_symbol (wchar_t) ++ ... ++ charset[l+m+5] = collating_symbol (wchar_t) ++ ifdef _LIBC we use the index if ++ _NL_COLLATE_SYMB_EXTRAMB instead of ++ wchar_t string. ++ ++ charset[l+m+6] = equivalence_classes (wchar_t) ++ ... ++ charset[l+m+n+5] = equivalence_classes (wchar_t) ++ ifdef _LIBC we use the index in ++ _NL_COLLATE_WEIGHT instead of ++ wchar_t string. ++ ++ charset[l+m+n+6] = range_start ++ charset[l+m+n+7] = range_end ++ ... ++ charset[l+m+n+2o+4] = range_start ++ charset[l+m+n+2o+5] = range_end ++ ifdef _LIBC we use the value looked up ++ in _NL_COLLATE_COLLSEQ instead of ++ wchar_t character. ++ ++ charset[l+m+n+2o+6] = char ++ ... ++ charset[l+m+n+2o+p+5] = char ++ ++ */ ++ ++ /* We need at least 6 spaces: the opcode, the length of ++ char_classes, the length of collating_symbols, the length of ++ equivalence_classes, the length of char_ranges, the length of ++ chars. */ ++ GET_BUFFER_SPACE (6); ++ ++ /* Save b as laststart. And We use laststart as the pointer ++ to the first element of the charset here. ++ In other words, laststart[i] indicates charset[i]. */ ++ laststart = b; ++ ++ /* We test `*p == '^' twice, instead of using an if ++ statement, so we only need one BUF_PUSH. */ ++ BUF_PUSH (*p == '^' ? charset_not : charset); ++ if (*p == '^') ++ p++; ++ ++ /* Push the length of char_classes, the length of ++ collating_symbols, the length of equivalence_classes, the ++ length of char_ranges and the length of chars. */ ++ BUF_PUSH_3 (0, 0, 0); ++ BUF_PUSH_2 (0, 0); ++ ++ /* Remember the first position in the bracket expression. */ ++ p1 = p; ++ ++ /* charset_not matches newline according to a syntax bit. */ ++ if ((re_opcode_t) b[-6] == charset_not ++ && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) ++ { ++ BUF_PUSH('\n'); ++ laststart[5]++; /* Update the length of characters */ ++ } ++ ++ /* Read in characters and ranges, setting map bits. */ ++ for (;;) ++ { ++ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); ++ ++ PATFETCH (c); ++ ++ /* \ might escape characters inside [...] and [^...]. */ ++ if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') ++ { ++ if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); ++ ++ PATFETCH (c1); ++ BUF_PUSH(c1); ++ laststart[5]++; /* Update the length of chars */ ++ range_start = c1; ++ continue; ++ } ++ ++ /* Could be the end of the bracket expression. If it's ++ not (i.e., when the bracket expression is `[]' so ++ far), the ']' character bit gets set way below. */ ++ if (c == ']' && p != p1 + 1) ++ break; ++ ++ /* Look ahead to see if it's a range when the last thing ++ was a character class. */ ++ if (had_char_class && c == '-' && *p != ']') ++ FREE_STACK_RETURN (REG_ERANGE); ++ ++ /* Look ahead to see if it's a range when the last thing ++ was a character: if this is a hyphen not at the ++ beginning or the end of a list, then it's the range ++ operator. */ ++ if (c == '-' ++ && !(p - 2 >= pattern && p[-2] == '[') ++ && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') ++ && *p != ']') ++ { ++ reg_errcode_t ret; ++ /* Allocate the space for range_start and range_end. */ ++ GET_BUFFER_SPACE (2); ++ /* Update the pointer to indicate end of buffer. */ ++ b += 2; ++ ret = wcs_compile_range (range_start, &p, pend, translate, ++ syntax, b, laststart); ++ if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); ++ range_start = 0xffffffff; ++ } ++ else if (p[0] == '-' && p[1] != ']') ++ { /* This handles ranges made up of characters only. */ ++ reg_errcode_t ret; ++ ++ /* Move past the `-'. */ ++ PATFETCH (c1); ++ /* Allocate the space for range_start and range_end. */ ++ GET_BUFFER_SPACE (2); ++ /* Update the pointer to indicate end of buffer. */ ++ b += 2; ++ ret = wcs_compile_range (c, &p, pend, translate, syntax, b, ++ laststart); ++ if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); ++ range_start = 0xffffffff; ++ } ++ ++ /* See if we're at the beginning of a possible character ++ class. */ ++ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':') ++ { /* Leave room for the null. */ ++ char str[CHAR_CLASS_MAX_LENGTH + 1]; ++ ++ PATFETCH (c); ++ c1 = 0; ++ ++ /* If pattern is `[[:'. */ ++ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); ++ ++ for (;;) ++ { ++ PATFETCH (c); ++ if ((c == ':' && *p == ']') || p == pend) ++ break; ++ if (c1 < CHAR_CLASS_MAX_LENGTH) ++ str[c1++] = c; ++ else ++ /* This is in any case an invalid class name. */ ++ str[0] = '\0'; ++ } ++ str[c1] = '\0'; ++ ++ /* If isn't a word bracketed by `[:' and `:]': ++ undo the ending character, the letters, and leave ++ the leading `:' and `[' (but store them as character). */ ++ if (c == ':' && *p == ']') ++ { ++ wctype_t wt; ++ uintptr_t alignedp; ++ ++ /* Query the character class as wctype_t. */ ++ wt = IS_CHAR_CLASS (str); ++ if (wt == 0) ++ FREE_STACK_RETURN (REG_ECTYPE); ++ ++ /* Throw away the ] at the end of the character ++ class. */ ++ PATFETCH (c); ++ ++ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); ++ ++ /* Allocate the space for character class. */ ++ GET_BUFFER_SPACE(CHAR_CLASS_SIZE); ++ /* Update the pointer to indicate end of buffer. */ ++ b += CHAR_CLASS_SIZE; ++ /* Move data which follow character classes ++ not to violate the data. */ ++ insert_space(CHAR_CLASS_SIZE, ++ laststart + 6 + laststart[1], ++ b - 1); ++ alignedp = ((uintptr_t)(laststart + 6 + laststart[1]) ++ + __alignof__(wctype_t) - 1) ++ & ~(uintptr_t)(__alignof__(wctype_t) - 1); ++ /* Store the character class. */ ++ *((wctype_t*)alignedp) = wt; ++ /* Update length of char_classes */ ++ laststart[1] += CHAR_CLASS_SIZE; ++ ++ had_char_class = true; ++ } ++ else ++ { ++ c1++; ++ while (c1--) ++ PATUNFETCH; ++ BUF_PUSH ('['); ++ BUF_PUSH (':'); ++ laststart[5] += 2; /* Update the length of characters */ ++ range_start = ':'; ++ had_char_class = false; ++ } ++ } ++ else if (syntax & RE_CHAR_CLASSES && c == '[' && (*p == '=' ++ || *p == '.')) ++ { ++ CHAR_T str[128]; /* Should be large enough. */ ++ CHAR_T delim = *p; /* '=' or '.' */ ++# ifdef _LIBC ++ uint32_t nrules = ++ _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); ++# endif ++ PATFETCH (c); ++ c1 = 0; ++ ++ /* If pattern is `[[=' or '[[.'. */ ++ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); ++ ++ for (;;) ++ { ++ PATFETCH (c); ++ if ((c == delim && *p == ']') || p == pend) ++ break; ++ if (c1 < sizeof (str) - 1) ++ str[c1++] = c; ++ else ++ /* This is in any case an invalid class name. */ ++ str[0] = '\0'; ++ } ++ str[c1] = '\0'; ++ ++ if (c == delim && *p == ']' && str[0] != '\0') ++ { ++ unsigned int i, offset; ++ /* If we have no collation data we use the default ++ collation in which each character is in a class ++ by itself. It also means that ASCII is the ++ character set and therefore we cannot have character ++ with more than one byte in the multibyte ++ representation. */ ++ ++ /* If not defined _LIBC, we push the name and ++ `\0' for the sake of matching performance. */ ++ int datasize = c1 + 1; ++ ++# ifdef _LIBC ++ int32_t idx = 0; ++ if (nrules == 0) ++# endif ++ { ++ if (c1 != 1) ++ FREE_STACK_RETURN (REG_ECOLLATE); ++ } ++# ifdef _LIBC ++ else ++ { ++ const int32_t *table; ++ const int32_t *weights; ++ const int32_t *extra; ++ const int32_t *indirect; ++ wint_t *cp; ++ ++ /* This #include defines a local function! */ ++# include ++ ++ if(delim == '=') ++ { ++ /* We push the index for equivalence class. */ ++ cp = (wint_t*)str; ++ ++ table = (const int32_t *) ++ _NL_CURRENT (LC_COLLATE, ++ _NL_COLLATE_TABLEWC); ++ weights = (const int32_t *) ++ _NL_CURRENT (LC_COLLATE, ++ _NL_COLLATE_WEIGHTWC); ++ extra = (const int32_t *) ++ _NL_CURRENT (LC_COLLATE, ++ _NL_COLLATE_EXTRAWC); ++ indirect = (const int32_t *) ++ _NL_CURRENT (LC_COLLATE, ++ _NL_COLLATE_INDIRECTWC); ++ ++ idx = findidx ((const wint_t**)&cp, c1); ++ if (idx == 0 || cp < (wint_t*) str + c1) ++ /* This is no valid character. */ ++ FREE_STACK_RETURN (REG_ECOLLATE); ++ ++ str[0] = (wchar_t)idx; ++ } ++ else /* delim == '.' */ ++ { ++ /* We push collation sequence value ++ for collating symbol. */ ++ int32_t table_size; ++ const int32_t *symb_table; ++ const unsigned char *extra; ++ int32_t idx; ++ int32_t elem; ++ int32_t second; ++ int32_t hash; ++ char char_str[c1]; ++ ++ /* We have to convert the name to a single-byte ++ string. This is possible since the names ++ consist of ASCII characters and the internal ++ representation is UCS4. */ ++ for (i = 0; i < c1; ++i) ++ char_str[i] = str[i]; ++ ++ table_size = ++ _NL_CURRENT_WORD (LC_COLLATE, ++ _NL_COLLATE_SYMB_HASH_SIZEMB); ++ symb_table = (const int32_t *) ++ _NL_CURRENT (LC_COLLATE, ++ _NL_COLLATE_SYMB_TABLEMB); ++ extra = (const unsigned char *) ++ _NL_CURRENT (LC_COLLATE, ++ _NL_COLLATE_SYMB_EXTRAMB); ++ ++ /* Locate the character in the hashing table. */ ++ hash = elem_hash (char_str, c1); ++ ++ idx = 0; ++ elem = hash % table_size; ++ second = hash % (table_size - 2); ++ while (symb_table[2 * elem] != 0) ++ { ++ /* First compare the hashing value. */ ++ if (symb_table[2 * elem] == hash ++ && c1 == extra[symb_table[2 * elem + 1]] ++ && memcmp (char_str, ++ &extra[symb_table[2 * elem + 1] ++ + 1], c1) == 0) ++ { ++ /* Yep, this is the entry. */ ++ idx = symb_table[2 * elem + 1]; ++ idx += 1 + extra[idx]; ++ break; ++ } ++ ++ /* Next entry. */ ++ elem += second; ++ } ++ ++ if (symb_table[2 * elem] != 0) ++ { ++ /* Compute the index of the byte sequence ++ in the table. */ ++ idx += 1 + extra[idx]; ++ /* Adjust for the alignment. */ ++ idx = (idx + 3) & ~3; ++ ++ str[0] = (wchar_t) idx + 4; ++ } ++ else if (symb_table[2 * elem] == 0 && c1 == 1) ++ { ++ /* No valid character. Match it as a ++ single byte character. */ ++ had_char_class = false; ++ BUF_PUSH(str[0]); ++ /* Update the length of characters */ ++ laststart[5]++; ++ range_start = str[0]; ++ ++ /* Throw away the ] at the end of the ++ collating symbol. */ ++ PATFETCH (c); ++ /* exit from the switch block. */ ++ continue; ++ } ++ else ++ FREE_STACK_RETURN (REG_ECOLLATE); ++ } ++ datasize = 1; ++ } ++# endif ++ /* Throw away the ] at the end of the equivalence ++ class (or collating symbol). */ ++ PATFETCH (c); ++ ++ /* Allocate the space for the equivalence class ++ (or collating symbol) (and '\0' if needed). */ ++ GET_BUFFER_SPACE(datasize); ++ /* Update the pointer to indicate end of buffer. */ ++ b += datasize; ++ ++ if (delim == '=') ++ { /* equivalence class */ ++ /* Calculate the offset of char_ranges, ++ which is next to equivalence_classes. */ ++ offset = laststart[1] + laststart[2] ++ + laststart[3] +6; ++ /* Insert space. */ ++ insert_space(datasize, laststart + offset, b - 1); ++ ++ /* Write the equivalence_class and \0. */ ++ for (i = 0 ; i < datasize ; i++) ++ laststart[offset + i] = str[i]; ++ ++ /* Update the length of equivalence_classes. */ ++ laststart[3] += datasize; ++ had_char_class = true; ++ } ++ else /* delim == '.' */ ++ { /* collating symbol */ ++ /* Calculate the offset of the equivalence_classes, ++ which is next to collating_symbols. */ ++ offset = laststart[1] + laststart[2] + 6; ++ /* Insert space and write the collationg_symbol ++ and \0. */ ++ insert_space(datasize, laststart + offset, b-1); ++ for (i = 0 ; i < datasize ; i++) ++ laststart[offset + i] = str[i]; ++ ++ /* In re_match_2_internal if range_start < -1, we ++ assume -range_start is the offset of the ++ collating symbol which is specified as ++ the character of the range start. So we assign ++ -(laststart[1] + laststart[2] + 6) to ++ range_start. */ ++ range_start = -(laststart[1] + laststart[2] + 6); ++ /* Update the length of collating_symbol. */ ++ laststart[2] += datasize; ++ had_char_class = false; ++ } ++ } ++ else ++ { ++ c1++; ++ while (c1--) ++ PATUNFETCH; ++ BUF_PUSH ('['); ++ BUF_PUSH (delim); ++ laststart[5] += 2; /* Update the length of characters */ ++ range_start = delim; ++ had_char_class = false; ++ } ++ } ++ else ++ { ++ had_char_class = false; ++ BUF_PUSH(c); ++ laststart[5]++; /* Update the length of characters */ ++ range_start = c; ++ } ++ } ++ ++#else /* BYTE */ ++ /* Ensure that we have enough space to push a charset: the ++ opcode, the length count, and the bitset; 34 bytes in all. */ ++ GET_BUFFER_SPACE (34); ++ ++ laststart = b; ++ ++ /* We test `*p == '^' twice, instead of using an if ++ statement, so we only need one BUF_PUSH. */ ++ BUF_PUSH (*p == '^' ? charset_not : charset); ++ if (*p == '^') ++ p++; ++ ++ /* Remember the first position in the bracket expression. */ ++ p1 = p; ++ ++ /* Push the number of bytes in the bitmap. */ ++ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); ++ ++ /* Clear the whole map. */ ++ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH); ++ ++ /* charset_not matches newline according to a syntax bit. */ ++ if ((re_opcode_t) b[-2] == charset_not ++ && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) ++ SET_LIST_BIT ('\n'); ++ ++ /* Read in characters and ranges, setting map bits. */ ++ for (;;) ++ { ++ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); ++ ++ PATFETCH (c); ++ ++ /* \ might escape characters inside [...] and [^...]. */ ++ if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') ++ { ++ if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); ++ ++ PATFETCH (c1); ++ SET_LIST_BIT (c1); ++ range_start = c1; ++ continue; ++ } ++ ++ /* Could be the end of the bracket expression. If it's ++ not (i.e., when the bracket expression is `[]' so ++ far), the ']' character bit gets set way below. */ ++ if (c == ']' && p != p1 + 1) ++ break; ++ ++ /* Look ahead to see if it's a range when the last thing ++ was a character class. */ ++ if (had_char_class && c == '-' && *p != ']') ++ FREE_STACK_RETURN (REG_ERANGE); ++ ++ /* Look ahead to see if it's a range when the last thing ++ was a character: if this is a hyphen not at the ++ beginning or the end of a list, then it's the range ++ operator. */ ++ if (c == '-' ++ && !(p - 2 >= pattern && p[-2] == '[') ++ && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') ++ && *p != ']') ++ { ++ reg_errcode_t ret ++ = byte_compile_range (range_start, &p, pend, translate, ++ syntax, b); ++ if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); ++ range_start = 0xffffffff; ++ } ++ ++ else if (p[0] == '-' && p[1] != ']') ++ { /* This handles ranges made up of characters only. */ ++ reg_errcode_t ret; ++ ++ /* Move past the `-'. */ ++ PATFETCH (c1); ++ ++ ret = byte_compile_range (c, &p, pend, translate, syntax, b); ++ if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); ++ range_start = 0xffffffff; ++ } ++ ++ /* See if we're at the beginning of a possible character ++ class. */ ++ ++ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':') ++ { /* Leave room for the null. */ ++ char str[CHAR_CLASS_MAX_LENGTH + 1]; ++ ++ PATFETCH (c); ++ c1 = 0; ++ ++ /* If pattern is `[[:'. */ ++ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); ++ ++ for (;;) ++ { ++ PATFETCH (c); ++ if ((c == ':' && *p == ']') || p == pend) ++ break; ++ if (((int) c1) < CHAR_CLASS_MAX_LENGTH) ++ str[c1++] = c; ++ else ++ /* This is in any case an invalid class name. */ ++ str[0] = '\0'; ++ } ++ str[c1] = '\0'; ++ ++ /* If isn't a word bracketed by `[:' and `:]': ++ undo the ending character, the letters, and leave ++ the leading `:' and `[' (but set bits for them). */ ++ if (c == ':' && *p == ']') ++ { ++# if WIDE_CHAR_SUPPORT ++ boolean is_lower = STREQ (str, "lower"); ++ boolean is_upper = STREQ (str, "upper"); ++ wctype_t wt; ++ int ch; ++ ++ wt = IS_CHAR_CLASS (str); ++ if (wt == 0) ++ FREE_STACK_RETURN (REG_ECTYPE); ++ ++ /* Throw away the ] at the end of the character ++ class. */ ++ PATFETCH (c); ++ ++ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); ++ ++ for (ch = 0; ch < 1 << BYTEWIDTH; ++ch) ++ { ++# ifdef _LIBC ++ if (__iswctype (__btowc (ch), wt)) ++ SET_LIST_BIT (ch); ++# else ++ if (iswctype (btowc (ch), wt)) ++ SET_LIST_BIT (ch); ++# endif ++ ++ if (translate && (is_upper || is_lower) ++ && (ISUPPER (ch) || ISLOWER (ch))) ++ SET_LIST_BIT (ch); ++ } ++ ++ had_char_class = true; ++# else ++ int ch; ++ boolean is_alnum = STREQ (str, "alnum"); ++ boolean is_alpha = STREQ (str, "alpha"); ++ boolean is_blank = STREQ (str, "blank"); ++ boolean is_cntrl = STREQ (str, "cntrl"); ++ boolean is_digit = STREQ (str, "digit"); ++ boolean is_graph = STREQ (str, "graph"); ++ boolean is_lower = STREQ (str, "lower"); ++ boolean is_print = STREQ (str, "print"); ++ boolean is_punct = STREQ (str, "punct"); ++ boolean is_space = STREQ (str, "space"); ++ boolean is_upper = STREQ (str, "upper"); ++ boolean is_xdigit = STREQ (str, "xdigit"); ++ ++ if (!IS_CHAR_CLASS (str)) ++ FREE_STACK_RETURN (REG_ECTYPE); ++ ++ /* Throw away the ] at the end of the character ++ class. */ ++ PATFETCH (c); ++ ++ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); ++ ++ for (ch = 0; ch < 1 << BYTEWIDTH; ch++) ++ { ++ /* This was split into 3 if's to ++ avoid an arbitrary limit in some compiler. */ ++ if ( (is_alnum && ISALNUM (ch)) ++ || (is_alpha && ISALPHA (ch)) ++ || (is_blank && ISBLANK (ch)) ++ || (is_cntrl && ISCNTRL (ch))) ++ SET_LIST_BIT (ch); ++ if ( (is_digit && ISDIGIT (ch)) ++ || (is_graph && ISGRAPH (ch)) ++ || (is_lower && ISLOWER (ch)) ++ || (is_print && ISPRINT (ch))) ++ SET_LIST_BIT (ch); ++ if ( (is_punct && ISPUNCT (ch)) ++ || (is_space && ISSPACE (ch)) ++ || (is_upper && ISUPPER (ch)) ++ || (is_xdigit && ISXDIGIT (ch))) ++ SET_LIST_BIT (ch); ++ if ( translate && (is_upper || is_lower) ++ && (ISUPPER (ch) || ISLOWER (ch))) ++ SET_LIST_BIT (ch); ++ } ++ had_char_class = true; ++# endif /* libc || wctype.h */ ++ } ++ else ++ { ++ c1++; ++ while (c1--) ++ PATUNFETCH; ++ SET_LIST_BIT ('['); ++ SET_LIST_BIT (':'); ++ range_start = ':'; ++ had_char_class = false; ++ } ++ } ++ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '=') ++ { ++ unsigned char str[MB_LEN_MAX + 1]; ++# ifdef _LIBC ++ uint32_t nrules = ++ _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); ++# endif ++ ++ PATFETCH (c); ++ c1 = 0; ++ ++ /* If pattern is `[[='. */ ++ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); ++ ++ for (;;) ++ { ++ PATFETCH (c); ++ if ((c == '=' && *p == ']') || p == pend) ++ break; ++ if (c1 < MB_LEN_MAX) ++ str[c1++] = c; ++ else ++ /* This is in any case an invalid class name. */ ++ str[0] = '\0'; ++ } ++ str[c1] = '\0'; ++ ++ if (c == '=' && *p == ']' && str[0] != '\0') ++ { ++ /* If we have no collation data we use the default ++ collation in which each character is in a class ++ by itself. It also means that ASCII is the ++ character set and therefore we cannot have character ++ with more than one byte in the multibyte ++ representation. */ ++# ifdef _LIBC ++ if (nrules == 0) ++# endif ++ { ++ if (c1 != 1) ++ FREE_STACK_RETURN (REG_ECOLLATE); ++ ++ /* Throw away the ] at the end of the equivalence ++ class. */ ++ PATFETCH (c); ++ ++ /* Set the bit for the character. */ ++ SET_LIST_BIT (str[0]); ++ } ++# ifdef _LIBC ++ else ++ { ++ /* Try to match the byte sequence in `str' against ++ those known to the collate implementation. ++ First find out whether the bytes in `str' are ++ actually from exactly one character. */ ++ const int32_t *table; ++ const unsigned char *weights; ++ const unsigned char *extra; ++ const int32_t *indirect; ++ int32_t idx; ++ const unsigned char *cp = str; ++ int ch; ++ ++ /* This #include defines a local function! */ ++# include ++ ++ table = (const int32_t *) ++ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); ++ weights = (const unsigned char *) ++ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB); ++ extra = (const unsigned char *) ++ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB); ++ indirect = (const int32_t *) ++ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); ++ ++ idx = findidx (&cp, c1); ++ if (idx == 0 || cp < str + c1) ++ /* This is no valid character. */ ++ FREE_STACK_RETURN (REG_ECOLLATE); ++ ++ /* Throw away the ] at the end of the equivalence ++ class. */ ++ PATFETCH (c); ++ ++ /* Now we have to go throught the whole table ++ and find all characters which have the same ++ first level weight. ++ ++ XXX Note that this is not entirely correct. ++ we would have to match multibyte sequences ++ but this is not possible with the current ++ implementation. */ ++ for (ch = 1; ch < 256; ++ch) ++ /* XXX This test would have to be changed if we ++ would allow matching multibyte sequences. */ ++ if (table[ch] > 0) ++ { ++ int32_t idx2 = table[ch]; ++ size_t len = weights[idx2]; ++ ++ /* Test whether the lenghts match. */ ++ if (weights[idx] == len) ++ { ++ /* They do. New compare the bytes of ++ the weight. */ ++ size_t cnt = 0; ++ ++ while (cnt < len ++ && (weights[idx + 1 + cnt] ++ == weights[idx2 + 1 + cnt])) ++ ++cnt; ++ ++ if (cnt == len) ++ /* They match. Mark the character as ++ acceptable. */ ++ SET_LIST_BIT (ch); ++ } ++ } ++ } ++# endif ++ had_char_class = true; ++ } ++ else ++ { ++ c1++; ++ while (c1--) ++ PATUNFETCH; ++ SET_LIST_BIT ('['); ++ SET_LIST_BIT ('='); ++ range_start = '='; ++ had_char_class = false; ++ } ++ } ++ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '.') ++ { ++ unsigned char str[128]; /* Should be large enough. */ ++# ifdef _LIBC ++ uint32_t nrules = ++ _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); ++# endif ++ ++ PATFETCH (c); ++ c1 = 0; ++ ++ /* If pattern is `[[.'. */ ++ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); ++ ++ for (;;) ++ { ++ PATFETCH (c); ++ if ((c == '.' && *p == ']') || p == pend) ++ break; ++ if (c1 < sizeof (str)) ++ str[c1++] = c; ++ else ++ /* This is in any case an invalid class name. */ ++ str[0] = '\0'; ++ } ++ str[c1] = '\0'; ++ ++ if (c == '.' && *p == ']' && str[0] != '\0') ++ { ++ /* If we have no collation data we use the default ++ collation in which each character is the name ++ for its own class which contains only the one ++ character. It also means that ASCII is the ++ character set and therefore we cannot have character ++ with more than one byte in the multibyte ++ representation. */ ++# ifdef _LIBC ++ if (nrules == 0) ++# endif ++ { ++ if (c1 != 1) ++ FREE_STACK_RETURN (REG_ECOLLATE); ++ ++ /* Throw away the ] at the end of the equivalence ++ class. */ ++ PATFETCH (c); ++ ++ /* Set the bit for the character. */ ++ SET_LIST_BIT (str[0]); ++ range_start = ((const unsigned char *) str)[0]; ++ } ++# ifdef _LIBC ++ else ++ { ++ /* Try to match the byte sequence in `str' against ++ those known to the collate implementation. ++ First find out whether the bytes in `str' are ++ actually from exactly one character. */ ++ int32_t table_size; ++ const int32_t *symb_table; ++ const unsigned char *extra; ++ int32_t idx; ++ int32_t elem; ++ int32_t second; ++ int32_t hash; ++ ++ table_size = ++ _NL_CURRENT_WORD (LC_COLLATE, ++ _NL_COLLATE_SYMB_HASH_SIZEMB); ++ symb_table = (const int32_t *) ++ _NL_CURRENT (LC_COLLATE, ++ _NL_COLLATE_SYMB_TABLEMB); ++ extra = (const unsigned char *) ++ _NL_CURRENT (LC_COLLATE, ++ _NL_COLLATE_SYMB_EXTRAMB); ++ ++ /* Locate the character in the hashing table. */ ++ hash = elem_hash ((const char *) str, c1); ++ ++ idx = 0; ++ elem = hash % table_size; ++ second = hash % (table_size - 2); ++ while (symb_table[2 * elem] != 0) ++ { ++ /* First compare the hashing value. */ ++ if (symb_table[2 * elem] == hash ++ && c1 == extra[symb_table[2 * elem + 1]] ++ && memcmp (str, ++ &extra[symb_table[2 * elem + 1] ++ + 1], ++ c1) == 0) ++ { ++ /* Yep, this is the entry. */ ++ idx = symb_table[2 * elem + 1]; ++ idx += 1 + extra[idx]; ++ break; ++ } ++ ++ /* Next entry. */ ++ elem += second; ++ } ++ ++ if (symb_table[2 * elem] == 0) ++ /* This is no valid character. */ ++ FREE_STACK_RETURN (REG_ECOLLATE); ++ ++ /* Throw away the ] at the end of the equivalence ++ class. */ ++ PATFETCH (c); ++ ++ /* Now add the multibyte character(s) we found ++ to the accept list. ++ ++ XXX Note that this is not entirely correct. ++ we would have to match multibyte sequences ++ but this is not possible with the current ++ implementation. Also, we have to match ++ collating symbols, which expand to more than ++ one file, as a whole and not allow the ++ individual bytes. */ ++ c1 = extra[idx++]; ++ if (c1 == 1) ++ range_start = extra[idx]; ++ while (c1-- > 0) ++ { ++ SET_LIST_BIT (extra[idx]); ++ ++idx; ++ } ++ } ++# endif ++ had_char_class = false; ++ } ++ else ++ { ++ c1++; ++ while (c1--) ++ PATUNFETCH; ++ SET_LIST_BIT ('['); ++ SET_LIST_BIT ('.'); ++ range_start = '.'; ++ had_char_class = false; ++ } ++ } ++ else ++ { ++ had_char_class = false; ++ SET_LIST_BIT (c); ++ range_start = c; ++ } ++ } ++ ++ /* Discard any (non)matching list bytes that are all 0 at the ++ end of the map. Decrease the map-length byte too. */ ++ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) ++ b[-1]--; ++ b += b[-1]; ++#endif /* WCHAR */ ++ } ++ break; ++ ++ ++ case '(': ++ if (syntax & RE_NO_BK_PARENS) ++ goto handle_open; ++ else ++ goto normal_char; ++ ++ ++ case ')': ++ if (syntax & RE_NO_BK_PARENS) ++ goto handle_close; ++ else ++ goto normal_char; ++ ++ ++ case '\n': ++ if (syntax & RE_NEWLINE_ALT) ++ goto handle_alt; ++ else ++ goto normal_char; ++ ++ ++ case '|': ++ if (syntax & RE_NO_BK_VBAR) ++ goto handle_alt; ++ else ++ goto normal_char; ++ ++ ++ case '{': ++ if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES) ++ goto handle_interval; ++ else ++ goto normal_char; ++ ++ ++ case '\\': ++ if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); ++ ++ /* Do not translate the character after the \, so that we can ++ distinguish, e.g., \B from \b, even if we normally would ++ translate, e.g., B to b. */ ++ PATFETCH_RAW (c); ++ ++ switch (c) ++ { ++ case '(': ++ if (syntax & RE_NO_BK_PARENS) ++ goto normal_backslash; ++ ++ handle_open: ++ bufp->re_nsub++; ++ regnum++; ++ ++ if (COMPILE_STACK_FULL) ++ { ++ RETALLOC (compile_stack.stack, compile_stack.size << 1, ++ compile_stack_elt_t); ++ if (compile_stack.stack == NULL) return REG_ESPACE; ++ ++ compile_stack.size <<= 1; ++ } ++ ++ /* These are the values to restore when we hit end of this ++ group. They are all relative offsets, so that if the ++ whole pattern moves because of realloc, they will still ++ be valid. */ ++ COMPILE_STACK_TOP.begalt_offset = begalt - COMPILED_BUFFER_VAR; ++ COMPILE_STACK_TOP.fixup_alt_jump ++ = fixup_alt_jump ? fixup_alt_jump - COMPILED_BUFFER_VAR + 1 : 0; ++ COMPILE_STACK_TOP.laststart_offset = b - COMPILED_BUFFER_VAR; ++ COMPILE_STACK_TOP.regnum = regnum; ++ ++ /* We will eventually replace the 0 with the number of ++ groups inner to this one. But do not push a ++ start_memory for groups beyond the last one we can ++ represent in the compiled pattern. */ ++ if (regnum <= MAX_REGNUM) ++ { ++ COMPILE_STACK_TOP.inner_group_offset = b ++ - COMPILED_BUFFER_VAR + 2; ++ BUF_PUSH_3 (start_memory, regnum, 0); ++ } ++ ++ compile_stack.avail++; ++ ++ fixup_alt_jump = 0; ++ laststart = 0; ++ begalt = b; ++ /* If we've reached MAX_REGNUM groups, then this open ++ won't actually generate any code, so we'll have to ++ clear pending_exact explicitly. */ ++ pending_exact = 0; ++ break; ++ ++ ++ case ')': ++ if (syntax & RE_NO_BK_PARENS) goto normal_backslash; ++ ++ if (COMPILE_STACK_EMPTY) ++ { ++ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) ++ goto normal_backslash; ++ else ++ FREE_STACK_RETURN (REG_ERPAREN); ++ } ++ ++ handle_close: ++ if (fixup_alt_jump) ++ { /* Push a dummy failure point at the end of the ++ alternative for a possible future ++ `pop_failure_jump' to pop. See comments at ++ `push_dummy_failure' in `re_match_2'. */ ++ BUF_PUSH (push_dummy_failure); ++ ++ /* We allocated space for this jump when we assigned ++ to `fixup_alt_jump', in the `handle_alt' case below. */ ++ STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1); ++ } ++ ++ /* See similar code for backslashed left paren above. */ ++ if (COMPILE_STACK_EMPTY) ++ { ++ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) ++ goto normal_char; ++ else ++ FREE_STACK_RETURN (REG_ERPAREN); ++ } ++ ++ /* Since we just checked for an empty stack above, this ++ ``can't happen''. */ ++ assert (compile_stack.avail != 0); ++ { ++ /* We don't just want to restore into `regnum', because ++ later groups should continue to be numbered higher, ++ as in `(ab)c(de)' -- the second group is #2. */ ++ regnum_t this_group_regnum; ++ ++ compile_stack.avail--; ++ begalt = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.begalt_offset; ++ fixup_alt_jump ++ = COMPILE_STACK_TOP.fixup_alt_jump ++ ? COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.fixup_alt_jump - 1 ++ : 0; ++ laststart = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.laststart_offset; ++ this_group_regnum = COMPILE_STACK_TOP.regnum; ++ /* If we've reached MAX_REGNUM groups, then this open ++ won't actually generate any code, so we'll have to ++ clear pending_exact explicitly. */ ++ pending_exact = 0; ++ ++ /* We're at the end of the group, so now we know how many ++ groups were inside this one. */ ++ if (this_group_regnum <= MAX_REGNUM) ++ { ++ UCHAR_T *inner_group_loc ++ = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.inner_group_offset; ++ ++ *inner_group_loc = regnum - this_group_regnum; ++ BUF_PUSH_3 (stop_memory, this_group_regnum, ++ regnum - this_group_regnum); ++ } ++ } ++ break; ++ ++ ++ case '|': /* `\|'. */ ++ if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR) ++ goto normal_backslash; ++ handle_alt: ++ if (syntax & RE_LIMITED_OPS) ++ goto normal_char; ++ ++ /* Insert before the previous alternative a jump which ++ jumps to this alternative if the former fails. */ ++ GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); ++ INSERT_JUMP (on_failure_jump, begalt, ++ b + 2 + 2 * OFFSET_ADDRESS_SIZE); ++ pending_exact = 0; ++ b += 1 + OFFSET_ADDRESS_SIZE; ++ ++ /* The alternative before this one has a jump after it ++ which gets executed if it gets matched. Adjust that ++ jump so it will jump to this alternative's analogous ++ jump (put in below, which in turn will jump to the next ++ (if any) alternative's such jump, etc.). The last such ++ jump jumps to the correct final destination. A picture: ++ _____ _____ ++ | | | | ++ | v | v ++ a | b | c ++ ++ If we are at `b', then fixup_alt_jump right now points to a ++ three-byte space after `a'. We'll put in the jump, set ++ fixup_alt_jump to right after `b', and leave behind three ++ bytes which we'll fill in when we get to after `c'. */ ++ ++ if (fixup_alt_jump) ++ STORE_JUMP (jump_past_alt, fixup_alt_jump, b); ++ ++ /* Mark and leave space for a jump after this alternative, ++ to be filled in later either by next alternative or ++ when know we're at the end of a series of alternatives. */ ++ fixup_alt_jump = b; ++ GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); ++ b += 1 + OFFSET_ADDRESS_SIZE; ++ ++ laststart = 0; ++ begalt = b; ++ break; ++ ++ ++ case '{': ++ /* If \{ is a literal. */ ++ if (!(syntax & RE_INTERVALS) ++ /* If we're at `\{' and it's not the open-interval ++ operator. */ ++ || (syntax & RE_NO_BK_BRACES)) ++ goto normal_backslash; ++ ++ handle_interval: ++ { ++ /* If got here, then the syntax allows intervals. */ ++ ++ /* At least (most) this many matches must be made. */ ++ int lower_bound = -1, upper_bound = -1; ++ ++ /* Place in the uncompiled pattern (i.e., just after ++ the '{') to go back to if the interval is invalid. */ ++ const CHAR_T *beg_interval = p; ++ ++ if (p == pend) ++ goto invalid_interval; ++ ++ GET_UNSIGNED_NUMBER (lower_bound); ++ ++ if (c == ',') ++ { ++ GET_UNSIGNED_NUMBER (upper_bound); ++ if (upper_bound < 0) ++ upper_bound = RE_DUP_MAX; ++ } ++ else ++ /* Interval such as `{1}' => match exactly once. */ ++ upper_bound = lower_bound; ++ ++ if (! (0 <= lower_bound && lower_bound <= upper_bound)) ++ goto invalid_interval; ++ ++ if (!(syntax & RE_NO_BK_BRACES)) ++ { ++ if (c != '\\' || p == pend) ++ goto invalid_interval; ++ PATFETCH (c); ++ } ++ ++ if (c != '}') ++ goto invalid_interval; ++ ++ /* If it's invalid to have no preceding re. */ ++ if (!laststart) ++ { ++ if (syntax & RE_CONTEXT_INVALID_OPS ++ && !(syntax & RE_INVALID_INTERVAL_ORD)) ++ FREE_STACK_RETURN (REG_BADRPT); ++ else if (syntax & RE_CONTEXT_INDEP_OPS) ++ laststart = b; ++ else ++ goto unfetch_interval; ++ } ++ ++ /* We just parsed a valid interval. */ ++ ++ if (RE_DUP_MAX < upper_bound) ++ FREE_STACK_RETURN (REG_BADBR); ++ ++ /* If the upper bound is zero, don't want to succeed at ++ all; jump from `laststart' to `b + 3', which will be ++ the end of the buffer after we insert the jump. */ ++ /* ifdef WCHAR, 'b + 1 + OFFSET_ADDRESS_SIZE' ++ instead of 'b + 3'. */ ++ if (upper_bound == 0) ++ { ++ GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); ++ INSERT_JUMP (jump, laststart, b + 1 ++ + OFFSET_ADDRESS_SIZE); ++ b += 1 + OFFSET_ADDRESS_SIZE; ++ } ++ ++ /* Otherwise, we have a nontrivial interval. When ++ we're all done, the pattern will look like: ++ set_number_at ++ set_number_at ++ succeed_n ++ ++ jump_n ++ (The upper bound and `jump_n' are omitted if ++ `upper_bound' is 1, though.) */ ++ else ++ { /* If the upper bound is > 1, we need to insert ++ more at the end of the loop. */ ++ unsigned nbytes = 2 + 4 * OFFSET_ADDRESS_SIZE + ++ (upper_bound > 1) * (2 + 4 * OFFSET_ADDRESS_SIZE); ++ ++ GET_BUFFER_SPACE (nbytes); ++ ++ /* Initialize lower bound of the `succeed_n', even ++ though it will be set during matching by its ++ attendant `set_number_at' (inserted next), ++ because `re_compile_fastmap' needs to know. ++ Jump to the `jump_n' we might insert below. */ ++ INSERT_JUMP2 (succeed_n, laststart, ++ b + 1 + 2 * OFFSET_ADDRESS_SIZE ++ + (upper_bound > 1) * (1 + 2 * OFFSET_ADDRESS_SIZE) ++ , lower_bound); ++ b += 1 + 2 * OFFSET_ADDRESS_SIZE; ++ ++ /* Code to initialize the lower bound. Insert ++ before the `succeed_n'. The `5' is the last two ++ bytes of this `set_number_at', plus 3 bytes of ++ the following `succeed_n'. */ ++ /* ifdef WCHAR, The '1+2*OFFSET_ADDRESS_SIZE' ++ is the 'set_number_at', plus '1+OFFSET_ADDRESS_SIZE' ++ of the following `succeed_n'. */ ++ PREFIX(insert_op2) (set_number_at, laststart, 1 ++ + 2 * OFFSET_ADDRESS_SIZE, lower_bound, b); ++ b += 1 + 2 * OFFSET_ADDRESS_SIZE; ++ ++ if (upper_bound > 1) ++ { /* More than one repetition is allowed, so ++ append a backward jump to the `succeed_n' ++ that starts this interval. ++ ++ When we've reached this during matching, ++ we'll have matched the interval once, so ++ jump back only `upper_bound - 1' times. */ ++ STORE_JUMP2 (jump_n, b, laststart ++ + 2 * OFFSET_ADDRESS_SIZE + 1, ++ upper_bound - 1); ++ b += 1 + 2 * OFFSET_ADDRESS_SIZE; ++ ++ /* The location we want to set is the second ++ parameter of the `jump_n'; that is `b-2' as ++ an absolute address. `laststart' will be ++ the `set_number_at' we're about to insert; ++ `laststart+3' the number to set, the source ++ for the relative address. But we are ++ inserting into the middle of the pattern -- ++ so everything is getting moved up by 5. ++ Conclusion: (b - 2) - (laststart + 3) + 5, ++ i.e., b - laststart. ++ ++ We insert this at the beginning of the loop ++ so that if we fail during matching, we'll ++ reinitialize the bounds. */ ++ PREFIX(insert_op2) (set_number_at, laststart, ++ b - laststart, ++ upper_bound - 1, b); ++ b += 1 + 2 * OFFSET_ADDRESS_SIZE; ++ } ++ } ++ pending_exact = 0; ++ break; ++ ++ invalid_interval: ++ if (!(syntax & RE_INVALID_INTERVAL_ORD)) ++ FREE_STACK_RETURN (p == pend ? REG_EBRACE : REG_BADBR); ++ unfetch_interval: ++ /* Match the characters as literals. */ ++ p = beg_interval; ++ c = '{'; ++ if (syntax & RE_NO_BK_BRACES) ++ goto normal_char; ++ else ++ goto normal_backslash; ++ } ++ ++#ifdef emacs ++ /* There is no way to specify the before_dot and after_dot ++ operators. rms says this is ok. --karl */ ++ case '=': ++ BUF_PUSH (at_dot); ++ break; ++ ++ case 's': ++ laststart = b; ++ PATFETCH (c); ++ BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]); ++ break; ++ ++ case 'S': ++ laststart = b; ++ PATFETCH (c); ++ BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]); ++ break; ++#endif /* emacs */ ++ ++ ++ case 'w': ++ if (syntax & RE_NO_GNU_OPS) ++ goto normal_char; ++ laststart = b; ++ BUF_PUSH (wordchar); ++ break; ++ ++ ++ case 'W': ++ if (syntax & RE_NO_GNU_OPS) ++ goto normal_char; ++ laststart = b; ++ BUF_PUSH (notwordchar); ++ break; ++ ++ ++ case '<': ++ if (syntax & RE_NO_GNU_OPS) ++ goto normal_char; ++ BUF_PUSH (wordbeg); ++ break; ++ ++ case '>': ++ if (syntax & RE_NO_GNU_OPS) ++ goto normal_char; ++ BUF_PUSH (wordend); ++ break; ++ ++ case 'b': ++ if (syntax & RE_NO_GNU_OPS) ++ goto normal_char; ++ BUF_PUSH (wordbound); ++ break; ++ ++ case 'B': ++ if (syntax & RE_NO_GNU_OPS) ++ goto normal_char; ++ BUF_PUSH (notwordbound); ++ break; ++ ++ case '`': ++ if (syntax & RE_NO_GNU_OPS) ++ goto normal_char; ++ BUF_PUSH (begbuf); ++ break; ++ ++ case '\'': ++ if (syntax & RE_NO_GNU_OPS) ++ goto normal_char; ++ BUF_PUSH (endbuf); ++ break; ++ ++ case '1': case '2': case '3': case '4': case '5': ++ case '6': case '7': case '8': case '9': ++ if (syntax & RE_NO_BK_REFS) ++ goto normal_char; ++ ++ c1 = c - '0'; ++ ++ if (c1 > regnum) ++ FREE_STACK_RETURN (REG_ESUBREG); ++ ++ /* Can't back reference to a subexpression if inside of it. */ ++ if (group_in_compile_stack (compile_stack, (regnum_t) c1)) ++ goto normal_char; ++ ++ laststart = b; ++ BUF_PUSH_2 (duplicate, c1); ++ break; ++ ++ ++ case '+': ++ case '?': ++ if (syntax & RE_BK_PLUS_QM) ++ goto handle_plus; ++ else ++ goto normal_backslash; ++ ++ default: ++ normal_backslash: ++ /* You might think it would be useful for \ to mean ++ not to translate; but if we don't translate it ++ it will never match anything. */ ++ c = TRANSLATE (c); ++ goto normal_char; ++ } ++ break; ++ ++ ++ default: ++ /* Expects the character in `c'. */ ++ normal_char: ++ /* If no exactn currently being built. */ ++ if (!pending_exact ++#ifdef WCHAR ++ /* If last exactn handle binary(or character) and ++ new exactn handle character(or binary). */ ++ || is_exactn_bin != is_binary[p - 1 - pattern] ++#endif /* WCHAR */ ++ ++ /* If last exactn not at current position. */ ++ || pending_exact + *pending_exact + 1 != b ++ ++ /* We have only one byte following the exactn for the count. */ ++ || *pending_exact == (1 << BYTEWIDTH) - 1 ++ ++ /* If followed by a repetition operator. */ ++ || *p == '*' || *p == '^' ++ || ((syntax & RE_BK_PLUS_QM) ++ ? *p == '\\' && (p[1] == '+' || p[1] == '?') ++ : (*p == '+' || *p == '?')) ++ || ((syntax & RE_INTERVALS) ++ && ((syntax & RE_NO_BK_BRACES) ++ ? *p == '{' ++ : (p[0] == '\\' && p[1] == '{')))) ++ { ++ /* Start building a new exactn. */ ++ ++ laststart = b; ++ ++#ifdef WCHAR ++ /* Is this exactn binary data or character? */ ++ is_exactn_bin = is_binary[p - 1 - pattern]; ++ if (is_exactn_bin) ++ BUF_PUSH_2 (exactn_bin, 0); ++ else ++ BUF_PUSH_2 (exactn, 0); ++#else ++ BUF_PUSH_2 (exactn, 0); ++#endif /* WCHAR */ ++ pending_exact = b - 1; ++ } ++ ++ BUF_PUSH (c); ++ (*pending_exact)++; ++ break; ++ } /* switch (c) */ ++ } /* while p != pend */ ++ ++ ++ /* Through the pattern now. */ ++ ++ if (fixup_alt_jump) ++ STORE_JUMP (jump_past_alt, fixup_alt_jump, b); ++ ++ if (!COMPILE_STACK_EMPTY) ++ FREE_STACK_RETURN (REG_EPAREN); ++ ++ /* If we don't want backtracking, force success ++ the first time we reach the end of the compiled pattern. */ ++ if (syntax & RE_NO_POSIX_BACKTRACKING) ++ BUF_PUSH (succeed); ++ ++#ifdef WCHAR ++ free (pattern); ++ free (mbs_offset); ++ free (is_binary); ++#endif ++ free (compile_stack.stack); ++ ++ /* We have succeeded; set the length of the buffer. */ ++#ifdef WCHAR ++ bufp->used = (uintptr_t) b - (uintptr_t) COMPILED_BUFFER_VAR; ++#else ++ bufp->used = b - bufp->buffer; ++#endif ++ ++#ifdef DEBUG ++ if (debug) ++ { ++ DEBUG_PRINT1 ("\nCompiled pattern: \n"); ++ PREFIX(print_compiled_pattern) (bufp); ++ } ++#endif /* DEBUG */ ++ ++#ifndef MATCH_MAY_ALLOCATE ++ /* Initialize the failure stack to the largest possible stack. This ++ isn't necessary unless we're trying to avoid calling alloca in ++ the search and match routines. */ ++ { ++ int num_regs = bufp->re_nsub + 1; ++ ++ /* Since DOUBLE_FAIL_STACK refuses to double only if the current size ++ is strictly greater than re_max_failures, the largest possible stack ++ is 2 * re_max_failures failure points. */ ++ if (fail_stack.size < (2 * re_max_failures * MAX_FAILURE_ITEMS)) ++ { ++ fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS); ++ ++# ifdef emacs ++ if (! fail_stack.stack) ++ fail_stack.stack ++ = (PREFIX(fail_stack_elt_t) *) xmalloc (fail_stack.size ++ * sizeof (PREFIX(fail_stack_elt_t))); ++ else ++ fail_stack.stack ++ = (PREFIX(fail_stack_elt_t) *) xrealloc (fail_stack.stack, ++ (fail_stack.size ++ * sizeof (PREFIX(fail_stack_elt_t)))); ++# else /* not emacs */ ++ if (! fail_stack.stack) ++ fail_stack.stack ++ = (PREFIX(fail_stack_elt_t) *) malloc (fail_stack.size ++ * sizeof (PREFIX(fail_stack_elt_t))); ++ else ++ fail_stack.stack ++ = (PREFIX(fail_stack_elt_t) *) realloc (fail_stack.stack, ++ (fail_stack.size ++ * sizeof (PREFIX(fail_stack_elt_t)))); ++# endif /* not emacs */ ++ } ++ ++ PREFIX(regex_grow_registers) (num_regs); ++ } ++#endif /* not MATCH_MAY_ALLOCATE */ ++ ++ return REG_NOERROR; ++} /* regex_compile */ ++ ++/* Subroutines for `regex_compile'. */ ++ ++/* Store OP at LOC followed by two-byte integer parameter ARG. */ ++/* ifdef WCHAR, integer parameter is 1 wchar_t. */ ++ ++static void ++PREFIX(store_op1) (re_opcode_t op, UCHAR_T *loc, int arg) ++{ ++ *loc = (UCHAR_T) op; ++ STORE_NUMBER (loc + 1, arg); ++} ++ ++ ++/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */ ++/* ifdef WCHAR, integer parameter is 1 wchar_t. */ ++ ++static void ++PREFIX(store_op2) (re_opcode_t op, UCHAR_T *loc, int arg1, int arg2) ++{ ++ *loc = (UCHAR_T) op; ++ STORE_NUMBER (loc + 1, arg1); ++ STORE_NUMBER (loc + 1 + OFFSET_ADDRESS_SIZE, arg2); ++} ++ ++ ++/* Copy the bytes from LOC to END to open up three bytes of space at LOC ++ for OP followed by two-byte integer parameter ARG. */ ++/* ifdef WCHAR, integer parameter is 1 wchar_t. */ ++ ++static void ++PREFIX(insert_op1) (re_opcode_t op, UCHAR_T *loc, int arg, UCHAR_T *end) ++{ ++ register UCHAR_T *pfrom = end; ++ register UCHAR_T *pto = end + 1 + OFFSET_ADDRESS_SIZE; ++ ++ while (pfrom != loc) ++ *--pto = *--pfrom; ++ ++ PREFIX(store_op1) (op, loc, arg); ++} ++ ++ ++/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */ ++/* ifdef WCHAR, integer parameter is 1 wchar_t. */ ++ ++static void ++PREFIX(insert_op2) (re_opcode_t op, UCHAR_T *loc, int arg1, ++ int arg2, UCHAR_T *end) ++{ ++ register UCHAR_T *pfrom = end; ++ register UCHAR_T *pto = end + 1 + 2 * OFFSET_ADDRESS_SIZE; ++ ++ while (pfrom != loc) ++ *--pto = *--pfrom; ++ ++ PREFIX(store_op2) (op, loc, arg1, arg2); ++} ++ ++ ++/* P points to just after a ^ in PATTERN. Return true if that ^ comes ++ after an alternative or a begin-subexpression. We assume there is at ++ least one character before the ^. */ ++ ++static boolean ++PREFIX(at_begline_loc_p) (const CHAR_T *pattern, const CHAR_T *p, ++ reg_syntax_t syntax) ++{ ++ const CHAR_T *prev = p - 2; ++ boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; ++ ++ return ++ /* After a subexpression? */ ++ (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash)) ++ /* After an alternative? */ ++ || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)); ++} ++ ++ ++/* The dual of at_begline_loc_p. This one is for $. We assume there is ++ at least one character after the $, i.e., `P < PEND'. */ ++ ++static boolean ++PREFIX(at_endline_loc_p) (const CHAR_T *p, const CHAR_T *pend, ++ reg_syntax_t syntax) ++{ ++ const CHAR_T *next = p; ++ boolean next_backslash = *next == '\\'; ++ const CHAR_T *next_next = p + 1 < pend ? p + 1 : 0; ++ ++ return ++ /* Before a subexpression? */ ++ (syntax & RE_NO_BK_PARENS ? *next == ')' ++ : next_backslash && next_next && *next_next == ')') ++ /* Before an alternative? */ ++ || (syntax & RE_NO_BK_VBAR ? *next == '|' ++ : next_backslash && next_next && *next_next == '|'); ++} ++ ++#else /* not INSIDE_RECURSION */ ++ ++/* Returns true if REGNUM is in one of COMPILE_STACK's elements and ++ false if it's not. */ ++ ++static boolean ++group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum) ++{ ++ int this_element; ++ ++ for (this_element = compile_stack.avail - 1; ++ this_element >= 0; ++ this_element--) ++ if (compile_stack.stack[this_element].regnum == regnum) ++ return true; ++ ++ return false; ++} ++#endif /* not INSIDE_RECURSION */ ++ ++#ifdef INSIDE_RECURSION ++ ++#ifdef WCHAR ++/* This insert space, which size is "num", into the pattern at "loc". ++ "end" must point the end of the allocated buffer. */ ++static void ++insert_space (int num, CHAR_T *loc, CHAR_T *end) ++{ ++ register CHAR_T *pto = end; ++ register CHAR_T *pfrom = end - num; ++ ++ while (pfrom >= loc) ++ *pto-- = *pfrom--; ++} ++#endif /* WCHAR */ ++ ++#ifdef WCHAR ++static reg_errcode_t ++wcs_compile_range (CHAR_T range_start_char, const CHAR_T **p_ptr, ++ const CHAR_T *pend, RE_TRANSLATE_TYPE translate, ++ reg_syntax_t syntax, CHAR_T *b, CHAR_T *char_set) ++{ ++ const CHAR_T *p = *p_ptr; ++ CHAR_T range_start, range_end; ++ reg_errcode_t ret; ++# ifdef _LIBC ++ uint32_t nrules; ++ uint32_t start_val, end_val; ++# endif ++ if (p == pend) ++ return REG_ERANGE; ++ ++# ifdef _LIBC ++ nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); ++ if (nrules != 0) ++ { ++ const char *collseq = (const char *) _NL_CURRENT(LC_COLLATE, ++ _NL_COLLATE_COLLSEQWC); ++ const unsigned char *extra = (const unsigned char *) ++ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); ++ ++ if (range_start_char < -1) ++ { ++ /* range_start is a collating symbol. */ ++ int32_t *wextra; ++ /* Retreive the index and get collation sequence value. */ ++ wextra = (int32_t*)(extra + char_set[-range_start_char]); ++ start_val = wextra[1 + *wextra]; ++ } ++ else ++ start_val = collseq_table_lookup(collseq, TRANSLATE(range_start_char)); ++ ++ end_val = collseq_table_lookup (collseq, TRANSLATE (p[0])); ++ ++ /* Report an error if the range is empty and the syntax prohibits ++ this. */ ++ ret = ((syntax & RE_NO_EMPTY_RANGES) ++ && (start_val > end_val))? REG_ERANGE : REG_NOERROR; ++ ++ /* Insert space to the end of the char_ranges. */ ++ insert_space(2, b - char_set[5] - 2, b - 1); ++ *(b - char_set[5] - 2) = (wchar_t)start_val; ++ *(b - char_set[5] - 1) = (wchar_t)end_val; ++ char_set[4]++; /* ranges_index */ ++ } ++ else ++# endif ++ { ++ range_start = (range_start_char >= 0)? TRANSLATE (range_start_char): ++ range_start_char; ++ range_end = TRANSLATE (p[0]); ++ /* Report an error if the range is empty and the syntax prohibits ++ this. */ ++ ret = ((syntax & RE_NO_EMPTY_RANGES) ++ && (range_start > range_end))? REG_ERANGE : REG_NOERROR; ++ ++ /* Insert space to the end of the char_ranges. */ ++ insert_space(2, b - char_set[5] - 2, b - 1); ++ *(b - char_set[5] - 2) = range_start; ++ *(b - char_set[5] - 1) = range_end; ++ char_set[4]++; /* ranges_index */ ++ } ++ /* Have to increment the pointer into the pattern string, so the ++ caller isn't still at the ending character. */ ++ (*p_ptr)++; ++ ++ return ret; ++} ++#else /* BYTE */ ++/* Read the ending character of a range (in a bracket expression) from the ++ uncompiled pattern *P_PTR (which ends at PEND). We assume the ++ starting character is in `P[-2]'. (`P[-1]' is the character `-'.) ++ Then we set the translation of all bits between the starting and ++ ending characters (inclusive) in the compiled pattern B. ++ ++ Return an error code. ++ ++ We use these short variable names so we can use the same macros as ++ `regex_compile' itself. */ ++ ++static reg_errcode_t ++byte_compile_range (unsigned int range_start_char, const char **p_ptr, ++ const char *pend, RE_TRANSLATE_TYPE translate, ++ reg_syntax_t syntax, unsigned char *b) ++{ ++ unsigned this_char; ++ const char *p = *p_ptr; ++ reg_errcode_t ret; ++# if _LIBC ++ const unsigned char *collseq; ++ unsigned int start_colseq; ++ unsigned int end_colseq; ++# else ++ unsigned end_char; ++# endif ++ ++ if (p == pend) ++ return REG_ERANGE; ++ ++ /* Have to increment the pointer into the pattern string, so the ++ caller isn't still at the ending character. */ ++ (*p_ptr)++; ++ ++ /* Report an error if the range is empty and the syntax prohibits this. */ ++ ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR; ++ ++# if _LIBC ++ collseq = (const unsigned char *) _NL_CURRENT (LC_COLLATE, ++ _NL_COLLATE_COLLSEQMB); ++ ++ start_colseq = collseq[(unsigned char) TRANSLATE (range_start_char)]; ++ end_colseq = collseq[(unsigned char) TRANSLATE (p[0])]; ++ for (this_char = 0; this_char <= (unsigned char) -1; ++this_char) ++ { ++ unsigned int this_colseq = collseq[(unsigned char) TRANSLATE (this_char)]; ++ ++ if (start_colseq <= this_colseq && this_colseq <= end_colseq) ++ { ++ SET_LIST_BIT (TRANSLATE (this_char)); ++ ret = REG_NOERROR; ++ } ++ } ++# else ++ /* Here we see why `this_char' has to be larger than an `unsigned ++ char' -- we would otherwise go into an infinite loop, since all ++ characters <= 0xff. */ ++ range_start_char = TRANSLATE (range_start_char); ++ /* TRANSLATE(p[0]) is casted to char (not unsigned char) in TRANSLATE, ++ and some compilers cast it to int implicitly, so following for_loop ++ may fall to (almost) infinite loop. ++ e.g. If translate[p[0]] = 0xff, end_char may equals to 0xffffffff. ++ To avoid this, we cast p[0] to unsigned int and truncate it. */ ++ end_char = ((unsigned)TRANSLATE(p[0]) & ((1 << BYTEWIDTH) - 1)); ++ ++ for (this_char = range_start_char; this_char <= end_char; ++this_char) ++ { ++ SET_LIST_BIT (TRANSLATE (this_char)); ++ ret = REG_NOERROR; ++ } ++# endif ++ ++ return ret; ++} ++#endif /* WCHAR */ ++ ++/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in ++ BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible ++ characters can start a string that matches the pattern. This fastmap ++ is used by re_search to skip quickly over impossible starting points. ++ ++ The caller must supply the address of a (1 << BYTEWIDTH)-byte data ++ area as BUFP->fastmap. ++ ++ We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in ++ the pattern buffer. ++ ++ Returns 0 if we succeed, -2 if an internal error. */ ++ ++#ifdef WCHAR ++/* local function for re_compile_fastmap. ++ truncate wchar_t character to char. */ ++static unsigned char truncate_wchar (CHAR_T c); ++ ++static unsigned char ++truncate_wchar (CHAR_T c) ++{ ++ unsigned char buf[MB_CUR_MAX]; ++ mbstate_t state; ++ int retval; ++ memset (&state, '\0', sizeof (state)); ++# ifdef _LIBC ++ retval = __wcrtomb (buf, c, &state); ++# else ++ retval = wcrtomb (buf, c, &state); ++# endif ++ return retval > 0 ? buf[0] : (unsigned char) c; ++} ++#endif /* WCHAR */ ++ ++static int ++PREFIX(re_compile_fastmap) (struct re_pattern_buffer *bufp) ++{ ++ int j, k; ++#ifdef MATCH_MAY_ALLOCATE ++ PREFIX(fail_stack_type) fail_stack; ++#endif ++#ifndef REGEX_MALLOC ++ char *destination; ++#endif ++ ++ register char *fastmap = bufp->fastmap; ++ ++#ifdef WCHAR ++ /* We need to cast pattern to (wchar_t*), because we casted this compiled ++ pattern to (char*) in regex_compile. */ ++ UCHAR_T *pattern = (UCHAR_T*)bufp->buffer; ++ register UCHAR_T *pend = (UCHAR_T*) (bufp->buffer + bufp->used); ++#else /* BYTE */ ++ UCHAR_T *pattern = bufp->buffer; ++ register UCHAR_T *pend = pattern + bufp->used; ++#endif /* WCHAR */ ++ UCHAR_T *p = pattern; ++ ++#ifdef REL_ALLOC ++ /* This holds the pointer to the failure stack, when ++ it is allocated relocatably. */ ++ fail_stack_elt_t *failure_stack_ptr; ++#endif ++ ++ /* Assume that each path through the pattern can be null until ++ proven otherwise. We set this false at the bottom of switch ++ statement, to which we get only if a particular path doesn't ++ match the empty string. */ ++ boolean path_can_be_null = true; ++ ++ /* We aren't doing a `succeed_n' to begin with. */ ++ boolean succeed_n_p = false; ++ ++ assert (fastmap != NULL && p != NULL); ++ ++ INIT_FAIL_STACK (); ++ bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */ ++ bufp->fastmap_accurate = 1; /* It will be when we're done. */ ++ bufp->can_be_null = 0; ++ ++ while (1) ++ { ++ if (p == pend || *p == (UCHAR_T) succeed) ++ { ++ /* We have reached the (effective) end of pattern. */ ++ if (!FAIL_STACK_EMPTY ()) ++ { ++ bufp->can_be_null |= path_can_be_null; ++ ++ /* Reset for next path. */ ++ path_can_be_null = true; ++ ++ p = fail_stack.stack[--fail_stack.avail].pointer; ++ ++ continue; ++ } ++ else ++ break; ++ } ++ ++ /* We should never be about to go beyond the end of the pattern. */ ++ assert (p < pend); ++ ++ switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) ++ { ++ ++ /* I guess the idea here is to simply not bother with a fastmap ++ if a backreference is used, since it's too hard to figure out ++ the fastmap for the corresponding group. Setting ++ `can_be_null' stops `re_search_2' from using the fastmap, so ++ that is all we do. */ ++ case duplicate: ++ bufp->can_be_null = 1; ++ goto done; ++ ++ ++ /* Following are the cases which match a character. These end ++ with `break'. */ ++ ++#ifdef WCHAR ++ case exactn: ++ fastmap[truncate_wchar(p[1])] = 1; ++ break; ++#else /* BYTE */ ++ case exactn: ++ fastmap[p[1]] = 1; ++ break; ++#endif /* WCHAR */ ++#ifdef MBS_SUPPORT ++ case exactn_bin: ++ fastmap[p[1]] = 1; ++ break; ++#endif ++ ++#ifdef WCHAR ++ /* It is hard to distinguish fastmap from (multi byte) characters ++ which depends on current locale. */ ++ case charset: ++ case charset_not: ++ case wordchar: ++ case notwordchar: ++ bufp->can_be_null = 1; ++ goto done; ++#else /* BYTE */ ++ case charset: ++ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) ++ if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) ++ fastmap[j] = 1; ++ break; ++ ++ ++ case charset_not: ++ /* Chars beyond end of map must be allowed. */ ++ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++) ++ fastmap[j] = 1; ++ ++ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) ++ if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) ++ fastmap[j] = 1; ++ break; ++ ++ ++ case wordchar: ++ for (j = 0; j < (1 << BYTEWIDTH); j++) ++ if (SYNTAX (j) == Sword) ++ fastmap[j] = 1; ++ break; ++ ++ ++ case notwordchar: ++ for (j = 0; j < (1 << BYTEWIDTH); j++) ++ if (SYNTAX (j) != Sword) ++ fastmap[j] = 1; ++ break; ++#endif /* WCHAR */ ++ ++ case anychar: ++ { ++ int fastmap_newline = fastmap['\n']; ++ ++ /* `.' matches anything ... */ ++ for (j = 0; j < (1 << BYTEWIDTH); j++) ++ fastmap[j] = 1; ++ ++ /* ... except perhaps newline. */ ++ if (!(bufp->syntax & RE_DOT_NEWLINE)) ++ fastmap['\n'] = fastmap_newline; ++ ++ /* Return if we have already set `can_be_null'; if we have, ++ then the fastmap is irrelevant. Something's wrong here. */ ++ else if (bufp->can_be_null) ++ goto done; ++ ++ /* Otherwise, have to check alternative paths. */ ++ break; ++ } ++ ++#ifdef emacs ++ case syntaxspec: ++ k = *p++; ++ for (j = 0; j < (1 << BYTEWIDTH); j++) ++ if (SYNTAX (j) == (enum syntaxcode) k) ++ fastmap[j] = 1; ++ break; ++ ++ ++ case notsyntaxspec: ++ k = *p++; ++ for (j = 0; j < (1 << BYTEWIDTH); j++) ++ if (SYNTAX (j) != (enum syntaxcode) k) ++ fastmap[j] = 1; ++ break; ++ ++ ++ /* All cases after this match the empty string. These end with ++ `continue'. */ ++ ++ ++ case before_dot: ++ case at_dot: ++ case after_dot: ++ continue; ++#endif /* emacs */ ++ ++ ++ case no_op: ++ case begline: ++ case endline: ++ case begbuf: ++ case endbuf: ++ case wordbound: ++ case notwordbound: ++ case wordbeg: ++ case wordend: ++ case push_dummy_failure: ++ continue; ++ ++ ++ case jump_n: ++ case pop_failure_jump: ++ case maybe_pop_jump: ++ case jump: ++ case jump_past_alt: ++ case dummy_failure_jump: ++ EXTRACT_NUMBER_AND_INCR (j, p); ++ p += j; ++ if (j > 0) ++ continue; ++ ++ /* Jump backward implies we just went through the body of a ++ loop and matched nothing. Opcode jumped to should be ++ `on_failure_jump' or `succeed_n'. Just treat it like an ++ ordinary jump. For a * loop, it has pushed its failure ++ point already; if so, discard that as redundant. */ ++ if ((re_opcode_t) *p != on_failure_jump ++ && (re_opcode_t) *p != succeed_n) ++ continue; ++ ++ p++; ++ EXTRACT_NUMBER_AND_INCR (j, p); ++ p += j; ++ ++ /* If what's on the stack is where we are now, pop it. */ ++ if (!FAIL_STACK_EMPTY () ++ && fail_stack.stack[fail_stack.avail - 1].pointer == p) ++ fail_stack.avail--; ++ ++ continue; ++ ++ ++ case on_failure_jump: ++ case on_failure_keep_string_jump: ++ handle_on_failure_jump: ++ EXTRACT_NUMBER_AND_INCR (j, p); ++ ++ /* For some patterns, e.g., `(a?)?', `p+j' here points to the ++ end of the pattern. We don't want to push such a point, ++ since when we restore it above, entering the switch will ++ increment `p' past the end of the pattern. We don't need ++ to push such a point since we obviously won't find any more ++ fastmap entries beyond `pend'. Such a pattern can match ++ the null string, though. */ ++ if (p + j < pend) ++ { ++ if (!PUSH_PATTERN_OP (p + j, fail_stack)) ++ { ++ RESET_FAIL_STACK (); ++ return -2; ++ } ++ } ++ else ++ bufp->can_be_null = 1; ++ ++ if (succeed_n_p) ++ { ++ EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */ ++ succeed_n_p = false; ++ } ++ ++ continue; ++ ++ ++ case succeed_n: ++ /* Get to the number of times to succeed. */ ++ p += OFFSET_ADDRESS_SIZE; ++ ++ /* Increment p past the n for when k != 0. */ ++ EXTRACT_NUMBER_AND_INCR (k, p); ++ if (k == 0) ++ { ++ p -= 2 * OFFSET_ADDRESS_SIZE; ++ succeed_n_p = true; /* Spaghetti code alert. */ ++ goto handle_on_failure_jump; ++ } ++ continue; ++ ++ ++ case set_number_at: ++ p += 2 * OFFSET_ADDRESS_SIZE; ++ continue; ++ ++ ++ case start_memory: ++ case stop_memory: ++ p += 2; ++ continue; ++ ++ ++ default: ++ abort (); /* We have listed all the cases. */ ++ } /* switch *p++ */ ++ ++ /* Getting here means we have found the possible starting ++ characters for one path of the pattern -- and that the empty ++ string does not match. We need not follow this path further. ++ Instead, look at the next alternative (remembered on the ++ stack), or quit if no more. The test at the top of the loop ++ does these things. */ ++ path_can_be_null = false; ++ p = pend; ++ } /* while p */ ++ ++ /* Set `can_be_null' for the last path (also the first path, if the ++ pattern is empty). */ ++ bufp->can_be_null |= path_can_be_null; ++ ++ done: ++ RESET_FAIL_STACK (); ++ return 0; ++} ++ ++#else /* not INSIDE_RECURSION */ ++ ++int ++re_compile_fastmap (struct re_pattern_buffer *bufp) ++{ ++# ifdef MBS_SUPPORT ++ if (MB_CUR_MAX != 1) ++ return wcs_re_compile_fastmap(bufp); ++ else ++# endif ++ return byte_re_compile_fastmap(bufp); ++} /* re_compile_fastmap */ ++#ifdef _LIBC ++weak_alias (__re_compile_fastmap, re_compile_fastmap) ++#endif ++ ++ ++/* Set REGS to hold NUM_REGS registers, storing them in STARTS and ++ ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use ++ this memory for recording register information. STARTS and ENDS ++ must be allocated using the malloc library routine, and must each ++ be at least NUM_REGS * sizeof (regoff_t) bytes long. ++ ++ If NUM_REGS == 0, then subsequent matches should allocate their own ++ register data. ++ ++ Unless this function is called, the first search or match using ++ PATTERN_BUFFER will allocate its own register data, without ++ freeing the old data. */ ++ ++void ++re_set_registers (struct re_pattern_buffer *bufp, ++ struct re_registers *regs, unsigned num_regs, ++ regoff_t *starts, regoff_t *ends) ++{ ++ if (num_regs) ++ { ++ bufp->regs_allocated = REGS_REALLOCATE; ++ regs->num_regs = num_regs; ++ regs->start = starts; ++ regs->end = ends; ++ } ++ else ++ { ++ bufp->regs_allocated = REGS_UNALLOCATED; ++ regs->num_regs = 0; ++ regs->start = regs->end = (regoff_t *) 0; ++ } ++} ++#ifdef _LIBC ++weak_alias (__re_set_registers, re_set_registers) ++#endif ++ ++/* Searching routines. */ ++ ++/* Like re_search_2, below, but only one string is specified, and ++ doesn't let you say where to stop matching. */ ++ ++int ++re_search (struct re_pattern_buffer *bufp, const char *string, int size, ++ int startpos, int range, struct re_registers *regs) ++{ ++ return re_search_2 (bufp, NULL, 0, string, size, startpos, range, ++ regs, size); ++} ++#ifdef _LIBC ++weak_alias (__re_search, re_search) ++#endif ++ ++ ++/* Using the compiled pattern in BUFP->buffer, first tries to match the ++ virtual concatenation of STRING1 and STRING2, starting first at index ++ STARTPOS, then at STARTPOS + 1, and so on. ++ ++ STRING1 and STRING2 have length SIZE1 and SIZE2, respectively. ++ ++ RANGE is how far to scan while trying to match. RANGE = 0 means try ++ only at STARTPOS; in general, the last start tried is STARTPOS + ++ RANGE. ++ ++ In REGS, return the indices of the virtual concatenation of STRING1 ++ and STRING2 that matched the entire BUFP->buffer and its contained ++ subexpressions. ++ ++ Do not consider matching one past the index STOP in the virtual ++ concatenation of STRING1 and STRING2. ++ ++ We return either the position in the strings at which the match was ++ found, -1 if no match, or -2 if error (such as failure ++ stack overflow). */ ++ ++int ++re_search_2 (struct re_pattern_buffer *bufp, const char *string1, int size1, ++ const char *string2, int size2, int startpos, int range, ++ struct re_registers *regs, int stop) ++{ ++# ifdef MBS_SUPPORT ++ if (MB_CUR_MAX != 1) ++ return wcs_re_search_2 (bufp, string1, size1, string2, size2, startpos, ++ range, regs, stop); ++ else ++# endif ++ return byte_re_search_2 (bufp, string1, size1, string2, size2, startpos, ++ range, regs, stop); ++} /* re_search_2 */ ++#ifdef _LIBC ++weak_alias (__re_search_2, re_search_2) ++#endif ++ ++#endif /* not INSIDE_RECURSION */ ++ ++#ifdef INSIDE_RECURSION ++ ++#ifdef MATCH_MAY_ALLOCATE ++# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL ++#else ++# define FREE_VAR(var) if (var) free (var); var = NULL ++#endif ++ ++#ifdef WCHAR ++# define MAX_ALLOCA_SIZE 2000 ++ ++# define FREE_WCS_BUFFERS() \ ++ do { \ ++ if (size1 > MAX_ALLOCA_SIZE) \ ++ { \ ++ free (wcs_string1); \ ++ free (mbs_offset1); \ ++ } \ ++ else \ ++ { \ ++ FREE_VAR (wcs_string1); \ ++ FREE_VAR (mbs_offset1); \ ++ } \ ++ if (size2 > MAX_ALLOCA_SIZE) \ ++ { \ ++ free (wcs_string2); \ ++ free (mbs_offset2); \ ++ } \ ++ else \ ++ { \ ++ FREE_VAR (wcs_string2); \ ++ FREE_VAR (mbs_offset2); \ ++ } \ ++ } while (0) ++ ++#endif ++ ++ ++static int ++PREFIX(re_search_2) (struct re_pattern_buffer *bufp, const char *string1, ++ int size1, const char *string2, int size2, ++ int startpos, int range, ++ struct re_registers *regs, int stop) ++{ ++ int val; ++ register char *fastmap = bufp->fastmap; ++ register RE_TRANSLATE_TYPE translate = bufp->translate; ++ int total_size = size1 + size2; ++ int endpos = startpos + range; ++#ifdef WCHAR ++ /* We need wchar_t* buffers correspond to cstring1, cstring2. */ ++ wchar_t *wcs_string1 = NULL, *wcs_string2 = NULL; ++ /* We need the size of wchar_t buffers correspond to csize1, csize2. */ ++ int wcs_size1 = 0, wcs_size2 = 0; ++ /* offset buffer for optimizatoin. See convert_mbs_to_wc. */ ++ int *mbs_offset1 = NULL, *mbs_offset2 = NULL; ++ /* They hold whether each wchar_t is binary data or not. */ ++ char *is_binary = NULL; ++#endif /* WCHAR */ ++ ++ /* Check for out-of-range STARTPOS. */ ++ if (startpos < 0 || startpos > total_size) ++ return -1; ++ ++ /* Fix up RANGE if it might eventually take us outside ++ the virtual concatenation of STRING1 and STRING2. ++ Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE. */ ++ if (endpos < 0) ++ range = 0 - startpos; ++ else if (endpos > total_size) ++ range = total_size - startpos; ++ ++ /* If the search isn't to be a backwards one, don't waste time in a ++ search for a pattern that must be anchored. */ ++ if (bufp->used > 0 && range > 0 ++ && ((re_opcode_t) bufp->buffer[0] == begbuf ++ /* `begline' is like `begbuf' if it cannot match at newlines. */ ++ || ((re_opcode_t) bufp->buffer[0] == begline ++ && !bufp->newline_anchor))) ++ { ++ if (startpos > 0) ++ return -1; ++ else ++ range = 1; ++ } ++ ++#ifdef emacs ++ /* In a forward search for something that starts with \=. ++ don't keep searching past point. */ ++ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0) ++ { ++ range = PT - startpos; ++ if (range <= 0) ++ return -1; ++ } ++#endif /* emacs */ ++ ++ /* Update the fastmap now if not correct already. */ ++ if (fastmap && !bufp->fastmap_accurate) ++ if (re_compile_fastmap (bufp) == -2) ++ return -2; ++ ++#ifdef WCHAR ++ /* Allocate wchar_t array for wcs_string1 and wcs_string2 and ++ fill them with converted string. */ ++ if (size1 != 0) ++ { ++ if (size1 > MAX_ALLOCA_SIZE) ++ { ++ wcs_string1 = TALLOC (size1 + 1, CHAR_T); ++ mbs_offset1 = TALLOC (size1 + 1, int); ++ is_binary = TALLOC (size1 + 1, char); ++ } ++ else ++ { ++ wcs_string1 = REGEX_TALLOC (size1 + 1, CHAR_T); ++ mbs_offset1 = REGEX_TALLOC (size1 + 1, int); ++ is_binary = REGEX_TALLOC (size1 + 1, char); ++ } ++ if (!wcs_string1 || !mbs_offset1 || !is_binary) ++ { ++ if (size1 > MAX_ALLOCA_SIZE) ++ { ++ free (wcs_string1); ++ free (mbs_offset1); ++ free (is_binary); ++ } ++ else ++ { ++ FREE_VAR (wcs_string1); ++ FREE_VAR (mbs_offset1); ++ FREE_VAR (is_binary); ++ } ++ return -2; ++ } ++ wcs_size1 = convert_mbs_to_wcs(wcs_string1, string1, size1, ++ mbs_offset1, is_binary); ++ wcs_string1[wcs_size1] = L'\0'; /* for a sentinel */ ++ if (size1 > MAX_ALLOCA_SIZE) ++ free (is_binary); ++ else ++ FREE_VAR (is_binary); ++ } ++ if (size2 != 0) ++ { ++ if (size2 > MAX_ALLOCA_SIZE) ++ { ++ wcs_string2 = TALLOC (size2 + 1, CHAR_T); ++ mbs_offset2 = TALLOC (size2 + 1, int); ++ is_binary = TALLOC (size2 + 1, char); ++ } ++ else ++ { ++ wcs_string2 = REGEX_TALLOC (size2 + 1, CHAR_T); ++ mbs_offset2 = REGEX_TALLOC (size2 + 1, int); ++ is_binary = REGEX_TALLOC (size2 + 1, char); ++ } ++ if (!wcs_string2 || !mbs_offset2 || !is_binary) ++ { ++ FREE_WCS_BUFFERS (); ++ if (size2 > MAX_ALLOCA_SIZE) ++ free (is_binary); ++ else ++ FREE_VAR (is_binary); ++ return -2; ++ } ++ wcs_size2 = convert_mbs_to_wcs(wcs_string2, string2, size2, ++ mbs_offset2, is_binary); ++ wcs_string2[wcs_size2] = L'\0'; /* for a sentinel */ ++ if (size2 > MAX_ALLOCA_SIZE) ++ free (is_binary); ++ else ++ FREE_VAR (is_binary); ++ } ++#endif /* WCHAR */ ++ ++ ++ /* Loop through the string, looking for a place to start matching. */ ++ for (;;) ++ { ++ /* If a fastmap is supplied, skip quickly over characters that ++ cannot be the start of a match. If the pattern can match the ++ null string, however, we don't need to skip characters; we want ++ the first null string. */ ++ if (fastmap && startpos < total_size && !bufp->can_be_null) ++ { ++ if (range > 0) /* Searching forwards. */ ++ { ++ register const char *d; ++ register int lim = 0; ++ int irange = range; ++ ++ if (startpos < size1 && startpos + range >= size1) ++ lim = range - (size1 - startpos); ++ ++ d = (startpos >= size1 ? string2 - size1 : string1) + startpos; ++ ++ /* Written out as an if-else to avoid testing `translate' ++ inside the loop. */ ++ if (translate) ++ while (range > lim ++ && !fastmap[(unsigned char) ++ translate[(unsigned char) *d++]]) ++ range--; ++ else ++ while (range > lim && !fastmap[(unsigned char) *d++]) ++ range--; ++ ++ startpos += irange - range; ++ } ++ else /* Searching backwards. */ ++ { ++ register CHAR_T c = (size1 == 0 || startpos >= size1 ++ ? string2[startpos - size1] ++ : string1[startpos]); ++ ++ if (!fastmap[(unsigned char) TRANSLATE (c)]) ++ goto advance; ++ } ++ } ++ ++ /* If can't match the null string, and that's all we have left, fail. */ ++ if (range >= 0 && startpos == total_size && fastmap ++ && !bufp->can_be_null) ++ { ++#ifdef WCHAR ++ FREE_WCS_BUFFERS (); ++#endif ++ return -1; ++ } ++ ++#ifdef WCHAR ++ val = wcs_re_match_2_internal (bufp, string1, size1, string2, ++ size2, startpos, regs, stop, ++ wcs_string1, wcs_size1, ++ wcs_string2, wcs_size2, ++ mbs_offset1, mbs_offset2); ++#else /* BYTE */ ++ val = byte_re_match_2_internal (bufp, string1, size1, string2, ++ size2, startpos, regs, stop); ++#endif /* BYTE */ ++ ++#ifndef REGEX_MALLOC ++# ifdef C_ALLOCA ++ alloca (0); ++# endif ++#endif ++ ++ if (val >= 0) ++ { ++#ifdef WCHAR ++ FREE_WCS_BUFFERS (); ++#endif ++ return startpos; ++ } ++ ++ if (val == -2) ++ { ++#ifdef WCHAR ++ FREE_WCS_BUFFERS (); ++#endif ++ return -2; ++ } ++ ++ advance: ++ if (!range) ++ break; ++ else if (range > 0) ++ { ++ range--; ++ startpos++; ++ } ++ else ++ { ++ range++; ++ startpos--; ++ } ++ } ++#ifdef WCHAR ++ FREE_WCS_BUFFERS (); ++#endif ++ return -1; ++} ++ ++#ifdef WCHAR ++/* This converts PTR, a pointer into one of the search wchar_t strings ++ `string1' and `string2' into an multibyte string offset from the ++ beginning of that string. We use mbs_offset to optimize. ++ See convert_mbs_to_wcs. */ ++# define POINTER_TO_OFFSET(ptr) \ ++ (FIRST_STRING_P (ptr) \ ++ ? ((regoff_t)(mbs_offset1 != NULL? mbs_offset1[(ptr)-string1] : 0)) \ ++ : ((regoff_t)((mbs_offset2 != NULL? mbs_offset2[(ptr)-string2] : 0) \ ++ + csize1))) ++#else /* BYTE */ ++/* This converts PTR, a pointer into one of the search strings `string1' ++ and `string2' into an offset from the beginning of that string. */ ++# define POINTER_TO_OFFSET(ptr) \ ++ (FIRST_STRING_P (ptr) \ ++ ? ((regoff_t) ((ptr) - string1)) \ ++ : ((regoff_t) ((ptr) - string2 + size1))) ++#endif /* WCHAR */ ++ ++/* Macros for dealing with the split strings in re_match_2. */ ++ ++#define MATCHING_IN_FIRST_STRING (dend == end_match_1) ++ ++/* Call before fetching a character with *d. This switches over to ++ string2 if necessary. */ ++#define PREFETCH() \ ++ while (d == dend) \ ++ { \ ++ /* End of string2 => fail. */ \ ++ if (dend == end_match_2) \ ++ goto fail; \ ++ /* End of string1 => advance to string2. */ \ ++ d = string2; \ ++ dend = end_match_2; \ ++ } ++ ++/* Test if at very beginning or at very end of the virtual concatenation ++ of `string1' and `string2'. If only one string, it's `string2'. */ ++#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2) ++#define AT_STRINGS_END(d) ((d) == end2) ++ ++ ++/* Test if D points to a character which is word-constituent. We have ++ two special cases to check for: if past the end of string1, look at ++ the first character in string2; and if before the beginning of ++ string2, look at the last character in string1. */ ++#ifdef WCHAR ++/* Use internationalized API instead of SYNTAX. */ ++# define WORDCHAR_P(d) \ ++ (iswalnum ((wint_t)((d) == end1 ? *string2 \ ++ : (d) == string2 - 1 ? *(end1 - 1) : *(d))) != 0 \ ++ || ((d) == end1 ? *string2 \ ++ : (d) == string2 - 1 ? *(end1 - 1) : *(d)) == L'_') ++#else /* BYTE */ ++# define WORDCHAR_P(d) \ ++ (SYNTAX ((d) == end1 ? *string2 \ ++ : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \ ++ == Sword) ++#endif /* WCHAR */ ++ ++/* Disabled due to a compiler bug -- see comment at case wordbound */ ++#if 0 ++/* Test if the character before D and the one at D differ with respect ++ to being word-constituent. */ ++#define AT_WORD_BOUNDARY(d) \ ++ (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \ ++ || WORDCHAR_P (d - 1) != WORDCHAR_P (d)) ++#endif ++ ++/* Free everything we malloc. */ ++#ifdef MATCH_MAY_ALLOCATE ++# ifdef WCHAR ++# define FREE_VARIABLES() \ ++ do { \ ++ REGEX_FREE_STACK (fail_stack.stack); \ ++ FREE_VAR (regstart); \ ++ FREE_VAR (regend); \ ++ FREE_VAR (old_regstart); \ ++ FREE_VAR (old_regend); \ ++ FREE_VAR (best_regstart); \ ++ FREE_VAR (best_regend); \ ++ FREE_VAR (reg_info); \ ++ FREE_VAR (reg_dummy); \ ++ FREE_VAR (reg_info_dummy); \ ++ if (!cant_free_wcs_buf) \ ++ { \ ++ FREE_VAR (string1); \ ++ FREE_VAR (string2); \ ++ FREE_VAR (mbs_offset1); \ ++ FREE_VAR (mbs_offset2); \ ++ } \ ++ } while (0) ++# else /* BYTE */ ++# define FREE_VARIABLES() \ ++ do { \ ++ REGEX_FREE_STACK (fail_stack.stack); \ ++ FREE_VAR (regstart); \ ++ FREE_VAR (regend); \ ++ FREE_VAR (old_regstart); \ ++ FREE_VAR (old_regend); \ ++ FREE_VAR (best_regstart); \ ++ FREE_VAR (best_regend); \ ++ FREE_VAR (reg_info); \ ++ FREE_VAR (reg_dummy); \ ++ FREE_VAR (reg_info_dummy); \ ++ } while (0) ++# endif /* WCHAR */ ++#else ++# ifdef WCHAR ++# define FREE_VARIABLES() \ ++ do { \ ++ if (!cant_free_wcs_buf) \ ++ { \ ++ FREE_VAR (string1); \ ++ FREE_VAR (string2); \ ++ FREE_VAR (mbs_offset1); \ ++ FREE_VAR (mbs_offset2); \ ++ } \ ++ } while (0) ++# else /* BYTE */ ++# define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */ ++# endif /* WCHAR */ ++#endif /* not MATCH_MAY_ALLOCATE */ ++ ++/* These values must meet several constraints. They must not be valid ++ register values; since we have a limit of 255 registers (because ++ we use only one byte in the pattern for the register number), we can ++ use numbers larger than 255. They must differ by 1, because of ++ NUM_FAILURE_ITEMS above. And the value for the lowest register must ++ be larger than the value for the highest register, so we do not try ++ to actually save any registers when none are active. */ ++#define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH) ++#define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1) ++ ++#else /* not INSIDE_RECURSION */ ++/* Matching routines. */ ++ ++#ifndef emacs /* Emacs never uses this. */ ++/* re_match is like re_match_2 except it takes only a single string. */ ++ ++int ++re_match (struct re_pattern_buffer *bufp, const char *string, ++ int size, int pos, struct re_registers *regs) ++{ ++ int result; ++# ifdef MBS_SUPPORT ++ if (MB_CUR_MAX != 1) ++ result = wcs_re_match_2_internal (bufp, NULL, 0, string, size, ++ pos, regs, size, ++ NULL, 0, NULL, 0, NULL, NULL); ++ else ++# endif ++ result = byte_re_match_2_internal (bufp, NULL, 0, string, size, ++ pos, regs, size); ++# ifndef REGEX_MALLOC ++# ifdef C_ALLOCA ++ alloca (0); ++# endif ++# endif ++ return result; ++} ++# ifdef _LIBC ++weak_alias (__re_match, re_match) ++# endif ++#endif /* not emacs */ ++ ++#endif /* not INSIDE_RECURSION */ ++ ++#ifdef INSIDE_RECURSION ++static boolean PREFIX(group_match_null_string_p) (UCHAR_T **p, ++ UCHAR_T *end, ++ PREFIX(register_info_type) *reg_info); ++static boolean PREFIX(alt_match_null_string_p) (UCHAR_T *p, ++ UCHAR_T *end, ++ PREFIX(register_info_type) *reg_info); ++static boolean PREFIX(common_op_match_null_string_p) (UCHAR_T **p, ++ UCHAR_T *end, ++ PREFIX(register_info_type) *reg_info); ++static int PREFIX(bcmp_translate) (const CHAR_T *s1, const CHAR_T *s2, ++ register int len, ++ RE_TRANSLATE_TYPE translate); ++#else /* not INSIDE_RECURSION */ ++ ++/* re_match_2 matches the compiled pattern in BUFP against the ++ the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1 ++ and SIZE2, respectively). We start matching at POS, and stop ++ matching at STOP. ++ ++ If REGS is non-null and the `no_sub' field of BUFP is nonzero, we ++ store offsets for the substring each group matched in REGS. See the ++ documentation for exactly how many groups we fill. ++ ++ We return -1 if no match, -2 if an internal error (such as the ++ failure stack overflowing). Otherwise, we return the length of the ++ matched substring. */ ++ ++int ++re_match_2 (struct re_pattern_buffer *bufp, const char *string1, int size1, ++ const char *string2, int size2, int pos, ++ struct re_registers *regs, int stop) ++{ ++ int result; ++# ifdef MBS_SUPPORT ++ if (MB_CUR_MAX != 1) ++ result = wcs_re_match_2_internal (bufp, string1, size1, string2, size2, ++ pos, regs, stop, ++ NULL, 0, NULL, 0, NULL, NULL); ++ else ++# endif ++ result = byte_re_match_2_internal (bufp, string1, size1, string2, size2, ++ pos, regs, stop); ++ ++#ifndef REGEX_MALLOC ++# ifdef C_ALLOCA ++ alloca (0); ++# endif ++#endif ++ return result; ++} ++#ifdef _LIBC ++weak_alias (__re_match_2, re_match_2) ++#endif ++ ++#endif /* not INSIDE_RECURSION */ ++ ++#ifdef INSIDE_RECURSION ++ ++#ifdef WCHAR ++static int count_mbs_length (int *, int); ++ ++/* This check the substring (from 0, to length) of the multibyte string, ++ to which offset_buffer correspond. And count how many wchar_t_characters ++ the substring occupy. We use offset_buffer to optimization. ++ See convert_mbs_to_wcs. */ ++ ++static int ++count_mbs_length(int *offset_buffer, int length) ++{ ++ int upper, lower; ++ ++ /* Check whether the size is valid. */ ++ if (length < 0) ++ return -1; ++ ++ if (offset_buffer == NULL) ++ return 0; ++ ++ /* If there are no multibyte character, offset_buffer[i] == i. ++ Optmize for this case. */ ++ if (offset_buffer[length] == length) ++ return length; ++ ++ /* Set up upper with length. (because for all i, offset_buffer[i] >= i) */ ++ upper = length; ++ lower = 0; ++ ++ while (true) ++ { ++ int middle = (lower + upper) / 2; ++ if (middle == lower || middle == upper) ++ break; ++ if (offset_buffer[middle] > length) ++ upper = middle; ++ else if (offset_buffer[middle] < length) ++ lower = middle; ++ else ++ return middle; ++ } ++ ++ return -1; ++} ++#endif /* WCHAR */ ++ ++/* This is a separate function so that we can force an alloca cleanup ++ afterwards. */ ++#ifdef WCHAR ++static int ++wcs_re_match_2_internal (struct re_pattern_buffer *bufp, ++ const char *cstring1, int csize1, ++ const char *cstring2, int csize2, ++ int pos, ++ struct re_registers *regs, ++ int stop, ++ /* string1 == string2 == NULL means string1/2, size1/2 and ++ mbs_offset1/2 need seting up in this function. */ ++ /* We need wchar_t* buffers correspond to cstring1, cstring2. */ ++ wchar_t *string1, int size1, ++ wchar_t *string2, int size2, ++ /* offset buffer for optimizatoin. See convert_mbs_to_wc. */ ++ int *mbs_offset1, int *mbs_offset2) ++#else /* BYTE */ ++static int ++byte_re_match_2_internal (struct re_pattern_buffer *bufp, ++ const char *string1, int size1, ++ const char *string2, int size2, ++ int pos, ++ struct re_registers *regs, int stop) ++#endif /* BYTE */ ++{ ++ /* General temporaries. */ ++ int mcnt; ++ UCHAR_T *p1; ++#ifdef WCHAR ++ /* They hold whether each wchar_t is binary data or not. */ ++ char *is_binary = NULL; ++ /* If true, we can't free string1/2, mbs_offset1/2. */ ++ int cant_free_wcs_buf = 1; ++#endif /* WCHAR */ ++ ++ /* Just past the end of the corresponding string. */ ++ const CHAR_T *end1, *end2; ++ ++ /* Pointers into string1 and string2, just past the last characters in ++ each to consider matching. */ ++ const CHAR_T *end_match_1, *end_match_2; ++ ++ /* Where we are in the data, and the end of the current string. */ ++ const CHAR_T *d, *dend; ++ ++ /* Where we are in the pattern, and the end of the pattern. */ ++#ifdef WCHAR ++ UCHAR_T *pattern, *p; ++ register UCHAR_T *pend; ++#else /* BYTE */ ++ UCHAR_T *p = bufp->buffer; ++ register UCHAR_T *pend = p + bufp->used; ++#endif /* WCHAR */ ++ ++ /* Mark the opcode just after a start_memory, so we can test for an ++ empty subpattern when we get to the stop_memory. */ ++ UCHAR_T *just_past_start_mem = 0; ++ ++ /* We use this to map every character in the string. */ ++ RE_TRANSLATE_TYPE translate = bufp->translate; ++ ++ /* Failure point stack. Each place that can handle a failure further ++ down the line pushes a failure point on this stack. It consists of ++ restart, regend, and reg_info for all registers corresponding to ++ the subexpressions we're currently inside, plus the number of such ++ registers, and, finally, two char *'s. The first char * is where ++ to resume scanning the pattern; the second one is where to resume ++ scanning the strings. If the latter is zero, the failure point is ++ a ``dummy''; if a failure happens and the failure point is a dummy, ++ it gets discarded and the next next one is tried. */ ++#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ ++ PREFIX(fail_stack_type) fail_stack; ++#endif ++#ifdef DEBUG ++ static unsigned failure_id; ++ unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0; ++#endif ++ ++#ifdef REL_ALLOC ++ /* This holds the pointer to the failure stack, when ++ it is allocated relocatably. */ ++ fail_stack_elt_t *failure_stack_ptr; ++#endif ++ ++ /* We fill all the registers internally, independent of what we ++ return, for use in backreferences. The number here includes ++ an element for register zero. */ ++ size_t num_regs = bufp->re_nsub + 1; ++ ++ /* The currently active registers. */ ++ active_reg_t lowest_active_reg = NO_LOWEST_ACTIVE_REG; ++ active_reg_t highest_active_reg = NO_HIGHEST_ACTIVE_REG; ++ ++ /* Information on the contents of registers. These are pointers into ++ the input strings; they record just what was matched (on this ++ attempt) by a subexpression part of the pattern, that is, the ++ regnum-th regstart pointer points to where in the pattern we began ++ matching and the regnum-th regend points to right after where we ++ stopped matching the regnum-th subexpression. (The zeroth register ++ keeps track of what the whole pattern matches.) */ ++#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ ++ const CHAR_T **regstart, **regend; ++#endif ++ ++ /* If a group that's operated upon by a repetition operator fails to ++ match anything, then the register for its start will need to be ++ restored because it will have been set to wherever in the string we ++ are when we last see its open-group operator. Similarly for a ++ register's end. */ ++#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ ++ const CHAR_T **old_regstart, **old_regend; ++#endif ++ ++ /* The is_active field of reg_info helps us keep track of which (possibly ++ nested) subexpressions we are currently in. The matched_something ++ field of reg_info[reg_num] helps us tell whether or not we have ++ matched any of the pattern so far this time through the reg_num-th ++ subexpression. These two fields get reset each time through any ++ loop their register is in. */ ++#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ ++ PREFIX(register_info_type) *reg_info; ++#endif ++ ++ /* The following record the register info as found in the above ++ variables when we find a match better than any we've seen before. ++ This happens as we backtrack through the failure points, which in ++ turn happens only if we have not yet matched the entire string. */ ++ unsigned best_regs_set = false; ++#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ ++ const CHAR_T **best_regstart, **best_regend; ++#endif ++ ++ /* Logically, this is `best_regend[0]'. But we don't want to have to ++ allocate space for that if we're not allocating space for anything ++ else (see below). Also, we never need info about register 0 for ++ any of the other register vectors, and it seems rather a kludge to ++ treat `best_regend' differently than the rest. So we keep track of ++ the end of the best match so far in a separate variable. We ++ initialize this to NULL so that when we backtrack the first time ++ and need to test it, it's not garbage. */ ++ const CHAR_T *match_end = NULL; ++ ++ /* This helps SET_REGS_MATCHED avoid doing redundant work. */ ++ int set_regs_matched_done = 0; ++ ++ /* Used when we pop values we don't care about. */ ++#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ ++ const CHAR_T **reg_dummy; ++ PREFIX(register_info_type) *reg_info_dummy; ++#endif ++ ++#ifdef DEBUG ++ /* Counts the total number of registers pushed. */ ++ unsigned num_regs_pushed = 0; ++#endif ++ ++ DEBUG_PRINT1 ("\n\nEntering re_match_2.\n"); ++ ++ INIT_FAIL_STACK (); ++ ++#ifdef MATCH_MAY_ALLOCATE ++ /* Do not bother to initialize all the register variables if there are ++ no groups in the pattern, as it takes a fair amount of time. If ++ there are groups, we include space for register 0 (the whole ++ pattern), even though we never use it, since it simplifies the ++ array indexing. We should fix this. */ ++ if (bufp->re_nsub) ++ { ++ regstart = REGEX_TALLOC (num_regs, const CHAR_T *); ++ regend = REGEX_TALLOC (num_regs, const CHAR_T *); ++ old_regstart = REGEX_TALLOC (num_regs, const CHAR_T *); ++ old_regend = REGEX_TALLOC (num_regs, const CHAR_T *); ++ best_regstart = REGEX_TALLOC (num_regs, const CHAR_T *); ++ best_regend = REGEX_TALLOC (num_regs, const CHAR_T *); ++ reg_info = REGEX_TALLOC (num_regs, PREFIX(register_info_type)); ++ reg_dummy = REGEX_TALLOC (num_regs, const CHAR_T *); ++ reg_info_dummy = REGEX_TALLOC (num_regs, PREFIX(register_info_type)); ++ ++ if (!(regstart && regend && old_regstart && old_regend && reg_info ++ && best_regstart && best_regend && reg_dummy && reg_info_dummy)) ++ { ++ FREE_VARIABLES (); ++ return -2; ++ } ++ } ++ else ++ { ++ /* We must initialize all our variables to NULL, so that ++ `FREE_VARIABLES' doesn't try to free them. */ ++ regstart = regend = old_regstart = old_regend = best_regstart ++ = best_regend = reg_dummy = NULL; ++ reg_info = reg_info_dummy = (PREFIX(register_info_type) *) NULL; ++ } ++#endif /* MATCH_MAY_ALLOCATE */ ++ ++ /* The starting position is bogus. */ ++#ifdef WCHAR ++ if (pos < 0 || pos > csize1 + csize2) ++#else /* BYTE */ ++ if (pos < 0 || pos > size1 + size2) ++#endif ++ { ++ FREE_VARIABLES (); ++ return -1; ++ } ++ ++#ifdef WCHAR ++ /* Allocate wchar_t array for string1 and string2 and ++ fill them with converted string. */ ++ if (string1 == NULL && string2 == NULL) ++ { ++ /* We need seting up buffers here. */ ++ ++ /* We must free wcs buffers in this function. */ ++ cant_free_wcs_buf = 0; ++ ++ if (csize1 != 0) ++ { ++ string1 = REGEX_TALLOC (csize1 + 1, CHAR_T); ++ mbs_offset1 = REGEX_TALLOC (csize1 + 1, int); ++ is_binary = REGEX_TALLOC (csize1 + 1, char); ++ if (!string1 || !mbs_offset1 || !is_binary) ++ { ++ FREE_VAR (string1); ++ FREE_VAR (mbs_offset1); ++ FREE_VAR (is_binary); ++ return -2; ++ } ++ } ++ if (csize2 != 0) ++ { ++ string2 = REGEX_TALLOC (csize2 + 1, CHAR_T); ++ mbs_offset2 = REGEX_TALLOC (csize2 + 1, int); ++ is_binary = REGEX_TALLOC (csize2 + 1, char); ++ if (!string2 || !mbs_offset2 || !is_binary) ++ { ++ FREE_VAR (string1); ++ FREE_VAR (mbs_offset1); ++ FREE_VAR (string2); ++ FREE_VAR (mbs_offset2); ++ FREE_VAR (is_binary); ++ return -2; ++ } ++ size2 = convert_mbs_to_wcs(string2, cstring2, csize2, ++ mbs_offset2, is_binary); ++ string2[size2] = L'\0'; /* for a sentinel */ ++ FREE_VAR (is_binary); ++ } ++ } ++ ++ /* We need to cast pattern to (wchar_t*), because we casted this compiled ++ pattern to (char*) in regex_compile. */ ++ p = pattern = (CHAR_T*)bufp->buffer; ++ pend = (CHAR_T*)(bufp->buffer + bufp->used); ++ ++#endif /* WCHAR */ ++ ++ /* Initialize subexpression text positions to -1 to mark ones that no ++ start_memory/stop_memory has been seen for. Also initialize the ++ register information struct. */ ++ for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) ++ { ++ regstart[mcnt] = regend[mcnt] ++ = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE; ++ ++ REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE; ++ IS_ACTIVE (reg_info[mcnt]) = 0; ++ MATCHED_SOMETHING (reg_info[mcnt]) = 0; ++ EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0; ++ } ++ ++ /* We move `string1' into `string2' if the latter's empty -- but not if ++ `string1' is null. */ ++ if (size2 == 0 && string1 != NULL) ++ { ++ string2 = string1; ++ size2 = size1; ++ string1 = 0; ++ size1 = 0; ++#ifdef WCHAR ++ mbs_offset2 = mbs_offset1; ++ csize2 = csize1; ++ mbs_offset1 = NULL; ++ csize1 = 0; ++#endif ++ } ++ end1 = string1 + size1; ++ end2 = string2 + size2; ++ ++ /* Compute where to stop matching, within the two strings. */ ++#ifdef WCHAR ++ if (stop <= csize1) ++ { ++ mcnt = count_mbs_length(mbs_offset1, stop); ++ end_match_1 = string1 + mcnt; ++ end_match_2 = string2; ++ } ++ else ++ { ++ if (stop > csize1 + csize2) ++ stop = csize1 + csize2; ++ end_match_1 = end1; ++ mcnt = count_mbs_length(mbs_offset2, stop-csize1); ++ end_match_2 = string2 + mcnt; ++ } ++ if (mcnt < 0) ++ { /* count_mbs_length return error. */ ++ FREE_VARIABLES (); ++ return -1; ++ } ++#else ++ if (stop <= size1) ++ { ++ end_match_1 = string1 + stop; ++ end_match_2 = string2; ++ } ++ else ++ { ++ end_match_1 = end1; ++ end_match_2 = string2 + stop - size1; ++ } ++#endif /* WCHAR */ ++ ++ /* `p' scans through the pattern as `d' scans through the data. ++ `dend' is the end of the input string that `d' points within. `d' ++ is advanced into the following input string whenever necessary, but ++ this happens before fetching; therefore, at the beginning of the ++ loop, `d' can be pointing at the end of a string, but it cannot ++ equal `string2'. */ ++#ifdef WCHAR ++ if (size1 > 0 && pos <= csize1) ++ { ++ mcnt = count_mbs_length(mbs_offset1, pos); ++ d = string1 + mcnt; ++ dend = end_match_1; ++ } ++ else ++ { ++ mcnt = count_mbs_length(mbs_offset2, pos-csize1); ++ d = string2 + mcnt; ++ dend = end_match_2; ++ } ++ ++ if (mcnt < 0) ++ { /* count_mbs_length return error. */ ++ FREE_VARIABLES (); ++ return -1; ++ } ++#else ++ if (size1 > 0 && pos <= size1) ++ { ++ d = string1 + pos; ++ dend = end_match_1; ++ } ++ else ++ { ++ d = string2 + pos - size1; ++ dend = end_match_2; ++ } ++#endif /* WCHAR */ ++ ++ DEBUG_PRINT1 ("The compiled pattern is:\n"); ++ DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend); ++ DEBUG_PRINT1 ("The string to match is: `"); ++ DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2); ++ DEBUG_PRINT1 ("'\n"); ++ ++ /* This loops over pattern commands. It exits by returning from the ++ function if the match is complete, or it drops through if the match ++ fails at this starting point in the input data. */ ++ for (;;) ++ { ++#ifdef _LIBC ++ DEBUG_PRINT2 ("\n%p: ", p); ++#else ++ DEBUG_PRINT2 ("\n0x%x: ", p); ++#endif ++ ++ if (p == pend) ++ { /* End of pattern means we might have succeeded. */ ++ DEBUG_PRINT1 ("end of pattern ... "); ++ ++ /* If we haven't matched the entire string, and we want the ++ longest match, try backtracking. */ ++ if (d != end_match_2) ++ { ++ /* 1 if this match ends in the same string (string1 or string2) ++ as the best previous match. */ ++ boolean same_str_p = (FIRST_STRING_P (match_end) ++ == MATCHING_IN_FIRST_STRING); ++ /* 1 if this match is the best seen so far. */ ++ boolean best_match_p; ++ ++ /* AIX compiler got confused when this was combined ++ with the previous declaration. */ ++ if (same_str_p) ++ best_match_p = d > match_end; ++ else ++ best_match_p = !MATCHING_IN_FIRST_STRING; ++ ++ DEBUG_PRINT1 ("backtracking.\n"); ++ ++ if (!FAIL_STACK_EMPTY ()) ++ { /* More failure points to try. */ ++ ++ /* If exceeds best match so far, save it. */ ++ if (!best_regs_set || best_match_p) ++ { ++ best_regs_set = true; ++ match_end = d; ++ ++ DEBUG_PRINT1 ("\nSAVING match as best so far.\n"); ++ ++ for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) ++ { ++ best_regstart[mcnt] = regstart[mcnt]; ++ best_regend[mcnt] = regend[mcnt]; ++ } ++ } ++ goto fail; ++ } ++ ++ /* If no failure points, don't restore garbage. And if ++ last match is real best match, don't restore second ++ best one. */ ++ else if (best_regs_set && !best_match_p) ++ { ++ restore_best_regs: ++ /* Restore best match. It may happen that `dend == ++ end_match_1' while the restored d is in string2. ++ For example, the pattern `x.*y.*z' against the ++ strings `x-' and `y-z-', if the two strings are ++ not consecutive in memory. */ ++ DEBUG_PRINT1 ("Restoring best registers.\n"); ++ ++ d = match_end; ++ dend = ((d >= string1 && d <= end1) ++ ? end_match_1 : end_match_2); ++ ++ for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) ++ { ++ regstart[mcnt] = best_regstart[mcnt]; ++ regend[mcnt] = best_regend[mcnt]; ++ } ++ } ++ } /* d != end_match_2 */ ++ ++ succeed_label: ++ DEBUG_PRINT1 ("Accepting match.\n"); ++ /* If caller wants register contents data back, do it. */ ++ if (regs && !bufp->no_sub) ++ { ++ /* Have the register data arrays been allocated? */ ++ if (bufp->regs_allocated == REGS_UNALLOCATED) ++ { /* No. So allocate them with malloc. We need one ++ extra element beyond `num_regs' for the `-1' marker ++ GNU code uses. */ ++ regs->num_regs = MAX (RE_NREGS, num_regs + 1); ++ regs->start = TALLOC (regs->num_regs, regoff_t); ++ regs->end = TALLOC (regs->num_regs, regoff_t); ++ if (regs->start == NULL || regs->end == NULL) ++ { ++ FREE_VARIABLES (); ++ return -2; ++ } ++ bufp->regs_allocated = REGS_REALLOCATE; ++ } ++ else if (bufp->regs_allocated == REGS_REALLOCATE) ++ { /* Yes. If we need more elements than were already ++ allocated, reallocate them. If we need fewer, just ++ leave it alone. */ ++ if (regs->num_regs < num_regs + 1) ++ { ++ regs->num_regs = num_regs + 1; ++ RETALLOC (regs->start, regs->num_regs, regoff_t); ++ RETALLOC (regs->end, regs->num_regs, regoff_t); ++ if (regs->start == NULL || regs->end == NULL) ++ { ++ FREE_VARIABLES (); ++ return -2; ++ } ++ } ++ } ++ else ++ { ++ /* These braces fend off a "empty body in an else-statement" ++ warning under GCC when assert expands to nothing. */ ++ assert (bufp->regs_allocated == REGS_FIXED); ++ } ++ ++ /* Convert the pointer data in `regstart' and `regend' to ++ indices. Register zero has to be set differently, ++ since we haven't kept track of any info for it. */ ++ if (regs->num_regs > 0) ++ { ++ regs->start[0] = pos; ++#ifdef WCHAR ++ if (MATCHING_IN_FIRST_STRING) ++ regs->end[0] = mbs_offset1 != NULL ? ++ mbs_offset1[d-string1] : 0; ++ else ++ regs->end[0] = csize1 + (mbs_offset2 != NULL ? ++ mbs_offset2[d-string2] : 0); ++#else ++ regs->end[0] = (MATCHING_IN_FIRST_STRING ++ ? ((regoff_t) (d - string1)) ++ : ((regoff_t) (d - string2 + size1))); ++#endif /* WCHAR */ ++ } ++ ++ /* Go through the first `min (num_regs, regs->num_regs)' ++ registers, since that is all we initialized. */ ++ for (mcnt = 1; (unsigned) mcnt < MIN (num_regs, regs->num_regs); ++ mcnt++) ++ { ++ if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt])) ++ regs->start[mcnt] = regs->end[mcnt] = -1; ++ else ++ { ++ regs->start[mcnt] ++ = (regoff_t) POINTER_TO_OFFSET (regstart[mcnt]); ++ regs->end[mcnt] ++ = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]); ++ } ++ } ++ ++ /* If the regs structure we return has more elements than ++ were in the pattern, set the extra elements to -1. If ++ we (re)allocated the registers, this is the case, ++ because we always allocate enough to have at least one ++ -1 at the end. */ ++ for (mcnt = num_regs; (unsigned) mcnt < regs->num_regs; mcnt++) ++ regs->start[mcnt] = regs->end[mcnt] = -1; ++ } /* regs && !bufp->no_sub */ ++ ++ DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n", ++ nfailure_points_pushed, nfailure_points_popped, ++ nfailure_points_pushed - nfailure_points_popped); ++ DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed); ++ ++#ifdef WCHAR ++ if (MATCHING_IN_FIRST_STRING) ++ mcnt = mbs_offset1 != NULL ? mbs_offset1[d-string1] : 0; ++ else ++ mcnt = (mbs_offset2 != NULL ? mbs_offset2[d-string2] : 0) + ++ csize1; ++ mcnt -= pos; ++#else ++ mcnt = d - pos - (MATCHING_IN_FIRST_STRING ++ ? string1 ++ : string2 - size1); ++#endif /* WCHAR */ ++ ++ DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt); ++ ++ FREE_VARIABLES (); ++ return mcnt; ++ } ++ ++ /* Otherwise match next pattern command. */ ++ switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) ++ { ++ /* Ignore these. Used to ignore the n of succeed_n's which ++ currently have n == 0. */ ++ case no_op: ++ DEBUG_PRINT1 ("EXECUTING no_op.\n"); ++ break; ++ ++ case succeed: ++ DEBUG_PRINT1 ("EXECUTING succeed.\n"); ++ goto succeed_label; ++ ++ /* Match the next n pattern characters exactly. The following ++ byte in the pattern defines n, and the n bytes after that ++ are the characters to match. */ ++ case exactn: ++#ifdef MBS_SUPPORT ++ case exactn_bin: ++#endif ++ mcnt = *p++; ++ DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt); ++ ++ /* This is written out as an if-else so we don't waste time ++ testing `translate' inside the loop. */ ++ if (translate) ++ { ++ do ++ { ++ PREFETCH (); ++#ifdef WCHAR ++ if (*d <= 0xff) ++ { ++ if ((UCHAR_T) translate[(unsigned char) *d++] ++ != (UCHAR_T) *p++) ++ goto fail; ++ } ++ else ++ { ++ if (*d++ != (CHAR_T) *p++) ++ goto fail; ++ } ++#else ++ if ((UCHAR_T) translate[(unsigned char) *d++] ++ != (UCHAR_T) *p++) ++ goto fail; ++#endif /* WCHAR */ ++ } ++ while (--mcnt); ++ } ++ else ++ { ++ do ++ { ++ PREFETCH (); ++ if (*d++ != (CHAR_T) *p++) goto fail; ++ } ++ while (--mcnt); ++ } ++ SET_REGS_MATCHED (); ++ break; ++ ++ ++ /* Match any character except possibly a newline or a null. */ ++ case anychar: ++ DEBUG_PRINT1 ("EXECUTING anychar.\n"); ++ ++ PREFETCH (); ++ ++ if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n') ++ || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000')) ++ goto fail; ++ ++ SET_REGS_MATCHED (); ++ DEBUG_PRINT2 (" Matched `%ld'.\n", (long int) *d); ++ d++; ++ break; ++ ++ ++ case charset: ++ case charset_not: ++ { ++ register UCHAR_T c; ++#ifdef WCHAR ++ unsigned int i, char_class_length, coll_symbol_length, ++ equiv_class_length, ranges_length, chars_length, length; ++ CHAR_T *workp, *workp2, *charset_top; ++#define WORK_BUFFER_SIZE 128 ++ CHAR_T str_buf[WORK_BUFFER_SIZE]; ++# ifdef _LIBC ++ uint32_t nrules; ++# endif /* _LIBC */ ++#endif /* WCHAR */ ++ boolean negate = (re_opcode_t) *(p - 1) == charset_not; ++ ++ DEBUG_PRINT2 ("EXECUTING charset%s.\n", negate ? "_not" : ""); ++ PREFETCH (); ++ c = TRANSLATE (*d); /* The character to match. */ ++#ifdef WCHAR ++# ifdef _LIBC ++ nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); ++# endif /* _LIBC */ ++ charset_top = p - 1; ++ char_class_length = *p++; ++ coll_symbol_length = *p++; ++ equiv_class_length = *p++; ++ ranges_length = *p++; ++ chars_length = *p++; ++ /* p points charset[6], so the address of the next instruction ++ (charset[l+m+n+2o+k+p']) equals p[l+m+n+2*o+p'], ++ where l=length of char_classes, m=length of collating_symbol, ++ n=equivalence_class, o=length of char_range, ++ p'=length of character. */ ++ workp = p; ++ /* Update p to indicate the next instruction. */ ++ p += char_class_length + coll_symbol_length+ equiv_class_length + ++ 2*ranges_length + chars_length; ++ ++ /* match with char_class? */ ++ for (i = 0; i < char_class_length ; i += CHAR_CLASS_SIZE) ++ { ++ wctype_t wctype; ++ uintptr_t alignedp = ((uintptr_t)workp ++ + __alignof__(wctype_t) - 1) ++ & ~(uintptr_t)(__alignof__(wctype_t) - 1); ++ wctype = *((wctype_t*)alignedp); ++ workp += CHAR_CLASS_SIZE; ++# ifdef _LIBC ++ if (__iswctype((wint_t)c, wctype)) ++ goto char_set_matched; ++# else ++ if (iswctype((wint_t)c, wctype)) ++ goto char_set_matched; ++# endif ++ } ++ ++ /* match with collating_symbol? */ ++# ifdef _LIBC ++ if (nrules != 0) ++ { ++ const unsigned char *extra = (const unsigned char *) ++ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); ++ ++ for (workp2 = workp + coll_symbol_length ; workp < workp2 ; ++ workp++) ++ { ++ int32_t *wextra; ++ wextra = (int32_t*)(extra + *workp++); ++ for (i = 0; i < *wextra; ++i) ++ if (TRANSLATE(d[i]) != wextra[1 + i]) ++ break; ++ ++ if (i == *wextra) ++ { ++ /* Update d, however d will be incremented at ++ char_set_matched:, we decrement d here. */ ++ d += i - 1; ++ goto char_set_matched; ++ } ++ } ++ } ++ else /* (nrules == 0) */ ++# endif ++ /* If we can't look up collation data, we use wcscoll ++ instead. */ ++ { ++ for (workp2 = workp + coll_symbol_length ; workp < workp2 ;) ++ { ++ const CHAR_T *backup_d = d, *backup_dend = dend; ++# ifdef _LIBC ++ length = __wcslen (workp); ++# else ++ length = wcslen (workp); ++# endif ++ ++ /* If wcscoll(the collating symbol, whole string) > 0, ++ any substring of the string never match with the ++ collating symbol. */ ++# ifdef _LIBC ++ if (__wcscoll (workp, d) > 0) ++# else ++ if (wcscoll (workp, d) > 0) ++# endif ++ { ++ workp += length + 1; ++ continue; ++ } ++ ++ /* First, we compare the collating symbol with ++ the first character of the string. ++ If it don't match, we add the next character to ++ the compare buffer in turn. */ ++ for (i = 0 ; i < WORK_BUFFER_SIZE-1 ; i++, d++) ++ { ++ int match; ++ if (d == dend) ++ { ++ if (dend == end_match_2) ++ break; ++ d = string2; ++ dend = end_match_2; ++ } ++ ++ /* add next character to the compare buffer. */ ++ str_buf[i] = TRANSLATE(*d); ++ str_buf[i+1] = '\0'; ++ ++# ifdef _LIBC ++ match = __wcscoll (workp, str_buf); ++# else ++ match = wcscoll (workp, str_buf); ++# endif ++ if (match == 0) ++ goto char_set_matched; ++ ++ if (match < 0) ++ /* (str_buf > workp) indicate (str_buf + X > workp), ++ because for all X (str_buf + X > str_buf). ++ So we don't need continue this loop. */ ++ break; ++ ++ /* Otherwise(str_buf < workp), ++ (str_buf+next_character) may equals (workp). ++ So we continue this loop. */ ++ } ++ /* not matched */ ++ d = backup_d; ++ dend = backup_dend; ++ workp += length + 1; ++ } ++ } ++ /* match with equivalence_class? */ ++# ifdef _LIBC ++ if (nrules != 0) ++ { ++ const CHAR_T *backup_d = d, *backup_dend = dend; ++ /* Try to match the equivalence class against ++ those known to the collate implementation. */ ++ const int32_t *table; ++ const int32_t *weights; ++ const int32_t *extra; ++ const int32_t *indirect; ++ int32_t idx, idx2; ++ wint_t *cp; ++ size_t len; ++ ++ /* This #include defines a local function! */ ++# include ++ ++ table = (const int32_t *) ++ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEWC); ++ weights = (const wint_t *) ++ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTWC); ++ extra = (const wint_t *) ++ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAWC); ++ indirect = (const int32_t *) ++ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTWC); ++ ++ /* Write 1 collating element to str_buf, and ++ get its index. */ ++ idx2 = 0; ++ ++ for (i = 0 ; idx2 == 0 && i < WORK_BUFFER_SIZE - 1; i++) ++ { ++ cp = (wint_t*)str_buf; ++ if (d == dend) ++ { ++ if (dend == end_match_2) ++ break; ++ d = string2; ++ dend = end_match_2; ++ } ++ str_buf[i] = TRANSLATE(*(d+i)); ++ str_buf[i+1] = '\0'; /* sentinel */ ++ idx2 = findidx ((const wint_t**)&cp, i); ++ } ++ ++ /* Update d, however d will be incremented at ++ char_set_matched:, we decrement d here. */ ++ d = backup_d + ((wchar_t*)cp - (wchar_t*)str_buf - 1); ++ if (d >= dend) ++ { ++ if (dend == end_match_2) ++ d = dend; ++ else ++ { ++ d = string2; ++ dend = end_match_2; ++ } ++ } ++ ++ len = weights[idx2]; ++ ++ for (workp2 = workp + equiv_class_length ; workp < workp2 ; ++ workp++) ++ { ++ idx = (int32_t)*workp; ++ /* We already checked idx != 0 in regex_compile. */ ++ ++ if (idx2 != 0 && len == weights[idx]) ++ { ++ int cnt = 0; ++ while (cnt < len && (weights[idx + 1 + cnt] ++ == weights[idx2 + 1 + cnt])) ++ ++cnt; ++ ++ if (cnt == len) ++ goto char_set_matched; ++ } ++ } ++ /* not matched */ ++ d = backup_d; ++ dend = backup_dend; ++ } ++ else /* (nrules == 0) */ ++# endif ++ /* If we can't look up collation data, we use wcscoll ++ instead. */ ++ { ++ for (workp2 = workp + equiv_class_length ; workp < workp2 ;) ++ { ++ const CHAR_T *backup_d = d, *backup_dend = dend; ++# ifdef _LIBC ++ length = __wcslen (workp); ++# else ++ length = wcslen (workp); ++# endif ++ ++ /* If wcscoll(the collating symbol, whole string) > 0, ++ any substring of the string never match with the ++ collating symbol. */ ++# ifdef _LIBC ++ if (__wcscoll (workp, d) > 0) ++# else ++ if (wcscoll (workp, d) > 0) ++# endif ++ { ++ workp += length + 1; ++ break; ++ } ++ ++ /* First, we compare the equivalence class with ++ the first character of the string. ++ If it don't match, we add the next character to ++ the compare buffer in turn. */ ++ for (i = 0 ; i < WORK_BUFFER_SIZE - 1 ; i++, d++) ++ { ++ int match; ++ if (d == dend) ++ { ++ if (dend == end_match_2) ++ break; ++ d = string2; ++ dend = end_match_2; ++ } ++ ++ /* add next character to the compare buffer. */ ++ str_buf[i] = TRANSLATE(*d); ++ str_buf[i+1] = '\0'; ++ ++# ifdef _LIBC ++ match = __wcscoll (workp, str_buf); ++# else ++ match = wcscoll (workp, str_buf); ++# endif ++ ++ if (match == 0) ++ goto char_set_matched; ++ ++ if (match < 0) ++ /* (str_buf > workp) indicate (str_buf + X > workp), ++ because for all X (str_buf + X > str_buf). ++ So we don't need continue this loop. */ ++ break; ++ ++ /* Otherwise(str_buf < workp), ++ (str_buf+next_character) may equals (workp). ++ So we continue this loop. */ ++ } ++ /* not matched */ ++ d = backup_d; ++ dend = backup_dend; ++ workp += length + 1; ++ } ++ } ++ ++ /* match with char_range? */ ++# ifdef _LIBC ++ if (nrules != 0) ++ { ++ uint32_t collseqval; ++ const char *collseq = (const char *) ++ _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC); ++ ++ collseqval = collseq_table_lookup (collseq, c); ++ ++ for (; workp < p - chars_length ;) ++ { ++ uint32_t start_val, end_val; ++ ++ /* We already compute the collation sequence value ++ of the characters (or collating symbols). */ ++ start_val = (uint32_t) *workp++; /* range_start */ ++ end_val = (uint32_t) *workp++; /* range_end */ ++ ++ if (start_val <= collseqval && collseqval <= end_val) ++ goto char_set_matched; ++ } ++ } ++ else ++# endif ++ { ++ /* We set range_start_char at str_buf[0], range_end_char ++ at str_buf[4], and compared char at str_buf[2]. */ ++ str_buf[1] = 0; ++ str_buf[2] = c; ++ str_buf[3] = 0; ++ str_buf[5] = 0; ++ for (; workp < p - chars_length ;) ++ { ++ wchar_t *range_start_char, *range_end_char; ++ ++ /* match if (range_start_char <= c <= range_end_char). */ ++ ++ /* If range_start(or end) < 0, we assume -range_start(end) ++ is the offset of the collating symbol which is specified ++ as the character of the range start(end). */ ++ ++ /* range_start */ ++ if (*workp < 0) ++ range_start_char = charset_top - (*workp++); ++ else ++ { ++ str_buf[0] = *workp++; ++ range_start_char = str_buf; ++ } ++ ++ /* range_end */ ++ if (*workp < 0) ++ range_end_char = charset_top - (*workp++); ++ else ++ { ++ str_buf[4] = *workp++; ++ range_end_char = str_buf + 4; ++ } ++ ++# ifdef _LIBC ++ if (__wcscoll (range_start_char, str_buf+2) <= 0 ++ && __wcscoll (str_buf+2, range_end_char) <= 0) ++# else ++ if (wcscoll (range_start_char, str_buf+2) <= 0 ++ && wcscoll (str_buf+2, range_end_char) <= 0) ++# endif ++ goto char_set_matched; ++ } ++ } ++ ++ /* match with char? */ ++ for (; workp < p ; workp++) ++ if (c == *workp) ++ goto char_set_matched; ++ ++ negate = !negate; ++ ++ char_set_matched: ++ if (negate) goto fail; ++#else ++ /* Cast to `unsigned' instead of `unsigned char' in case the ++ bit list is a full 32 bytes long. */ ++ if (c < (unsigned) (*p * BYTEWIDTH) ++ && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) ++ negate = !negate; ++ ++ p += 1 + *p; ++ ++ if (!negate) goto fail; ++#undef WORK_BUFFER_SIZE ++#endif /* WCHAR */ ++ SET_REGS_MATCHED (); ++ d++; ++ break; ++ } ++ ++ ++ /* The beginning of a group is represented by start_memory. ++ The arguments are the register number in the next byte, and the ++ number of groups inner to this one in the next. The text ++ matched within the group is recorded (in the internal ++ registers data structure) under the register number. */ ++ case start_memory: ++ DEBUG_PRINT3 ("EXECUTING start_memory %ld (%ld):\n", ++ (long int) *p, (long int) p[1]); ++ ++ /* Find out if this group can match the empty string. */ ++ p1 = p; /* To send to group_match_null_string_p. */ ++ ++ if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE) ++ REG_MATCH_NULL_STRING_P (reg_info[*p]) ++ = PREFIX(group_match_null_string_p) (&p1, pend, reg_info); ++ ++ /* Save the position in the string where we were the last time ++ we were at this open-group operator in case the group is ++ operated upon by a repetition operator, e.g., with `(a*)*b' ++ against `ab'; then we want to ignore where we are now in ++ the string in case this attempt to match fails. */ ++ old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) ++ ? REG_UNSET (regstart[*p]) ? d : regstart[*p] ++ : regstart[*p]; ++ DEBUG_PRINT2 (" old_regstart: %d\n", ++ POINTER_TO_OFFSET (old_regstart[*p])); ++ ++ regstart[*p] = d; ++ DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p])); ++ ++ IS_ACTIVE (reg_info[*p]) = 1; ++ MATCHED_SOMETHING (reg_info[*p]) = 0; ++ ++ /* Clear this whenever we change the register activity status. */ ++ set_regs_matched_done = 0; ++ ++ /* This is the new highest active register. */ ++ highest_active_reg = *p; ++ ++ /* If nothing was active before, this is the new lowest active ++ register. */ ++ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) ++ lowest_active_reg = *p; ++ ++ /* Move past the register number and inner group count. */ ++ p += 2; ++ just_past_start_mem = p; ++ ++ break; ++ ++ ++ /* The stop_memory opcode represents the end of a group. Its ++ arguments are the same as start_memory's: the register ++ number, and the number of inner groups. */ ++ case stop_memory: ++ DEBUG_PRINT3 ("EXECUTING stop_memory %ld (%ld):\n", ++ (long int) *p, (long int) p[1]); ++ ++ /* We need to save the string position the last time we were at ++ this close-group operator in case the group is operated ++ upon by a repetition operator, e.g., with `((a*)*(b*)*)*' ++ against `aba'; then we want to ignore where we are now in ++ the string in case this attempt to match fails. */ ++ old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) ++ ? REG_UNSET (regend[*p]) ? d : regend[*p] ++ : regend[*p]; ++ DEBUG_PRINT2 (" old_regend: %d\n", ++ POINTER_TO_OFFSET (old_regend[*p])); ++ ++ regend[*p] = d; ++ DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p])); ++ ++ /* This register isn't active anymore. */ ++ IS_ACTIVE (reg_info[*p]) = 0; ++ ++ /* Clear this whenever we change the register activity status. */ ++ set_regs_matched_done = 0; ++ ++ /* If this was the only register active, nothing is active ++ anymore. */ ++ if (lowest_active_reg == highest_active_reg) ++ { ++ lowest_active_reg = NO_LOWEST_ACTIVE_REG; ++ highest_active_reg = NO_HIGHEST_ACTIVE_REG; ++ } ++ else ++ { /* We must scan for the new highest active register, since ++ it isn't necessarily one less than now: consider ++ (a(b)c(d(e)f)g). When group 3 ends, after the f), the ++ new highest active register is 1. */ ++ UCHAR_T r = *p - 1; ++ while (r > 0 && !IS_ACTIVE (reg_info[r])) ++ r--; ++ ++ /* If we end up at register zero, that means that we saved ++ the registers as the result of an `on_failure_jump', not ++ a `start_memory', and we jumped to past the innermost ++ `stop_memory'. For example, in ((.)*) we save ++ registers 1 and 2 as a result of the *, but when we pop ++ back to the second ), we are at the stop_memory 1. ++ Thus, nothing is active. */ ++ if (r == 0) ++ { ++ lowest_active_reg = NO_LOWEST_ACTIVE_REG; ++ highest_active_reg = NO_HIGHEST_ACTIVE_REG; ++ } ++ else ++ highest_active_reg = r; ++ } ++ ++ /* If just failed to match something this time around with a ++ group that's operated on by a repetition operator, try to ++ force exit from the ``loop'', and restore the register ++ information for this group that we had before trying this ++ last match. */ ++ if ((!MATCHED_SOMETHING (reg_info[*p]) ++ || just_past_start_mem == p - 1) ++ && (p + 2) < pend) ++ { ++ boolean is_a_jump_n = false; ++ ++ p1 = p + 2; ++ mcnt = 0; ++ switch ((re_opcode_t) *p1++) ++ { ++ case jump_n: ++ is_a_jump_n = true; ++ case pop_failure_jump: ++ case maybe_pop_jump: ++ case jump: ++ case dummy_failure_jump: ++ EXTRACT_NUMBER_AND_INCR (mcnt, p1); ++ if (is_a_jump_n) ++ p1 += OFFSET_ADDRESS_SIZE; ++ break; ++ ++ default: ++ /* do nothing */ ; ++ } ++ p1 += mcnt; ++ ++ /* If the next operation is a jump backwards in the pattern ++ to an on_failure_jump right before the start_memory ++ corresponding to this stop_memory, exit from the loop ++ by forcing a failure after pushing on the stack the ++ on_failure_jump's jump in the pattern, and d. */ ++ if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump ++ && (re_opcode_t) p1[1+OFFSET_ADDRESS_SIZE] == start_memory ++ && p1[2+OFFSET_ADDRESS_SIZE] == *p) ++ { ++ /* If this group ever matched anything, then restore ++ what its registers were before trying this last ++ failed match, e.g., with `(a*)*b' against `ab' for ++ regstart[1], and, e.g., with `((a*)*(b*)*)*' ++ against `aba' for regend[3]. ++ ++ Also restore the registers for inner groups for, ++ e.g., `((a*)(b*))*' against `aba' (register 3 would ++ otherwise get trashed). */ ++ ++ if (EVER_MATCHED_SOMETHING (reg_info[*p])) ++ { ++ unsigned r; ++ ++ EVER_MATCHED_SOMETHING (reg_info[*p]) = 0; ++ ++ /* Restore this and inner groups' (if any) registers. */ ++ for (r = *p; r < (unsigned) *p + (unsigned) *(p + 1); ++ r++) ++ { ++ regstart[r] = old_regstart[r]; ++ ++ /* xx why this test? */ ++ if (old_regend[r] >= regstart[r]) ++ regend[r] = old_regend[r]; ++ } ++ } ++ p1++; ++ EXTRACT_NUMBER_AND_INCR (mcnt, p1); ++ PUSH_FAILURE_POINT (p1 + mcnt, d, -2); ++ ++ goto fail; ++ } ++ } ++ ++ /* Move past the register number and the inner group count. */ ++ p += 2; ++ break; ++ ++ ++ /* \ has been turned into a `duplicate' command which is ++ followed by the numeric value of as the register number. */ ++ case duplicate: ++ { ++ register const CHAR_T *d2, *dend2; ++ int regno = *p++; /* Get which register to match against. */ ++ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno); ++ ++ /* Can't back reference a group which we've never matched. */ ++ if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno])) ++ goto fail; ++ ++ /* Where in input to try to start matching. */ ++ d2 = regstart[regno]; ++ ++ /* Where to stop matching; if both the place to start and ++ the place to stop matching are in the same string, then ++ set to the place to stop, otherwise, for now have to use ++ the end of the first string. */ ++ ++ dend2 = ((FIRST_STRING_P (regstart[regno]) ++ == FIRST_STRING_P (regend[regno])) ++ ? regend[regno] : end_match_1); ++ for (;;) ++ { ++ /* If necessary, advance to next segment in register ++ contents. */ ++ while (d2 == dend2) ++ { ++ if (dend2 == end_match_2) break; ++ if (dend2 == regend[regno]) break; ++ ++ /* End of string1 => advance to string2. */ ++ d2 = string2; ++ dend2 = regend[regno]; ++ } ++ /* At end of register contents => success */ ++ if (d2 == dend2) break; ++ ++ /* If necessary, advance to next segment in data. */ ++ PREFETCH (); ++ ++ /* How many characters left in this segment to match. */ ++ mcnt = dend - d; ++ ++ /* Want how many consecutive characters we can match in ++ one shot, so, if necessary, adjust the count. */ ++ if (mcnt > dend2 - d2) ++ mcnt = dend2 - d2; ++ ++ /* Compare that many; failure if mismatch, else move ++ past them. */ ++ if (translate ++ ? PREFIX(bcmp_translate) (d, d2, mcnt, translate) ++ : memcmp (d, d2, mcnt*sizeof(UCHAR_T))) ++ goto fail; ++ d += mcnt, d2 += mcnt; ++ ++ /* Do this because we've match some characters. */ ++ SET_REGS_MATCHED (); ++ } ++ } ++ break; ++ ++ ++ /* begline matches the empty string at the beginning of the string ++ (unless `not_bol' is set in `bufp'), and, if ++ `newline_anchor' is set, after newlines. */ ++ case begline: ++ DEBUG_PRINT1 ("EXECUTING begline.\n"); ++ ++ if (AT_STRINGS_BEG (d)) ++ { ++ if (!bufp->not_bol) break; ++ } ++ else if (d[-1] == '\n' && bufp->newline_anchor) ++ { ++ break; ++ } ++ /* In all other cases, we fail. */ ++ goto fail; ++ ++ ++ /* endline is the dual of begline. */ ++ case endline: ++ DEBUG_PRINT1 ("EXECUTING endline.\n"); ++ ++ if (AT_STRINGS_END (d)) ++ { ++ if (!bufp->not_eol) break; ++ } ++ ++ /* We have to ``prefetch'' the next character. */ ++ else if ((d == end1 ? *string2 : *d) == '\n' ++ && bufp->newline_anchor) ++ { ++ break; ++ } ++ goto fail; ++ ++ ++ /* Match at the very beginning of the data. */ ++ case begbuf: ++ DEBUG_PRINT1 ("EXECUTING begbuf.\n"); ++ if (AT_STRINGS_BEG (d)) ++ break; ++ goto fail; ++ ++ ++ /* Match at the very end of the data. */ ++ case endbuf: ++ DEBUG_PRINT1 ("EXECUTING endbuf.\n"); ++ if (AT_STRINGS_END (d)) ++ break; ++ goto fail; ++ ++ ++ /* on_failure_keep_string_jump is used to optimize `.*\n'. It ++ pushes NULL as the value for the string on the stack. Then ++ `pop_failure_point' will keep the current value for the ++ string, instead of restoring it. To see why, consider ++ matching `foo\nbar' against `.*\n'. The .* matches the foo; ++ then the . fails against the \n. But the next thing we want ++ to do is match the \n against the \n; if we restored the ++ string value, we would be back at the foo. ++ ++ Because this is used only in specific cases, we don't need to ++ check all the things that `on_failure_jump' does, to make ++ sure the right things get saved on the stack. Hence we don't ++ share its code. The only reason to push anything on the ++ stack at all is that otherwise we would have to change ++ `anychar's code to do something besides goto fail in this ++ case; that seems worse than this. */ ++ case on_failure_keep_string_jump: ++ DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump"); ++ ++ EXTRACT_NUMBER_AND_INCR (mcnt, p); ++#ifdef _LIBC ++ DEBUG_PRINT3 (" %d (to %p):\n", mcnt, p + mcnt); ++#else ++ DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt); ++#endif ++ ++ PUSH_FAILURE_POINT (p + mcnt, NULL, -2); ++ break; ++ ++ ++ /* Uses of on_failure_jump: ++ ++ Each alternative starts with an on_failure_jump that points ++ to the beginning of the next alternative. Each alternative ++ except the last ends with a jump that in effect jumps past ++ the rest of the alternatives. (They really jump to the ++ ending jump of the following alternative, because tensioning ++ these jumps is a hassle.) ++ ++ Repeats start with an on_failure_jump that points past both ++ the repetition text and either the following jump or ++ pop_failure_jump back to this on_failure_jump. */ ++ case on_failure_jump: ++ on_failure: ++ DEBUG_PRINT1 ("EXECUTING on_failure_jump"); ++ ++ EXTRACT_NUMBER_AND_INCR (mcnt, p); ++#ifdef _LIBC ++ DEBUG_PRINT3 (" %d (to %p)", mcnt, p + mcnt); ++#else ++ DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt); ++#endif ++ ++ /* If this on_failure_jump comes right before a group (i.e., ++ the original * applied to a group), save the information ++ for that group and all inner ones, so that if we fail back ++ to this point, the group's information will be correct. ++ For example, in \(a*\)*\1, we need the preceding group, ++ and in \(zz\(a*\)b*\)\2, we need the inner group. */ ++ ++ /* We can't use `p' to check ahead because we push ++ a failure point to `p + mcnt' after we do this. */ ++ p1 = p; ++ ++ /* We need to skip no_op's before we look for the ++ start_memory in case this on_failure_jump is happening as ++ the result of a completed succeed_n, as in \(a\)\{1,3\}b\1 ++ against aba. */ ++ while (p1 < pend && (re_opcode_t) *p1 == no_op) ++ p1++; ++ ++ if (p1 < pend && (re_opcode_t) *p1 == start_memory) ++ { ++ /* We have a new highest active register now. This will ++ get reset at the start_memory we are about to get to, ++ but we will have saved all the registers relevant to ++ this repetition op, as described above. */ ++ highest_active_reg = *(p1 + 1) + *(p1 + 2); ++ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) ++ lowest_active_reg = *(p1 + 1); ++ } ++ ++ DEBUG_PRINT1 (":\n"); ++ PUSH_FAILURE_POINT (p + mcnt, d, -2); ++ break; ++ ++ ++ /* A smart repeat ends with `maybe_pop_jump'. ++ We change it to either `pop_failure_jump' or `jump'. */ ++ case maybe_pop_jump: ++ EXTRACT_NUMBER_AND_INCR (mcnt, p); ++ DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt); ++ { ++ register UCHAR_T *p2 = p; ++ ++ /* Compare the beginning of the repeat with what in the ++ pattern follows its end. If we can establish that there ++ is nothing that they would both match, i.e., that we ++ would have to backtrack because of (as in, e.g., `a*a') ++ then we can change to pop_failure_jump, because we'll ++ never have to backtrack. ++ ++ This is not true in the case of alternatives: in ++ `(a|ab)*' we do need to backtrack to the `ab' alternative ++ (e.g., if the string was `ab'). But instead of trying to ++ detect that here, the alternative has put on a dummy ++ failure point which is what we will end up popping. */ ++ ++ /* Skip over open/close-group commands. ++ If what follows this loop is a ...+ construct, ++ look at what begins its body, since we will have to ++ match at least one of that. */ ++ while (1) ++ { ++ if (p2 + 2 < pend ++ && ((re_opcode_t) *p2 == stop_memory ++ || (re_opcode_t) *p2 == start_memory)) ++ p2 += 3; ++ else if (p2 + 2 + 2 * OFFSET_ADDRESS_SIZE < pend ++ && (re_opcode_t) *p2 == dummy_failure_jump) ++ p2 += 2 + 2 * OFFSET_ADDRESS_SIZE; ++ else ++ break; ++ } ++ ++ p1 = p + mcnt; ++ /* p1[0] ... p1[2] are the `on_failure_jump' corresponding ++ to the `maybe_finalize_jump' of this case. Examine what ++ follows. */ ++ ++ /* If we're at the end of the pattern, we can change. */ ++ if (p2 == pend) ++ { ++ /* Consider what happens when matching ":\(.*\)" ++ against ":/". I don't really understand this code ++ yet. */ ++ p[-(1+OFFSET_ADDRESS_SIZE)] = (UCHAR_T) ++ pop_failure_jump; ++ DEBUG_PRINT1 ++ (" End of pattern: change to `pop_failure_jump'.\n"); ++ } ++ ++ else if ((re_opcode_t) *p2 == exactn ++#ifdef MBS_SUPPORT ++ || (re_opcode_t) *p2 == exactn_bin ++#endif ++ || (bufp->newline_anchor && (re_opcode_t) *p2 == endline)) ++ { ++ register UCHAR_T c ++ = *p2 == (UCHAR_T) endline ? '\n' : p2[2]; ++ ++ if (((re_opcode_t) p1[1+OFFSET_ADDRESS_SIZE] == exactn ++#ifdef MBS_SUPPORT ++ || (re_opcode_t) p1[1+OFFSET_ADDRESS_SIZE] == exactn_bin ++#endif ++ ) && p1[3+OFFSET_ADDRESS_SIZE] != c) ++ { ++ p[-(1+OFFSET_ADDRESS_SIZE)] = (UCHAR_T) ++ pop_failure_jump; ++#ifdef WCHAR ++ DEBUG_PRINT3 (" %C != %C => pop_failure_jump.\n", ++ (wint_t) c, ++ (wint_t) p1[3+OFFSET_ADDRESS_SIZE]); ++#else ++ DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", ++ (char) c, ++ (char) p1[3+OFFSET_ADDRESS_SIZE]); ++#endif ++ } ++ ++#ifndef WCHAR ++ else if ((re_opcode_t) p1[3] == charset ++ || (re_opcode_t) p1[3] == charset_not) ++ { ++ int negate = (re_opcode_t) p1[3] == charset_not; ++ ++ if (c < (unsigned) (p1[4] * BYTEWIDTH) ++ && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) ++ negate = !negate; ++ ++ /* `negate' is equal to 1 if c would match, which means ++ that we can't change to pop_failure_jump. */ ++ if (!negate) ++ { ++ p[-3] = (unsigned char) pop_failure_jump; ++ DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); ++ } ++ } ++#endif /* not WCHAR */ ++ } ++#ifndef WCHAR ++ else if ((re_opcode_t) *p2 == charset) ++ { ++ /* We win if the first character of the loop is not part ++ of the charset. */ ++ if ((re_opcode_t) p1[3] == exactn ++ && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5] ++ && (p2[2 + p1[5] / BYTEWIDTH] ++ & (1 << (p1[5] % BYTEWIDTH))))) ++ { ++ p[-3] = (unsigned char) pop_failure_jump; ++ DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); ++ } ++ ++ else if ((re_opcode_t) p1[3] == charset_not) ++ { ++ int idx; ++ /* We win if the charset_not inside the loop ++ lists every character listed in the charset after. */ ++ for (idx = 0; idx < (int) p2[1]; idx++) ++ if (! (p2[2 + idx] == 0 ++ || (idx < (int) p1[4] ++ && ((p2[2 + idx] & ~ p1[5 + idx]) == 0)))) ++ break; ++ ++ if (idx == p2[1]) ++ { ++ p[-3] = (unsigned char) pop_failure_jump; ++ DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); ++ } ++ } ++ else if ((re_opcode_t) p1[3] == charset) ++ { ++ int idx; ++ /* We win if the charset inside the loop ++ has no overlap with the one after the loop. */ ++ for (idx = 0; ++ idx < (int) p2[1] && idx < (int) p1[4]; ++ idx++) ++ if ((p2[2 + idx] & p1[5 + idx]) != 0) ++ break; ++ ++ if (idx == p2[1] || idx == p1[4]) ++ { ++ p[-3] = (unsigned char) pop_failure_jump; ++ DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); ++ } ++ } ++ } ++#endif /* not WCHAR */ ++ } ++ p -= OFFSET_ADDRESS_SIZE; /* Point at relative address again. */ ++ if ((re_opcode_t) p[-1] != pop_failure_jump) ++ { ++ p[-1] = (UCHAR_T) jump; ++ DEBUG_PRINT1 (" Match => jump.\n"); ++ goto unconditional_jump; ++ } ++ /* Note fall through. */ ++ ++ ++ /* The end of a simple repeat has a pop_failure_jump back to ++ its matching on_failure_jump, where the latter will push a ++ failure point. The pop_failure_jump takes off failure ++ points put on by this pop_failure_jump's matching ++ on_failure_jump; we got through the pattern to here from the ++ matching on_failure_jump, so didn't fail. */ ++ case pop_failure_jump: ++ { ++ /* We need to pass separate storage for the lowest and ++ highest registers, even though we don't care about the ++ actual values. Otherwise, we will restore only one ++ register from the stack, since lowest will == highest in ++ `pop_failure_point'. */ ++ active_reg_t dummy_low_reg, dummy_high_reg; ++ UCHAR_T *pdummy = NULL; ++ const CHAR_T *sdummy = NULL; ++ ++ DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); ++ POP_FAILURE_POINT (sdummy, pdummy, ++ dummy_low_reg, dummy_high_reg, ++ reg_dummy, reg_dummy, reg_info_dummy); ++ } ++ /* Note fall through. */ ++ ++ unconditional_jump: ++#ifdef _LIBC ++ DEBUG_PRINT2 ("\n%p: ", p); ++#else ++ DEBUG_PRINT2 ("\n0x%x: ", p); ++#endif ++ /* Note fall through. */ ++ ++ /* Unconditionally jump (without popping any failure points). */ ++ case jump: ++ EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */ ++ DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt); ++ p += mcnt; /* Do the jump. */ ++#ifdef _LIBC ++ DEBUG_PRINT2 ("(to %p).\n", p); ++#else ++ DEBUG_PRINT2 ("(to 0x%x).\n", p); ++#endif ++ break; ++ ++ ++ /* We need this opcode so we can detect where alternatives end ++ in `group_match_null_string_p' et al. */ ++ case jump_past_alt: ++ DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n"); ++ goto unconditional_jump; ++ ++ ++ /* Normally, the on_failure_jump pushes a failure point, which ++ then gets popped at pop_failure_jump. We will end up at ++ pop_failure_jump, also, and with a pattern of, say, `a+', we ++ are skipping over the on_failure_jump, so we have to push ++ something meaningless for pop_failure_jump to pop. */ ++ case dummy_failure_jump: ++ DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n"); ++ /* It doesn't matter what we push for the string here. What ++ the code at `fail' tests is the value for the pattern. */ ++ PUSH_FAILURE_POINT (NULL, NULL, -2); ++ goto unconditional_jump; ++ ++ ++ /* At the end of an alternative, we need to push a dummy failure ++ point in case we are followed by a `pop_failure_jump', because ++ we don't want the failure point for the alternative to be ++ popped. For example, matching `(a|ab)*' against `aab' ++ requires that we match the `ab' alternative. */ ++ case push_dummy_failure: ++ DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n"); ++ /* See comments just above at `dummy_failure_jump' about the ++ two zeroes. */ ++ PUSH_FAILURE_POINT (NULL, NULL, -2); ++ break; ++ ++ /* Have to succeed matching what follows at least n times. ++ After that, handle like `on_failure_jump'. */ ++ case succeed_n: ++ EXTRACT_NUMBER (mcnt, p + OFFSET_ADDRESS_SIZE); ++ DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt); ++ ++ assert (mcnt >= 0); ++ /* Originally, this is how many times we HAVE to succeed. */ ++ if (mcnt > 0) ++ { ++ mcnt--; ++ p += OFFSET_ADDRESS_SIZE; ++ STORE_NUMBER_AND_INCR (p, mcnt); ++#ifdef _LIBC ++ DEBUG_PRINT3 (" Setting %p to %d.\n", p - OFFSET_ADDRESS_SIZE ++ , mcnt); ++#else ++ DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p - OFFSET_ADDRESS_SIZE ++ , mcnt); ++#endif ++ } ++ else if (mcnt == 0) ++ { ++#ifdef _LIBC ++ DEBUG_PRINT2 (" Setting two bytes from %p to no_op.\n", ++ p + OFFSET_ADDRESS_SIZE); ++#else ++ DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", ++ p + OFFSET_ADDRESS_SIZE); ++#endif /* _LIBC */ ++ ++#ifdef WCHAR ++ p[1] = (UCHAR_T) no_op; ++#else ++ p[2] = (UCHAR_T) no_op; ++ p[3] = (UCHAR_T) no_op; ++#endif /* WCHAR */ ++ goto on_failure; ++ } ++ break; ++ ++ case jump_n: ++ EXTRACT_NUMBER (mcnt, p + OFFSET_ADDRESS_SIZE); ++ DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt); ++ ++ /* Originally, this is how many times we CAN jump. */ ++ if (mcnt) ++ { ++ mcnt--; ++ STORE_NUMBER (p + OFFSET_ADDRESS_SIZE, mcnt); ++ ++#ifdef _LIBC ++ DEBUG_PRINT3 (" Setting %p to %d.\n", p + OFFSET_ADDRESS_SIZE, ++ mcnt); ++#else ++ DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p + OFFSET_ADDRESS_SIZE, ++ mcnt); ++#endif /* _LIBC */ ++ goto unconditional_jump; ++ } ++ /* If don't have to jump any more, skip over the rest of command. */ ++ else ++ p += 2 * OFFSET_ADDRESS_SIZE; ++ break; ++ ++ case set_number_at: ++ { ++ DEBUG_PRINT1 ("EXECUTING set_number_at.\n"); ++ ++ EXTRACT_NUMBER_AND_INCR (mcnt, p); ++ p1 = p + mcnt; ++ EXTRACT_NUMBER_AND_INCR (mcnt, p); ++#ifdef _LIBC ++ DEBUG_PRINT3 (" Setting %p to %d.\n", p1, mcnt); ++#else ++ DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt); ++#endif ++ STORE_NUMBER (p1, mcnt); ++ break; ++ } ++ ++#if 0 ++ /* The DEC Alpha C compiler 3.x generates incorrect code for the ++ test WORDCHAR_P (d - 1) != WORDCHAR_P (d) in the expansion of ++ AT_WORD_BOUNDARY, so this code is disabled. Expanding the ++ macro and introducing temporary variables works around the bug. */ ++ ++ case wordbound: ++ DEBUG_PRINT1 ("EXECUTING wordbound.\n"); ++ if (AT_WORD_BOUNDARY (d)) ++ break; ++ goto fail; ++ ++ case notwordbound: ++ DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); ++ if (AT_WORD_BOUNDARY (d)) ++ goto fail; ++ break; ++#else ++ case wordbound: ++ { ++ boolean prevchar, thischar; ++ ++ DEBUG_PRINT1 ("EXECUTING wordbound.\n"); ++ if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) ++ break; ++ ++ prevchar = WORDCHAR_P (d - 1); ++ thischar = WORDCHAR_P (d); ++ if (prevchar != thischar) ++ break; ++ goto fail; ++ } ++ ++ case notwordbound: ++ { ++ boolean prevchar, thischar; ++ ++ DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); ++ if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) ++ goto fail; ++ ++ prevchar = WORDCHAR_P (d - 1); ++ thischar = WORDCHAR_P (d); ++ if (prevchar != thischar) ++ goto fail; ++ break; ++ } ++#endif ++ ++ case wordbeg: ++ DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); ++ if (!AT_STRINGS_END (d) && WORDCHAR_P (d) ++ && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1))) ++ break; ++ goto fail; ++ ++ case wordend: ++ DEBUG_PRINT1 ("EXECUTING wordend.\n"); ++ if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1) ++ && (AT_STRINGS_END (d) || !WORDCHAR_P (d))) ++ break; ++ goto fail; ++ ++#ifdef emacs ++ case before_dot: ++ DEBUG_PRINT1 ("EXECUTING before_dot.\n"); ++ if (PTR_CHAR_POS ((unsigned char *) d) >= point) ++ goto fail; ++ break; ++ ++ case at_dot: ++ DEBUG_PRINT1 ("EXECUTING at_dot.\n"); ++ if (PTR_CHAR_POS ((unsigned char *) d) != point) ++ goto fail; ++ break; ++ ++ case after_dot: ++ DEBUG_PRINT1 ("EXECUTING after_dot.\n"); ++ if (PTR_CHAR_POS ((unsigned char *) d) <= point) ++ goto fail; ++ break; ++ ++ case syntaxspec: ++ DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt); ++ mcnt = *p++; ++ goto matchsyntax; ++ ++ case wordchar: ++ DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n"); ++ mcnt = (int) Sword; ++ matchsyntax: ++ PREFETCH (); ++ /* Can't use *d++ here; SYNTAX may be an unsafe macro. */ ++ d++; ++ if (SYNTAX (d[-1]) != (enum syntaxcode) mcnt) ++ goto fail; ++ SET_REGS_MATCHED (); ++ break; ++ ++ case notsyntaxspec: ++ DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt); ++ mcnt = *p++; ++ goto matchnotsyntax; ++ ++ case notwordchar: ++ DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n"); ++ mcnt = (int) Sword; ++ matchnotsyntax: ++ PREFETCH (); ++ /* Can't use *d++ here; SYNTAX may be an unsafe macro. */ ++ d++; ++ if (SYNTAX (d[-1]) == (enum syntaxcode) mcnt) ++ goto fail; ++ SET_REGS_MATCHED (); ++ break; ++ ++#else /* not emacs */ ++ case wordchar: ++ DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n"); ++ PREFETCH (); ++ if (!WORDCHAR_P (d)) ++ goto fail; ++ SET_REGS_MATCHED (); ++ d++; ++ break; ++ ++ case notwordchar: ++ DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n"); ++ PREFETCH (); ++ if (WORDCHAR_P (d)) ++ goto fail; ++ SET_REGS_MATCHED (); ++ d++; ++ break; ++#endif /* not emacs */ ++ ++ default: ++ abort (); ++ } ++ continue; /* Successfully executed one pattern command; keep going. */ ++ ++ ++ /* We goto here if a matching operation fails. */ ++ fail: ++ if (!FAIL_STACK_EMPTY ()) ++ { /* A restart point is known. Restore to that state. */ ++ DEBUG_PRINT1 ("\nFAIL:\n"); ++ POP_FAILURE_POINT (d, p, ++ lowest_active_reg, highest_active_reg, ++ regstart, regend, reg_info); ++ ++ /* If this failure point is a dummy, try the next one. */ ++ if (!p) ++ goto fail; ++ ++ /* If we failed to the end of the pattern, don't examine *p. */ ++ assert (p <= pend); ++ if (p < pend) ++ { ++ boolean is_a_jump_n = false; ++ ++ /* If failed to a backwards jump that's part of a repetition ++ loop, need to pop this failure point and use the next one. */ ++ switch ((re_opcode_t) *p) ++ { ++ case jump_n: ++ is_a_jump_n = true; ++ case maybe_pop_jump: ++ case pop_failure_jump: ++ case jump: ++ p1 = p + 1; ++ EXTRACT_NUMBER_AND_INCR (mcnt, p1); ++ p1 += mcnt; ++ ++ if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n) ++ || (!is_a_jump_n ++ && (re_opcode_t) *p1 == on_failure_jump)) ++ goto fail; ++ break; ++ default: ++ /* do nothing */ ; ++ } ++ } ++ ++ if (d >= string1 && d <= end1) ++ dend = end_match_1; ++ } ++ else ++ break; /* Matching at this starting point really fails. */ ++ } /* for (;;) */ ++ ++ if (best_regs_set) ++ goto restore_best_regs; ++ ++ FREE_VARIABLES (); ++ ++ return -1; /* Failure to match. */ ++} /* re_match_2 */ ++ ++/* Subroutine definitions for re_match_2. */ ++ ++ ++/* We are passed P pointing to a register number after a start_memory. ++ ++ Return true if the pattern up to the corresponding stop_memory can ++ match the empty string, and false otherwise. ++ ++ If we find the matching stop_memory, sets P to point to one past its number. ++ Otherwise, sets P to an undefined byte less than or equal to END. ++ ++ We don't handle duplicates properly (yet). */ ++ ++static boolean ++PREFIX(group_match_null_string_p) (UCHAR_T **p, UCHAR_T *end, ++ PREFIX(register_info_type) *reg_info) ++{ ++ int mcnt; ++ /* Point to after the args to the start_memory. */ ++ UCHAR_T *p1 = *p + 2; ++ ++ while (p1 < end) ++ { ++ /* Skip over opcodes that can match nothing, and return true or ++ false, as appropriate, when we get to one that can't, or to the ++ matching stop_memory. */ ++ ++ switch ((re_opcode_t) *p1) ++ { ++ /* Could be either a loop or a series of alternatives. */ ++ case on_failure_jump: ++ p1++; ++ EXTRACT_NUMBER_AND_INCR (mcnt, p1); ++ ++ /* If the next operation is not a jump backwards in the ++ pattern. */ ++ ++ if (mcnt >= 0) ++ { ++ /* Go through the on_failure_jumps of the alternatives, ++ seeing if any of the alternatives cannot match nothing. ++ The last alternative starts with only a jump, ++ whereas the rest start with on_failure_jump and end ++ with a jump, e.g., here is the pattern for `a|b|c': ++ ++ /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6 ++ /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3 ++ /exactn/1/c ++ ++ So, we have to first go through the first (n-1) ++ alternatives and then deal with the last one separately. */ ++ ++ ++ /* Deal with the first (n-1) alternatives, which start ++ with an on_failure_jump (see above) that jumps to right ++ past a jump_past_alt. */ ++ ++ while ((re_opcode_t) p1[mcnt-(1+OFFSET_ADDRESS_SIZE)] == ++ jump_past_alt) ++ { ++ /* `mcnt' holds how many bytes long the alternative ++ is, including the ending `jump_past_alt' and ++ its number. */ ++ ++ if (!PREFIX(alt_match_null_string_p) (p1, p1 + mcnt - ++ (1 + OFFSET_ADDRESS_SIZE), ++ reg_info)) ++ return false; ++ ++ /* Move to right after this alternative, including the ++ jump_past_alt. */ ++ p1 += mcnt; ++ ++ /* Break if it's the beginning of an n-th alternative ++ that doesn't begin with an on_failure_jump. */ ++ if ((re_opcode_t) *p1 != on_failure_jump) ++ break; ++ ++ /* Still have to check that it's not an n-th ++ alternative that starts with an on_failure_jump. */ ++ p1++; ++ EXTRACT_NUMBER_AND_INCR (mcnt, p1); ++ if ((re_opcode_t) p1[mcnt-(1+OFFSET_ADDRESS_SIZE)] != ++ jump_past_alt) ++ { ++ /* Get to the beginning of the n-th alternative. */ ++ p1 -= 1 + OFFSET_ADDRESS_SIZE; ++ break; ++ } ++ } ++ ++ /* Deal with the last alternative: go back and get number ++ of the `jump_past_alt' just before it. `mcnt' contains ++ the length of the alternative. */ ++ EXTRACT_NUMBER (mcnt, p1 - OFFSET_ADDRESS_SIZE); ++ ++ if (!PREFIX(alt_match_null_string_p) (p1, p1 + mcnt, reg_info)) ++ return false; ++ ++ p1 += mcnt; /* Get past the n-th alternative. */ ++ } /* if mcnt > 0 */ ++ break; ++ ++ ++ case stop_memory: ++ assert (p1[1] == **p); ++ *p = p1 + 2; ++ return true; ++ ++ ++ default: ++ if (!PREFIX(common_op_match_null_string_p) (&p1, end, reg_info)) ++ return false; ++ } ++ } /* while p1 < end */ ++ ++ return false; ++} /* group_match_null_string_p */ ++ ++ ++/* Similar to group_match_null_string_p, but doesn't deal with alternatives: ++ It expects P to be the first byte of a single alternative and END one ++ byte past the last. The alternative can contain groups. */ ++ ++static boolean ++PREFIX(alt_match_null_string_p) (UCHAR_T *p, UCHAR_T *end, ++ PREFIX(register_info_type) *reg_info) ++{ ++ int mcnt; ++ UCHAR_T *p1 = p; ++ ++ while (p1 < end) ++ { ++ /* Skip over opcodes that can match nothing, and break when we get ++ to one that can't. */ ++ ++ switch ((re_opcode_t) *p1) ++ { ++ /* It's a loop. */ ++ case on_failure_jump: ++ p1++; ++ EXTRACT_NUMBER_AND_INCR (mcnt, p1); ++ p1 += mcnt; ++ break; ++ ++ default: ++ if (!PREFIX(common_op_match_null_string_p) (&p1, end, reg_info)) ++ return false; ++ } ++ } /* while p1 < end */ ++ ++ return true; ++} /* alt_match_null_string_p */ ++ ++ ++/* Deals with the ops common to group_match_null_string_p and ++ alt_match_null_string_p. ++ ++ Sets P to one after the op and its arguments, if any. */ ++ ++static boolean ++PREFIX(common_op_match_null_string_p) (UCHAR_T **p, UCHAR_T *end, ++ PREFIX(register_info_type) *reg_info) ++{ ++ int mcnt; ++ boolean ret; ++ int reg_no; ++ UCHAR_T *p1 = *p; ++ ++ switch ((re_opcode_t) *p1++) ++ { ++ case no_op: ++ case begline: ++ case endline: ++ case begbuf: ++ case endbuf: ++ case wordbeg: ++ case wordend: ++ case wordbound: ++ case notwordbound: ++#ifdef emacs ++ case before_dot: ++ case at_dot: ++ case after_dot: ++#endif ++ break; ++ ++ case start_memory: ++ reg_no = *p1; ++ assert (reg_no > 0 && reg_no <= MAX_REGNUM); ++ ret = PREFIX(group_match_null_string_p) (&p1, end, reg_info); ++ ++ /* Have to set this here in case we're checking a group which ++ contains a group and a back reference to it. */ ++ ++ if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE) ++ REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret; ++ ++ if (!ret) ++ return false; ++ break; ++ ++ /* If this is an optimized succeed_n for zero times, make the jump. */ ++ case jump: ++ EXTRACT_NUMBER_AND_INCR (mcnt, p1); ++ if (mcnt >= 0) ++ p1 += mcnt; ++ else ++ return false; ++ break; ++ ++ case succeed_n: ++ /* Get to the number of times to succeed. */ ++ p1 += OFFSET_ADDRESS_SIZE; ++ EXTRACT_NUMBER_AND_INCR (mcnt, p1); ++ ++ if (mcnt == 0) ++ { ++ p1 -= 2 * OFFSET_ADDRESS_SIZE; ++ EXTRACT_NUMBER_AND_INCR (mcnt, p1); ++ p1 += mcnt; ++ } ++ else ++ return false; ++ break; ++ ++ case duplicate: ++ if (!REG_MATCH_NULL_STRING_P (reg_info[*p1])) ++ return false; ++ break; ++ ++ case set_number_at: ++ p1 += 2 * OFFSET_ADDRESS_SIZE; ++ ++ default: ++ /* All other opcodes mean we cannot match the empty string. */ ++ return false; ++ } ++ ++ *p = p1; ++ return true; ++} /* common_op_match_null_string_p */ ++ ++ ++/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN ++ bytes; nonzero otherwise. */ ++ ++static int ++PREFIX(bcmp_translate) (const CHAR_T *s1, const CHAR_T *s2, register int len, ++ RE_TRANSLATE_TYPE translate) ++{ ++ register const UCHAR_T *p1 = (const UCHAR_T *) s1; ++ register const UCHAR_T *p2 = (const UCHAR_T *) s2; ++ while (len) ++ { ++#ifdef WCHAR ++ if (((*p1<=0xff)?translate[*p1++]:*p1++) ++ != ((*p2<=0xff)?translate[*p2++]:*p2++)) ++ return 1; ++#else /* BYTE */ ++ if (translate[*p1++] != translate[*p2++]) return 1; ++#endif /* WCHAR */ ++ len--; ++ } ++ return 0; ++} ++ ++ ++#else /* not INSIDE_RECURSION */ ++ ++/* Entry points for GNU code. */ ++ ++/* re_compile_pattern is the GNU regular expression compiler: it ++ compiles PATTERN (of length SIZE) and puts the result in BUFP. ++ Returns 0 if the pattern was valid, otherwise an error string. ++ ++ Assumes the `allocated' (and perhaps `buffer') and `translate' fields ++ are set in BUFP on entry. ++ ++ We call regex_compile to do the actual compilation. */ ++ ++const char * ++re_compile_pattern (const char *pattern, size_t length, ++ struct re_pattern_buffer *bufp) ++{ ++ reg_errcode_t ret; ++ ++ /* GNU code is written to assume at least RE_NREGS registers will be set ++ (and at least one extra will be -1). */ ++ bufp->regs_allocated = REGS_UNALLOCATED; ++ ++ /* And GNU code determines whether or not to get register information ++ by passing null for the REGS argument to re_match, etc., not by ++ setting no_sub. */ ++ bufp->no_sub = 0; ++ ++ /* Match anchors at newline. */ ++ bufp->newline_anchor = 1; ++ ++# ifdef MBS_SUPPORT ++ if (MB_CUR_MAX != 1) ++ ret = wcs_regex_compile (pattern, length, re_syntax_options, bufp); ++ else ++# endif ++ ret = byte_regex_compile (pattern, length, re_syntax_options, bufp); ++ ++ if (!ret) ++ return NULL; ++ return gettext (re_error_msgid[(int) ret]); ++} ++#ifdef _LIBC ++weak_alias (__re_compile_pattern, re_compile_pattern) ++#endif ++ ++/* Entry points compatible with 4.2 BSD regex library. We don't define ++ them unless specifically requested. */ ++ ++#if defined _REGEX_RE_COMP || defined _LIBC ++ ++/* BSD has one and only one pattern buffer. */ ++static struct re_pattern_buffer re_comp_buf; ++ ++char * ++#ifdef _LIBC ++/* Make these definitions weak in libc, so POSIX programs can redefine ++ these names if they don't use our functions, and still use ++ regcomp/regexec below without link errors. */ ++weak_function ++#endif ++re_comp (const char *s) ++{ ++ reg_errcode_t ret; ++ ++ if (!s) ++ { ++ if (!re_comp_buf.buffer) ++ return (char *) gettext ("No previous regular expression"); ++ return 0; ++ } ++ ++ if (!re_comp_buf.buffer) ++ { ++ re_comp_buf.buffer = (unsigned char *) malloc (200); ++ if (re_comp_buf.buffer == NULL) ++ return (char *) gettext (re_error_msgid[(int) REG_ESPACE]); ++ re_comp_buf.allocated = 200; ++ ++ re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH); ++ if (re_comp_buf.fastmap == NULL) ++ return (char *) gettext (re_error_msgid[(int) REG_ESPACE]); ++ } ++ ++ /* Since `re_exec' always passes NULL for the `regs' argument, we ++ don't need to initialize the pattern buffer fields which affect it. */ ++ ++ /* Match anchors at newlines. */ ++ re_comp_buf.newline_anchor = 1; ++ ++# ifdef MBS_SUPPORT ++ if (MB_CUR_MAX != 1) ++ ret = wcs_regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); ++ else ++# endif ++ ret = byte_regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); ++ ++ if (!ret) ++ return NULL; ++ ++ /* Yes, we're discarding `const' here if !HAVE_LIBINTL. */ ++ return (char *) gettext (re_error_msgid[(int) ret]); ++} ++ ++ ++int ++#ifdef _LIBC ++weak_function ++#endif ++re_exec (const char *s) ++{ ++ const int len = strlen (s); ++ return ++ 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0); ++} ++ ++#endif /* _REGEX_RE_COMP */ ++ ++/* POSIX.2 functions. Don't define these for Emacs. */ ++ ++#ifndef emacs ++ ++/* regcomp takes a regular expression as a string and compiles it. ++ ++ PREG is a regex_t *. We do not expect any fields to be initialized, ++ since POSIX says we shouldn't. Thus, we set ++ ++ `buffer' to the compiled pattern; ++ `used' to the length of the compiled pattern; ++ `syntax' to RE_SYNTAX_POSIX_EXTENDED if the ++ REG_EXTENDED bit in CFLAGS is set; otherwise, to ++ RE_SYNTAX_POSIX_BASIC; ++ `newline_anchor' to REG_NEWLINE being set in CFLAGS; ++ `fastmap' to an allocated space for the fastmap; ++ `fastmap_accurate' to zero; ++ `re_nsub' to the number of subexpressions in PATTERN. ++ ++ PATTERN is the address of the pattern string. ++ ++ CFLAGS is a series of bits which affect compilation. ++ ++ If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we ++ use POSIX basic syntax. ++ ++ If REG_NEWLINE is set, then . and [^...] don't match newline. ++ Also, regexec will try a match beginning after every newline. ++ ++ If REG_ICASE is set, then we considers upper- and lowercase ++ versions of letters to be equivalent when matching. ++ ++ If REG_NOSUB is set, then when PREG is passed to regexec, that ++ routine will report only success or failure, and nothing about the ++ registers. ++ ++ It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for ++ the return codes and their meanings.) */ ++ ++int ++regcomp (regex_t *preg, const char *pattern, int cflags) ++{ ++ reg_errcode_t ret; ++ reg_syntax_t syntax ++ = (cflags & REG_EXTENDED) ? ++ RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC; ++ ++ /* regex_compile will allocate the space for the compiled pattern. */ ++ preg->buffer = 0; ++ preg->allocated = 0; ++ preg->used = 0; ++ ++ /* Try to allocate space for the fastmap. */ ++ preg->fastmap = (char *) malloc (1 << BYTEWIDTH); ++ ++ if (cflags & REG_ICASE) ++ { ++ int i; ++ ++ preg->translate ++ = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE ++ * sizeof (*(RE_TRANSLATE_TYPE)0)); ++ if (preg->translate == NULL) ++ return (int) REG_ESPACE; ++ ++ /* Map uppercase characters to corresponding lowercase ones. */ ++ for (i = 0; i < CHAR_SET_SIZE; i++) ++ preg->translate[i] = ISUPPER (i) ? TOLOWER (i) : i; ++ } ++ else ++ preg->translate = NULL; ++ ++ /* If REG_NEWLINE is set, newlines are treated differently. */ ++ if (cflags & REG_NEWLINE) ++ { /* REG_NEWLINE implies neither . nor [^...] match newline. */ ++ syntax &= ~RE_DOT_NEWLINE; ++ syntax |= RE_HAT_LISTS_NOT_NEWLINE; ++ /* It also changes the matching behavior. */ ++ preg->newline_anchor = 1; ++ } ++ else ++ preg->newline_anchor = 0; ++ ++ preg->no_sub = !!(cflags & REG_NOSUB); ++ ++ /* POSIX says a null character in the pattern terminates it, so we ++ can use strlen here in compiling the pattern. */ ++# ifdef MBS_SUPPORT ++ if (MB_CUR_MAX != 1) ++ ret = wcs_regex_compile (pattern, strlen (pattern), syntax, preg); ++ else ++# endif ++ ret = byte_regex_compile (pattern, strlen (pattern), syntax, preg); ++ ++ /* POSIX doesn't distinguish between an unmatched open-group and an ++ unmatched close-group: both are REG_EPAREN. */ ++ if (ret == REG_ERPAREN) ret = REG_EPAREN; ++ ++ if (ret == REG_NOERROR && preg->fastmap) ++ { ++ /* Compute the fastmap now, since regexec cannot modify the pattern ++ buffer. */ ++ if (re_compile_fastmap (preg) == -2) ++ { ++ /* Some error occurred while computing the fastmap, just forget ++ about it. */ ++ free (preg->fastmap); ++ preg->fastmap = NULL; ++ } ++ } ++ ++ return (int) ret; ++} ++#ifdef _LIBC ++weak_alias (__regcomp, regcomp) ++#endif ++ ++ ++/* regexec searches for a given pattern, specified by PREG, in the ++ string STRING. ++ ++ If NMATCH is zero or REG_NOSUB was set in the cflags argument to ++ `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at ++ least NMATCH elements, and we set them to the offsets of the ++ corresponding matched substrings. ++ ++ EFLAGS specifies `execution flags' which affect matching: if ++ REG_NOTBOL is set, then ^ does not match at the beginning of the ++ string; if REG_NOTEOL is set, then $ does not match at the end. ++ ++ We return 0 if we find a match and REG_NOMATCH if not. */ ++ ++int ++regexec (const regex_t *preg, const char *string, size_t nmatch, ++ regmatch_t pmatch[], int eflags) ++{ ++ int ret; ++ struct re_registers regs; ++ regex_t private_preg; ++ int len = strlen (string); ++ boolean want_reg_info = !preg->no_sub && nmatch > 0; ++ ++ private_preg = *preg; ++ ++ private_preg.not_bol = !!(eflags & REG_NOTBOL); ++ private_preg.not_eol = !!(eflags & REG_NOTEOL); ++ ++ /* The user has told us exactly how many registers to return ++ information about, via `nmatch'. We have to pass that on to the ++ matching routines. */ ++ private_preg.regs_allocated = REGS_FIXED; ++ ++ if (want_reg_info) ++ { ++ regs.num_regs = nmatch; ++ regs.start = TALLOC (nmatch * 2, regoff_t); ++ if (regs.start == NULL) ++ return (int) REG_NOMATCH; ++ regs.end = regs.start + nmatch; ++ } ++ ++ /* Perform the searching operation. */ ++ ret = re_search (&private_preg, string, len, ++ /* start: */ 0, /* range: */ len, ++ want_reg_info ? ®s : (struct re_registers *) 0); ++ ++ /* Copy the register information to the POSIX structure. */ ++ if (want_reg_info) ++ { ++ if (ret >= 0) ++ { ++ unsigned r; ++ ++ for (r = 0; r < nmatch; r++) ++ { ++ pmatch[r].rm_so = regs.start[r]; ++ pmatch[r].rm_eo = regs.end[r]; ++ } ++ } ++ ++ /* If we needed the temporary register info, free the space now. */ ++ free (regs.start); ++ } ++ ++ /* We want zero return to mean success, unlike `re_search'. */ ++ return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH; ++} ++#ifdef _LIBC ++/* EGLIBC: This is handled in regexec-compat.c. */ ++/*weak_alias (__regexec, regexec)*/ ++#include "regexec-compat.c" ++#endif ++ ++ ++/* Returns a message corresponding to an error code, ERRCODE, returned ++ from either regcomp or regexec. We don't use PREG here. */ ++ ++size_t ++regerror (int errcode, const regex_t *preg __attribute__ ((unused)), ++ char *errbuf, size_t errbuf_size) ++{ ++ const char *msg; ++ size_t msg_size; ++ ++ if (errcode < 0 ++ || errcode >= (int) (sizeof (re_error_msgid) ++ / sizeof (re_error_msgid[0]))) ++ /* Only error codes returned by the rest of the code should be passed ++ to this routine. If we are given anything else, or if other regex ++ code generates an invalid error code, then the program has a bug. ++ Dump core so we can fix it. */ ++ abort (); ++ ++ msg = gettext (re_error_msgid[errcode]); ++ ++ msg_size = strlen (msg) + 1; /* Includes the null. */ ++ ++ if (errbuf_size != 0) ++ { ++ if (msg_size > errbuf_size) ++ { ++#if defined HAVE_MEMPCPY || defined _LIBC ++ *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0'; ++#else ++ memcpy (errbuf, msg, errbuf_size - 1); ++ errbuf[errbuf_size - 1] = 0; ++#endif ++ } ++ else ++ memcpy (errbuf, msg, msg_size); ++ } ++ ++ return msg_size; ++} ++#ifdef _LIBC ++weak_alias (__regerror, regerror) ++#endif ++ ++ ++/* Free dynamically allocated space used by PREG. */ ++ ++void ++regfree (regex_t *preg) ++{ ++ if (preg->buffer != NULL) ++ free (preg->buffer); ++ preg->buffer = NULL; ++ ++ preg->allocated = 0; ++ preg->used = 0; ++ ++ if (preg->fastmap != NULL) ++ free (preg->fastmap); ++ preg->fastmap = NULL; ++ preg->fastmap_accurate = 0; ++ ++ if (preg->translate != NULL) ++ free (preg->translate); ++ preg->translate = NULL; ++} ++#ifdef _LIBC ++weak_alias (__regfree, regfree) ++#endif ++ ++#endif /* not emacs */ ++ ++#endif /* not INSIDE_RECURSION */ ++ ++ ++#undef STORE_NUMBER ++#undef STORE_NUMBER_AND_INCR ++#undef EXTRACT_NUMBER ++#undef EXTRACT_NUMBER_AND_INCR ++ ++#undef DEBUG_PRINT_COMPILED_PATTERN ++#undef DEBUG_PRINT_DOUBLE_STRING ++ ++#undef INIT_FAIL_STACK ++#undef RESET_FAIL_STACK ++#undef DOUBLE_FAIL_STACK ++#undef PUSH_PATTERN_OP ++#undef PUSH_FAILURE_POINTER ++#undef PUSH_FAILURE_INT ++#undef PUSH_FAILURE_ELT ++#undef POP_FAILURE_POINTER ++#undef POP_FAILURE_INT ++#undef POP_FAILURE_ELT ++#undef DEBUG_PUSH ++#undef DEBUG_POP ++#undef PUSH_FAILURE_POINT ++#undef POP_FAILURE_POINT ++ ++#undef REG_UNSET_VALUE ++#undef REG_UNSET ++ ++#undef PATFETCH ++#undef PATFETCH_RAW ++#undef PATUNFETCH ++#undef TRANSLATE ++ ++#undef INIT_BUF_SIZE ++#undef GET_BUFFER_SPACE ++#undef BUF_PUSH ++#undef BUF_PUSH_2 ++#undef BUF_PUSH_3 ++#undef STORE_JUMP ++#undef STORE_JUMP2 ++#undef INSERT_JUMP ++#undef INSERT_JUMP2 ++#undef EXTEND_BUFFER ++#undef GET_UNSIGNED_NUMBER ++#undef FREE_STACK_RETURN ++ ++# undef POINTER_TO_OFFSET ++# undef MATCHING_IN_FRST_STRING ++# undef PREFETCH ++# undef AT_STRINGS_BEG ++# undef AT_STRINGS_END ++# undef WORDCHAR_P ++# undef FREE_VAR ++# undef FREE_VARIABLES ++# undef NO_HIGHEST_ACTIVE_REG ++# undef NO_LOWEST_ACTIVE_REG ++ ++# undef CHAR_T ++# undef UCHAR_T ++# undef COMPILED_BUFFER_VAR ++# undef OFFSET_ADDRESS_SIZE ++# undef CHAR_CLASS_SIZE ++# undef PREFIX ++# undef ARG_PREFIX ++# undef PUT_CHAR ++# undef BYTE ++# undef WCHAR ++ ++# define DEFINED_ONCE +Index: git/pwd/Makefile +=================================================================== +--- git.orig/pwd/Makefile 2014-08-29 20:00:53.316070587 -0700 ++++ git/pwd/Makefile 2014-08-29 20:01:15.232070587 -0700 +@@ -18,6 +18,8 @@ + # + # Sub-makefile for pwd portion of the library. + # ++include ../option-groups.mak ++ + subdir := pwd + + include ../Makeconfig +Index: git/resolv/Makefile +=================================================================== +--- git.orig/resolv/Makefile 2014-08-29 20:00:53.320070587 -0700 ++++ git/resolv/Makefile 2014-08-29 20:01:15.232070587 -0700 +@@ -18,6 +18,8 @@ + # + # Sub-makefile for resolv portion of the library. + # ++include ../option-groups.mak ++ + subdir := resolv + + include ../Makeconfig +@@ -27,20 +29,21 @@ + arpa/nameser.h arpa/nameser_compat.h \ + sys/bitypes.h + +-routines := herror inet_addr inet_ntop inet_pton nsap_addr res_init \ +- res_hconf res_libc res-state ++routines-$(OPTION_EGLIBC_INET) \ ++ += herror inet_addr inet_ntop inet_pton nsap_addr res_init \ ++ res_hconf res_libc res-state + +-tests = tst-aton tst-leaks tst-inet_ntop +-xtests = tst-leaks2 ++tests-$(OPTION_EGLIBC_INET) += tst-aton tst-leaks tst-inet_ntop ++xtests-$(OPTION_EGLIBC_INET) += tst-leaks2 + + generate := mtrace-tst-leaks.out tst-leaks.mtrace tst-leaks2.mtrace + +-extra-libs := libresolv libnss_dns ++extra-libs-$(OPTION_EGLIBC_INET) += libresolv libnss_dns + ifeq ($(have-thread-library),yes) +-extra-libs += libanl +-routines += gai_sigqueue ++extra-libs-$(OPTION_EGLIBC_INET_ANL) += libanl ++routines-$(OPTION_EGLIBC_INET) += gai_sigqueue + endif +-extra-libs-others = $(extra-libs) ++extra-libs-others-y += $(extra-libs-y) + libresolv-routines := gethnamaddr res_comp res_debug \ + res_data res_mkquery res_query res_send \ + inet_net_ntop inet_net_pton inet_neta base64 \ +@@ -60,7 +63,7 @@ + static-only-routines += $(libnss_dns-routines) $(libresolv-routines) + endif + +-ifeq (yesyes,$(build-shared)$(have-thread-library)) ++ifeq (yesyesy,$(build-shared)$(have-thread-library)$(OPTION_EGLIBC_INET_ANL)) + tests: $(objpfx)ga_test + endif + +Index: git/stdio-common/fxprintf.c +=================================================================== +--- git.orig/stdio-common/fxprintf.c 2014-08-29 20:00:53.544070587 -0700 ++++ git/stdio-common/fxprintf.c 2014-08-29 20:01:15.232070587 -0700 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + + int +@@ -37,6 +38,7 @@ + int res; + if (_IO_fwide (fp, 0) > 0) + { ++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + size_t len = strlen (fmt) + 1; + wchar_t wfmt[len]; + for (size_t i = 0; i < len; ++i) +@@ -45,6 +47,9 @@ + wfmt[i] = fmt[i]; + } + res = __vfwprintf (fp, wfmt, ap); ++#else ++ abort(); ++#endif + } + else + res = _IO_vfprintf (fp, fmt, ap); +Index: git/stdio-common/_i18n_number.h +=================================================================== +--- git.orig/stdio-common/_i18n_number.h 2014-08-29 20:00:53.500070587 -0700 ++++ git/stdio-common/_i18n_number.h 2014-08-29 20:01:15.232070587 -0700 +@@ -19,10 +19,13 @@ + #include + #include + #include ++#include + + #include "../locale/outdigits.h" + #include "../locale/outdigitswc.h" + ++#if __OPTION_EGLIBC_LOCALE_CODE ++ + static CHAR_T * + _i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end) + { +@@ -115,3 +118,13 @@ + + return w; + } ++ ++#else ++ ++static CHAR_T * ++_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end) ++{ ++ return w; ++} ++ ++#endif +Index: git/stdio-common/Makefile +=================================================================== +--- git.orig/stdio-common/Makefile 2014-08-29 20:00:53.500070587 -0700 ++++ git/stdio-common/Makefile 2014-08-29 20:01:15.232070587 -0700 +@@ -18,6 +18,8 @@ + # + # Specific makefile for stdio-common. + # ++include ../option-groups.mak ++ + subdir := stdio-common + + include ../Makeconfig +@@ -30,7 +32,7 @@ + vfprintf vprintf printf_fp reg-printf printf-prs printf_fphex \ + reg-modifier reg-type \ + printf_size fprintf printf snprintf sprintf asprintf dprintf \ +- vfwprintf vfscanf vfwscanf \ ++ vfscanf \ + fscanf scanf sscanf \ + perror psignal \ + tmpfile tmpfile64 tmpnam tmpnam_r tempnam tempname \ +@@ -41,23 +43,37 @@ + isoc99_vsscanf \ + psiginfo + +-aux := errlist siglist printf-parsemb printf-parsewc fxprintf ++# Ideally, _itowa and itowa-digits would be in this option group as ++# well, but it is used unconditionally by printf_fp and printf_fphex, ++# and it didn't seem straightforward to disentangle it. ++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) += \ ++ vfwprintf vfwscanf ++ ++aux := errlist siglist printf-parsemb fxprintf ++aux-$(OPTION_POSIX_C_LANG_WIDE_CHAR) += printf-parsewc + + tests := tstscanf test_rdwr test-popen tstgetln test-fseek \ + temptest tst-fileno test-fwrite tst-ungetc tst-ferror \ + xbug errnobug \ + bug1 bug2 bug3 bug4 bug5 bug6 bug7 bug8 bug9 bug10 bug11 bug12 bug13 \ +- tfformat tiformat tllformat tstdiomisc tst-printfsz tst-wc-printf \ ++ tfformat tiformat tllformat tstdiomisc tst-printfsz \ + scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9 scanf10 \ +- scanf11 scanf12 tst-tmpnam tst-cookie tst-obprintf tst-sscanf \ +- tst-swprintf tst-fseek tst-fmemopen test-vfprintf tst-gets \ +- tst-perror tst-sprintf tst-rndseek tst-fdopen tst-fphex bug14 \ ++ scanf11 scanf12 tst-tmpnam tst-cookie tst-obprintf \ ++ scanf11 scanf12 tst-tmpnam tst-cookie tst-obprintf \ ++ tst-fseek tst-fmemopen tst-gets \ ++ tst-sprintf tst-rndseek tst-fdopen tst-fphex \ + tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \ +- tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \ +- bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \ +- scanf16 scanf17 tst-setvbuf1 tst-grouping bug23 bug24 \ +- bug-vfprintf-nargs tst-long-dbl-fphex tst-fphex-wide tst-sprintf3 \ +- bug25 tst-printf-round bug26 ++ tst-fwrite bug16 bug17 tst-sprintf2 bug18 \ ++ bug19 tst-popen2 scanf14 scanf15 bug21 bug22 scanf16 scanf17 \ ++ tst-setvbuf1 bug23 bug24 bug-vfprintf-nargs tst-sprintf3 bug25 \ ++ tst-printf-round bug26 ++ ++tests-$(OPTION_EGLIBC_LOCALE_CODE) \ ++ += tst-sscanf tst-swprintf test-vfprintf bug14 scanf13 tst-grouping ++tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \ ++ += tst-perror bug19a bug20 tst-long-dbl-fphex tst-fphex-wide ++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \ ++ += bug18a tst-swscanf tst-wc-printf + + test-srcs = tst-unbputc tst-printf + +Index: git/stdio-common/printf_fp.c +=================================================================== +--- git.orig/stdio-common/printf_fp.c 2014-08-29 20:00:53.548070587 -0700 ++++ git/stdio-common/printf_fp.c 2014-08-29 20:01:15.232070587 -0700 +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -148,6 +149,10 @@ + wchar_t thousands_sep, int ngroups) + internal_function; + ++/* Ideally, when OPTION_EGLIBC_LOCALE_CODE is disabled, this should do ++ all its work in ordinary characters, rather than doing it in wide ++ characters and then converting at the end. But that is a challenge ++ for another day. */ + + int + ___printf_fp (FILE *fp, +@@ -206,7 +211,14 @@ + mp_limb_t cy; + + /* Nonzero if this is output on a wide character stream. */ ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR + int wide = info->wide; ++#else ++ /* This should never be called on a wide-oriented stream when ++ OPTION_POSIX_C_LANG_WIDE_CHAR is disabled, but the compiler can't ++ be trusted to figure that out. */ ++ const int wide = 0; ++#endif + + /* Buffer in which we produce the output. */ + wchar_t *wbuffer = NULL; +@@ -258,6 +270,7 @@ + + + /* Figure out the decimal point character. */ ++#if __OPTION_EGLIBC_LOCALE_CODE + if (info->extra == 0) + { + decimal = _NL_CURRENT (LC_NUMERIC, DECIMAL_POINT); +@@ -277,7 +290,13 @@ + /* The decimal point character must not be zero. */ + assert (*decimal != '\0'); + assert (decimalwc != L'\0'); ++#else ++ /* Hard-code values from 'C' locale. */ ++ decimal = "."; ++ decimalwc = L'.'; ++#endif + ++#if __OPTION_EGLIBC_LOCALE_CODE + if (info->group) + { + if (info->extra == 0) +@@ -321,6 +340,9 @@ + } + else + grouping = NULL; ++#else ++ grouping = NULL; ++#endif + + /* Fetch the argument value. */ + #ifndef __NO_LONG_DOUBLE_MATH +Index: git/stdio-common/printf_fphex.c +=================================================================== +--- git.orig/stdio-common/printf_fphex.c 2014-08-29 20:00:53.548070587 -0700 ++++ git/stdio-common/printf_fphex.c 2014-08-29 20:01:15.232070587 -0700 +@@ -28,6 +28,7 @@ + #include <_itoa.h> + #include <_itowa.h> + #include ++#include + #include + #include + +@@ -139,10 +140,18 @@ + int done = 0; + + /* Nonzero if this is output on a wide character stream. */ ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR + int wide = info->wide; ++#else ++ /* This should never be called on a wide-oriented stream when ++ OPTION_POSIX_C_LANG_WIDE_CHAR is disabled, but the compiler can't ++ be trusted to figure that out. */ ++ const int wide = 0; ++#endif + + + /* Figure out the decimal point character. */ ++#if __OPTION_EGLIBC_LOCALE_CODE + if (info->extra == 0) + { + decimal = _NL_CURRENT (LC_NUMERIC, DECIMAL_POINT); +@@ -156,6 +165,10 @@ + } + /* The decimal point character must never be zero. */ + assert (*decimal != '\0' && decimalwc != L'\0'); ++#else ++ decimal = "."; ++ decimalwc = L'.'; ++#endif + + + /* Fetch the argument value. */ +Index: git/stdio-common/printf_size.c +=================================================================== +--- git.orig/stdio-common/printf_size.c 2014-08-29 20:00:53.548070587 -0700 ++++ git/stdio-common/printf_size.c 2014-08-29 20:01:15.232070587 -0700 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + + /* This defines make it possible to use the same code for GNU C library and +@@ -116,7 +117,14 @@ + + struct printf_info fp_info; + int done = 0; ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR + int wide = info->wide; ++#else ++ /* This should never be called on a wide-oriented stream when ++ OPTION_POSIX_C_LANG_WIDE_CHAR is disabled, but the compiler can't ++ be trusted to figure that out. */ ++ const int wide = 0; ++#endif + int res; + + /* Fetch the argument value. */ +Index: git/stdio-common/scanf14.c +=================================================================== +--- git.orig/stdio-common/scanf14.c 2014-08-29 20:00:53.548070587 -0700 ++++ git/stdio-common/scanf14.c 2014-08-29 20:01:15.232070587 -0700 +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + + #define FAIL() \ + do { \ +@@ -36,6 +37,7 @@ + FAIL (); + else if (d != 2.25 || memcmp (c, " x", 2) != 0) + FAIL (); ++#if __OPTION_EGLIBC_LOCALE_CODE + if (sscanf (" 3.25S x", "%4aS%3c", &lsp, c) != 2) + FAIL (); + else +@@ -45,6 +47,7 @@ + memset (lsp, 'x', sizeof L"3.25"); + free (lsp); + } ++#endif + if (sscanf ("4.25[0-9.] x", "%a[0-9.]%8c", &sp, c) != 2) + FAIL (); + else +Index: git/stdio-common/tstdiomisc.c +=================================================================== +--- git.orig/stdio-common/tstdiomisc.c 2014-08-29 20:00:53.584070587 -0700 ++++ git/stdio-common/tstdiomisc.c 2014-08-29 20:01:15.232070587 -0700 +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + + static int + t1 (void) +@@ -125,6 +126,7 @@ + printf ("expected \"-inf -INF -inf -INF -inf -INF -inf -INF\", got \"%s\"\n", + buf); + ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR + swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G", + qnanval, qnanval, qnanval, qnanval, + qnanval, qnanval, qnanval, qnanval); +@@ -162,6 +164,7 @@ + result |= wcscmp (wbuf, L"-inf -INF -inf -INF -inf -INF -inf -INF") != 0; + printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n", + wbuf); ++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */ + + lqnanval = NAN; + +@@ -206,6 +209,7 @@ + printf ("expected \"-inf -INF -inf -INF -inf -INF -inf -INF\", got \"%s\"\n", + buf); + ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR + swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), + L"%La %LA %Le %LE %Lf %LF %Lg %LG", + lqnanval, lqnanval, lqnanval, lqnanval, +@@ -250,6 +254,7 @@ + result |= wcscmp (wbuf, L"-inf -INF -inf -INF -inf -INF -inf -INF") != 0; + printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n", + wbuf); ++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */ + + return result; + } +Index: git/stdio-common/tst-popen.c +=================================================================== +--- git.orig/stdio-common/tst-popen.c 2014-08-29 20:00:53.576070587 -0700 ++++ git/stdio-common/tst-popen.c 2014-08-29 20:01:15.232070587 -0700 +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + static int + do_test (void) +@@ -34,12 +35,14 @@ + return 1; + } + ++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + /* POSIX says that pipe streams are byte-oriented. */ + if (fwide (f, 0) >= 0) + { + puts ("popen did not return byte-oriented stream"); + result = 1; + } ++#endif + + if (getline (&line, &len, f) != 5) + { +Index: git/stdio-common/tst-sprintf.c +=================================================================== +--- git.orig/stdio-common/tst-sprintf.c 2014-08-29 20:00:53.580070587 -0700 ++++ git/stdio-common/tst-sprintf.c 2014-08-29 20:01:15.236070587 -0700 +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + + + int +@@ -10,12 +11,14 @@ + char buf[100]; + int result = 0; + ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR + if (sprintf (buf, "%.0ls", L"foo") != 0 + || strlen (buf) != 0) + { + puts ("sprintf (buf, \"%.0ls\", L\"foo\") produced some output"); + result = 1; + } ++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */ + + #define SIZE (1024*70000) + #define STR(x) #x +Index: git/stdio-common/vfprintf.c +=================================================================== +--- git.orig/stdio-common/vfprintf.c 2014-08-29 20:00:53.588070587 -0700 ++++ git/stdio-common/vfprintf.c 2014-08-29 20:01:15.236070587 -0700 +@@ -29,6 +29,7 @@ + #include <_itoa.h> + #include + #include ++#include + + /* This code is shared between the standard stdio implementation found + in GNU C library and the libio implementation originally found in +@@ -138,6 +139,18 @@ + # define EOF WEOF + #endif + ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR ++# define MULTIBYTE_SUPPORT (1) ++#else ++# define MULTIBYTE_SUPPORT (0) ++#endif ++ ++#if __OPTION_EGLIBC_LOCALE_CODE ++# define LOCALE_SUPPORT (1) ++#else ++# define LOCALE_SUPPORT (0) ++#endif ++ + #include "_i18n_number.h" + + /* Include the shared code for parsing the format string. */ +@@ -1123,8 +1136,11 @@ + # define process_string_arg(fspec) \ + LABEL (form_character): \ + /* Character. */ \ +- if (is_long) \ +- goto LABEL (form_wcharacter); \ ++ if (is_long) \ ++ { \ ++ assert (MULTIBYTE_SUPPORT); \ ++ goto LABEL (form_wcharacter); \ ++ } \ + --width; /* Account for the character itself. */ \ + if (!left) \ + PAD (' '); \ +@@ -1137,6 +1153,7 @@ + break; \ + \ + LABEL (form_wcharacter): \ ++ assert (MULTIBYTE_SUPPORT); \ + { \ + /* Wide character. */ \ + char buf[MB_CUR_MAX]; \ +@@ -1203,6 +1220,7 @@ + } \ + else \ + { \ ++ assert (MULTIBYTE_SUPPORT); \ + const wchar_t *s2 = (const wchar_t *) string; \ + mbstate_t mbstate; \ + \ +@@ -1403,7 +1421,9 @@ + LABEL (flag_quote): + group = 1; + +- if (grouping == (const char *) -1) ++ if (! LOCALE_SUPPORT) ++ grouping = NULL; ++ else if (grouping == (const char *) -1) + { + #ifdef COMPILE_WPRINTF + thousands_sep = _NL_CURRENT_WORD (LC_NUMERIC, +@@ -1702,7 +1722,9 @@ + free (workstart); + workstart = NULL; + +- if (grouping == (const char *) -1) ++ if (! LOCALE_SUPPORT) ++ grouping = NULL; ++ else if (grouping == (const char *) -1) + { + #ifdef COMPILE_WPRINTF + thousands_sep = _NL_CURRENT_WORD (LC_NUMERIC, +Index: git/stdio-common/vfscanf.c +=================================================================== +--- git.orig/stdio-common/vfscanf.c 2014-08-29 20:00:53.588070587 -0700 ++++ git/stdio-common/vfscanf.c 2014-08-29 20:01:15.236070587 -0700 +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + + #ifdef __GNUC__ + # define HAVE_LONGLONG +@@ -133,6 +134,12 @@ + # define WINT_T int + #endif + ++#if __OPTION_POSIX_C_LANG_WIDE_CHAR ++# define MULTIBYTE_SUPPORT (1) ++#else ++# define MULTIBYTE_SUPPORT (0) ++#endif ++ + #define encode_error() do { \ + errval = 4; \ + __set_errno (EILSEQ); \ +@@ -316,24 +323,35 @@ + ARGCHECK (s, format); + + { +-#ifndef COMPILE_WSCANF ++#if __OPTION_EGLIBC_LOCALE_CODE && !defined (COMPILE_WSCANF) + struct __locale_data *const curnumeric = loc->__locales[LC_NUMERIC]; + #endif + ++#if __OPTION_EGLIBC_LOCALE_CODE + /* Figure out the decimal point character. */ +-#ifdef COMPILE_WSCANF ++# ifdef COMPILE_WSCANF + decimal = _NL_CURRENT_WORD (LC_NUMERIC, _NL_NUMERIC_DECIMAL_POINT_WC); +-#else ++# else + decimal = curnumeric->values[_NL_ITEM_INDEX (DECIMAL_POINT)].string; +-#endif ++# endif + /* Figure out the thousands separator character. */ +-#ifdef COMPILE_WSCANF ++# ifdef COMPILE_WSCANF + thousands = _NL_CURRENT_WORD (LC_NUMERIC, _NL_NUMERIC_THOUSANDS_SEP_WC); +-#else ++# else + thousands = curnumeric->values[_NL_ITEM_INDEX (THOUSANDS_SEP)].string; + if (*thousands == '\0') + thousands = NULL; +-#endif ++# endif ++#else /* if ! __OPTION_EGLIBC_LOCALE_CODE */ ++ /* Hard-code values from the C locale. */ ++# ifdef COMPILE_WSCANF ++ decimal = L'.'; ++ thousands = L'\0'; ++# else ++ decimal = "."; ++ thousands = NULL; ++# endif ++#endif /* __OPTION_EGLIBC_LOCALE_CODE */ + } + + /* Lock the stream. */ +@@ -385,6 +403,8 @@ + #ifndef COMPILE_WSCANF + if (!isascii ((unsigned char) *f)) + { ++ assert (MULTIBYTE_SUPPORT); ++ + /* Non-ASCII, may be a multibyte. */ + int len = __mbrlen (f, strlen (f), &state); + if (len > 0) +@@ -830,6 +850,8 @@ + } + /* FALLTHROUGH */ + case L_('C'): ++ assert (MULTIBYTE_SUPPORT); ++ + if (width == -1) + width = 1; + +@@ -1172,6 +1194,8 @@ + /* FALLTHROUGH */ + + case L_('S'): ++ assert (MULTIBYTE_SUPPORT); ++ + { + #ifndef COMPILE_WSCANF + mbstate_t cstate; +@@ -1419,10 +1443,17 @@ + const char *mbdigits[10]; + const char *mbdigits_extended[10]; + #endif ++#if __OPTION_EGLIBC_LOCALE_CODE + /* "to_inpunct" is a map from ASCII digits to their + equivalent in locale. This is defined for locales + which use an extra digits set. */ + wctrans_t map = __wctrans ("to_inpunct"); ++#else ++ /* This will always be the case when ++ OPTION_EGLIBC_LOCALE_CODE is disabled, but the ++ compiler can't figure that out. */ ++ wctrans_t map = NULL; ++#endif + int n; + + from_level = 0; +@@ -2088,6 +2119,7 @@ + --width; + } + ++#if __OPTION_EGLIBC_LOCALE_CODE + wctrans_t map; + if (__builtin_expect ((flags & I18N) != 0, 0) + /* Hexadecimal floats make no sense, fixing localized +@@ -2304,6 +2336,7 @@ + ; + #endif + } ++#endif /* __OPTION_EGLIBC_LOCALE_CODE */ + + /* Have we read any character? If we try to read a number + in hexadecimal notation and we have read only the `0x' +@@ -2343,7 +2376,10 @@ + + case L_('['): /* Character class. */ + if (flags & LONG) +- STRING_ARG (wstr, wchar_t, 100); ++ { ++ assert (MULTIBYTE_SUPPORT); ++ STRING_ARG (wstr, wchar_t, 100); ++ } + else + STRING_ARG (str, char, 100); + +@@ -2417,6 +2453,7 @@ + if (flags & LONG) + { + size_t now = read_in; ++ assert (MULTIBYTE_SUPPORT); + #ifdef COMPILE_WSCANF + if (__glibc_unlikely (inchar () == WEOF)) + input_error (); +Index: git/stdlib/Makefile +=================================================================== +--- git.orig/stdlib/Makefile 2014-08-29 20:00:53.588070587 -0700 ++++ git/stdlib/Makefile 2014-08-29 20:01:15.236070587 -0700 +@@ -18,6 +18,8 @@ + # + # Makefile for stdlib routines + # ++include ../option-groups.mak ++ + subdir := stdlib + + include ../Makeconfig +@@ -30,7 +32,7 @@ + alloca.h fmtmsg.h \ + bits/stdlib-bsearch.h + +-routines := \ ++routines-y := \ + atof atoi atol atoll \ + abort \ + bsearch qsort msort \ +@@ -39,7 +41,6 @@ + quick_exit at_quick_exit cxa_at_quick_exit cxa_thread_atexit_impl \ + abs labs llabs \ + div ldiv lldiv \ +- mblen mbstowcs mbtowc wcstombs wctomb \ + random random_r rand rand_r \ + drand48 erand48 lrand48 nrand48 mrand48 jrand48 \ + srand48 seed48 lcong48 \ +@@ -52,9 +53,18 @@ + strtof_l strtod_l strtold_l \ + system canonicalize \ + a64l l64a \ +- rpmatch strfmon strfmon_l getsubopt xpg_basename fmtmsg \ +- strtoimax strtoumax wcstoimax wcstoumax \ ++ getsubopt xpg_basename \ ++ strtoimax strtoumax \ + getcontext setcontext makecontext swapcontext ++routines-$(OPTION_EGLIBC_LOCALE_CODE) += \ ++ strfmon strfmon_l ++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) += \ ++ mblen mbstowcs mbtowc wcstombs wctomb \ ++ wcstoimax wcstoumax ++ifeq (yy,$(OPTION_EGLIBC_LOCALE_CODE)$(OPTION_POSIX_REGEXP)) ++routines-y += rpmatch ++endif ++routines-$(OPTION_EGLIBC_FMTMSG) += fmtmsg + aux = grouping groupingwc tens_in_limb + + # These routines will be omitted from the libc shared object. +@@ -62,20 +72,22 @@ + # linked against when the shared library will be used. + static-only-routines = atexit at_quick_exit + +-test-srcs := tst-fmtmsg +-tests := tst-strtol tst-strtod testmb testrand testsort testdiv \ ++test-srcs-$(OPTION_EGLIBC_FMTMSG) := tst-fmtmsg ++tests := tst-strtol tst-strtod testrand testsort testdiv \ + test-canon test-canon2 tst-strtoll tst-environ \ + tst-xpg-basename tst-random tst-random2 tst-bsearch \ + tst-limits tst-rand48 bug-strtod tst-setcontext \ +- test-a64l tst-qsort tst-system testmb2 bug-strtod2 \ +- tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2 \ +- tst-makecontext tst-strtod4 tst-strtod5 tst-qsort2 \ +- tst-makecontext2 tst-strtod6 tst-unsetenv1 \ +- tst-makecontext3 bug-getcontext bug-fmtmsg1 \ ++ test-a64l tst-qsort tst-system bug-strtod2 \ ++ tst-atof1 tst-atof2 tst-strtod2 tst-rand48-2 \ ++ tst-makecontext tst-qsort2 tst-makecontext2 tst-strtod6 \ ++ tst-unsetenv1 tst-makecontext3 bug-getcontext bug-fmtmsg1 \ + tst-secure-getenv tst-strtod-overflow tst-strtod-round \ + tst-tininess tst-strtod-underflow tst-tls-atexit + tests-static := tst-secure-getenv +- ++tests-$(OPTION_EGLIBC_LOCALE_CODE) \ ++ += tst-strtod3 tst-strtod4 tst-strtod5 testmb2 ++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \ ++ += testmb + modules-names = tst-tls-atexit-lib + + ifeq ($(build-shared),yes) +@@ -115,8 +127,10 @@ + tests-special += $(objpfx)isomac.out + + ifeq ($(run-built-tests),yes) ++ifeq (y,$(OPTION_EGLIBC_FMTMSG)) + tests-special += $(objpfx)tst-fmtmsg.out + endif ++endif + + include ../Rules + +Index: git/stdlib/strtod_l.c +=================================================================== +--- git.orig/stdlib/strtod_l.c 2014-08-29 20:00:53.648070587 -0700 ++++ git/stdlib/strtod_l.c 2014-08-29 20:01:15.236070587 -0700 +@@ -17,6 +17,7 @@ + License along with the GNU C Library; if not, see + . */ + ++#include + #include + + extern double ____strtod_l_internal (const char *, char **, int, __locale_t); +@@ -548,6 +549,7 @@ + /* Used in several places. */ + int cnt; + ++#if __OPTION_EGLIBC_LOCALE_CODE + struct __locale_data *current = loc->__locales[LC_NUMERIC]; + + if (__glibc_unlikely (group)) +@@ -586,6 +588,17 @@ + decimal_len = strlen (decimal); + assert (decimal_len > 0); + #endif ++#else /* if ! __OPTION_EGLIBC_LOCALE_CODE */ ++ /* Hard-code values from the 'C' locale. */ ++ grouping = NULL; ++#ifdef USE_WIDE_CHAR ++ decimal = L'.'; ++# define decimal_len 1 ++#else ++ decimal = "."; ++ decimal_len = 1; ++#endif ++#endif /* __OPTION_EGLIBC_LOCALE_CODE */ + + /* Prepare number representation. */ + exponent = 0; +Index: git/stdlib/tst-strtod.c +=================================================================== +--- git.orig/stdlib/tst-strtod.c 2014-08-29 20:00:53.700070587 -0700 ++++ git/stdlib/tst-strtod.c 2014-08-29 20:01:15.236070587 -0700 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + struct ltest + { +@@ -176,7 +177,9 @@ + + status |= long_dbl (); + ++#if __OPTION_EGLIBC_LOCALE_CODE + status |= locale_test (); ++#endif + + return status ? EXIT_FAILURE : EXIT_SUCCESS; + } +@@ -219,6 +222,7 @@ + return 0; + } + ++#if __OPTION_EGLIBC_LOCALE_CODE + /* Perform a few tests in a locale with thousands separators. */ + static int + locale_test (void) +@@ -276,3 +280,4 @@ + + return result; + } ++#endif /* __OPTION_EGLIBC_LOCALE_CODE */ +Index: git/streams/Makefile +=================================================================== +--- git.orig/streams/Makefile 2014-08-29 20:00:53.712070587 -0700 ++++ git/streams/Makefile 2014-08-29 20:01:15.236070587 -0700 +@@ -18,11 +18,14 @@ + # + # Makefile for streams. + # ++include ../option-groups.mak ++ + subdir := streams + + include ../Makeconfig + + headers = stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h +-routines = isastream getmsg getpmsg putmsg putpmsg fattach fdetach ++routines-$(OPTION_EGLIBC_STREAMS) \ ++ += isastream getmsg getpmsg putmsg putpmsg fattach fdetach + + include ../Rules +Index: git/string/Makefile +=================================================================== +--- git.orig/string/Makefile 2014-08-29 20:00:53.716070587 -0700 ++++ git/string/Makefile 2014-08-29 20:01:15.236070587 -0700 +@@ -18,6 +18,8 @@ + # + # Sub-makefile for string portion of library. + # ++include ../option-groups.mak ++ + subdir := string + + include ../Makeconfig +@@ -39,10 +41,12 @@ + $(addprefix argz-,append count create ctsep next \ + delete extract insert stringify \ + addsep replace) \ +- envz basename \ ++ basename \ + strcoll_l strxfrm_l string-inlines memrchr \ + xpg-strerror strerror_l + ++routines-$(OPTION_EGLIBC_ENVZ) += envz ++ + strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \ + stpcpy stpncpy strcat strchr strcmp strcpy strcspn \ + strlen strncmp strncpy strpbrk strrchr strspn memmem \ +@@ -51,10 +55,12 @@ + tests := tester inl-tester noinl-tester testcopy test-ffs \ + tst-strlen stratcliff tst-svc tst-inlcall \ + bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap \ +- tst-strtok tst-strxfrm bug-strcoll1 tst-strfry \ ++ tst-strtok tst-strfry \ + bug-strtok1 $(addprefix test-,$(strop-tests)) \ +- bug-envz1 tst-strxfrm2 tst-endian tst-svc2 \ +- tst-strtok_r ++ tst-strxfrm2 tst-endian tst-svc2 tst-strtok_r ++tests-$(OPTION_EGLIBC_ENVZ) += bug-envz1 ++tests-$(OPTION_EGLIBC_LOCALE_CODE) \ ++ += tst-strxfrm bug-strcoll1 + + xtests = tst-strcoll-overflow + +Index: git/string/strcoll_l.c +=================================================================== +--- git.orig/string/strcoll_l.c 2014-08-29 20:00:53.744070587 -0700 ++++ git/string/strcoll_l.c 2014-08-29 20:01:15.240070587 -0700 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #ifndef STRING_TYPE + # define STRING_TYPE char +@@ -472,7 +473,11 @@ + STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l) + { + struct __locale_data *current = l->__locales[LC_COLLATE]; ++#if __OPTION_EGLIBC_LOCALE_CODE + uint_fast32_t nrules = current->values[_NL_ITEM_INDEX (_NL_COLLATE_NRULES)].word; ++#else ++ const uint_fast32_t nrules = 0; ++#endif + /* We don't assign the following values right away since it might be + unnecessary in case there are no rules. */ + const unsigned char *rulesets; +Index: git/string/strerror_l.c +=================================================================== +--- git.orig/string/strerror_l.c 2014-08-29 20:00:53.744070587 -0700 ++++ git/string/strerror_l.c 2014-08-29 20:01:15.240070587 -0700 +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + + static __thread char *last_value; +@@ -29,10 +30,14 @@ + static const char * + translate (const char *str, locale_t loc) + { ++#if __OPTION_EGLIBC_LOCALE_CODE + locale_t oldloc = __uselocale (loc); + const char *res = _(str); + __uselocale (oldloc); + return res; ++#else ++ return str; ++#endif + } + + +Index: git/string/strxfrm_l.c +=================================================================== +--- git.orig/string/strxfrm_l.c 2014-08-29 20:00:53.748070587 -0700 ++++ git/string/strxfrm_l.c 2014-08-29 20:01:15.240070587 -0700 +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #ifndef STRING_TYPE + # define STRING_TYPE char +@@ -85,7 +86,11 @@ + STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n, __locale_t l) + { + struct __locale_data *current = l->__locales[LC_COLLATE]; ++#if __OPTION_EGLIBC_LOCALE_CODE + uint_fast32_t nrules = current->values[_NL_ITEM_INDEX (_NL_COLLATE_NRULES)].word; ++#else ++ const uint_fast32_t nrules = 0; ++#endif + /* We don't assign the following values right away since it might be + unnecessary in case there are no rules. */ + const unsigned char *rulesets; +Index: git/string/test-strcmp.c +=================================================================== +--- git.orig/string/test-strcmp.c 2014-08-29 20:00:53.752070587 -0700 ++++ git/string/test-strcmp.c 2014-08-29 20:01:15.240070587 -0700 +@@ -329,34 +329,6 @@ + FOR_EACH_IMPL (impl, 0) + check_result (impl, s1 + i1, s2 + i2, exp_result); + } +- +- /* Test cases where there are multiple zero bytes after the first. */ +- +- for (size_t i = 0; i < 16 + 1; i++) +- { +- s1[i] = 0x00; +- s2[i] = 0x00; +- } +- +- for (size_t i = 0; i < 16; i++) +- { +- int exp_result; +- +- for (int val = 0x01; val < 0x100; val++) +- { +- for (size_t j = 0; j < i; j++) +- { +- s1[j] = val; +- s2[j] = val; +- } +- +- s2[i] = val; +- +- exp_result = SIMPLE_STRCMP (s1, s2); +- FOR_EACH_IMPL (impl, 0) +- check_result (impl, s1, s2, exp_result); +- } +- } + } + + +Index: git/string/tst-strxfrm2.c +=================================================================== +--- git.orig/string/tst-strxfrm2.c 2014-08-29 20:00:53.756070587 -0700 ++++ git/string/tst-strxfrm2.c 2014-08-29 20:01:15.240070587 -0700 +@@ -1,6 +1,7 @@ + #include + #include + #include ++#include + + static int + do_test (void) +@@ -38,6 +39,7 @@ + res = 1; + } + ++#if __OPTION_EGLIBC_LOCALE_CODE + if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL) + { + puts ("setlocale failed"); +@@ -75,6 +77,7 @@ + res = 1; + } + } ++#endif + + return res; + } +Index: git/string/tst-strxfrm.c +=================================================================== +--- git.orig/string/tst-strxfrm.c 2014-08-29 20:00:53.756070587 -0700 ++++ git/string/tst-strxfrm.c 2014-08-29 20:01:15.240070587 -0700 +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + + + char const string[] = ""; +@@ -64,8 +65,10 @@ + int result = 0; + + result |= test ("C"); ++#if __OPTION_EGLIBC_LOCALE_CODE + result |= test ("en_US.ISO-8859-1"); + result |= test ("de_DE.UTF-8"); ++#endif + + return result; + } +Index: git/sunrpc/Makefile +=================================================================== +--- git.orig/sunrpc/Makefile 2014-08-29 20:00:53.760070587 -0700 ++++ git/sunrpc/Makefile 2014-08-29 20:01:15.240070587 -0700 +@@ -18,6 +18,8 @@ + # + # Sub-makefile for sunrpc portion of the library. + # ++include ../option-groups.mak ++ + subdir := sunrpc + + include ../Makeconfig +@@ -55,7 +57,6 @@ + headers-not-in-tirpc = $(addprefix rpc/,key_prot.h rpc_des.h) \ + $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h + headers = rpc/netdb.h +-install-others = $(inst_sysconfdir)/rpc + generated += $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \ + $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen + generated-dirs += rpcsvc +@@ -65,18 +66,28 @@ + endif + + ifeq ($(build-shared),yes) +-need-export-routines := auth_des auth_unix clnt_gen clnt_perr clnt_tcp \ ++need-export-routines-$(OPTION_EGLIBC_SUNRPC) += \ ++ auth_des auth_unix clnt_gen clnt_perr clnt_tcp \ + clnt_udp get_myaddr key_call netname pm_getport \ +- rpc_thread svc svc_tcp svc_udp xcrypt xdr_array xdr \ ++ rpc_thread svc svc_tcp svc_udp xdr_array xdr \ + xdr_intXX_t xdr_mem xdr_ref xdr_sizeof xdr_stdio \ + svc_run + +-routines := auth_none authuxprot bindrsvprt clnt_raw clnt_simp \ ++need-export-routines-y += xcrypt ++ ++need-export-routines := $(need-export-routines-y) ++ ++routines-$(OPTION_EGLIBC_SUNRPC) \ ++ += auth_none authuxprot bindrsvprt clnt_raw clnt_simp \ + rpc_dtable getrpcport pmap_clnt pm_getmaps pmap_prot pmap_prot2 \ + pmap_rmt rpc_prot rpc_common rpc_cmsg svc_auth svc_authux svc_raw \ + svc_simple xdr_float xdr_rec publickey authdes_prot \ +- des_crypt des_impl des_soft key_prot openchild rtime svcauth_des \ +- clnt_unix svc_unix create_xid $(need-export-routines) ++ key_prot openchild rtime svcauth_des \ ++ clnt_unix svc_unix create_xid ++ ++# xdecrypt is also used by nss/nss_files/files-key.c. ++routines-y += des_crypt des_impl des_soft $(need-export-routines) ++ + ifneq ($(link-obsolete-rpc),yes) + # We only add the RPC for compatibility to libc.so. + shared-only-routines = $(routines) +@@ -85,25 +96,28 @@ + + # We do not build rpcinfo anymore. It is not needed for a bootstrap + # and not wanted on complete systems. +-# others := rpcinfo +-# install-sbin := rpcinfo +-install-bin := rpcgen ++# others-$(OPTION_EGLIBC_SUNRPC) += rpcinfo ++# install-sbin-$(OPTION_EGLIBC_SUNRPC) += rpcinfo ++install-bin-$(OPTION_EGLIBC_SUNRPC) += rpcgen + rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \ + rpc_scan.o rpc_util.o rpc_svcout.o rpc_clntout.o \ + rpc_tblout.o rpc_sample.o +-extra-objs = $(rpcgen-objs) $(addprefix cross-,$(rpcgen-objs)) +-others += rpcgen ++extra-objs-$(OPTION_EGLIBC_SUNRPC) = $(rpcgen-objs) $(addprefix cross-,$(rpcgen-objs)) ++others-$(OPTION_EGLIBC_SUNRPC) += rpcgen ++ ++install-others-$(OPTION_EGLIBC_SUNRPC) += $(inst_sysconfdir)/rpc + +-tests = tst-xdrmem tst-xdrmem2 +-xtests := tst-getmyaddr ++tests-$(OPTION_EGLIBC_SUNRPC) = tst-xdrmem tst-xdrmem2 ++xtests-$(OPTION_EGLIBC_SUNRPC) := tst-getmyaddr + + ifeq ($(have-thread-library),yes) +-xtests += thrsvc ++xtests-$(OPTION_EGLIBC_SUNRPC) += thrsvc + endif + + headers += $(rpcsvc:%.x=rpcsvc/%.h) +-extra-libs := librpcsvc +-extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass. ++extra-libs-$(OPTION_EGLIBC_SUNRPC) += librpcsvc ++# Make it in `others' pass, not `lib' pass. ++extra-libs-others-y += $(extra-libs-y) + librpcsvc-routines = $(rpcsvc:%.x=x%) + librpcsvc-inhibit-o = .os # Build no shared rpcsvc library. + omit-deps = $(librpcsvc-routines) +Index: git/sysdeps/generic/ldsodefs.h +=================================================================== +--- git.orig/sysdeps/generic/ldsodefs.h 2014-08-29 20:00:53.904070587 -0700 ++++ git/sysdeps/generic/ldsodefs.h 2014-08-29 20:01:15.240070587 -0700 +@@ -425,6 +425,12 @@ + # undef __rtld_global_attribute__ + #endif + ++#if __OPTION_EGLIBC_RTLD_DEBUG ++# define GLRO_dl_debug_mask GLRO(dl_debug_mask) ++#else ++# define GLRO_dl_debug_mask 0 ++#endif ++ + #ifndef SHARED + # define GLRO(name) _##name + #else +@@ -437,8 +443,10 @@ + { + #endif + ++#if __OPTION_EGLIBC_RTLD_DEBUG + /* If nonzero the appropriate debug information is printed. */ + EXTERN int _dl_debug_mask; ++#endif + #define DL_DEBUG_LIBS (1 << 0) + #define DL_DEBUG_IMPCALLS (1 << 1) + #define DL_DEBUG_BINDINGS (1 << 2) +Index: git/sysdeps/gnu/Makefile +=================================================================== +--- git.orig/sysdeps/gnu/Makefile 2014-08-29 20:00:53.924070587 -0700 ++++ git/sysdeps/gnu/Makefile 2014-08-29 20:01:15.240070587 -0700 +@@ -57,7 +57,8 @@ + endif + + ifeq ($(subdir),login) +-sysdep_routines += setutxent getutxent endutxent getutxid getutxline \ ++sysdep_routines-$(OPTION_EGLIBC_UTMPX) \ ++ += setutxent getutxent endutxent getutxid getutxline \ + pututxline utmpxname updwtmpx getutmpx getutmp + + sysdep_headers += utmpx.h bits/utmpx.h +Index: git/sysdeps/ieee754/ldbl-opt/Makefile +=================================================================== +--- git.orig/sysdeps/ieee754/ldbl-opt/Makefile 2014-08-29 20:00:54.452070587 -0700 ++++ git/sysdeps/ieee754/ldbl-opt/Makefile 2014-08-29 20:01:15.244070587 -0700 +@@ -11,19 +11,18 @@ + routines += math_ldbl_opt nldbl-compat + + extra-libs += libnldbl +-libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \ ++libnldbl-calls = asprintf dprintf fprintf fscanf iovfscanf \ + obstack_printf obstack_vprintf printf scanf snprintf \ +- sprintf sscanf swprintf swscanf vasprintf vdprintf vfprintf \ +- vfscanf vfwprintf vfwscanf vprintf vscanf vsnprintf \ +- vsprintf vsscanf vswprintf vswscanf vwprintf vwscanf \ +- wprintf wscanf printf_fp printf_size \ +- fprintf_chk fwprintf_chk printf_chk snprintf_chk sprintf_chk \ +- swprintf_chk vfprintf_chk vfwprintf_chk vprintf_chk \ +- vsnprintf_chk vsprintf_chk vswprintf_chk vwprintf_chk \ +- wprintf_chk asprintf_chk vasprintf_chk dprintf_chk \ ++ sprintf sscanf vasprintf vdprintf vfprintf \ ++ vfscanf vprintf vscanf vsnprintf \ ++ vsprintf vsscanf \ ++ printf_fp printf_size \ ++ fprintf_chk printf_chk snprintf_chk sprintf_chk \ ++ vfprintf_chk vprintf_chk \ ++ vsnprintf_chk vsprintf_chk \ ++ asprintf_chk vasprintf_chk dprintf_chk \ + vdprintf_chk obstack_printf_chk obstack_vprintf_chk \ + syslog syslog_chk vsyslog vsyslog_chk \ +- strfmon strfmon_l \ + strtold strtold_l strtoldint wcstold wcstold_l wcstoldint \ + qecvt qfcvt qgcvt qecvt_r qfcvt_r \ + isinf isnan finite signbit scalb log2 lgamma_r ceil \ +@@ -38,9 +37,15 @@ + casinh cexp clog cproj csin csinh csqrt ctan ctanh cpow \ + cabs carg cimag creal clog10 \ + isoc99_scanf isoc99_fscanf isoc99_sscanf \ +- isoc99_vscanf isoc99_vfscanf isoc99_vsscanf \ ++ isoc99_vscanf isoc99_vfscanf isoc99_vsscanf ++libnldbl-calls-$(OPTION_EGLIBC_LOCALE_CODE) += strfmon strfmon_l ++libnldbl-calls-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) += fwprintf fwscanf \ ++ swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \ ++ vwprintf vwscanf wprintf wscanf fwprintf_chk swprintf_chk \ ++ vfwprintf_chk vswprintf_chk vwprintf_chk wprintf_chk \ + isoc99_wscanf isoc99_fwscanf isoc99_swscanf \ + isoc99_vwscanf isoc99_vfwscanf isoc99_vswscanf ++libnldbl-calls += $(libnldbl-calls-y) + libnldbl-routines = $(libnldbl-calls:%=nldbl-%) + libnldbl-inhibit-o = $(object-suffixes) + libnldbl-static-only-routines = $(libnldbl-routines) +Index: git/sysdeps/ieee754/ldbl-opt/nldbl-compat.c +=================================================================== +--- git.orig/sysdeps/ieee754/ldbl-opt/nldbl-compat.c 2014-08-29 20:00:54.468070587 -0700 ++++ git/sysdeps/ieee754/ldbl-opt/nldbl-compat.c 2014-08-29 20:01:15.244070587 -0700 +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include "nldbl-compat.h" + +@@ -33,20 +34,14 @@ + libc_hidden_proto (__nldbl_vsscanf) + libc_hidden_proto (__nldbl_vsprintf) + libc_hidden_proto (__nldbl_vfscanf) +-libc_hidden_proto (__nldbl_vfwscanf) + libc_hidden_proto (__nldbl_vdprintf) +-libc_hidden_proto (__nldbl_vswscanf) +-libc_hidden_proto (__nldbl_vfwprintf) +-libc_hidden_proto (__nldbl_vswprintf) + libc_hidden_proto (__nldbl_vsnprintf) + libc_hidden_proto (__nldbl_vasprintf) + libc_hidden_proto (__nldbl_obstack_vprintf) +-libc_hidden_proto (__nldbl___vfwprintf_chk) + libc_hidden_proto (__nldbl___vsnprintf_chk) + libc_hidden_proto (__nldbl___vfprintf_chk) + libc_hidden_proto (__nldbl___vsyslog_chk) + libc_hidden_proto (__nldbl___vsprintf_chk) +-libc_hidden_proto (__nldbl___vswprintf_chk) + libc_hidden_proto (__nldbl___vasprintf_chk) + libc_hidden_proto (__nldbl___vdprintf_chk) + libc_hidden_proto (__nldbl___obstack_vprintf_chk) +@@ -54,8 +49,17 @@ + libc_hidden_proto (__nldbl___vstrfmon_l) + libc_hidden_proto (__nldbl___isoc99_vsscanf) + libc_hidden_proto (__nldbl___isoc99_vfscanf) ++ ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO ++libc_hidden_proto (__nldbl_vfwscanf) ++libc_hidden_proto (__nldbl_vswscanf) ++libc_hidden_proto (__nldbl_vfwprintf) ++libc_hidden_proto (__nldbl_vswprintf) ++libc_hidden_proto (__nldbl___vfwprintf_chk) ++libc_hidden_proto (__nldbl___vswprintf_chk) + libc_hidden_proto (__nldbl___isoc99_vswscanf) + libc_hidden_proto (__nldbl___isoc99_vfwscanf) ++#endif + + static void + __nldbl_cleanup (void *arg) +@@ -117,6 +121,7 @@ + } + weak_alias (__nldbl_fprintf, __nldbl__IO_fprintf) + ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + int + attribute_compat_text_section weak_function + __nldbl_fwprintf (FILE *stream, const wchar_t *fmt, ...) +@@ -130,6 +135,7 @@ + + return done; + } ++#endif + + int + attribute_compat_text_section +@@ -226,6 +232,7 @@ + return done; + } + ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + int + attribute_compat_text_section + __nldbl_swprintf (wchar_t *s, size_t n, const wchar_t *fmt, ...) +@@ -239,6 +246,7 @@ + + return done; + } ++#endif + + int + attribute_compat_text_section weak_function +@@ -264,6 +272,7 @@ + } + libc_hidden_def (__nldbl_vdprintf) + ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + int + attribute_compat_text_section weak_function + __nldbl_vfwprintf (FILE *s, const wchar_t *fmt, va_list ap) +@@ -275,6 +284,7 @@ + return res; + } + libc_hidden_def (__nldbl_vfwprintf) ++#endif + + int + attribute_compat_text_section +@@ -297,6 +307,7 @@ + libc_hidden_def (__nldbl_vsnprintf) + weak_alias (__nldbl_vsnprintf, __nldbl___vsnprintf) + ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + int + attribute_compat_text_section weak_function + __nldbl_vswprintf (wchar_t *string, size_t maxlen, const wchar_t *fmt, +@@ -330,6 +341,7 @@ + + return done; + } ++#endif + + int + attribute_compat_text_section +@@ -419,6 +431,7 @@ + return done; + } + ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + int + attribute_compat_text_section + __nldbl_vfwscanf (FILE *s, const wchar_t *fmt, va_list ap) +@@ -491,6 +504,7 @@ + + return done; + } ++#endif + + int + attribute_compat_text_section +@@ -506,6 +520,7 @@ + return done; + } + ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + int + attribute_compat_text_section + __nldbl___fwprintf_chk (FILE *stream, int flag, const wchar_t *fmt, ...) +@@ -519,6 +534,7 @@ + + return done; + } ++#endif + + int + attribute_compat_text_section +@@ -563,6 +579,7 @@ + return done; + } + ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + int + attribute_compat_text_section + __nldbl___swprintf_chk (wchar_t *s, size_t n, int flag, size_t slen, +@@ -577,6 +594,7 @@ + + return done; + } ++#endif + + int + attribute_compat_text_section +@@ -590,6 +608,7 @@ + } + libc_hidden_def (__nldbl___vfprintf_chk) + ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + int + attribute_compat_text_section + __nldbl___vfwprintf_chk (FILE *s, int flag, const wchar_t *fmt, va_list ap) +@@ -601,6 +620,7 @@ + return res; + } + libc_hidden_def (__nldbl___vfwprintf_chk) ++#endif + + int + attribute_compat_text_section +@@ -635,6 +655,7 @@ + } + libc_hidden_def (__nldbl___vsprintf_chk) + ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + int + attribute_compat_text_section + __nldbl___vswprintf_chk (wchar_t *string, size_t maxlen, int flag, size_t slen, +@@ -668,6 +689,7 @@ + + return done; + } ++#endif + + int + attribute_compat_text_section +@@ -775,6 +797,7 @@ + return ___printf_fp (fp, &info_no_ldbl, args); + } + ++#if __OPTION_EGLIBC_LOCALE_CODE + ssize_t + attribute_compat_text_section + __nldbl_strfmon (char *s, size_t maxsize, const char *format, ...) +@@ -829,6 +852,7 @@ + return res; + } + libc_hidden_def (__nldbl___vstrfmon_l) ++#endif + + void + attribute_compat_text_section +@@ -941,6 +965,7 @@ + return done; + } + ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + int + attribute_compat_text_section + __nldbl___isoc99_vfwscanf (FILE *s, const wchar_t *fmt, va_list ap) +@@ -1014,6 +1039,7 @@ + + return done; + } ++#endif + + #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) + compat_symbol (libc, __nldbl__IO_printf, _IO_printf, GLIBC_2_0); +@@ -1057,6 +1083,7 @@ + compat_symbol (libc, __nldbl___strfmon_l, __strfmon_l, GLIBC_2_1); + #endif + #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_2) ++# ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO + compat_symbol (libc, __nldbl_swprintf, swprintf, GLIBC_2_2); + compat_symbol (libc, __nldbl_vwprintf, vwprintf, GLIBC_2_2); + compat_symbol (libc, __nldbl_wprintf, wprintf, GLIBC_2_2); +@@ -1069,6 +1096,7 @@ + compat_symbol (libc, __nldbl_vswscanf, vswscanf, GLIBC_2_2); + compat_symbol (libc, __nldbl_vwscanf, vwscanf, GLIBC_2_2); + compat_symbol (libc, __nldbl_wscanf, wscanf, GLIBC_2_2); ++# endif + #endif + #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_3) + compat_symbol (libc, __nldbl_strfmon_l, strfmon_l, GLIBC_2_3); +Index: git/sysdeps/ieee754/ldbl-opt/nldbl-compat.h +=================================================================== +--- git.orig/sysdeps/ieee754/ldbl-opt/nldbl-compat.h 2014-08-29 20:00:54.468070587 -0700 ++++ git/sysdeps/ieee754/ldbl-opt/nldbl-compat.h 2014-08-29 20:01:15.244070587 -0700 +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + + /* Declare the __nldbl_NAME function the wrappers call that's in libc.so. */ +@@ -37,19 +38,15 @@ + + NLDBL_DECL (_IO_vfscanf); + NLDBL_DECL (vfscanf); +-NLDBL_DECL (vfwscanf); + NLDBL_DECL (obstack_vprintf); + NLDBL_DECL (vasprintf); + NLDBL_DECL (dprintf); + NLDBL_DECL (vdprintf); + NLDBL_DECL (fprintf); + NLDBL_DECL (vfprintf); +-NLDBL_DECL (vfwprintf); + NLDBL_DECL (vsnprintf); + NLDBL_DECL (vsprintf); + NLDBL_DECL (vsscanf); +-NLDBL_DECL (vswprintf); +-NLDBL_DECL (vswscanf); + NLDBL_DECL (__asprintf); + NLDBL_DECL (asprintf); + NLDBL_DECL (__printf_fp); +@@ -66,12 +63,18 @@ + NLDBL_DECL (__isoc99_vscanf); + NLDBL_DECL (__isoc99_vfscanf); + NLDBL_DECL (__isoc99_vsscanf); ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO ++NLDBL_DECL (vfwscanf); ++NLDBL_DECL (vfwprintf); ++NLDBL_DECL (vswprintf); ++NLDBL_DECL (vswscanf); + NLDBL_DECL (__isoc99_wscanf); + NLDBL_DECL (__isoc99_fwscanf); + NLDBL_DECL (__isoc99_swscanf); + NLDBL_DECL (__isoc99_vwscanf); + NLDBL_DECL (__isoc99_vfwscanf); + NLDBL_DECL (__isoc99_vswscanf); ++#endif + + /* This one does not exist in the normal interface, only + __nldbl___vstrfmon really exists. */ +@@ -82,22 +85,23 @@ + since we don't compile with _FORTIFY_SOURCE. */ + extern int __nldbl___vfprintf_chk (FILE *__restrict, int, + const char *__restrict, _G_va_list); +-extern int __nldbl___vfwprintf_chk (FILE *__restrict, int, +- const wchar_t *__restrict, __gnuc_va_list); + extern int __nldbl___vsprintf_chk (char *__restrict, int, size_t, + const char *__restrict, _G_va_list) __THROW; + extern int __nldbl___vsnprintf_chk (char *__restrict, size_t, int, size_t, + const char *__restrict, _G_va_list) + __THROW; +-extern int __nldbl___vswprintf_chk (wchar_t *__restrict, size_t, int, size_t, +- const wchar_t *__restrict, __gnuc_va_list) +- __THROW; + extern int __nldbl___vasprintf_chk (char **, int, const char *, _G_va_list) + __THROW; + extern int __nldbl___vdprintf_chk (int, int, const char *, _G_va_list); + extern int __nldbl___obstack_vprintf_chk (struct obstack *, int, const char *, + _G_va_list) __THROW; + extern void __nldbl___vsyslog_chk (int, int, const char *, va_list); +- ++#ifdef __OPTION_POSIX_WIDE_CHAR_DEVICE_IO ++extern int __nldbl___vfwprintf_chk (FILE *__restrict, int, ++ const wchar_t *__restrict, __gnuc_va_list); ++extern int __nldbl___vswprintf_chk (wchar_t *__restrict, size_t, int, size_t, ++ const wchar_t *__restrict, __gnuc_va_list) ++ __THROW; ++#endif + + #endif /* __NLDBL_COMPAT_H */ +Index: git/sysdeps/unix/sysv/linux/gethostid.c +=================================================================== +--- git.orig/sysdeps/unix/sysv/linux/gethostid.c 2014-08-29 20:00:58.840070587 -0700 ++++ git/sysdeps/unix/sysv/linux/gethostid.c 2014-08-29 20:01:15.244070587 -0700 +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #define HOSTIDFILE "/etc/hostid" + +@@ -89,6 +90,7 @@ + return id; + } + ++#if __OPTION_EGLIBC_INET + /* Getting from the file was not successful. An intelligent guess for + a unique number of a host is its IP address. Return this. */ + if (__gethostname (hostname, MAXHOSTNAMELEN) < 0 || hostname[0] == '\0') +@@ -115,5 +117,9 @@ + /* For the return value to be not exactly the IP address we do some + bit fiddling. */ + return (int32_t) (in.s_addr << 16 | in.s_addr >> 16); ++#else ++ /* Return an arbitrary value. */ ++ return 0; ++#endif + } + #endif +Index: git/sysdeps/unix/sysv/linux/libc_fatal.c +=================================================================== +--- git.orig/sysdeps/unix/sysv/linux/libc_fatal.c 2014-08-29 20:00:58.980070587 -0700 ++++ git/sysdeps/unix/sysv/linux/libc_fatal.c 2014-08-29 20:01:15.244070587 -0700 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + static bool + writev_for_fatal (int fd, const struct iovec *iov, size_t niov, size_t total) +@@ -40,6 +41,7 @@ + static void + backtrace_and_maps (int do_abort, bool written, int fd) + { ++#if __OPTION_EGLIBC_BACKTRACE + if (do_abort > 1 && written) + { + void *addrs[64]; +@@ -62,6 +64,7 @@ + close_not_cancel_no_status (fd2); + } + } ++#endif /* __OPTION_EGLIBC_BACKTRACE */ + } + #define BEFORE_ABORT backtrace_and_maps + +Index: git/time/Makefile +=================================================================== +--- git.orig/time/Makefile 2014-08-29 20:00:59.504070587 -0700 ++++ git/time/Makefile 2014-08-29 20:01:15.244070587 -0700 +@@ -18,6 +18,8 @@ + # + # Makefile for time routines + # ++include ../option-groups.mak ++ + subdir := time + + include ../Makeconfig +@@ -30,14 +32,20 @@ + tzfile getitimer setitimer \ + stime dysize timegm ftime \ + getdate strptime strptime_l \ +- strftime wcsftime strftime_l wcsftime_l \ ++ strftime strftime_l \ + timespec_get +-aux := era alt_digit lc-time-cleanup ++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \ ++ := wcsftime wcsftime_l ++aux-$(OPTION_EGLIBC_LOCALE_CODE) += alt_digit era lc-time-cleanup + +-tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \ +- tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \ ++tests := test_time clocktest tst-posixtz \ ++ tst-getdate tst-mktime tst-mktime2 tst-strftime \ + tst-mktime3 tst-strptime2 bug-asctime bug-asctime_r bug-mktime1 \ + tst-strptime3 bug-getdate1 tst-strptime-whitespace ++tests-$(OPTION_EGLIBC_LOCALE_CODE) \ ++ += tst-strptime tst-ftime_l ++tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \ ++ += tst_wcsftime + + include ../Rules + +Index: git/time/strftime_l.c +=================================================================== +--- git.orig/time/strftime_l.c 2014-08-29 20:00:59.528070587 -0700 ++++ git/time/strftime_l.c 2014-08-29 20:01:15.244070587 -0700 +@@ -35,6 +35,10 @@ + # include "../locale/localeinfo.h" + #endif + ++#ifdef _LIBC ++# include ++#endif ++ + #if defined emacs && !defined HAVE_BCOPY + # define HAVE_MEMCPY 1 + #endif +@@ -882,7 +886,7 @@ + case L_('C'): + if (modifier == L_('E')) + { +-#if HAVE_STRUCT_ERA_ENTRY ++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY + struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); + if (era) + { +@@ -955,7 +959,7 @@ + + if (modifier == L_('O') && 0 <= number_value) + { +-#ifdef _NL_CURRENT ++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && defined (_NL_CURRENT) + /* Get the locale specific alternate representation of + the number NUMBER_VALUE. If none exist NULL is returned. */ + const CHAR_T *cp = nl_get_alt_digit (number_value +@@ -1260,7 +1264,7 @@ + case L_('Y'): + if (modifier == 'E') + { +-#if HAVE_STRUCT_ERA_ENTRY ++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY + struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); + if (era) + { +@@ -1285,7 +1289,7 @@ + case L_('y'): + if (modifier == L_('E')) + { +-#if HAVE_STRUCT_ERA_ENTRY ++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY + struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); + if (era) + { +Index: git/time/strptime_l.c +=================================================================== +--- git.orig/time/strptime_l.c 2014-08-29 20:00:59.528070587 -0700 ++++ git/time/strptime_l.c 2014-08-29 20:01:15.244070587 -0700 +@@ -29,6 +29,7 @@ + + #ifdef _LIBC + # define HAVE_LOCALTIME_R 0 ++# include + # include "../locale/localeinfo.h" + #endif + +@@ -84,7 +85,7 @@ + if (val < from || val > to) \ + return NULL; \ + } while (0) +-#ifdef _NL_CURRENT ++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && defined (_NL_CURRENT) + # define get_alt_number(from, to, n) \ + ({ \ + __label__ do_normal; \ +@@ -820,6 +821,7 @@ + s.want_xday = 1; + break; + case 'C': ++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE + if (s.decided != raw) + { + if (s.era_cnt >= 0) +@@ -856,10 +858,12 @@ + + s.decided = raw; + } ++#endif + /* The C locale has no era information, so use the + normal representation. */ + goto match_century; + case 'y': ++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE + if (s.decided != raw) + { + get_number(0, 9999, 4); +@@ -918,9 +922,10 @@ + + s.decided = raw; + } +- ++#endif + goto match_year_in_century; + case 'Y': ++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE + if (s.decided != raw) + { + num_eras = _NL_CURRENT_WORD (LC_TIME, +@@ -948,6 +953,7 @@ + + s.decided = raw; + } ++#endif + get_number (0, 9999, 4); + tm->tm_year = val - 1900; + s.want_century = 0; +@@ -1118,6 +1124,7 @@ + tm->tm_year = (s.century - 19) * 100; + } + ++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE + if (s.era_cnt != -1) + { + era = _nl_select_era_entry (s.era_cnt HELPER_LOCALE_ARG); +@@ -1132,6 +1139,7 @@ + tm->tm_year = era->start_date[0]; + } + else ++#endif + if (s.want_era) + { + /* No era found but we have seen an E modifier. Rectify some +Index: git/timezone/Makefile +=================================================================== +--- git.orig/timezone/Makefile 2014-08-29 20:01:14.044070587 -0700 ++++ git/timezone/Makefile 2014-08-29 20:01:15.244070587 -0700 +@@ -115,7 +115,7 @@ + + $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make + sed -e 's|/bin/bash|/bin/sh|' \ +- -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \ ++ -e '/TZDIR=/s|\$$(pwd)|$(zonedir)|' \ + -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \ + -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \ + -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \ +Index: git/wcsmbs/Makefile +=================================================================== +--- git.orig/wcsmbs/Makefile 2014-08-29 20:00:59.548070587 -0700 ++++ git/wcsmbs/Makefile 2014-08-29 20:01:15.244070587 -0700 +@@ -18,15 +18,21 @@ + # + # Sub-makefile for wcsmbs portion of the library. + # ++include ../option-groups.mak ++ + subdir := wcsmbs + + include ../Makeconfig + + headers := wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h + +-routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ ++# These functions are used by printf_fp.c, even in the plain case; see ++# comments there for OPTION_EGLIBC_LOCALE_CODE. ++routines := wmemcpy wmemset ++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \ ++ := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ + wcsncmp wcsncpy wcspbrk wcsrchr wcsspn wcstok wcsstr wmemchr \ +- wmemcmp wmemcpy wmemmove wmemset wcpcpy wcpncpy wmempcpy \ ++ wmemcmp wmemmove wcpcpy wcpncpy wmempcpy \ + btowc wctob mbsinit \ + mbrlen mbrtowc wcrtomb mbsrtowcs wcsrtombs \ + mbsnrtowcs wcsnrtombs wcsnlen wcschrnul \ +@@ -38,14 +44,19 @@ + wcscoll_l wcsxfrm_l \ + wcscasecmp wcsncase wcscasecmp_l wcsncase_l \ + wcsmbsload mbsrtowcs_l \ +- isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf \ + isoc99_swscanf isoc99_vswscanf \ + mbrtoc16 c16rtomb ++routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \ ++ += isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf + + strop-tests := wcscmp wmemcmp wcslen wcschr wcsrchr wcscpy +-tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ +- tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ +- tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) ++tests := tst-wchar-h ++tests-$(OPTION_EGLIBC_LOCALE_CODE) \ ++ += tst-btowc tst-mbrtowc tst-mbrtowc2 tst-wcrtomb tst-c16c32-1 ++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \ ++ += tst-wcstof wcsmbs-tst1 tst-wcsnlen \ ++ tst-wcpncpy tst-mbsrtowcs \ ++ wcsatcliff $(addprefix test-,$(strop-tests)) + tests-ifunc := $(strop-tests:%=test-%-ifunc) + tests += $(tests-ifunc) + +Index: git/wcsmbs/wcsmbsload.c +=================================================================== +--- git.orig/wcsmbs/wcsmbsload.c 2014-08-29 20:00:59.580070587 -0700 ++++ git/wcsmbs/wcsmbsload.c 2014-08-29 20:01:15.248070587 -0700 +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -143,6 +144,7 @@ + }) + + ++#if __OPTION_EGLIBC_LOCALE_CODE + /* Some of the functions here must not be used while setlocale is called. */ + __libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden) + +@@ -211,6 +213,17 @@ + + __libc_rwlock_unlock (__libc_setlocale_lock); + } ++#else ++void ++internal_function ++__wcsmbs_load_conv (struct __locale_data *new_category) ++{ ++ /* When OPTION_EGLIBC_LOCALE_CODE is disabled, we should never reach ++ this point: there is no way to change locales, so every locale ++ passed to get_gconv_fcts should be _nl_C_LC_CTYPE. */ ++ abort (); ++} ++#endif + + + /* Clone the current conversion function set. */ +Index: git/wctype/Makefile +=================================================================== +--- git.orig/wctype/Makefile 2014-08-29 20:00:59.584070587 -0700 ++++ git/wctype/Makefile 2014-08-29 20:01:15.248070587 -0700 +@@ -18,14 +18,20 @@ + # + # Sub-makefile for wctype portion of the library. + # ++include ../option-groups.mak ++ + subdir := wctype + + include ../Makeconfig + + headers := wctype.h +-routines := wcfuncs wctype iswctype wctrans towctrans \ +- wcfuncs_l wctype_l iswctype_l wctrans_l towctrans_l ++routines := wctrans towctrans towctrans_l ++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \ ++ := wcfuncs wctype iswctype \ ++ wcfuncs_l wctype_l iswctype_l wctrans_l + +-tests := test_wctype test_wcfuncs bug-wctypeh ++tests := ++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \ ++ += test_wctype test_wcfuncs bug-wctypeh + + include ../Rules +Index: git/sysdeps/nptl/Makefile +=================================================================== +--- git.orig/sysdeps/nptl/Makefile 2014-08-29 20:00:58.036070587 -0700 ++++ git/sysdeps/nptl/Makefile 2014-08-29 20:01:15.248070587 -0700 +@@ -18,6 +18,9 @@ + + ifeq ($(subdir),nptl) + libpthread-sysdep_routines += errno-loc ++ifeq ($(OPTION_EGLIBC_BIG_MACROS),n) ++sysdep_routines += small-macros-fns ++endif + endif + + ifeq ($(subdir),rt) +Index: git/sysdeps/nptl/bits/libc-lock.h +=================================================================== +--- git.orig/sysdeps/nptl/bits/libc-lock.h 2014-08-29 20:00:58.036070587 -0700 ++++ git/sysdeps/nptl/bits/libc-lock.h 2014-08-29 20:01:15.248070587 -0700 +@@ -24,6 +24,14 @@ + #include + + ++#ifdef _LIBC ++# include ++# include ++# include ++# include /* For EBUSY. */ ++# include /* For __OPTION_EGLIBC_BIG_MACROS. */ ++#endif ++ + /* Mutex type. */ + #if defined _LIBC || defined _IO_MTSAFE_IO + # if (defined NOT_IN_libc && !defined IS_IN_libpthread) || !defined _LIBC +@@ -87,6 +95,14 @@ + + /* Lock the recursive named lock variable. */ + #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread) ++# if __OPTION_EGLIBC_BIG_MACROS != 1 ++/* EGLIBC: Declare wrapper function for a big macro if either ++ !__OPTION_EGLIBC_BIG_MACROS or we are using a back door from ++ small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2). */ ++extern void __libc_lock_lock_recursive_fn (__libc_lock_recursive_t *); ++libc_hidden_proto (__libc_lock_lock_recursive_fn); ++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */ ++# if __OPTION_EGLIBC_BIG_MACROS + # define __libc_lock_lock_recursive(NAME) \ + do { \ + void *self = THREAD_SELF; \ +@@ -97,6 +113,10 @@ + } \ + ++(NAME).cnt; \ + } while (0) ++# else ++# define __libc_lock_lock_recursive(NAME) \ ++ __libc_lock_lock_recursive_fn (&(NAME)) ++# endif /* __OPTION_EGLIBC_BIG_MACROS */ + #else + # define __libc_lock_lock_recursive(NAME) \ + __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0) +@@ -104,6 +124,14 @@ + + /* Try to lock the recursive named lock variable. */ + #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread) ++# if __OPTION_EGLIBC_BIG_MACROS != 1 ++/* EGLIBC: Declare wrapper function for a big macro if either ++ !__OPTION_EGLIBC_BIG_MACROS or we are using a back door from ++ small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2). */ ++extern int __libc_lock_trylock_recursive_fn (__libc_lock_recursive_t *); ++libc_hidden_proto (__libc_lock_trylock_recursive_fn); ++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */ ++# if __OPTION_EGLIBC_BIG_MACROS + # define __libc_lock_trylock_recursive(NAME) \ + ({ \ + int result = 0; \ +@@ -122,6 +150,10 @@ + ++(NAME).cnt; \ + result; \ + }) ++# else ++# define __libc_lock_trylock_recursive(NAME) \ ++ __libc_lock_trylock_recursive_fn (&(NAME)) ++# endif /* __OPTION_EGLIBC_BIG_MACROS */ + #else + # define __libc_lock_trylock_recursive(NAME) \ + __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0) +@@ -129,6 +161,14 @@ + + /* Unlock the recursive named lock variable. */ + #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread) ++# if __OPTION_EGLIBC_BIG_MACROS != 1 ++/* EGLIBC: Declare wrapper function for a big macro if either ++ !__OPTION_EGLIBC_BIG_MACROS, or we are using a back door from ++ small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2). */ ++extern void __libc_lock_unlock_recursive_fn (__libc_lock_recursive_t *); ++libc_hidden_proto (__libc_lock_unlock_recursive_fn); ++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */ ++# if __OPTION_EGLIBC_BIG_MACROS + /* We do no error checking here. */ + # define __libc_lock_unlock_recursive(NAME) \ + do { \ +@@ -138,6 +178,10 @@ + lll_unlock ((NAME).lock, LLL_PRIVATE); \ + } \ + } while (0) ++# else ++# define __libc_lock_unlock_recursive(NAME) \ ++ __libc_lock_unlock_recursive_fn (&(NAME)) ++# endif /* __OPTION_EGLIBC_BIG_MACROS */ + #else + # define __libc_lock_unlock_recursive(NAME) \ + __libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0) +Index: git/sysdeps/nptl/bits/libc-lockP.h +=================================================================== +--- git.orig/sysdeps/nptl/bits/libc-lockP.h 2014-08-29 20:00:58.044070587 -0700 ++++ git/sysdeps/nptl/bits/libc-lockP.h 2014-08-29 20:01:15.248070587 -0700 +@@ -33,6 +33,8 @@ + #include + #include + #include ++#include /* For EBUSY. */ ++#include /* For __OPTION_EGLIBC_BIG_MACROS. */ + + /* Mutex type. */ + #if defined NOT_IN_libc && !defined IS_IN_libpthread +@@ -159,10 +161,22 @@ + + /* Lock the named lock variable. */ + #if !defined NOT_IN_libc || defined IS_IN_libpthread +-# ifndef __libc_lock_lock +-# define __libc_lock_lock(NAME) \ ++# if __OPTION_EGLIBC_BIG_MACROS != 1 ++/* EGLIBC: Declare wrapper function for a big macro if either ++ !__OPTION_EGLIBC_BIG_MACROS or we are using a back door from ++ small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2). */ ++extern void __libc_lock_lock_fn (__libc_lock_t *); ++libc_hidden_proto (__libc_lock_lock_fn); ++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */ ++# if __OPTION_EGLIBC_BIG_MACROS ++# ifndef __libc_lock_lock ++# define __libc_lock_lock(NAME) \ + ({ lll_lock (NAME, LLL_PRIVATE); 0; }) +-# endif ++# endif ++# else ++# define __libc_lock_lock(NAME) \ ++ __libc_lock_lock_fn (&(NAME)) ++# endif /* __OPTION_EGLIBC_BIG_MACROS */ + #else + # undef __libc_lock_lock + # define __libc_lock_lock(NAME) \ +@@ -175,10 +189,22 @@ + + /* Try to lock the named lock variable. */ + #if !defined NOT_IN_libc || defined IS_IN_libpthread +-# ifndef __libc_lock_trylock +-# define __libc_lock_trylock(NAME) \ ++# if __OPTION_EGLIBC_BIG_MACROS != 1 ++/* EGLIBC: Declare wrapper function for a big macro if either ++ !__OPTION_EGLIBC_BIG_MACROS or we are using a back door from ++ small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2). */ ++extern int __libc_lock_trylock_fn (__libc_lock_t *); ++libc_hidden_proto (__libc_lock_trylock_fn); ++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */ ++# if __OPTION_EGLIBC_BIG_MACROS ++# ifndef __libc_lock_trylock ++# define __libc_lock_trylock(NAME) \ + lll_trylock (NAME) +-# endif ++# endif ++# else ++# define __libc_lock_trylock(NAME) \ ++ __libc_lock_trylock_fn (&(NAME)) ++# endif /* __OPTION_EGLIBC_BIG_MACROS */ + #else + # undef __libc_lock_trylock + # define __libc_lock_trylock(NAME) \ +@@ -194,8 +220,20 @@ + + /* Unlock the named lock variable. */ + #if !defined NOT_IN_libc || defined IS_IN_libpthread ++# if __OPTION_EGLIBC_BIG_MACROS != 1 ++/* EGLIBC: Declare wrapper function for a big macro if either ++ !__OPTION_EGLIBC_BIG_MACROS, or we are using a back door from ++ small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2). */ ++extern void __libc_lock_unlock_fn (__libc_lock_t *); ++libc_hidden_proto (__libc_lock_unlock_fn); ++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */ ++# if __OPTION_EGLIBC_BIG_MACROS + # define __libc_lock_unlock(NAME) \ + lll_unlock (NAME, LLL_PRIVATE) ++# else ++# define __libc_lock_unlock(NAME) \ ++ __libc_lock_unlock_fn (&(NAME)) ++# endif /* __OPTION_EGLIBC_BIG_MACROS */ + #else + # define __libc_lock_unlock(NAME) \ + __libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0) +Index: git/sysdeps/nptl/small-macros-fns.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/nptl/small-macros-fns.c 2014-08-29 20:01:15.248070587 -0700 +@@ -0,0 +1,72 @@ ++/* EGLIBC: function wrappers for big macros. ++ Copyright (C) 2009 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2.1 of the ++ License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; see the file COPYING.LIB. If not, ++ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ++ Boston, MA 02111-1307, USA. */ ++ ++#include ++ ++/* Handle macros from ./bits/libc-lock.h. */ ++#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread) ++ ++/* Get the macros for function bodies through a back door. */ ++# undef __OPTION_EGLIBC_BIG_MACROS ++# define __OPTION_EGLIBC_BIG_MACROS 2 ++# include ++ ++void ++__libc_lock_lock_fn (__libc_lock_t *name) ++{ ++ __libc_lock_lock (*name); ++} ++libc_hidden_def (__libc_lock_lock_fn); ++ ++void ++__libc_lock_lock_recursive_fn (__libc_lock_recursive_t *name) ++{ ++ __libc_lock_lock_recursive (*name); ++} ++libc_hidden_def (__libc_lock_lock_recursive_fn); ++ ++int ++__libc_lock_trylock_fn (__libc_lock_t *name) ++{ ++ return __libc_lock_trylock (*name); ++} ++libc_hidden_def (__libc_lock_trylock_fn); ++ ++int ++__libc_lock_trylock_recursive_fn (__libc_lock_recursive_t *name) ++{ ++ return __libc_lock_trylock_recursive (*name); ++} ++libc_hidden_def (__libc_lock_trylock_recursive_fn); ++ ++void ++__libc_lock_unlock_fn (__libc_lock_t *name) ++{ ++ __libc_lock_unlock (*name); ++} ++libc_hidden_def (__libc_lock_unlock_fn); ++ ++void ++__libc_lock_unlock_recursive_fn (__libc_lock_recursive_t *name) ++{ ++ __libc_lock_unlock_recursive (*name); ++} ++libc_hidden_def (__libc_lock_unlock_recursive_fn); ++ ++#endif /*defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)*/ +Index: git/include/libc-symbols.h +=================================================================== +--- git.orig/include/libc-symbols.h 2014-08-29 20:00:47.144070587 -0700 ++++ git/include/libc-symbols.h 2014-08-29 20:01:15.248070587 -0700 +@@ -60,8 +60,11 @@ + /* Define these macros for the benefit of portable GNU code that wants to check + them. Of course, STDC_HEADERS is never false when building libc! */ + #define STDC_HEADERS 1 +-#define HAVE_MBSTATE_T 1 +-#define HAVE_MBSRTOWCS 1 ++ ++#if __OPTION_EGLIBC_LOCALE_CODE ++# define HAVE_MBSTATE_T 1 ++# define HAVE_MBSRTOWCS 1 ++#endif + #define HAVE_LIBINTL_H 1 + #define HAVE_WCTYPE_H 1 + #define HAVE_ISWCTYPE 1 +Index: git/crypt/crypt_common.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/crypt/crypt_common.c 2014-08-29 20:01:15.248070587 -0700 +@@ -0,0 +1,42 @@ ++/* ++ * crypt: crypt(3) implementation ++ * ++ * Copyright (C) 1991-2014 Free Software Foundation, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; see the file COPYING.LIB. If not, ++ * see . ++ * ++ * General Support routines ++ * ++ */ ++ ++#include "crypt-private.h" ++ ++/* Table with characters for base64 transformation. */ ++static const char b64t[64] = ++"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; ++ ++void ++__b64_from_24bit (char **cp, int *buflen, ++ unsigned int b2, unsigned int b1, unsigned int b0, ++ int n) ++{ ++ unsigned int w = (b2 << 16) | (b1 << 8) | b0; ++ while (n-- > 0 && (*buflen) > 0) ++ { ++ *(*cp)++ = b64t[w & 0x3f]; ++ --(*buflen); ++ w >>= 6; ++ } ++} +Index: git/crypt/crypt_util.c +=================================================================== +--- git.orig/crypt/crypt_util.c 2014-08-29 20:00:43.028070587 -0700 ++++ git/crypt/crypt_util.c 2014-08-29 20:01:15.248070587 -0700 +@@ -242,10 +242,6 @@ + */ + static ufc_long efp[16][64][2]; + +-/* Table with characters for base64 transformation. */ +-static const char b64t[64] = +-"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; +- + /* + * For use by the old, non-reentrant routines + * (crypt/encrypt/setkey) +@@ -949,17 +945,3 @@ + { + __setkey_r(__key, &_ufc_foobar); + } +- +-void +-__b64_from_24bit (char **cp, int *buflen, +- unsigned int b2, unsigned int b1, unsigned int b0, +- int n) +-{ +- unsigned int w = (b2 << 16) | (b1 << 8) | b0; +- while (n-- > 0 && (*buflen) > 0) +- { +- *(*cp)++ = b64t[w & 0x3f]; +- --(*buflen); +- w >>= 6; +- } +-} +Index: git/sysdeps/arm/Makefile +=================================================================== +--- git.orig/sysdeps/arm/Makefile 2014-08-29 20:29:37.000000000 -0700 ++++ git/sysdeps/arm/Makefile 2014-08-29 20:31:09.904070587 -0700 +@@ -37,10 +37,13 @@ + # get offset to rtld_global._dl_hwcap + gen-as-const-headers += rtld-global-offsets.sym tlsdesc.sym + aeabi_constants = aeabi_lcsts aeabi_sighandlers aeabi_math +-aeabi_routines = aeabi_assert aeabi_localeconv aeabi_errno_addr \ ++aeabi_routines = aeabi_assert aeabi_errno_addr \ + aeabi_mb_cur_max aeabi_atexit aeabi_memclr aeabi_memcpy \ + aeabi_memmove aeabi_memset \ + aeabi_read_tp libc-aeabi_read_tp ++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE)) ++aeabi_routines += aeabi_localeconv ++endif + + sysdep_routines += $(aeabi_constants) $(aeabi_routines) + static-only-routines += $(aeabi_constants) aeabi_read_tp diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc.patch new file mode 100644 index 0000000..fdfabc3 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/eglibc.patch @@ -0,0 +1,602 @@ +Instruction documents from eglibc + +Upstream-Status: Pending + +Index: git/EGLIBC.cross-building +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/EGLIBC.cross-building 2014-08-27 07:27:25.580070587 +0000 +@@ -0,0 +1,383 @@ ++ -*- mode: text -*- ++ ++ Cross-Compiling EGLIBC ++ Jim Blandy ++ ++ ++Introduction ++ ++Most GNU tools have a simple build procedure: you run their ++'configure' script, and then you run 'make'. Unfortunately, the ++process of cross-compiling the GNU C library is quite a bit more ++involved: ++ ++1) Build a cross-compiler, with certain facilities disabled. ++ ++2) Configure the C library using the compiler you built in step 1). ++ Build a few of the C run-time object files, but not the rest of the ++ library. Install the library's header files and the run-time ++ object files, and create a dummy libc.so. ++ ++3) Build a second cross-compiler, using the header files and object ++ files you installed in step 2. ++ ++4) Configure, build, and install a fresh C library, using the compiler ++ built in step 3. ++ ++5) Build a third cross-compiler, based on the C library built in step 4. ++ ++The reason for this complexity is that, although GCC and the GNU C ++library are distributed separately, they are not actually independent ++of each other: GCC requires the C library's headers and some object ++files to compile its own libraries, while the C library depends on ++GCC's libraries. EGLIBC includes features and bug fixes to the stock ++GNU C library that simplify this process, but the fundamental ++interdependency stands. ++ ++In this document, we explain how to cross-compile an EGLIBC/GCC pair ++from source. Our intended audience is developers who are already ++familiar with the GNU toolchain and comfortable working with ++cross-development tools. While we do present a worked example to ++accompany the explanation, for clarity's sake we do not cover many of ++the options available to cross-toolchain users. ++ ++ ++Preparation ++ ++EGLIBC requires recent versions of the GNU binutils, GCC, and the ++Linux kernel. The web page ++documents the current requirements, and lists patches needed for ++certain target architectures. As of this writing, these build ++instructions have been tested with binutils 2.22.51, GCC 4.6.2, ++and Linux 3.1. ++ ++First, let's set some variables, to simplify later commands. We'll ++build EGLIBC and GCC for an ARM target, known to the Linux kernel ++as 'arm', and we'll do the build on an Intel x86_64 Linux box: ++ ++ $ build=x86_64-pc-linux-gnu ++ $ host=$build ++ $ target=arm-none-linux-gnueabi ++ $ linux_arch=arm ++ ++We're using the aforementioned versions of Binutils, GCC, and Linux: ++ ++ $ binutilsv=binutils-2.22.51 ++ $ gccv=gcc-4.6.2 ++ $ linuxv=linux-3.1 ++ ++We're carrying out the entire process under '~/cross-build', which ++contains unpacked source trees for binutils, gcc, and linux kernel, ++along with EGLIBC svn trunk (which can be checked-out with ++'svn co http://www.eglibc.org/svn/trunk eglibc'): ++ ++ $ top=$HOME/cross-build/$target ++ $ src=$HOME/cross-build/src ++ $ ls $src ++ binutils-2.22.51 eglibc gcc-4.6.2 linux-3.1 ++ ++We're going to place our build directories in a subdirectory 'obj', ++we'll install the cross-development toolchain in 'tools', and we'll ++place our sysroot (containing files to be installed on the target ++system) in 'sysroot': ++ ++ $ obj=$top/obj ++ $ tools=$top/tools ++ $ sysroot=$top/sysroot ++ ++ ++Binutils ++ ++Configuring and building binutils for the target is straightforward: ++ ++ $ mkdir -p $obj/binutils ++ $ cd $obj/binutils ++ $ $src/$binutilsv/configure \ ++ > --target=$target \ ++ > --prefix=$tools \ ++ > --with-sysroot=$sysroot ++ $ make ++ $ make install ++ ++ ++The First GCC ++ ++For our work, we need a cross-compiler targeting an ARM Linux ++system. However, that configuration includes the shared library ++'libgcc_s.so', which is compiled against the EGLIBC headers (which we ++haven't installed yet) and linked against 'libc.so' (which we haven't ++built yet). ++ ++Fortunately, there are configuration options for GCC which tell it not ++to build 'libgcc_s.so'. The '--without-headers' option is supposed to ++take care of this, but its implementation is incomplete, so you must ++also configure with the '--with-newlib' option. While '--with-newlib' ++appears to mean "Use the Newlib C library", its effect is to tell the ++GCC build machinery, "Don't assume there is a C library available." ++ ++We also need to disable some of the libraries that would normally be ++built along with GCC, and specify that only the compiler for the C ++language is needed. ++ ++So, we create a build directory, configure, make, and install. ++ ++ $ mkdir -p $obj/gcc1 ++ $ cd $obj/gcc1 ++ $ $src/$gccv/configure \ ++ > --target=$target \ ++ > --prefix=$tools \ ++ > --without-headers --with-newlib \ ++ > --disable-shared --disable-threads --disable-libssp \ ++ > --disable-libgomp --disable-libmudflap --disable-libquadmath \ ++ > --disable-decimal-float --disable-libffi \ ++ > --enable-languages=c ++ $ PATH=$tools/bin:$PATH make ++ $ PATH=$tools/bin:$PATH make install ++ ++ ++Linux Kernel Headers ++ ++To configure EGLIBC, we also need Linux kernel headers in place. ++Fortunately, the Linux makefiles have a target that installs them for ++us. Since the process does modify the source tree a bit, we make a ++copy first: ++ ++ $ cp -r $src/$linuxv $obj/linux ++ $ cd $obj/linux ++ ++Now we're ready to install the headers into the sysroot: ++ ++ $ PATH=$tools/bin:$PATH \ ++ > make headers_install \ ++ > ARCH=$linux_arch CROSS_COMPILE=$target- \ ++ > INSTALL_HDR_PATH=$sysroot/usr ++ ++ ++EGLIBC Headers and Preliminary Objects ++ ++Using the cross-compiler we've just built, we can now configure EGLIBC ++well enough to install the headers and build the object files that the ++full cross-compiler will need: ++ ++ $ mkdir -p $obj/eglibc-headers ++ $ cd $obj/eglibc-headers ++ $ BUILD_CC=gcc \ ++ > CC=$tools/bin/$target-gcc \ ++ > CXX=$tools/bin/$target-g++ \ ++ > AR=$tools/bin/$target-ar \ ++ > RANLIB=$tools/bin/$target-ranlib \ ++ > $src/eglibc/libc/configure \ ++ > --prefix=/usr \ ++ > --with-headers=$sysroot/usr/include \ ++ > --build=$build \ ++ > --host=$target \ ++ > --disable-profile --without-gd --without-cvs \ ++ > --enable-add-ons=nptl,libidn,../ports ++ ++The option '--prefix=/usr' may look strange, but you should never ++configure EGLIBC with a prefix other than '/usr': in various places, ++EGLIBC's build system checks whether the prefix is '/usr', and does ++special handling only if that is the case. Unless you use this ++prefix, you will get a sysroot that does not use the standard Linux ++directory layouts and cannot be used as a basis for the root ++filesystem on your target system compatibly with normal GLIBC ++installations. ++ ++The '--with-headers' option tells EGLIBC where the Linux headers have ++been installed. ++ ++The '--enable-add-ons=nptl,libidn,../ports' option tells EGLIBC to look ++for the listed glibc add-ons. Most notably the ports add-on (located ++just above the libc sources in the EGLIBC svn tree) is required to ++support ARM targets. ++ ++We can now use the 'install-headers' makefile target to install the ++headers: ++ ++ $ make install-headers install_root=$sysroot \ ++ > install-bootstrap-headers=yes ++ ++The 'install_root' variable indicates where the files should actually ++be installed; its value is treated as the parent of the '--prefix' ++directory we passed to the configure script, so the headers will go in ++'$sysroot/usr/include'. The 'install-bootstrap-headers' variable ++requests special handling for certain tricky header files. ++ ++Next, there are a few object files needed to link shared libraries, ++which we build and install by hand: ++ ++ $ mkdir -p $sysroot/usr/lib ++ $ make csu/subdir_lib ++ $ cp csu/crt1.o csu/crti.o csu/crtn.o $sysroot/usr/lib ++ ++Finally, 'libgcc_s.so' requires a 'libc.so' to link against. However, ++since we will never actually execute its code, it doesn't matter what ++it contains. So, treating '/dev/null' as a C source file, we produce ++a dummy 'libc.so' in one step: ++ ++ $ $tools/bin/$target-gcc -nostdlib -nostartfiles -shared -x c /dev/null \ ++ > -o $sysroot/usr/lib/libc.so ++ ++ ++The Second GCC ++ ++With the EGLIBC headers and selected object files installed, we can ++now build a GCC that is capable of compiling EGLIBC. We configure, ++build, and install the second GCC, again building only the C compiler, ++and avoiding libraries we won't use: ++ ++ $ mkdir -p $obj/gcc2 ++ $ cd $obj/gcc2 ++ $ $src/$gccv/configure \ ++ > --target=$target \ ++ > --prefix=$tools \ ++ > --with-sysroot=$sysroot \ ++ > --disable-libssp --disable-libgomp --disable-libmudflap \ ++ > --disable-libffi --disable-libquadmath \ ++ > --enable-languages=c ++ $ PATH=$tools/bin:$PATH make ++ $ PATH=$tools/bin:$PATH make install ++ ++ ++EGLIBC, Complete ++ ++With the second compiler built and installed, we're now ready for the ++full EGLIBC build: ++ ++ $ mkdir -p $obj/eglibc ++ $ cd $obj/eglibc ++ $ BUILD_CC=gcc \ ++ > CC=$tools/bin/$target-gcc \ ++ > CXX=$tools/bin/$target-g++ \ ++ > AR=$tools/bin/$target-ar \ ++ > RANLIB=$tools/bin/$target-ranlib \ ++ > $src/eglibc/libc/configure \ ++ > --prefix=/usr \ ++ > --with-headers=$sysroot/usr/include \ ++ > --with-kconfig=$obj/linux/scripts/kconfig \ ++ > --build=$build \ ++ > --host=$target \ ++ > --disable-profile --without-gd --without-cvs \ ++ > --enable-add-ons=nptl,libidn,../ports ++ ++Note the additional '--with-kconfig' option. This tells EGLIBC where to ++find the host config tools used by the kernel 'make config' and 'make ++menuconfig'. These tools can be re-used by EGLIBC for its own 'make ++*config' support, which will create 'option-groups.config' for you. ++But first make sure those tools have been built by running some ++dummy 'make *config' calls in the kernel directory: ++ ++ $ cd $obj/linux ++ $ PATH=$tools/bin:$PATH make config \ ++ > ARCH=$linux_arch CROSS_COMPILE=$target- \ ++ $ PATH=$tools/bin:$PATH make menuconfig \ ++ > ARCH=$linux_arch CROSS_COMPILE=$target- \ ++ ++Now we can configure and build the full EGLIBC: ++ ++ $ cd $obj/eglibc ++ $ PATH=$tools/bin:$PATH make defconfig ++ $ PATH=$tools/bin:$PATH make menuconfig ++ $ PATH=$tools/bin:$PATH make ++ $ PATH=$tools/bin:$PATH make install install_root=$sysroot ++ ++At this point, we have a complete EGLIBC installation in '$sysroot', ++with header files, library files, and most of the C runtime startup ++files in place. ++ ++ ++The Third GCC ++ ++Finally, we recompile GCC against this full installation, enabling ++whatever languages and libraries we would like to use: ++ ++ $ mkdir -p $obj/gcc3 ++ $ cd $obj/gcc3 ++ $ $src/$gccv/configure \ ++ > --target=$target \ ++ > --prefix=$tools \ ++ > --with-sysroot=$sysroot \ ++ > --enable-__cxa_atexit \ ++ > --disable-libssp --disable-libgomp --disable-libmudflap \ ++ > --enable-languages=c,c++ ++ $ PATH=$tools/bin:$PATH make ++ $ PATH=$tools/bin:$PATH make install ++ ++The '--enable-__cxa_atexit' option tells GCC what sort of C++ ++destructor support to expect from the C library; it's required with ++EGLIBC. ++ ++And since GCC's installation process isn't designed to help construct ++sysroot trees, we must manually copy certain libraries into place in ++the sysroot. ++ ++ $ cp -d $tools/$target/lib/libgcc_s.so* $sysroot/lib ++ $ cp -d $tools/$target/lib/libstdc++.so* $sysroot/usr/lib ++ ++ ++Trying Things Out ++ ++At this point, '$tools' contains a cross toolchain ready to use ++the EGLIBC installation in '$sysroot': ++ ++ $ cat > hello.c < #include ++ > int ++ > main (int argc, char **argv) ++ > { ++ > puts ("Hello, world!"); ++ > return 0; ++ > } ++ > EOF ++ $ $tools/bin/$target-gcc -Wall hello.c -o hello ++ $ cat > c++-hello.cc < #include ++ > int ++ > main (int argc, char **argv) ++ > { ++ > std::cout << "Hello, C++ world!" << std::endl; ++ > return 0; ++ > } ++ > EOF ++ $ $tools/bin/$target-g++ -Wall c++-hello.cc -o c++-hello ++ ++ ++We can use 'readelf' to verify that these are indeed executables for ++our target, using our dynamic linker: ++ ++ $ $tools/bin/$target-readelf -hl hello ++ ELF Header: ++ ... ++ Type: EXEC (Executable file) ++ Machine: ARM ++ ++ ... ++ Program Headers: ++ Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align ++ PHDR 0x000034 0x10000034 0x10000034 0x00100 0x00100 R E 0x4 ++ INTERP 0x000134 0x00008134 0x00008134 0x00013 0x00013 R 0x1 ++ [Requesting program interpreter: /lib/ld-linux.so.3] ++ LOAD 0x000000 0x00008000 0x00008000 0x0042c 0x0042c R E 0x8000 ++ ... ++ ++Looking at the dynamic section of the installed 'libgcc_s.so', we see ++that the 'NEEDED' entry for the C library does include the '.6' ++suffix, indicating that was linked against our fully build EGLIBC, and ++not our dummy 'libc.so': ++ ++ $ $tools/bin/$target-readelf -d $sysroot/lib/libgcc_s.so.1 ++ Dynamic section at offset 0x1083c contains 24 entries: ++ Tag Type Name/Value ++ 0x00000001 (NEEDED) Shared library: [libc.so.6] ++ 0x0000000e (SONAME) Library soname: [libgcc_s.so.1] ++ ... ++ ++ ++And on the target machine, we can run our programs: ++ ++ $ $sysroot/lib/ld.so.1 --library-path $sysroot/lib:$sysroot/usr/lib \ ++ > ./hello ++ Hello, world! ++ $ $sysroot/lib/ld.so.1 --library-path $sysroot/lib:$sysroot/usr/lib \ ++ > ./c++-hello ++ Hello, C++ world! +Index: git/EGLIBC.cross-testing +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/EGLIBC.cross-testing 2014-08-27 07:24:41.532070587 +0000 +@@ -0,0 +1,205 @@ ++ -*- mode: text -*- ++ ++ Cross-Testing With EGLIBC ++ Jim Blandy ++ ++ ++Introduction ++ ++Developers writing software for embedded systems often use a desktop ++or other similarly capable computer for development, but need to run ++tests on the embedded system, or perhaps on a simulator. When ++configured for cross-compilation, the stock GNU C library simply ++disables running tests altogether: the command 'make tests' builds ++test programs, but does not run them. EGLIBC, however, provides ++facilities for compiling tests and generating data files on the build ++system, but running the test programs themselves on a remote system or ++simulator. ++ ++ ++Test environment requirements ++ ++The test environment must meet certain conditions for EGLIBC's ++cross-testing facilities to work: ++ ++- Shared filesystems. The 'build' system, on which you configure and ++ compile EGLIBC, and the 'host' system, on which you intend to run ++ EGLIBC, must share a filesystem containing the EGLIBC build and ++ source trees. Files must appear at the same paths on both systems. ++ ++- Remote-shell like invocation. There must be a way to run a program ++ on the host system from the build system, passing it properly quoted ++ command-line arguments, setting environment variables, and ++ inheriting the caller's standard input and output. ++ ++ ++Usage ++ ++To use EGLIBC's cross-testing support, provide values for the ++following Make variables when you invoke 'make': ++ ++- cross-test-wrapper ++ ++ This should be the name of the cross-testing wrapper command, along ++ with any arguments. ++ ++- cross-localedef ++ ++ This should be the name of a cross-capable localedef program, like ++ that included in the EGLIBC 'localedef' module, along with any ++ arguments needed. ++ ++These are each explained in detail below. ++ ++ ++The Cross-Testing Wrapper ++ ++To run test programs reliably, the stock GNU C library takes care to ++ensure that test programs use the newly compiled dynamic linker and ++shared libraries, and never the host system's installed libraries. To ++accomplish this, it runs the tests by explicitly invoking the dynamic ++linker from the build tree, passing it a list of build tree ++directories to search for shared libraries, followed by the name of ++the executable to run and its arguments. ++ ++For example, where one might normally run a test program like this: ++ ++ $ ./tst-foo arg1 arg2 ++ ++the GNU C library might run that program like this: ++ ++ $ $objdir/elf/ld-linux.so.3 --library-path $objdir \ ++ ./tst-foo arg1 arg2 ++ ++(where $objdir is the path to the top of the build tree, and the ++trailing backslash indicates a continuation of the command). In other ++words, each test program invocation is 'wrapped up' inside an explicit ++invocation of the dynamic linker, which must itself execute the test ++program, having loaded shared libraries from the appropriate ++directories. ++ ++To support cross-testing, EGLIBC allows the developer to optionally ++set the 'cross-test-wrapper' Make variable to another wrapper command, ++to which it passes the entire dynamic linker invocation shown above as ++arguments. For example, if the developer supplies a wrapper of ++'my-wrapper hostname', then EGLIBC would run the test above as ++follows: ++ ++ $ my-wrapper hostname \ ++ $objdir/elf/ld-linux.so.3 --library-path $objdir \ ++ ./tst-foo arg1 arg2 ++ ++The 'my-wrapper' command is responsible for executing the command ++given on the host system. ++ ++Since tests are run in varying directories, the wrapper should either ++be in your command search path, or 'cross-test-wrapper' should give an ++absolute path for the wrapper. ++ ++The wrapper must meet several requirements: ++ ++- It must preserve the current directory. As explained above, the ++ build directory tree must be visible on both the build and host ++ systems, at the same path. The test wrapper must ensure that the ++ current directory it inherits is also inherited by the dynamic ++ linker (and thus the test program itself). ++ ++- It must preserve environment variables' values. Many EGLIBC tests ++ set environment variables for test runs; in native testing, it ++ invokes programs like this: ++ ++ $ GCONV_PATH=$objdir/iconvdata \ ++ $objdir/elf/ld-linux.so.3 --library-path $objdir \ ++ ./tst-foo arg1 arg2 ++ ++ With the cross-testing wrapper, that invocation becomes: ++ ++ $ GCONV_PATH=$objdir/iconvdata \ ++ my-wrapper hostname \ ++ $objdir/elf/ld-linux.so.3 --library-path $objdir \ ++ ./tst-foo arg1 arg2 ++ ++ Here, 'my-wrapper' must ensure that the value it sees for ++ 'GCONV_PATH' will be seen by the dynamic linker, and thus 'tst-foo' ++ itself. (The wrapper supplied with GLIBC simply preserves the ++ values of *all* enviroment variables, with a fixed set of ++ exceptions.) ++ ++ If your wrapper is a shell script, take care to correctly propagate ++ environment variables whose values contain spaces and shell ++ metacharacters. ++ ++- It must pass the command's arguments, unmodified. The arguments ++ seen by the test program should be exactly those seen by the wrapper ++ (after whatever arguments are given to the wrapper itself). The ++ EGLIBC test framework performs all needed shell word splitting and ++ expansion (wildcard expansion, parameter substitution, and so on) ++ before invoking the wrapper; further expansion may break the tests. ++ ++ ++The 'cross-test-ssh.sh' script ++ ++If you want to use 'ssh' (or something sufficiently similar) to run ++test programs on your host system, EGLIBC includes a shell script, ++'scripts/cross-test-ssh.sh', which you can use as your wrapper ++command. This script takes care of setting the test command's current ++directory, propagating environment variable values, and carrying ++command-line arguments, all across an 'ssh' connection. You may even ++supply an alternative to 'ssh' on the command line, if needed. ++ ++For more details, pass 'cross-test-ssh.sh' the '--help' option. ++ ++ ++The Cross-Compiling Locale Definition Command ++ ++Some EGLIBC tests rely on locales generated especially for the test ++process. In a native configuration, these tests simply run the ++'localedef' command built by the normal EGLIBC build process, ++'locale/localedef', to process and install their locales. However, in ++a cross-compiling configuration, this 'localedef' is built for the ++host system, not the build system, and since it requires quite a bit ++of memory to run (we have seen it fail on systems with 64MiB of ++memory), it may not be practical to run it on the host system. ++ ++If set, EGLIBC uses the 'cross-localedef' Make variable as the command ++to run on the build system to process and install locales. The ++localedef program built from the EGLIBC 'localedef' module is ++suitable. ++ ++The value of 'cross-localedef' may also include command-line arguments ++to be passed to the program; if you are using EGLIBC's 'localedef', ++you may include endianness and 'uint32_t' alignment arguments here. ++ ++ ++Example ++ ++In developing EGLIBC's cross-testing facility, we invoked 'make' with ++the following script: ++ ++ #!/bin/sh ++ ++ srcdir=... ++ test_hostname=... ++ localedefdir=... ++ cross_gxx=...-g++ ++ ++ wrapper="$srcdir/scripts/cross-test-ssh.sh $test_hostname" ++ localedef="$localedefdir/localedef --little-endian --uint32-align=4" ++ ++ make cross-test-wrapper="$wrapper" \ ++ cross-localedef="$localedef" \ ++ CXX="$cross_gxx" \ ++ "$@" ++ ++ ++Other Cross-Testing Concerns ++ ++Here are notes on some other issues which you may encounter in running ++the EGLIBC tests in a cross-compiling environment: ++ ++- Some tests require a C++ cross-compiler; you should set the 'CXX' ++ Make variable to the name of an appropriate cross-compiler. ++ ++- Some tests require access to libstdc++.so.6 and libgcc_s.so.1; we ++ simply place copies of these libraries in the top EGLIBC build ++ directory. diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/etc/ld.so.conf b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/etc/ld.so.conf new file mode 100644 index 0000000..e69de29 diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/fix-tibetian-locales.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/fix-tibetian-locales.patch new file mode 100644 index 0000000..9ab9fdc --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/fix-tibetian-locales.patch @@ -0,0 +1,38 @@ +cross localedef fails to compile these locales because name_fmt field is empty +It is not acceptable for cross localedef and it errors out + +LC_NAME: field `name_fmt' not defined + +We therefore give a dummy string to the format, the real fix needs some native +tibetian person to define proper name_fmt + +Upstream-Status: Pending + +Signed-off-by: Khem Raj + +Index: git/localedata/locales/bo_CN +=================================================================== +--- git.orig/localedata/locales/bo_CN 2014-08-29 10:35:22.464070587 -0700 ++++ git/localedata/locales/bo_CN 2014-08-29 10:35:22.456070587 -0700 +@@ -146,7 +146,7 @@ + LC_NAME + % FIXME + +-name_fmt "" ++name_fmt "FIXME" + % name_gen "FIXME" + % name_miss "FIXME" + % name_mr "FIXME" +Index: git/localedata/locales/bo_IN +=================================================================== +--- git.orig/localedata/locales/bo_IN 2014-08-29 10:35:22.464070587 -0700 ++++ git/localedata/locales/bo_IN 2014-08-29 10:35:22.456070587 -0700 +@@ -71,7 +71,7 @@ + + LC_NAME + % FIXME +-name_fmt "" ++name_fmt "FIXME" + % name_gen "FIXME" + % name_miss "FIXME" + % name_mr "FIXME" diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/fix_am_rootsbindir.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/fix_am_rootsbindir.patch new file mode 100644 index 0000000..668e8bf --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/fix_am_rootsbindir.patch @@ -0,0 +1,29 @@ +sysdeps/gnu/configure.ac: handle correctly $libc_cv_rootsbindir + +Upstream-Status:Pending +Signed-off-by: Matthieu Crapet + +Index: git/sysdeps/gnu/configure +=================================================================== +--- git.orig/sysdeps/gnu/configure 2014-08-27 07:24:38.572070587 +0000 ++++ git/sysdeps/gnu/configure 2014-08-27 07:24:41.308070587 +0000 +@@ -32,6 +32,6 @@ + else + libc_cv_localstatedir=$localstatedir + fi +- libc_cv_rootsbindir=/sbin ++ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin + ;; + esac +Index: git/sysdeps/gnu/configure.ac +=================================================================== +--- git.orig/sysdeps/gnu/configure.ac 2014-08-27 07:24:38.572070587 +0000 ++++ git/sysdeps/gnu/configure.ac 2014-08-27 07:24:41.308070587 +0000 +@@ -21,6 +21,6 @@ + else + libc_cv_localstatedir=$localstatedir + fi +- libc_cv_rootsbindir=/sbin ++ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin + ;; + esac diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/fsl-ppc-no-fsqrt.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/fsl-ppc-no-fsqrt.patch new file mode 100644 index 0000000..f88eaf4 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/fsl-ppc-no-fsqrt.patch @@ -0,0 +1,100 @@ +Create e5500 specific math_private.h and let it include when compiling for e5500/64bit core +We prefefine __CPU_HAS_FSQRT to 0 and then in general ppc64 math_private.h we check if its +already defined before redefining it. This way we can ensure that on e5500 builds it wont +emit fsqrt intructions + +-Khem + +Upstream-Status: Pending + +Index: git/sysdeps/powerpc/fpu/math_private.h +=================================================================== +--- git.orig/sysdeps/powerpc/fpu/math_private.h 2014-08-29 10:31:30.224070587 -0700 ++++ git/sysdeps/powerpc/fpu/math_private.h 2014-08-29 10:31:30.212070587 -0700 +@@ -25,10 +25,12 @@ + #include + #include_next + +-# if __WORDSIZE == 64 || defined _ARCH_PWR4 +-# define __CPU_HAS_FSQRT 1 +-# else +-# define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0) ++# ifndef __CPU_HAS_FSQRT ++# if __WORDSIZE == 64 || defined _ARCH_PWR4 ++# define __CPU_HAS_FSQRT 1 ++# else ++# define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0) ++# endif + # endif + + extern double __slow_ieee754_sqrt (double); +Index: git/sysdeps/powerpc/powerpc64/e5500/fpu/math_private.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc64/e5500/fpu/math_private.h 2014-08-29 10:31:30.212070587 -0700 +@@ -0,0 +1,9 @@ ++#ifndef _E5500_MATH_PRIVATE_H_ ++#define _E5500_MATH_PRIVATE_H_ 1 ++/* E5500 core FPU does not implement ++ fsqrt */ ++ ++#define __CPU_HAS_FSQRT 0 ++#include_next ++ ++#endif /* _E5500_MATH_PRIVATE_H_ */ +Index: git/sysdeps/powerpc/powerpc64/e6500/fpu/math_private.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc64/e6500/fpu/math_private.h 2014-08-29 10:31:30.212070587 -0700 +@@ -0,0 +1,9 @@ ++#ifndef _E6500_MATH_PRIVATE_H_ ++#define _E6500_MATH_PRIVATE_H_ 1 ++/* E6500 core FPU does not implement ++ fsqrt */ ++ ++#define __CPU_HAS_FSQRT 0 ++#include_next ++ ++#endif /* _E6500_MATH_PRIVATE_H_ */ +Index: git/sysdeps/powerpc/powerpc32/e500mc/fpu/math_private.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc32/e500mc/fpu/math_private.h 2014-08-29 10:31:30.212070587 -0700 +@@ -0,0 +1,9 @@ ++#ifndef _E500MC_MATH_PRIVATE_H_ ++#define _E500MC_MATH_PRIVATE_H_ 1 ++/* E500MC core FPU does not implement ++ fsqrt */ ++ ++#define __CPU_HAS_FSQRT 0 ++#include_next ++ ++#endif /* _E500MC_MATH_PRIVATE_H_ */ +Index: git/sysdeps/powerpc/powerpc32/e5500/fpu/math_private.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc32/e5500/fpu/math_private.h 2014-08-29 10:31:30.216070587 -0700 +@@ -0,0 +1,9 @@ ++#ifndef _E5500_MATH_PRIVATE_H_ ++#define _E5500_MATH_PRIVATE_H_ 1 ++/* E5500 core FPU does not implement ++ fsqrt */ ++ ++#define __CPU_HAS_FSQRT 0 ++#include_next ++ ++#endif /* _E5500_MATH_PRIVATE_H_ */ +Index: git/sysdeps/powerpc/powerpc32/e6500/fpu/math_private.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc32/e6500/fpu/math_private.h 2014-08-29 10:31:30.216070587 -0700 +@@ -0,0 +1,9 @@ ++#ifndef _E6500_MATH_PRIVATE_H_ ++#define _E6500_MATH_PRIVATE_H_ 1 ++/* E6500 core FPU does not implement ++ fsqrt */ ++ ++#define __CPU_HAS_FSQRT 0 ++#include_next ++ ++#endif /* _E6500_MATH_PRIVATE_H_ */ diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/generate-supported.mk b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/generate-supported.mk new file mode 100644 index 0000000..d2a28c2 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/generate-supported.mk @@ -0,0 +1,11 @@ +#!/usr/bin/make + +include $(IN) + +all: + rm -f $(OUT) + touch $(OUT) + for locale in $(SUPPORTED-LOCALES); do \ + [ $$locale = true ] && continue; \ + echo $$locale | sed 's,/, ,' >> $(OUT); \ + done diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/glibc.fix_sqrt2.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/glibc.fix_sqrt2.patch new file mode 100644 index 0000000..f5ed1bf --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/glibc.fix_sqrt2.patch @@ -0,0 +1,1516 @@ +Signed-of-by: Edmar Wienskoski +Upstream-Status: Pending + +Index: git/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c 2014-08-29 10:34:07.768070587 -0700 +@@ -0,0 +1,134 @@ ++/* Double-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float two108 = 3.245185536584267269e+32; ++static const float twom54 = 5.551115123125782702e-17; ++static const float half = 0.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the actual square root and half of its reciprocal ++ simultaneously. */ ++ ++#ifdef __STDC__ ++double ++__ieee754_sqrt (double b) ++#else ++double ++__ieee754_sqrt (b) ++ double b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++ double y, g, h, d, r; ++ ieee_double_shape_type u; ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ u.value = b; ++ ++ relax_fenv_state (); ++ ++ __asm__ ("frsqrte %[estimate], %[x]\n" ++ : [estimate] "=f" (y) : [x] "f" (b)); ++ ++ /* Following Muller et al, page 168, equation 5.20. ++ ++ h goes to 1/(2*sqrt(b)) ++ g goes to sqrt(b). ++ ++ We need three iterations to get within 1ulp. */ ++ ++ /* Indicate that these can be performed prior to the branch. GCC ++ insists on sinking them below the branch, however; it seems like ++ they'd be better before the branch so that we can cover any latency ++ from storing the argument and loading its high word. Oh well. */ ++ ++ g = b * y; ++ h = 0.5 * y; ++ ++ /* Handle small numbers by scaling. */ ++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) ++ return __ieee754_sqrt (b * two108) * twom54; ++ ++#define FMADD(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ ++ ++ /* Final refinement. */ ++ d = FNMSUB (g, g, b); ++ ++ fesetenv_register (fe); ++ return FMADD (d, h, g); ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_wash (b); ++} +Index: git/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c 2014-08-29 10:34:07.768070587 -0700 +@@ -0,0 +1,101 @@ ++/* Single-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float threehalf = 1.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the reciprocal square root and use that to compute the actual ++ square root. */ ++ ++#ifdef __STDC__ ++float ++__ieee754_sqrtf (float b) ++#else ++float ++__ieee754_sqrtf (b) ++ float b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++#define FMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ double y, x; ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ relax_fenv_state (); ++ ++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ ++ y = FMSUB (threehalf, b, b); ++ ++ /* Initial estimate. */ ++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); ++ ++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ ++ /* All done. */ ++ fesetenv_register (fe); ++ return x * b; ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_washf (b); ++} +Index: git/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c 2014-08-29 10:34:07.768070587 -0700 +@@ -0,0 +1,134 @@ ++/* Double-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float two108 = 3.245185536584267269e+32; ++static const float twom54 = 5.551115123125782702e-17; ++static const float half = 0.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the actual square root and half of its reciprocal ++ simultaneously. */ ++ ++#ifdef __STDC__ ++double ++__ieee754_sqrt (double b) ++#else ++double ++__ieee754_sqrt (b) ++ double b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++ double y, g, h, d, r; ++ ieee_double_shape_type u; ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ u.value = b; ++ ++ relax_fenv_state (); ++ ++ __asm__ ("frsqrte %[estimate], %[x]\n" ++ : [estimate] "=f" (y) : [x] "f" (b)); ++ ++ /* Following Muller et al, page 168, equation 5.20. ++ ++ h goes to 1/(2*sqrt(b)) ++ g goes to sqrt(b). ++ ++ We need three iterations to get within 1ulp. */ ++ ++ /* Indicate that these can be performed prior to the branch. GCC ++ insists on sinking them below the branch, however; it seems like ++ they'd be better before the branch so that we can cover any latency ++ from storing the argument and loading its high word. Oh well. */ ++ ++ g = b * y; ++ h = 0.5 * y; ++ ++ /* Handle small numbers by scaling. */ ++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) ++ return __ieee754_sqrt (b * two108) * twom54; ++ ++#define FMADD(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ ++ ++ /* Final refinement. */ ++ d = FNMSUB (g, g, b); ++ ++ fesetenv_register (fe); ++ return FMADD (d, h, g); ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_wash (b); ++} +Index: git/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c 2014-08-29 10:34:07.772070587 -0700 +@@ -0,0 +1,101 @@ ++/* Single-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float threehalf = 1.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the reciprocal square root and use that to compute the actual ++ square root. */ ++ ++#ifdef __STDC__ ++float ++__ieee754_sqrtf (float b) ++#else ++float ++__ieee754_sqrtf (b) ++ float b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++#define FMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ double y, x; ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ relax_fenv_state (); ++ ++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ ++ y = FMSUB (threehalf, b, b); ++ ++ /* Initial estimate. */ ++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); ++ ++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ ++ /* All done. */ ++ fesetenv_register (fe); ++ return x * b; ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_washf (b); ++} +Index: git/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c 2014-08-29 10:34:07.772070587 -0700 +@@ -0,0 +1,134 @@ ++/* Double-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float two108 = 3.245185536584267269e+32; ++static const float twom54 = 5.551115123125782702e-17; ++static const float half = 0.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the actual square root and half of its reciprocal ++ simultaneously. */ ++ ++#ifdef __STDC__ ++double ++__ieee754_sqrt (double b) ++#else ++double ++__ieee754_sqrt (b) ++ double b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++ double y, g, h, d, r; ++ ieee_double_shape_type u; ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ u.value = b; ++ ++ relax_fenv_state (); ++ ++ __asm__ ("frsqrte %[estimate], %[x]\n" ++ : [estimate] "=f" (y) : [x] "f" (b)); ++ ++ /* Following Muller et al, page 168, equation 5.20. ++ ++ h goes to 1/(2*sqrt(b)) ++ g goes to sqrt(b). ++ ++ We need three iterations to get within 1ulp. */ ++ ++ /* Indicate that these can be performed prior to the branch. GCC ++ insists on sinking them below the branch, however; it seems like ++ they'd be better before the branch so that we can cover any latency ++ from storing the argument and loading its high word. Oh well. */ ++ ++ g = b * y; ++ h = 0.5 * y; ++ ++ /* Handle small numbers by scaling. */ ++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) ++ return __ieee754_sqrt (b * two108) * twom54; ++ ++#define FMADD(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ ++ ++ /* Final refinement. */ ++ d = FNMSUB (g, g, b); ++ ++ fesetenv_register (fe); ++ return FMADD (d, h, g); ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_wash (b); ++} +Index: git/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c 2014-08-29 10:34:07.772070587 -0700 +@@ -0,0 +1,101 @@ ++/* Single-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float threehalf = 1.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the reciprocal square root and use that to compute the actual ++ square root. */ ++ ++#ifdef __STDC__ ++float ++__ieee754_sqrtf (float b) ++#else ++float ++__ieee754_sqrtf (b) ++ float b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++#define FMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ double y, x; ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ relax_fenv_state (); ++ ++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ ++ y = FMSUB (threehalf, b, b); ++ ++ /* Initial estimate. */ ++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); ++ ++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ ++ /* All done. */ ++ fesetenv_register (fe); ++ return x * b; ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_washf (b); ++} +Index: git/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 2014-08-29 10:34:07.772070587 -0700 +@@ -0,0 +1,134 @@ ++/* Double-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float two108 = 3.245185536584267269e+32; ++static const float twom54 = 5.551115123125782702e-17; ++static const float half = 0.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the actual square root and half of its reciprocal ++ simultaneously. */ ++ ++#ifdef __STDC__ ++double ++__ieee754_sqrt (double b) ++#else ++double ++__ieee754_sqrt (b) ++ double b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++ double y, g, h, d, r; ++ ieee_double_shape_type u; ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ u.value = b; ++ ++ relax_fenv_state (); ++ ++ __asm__ ("frsqrte %[estimate], %[x]\n" ++ : [estimate] "=f" (y) : [x] "f" (b)); ++ ++ /* Following Muller et al, page 168, equation 5.20. ++ ++ h goes to 1/(2*sqrt(b)) ++ g goes to sqrt(b). ++ ++ We need three iterations to get within 1ulp. */ ++ ++ /* Indicate that these can be performed prior to the branch. GCC ++ insists on sinking them below the branch, however; it seems like ++ they'd be better before the branch so that we can cover any latency ++ from storing the argument and loading its high word. Oh well. */ ++ ++ g = b * y; ++ h = 0.5 * y; ++ ++ /* Handle small numbers by scaling. */ ++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) ++ return __ieee754_sqrt (b * two108) * twom54; ++ ++#define FMADD(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ ++ ++ /* Final refinement. */ ++ d = FNMSUB (g, g, b); ++ ++ fesetenv_register (fe); ++ return FMADD (d, h, g); ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_wash (b); ++} +Index: git/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 2014-08-29 10:34:07.772070587 -0700 +@@ -0,0 +1,101 @@ ++/* Single-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float threehalf = 1.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the reciprocal square root and use that to compute the actual ++ square root. */ ++ ++#ifdef __STDC__ ++float ++__ieee754_sqrtf (float b) ++#else ++float ++__ieee754_sqrtf (b) ++ float b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++#define FMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ double y, x; ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ relax_fenv_state (); ++ ++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ ++ y = FMSUB (threehalf, b, b); ++ ++ /* Initial estimate. */ ++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); ++ ++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ ++ /* All done. */ ++ fesetenv_register (fe); ++ return x * b; ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_washf (b); ++} +Index: git/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c 2014-08-29 10:34:07.772070587 -0700 +@@ -0,0 +1,134 @@ ++/* Double-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float two108 = 3.245185536584267269e+32; ++static const float twom54 = 5.551115123125782702e-17; ++static const float half = 0.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the actual square root and half of its reciprocal ++ simultaneously. */ ++ ++#ifdef __STDC__ ++double ++__ieee754_sqrt (double b) ++#else ++double ++__ieee754_sqrt (b) ++ double b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++ double y, g, h, d, r; ++ ieee_double_shape_type u; ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ u.value = b; ++ ++ relax_fenv_state (); ++ ++ __asm__ ("frsqrte %[estimate], %[x]\n" ++ : [estimate] "=f" (y) : [x] "f" (b)); ++ ++ /* Following Muller et al, page 168, equation 5.20. ++ ++ h goes to 1/(2*sqrt(b)) ++ g goes to sqrt(b). ++ ++ We need three iterations to get within 1ulp. */ ++ ++ /* Indicate that these can be performed prior to the branch. GCC ++ insists on sinking them below the branch, however; it seems like ++ they'd be better before the branch so that we can cover any latency ++ from storing the argument and loading its high word. Oh well. */ ++ ++ g = b * y; ++ h = 0.5 * y; ++ ++ /* Handle small numbers by scaling. */ ++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) ++ return __ieee754_sqrt (b * two108) * twom54; ++ ++#define FMADD(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ ++ ++ /* Final refinement. */ ++ d = FNMSUB (g, g, b); ++ ++ fesetenv_register (fe); ++ return FMADD (d, h, g); ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_wash (b); ++} +Index: git/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c 2014-08-29 10:34:07.772070587 -0700 +@@ -0,0 +1,101 @@ ++/* Single-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float threehalf = 1.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the reciprocal square root and use that to compute the actual ++ square root. */ ++ ++#ifdef __STDC__ ++float ++__ieee754_sqrtf (float b) ++#else ++float ++__ieee754_sqrtf (b) ++ float b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++#define FMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ double y, x; ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ relax_fenv_state (); ++ ++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ ++ y = FMSUB (threehalf, b, b); ++ ++ /* Initial estimate. */ ++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); ++ ++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ ++ /* All done. */ ++ fesetenv_register (fe); ++ return x * b; ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_washf (b); ++} +Index: git/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c 2014-08-29 10:34:07.772070587 -0700 +@@ -0,0 +1,134 @@ ++/* Double-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float two108 = 3.245185536584267269e+32; ++static const float twom54 = 5.551115123125782702e-17; ++static const float half = 0.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the actual square root and half of its reciprocal ++ simultaneously. */ ++ ++#ifdef __STDC__ ++double ++__ieee754_sqrt (double b) ++#else ++double ++__ieee754_sqrt (b) ++ double b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++ double y, g, h, d, r; ++ ieee_double_shape_type u; ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ u.value = b; ++ ++ relax_fenv_state (); ++ ++ __asm__ ("frsqrte %[estimate], %[x]\n" ++ : [estimate] "=f" (y) : [x] "f" (b)); ++ ++ /* Following Muller et al, page 168, equation 5.20. ++ ++ h goes to 1/(2*sqrt(b)) ++ g goes to sqrt(b). ++ ++ We need three iterations to get within 1ulp. */ ++ ++ /* Indicate that these can be performed prior to the branch. GCC ++ insists on sinking them below the branch, however; it seems like ++ they'd be better before the branch so that we can cover any latency ++ from storing the argument and loading its high word. Oh well. */ ++ ++ g = b * y; ++ h = 0.5 * y; ++ ++ /* Handle small numbers by scaling. */ ++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) ++ return __ieee754_sqrt (b * two108) * twom54; ++ ++#define FMADD(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ r = FNMSUB (g, h, half); ++ g = FMADD (g, r, g); ++ h = FMADD (h, r, h); ++ ++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */ ++ ++ /* Final refinement. */ ++ d = FNMSUB (g, g, b); ++ ++ fesetenv_register (fe); ++ return FMADD (d, h, g); ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_wash (b); ++} +Index: git/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c 2014-08-29 10:34:07.776070587 -0700 +@@ -0,0 +1,101 @@ ++/* Single-precision floating point square root. ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 }; ++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 }; ++static const float threehalf = 1.5; ++ ++/* The method is based on the descriptions in: ++ ++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5; ++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9 ++ ++ We find the reciprocal square root and use that to compute the actual ++ square root. */ ++ ++#ifdef __STDC__ ++float ++__ieee754_sqrtf (float b) ++#else ++float ++__ieee754_sqrtf (b) ++ float b; ++#endif ++{ ++ if (__builtin_expect (b > 0, 1)) ++ { ++#define FMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++#define FNMSUB(a_, c_, b_) \ ++ ({ double __r; \ ++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \ ++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \ ++ __r;}) ++ ++ if (__builtin_expect (b != a_inf.value, 1)) ++ { ++ double y, x; ++ fenv_t fe; ++ ++ fe = fegetenv_register (); ++ ++ relax_fenv_state (); ++ ++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */ ++ y = FMSUB (threehalf, b, b); ++ ++ /* Initial estimate. */ ++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b)); ++ ++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */ ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ x = x * FNMSUB (y, x * x, threehalf); ++ ++ /* All done. */ ++ fesetenv_register (fe); ++ return x * b; ++ } ++ } ++ else if (b < 0) ++ { ++ /* For some reason, some PowerPC32 processors don't implement ++ FE_INVALID_SQRT. */ ++#ifdef FE_INVALID_SQRT ++ feraiseexcept (FE_INVALID_SQRT); ++ ++ fenv_union_t u = { .fenv = fegetenv_register () }; ++ if ((u.l & FE_INVALID) == 0) ++#endif ++ feraiseexcept (FE_INVALID); ++ b = a_nan.value; ++ } ++ return f_washf (b); ++} +Index: git/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies 2014-08-29 10:34:07.776070587 -0700 +@@ -0,0 +1 @@ ++powerpc/powerpc32/603e/fpu +Index: git/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies 2014-08-29 10:34:07.776070587 -0700 +@@ -0,0 +1,2 @@ ++# e300c3 is a variant of 603e so use the same optimizations for sqrt ++powerpc/powerpc32/603e/fpu +Index: git/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies 2014-08-29 10:34:07.776070587 -0700 +@@ -0,0 +1 @@ ++powerpc/powerpc32/e500mc/fpu +Index: git/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies 2014-08-29 10:34:07.776070587 -0700 +@@ -0,0 +1 @@ ++powerpc/powerpc32/e5500/fpu +Index: git/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies 2014-08-29 10:34:07.776070587 -0700 +@@ -0,0 +1 @@ ++powerpc/powerpc32/e6500/fpu +Index: git/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies 2014-08-29 10:34:07.780070587 -0700 +@@ -0,0 +1 @@ ++powerpc/powerpc64/e5500/fpu +Index: git/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies 2014-08-29 10:34:07.780070587 -0700 +@@ -0,0 +1 @@ ++powerpc/powerpc64/e6500/fpu diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/grok_gold.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/grok_gold.patch new file mode 100644 index 0000000..26875c7 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/grok_gold.patch @@ -0,0 +1,34 @@ +Make ld --version output matching grok gold's output + +adapted from from upstream branch roland/gold-vs-libc + +Signed-off-by: Khem Raj +Upstream-Status: Backport + + +Index: git/configure +=================================================================== +--- git.orig/configure 2014-08-29 10:32:34.464070587 -0700 ++++ git/configure 2014-08-29 10:32:34.456070587 -0700 +@@ -4592,7 +4592,7 @@ + # Found it, now check the version. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $LD" >&5 + $as_echo_n "checking version of $LD... " >&6; } +- ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'` ++ ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU [Bbinutilsd][^.]* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*) +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac 2014-08-29 10:32:34.464070587 -0700 ++++ git/configure.ac 2014-08-29 10:32:34.460070587 -0700 +@@ -930,7 +930,7 @@ + [GNU assembler.* \([0-9]*\.[0-9.]*\)], + [2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], AS=: critic_missing="$critic_missing as") + AC_CHECK_PROG_VER(LD, $LD, --version, +- [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)], ++ [GNU [Bbinutilsd][^.]* \([0-9][0-9]*\.[0-9.]*\)], + [2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], LD=: critic_missing="$critic_missing ld") + + # These programs are version sensitive. diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/initgroups_keys.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/initgroups_keys.patch new file mode 100644 index 0000000..32aa15a --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/initgroups_keys.patch @@ -0,0 +1,20 @@ +This is needed since initgroups belongs to NET group +so when NET is disabled in eglibc build then it reports +as undefined symbol + +Signed-off-by: Khem Raj +Upstream-Status: Pending + +Index: git/nss/getent.c +=================================================================== +--- git.orig/nss/getent.c 2014-08-27 05:15:25.996070587 +0000 ++++ git/nss/getent.c 2014-08-27 05:16:00.048070587 +0000 +@@ -879,7 +879,7 @@ + D(group) + D(gshadow) + D(hosts) +-D(initgroups) ++DN(initgroups) + D(netgroup) + D(networks) + D(passwd) diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ld-search-order.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ld-search-order.patch new file mode 100644 index 0000000..f518bc7 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ld-search-order.patch @@ -0,0 +1,56 @@ +Upstream-Status: Inappropriate [embedded specific] + +The default lib search path order is: + + 1) LD_LIBRARY_PATH + 2) RPATH from the binary + 3) ld.so.cache + 4) default search paths embedded in the linker + +For nativesdk binaries which are being used alongside binaries on a host system, we +need the search paths to firstly search the shipped nativesdk libs but then also +cover the host system. For example we want the host system's libGL and this may be +in a non-standard location like /usr/lib/mesa. The only place the location is know +about is in the ld.so.cache of the host system. + +Since nativesdk has a simple structure and doesn't need to use a cache itself, we +repurpose the cache for use as a last resort in finding host system binaries. This +means we need to switch the order of 3 and 4 above to make this work effectively. + +RP 14/10/2010 + +Index: git/elf/dl-load.c +=================================================================== +--- git.orig/elf/dl-load.c 2014-08-28 17:32:46.292070587 -0700 ++++ git/elf/dl-load.c 2014-08-28 17:33:56.048070587 -0700 +@@ -2050,7 +2050,14 @@ + fd = open_path (name, namelen, mode, + &loader->l_runpath_dirs, &realname, &fb, loader, + LA_SER_RUNPATH, &found_other_class); +- ++ /* try the default path. */ ++ if (fd == -1 ++ && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL ++ || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) ++ && rtld_search_dirs.dirs != (void *) -1) ++ fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs, ++ &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); ++ /* Finally try ld.so.cache */ + #ifdef USE_LDCONFIG + if (fd == -1 + && (__glibc_likely ((mode & __RTLD_SECURE) == 0) +@@ -2113,14 +2120,6 @@ + } + #endif + +- /* Finally, try the default path. */ +- if (fd == -1 +- && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL +- || __glibc_likely (!(l->l_flags_1 & DF_1_NODEFLIB))) +- && rtld_search_dirs.dirs != (void *) -1) +- fd = open_path (name, namelen, mode, &rtld_search_dirs, +- &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); +- + /* Add another newline when we are tracing the library loading. */ + if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS)) + _dl_debug_printf ("\n"); diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/mips-rld-map-check.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/mips-rld-map-check.patch new file mode 100644 index 0000000..9f593d6 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/mips-rld-map-check.patch @@ -0,0 +1,27 @@ + +On mips target, binutils currently sets DT_MIPS_RLD_MAP to 0 in dynamic +section if a --version-script sets _RLD_MAP to local. This is apparently +a binutils bug, but libc shouldn't segfault in this case. + +see also: http://sourceware.org/bugilla/show_bug.cgi?id=11615 + +Upstream-Status: Pending + +9/19/2010 - added by Qing He + + +--- +Index: git/sysdeps/mips/dl-machine.h +=================================================================== +--- git.orig/sysdeps/mips/dl-machine.h 2014-08-27 04:58:11.840070587 +0000 ++++ git/sysdeps/mips/dl-machine.h 2014-08-27 04:58:11.832070587 +0000 +@@ -70,7 +70,8 @@ + /* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in + with the run-time address of the r_debug structure */ + #define ELF_MACHINE_DEBUG_SETUP(l,r) \ +-do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \ ++do { if ((l)->l_info[DT_MIPS (RLD_MAP)] && \ ++ (l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) \ + *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \ + (ElfW(Addr)) (r); \ + } while (0) diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/multilib_readlib.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/multilib_readlib.patch new file mode 100644 index 0000000..13ffc46 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/multilib_readlib.patch @@ -0,0 +1,19 @@ +Upstream-Status: Inappropriate [embedded specific] + +Replace the OECORE_KNOWN_INTERPRETER_NAMES with the value of +variable EGLIBC_KNOWN_INTERPRETER_NAMES. + +Lianhao Lu, 08/01/2011 + +Index: git/elf/readlib.c +=================================================================== +--- git.orig/elf/readlib.c 2014-08-29 10:34:16.824070587 -0700 ++++ git/elf/readlib.c 2014-08-29 10:34:16.816070587 -0700 +@@ -51,6 +51,7 @@ + #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES + SYSDEP_KNOWN_INTERPRETER_NAMES + #endif ++ OECORE_KNOWN_INTERPRETER_NAMES + }; + + static struct known_names known_libs[] = diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/option-groups.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/option-groups.patch new file mode 100644 index 0000000..693bd2f --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/option-groups.patch @@ -0,0 +1,1397 @@ +Eglibc option group infrastructure + +Upstream-Status: Pending + +Index: git/option-groups.def +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/option-groups.def 2014-08-27 07:26:51.652070587 +0000 +@@ -0,0 +1,868 @@ ++# This file documents the option groups EGLIBC currently supports, in ++# a format akin to the Linux Kconfig system's. The syntax may change ++# over time. ++# ++# An entry of the form: ++# ++# config GROUP_NAME ++# bool "one-line explanation of what this option group controls" ++# help ++# Multi-line help explaining the option group's meaning in ++# some detail, terminated by indentation level. ++# ++# defines an option group whose variable is GROUP_NAME, with ++# meaningful values 'y' (enabled) and 'n' (disabled). The ++# documentation is formatted to be consumed by some sort of ++# interactive configuration interface, but EGLIBC doesn't have such an ++# interface yet. ++# ++# An option may have a 'depends on' line, indicating which other options ++# must also be enabled if this option is. At present, EGLIBC doesn't ++# check that these dependencies are satisfied. ++# ++# Option group variables get their default values from the file ++# 'option-groups.defaults', in the top directory of the EGLIBC source ++# tree. By default, all EGLIBC option groups are enabled --- their ++# variables are set to 'y'. ++# ++# After including 'option-groups.defaults', the EGLIBC make machinery ++# includes the file 'option-groups.config' from the top of the build ++# tree, if it is present. Developers can place assignments to option ++# group variables in that file to override the defaults. For example, ++# to disable an option group, place a line of the form: ++# ++# OPTION_GROUP_NAME = n ++# ++# in 'option-groups.config' at the top of your build tree. To ++# explicitly enable an option group, you may also write: ++# ++# OPTION_GROUP_NAME = y ++# ++# although this simply reestablishes the value already set by ++# 'option-groups.defaults'. ++ ++config EGLIBC_ADVANCED_INET6 ++ bool "IPv6 Advanced Sockets API support (RFC3542)" ++ depends on EGLIBC_INET ++ help ++ This option group includes the functions specified by RFC 3542, ++ "Advanced Sockets Application Program Interface (API) for ++ IPv6". ++ ++ This option group includes the following functions: ++ ++ inet6_opt_append ++ inet6_opt_find ++ inet6_opt_finish ++ inet6_opt_get_val ++ inet6_opt_init ++ inet6_option_alloc ++ inet6_option_append ++ inet6_option_find ++ inet6_option_init ++ inet6_option_next ++ inet6_option_space ++ inet6_opt_next ++ inet6_opt_set_val ++ inet6_rth_add ++ inet6_rth_getaddr ++ inet6_rth_init ++ inet6_rth_reverse ++ inet6_rth_segments ++ inet6_rth_space ++ ++config EGLIBC_BACKTRACE ++ bool "Functions for producing backtraces" ++ help ++ This option group includes functions for producing a list of ++ the function calls that are currently active in a thread, from ++ within the thread itself. These functions are often used ++ within signal handlers, to produce diagnostic output. ++ ++ This option group includes the following functions: ++ ++ backtrace ++ backtrace_symbols ++ backtrace_symbols_fd ++ ++config EGLIBC_BIG_MACROS ++ bool "Use extensive inline code" ++ help ++ This option group specifies whether certain pieces of code ++ should be inlined to achieve maximum speed. If this option ++ group is not selected, function calls will be used instead, ++ hence reducing the library footprint. ++ ++config EGLIBC_BSD ++ bool "BSD-specific functions, and their compatibility stubs" ++ help ++ This option group includes functions specific to BSD kernels. ++ A number of these functions have stub versions that are also ++ included in libraries built for non-BSD systems for ++ compatibility. ++ ++ This option group includes the following functions: ++ ++ chflags ++ fchflags ++ lchmod ++ revoke ++ setlogin ++ ++config EGLIBC_CXX_TESTS ++ bool "Tests that link against the standard C++ library." ++ depends on POSIX_WIDE_CHAR_DEVICE_IO && EGLIBC_LIBM ++ help ++ This option group does not include any C library functions; ++ instead, it controls which EGLIBC tests an ordinary 'make ++ tests' runs. With this group disabled, tests that would ++ normally link against the standard C++ library are not ++ run. ++ ++ The standard C++ library depends on the math library 'libm' and ++ the wide character I/O functions included in EGLIBC. So those ++ option groups must be enabled if this test is enabled. ++ ++config EGLIBC_CATGETS ++ bool "Functions for accessing message catalogs" ++ depends on EGLIBC_LOCALE_CODE ++ help ++ This option group includes functions for accessing message ++ catalogs: catopen, catclose, and catgets. ++ ++ This option group depends on the EGLIBC_LOCALE_CODE ++ option group. ++ ++config EGLIBC_CHARSETS ++ bool "iconv/gconv character set conversion libraries" ++ help ++ This option group includes support for character sets other ++ than ASCII (ANSI_X3.4-1968) and Unicode and ISO-10646 in their ++ various encodings. This affects both the character sets ++ supported by the wide and multibyte character functions, and ++ those supported by the 'iconv' functions. ++ ++ With this option group disabled, EGLIBC supports only the ++ following character sets: ++ ++ ANSI_X3.4 - ASCII ++ ANSI_X3.4-1968 ++ ANSI_X3.4-1986 ++ ASCII ++ CP367 ++ CSASCII ++ IBM367 ++ ISO-IR-6 ++ ISO646-US ++ ISO_646.IRV:1991 ++ OSF00010020 ++ US ++ US-ASCII ++ ++ 10646-1:1993 - ISO 10646, in big-endian UCS4 form ++ 10646-1:1993/UCS4 ++ CSUCS4 ++ ISO-10646 ++ ISO-10646/UCS4 ++ OSF00010104 ++ OSF00010105 ++ OSF00010106 ++ UCS-4 ++ UCS-4BE ++ UCS4 ++ ++ UCS-4LE - ISO 10646, in little-endian UCS4 form ++ ++ ISO-10646/UTF-8 - ISO 10646, in UTF-8 form ++ ISO-10646/UTF8 ++ ISO-IR-193 ++ OSF05010001 ++ UTF-8 ++ UTF8 ++ ++ ISO-10646/UCS2 - ISO 10646, in target-endian UCS2 form ++ OSF00010100 ++ OSF00010101 ++ OSF00010102 ++ UCS-2 ++ UCS2 ++ ++ UCS-2BE - ISO 10646, in big-endian UCS2 form ++ UNICODEBIG ++ ++ UCS-2LE - ISO 10646, in little-endian UCS2 form ++ UNICODELITTLE ++ ++ WCHAR_T - EGLIBC's internal form (target-endian, ++ 32-bit ISO 10646) ++ ++config EGLIBC_CRYPT ++ bool "Encryption library" ++ help ++ This option group includes the `libcrypt' library which ++ provides functions for one-way encryption. Supported ++ encryption algorithms include MD5, SHA-256, SHA-512 and DES. ++ ++config EGLIBC_CRYPT_UFC ++ bool "Ultra fast `crypt' implementation" ++ depends on EGLIBC_CRYPT ++ help ++ This option group provides ultra fast DES-based implementation of ++ the `crypt' function. When this option group is disabled, ++ (a) the library will not provide the setkey[_r] and encrypt[_r] ++ functions and (b) the crypt[_r] function will return NULL and set the ++ errno to ENOSYS if /salt/ passed does not correspond to either MD5, ++ SHA-256 or SHA-512 algorithm. ++ ++config EGLIBC_DB_ALIASES ++ bool "Functions for accessing the mail aliases database" ++ help ++ This option group includues functions for looking up mail ++ aliases in '/etc/aliases' or using nsswitch. It includes the ++ following functions: ++ ++ endaliasent ++ getaliasbyname ++ getaliasbyname_r ++ getaliasent ++ getaliasent_r ++ setaliasent ++ ++ When this option group is disabled, the NSS service libraries ++ also lack support for querying their mail alias tables. ++ ++config EGLIBC_ENVZ ++ bool "Functions for handling envz-style environment vectors." ++ help ++ This option group contains functions for creating and operating ++ on envz vectors. An "envz vector" is a vector of strings in a ++ contiguous block of memory, where each element is a name-value ++ pair, and elements are separated from their neighbors by null ++ characters. ++ ++ This option group includes the following functions: ++ ++ envz_add envz_merge ++ envz_entry envz_remove ++ envz_get envz_strip ++ ++config EGLIBC_FCVT ++ bool "Functions for converting floating-point numbers to strings" ++ help ++ This option group includes functions for converting ++ floating-point numbers to strings. ++ ++ This option group includes the following functions: ++ ++ ecvt qecvt ++ ecvt_r qecvt_r ++ fcvt qfcvt ++ fcvt_r qfcvt_r ++ gcvt qgcvt ++ ++config EGLIBC_FMTMSG ++ bool "Functions for formatting messages" ++ help ++ This option group includes the following functions: ++ ++ addseverity fmtmsg ++ ++config EGLIBC_FSTAB ++ bool "Access functions for 'fstab'" ++ help ++ This option group includes functions for reading the mount ++ point specification table, '/etc/fstab'. These functions are ++ not included in the POSIX standard, which provides the ++ 'getmntent' family of functions instead. ++ ++ This option group includes the following functions: ++ ++ endfsent getfsspec ++ getfsent setfsent ++ getfsfile ++ ++config EGLIBC_FTRAVERSE ++ bool "Functions for traversing file hierarchies" ++ help ++ This option group includes functions for traversing file ++ UNIX file hierachies. ++ ++ This option group includes the following functions: ++ ++ fts_open ftw ++ fts_read nftw ++ fts_children ftw64 ++ fts_set nftw64 ++ fts_close ++ ++config EGLIBC_GETLOGIN ++ bool "The getlogin function" ++ depends on EGLIBC_UTMP ++ help ++ This function group includes the 'getlogin' and 'getlogin_r' ++ functions, which return the user name associated by the login ++ activity with the current process's controlling terminal. ++ ++ With this option group disabled, the 'glob' function will not ++ fall back on 'getlogin' to find the user's login name for tilde ++ expansion when the 'HOME' environment variable is not set. ++ ++config EGLIBC_IDN ++ bool "International domain names support" ++ help ++ This option group includes the `libcidn' library which ++ provides support for international domain names. ++ ++config EGLIBC_INET ++ bool "Networking support" ++ help ++ This option group includes networking-specific functions and ++ data. With EGLIBC_INET disabled, the EGLIBC ++ installation and API changes as follows: ++ ++ - The following libraries are not installed: ++ ++ libnsl ++ libnss_compat ++ libnss_dns ++ libnss_hesiod ++ libnss_nis ++ libnss_nisplus ++ libresolv ++ ++ - The following functions and variables are omitted from libc: ++ ++ authdes_create hstrerror svc_fdset ++ authdes_getucred htonl svc_getreq ++ authdes_pk_create htons svc_getreq_common ++ authnone_create if_freenameindex svc_getreq_poll ++ authunix_create if_indextoname svc_getreqset ++ authunix_create_default if_nameindex svc_max_pollfd ++ bindresvport if_nametoindex svc_pollfd ++ callrpc in6addr_any svcraw_create ++ cbc_crypt in6addr_loopback svc_register ++ clnt_broadcast inet6_opt_append svc_run ++ clnt_create inet6_opt_find svc_sendreply ++ clnt_pcreateerror inet6_opt_finish svctcp_create ++ clnt_perrno inet6_opt_get_val svcudp_bufcreate ++ clnt_perror inet6_opt_init svcudp_create ++ clntraw_create inet6_option_alloc svcudp_enablecache ++ clnt_spcreateerror inet6_option_append svcunix_create ++ clnt_sperrno inet6_option_find svcunixfd_create ++ clnt_sperror inet6_option_init svc_unregister ++ clnttcp_create inet6_option_next user2netname ++ clntudp_bufcreate inet6_option_space xdecrypt ++ clntudp_create inet6_opt_next xdr_accepted_reply ++ clntunix_create inet6_opt_set_val xdr_array ++ des_setparity inet6_rth_add xdr_authdes_cred ++ ecb_crypt inet6_rth_getaddr xdr_authdes_verf ++ endaliasent inet6_rth_init xdr_authunix_parms ++ endhostent inet6_rth_reverse xdr_bool ++ endnetent inet6_rth_segments xdr_bytes ++ endnetgrent inet6_rth_space xdr_callhdr ++ endprotoent inet_addr xdr_callmsg ++ endrpcent inet_aton xdr_char ++ endservent inet_lnaof xdr_cryptkeyarg ++ ether_aton inet_makeaddr xdr_cryptkeyarg2 ++ ether_aton_r inet_netof xdr_cryptkeyres ++ ether_hostton inet_network xdr_des_block ++ ether_line inet_nsap_addr xdr_double ++ ether_ntoa inet_nsap_ntoa xdr_enum ++ ether_ntoa_r inet_ntoa xdr_float ++ ether_ntohost inet_ntop xdr_free ++ freeaddrinfo inet_pton xdr_getcredres ++ freeifaddrs innetgr xdr_hyper ++ gai_strerror iruserok xdr_int ++ getaddrinfo iruserok_af xdr_int16_t ++ getaliasbyname key_decryptsession xdr_int32_t ++ getaliasbyname_r key_decryptsession_pk xdr_int64_t ++ getaliasent key_encryptsession xdr_int8_t ++ getaliasent_r key_encryptsession_pk xdr_keybuf ++ gethostbyaddr key_gendes xdr_key_netstarg ++ gethostbyaddr_r key_get_conv xdr_key_netstres ++ gethostbyname key_secretkey_is_set xdr_keystatus ++ gethostbyname2 key_setnet xdr_long ++ gethostbyname2_r key_setsecret xdr_longlong_t ++ gethostbyname_r netname2host xdrmem_create ++ gethostent netname2user xdr_netnamestr ++ gethostent_r ntohl xdr_netobj ++ getifaddrs ntohs xdr_opaque ++ getipv4sourcefilter passwd2des xdr_opaque_auth ++ get_myaddress pmap_getmaps xdr_pmap ++ getnameinfo pmap_getport xdr_pmaplist ++ getnetbyaddr pmap_rmtcall xdr_pointer ++ getnetbyaddr_r pmap_set xdr_quad_t ++ getnetbyname pmap_unset xdrrec_create ++ getnetbyname_r rcmd xdrrec_endofrecord ++ getnetent rcmd_af xdrrec_eof ++ getnetent_r registerrpc xdrrec_skiprecord ++ getnetgrent res_init xdr_reference ++ getnetgrent_r rexec xdr_rejected_reply ++ getnetname rexec_af xdr_replymsg ++ getprotobyname rexecoptions xdr_rmtcall_args ++ getprotobyname_r rpc_createerr xdr_rmtcallres ++ getprotobynumber rresvport xdr_short ++ getprotobynumber_r rresvport_af xdr_sizeof ++ getprotoent rtime xdrstdio_create ++ getprotoent_r ruserok xdr_string ++ getpublickey ruserok_af xdr_u_char ++ getrpcbyname ruserpass xdr_u_hyper ++ getrpcbyname_r setaliasent xdr_u_int ++ getrpcbynumber sethostent xdr_uint16_t ++ getrpcbynumber_r setipv4sourcefilter xdr_uint32_t ++ getrpcent setnetent xdr_uint64_t ++ getrpcent_r setnetgrent xdr_uint8_t ++ getrpcport setprotoent xdr_u_long ++ getsecretkey setrpcent xdr_u_longlong_t ++ getservbyname setservent xdr_union ++ getservbyname_r setsourcefilter xdr_unixcred ++ getservbyport svcauthdes_stats xdr_u_quad_t ++ getservbyport_r svcerr_auth xdr_u_short ++ getservent svcerr_decode xdr_vector ++ getservent_r svcerr_noproc xdr_void ++ getsourcefilter svcerr_noprog xdr_wrapstring ++ h_errlist svcerr_progvers xencrypt ++ h_errno svcerr_systemerr xprt_register ++ herror svcerr_weakauth xprt_unregister ++ h_nerr svc_exit ++ host2netname svcfd_create ++ ++ - The rpcgen, nscd, and rpcinfo commands are not installed. ++ ++ - The 'rpc' file (a text file listing RPC services) is not installed. ++ ++ Socket-related system calls do not fall in this option group, ++ because many are also used for other inter-process ++ communication mechanisms. For example, the 'syslog' routines ++ use Unix-domain sockets to communicate with the syslog daemon; ++ syslog is valuable in non-networked contexts. ++ ++config EGLIBC_INET_ANL ++ bool "Asynchronous name lookup" ++ depends on EGLIBC_INET ++ help ++ This option group includes the `libanl' library which ++ provides support for asynchronous name lookup. ++ ++config EGLIBC_LIBM ++ bool "libm (math library)" ++ help ++ This option group includes the 'libm' library, containing ++ mathematical functions. If this option group is omitted, then ++ an EGLIBC installation does not include shared or unshared versions ++ of the math library. ++ ++ Note that this does not remove all floating-point related ++ functionality from EGLIBC; for example, 'printf' and 'scanf' ++ can still print and read floating-point values with this option ++ group disabled. ++ ++ Note that the ISO Standard C++ library 'libstdc++' depends on ++ EGLIBC's math library 'libm'. If you disable this option ++ group, you will not be able to build 'libstdc++' against the ++ resulting EGLIBC installation. ++ ++config EGLIBC_LOCALES ++ bool "Locale definitions" ++ help ++ This option group includes all locale definitions other than ++ that for the "C" locale. If this option group is omitted, then ++ only the "C" locale is supported. ++ ++ ++config EGLIBC_LOCALE_CODE ++ bool "Locale functions" ++ depends on POSIX_C_LANG_WIDE_CHAR ++ help ++ This option group includes locale support functions, programs, ++ and libraries. With EGLIBC_LOCALE_CODE disabled, ++ EGLIBC supports only the 'C' locale (also known as 'POSIX'), ++ and ignores the settings of the 'LANG' and 'LC_*' environment ++ variables. ++ ++ With EGLIBC_LOCALE_CODE disabled, the following ++ functions are omitted from libc: ++ ++ duplocale localeconv nl_langinfo rpmatch strfmon_l ++ freelocale newlocale nl_langinfo_l strfmon uselocale ++ ++ Furthermore, only the LC_CTYPE and LC_TIME categories of the ++ standard "C" locale are available. ++ ++ The EGLIBC_CATGETS option group depends on this option group. ++ ++ ++config EGLIBC_MEMUSAGE ++ bool "Memory profiling library" ++ help ++ This option group includes the `libmemusage' library and ++ the `memusage' and `memusagestat' utilities. ++ These components provide memory profiling functions. ++ ++config EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE ++ int "Memory profiling library buffer size" ++ depends on EGLIBC_MEMUSAGE ++ default "32768" ++ help ++ Libmemusage library buffers the profiling data in memory ++ before writing it out to disk. By default, the library ++ allocates 1.5M buffer, which can be substantial for some ++ systems. EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE option ++ allows to change the default buffer size. It specifies ++ the number of entries the buffer should have. ++ On most architectures one buffer entry amounts to 48 bytes, ++ so setting this option to the value of 512 will reduce the size of ++ the memory buffer to 24K. ++ ++config EGLIBC_NIS ++ bool "Support for NIS, NIS+, and the special 'compat' services." ++ depends on EGLIBC_INET && EGLIBC_SUNRPC ++ help ++ This option group includes the NIS, NIS+, and 'compat' Name ++ Service Switch service libraries. When it is disabled, those ++ services libraries are not installed; you should remove any ++ references to them from your 'nsswitch.conf' file. ++ ++ This option group depends on the EGLIBC_INET option ++ group; you must enable that to enable this option group. ++ ++config EGLIBC_NSSWITCH ++ bool "Name service switch (nsswitch) support" ++ help ++ This option group includes support for the 'nsswitch' facility. ++ With this option group enabled, all EGLIBC functions for ++ accessing various system databases (passwords and groups; ++ networking; aliases; public keys; and so on) consult the ++ '/etc/nsswitch.conf' configuration file to decide how to handle ++ queries. ++ ++ With this option group disabled, EGLIBC uses a fixed list of ++ services to satisfy queries on each database, as requested by ++ configuration files specified when EGLIBC is built. Your ++ 'option-groups.config' file must set the following two ++ variables: ++ ++config EGLIBC_NSSWITCH_FIXED_CONFIG ++ string "Nsswitch fixed config filename" ++ depends on !EGLIBC_NSSWITCH ++ default "" ++ help ++ Set this to the name of a file whose contents observe the ++ same syntax as an ordinary '/etc/nsswitch.conf' file. The ++ EGLIBC build process parses this file just as EGLIBC would ++ at run time if EGLIBC_NSSWITCH were enabled, and ++ produces a C library that uses the nsswitch service ++ libraries to search for database entries as this file ++ specifies, instead of consulting '/etc/nsswitch.conf' at run ++ time. ++ ++ This should be an absolute filename. The EGLIBC build ++ process may use it from several different working ++ directories. It may include references to Makefile ++ variables like 'common-objpfx' (the top of the build tree, ++ with a trailing slash), or '..' (the top of the source tree, ++ with a trailing slash). ++ ++ The EGLIBC source tree includes a sample configuration file ++ named 'nss/fixed-nsswitch.conf'; for simple configurations, ++ you will probably want to delete references to databases not ++ needed on your system. ++ ++config EGLIBC_NSSWITCH_FIXED_FUNCTIONS ++ string "Nsswitch fixed functions filename" ++ depends on !EGLIBC_NSSWITCH ++ default "" ++ help ++ The EGLIBC build process uses this file to decide which ++ functions to make available from which service libraries. ++ The file 'nss/fixed-nsswitch.functions' serves as a sample ++ configuration file for this setting, and explains its syntax ++ and meaning in more detail. ++ ++ This should be an absolute file name. The EGLIBC build ++ process may use it from several different working ++ directories. It may include references to Makefile ++ variables like 'common-objpfx' (the top of the build tree, ++ with a trailing slash), or '..' (the top of the source tree, ++ with a trailing slash). ++ ++ Be sure to mention each function in each service you wish to ++ use. If you do not mention a service's function here, the ++ EGLIBC database access functions will not find it, even if ++ it is listed in the EGLIBC_NSSWITCH_FIXED_CONFIG ++ file. ++ ++ In this arrangement, EGLIBC will not use the 'dlopen' and ++ 'dlsym' functions to find database access functions. Instead, ++ libc hard-codes references to the service libraries' database ++ access functions. You must explicitly link your program ++ against the name service libraries (those whose names start ++ with 'libnss_', in the sysroot's '/lib' directory) whose ++ functions you intend to use. This arrangement helps ++ system-wide static analysis tools decide which functions a ++ system actually uses. ++ ++ Note that some nsswitch service libraries require other option ++ groups to be enabled; for example, the EGLIBC_INET ++ option group must be enabled to use the 'libnss_dns.so.2' ++ service library, which uses the Domain Name System network ++ protocol to answer queries. ++ ++config EGLIBC_RCMD ++ bool "Support for 'rcmd' and related library functions" ++ depends on EGLIBC_INET ++ help ++ This option group includes functions for running commands on ++ remote machines via the 'rsh' protocol, and doing authentication ++ related to those functions. This also includes functions that ++ use the 'rexec' protocol. ++ ++ This option group includes the following functions: ++ ++ rcmd ruserok ++ rcmd_af ruserok_af ++ rexec iruserok ++ rexec_af iruserok_af ++ rresvport ruserpass ++ rresvport_af ++ ++config EGLIBC_RTLD_DEBUG ++ bool "Runtime linker debug print outs" ++ help ++ This option group enables debug output of the runtime linker ++ which is activated via LD_DEBUG and LD_TRACE_PRELINKING ++ environment variables. Disabling this option group yields ++ a smaller runtime linker binary. ++ BEWARE: Disabling this option group is likely to break ++ the `ldd' utility which may also be used by the prelinker. ++ In particular, the `--unused' ldd option will not work correctly. ++ ++config EGLIBC_SPAWN ++ bool "Support for POSIX posix_spawn functions" ++ help ++ This option group includes the POSIX functions for executing ++ programs in child processes without using 'fork' or 'vfork'. ++ ++ This option group includes the following functions: ++ ++ posix_spawn ++ posix_spawnattr_destroy ++ posix_spawnattr_getflags ++ posix_spawnattr_getpgroup ++ posix_spawnattr_getschedparam ++ posix_spawnattr_getschedpolicy ++ posix_spawnattr_getsigdefault ++ posix_spawnattr_getsigmask ++ posix_spawnattr_init ++ posix_spawnattr_setflags ++ posix_spawnattr_setpgroup ++ posix_spawnattr_setschedparam ++ posix_spawnattr_setschedpolicy ++ posix_spawnattr_setsigdefault ++ posix_spawnattr_setsigmask ++ posix_spawn_file_actions_addclose ++ posix_spawn_file_actions_adddup2 ++ posix_spawn_file_actions_addopen ++ posix_spawn_file_actions_destroy ++ posix_spawn_file_actions_init ++ posix_spawnp ++ ++ This option group also provides the ability for the iconv, ++ localedef, and locale programs to operate transparently on ++ compressed charset definitions. When this option group is ++ disabled, those programs will only operate on uncompressed ++ charmap files. ++ ++config EGLIBC_STREAMS ++ bool "Support for accessing STREAMS." ++ help ++ This option group includes functions for reading and writing ++ messages to and from STREAMS. The STREAMS interface provides a ++ uniform mechanism for implementing networking services and other ++ character-based I/O. (STREAMS are not to be confused with ++ FILE objects, also called 'streams'.) ++ ++ This option group includes the following functions: ++ ++ getmsg putpmsg ++ getpmsg fattach ++ isastream fdetach ++ putmsg ++ ++config EGLIBC_SUNRPC ++ bool "Support for the Sun 'RPC' protocol." ++ depends on EGLIBC_INET ++ help ++ This option group includes support for the Sun RPC protocols, ++ including the 'rpcgen' and 'rpcinfo' programs. ++ ++config EGLIBC_UTMP ++ bool "Older access functions for 'utmp' login records" ++ help ++ This option group includes the older 'utent' family of ++ functions for accessing user login records in the 'utmp' file. ++ POSIX omits these functions in favor of the 'utxent' family, ++ and they are obsolete on systems other than Linux. ++ ++ This option group includes the following functions: ++ ++ endutent ++ getutent ++ getutent_r ++ getutid ++ getutid_r ++ getutline ++ getutline_r ++ logwtmp ++ pututline ++ setutent ++ updwtmp ++ utmpname ++ ++ This option group includes the following libraries: ++ ++ libutil.so (and libutil.a) ++ ++config EGLIBC_UTMPX ++ bool "POSIX access functions for 'utmp' login records" ++ depends on EGLIBC_UTMP ++ help ++ This option group includes the POSIX functions for reading and ++ writing user login records in the 'utmp' file (usually ++ '/var/run/utmp'). The POSIX functions operate on 'struct ++ utmpx' structures, as opposed to the family of older 'utent' ++ functions, which operate on 'struct utmp' structures. ++ ++ This option group includes the following functions: ++ ++ endutxent ++ getutmp ++ getutmpx ++ getutxent ++ getutxid ++ getutxline ++ pututxline ++ setutxent ++ updwtmpx ++ utmpxname ++ ++config EGLIBC_WORDEXP ++ bool "Shell-style word expansion" ++ help ++ This option group includes the 'wordexp' function for ++ performing word expansion in the manner of the shell, and the ++ accompanying 'wordfree' function. ++ ++config POSIX_C_LANG_WIDE_CHAR ++ bool "ISO C library wide character functions, excluding I/O" ++ help ++ This option group includes the functions defined by the ISO C ++ standard for working with wide and multibyte characters in ++ memory. Functions for reading and writing wide and multibyte ++ characters from and to files call in the ++ POSIX_WIDE_CHAR_DEVICE_IO option group. ++ ++ This option group includes the following functions: ++ ++ btowc mbsinit wcscspn wcstoll ++ iswalnum mbsrtowcs wcsftime wcstombs ++ iswalpha mbstowcs wcslen wcstoul ++ iswblank mbtowc wcsncat wcstoull ++ iswcntrl swprintf wcsncmp wcstoumax ++ iswctype swscanf wcsncpy wcsxfrm ++ iswdigit towctrans wcspbrk wctob ++ iswgraph towlower wcsrchr wctomb ++ iswlower towupper wcsrtombs wctrans ++ iswprint vswprintf wcsspn wctype ++ iswpunct vswscanf wcsstr wmemchr ++ iswspace wcrtomb wcstod wmemcmp ++ iswupper wcscat wcstof wmemcpy ++ iswxdigit wcschr wcstoimax wmemmove ++ mblen wcscmp wcstok wmemset ++ mbrlen wcscoll wcstol ++ mbrtowc wcscpy wcstold ++ ++config POSIX_REGEXP ++ bool "Regular expressions" ++ help ++ This option group includes the POSIX regular expression ++ functions, and the associated non-POSIX extensions and ++ compatibility functions. ++ ++ With POSIX_REGEXP disabled, the following functions are ++ omitted from libc: ++ ++ re_comp re_max_failures regcomp ++ re_compile_fastmap re_search regerror ++ re_compile_pattern re_search_2 regexec ++ re_exec re_set_registers regfree ++ re_match re_set_syntax rpmatch ++ re_match_2 re_syntax_options ++ ++ Furthermore, the compatibility regexp interface defined in the ++ header file, 'compile', 'step', and 'advance', is ++ omitted. ++ ++config POSIX_REGEXP_GLIBC ++ bool "Regular expressions from GLIBC" ++ depends on POSIX_REGEXP ++ help ++ This option group specifies which regular expression ++ library to use. The choice is between regex ++ implementation from GLIBC and regex implementation from ++ libiberty. The GLIBC variant is fully POSIX conformant and ++ optimized for speed; regex from libiberty is more than twice ++ as small while still is enough for most practical purposes. ++ ++config POSIX_WIDE_CHAR_DEVICE_IO ++ bool "Input and output functions for wide characters" ++ depends on POSIX_C_LANG_WIDE_CHAR ++ help ++ This option group includes functions for reading and writing ++ wide characters to and from streams. ++ ++ This option group includes the following functions: ++ ++ fgetwc fwprintf putwchar vwscanf ++ fgetws fwscanf ungetwc wprintf ++ fputwc getwc vfwprintf wscanf ++ fputws getwchar vfwscanf ++ fwide putwc vwprintf ++ ++ This option group further includes the following unlocked ++ variants of the above functions: ++ ++ fgetwc_unlocked getwc_unlocked ++ fgetws_unlocked getwchar_unlocked ++ fputwc_unlocked putwc_unlocked ++ fputws_unlocked putwchar_unlocked ++ ++ Note that the GNU standard C++ library, 'libstdc++.so', uses ++ some of these functions; you will not be able to link or run ++ C++ programs if you disable this option group. ++ ++ This option group also affects the behavior of the following ++ functions: ++ ++ fdopen ++ fopen ++ fopen64 ++ freopen ++ freopen64 ++ ++ These functions all take an OPENTYPE parameter which may ++ contain a string of the form ",ccs=CHARSET", indicating that ++ the underlying file uses the character set named CHARSET. ++ This produces a wide-oriented stream, which is only useful ++ when the functions included in this option group are present. ++ If the user attempts to open a file specifying a character set ++ in the OPENTYPE parameter, and EGLIBC was built with this ++ option group disabled, the function returns NULL, and sets ++ errno to EINVAL. ++ ++ ++# This helps Emacs users browse this file using the page motion commands ++# and commands like 'pages-directory'. ++# Local Variables: ++# page-delimiter: "^config\\s-" ++# End: +Index: git/option-groups.mak +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/option-groups.mak 2014-08-27 07:26:51.652070587 +0000 +@@ -0,0 +1,41 @@ ++# Setup file for subdirectory Makefiles that define EGLIBC option groups. ++ ++# EGLIBC shouldn't need to override this. However, the ++# cross-build-friendly localedef includes this makefile to get option ++# group variable definitions; it uses a single build tree for all the ++# multilibs, and needs to be able to specify a different option group ++# configuration file for each multilib. ++option_group_config_file ?= $(objdir)/option-groups.config ++ ++# Read the default settings for all options. ++# We're included before ../Rules, so we can't assume $(..) is set. ++include $(firstword $(..) ../)option-groups.defaults ++ ++# Read the developer's option group selections, overriding the ++# defaults from option-groups.defaults. ++-include $(option_group_config_file) ++ ++# $(call option-disabled, VAR) is 'y' if VAR is not 'y', or 'n' otherwise. ++# VAR should be a variable name, not a variable reference; this is ++# less general, but more terse for the intended use. ++# You can use it to add a file to a list if an option group is ++# disabled, like this: ++# routines-$(call option-disabled, OPTION_POSIX_C_LANG_WIDE_CHAR) += ... ++define option-disabled ++$(firstword $(subst y,n,$(filter y,$($(strip $(1))))) y) ++endef ++ ++# Establish 'routines-y', etc. as simply-expanded variables. ++aux-y := ++extra-libs-others-y := ++extra-libs-y := ++extra-objs-y := ++install-bin-y := ++install-others-y := ++install-sbin-y := ++others-y := ++others-pie-y := ++routines-y := ++test-srcs-y := ++tests-y := ++xtests-y := +Index: git/option-groups.defaults +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/option-groups.defaults 2014-08-27 07:24:41.652070587 +0000 +@@ -0,0 +1,47 @@ ++# This file sets default values for all option group variables ++# mentioned in option-groups.def; see that file for a description of ++# each option group. ++# ++# Subdirectory makefiles include this file before including the user's ++# settings from option-groups.config at the top of the build tree; ++# that file need only refer to those options whose default settings ++# are to be changed. ++# ++# By default, all option groups are enabled. ++OPTION_EGLIBC_ADVANCED_INET6 = y ++OPTION_EGLIBC_BACKTRACE = y ++OPTION_EGLIBC_BIG_MACROS = y ++OPTION_EGLIBC_BSD = y ++OPTION_EGLIBC_CXX_TESTS = y ++OPTION_EGLIBC_CATGETS = y ++OPTION_EGLIBC_CHARSETS = y ++OPTION_EGLIBC_CRYPT = y ++OPTION_EGLIBC_CRYPT_UFC = y ++OPTION_EGLIBC_DB_ALIASES = y ++OPTION_EGLIBC_ENVZ = y ++OPTION_EGLIBC_FCVT = y ++OPTION_EGLIBC_FMTMSG = y ++OPTION_EGLIBC_FSTAB = y ++OPTION_EGLIBC_FTRAVERSE = y ++OPTION_EGLIBC_GETLOGIN = y ++OPTION_EGLIBC_IDN = y ++OPTION_EGLIBC_INET = y ++OPTION_EGLIBC_INET_ANL = y ++OPTION_EGLIBC_LIBM = y ++OPTION_EGLIBC_LOCALES = y ++OPTION_EGLIBC_LOCALE_CODE = y ++OPTION_EGLIBC_MEMUSAGE = y ++OPTION_EGLIBC_NIS = y ++OPTION_EGLIBC_NSSWITCH = y ++OPTION_EGLIBC_RCMD = y ++OPTION_EGLIBC_RTLD_DEBUG = y ++OPTION_EGLIBC_SPAWN = y ++OPTION_EGLIBC_STREAMS = y ++OPTION_EGLIBC_SUNRPC = y ++OPTION_EGLIBC_UTMP = y ++OPTION_EGLIBC_UTMPX = y ++OPTION_EGLIBC_WORDEXP = y ++OPTION_POSIX_C_LANG_WIDE_CHAR = y ++OPTION_POSIX_REGEXP = y ++OPTION_POSIX_REGEXP_GLIBC = y ++OPTION_POSIX_WIDE_CHAR_DEVICE_IO = y +Index: git/Makefile +=================================================================== +--- git.orig/Makefile 2014-08-27 07:24:37.540070587 +0000 ++++ git/Makefile 2014-08-27 07:24:41.656070587 +0000 +@@ -24,6 +24,7 @@ + + include Makeconfig + ++include options-config/Makefile + + # This is the default target; it makes everything except the tests. + .PHONY: all +Index: git/EGLIBC.option-groups +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/EGLIBC.option-groups 2014-08-27 07:24:41.656070587 +0000 +@@ -0,0 +1,122 @@ ++ -*- mode: text -*- ++ ++ The EGLIBC Component Configuration System ++ Jim Blandy ++ ++Introduction ++ ++The GNU C library (GLIBC) provides a broad range of functionality, ++ranging from internationalization support to transcendental ++mathematical functions. Its website boasts that "nearly all known and ++useful functions from any other C library are available." This ++exhaustive approach has been one of GLIBC's strengths on desktop and ++server systems, but it has also given GLIBC a large footprint, both in ++memory and on disk, making it a challenge to use in embedded systems ++with limited resources. ++ ++The Embedded GNU C library (EGLIBC) is a variant of the GNU C library ++designed to work well on embedded systems. In particular, EGLIBC's ++component configuration system allows embedded developers to build ++customized versions of the library that include only the features ++their application uses, reducing its space requirements. ++ ++EGLIBC's component configuration system categorizes the library's ++functions into "option groups", and allows you to include or exclude ++option groups individually. Some option groups depend on others; ++EGLIBC tracks these relationships, and ensures that the selected ++configuration yields a functioning library. ++ ++ ++Consistent and Predictable Behavior ++ ++A flexible configuration system is a mixed blessing: if the options ++offered are poorly designed, it can be hard to see which choices will ++have the desired effects, and choices with obscure consequences can ++make debugging difficult. EGLIBC's configuration follows some general ++principles to reduce these risks: ++ ++- EGLIBC has a single default configuration for each target ++ architecture. ++ ++- In the default configuration, all option groups are enabled, and ++ EGLIBC is upwardly API- and ABI-compatible with GLIBC. ++ ++- As much as possible, configurations only affect what functions are ++ present, not how they behave. If the system works with an option ++ group disabled, it will still work with it enabled. ++ ++- As much as possible, configurations only select option groups --- ++ they do not describe characteristics of the target architecture. ++ ++These rules mean that you have a simple debugging strategy available ++if you suspect that your EGLIBC configuration might be the source of a ++problem: fall back to the default configuration, re-test, and then ++disable option groups one by one, until the problem reappears. ++ ++ ++The Option Groups ++ ++To see the current full list of implemented option groups, refer to the ++file 'option-groups.def' at the top of the source tree, or run ++'make menuconfig' from the top-level build directory. ++ ++The POSIX.1-2001 specification includes a suggested partition of all ++the functions in the POSIX C API into option groups: math functions ++like 'sin' and 'cos'; networking functions like 'socket' and ++'connect'; and so on. EGLIBC could use this partitioning as the basis ++for future option groups. ++ ++ ++Implementation ++ ++The EGLIBC component configuration system resembles the approach used ++by the Linux kernel to select device drivers, network protocols, and ++other features. A file named 'option-groups.config' in the top-level ++build directory contains assignments to Make variables, each of which ++enables or disables a particular option group. If the variable's ++value is set to 'y', then the option group is enabled; if it set to ++anything else, the option group is omitted. The file ++'option-groups.defaults', at the top of the source tree, establishes ++default values for all variables; all option groups are enabled by ++default. ++ ++For example, the following 'option-groups.config' would omit locale ++data, but include mathematical functions, and everything else: ++ ++ OPTION_EGLIBC_LOCALES = n ++ OPTION_EGLIBC_LIBM = y ++ ++Like the Linux kernel, EGLIBC supports a similar set of '*config' make ++targets to make it easier to create 'option-groups.config', with all ++dependencies between option groups automatically satisfied. Run ++'make help' to see the list of supported make config targets. For ++example, 'make menuconfig' will update the current config utilising a ++menu based program. ++ ++The option group names and their type (boolean, int, hex, string), help ++description, and dependencies with other option groups, are described by ++'option-groups.def' at the top of the source tree, analogous to the ++'Kconfig' files in the Linux kernel. ++ ++In general, each option group variable controls whether a given set of ++object files in EGLIBC is compiled and included in the final ++libraries, or omitted from the build. ++ ++Each subdirectory's Makefile categorizes its routines, libraries, and ++executables by option group. For example, EGLIBC's 'math/Makefile' ++places the 'libm' library in the OPTION_EGLIBC_LIBM group as follows: ++ ++ extra-libs-$(OPTION_EGLIBC_LIBM) := libm ++ ++Finally, common code in 'Makerules' cites the value of the variable ++'extra-libs-y', selecting only those libraries that belong to enabled ++option groups to be built. ++ ++ ++Current Status and Future Directions ++ ++The EGLIBC component configuration system described here is still ++under development. ++ ++We have used the system to subset some portions of EGLIBC's ++Index: libc/configure.ac +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac 2014-08-27 07:24:41.196070587 +0000 ++++ git/configure.ac 2014-08-27 07:24:41.656070587 +0000 +@@ -127,6 +127,16 @@ + [sysheaders='']) + AC_SUBST(sysheaders) + ++AC_ARG_WITH([kconfig], ++ AC_HELP_STRING([--with-kconfig=PATH], ++ [location of kconfig tools to use (from Linux ++ kernel builds) to re-use for configuring EGLIBC ++ option groups]), ++ [KCONFIG_TOOLS=$withval], ++ [KCONFIG_TOOLS='']) ++AC_SUBST(KCONFIG_TOOLS) ++ ++ + AC_SUBST(use_default_link) + AC_ARG_WITH([default-link], + AC_HELP_STRING([--with-default-link], +Index: git/config.make.in +=================================================================== +--- git.orig/config.make.in 2014-08-27 07:24:37.560070587 +0000 ++++ git/config.make.in 2014-08-27 07:24:41.656070587 +0000 +@@ -46,6 +46,8 @@ + c++-sysincludes = @CXX_SYSINCLUDES@ + all-warnings = @all_warnings@ + ++kconfig_tools = @KCONFIG_TOOLS@ ++ + have-z-combreloc = @libc_cv_z_combreloc@ + have-z-execstack = @libc_cv_z_execstack@ + have-Bgroup = @libc_cv_Bgroup@ +Index: git/configure +=================================================================== +--- git.orig/configure 2014-08-27 07:24:41.192070587 +0000 ++++ git/configure 2014-08-27 07:24:41.660070587 +0000 +@@ -619,6 +619,7 @@ + PERL + BASH_SHELL + libc_cv_gcc_static_libgcc ++KCONFIG_TOOLS + CXX_SYSINCLUDES + SYSINCLUDES + AUTOCONF +@@ -733,6 +734,7 @@ + with_binutils + with_selinux + with_headers ++with_kconfig + with_default_link + enable_sanity_checks + enable_shared +@@ -1437,6 +1439,9 @@ + --with-selinux if building with SELinux support + --with-headers=PATH location of system headers to use (for example + /usr/src/linux/include) [default=compiler default] ++ --with-kconfig=PATH location of kconfig tools to use (from Linux kernel ++ builds) to re-use for configuring EGLIBC option ++ groups + --with-default-link do not use explicit linker scripts + --with-cpu=CPU select code for CPU variant + +@@ -3400,6 +3405,14 @@ + + + ++# Check whether --with-kconfig was given. ++if test "${with_kconfig+set}" = set; then ++ withval=$with_kconfig; KCONFIG_TOOLS=$withval ++else ++ KCONFIG_TOOLS='' ++fi ++ ++ + + # Check whether --with-default-link was given. + if test "${with_default_link+set}" = set; then : +Index: git/options-config/Makefile +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/options-config/Makefile 2014-08-27 07:24:41.652070587 +0000 +@@ -0,0 +1,55 @@ ++# =========================================================================== ++# EGLIBC option-groups configuration targets ++# These targets are included from top-level makefile ++ ++ifneq ($(kconfig_tools),) ++ifneq (no,$(PERL)) ++ ++ocdir := options-config ++ ++OconfigDefaults := option-groups.defaults ++OconfigDefaults_tmp := $(common-objpfx).tmp.defconfig ++OconfigDef := option-groups.def ++Oconfig := $(common-objpfx)option-groups.config ++Oconfig_tmp := $(common-objpfx).tmp.config ++ ++conf := $(kconfig_tools)/conf ++mconf := $(kconfig_tools)/mconf ++ ++preproc := $(PERL) $(ocdir)/config-preproc.pl ++postproc := $(PERL) $(ocdir)/config-postproc.pl ++ ++PHONY += defconfig config menuconfig ++ ++defconfig: $(conf) $(OconfigDefaults) $(OconfigDef) ++ rm -f $(OconfigDefaults_tmp) ++ rm -f $(Oconfig_tmp) ++ $(preproc) $(OconfigDefaults) > $(OconfigDefaults_tmp) ++ KCONFIG_CONFIG=$(Oconfig_tmp) $< --defconfig=$(OconfigDefaults_tmp) \ ++ $(OconfigDef) ++ $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig) ++ rm $(Oconfig_tmp) ++ rm $(OconfigDefaults_tmp) ++ ++config: $(conf) $(OconfigDefaults) $(OconfigDef) ++ rm -f $(Oconfig_tmp) ++ $(preproc) $(wildcard $(Oconfig)) > $(Oconfig_tmp) ++ KCONFIG_CONFIG=$(Oconfig_tmp) $< --oldaskconfig $(OconfigDef) ++ $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig) ++ rm $(Oconfig_tmp) ++ ++menuconfig: $(mconf) $(OconfigDefaults) $(OconfigDef) ++ rm -f $(Oconfig_tmp) ++ $(preproc) $(wildcard $(Oconfig)) > $(Oconfig_tmp) ++ KCONFIG_CONFIG=$(Oconfig_tmp) $< $(OconfigDef) ++ $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig) ++ rm $(Oconfig_tmp) ++ ++# Help text used by make help ++help: ++ @echo ' defconfig - New config with default from default config' ++ @echo ' config - Update current config utilising a line-oriented program' ++ @echo ' menuconfig - Update current config utilising a menu based program' ++ ++endif ++endif +Index: git/options-config/config-postproc.pl +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/options-config/config-postproc.pl 2014-08-27 07:24:41.652070587 +0000 +@@ -0,0 +1,58 @@ ++#!/usr/bin/perl ++ ++$usage = "usage: $0 \n"; ++ ++die "$usage" unless @ARGV; ++$defaults = shift @ARGV; ++die "$usage" unless @ARGV; ++die "Could not open $ARGV[0]" unless -T $ARGV[0]; ++ ++sub yank { ++ @option = grep(!($_ =~ /$_[0]\s*=/), @option); ++} ++ ++open(DEFAULTS, $defaults) || die "Could not open $defaults\n"; ++ ++# get the full list of available options using the default config file ++$i = 0; ++while () { ++ if (/^\s*OPTION_(\w+\s*=.*$)/) { ++ $option[$i++] = $1; ++ } ++} ++ ++# now go through the config file, making the necessary changes ++while (<>) { ++ if (/Linux Kernel Configuration/) { ++ # change title ++ s/Linux Kernel/Option Groups/; ++ print; ++ } elsif (/^\s*CONFIG_(\w+)\s*=/) { ++ # this is an explicit option set line, change CONFIG_ to OPTION_ ++ # before printing and remove this option from option list ++ $opt = $1; ++ yank($opt); ++ s/CONFIG_/OPTION_/g; ++ print; ++ } elsif (/^\s*#\s+CONFIG_(\w+) is not set/) { ++ # this is a comment line for an unset boolean option, change CONFIG_ ++ # to OPTION_, remove this option from option list, and convert to ++ # explicit OPTION_FOO=n ++ $opt = $1; ++ yank($opt); ++ s/CONFIG_/OPTION_/g; ++ print "OPTION_$opt=n\n"; ++ } else { ++ print; ++ } ++} ++ ++# any boolean options left in @options, are options that were not mentioned in ++# the config file, and implicitly that means the option must be set =n, ++# so do that here. ++foreach $opt (@option) { ++ if ($opt =~ /=\s*[yn]/) { ++ $opt =~ s/=\s*[yn]/=n/; ++ print "OPTION_$opt\n"; ++ } ++} +Index: git/options-config/config-preproc.pl +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/options-config/config-preproc.pl 2014-08-27 07:24:41.652070587 +0000 +@@ -0,0 +1,8 @@ ++#!/usr/bin/perl ++ ++if (@ARGV) { ++ while (<>) { ++ s/OPTION_/CONFIG_/g; ++ print; ++ } ++} +Index: git/scripts/option-groups.awk +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/scripts/option-groups.awk 2014-08-27 07:26:51.652070587 +0000 +@@ -0,0 +1,63 @@ ++# option-groups.awk --- generate option group header file ++# Given input files containing makefile-style assignments to variables, ++# print out a header file that #defines an appropriate preprocessor ++# symbol for each variable left set to 'y'. ++ ++BEGIN { FS="=" } ++ ++# Trim spaces. ++{ gsub (/[[:blank:]]/, "") } ++ ++# Skip comments. ++/^#/ { next } ++ ++# Process assignments. ++NF == 2 { ++ vars[$1] = $2 ++} ++ ++# Print final values. ++END { ++ print "/* This file is automatically generated by scripts/option-groups.awk" ++ print " in the EGLIBC source tree." ++ print "" ++ print " It defines macros that indicate which EGLIBC option groups were" ++ print " configured in 'option-groups.config' when this C library was" ++ print " built. For each option group named OPTION_foo, it #defines" ++ print " __OPTION_foo to be 1 if the group is enabled, or leaves that" ++ print " symbol undefined if the group is disabled. */" ++ print "" ++ print "#ifndef __GNU_OPTION_GROUPS_H" ++ print "#define __GNU_OPTION_GROUPS_H" ++ print "" ++ ++ # Produce a sorted list of variable names. ++ i=0 ++ for (var in vars) ++ names[i++] = var ++ n = asort (names) ++ ++ for (i = 1; i <= n; i++) ++ { ++ var = names[i] ++ if (var ~ /^OPTION_/) ++ { ++ if (vars[var] == "y") ++ print "#define __" var " 1" ++ else if (vars[var] == "n") ++ print "/* #undef __" var " */" ++ else if (vars[var] ~ /^[0-9]+/ || ++ vars[var] ~ /^0x[0-9aAbBcCdDeEfF]+/ || ++ vars[var] ~ /^\"/) ++ print "#define __" var " " vars[var] ++ else ++ print "/* #undef __" var " */" ++ # Ignore variables that don't have boolean, int, hex, or ++ # string values. Ideally, this would be driven by the types ++ # given in option-groups.def. ++ } ++ } ++ ++ print "" ++ print "#endif /* __GNU_OPTION_GROUPS_H */" ++} diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ppc-sqrt_finite.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ppc-sqrt_finite.patch new file mode 100644 index 0000000..6ea666b --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ppc-sqrt_finite.patch @@ -0,0 +1,184 @@ +on ppc fixes the errors like below +| ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite' +| collect2: ld returned 1 exit status + +Upstream-Status: Pending + +ChangeLog + +2012-01-06 Khem Raj + + * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Add __*_finite alias. + Remove cruft. + * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Ditto. + * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: Ditto. + * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c: Ditto. + +Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c +@@ -39,14 +39,8 @@ static const float half = 0.5; + We find the actual square root and half of its reciprocal + simultaneously. */ + +-#ifdef __STDC__ + double + __ieee754_sqrt (double b) +-#else +-double +-__ieee754_sqrt (b) +- double b; +-#endif + { + if (__builtin_expect (b > 0, 1)) + { +@@ -132,3 +126,4 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c +@@ -37,14 +37,8 @@ static const float threehalf = 1.5; + We find the reciprocal square root and use that to compute the actual + square root. */ + +-#ifdef __STDC__ + float + __ieee754_sqrtf (float b) +-#else +-float +-__ieee754_sqrtf (b) +- float b; +-#endif + { + if (__builtin_expect (b > 0, 1)) + { +@@ -99,3 +93,4 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c +@@ -39,14 +39,8 @@ static const float half = 0.5; + We find the actual square root and half of its reciprocal + simultaneously. */ + +-#ifdef __STDC__ + double + __ieee754_sqrt (double b) +-#else +-double +-__ieee754_sqrt (b) +- double b; +-#endif + { + if (__builtin_expect (b > 0, 1)) + { +@@ -132,3 +126,4 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c +@@ -37,14 +37,8 @@ static const float threehalf = 1.5; + We find the reciprocal square root and use that to compute the actual + square root. */ + +-#ifdef __STDC__ + float + __ieee754_sqrtf (float b) +-#else +-float +-__ieee754_sqrtf (b) +- float b; +-#endif + { + if (__builtin_expect (b > 0, 1)) + { +@@ -99,3 +93,4 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c +@@ -132,3 +132,4 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c +@@ -99,3 +99,4 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c +@@ -132,3 +132,4 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c +@@ -99,3 +99,4 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c +@@ -132,3 +132,4 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c +@@ -99,3 +99,4 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c ++++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c +@@ -132,3 +132,4 @@ __ieee754_sqrt (b) + } + return f_wash (b); + } ++strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c +=================================================================== +--- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c ++++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c +@@ -99,3 +99,4 @@ __ieee754_sqrtf (b) + } + return f_washf (b); + } ++strong_alias (__ieee754_sqrtf, __sqrtf_finite) diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ppc_slow_ieee754_sqrt.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ppc_slow_ieee754_sqrt.patch new file mode 100644 index 0000000..5b819bc --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ppc_slow_ieee754_sqrt.patch @@ -0,0 +1,365 @@ + __ieee754_sqrt{,f} are now inline functions and call out __slow versions + + +Signed-off-by: Khem Raj +Upstream-Status: Pending +Index: git/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c +=================================================================== +--- git.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c 2014-08-29 10:35:02.616070587 -0700 ++++ git/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c 2014-08-29 10:35:02.604070587 -0700 +@@ -40,7 +40,7 @@ + simultaneously. */ + + double +-__ieee754_sqrt (double b) ++__slow_ieee754_sqrt (double b) + { + if (__builtin_expect (b > 0, 1)) + { +@@ -77,7 +77,7 @@ + + /* Handle small numbers by scaling. */ + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) +- return __ieee754_sqrt (b * two108) * twom54; ++ return __slow_ieee754_sqrt (b * two108) * twom54; + + #define FMADD(a_, c_, b_) \ + ({ double __r; \ +@@ -126,4 +126,12 @@ + } + return f_wash (b); + } ++ ++#undef __ieee754_sqrt ++double ++__ieee754_sqrt (double x) ++{ ++ return __slow_ieee754_sqrt (x); ++} ++ + strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: git/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c +=================================================================== +--- git.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c 2014-08-29 10:35:02.616070587 -0700 ++++ git/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c 2014-08-29 10:35:02.604070587 -0700 +@@ -38,7 +38,7 @@ + square root. */ + + float +-__ieee754_sqrtf (float b) ++__slow_ieee754_sqrtf (float b) + { + if (__builtin_expect (b > 0, 1)) + { +@@ -93,4 +93,10 @@ + } + return f_washf (b); + } ++#undef __ieee754_sqrtf ++float ++__ieee754_sqrtf (float x) ++{ ++ return __slow_ieee754_sqrtf (x); ++} + strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: git/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c +=================================================================== +--- git.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c 2014-08-29 10:35:02.616070587 -0700 ++++ git/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c 2014-08-29 10:35:02.604070587 -0700 +@@ -40,7 +40,7 @@ + simultaneously. */ + + double +-__ieee754_sqrt (double b) ++__slow_ieee754_sqrt (double b) + { + if (__builtin_expect (b > 0, 1)) + { +@@ -77,7 +77,7 @@ + + /* Handle small numbers by scaling. */ + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) +- return __ieee754_sqrt (b * two108) * twom54; ++ return __slow_ieee754_sqrt (b * two108) * twom54; + + #define FMADD(a_, c_, b_) \ + ({ double __r; \ +@@ -126,4 +126,12 @@ + } + return f_wash (b); + } ++ ++#undef __ieee754_sqrt ++double ++__ieee754_sqrt (double x) ++{ ++ return __slow_ieee754_sqrt (x); ++} ++ + strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: git/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c +=================================================================== +--- git.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c 2014-08-29 10:35:02.616070587 -0700 ++++ git/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c 2014-08-29 10:35:02.604070587 -0700 +@@ -38,7 +38,7 @@ + square root. */ + + float +-__ieee754_sqrtf (float b) ++__slow_ieee754_sqrtf (float b) + { + if (__builtin_expect (b > 0, 1)) + { +@@ -93,4 +93,11 @@ + } + return f_washf (b); + } ++#undef __ieee754_sqrtf ++float ++__ieee754_sqrtf (float x) ++{ ++ return __slow_ieee754_sqrtf (x); ++} ++ + strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: git/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c +=================================================================== +--- git.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c 2014-08-29 10:35:02.616070587 -0700 ++++ git/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c 2014-08-29 10:35:02.604070587 -0700 +@@ -41,10 +41,10 @@ + + #ifdef __STDC__ + double +-__ieee754_sqrt (double b) ++__slow_ieee754_sqrt (double b) + #else + double +-__ieee754_sqrt (b) ++__slow_ieee754_sqrt (b) + double b; + #endif + { +@@ -83,7 +83,7 @@ + + /* Handle small numbers by scaling. */ + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) +- return __ieee754_sqrt (b * two108) * twom54; ++ return __slow_ieee754_sqrt (b * two108) * twom54; + + #define FMADD(a_, c_, b_) \ + ({ double __r; \ +@@ -132,4 +132,12 @@ + } + return f_wash (b); + } ++ ++#undef __ieee754_sqrt ++double ++__ieee754_sqrt (double x) ++{ ++ return __slow_ieee754_sqrt (x); ++} ++ + strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: git/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c +=================================================================== +--- git.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c 2014-08-29 10:35:02.616070587 -0700 ++++ git/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c 2014-08-29 10:35:02.604070587 -0700 +@@ -39,10 +39,10 @@ + + #ifdef __STDC__ + float +-__ieee754_sqrtf (float b) ++__slow_ieee754_sqrtf (float b) + #else + float +-__ieee754_sqrtf (b) ++__slow_ieee754_sqrtf (b) + float b; + #endif + { +@@ -99,4 +99,12 @@ + } + return f_washf (b); + } ++ ++#undef __ieee754_sqrtf ++float ++__ieee754_sqrtf (float x) ++{ ++ return __slow_ieee754_sqrtf (x); ++} ++ + strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: git/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c +=================================================================== +--- git.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c 2014-08-29 10:35:02.616070587 -0700 ++++ git/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c 2014-08-29 10:35:02.608070587 -0700 +@@ -41,10 +41,10 @@ + + #ifdef __STDC__ + double +-__ieee754_sqrt (double b) ++__slow_ieee754_sqrt (double b) + #else + double +-__ieee754_sqrt (b) ++__slow_ieee754_sqrt (b) + double b; + #endif + { +@@ -83,7 +83,7 @@ + + /* Handle small numbers by scaling. */ + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) +- return __ieee754_sqrt (b * two108) * twom54; ++ return __slow_ieee754_sqrt (b * two108) * twom54; + + #define FMADD(a_, c_, b_) \ + ({ double __r; \ +@@ -132,4 +132,12 @@ + } + return f_wash (b); + } ++ ++#undef __ieee754_sqrt ++double ++__ieee754_sqrt (double x) ++{ ++ return __slow_ieee754_sqrt (x); ++} ++ + strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: git/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c +=================================================================== +--- git.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c 2014-08-29 10:35:02.616070587 -0700 ++++ git/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c 2014-08-29 10:35:02.608070587 -0700 +@@ -39,10 +39,10 @@ + + #ifdef __STDC__ + float +-__ieee754_sqrtf (float b) ++__slow_ieee754_sqrtf (float b) + #else + float +-__ieee754_sqrtf (b) ++__slow_ieee754_sqrtf (b) + float b; + #endif + { +@@ -99,4 +99,12 @@ + } + return f_washf (b); + } ++ ++#undef __ieee754_sqrtf ++float ++__ieee754_sqrtf (float x) ++{ ++ return __slow_ieee754_sqrtf (x); ++} ++ + strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: git/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c +=================================================================== +--- git.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c 2014-08-29 10:35:02.616070587 -0700 ++++ git/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c 2014-08-29 10:35:02.608070587 -0700 +@@ -41,10 +41,10 @@ + + #ifdef __STDC__ + double +-__ieee754_sqrt (double b) ++__slow_ieee754_sqrt (double b) + #else + double +-__ieee754_sqrt (b) ++__slow_ieee754_sqrt (b) + double b; + #endif + { +@@ -83,7 +83,7 @@ + + /* Handle small numbers by scaling. */ + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) +- return __ieee754_sqrt (b * two108) * twom54; ++ return __slow_ieee754_sqrt (b * two108) * twom54; + + #define FMADD(a_, c_, b_) \ + ({ double __r; \ +@@ -132,4 +132,12 @@ + } + return f_wash (b); + } ++ ++#undef __ieee754_sqrt ++double ++__ieee754_sqrt (double x) ++{ ++ return __slow_ieee754_sqrt (x); ++} ++ + strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: git/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c +=================================================================== +--- git.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c 2014-08-29 10:35:02.616070587 -0700 ++++ git/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c 2014-08-29 10:35:02.608070587 -0700 +@@ -39,10 +39,10 @@ + + #ifdef __STDC__ + float +-__ieee754_sqrtf (float b) ++__slow_ieee754_sqrtf (float b) + #else + float +-__ieee754_sqrtf (b) ++__slow_ieee754_sqrtf (b) + float b; + #endif + { +@@ -99,4 +99,12 @@ + } + return f_washf (b); + } ++ ++#undef __ieee754_sqrtf ++float ++__ieee754_sqrtf (float x) ++{ ++ return __slow_ieee754_sqrtf (x); ++} ++ + strong_alias (__ieee754_sqrtf, __sqrtf_finite) +Index: git/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c +=================================================================== +--- git.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 2014-08-29 10:35:02.616070587 -0700 ++++ git/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 2014-08-29 10:35:02.608070587 -0700 +@@ -132,4 +132,12 @@ + } + return f_wash (b); + } ++ ++#undef __ieee754_sqrt ++double ++__ieee754_sqrt (double x) ++{ ++ return __slow_ieee754_sqrt (x); ++} ++ + strong_alias (__ieee754_sqrt, __sqrt_finite) +Index: git/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c +=================================================================== +--- git.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 2014-08-29 10:35:02.616070587 -0700 ++++ git/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 2014-08-29 10:35:02.608070587 -0700 +@@ -99,4 +99,12 @@ + } + return f_washf (b); + } ++ ++#undef __ieee754_sqrtf ++float ++__ieee754_sqrtf (float x) ++{ ++ return __slow_ieee754_sqrtf (x); ++} ++ + strong_alias (__ieee754_sqrtf, __sqrtf_finite) diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ppce6500-32b_slow_ieee754_sqrt.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ppce6500-32b_slow_ieee754_sqrt.patch new file mode 100644 index 0000000..4c6c107 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/ppce6500-32b_slow_ieee754_sqrt.patch @@ -0,0 +1,47 @@ + __ieee754_sqrt{,f} are now inline functions and call out __slow versions + + +Signed-off-by: chunrong guo +Upstream-Status: Pending + +diff -rNu libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c +--- libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 2014-04-08 04:39:58.487229887 -0500 ++++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 2014-04-08 04:40:52.643069198 -0500 +@@ -41,10 +41,10 @@ + + #ifdef __STDC__ + double +-__ieee754_sqrt (double b) ++__slow_ieee754_sqrt (double b) + #else + double +-__ieee754_sqrt (b) ++__slow_ieee754_sqrt (b) + double b; + #endif + { +@@ -83,7 +83,7 @@ + + /* Handle small numbers by scaling. */ + if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0)) +- return __ieee754_sqrt (b * two108) * twom54; ++ return __slow_ieee754_sqrt (b * two108) * twom54; + + #define FMADD(a_, c_, b_) \ + ({ double __r; \ +diff -rNu libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c +--- libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 2014-04-08 04:39:58.487229887 -0500 ++++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 2014-04-08 04:41:26.017067682 -0500 +@@ -39,10 +39,10 @@ + + #ifdef __STDC__ + float +-__ieee754_sqrtf (float b) ++__slow_ieee754_sqrtf (float b) + #else + float +-__ieee754_sqrtf (b) ++__slow_ieee754_sqrtf (b) + float b; + #endif + { diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/relocatable_sdk.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/relocatable_sdk.patch new file mode 100644 index 0000000..ca5f17b --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/relocatable_sdk.patch @@ -0,0 +1,108 @@ +Upstream-Status: Inappropriate [SDK specific] + +This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings +and lengths as well as ld.so.cache path in the dynamic loader to specific +sections in memory. The sections that contain paths have been allocated a 4096 +byte section, which is the maximum path length in linux. This will allow the +relocating script to parse the ELF binary, detect the section and easily replace +the strings in a certain path. + +Signed-off-by: Laurentiu Palcu + +Index: libc/elf/interp.c +=================================================================== +--- libc.orig/elf/interp.c ++++ libc/elf/interp.c +@@ -16,5 +16,5 @@ + License along with the GNU C Library; if not, see + . */ + +-const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp"))) ++const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp"))) + = RUNTIME_LINKER; +Index: libc/elf/dl-load.c +=================================================================== +--- libc.orig/elf/dl-load.c ++++ libc/elf/dl-load.c +@@ -144,8 +144,8 @@ static size_t max_capstrlen attribute_re + /* Get the generated information about the trusted directories. */ + #include "trusted-dirs.h" + +-static const char system_dirs[] = SYSTEM_DIRS; +-static const size_t system_dirs_len[] = ++static const char system_dirs[4096] __attribute__ ((section (".sysdirs"))) = SYSTEM_DIRS; ++volatile static const size_t system_dirs_len[] __attribute__ ((section (".sysdirslen"))) = + { + SYSTEM_DIRS_LEN + }; +Index: libc/elf/dl-cache.c +=================================================================== +--- libc.orig/elf/dl-cache.c ++++ libc/elf/dl-cache.c +@@ -133,6 +133,10 @@ do \ + while (0) + + ++const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))) = ++ SYSCONFDIR "/ld.so.cache"; ++ ++ + int + internal_function + _dl_cache_libcmp (const char *p1, const char *p2) +Index: libc/elf/ldconfig.c +=================================================================== +--- libc.orig/elf/ldconfig.c ++++ libc/elf/ldconfig.c +@@ -166,6 +166,9 @@ static struct argp argp = + options, parse_opt, NULL, doc, NULL, more_help, NULL + }; + ++ ++extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))); ++ + /* Check if string corresponds to an important hardware capability or + a platform. */ + static int +Index: libc/sysdeps/generic/dl-cache.h +=================================================================== +--- libc.orig/sysdeps/generic/dl-cache.h ++++ libc/sysdeps/generic/dl-cache.h +@@ -27,10 +27,6 @@ + ((flags) == 1 || (flags) == _DL_CACHE_DEFAULT_ID) + #endif + +-#ifndef LD_SO_CACHE +-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache" +-#endif +- + #ifndef add_system_dir + # define add_system_dir(dir) add_dir (dir) + #endif +Index: libc/elf/rtld.c +=================================================================== +--- libc.orig/elf/rtld.c ++++ libc/elf/rtld.c +@@ -99,6 +99,7 @@ uintptr_t __pointer_chk_guard_local + strong_alias (__pointer_chk_guard_local, __pointer_chk_guard) + #endif + ++extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))); + + /* List of auditing DSOs. */ + static struct audit_list +@@ -1031,12 +1032,12 @@ of this helper program; chances are you + --list list all dependencies and how they are resolved\n\ + --verify verify that given object really is a dynamically linked\n\ + object we can handle\n\ +- --inhibit-cache Do not use " LD_SO_CACHE "\n\ ++ --inhibit-cache Do not use %s\n\ + --library-path PATH use given PATH instead of content of the environment\n\ + variable LD_LIBRARY_PATH\n\ + --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\ + in LIST\n\ +- --audit LIST use objects named in LIST as auditors\n"); ++ --audit LIST use objects named in LIST as auditors\n", LD_SO_CACHE); + + ++_dl_skip_args; + --_dl_argc; diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/relocatable_sdk_fix_openpath.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/relocatable_sdk_fix_openpath.patch new file mode 100644 index 0000000..f164f8f --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/relocatable_sdk_fix_openpath.patch @@ -0,0 +1,41 @@ +Upstream-Status: Inappropriate [SDK specific] + +eglibc-nativesdk: Fix buffer overrun with a relocated SDK + +When ld-linux-*.so.2 is relocated to a path that is longer than the +original fixed location, the dynamic loader will crash in open_path +because it implicitly assumes that max_dirnamelen is a fixed size that +never changes. + +The allocated buffer will not be large enough to contain the directory +path string which is larger than the fixed location provided at build +time. + +Signed-off-by: Jason Wessel + +--- + elf/dl-load.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/elf/dl-load.c ++++ b/elf/dl-load.c +@@ -1919,7 +1919,19 @@ open_path (const char *name, size_t name + given on the command line when rtld is run directly. */ + return -1; + ++ do ++ { ++ struct r_search_path_elem *this_dir = *dirs; ++ if (this_dir->dirnamelen > max_dirnamelen) ++ { ++ max_dirnamelen = this_dir->dirnamelen; ++ } ++ } ++ while (*++dirs != NULL); ++ + buf = alloca (max_dirnamelen + max_capstrlen + namelen); ++ ++ dirs = sps->dirs; + do + { + struct r_search_path_elem *this_dir = *dirs; diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/timezone-re-written-tzselect-as-posix-sh.patch b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/timezone-re-written-tzselect-as-posix-sh.patch new file mode 100644 index 0000000..55547de --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/timezone-re-written-tzselect-as-posix-sh.patch @@ -0,0 +1,38 @@ +timezone: re-written tzselect as posix sh + +To avoid the bash dependency. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia +--- + timezone/Makefile | 2 +- + timezone/tzselect.ksh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Index: git/timezone/Makefile +=================================================================== +--- git.orig/timezone/Makefile 2014-08-27 05:35:58.008070587 +0000 ++++ git/timezone/Makefile 2014-08-27 05:36:37.908070587 +0000 +@@ -114,7 +114,7 @@ + + + $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make +- sed -e 's|/bin/bash|$(BASH)|' \ ++ sed -e 's|/bin/bash|/bin/sh|' \ + -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \ + -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \ + -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \ +Index: git/timezone/tzselect.ksh +=================================================================== +--- git.orig/timezone/tzselect.ksh 2014-08-27 05:35:58.008070587 +0000 ++++ git/timezone/tzselect.ksh 2014-08-27 05:35:58.000070587 +0000 +@@ -35,7 +35,7 @@ + + # Specify default values for environment variables if they are unset. + : ${AWK=awk} +-: ${TZDIR=`pwd`} ++: ${TZDIR=$(pwd)} + + # Check for awk Posix compliance. + ($AWK -v x=y 'BEGIN { exit 123 }') /dev/null 2>&1 diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-locale_linaro-2.20.bb b/meta-linaro-toolchain/recipes-core/glibc/glibc-locale_linaro-2.20.bb new file mode 100644 index 0000000..8d22aff --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-locale_linaro-2.20.bb @@ -0,0 +1 @@ +require recipes-core/glibc/glibc-locale.inc diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-mtrace_linaro-2.20.bb b/meta-linaro-toolchain/recipes-core/glibc/glibc-mtrace_linaro-2.20.bb new file mode 100644 index 0000000..4849101 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-mtrace_linaro-2.20.bb @@ -0,0 +1 @@ +require recipes-core/glibc/glibc-mtrace.inc diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc-scripts_linaro-2.20.bb b/meta-linaro-toolchain/recipes-core/glibc/glibc-scripts_linaro-2.20.bb new file mode 100644 index 0000000..674cd80 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc-scripts_linaro-2.20.bb @@ -0,0 +1 @@ +require recipes-core/glibc/glibc-scripts.inc diff --git a/meta-linaro-toolchain/recipes-core/glibc/glibc_linaro-2.20.bb b/meta-linaro-toolchain/recipes-core/glibc/glibc_linaro-2.20.bb new file mode 100644 index 0000000..b386236 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/glibc_linaro-2.20.bb @@ -0,0 +1,173 @@ +require recipes-core/glibc/glibc.inc + +DEPENDS += "gperf-native kconfig-frontends-native" + +MMYY = "14.11" +RELEASE = "20${MMYY}" +PR = "r${RELEASE}" + +SRC_URI = "http://releases.linaro.org/${MMYY}/components/toolchain/glibc-linaro/glibc-${PV}-${RELEASE}.tar.xz \ + file://etc/ld.so.conf \ + file://generate-supported.mk \ + file://IO-acquire-lock-fix.patch \ + file://mips-rld-map-check.patch \ + file://etc/ld.so.conf \ + file://generate-supported.mk \ + file://glibc.fix_sqrt2.patch \ + file://multilib_readlib.patch \ + file://ppc-sqrt_finite.patch \ + file://ppc_slow_ieee754_sqrt.patch \ + file://add_resource_h_to_wait_h.patch \ + file://fsl-ppc-no-fsqrt.patch \ + file://0001-R_ARM_TLS_DTPOFF32.patch \ + file://0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \ + file://fix-tibetian-locales.patch \ + file://ppce6500-32b_slow_ieee754_sqrt.patch \ + file://grok_gold.patch \ + file://fix_am_rootsbindir.patch \ + ${EGLIBCPATCHES} \ + " +EGLIBCPATCHES = "\ + file://timezone-re-written-tzselect-as-posix-sh.patch \ + file://eglibc.patch \ + file://option-groups.patch \ + file://GLRO_dl_debug_mask.patch \ + file://eglibc-header-bootstrap.patch \ + file://eglibc-resolv-dynamic.patch \ + file://eglibc-ppc8xx-cache-line-workaround.patch \ + file://eglibc-sh4-fpscr_values.patch \ + file://eglibc-use-option-groups.patch \ + " + +SRC_URI[md5sum] = "ca2035b47d86856ffdd201ce2a12e60e" +SRC_URI[sha256sum] = "2db756f9f9281f78443cd04fc544fc2d8bce38037d5f75c8284bd8b0ccf9c9ed" + +LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \ + file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" + +SRC_URI_append_class-nativesdk = " file://ld-search-order.patch \ + file://relocatable_sdk.patch \ + file://relocatable_sdk_fix_openpath.patch \ + " +S = "${WORKDIR}/glibc-${PV}-${RELEASE}" +B = "${WORKDIR}/build-${TARGET_SYS}" + +PACKAGES_DYNAMIC = "" + +# the -isystem in bitbake.conf screws up glibc do_stage +BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}" +TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}" + +GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN es_CR.ISO-8859-1" + +FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/glibc-${PV}', '${FILE_DIRNAME}/glibc', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}" + +# +# For now, we will skip building of a gcc package if it is a uclibc one +# and our build is not a uclibc one, and we skip a glibc one if our build +# is a uclibc build. +# +# See the note in gcc/gcc_3.4.0.oe +# + +python __anonymous () { + import re + uc_os = (re.match('.*uclibc$', d.getVar('TARGET_OS', True)) != None) + if uc_os: + raise bb.parse.SkipPackage("incompatible with target %s" % + d.getVar('TARGET_OS', True)) +} + +export libc_cv_slibdir = "${base_libdir}" + +EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \ + --without-cvs --disable-profile \ + --disable-debug --without-gd \ + --enable-clocale=gnu \ + --enable-add-ons \ + --with-headers=${STAGING_INCDIR} \ + --without-selinux \ + --enable-obsolete-rpc \ + --with-kconfig=${STAGING_BINDIR_NATIVE} \ + ${GLIBC_EXTRA_OECONF}" + +EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}" + +do_patch_append() { + bb.build.exec_func('do_fix_readlib_c', d) +} + +# for mips glibc now builds syscall tables for all abi's +# so we make sure that we choose right march option which is +# compatible with o32,n32 and n64 abi's +# e.g. -march=mips32 is not compatible with n32 and n64 therefore +# we filter it out in such case -march=from-abi which will be +# mips1 when using o32 and mips3 when using n32/n64 + +TUNE_CCARGS_mips := "${@oe_filter_out('-march=mips32', '${TUNE_CCARGS}', d)}" +TUNE_CCARGS_mipsel := "${@oe_filter_out('-march=mips32', '${TUNE_CCARGS}', d)}" + +do_fix_readlib_c () { + sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c +} + +do_configure () { +# override this function to avoid the autoconf/automake/aclocal/autoheader +# calls for now +# don't pass CPPFLAGS into configure, since it upsets the kernel-headers +# version check and doesn't really help with anything + if [ -z "`which rpcgen`" ]; then + echo "rpcgen not found. Install glibc-devel." + exit 1 + fi + (cd ${S} && gnu-configize) || die "failure in running gnu-configize" + find ${S} -name "configure" | xargs touch + CPPFLAGS="" oe_runconf +} + +rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \ + yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \ + rusers.x spray.x nfs_prot.x rquota.x key_prot.x" + +do_compile () { + # -Wl,-rpath-link /lib in LDFLAGS can cause breakage if another glibc is in staging + unset LDFLAGS + base_do_compile + ( + cd ${S}/sunrpc/rpcsvc + for r in ${rpcsvc}; do + h=`echo $r|sed -e's,\.x$,.h,'` + rpcgen -h $r -o $h || bbwarn "unable to generate header for $r" + done + ) + echo "Adjust ldd script" + if [ -n "${RTLDLIST}" ] + then + prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'` + if [ "${prevrtld}" != "${RTLDLIST}" ] + then + sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#" + fi + fi + +} + +# In case of aarch64_be install symlink to ld-linux-aarch64_be.so.1 +# to enable transition of toolchain and executables that are not yet +# aware about aarch64_be run-time linker name change. +# +# Currently there is no use case that requires both LE and BE glibc +# installed into the same rootfs, so our transitional symlink should +# be fine. +# +do_install_append_aarch64-be() { + if [ -e ${D}${base_libdir}/ld-linux-aarch64_be.so.1 ] ; then + ln -sf ld-linux-aarch64_be.so.1 ${D}${base_libdir}/ld-linux-aarch64.so.1 + fi +} + +require recipes-core/glibc/glibc-package.inc + +BBCLASSEXTEND = "nativesdk" diff --git a/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch new file mode 100644 index 0000000..cdfeaea --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch @@ -0,0 +1,331 @@ +Upstream-Status: Inappropriate [embedded specific] + +We run the ldconfig in the cross fashion. make the code bitsize aware so that +we can cross build ldconfig cache for various architectures. + +Richard Purdie 2009/05/19 +Nitin A Kamble 2009/03/29 + +Index: ldconfig-native-2.12.1/readelflib.c +=================================================================== +--- ldconfig-native-2.12.1.orig/readelflib.c ++++ ldconfig-native-2.12.1/readelflib.c +@@ -40,39 +40,212 @@ do \ + + /* Returns 0 if everything is ok, != 0 in case of error. */ + int +-process_elf_file (const char *file_name, const char *lib, int *flag, ++process_elf_file32 (const char *file_name, const char *lib, int *flag, + unsigned int *osversion, char **soname, void *file_contents, + size_t file_length) + { + int i; + unsigned int j; +- ElfW(Addr) loadaddr; ++ Elf32_Addr loadaddr; + unsigned int dynamic_addr; + size_t dynamic_size; + char *program_interpreter; + +- ElfW(Ehdr) *elf_header; +- ElfW(Phdr) *elf_pheader, *segment; +- ElfW(Dyn) *dynamic_segment, *dyn_entry; ++ Elf32_Ehdr *elf_header; ++ Elf32_Phdr *elf_pheader, *segment; ++ Elf32_Dyn *dynamic_segment, *dyn_entry; + char *dynamic_strings; + +- elf_header = (ElfW(Ehdr) *) file_contents; ++ elf_header = (Elf32_Ehdr *) file_contents; + *osversion = 0; + +- if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS)) ++ if (elf_header->e_type != ET_DYN) + { +- if (opt_verbose) ++ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name, ++ elf_header->e_type); ++ return 1; ++ } ++ ++ /* Get information from elf program header. */ ++ elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents); ++ check_ptr (elf_pheader); ++ ++ /* The library is an elf library, now search for soname and ++ libc5/libc6. */ ++ *flag = FLAG_ELF; ++ ++ loadaddr = -1; ++ dynamic_addr = 0; ++ dynamic_size = 0; ++ program_interpreter = NULL; ++ for (i = 0, segment = elf_pheader; ++ i < elf_header->e_phnum; i++, segment++) ++ { ++ check_ptr (segment); ++ ++ switch (segment->p_type) + { +- if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) +- error (0, 0, _("%s is a 32 bit ELF file.\n"), file_name); +- else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64) +- error (0, 0, _("%s is a 64 bit ELF file.\n"), file_name); +- else +- error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name); ++ case PT_LOAD: ++ if (loadaddr == (Elf32_Addr) -1) ++ loadaddr = segment->p_vaddr - segment->p_offset; ++ break; ++ ++ case PT_DYNAMIC: ++ if (dynamic_addr) ++ error (0, 0, _("more than one dynamic segment\n")); ++ ++ dynamic_addr = segment->p_offset; ++ dynamic_size = segment->p_filesz; ++ break; ++ ++ case PT_INTERP: ++ program_interpreter = (char *) (file_contents + segment->p_offset); ++ check_ptr (program_interpreter); ++ ++ /* Check if this is enough to classify the binary. */ ++ for (j = 0; j < sizeof (interpreters) / sizeof (interpreters [0]); ++ ++j) ++ if (strcmp (program_interpreter, interpreters[j].soname) == 0) ++ { ++ *flag = interpreters[j].flag; ++ break; ++ } ++ break; ++ ++ case PT_NOTE: ++ if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4) ++ { ++ Elf32_Word *abi_note = (Elf32_Word *) (file_contents ++ + segment->p_offset); ++ Elf32_Addr size = segment->p_filesz; ++ ++ while (abi_note [0] != 4 || abi_note [1] != 16 ++ || abi_note [2] != 1 ++ || memcmp (abi_note + 3, "GNU", 4) != 0) ++ { ++#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word))) ++ Elf32_Addr) note_size = 3 * sizeof (Elf32_Word)) ++ + ROUND (abi_note[0]) ++ + ROUND (abi_note[1]); ++ ++ if (size - 32 < note_size || note_size == 0) ++ { ++ size = 0; ++ break; ++ } ++ size -= note_size; ++ abi_note = (void *) abi_note + note_size; ++ } ++ ++ if (size == 0) ++ break; ++ ++ *osversion = (abi_note [4] << 24) | ++ ((abi_note [5] & 0xff) << 16) | ++ ((abi_note [6] & 0xff) << 8) | ++ (abi_note [7] & 0xff); ++ } ++ break; ++ ++ default: ++ break; ++ } ++ ++ } ++ if (loadaddr == (Elf32_Addr) -1) ++ { ++ /* Very strange. */ ++ loadaddr = 0; ++ } ++ ++ /* Now we can read the dynamic sections. */ ++ if (dynamic_size == 0) ++ return 1; ++ ++ dynamic_segment = (Elf32_Dyn *) (file_contents + dynamic_addr); ++ check_ptr (dynamic_segment); ++ ++ /* Find the string table. */ ++ dynamic_strings = NULL; ++ for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; ++ ++dyn_entry) ++ { ++ check_ptr (dyn_entry); ++ if (dyn_entry->d_tag == DT_STRTAB) ++ { ++ dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr); ++ check_ptr (dynamic_strings); ++ break; + } +- return 1; + } + ++ if (dynamic_strings == NULL) ++ return 1; ++ ++ /* Now read the DT_NEEDED and DT_SONAME entries. */ ++ for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; ++ ++dyn_entry) ++ { ++ if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME) ++ { ++ char *name = dynamic_strings + dyn_entry->d_un.d_val; ++ check_ptr (name); ++ ++ if (dyn_entry->d_tag == DT_NEEDED) ++ { ++ ++ if (*flag == FLAG_ELF) ++ { ++ /* Check if this is enough to classify the binary. */ ++ for (j = 0; ++ j < sizeof (known_libs) / sizeof (known_libs [0]); ++ ++j) ++ if (strcmp (name, known_libs [j].soname) == 0) ++ { ++ *flag = known_libs [j].flag; ++ break; ++ } ++ } ++ } ++ ++ else if (dyn_entry->d_tag == DT_SONAME) ++ *soname = xstrdup (name); ++ ++ /* Do we have everything we need? */ ++ if (*soname && *flag != FLAG_ELF) ++ return 0; ++ } ++ } ++ ++ /* We reach this point only if the file doesn't contain a DT_SONAME ++ or if we can't classify the library. If it doesn't have a ++ soname, return the name of the library. */ ++ if (*soname == NULL) ++ *soname = xstrdup (lib); ++ ++ return 0; ++} ++ ++int ++process_elf_file64 (const char *file_name, const char *lib, int *flag, ++ unsigned int *osversion, char **soname, void *file_contents, ++ size_t file_length) ++{ ++ int i; ++ unsigned int j; ++ Elf64_Addr loadaddr; ++ unsigned int dynamic_addr; ++ size_t dynamic_size; ++ char *program_interpreter; ++ ++ Elf64_Ehdr *elf_header; ++ Elf64_Phdr *elf_pheader, *segment; ++ Elf64_Dyn *dynamic_segment, *dyn_entry; ++ char *dynamic_strings; ++ ++ elf_header = (Elf64_Ehdr *) file_contents; ++ *osversion = 0; ++ + if (elf_header->e_type != ET_DYN) + { + error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name, +@@ -81,7 +254,7 @@ process_elf_file (const char *file_name, + } + + /* Get information from elf program header. */ +- elf_pheader = (ElfW(Phdr) *) (elf_header->e_phoff + file_contents); ++ elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents); + check_ptr (elf_pheader); + + /* The library is an elf library, now search for soname and +@@ -100,7 +273,7 @@ process_elf_file (const char *file_name, + switch (segment->p_type) + { + case PT_LOAD: +- if (loadaddr == (ElfW(Addr)) -1) ++ if (loadaddr == (Elf64_Addr) -1) + loadaddr = segment->p_vaddr - segment->p_offset; + break; + +@@ -129,16 +302,16 @@ process_elf_file (const char *file_name, + case PT_NOTE: + if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4) + { +- ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents ++ Elf64_Word *abi_note = (Elf64_Word *) (file_contents + + segment->p_offset); +- ElfW(Addr) size = segment->p_filesz; ++ Elf64_Addr size = segment->p_filesz; + + while (abi_note [0] != 4 || abi_note [1] != 16 + || abi_note [2] != 1 + || memcmp (abi_note + 3, "GNU", 4) != 0) + { +-#define ROUND(len) (((len) + sizeof (ElfW(Word)) - 1) & -sizeof (ElfW(Word))) +- ElfW(Addr) note_size = 3 * sizeof (ElfW(Word)) ++#define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word)) ++ Elf64_Addr note_size = 3 * sizeof (Elf64_Word) + + ROUND (abi_note[0]) + + ROUND (abi_note[1]); + +@@ -166,7 +339,7 @@ process_elf_file (const char *file_name, + } + + } +- if (loadaddr == (ElfW(Addr)) -1) ++ if (loadaddr == (Elf64_Addr) -1) + { + /* Very strange. */ + loadaddr = 0; +@@ -176,7 +349,7 @@ process_elf_file (const char *file_name, + if (dynamic_size == 0) + return 1; + +- dynamic_segment = (ElfW(Dyn) *) (file_contents + dynamic_addr); ++ dynamic_segment = (Elf64_Dyn *) (file_contents + dynamic_addr); + check_ptr (dynamic_segment); + + /* Find the string table. */ +@@ -233,3 +406,33 @@ process_elf_file (const char *file_name, + + return 0; + } ++/* Returns 0 if everything is ok, != 0 in case of error. */ ++int ++process_elf_file (const char *file_name, const char *lib, int *flag, ++ unsigned int *osversion, char **soname, void *file_contents, ++ size_t file_length) ++{ ++ int i; ++ unsigned int j; ++ ElfW(Addr) loadaddr; ++ unsigned int dynamic_addr; ++ size_t dynamic_size; ++ char *program_interpreter; ++ ++ ElfW(Ehdr) *elf_header; ++ ElfW(Phdr) *elf_pheader, *segment; ++ ElfW(Dyn) *dynamic_segment, *dyn_entry; ++ char *dynamic_strings; ++ ++ elf_header = (ElfW(Ehdr) *) file_contents; ++ *osversion = 0; ++ ++ if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) ++ return process_elf_file32(file_name, lib,flag, osversion, soname, file_contents, file_length); ++ else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64) ++ return process_elf_file64(file_name, lib,flag, osversion, soname, file_contents, file_length); ++ error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name); ++ return 1; ++} ++ ++ diff --git a/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/README b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/README new file mode 100644 index 0000000..43fb983 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/README @@ -0,0 +1,8 @@ +The files are pulled verbatim from glibc 2.5 and then patched to allow +standalone compilation of ldconfig. + +Richard Purdie +OpenedHand Ltd. + +Upgraded the ldconfig recipe to eglibc 2.12.1 +Nitin A Kamble 2011/03/29 diff --git a/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch new file mode 100644 index 0000000..7f8e4db --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch @@ -0,0 +1,454 @@ +Upstream-Status: Inappropriate [embedded specific] + +Do data input/output handling according to endien-ness of the library file. That +enables use of ldconfig in the cross fashion for any architecture. + +2011/04/04 +Richard Purdie +Nitin Kamble + +Index: ldconfig-native-2.12.1/readelflib.c +=================================================================== +--- ldconfig-native-2.12.1.orig/readelflib.c ++++ ldconfig-native-2.12.1/readelflib.c +@@ -38,6 +38,28 @@ do \ + } \ + while (0); + ++int be; ++static uint16_t read16(uint16_t x, int be) ++{ ++ if (be) ++ return be16toh(x); ++ return le16toh(x); ++} ++ ++static uint32_t read32(uint32_t x, int be) ++{ ++ if (be) ++ return be32toh(x); ++ return le32toh(x); ++} ++ ++static uint64_t read64(uint64_t x, int be) ++{ ++ if (be) ++ return be64toh(x); ++ return le64toh(x); ++} ++ + /* Returns 0 if everything is ok, != 0 in case of error. */ + int + process_elf_file32 (const char *file_name, const char *lib, int *flag, +@@ -59,15 +81,17 @@ process_elf_file32 (const char *file_nam + elf_header = (Elf32_Ehdr *) file_contents; + *osversion = 0; + +- if (elf_header->e_type != ET_DYN) ++ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB); ++ ++ if (read16(elf_header->e_type, be) != ET_DYN) + { + error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name, +- elf_header->e_type); ++ read16(elf_header->e_type, be)); + return 1; + } + + /* Get information from elf program header. */ +- elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents); ++ elf_pheader = (Elf32_Phdr *) (read32(elf_header->e_phoff, be) + file_contents); + check_ptr (elf_pheader); + + /* The library is an elf library, now search for soname and +@@ -79,27 +103,27 @@ process_elf_file32 (const char *file_nam + dynamic_size = 0; + program_interpreter = NULL; + for (i = 0, segment = elf_pheader; +- i < elf_header->e_phnum; i++, segment++) ++ i < read16(elf_header->e_phnum, be); i++, segment++) + { + check_ptr (segment); + +- switch (segment->p_type) ++ switch (read32(segment->p_type, be)) + { + case PT_LOAD: + if (loadaddr == (Elf32_Addr) -1) +- loadaddr = segment->p_vaddr - segment->p_offset; ++ loadaddr = read32(segment->p_vaddr, be) - read32(segment->p_offset, be); + break; + + case PT_DYNAMIC: + if (dynamic_addr) + error (0, 0, _("more than one dynamic segment\n")); + +- dynamic_addr = segment->p_offset; +- dynamic_size = segment->p_filesz; ++ dynamic_addr = read32(segment->p_offset, be); ++ dynamic_size = read32(segment->p_filesz, be); + break; + + case PT_INTERP: +- program_interpreter = (char *) (file_contents + segment->p_offset); ++ program_interpreter = (char *) (file_contents + read32(segment->p_offset, be)); + check_ptr (program_interpreter); + + /* Check if this is enough to classify the binary. */ +@@ -113,20 +137,20 @@ process_elf_file32 (const char *file_nam + break; + + case PT_NOTE: +- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4) ++ if (!*osversion && read32(segment->p_filesz, be) >= 32 && segment->p_align >= 4) + { + Elf32_Word *abi_note = (Elf32_Word *) (file_contents +- + segment->p_offset); +- Elf32_Addr size = segment->p_filesz; ++ + read32(segment->p_offset, be)); ++ Elf32_Addr size = read32(segment->p_filesz, be); + +- while (abi_note [0] != 4 || abi_note [1] != 16 +- || abi_note [2] != 1 ++ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16 ++ || read32(abi_note [2], be) != 1 + || memcmp (abi_note + 3, "GNU", 4) != 0) + { +-#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word))) +- Elf32_Addr) note_size = 3 * sizeof (Elf32_Word)) +- + ROUND (abi_note[0]) +- + ROUND (abi_note[1]); ++#define ROUND(len) (((len) + sizeof (Elf32_Word) - 1) & -sizeof (Elf32_Word)) ++ Elf32_Addr note_size = 3 * sizeof (Elf32_Word) ++ + ROUND (read32(abi_note[0], be)) ++ + ROUND (read32(abi_note[1], be)); + + if (size - 32 < note_size || note_size == 0) + { +@@ -140,10 +164,10 @@ process_elf_file32 (const char *file_nam + if (size == 0) + break; + +- *osversion = (abi_note [4] << 24) | +- ((abi_note [5] & 0xff) << 16) | +- ((abi_note [6] & 0xff) << 8) | +- (abi_note [7] & 0xff); ++ *osversion = (read32(abi_note [4], be) << 24) | ++ ((read32(abi_note [5], be) & 0xff) << 16) | ++ ((read32(abi_note [6], be) & 0xff) << 8) | ++ (read32(abi_note [7], be) & 0xff); + } + break; + +@@ -167,13 +191,13 @@ process_elf_file32 (const char *file_nam + + /* Find the string table. */ + dynamic_strings = NULL; +- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; ++ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL; + ++dyn_entry) + { + check_ptr (dyn_entry); +- if (dyn_entry->d_tag == DT_STRTAB) ++ if (read32(dyn_entry->d_tag, be) == DT_STRTAB) + { +- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr); ++ dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadaddr); + check_ptr (dynamic_strings); + break; + } +@@ -183,15 +207,15 @@ process_elf_file32 (const char *file_nam + return 1; + + /* Now read the DT_NEEDED and DT_SONAME entries. */ +- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; ++ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL; + ++dyn_entry) + { +- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME) ++ if (read32(dyn_entry->d_tag, be) == DT_NEEDED || read32(dyn_entry->d_tag, be) == DT_SONAME) + { +- char *name = dynamic_strings + dyn_entry->d_un.d_val; ++ char *name = dynamic_strings + read32(dyn_entry->d_un.d_val, be); + check_ptr (name); + +- if (dyn_entry->d_tag == DT_NEEDED) ++ if (read32(dyn_entry->d_tag, be) == DT_NEEDED) + { + + if (*flag == FLAG_ELF) +@@ -208,7 +232,7 @@ process_elf_file32 (const char *file_nam + } + } + +- else if (dyn_entry->d_tag == DT_SONAME) ++ else if (read32(dyn_entry->d_tag, be) == DT_SONAME) + *soname = xstrdup (name); + + /* Do we have everything we need? */ +@@ -246,15 +270,17 @@ process_elf_file64 (const char *file_nam + elf_header = (Elf64_Ehdr *) file_contents; + *osversion = 0; + +- if (elf_header->e_type != ET_DYN) ++ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB); ++ ++ if (read16(elf_header->e_type, be) != ET_DYN) + { + error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name, +- elf_header->e_type); ++ read16(elf_header->e_type, be)); + return 1; + } + + /* Get information from elf program header. */ +- elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents); ++ elf_pheader = (Elf64_Phdr *) (read64(elf_header->e_phoff, be) + file_contents); + check_ptr (elf_pheader); + + /* The library is an elf library, now search for soname and +@@ -266,27 +292,27 @@ process_elf_file64 (const char *file_nam + dynamic_size = 0; + program_interpreter = NULL; + for (i = 0, segment = elf_pheader; +- i < elf_header->e_phnum; i++, segment++) ++ i < read16(elf_header->e_phnum, be); i++, segment++) + { + check_ptr (segment); + +- switch (segment->p_type) ++ switch (read32(segment->p_type, be)) + { + case PT_LOAD: + if (loadaddr == (Elf64_Addr) -1) +- loadaddr = segment->p_vaddr - segment->p_offset; ++ loadaddr = read64(segment->p_vaddr, be) - read64(segment->p_offset, be); + break; + + case PT_DYNAMIC: + if (dynamic_addr) + error (0, 0, _("more than one dynamic segment\n")); + +- dynamic_addr = segment->p_offset; +- dynamic_size = segment->p_filesz; ++ dynamic_addr = read64(segment->p_offset, be); ++ dynamic_size = read32(segment->p_filesz, be); + break; + + case PT_INTERP: +- program_interpreter = (char *) (file_contents + segment->p_offset); ++ program_interpreter = (char *) (file_contents + read64(segment->p_offset, be)); + check_ptr (program_interpreter); + + /* Check if this is enough to classify the binary. */ +@@ -300,20 +326,21 @@ process_elf_file64 (const char *file_nam + break; + + case PT_NOTE: +- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4) ++ if (!*osversion && read32(segment->p_filesz, be) >= 32 && read32(segment->p_align, be) >= 4) + { + Elf64_Word *abi_note = (Elf64_Word *) (file_contents +- + segment->p_offset); +- Elf64_Addr size = segment->p_filesz; ++ + read64(segment->p_offset, be)); ++ Elf64_Addr size = read32(segment->p_filesz, be); + +- while (abi_note [0] != 4 || abi_note [1] != 16 +- || abi_note [2] != 1 ++ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16 ++ || read32(abi_note [2], be) != 1 + || memcmp (abi_note + 3, "GNU", 4) != 0) + { ++#undef ROUND + #define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word)) + Elf64_Addr note_size = 3 * sizeof (Elf64_Word) +- + ROUND (abi_note[0]) +- + ROUND (abi_note[1]); ++ + ROUND (read32(abi_note[0], be)) ++ + ROUND (read32(abi_note[1], be)); + + if (size - 32 < note_size || note_size == 0) + { +@@ -327,10 +354,10 @@ process_elf_file64 (const char *file_nam + if (size == 0) + break; + +- *osversion = (abi_note [4] << 24) | +- ((abi_note [5] & 0xff) << 16) | +- ((abi_note [6] & 0xff) << 8) | +- (abi_note [7] & 0xff); ++ *osversion = (read32(abi_note [4], be) << 24) | ++ ((read32(abi_note [5], be) & 0xff) << 16) | ++ ((read32(abi_note [6], be) & 0xff) << 8) | ++ (read32(abi_note [7], be) & 0xff); + } + break; + +@@ -354,13 +381,13 @@ process_elf_file64 (const char *file_nam + + /* Find the string table. */ + dynamic_strings = NULL; +- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; ++ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL; + ++dyn_entry) + { + check_ptr (dyn_entry); +- if (dyn_entry->d_tag == DT_STRTAB) ++ if (read64(dyn_entry->d_tag, be) == DT_STRTAB) + { +- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr); ++ dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadaddr); + check_ptr (dynamic_strings); + break; + } +@@ -370,15 +397,15 @@ process_elf_file64 (const char *file_nam + return 1; + + /* Now read the DT_NEEDED and DT_SONAME entries. */ +- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL; ++ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL; + ++dyn_entry) + { +- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME) ++ if (read64(dyn_entry->d_tag, be) == DT_NEEDED || read64(dyn_entry->d_tag, be) == DT_SONAME) + { +- char *name = dynamic_strings + dyn_entry->d_un.d_val; ++ char *name = dynamic_strings + read64(dyn_entry->d_un.d_val, be); + check_ptr (name); + +- if (dyn_entry->d_tag == DT_NEEDED) ++ if (read64(dyn_entry->d_tag, be) == DT_NEEDED) + { + + if (*flag == FLAG_ELF) +@@ -395,7 +422,7 @@ process_elf_file64 (const char *file_nam + } + } + +- else if (dyn_entry->d_tag == DT_SONAME) ++ else if (read64(dyn_entry->d_tag, be) == DT_SONAME) + *soname = xstrdup (name); + + /* Do we have everything we need? */ +Index: ldconfig-native-2.12.1/readlib.c +=================================================================== +--- ldconfig-native-2.12.1.orig/readlib.c ++++ ldconfig-native-2.12.1/readlib.c +@@ -169,7 +169,8 @@ process_file (const char *real_file_name + ret = 1; + } + /* Libraries have to be shared object files. */ +- else if (elf_header->e_type != ET_DYN) ++ else if ((elf_header->e_ident[EI_DATA] == ELFDATA2MSB && be16toh(elf_header->e_type) != ET_DYN) || ++ (elf_header->e_ident[EI_DATA] == ELFDATA2LSB && le16toh(elf_header->e_type) != ET_DYN)) + ret = 1; + else if (process_elf_file (file_name, lib, flag, osversion, soname, + file_contents, statbuf.st_size)) +Index: ldconfig-native-2.12.1/cache.c +=================================================================== +--- ldconfig-native-2.12.1.orig/cache.c ++++ ldconfig-native-2.12.1/cache.c +@@ -39,6 +39,29 @@ + # define N_(msgid) msgid + #define _(msg) msg + ++extern int be; ++ ++static uint16_t write16(uint16_t x, int be) ++{ ++ if (be) ++ return htobe16(x); ++ return htole16(x); ++} ++ ++static uint32_t write32(uint32_t x, int be) ++{ ++ if (be) ++ return htobe32(x); ++ return htole32(x); ++} ++ ++static uint64_t write64(uint64_t x, int be) ++{ ++ if (be) ++ return htobe64(x); ++ return htole64(x); ++} ++ + struct cache_entry + { + char *lib; /* Library name. */ +@@ -279,7 +302,12 @@ save_cache (const char *cache_name) + /* Number of normal cache entries. */ + int cache_entry_old_count = 0; + +- for (entry = entries; entry != NULL; entry = entry->next) ++ if (be) ++ printf("saving cache in big endian encoding\n"); ++ else ++ printf("saving cache in little endian encoding\n"); ++ ++ for (entry = entries; entry != NULL; entry = entry->next) + { + /* Account the final NULs. */ + total_strlen += strlen (entry->lib) + strlen (entry->path) + 2; +@@ -310,7 +338,7 @@ save_cache (const char *cache_name) + memset (file_entries, '\0', sizeof (struct cache_file)); + memcpy (file_entries->magic, CACHEMAGIC, sizeof CACHEMAGIC - 1); + +- file_entries->nlibs = cache_entry_old_count; ++ file_entries->nlibs = write32(cache_entry_old_count, be); + } + + struct cache_file_new *file_entries_new = NULL; +@@ -330,8 +358,8 @@ save_cache (const char *cache_name) + memcpy (file_entries_new->version, CACHE_VERSION, + sizeof CACHE_VERSION - 1); + +- file_entries_new->nlibs = cache_entry_count; +- file_entries_new->len_strings = total_strlen; ++ file_entries_new->nlibs = write32(cache_entry_count, be); ++ file_entries_new->len_strings = write32(total_strlen, be); + } + + /* Pad for alignment of cache_file_new. */ +@@ -358,9 +386,9 @@ save_cache (const char *cache_name) + /* First the library. */ + if (opt_format != 2 && entry->hwcap == 0) + { +- file_entries->libs[idx_old].flags = entry->flags; ++ file_entries->libs[idx_old].flags = write32(entry->flags, be); + /* XXX: Actually we can optimize here and remove duplicates. */ +- file_entries->libs[idx_old].key = str_offset + pad; ++ file_entries->libs[idx_old].key = write32(str_offset + pad, be); + } + if (opt_format != 0) + { +@@ -368,10 +396,10 @@ save_cache (const char *cache_name) + not doing so makes the code easier, the string table + always begins at the beginning of the the new cache + struct. */ +- file_entries_new->libs[idx_new].flags = entry->flags; +- file_entries_new->libs[idx_new].osversion = entry->osversion; +- file_entries_new->libs[idx_new].hwcap = entry->hwcap; +- file_entries_new->libs[idx_new].key = str_offset; ++ file_entries_new->libs[idx_new].flags = write32(entry->flags, be); ++ file_entries_new->libs[idx_new].osversion = write32(entry->osversion, be); ++ file_entries_new->libs[idx_new].hwcap = write64(entry->hwcap, be); ++ file_entries_new->libs[idx_new].key = write32(str_offset, be); + } + + size_t len = strlen (entry->lib) + 1; +@@ -379,9 +407,9 @@ save_cache (const char *cache_name) + str_offset += len; + /* Then the path. */ + if (opt_format != 2 && entry->hwcap == 0) +- file_entries->libs[idx_old].value = str_offset + pad; ++ file_entries->libs[idx_old].value = write32(str_offset + pad, be); + if (opt_format != 0) +- file_entries_new->libs[idx_new].value = str_offset; ++ file_entries_new->libs[idx_new].value = write32(str_offset, be); + len = strlen (entry->path) + 1; + str = mempcpy (str, entry->path, len); + str_offset += len; diff --git a/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch new file mode 100644 index 0000000..a18b2c2 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch @@ -0,0 +1,113 @@ +Upstream-Status: Inappropriate [fix poky patch] + +This patch fixes build issues with a previous endian-ness_handling.patch on +distros that don't have macros referenced + +7/20/2011 +Matthew McClintock + +diff -purN ldconfig-native-2.12.1.orig/endian_extra.h ldconfig-native-2.12.1/endian_extra.h +--- ldconfig-native-2.12.1.orig/endian_extra.h 1969-12-31 18:00:00.000000000 -0600 ++++ ldconfig-native-2.12.1/endian_extra.h 2011-07-19 18:09:14.323048417 -0500 +@@ -0,0 +1,64 @@ ++/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++ ++#ifndef _ENDIAN_EXTRA_H ++#define _ENDIAN_EXTRA_H 1 ++ ++/* Don't redefine these macros if they already exist */ ++#ifndef htobe16 ++#ifdef __USE_BSD ++/* Conversion interfaces. */ ++# include ++ ++# if __BYTE_ORDER == __LITTLE_ENDIAN ++# define htobe16(x) __bswap_16 (x) ++# define htole16(x) (x) ++# define be16toh(x) __bswap_16 (x) ++# define le16toh(x) (x) ++ ++# define htobe32(x) __bswap_32 (x) ++# define htole32(x) (x) ++# define be32toh(x) __bswap_32 (x) ++# define le32toh(x) (x) ++ ++# define htobe64(x) __bswap_64 (x) ++# define htole64(x) (x) ++# define be64toh(x) __bswap_64 (x) ++# define le64toh(x) (x) ++# else ++# define htobe16(x) (x) ++# define htole16(x) __bswap_16 (x) ++# define be16toh(x) (x) ++# define le16toh(x) __bswap_16 (x) ++ ++# define htobe32(x) (x) ++# define htole32(x) __bswap_32 (x) ++# define be32toh(x) (x) ++# define le32toh(x) __bswap_32 (x) ++ ++# define htobe64(x) (x) ++# define htole64(x) __bswap_64 (x) ++# define be64toh(x) (x) ++# define le64toh(x) __bswap_64 (x) ++# endif ++#endif ++#endif ++ ++#endif /* endian_extra.h */ +diff -purN ldconfig-native-2.12.1.orig/cache.c ldconfig-native-2.12.1/cache.c +--- ldconfig-native-2.12.1.orig/cache.c 2011-07-19 18:21:28.347041301 -0500 ++++ ldconfig-native-2.12.1/cache.c 2011-07-19 18:22:54.118048064 -0500 +@@ -39,6 +39,8 @@ + # define N_(msgid) msgid + #define _(msg) msg + ++#include "endian_extra.h" ++ + extern int be; + + static uint16_t write16(uint16_t x, int be) +diff -purN ldconfig-native-2.12.1.orig/readelflib.c ldconfig-native-2.12.1/readelflib.c +--- ldconfig-native-2.12.1.orig/readelflib.c 2011-07-19 18:21:28.346041593 -0500 ++++ ldconfig-native-2.12.1/readelflib.c 2011-07-19 18:23:05.324059875 -0500 +@@ -25,6 +25,9 @@ + + /* check_ptr checks that a pointer is in the mmaped file and doesn't + point outside it. */ ++ ++#include "endian_extra.h" ++ + #undef check_ptr + #define check_ptr(ptr) \ + do \ +diff -purN ldconfig-native-2.12.1.orig/readlib.c ldconfig-native-2.12.1/readlib.c +--- ldconfig-native-2.12.1.orig/readlib.c 2011-07-19 18:21:28.346041593 -0500 ++++ ldconfig-native-2.12.1/readlib.c 2011-07-19 18:23:23.877046210 -0500 +@@ -40,6 +40,8 @@ + + #include "ldconfig.h" + ++#include "endian_extra.h" ++ + #define _(msg) msg + + #define Elf32_CLASS ELFCLASS32 diff --git a/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch new file mode 100644 index 0000000..4e9aab9 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch @@ -0,0 +1,24 @@ +Upstream-Status: Inappropriate [embedded specific] + +The native version of ldconfig was using native definition of LD_SO (i.e. +ld-linux-x86-64.so.2 ) which is not correct for doing the cross ldconfig. +This was causing libc.so on the target marked as ELF lib rather than +FLAG_ELF_LIBC6 in the ld.so.cache. + +Nitin A Kamble 2011/04/4 + +Index: ldconfig-native-2.12.1/readlib.c +=================================================================== +--- ldconfig-native-2.12.1.orig/readlib.c ++++ ldconfig-native-2.12.1/readlib.c +@@ -51,6 +51,10 @@ struct known_names + int flag; + }; + ++/* don't use host's definition of LD_SO */ ++#undef LD_SO ++#define LD_SO "ld.so.1" ++ + static struct known_names interpreters[] = + { + { "/lib/" LD_SO, FLAG_ELF_LIBC6 }, diff --git a/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch new file mode 100644 index 0000000..5ed4f6f --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch @@ -0,0 +1,37 @@ +Upstream-Status: Inappropriate [embedded specific] + +make ldconfig default to both /lib+/usr/lib, /lib32+/usr/lib32 and +/lib64+/usr/lib64 on bi-ABI architectures. + +--- + ldconfig.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff -urpN a/ldconfig.c b/ldconfig.c +--- a/ldconfig.c ++++ b/ldconfig.c +@@ -52,7 +52,11 @@ + + #define SYSCONFDIR "/etc" + #define LIBDIR "/usr/lib" ++#define LIBDIR32 "/usr/lib32" ++#define LIBDIR64 "/usr/lib64" + #define SLIBDIR "/lib" ++#define SLIBDIR32 "/lib32" ++#define SLIBDIR64 "/lib64" + # define N_(msgid) msgid + #define _(msg) msg + +@@ -1373,6 +1377,12 @@ main (int argc, char **argv) + add_system_dir (SLIBDIR); + if (strcmp (SLIBDIR, LIBDIR)) + add_system_dir (LIBDIR); ++ add_system_dir (SLIBDIR32); ++ if (strcmp (SLIBDIR32, LIBDIR32)) ++ add_system_dir (LIBDIR32); ++ add_system_dir (SLIBDIR64); ++ if (strcmp (SLIBDIR64, LIBDIR64)) ++ add_system_dir (LIBDIR64); + } + + const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE; diff --git a/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 new file mode 100644 index 0000000..dc1e798 Binary files /dev/null and b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 differ diff --git a/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch new file mode 100644 index 0000000..52986e6 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch @@ -0,0 +1,471 @@ +Upstream-Status: Inappropriate [embedded specific] + +enable standalone building of ldconfig + +--- + cache.c | 11 +- + chroot_canon.c | 7 + + dl-cache.c | 235 --------------------------------------------------------- + dl-cache.h | 3 + ldconfig.c | 27 ++++-- + readlib.c | 7 + + xstrdup.c | 11 -- + 7 files changed, 45 insertions(+), 256 deletions(-) + +Index: ldconfig-native-2.12.1/cache.c +=================================================================== +--- ldconfig-native-2.12.1.orig/cache.c ++++ ldconfig-native-2.12.1/cache.c +@@ -16,6 +16,9 @@ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + ++#define _LARGEFILE64_SOURCE ++#define _GNU_SOURCE ++ + #include + #include + #include +@@ -31,8 +34,10 @@ + #include + #include + +-#include +-#include ++#include "ldconfig.h" ++#include "dl-cache.h" ++# define N_(msgid) msgid ++#define _(msg) msg + + struct cache_entry + { +Index: ldconfig-native-2.12.1/chroot_canon.c +=================================================================== +--- ldconfig-native-2.12.1.orig/chroot_canon.c ++++ ldconfig-native-2.12.1/chroot_canon.c +@@ -17,6 +17,9 @@ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + ++#define _LARGEFILE64_SOURCE ++#define _GNU_SOURCE ++ + #include + #include + #include +@@ -27,7 +30,9 @@ + #include + #include + +-#include ++#include "ldconfig.h" ++ ++#define __set_errno(Val) errno = (Val) + + #ifndef PATH_MAX + #define PATH_MAX 1024 +Index: ldconfig-native-2.12.1/dl-cache.c +=================================================================== +--- ldconfig-native-2.12.1.orig/dl-cache.c ++++ ldconfig-native-2.12.1/dl-cache.c +@@ -20,12 +20,12 @@ + + #include + #include +-#include ++//#include "ldsodefs.h" + #include + #include + #include + +-#include ++//#include "_itoa.h" + + #ifndef _DL_PLATFORMS_COUNT + # define _DL_PLATFORMS_COUNT 0 +@@ -39,103 +39,7 @@ static size_t cachesize; + /* 1 if cache_data + PTR points into the cache. */ + #define _dl_cache_verify_ptr(ptr) (ptr < cache_data_size) + +-#define SEARCH_CACHE(cache) \ +-/* We use binary search since the table is sorted in the cache file. \ +- The first matching entry in the table is returned. \ +- It is important to use the same algorithm as used while generating \ +- the cache file. */ \ +-do \ +- { \ +- left = 0; \ +- right = cache->nlibs - 1; \ +- \ +- while (left <= right) \ +- { \ +- __typeof__ (cache->libs[0].key) key; \ +- \ +- middle = (left + right) / 2; \ +- \ +- key = cache->libs[middle].key; \ +- \ +- /* Make sure string table indices are not bogus before using \ +- them. */ \ +- if (! _dl_cache_verify_ptr (key)) \ +- { \ +- cmpres = 1; \ +- break; \ +- } \ +- \ +- /* Actually compare the entry with the key. */ \ +- cmpres = _dl_cache_libcmp (name, cache_data + key); \ +- if (__builtin_expect (cmpres == 0, 0)) \ +- { \ +- /* Found it. LEFT now marks the last entry for which we \ +- know the name is correct. */ \ +- left = middle; \ +- \ +- /* There might be entries with this name before the one we \ +- found. So we have to find the beginning. */ \ +- while (middle > 0) \ +- { \ +- __typeof__ (cache->libs[0].key) key; \ +- \ +- key = cache->libs[middle - 1].key; \ +- /* Make sure string table indices are not bogus before \ +- using them. */ \ +- if (! _dl_cache_verify_ptr (key) \ +- /* Actually compare the entry. */ \ +- || _dl_cache_libcmp (name, cache_data + key) != 0) \ +- break; \ +- --middle; \ +- } \ +- \ +- do \ +- { \ +- int flags; \ +- __typeof__ (cache->libs[0]) *lib = &cache->libs[middle]; \ +- \ +- /* Only perform the name test if necessary. */ \ +- if (middle > left \ +- /* We haven't seen this string so far. Test whether the \ +- index is ok and whether the name matches. Otherwise \ +- we are done. */ \ +- && (! _dl_cache_verify_ptr (lib->key) \ +- || (_dl_cache_libcmp (name, cache_data + lib->key) \ +- != 0))) \ +- break; \ +- \ +- flags = lib->flags; \ +- if (_dl_cache_check_flags (flags) \ +- && _dl_cache_verify_ptr (lib->value)) \ +- { \ +- if (best == NULL || flags == GLRO(dl_correct_cache_id)) \ +- { \ +- HWCAP_CHECK; \ +- best = cache_data + lib->value; \ +- \ +- if (flags == GLRO(dl_correct_cache_id)) \ +- /* We've found an exact match for the shared \ +- object and no general `ELF' release. Stop \ +- searching. */ \ +- break; \ +- } \ +- } \ +- } \ +- while (++middle <= right); \ +- break; \ +- } \ +- \ +- if (cmpres < 0) \ +- left = middle + 1; \ +- else \ +- right = middle - 1; \ +- } \ +- } \ +-while (0) +- +- + int +-internal_function + _dl_cache_libcmp (const char *p1, const char *p2) + { + while (*p1 != '\0') +@@ -172,139 +76,3 @@ _dl_cache_libcmp (const char *p1, const + } + return *p1 - *p2; + } +- +- +-/* Look up NAME in ld.so.cache and return the file name stored there, +- or null if none is found. */ +- +-const char * +-internal_function +-_dl_load_cache_lookup (const char *name) +-{ +- int left, right, middle; +- int cmpres; +- const char *cache_data; +- uint32_t cache_data_size; +- const char *best; +- +- /* Print a message if the loading of libs is traced. */ +- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)) +- _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE); +- +- if (cache == NULL) +- { +- /* Read the contents of the file. */ +- void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize, +- PROT_READ); +- +- /* We can handle three different cache file formats here: +- - the old libc5/glibc2.0/2.1 format +- - the old format with the new format in it +- - only the new format +- The following checks if the cache contains any of these formats. */ +- if (file != MAP_FAILED && cachesize > sizeof *cache +- && memcmp (file, CACHEMAGIC, sizeof CACHEMAGIC - 1) == 0) +- { +- size_t offset; +- /* Looks ok. */ +- cache = file; +- +- /* Check for new version. */ +- offset = ALIGN_CACHE (sizeof (struct cache_file) +- + cache->nlibs * sizeof (struct file_entry)); +- +- cache_new = (struct cache_file_new *) ((void *) cache + offset); +- if (cachesize < (offset + sizeof (struct cache_file_new)) +- || memcmp (cache_new->magic, CACHEMAGIC_VERSION_NEW, +- sizeof CACHEMAGIC_VERSION_NEW - 1) != 0) +- cache_new = (void *) -1; +- } +- else if (file != MAP_FAILED && cachesize > sizeof *cache_new +- && memcmp (file, CACHEMAGIC_VERSION_NEW, +- sizeof CACHEMAGIC_VERSION_NEW - 1) == 0) +- { +- cache_new = file; +- cache = file; +- } +- else +- { +- if (file != MAP_FAILED) +- __munmap (file, cachesize); +- cache = (void *) -1; +- } +- +- assert (cache != NULL); +- } +- +- if (cache == (void *) -1) +- /* Previously looked for the cache file and didn't find it. */ +- return NULL; +- +- best = NULL; +- +- if (cache_new != (void *) -1) +- { +- uint64_t platform; +- +- /* This is where the strings start. */ +- cache_data = (const char *) cache_new; +- +- /* Now we can compute how large the string table is. */ +- cache_data_size = (const char *) cache + cachesize - cache_data; +- +- platform = _dl_string_platform (GLRO(dl_platform)); +- if (platform != (uint64_t) -1) +- platform = 1ULL << platform; +- +-#define _DL_HWCAP_TLS_MASK (1LL << 63) +- uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & GLRO(dl_hwcap_mask)) +- | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK); +- +- /* Only accept hwcap if it's for the right platform. */ +-#define HWCAP_CHECK \ +- if (lib->hwcap & hwcap_exclude) \ +- continue; \ +- if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion)) \ +- continue; \ +- if (_DL_PLATFORMS_COUNT \ +- && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \ +- && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \ +- continue +- SEARCH_CACHE (cache_new); +- } +- else +- { +- /* This is where the strings start. */ +- cache_data = (const char *) &cache->libs[cache->nlibs]; +- +- /* Now we can compute how large the string table is. */ +- cache_data_size = (const char *) cache + cachesize - cache_data; +- +-#undef HWCAP_CHECK +-#define HWCAP_CHECK do {} while (0) +- SEARCH_CACHE (cache); +- } +- +- /* Print our result if wanted. */ +- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0) +- && best != NULL) +- _dl_debug_printf (" trying file=%s\n", best); +- +- return best; +-} +- +-#ifndef MAP_COPY +-/* If the system does not support MAP_COPY we cannot leave the file open +- all the time since this would create problems when the file is replaced. +- Therefore we provide this function to close the file and open it again +- once needed. */ +-void +-_dl_unload_cache (void) +-{ +- if (cache != NULL && cache != (struct cache_file *) -1) +- { +- __munmap (cache, cachesize); +- cache = NULL; +- } +-} +-#endif +Index: ldconfig-native-2.12.1/dl-cache.h +=================================================================== +--- ldconfig-native-2.12.1.orig/dl-cache.h ++++ ldconfig-native-2.12.1/dl-cache.h +@@ -101,5 +101,4 @@ struct cache_file_new + (((addr) + __alignof__ (struct cache_file_new) -1) \ + & (~(__alignof__ (struct cache_file_new) - 1))) + +-extern int _dl_cache_libcmp (const char *p1, const char *p2) +- internal_function; ++extern int _dl_cache_libcmp (const char *p1, const char *p2); +Index: ldconfig-native-2.12.1/ldconfig.c +=================================================================== +--- ldconfig-native-2.12.1.orig/ldconfig.c ++++ ldconfig-native-2.12.1/ldconfig.c +@@ -16,6 +16,9 @@ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + ++#define _LARGEFILE64_SOURCE ++#define _GNU_SOURCE ++ + #define PROCINFO_CLASS static + #include + #include +@@ -39,10 +42,20 @@ + #include + #include + +-#include +-#include ++#include "ldconfig.h" ++#include "dl-cache.h" ++ ++#include "dl-procinfo.h" ++ ++#include "argp.h" ++ ++ ++#define SYSCONFDIR "/etc" ++#define LIBDIR "/usr/lib" ++#define SLIBDIR "/lib" ++# define N_(msgid) msgid ++#define _(msg) msg + +-#include + + #ifdef _DL_FIRST_PLATFORM + # define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT) +@@ -55,7 +68,7 @@ + #endif + + /* Get libc version number. */ +-#include ++#include "version.h" + + #define PACKAGE _libc_intl_domainname + +@@ -152,8 +165,8 @@ static const struct argp_option options[ + { NULL, 0, NULL, 0, NULL, 0 } + }; + +-#define PROCINFO_CLASS static +-#include ++//#define PROCINFO_CLASS static ++//#include + + /* Short description of program. */ + static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings."); +@@ -291,6 +304,7 @@ parse_opt (int key, char *arg, struct ar + return 0; + } + ++#define REPORT_BUGS_TO "mailing list : poky@yoctoproject.org" + /* Print bug-reporting information in the help message. */ + static char * + more_help (int key, const char *text, void *input) +@@ -315,7 +329,7 @@ For bug reporting instructions, please s + static void + print_version (FILE *stream, struct argp_state *state) + { +- fprintf (stream, "ldconfig %s%s\n", PKGVERSION, VERSION); ++ fprintf (stream, "ldconfig (Hacked Poky Version)\n"); + fprintf (stream, gettext ("\ + Copyright (C) %s Free Software Foundation, Inc.\n\ + This is free software; see the source for copying conditions. There is NO\n\ +@@ -1233,6 +1247,7 @@ set_hwcap (void) + hwcap_mask = strtoul (mask, NULL, 0); + } + ++const char _libc_intl_domainname[] = "libc"; + + int + main (int argc, char **argv) +Index: ldconfig-native-2.12.1/readlib.c +=================================================================== +--- ldconfig-native-2.12.1.orig/readlib.c ++++ ldconfig-native-2.12.1/readlib.c +@@ -22,6 +22,9 @@ + development version. Besides the simplification, it has also been + modified to read some other file formats. */ + ++#define _LARGEFILE64_SOURCE ++#define _GNU_SOURCE ++ + #include + #include + #include +@@ -35,7 +38,9 @@ + #include + #include + +-#include ++#include "ldconfig.h" ++ ++#define _(msg) msg + + #define Elf32_CLASS ELFCLASS32 + #define Elf64_CLASS ELFCLASS64 +Index: ldconfig-native-2.12.1/xstrdup.c +=================================================================== +--- ldconfig-native-2.12.1.orig/xstrdup.c ++++ ldconfig-native-2.12.1/xstrdup.c +@@ -16,15 +16,10 @@ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +-#ifdef HAVE_CONFIG_H +-# include +-#endif ++#define _GNU_SOURCE ++ ++#include + +-#if defined STDC_HEADERS || defined HAVE_STRING_H || _LIBC +-# include +-#else +-# include +-#endif + void *xmalloc (size_t n) __THROW; + char *xstrdup (char *string) __THROW; + diff --git a/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch new file mode 100644 index 0000000..27bc411 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch @@ -0,0 +1,36 @@ +Upstream-Status: Pending + +Coming from this bug: http://sourceware.org/bugzilla/show_bug.cgi?id=11149 + +Nitin A Kamble 2011/03/29 + +--- ldconfig-native-2.12.1.orig/ldconfig.c ++++ ldconfig-native-2.12.1/ldconfig.c +@@ -1359,14 +1359,9 @@ main (int argc, char **argv) + + const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE; + if (opt_chroot) +- { +- aux_cache_file = chroot_canon (opt_chroot, aux_cache_file); +- if (aux_cache_file == NULL) +- error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"), +- _PATH_LDCONFIG_AUX_CACHE); +- } ++ aux_cache_file = chroot_canon (opt_chroot, aux_cache_file); + +- if (! opt_ignore_aux_cache) ++ if (! opt_ignore_aux_cache && aux_cache_file) + load_aux_cache (aux_cache_file); + else + init_aux_cache (); +@@ -1376,7 +1371,8 @@ main (int argc, char **argv) + if (opt_build_cache) + { + save_cache (cache_file); +- save_aux_cache (aux_cache_file); ++ if (aux_cache_file) ++ save_aux_cache (aux_cache_file); + } + + return 0; + diff --git a/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native_2.12.1.bb b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native_2.12.1.bb new file mode 100644 index 0000000..7c34635 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/ldconfig-native_2.12.1.bb @@ -0,0 +1,32 @@ +SUMMARY = "A standalone native ldconfig build" + +LICENSE = "GPLv2+" + +LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=17;md5=1d15f20937c055cb5de2329a4c054399" + +SRC_URI = "file://ldconfig-native-2.12.1.tar.bz2 \ + file://ldconfig.patch \ + file://ldconfig_aux-cache_path_fix.patch \ + file://32and64bit.patch \ + file://endian-ness_handling.patch \ + file://flag_fix.patch \ + file://endianess-header.patch \ + file://ldconfig-default-to-all-multilib-dirs.patch \ +" + +PR = "r2" + +FILESEXTRAPATHS =. "${FILE_DIRNAME}/${P}:" + +inherit native + +S = "${WORKDIR}/${PN}-${PV}" + +do_compile () { + $CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c -I. dl-cache.c -o ldconfig +} + +do_install () { + install -d ${D}/${bindir}/ + install ldconfig ${D}/${bindir}/ +} diff --git a/meta-linaro-toolchain/recipes-core/glibc/site_config/funcs b/meta-linaro-toolchain/recipes-core/glibc/site_config/funcs new file mode 100644 index 0000000..ccc8539 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/site_config/funcs @@ -0,0 +1,474 @@ +a64l +abs +access +__adjtimex +alarm +alphasort +argz_append +__argz_count +argz_create_sep +argz_insert +__argz_next +argz_next +__argz_stringify +argz_stringify +asprintf +atexit +atof +atoi +bcmp +bcopy +bindresvport +bind_textdomain_codeset +btowc +bzero +calloc +canonicalize_file_name +catgets +cfgetospeed +cfsetispeed +cfsetspeed +chmod +chown +chroot +clock +close +closedir +closelog +confstr +connect +daemon +dcgettext +difftime +dirfd +dirname +dngettext +dup2 +ecvt +endgrent +endmntent +endpwent +endutent +endutxent +epoll_ctl +err +ether_hostton +ether_ntohost +euidaccess +execv +fchdir +fchmod +fchmodat +fchown +fchownat +fcntl +fcvt +fdatasync +fdopendir +feof_unlocked +fgets_unlocked +fgetxattr +finite +flistxattr +flock +flockfile +fnmatch +fork +fpathconf +__fpending +fprintf +free +freeaddrinfo +freeifaddrs +fseeko +__fsetlocking +fsetxattr +fstat64 +fstat +fstatfs +fsync +ftello +ftime +ftruncate +funlockfile +futimes +futimesat +gai_strerror +gcvt +getaddrinfo +getc_unlocked +getcwd +getdelim +getdomainname +getdtablesize +getegid +getenv +geteuid +getgid +getgrent +getgrent_r +getgrgid_r +getgrnam +getgrnam_r +getgrouplist +getgroups +gethostbyaddr_r +gethostbyname2 +gethostbyname +gethostbyname_r +gethostent +gethostid +gethostname +getifaddrs +getline +getloadavg +getmntent +getmsg +getnameinfo +getnetbyaddr_r +getnetgrent_r +getopt +getopt_long +getopt_long_only +getpagesize +getpass +getpeername +getpgrp +getpid +getppid +getprotoent_r +getpwent +getpwent_r +getpwnam +getpwnam_r +getpwuid +getpwuid_r +getresuid +getrlimit +getrusage +getservbyname +getservbyname_r +getservbyport_r +getservent +getservent_r +getspnam +getspnam_r +gettimeofday +getttyent +getttynam +getuid +getusershell +getutent +getutid +getutline +getutmp +getutmpx +getutxent +getutxid +getutxline +getwd +getxattr +glob +gmtime +gmtime_r +grantpt +group_member +herror +hstrerror +iconv +iconv_open +if_freenameindex +if_indextoname +if_nameindex +if_nametoindex +index +inet_addr +inet_aton +inet_ntoa +inet_ntop +inet_pton +initgroups +innetgr +iruserok +isascii +isatty +isblank +isgraph +isinf +isnan +isprint +isspace +iswalnum +iswcntrl +iswctype +iswprint +iswspace +iswupper +isxdigit +kill +killpg +lchown +lckpwdf +lgetxattr +link +listxattr +llistxattr +localtime +localtime_r +lockf +lrand48 +lsearch +lseek64 +lsetxattr +lstat +mallinfo +malloc +mblen +mbrlen +mbrtowc +mbsinit +mbsrtowcs +mbtowc +memalign +memchr +memcmp +memcpy +memmove +mempcpy +memrchr +memset +mkdir +mkdirat +mkdtemp +mkfifo +mknod +mkstemp64 +mkstemp +mktime +mlock +mmap +mtrace +munlock +munmap +nanosleep +nice +nl_langinfo +ntp_adjtime +ntp_gettime +_obstack_free +on_exit +open64 +open +openat +opendir +openlog +pathconf +pipe +poll +popen +posix_memalign +prctl +pread +printf +__progname +pselect +pthread_mutex_lock +ptsname +putenv +putgrent +putpwent +putspent +pututline +pututxline +putwc +pwrite +qsort +raise +rand +random +rand_r +read +readdir +readdir_r +readlink +realloc +realpath +re_comp +recvmsg +re_exec +regcomp +regexec +remove +rename +re_search +rmdir +rpmatch +rresvport_af +ruserok +ruserok_af +sbrk +scandir +sched_setscheduler +sched_yield +__secure_getenv +select +semctl +semget +sendmsg +setbuf +setbuffer +setegid +setenv +seteuid +setgid +setgroups +sethostname +setitimer +_setjmp +setjmp +setlinebuf +setlocale +setmntent +setpgid +setpgrp +setpriority +setregid +setresgid +setresuid +setreuid +setrlimit +setsid +setsockopt +settimeofday +setuid +setutent +setutxent +setvbuf +setxattr +sgetspent +shmat +shmctl +shmdt +shmget +shutdown +sigaction +sigaddset +sigaltstack +sigblock +sigemptyset +sighold +siginterrupt +signal +sigprocmask +sigset +sigsetmask +sigstack +sigsuspend +sigvec +snprintf +socket +socketpair +sprintf +srand48 +srand +srandom +sscanf +stat +statfs +statvfs +stime +stpcpy +strcasecmp +strcasestr +strchr +strchrnul +strcmp +strcspn +strdup +strerror +strerror_r +strftime +strlen +strncasecmp +strncmp +strndup +strnlen +strpbrk +strptime +strrchr +strsep +strsignal +strspn +strstr +strtod +strtoimax +strtok_r +strtol +strtoll +strtoul +strtoull +strtoumax +strverscmp +strxfrm +symlink +sync +sysconf +sysctl +sysinfo +syslog +_sys_siglist +sys_siglist +system +tcgetattr +tcgetpgrp +tcsetattr +tcsetpgrp +time +timegm +times +timezone +tmpnam +towlower +towupper +truncate +tsearch +ttyname +tzset +ulimit +umask +uname +unlink +unsetenv +unshare +updwtmp +updwtmpx +usleep +ustat +utime +utimes +utmpname +utmpxname +valloc +vasprintf +verrx +vfork +vfprintf +vfscanf +vhangup +vprintf +vsnprintf +vsprintf +wait3 +wait4 +waitpid +wcrtomb +wcscoll +wcsdup +wcslen +wctob +wctomb +wctype +wcwidth +wmemchr +wmemcpy +wmempcpy diff --git a/meta-linaro-toolchain/recipes-core/glibc/site_config/headers b/meta-linaro-toolchain/recipes-core/glibc/site_config/headers new file mode 100644 index 0000000..609ab53 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/site_config/headers @@ -0,0 +1,156 @@ +aio.h +alloca.h +argz.h +arpa/inet.h +arpa/nameser.h +asm/byteorder.h +asm/ioctls.h +asm/page.h +asm/types.h +assert.h +byteswap.h +crypt.h +ctype.h +dirent.h +dlfcn.h +elf.h +endian.h +err.h +errno.h +execinfo.h +fcntl.h +features.h +float.h +fstab.h +ftw.h +getopt.h +glob.h +grp.h +iconv.h +ifaddrs.h +inttypes.h +langinfo.h +lastlog.h +libgen.h +libintl.h +limits.h +linux/capability.h +linux/fd.h +linux/fs.h +linux/hayesesp.h +linux/hdreg.h +linux/icmp.h +linux/in6.h +linux/joystick.h +linux/ptrace.h +linux/serial.h +linux/sonypi.h +linux/unistd.h +linux/utsname.h +linux/version.h +locale.h +malloc.h +math.h +mcheck.h +memory.h +mntent.h +mqueue.h +netdb.h +net/if.h +netinet/ether.h +netinet/in.h +netinet/ip6.h +netinet/ip.h +netinet/tcp.h +netinet/udp.h +netipx/ipx.h +net/route.h +paths.h +poll.h +pthread.h +pty.h +pwd.h +regex.h +resolv.h +rpc/rpc.h +rpc/types.h +sched.h +scsi/scsi.h +search.h +semaphore.h +setjmp.h +sgtty.h +shadow.h +signal.h +stdarg.h +stdbool.h +stdc +stddef.h +stdint.h +stdio.h +stdlib.h +string.h +strings.h +stropts.h +sys/bitypes.h +sys/cdefs.h +sys/dir.h +sys/epoll.h +sysexits.h +sys/fcntl.h +sys/file.h +sys/fsuid.h +sys/ioctl.h +sys/ipc.h +syslog.h +sys/mman.h +sys/mount.h +sys/mtio.h +sys/param.h +sys/poll.h +sys/prctl.h +sys/ptrace.h +sys/queue.h +sys/reg.h +sys/resource.h +sys/select.h +sys/sem.h +sys/shm.h +sys/signal.h +sys/socket.h +sys/socketvar.h +sys/soundcard.h +sys/statfs.h +sys/stat.h +sys/statvfs.h +sys/stropts.h +sys/swap.h +sys/sysctl.h +sys/sysinfo.h +sys/sysmacros.h +sys/termios.h +sys/timeb.h +sys/time.h +sys/times.h +sys/timex.h +sys/types.h +sys/uio.h +sys/un.h +sys/unistd.h +sys/user.h +sys/utsname.h +sys/vfs.h +sys/wait.h +termio.h +termios.h +time.h +ttyent.h +ulimit.h +unistd.h +ustat.h +utime.h +utmp.h +utmpx.h +values.h +wchar.h +wctype.h diff --git a/meta-linaro-toolchain/recipes-core/glibc/site_config/types b/meta-linaro-toolchain/recipes-core/glibc/site_config/types new file mode 100644 index 0000000..178bd85 --- /dev/null +++ b/meta-linaro-toolchain/recipes-core/glibc/site_config/types @@ -0,0 +1,21 @@ +char +char * +double +float +int +long +long double +long int +long long +long long int +short +short int +signed char +unsigned char +unsigned int +unsigned long +unsigned long int +unsigned long long int +unsigned short +unsigned short int +void * diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-cross-canadian_linaro-2.24.bb b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-cross-canadian_linaro-2.24.bb new file mode 100644 index 0000000..76b6277 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-cross-canadian_linaro-2.24.bb @@ -0,0 +1,3 @@ +require recipes-devtools/binutils/binutils.inc +require recipes-devtools/binutils/binutils-${PV}.inc +require recipes-devtools/binutils/binutils-cross-canadian.inc diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-cross_linaro-2.24.bb b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-cross_linaro-2.24.bb new file mode 100644 index 0000000..a8b918e --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-cross_linaro-2.24.bb @@ -0,0 +1,3 @@ +require recipes-devtools/binutils/binutils.inc +require recipes-devtools/binutils/binutils-${PV}.inc +require recipes-devtools/binutils/binutils-cross.inc diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-crosssdk_linaro-2.24.bb b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-crosssdk_linaro-2.24.bb new file mode 100644 index 0000000..1c62ed4 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-crosssdk_linaro-2.24.bb @@ -0,0 +1,13 @@ +require recipes-devtools/binutils/binutils-cross_${PV}.bb + +inherit crosssdk + +PN = "binutils-crosssdk-${TARGET_ARCH}" + +PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk" + +SRC_URI += "file://relocatable_sdk.patch" + +do_configure_prepend () { + sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt +} diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24.inc b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24.inc new file mode 100644 index 0000000..888e0e9 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24.inc @@ -0,0 +1,47 @@ +BPV = "2.24.0" +MMYY = "14.11" +RELEASE = "20${MMYY}" +LINARORELEASE = "20${MMYY}-2" +PR = "r${RELEASE}" + +LIC_FILES_CHKSUM="\ + file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ + file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\ + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\ + file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\ + file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\ + file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ + file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\ + file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\ + file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\ + " + +SRC_URI = "\ + http://releases.linaro.org/${MMYY}/components/toolchain/binutils-linaro/binutils-linaro-${BPV}-${LINARORELEASE}.tar.xz \ + file://binutils-uclibc-100-uclibc-conf.patch \ + file://binutils-uclibc-300-001_ld_makefile_patch.patch \ + file://binutils-uclibc-300-006_better_file_error.patch \ + file://binutils-uclibc-300-012_check_ldrunpath_length.patch \ + file://binutils-uclibc-gas-needs-libm.patch \ + file://libtool-2.4-update.patch \ + file://libiberty_path_fix.patch \ + file://binutils-poison.patch \ + file://libtool-rpath-fix.patch \ + file://binutils-armv5e.patch \ + file://mips64-default-ld-emulation.patch \ + file://binutils-xlp-support.patch \ + file://fix-pr15815.patch;apply=no \ + file://fix-pr2404.patch \ + file://fix-pr16476.patch \ + file://fix-pr16428.patch \ + file://replace_macros_with_static_inline.patch;apply=no \ + file://0001-Fix-MMIX-build-breakage-from-bfd_set_section_vma-cha.patch;apply=no \ + file://binutils-uninitialised-warning.patch \ + file://0001-AArch64-Define-LP64-LE-loader-name.patch \ + file://0001-AArch64-Define-LP64-BE-linker-name.patch \ + " + +SRC_URI[md5sum] = "05c1d4bc718ec05f6d53785eea10763f" +SRC_URI[sha256sum] = "9196bb6f53c6f113681f06fc396f615101e5f367a4ea48dbcbe45616d5eb1d06" + +S = "${WORKDIR}/binutils-linaro-${BPV}-${LINARORELEASE}" diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/0001-AArch64-Define-LP64-BE-linker-name.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/0001-AArch64-Define-LP64-BE-linker-name.patch new file mode 100644 index 0000000..7e4923c --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/0001-AArch64-Define-LP64-BE-linker-name.patch @@ -0,0 +1,18 @@ +From 5a4f233680ecf1132591f8213ff1cc6a2535b1b7 Mon Sep 17 00:00:00 2001 +From: Marcus Shawcroft +Date: Mon, 20 Jan 2014 18:20:04 +0000 +Subject: [PATCH] [AArch64] Define LP64 BE linker name. + +--- + ld/ChangeLog | 4 ++++ + ld/emulparams/aarch64linuxb.sh | 1 + + 2 files changed, 5 insertions(+) + +Index: binutils-linaro-2.24-2014.03/ld/emulparams/aarch64linuxb.sh +=================================================================== +--- binutils-linaro-2.24-2014.03.orig/ld/emulparams/aarch64linuxb.sh ++++ binutils-linaro-2.24-2014.03/ld/emulparams/aarch64linuxb.sh +@@ -1,2 +1,3 @@ + . ${srcdir}/emulparams/aarch64linux.sh + OUTPUT_FORMAT="elf64-bigaarch64" ++ELF_INTERPRETER_NAME=\"/lib/ld-linux-aarch64_be.so.1\" diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/0001-AArch64-Define-LP64-LE-loader-name.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/0001-AArch64-Define-LP64-LE-loader-name.patch new file mode 100644 index 0000000..ea22461 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/0001-AArch64-Define-LP64-LE-loader-name.patch @@ -0,0 +1,20 @@ +From 30feb358161fe68402e0e42deebe71a0c432763b Mon Sep 17 00:00:00 2001 +From: Marcus Shawcroft +Date: Mon, 20 Jan 2014 18:18:52 +0000 +Subject: [PATCH] [AArch64] Define LP64 LE loader name. + +--- + ld/ChangeLog | 4 ++++ + ld/emulparams/aarch64linux.sh | 2 ++ + 2 files changed, 6 insertions(+) + +Index: binutils-linaro-2.24-2014.03/ld/emulparams/aarch64linux.sh +=================================================================== +--- binutils-linaro-2.24-2014.03.orig/ld/emulparams/aarch64linux.sh ++++ binutils-linaro-2.24-2014.03/ld/emulparams/aarch64linux.sh +@@ -45,3 +45,5 @@ case "$target" in + esac + ;; + esac ++ ++ELF_INTERPRETER_NAME=\"/lib/ld-linux-aarch64.so.1\" diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/0001-Fix-MMIX-build-breakage-from-bfd_set_section_vma-cha.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/0001-Fix-MMIX-build-breakage-from-bfd_set_section_vma-cha.patch new file mode 100644 index 0000000..f786b17 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/0001-Fix-MMIX-build-breakage-from-bfd_set_section_vma-cha.patch @@ -0,0 +1,31 @@ +Upstream-Status: Backport + +From 0a09fb4a09e80c36fa3ef763ae276fd13d272a36 Mon Sep 17 00:00:00 2001 +From: Hans-Peter Nilsson +Date: Sat, 1 Feb 2014 01:11:28 +0100 +Subject: [PATCH] Fix MMIX build breakage from bfd_set_section_vma change. + + * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Fix typo in + call to bfd_set_section_vma exposed by recent bfd_set_section_vma + change. +--- + ld/ChangeLog | 6 ++++++ + ld/emultempl/mmix-elfnmmo.em | 2 +- + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/ld/emultempl/mmix-elfnmmo.em b/ld/emultempl/mmix-elfnmmo.em +index 0059792..5e9781a 100644 +--- a/ld/emultempl/mmix-elfnmmo.em ++++ b/ld/emultempl/mmix-elfnmmo.em +@@ -102,7 +102,7 @@ mmix_after_allocation (void) + This section is only present when there are register symbols. */ + sec = bfd_get_section_by_name (link_info.output_bfd, MMIX_REG_SECTION_NAME); + if (sec != NULL) +- bfd_set_section_vma (abfd, sec, 0); ++ bfd_set_section_vma (sec->owner, sec, 0); + + if (!_bfd_mmix_after_linker_allocation (link_info.output_bfd, &link_info)) + { +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-armv5e.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-armv5e.patch new file mode 100644 index 0000000..97ad6df --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-armv5e.patch @@ -0,0 +1,25 @@ +Add the armv5e architecture to binutils + +Binutils has a comment that indicates it is supposed to match gcc for all of +the support "-march=" settings, but it was lacking the armv5e setting. This +was a simple way to add it, as thumb instructions shouldn't be generated by +the compiler anyway. + +Upstream-Status: Denied +Upstream maintainer indicated that we should not be using armv5e, even though +it is a legal archicture defined by our gcc. + +Signed-off-by: Mark Hatle + +Index: binutils-2.22.90/gas/config/tc-arm.c +=================================================================== +--- binutils-2.22.90.orig/gas/config/tc-arm.c 2012-07-24 09:38:32.000000000 -0700 ++++ binutils-2.22.90/gas/config/tc-arm.c 2012-08-07 23:41:59.822564075 -0700 +@@ -23162,6 +23162,7 @@ + ARM_ARCH_OPT ("armv4t", ARM_ARCH_V4T, FPU_ARCH_FPA), + ARM_ARCH_OPT ("armv4txm", ARM_ARCH_V4TxM, FPU_ARCH_FPA), + ARM_ARCH_OPT ("armv5", ARM_ARCH_V5, FPU_ARCH_VFP), ++ ARM_ARCH_OPT ("armv5e", ARM_ARCH_V5TE, FPU_ARCH_VFP), + ARM_ARCH_OPT ("armv5t", ARM_ARCH_V5T, FPU_ARCH_VFP), + ARM_ARCH_OPT ("armv5txm", ARM_ARCH_V5TxM, FPU_ARCH_VFP), + ARM_ARCH_OPT ("armv5te", ARM_ARCH_V5TE, FPU_ARCH_VFP), diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-poison.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-poison.patch new file mode 100644 index 0000000..996c023 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-poison.patch @@ -0,0 +1,259 @@ +Upstream-Status: Inappropriate [distribution: codesourcery] + +Patch originally created by Mark Hatle, forward-ported to +binutils 2.21 by Scott Garman. + +purpose: warn for uses of system directories when cross linking + +Code Merged from Sourcery G++ binutils 2.19 - 4.4-277 + +2008-07-02 Joseph Myers + + ld/ + * ld.h (args_type): Add error_poison_system_directories. + * ld.texinfo (--error-poison-system-directories): Document. + * ldfile.c (ldfile_add_library_path): Check + command_line.error_poison_system_directories. + * ldmain.c (main): Initialize + command_line.error_poison_system_directories. + * lexsup.c (enum option_values): Add + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES. + (ld_options): Add --error-poison-system-directories. + (parse_args): Handle new option. + +2007-06-13 Joseph Myers + + ld/ + * config.in: Regenerate. + * ld.h (args_type): Add poison_system_directories. + * ld.texinfo (--no-poison-system-directories): Document. + * ldfile.c (ldfile_add_library_path): Check + command_line.poison_system_directories. + * ldmain.c (main): Initialize + command_line.poison_system_directories. + * lexsup.c (enum option_values): Add + OPTION_NO_POISON_SYSTEM_DIRECTORIES. + (ld_options): Add --no-poison-system-directories. + (parse_args): Handle new option. + +2007-04-20 Joseph Myers + + Merge from Sourcery G++ binutils 2.17: + + 2007-03-20 Joseph Myers + Based on patch by Mark Hatle . + ld/ + * configure.in (--enable-poison-system-directories): New option. + * configure, config.in: Regenerate. + * ldfile.c (ldfile_add_library_path): If + ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib, + /usr/lib, /usr/local/lib or /usr/X11R6/lib. + +Signed-off-by: Mark Hatle +Signed-off-by: Scott Garman + +Index: binutils-2.24/ld/config.in +=================================================================== +--- binutils-2.24.orig/ld/config.in 2013-12-15 11:46:17.000000000 -0800 ++++ binutils-2.24/ld/config.in 2013-12-15 11:46:59.810435651 -0800 +@@ -11,6 +11,9 @@ + language is requested. */ + #undef ENABLE_NLS + ++/* Define to warn for use of native system library directories */ ++#undef ENABLE_POISON_SYSTEM_DIRECTORIES ++ + /* Additional extension a shared object might have. */ + #undef EXTRA_SHLIB_EXTENSION + +Index: binutils-2.24/ld/configure +=================================================================== +--- binutils-2.24.orig/ld/configure 2013-12-15 11:46:17.000000000 -0800 ++++ binutils-2.24/ld/configure 2013-12-15 11:46:59.810435651 -0800 +@@ -777,6 +777,7 @@ + enable_targets + enable_64_bit_bfd + with_sysroot ++enable_poison_system_directories + enable_gold + enable_got + enable_werror +@@ -1433,6 +1434,8 @@ + (and sometimes confusing) to the casual installer + --enable-targets alternative target configurations + --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) ++ --enable-poison-system-directories ++ warn for use of native system library directories + --enable-gold[=ARG] build gold [ARG={default,yes,no}] + --enable-got= GOT handling scheme (target, single, negative, + multigot) +@@ -4345,7 +4348,18 @@ + fi + + ++# Check whether --enable-poison-system-directories was given. ++if test "${enable_poison_system_directories+set}" = set; then : ++ enableval=$enable_poison_system_directories; ++else ++ enable_poison_system_directories=no ++fi ++ ++if test "x${enable_poison_system_directories}" = "xyes"; then + ++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++ ++fi + + # Check whether --enable-got was given. + if test "${enable_got+set}" = set; then : +Index: binutils-2.24/ld/configure.in +=================================================================== +--- binutils-2.24.orig/ld/configure.in 2013-12-15 11:46:17.000000000 -0800 ++++ binutils-2.24/ld/configure.in 2013-12-15 11:46:59.810435651 -0800 +@@ -87,6 +87,16 @@ + AC_SUBST(TARGET_SYSTEM_ROOT) + AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) + ++AC_ARG_ENABLE([poison-system-directories], ++ AS_HELP_STRING([--enable-poison-system-directories], ++ [warn for use of native system library directories]),, ++ [enable_poison_system_directories=no]) ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], ++ [1], ++ [Define to warn for use of native system library directories]) ++fi ++ + dnl Use --enable-gold to decide if this linker should be the default. + dnl "install_as_default" is set to false if gold is the default linker. + dnl "installed_linker" is the installed BFD linker name. +Index: binutils-2.24/ld/ldfile.c +=================================================================== +--- binutils-2.24.orig/ld/ldfile.c 2013-12-15 11:46:17.000000000 -0800 ++++ binutils-2.24/ld/ldfile.c 2013-12-15 11:46:59.813768989 -0800 +@@ -116,6 +116,23 @@ + new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL); + else + new_dirs->name = xstrdup (name); ++ ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ if (command_line.poison_system_directories ++ && ((!strncmp (name, "/lib", 4)) ++ || (!strncmp (name, "/usr/lib", 8)) ++ || (!strncmp (name, "/usr/local/lib", 14)) ++ || (!strncmp (name, "/usr/X11R6/lib", 14)))) ++ { ++ if (command_line.error_poison_system_directories) ++ einfo (_("%X%P: error: library search path \"%s\" is unsafe for " ++ "cross-compilation\n"), name); ++ else ++ einfo (_("%P: warning: library search path \"%s\" is unsafe for " ++ "cross-compilation\n"), name); ++ } ++#endif ++ + } + + /* Try to open a BFD for a lang_input_statement. */ +Index: binutils-2.24/ld/ld.h +=================================================================== +--- binutils-2.24.orig/ld/ld.h 2013-12-15 11:46:17.000000000 -0800 ++++ binutils-2.24/ld/ld.h 2013-12-15 11:46:59.813768989 -0800 +@@ -180,6 +180,14 @@ + /* If TRUE we'll just print the default output on stdout. */ + bfd_boolean print_output_format; + ++ /* If TRUE (the default) warn for uses of system directories when ++ cross linking. */ ++ bfd_boolean poison_system_directories; ++ ++ /* If TRUE (default FALSE) give an error for uses of system ++ directories when cross linking instead of a warning. */ ++ bfd_boolean error_poison_system_directories; ++ + /* Big or little endian as set on command line. */ + enum endian_enum endian; + +Index: binutils-2.24/ld/ldmain.c +=================================================================== +--- binutils-2.24.orig/ld/ldmain.c 2013-12-15 11:46:17.000000000 -0800 ++++ binutils-2.24/ld/ldmain.c 2013-12-15 11:48:12.087101740 -0800 +@@ -266,6 +266,8 @@ + command_line.warn_mismatch = TRUE; + command_line.warn_search_mismatch = TRUE; + command_line.check_section_addresses = -1; ++ command_line.poison_system_directories = TRUE; ++ command_line.error_poison_system_directories = FALSE; + + /* We initialize DEMANGLING based on the environment variable + COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the +Index: binutils-2.24/ld/ld.texinfo +=================================================================== +--- binutils-2.24.orig/ld/ld.texinfo 2013-12-15 11:46:17.000000000 -0800 ++++ binutils-2.24/ld/ld.texinfo 2013-12-15 11:46:59.813768989 -0800 +@@ -2175,6 +2175,18 @@ + + Passing @code{none} for @var{style} disables the setting from any + @code{--build-id} options earlier on the command line. ++ ++@kindex --no-poison-system-directories ++@item --no-poison-system-directories ++Do not warn for @option{-L} options using system directories such as ++@file{/usr/lib} when cross linking. This option is intended for use ++in chroot environments when such directories contain the correct ++libraries for the target system rather than the host. ++ ++@kindex --error-poison-system-directories ++@item --error-poison-system-directories ++Give an error instead of a warning for @option{-L} options using ++system directories when cross linking. + @end table + + @c man end +Index: binutils-2.24/ld/lexsup.c +=================================================================== +--- binutils-2.24.orig/ld/lexsup.c 2013-12-15 11:46:17.000000000 -0800 ++++ binutils-2.24/ld/lexsup.c 2013-12-15 11:49:28.950434490 -0800 +@@ -507,6 +507,14 @@ + OPTION_IGNORE_UNRESOLVED_SYMBOL}, + '\0', N_("SYMBOL"), + N_("Unresolved SYMBOL will not cause an error or warning"), TWO_DASHES }, ++ { {"no-poison-system-directories", no_argument, NULL, ++ OPTION_NO_POISON_SYSTEM_DIRECTORIES}, ++ '\0', NULL, N_("Do not warn for -L options using system directories"), ++ TWO_DASHES }, ++ { {"error-poison-system-directories", no_argument, NULL, ++ + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES}, ++ '\0', NULL, N_("Give an error for -L options using system directories"), ++ TWO_DASHES }, + }; + + #define OPTION_COUNT ARRAY_SIZE (ld_options) +@@ -1442,6 +1450,14 @@ + einfo (_("%P%X: --hash-size needs a numeric argument\n")); + } + break; ++ ++ case OPTION_NO_POISON_SYSTEM_DIRECTORIES: ++ command_line.poison_system_directories = FALSE; ++ break; ++ ++ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES: ++ command_line.error_poison_system_directories = TRUE; ++ break; + } + } + +Index: binutils-2.24/ld/ldlex.h +=================================================================== +--- binutils-2.24.orig/ld/ldlex.h 2013-12-15 11:46:17.000000000 -0800 ++++ binutils-2.24/ld/ldlex.h 2013-12-15 11:47:43.230435299 -0800 +@@ -138,6 +138,8 @@ + OPTION_DEFAULT_SCRIPT, + OPTION_PRINT_OUTPUT_FORMAT, + OPTION_IGNORE_UNRESOLVED_SYMBOL, ++ OPTION_NO_POISON_SYSTEM_DIRECTORIES, ++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES, + }; + + /* The initial parser states. */ diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-100-uclibc-conf.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-100-uclibc-conf.patch new file mode 100644 index 0000000..b5a25c2 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-100-uclibc-conf.patch @@ -0,0 +1,40 @@ +Upstream-Status: Pending + +Index: binutils-2.22/configure +=================================================================== +--- binutils-2.22.orig/configure ++++ binutils-2.22/configure +@@ -3130,7 +3130,7 @@ case "${target}" in + ;; + s390-*-* | s390x-*-*) + ;; +- sh-*-* | sh[34]*-*-*) ++ sh*-*-* | sh[34]*-*-*) + ;; + sh64-*-* | sh5*-*-*) + ;; +@@ -3570,7 +3570,7 @@ case "${target}" in + mips*-*-*) + noconfigdirs="$noconfigdirs gprof" + ;; +- sh-*-* | sh64-*-*) ++ sh*-*-* | sh64-*-*) + case "${target}" in + sh*-*-elf) + ;; +Index: binutils-2.22/gprof/configure +=================================================================== +--- binutils-2.22.orig/gprof/configure ++++ binutils-2.22/gprof/configure +@@ -6103,6 +6103,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-300-001_ld_makefile_patch.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-300-001_ld_makefile_patch.patch new file mode 100644 index 0000000..c6e1efc --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-300-001_ld_makefile_patch.patch @@ -0,0 +1,55 @@ +#!/bin/sh -e +## 001_ld_makefile_patch.dpatch +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Description: correct where ld scripts are installed +## DP: Author: Chris Chimelis +## DP: Upstream status: N/A +## DP: Date: ?? + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 +Upstream-Status: Inappropriate [debian patch] + +@DPATCH@ +Index: binutils-2.22/ld/Makefile.am +=================================================================== +--- binutils-2.22.orig/ld/Makefile.am ++++ binutils-2.22/ld/Makefile.am +@@ -37,7 +37,7 @@ endif + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + + EMUL = @EMUL@ + EMULATION_OFILES = @EMULATION_OFILES@ +Index: binutils-2.22/ld/Makefile.in +=================================================================== +--- binutils-2.22.orig/ld/Makefile.in ++++ binutils-2.22/ld/Makefile.in +@@ -366,7 +366,7 @@ AM_CFLAGS = $(WARN_CFLAGS) + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + BASEDIR = $(srcdir)/.. + BFDDIR = $(BASEDIR)/bfd + INCDIR = $(BASEDIR)/include diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-300-006_better_file_error.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-300-006_better_file_error.patch new file mode 100644 index 0000000..47bd8ff --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-300-006_better_file_error.patch @@ -0,0 +1,45 @@ +#!/bin/sh -e +## 006_better_file_error.dpatch by David Kimdon +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Specify which filename is causing an error if the filename is a +## DP: directory. (#45832) + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 +Upstream-Status: Inappropriate [debian patch] + +@DPATCH@ +Index: binutils-2.22/bfd/opncls.c +=================================================================== +--- binutils-2.22.orig/bfd/opncls.c ++++ binutils-2.22/bfd/opncls.c +@@ -197,6 +197,13 @@ bfd_fopen (const char *filename, const c + { + bfd *nbfd; + const bfd_target *target_vec; ++ struct stat s; ++ ++ if (stat (filename, &s) == 0) ++ if (S_ISDIR(s.st_mode)) { ++ bfd_set_error (bfd_error_file_not_recognized); ++ return NULL; ++ } + + nbfd = _bfd_new_bfd (); + if (nbfd == NULL) diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-300-012_check_ldrunpath_length.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-300-012_check_ldrunpath_length.patch new file mode 100644 index 0000000..d31f80c --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-300-012_check_ldrunpath_length.patch @@ -0,0 +1,49 @@ +#!/bin/sh -e +## 012_check_ldrunpath_length.dpatch by Chris Chimelis +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for +## DP: cases where -rpath isn't specified. (#151024) + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 +Upstream-Status: Inappropriate [debian patch] + +@DPATCH@ +Index: binutils-2.22/ld/emultempl/elf32.em +=================================================================== +--- binutils-2.22.orig/ld/emultempl/elf32.em ++++ binutils-2.22/ld/emultempl/elf32.em +@@ -1273,6 +1273,8 @@ fragment <link_next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-gas-needs-libm.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-gas-needs-libm.patch new file mode 100644 index 0000000..3869faf --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uclibc-gas-needs-libm.patch @@ -0,0 +1,38 @@ +Source: Khem Raj +Disposition: submit upstream. +Upstream-Status: Pending + +Description: + +We do not need to have the libtool patch anymore for binutils after +libtool has been updated upstream it include support for it. However +for building gas natively on uclibc systems we have to link it with +-lm so that it picks up missing symbols. + +/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_from_double': +floatformat.c:(.text+0x1ec): undefined reference to `frexp' +floatformat.c:(.text+0x2f8): undefined reference to `ldexp' +/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_to_double': +floatformat.c:(.text+0x38a): undefined reference to `ldexp' +floatformat.c:(.text+0x3d2): undefined reference to `ldexp' +floatformat.c:(.text+0x43e): undefined reference to `ldexp' floatformat.c:(.text+0x4e2): undefined reference to `ldexp' +collect2: ld returned 1 exit status +make[4]: *** [as-new] Error 1 + +Index: binutils-2.22/gas/configure.tgt +=================================================================== +--- binutils-2.22.orig/gas/configure.tgt ++++ binutils-2.22/gas/configure.tgt +@@ -428,6 +428,12 @@ case ${generic_target} in + *-*-netware) fmt=elf em=netware ;; + esac + ++case ${generic_target} in ++ arm-*-*uclibc*) ++ need_libm=yes ++ ;; ++esac ++ + case ${cpu_type} in + alpha | arm | i386 | ia64 | microblaze | mips | ns32k | pdp11 | ppc | sparc | z80 | z8k) + bfd_gas=yes diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uninitialised-warning.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uninitialised-warning.patch new file mode 100644 index 0000000..2feb80c --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-uninitialised-warning.patch @@ -0,0 +1,50 @@ +From f9c316c4d75be236bbaa8464ef803ed2d3859d6d Mon Sep 17 00:00:00 2001 +From: H.J. Lu +Date: Wed, 15 Jan 2014 07:43:19 -0800 +Subject: [PATCH 1/1] Silence uninitialized warning on ehdr_start_save + +Older GCC, like 4.1/4.2, will issue an uninitialized warning on +ehdr_start_save. This patch silences by using + +struct bfd_link_hash_entry ehdr_start_save = ehdr_start_save; + + * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): + Silence uninitialized warning on ehdr_start_save with older + GCC. + +Upstream-Status: Backport +--- + ld/ChangeLog | 6 ++++++ + ld/emultempl/elf32.em | 2 +- + 2 files changed, 7 insertions(+), 1 deletions(-) + +#diff --git a/ld/ChangeLog b/ld/ChangeLog +#index eaa6b93..91055de 100644 +#--- a/ld/ChangeLog +#+++ b/ld/ChangeLog +#@@ -1,3 +1,9 @@ +#+2014-01-15 H.J. Lu +#+ +#+ * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): +#+ Silence uninitialized warning on ehdr_start_save with older +#+ GCC. +#+ +# 2014-01-15 Alan Modra +# +# * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Define +diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em +index 13f86f0..569c7f7 100644 +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1481,7 +1481,7 @@ gld${EMULATION_NAME}_before_allocation (void) + asection *sinterp; + bfd *abfd; + struct elf_link_hash_entry *ehdr_start = NULL; +- struct bfd_link_hash_entry ehdr_start_save; ++ struct bfd_link_hash_entry ehdr_start_save = ehdr_start_save; + + if (is_elf_hash_table (link_info.hash)) + { +-- +1.7.1 + diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-xlp-support.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-xlp-support.patch new file mode 100644 index 0000000..a199918 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/binutils-xlp-support.patch @@ -0,0 +1,402 @@ +Upstream-Status: Unknown +Signed-off-by: Khem Raj + +From 26adb06ce515aadfec08ce13109b4b98287f677b Mon Sep 17 00:00:00 2001 +From: Nebu Philips +Date: Fri, 30 Jul 2010 15:10:03 -0700 +Subject: [PATCH] Add support for Netlogic XLP + +Using the mipsisa64r2nlm target, add support for XLP from +Netlogic. Also, update vendor name to NLM wherever applicable. +--- + bfd/aoutx.h | 1 + + bfd/archures.c | 1 + + bfd/bfd-in2.h | 1 + + bfd/config.bfd | 5 +++++ + bfd/cpu-mips.c | 6 ++++-- + bfd/elfxx-mips.c | 8 ++++++++ + binutils/readelf.c | 1 + + config.sub | 6 ++++++ + gas/config/tc-mips.c | 7 ++++++- + gas/configure | 3 +++ + gas/configure.tgt | 2 +- + gas/doc/c-mips.texi | 3 ++- + include/elf/mips.h | 1 + + include/opcode/mips.h | 6 +++++- + ld/configure.tgt | 2 ++ + opcodes/mips-dis.c | 6 ++++++ + opcodes/mips-opc.c | 31 ++++++++++++++++++++----------- + 17 files changed, 73 insertions(+), 17 deletions(-) + +Index: binutils-2.24/bfd/aoutx.h +=================================================================== +--- binutils-2.24.orig/bfd/aoutx.h 2013-12-15 13:07:57.180399300 -0800 ++++ binutils-2.24/bfd/aoutx.h 2013-12-15 13:08:03.397065919 -0800 +@@ -798,6 +798,7 @@ + case bfd_mach_mipsisa64r2: + case bfd_mach_mips_sb1: + case bfd_mach_mips_xlr: ++ case bfd_mach_mips_xlp: + /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */ + arch_flags = M_MIPS2; + break; +Index: binutils-2.24/bfd/archures.c +=================================================================== +--- binutils-2.24.orig/bfd/archures.c 2013-12-15 13:07:57.180399300 -0800 ++++ binutils-2.24/bfd/archures.c 2013-12-15 13:08:03.397065919 -0800 +@@ -178,6 +178,7 @@ + .#define bfd_mach_mips_octeonp 6601 + .#define bfd_mach_mips_octeon2 6502 + .#define bfd_mach_mips_xlr 887682 {* decimal 'XLR' *} ++.#define bfd_mach_mips_xlp 887680 {* decimal 'XLP' *} + .#define bfd_mach_mipsisa32 32 + .#define bfd_mach_mipsisa32r2 33 + .#define bfd_mach_mipsisa64 64 +Index: binutils-2.24/bfd/bfd-in2.h +=================================================================== +--- binutils-2.24.orig/bfd/bfd-in2.h 2013-12-15 13:07:57.180399300 -0800 ++++ binutils-2.24/bfd/bfd-in2.h 2013-12-15 13:08:03.400399254 -0800 +@@ -1933,6 +1933,7 @@ + #define bfd_mach_mips_octeonp 6601 + #define bfd_mach_mips_octeon2 6502 + #define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ ++#define bfd_mach_mips_xlp 887680 /* decimal 'XLP' */ + #define bfd_mach_mipsisa32 32 + #define bfd_mach_mipsisa32r2 33 + #define bfd_mach_mipsisa64 64 +Index: binutils-2.24/bfd/config.bfd +=================================================================== +--- binutils-2.24.orig/bfd/config.bfd 2013-12-15 13:08:03.047065922 -0800 ++++ binutils-2.24/bfd/config.bfd 2013-12-15 13:08:03.400399254 -0800 +@@ -1032,6 +1032,11 @@ + targ_defvec=bfd_elf32_littlemips_vec + targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" + ;; ++ mipsisa64*-*-elf*) ++ targ_defvec=bfd_elf32_tradbigmips_vec ++ targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" ++ want64=true ++ ;; + mips*-*-elf* | mips*-*-rtems* | mips*-*-vxworks | mips*-*-windiss) + targ_defvec=bfd_elf32_bigmips_vec + targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" +Index: binutils-2.24/bfd/cpu-mips.c +=================================================================== +--- binutils-2.24.orig/bfd/cpu-mips.c 2013-12-15 13:07:57.180399300 -0800 ++++ binutils-2.24/bfd/cpu-mips.c 2013-12-15 13:08:03.400399254 -0800 +@@ -99,7 +99,8 @@ + I_mipsocteonp, + I_mipsocteon2, + I_xlr, +- I_micromips ++ I_micromips, ++ I_xlp + }; + + #define NN(index) (&arch_info_struct[(index) + 1]) +@@ -143,7 +144,8 @@ + N (64, 64, bfd_mach_mips_octeonp,"mips:octeon+", FALSE, NN(I_mipsocteonp)), + N (64, 64, bfd_mach_mips_octeon2,"mips:octeon2", FALSE, NN(I_mipsocteon2)), + N (64, 64, bfd_mach_mips_xlr, "mips:xlr", FALSE, NN(I_xlr)), +- N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,0) ++ N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,NN(I_micromips)), ++ N (64, 64, bfd_mach_mips_xlp, "mips:xlp", FALSE, 0) + }; + + /* The default architecture is mips:3000, but with a machine number of +Index: binutils-2.24/bfd/elfxx-mips.c +=================================================================== +--- binutils-2.24.orig/bfd/elfxx-mips.c 2013-12-15 13:07:57.180399300 -0800 ++++ binutils-2.24/bfd/elfxx-mips.c 2013-12-15 13:08:03.400399254 -0800 +@@ -6404,6 +6404,9 @@ + case E_MIPS_MACH_XLR: + return bfd_mach_mips_xlr; + ++ case E_MIPS_MACH_XLP: ++ return bfd_mach_mips_xlp; ++ + default: + switch (flags & EF_MIPS_ARCH) + { +@@ -11622,6 +11625,10 @@ + val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON2; + break; + ++ case bfd_mach_mips_xlp: ++ val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_XLP; ++ break; ++ + case bfd_mach_mipsisa32: + val = E_MIPS_ARCH_32; + break; +@@ -14202,6 +14209,7 @@ + { bfd_mach_mips_octeon2, bfd_mach_mips_octeonp }, + { bfd_mach_mips_octeonp, bfd_mach_mips_octeon }, + { bfd_mach_mips_octeon, bfd_mach_mipsisa64r2 }, ++ { bfd_mach_mips_xlp, bfd_mach_mipsisa64r2 }, + + /* MIPS64 extensions. */ + { bfd_mach_mipsisa64r2, bfd_mach_mipsisa64 }, +Index: binutils-2.24/binutils/readelf.c +=================================================================== +--- binutils-2.24.orig/binutils/readelf.c 2013-12-15 13:07:57.180399300 -0800 ++++ binutils-2.24/binutils/readelf.c 2013-12-15 13:08:03.403732587 -0800 +@@ -2602,6 +2602,7 @@ + case E_MIPS_MACH_OCTEON: strcat (buf, ", octeon"); break; + case E_MIPS_MACH_OCTEON2: strcat (buf, ", octeon2"); break; + case E_MIPS_MACH_XLR: strcat (buf, ", xlr"); break; ++ case E_MIPS_MACH_XLP: strcat (buf, ", xlp"); break; + case 0: + /* We simply ignore the field in this case to avoid confusion: + MIPS ELF does not specify EF_MIPS_MACH, it is a GNU +Index: binutils-2.24/gas/config/tc-mips.c +=================================================================== +--- binutils-2.24.orig/gas/config/tc-mips.c 2013-12-15 13:07:57.180399300 -0800 ++++ binutils-2.24/gas/config/tc-mips.c 2013-12-15 13:17:19.943728439 -0800 +@@ -486,6 +486,7 @@ + || mips_opts.arch == CPU_RM7000 \ + || mips_opts.arch == CPU_VR5500 \ + || mips_opts.micromips \ ++ || mips_opts.arch == CPU_XLP \ + ) + + /* Whether the processor uses hardware interlocks to protect reads +@@ -515,6 +516,7 @@ + && mips_opts.isa != ISA_MIPS3) \ + || mips_opts.arch == CPU_R4300 \ + || mips_opts.micromips \ ++ || mips_opts.arch == CPU_XLP \ + ) + + /* Whether the processor uses hardware interlocks to protect reads +@@ -17794,7 +17796,7 @@ + /* Broadcom XLP. + XLP is mostly like XLR, with the prominent exception that it is + MIPS64R2 rather than MIPS64. */ +- { "xlp", 0, 0, ISA_MIPS64R2, CPU_XLR }, ++ { "xlp", 0, 0, ISA_MIPS64R2, CPU_XLP }, + + /* End marker */ + { NULL, 0, 0, 0, 0 } +Index: binutils-2.24/gas/configure +=================================================================== +--- binutils-2.24.orig/gas/configure 2013-12-15 13:08:01.127065936 -0800 ++++ binutils-2.24/gas/configure 2013-12-15 13:08:03.407065920 -0800 +@@ -12697,6 +12697,9 @@ + mipsisa64r2 | mipsisa64r2el) + mips_cpu=mips64r2 + ;; ++ mipsisa64r2nlm | mipsisa64r2nlmel) ++ mips_cpu=xlp ++ ;; + mipstx39 | mipstx39el) + mips_cpu=r3900 + ;; +Index: binutils-2.24/gas/configure.tgt +=================================================================== +--- binutils-2.24.orig/gas/configure.tgt 2013-12-15 13:08:00.783732605 -0800 ++++ binutils-2.24/gas/configure.tgt 2013-12-15 13:08:03.407065920 -0800 +@@ -325,7 +325,7 @@ + fmt=elf em=freebsd ;; + mips-*-sysv4*MP* | mips-*-gnu*) fmt=elf em=tmips ;; + mips*-sde-elf* | mips*-mti-elf*) fmt=elf em=tmips ;; +- mips-*-elf* | mips-*-rtems*) fmt=elf ;; ++ mips-*-elf* | mips-*-rtems*) fmt=elf em=tmips ;; + mips-*-netbsd*) fmt=elf em=tmips ;; + mips-*-openbsd*) fmt=elf em=tmips ;; + +Index: binutils-2.24/include/elf/mips.h +=================================================================== +--- binutils-2.24.orig/include/elf/mips.h 2013-12-15 13:07:57.180399300 -0800 ++++ binutils-2.24/include/elf/mips.h 2013-12-15 13:08:03.407065920 -0800 +@@ -274,6 +274,7 @@ + #define E_MIPS_MACH_SB1 0x008a0000 + #define E_MIPS_MACH_OCTEON 0x008b0000 + #define E_MIPS_MACH_XLR 0x008c0000 ++#define E_MIPS_MACH_XLP 0x008e0000 + #define E_MIPS_MACH_OCTEON2 0x008d0000 + #define E_MIPS_MACH_5400 0x00910000 + #define E_MIPS_MACH_5900 0x00920000 +Index: binutils-2.24/include/opcode/mips.h +=================================================================== +--- binutils-2.24.orig/include/opcode/mips.h 2013-12-15 13:07:57.180399300 -0800 ++++ binutils-2.24/include/opcode/mips.h 2013-12-15 13:40:11.130384844 -0800 +@@ -1092,8 +1092,10 @@ + #define INSN_LOONGSON_2F 0x80000000 + /* Loongson 3A. */ + #define INSN_LOONGSON_3A 0x00000400 +-/* RMI Xlr instruction */ +-#define INSN_XLR 0x00000020 ++/* Netlogic Xlr instruction */ ++#define INSN_XLR 0x00000020 ++/* Netlogic XlP instruction */ ++#define INSN_XLP 0x00000040 + + /* DSP ASE */ + #define ASE_DSP 0x00000001 +@@ -1172,6 +1174,7 @@ + #define CPU_OCTEONP 6601 + #define CPU_OCTEON2 6502 + #define CPU_XLR 887682 /* decimal 'XLR' */ ++#define CPU_XLP 887680 /* decimal 'XLP' */ + + /* Return true if the given CPU is included in INSN_* mask MASK. */ + +@@ -1239,6 +1242,9 @@ + case CPU_XLR: + return (mask & INSN_XLR) != 0; + ++ case CPU_XLP: ++ return (mask & INSN_XLP) != 0; ++ + default: + return FALSE; + } +Index: binutils-2.24/ld/configure.tgt +=================================================================== +--- binutils-2.24.orig/ld/configure.tgt 2013-12-15 13:08:03.047065922 -0800 ++++ binutils-2.24/ld/configure.tgt 2013-12-15 13:08:03.407065920 -0800 +@@ -457,6 +457,8 @@ + mips*-sde-elf* | mips*-mti-elf*) + targ_emul=elf32btsmip + targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip" ;; ++mipsisa64*-*-elf*) targ_emul=elf32btsmip ++ targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip" ;; + mips64*el-ps2-elf*) targ_emul=elf32lr5900n32 + targ_extra_emuls="elf32lr5900" + targ_extra_libpath=$targ_extra_emuls ;; +Index: binutils-2.24/opcodes/mips-dis.c +=================================================================== +--- binutils-2.24.orig/opcodes/mips-dis.c 2013-12-15 13:07:57.180399300 -0800 ++++ binutils-2.24/opcodes/mips-dis.c 2013-12-15 13:39:50.243718329 -0800 +@@ -554,13 +554,11 @@ + mips_cp0sel_names_xlr, ARRAY_SIZE (mips_cp0sel_names_xlr), + mips_hwr_names_numeric }, + +- /* XLP is mostly like XLR, with the prominent exception it is being +- MIPS64R2. */ +- { "xlp", 1, bfd_mach_mips_xlr, CPU_XLR, +- ISA_MIPS64R2 | INSN_XLR, 0, +- mips_cp0_names_xlr, +- mips_cp0sel_names_xlr, ARRAY_SIZE (mips_cp0sel_names_xlr), +- mips_hwr_names_numeric }, ++ { "xlp", 1, bfd_mach_mips_xlp, CPU_XLP, ++ ISA_MIPS64R2 | INSN_XLP, 0, ++ mips_cp0_names_mips3264r2, ++ mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2), ++ mips_hwr_names_mips3264r2 }, + + /* This entry, mips16, is here only for ISA/processor selection; do + not print its name. */ +Index: binutils-2.24/opcodes/mips-opc.c +=================================================================== +--- binutils-2.24.orig/opcodes/mips-opc.c 2013-12-15 13:07:57.180399300 -0800 ++++ binutils-2.24/opcodes/mips-opc.c 2013-12-15 13:27:30.573724118 -0800 +@@ -262,7 +262,8 @@ + #define IOCT (INSN_OCTEON | INSN_OCTEONP | INSN_OCTEON2) + #define IOCTP (INSN_OCTEONP | INSN_OCTEON2) + #define IOCT2 INSN_OCTEON2 +-#define XLR INSN_XLR ++#define XLR INSN_XLR ++#define XLP INSN_XLP + #define IVIRT ASE_VIRT + #define IVIRT64 ASE_VIRT64 + +@@ -881,6 +882,7 @@ + {"cins", "t,r,+p,+S", 0x70000032, 0xfc00003f, WR_1|RD_2, 0, IOCT, 0, 0 }, + {"clo", "U,s", 0x70000021, 0xfc0007ff, WR_1|RD_2, 0, I32|N55, 0, 0 }, + {"clz", "U,s", 0x70000020, 0xfc0007ff, WR_1|RD_2, 0, I32|N55, 0, 0 }, ++{"crc", "d,s,t", 0x7000001c, 0xfc0007ff, WR_1|RD_2|RD_3, 0, XLP, 0, 0 }, + {"ctc0", "t,G", 0x40c00000, 0xffe007ff, RD_1|WR_CC|COD, 0, I1, 0, IOCT|IOCTP|IOCT2 }, + {"ctc1", "t,G", 0x44c00000, 0xffe007ff, RD_1|WR_CC|COD|FP_S, 0, I1, 0, 0 }, + {"ctc1", "t,S", 0x44c00000, 0xffe007ff, RD_1|WR_CC|COD|FP_S, 0, I1, 0, 0 }, +@@ -913,10 +915,11 @@ + {"daddiu", "t,r,j", 0x64000000, 0xfc000000, WR_1|RD_2, 0, I3, 0, 0 }, + {"daddu", "d,v,t", 0x0000002d, 0xfc0007ff, WR_1|RD_2|RD_3, 0, I3, 0, 0 }, + {"daddu", "t,r,I", 0, (int) M_DADDU_I, INSN_MACRO, 0, I3, 0, 0 }, +-{"daddwc", "d,s,t", 0x70000038, 0xfc0007ff, WR_1|RD_2|RD_3|WR_C0|RD_C0, 0, XLR, 0, 0 }, ++{"daddwc", "d,s,t", 0x70000038, 0xfc0007ff, WR_1|RD_2|RD_3|WR_C0|RD_C0, 0, XLR|XLP, 0, 0 }, + {"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5, 0, 0 }, + {"dclo", "U,s", 0x70000025, 0xfc0007ff, WR_1|RD_2, 0, I64|N55, 0, 0 }, + {"dclz", "U,s", 0x70000024, 0xfc0007ff, WR_1|RD_2, 0, I64|N55, 0, 0 }, ++{"dcrc", "d,s,t", 0x7000001d, 0xfc0007ff, WR_1|RD_2|RD_3, 0, XLP, 0, 0 }, + /* dctr and dctw are used on the r5000. */ + {"dctr", "o(b)", 0xbc050000, 0xfc1f0000, RD_2, 0, I3, 0, 0 }, + {"dctw", "o(b)", 0xbc090000, 0xfc1f0000, RD_2, 0, I3, 0, 0 }, +@@ -980,6 +983,7 @@ + {"dmfc0", "t,G,H", 0x40200000, 0xffe007f8, WR_1|RD_C0|LCD, 0, I64, 0, 0 }, + {"dmfgc0", "t,G", 0x40600100, 0xffe007ff, WR_1|RD_C0|LCD, 0, 0, IVIRT64, 0 }, + {"dmfgc0", "t,G,H", 0x40600100, 0xffe007f8, WR_1|RD_C0|LCD, 0, 0, IVIRT64, 0 }, ++{"dmfur", "t,d", 0x7000001e, 0xffe007ff, WR_1, 0, XLP, 0, 0 }, + {"dmt", "", 0x41600bc1, 0xffffffff, TRAP, 0, 0, MT32, 0 }, + {"dmt", "t", 0x41600bc1, 0xffe0ffff, WR_1|TRAP, 0, 0, MT32, 0 }, + {"dmtc0", "t,G", 0x40a00000, 0xffe007ff, RD_1|WR_C0|WR_CC|COD, 0, I3, 0, EE }, +@@ -994,6 +998,8 @@ + /* dmtc2 is at the bottom of the table. */ + /* dmfc3 is at the bottom of the table. */ + /* dmtc3 is at the bottom of the table. */ ++{"dmtur", "t,d", 0x7000001f, 0xffe007ff, RD_1, 0, XLP, 0, 0 }, ++{"dmul", "d,s,t", 0x70000006, 0xfc0007ff, WR_1|RD_2|RD_3, 0, XLP, 0, 0 }, + {"dmul", "d,v,t", 0x70000003, 0xfc0007ff, WR_1|RD_2|RD_3|WR_HILO, 0, IOCT, 0, 0 }, + {"dmul", "d,v,t", 0, (int) M_DMUL, INSN_MACRO, 0, I3, 0, M32 }, + {"dmul", "d,v,I", 0, (int) M_DMUL_I, INSN_MACRO, 0, I3, 0, M32 }, +@@ -1134,9 +1140,9 @@ + /* The macro has to be first to handle o32 correctly. */ + {"ld", "t,A(b)", 0, (int) M_LD_AB, INSN_MACRO, 0, I1, 0, 0 }, + {"ld", "t,o(b)", 0xdc000000, 0xfc000000, WR_1|RD_3, 0, I3, 0, 0 }, +-{"ldaddw", "t,b", 0x70000010, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR, 0, 0 }, +-{"ldaddwu", "t,b", 0x70000011, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR, 0, 0 }, +-{"ldaddd", "t,b", 0x70000012, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR, 0, 0 }, ++{"ldaddw", "t,b", 0x70000010, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 }, ++{"ldaddwu", "t,b", 0x70000011, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 }, ++{"ldaddd", "t,b", 0x70000012, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 }, + {"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, WR_1|RD_3|CLD|FP_D, 0, I2, 0, SF }, + {"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, WR_1|RD_3|CLD|FP_D, 0, I2, 0, SF }, + {"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, INSN2_M_FP_D, I2, 0, SF }, +@@ -1288,7 +1294,7 @@ + {"mflo", "d,9", 0x00000012, 0xff9f07ff, WR_1|RD_LO, 0, 0, D32, 0 }, + {"mflo1", "d", 0x70000012, 0xffff07ff, WR_1|RD_LO, 0, EE, 0, 0 }, + {"mflhxu", "d", 0x00000052, 0xffff07ff, WR_1|MOD_HILO, 0, 0, SMT, 0 }, +-{"mfcr", "t,s", 0x70000018, 0xfc00ffff, WR_1, 0, XLR, 0, 0 }, ++{"mfcr", "t,s", 0x70000018, 0xfc00ffff, WR_1, 0, XLR|XLP, 0, 0 }, + {"mfsa", "d", 0x00000028, 0xffff07ff, WR_1, 0, EE, 0, 0 }, + {"min.ob", "X,Y,Q", 0x78000006, 0xfc20003f, WR_1|RD_2|RD_3|FP_D, 0, SB1, MX, 0 }, + {"min.ob", "D,S,Q", 0x48000006, 0xfc20003f, WR_1|RD_2|RD_3|FP_D, 0, N54, 0, 0 }, +@@ -1332,10 +1338,13 @@ + /* move is at the top of the table. */ + {"msgn.qh", "X,Y,Q", 0x78200000, 0xfc20003f, WR_1|RD_2|RD_3|FP_D, 0, 0, MX, 0 }, + {"msgsnd", "t", 0, (int) M_MSGSND, INSN_MACRO, 0, XLR, 0, 0 }, ++{"msgsnds", "d,t", 0x4a000001, 0xffe007ff, WR_1|RD_2|RD_C0|WR_C0, 0, XLP, 0, 0 }, + {"msgld", "", 0, (int) M_MSGLD, INSN_MACRO, 0, XLR, 0, 0 }, + {"msgld", "t", 0, (int) M_MSGLD_T, INSN_MACRO, 0, XLR, 0, 0 }, +-{"msgwait", "", 0, (int) M_MSGWAIT, INSN_MACRO, 0, XLR, 0, 0 }, +-{"msgwait", "t", 0, (int) M_MSGWAIT_T,INSN_MACRO, 0, XLR, 0, 0 }, ++{"msglds", "d,t", 0x4a000002, 0xffe007ff, WR_1|RD_2|RD_C0|WR_C0, 0, XLP, 0, 0 }, ++{"msgwait", "", 0, (int) M_MSGWAIT, INSN_MACRO, 0, XLR|XLP, 0, 0 }, ++{"msgwait", "t", 0, (int) M_MSGWAIT_T,INSN_MACRO, 0, XLR|XLP, 0, 0 }, ++{"msgsync", "", 0x4a000004, 0xffffffff,0, 0, XLP, 0, 0 }, + {"msub.d", "D,R,S,T", 0x4c000029, 0xfc00003f, WR_1|RD_2|RD_3|RD_4|FP_D, 0, I4_33, 0, 0 }, + {"msub.d", "D,S,T", 0x46200019, 0xffe0003f, WR_1|RD_2|RD_3|FP_D, 0, IL2E, 0, 0 }, + {"msub.d", "D,S,T", 0x72200019, 0xffe0003f, WR_1|RD_2|RD_3|FP_D, 0, IL2F, 0, 0 }, +@@ -1381,7 +1390,7 @@ + {"mtlo", "s,7", 0x00000013, 0xfc1fe7ff, RD_1|WR_LO, 0, 0, D32, 0 }, + {"mtlo1", "s", 0x70000013, 0xfc1fffff, RD_1|WR_LO, 0, EE, 0, 0 }, + {"mtlhx", "s", 0x00000053, 0xfc1fffff, RD_1|MOD_HILO, 0, 0, SMT, 0 }, +-{"mtcr", "t,s", 0x70000019, 0xfc00ffff, RD_1, 0, XLR, 0, 0 }, ++{"mtcr", "t,s", 0x70000019, 0xfc00ffff, RD_1, 0, XLR|XLP, 0, 0 }, + {"mtm0", "s", 0x70000008, 0xfc1fffff, RD_1, 0, IOCT, 0, 0 }, + {"mtm1", "s", 0x7000000c, 0xfc1fffff, RD_1, 0, IOCT, 0, 0 }, + {"mtm2", "s", 0x7000000d, 0xfc1fffff, RD_1, 0, IOCT, 0, 0 }, +@@ -1802,9 +1811,9 @@ + {"suxc1", "S,t(b)", 0x4c00000d, 0xfc0007ff, RD_1|RD_2|RD_3|SM|FP_D, 0, I5_33|N55, 0, 0}, + {"sw", "t,o(b)", 0xac000000, 0xfc000000, RD_1|RD_3|SM, 0, I1, 0, 0 }, + {"sw", "t,A(b)", 0, (int) M_SW_AB, INSN_MACRO, 0, I1, 0, 0 }, +-{"swapw", "t,b", 0x70000014, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR, 0, 0 }, +-{"swapwu", "t,b", 0x70000015, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR, 0, 0 }, +-{"swapd", "t,b", 0x70000016, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR, 0, 0 }, ++{"swapw", "t,b", 0x70000014, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 }, ++{"swapwu", "t,b", 0x70000015, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 }, ++{"swapd", "t,b", 0x70000016, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 }, + {"swc0", "E,o(b)", 0xe0000000, 0xfc000000, RD_3|RD_C0|SM, 0, I1, 0, IOCT|IOCTP|IOCT2 }, + {"swc0", "E,A(b)", 0, (int) M_SWC0_AB, INSN_MACRO, 0, I1, 0, IOCT|IOCTP|IOCT2 }, + {"swc1", "T,o(b)", 0xe4000000, 0xfc000000, RD_1|RD_3|SM|FP_S, 0, I1, 0, 0 }, diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr15815.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr15815.patch new file mode 100644 index 0000000..9f53f41 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr15815.patch @@ -0,0 +1,36 @@ +This patch fixes the problem where libiberty is not installed in spite of +asking it via --enable-install-libiberty, the problem is that target_header_dir +is reset explicitly which means libiberty.a will never get installed + +also check + +https://sourceware.org/bugzilla/show_bug.cgi?id=15815 + +Upstream-Status: Pending + +Signed-off-by: Khem Raj + +Index: binutils-2.24/libiberty/configure +=================================================================== +--- binutils-2.24.orig/libiberty/configure 2013-12-16 00:08:09.280103157 -0800 ++++ binutils-2.24/libiberty/configure 2013-12-16 00:08:29.753436339 -0800 +@@ -5507,7 +5507,6 @@ + + setobjs= + CHECK= +-target_header_dir= + if test -n "${with_target_subdir}"; then + + # We are being configured as a target library. AC_REPLACE_FUNCS +Index: binutils-2.24/libiberty/configure.ac +=================================================================== +--- binutils-2.24.orig/libiberty/configure.ac 2013-11-08 02:13:49.000000000 -0800 ++++ binutils-2.24/libiberty/configure.ac 2013-12-16 00:07:45.133436672 -0800 +@@ -405,7 +405,6 @@ + + setobjs= + CHECK= +-target_header_dir= + if test -n "${with_target_subdir}"; then + + # We are being configured as a target library. AC_REPLACE_FUNCS diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr16428.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr16428.patch new file mode 100644 index 0000000..4584748 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr16428.patch @@ -0,0 +1,123 @@ +commit 4199e3b8669d0a36448687850374fdc2ad7240b6 +Author: Alan Modra +Date: Wed Jan 15 21:50:55 2014 +1030 + + non-PIC references to __ehdr_start in pie and shared + + Rather than hacking every backend to not discard dynamic relocations + against an undefined hidden __ehdr_start, make it appear to be defined + early. We want __ehdr_start hidden before size_dynamic_sections so + that it isn't put in .dynsym, but we do need the dynamic relocations + for a PIE or shared library with a non-PIC reference. Defining it + early is wrong if we don't actually define the symbol later to its + proper value. (In some cases we want to leave the symbol undefined, + for example, when the ELF header isn't loaded, and we don't have this + infomation available in before_allocation.) + + ld/ + * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Define + __ehdr_start before size_dynamic_sections and restore afterwards. + ld/testsuite/ + * ld-elf/ehdr_start-shared.d: New. + * ld-elf/ehdr_start-userdef.d: xfail frv. + * ld-elf/ehdr_start-weak.d: Likewise. + * ld-elf/ehdr_start.d: Likewise. + +Upstream-Status: Backport + +diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em +index 9a2fe89..13f86f0 100644 +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1480,6 +1480,8 @@ gld${EMULATION_NAME}_before_allocation (void) + const char *rpath; + asection *sinterp; + bfd *abfd; ++ struct elf_link_hash_entry *ehdr_start = NULL; ++ struct bfd_link_hash_entry ehdr_start_save; + + if (is_elf_hash_table (link_info.hash)) + { +@@ -1504,6 +1506,16 @@ gld${EMULATION_NAME}_before_allocation (void) + _bfd_elf_link_hash_hide_symbol (&link_info, h, TRUE); + if (ELF_ST_VISIBILITY (h->other) != STV_INTERNAL) + h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN; ++ /* Don't leave the symbol undefined. Undefined hidden ++ symbols typically won't have dynamic relocations, but ++ we most likely will need dynamic relocations for ++ __ehdr_start if we are building a PIE or shared ++ library. */ ++ ehdr_start = h; ++ ehdr_start_save = h->root; ++ h->root.type = bfd_link_hash_defined; ++ h->root.u.def.section = bfd_abs_section_ptr; ++ h->root.u.def.value = 0; + } + } + +@@ -1620,6 +1632,14 @@ ${ELF_INTERPRETER_SET_DEFAULT} + + if (!bfd_elf_size_dynsym_hash_dynstr (link_info.output_bfd, &link_info)) + einfo ("%P%F: failed to set dynamic section sizes: %E\n"); ++ ++ if (ehdr_start != NULL) ++ { ++ /* If we twiddled __ehdr_start to defined earlier, put it back ++ as it was. */ ++ ehdr_start->root.type = ehdr_start_save.type; ++ ehdr_start->root.u = ehdr_start_save.u; ++ } + } + + EOF +diff --git a/ld/testsuite/ld-elf/ehdr_start-shared.d b/ld/testsuite/ld-elf/ehdr_start-shared.d +new file mode 100644 +index 0000000..c17516a +--- /dev/null ++++ b/ld/testsuite/ld-elf/ehdr_start-shared.d +@@ -0,0 +1,9 @@ ++#source: ehdr_start.s ++#ld: -e _start -shared ++#nm: -n ++#target: *-*-linux* *-*-gnu* *-*-nacl* ++#xfail: cris*-*-* frv-*-* ++ ++#... ++[0-9a-f]*000 [Adrt] __ehdr_start ++#pass +diff --git a/ld/testsuite/ld-elf/ehdr_start-userdef.d b/ld/testsuite/ld-elf/ehdr_start-userdef.d +index 2a88e98..b58ae3f 100644 +--- a/ld/testsuite/ld-elf/ehdr_start-userdef.d ++++ b/ld/testsuite/ld-elf/ehdr_start-userdef.d +@@ -2,6 +2,7 @@ + #ld: -e _start -T ehdr_start-userdef.t + #readelf: -Ws + #target: *-*-linux* *-*-gnu* *-*-nacl* ++#xfail: frv-*-* + + #... + Symbol table '\.symtab' contains [0-9]+ entries: +diff --git a/ld/testsuite/ld-elf/ehdr_start-weak.d b/ld/testsuite/ld-elf/ehdr_start-weak.d +index 8bd9035..24ae34c 100644 +--- a/ld/testsuite/ld-elf/ehdr_start-weak.d ++++ b/ld/testsuite/ld-elf/ehdr_start-weak.d +@@ -2,6 +2,7 @@ + #ld: -e _start -T ehdr_start-missing.t + #nm: -n + #target: *-*-linux* *-*-gnu* *-*-nacl* ++#xfail: frv-*-* + + #... + \s+[wU] __ehdr_start +diff --git a/ld/testsuite/ld-elf/ehdr_start.d b/ld/testsuite/ld-elf/ehdr_start.d +index 52e5b54..d538b66 100644 +--- a/ld/testsuite/ld-elf/ehdr_start.d ++++ b/ld/testsuite/ld-elf/ehdr_start.d +@@ -2,6 +2,7 @@ + #ld: -e _start + #nm: -n + #target: *-*-linux* *-*-gnu* *-*-nacl* ++#xfail: frv-*-* + + #... + [0-9a-f]*000 [Adrt] __ehdr_start diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr16476.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr16476.patch new file mode 100644 index 0000000..65d62bc --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr16476.patch @@ -0,0 +1,220 @@ +From: H.J. Lu +Date: Tue, 21 Jan 2014 23:42:43 +0000 (-0800) +Subject: Check incompatible existing default symbol definition +X-Git-Tag: hjl/linux/release/2.24.51.0.3~1^2~8^2~16 +X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff_plain;h=4584ec12076e088cf36965b88ef8710ca85491f9 + +Check incompatible existing default symbol definition + +After resolving a versioned reference, foo@VER1, to a default versioned +definition, foo@@VER1, from a shared object, we also merge it with +the existing regular default symbol definition, foo. When foo is IFUNC +and foo@@VER1 aren't, we will merge 2 incompatible definitions. This +patch avoids merging foo@@VER1 definition with foo definition if +one is IFUNC and the other isn't. + +Upstream-Status: Backport +--- + +#diff --git a/bfd/ChangeLog b/bfd/ChangeLog +#index 5923bc3..c70a7db 100644 +#--- a/bfd/ChangeLog +#+++ b/bfd/ChangeLog +#@@ -1,5 +1,13 @@ +# 2014-01-21 H.J. Lu +# +#+ PR ld/16467 +#+ * elflink.c (_bfd_elf_merge_symbol): When types of the existing +#+ regular default symbol definition and the versioned dynamic +#+ symbol definition mismatch, skip the default symbol definition +#+ if one of them is IFUNC. +#+ +#+2014-01-21 H.J. Lu +#+ +# PR ld/2404 +# * elflink.c (_bfd_elf_merge_symbol): Don't check info->shared, +# info->export_dynamic nor h->ref_dynamic for type mismatch when +diff --git a/bfd/elflink.c b/bfd/elflink.c +index d0006da..792e14e 100644 +--- a/bfd/elflink.c ++++ b/bfd/elflink.c +@@ -1092,11 +1092,14 @@ _bfd_elf_merge_symbol (bfd *abfd, + && newdyn + && newdef + && !olddyn +- && (olddef || h->root.type == bfd_link_hash_common) +- && ELF_ST_TYPE (sym->st_info) != h->type +- && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE +- && h->type != STT_NOTYPE +- && !(newfunc && oldfunc)) ++ && (((olddef || h->root.type == bfd_link_hash_common) ++ && ELF_ST_TYPE (sym->st_info) != h->type ++ && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE ++ && h->type != STT_NOTYPE ++ && !(newfunc && oldfunc)) ++ || (olddef ++ && ((h->type == STT_GNU_IFUNC) ++ != (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC))))) + { + *skip = TRUE; + return TRUE; +#diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog +#index ac65a3a..a092428 100644 +#--- a/ld/testsuite/ChangeLog +#+++ b/ld/testsuite/ChangeLog +#@@ -1,5 +1,19 @@ +# 2014-01-21 H.J. Lu +# +#+ PR ld/16467 +#+ * ld-ifunc/dummy.c: New file. +#+ * ld-ifunc/pr16467.out: Likewise. +##+ * ld-ifunc/pr16467a.c: Likewise. +#+ * ld-ifunc/pr16467a.map: Likewise. +#+ * ld-ifunc/pr16467b.c: Likewise. +#+ * ld-ifunc/pr16467b.map: Likewise. +#+ * ld-ifunc/pr16467c.c: Likewise. +#+ +#+ * ld-ifunc/ifunc.exp (run_cc_link_tests): New. +#+ (run_ld_link_exec_tests): Run pr16467. +#+ +#+2014-01-21 H.J. Lu +#+ +# PR ld/2404 +# * ld-elf/shared.exp: Add a PIE test for PR ld/2404. +# +diff --git a/ld/testsuite/ld-ifunc/dummy.c b/ld/testsuite/ld-ifunc/dummy.c +new file mode 100644 +index 0000000..5c03287 +--- /dev/null ++++ b/ld/testsuite/ld-ifunc/dummy.c +@@ -0,0 +1 @@ ++/* An empty file. */ +diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp +index fb106c6..d7ff445 100644 +--- a/ld/testsuite/ld-ifunc/ifunc.exp ++++ b/ld/testsuite/ld-ifunc/ifunc.exp +@@ -349,6 +349,42 @@ if { $verbose < 1 } { + remote_file host delete "tmpdir/static_nonifunc_prog" + } + ++run_cc_link_tests [list \ ++ [list \ ++ "Build libpr16467a.so" \ ++ "-shared -Wl,--version-script=pr16467a.map" \ ++ "-fPIC" \ ++ { pr16467a.c } \ ++ {} \ ++ "libpr16467a.so" \ ++ ] \ ++ [list \ ++ "Build libpr16467b.a" \ ++ "" \ ++ "-fPIC" \ ++ { pr16467b.c } \ ++ {} \ ++ "libpr16467b.a" \ ++ ] \ ++ [list \ ++ "Build libpr16467b.so" \ ++ "-shared tmpdir/pr16467b.o tmpdir/libpr16467a.so \ ++ -Wl,--version-script=pr16467b.map" \ ++ "-fPIC" \ ++ { dummy.c } \ ++ {} \ ++ "libpr16467b.so" \ ++ ] \ ++ [list \ ++ "Build libpr16467c.a" \ ++ "" \ ++ "" \ ++ { pr16467c.c } \ ++ {} \ ++ "libpr16467c.a" \ ++ ] \ ++] ++ + run_ld_link_exec_tests [] [list \ + [list \ + "Common symbol override ifunc test 1a" \ +@@ -368,6 +404,15 @@ run_ld_link_exec_tests [] [list \ + "ifunc-common-1.out" \ + "-g" \ + ] \ ++ [list \ ++ "Run pr16467" \ ++ "tmpdir/pr16467c.o tmpdir/libpr16467b.so tmpdir/libpr16467a.so" \ ++ "" \ ++ { dummy.c } \ ++ "pr16467" \ ++ "pr16467.out" \ ++ "" \ ++ ] \ + ] + + set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]] +diff --git a/ld/testsuite/ld-ifunc/pr16467.out b/ld/testsuite/ld-ifunc/pr16467.out +new file mode 100644 +index 0000000..d86bac9 +--- /dev/null ++++ b/ld/testsuite/ld-ifunc/pr16467.out +@@ -0,0 +1 @@ ++OK +diff --git a/ld/testsuite/ld-ifunc/pr16467a.c b/ld/testsuite/ld-ifunc/pr16467a.c +new file mode 100644 +index 0000000..ae3f084 +--- /dev/null ++++ b/ld/testsuite/ld-ifunc/pr16467a.c +@@ -0,0 +1,5 @@ ++const char * ++sd_get_seats(void) ++{ ++ return "OK"; ++} +diff --git a/ld/testsuite/ld-ifunc/pr16467a.map b/ld/testsuite/ld-ifunc/pr16467a.map +new file mode 100644 +index 0000000..d677f37 +--- /dev/null ++++ b/ld/testsuite/ld-ifunc/pr16467a.map +@@ -0,0 +1,4 @@ ++LIBSYSTEMD_209 { ++global: ++ sd_get_seats; ++}; +diff --git a/ld/testsuite/ld-ifunc/pr16467b.c b/ld/testsuite/ld-ifunc/pr16467b.c +new file mode 100644 +index 0000000..264f6cf +--- /dev/null ++++ b/ld/testsuite/ld-ifunc/pr16467b.c +@@ -0,0 +1,7 @@ ++void new_sd_get_seats(void); ++__asm__(".symver new_sd_get_seats,sd_get_seats@LIBSYSTEMD_209"); ++void (*resolve_sd_get_seats(void)) (void) __asm__ ("sd_get_seats"); ++void (*resolve_sd_get_seats(void)) (void) { ++ return new_sd_get_seats; ++} ++__asm__(".type sd_get_seats, %gnu_indirect_function"); +diff --git a/ld/testsuite/ld-ifunc/pr16467b.map b/ld/testsuite/ld-ifunc/pr16467b.map +new file mode 100644 +index 0000000..1f263de +--- /dev/null ++++ b/ld/testsuite/ld-ifunc/pr16467b.map +@@ -0,0 +1,4 @@ ++LIBSYSTEMD_208 { ++global: ++ sd_get_seats; ++}; +diff --git a/ld/testsuite/ld-ifunc/pr16467c.c b/ld/testsuite/ld-ifunc/pr16467c.c +new file mode 100644 +index 0000000..e2a901c +--- /dev/null ++++ b/ld/testsuite/ld-ifunc/pr16467c.c +@@ -0,0 +1,9 @@ ++#include ++const char* sd_get_seats(void); ++ ++int ++main (int argc, char **argv) ++{ ++ printf("%s\n", sd_get_seats()); ++ return 0; ++} diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr2404.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr2404.patch new file mode 100644 index 0000000..41f3504 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/fix-pr2404.patch @@ -0,0 +1,76 @@ +From: H.J. Lu +Date: Tue, 21 Jan 2014 13:33:48 +0000 (-0800) +Subject: Don't check shared/export_dynamic/ref_dynamic for type mismatch +X-Git-Tag: hjl/linux/release/2.24.51.0.3~1^2~8^2~22 +X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff_plain;h=22ef172a21663abb477d72284b4d59c8eabcbb82 + +Don't check shared/export_dynamic/ref_dynamic for type mismatch + +There is nothing linker can do when a type mismatched default definition +are made dynamic by info->shared, info->export_dynamic or h->ref_dynamic. +But we do want to avoid exporting it when building PIE. Let's remove +those checks. + +bfd/ + + PR ld/2404 + * elflink.c (_bfd_elf_merge_symbol): Don't check info->shared, + info->export_dynamic, nor !h->ref_dynamic for type mismatch when + adding the default version. + +ld/testsuite/ + + PR ld/2404 + * ld-elf/shared.exp: Add a PIE test for PR ld/2404. + +Upstream-Status: Backport +--- + +Index: binutils-2.24/bfd/elflink.c +=================================================================== +--- binutils-2.24.orig/bfd/elflink.c 2014-02-08 13:20:08.628378267 +0000 ++++ binutils-2.24/bfd/elflink.c 2014-02-08 13:20:08.624378267 +0000 +@@ -1090,9 +1090,6 @@ + the type of existing regular definition mismatch. We only do it + if the existing regular definition won't be dynamic. */ + if (pold_alignment == NULL +- && !info->shared +- && !info->export_dynamic +- && !h->ref_dynamic + && newdyn + && newdef + && !olddyn +Index: binutils-2.24/ld/testsuite/ld-elf/shared.exp +=================================================================== +--- binutils-2.24.orig/ld/testsuite/ld-elf/shared.exp 2014-02-08 13:20:08.628378267 +0000 ++++ binutils-2.24/ld/testsuite/ld-elf/shared.exp 2014-02-08 13:20:08.624378267 +0000 +@@ -432,3 +432,29 @@ + + run_cc_link_tests $build_cxx_tests + run_ld_link_exec_tests [] $run_cxx_tests ++ ++if { [istarget *-*-linux*] ++ || [istarget *-*-nacl*] ++ || [istarget *-*-gnu*] } { ++ run_cc_link_tests [list \ ++ [list \ ++ "Build libpr2404b.a with PIE" \ ++ "" \ ++ "-fPIE" \ ++ { pr2404b.c } \ ++ {} \ ++ "libpr2404b.a" \ ++ ] \ ++ ] ++ run_ld_link_exec_tests [] [list \ ++ [list \ ++ "Run pr2404 with PIE" \ ++ "-pie tmpdir/pr2404b.o tmpdir/libpr2404a.so" \ ++ "" \ ++ { dummy.c } \ ++ "pr2404pie" \ ++ "pr2404.out" \ ++ "-fPIE" \ ++ ] \ ++ ] ++} diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/libiberty_path_fix.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/libiberty_path_fix.patch new file mode 100644 index 0000000..6e732fb --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/libiberty_path_fix.patch @@ -0,0 +1,22 @@ +Upstream-Status: Inappropriate [embedded specific] + +don't let the distro compiler point to the wrong installation location + +Thanks to RP for helping find the source code causing the issue. + +2010/08/13 +Nitin A Kamble +Index: binutils-2.22/libiberty/Makefile.in +=================================================================== +--- binutils-2.22.orig/libiberty/Makefile.in ++++ binutils-2.22/libiberty/Makefile.in +@@ -350,7 +350,8 @@ install-strip: install + # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the + # default multilib, so we have to take CFLAGS into account as well, + # since it will be passed the multilib flags. +-MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory` ++#MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory` ++MULTIOSDIR = "" + install_to_libdir: all + ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR) + $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/libtool-2.4-update.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/libtool-2.4-update.patch new file mode 100644 index 0000000..2e621f1 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/libtool-2.4-update.patch @@ -0,0 +1,19317 @@ +Upstream-Status: Inappropriate [embedded specific] + +Index: binutils-2.24/libtool.m4 +=================================================================== +--- binutils-2.24.orig/libtool.m4 2013-11-04 07:33:40.000000000 -0800 ++++ binutils-2.24/libtool.m4 2013-12-15 11:10:23.863785363 -0800 +@@ -1,7 +1,8 @@ + # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + # + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, ++# Inc. + # Written by Gordon Matzigkeit, 1996 + # + # This file is free software; the Free Software Foundation gives +@@ -10,7 +11,8 @@ + + m4_define([_LT_COPYING], [dnl + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, ++# Inc. + # Written by Gordon Matzigkeit, 1996 + # + # This file is part of GNU Libtool. +@@ -37,7 +39,7 @@ + # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ]) + +-# serial 56 LT_INIT ++# serial 57 LT_INIT + + + # LT_PREREQ(VERSION) +@@ -92,7 +94,8 @@ + LIBTOOL_DEPS="$ltmain" + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)' ++LIBTOOL="$LIBTOOL/${host_alias}-libtool" + AC_SUBST(LIBTOOL)dnl + + _LT_SETUP +@@ -166,10 +169,13 @@ + dnl + m4_require([_LT_FILEUTILS_DEFAULTS])dnl + m4_require([_LT_CHECK_SHELL_FEATURES])dnl ++m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl + m4_require([_LT_CMD_RELOAD])dnl + m4_require([_LT_CHECK_MAGIC_METHOD])dnl ++m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl + m4_require([_LT_CMD_OLD_ARCHIVE])dnl + m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl ++m4_require([_LT_WITH_SYSROOT])dnl + + _LT_CONFIG_LIBTOOL_INIT([ + # See if we are running on zsh, and set the options which allow our +@@ -199,7 +205,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=${host_alias}-libtool + can_build_shared=yes + + # All known linkers require a `.a' archive for static linking (except MSVC, +@@ -632,7 +638,7 @@ + m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) + configured by $[0], generated by m4_PACKAGE_STRING. + +-Copyright (C) 2009 Free Software Foundation, Inc. ++Copyright (C) 2010 Free Software Foundation, Inc. + This config.lt script is free software; the Free Software Foundation + gives unlimited permision to copy, distribute and modify it." + +@@ -746,15 +752,12 @@ + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? +- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) ++ sed '$q' "$ltmain" >> "$cfgfile" \ ++ || (rm -f "$cfgfile"; exit 1) + +- _LT_PROG_XSI_SHELLFNS ++ _LT_PROG_REPLACE_SHELLFNS + +- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) +- +- mv -f "$cfgfile" "$ofile" || ++ mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + ], +@@ -980,6 +983,8 @@ + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD ++ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD ++ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF + int main() { return 0;} + _LT_EOF +@@ -1069,30 +1074,41 @@ + fi + ]) + +-# _LT_SYS_MODULE_PATH_AIX +-# ----------------------- ++# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) ++# ---------------------------------- + # Links a minimal program and checks the executable + # for the system default hardcoded library path. In most cases, + # this is /usr/lib:/lib, but when the MPI compilers are used + # the location of the communication and MPI libs are included too. + # If we don't find anything, use the default library path according + # to the aix ld manual. ++# Store the results from the different compilers for each TAGNAME. ++# Allow to override them for all tags through lt_cv_aix_libpath. + m4_defun([_LT_SYS_MODULE_PATH_AIX], + [m4_require([_LT_DECL_SED])dnl +-AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi],[]) +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], ++ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ ++ lt_aix_libpath_sed='[ ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }]' ++ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then ++ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi],[]) ++ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then ++ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" ++ fi ++ ]) ++ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) ++fi + ])# _LT_SYS_MODULE_PATH_AIX + + +@@ -1117,7 +1133,7 @@ + + AC_MSG_CHECKING([how to print strings]) + # Test print first, because it will be a builtin if present. +-if test "X`print -r -- -n 2>/dev/null`" = X-n && \ ++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' + elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then +@@ -1161,6 +1177,39 @@ + ])# _LT_PROG_ECHO_BACKSLASH + + ++# _LT_WITH_SYSROOT ++# ---------------- ++AC_DEFUN([_LT_WITH_SYSROOT], ++[AC_MSG_CHECKING([for sysroot]) ++AC_ARG_WITH([libtool-sysroot], ++[ --with-libtool-sysroot[=DIR] Search for dependent libraries within DIR ++ (or the compiler's sysroot if not specified).], ++[], [with_libtool_sysroot=no]) ++ ++dnl lt_sysroot will always be passed unquoted. We quote it here ++dnl in case the user passed a directory name. ++lt_sysroot= ++case ${with_libtool_sysroot} in #( ++ yes) ++ if test "$GCC" = yes; then ++ lt_sysroot=`$CC --print-sysroot 2>/dev/null` ++ fi ++ ;; #( ++ /*) ++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"` ++ ;; #( ++ no|'') ++ ;; #( ++ *) ++ AC_MSG_RESULT([${with_libtool_sysroot}]) ++ AC_MSG_ERROR([The sysroot must be an absolute path.]) ++ ;; ++esac ++ ++ AC_MSG_RESULT([${lt_sysroot:-no}]) ++_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl ++[dependent libraries, and in which our libraries should be installed.])]) ++ + # _LT_ENABLE_LOCK + # --------------- + m4_defun([_LT_ENABLE_LOCK], +@@ -1320,14 +1369,47 @@ + ])# _LT_ENABLE_LOCK + + ++# _LT_PROG_AR ++# ----------- ++m4_defun([_LT_PROG_AR], ++[AC_CHECK_TOOLS(AR, [ar], false) ++: ${AR=ar} ++: ${AR_FLAGS=cru} ++_LT_DECL([], [AR], [1], [The archiver]) ++_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) ++ ++AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], ++ [lt_cv_ar_at_file=no ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM], ++ [echo conftest.$ac_objext > conftest.lst ++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' ++ AC_TRY_EVAL([lt_ar_try]) ++ if test "$ac_status" -eq 0; then ++ # Ensure the archiver fails upon bogus file names. ++ rm -f conftest.$ac_objext libconftest.a ++ AC_TRY_EVAL([lt_ar_try]) ++ if test "$ac_status" -ne 0; then ++ lt_cv_ar_at_file=@ ++ fi ++ fi ++ rm -f conftest.* libconftest.a ++ ]) ++ ]) ++ ++if test "x$lt_cv_ar_at_file" = xno; then ++ archiver_list_spec= ++else ++ archiver_list_spec=$lt_cv_ar_at_file ++fi ++_LT_DECL([], [archiver_list_spec], [1], ++ [How to feed a file listing to the archiver]) ++])# _LT_PROG_AR ++ ++ + # _LT_CMD_OLD_ARCHIVE + # ------------------- + m4_defun([_LT_CMD_OLD_ARCHIVE], +-[AC_CHECK_TOOL(AR, ar, false) +-test -z "$AR" && AR=ar +-test -z "$AR_FLAGS" && AR_FLAGS=cru +-_LT_DECL([], [AR], [1], [The archiver]) +-_LT_DECL([], [AR_FLAGS], [1]) ++[_LT_PROG_AR + + AC_CHECK_TOOL(STRIP, strip, :) + test -z "$STRIP" && STRIP=: +@@ -1623,7 +1705,7 @@ + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-[#line __oline__ "configure" ++[#line $LINENO "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -1667,10 +1749,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -2210,8 +2292,9 @@ + need_version=no + need_lib_prefix=no + +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) ++ case $GCC,$cc_basename in ++ yes,*) ++ # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ +@@ -2244,13 +2327,71 @@ + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac ++ dynamic_linker='Win32 ld.exe' ++ ;; ++ ++ *,cl*) ++ # Native MSVC ++ libname_spec='$name' ++ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ++ library_names_spec='${libname}.dll.lib' ++ ++ case $build_os in ++ mingw*) ++ sys_lib_search_path_spec= ++ lt_save_ifs=$IFS ++ IFS=';' ++ for lt_path in $LIB ++ do ++ IFS=$lt_save_ifs ++ # Let DOS variable expansion print the short 8.3 style file name. ++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` ++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" ++ done ++ IFS=$lt_save_ifs ++ # Convert to MSYS style. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ++ ;; ++ cygwin*) ++ # Convert to unix form, then to dos form, then back to unix form ++ # but this time dos style (no spaces!) so that the unix form looks ++ # like /cygdrive/c/PROGRA~1:/cygdr... ++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` ++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` ++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ ;; ++ *) ++ sys_lib_search_path_spec="$LIB" ++ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then ++ # It is most probably a Windows format PATH. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ # FIXME: find the short name or the path components, as spaces are ++ # common. (e.g. "Program Files" -> "PROGRA~1") ++ ;; ++ esac ++ ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds ++ postinstall_cmds='base_file=`basename \${file}`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ dldir=$destdir/`dirname \$dlpath`~ ++ test -d \$dldir || mkdir -p \$dldir~ ++ $install_prog $dir/$dlname \$dldir/$dlname' ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ ++ dlpath=$dir/\$dldll~ ++ $RM \$dlpath' ++ shlibpath_overrides_runpath=yes ++ dynamic_linker='Win32 link.exe' + ;; + + *) ++ # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ++ dynamic_linker='Win32 ld.exe' + ;; + esac +- dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; +@@ -2342,7 +2483,7 @@ + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +@@ -2950,6 +3091,11 @@ + esac + reload_cmds='$LD$reload_flag -o $output$reload_objs' + case $host_os in ++ cygwin* | mingw* | pw32* | cegcc*) ++ if test "$GCC" != yes; then ++ reload_cmds=false ++ fi ++ ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' +@@ -3016,7 +3162,8 @@ + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else +- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' ++ # Keep this pattern in sync with the one in func_win32_libid. ++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; +@@ -3167,6 +3314,21 @@ + ;; + esac + ]) ++ ++file_magic_glob= ++want_nocaseglob=no ++if test "$build" = "$host"; then ++ case $host_os in ++ mingw* | pw32*) ++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then ++ want_nocaseglob=yes ++ else ++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` ++ fi ++ ;; ++ esac ++fi ++ + file_magic_cmd=$lt_cv_file_magic_cmd + deplibs_check_method=$lt_cv_deplibs_check_method + test -z "$deplibs_check_method" && deplibs_check_method=unknown +@@ -3174,7 +3336,11 @@ + _LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) + _LT_DECL([], [file_magic_cmd], [1], +- [Command to use when deplibs_check_method == "file_magic"]) ++ [Command to use when deplibs_check_method = "file_magic"]) ++_LT_DECL([], [file_magic_glob], [1], ++ [How to find potential files when deplibs_check_method = "file_magic"]) ++_LT_DECL([], [want_nocaseglob], [1], ++ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) + ])# _LT_CHECK_MAGIC_METHOD + + +@@ -3277,6 +3443,67 @@ + dnl AC_DEFUN([AM_PROG_NM], []) + dnl AC_DEFUN([AC_PROG_NM], []) + ++# _LT_CHECK_SHAREDLIB_FROM_LINKLIB ++# -------------------------------- ++# how to determine the name of the shared library ++# associated with a specific link library. ++# -- PORTME fill in with the dynamic library characteristics ++m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], ++[m4_require([_LT_DECL_EGREP]) ++m4_require([_LT_DECL_OBJDUMP]) ++m4_require([_LT_DECL_DLLTOOL]) ++AC_CACHE_CHECK([how to associate runtime and link libraries], ++lt_cv_sharedlib_from_linklib_cmd, ++[lt_cv_sharedlib_from_linklib_cmd='unknown' ++ ++case $host_os in ++cygwin* | mingw* | pw32* | cegcc*) ++ # two different shell functions defined in ltmain.sh ++ # decide which to use based on capabilities of $DLLTOOL ++ case `$DLLTOOL --help 2>&1` in ++ *--identify-strict*) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ++ ;; ++ *) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ++ ;; ++ esac ++ ;; ++*) ++ # fallback: assume linklib IS sharedlib ++ lt_cv_sharedlib_from_linklib_cmd="$ECHO" ++ ;; ++esac ++]) ++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd ++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO ++ ++_LT_DECL([], [sharedlib_from_linklib_cmd], [1], ++ [Command to associate shared and link libraries]) ++])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB ++ ++ ++# _LT_PATH_MANIFEST_TOOL ++# ---------------------- ++# locate the manifest tool ++m4_defun([_LT_PATH_MANIFEST_TOOL], ++[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) ++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt ++AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], ++ [lt_cv_path_mainfest_tool=no ++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD ++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out ++ cat conftest.err >&AS_MESSAGE_LOG_FD ++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then ++ lt_cv_path_mainfest_tool=yes ++ fi ++ rm -f conftest*]) ++if test "x$lt_cv_path_mainfest_tool" != xyes; then ++ MANIFEST_TOOL=: ++fi ++_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ++])# _LT_PATH_MANIFEST_TOOL ++ + + # LT_LIB_M + # -------- +@@ -3403,8 +3630,8 @@ + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + + # Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + + # Handle CRLF in mingw tool chain + opt_cr= +@@ -3440,6 +3667,7 @@ + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi ++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no +@@ -3473,6 +3701,18 @@ + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext ++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ ++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) ++/* DATA imports from DLLs on WIN32 con't be const, because runtime ++ relocations are performed -- see ld's documentation on pseudo-relocs. */ ++# define LT@&t@_DLSYM_CONST ++#elif defined(__osf__) ++/* This system does not cope well with relocations in const data. */ ++# define LT@&t@_DLSYM_CONST ++#else ++# define LT@&t@_DLSYM_CONST const ++#endif ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -3484,7 +3724,7 @@ + cat <<_LT_EOF >> conftest.$ac_ext + + /* The mapping between symbol names and symbols. */ +-const struct { ++LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; + } +@@ -3510,15 +3750,15 @@ + _LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext +- lt_save_LIBS="$LIBS" +- lt_save_CFLAGS="$CFLAGS" ++ lt_globsym_save_LIBS=$LIBS ++ lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi +- LIBS="$lt_save_LIBS" +- CFLAGS="$lt_save_CFLAGS" ++ LIBS=$lt_globsym_save_LIBS ++ CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi +@@ -3551,6 +3791,13 @@ + AC_MSG_RESULT(ok) + fi + ++# Response file support. ++if test "$lt_cv_nm_interface" = "MS dumpbin"; then ++ nm_file_list_spec='@' ++elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then ++ nm_file_list_spec='@' ++fi ++ + _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) + _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], +@@ -3561,6 +3808,8 @@ + _LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) ++_LT_DECL([], [nm_file_list_spec], [1], ++ [Specify filename containing input files for $NM]) + ]) # _LT_CMD_GLOBAL_SYMBOLS + + +@@ -3572,7 +3821,6 @@ + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)= + +-AC_MSG_CHECKING([for $compiler option to produce PIC]) + m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then +@@ -3678,6 +3926,12 @@ + ;; + esac + ;; ++ mingw* | cygwin* | os2* | pw32* | cegcc*) ++ # This hack is so that the source file can tell whether it is being ++ # built for inclusion in a dll (and should export symbols for example). ++ m4_if([$1], [GCJ], [], ++ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ++ ;; + dgux*) + case $cc_basename in + ec++*) +@@ -3830,7 +4084,7 @@ + ;; + solaris*) + case $cc_basename in +- CC*) ++ CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +@@ -4053,6 +4307,12 @@ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; ++ nagfor*) ++ # NAG Fortran compiler ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) +@@ -4115,7 +4375,7 @@ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in +- f77* | f90* | f95*) ++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; +@@ -4172,9 +4432,11 @@ + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; + esac +-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], +- [How to pass a linker flag through the compiler]) ++ ++AC_CACHE_CHECK([for $compiler option to produce PIC], ++ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], ++ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) ++_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + + # + # Check to make sure the PIC flag actually works. +@@ -4193,6 +4455,8 @@ + _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + ++_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], ++ [How to pass a linker flag through the compiler]) + # + # Check to make sure the static flag actually works. + # +@@ -4213,6 +4477,7 @@ + m4_defun([_LT_LINKER_SHLIBS], + [AC_REQUIRE([LT_PATH_LD])dnl + AC_REQUIRE([LT_PATH_NM])dnl ++m4_require([_LT_PATH_MANIFEST_TOOL])dnl + m4_require([_LT_FILEUTILS_DEFAULTS])dnl + m4_require([_LT_DECL_EGREP])dnl + m4_require([_LT_DECL_SED])dnl +@@ -4221,6 +4486,7 @@ + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ++ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. +@@ -4235,15 +4501,20 @@ + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" +- ;; ++ ;; + cygwin* | mingw* | cegcc*) +- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' +- ;; ++ case $cc_basename in ++ cl*) ;; ++ *) ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ++ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ++ ;; ++ esac ++ ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- ;; ++ ;; + esac +- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + ], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= +@@ -4411,7 +4682,8 @@ + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ++ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +@@ -4459,7 +4731,7 @@ + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then +- tmp_addflag= ++ tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler +@@ -4510,12 +4782,12 @@ + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' +- _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ +- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' ++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac +@@ -4529,8 +4801,8 @@ + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + +@@ -4548,8 +4820,8 @@ + + _LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +@@ -4595,8 +4867,8 @@ + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +@@ -4726,7 +4998,7 @@ + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. +- _LT_SYS_MODULE_PATH_AIX ++ _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else +@@ -4737,7 +5009,7 @@ + else + # Determine the default libpath from the value encoded in an + # empty executable. +- _LT_SYS_MODULE_PATH_AIX ++ _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. +@@ -4781,20 +5053,63 @@ + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' +- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported +- # Tell ltmain to make .lib files, not .a files. +- libext=lib +- # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" +- # FIXME: Setting linknames here is a bad hack. +- _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' +- # The linker will automatically build a .lib file if we build a DLL. +- _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' +- # FIXME: Should let the user specify the lib program. +- _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' +- _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' +- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ++ case $cc_basename in ++ cl*) ++ # Native MSVC ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ _LT_TAGVAR(always_export_symbols, $1)=yes ++ _LT_TAGVAR(file_list_spec, $1)='@' ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; ++ else ++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' ++ # The linker will not automatically build a static lib if we build a DLL. ++ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' ++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' ++ # Don't use ranlib ++ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' ++ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile="$lt_outputfile.exe" ++ lt_tool_outputfile="$lt_tool_outputfile.exe" ++ ;; ++ esac~ ++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' ++ ;; ++ *) ++ # Assume MSVC wrapper ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' ++ # The linker will automatically build a .lib file if we build a DLL. ++ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' ++ # FIXME: Should let the user specify the lib program. ++ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' ++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ++ ;; ++ esac + ;; + + darwin* | rhapsody*) +@@ -4828,7 +5143,7 @@ + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no +@@ -4836,7 +5151,7 @@ + + hpux9*) + if test "$GCC" = yes; then +- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi +@@ -4852,7 +5167,7 @@ + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi +@@ -4876,10 +5191,10 @@ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else +@@ -4926,16 +5241,31 @@ + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" +- AC_LINK_IFELSE(int foo(void) {}, +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' +- ) +- LDFLAGS="$save_LDFLAGS" ++ # This should be the same for all languages, so no per-tag cache variable. ++ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], ++ [lt_cv_irix_exported_symbol], ++ [save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" ++ AC_LINK_IFELSE( ++ [AC_LANG_SOURCE( ++ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], ++ [C++], [[int foo (void) { return 0; }]], ++ [Fortran 77], [[ ++ subroutine foo ++ end]], ++ [Fortran], [[ ++ subroutine foo ++ end]])])], ++ [lt_cv_irix_exported_symbol=yes], ++ [lt_cv_irix_exported_symbol=no]) ++ LDFLAGS="$save_LDFLAGS"]) ++ if test "$lt_cv_irix_exported_symbol" = yes; then ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ++ fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' +@@ -5020,7 +5350,7 @@ + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +@@ -5039,9 +5369,9 @@ + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) +@@ -5313,8 +5643,6 @@ + to runtime path list]) + _LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +-_LT_TAGDECL([], [fix_srcfile_path], [1], +- [Fix the shell variable $srcfile for the compiler]) + _LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) + _LT_TAGDECL([], [export_symbols_cmds], [2], +@@ -5325,6 +5653,8 @@ + [Symbols that must always be exported]) + _LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) ++_LT_TAGDECL([], [postlink_cmds], [2], ++ [Commands necessary for finishing linking programs]) + _LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) + dnl FIXME: Not yet implemented +@@ -5426,6 +5756,7 @@ + m4_defun([_LT_LANG_CXX_CONFIG], + [m4_require([_LT_FILEUTILS_DEFAULTS])dnl + m4_require([_LT_DECL_EGREP])dnl ++m4_require([_LT_PATH_MANIFEST_TOOL])dnl + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then +@@ -5487,6 +5818,7 @@ + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC ++ lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX +@@ -5504,6 +5836,7 @@ + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} ++ CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) +@@ -5525,8 +5858,8 @@ + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +@@ -5667,7 +6000,7 @@ + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. +- _LT_SYS_MODULE_PATH_AIX ++ _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +@@ -5679,7 +6012,7 @@ + else + # Determine the default libpath from the value encoded in an + # empty executable. +- _LT_SYS_MODULE_PATH_AIX ++ _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. +@@ -5721,29 +6054,75 @@ + ;; + + cygwin* | mingw* | pw32* | cegcc*) +- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, +- # as there is no search path for DLLs. +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' +- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported +- _LT_TAGVAR(always_export_symbols, $1)=no +- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +- +- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- else +- _LT_TAGVAR(ld_shlibs, $1)=no +- fi +- ;; ++ case $GXX,$cc_basename in ++ ,cl* | no,cl*) ++ # Native MSVC ++ # hardcode_libdir_flag_spec is actually meaningless, as there is ++ # no search path for DLLs. ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ _LT_TAGVAR(always_export_symbols, $1)=yes ++ _LT_TAGVAR(file_list_spec, $1)='@' ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; ++ else ++ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' ++ # The linker will not automatically build a static lib if we build a DLL. ++ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' ++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ++ # Don't use ranlib ++ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' ++ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile="$lt_outputfile.exe" ++ lt_tool_outputfile="$lt_tool_outputfile.exe" ++ ;; ++ esac~ ++ func_to_tool_file "$lt_outputfile"~ ++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' ++ ;; ++ *) ++ # g++ ++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, ++ # as there is no search path for DLLs. ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' ++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported ++ _LT_TAGVAR(always_export_symbols, $1)=no ++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ++ ++ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ # If the export-symbols file already is a .def file (1st line ++ # is EXPORTS), use it as is; otherwise, prepend... ++ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ cp $export_symbols $output_objdir/$soname.def; ++ else ++ echo EXPORTS > $output_objdir/$soname.def; ++ cat $export_symbols >> $output_objdir/$soname.def; ++ fi~ ++ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ else ++ _LT_TAGVAR(ld_shlibs, $1)=no ++ fi ++ ;; ++ esac ++ ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; +@@ -5818,7 +6197,7 @@ + ;; + *) + if test "$GXX" = yes; then +- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no +@@ -5889,10 +6268,10 @@ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi +@@ -5933,9 +6312,9 @@ + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes +@@ -6005,20 +6384,20 @@ + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ +- compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' ++ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ +- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ ++ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ +- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' ++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ +- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' +@@ -6213,7 +6592,7 @@ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + +@@ -6259,7 +6638,7 @@ + + solaris*) + case $cc_basename in +- CC*) ++ CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' +@@ -6300,9 +6679,9 @@ + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when +@@ -6431,6 +6810,7 @@ + fi # test -n "$compiler" + + CC=$lt_save_CC ++ CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC +@@ -6445,6 +6825,29 @@ + ])# _LT_LANG_CXX_CONFIG + + ++# _LT_FUNC_STRIPNAME_CNF ++# ---------------------- ++# func_stripname_cnf prefix suffix name ++# strip PREFIX and SUFFIX off of NAME. ++# PREFIX and SUFFIX must not contain globbing or regex special ++# characters, hashes, percent signs, but SUFFIX may contain a leading ++# dot (in which case that matches only a dot). ++# ++# This function is identical to the (non-XSI) version of func_stripname, ++# except this one can be used by m4 code that may be executed by configure, ++# rather than the libtool script. ++m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl ++AC_REQUIRE([_LT_DECL_SED]) ++AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) ++func_stripname_cnf () ++{ ++ case ${2} in ++ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; ++ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; ++ esac ++} # func_stripname_cnf ++])# _LT_FUNC_STRIPNAME_CNF ++ + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) + # --------------------------------- + # Figure out "hidden" library dependencies from verbose +@@ -6453,6 +6856,7 @@ + # objects, libraries and library flags. + m4_defun([_LT_SYS_HIDDEN_LIBDEPS], + [m4_require([_LT_FILEUTILS_DEFAULTS])dnl ++AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl + # Dependencies to place before and after the object being linked: + _LT_TAGVAR(predep_objects, $1)= + _LT_TAGVAR(postdep_objects, $1)= +@@ -6503,6 +6907,13 @@ + }; + _LT_EOF + ]) ++ ++_lt_libdeps_save_CFLAGS=$CFLAGS ++case "$CC $CFLAGS " in #( ++*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; ++*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; ++esac ++ + dnl Parse the compiler output and extract the necessary + dnl objects, libraries and library flags. + if AC_TRY_EVAL(ac_compile); then +@@ -6514,7 +6925,7 @@ + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do +- case $p in ++ case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. +@@ -6523,13 +6934,22 @@ + test $p = "-R"; then + prev=$p + continue +- else +- prev= + fi + ++ # Expand the sysroot to ease extracting the directories later. ++ if test -z "$prev"; then ++ case $p in ++ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; ++ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; ++ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; ++ esac ++ fi ++ case $p in ++ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; ++ esac + if test "$pre_test_object_deps_done" = no; then +- case $p in +- -L* | -R*) ++ case ${prev} in ++ -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. +@@ -6549,8 +6969,10 @@ + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi ++ prev= + ;; + ++ *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. +@@ -6586,6 +7008,7 @@ + fi + + $RM -f confest.$objext ++CFLAGS=$_lt_libdeps_save_CFLAGS + + # PORTME: override above test on systems where it is broken + m4_if([$1], [CXX], +@@ -6622,7 +7045,7 @@ + + solaris*) + case $cc_basename in +- CC*) ++ CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as +@@ -6735,7 +7158,9 @@ + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC ++ lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} ++ CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) +@@ -6789,6 +7214,7 @@ + + GCC=$lt_save_GCC + CC="$lt_save_CC" ++ CFLAGS="$lt_save_CFLAGS" + fi # test "$_lt_disable_F77" != yes + + AC_LANG_POP +@@ -6865,7 +7291,9 @@ + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC ++ lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} ++ CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + +@@ -6921,7 +7349,8 @@ + fi # test -n "$compiler" + + GCC=$lt_save_GCC +- CC="$lt_save_CC" ++ CC=$lt_save_CC ++ CFLAGS=$lt_save_CFLAGS + fi # test "$_lt_disable_FC" != yes + + AC_LANG_POP +@@ -6958,10 +7387,12 @@ + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. +-lt_save_CC="$CC" ++lt_save_CC=$CC ++lt_save_CFLAGS=$CFLAGS + lt_save_GCC=$GCC + GCC=yes + CC=${GCJ-"gcj"} ++CFLAGS=$GCJFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_TAGVAR(LD, $1)="$LD" +@@ -6992,7 +7423,8 @@ + AC_LANG_RESTORE + + GCC=$lt_save_GCC +-CC="$lt_save_CC" ++CC=$lt_save_CC ++CFLAGS=$lt_save_CFLAGS + ])# _LT_LANG_GCJ_CONFIG + + +@@ -7027,9 +7459,11 @@ + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" ++lt_save_CFLAGS=$CFLAGS + lt_save_GCC=$GCC + GCC= + CC=${RC-"windres"} ++CFLAGS= + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) +@@ -7042,7 +7476,8 @@ + + GCC=$lt_save_GCC + AC_LANG_RESTORE +-CC="$lt_save_CC" ++CC=$lt_save_CC ++CFLAGS=$lt_save_CFLAGS + ])# _LT_LANG_RC_CONFIG + + +@@ -7101,6 +7536,15 @@ + AC_SUBST([OBJDUMP]) + ]) + ++# _LT_DECL_DLLTOOL ++# ---------------- ++# Ensure DLLTOOL variable is set. ++m4_defun([_LT_DECL_DLLTOOL], ++[AC_CHECK_TOOL(DLLTOOL, dlltool, false) ++test -z "$DLLTOOL" && DLLTOOL=dlltool ++_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) ++AC_SUBST([DLLTOOL]) ++]) + + # _LT_DECL_SED + # ------------ +@@ -7194,8 +7638,8 @@ + # Try some XSI features + xsi_shell=no + ( _lt_dummy="a/b/c" +- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ +- = c,a/b,, \ ++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ ++ = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +@@ -7234,206 +7678,162 @@ + ])# _LT_CHECK_SHELL_FEATURES + + +-# _LT_PROG_XSI_SHELLFNS +-# --------------------- +-# Bourne and XSI compatible variants of some useful shell functions. +-m4_defun([_LT_PROG_XSI_SHELLFNS], +-[case $xsi_shell in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result="${1##*/}" +-} +- +-# func_dirname_and_basename file append nondir_replacement +-# perform func_basename and func_dirname in a single function +-# call: +-# dirname: Compute the dirname of FILE. If nonempty, +-# add APPEND to the result, otherwise set result +-# to NONDIR_REPLACEMENT. +-# value returned in "$func_dirname_result" +-# basename: Compute filename of FILE. +-# value retuned in "$func_basename_result" +-# Implementation must be kept synchronized with func_dirname +-# and func_basename. For efficiency, we do not delegate to +-# those functions but instead duplicate the functionality here. +-func_dirname_and_basename () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +- func_basename_result="${1##*/}" +-} +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-func_stripname () +-{ +- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are +- # positional parameters, so assign one to ordinary parameter first. +- func_stripname_result=${3} +- func_stripname_result=${func_stripname_result#"${1}"} +- func_stripname_result=${func_stripname_result%"${2}"} +-} +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=${1%%=*} +- func_opt_split_arg=${1#*=} +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- case ${1} in +- *.lo) func_lo2o_result=${1%.lo}.${objext} ;; +- *) func_lo2o_result=${1} ;; +- esac +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=${1%.*}.lo +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=$(( $[*] )) +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=${#1} +-} +- +-_LT_EOF +- ;; +- *) # Bourne compatible functions. +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- # Extract subdirectory from the argument. +- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` +- if test "X$func_dirname_result" = "X${1}"; then +- func_dirname_result="${3}" +- else +- func_dirname_result="$func_dirname_result${2}" +- fi +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result=`$ECHO "${1}" | $SED "$basename"` +-} ++# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) ++# ------------------------------------------------------ ++# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and ++# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. ++m4_defun([_LT_PROG_FUNCTION_REPLACE], ++[dnl { ++sed -e '/^$1 ()$/,/^} # $1 /c\ ++$1 ()\ ++{\ ++m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) ++} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++]) + +-dnl func_dirname_and_basename +-dnl A portable version of this function is already defined in general.m4sh +-dnl so there is no need for it here. + +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-# func_strip_suffix prefix name +-func_stripname () +-{ +- case ${2} in +- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; +- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; +- esac +-} ++# _LT_PROG_REPLACE_SHELLFNS ++# ------------------------- ++# Replace existing portable implementations of several shell functions with ++# equivalent extended shell implementations where those features are available.. ++m4_defun([_LT_PROG_REPLACE_SHELLFNS], ++[if test x"$xsi_shell" = xyes; then ++ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl ++ case ${1} in ++ */*) func_dirname_result="${1%/*}${2}" ;; ++ * ) func_dirname_result="${3}" ;; ++ esac]) ++ ++ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl ++ func_basename_result="${1##*/}"]) ++ ++ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl ++ case ${1} in ++ */*) func_dirname_result="${1%/*}${2}" ;; ++ * ) func_dirname_result="${3}" ;; ++ esac ++ func_basename_result="${1##*/}"]) + +-# sed scripts: +-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +-my_sed_long_arg='1s/^-[[^=]]*=//' ++ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl ++ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are ++ # positional parameters, so assign one to ordinary parameter first. ++ func_stripname_result=${3} ++ func_stripname_result=${func_stripname_result#"${1}"} ++ func_stripname_result=${func_stripname_result%"${2}"}]) ++ ++ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl ++ func_split_long_opt_name=${1%%=*} ++ func_split_long_opt_arg=${1#*=}]) ++ ++ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl ++ func_split_short_opt_arg=${1#??} ++ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) ++ ++ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl ++ case ${1} in ++ *.lo) func_lo2o_result=${1%.lo}.${objext} ;; ++ *) func_lo2o_result=${1} ;; ++ esac]) + +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` +- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +-} ++ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + +-# func_lo2o object +-func_lo2o () +-{ +- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +-} ++ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'` +-} ++ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) ++fi + +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=`expr "$[@]"` +-} ++if test x"$lt_shell_append" = xyes; then ++ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +-} ++ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl ++ func_quote_for_eval "${2}" ++dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ ++ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) ++ ++ # Save a `func_append' function call where possible by direct use of '+=' ++ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++else ++ # Save a `func_append' function call even when '+=' is not available ++ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++fi + +-_LT_EOF +-esac ++if test x"$_lt_function_replace_fail" = x":"; then ++ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) ++fi ++]) + +-case $lt_shell_append in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$[1]+=\$[2]" +-} +-_LT_EOF ++# _LT_PATH_CONVERSION_FUNCTIONS ++# ----------------------------- ++# Determine which file name conversion functions should be used by ++# func_to_host_file (and, implicitly, by func_to_host_path). These are needed ++# for certain cross-compile configurations and native mingw. ++m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], ++[AC_REQUIRE([AC_CANONICAL_HOST])dnl ++AC_REQUIRE([AC_CANONICAL_BUILD])dnl ++AC_MSG_CHECKING([how to convert $build file names to $host format]) ++AC_CACHE_VAL(lt_cv_to_host_file_cmd, ++[case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ++ ;; ++ esac + ;; +- *) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$[1]=\$$[1]\$[2]" +-} +- +-_LT_EOF ++ *-*-cygwin* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ++ ;; ++ esac + ;; +- esac ++ * ) # unhandled hosts (and "normal" native builds) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++esac ++]) ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) ++_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], ++ [0], [convert $build file names to $host format])dnl ++ ++AC_MSG_CHECKING([how to convert $build file names to toolchain format]) ++AC_CACHE_VAL(lt_cv_to_tool_file_cmd, ++[#assume ordinary cross tools, or native build. ++lt_cv_to_tool_file_cmd=func_convert_file_noop ++case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ esac ++ ;; ++esac + ]) ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) ++_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], ++ [0], [convert $build files to toolchain format])dnl ++])# _LT_PATH_CONVERSION_FUNCTIONS +Index: binutils-2.24/ltmain.sh +=================================================================== +--- binutils-2.24.orig/ltmain.sh 2013-11-04 07:33:40.000000000 -0800 ++++ binutils-2.24/ltmain.sh 2013-12-15 11:10:23.867118697 -0800 +@@ -1,10 +1,9 @@ +-# Generated from ltmain.m4sh. + +-# libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a ++# libtool (GNU libtool) 2.4 + # Written by Gordon Matzigkeit , 1996 + + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +-# 2007, 2008, 2009 Free Software Foundation, Inc. ++# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + # This is free software; see the source for copying conditions. There is NO + # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +@@ -38,7 +37,6 @@ + # -n, --dry-run display commands without modifying any files + # --features display basic configuration information and exit + # --mode=MODE use operation mode MODE +-# --no-finish let install mode avoid finish commands + # --preserve-dup-deps don't remove duplicate dependency libraries + # --quiet, --silent don't print informational messages + # --no-quiet, --no-silent +@@ -71,17 +69,19 @@ + # compiler: $LTCC + # compiler flags: $LTCFLAGS + # linker: $LD (gnu? $with_gnu_ld) +-# $progname: (GNU libtool 1.3134 2009-11-29) 2.2.7a ++# $progname: (GNU libtool) 2.4 + # automake: $automake_version + # autoconf: $autoconf_version + # + # Report bugs to . ++# GNU libtool home page: . ++# General help using GNU software: . + + PROGRAM=libtool + PACKAGE=libtool +-VERSION=2.2.7a +-TIMESTAMP=" 1.3134 2009-11-29" +-package_revision=1.3134 ++VERSION=2.4 ++TIMESTAMP="" ++package_revision=1.3293 + + # Be Bourne compatible + if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +@@ -106,9 +106,6 @@ + } + + # NLS nuisances: We save the old values to restore during execute mode. +-# Only set LANG and LC_ALL to C if already set. +-# These must not be set unconditionally because not all systems understand +-# e.g. LANG=C (notably SCO). + lt_user_locale= + lt_safe_locale= + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +@@ -121,15 +118,13 @@ + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" + done ++LC_ALL=C ++LANGUAGE=C ++export LANGUAGE LC_ALL + + $lt_unset CDPATH + + +- +- +- +- +- + # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh + # is ksh but when the shell is invoked as "sh" and the current value of + # the _XPG environment variable is not equal to 1 (one), the special +@@ -140,7 +135,7 @@ + + + : ${CP="cp -f"} +-: ${ECHO=$as_echo} ++test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} + : ${EGREP="/bin/grep -E"} + : ${FGREP="/bin/grep -F"} + : ${GREP="/bin/grep"} +@@ -149,7 +144,7 @@ + : ${MKDIR="mkdir"} + : ${MV="mv -f"} + : ${RM="rm -f"} +-: ${SED="/mount/endor/wildenhu/local-x86_64/bin/sed"} ++: ${SED="/bin/sed"} + : ${SHELL="${CONFIG_SHELL-/bin/sh}"} + : ${Xsed="$SED -e 1s/^X//"} + +@@ -169,6 +164,27 @@ + dirname="s,/[^/]*$,," + basename="s,^.*/,," + ++# func_dirname file append nondir_replacement ++# Compute the dirname of FILE. If nonempty, add APPEND to the result, ++# otherwise set result to NONDIR_REPLACEMENT. ++func_dirname () ++{ ++ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` ++ if test "X$func_dirname_result" = "X${1}"; then ++ func_dirname_result="${3}" ++ else ++ func_dirname_result="$func_dirname_result${2}" ++ fi ++} # func_dirname may be replaced by extended shell implementation ++ ++ ++# func_basename file ++func_basename () ++{ ++ func_basename_result=`$ECHO "${1}" | $SED "$basename"` ++} # func_basename may be replaced by extended shell implementation ++ ++ + # func_dirname_and_basename file append nondir_replacement + # perform func_basename and func_dirname in a single function + # call: +@@ -183,17 +199,31 @@ + # those functions but instead duplicate the functionality here. + func_dirname_and_basename () + { +- # Extract subdirectory from the argument. +- func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` +- if test "X$func_dirname_result" = "X${1}"; then +- func_dirname_result="${3}" +- else +- func_dirname_result="$func_dirname_result${2}" +- fi +- func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +-} ++ # Extract subdirectory from the argument. ++ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` ++ if test "X$func_dirname_result" = "X${1}"; then ++ func_dirname_result="${3}" ++ else ++ func_dirname_result="$func_dirname_result${2}" ++ fi ++ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` ++} # func_dirname_and_basename may be replaced by extended shell implementation ++ ++ ++# func_stripname prefix suffix name ++# strip PREFIX and SUFFIX off of NAME. ++# PREFIX and SUFFIX must not contain globbing or regex special ++# characters, hashes, percent signs, but SUFFIX may contain a leading ++# dot (in which case that matches only a dot). ++# func_strip_suffix prefix name ++func_stripname () ++{ ++ case ${2} in ++ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; ++ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; ++ esac ++} # func_stripname may be replaced by extended shell implementation + +-# Generated shell functions inserted here. + + # These SED scripts presuppose an absolute path with a trailing slash. + pathcar='s,^/\([^/]*\).*$,\1,' +@@ -376,6 +406,15 @@ + # Same as above, but do not quote variable references. + double_quote_subst='s/\(["`\\]\)/\\\1/g' + ++# Sed substitution that turns a string into a regex matching for the ++# string literally. ++sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' ++ ++# Sed substitution that converts a w32 file name or path ++# which contains forward slashes, into one that contains ++# (escaped) backslashes. A very naive implementation. ++lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' ++ + # Re-`\' parameter expansions in output of double_quote_subst that were + # `\'-ed in input to the same. If an odd number of `\' preceded a '$' + # in input to double_quote_subst, that '$' was protected from expansion. +@@ -404,7 +443,7 @@ + # name if it has been set yet. + func_echo () + { +- $ECHO "$progname${mode+: }$mode: $*" ++ $ECHO "$progname: ${opt_mode+$opt_mode: }$*" + } + + # func_verbose arg... +@@ -430,14 +469,14 @@ + # Echo program name prefixed message to standard error. + func_error () + { +- $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 ++ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 + } + + # func_warning arg... + # Echo program name prefixed warning message to standard error. + func_warning () + { +- $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 ++ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +@@ -656,19 +695,35 @@ + fi + } + +- +- ++# func_tr_sh ++# Turn $1 into a string suitable for a shell variable name. ++# Result is stored in $func_tr_sh_result. All characters ++# not in the set a-zA-Z0-9_ are replaced with '_'. Further, ++# if $1 begins with a digit, a '_' is prepended as well. ++func_tr_sh () ++{ ++ case $1 in ++ [0-9]* | *[!a-zA-Z0-9_]*) ++ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ++ ;; ++ * ) ++ func_tr_sh_result=$1 ++ ;; ++ esac ++} + + + # func_version + # Echo version message to standard output and exit. + func_version () + { ++ $opt_debug ++ + $SED -n '/(C)/!b go + :more + /\./!{ + N +- s/\n# // ++ s/\n# / / + b more + } + :go +@@ -685,7 +740,9 @@ + # Echo short help message to standard output and exit. + func_usage () + { +- $SED -n '/^# Usage:/,/^# *-h/ { ++ $opt_debug ++ ++ $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ +@@ -701,7 +758,10 @@ + # unless 'noexit' is passed as argument. + func_help () + { ++ $opt_debug ++ + $SED -n '/^# Usage:/,/# Report bugs to/ { ++ :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* +@@ -714,7 +774,11 @@ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p +- }' < "$progpath" ++ d ++ } ++ /^# .* home page:/b print ++ /^# General help using/b print ++ ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret +@@ -726,12 +790,39 @@ + # exit_cmd. + func_missing_arg () + { +- func_error "missing argument for $1" ++ $opt_debug ++ ++ func_error "missing argument for $1." + exit_cmd=exit + } + +-exit_cmd=: + ++# func_split_short_opt shortopt ++# Set func_split_short_opt_name and func_split_short_opt_arg shell ++# variables after splitting SHORTOPT after the 2nd character. ++func_split_short_opt () ++{ ++ my_sed_short_opt='1s/^\(..\).*$/\1/;q' ++ my_sed_short_rest='1s/^..\(.*\)$/\1/;q' ++ ++ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` ++ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` ++} # func_split_short_opt may be replaced by extended shell implementation ++ ++ ++# func_split_long_opt longopt ++# Set func_split_long_opt_name and func_split_long_opt_arg shell ++# variables after splitting LONGOPT at the `=' sign. ++func_split_long_opt () ++{ ++ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' ++ my_sed_long_arg='1s/^--[^=]*=//' ++ ++ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` ++ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` ++} # func_split_long_opt may be replaced by extended shell implementation ++ ++exit_cmd=: + + + +@@ -741,26 +832,64 @@ + magic_exe="%%%MAGIC EXE variable%%%" + + # Global variables. +-# $mode is unset + nonopt= +-execute_dlfiles= + preserve_args= + lo2o="s/\\.lo\$/.${objext}/" + o2lo="s/\\.${objext}\$/.lo/" + extracted_archives= + extracted_serial=0 + +-opt_dry_run=false +-opt_finish=: +-opt_duplicate_deps=false +-opt_silent=false +-opt_debug=: +- + # If this variable is set in any of the actions, the command in it + # will be execed at the end. This prevents here-documents from being + # left over by shells. + exec_cmd= + ++# func_append var value ++# Append VALUE to the end of shell variable VAR. ++func_append () ++{ ++ eval "${1}=\$${1}\${2}" ++} # func_append may be replaced by extended shell implementation ++ ++# func_append_quoted var value ++# Quote VALUE and append to the end of shell variable VAR, separated ++# by a space. ++func_append_quoted () ++{ ++ func_quote_for_eval "${2}" ++ eval "${1}=\$${1}\\ \$func_quote_for_eval_result" ++} # func_append_quoted may be replaced by extended shell implementation ++ ++ ++# func_arith arithmetic-term... ++func_arith () ++{ ++ func_arith_result=`expr "${@}"` ++} # func_arith may be replaced by extended shell implementation ++ ++ ++# func_len string ++# STRING may not start with a hyphen. ++func_len () ++{ ++ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` ++} # func_len may be replaced by extended shell implementation ++ ++ ++# func_lo2o object ++func_lo2o () ++{ ++ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` ++} # func_lo2o may be replaced by extended shell implementation ++ ++ ++# func_xform libobj-or-source ++func_xform () ++{ ++ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` ++} # func_xform may be replaced by extended shell implementation ++ ++ + # func_fatal_configuration arg... + # Echo program name prefixed message to standard error, followed by + # a configuration failure hint, and exit. +@@ -850,130 +979,204 @@ + esac + } + +-# Parse options once, thoroughly. This comes as soon as possible in +-# the script to make things like `libtool --version' happen quickly. ++# func_check_version_match ++# Ensure that we are using m4 macros, and libtool script from the same ++# release of libtool. ++func_check_version_match () + { ++ if test "$package_revision" != "$macro_revision"; then ++ if test "$VERSION" != "$macro_version"; then ++ if test -z "$macro_version"; then ++ cat >&2 <<_LT_EOF ++$progname: Version mismatch error. This is $PACKAGE $VERSION, but the ++$progname: definition of this LT_INIT comes from an older release. ++$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION ++$progname: and run autoconf again. ++_LT_EOF ++ else ++ cat >&2 <<_LT_EOF ++$progname: Version mismatch error. This is $PACKAGE $VERSION, but the ++$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. ++$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION ++$progname: and run autoconf again. ++_LT_EOF ++ fi ++ else ++ cat >&2 <<_LT_EOF ++$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, ++$progname: but the definition of this LT_INIT comes from revision $macro_revision. ++$progname: You should recreate aclocal.m4 with macros from revision $package_revision ++$progname: of $PACKAGE $VERSION and run autoconf again. ++_LT_EOF ++ fi ++ ++ exit $EXIT_MISMATCH ++ fi ++} ++ ++ ++# Shorthand for --mode=foo, only valid as the first argument ++case $1 in ++clean|clea|cle|cl) ++ shift; set dummy --mode clean ${1+"$@"}; shift ++ ;; ++compile|compil|compi|comp|com|co|c) ++ shift; set dummy --mode compile ${1+"$@"}; shift ++ ;; ++execute|execut|execu|exec|exe|ex|e) ++ shift; set dummy --mode execute ${1+"$@"}; shift ++ ;; ++finish|finis|fini|fin|fi|f) ++ shift; set dummy --mode finish ${1+"$@"}; shift ++ ;; ++install|instal|insta|inst|ins|in|i) ++ shift; set dummy --mode install ${1+"$@"}; shift ++ ;; ++link|lin|li|l) ++ shift; set dummy --mode link ${1+"$@"}; shift ++ ;; ++uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) ++ shift; set dummy --mode uninstall ${1+"$@"}; shift ++ ;; ++esac + +- # Shorthand for --mode=foo, only valid as the first argument +- case $1 in +- clean|clea|cle|cl) +- shift; set dummy --mode clean ${1+"$@"}; shift +- ;; +- compile|compil|compi|comp|com|co|c) +- shift; set dummy --mode compile ${1+"$@"}; shift +- ;; +- execute|execut|execu|exec|exe|ex|e) +- shift; set dummy --mode execute ${1+"$@"}; shift +- ;; +- finish|finis|fini|fin|fi|f) +- shift; set dummy --mode finish ${1+"$@"}; shift +- ;; +- install|instal|insta|inst|ins|in|i) +- shift; set dummy --mode install ${1+"$@"}; shift +- ;; +- link|lin|li|l) +- shift; set dummy --mode link ${1+"$@"}; shift +- ;; +- uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) +- shift; set dummy --mode uninstall ${1+"$@"}; shift +- ;; +- esac + +- # Parse non-mode specific arguments: +- while test "$#" -gt 0; do ++ ++# Option defaults: ++opt_debug=: ++opt_dry_run=false ++opt_config=false ++opt_preserve_dup_deps=false ++opt_features=false ++opt_finish=false ++opt_help=false ++opt_help_all=false ++opt_silent=: ++opt_verbose=: ++opt_silent=false ++opt_verbose=false ++ ++ ++# Parse options once, thoroughly. This comes as soon as possible in the ++# script to make things like `--version' happen as quickly as we can. ++{ ++ # this just eases exit handling ++ while test $# -gt 0; do + opt="$1" + shift +- + case $opt in +- --config) func_config ;; +- +- --debug) preserve_args="$preserve_args $opt" ++ --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" +- opt_debug='set -x' + $opt_debug + ;; +- +- -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break +- execute_dlfiles="$execute_dlfiles $1" +- shift ++ --dry-run|--dryrun|-n) ++ opt_dry_run=: + ;; +- +- --dry-run | -n) opt_dry_run=: ;; +- --features) func_features ;; +- --finish) mode="finish" ;; +- --no-finish) opt_finish=false ;; +- +- --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break +- case $1 in +- # Valid mode arguments: +- clean) ;; +- compile) ;; +- execute) ;; +- finish) ;; +- install) ;; +- link) ;; +- relink) ;; +- uninstall) ;; +- +- # Catch anything else as an error +- *) func_error "invalid argument for $opt" +- exit_cmd=exit +- break +- ;; +- esac +- +- mode="$1" ++ --config) ++ opt_config=: ++func_config ++ ;; ++ --dlopen|-dlopen) ++ optarg="$1" ++ opt_dlopen="${opt_dlopen+$opt_dlopen ++}$optarg" + shift + ;; +- + --preserve-dup-deps) +- opt_duplicate_deps=: ;; +- +- --quiet|--silent) preserve_args="$preserve_args $opt" +- opt_silent=: +- opt_verbose=false ++ opt_preserve_dup_deps=: + ;; +- +- --no-quiet|--no-silent) +- preserve_args="$preserve_args $opt" +- opt_silent=false ++ --features) ++ opt_features=: ++func_features + ;; +- +- --verbose| -v) preserve_args="$preserve_args $opt" ++ --finish) ++ opt_finish=: ++set dummy --mode finish ${1+"$@"}; shift ++ ;; ++ --help) ++ opt_help=: ++ ;; ++ --help-all) ++ opt_help_all=: ++opt_help=': help-all' ++ ;; ++ --mode) ++ test $# = 0 && func_missing_arg $opt && break ++ optarg="$1" ++ opt_mode="$optarg" ++case $optarg in ++ # Valid mode arguments: ++ clean|compile|execute|finish|install|link|relink|uninstall) ;; ++ ++ # Catch anything else as an error ++ *) func_error "invalid argument for $opt" ++ exit_cmd=exit ++ break ++ ;; ++esac ++ shift ++ ;; ++ --no-silent|--no-quiet) + opt_silent=false +- opt_verbose=: ++func_append preserve_args " $opt" + ;; +- +- --no-verbose) preserve_args="$preserve_args $opt" ++ --no-verbose) + opt_verbose=false ++func_append preserve_args " $opt" + ;; +- +- --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break +- preserve_args="$preserve_args $opt $1" +- func_enable_tag "$1" # tagname is set here ++ --silent|--quiet) ++ opt_silent=: ++func_append preserve_args " $opt" ++ opt_verbose=false ++ ;; ++ --verbose|-v) ++ opt_verbose=: ++func_append preserve_args " $opt" ++opt_silent=false ++ ;; ++ --tag) ++ test $# = 0 && func_missing_arg $opt && break ++ optarg="$1" ++ opt_tag="$optarg" ++func_append preserve_args " $opt $optarg" ++func_enable_tag "$optarg" + shift + ;; + ++ -\?|-h) func_usage ;; ++ --help) func_help ;; ++ --version) func_version ;; ++ + # Separate optargs to long options: +- -dlopen=*|--mode=*|--tag=*) +- func_opt_split "$opt" +- set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} ++ --*=*) ++ func_split_long_opt "$opt" ++ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + +- -\?|-h) func_usage ;; +- --help) opt_help=: ;; +- --help-all) opt_help=': help-all' ;; +- --version) func_version ;; +- +- -*) func_fatal_help "unrecognized option \`$opt'" ;; +- +- *) nonopt="$opt" +- break ++ # Separate non-argument short options: ++ -\?*|-h*|-n*|-v*) ++ func_split_short_opt "$opt" ++ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} ++ shift + ;; ++ ++ --) break ;; ++ -*) func_fatal_help "unrecognized option \`$opt'" ;; ++ *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + ++ # Validate options: ++ ++ # save first non-option argument ++ if test "$#" -gt 0; then ++ nonopt="$opt" ++ shift ++ fi ++ ++ # preserve --debug ++ test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) +@@ -981,82 +1184,44 @@ + opt_duplicate_compiler_generated_deps=: + ;; + *) +- opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ++ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + +- # Having warned about all mis-specified options, bail out if +- # anything was wrong. +- $exit_cmd $EXIT_FAILURE +-} ++ $opt_help || { ++ # Sanity checks first: ++ func_check_version_match + +-# func_check_version_match +-# Ensure that we are using m4 macros, and libtool script from the same +-# release of libtool. +-func_check_version_match () +-{ +- if test "$package_revision" != "$macro_revision"; then +- if test "$VERSION" != "$macro_version"; then +- if test -z "$macro_version"; then +- cat >&2 <<_LT_EOF +-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +-$progname: definition of this LT_INIT comes from an older release. +-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +-$progname: and run autoconf again. +-_LT_EOF +- else +- cat >&2 <<_LT_EOF +-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +-$progname: and run autoconf again. +-_LT_EOF +- fi +- else +- cat >&2 <<_LT_EOF +-$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +-$progname: but the definition of this LT_INIT comes from revision $macro_revision. +-$progname: You should recreate aclocal.m4 with macros from revision $package_revision +-$progname: of $PACKAGE $VERSION and run autoconf again. +-_LT_EOF ++ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then ++ func_fatal_configuration "not configured to build any kind of library" + fi + +- exit $EXIT_MISMATCH +- fi +-} +- ++ # Darwin sucks ++ eval std_shrext=\"$shrext_cmds\" + +-## ----------- ## +-## Main. ## +-## ----------- ## +- +-$opt_help || { +- # Sanity checks first: +- func_check_version_match +- +- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then +- func_fatal_configuration "not configured to build any kind of library" +- fi ++ # Only execute mode is allowed to have -dlopen flags. ++ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then ++ func_error "unrecognized option \`-dlopen'" ++ $ECHO "$help" 1>&2 ++ exit $EXIT_FAILURE ++ fi + +- test -z "$mode" && func_fatal_error "error: you must specify a MODE." ++ # Change the help message to a mode-specific one. ++ generic_help="$help" ++ help="Try \`$progname --help --mode=$opt_mode' for more information." ++ } + + +- # Darwin sucks +- eval "std_shrext=\"$shrext_cmds\"" ++ # Bail if the options were screwed ++ $exit_cmd $EXIT_FAILURE ++} + + +- # Only execute mode is allowed to have -dlopen flags. +- if test -n "$execute_dlfiles" && test "$mode" != execute; then +- func_error "unrecognized option \`-dlopen'" +- $ECHO "$help" 1>&2 +- exit $EXIT_FAILURE +- fi + +- # Change the help message to a mode-specific one. +- generic_help="$help" +- help="Try \`$progname --help --mode=$mode' for more information." +-} + ++## ----------- ## ++## Main. ## ++## ----------- ## + + # func_lalib_p file + # True iff FILE is a libtool `.la' library or `.lo' object file. +@@ -1121,12 +1286,9 @@ + # temporary ltwrapper_script. + func_ltwrapper_scriptname () + { +- func_ltwrapper_scriptname_result="" +- if func_ltwrapper_executable_p "$1"; then +- func_dirname_and_basename "$1" "" "." +- func_stripname '' '.exe' "$func_basename_result" +- func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +- fi ++ func_dirname_and_basename "$1" "" "." ++ func_stripname '' '.exe' "$func_basename_result" ++ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + } + + # func_ltwrapper_p file +@@ -1149,7 +1311,7 @@ + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs +- eval "cmd=\"$cmd\"" ++ eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +@@ -1172,6 +1334,37 @@ + } + + ++# func_resolve_sysroot PATH ++# Replace a leading = in PATH with a sysroot. Store the result into ++# func_resolve_sysroot_result ++func_resolve_sysroot () ++{ ++ func_resolve_sysroot_result=$1 ++ case $func_resolve_sysroot_result in ++ =*) ++ func_stripname '=' '' "$func_resolve_sysroot_result" ++ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ++ ;; ++ esac ++} ++ ++# func_replace_sysroot PATH ++# If PATH begins with the sysroot, replace it with = and ++# store the result into func_replace_sysroot_result. ++func_replace_sysroot () ++{ ++ case "$lt_sysroot:$1" in ++ ?*:"$lt_sysroot"*) ++ func_stripname "$lt_sysroot" '' "$1" ++ func_replace_sysroot_result="=$func_stripname_result" ++ ;; ++ *) ++ # Including no sysroot. ++ func_replace_sysroot_result=$1 ++ ;; ++ esac ++} ++ + # func_infer_tag arg + # Infer tagged configuration to use if any are available and + # if one wasn't chosen via the "--tag" command line option. +@@ -1184,8 +1377,7 @@ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do +- func_quote_for_eval "$arg" +- CC_quoted="$CC_quoted $func_quote_for_eval_result" ++ func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` +@@ -1204,8 +1396,7 @@ + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. +- func_quote_for_eval "$arg" +- CC_quoted="$CC_quoted $func_quote_for_eval_result" ++ func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` +@@ -1274,6 +1465,486 @@ + } + } + ++ ++################################################## ++# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # ++################################################## ++ ++# func_convert_core_file_wine_to_w32 ARG ++# Helper function used by file name conversion functions when $build is *nix, ++# and $host is mingw, cygwin, or some other w32 environment. Relies on a ++# correctly configured wine environment available, with the winepath program ++# in $build's $PATH. ++# ++# ARG is the $build file name to be converted to w32 format. ++# Result is available in $func_convert_core_file_wine_to_w32_result, and will ++# be empty on error (or when ARG is empty) ++func_convert_core_file_wine_to_w32 () ++{ ++ $opt_debug ++ func_convert_core_file_wine_to_w32_result="$1" ++ if test -n "$1"; then ++ # Unfortunately, winepath does not exit with a non-zero error code, so we ++ # are forced to check the contents of stdout. On the other hand, if the ++ # command is not found, the shell will set an exit code of 127 and print ++ # *an error message* to stdout. So we must check for both error code of ++ # zero AND non-empty stdout, which explains the odd construction: ++ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` ++ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then ++ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | ++ $SED -e "$lt_sed_naive_backslashify"` ++ else ++ func_convert_core_file_wine_to_w32_result= ++ fi ++ fi ++} ++# end: func_convert_core_file_wine_to_w32 ++ ++ ++# func_convert_core_path_wine_to_w32 ARG ++# Helper function used by path conversion functions when $build is *nix, and ++# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly ++# configured wine environment available, with the winepath program in $build's ++# $PATH. Assumes ARG has no leading or trailing path separator characters. ++# ++# ARG is path to be converted from $build format to win32. ++# Result is available in $func_convert_core_path_wine_to_w32_result. ++# Unconvertible file (directory) names in ARG are skipped; if no directory names ++# are convertible, then the result may be empty. ++func_convert_core_path_wine_to_w32 () ++{ ++ $opt_debug ++ # unfortunately, winepath doesn't convert paths, only file names ++ func_convert_core_path_wine_to_w32_result="" ++ if test -n "$1"; then ++ oldIFS=$IFS ++ IFS=: ++ for func_convert_core_path_wine_to_w32_f in $1; do ++ IFS=$oldIFS ++ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" ++ if test -n "$func_convert_core_file_wine_to_w32_result" ; then ++ if test -z "$func_convert_core_path_wine_to_w32_result"; then ++ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" ++ else ++ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" ++ fi ++ fi ++ done ++ IFS=$oldIFS ++ fi ++} ++# end: func_convert_core_path_wine_to_w32 ++ ++ ++# func_cygpath ARGS... ++# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when ++# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) ++# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or ++# (2), returns the Cygwin file name or path in func_cygpath_result (input ++# file name or path is assumed to be in w32 format, as previously converted ++# from $build's *nix or MSYS format). In case (3), returns the w32 file name ++# or path in func_cygpath_result (input file name or path is assumed to be in ++# Cygwin format). Returns an empty string on error. ++# ++# ARGS are passed to cygpath, with the last one being the file name or path to ++# be converted. ++# ++# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH ++# environment variable; do not put it in $PATH. ++func_cygpath () ++{ ++ $opt_debug ++ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then ++ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` ++ if test "$?" -ne 0; then ++ # on failure, ensure result is empty ++ func_cygpath_result= ++ fi ++ else ++ func_cygpath_result= ++ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" ++ fi ++} ++#end: func_cygpath ++ ++ ++# func_convert_core_msys_to_w32 ARG ++# Convert file name or path ARG from MSYS format to w32 format. Return ++# result in func_convert_core_msys_to_w32_result. ++func_convert_core_msys_to_w32 () ++{ ++ $opt_debug ++ # awkward: cmd appends spaces to result ++ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | ++ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` ++} ++#end: func_convert_core_msys_to_w32 ++ ++ ++# func_convert_file_check ARG1 ARG2 ++# Verify that ARG1 (a file name in $build format) was converted to $host ++# format in ARG2. Otherwise, emit an error message, but continue (resetting ++# func_to_host_file_result to ARG1). ++func_convert_file_check () ++{ ++ $opt_debug ++ if test -z "$2" && test -n "$1" ; then ++ func_error "Could not determine host file name corresponding to" ++ func_error " \`$1'" ++ func_error "Continuing, but uninstalled executables may not work." ++ # Fallback: ++ func_to_host_file_result="$1" ++ fi ++} ++# end func_convert_file_check ++ ++ ++# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH ++# Verify that FROM_PATH (a path in $build format) was converted to $host ++# format in TO_PATH. Otherwise, emit an error message, but continue, resetting ++# func_to_host_file_result to a simplistic fallback value (see below). ++func_convert_path_check () ++{ ++ $opt_debug ++ if test -z "$4" && test -n "$3"; then ++ func_error "Could not determine the host path corresponding to" ++ func_error " \`$3'" ++ func_error "Continuing, but uninstalled executables may not work." ++ # Fallback. This is a deliberately simplistic "conversion" and ++ # should not be "improved". See libtool.info. ++ if test "x$1" != "x$2"; then ++ lt_replace_pathsep_chars="s|$1|$2|g" ++ func_to_host_path_result=`echo "$3" | ++ $SED -e "$lt_replace_pathsep_chars"` ++ else ++ func_to_host_path_result="$3" ++ fi ++ fi ++} ++# end func_convert_path_check ++ ++ ++# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG ++# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT ++# and appending REPL if ORIG matches BACKPAT. ++func_convert_path_front_back_pathsep () ++{ ++ $opt_debug ++ case $4 in ++ $1 ) func_to_host_path_result="$3$func_to_host_path_result" ++ ;; ++ esac ++ case $4 in ++ $2 ) func_append func_to_host_path_result "$3" ++ ;; ++ esac ++} ++# end func_convert_path_front_back_pathsep ++ ++ ++################################################## ++# $build to $host FILE NAME CONVERSION FUNCTIONS # ++################################################## ++# invoked via `$to_host_file_cmd ARG' ++# ++# In each case, ARG is the path to be converted from $build to $host format. ++# Result will be available in $func_to_host_file_result. ++ ++ ++# func_to_host_file ARG ++# Converts the file name ARG from $build format to $host format. Return result ++# in func_to_host_file_result. ++func_to_host_file () ++{ ++ $opt_debug ++ $to_host_file_cmd "$1" ++} ++# end func_to_host_file ++ ++ ++# func_to_tool_file ARG LAZY ++# converts the file name ARG from $build format to toolchain format. Return ++# result in func_to_tool_file_result. If the conversion in use is listed ++# in (the comma separated) LAZY, no conversion takes place. ++func_to_tool_file () ++{ ++ $opt_debug ++ case ,$2, in ++ *,"$to_tool_file_cmd",*) ++ func_to_tool_file_result=$1 ++ ;; ++ *) ++ $to_tool_file_cmd "$1" ++ func_to_tool_file_result=$func_to_host_file_result ++ ;; ++ esac ++} ++# end func_to_tool_file ++ ++ ++# func_convert_file_noop ARG ++# Copy ARG to func_to_host_file_result. ++func_convert_file_noop () ++{ ++ func_to_host_file_result="$1" ++} ++# end func_convert_file_noop ++ ++ ++# func_convert_file_msys_to_w32 ARG ++# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic ++# conversion to w32 is not available inside the cwrapper. Returns result in ++# func_to_host_file_result. ++func_convert_file_msys_to_w32 () ++{ ++ $opt_debug ++ func_to_host_file_result="$1" ++ if test -n "$1"; then ++ func_convert_core_msys_to_w32 "$1" ++ func_to_host_file_result="$func_convert_core_msys_to_w32_result" ++ fi ++ func_convert_file_check "$1" "$func_to_host_file_result" ++} ++# end func_convert_file_msys_to_w32 ++ ++ ++# func_convert_file_cygwin_to_w32 ARG ++# Convert file name ARG from Cygwin to w32 format. Returns result in ++# func_to_host_file_result. ++func_convert_file_cygwin_to_w32 () ++{ ++ $opt_debug ++ func_to_host_file_result="$1" ++ if test -n "$1"; then ++ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use ++ # LT_CYGPATH in this case. ++ func_to_host_file_result=`cygpath -m "$1"` ++ fi ++ func_convert_file_check "$1" "$func_to_host_file_result" ++} ++# end func_convert_file_cygwin_to_w32 ++ ++ ++# func_convert_file_nix_to_w32 ARG ++# Convert file name ARG from *nix to w32 format. Requires a wine environment ++# and a working winepath. Returns result in func_to_host_file_result. ++func_convert_file_nix_to_w32 () ++{ ++ $opt_debug ++ func_to_host_file_result="$1" ++ if test -n "$1"; then ++ func_convert_core_file_wine_to_w32 "$1" ++ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" ++ fi ++ func_convert_file_check "$1" "$func_to_host_file_result" ++} ++# end func_convert_file_nix_to_w32 ++ ++ ++# func_convert_file_msys_to_cygwin ARG ++# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. ++# Returns result in func_to_host_file_result. ++func_convert_file_msys_to_cygwin () ++{ ++ $opt_debug ++ func_to_host_file_result="$1" ++ if test -n "$1"; then ++ func_convert_core_msys_to_w32 "$1" ++ func_cygpath -u "$func_convert_core_msys_to_w32_result" ++ func_to_host_file_result="$func_cygpath_result" ++ fi ++ func_convert_file_check "$1" "$func_to_host_file_result" ++} ++# end func_convert_file_msys_to_cygwin ++ ++ ++# func_convert_file_nix_to_cygwin ARG ++# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed ++# in a wine environment, working winepath, and LT_CYGPATH set. Returns result ++# in func_to_host_file_result. ++func_convert_file_nix_to_cygwin () ++{ ++ $opt_debug ++ func_to_host_file_result="$1" ++ if test -n "$1"; then ++ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. ++ func_convert_core_file_wine_to_w32 "$1" ++ func_cygpath -u "$func_convert_core_file_wine_to_w32_result" ++ func_to_host_file_result="$func_cygpath_result" ++ fi ++ func_convert_file_check "$1" "$func_to_host_file_result" ++} ++# end func_convert_file_nix_to_cygwin ++ ++ ++############################################# ++# $build to $host PATH CONVERSION FUNCTIONS # ++############################################# ++# invoked via `$to_host_path_cmd ARG' ++# ++# In each case, ARG is the path to be converted from $build to $host format. ++# The result will be available in $func_to_host_path_result. ++# ++# Path separators are also converted from $build format to $host format. If ++# ARG begins or ends with a path separator character, it is preserved (but ++# converted to $host format) on output. ++# ++# All path conversion functions are named using the following convention: ++# file name conversion function : func_convert_file_X_to_Y () ++# path conversion function : func_convert_path_X_to_Y () ++# where, for any given $build/$host combination the 'X_to_Y' value is the ++# same. If conversion functions are added for new $build/$host combinations, ++# the two new functions must follow this pattern, or func_init_to_host_path_cmd ++# will break. ++ ++ ++# func_init_to_host_path_cmd ++# Ensures that function "pointer" variable $to_host_path_cmd is set to the ++# appropriate value, based on the value of $to_host_file_cmd. ++to_host_path_cmd= ++func_init_to_host_path_cmd () ++{ ++ $opt_debug ++ if test -z "$to_host_path_cmd"; then ++ func_stripname 'func_convert_file_' '' "$to_host_file_cmd" ++ to_host_path_cmd="func_convert_path_${func_stripname_result}" ++ fi ++} ++ ++ ++# func_to_host_path ARG ++# Converts the path ARG from $build format to $host format. Return result ++# in func_to_host_path_result. ++func_to_host_path () ++{ ++ $opt_debug ++ func_init_to_host_path_cmd ++ $to_host_path_cmd "$1" ++} ++# end func_to_host_path ++ ++ ++# func_convert_path_noop ARG ++# Copy ARG to func_to_host_path_result. ++func_convert_path_noop () ++{ ++ func_to_host_path_result="$1" ++} ++# end func_convert_path_noop ++ ++ ++# func_convert_path_msys_to_w32 ARG ++# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic ++# conversion to w32 is not available inside the cwrapper. Returns result in ++# func_to_host_path_result. ++func_convert_path_msys_to_w32 () ++{ ++ $opt_debug ++ func_to_host_path_result="$1" ++ if test -n "$1"; then ++ # Remove leading and trailing path separator characters from ARG. MSYS ++ # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; ++ # and winepath ignores them completely. ++ func_stripname : : "$1" ++ func_to_host_path_tmp1=$func_stripname_result ++ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" ++ func_to_host_path_result="$func_convert_core_msys_to_w32_result" ++ func_convert_path_check : ";" \ ++ "$func_to_host_path_tmp1" "$func_to_host_path_result" ++ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" ++ fi ++} ++# end func_convert_path_msys_to_w32 ++ ++ ++# func_convert_path_cygwin_to_w32 ARG ++# Convert path ARG from Cygwin to w32 format. Returns result in ++# func_to_host_file_result. ++func_convert_path_cygwin_to_w32 () ++{ ++ $opt_debug ++ func_to_host_path_result="$1" ++ if test -n "$1"; then ++ # See func_convert_path_msys_to_w32: ++ func_stripname : : "$1" ++ func_to_host_path_tmp1=$func_stripname_result ++ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` ++ func_convert_path_check : ";" \ ++ "$func_to_host_path_tmp1" "$func_to_host_path_result" ++ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" ++ fi ++} ++# end func_convert_path_cygwin_to_w32 ++ ++ ++# func_convert_path_nix_to_w32 ARG ++# Convert path ARG from *nix to w32 format. Requires a wine environment and ++# a working winepath. Returns result in func_to_host_file_result. ++func_convert_path_nix_to_w32 () ++{ ++ $opt_debug ++ func_to_host_path_result="$1" ++ if test -n "$1"; then ++ # See func_convert_path_msys_to_w32: ++ func_stripname : : "$1" ++ func_to_host_path_tmp1=$func_stripname_result ++ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" ++ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" ++ func_convert_path_check : ";" \ ++ "$func_to_host_path_tmp1" "$func_to_host_path_result" ++ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" ++ fi ++} ++# end func_convert_path_nix_to_w32 ++ ++ ++# func_convert_path_msys_to_cygwin ARG ++# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. ++# Returns result in func_to_host_file_result. ++func_convert_path_msys_to_cygwin () ++{ ++ $opt_debug ++ func_to_host_path_result="$1" ++ if test -n "$1"; then ++ # See func_convert_path_msys_to_w32: ++ func_stripname : : "$1" ++ func_to_host_path_tmp1=$func_stripname_result ++ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" ++ func_cygpath -u -p "$func_convert_core_msys_to_w32_result" ++ func_to_host_path_result="$func_cygpath_result" ++ func_convert_path_check : : \ ++ "$func_to_host_path_tmp1" "$func_to_host_path_result" ++ func_convert_path_front_back_pathsep ":*" "*:" : "$1" ++ fi ++} ++# end func_convert_path_msys_to_cygwin ++ ++ ++# func_convert_path_nix_to_cygwin ARG ++# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a ++# a wine environment, working winepath, and LT_CYGPATH set. Returns result in ++# func_to_host_file_result. ++func_convert_path_nix_to_cygwin () ++{ ++ $opt_debug ++ func_to_host_path_result="$1" ++ if test -n "$1"; then ++ # Remove leading and trailing path separator characters from ++ # ARG. msys behavior is inconsistent here, cygpath turns them ++ # into '.;' and ';.', and winepath ignores them completely. ++ func_stripname : : "$1" ++ func_to_host_path_tmp1=$func_stripname_result ++ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" ++ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" ++ func_to_host_path_result="$func_cygpath_result" ++ func_convert_path_check : : \ ++ "$func_to_host_path_tmp1" "$func_to_host_path_result" ++ func_convert_path_front_back_pathsep ":*" "*:" : "$1" ++ fi ++} ++# end func_convert_path_nix_to_cygwin ++ ++ + # func_mode_compile arg... + func_mode_compile () + { +@@ -1314,12 +1985,12 @@ + ;; + + -pie | -fpie | -fPIE) +- pie_flag="$pie_flag $arg" ++ func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) +- later="$later $arg" ++ func_append later " $arg" + continue + ;; + +@@ -1340,15 +2011,14 @@ + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" +- func_quote_for_eval "$arg" +- lastarg="$lastarg $func_quote_for_eval_result" ++ func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. +- base_compile="$base_compile $lastarg" ++ func_append base_compile " $lastarg" + continue + ;; + +@@ -1364,8 +2034,7 @@ + esac # case $arg_mode + + # Aesthetically quote the previous argument. +- func_quote_for_eval "$lastarg" +- base_compile="$base_compile $func_quote_for_eval_result" ++ func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in +@@ -1496,17 +2165,16 @@ + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi +- removelist="$removelist $output_obj" ++ func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist +- removelist="$removelist $lockfile" ++ func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + +- if test -n "$fix_srcfile_path"; then +- eval "srcfile=\"$fix_srcfile_path\"" +- fi ++ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 ++ srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + +@@ -1526,7 +2194,7 @@ + + if test -z "$output_obj"; then + # Place PIC objects in $objdir +- command="$command -o $lobj" ++ func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ +@@ -1573,11 +2241,11 @@ + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then +- command="$command -o $obj" ++ func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. +- command="$command$suppress_output" ++ func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + +@@ -1622,13 +2290,13 @@ + } + + $opt_help || { +- test "$mode" = compile && func_mode_compile ${1+"$@"} ++ test "$opt_mode" = compile && func_mode_compile ${1+"$@"} + } + + func_mode_help () + { + # We need to display help for each of the modes. +- case $mode in ++ case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. +@@ -1659,8 +2327,8 @@ + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes +- -prefer-pic try to building PIC objects only +- -prefer-non-pic try to building non-PIC objects only ++ -prefer-pic try to build PIC objects only ++ -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler +@@ -1804,7 +2472,7 @@ + ;; + + *) +- func_fatal_help "invalid operation mode \`$mode'" ++ func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + +@@ -1819,13 +2487,13 @@ + else + { + func_help noexit +- for mode in compile link execute install finish uninstall clean; do ++ for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit +- for mode in compile link execute install finish uninstall clean; do ++ for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done +@@ -1854,13 +2522,16 @@ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. +- for file in $execute_dlfiles; do ++ for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) ++ func_resolve_sysroot "$file" ++ file=$func_resolve_sysroot_result ++ + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" +@@ -1882,7 +2553,7 @@ + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then +- dir="$dir/$objdir" ++ func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" +@@ -1907,10 +2578,10 @@ + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. +- if eval test -z \"\$$shlibpath_var\"; then +- eval $shlibpath_var=\$dir ++ if eval "test -z \"\$$shlibpath_var\""; then ++ eval "$shlibpath_var=\"\$dir\"" + else +- eval $shlibpath_var=\$dir:\$$shlibpath_var ++ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + +@@ -1939,8 +2610,7 @@ + ;; + esac + # Quote arguments (to preserve shell metacharacters). +- func_quote_for_eval "$file" +- args="$args $func_quote_for_eval_result" ++ func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then +@@ -1972,22 +2642,59 @@ + fi + } + +-test "$mode" = execute && func_mode_execute ${1+"$@"} ++test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + + # func_mode_finish arg... + func_mode_finish () + { + $opt_debug +- libdirs="$nonopt" ++ libs= ++ libdirs= + admincmds= + +- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then +- for dir +- do +- libdirs="$libdirs $dir" +- done ++ for opt in "$nonopt" ${1+"$@"} ++ do ++ if test -d "$opt"; then ++ func_append libdirs " $opt" ++ ++ elif test -f "$opt"; then ++ if func_lalib_unsafe_p "$opt"; then ++ func_append libs " $opt" ++ else ++ func_warning "\`$opt' is not a valid libtool archive" ++ fi ++ ++ else ++ func_fatal_error "invalid argument \`$opt'" ++ fi ++ done ++ ++ if test -n "$libs"; then ++ if test -n "$lt_sysroot"; then ++ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` ++ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" ++ else ++ sysroot_cmd= ++ fi ++ ++ # Remove sysroot references ++ if $opt_dry_run; then ++ for lib in $libs; do ++ echo "removing references to $lt_sysroot and \`=' prefixes from $lib" ++ done ++ else ++ tmpdir=`func_mktempdir` ++ for lib in $libs; do ++ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ ++ > $tmpdir/tmp-la ++ mv -f $tmpdir/tmp-la $lib ++ done ++ ${RM}r "$tmpdir" ++ fi ++ fi + ++ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. +@@ -1997,7 +2704,7 @@ + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" +- $opt_dry_run || eval "$cmds" || admincmds="$admincmds ++ $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done +@@ -2006,53 +2713,55 @@ + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + +- echo "----------------------------------------------------------------------" +- echo "Libraries have been installed in:" +- for libdir in $libdirs; do +- $ECHO " $libdir" +- done +- echo +- echo "If you ever happen to want to link against installed libraries" +- echo "in a given directory, LIBDIR, you must either use libtool, and" +- echo "specify the full pathname of the library, or use the \`-LLIBDIR'" +- echo "flag during linking and do at least one of the following:" +- if test -n "$shlibpath_var"; then +- echo " - add LIBDIR to the \`$shlibpath_var' environment variable" +- echo " during execution" +- fi +- if test -n "$runpath_var"; then +- echo " - add LIBDIR to the \`$runpath_var' environment variable" +- echo " during linking" +- fi +- if test -n "$hardcode_libdir_flag_spec"; then +- libdir=LIBDIR +- eval "flag=\"$hardcode_libdir_flag_spec\"" ++ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then ++ echo "----------------------------------------------------------------------" ++ echo "Libraries have been installed in:" ++ for libdir in $libdirs; do ++ $ECHO " $libdir" ++ done ++ echo ++ echo "If you ever happen to want to link against installed libraries" ++ echo "in a given directory, LIBDIR, you must either use libtool, and" ++ echo "specify the full pathname of the library, or use the \`-LLIBDIR'" ++ echo "flag during linking and do at least one of the following:" ++ if test -n "$shlibpath_var"; then ++ echo " - add LIBDIR to the \`$shlibpath_var' environment variable" ++ echo " during execution" ++ fi ++ if test -n "$runpath_var"; then ++ echo " - add LIBDIR to the \`$runpath_var' environment variable" ++ echo " during linking" ++ fi ++ if test -n "$hardcode_libdir_flag_spec"; then ++ libdir=LIBDIR ++ eval flag=\"$hardcode_libdir_flag_spec\" + +- $ECHO " - use the \`$flag' linker flag" +- fi +- if test -n "$admincmds"; then +- $ECHO " - have your system administrator run these commands:$admincmds" +- fi +- if test -f /etc/ld.so.conf; then +- echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" +- fi +- echo ++ $ECHO " - use the \`$flag' linker flag" ++ fi ++ if test -n "$admincmds"; then ++ $ECHO " - have your system administrator run these commands:$admincmds" ++ fi ++ if test -f /etc/ld.so.conf; then ++ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" ++ fi ++ echo + +- echo "See any operating system documentation about shared libraries for" +- case $host in +- solaris2.[6789]|solaris2.1[0-9]) +- echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" +- echo "pages." +- ;; +- *) +- echo "more information, such as the ld(1) and ld.so(8) manual pages." +- ;; +- esac +- echo "----------------------------------------------------------------------" ++ echo "See any operating system documentation about shared libraries for" ++ case $host in ++ solaris2.[6789]|solaris2.1[0-9]) ++ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" ++ echo "pages." ++ ;; ++ *) ++ echo "more information, such as the ld(1) and ld.so(8) manual pages." ++ ;; ++ esac ++ echo "----------------------------------------------------------------------" ++ fi + exit $EXIT_SUCCESS + } + +-test "$mode" = finish && func_mode_finish ${1+"$@"} ++test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + + # func_mode_install arg... +@@ -2077,7 +2786,7 @@ + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" +- install_prog="$install_prog$func_quote_for_eval_result" ++ func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; +@@ -2097,7 +2806,7 @@ + do + arg2= + if test -n "$dest"; then +- files="$files $dest" ++ func_append files " $dest" + dest=$arg + continue + fi +@@ -2135,11 +2844,11 @@ + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" +- install_prog="$install_prog $func_quote_for_eval_result" ++ func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi +- install_shared_prog="$install_shared_prog $func_quote_for_eval_result" ++ func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ +@@ -2151,7 +2860,7 @@ + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" +- install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" ++ func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + +@@ -2209,10 +2918,13 @@ + case $file in + *.$libext) + # Do the static libraries later. +- staticlibs="$staticlibs $file" ++ func_append staticlibs " $file" + ;; + + *.la) ++ func_resolve_sysroot "$file" ++ file=$func_resolve_sysroot_result ++ + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" +@@ -2226,23 +2938,30 @@ + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; +- *) current_libdirs="$current_libdirs $libdir" ;; ++ *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; +- *) future_libdirs="$future_libdirs $libdir" ;; ++ *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" +- dir="$dir$objdir" ++ func_append dir "$objdir" + + if test -n "$relink_command"; then ++ # Strip any trailing slash from the destination. ++ func_stripname '' '/' "$libdir" ++ destlibdir=$func_stripname_result ++ ++ func_stripname '' '/' "$destdir" ++ s_destdir=$func_stripname_result ++ + # Determine the prefix the user has applied to our future dir. +- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` ++ inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that +@@ -2315,7 +3034,7 @@ + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. +- test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ++ test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) +@@ -2503,7 +3222,7 @@ + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + +- if test -n "$current_libdirs" && $opt_finish; then ++ if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' +@@ -2512,7 +3231,7 @@ + fi + } + +-test "$mode" = install && func_mode_install ${1+"$@"} ++test "$opt_mode" = install && func_mode_install ${1+"$@"} + + + # func_generate_dlsyms outputname originator pic_p +@@ -2559,6 +3278,18 @@ + #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" + #endif + ++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ ++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) ++/* DATA imports from DLLs on WIN32 con't be const, because runtime ++ relocations are performed -- see ld's documentation on pseudo-relocs. */ ++# define LT_DLSYM_CONST ++#elif defined(__osf__) ++/* This system does not cope well with relocations in const data. */ ++# define LT_DLSYM_CONST ++#else ++# define LT_DLSYM_CONST const ++#endif ++ + /* External symbol declarations for the compiler. */\ + " + +@@ -2570,21 +3301,22 @@ + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do +- func_verbose "extracting global C symbols from \`$progfile'" +- $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" ++ func_to_tool_file "$progfile" func_convert_file_msys_to_w32 ++ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" ++ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { +- $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T +- $MV "$nlist"T "$nlist" ++ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' ++ eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { +- $EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T +- $MV "$nlist"T "$nlist" ++ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' ++ eval '$MV "$nlist"T "$nlist"' + } + fi + +@@ -2593,23 +3325,23 @@ + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols +- ${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' < "$nlist" > "$export_symbols" ++ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) +- echo EXPORTS > "$output_objdir/$outputname.def" +- cat "$export_symbols" >> "$output_objdir/$outputname.def" ++ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' ++ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { +- ${SED} -e 's/\([].[*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/' < "$export_symbols" > "$output_objdir/$outputname.exp" +- $GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T +- $MV "$nlist"T "$nlist" ++ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' ++ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' ++ eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) +- echo EXPORTS > "$output_objdir/$outputname.def" +- cat "$nlist" >> "$output_objdir/$outputname.def" ++ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' ++ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } +@@ -2620,10 +3352,52 @@ + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" +- $opt_dry_run || { +- $ECHO ": $name " >> "$nlist" +- eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" +- } ++ case $host in ++ *cygwin* | *mingw* | *cegcc* ) ++ # if an import library, we need to obtain dlname ++ if func_win32_import_lib_p "$dlprefile"; then ++ func_tr_sh "$dlprefile" ++ eval "curr_lafile=\$libfile_$func_tr_sh_result" ++ dlprefile_dlbasename="" ++ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then ++ # Use subshell, to avoid clobbering current variable values ++ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` ++ if test -n "$dlprefile_dlname" ; then ++ func_basename "$dlprefile_dlname" ++ dlprefile_dlbasename="$func_basename_result" ++ else ++ # no lafile. user explicitly requested -dlpreopen . ++ $sharedlib_from_linklib_cmd "$dlprefile" ++ dlprefile_dlbasename=$sharedlib_from_linklib_result ++ fi ++ fi ++ $opt_dry_run || { ++ if test -n "$dlprefile_dlbasename" ; then ++ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' ++ else ++ func_warning "Could not compute DLL name from $name" ++ eval '$ECHO ": $name " >> "$nlist"' ++ fi ++ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 ++ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | ++ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" ++ } ++ else # not an import lib ++ $opt_dry_run || { ++ eval '$ECHO ": $name " >> "$nlist"' ++ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 ++ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" ++ } ++ fi ++ ;; ++ *) ++ $opt_dry_run || { ++ eval '$ECHO ": $name " >> "$nlist"' ++ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 ++ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" ++ } ++ ;; ++ esac + done + + $opt_dry_run || { +@@ -2661,26 +3435,9 @@ + const char *name; + void *address; + } lt_dlsymlist; +-" +- case $host in +- *cygwin* | *mingw* | *cegcc* ) +- echo >> "$output_objdir/$my_dlsyms" "\ +-/* DATA imports from DLLs on WIN32 con't be const, because +- runtime relocations are performed -- see ld's documentation +- on pseudo-relocs. */" +- lt_dlsym_const= ;; +- *osf5*) +- echo >> "$output_objdir/$my_dlsyms" "\ +-/* This system does not cope well with relocations in const data */" +- lt_dlsym_const= ;; +- *) +- lt_dlsym_const=const ;; +- esac +- +- echo >> "$output_objdir/$my_dlsyms" "\ +-extern $lt_dlsym_const lt_dlsymlist ++extern LT_DLSYM_CONST lt_dlsymlist + lt_${my_prefix}_LTX_preloaded_symbols[]; +-$lt_dlsym_const lt_dlsymlist ++LT_DLSYM_CONST lt_dlsymlist + lt_${my_prefix}_LTX_preloaded_symbols[] = + {\ + { \"$my_originator\", (void *) 0 }," +@@ -2736,7 +3493,7 @@ + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; +- *) symtab_cflags="$symtab_cflags $arg" ;; ++ *) func_append symtab_cflags " $arg" ;; + esac + done + +@@ -2796,9 +3553,11 @@ + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static +- if $OBJDUMP -f "$1" | $SED -e '10q' 2>/dev/null | +- $EGREP 'file format (pe-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then +- win32_nmres=`$NM -f posix -A "$1" | ++ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. ++ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | ++ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then ++ func_to_tool_file "$1" func_convert_file_msys_to_w32 ++ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ +@@ -2827,6 +3586,131 @@ + $ECHO "$win32_libid_type" + } + ++# func_cygming_dll_for_implib ARG ++# ++# Platform-specific function to extract the ++# name of the DLL associated with the specified ++# import library ARG. ++# Invoked by eval'ing the libtool variable ++# $sharedlib_from_linklib_cmd ++# Result is available in the variable ++# $sharedlib_from_linklib_result ++func_cygming_dll_for_implib () ++{ ++ $opt_debug ++ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` ++} ++ ++# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs ++# ++# The is the core of a fallback implementation of a ++# platform-specific function to extract the name of the ++# DLL associated with the specified import library LIBNAME. ++# ++# SECTION_NAME is either .idata$6 or .idata$7, depending ++# on the platform and compiler that created the implib. ++# ++# Echos the name of the DLL associated with the ++# specified import library. ++func_cygming_dll_for_implib_fallback_core () ++{ ++ $opt_debug ++ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` ++ $OBJDUMP -s --section "$1" "$2" 2>/dev/null | ++ $SED '/^Contents of section '"$match_literal"':/{ ++ # Place marker at beginning of archive member dllname section ++ s/.*/====MARK====/ ++ p ++ d ++ } ++ # These lines can sometimes be longer than 43 characters, but ++ # are always uninteresting ++ /:[ ]*file format pe[i]\{,1\}-/d ++ /^In archive [^:]*:/d ++ # Ensure marker is printed ++ /^====MARK====/p ++ # Remove all lines with less than 43 characters ++ /^.\{43\}/!d ++ # From remaining lines, remove first 43 characters ++ s/^.\{43\}//' | ++ $SED -n ' ++ # Join marker and all lines until next marker into a single line ++ /^====MARK====/ b para ++ H ++ $ b para ++ b ++ :para ++ x ++ s/\n//g ++ # Remove the marker ++ s/^====MARK====// ++ # Remove trailing dots and whitespace ++ s/[\. \t]*$// ++ # Print ++ /./p' | ++ # we now have a list, one entry per line, of the stringified ++ # contents of the appropriate section of all members of the ++ # archive which possess that section. Heuristic: eliminate ++ # all those which have a first or second character that is ++ # a '.' (that is, objdump's representation of an unprintable ++ # character.) This should work for all archives with less than ++ # 0x302f exports -- but will fail for DLLs whose name actually ++ # begins with a literal '.' or a single character followed by ++ # a '.'. ++ # ++ # Of those that remain, print the first one. ++ $SED -e '/^\./d;/^.\./d;q' ++} ++ ++# func_cygming_gnu_implib_p ARG ++# This predicate returns with zero status (TRUE) if ++# ARG is a GNU/binutils-style import library. Returns ++# with nonzero status (FALSE) otherwise. ++func_cygming_gnu_implib_p () ++{ ++ $opt_debug ++ func_to_tool_file "$1" func_convert_file_msys_to_w32 ++ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` ++ test -n "$func_cygming_gnu_implib_tmp" ++} ++ ++# func_cygming_ms_implib_p ARG ++# This predicate returns with zero status (TRUE) if ++# ARG is an MS-style import library. Returns ++# with nonzero status (FALSE) otherwise. ++func_cygming_ms_implib_p () ++{ ++ $opt_debug ++ func_to_tool_file "$1" func_convert_file_msys_to_w32 ++ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` ++ test -n "$func_cygming_ms_implib_tmp" ++} ++ ++# func_cygming_dll_for_implib_fallback ARG ++# Platform-specific function to extract the ++# name of the DLL associated with the specified ++# import library ARG. ++# ++# This fallback implementation is for use when $DLLTOOL ++# does not support the --identify-strict option. ++# Invoked by eval'ing the libtool variable ++# $sharedlib_from_linklib_cmd ++# Result is available in the variable ++# $sharedlib_from_linklib_result ++func_cygming_dll_for_implib_fallback () ++{ ++ $opt_debug ++ if func_cygming_gnu_implib_p "$1" ; then ++ # binutils import library ++ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` ++ elif func_cygming_ms_implib_p "$1" ; then ++ # ms-generated import library ++ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` ++ else ++ # unknown ++ sharedlib_from_linklib_result="" ++ fi ++} + + + # func_extract_an_archive dir oldlib +@@ -2917,7 +3801,7 @@ + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do +- darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` ++ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ +@@ -2932,7 +3816,7 @@ + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac +- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` ++ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +@@ -3014,7 +3898,110 @@ + _LTECHO_EOF' + } + ECHO=\"$qECHO\" +- fi\ ++ fi ++ ++# Very basic option parsing. These options are (a) specific to ++# the libtool wrapper, (b) are identical between the wrapper ++# /script/ and the wrapper /executable/ which is used only on ++# windows platforms, and (c) all begin with the string "--lt-" ++# (application programs are unlikely to have options which match ++# this pattern). ++# ++# There are only two supported options: --lt-debug and ++# --lt-dump-script. There is, deliberately, no --lt-help. ++# ++# The first argument to this parsing function should be the ++# script's $0 value, followed by "$@". ++lt_option_debug= ++func_parse_lt_options () ++{ ++ lt_script_arg0=\$0 ++ shift ++ for lt_opt ++ do ++ case \"\$lt_opt\" in ++ --lt-debug) lt_option_debug=1 ;; ++ --lt-dump-script) ++ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` ++ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. ++ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` ++ cat \"\$lt_dump_D/\$lt_dump_F\" ++ exit 0 ++ ;; ++ --lt-*) ++ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 ++ exit 1 ++ ;; ++ esac ++ done ++ ++ # Print the debug banner immediately: ++ if test -n \"\$lt_option_debug\"; then ++ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 ++ fi ++} ++ ++# Used when --lt-debug. Prints its arguments to stdout ++# (redirection is the responsibility of the caller) ++func_lt_dump_args () ++{ ++ lt_dump_args_N=1; ++ for lt_arg ++ do ++ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" ++ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` ++ done ++} ++ ++# Core function for launching the target application ++func_exec_program_core () ++{ ++" ++ case $host in ++ # Backslashes separate directories on plain windows ++ *-*-mingw | *-*-os2* | *-cegcc*) ++ $ECHO "\ ++ if test -n \"\$lt_option_debug\"; then ++ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 ++ func_lt_dump_args \${1+\"\$@\"} 1>&2 ++ fi ++ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} ++" ++ ;; ++ ++ *) ++ $ECHO "\ ++ if test -n \"\$lt_option_debug\"; then ++ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 ++ func_lt_dump_args \${1+\"\$@\"} 1>&2 ++ fi ++ exec \"\$progdir/\$program\" \${1+\"\$@\"} ++" ++ ;; ++ esac ++ $ECHO "\ ++ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 ++ exit 1 ++} ++ ++# A function to encapsulate launching the target application ++# Strips options in the --lt-* namespace from \$@ and ++# launches target application with the remaining arguments. ++func_exec_program () ++{ ++ for lt_wr_arg ++ do ++ case \$lt_wr_arg in ++ --lt-*) ;; ++ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; ++ esac ++ shift ++ done ++ func_exec_program_core \${1+\"\$@\"} ++} ++ ++ # Parse options ++ func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` +@@ -3078,7 +4065,7 @@ + + # relink executable if necessary + if test -n \"\$relink_command\"; then +- if relink_command_output=\`eval \"\$relink_command\" 2>&1\`; then : ++ if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" +@@ -3102,6 +4089,18 @@ + + if test -f \"\$progdir/\$program\"; then" + ++ # fixup the dll searchpath if we need to. ++ # ++ # Fix the DLL searchpath if we need to. Do this before prepending ++ # to shlibpath, because on Windows, both are PATH and uninstalled ++ # libraries must come first. ++ if test -n "$dllsearchpath"; then ++ $ECHO "\ ++ # Add the dll search path components to the executable PATH ++ PATH=$dllsearchpath:\$PATH ++" ++ fi ++ + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ +@@ -3116,35 +4115,10 @@ + " + fi + +- # fixup the dll searchpath if we need to. +- if test -n "$dllsearchpath"; then +- $ECHO "\ +- # Add the dll search path components to the executable PATH +- PATH=$dllsearchpath:\$PATH +-" +- fi +- + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +-" +- case $host in +- # Backslashes separate directories on plain windows +- *-*-mingw | *-*-os2* | *-cegcc*) +- $ECHO "\ +- exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +-" +- ;; +- +- *) +- $ECHO "\ +- exec \"\$progdir/\$program\" \${1+\"\$@\"} +-" +- ;; +- esac +- $ECHO "\ +- \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 +- exit 1 ++ func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. +@@ -3158,166 +4132,6 @@ + } + + +-# func_to_host_path arg +-# +-# Convert paths to host format when used with build tools. +-# Intended for use with "native" mingw (where libtool itself +-# is running under the msys shell), or in the following cross- +-# build environments: +-# $build $host +-# mingw (msys) mingw [e.g. native] +-# cygwin mingw +-# *nix + wine mingw +-# where wine is equipped with the `winepath' executable. +-# In the native mingw case, the (msys) shell automatically +-# converts paths for any non-msys applications it launches, +-# but that facility isn't available from inside the cwrapper. +-# Similar accommodations are necessary for $host mingw and +-# $build cygwin. Calling this function does no harm for other +-# $host/$build combinations not listed above. +-# +-# ARG is the path (on $build) that should be converted to +-# the proper representation for $host. The result is stored +-# in $func_to_host_path_result. +-func_to_host_path () +-{ +- func_to_host_path_result="$1" +- if test -n "$1"; then +- case $host in +- *mingw* ) +- lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' +- case $build in +- *mingw* ) # actually, msys +- # awkward: cmd appends spaces to result +- func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | +- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +- ;; +- *cygwin* ) +- func_to_host_path_result=`cygpath -w "$1" | +- $SED -e "$lt_sed_naive_backslashify"` +- ;; +- * ) +- # Unfortunately, winepath does not exit with a non-zero +- # error code, so we are forced to check the contents of +- # stdout. On the other hand, if the command is not +- # found, the shell will set an exit code of 127 and print +- # *an error message* to stdout. So we must check for both +- # error code of zero AND non-empty stdout, which explains +- # the odd construction: +- func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` +- if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then +- func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" | +- $SED -e "$lt_sed_naive_backslashify"` +- else +- # Allow warning below. +- func_to_host_path_result= +- fi +- ;; +- esac +- if test -z "$func_to_host_path_result" ; then +- func_error "Could not determine host path corresponding to" +- func_error " \`$1'" +- func_error "Continuing, but uninstalled executables may not work." +- # Fallback: +- func_to_host_path_result="$1" +- fi +- ;; +- esac +- fi +-} +-# end: func_to_host_path +- +-# func_to_host_pathlist arg +-# +-# Convert pathlists to host format when used with build tools. +-# See func_to_host_path(), above. This function supports the +-# following $build/$host combinations (but does no harm for +-# combinations not listed here): +-# $build $host +-# mingw (msys) mingw [e.g. native] +-# cygwin mingw +-# *nix + wine mingw +-# +-# Path separators are also converted from $build format to +-# $host format. If ARG begins or ends with a path separator +-# character, it is preserved (but converted to $host format) +-# on output. +-# +-# ARG is a pathlist (on $build) that should be converted to +-# the proper representation on $host. The result is stored +-# in $func_to_host_pathlist_result. +-func_to_host_pathlist () +-{ +- func_to_host_pathlist_result="$1" +- if test -n "$1"; then +- case $host in +- *mingw* ) +- lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' +- # Remove leading and trailing path separator characters from +- # ARG. msys behavior is inconsistent here, cygpath turns them +- # into '.;' and ';.', and winepath ignores them completely. +- func_stripname : : "$1" +- func_to_host_pathlist_tmp1=$func_stripname_result +- case $build in +- *mingw* ) # Actually, msys. +- # Awkward: cmd appends spaces to result. +- func_to_host_pathlist_result=` +- ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | +- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +- ;; +- *cygwin* ) +- func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | +- $SED -e "$lt_sed_naive_backslashify"` +- ;; +- * ) +- # unfortunately, winepath doesn't convert pathlists +- func_to_host_pathlist_result="" +- func_to_host_pathlist_oldIFS=$IFS +- IFS=: +- for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do +- IFS=$func_to_host_pathlist_oldIFS +- if test -n "$func_to_host_pathlist_f" ; then +- func_to_host_path "$func_to_host_pathlist_f" +- if test -n "$func_to_host_path_result" ; then +- if test -z "$func_to_host_pathlist_result" ; then +- func_to_host_pathlist_result="$func_to_host_path_result" +- else +- func_append func_to_host_pathlist_result ";$func_to_host_path_result" +- fi +- fi +- fi +- done +- IFS=$func_to_host_pathlist_oldIFS +- ;; +- esac +- if test -z "$func_to_host_pathlist_result"; then +- func_error "Could not determine the host path(s) corresponding to" +- func_error " \`$1'" +- func_error "Continuing, but uninstalled executables may not work." +- # Fallback. This may break if $1 contains DOS-style drive +- # specifications. The fix is not to complicate the expression +- # below, but for the user to provide a working wine installation +- # with winepath so that path translation in the cross-to-mingw +- # case works properly. +- lt_replace_pathsep_nix_to_dos="s|:|;|g" +- func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ +- $SED -e "$lt_replace_pathsep_nix_to_dos"` +- fi +- # Now, add the leading and trailing path separators back +- case "$1" in +- :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" +- ;; +- esac +- case "$1" in +- *: ) func_append func_to_host_pathlist_result ";" +- ;; +- esac +- ;; +- esac +- fi +-} +-# end: func_to_host_pathlist +- + # func_emit_cwrapperexe_src + # emit the source code for a wrapper executable on stdout + # Must ONLY be called from within func_mode_link because +@@ -3334,10 +4148,6 @@ + + This wrapper executable should never be moved out of the build directory. + If it is, it will not operate correctly. +- +- Currently, it simply execs the wrapper *script* "$SHELL $output", +- but could eventually absorb all of the scripts functionality and +- exec $objdir/$outputname directly. + */ + EOF + cat <<"EOF" +@@ -3462,22 +4272,13 @@ + if (stale) { free ((void *) stale); stale = 0; } \ + } while (0) + +-#undef LTWRAPPER_DEBUGPRINTF +-#if defined LT_DEBUGWRAPPER +-# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args +-static void +-ltwrapper_debugprintf (const char *fmt, ...) +-{ +- va_list args; +- va_start (args, fmt); +- (void) vfprintf (stderr, fmt, args); +- va_end (args); +-} ++#if defined(LT_DEBUGWRAPPER) ++static int lt_debug = 1; + #else +-# define LTWRAPPER_DEBUGPRINTF(args) ++static int lt_debug = 0; + #endif + +-const char *program_name = NULL; ++const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + + void *xmalloc (size_t num); + char *xstrdup (const char *string); +@@ -3487,7 +4288,10 @@ + int make_executable (const char *path); + int check_executable (const char *path); + char *strendzap (char *str, const char *pat); +-void lt_fatal (const char *message, ...); ++void lt_debugprintf (const char *file, int line, const char *fmt, ...); ++void lt_fatal (const char *file, int line, const char *message, ...); ++static const char *nonnull (const char *s); ++static const char *nonempty (const char *s); + void lt_setenv (const char *name, const char *value); + char *lt_extend_str (const char *orig_value, const char *add, int to_end); + void lt_update_exe_path (const char *name, const char *value); +@@ -3497,14 +4301,14 @@ + EOF + + cat <"))); ++ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", ++ nonnull (lt_argv_zero)); + for (i = 0; i < newargc; i++) + { +- LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); ++ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", ++ i, nonnull (newargz[i])); + } + + EOF +@@ -3706,7 +4529,9 @@ + if (rval == -1) + { + /* failed to start process */ +- LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); ++ lt_debugprintf (__FILE__, __LINE__, ++ "(main) failed to launch target \"%s\": %s\n", ++ lt_argv_zero, nonnull (strerror (errno))); + return 127; + } + return rval; +@@ -3728,7 +4553,7 @@ + { + void *p = (void *) malloc (num); + if (!p) +- lt_fatal ("Memory exhausted"); ++ lt_fatal (__FILE__, __LINE__, "memory exhausted"); + + return p; + } +@@ -3762,8 +4587,8 @@ + { + struct stat st; + +- LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", +- path ? (*path ? path : "EMPTY!") : "NULL!")); ++ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", ++ nonempty (path)); + if ((!path) || (!*path)) + return 0; + +@@ -3780,8 +4605,8 @@ + int rval = 0; + struct stat st; + +- LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", +- path ? (*path ? path : "EMPTY!") : "NULL!")); ++ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", ++ nonempty (path)); + if ((!path) || (!*path)) + return 0; + +@@ -3807,8 +4632,8 @@ + int tmp_len; + char *concat_name; + +- LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", +- wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); ++ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", ++ nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; +@@ -3861,7 +4686,8 @@ + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) +- lt_fatal ("getcwd failed"); ++ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", ++ nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); +@@ -3886,7 +4712,8 @@ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) +- lt_fatal ("getcwd failed"); ++ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", ++ nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); +@@ -3912,8 +4739,9 @@ + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { +- LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", +- tmp_pathspec)); ++ lt_debugprintf (__FILE__, __LINE__, ++ "checking path component for symlinks: %s\n", ++ tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) +@@ -3935,8 +4763,9 @@ + } + else + { +- char *errstr = strerror (errno); +- lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); ++ lt_fatal (__FILE__, __LINE__, ++ "error accessing file \"%s\": %s", ++ tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); +@@ -3949,7 +4778,8 @@ + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { +- lt_fatal ("Could not follow symlinks for %s", pathspec); ++ lt_fatal (__FILE__, __LINE__, ++ "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); + #endif +@@ -3975,11 +4805,25 @@ + return str; + } + ++void ++lt_debugprintf (const char *file, int line, const char *fmt, ...) ++{ ++ va_list args; ++ if (lt_debug) ++ { ++ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); ++ va_start (args, fmt); ++ (void) vfprintf (stderr, fmt, args); ++ va_end (args); ++ } ++} ++ + static void +-lt_error_core (int exit_status, const char *mode, ++lt_error_core (int exit_status, const char *file, ++ int line, const char *mode, + const char *message, va_list ap) + { +- fprintf (stderr, "%s: %s: ", program_name, mode); ++ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + +@@ -3988,20 +4832,32 @@ + } + + void +-lt_fatal (const char *message, ...) ++lt_fatal (const char *file, int line, const char *message, ...) + { + va_list ap; + va_start (ap, message); +- lt_error_core (EXIT_FAILURE, "FATAL", message, ap); ++ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); + } + ++static const char * ++nonnull (const char *s) ++{ ++ return s ? s : "(null)"; ++} ++ ++static const char * ++nonempty (const char *s) ++{ ++ return (s && !*s) ? "(empty)" : nonnull (s); ++} ++ + void + lt_setenv (const char *name, const char *value) + { +- LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", +- (name ? name : ""), +- (value ? value : ""))); ++ lt_debugprintf (__FILE__, __LINE__, ++ "(lt_setenv) setting '%s' to '%s'\n", ++ nonnull (name), nonnull (value)); + { + #ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ +@@ -4049,9 +4905,9 @@ + void + lt_update_exe_path (const char *name, const char *value) + { +- LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", +- (name ? name : ""), +- (value ? value : ""))); ++ lt_debugprintf (__FILE__, __LINE__, ++ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", ++ nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { +@@ -4070,9 +4926,9 @@ + void + lt_update_lib_path (const char *name, const char *value) + { +- LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", +- (name ? name : ""), +- (value ? value : ""))); ++ lt_debugprintf (__FILE__, __LINE__, ++ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", ++ nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { +@@ -4222,7 +5078,7 @@ + func_win32_import_lib_p () + { + $opt_debug +- case `eval "$file_magic_cmd \"\$1\" 2>/dev/null" | $SED -e 10q` in ++ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +@@ -4401,9 +5257,9 @@ + ;; + *) + if test "$prev" = dlfiles; then +- dlfiles="$dlfiles $arg" ++ func_append dlfiles " $arg" + else +- dlprefiles="$dlprefiles $arg" ++ func_append dlprefiles " $arg" + fi + prev= + continue +@@ -4427,7 +5283,7 @@ + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; +- *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ++ *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; +@@ -4446,7 +5302,7 @@ + moreargs= + for fil in `cat "$save_arg"` + do +-# moreargs="$moreargs $fil" ++# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + +@@ -4475,7 +5331,7 @@ + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then +- dlfiles="$dlfiles $pic_object" ++ func_append dlfiles " $pic_object" + prev= + continue + else +@@ -4487,7 +5343,7 @@ + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. +- dlprefiles="$dlprefiles $pic_object" ++ func_append dlprefiles " $pic_object" + prev= + fi + +@@ -4557,12 +5413,12 @@ + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; +- *) rpath="$rpath $arg" ;; ++ *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; +- *) xrpath="$xrpath $arg" ;; ++ *) func_append xrpath " $arg" ;; + esac + fi + prev= +@@ -4574,28 +5430,28 @@ + continue + ;; + weak) +- weak_libs="$weak_libs $arg" ++ func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) +- linker_flags="$linker_flags $qarg" +- compiler_flags="$compiler_flags $qarg" ++ func_append linker_flags " $qarg" ++ func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) +- compiler_flags="$compiler_flags $qarg" ++ func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) +- linker_flags="$linker_flags $qarg" +- compiler_flags="$compiler_flags $wl$qarg" ++ func_append linker_flags " $qarg" ++ func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" +@@ -4686,15 +5542,16 @@ + ;; + + -L*) +- func_stripname '-L' '' "$arg" +- dir=$func_stripname_result +- if test -z "$dir"; then ++ func_stripname "-L" '' "$arg" ++ if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi ++ func_resolve_sysroot "$func_stripname_result" ++ dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; +@@ -4706,10 +5563,16 @@ + ;; + esac + case "$deplibs " in +- *" -L$dir "*) ;; ++ *" -L$dir "* | *" $arg "*) ++ # Will only happen for absolute or sysroot arguments ++ ;; + *) +- deplibs="$deplibs -L$dir" +- lib_search_path="$lib_search_path $dir" ++ # Preserve sysroot, but never include relative directories ++ case $dir in ++ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; ++ *) func_append deplibs " -L$dir" ;; ++ esac ++ func_append lib_search_path " $dir" + ;; + esac + case $host in +@@ -4718,12 +5581,12 @@ + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; +- *) dllsearchpath="$dllsearchpath:$dir";; ++ *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; +- *) dllsearchpath="$dllsearchpath:$testbindir";; ++ *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac +@@ -4747,7 +5610,7 @@ + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework +- deplibs="$deplibs System.ltframework" ++ func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) +@@ -4758,9 +5621,6 @@ + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; +- *-*-linux*) +- test "X$arg" = "X-lc" && continue +- ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in +@@ -4770,7 +5630,7 @@ + ;; + esac + fi +- deplibs="$deplibs $arg" ++ func_append deplibs " $arg" + continue + ;; + +@@ -4782,8 +5642,8 @@ + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. +- -model|-arch|-isysroot) +- compiler_flags="$compiler_flags $arg" ++ -model|-arch|-isysroot|--sysroot) ++ func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler +@@ -4791,12 +5651,12 @@ + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) +- compiler_flags="$compiler_flags $arg" ++ func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; +- * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; ++ * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; +@@ -4863,13 +5723,17 @@ + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; ++ =*) ++ func_stripname '=' '' "$dir" ++ dir=$lt_sysroot$func_stripname_result ++ ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; +- *) xrpath="$xrpath $dir" ;; ++ *) func_append xrpath " $dir" ;; + esac + continue + ;; +@@ -4922,8 +5786,8 @@ + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" +- arg="$arg $func_quote_for_eval_result" +- compiler_flags="$compiler_flags $func_quote_for_eval_result" ++ func_append arg " $func_quote_for_eval_result" ++ func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" +@@ -4938,9 +5802,9 @@ + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" +- arg="$arg $wl$func_quote_for_eval_result" +- compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" +- linker_flags="$linker_flags $func_quote_for_eval_result" ++ func_append arg " $wl$func_quote_for_eval_result" ++ func_append compiler_flags " $wl$func_quote_for_eval_result" ++ func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" +@@ -4968,24 +5832,27 @@ + arg="$func_quote_for_eval_result" + ;; + +- # -64, -mips[0-9] enable 64-bit mode on the SGI compiler +- # -r[0-9][0-9]* specifies the processor on the SGI compiler +- # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler +- # +DA*, +DD* enable 64-bit mode on the HP compiler +- # -q* pass through compiler args for the IBM compiler +- # -m*, -t[45]*, -txscale* pass through architecture-specific +- # compiler args for GCC +- # -F/path gives path to uninstalled frameworks, gcc on darwin +- # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC +- # @file GCC response files +- # -tp=* Portland pgcc target processor selection ++ # Flags to be passed through unchanged, with rationale: ++ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler ++ # -r[0-9][0-9]* specify processor for the SGI compiler ++ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler ++ # +DA*, +DD* enable 64-bit mode for the HP compiler ++ # -q* compiler args for the IBM compiler ++ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC ++ # -F/path path to uninstalled frameworks, gcc on darwin ++ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC ++ # @file GCC response files ++ # -tp=* Portland pgcc target processor selection ++ # --sysroot=* for sysroot support ++ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ +- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) ++ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ ++ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" +- compiler_flags="$compiler_flags $arg" ++ func_append compiler_flags " $arg" + continue + ;; + +@@ -4997,7 +5864,7 @@ + + *.$objext) + # A standard object. +- objs="$objs $arg" ++ func_append objs " $arg" + ;; + + *.lo) +@@ -5028,7 +5895,7 @@ + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then +- dlfiles="$dlfiles $pic_object" ++ func_append dlfiles " $pic_object" + prev= + continue + else +@@ -5040,7 +5907,7 @@ + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. +- dlprefiles="$dlprefiles $pic_object" ++ func_append dlprefiles " $pic_object" + prev= + fi + +@@ -5085,24 +5952,25 @@ + + *.$libext) + # An archive. +- deplibs="$deplibs $arg" +- old_deplibs="$old_deplibs $arg" ++ func_append deplibs " $arg" ++ func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + ++ func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. +- dlfiles="$dlfiles $arg" ++ func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. +- dlprefiles="$dlprefiles $arg" ++ func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else +- deplibs="$deplibs $arg" ++ func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; +@@ -5127,7 +5995,7 @@ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then +- eval "arg=\"$export_dynamic_flag_spec\"" ++ eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi +@@ -5144,11 +6012,13 @@ + else + shlib_search_path= + fi +- eval "sys_lib_search_path=\"$sys_lib_search_path_spec\"" +- eval "sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"" ++ eval sys_lib_search_path=\"$sys_lib_search_path_spec\" ++ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" ++ func_to_tool_file "$output_objdir/" ++ tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + +@@ -5169,12 +6039,12 @@ + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do +- if $opt_duplicate_deps ; then ++ if $opt_preserve_dup_deps ; then + case "$libs " in +- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; ++ *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi +- libs="$libs $deplib" ++ func_append libs " $deplib" + done + + if test "$linkmode" = lib; then +@@ -5187,9 +6057,9 @@ + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in +- *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; ++ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac +- pre_post_deps="$pre_post_deps $pre_post_dep" ++ func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= +@@ -5256,8 +6126,9 @@ + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= ++ func_resolve_sysroot "$lib" + case $lib in +- *.la) func_source "$lib" ;; ++ *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library +@@ -5267,7 +6138,7 @@ + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; +- *) deplibs="$deplibs $deplib" ;; ++ *) func_append deplibs " $deplib" ;; + esac + done + done +@@ -5288,11 +6159,11 @@ + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else +- compiler_flags="$compiler_flags $deplib" ++ func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; +- * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; ++ * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi +@@ -5377,7 +6248,7 @@ + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; +- * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; ++ * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi +@@ -5390,7 +6261,8 @@ + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" +- newlib_search_path="$newlib_search_path $func_stripname_result" ++ func_resolve_sysroot "$func_stripname_result" ++ func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test "$pass" = conv; then +@@ -5404,7 +6276,8 @@ + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" +- newlib_search_path="$newlib_search_path $func_stripname_result" ++ func_resolve_sysroot "$func_stripname_result" ++ func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" +@@ -5415,17 +6288,21 @@ + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" +- dir=$func_stripname_result ++ func_resolve_sysroot "$func_stripname_result" ++ dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; +- *) xrpath="$xrpath $dir" ;; ++ *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; +- *.la) lib="$deplib" ;; ++ *.la) ++ func_resolve_sysroot "$deplib" ++ lib=$func_resolve_sysroot_result ++ ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" +@@ -5488,11 +6365,11 @@ + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. +- newdlprefiles="$newdlprefiles $deplib" ++ func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else +- newdlfiles="$newdlfiles $deplib" ++ func_append newdlfiles " $deplib" + fi + fi + continue +@@ -5538,7 +6415,7 @@ + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; +- *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; ++ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi +@@ -5546,8 +6423,8 @@ + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then +- test -n "$dlopen" && dlfiles="$dlfiles $dlopen" +- test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" ++ test -n "$dlopen" && func_append dlfiles " $dlopen" ++ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" = conv; then +@@ -5558,20 +6435,20 @@ + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. +- convenience="$convenience $ladir/$objdir/$old_library" +- old_convenience="$old_convenience $ladir/$objdir/$old_library" ++ func_append convenience " $ladir/$objdir/$old_library" ++ func_append old_convenience " $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" +- if $opt_duplicate_deps ; then ++ if $opt_preserve_dup_deps ; then + case "$tmp_libs " in +- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; ++ *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi +- tmp_libs="$tmp_libs $deplib" ++ func_append tmp_libs " $deplib" + done + continue + fi # $pass = conv +@@ -5579,9 +6456,15 @@ + + # Get the name of the library we link against. + linklib= +- for l in $old_library $library_names; do +- linklib="$l" +- done ++ if test -n "$old_library" && ++ { test "$prefer_static_libs" = yes || ++ test "$prefer_static_libs,$installed" = "built,no"; }; then ++ linklib=$old_library ++ else ++ for l in $old_library $library_names; do ++ linklib="$l" ++ done ++ fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi +@@ -5598,9 +6481,9 @@ + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. +- dlprefiles="$dlprefiles $lib $dependency_libs" ++ func_append dlprefiles " $lib $dependency_libs" + else +- newdlfiles="$newdlfiles $lib" ++ func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen +@@ -5622,14 +6505,14 @@ + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then +- if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then ++ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else +- dir="$libdir" +- absdir="$libdir" ++ dir="$lt_sysroot$libdir" ++ absdir="$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else +@@ -5637,12 +6520,12 @@ + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later +- notinst_path="$notinst_path $abs_ladir" ++ func_append notinst_path " $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later +- notinst_path="$notinst_path $abs_ladir" ++ func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" +@@ -5653,20 +6536,46 @@ + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi +- # Prefer using a static library (so that no silly _DYNAMIC symbols +- # are required to link). +- if test -n "$old_library"; then +- newdlprefiles="$newdlprefiles $dir/$old_library" +- # Keep a list of preopened convenience libraries to check +- # that they are being used correctly in the link pass. +- test -z "$libdir" && \ +- dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" +- # Otherwise, use the dlname, so that lt_dlopen finds it. +- elif test -n "$dlname"; then +- newdlprefiles="$newdlprefiles $dir/$dlname" +- else +- newdlprefiles="$newdlprefiles $dir/$linklib" +- fi ++ case "$host" in ++ # special handling for platforms with PE-DLLs. ++ *cygwin* | *mingw* | *cegcc* ) ++ # Linker will automatically link against shared library if both ++ # static and shared are present. Therefore, ensure we extract ++ # symbols from the import library if a shared library is present ++ # (otherwise, the dlopen module name will be incorrect). We do ++ # this by putting the import library name into $newdlprefiles. ++ # We recover the dlopen module name by 'saving' the la file ++ # name in a special purpose variable, and (later) extracting the ++ # dlname from the la file. ++ if test -n "$dlname"; then ++ func_tr_sh "$dir/$linklib" ++ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" ++ func_append newdlprefiles " $dir/$linklib" ++ else ++ func_append newdlprefiles " $dir/$old_library" ++ # Keep a list of preopened convenience libraries to check ++ # that they are being used correctly in the link pass. ++ test -z "$libdir" && \ ++ func_append dlpreconveniencelibs " $dir/$old_library" ++ fi ++ ;; ++ * ) ++ # Prefer using a static library (so that no silly _DYNAMIC symbols ++ # are required to link). ++ if test -n "$old_library"; then ++ func_append newdlprefiles " $dir/$old_library" ++ # Keep a list of preopened convenience libraries to check ++ # that they are being used correctly in the link pass. ++ test -z "$libdir" && \ ++ func_append dlpreconveniencelibs " $dir/$old_library" ++ # Otherwise, use the dlname, so that lt_dlopen finds it. ++ elif test -n "$dlname"; then ++ func_append newdlprefiles " $dir/$dlname" ++ else ++ func_append newdlprefiles " $dir/$linklib" ++ fi ++ ;; ++ esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then +@@ -5684,7 +6593,7 @@ + + + if test "$linkmode" = prog && test "$pass" != link; then +- newlib_search_path="$newlib_search_path $ladir" ++ func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no +@@ -5697,7 +6606,8 @@ + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" +- newlib_search_path="$newlib_search_path $func_stripname_result" ++ func_resolve_sysroot "$func_stripname_result" ++ func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? +@@ -5708,12 +6618,12 @@ + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi +- if $opt_duplicate_deps ; then ++ if $opt_preserve_dup_deps ; then + case "$tmp_libs " in +- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; ++ *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi +- tmp_libs="$tmp_libs $deplib" ++ func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... +@@ -5728,7 +6638,7 @@ + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; +- *) temp_rpath="$temp_rpath$absdir:" ;; ++ *) func_append temp_rpath "$absdir:" ;; + esac + fi + +@@ -5740,7 +6650,7 @@ + *) + case "$compile_rpath " in + *" $absdir "*) ;; +- *) compile_rpath="$compile_rpath $absdir" ++ *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac +@@ -5749,7 +6659,7 @@ + *) + case "$finalize_rpath " in + *" $libdir "*) ;; +- *) finalize_rpath="$finalize_rpath $libdir" ++ *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac +@@ -5774,12 +6684,12 @@ + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded +- notinst_deplibs="$notinst_deplibs $lib" ++ func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then +- notinst_deplibs="$notinst_deplibs $lib" ++ func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; +@@ -5814,7 +6724,7 @@ + *) + case "$compile_rpath " in + *" $absdir "*) ;; +- *) compile_rpath="$compile_rpath $absdir" ++ *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac +@@ -5823,7 +6733,7 @@ + *) + case "$finalize_rpath " in + *" $libdir "*) ;; +- *) finalize_rpath="$finalize_rpath $libdir" ++ *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac +@@ -5835,7 +6745,7 @@ + shift + realname="$1" + shift +- eval "libname=\"$libname_spec\"" ++ libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" +@@ -5848,7 +6758,7 @@ + versuffix="-$major" + ;; + esac +- eval "soname=\"$soname_spec\"" ++ eval soname=\"$soname_spec\" + else + soname="$realname" + fi +@@ -5877,7 +6787,7 @@ + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + +- if test "$linkmode" = prog || test "$mode" != relink; then ++ if test "$linkmode" = prog || test "$opt_mode" != relink; then + add_shlibpath= + add_dir= + add= +@@ -5933,7 +6843,7 @@ + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) +- add_dir="$add_dir -L$inst_prefix_dir$libdir" ++ func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi +@@ -5955,7 +6865,7 @@ + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; +- *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; ++ *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then +@@ -5969,13 +6879,13 @@ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; +- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; ++ *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + +- if test "$linkmode" = prog || test "$mode" = relink; then ++ if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= +@@ -5989,7 +6899,7 @@ + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; +- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; ++ *) func_append finalize_shlibpath "$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then +@@ -6001,12 +6911,12 @@ + fi + else + # We cannot seem to hardcode it, guess we'll fake it. +- add_dir="-L$libdir" ++ add_dir="-L$lt_sysroot$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) +- add_dir="$add_dir -L$inst_prefix_dir$libdir" ++ func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi +@@ -6083,27 +6993,33 @@ + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; +- *) xrpath="$xrpath $temp_xrpath";; ++ *) func_append xrpath " $temp_xrpath";; + esac;; +- *) temp_deplibs="$temp_deplibs $libdir";; ++ *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + +- newlib_search_path="$newlib_search_path $absdir" ++ func_append newlib_search_path " $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" +- if $opt_duplicate_deps ; then ++ case $deplib in ++ -L*) func_stripname '-L' '' "$deplib" ++ func_resolve_sysroot "$func_stripname_result";; ++ *) func_resolve_sysroot "$deplib" ;; ++ esac ++ if $opt_preserve_dup_deps ; then + case "$tmp_libs " in +- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; ++ *" $func_resolve_sysroot_result "*) ++ func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi +- tmp_libs="$tmp_libs $deplib" ++ func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then +@@ -6113,8 +7029,10 @@ + case $deplib in + -L*) path="$deplib" ;; + *.la) ++ func_resolve_sysroot "$deplib" ++ deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." +- dir="$func_dirname_result" ++ dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; +@@ -6130,7 +7048,7 @@ + case $host in + *-*-darwin*) + depdepl= +- deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` ++ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp +@@ -6141,8 +7059,8 @@ + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi +- compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" +- linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" ++ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" ++ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi +@@ -6152,7 +7070,7 @@ + ;; + esac + else +- libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` ++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ +@@ -6192,7 +7110,7 @@ + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; +- *) lib_search_path="$lib_search_path $dir" ;; ++ *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= +@@ -6205,7 +7123,7 @@ + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order +- eval tmp_libs=\$$var ++ eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so +@@ -6250,13 +7168,13 @@ + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; +- *) tmp_libs="$tmp_libs $deplib" ;; ++ *) func_append tmp_libs " $deplib" ;; + esac + ;; +- *) tmp_libs="$tmp_libs $deplib" ;; ++ *) func_append tmp_libs " $deplib" ;; + esac + done +- eval $var=\$tmp_libs ++ eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs +@@ -6269,7 +7187,7 @@ + ;; + esac + if test -n "$i" ; then +- tmp_libs="$tmp_libs $i" ++ func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs +@@ -6310,7 +7228,7 @@ + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" +- objs="$objs$old_deplibs" ++ func_append objs "$old_deplibs" + ;; + + lib) +@@ -6319,8 +7237,8 @@ + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result +- eval "shared_ext=\"$shrext_cmds\"" +- eval "libname=\"$libname_spec\"" ++ eval shared_ext=\"$shrext_cmds\" ++ eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ +@@ -6330,8 +7248,8 @@ + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result +- eval "shared_ext=\"$shrext_cmds\"" +- eval "libname=\"$libname_spec\"" ++ eval shared_ext=\"$shrext_cmds\" ++ eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result +@@ -6346,7 +7264,7 @@ + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" +- libobjs="$libobjs $objs" ++ func_append libobjs " $objs" + fi + fi + +@@ -6544,7 +7462,7 @@ + done + + # Make executables depend on our current version. +- verstring="$verstring:${current}.0" ++ func_append verstring ":${current}.0" + ;; + + qnx) +@@ -6612,10 +7530,10 @@ + fi + + func_generate_dlsyms "$libname" "$libname" "yes" +- libobjs="$libobjs $symfileobj" ++ func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + +- if test "$mode" != relink; then ++ if test "$opt_mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= +@@ -6631,7 +7549,7 @@ + continue + fi + fi +- removelist="$removelist $p" ++ func_append removelist " $p" + ;; + *) ;; + esac +@@ -6642,7 +7560,7 @@ + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then +- oldlibs="$oldlibs $output_objdir/$libname.$libext" ++ func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` +@@ -6659,10 +7577,11 @@ + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do +- temp_xrpath="$temp_xrpath -R$libdir" ++ func_replace_sysroot "$libdir" ++ func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; +- *) finalize_rpath="$finalize_rpath $libdir" ;; ++ *) func_append finalize_rpath " $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then +@@ -6676,7 +7595,7 @@ + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; +- *) dlfiles="$dlfiles $lib" ;; ++ *) func_append dlfiles " $lib" ;; + esac + done + +@@ -6686,7 +7605,7 @@ + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; +- *) dlprefiles="$dlprefiles $lib" ;; ++ *) func_append dlprefiles " $lib" ;; + esac + done + +@@ -6698,7 +7617,7 @@ + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework +- deplibs="$deplibs System.ltframework" ++ func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. +@@ -6715,7 +7634,7 @@ + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then +- deplibs="$deplibs -lc" ++ func_append deplibs " -lc" + fi + ;; + esac +@@ -6764,18 +7683,18 @@ + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $i "*) +- newdeplibs="$newdeplibs $i" ++ func_append newdeplibs " $i" + i="" + ;; + esac + fi + if test -n "$i" ; then +- eval "libname=\"$libname_spec\"" +- eval "deplib_matches=\"$library_names_spec\"" ++ libname=`eval "\\$ECHO \"$libname_spec\""` ++ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` + set dummy $deplib_matches; shift + deplib_match=$1 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then +- newdeplibs="$newdeplibs $i" ++ func_append newdeplibs " $i" + else + droppeddeps=yes + echo +@@ -6789,7 +7708,7 @@ + fi + ;; + *) +- newdeplibs="$newdeplibs $i" ++ func_append newdeplibs " $i" + ;; + esac + done +@@ -6807,18 +7726,18 @@ + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $i "*) +- newdeplibs="$newdeplibs $i" ++ func_append newdeplibs " $i" + i="" + ;; + esac + fi + if test -n "$i" ; then +- eval "libname=\"$libname_spec\"" +- eval "deplib_matches=\"$library_names_spec\"" ++ libname=`eval "\\$ECHO \"$libname_spec\""` ++ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` + set dummy $deplib_matches; shift + deplib_match=$1 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then +- newdeplibs="$newdeplibs $i" ++ func_append newdeplibs " $i" + else + droppeddeps=yes + echo +@@ -6840,7 +7759,7 @@ + fi + ;; + *) +- newdeplibs="$newdeplibs $i" ++ func_append newdeplibs " $i" + ;; + esac + done +@@ -6857,15 +7776,27 @@ + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) +- newdeplibs="$newdeplibs $a_deplib" ++ func_append newdeplibs " $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then +- eval "libname=\"$libname_spec\"" ++ libname=`eval "\\$ECHO \"$libname_spec\""` ++ if test -n "$file_magic_glob"; then ++ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` ++ else ++ libnameglob=$libname ++ fi ++ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do +- potential_libs=`ls $i/$libname[.-]* 2>/dev/null` ++ if test "$want_nocaseglob" = yes; then ++ shopt -s nocaseglob ++ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` ++ $nocaseglob ++ else ++ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` ++ fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | +@@ -6885,10 +7816,10 @@ + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done +- if eval "$file_magic_cmd \"\$potlib\"" 2>/dev/null | ++ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then +- newdeplibs="$newdeplibs $a_deplib" ++ func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi +@@ -6913,7 +7844,7 @@ + ;; + *) + # Add a -L argument. +- newdeplibs="$newdeplibs $a_deplib" ++ func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. +@@ -6929,20 +7860,20 @@ + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) +- newdeplibs="$newdeplibs $a_deplib" ++ func_append newdeplibs " $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then +- eval "libname=\"$libname_spec\"" ++ libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then +- newdeplibs="$newdeplibs $a_deplib" ++ func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi +@@ -6967,7 +7898,7 @@ + ;; + *) + # Add a -L argument. +- newdeplibs="$newdeplibs $a_deplib" ++ func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. +@@ -7071,7 +8002,7 @@ + *) + case " $deplibs " in + *" -L$path/$objdir "*) +- new_libs="$new_libs -L$path/$objdir" ;; ++ func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac +@@ -7081,10 +8012,10 @@ + -L*) + case " $new_libs " in + *" $deplib "*) ;; +- *) new_libs="$new_libs $deplib" ;; ++ *) func_append new_libs " $deplib" ;; + esac + ;; +- *) new_libs="$new_libs $deplib" ;; ++ *) func_append new_libs " $deplib" ;; + esac + done + deplibs="$new_libs" +@@ -7101,10 +8032,12 @@ + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" +- test "$mode" != relink && rpath="$compile_rpath$rpath" ++ test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then ++ func_replace_sysroot "$libdir" ++ libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else +@@ -7113,18 +8046,18 @@ + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) +- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ++ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else +- eval "flag=\"$hardcode_libdir_flag_spec\"" +- dep_rpath="$dep_rpath $flag" ++ eval flag=\"$hardcode_libdir_flag_spec\" ++ func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; +- *) perm_rpath="$perm_rpath $libdir" ;; ++ *) func_apped perm_rpath " $libdir" ;; + esac + fi + done +@@ -7133,40 +8066,38 @@ + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then +- eval "dep_rpath=\"$hardcode_libdir_flag_spec_ld\"" ++ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else +- eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" ++ eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do +- rpath="$rpath$dir:" ++ func_append rpath "$dir:" + done +- eval $runpath_var=\$rpath\$$runpath_var +- export $runpath_var ++ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" +- test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" ++ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then +- eval $shlibpath_var=\$shlibpath\$$shlibpath_var +- export $shlibpath_var ++ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. +- eval "shared_ext=\"$shrext_cmds\"" +- eval "library_names=\"$library_names_spec\"" ++ eval shared_ext=\"$shrext_cmds\" ++ eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then +- eval "soname=\"$soname_spec\"" ++ eval soname=\"$soname_spec\" + else + soname="$realname" + fi +@@ -7178,7 +8109,7 @@ + linknames= + for link + do +- linknames="$linknames $link" ++ func_append linknames " $link" + done + + # Use standard objects if they are pic +@@ -7189,7 +8120,7 @@ + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" +- delfiles="$delfiles $export_symbols" ++ func_append delfiles " $export_symbols" + fi + + orig_export_symbols= +@@ -7220,13 +8151,45 @@ + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' +- for cmd in $cmds; do ++ for cmd1 in $cmds; do + IFS="$save_ifs" +- eval "cmd=\"$cmd\"" +- func_len " $cmd" +- len=$func_len_result +- if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then ++ # Take the normal branch if the nm_file_list_spec branch ++ # doesn't work or if tool conversion is not needed. ++ case $nm_file_list_spec~$to_tool_file_cmd in ++ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) ++ try_normal_branch=yes ++ eval cmd=\"$cmd1\" ++ func_len " $cmd" ++ len=$func_len_result ++ ;; ++ *) ++ try_normal_branch=no ++ ;; ++ esac ++ if test "$try_normal_branch" = yes \ ++ && { test "$len" -lt "$max_cmd_len" \ ++ || test "$max_cmd_len" -le -1; } ++ then ++ func_show_eval "$cmd" 'exit $?' ++ skipped_export=false ++ elif test -n "$nm_file_list_spec"; then ++ func_basename "$output" ++ output_la=$func_basename_result ++ save_libobjs=$libobjs ++ save_output=$output ++ output=${output_objdir}/${output_la}.nm ++ func_to_tool_file "$output" ++ libobjs=$nm_file_list_spec$func_to_tool_file_result ++ func_append delfiles " $output" ++ func_verbose "creating $NM input file list: $output" ++ for obj in $save_libobjs; do ++ func_to_tool_file "$obj" ++ $ECHO "$func_to_tool_file_result" ++ done > "$output" ++ eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' ++ output=$save_output ++ libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. +@@ -7248,7 +8211,7 @@ + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" +- $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols" ++ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then +@@ -7260,7 +8223,7 @@ + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter +- delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" ++ func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi +@@ -7270,7 +8233,7 @@ + case " $convenience " in + *" $test_deplib "*) ;; + *) +- tmp_deplibs="$tmp_deplibs $test_deplib" ++ func_append tmp_deplibs " $test_deplib" + ;; + esac + done +@@ -7286,43 +8249,43 @@ + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs +- eval "libobjs=\"\$libobjs $whole_archive_flag_spec\"" ++ eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" +- generated="$generated $gentop" ++ func_append generated " $gentop" + + func_extract_archives $gentop $convenience +- libobjs="$libobjs $func_extract_archives_result" ++ func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then +- eval "flag=\"$thread_safe_flag_spec\"" +- linker_flags="$linker_flags $flag" ++ eval flag=\"$thread_safe_flag_spec\" ++ func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking +- if test "$mode" = relink; then +- $opt_dry_run || (cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U) || exit $? ++ if test "$opt_mode" = relink; then ++ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then +- eval "test_cmds=\"$module_expsym_cmds\"" ++ eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else +- eval "test_cmds=\"$module_cmds\"" ++ eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then +- eval "test_cmds=\"$archive_expsym_cmds\"" ++ eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else +- eval "test_cmds=\"$archive_cmds\"" ++ eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi +@@ -7366,10 +8329,13 @@ + echo 'INPUT (' > $output + for obj in $save_libobjs + do +- $ECHO "$obj" >> $output ++ func_to_tool_file "$obj" ++ $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output +- delfiles="$delfiles $output" ++ func_append delfiles " $output" ++ func_to_tool_file "$output" ++ output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" +@@ -7383,15 +8349,17 @@ + fi + for obj + do +- $ECHO "$obj" >> $output ++ func_to_tool_file "$obj" ++ $ECHO "$func_to_tool_file_result" >> $output + done +- delfiles="$delfiles $output" +- output=$firstobj\"$file_list_spec$output\" ++ func_append delfiles " $output" ++ func_to_tool_file "$output" ++ output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext +- eval "test_cmds=\"$reload_cmds\"" ++ eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 +@@ -7411,12 +8379,12 @@ + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist +- eval "concat_cmds=\"$reload_cmds\"" ++ eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" +- eval "concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"" ++ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 +@@ -7433,11 +8401,11 @@ + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" +- eval "concat_cmds=\"\${concat_cmds}$reload_cmds\"" ++ eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then +- eval "concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"" ++ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi +- delfiles="$delfiles $output" ++ func_append delfiles " $output" + + else + output= +@@ -7450,9 +8418,9 @@ + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ +- eval "concat_cmds=\"\$concat_cmds$export_symbols_cmds\"" ++ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then +- eval "concat_cmds=\"\$concat_cmds~\$RM $last_robj\"" ++ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + +@@ -7471,7 +8439,7 @@ + lt_exit=$? + + # Restore the uninstalled library and exit +- if test "$mode" = relink; then ++ if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) +@@ -7492,7 +8460,7 @@ + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" +- $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols" ++ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then +@@ -7504,7 +8472,7 @@ + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter +- delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" ++ func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi +@@ -7515,7 +8483,7 @@ + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then +- eval "libobjs=\"\$libobjs $whole_archive_flag_spec\"" ++ eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the +@@ -7539,23 +8507,23 @@ + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. +- eval "cmds=\"\$cmds~\$RM $delfiles\"" ++ eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" +- generated="$generated $gentop" ++ func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles +- libobjs="$libobjs $func_extract_archives_result" ++ func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" +- eval "cmd=\"$cmd\"" ++ eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" +@@ -7564,7 +8532,7 @@ + lt_exit=$? + + # Restore the uninstalled library and exit +- if test "$mode" = relink; then ++ if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) +@@ -7576,8 +8544,8 @@ + IFS="$save_ifs" + + # Restore the uninstalled library and exit +- if test "$mode" = relink; then +- $opt_dry_run || (cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname) || exit $? ++ if test "$opt_mode" = relink; then ++ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then +@@ -7656,17 +8624,20 @@ + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then +- eval "tmp_whole_archive_flags=\"$whole_archive_flag_spec\"" ++ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" +- generated="$generated $gentop" ++ func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + ++ # If we're not building shared, we need to use non_pic_objs ++ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" ++ + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + +@@ -7690,7 +8661,7 @@ + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" +- # $opt_dry_run || echo timestamp > $libobj || exit $? ++ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + +@@ -7740,8 +8711,8 @@ + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) +- compile_command="$compile_command ${wl}-bind_at_load" +- finalize_command="$finalize_command ${wl}-bind_at_load" ++ func_append compile_command " ${wl}-bind_at_load" ++ func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi +@@ -7761,7 +8732,7 @@ + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) +- new_libs="$new_libs -L$path/$objdir" ;; ++ func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac +@@ -7771,17 +8742,17 @@ + -L*) + case " $new_libs " in + *" $deplib "*) ;; +- *) new_libs="$new_libs $deplib" ;; ++ *) func_append new_libs " $deplib" ;; + esac + ;; +- *) new_libs="$new_libs $deplib" ;; ++ *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + +- compile_command="$compile_command $compile_deplibs" +- finalize_command="$finalize_command $finalize_deplibs" ++ func_append compile_command " $compile_deplibs" ++ func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. +@@ -7789,7 +8760,7 @@ + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; +- *) finalize_rpath="$finalize_rpath $libdir" ;; ++ *) func_append finalize_rpath " $libdir" ;; + esac + done + fi +@@ -7808,18 +8779,18 @@ + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) +- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ++ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else +- eval "flag=\"$hardcode_libdir_flag_spec\"" +- rpath="$rpath $flag" ++ eval flag=\"$hardcode_libdir_flag_spec\" ++ func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; +- *) perm_rpath="$perm_rpath $libdir" ;; ++ *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in +@@ -7828,12 +8799,12 @@ + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; +- *) dllsearchpath="$dllsearchpath:$libdir";; ++ *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; +- *) dllsearchpath="$dllsearchpath:$testbindir";; ++ *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac +@@ -7842,7 +8813,7 @@ + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" +- eval "rpath=\" $hardcode_libdir_flag_spec\"" ++ eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + +@@ -7859,18 +8830,18 @@ + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) +- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ++ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else +- eval "flag=\"$hardcode_libdir_flag_spec\"" +- rpath="$rpath $flag" ++ eval flag=\"$hardcode_libdir_flag_spec\" ++ func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; +- *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; ++ *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done +@@ -7878,7 +8849,7 @@ + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" +- eval "rpath=\" $hardcode_libdir_flag_spec\"" ++ eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + +@@ -7921,6 +8892,12 @@ + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + ++ if test -n "$postlink_cmds"; then ++ func_to_tool_file "$output" ++ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` ++ func_execute_cmds "$postlink_cmds" 'exit $?' ++ fi ++ + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' +@@ -7943,7 +8920,7 @@ + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do +- rpath="$rpath$dir:" ++ func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi +@@ -7951,7 +8928,7 @@ + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do +- rpath="$rpath$dir:" ++ func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi +@@ -7966,6 +8943,13 @@ + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' ++ ++ if test -n "$postlink_cmds"; then ++ func_to_tool_file "$output" ++ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` ++ func_execute_cmds "$postlink_cmds" 'exit $?' ++ fi ++ + exit $EXIT_SUCCESS + fi + +@@ -7999,6 +8983,12 @@ + + func_show_eval "$link_command" 'exit $?' + ++ if test -n "$postlink_cmds"; then ++ func_to_tool_file "$output_objdir/$outputname" ++ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` ++ func_execute_cmds "$postlink_cmds" 'exit $?' ++ fi ++ + # Now create the wrapper script. + func_verbose "creating $output" + +@@ -8096,7 +9086,7 @@ + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then +- oldobjs="$oldobjs $symfileobj" ++ func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" +@@ -8104,10 +9094,10 @@ + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" +- generated="$generated $gentop" ++ func_append generated " $gentop" + + func_extract_archives $gentop $addlibs +- oldobjs="$oldobjs $func_extract_archives_result" ++ func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. +@@ -8118,10 +9108,10 @@ + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" +- generated="$generated $gentop" ++ func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles +- oldobjs="$oldobjs $func_extract_archives_result" ++ func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have +@@ -8139,7 +9129,7 @@ + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" +- generated="$generated $gentop" ++ func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= +@@ -8163,18 +9153,28 @@ + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" +- oldobjs="$oldobjs $gentop/$newobj" ++ func_append oldobjs " $gentop/$newobj" + ;; +- *) oldobjs="$oldobjs $obj" ;; ++ *) func_append oldobjs " $obj" ;; + esac + done + fi +- eval "cmds=\"$old_archive_cmds\"" ++ eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds ++ elif test -n "$archiver_list_spec"; then ++ func_verbose "using command file archive linking..." ++ for obj in $oldobjs ++ do ++ func_to_tool_file "$obj" ++ $ECHO "$func_to_tool_file_result" ++ done > $output_objdir/$libname.libcmd ++ func_to_tool_file "$output_objdir/$libname.libcmd" ++ oldobjs=" $archiver_list_spec$func_to_tool_file_result" ++ cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." +@@ -8189,7 +9189,7 @@ + do + last_oldobj=$obj + done +- eval "test_cmds=\"$old_archive_cmds\"" ++ eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 +@@ -8208,7 +9208,7 @@ + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ +- eval "concat_cmds=\"\${concat_cmds}$old_archive_cmds\"" ++ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi +@@ -8216,9 +9216,9 @@ + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then +- eval "cmds=\"\$concat_cmds\"" ++ eval cmds=\"\$concat_cmds\" + else +- eval "cmds=\"\$concat_cmds~\$old_archive_cmds\"" ++ eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi +@@ -8268,12 +9268,23 @@ + *.la) + func_basename "$deplib" + name="$func_basename_result" +- libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` ++ func_resolve_sysroot "$deplib" ++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" +- newdependency_libs="$newdependency_libs $libdir/$name" ++ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ++ ;; ++ -L*) ++ func_stripname -L '' "$deplib" ++ func_replace_sysroot "$func_stripname_result" ++ func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; +- *) newdependency_libs="$newdependency_libs $deplib" ;; ++ -R*) ++ func_stripname -R '' "$deplib" ++ func_replace_sysroot "$func_stripname_result" ++ func_append newdependency_libs " -R$func_replace_sysroot_result" ++ ;; ++ *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" +@@ -8284,12 +9295,14 @@ + *.la) + func_basename "$lib" + name="$func_basename_result" +- libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` ++ func_resolve_sysroot "$lib" ++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` ++ + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" +- newdlfiles="$newdlfiles $libdir/$name" ++ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; +- *) newdlfiles="$newdlfiles $lib" ;; ++ *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles="$newdlfiles" +@@ -8303,10 +9316,11 @@ + # the library: + func_basename "$lib" + name="$func_basename_result" +- libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` ++ func_resolve_sysroot "$lib" ++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" +- newdlprefiles="$newdlprefiles $libdir/$name" ++ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done +@@ -8318,7 +9332,7 @@ + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac +- newdlfiles="$newdlfiles $abs" ++ func_append newdlfiles " $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= +@@ -8327,7 +9341,7 @@ + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac +- newdlprefiles="$newdlprefiles $abs" ++ func_append newdlprefiles " $abs" + done + dlprefiles="$newdlprefiles" + fi +@@ -8412,7 +9426,7 @@ + exit $EXIT_SUCCESS + } + +-{ test "$mode" = link || test "$mode" = relink; } && ++{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +@@ -8432,9 +9446,9 @@ + for arg + do + case $arg in +- -f) RM="$RM $arg"; rmforce=yes ;; +- -*) RM="$RM $arg" ;; +- *) files="$files $arg" ;; ++ -f) func_append RM " $arg"; rmforce=yes ;; ++ -*) func_append RM " $arg" ;; ++ *) func_append files " $arg" ;; + esac + done + +@@ -8443,24 +9457,23 @@ + + rmdirs= + +- origobjdir="$objdir" + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then +- objdir="$origobjdir" ++ odir="$objdir" + else +- objdir="$dir/$origobjdir" ++ odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" +- test "$mode" = uninstall && objdir="$dir" ++ test "$opt_mode" = uninstall && odir="$dir" + +- # Remember objdir for removal later, being careful to avoid duplicates +- if test "$mode" = clean; then ++ # Remember odir for removal later, being careful to avoid duplicates ++ if test "$opt_mode" = clean; then + case " $rmdirs " in +- *" $objdir "*) ;; +- *) rmdirs="$rmdirs $objdir" ;; ++ *" $odir "*) ;; ++ *) func_append rmdirs " $odir" ;; + esac + fi + +@@ -8486,18 +9499,17 @@ + + # Delete the libtool libraries and symlinks. + for n in $library_names; do +- rmfiles="$rmfiles $objdir/$n" ++ func_append rmfiles " $odir/$n" + done +- test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" ++ test -n "$old_library" && func_append rmfiles " $odir/$old_library" + +- case "$mode" in ++ case "$opt_mode" in + clean) +- case " $library_names " in +- # " " in the beginning catches empty $dlname ++ case " $library_names " in + *" $dlname "*) ;; +- *) rmfiles="$rmfiles $objdir/$dlname" ;; ++ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac +- test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ++ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then +@@ -8525,19 +9537,19 @@ + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then +- rmfiles="$rmfiles $dir/$pic_object" ++ func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then +- rmfiles="$rmfiles $dir/$non_pic_object" ++ func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) +- if test "$mode" = clean ; then ++ if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) +@@ -8547,7 +9559,7 @@ + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe +- rmfiles="$rmfiles $file" ++ func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. +@@ -8556,7 +9568,7 @@ + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result +- rmfiles="$rmfiles $func_ltwrapper_scriptname_result" ++ func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename +@@ -8564,12 +9576,12 @@ + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles +- rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" ++ func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then +- rmfiles="$rmfiles $objdir/lt-$name" ++ func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then +- rmfiles="$rmfiles $objdir/lt-${noexename}.c" ++ func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi +@@ -8577,7 +9589,6 @@ + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done +- objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do +@@ -8589,16 +9600,16 @@ + exit $exit_status + } + +-{ test "$mode" = uninstall || test "$mode" = clean; } && ++{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +-test -z "$mode" && { ++test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" + } + + test -z "$exec_cmd" && \ +- func_fatal_help "invalid operation mode \`$mode'" ++ func_fatal_help "invalid operation mode \`$opt_mode'" + + if test -n "$exec_cmd"; then + eval exec "$exec_cmd" +Index: binutils-2.24/ltoptions.m4 +=================================================================== +--- binutils-2.24.orig/ltoptions.m4 2013-11-04 07:33:40.000000000 -0800 ++++ binutils-2.24/ltoptions.m4 2013-12-15 11:10:23.867118697 -0800 +@@ -8,7 +8,7 @@ + # unlimited permission to copy and/or distribute it, with or without + # modifications, as long as this notice is preserved. + +-# serial 6 ltoptions.m4 ++# serial 7 ltoptions.m4 + + # This is to help aclocal find these macros, as it can't see m4_define. + AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) +Index: binutils-2.24/ltversion.m4 +=================================================================== +--- binutils-2.24.orig/ltversion.m4 2013-11-04 07:33:40.000000000 -0800 ++++ binutils-2.24/ltversion.m4 2013-12-15 11:10:23.867118697 -0800 +@@ -7,17 +7,17 @@ + # unlimited permission to copy and/or distribute it, with or without + # modifications, as long as this notice is preserved. + +-# Generated from ltversion.in. ++# @configure_input@ + +-# serial 3134 ltversion.m4 ++# serial 3293 ltversion.m4 + # This file is part of GNU Libtool + +-m4_define([LT_PACKAGE_VERSION], [2.2.7a]) +-m4_define([LT_PACKAGE_REVISION], [1.3134]) ++m4_define([LT_PACKAGE_VERSION], [2.4]) ++m4_define([LT_PACKAGE_REVISION], [1.3293]) + + AC_DEFUN([LTVERSION_VERSION], +-[macro_version='2.2.7a' +-macro_revision='1.3134' ++[macro_version='2.4' ++macro_revision='1.3293' + _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) + _LT_DECL(, macro_revision, 0) + ]) +Index: binutils-2.24/lt~obsolete.m4 +=================================================================== +--- binutils-2.24.orig/lt~obsolete.m4 2013-11-04 07:33:40.000000000 -0800 ++++ binutils-2.24/lt~obsolete.m4 2013-12-15 11:10:23.867118697 -0800 +@@ -7,7 +7,7 @@ + # unlimited permission to copy and/or distribute it, with or without + # modifications, as long as this notice is preserved. + +-# serial 4 lt~obsolete.m4 ++# serial 5 lt~obsolete.m4 + + # These exist entirely to fool aclocal when bootstrapping libtool. + # +Index: binutils-2.24/configure +=================================================================== +--- binutils-2.24.orig/configure 2013-12-15 11:09:51.000000000 -0800 ++++ binutils-2.24/configure 2013-12-15 11:10:23.870452030 -0800 +@@ -7921,7 +7921,7 @@ + # For an installed makeinfo, we require it to be from texinfo 4.7 or + # higher, else we use the "missing" dummy. + if ${MAKEINFO} --version \ +- | egrep 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then ++ | egrep 'texinfo[^0-9]*([1-3][0-9]|4.[4-9]|4.[1-9][0-9]+|[5-9])' >/dev/null 2>&1; then + : + else + MAKEINFO="$MISSING makeinfo" +Index: binutils-2.24/bfd/configure +=================================================================== +--- binutils-2.24.orig/bfd/configure 2013-12-02 01:30:30.000000000 -0800 ++++ binutils-2.24/bfd/configure 2013-12-15 11:10:23.870452030 -0800 +@@ -668,6 +668,9 @@ + LIPO + NMEDIT + DSYMUTIL ++MANIFEST_TOOL ++ac_ct_AR ++DLLTOOL + OBJDUMP + LN_S + NM +@@ -780,6 +783,7 @@ + with_pic + enable_fast_install + with_gnu_ld ++with_libtool_sysroot + enable_libtool_lock + enable_plugins + enable_largefile +@@ -1456,6 +1460,8 @@ + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] ++ --with-libtool-sysroot=DIR Search for dependent libraries within DIR ++ (or the compiler's sysroot if not specified). + --with-mmap try using mmap for BFD input files if available + --with-separate-debug-dir=DIR + Look for global separate debug info in DIR +@@ -5386,8 +5392,8 @@ + + + +-macro_version='2.2.7a' +-macro_revision='1.3134' ++macro_version='2.4' ++macro_revision='1.3293' + + + +@@ -5427,7 +5433,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 + $as_echo_n "checking how to print strings... " >&6; } + # Test print first, because it will be a builtin if present. +-if test "X`print -r -- -n 2>/dev/null`" = X-n && \ ++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' + elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then +@@ -6113,8 +6119,8 @@ + # Try some XSI features + xsi_shell=no + ( _lt_dummy="a/b/c" +- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ +- = c,a/b,, \ ++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ ++ = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +@@ -6163,6 +6169,80 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 ++$as_echo_n "checking how to convert $build file names to $host format... " >&6; } ++if test "${lt_cv_to_host_file_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ++ ;; ++ esac ++ ;; ++ *-*-cygwin* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ++ ;; ++ esac ++ ;; ++ * ) # unhandled hosts (and "normal" native builds) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++esac ++ ++fi ++ ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 ++$as_echo "$lt_cv_to_host_file_cmd" >&6; } ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 ++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } ++if test "${lt_cv_to_tool_file_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ #assume ordinary cross tools, or native build. ++lt_cv_to_tool_file_cmd=func_convert_file_noop ++case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ esac ++ ;; ++esac ++ ++fi ++ ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 ++$as_echo "$lt_cv_to_tool_file_cmd" >&6; } ++ ++ ++ ++ ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 + $as_echo_n "checking for $LD option to reload object files... " >&6; } + if test "${lt_cv_ld_reload_flag+set}" = set; then : +@@ -6179,6 +6259,11 @@ + esac + reload_cmds='$LD$reload_flag -o $output$reload_objs' + case $host_os in ++ cygwin* | mingw* | pw32* | cegcc*) ++ if test "$GCC" != yes; then ++ reload_cmds=false ++ fi ++ ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' +@@ -6347,7 +6432,8 @@ + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else +- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' ++ # Keep this pattern in sync with the one in func_win32_libid. ++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; +@@ -6501,6 +6587,21 @@ + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 + $as_echo "$lt_cv_deplibs_check_method" >&6; } ++ ++file_magic_glob= ++want_nocaseglob=no ++if test "$build" = "$host"; then ++ case $host_os in ++ mingw* | pw32*) ++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then ++ want_nocaseglob=yes ++ else ++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` ++ fi ++ ;; ++ esac ++fi ++ + file_magic_cmd=$lt_cv_file_magic_cmd + deplibs_check_method=$lt_cv_deplibs_check_method + test -z "$deplibs_check_method" && deplibs_check_method=unknown +@@ -6516,9 +6617,162 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +-set dummy ${ac_tool_prefix}ar; ac_word=$2 ++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. ++set dummy ${ac_tool_prefix}dlltool; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_DLLTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$DLLTOOL"; then ++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++DLLTOOL=$ac_cv_prog_DLLTOOL ++if test -n "$DLLTOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 ++$as_echo "$DLLTOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_DLLTOOL"; then ++ ac_ct_DLLTOOL=$DLLTOOL ++ # Extract the first word of "dlltool", so it can be a program name with args. ++set dummy dlltool; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_DLLTOOL"; then ++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_DLLTOOL="dlltool" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL ++if test -n "$ac_ct_DLLTOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 ++$as_echo "$ac_ct_DLLTOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_DLLTOOL" = x; then ++ DLLTOOL="false" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ DLLTOOL=$ac_ct_DLLTOOL ++ fi ++else ++ DLLTOOL="$ac_cv_prog_DLLTOOL" ++fi ++ ++test -z "$DLLTOOL" && DLLTOOL=dlltool ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 ++$as_echo_n "checking how to associate runtime and link libraries... " >&6; } ++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_sharedlib_from_linklib_cmd='unknown' ++ ++case $host_os in ++cygwin* | mingw* | pw32* | cegcc*) ++ # two different shell functions defined in ltmain.sh ++ # decide which to use based on capabilities of $DLLTOOL ++ case `$DLLTOOL --help 2>&1` in ++ *--identify-strict*) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ++ ;; ++ *) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ++ ;; ++ esac ++ ;; ++*) ++ # fallback: assume linklib IS sharedlib ++ lt_cv_sharedlib_from_linklib_cmd="$ECHO" ++ ;; ++esac ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 ++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } ++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd ++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO ++ ++ ++ ++ ++ ++ ++ ++if test -n "$ac_tool_prefix"; then ++ for ac_prog in ar ++ do ++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. ++set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_prog_AR+set}" = set; then : +@@ -6534,7 +6788,7 @@ + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_AR="${ac_tool_prefix}ar" ++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -6554,11 +6808,15 @@ + fi + + ++ test -n "$AR" && break ++ done + fi +-if test -z "$ac_cv_prog_AR"; then ++if test -z "$AR"; then + ac_ct_AR=$AR +- # Extract the first word of "ar", so it can be a program name with args. +-set dummy ar; ac_word=$2 ++ for ac_prog in ar ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +@@ -6574,7 +6832,7 @@ + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_AR="ar" ++ ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -6593,6 +6851,10 @@ + $as_echo "no" >&6; } + fi + ++ ++ test -n "$ac_ct_AR" && break ++done ++ + if test "x$ac_ct_AR" = x; then + AR="false" + else +@@ -6604,16 +6866,72 @@ + esac + AR=$ac_ct_AR + fi +-else +- AR="$ac_cv_prog_AR" + fi + +-test -z "$AR" && AR=ar +-test -z "$AR_FLAGS" && AR_FLAGS=cru ++: ${AR=ar} ++: ${AR_FLAGS=cru} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 ++$as_echo_n "checking for archiver @FILE support... " >&6; } ++if test "${lt_cv_ar_at_file+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_ar_at_file=no ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ + ++int ++main () ++{ + ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ echo conftest.$ac_objext > conftest.lst ++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 ++ (eval $lt_ar_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if test "$ac_status" -eq 0; then ++ # Ensure the archiver fails upon bogus file names. ++ rm -f conftest.$ac_objext libconftest.a ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 ++ (eval $lt_ar_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if test "$ac_status" -ne 0; then ++ lt_cv_ar_at_file=@ ++ fi ++ fi ++ rm -f conftest.* libconftest.a + ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 ++$as_echo "$lt_cv_ar_at_file" >&6; } ++ ++if test "x$lt_cv_ar_at_file" = xno; then ++ archiver_list_spec= ++else ++ archiver_list_spec=$lt_cv_ar_at_file ++fi + + + +@@ -6955,8 +7273,8 @@ + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + + # Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + + # Handle CRLF in mingw tool chain + opt_cr= +@@ -6992,6 +7310,7 @@ + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi ++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no +@@ -7033,6 +7352,18 @@ + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext ++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ ++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) ++/* DATA imports from DLLs on WIN32 con't be const, because runtime ++ relocations are performed -- see ld's documentation on pseudo-relocs. */ ++# define LT_DLSYM_CONST ++#elif defined(__osf__) ++/* This system does not cope well with relocations in const data. */ ++# define LT_DLSYM_CONST ++#else ++# define LT_DLSYM_CONST const ++#endif ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -7044,7 +7375,7 @@ + cat <<_LT_EOF >> conftest.$ac_ext + + /* The mapping between symbol names and symbols. */ +-const struct { ++LT_DLSYM_CONST struct { + const char *name; + void *address; + } +@@ -7070,8 +7401,8 @@ + _LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext +- lt_save_LIBS="$LIBS" +- lt_save_CFLAGS="$CFLAGS" ++ lt_globsym_save_LIBS=$LIBS ++ lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 +@@ -7081,8 +7412,8 @@ + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi +- LIBS="$lt_save_LIBS" +- CFLAGS="$lt_save_CFLAGS" ++ LIBS=$lt_globsym_save_LIBS ++ CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi +@@ -7119,6 +7450,20 @@ + $as_echo "ok" >&6; } + fi + ++# Response file support. ++if test "$lt_cv_nm_interface" = "MS dumpbin"; then ++ nm_file_list_spec='@' ++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then ++ nm_file_list_spec='@' ++fi ++ ++ ++ ++ ++ ++ ++ ++ + + + +@@ -7138,6 +7483,41 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 ++$as_echo_n "checking for sysroot... " >&6; } ++ ++# Check whether --with-libtool-sysroot was given. ++if test "${with_libtool_sysroot+set}" = set; then : ++ withval=$with_libtool_sysroot; ++else ++ with_libtool_sysroot=no ++fi ++ ++ ++lt_sysroot= ++case ${with_libtool_sysroot} in #( ++ yes) ++ if test "$GCC" = yes; then ++ lt_sysroot=`$CC --print-sysroot 2>/dev/null` ++ fi ++ ;; #( ++ /*) ++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"` ++ ;; #( ++ no|'') ++ ;; #( ++ *) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5 ++$as_echo "${with_libtool_sysroot}" >&6; } ++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5 ++ ;; ++esac ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 ++$as_echo "${lt_sysroot:-no}" >&6; } ++ ++ ++ + + + # Check whether --enable-libtool-lock was given. +@@ -7346,6 +7726,123 @@ + + need_locks="$enable_libtool_lock" + ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. ++set dummy ${ac_tool_prefix}mt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$MANIFEST_TOOL"; then ++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL ++if test -n "$MANIFEST_TOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 ++$as_echo "$MANIFEST_TOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL ++ # Extract the first word of "mt", so it can be a program name with args. ++set dummy mt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_MANIFEST_TOOL"; then ++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL ++if test -n "$ac_ct_MANIFEST_TOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 ++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_MANIFEST_TOOL" = x; then ++ MANIFEST_TOOL=":" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL ++ fi ++else ++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" ++fi ++ ++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 ++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } ++if test "${lt_cv_path_mainfest_tool+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_path_mainfest_tool=no ++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 ++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out ++ cat conftest.err >&5 ++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then ++ lt_cv_path_mainfest_tool=yes ++ fi ++ rm -f conftest* ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 ++$as_echo "$lt_cv_path_mainfest_tool" >&6; } ++if test "x$lt_cv_path_mainfest_tool" != xyes; then ++ MANIFEST_TOOL=: ++fi ++ ++ ++ ++ ++ + + case $host_os in + rhapsody* | darwin*) +@@ -7909,6 +8406,8 @@ + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 ++ echo "$RANLIB libconftest.a" >&5 ++ $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF + int main() { return 0;} + _LT_EOF +@@ -8073,7 +8572,8 @@ + LIBTOOL_DEPS="$ltmain" + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)' ++LIBTOOL="$LIBTOOL/${host_alias}-libtool" + + + +@@ -8162,7 +8662,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=${host_alias}-libtool + can_build_shared=yes + + # All known linkers require a `.a' archive for static linking (except MSVC, +@@ -8460,8 +8960,6 @@ + lt_prog_compiler_pic= + lt_prog_compiler_static= + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +-$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' +@@ -8627,6 +9125,12 @@ + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; ++ nagfor*) ++ # NAG Fortran compiler ++ lt_prog_compiler_wl='-Wl,-Wl,,' ++ lt_prog_compiler_pic='-PIC' ++ lt_prog_compiler_static='-Bstatic' ++ ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) +@@ -8689,7 +9193,7 @@ + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in +- f77* | f90* | f95*) ++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; +@@ -8746,13 +9250,17 @@ + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; + esac +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +-$as_echo "$lt_prog_compiler_pic" >&6; } +- +- +- +- + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 ++$as_echo_n "checking for $compiler option to produce PIC... " >&6; } ++if test "${lt_cv_prog_compiler_pic+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 ++$as_echo "$lt_cv_prog_compiler_pic" >&6; } ++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + + # + # Check to make sure the PIC flag actually works. +@@ -8813,6 +9321,11 @@ + + + ++ ++ ++ ++ ++ + # + # Check to make sure the static flag actually works. + # +@@ -9163,7 +9676,8 @@ + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes +- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +@@ -9211,7 +9725,7 @@ + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then +- tmp_addflag= ++ tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler +@@ -9262,12 +9776,12 @@ + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' +- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' ++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ +- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' ++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac +@@ -9281,8 +9795,8 @@ + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + +@@ -9300,8 +9814,8 @@ + + _LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -9347,8 +9861,8 @@ + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -9478,7 +9992,13 @@ + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath_+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -9491,22 +10011,29 @@ + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath_ ++fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +@@ -9518,7 +10045,13 @@ + else + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath_+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -9531,22 +10064,29 @@ + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath_ ++fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, +@@ -9591,20 +10131,63 @@ + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. +- hardcode_libdir_flag_spec=' ' +- allow_undefined_flag=unsupported +- # Tell ltmain to make .lib files, not .a files. +- libext=lib +- # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" +- # FIXME: Setting linknames here is a bad hack. +- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' +- # The linker will automatically build a .lib file if we build a DLL. +- old_archive_from_new_cmds='true' +- # FIXME: Should let the user specify the lib program. +- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' +- fix_srcfile_path='`cygpath -w "$srcfile"`' +- enable_shared_with_static_runtimes=yes ++ case $cc_basename in ++ cl*) ++ # Native MSVC ++ hardcode_libdir_flag_spec=' ' ++ allow_undefined_flag=unsupported ++ always_export_symbols=yes ++ file_list_spec='@' ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' ++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; ++ else ++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' ++ # The linker will not automatically build a static lib if we build a DLL. ++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true' ++ enable_shared_with_static_runtimes=yes ++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ++ # Don't use ranlib ++ old_postinstall_cmds='chmod 644 $oldlib' ++ postlink_cmds='lt_outputfile="@OUTPUT@"~ ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile="$lt_outputfile.exe" ++ lt_tool_outputfile="$lt_tool_outputfile.exe" ++ ;; ++ esac~ ++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' ++ ;; ++ *) ++ # Assume MSVC wrapper ++ hardcode_libdir_flag_spec=' ' ++ allow_undefined_flag=unsupported ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' ++ # The linker will automatically build a .lib file if we build a DLL. ++ old_archive_from_new_cmds='true' ++ # FIXME: Should let the user specify the lib program. ++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' ++ enable_shared_with_static_runtimes=yes ++ ;; ++ esac + ;; + + darwin* | rhapsody*) +@@ -9665,7 +10248,7 @@ + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) +- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no +@@ -9673,7 +10256,7 @@ + + hpux9*) + if test "$GCC" = yes; then +- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi +@@ -9689,7 +10272,7 @@ + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi +@@ -9713,10 +10296,10 @@ + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else +@@ -9795,23 +10378,36 @@ + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ # This should be the same for all languages, so no per-tag cache variable. ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 ++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } ++if test "${lt_cv_irix_exported_symbol+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-int foo(void) {} ++int foo (void) { return 0; } + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' +- ++ lt_cv_irix_exported_symbol=yes ++else ++ lt_cv_irix_exported_symbol=no + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +- LDFLAGS="$save_LDFLAGS" ++ LDFLAGS="$save_LDFLAGS" ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 ++$as_echo "$lt_cv_irix_exported_symbol" >&6; } ++ if test "$lt_cv_irix_exported_symbol" = yes; then ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ++ fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' +@@ -9896,7 +10492,7 @@ + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' +- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' +@@ -9915,9 +10511,9 @@ + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' +- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) +@@ -10493,8 +11089,9 @@ + need_version=no + need_lib_prefix=no + +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) ++ case $GCC,$cc_basename in ++ yes,*) ++ # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ +@@ -10527,13 +11124,71 @@ + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac ++ dynamic_linker='Win32 ld.exe' ++ ;; ++ ++ *,cl*) ++ # Native MSVC ++ libname_spec='$name' ++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ++ library_names_spec='${libname}.dll.lib' ++ ++ case $build_os in ++ mingw*) ++ sys_lib_search_path_spec= ++ lt_save_ifs=$IFS ++ IFS=';' ++ for lt_path in $LIB ++ do ++ IFS=$lt_save_ifs ++ # Let DOS variable expansion print the short 8.3 style file name. ++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` ++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" ++ done ++ IFS=$lt_save_ifs ++ # Convert to MSYS style. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ++ ;; ++ cygwin*) ++ # Convert to unix form, then to dos form, then back to unix form ++ # but this time dos style (no spaces!) so that the unix form looks ++ # like /cygdrive/c/PROGRA~1:/cygdr... ++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` ++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` ++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ ;; ++ *) ++ sys_lib_search_path_spec="$LIB" ++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then ++ # It is most probably a Windows format PATH. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ # FIXME: find the short name or the path components, as spaces are ++ # common. (e.g. "Program Files" -> "PROGRA~1") ++ ;; ++ esac ++ ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds ++ postinstall_cmds='base_file=`basename \${file}`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ dldir=$destdir/`dirname \$dlpath`~ ++ test -d \$dldir || mkdir -p \$dldir~ ++ $install_prog $dir/$dlname \$dldir/$dlname' ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ ++ dlpath=$dir/\$dldll~ ++ $RM \$dlpath' ++ shlibpath_overrides_runpath=yes ++ dynamic_linker='Win32 link.exe' + ;; + + *) ++ # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ++ dynamic_linker='Win32 ld.exe' + ;; + esac +- dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; +@@ -10625,7 +11280,7 @@ + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +@@ -11465,10 +12120,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -11571,10 +12226,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -15079,7 +15734,7 @@ + if test "$enable_shared" = "yes"; then + x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` + if test -n "$x"; then +- SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" ++ SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a" + fi + + # More hacks to build DLLs on Windows. +@@ -16694,13 +17349,20 @@ + lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' + lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' + lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' ++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' ++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' + reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' + reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' + OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' + deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' + file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' ++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' ++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' ++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' ++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' + AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' + AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' ++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' + STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' + RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' + old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +@@ -16715,14 +17377,17 @@ + lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' ++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' ++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' + objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' + MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' ++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' + lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' + need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' ++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' + DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' + NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' + LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +@@ -16755,12 +17420,12 @@ + hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' + inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' + link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' + always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' + export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' + exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' + include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' + prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' ++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' + file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' + variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' + need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +@@ -16815,8 +17480,13 @@ + OBJDUMP \ + deplibs_check_method \ + file_magic_cmd \ ++file_magic_glob \ ++want_nocaseglob \ ++DLLTOOL \ ++sharedlib_from_linklib_cmd \ + AR \ + AR_FLAGS \ ++archiver_list_spec \ + STRIP \ + RANLIB \ + CC \ +@@ -16826,12 +17496,14 @@ + lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ ++nm_file_list_spec \ + lt_prog_compiler_no_builtin_flag \ +-lt_prog_compiler_wl \ + lt_prog_compiler_pic \ ++lt_prog_compiler_wl \ + lt_prog_compiler_static \ + lt_cv_prog_compiler_c_o \ + need_locks \ ++MANIFEST_TOOL \ + DSYMUTIL \ + NMEDIT \ + LIPO \ +@@ -16847,7 +17519,6 @@ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ +-fix_srcfile_path \ + exclude_expsyms \ + include_expsyms \ + file_list_spec \ +@@ -16883,6 +17554,7 @@ + module_expsym_cmds \ + export_symbols_cmds \ + prelink_cmds \ ++postlink_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + finish_cmds \ +@@ -17662,7 +18334,8 @@ + # NOTE: Changes made to this file will be lost: look at ltmain.sh. + # + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, ++# Inc. + # Written by Gordon Matzigkeit, 1996 + # + # This file is part of GNU Libtool. +@@ -17765,19 +18438,42 @@ + # turn newlines into spaces. + NL2SP=$lt_lt_NL2SP + ++# convert \$build file names to \$host format. ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++ ++# convert \$build files to toolchain format. ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++ + # An object symbol dumper. + OBJDUMP=$lt_OBJDUMP + + # Method to check whether dependent libraries are shared objects. + deplibs_check_method=$lt_deplibs_check_method + +-# Command to use when deplibs_check_method == "file_magic". ++# Command to use when deplibs_check_method = "file_magic". + file_magic_cmd=$lt_file_magic_cmd + ++# How to find potential files when deplibs_check_method = "file_magic". ++file_magic_glob=$lt_file_magic_glob ++ ++# Find potential files using nocaseglob when deplibs_check_method = "file_magic". ++want_nocaseglob=$lt_want_nocaseglob ++ ++# DLL creation program. ++DLLTOOL=$lt_DLLTOOL ++ ++# Command to associate shared and link libraries. ++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd ++ + # The archiver. + AR=$lt_AR ++ ++# Flags to create an archive. + AR_FLAGS=$lt_AR_FLAGS + ++# How to feed a file listing to the archiver. ++archiver_list_spec=$lt_archiver_list_spec ++ + # A symbol stripping program. + STRIP=$lt_STRIP + +@@ -17807,6 +18503,12 @@ + # Transform the output of nm in a C name address pair when lib prefix is needed. + global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + ++# Specify filename containing input files for \$NM. ++nm_file_list_spec=$lt_nm_file_list_spec ++ ++# The root where to search for dependent libraries,and in which our libraries should be installed. ++lt_sysroot=$lt_sysroot ++ + # The name of the directory that contains temporary libtool files. + objdir=$objdir + +@@ -17816,6 +18518,9 @@ + # Must we lock files when doing compilation? + need_locks=$lt_need_locks + ++# Manifest tool. ++MANIFEST_TOOL=$lt_MANIFEST_TOOL ++ + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. + DSYMUTIL=$lt_DSYMUTIL + +@@ -17930,12 +18635,12 @@ + # Compiler flag to turn off builtin functions. + no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +-# How to pass a linker flag through the compiler. +-wl=$lt_lt_prog_compiler_wl +- + # Additional compiler flags for building library objects. + pic_flag=$lt_lt_prog_compiler_pic + ++# How to pass a linker flag through the compiler. ++wl=$lt_lt_prog_compiler_wl ++ + # Compiler flag to prevent dynamic linking. + link_static_flag=$lt_lt_prog_compiler_static + +@@ -18022,9 +18727,6 @@ + # Whether libtool must link a program against all its dependency libraries. + link_all_deplibs=$link_all_deplibs + +-# Fix the shell variable \$srcfile for the compiler. +-fix_srcfile_path=$lt_fix_srcfile_path +- + # Set to "yes" if exported symbols are required. + always_export_symbols=$always_export_symbols + +@@ -18040,6 +18742,9 @@ + # Commands necessary for linking programs (against libraries) with templates. + prelink_cmds=$lt_prelink_cmds + ++# Commands necessary for finishing linking programs. ++postlink_cmds=$lt_postlink_cmds ++ + # Specify filename containing input files. + file_list_spec=$lt_file_list_spec + +@@ -18072,210 +18777,169 @@ + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? +- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) +- +- case $xsi_shell in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result="${1##*/}" +-} +- +-# func_dirname_and_basename file append nondir_replacement +-# perform func_basename and func_dirname in a single function +-# call: +-# dirname: Compute the dirname of FILE. If nonempty, +-# add APPEND to the result, otherwise set result +-# to NONDIR_REPLACEMENT. +-# value returned in "$func_dirname_result" +-# basename: Compute filename of FILE. +-# value retuned in "$func_basename_result" +-# Implementation must be kept synchronized with func_dirname +-# and func_basename. For efficiency, we do not delegate to +-# those functions but instead duplicate the functionality here. +-func_dirname_and_basename () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +- func_basename_result="${1##*/}" +-} +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-func_stripname () +-{ +- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are +- # positional parameters, so assign one to ordinary parameter first. +- func_stripname_result=${3} +- func_stripname_result=${func_stripname_result#"${1}"} +- func_stripname_result=${func_stripname_result%"${2}"} +-} +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=${1%%=*} +- func_opt_split_arg=${1#*=} +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- case ${1} in +- *.lo) func_lo2o_result=${1%.lo}.${objext} ;; +- *) func_lo2o_result=${1} ;; +- esac +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=${1%.*}.lo +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=$(( $* )) +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=${#1} +-} +- +-_LT_EOF +- ;; +- *) # Bourne compatible functions. +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- # Extract subdirectory from the argument. +- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` +- if test "X$func_dirname_result" = "X${1}"; then +- func_dirname_result="${3}" +- else +- func_dirname_result="$func_dirname_result${2}" +- fi +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result=`$ECHO "${1}" | $SED "$basename"` +-} +- +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-# func_strip_suffix prefix name +-func_stripname () +-{ +- case ${2} in +- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; +- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; +- esac +-} +- +-# sed scripts: +-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +-my_sed_long_arg='1s/^-[^=]*=//' +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` +- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=`expr "$@"` +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +-} +- +-_LT_EOF +-esac +- +-case $lt_shell_append in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$1+=\$2" +-} +-_LT_EOF +- ;; +- *) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$1=\$$1\$2" +-} +- +-_LT_EOF +- ;; +- esac ++ sed '$q' "$ltmain" >> "$cfgfile" \ ++ || (rm -f "$cfgfile"; exit 1) + ++ if test x"$xsi_shell" = xyes; then ++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ ++func_dirname ()\ ++{\ ++\ case ${1} in\ ++\ */*) func_dirname_result="${1%/*}${2}" ;;\ ++\ * ) func_dirname_result="${3}" ;;\ ++\ esac\ ++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_basename ()$/,/^} # func_basename /c\ ++func_basename ()\ ++{\ ++\ func_basename_result="${1##*/}"\ ++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ ++func_dirname_and_basename ()\ ++{\ ++\ case ${1} in\ ++\ */*) func_dirname_result="${1%/*}${2}" ;;\ ++\ * ) func_dirname_result="${3}" ;;\ ++\ esac\ ++\ func_basename_result="${1##*/}"\ ++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ ++func_stripname ()\ ++{\ ++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ ++\ # positional parameters, so assign one to ordinary parameter first.\ ++\ func_stripname_result=${3}\ ++\ func_stripname_result=${func_stripname_result#"${1}"}\ ++\ func_stripname_result=${func_stripname_result%"${2}"}\ ++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ ++func_split_long_opt ()\ ++{\ ++\ func_split_long_opt_name=${1%%=*}\ ++\ func_split_long_opt_arg=${1#*=}\ ++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ ++func_split_short_opt ()\ ++{\ ++\ func_split_short_opt_arg=${1#??}\ ++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ ++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ ++func_lo2o ()\ ++{\ ++\ case ${1} in\ ++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ ++\ *) func_lo2o_result=${1} ;;\ ++\ esac\ ++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_xform ()$/,/^} # func_xform /c\ ++func_xform ()\ ++{\ ++ func_xform_result=${1%.*}.lo\ ++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_arith ()$/,/^} # func_arith /c\ ++func_arith ()\ ++{\ ++ func_arith_result=$(( $* ))\ ++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_len ()$/,/^} # func_len /c\ ++func_len ()\ ++{\ ++ func_len_result=${#1}\ ++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++fi ++ ++if test x"$lt_shell_append" = xyes; then ++ sed -e '/^func_append ()$/,/^} # func_append /c\ ++func_append ()\ ++{\ ++ eval "${1}+=\\${2}"\ ++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ ++func_append_quoted ()\ ++{\ ++\ func_quote_for_eval "${2}"\ ++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ ++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ # Save a `func_append' function call where possible by direct use of '+=' ++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++else ++ # Save a `func_append' function call even when '+=' is not available ++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++fi ++ ++if test x"$_lt_function_replace_fail" = x":"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 ++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} ++fi + +- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) + +- mv -f "$cfgfile" "$ofile" || ++ mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +Index: binutils-2.24/opcodes/configure +=================================================================== +--- binutils-2.24.orig/opcodes/configure 2013-11-04 07:33:40.000000000 -0800 ++++ binutils-2.24/opcodes/configure 2013-12-15 11:10:23.873785364 -0800 +@@ -648,6 +648,9 @@ + LIPO + NMEDIT + DSYMUTIL ++MANIFEST_TOOL ++ac_ct_AR ++DLLTOOL + OBJDUMP + LN_S + NM +@@ -760,6 +763,7 @@ + with_pic + enable_fast_install + with_gnu_ld ++with_libtool_sysroot + enable_libtool_lock + enable_targets + enable_werror +@@ -1418,6 +1422,8 @@ + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] ++ --with-libtool-sysroot=DIR Search for dependent libraries within DIR ++ (or the compiler's sysroot if not specified). + + Some influential environment variables: + CC C compiler command +@@ -5113,8 +5119,8 @@ + + + +-macro_version='2.2.7a' +-macro_revision='1.3134' ++macro_version='2.4' ++macro_revision='1.3293' + + + +@@ -5154,7 +5160,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 + $as_echo_n "checking how to print strings... " >&6; } + # Test print first, because it will be a builtin if present. +-if test "X`print -r -- -n 2>/dev/null`" = X-n && \ ++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' + elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then +@@ -5840,8 +5846,8 @@ + # Try some XSI features + xsi_shell=no + ( _lt_dummy="a/b/c" +- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ +- = c,a/b,, \ ++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ ++ = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +@@ -5890,6 +5896,80 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 ++$as_echo_n "checking how to convert $build file names to $host format... " >&6; } ++if test "${lt_cv_to_host_file_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ++ ;; ++ esac ++ ;; ++ *-*-cygwin* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ++ ;; ++ esac ++ ;; ++ * ) # unhandled hosts (and "normal" native builds) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++esac ++ ++fi ++ ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 ++$as_echo "$lt_cv_to_host_file_cmd" >&6; } ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 ++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } ++if test "${lt_cv_to_tool_file_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ #assume ordinary cross tools, or native build. ++lt_cv_to_tool_file_cmd=func_convert_file_noop ++case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ esac ++ ;; ++esac ++ ++fi ++ ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 ++$as_echo "$lt_cv_to_tool_file_cmd" >&6; } ++ ++ ++ ++ ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 + $as_echo_n "checking for $LD option to reload object files... " >&6; } + if test "${lt_cv_ld_reload_flag+set}" = set; then : +@@ -5906,6 +5986,11 @@ + esac + reload_cmds='$LD$reload_flag -o $output$reload_objs' + case $host_os in ++ cygwin* | mingw* | pw32* | cegcc*) ++ if test "$GCC" != yes; then ++ reload_cmds=false ++ fi ++ ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' +@@ -6074,7 +6159,8 @@ + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else +- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' ++ # Keep this pattern in sync with the one in func_win32_libid. ++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; +@@ -6228,6 +6314,21 @@ + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 + $as_echo "$lt_cv_deplibs_check_method" >&6; } ++ ++file_magic_glob= ++want_nocaseglob=no ++if test "$build" = "$host"; then ++ case $host_os in ++ mingw* | pw32*) ++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then ++ want_nocaseglob=yes ++ else ++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` ++ fi ++ ;; ++ esac ++fi ++ + file_magic_cmd=$lt_cv_file_magic_cmd + deplibs_check_method=$lt_cv_deplibs_check_method + test -z "$deplibs_check_method" && deplibs_check_method=unknown +@@ -6243,9 +6344,162 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +-set dummy ${ac_tool_prefix}ar; ac_word=$2 ++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. ++set dummy ${ac_tool_prefix}dlltool; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_DLLTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$DLLTOOL"; then ++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++DLLTOOL=$ac_cv_prog_DLLTOOL ++if test -n "$DLLTOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 ++$as_echo "$DLLTOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_DLLTOOL"; then ++ ac_ct_DLLTOOL=$DLLTOOL ++ # Extract the first word of "dlltool", so it can be a program name with args. ++set dummy dlltool; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_DLLTOOL"; then ++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_DLLTOOL="dlltool" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL ++if test -n "$ac_ct_DLLTOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 ++$as_echo "$ac_ct_DLLTOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_DLLTOOL" = x; then ++ DLLTOOL="false" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ DLLTOOL=$ac_ct_DLLTOOL ++ fi ++else ++ DLLTOOL="$ac_cv_prog_DLLTOOL" ++fi ++ ++test -z "$DLLTOOL" && DLLTOOL=dlltool ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 ++$as_echo_n "checking how to associate runtime and link libraries... " >&6; } ++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_sharedlib_from_linklib_cmd='unknown' ++ ++case $host_os in ++cygwin* | mingw* | pw32* | cegcc*) ++ # two different shell functions defined in ltmain.sh ++ # decide which to use based on capabilities of $DLLTOOL ++ case `$DLLTOOL --help 2>&1` in ++ *--identify-strict*) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ++ ;; ++ *) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ++ ;; ++ esac ++ ;; ++*) ++ # fallback: assume linklib IS sharedlib ++ lt_cv_sharedlib_from_linklib_cmd="$ECHO" ++ ;; ++esac ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 ++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } ++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd ++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO ++ ++ ++ ++ ++ ++ ++ ++if test -n "$ac_tool_prefix"; then ++ for ac_prog in ar ++ do ++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. ++set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_prog_AR+set}" = set; then : +@@ -6261,7 +6515,7 @@ + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_AR="${ac_tool_prefix}ar" ++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -6281,11 +6535,15 @@ + fi + + ++ test -n "$AR" && break ++ done + fi +-if test -z "$ac_cv_prog_AR"; then ++if test -z "$AR"; then + ac_ct_AR=$AR +- # Extract the first word of "ar", so it can be a program name with args. +-set dummy ar; ac_word=$2 ++ for ac_prog in ar ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +@@ -6301,7 +6559,7 @@ + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_AR="ar" ++ ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -6320,6 +6578,10 @@ + $as_echo "no" >&6; } + fi + ++ ++ test -n "$ac_ct_AR" && break ++done ++ + if test "x$ac_ct_AR" = x; then + AR="false" + else +@@ -6331,12 +6593,11 @@ + esac + AR=$ac_ct_AR + fi +-else +- AR="$ac_cv_prog_AR" + fi + +-test -z "$AR" && AR=ar +-test -z "$AR_FLAGS" && AR_FLAGS=cru ++: ${AR=ar} ++: ${AR_FLAGS=cru} ++ + + + +@@ -6347,6 +6608,63 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 ++$as_echo_n "checking for archiver @FILE support... " >&6; } ++if test "${lt_cv_ar_at_file+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_ar_at_file=no ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ echo conftest.$ac_objext > conftest.lst ++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 ++ (eval $lt_ar_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if test "$ac_status" -eq 0; then ++ # Ensure the archiver fails upon bogus file names. ++ rm -f conftest.$ac_objext libconftest.a ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 ++ (eval $lt_ar_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if test "$ac_status" -ne 0; then ++ lt_cv_ar_at_file=@ ++ fi ++ fi ++ rm -f conftest.* libconftest.a ++ ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 ++$as_echo "$lt_cv_ar_at_file" >&6; } ++ ++if test "x$lt_cv_ar_at_file" = xno; then ++ archiver_list_spec= ++else ++ archiver_list_spec=$lt_cv_ar_at_file ++fi ++ ++ ++ ++ ++ ++ + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +@@ -6682,8 +7000,8 @@ + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + + # Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + + # Handle CRLF in mingw tool chain + opt_cr= +@@ -6719,6 +7037,7 @@ + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi ++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no +@@ -6760,6 +7079,18 @@ + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext ++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ ++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) ++/* DATA imports from DLLs on WIN32 con't be const, because runtime ++ relocations are performed -- see ld's documentation on pseudo-relocs. */ ++# define LT_DLSYM_CONST ++#elif defined(__osf__) ++/* This system does not cope well with relocations in const data. */ ++# define LT_DLSYM_CONST ++#else ++# define LT_DLSYM_CONST const ++#endif ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -6771,7 +7102,7 @@ + cat <<_LT_EOF >> conftest.$ac_ext + + /* The mapping between symbol names and symbols. */ +-const struct { ++LT_DLSYM_CONST struct { + const char *name; + void *address; + } +@@ -6797,8 +7128,8 @@ + _LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext +- lt_save_LIBS="$LIBS" +- lt_save_CFLAGS="$CFLAGS" ++ lt_globsym_save_LIBS=$LIBS ++ lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 +@@ -6808,8 +7139,8 @@ + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi +- LIBS="$lt_save_LIBS" +- CFLAGS="$lt_save_CFLAGS" ++ LIBS=$lt_globsym_save_LIBS ++ CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi +@@ -6846,6 +7177,14 @@ + $as_echo "ok" >&6; } + fi + ++# Response file support. ++if test "$lt_cv_nm_interface" = "MS dumpbin"; then ++ nm_file_list_spec='@' ++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then ++ nm_file_list_spec='@' ++fi ++ ++ + + + +@@ -6867,6 +7206,47 @@ + + + ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 ++$as_echo_n "checking for sysroot... " >&6; } ++ ++# Check whether --with-libtool-sysroot was given. ++if test "${with_libtool_sysroot+set}" = set; then : ++ withval=$with_libtool_sysroot; ++else ++ with_libtool_sysroot=no ++fi ++ ++ ++lt_sysroot= ++case ${with_libtool_sysroot} in #( ++ yes) ++ if test "$GCC" = yes; then ++ lt_sysroot=`$CC --print-sysroot 2>/dev/null` ++ fi ++ ;; #( ++ /*) ++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"` ++ ;; #( ++ no|'') ++ ;; #( ++ *) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5 ++$as_echo "${with_libtool_sysroot}" >&6; } ++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5 ++ ;; ++esac ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 ++$as_echo "${lt_sysroot:-no}" >&6; } ++ ++ ++ ++ ++ + # Check whether --enable-libtool-lock was given. + if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +@@ -7073,6 +7453,123 @@ + + need_locks="$enable_libtool_lock" + ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. ++set dummy ${ac_tool_prefix}mt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$MANIFEST_TOOL"; then ++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL ++if test -n "$MANIFEST_TOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 ++$as_echo "$MANIFEST_TOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL ++ # Extract the first word of "mt", so it can be a program name with args. ++set dummy mt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_MANIFEST_TOOL"; then ++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL ++if test -n "$ac_ct_MANIFEST_TOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 ++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_MANIFEST_TOOL" = x; then ++ MANIFEST_TOOL=":" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL ++ fi ++else ++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" ++fi ++ ++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 ++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } ++if test "${lt_cv_path_mainfest_tool+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_path_mainfest_tool=no ++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 ++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out ++ cat conftest.err >&5 ++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then ++ lt_cv_path_mainfest_tool=yes ++ fi ++ rm -f conftest* ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 ++$as_echo "$lt_cv_path_mainfest_tool" >&6; } ++if test "x$lt_cv_path_mainfest_tool" != xyes; then ++ MANIFEST_TOOL=: ++fi ++ ++ ++ ++ ++ + + case $host_os in + rhapsody* | darwin*) +@@ -7636,6 +8133,8 @@ + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 ++ echo "$RANLIB libconftest.a" >&5 ++ $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF + int main() { return 0;} + _LT_EOF +@@ -7801,7 +8300,8 @@ + LIBTOOL_DEPS="$ltmain" + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)' ++LIBTOOL="$LIBTOOL/${host_alias}-libtool" + + + +@@ -7890,7 +8390,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=${host_alias}-libtool + can_build_shared=yes + + # All known linkers require a `.a' archive for static linking (except MSVC, +@@ -8188,8 +8688,6 @@ + lt_prog_compiler_pic= + lt_prog_compiler_static= + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +-$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' +@@ -8355,6 +8853,12 @@ + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; ++ nagfor*) ++ # NAG Fortran compiler ++ lt_prog_compiler_wl='-Wl,-Wl,,' ++ lt_prog_compiler_pic='-PIC' ++ lt_prog_compiler_static='-Bstatic' ++ ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) +@@ -8417,7 +8921,7 @@ + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in +- f77* | f90* | f95*) ++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; +@@ -8474,13 +8978,17 @@ + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; + esac +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +-$as_echo "$lt_prog_compiler_pic" >&6; } +- +- +- +- + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 ++$as_echo_n "checking for $compiler option to produce PIC... " >&6; } ++if test "${lt_cv_prog_compiler_pic+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 ++$as_echo "$lt_cv_prog_compiler_pic" >&6; } ++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + + # + # Check to make sure the PIC flag actually works. +@@ -8541,6 +9049,11 @@ + + + ++ ++ ++ ++ ++ + # + # Check to make sure the static flag actually works. + # +@@ -8891,7 +9404,8 @@ + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes +- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +@@ -8939,7 +9453,7 @@ + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then +- tmp_addflag= ++ tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler +@@ -8990,12 +9504,12 @@ + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' +- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' ++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ +- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' ++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac +@@ -9009,8 +9523,8 @@ + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + +@@ -9028,8 +9542,8 @@ + + _LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -9075,8 +9589,8 @@ + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -9206,7 +9720,13 @@ + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath_+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -9219,22 +9739,29 @@ + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath_ ++fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +@@ -9246,7 +9773,13 @@ + else + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath_+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -9259,22 +9792,29 @@ + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath_ ++fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, +@@ -9319,20 +9859,63 @@ + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. +- hardcode_libdir_flag_spec=' ' +- allow_undefined_flag=unsupported +- # Tell ltmain to make .lib files, not .a files. +- libext=lib +- # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" +- # FIXME: Setting linknames here is a bad hack. +- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' +- # The linker will automatically build a .lib file if we build a DLL. +- old_archive_from_new_cmds='true' +- # FIXME: Should let the user specify the lib program. +- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' +- fix_srcfile_path='`cygpath -w "$srcfile"`' +- enable_shared_with_static_runtimes=yes ++ case $cc_basename in ++ cl*) ++ # Native MSVC ++ hardcode_libdir_flag_spec=' ' ++ allow_undefined_flag=unsupported ++ always_export_symbols=yes ++ file_list_spec='@' ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' ++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; ++ else ++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' ++ # The linker will not automatically build a static lib if we build a DLL. ++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true' ++ enable_shared_with_static_runtimes=yes ++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ++ # Don't use ranlib ++ old_postinstall_cmds='chmod 644 $oldlib' ++ postlink_cmds='lt_outputfile="@OUTPUT@"~ ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile="$lt_outputfile.exe" ++ lt_tool_outputfile="$lt_tool_outputfile.exe" ++ ;; ++ esac~ ++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' ++ ;; ++ *) ++ # Assume MSVC wrapper ++ hardcode_libdir_flag_spec=' ' ++ allow_undefined_flag=unsupported ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' ++ # The linker will automatically build a .lib file if we build a DLL. ++ old_archive_from_new_cmds='true' ++ # FIXME: Should let the user specify the lib program. ++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' ++ enable_shared_with_static_runtimes=yes ++ ;; ++ esac + ;; + + darwin* | rhapsody*) +@@ -9393,7 +9976,7 @@ + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) +- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no +@@ -9401,7 +9984,7 @@ + + hpux9*) + if test "$GCC" = yes; then +- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi +@@ -9417,7 +10000,7 @@ + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi +@@ -9441,10 +10024,10 @@ + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else +@@ -9523,23 +10106,36 @@ + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ # This should be the same for all languages, so no per-tag cache variable. ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 ++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } ++if test "${lt_cv_irix_exported_symbol+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-int foo(void) {} ++int foo (void) { return 0; } + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' +- ++ lt_cv_irix_exported_symbol=yes ++else ++ lt_cv_irix_exported_symbol=no + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +- LDFLAGS="$save_LDFLAGS" ++ LDFLAGS="$save_LDFLAGS" ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 ++$as_echo "$lt_cv_irix_exported_symbol" >&6; } ++ if test "$lt_cv_irix_exported_symbol" = yes; then ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ++ fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' +@@ -9624,7 +10220,7 @@ + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' +- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' +@@ -9643,9 +10239,9 @@ + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' +- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) +@@ -10221,8 +10817,9 @@ + need_version=no + need_lib_prefix=no + +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) ++ case $GCC,$cc_basename in ++ yes,*) ++ # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ +@@ -10255,13 +10852,71 @@ + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac ++ dynamic_linker='Win32 ld.exe' ++ ;; ++ ++ *,cl*) ++ # Native MSVC ++ libname_spec='$name' ++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ++ library_names_spec='${libname}.dll.lib' ++ ++ case $build_os in ++ mingw*) ++ sys_lib_search_path_spec= ++ lt_save_ifs=$IFS ++ IFS=';' ++ for lt_path in $LIB ++ do ++ IFS=$lt_save_ifs ++ # Let DOS variable expansion print the short 8.3 style file name. ++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` ++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" ++ done ++ IFS=$lt_save_ifs ++ # Convert to MSYS style. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ++ ;; ++ cygwin*) ++ # Convert to unix form, then to dos form, then back to unix form ++ # but this time dos style (no spaces!) so that the unix form looks ++ # like /cygdrive/c/PROGRA~1:/cygdr... ++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` ++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` ++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ ;; ++ *) ++ sys_lib_search_path_spec="$LIB" ++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then ++ # It is most probably a Windows format PATH. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ # FIXME: find the short name or the path components, as spaces are ++ # common. (e.g. "Program Files" -> "PROGRA~1") ++ ;; ++ esac ++ ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds ++ postinstall_cmds='base_file=`basename \${file}`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ dldir=$destdir/`dirname \$dlpath`~ ++ test -d \$dldir || mkdir -p \$dldir~ ++ $install_prog $dir/$dlname \$dldir/$dlname' ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ ++ dlpath=$dir/\$dldll~ ++ $RM \$dlpath' ++ shlibpath_overrides_runpath=yes ++ dynamic_linker='Win32 link.exe' + ;; + + *) ++ # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ++ dynamic_linker='Win32 ld.exe' + ;; + esac +- dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; +@@ -10353,7 +11008,7 @@ + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +@@ -11193,10 +11848,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -11299,10 +11954,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -12415,7 +13070,7 @@ + # since libbfd may not pull in the entirety of libiberty. + x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` + if test -n "$x"; then +- SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" ++ SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a" + fi + + case "${host}" in +@@ -13387,13 +14042,20 @@ + lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' + lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' + lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' ++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' ++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' + reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' + reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' + OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' + deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' + file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' ++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' ++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' ++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' ++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' + AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' + AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' ++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' + STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' + RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' + old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +@@ -13408,14 +14070,17 @@ + lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' ++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' ++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' + objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' + MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' ++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' + lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' + need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' ++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' + DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' + NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' + LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +@@ -13448,12 +14113,12 @@ + hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' + inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' + link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' + always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' + export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' + exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' + include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' + prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' ++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' + file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' + variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' + need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +@@ -13508,8 +14173,13 @@ + OBJDUMP \ + deplibs_check_method \ + file_magic_cmd \ ++file_magic_glob \ ++want_nocaseglob \ ++DLLTOOL \ ++sharedlib_from_linklib_cmd \ + AR \ + AR_FLAGS \ ++archiver_list_spec \ + STRIP \ + RANLIB \ + CC \ +@@ -13519,12 +14189,14 @@ + lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ ++nm_file_list_spec \ + lt_prog_compiler_no_builtin_flag \ +-lt_prog_compiler_wl \ + lt_prog_compiler_pic \ ++lt_prog_compiler_wl \ + lt_prog_compiler_static \ + lt_cv_prog_compiler_c_o \ + need_locks \ ++MANIFEST_TOOL \ + DSYMUTIL \ + NMEDIT \ + LIPO \ +@@ -13540,7 +14212,6 @@ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ +-fix_srcfile_path \ + exclude_expsyms \ + include_expsyms \ + file_list_spec \ +@@ -13576,6 +14247,7 @@ + module_expsym_cmds \ + export_symbols_cmds \ + prelink_cmds \ ++postlink_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + finish_cmds \ +@@ -14332,7 +15004,8 @@ + # NOTE: Changes made to this file will be lost: look at ltmain.sh. + # + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, ++# Inc. + # Written by Gordon Matzigkeit, 1996 + # + # This file is part of GNU Libtool. +@@ -14435,19 +15108,42 @@ + # turn newlines into spaces. + NL2SP=$lt_lt_NL2SP + ++# convert \$build file names to \$host format. ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++ ++# convert \$build files to toolchain format. ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++ + # An object symbol dumper. + OBJDUMP=$lt_OBJDUMP + + # Method to check whether dependent libraries are shared objects. + deplibs_check_method=$lt_deplibs_check_method + +-# Command to use when deplibs_check_method == "file_magic". ++# Command to use when deplibs_check_method = "file_magic". + file_magic_cmd=$lt_file_magic_cmd + ++# How to find potential files when deplibs_check_method = "file_magic". ++file_magic_glob=$lt_file_magic_glob ++ ++# Find potential files using nocaseglob when deplibs_check_method = "file_magic". ++want_nocaseglob=$lt_want_nocaseglob ++ ++# DLL creation program. ++DLLTOOL=$lt_DLLTOOL ++ ++# Command to associate shared and link libraries. ++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd ++ + # The archiver. + AR=$lt_AR ++ ++# Flags to create an archive. + AR_FLAGS=$lt_AR_FLAGS + ++# How to feed a file listing to the archiver. ++archiver_list_spec=$lt_archiver_list_spec ++ + # A symbol stripping program. + STRIP=$lt_STRIP + +@@ -14477,6 +15173,12 @@ + # Transform the output of nm in a C name address pair when lib prefix is needed. + global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + ++# Specify filename containing input files for \$NM. ++nm_file_list_spec=$lt_nm_file_list_spec ++ ++# The root where to search for dependent libraries,and in which our libraries should be installed. ++lt_sysroot=$lt_sysroot ++ + # The name of the directory that contains temporary libtool files. + objdir=$objdir + +@@ -14486,6 +15188,9 @@ + # Must we lock files when doing compilation? + need_locks=$lt_need_locks + ++# Manifest tool. ++MANIFEST_TOOL=$lt_MANIFEST_TOOL ++ + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. + DSYMUTIL=$lt_DSYMUTIL + +@@ -14600,12 +15305,12 @@ + # Compiler flag to turn off builtin functions. + no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +-# How to pass a linker flag through the compiler. +-wl=$lt_lt_prog_compiler_wl +- + # Additional compiler flags for building library objects. + pic_flag=$lt_lt_prog_compiler_pic + ++# How to pass a linker flag through the compiler. ++wl=$lt_lt_prog_compiler_wl ++ + # Compiler flag to prevent dynamic linking. + link_static_flag=$lt_lt_prog_compiler_static + +@@ -14692,9 +15397,6 @@ + # Whether libtool must link a program against all its dependency libraries. + link_all_deplibs=$link_all_deplibs + +-# Fix the shell variable \$srcfile for the compiler. +-fix_srcfile_path=$lt_fix_srcfile_path +- + # Set to "yes" if exported symbols are required. + always_export_symbols=$always_export_symbols + +@@ -14710,6 +15412,9 @@ + # Commands necessary for linking programs (against libraries) with templates. + prelink_cmds=$lt_prelink_cmds + ++# Commands necessary for finishing linking programs. ++postlink_cmds=$lt_postlink_cmds ++ + # Specify filename containing input files. + file_list_spec=$lt_file_list_spec + +@@ -14742,210 +15447,169 @@ + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? +- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) +- +- case $xsi_shell in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result="${1##*/}" +-} +- +-# func_dirname_and_basename file append nondir_replacement +-# perform func_basename and func_dirname in a single function +-# call: +-# dirname: Compute the dirname of FILE. If nonempty, +-# add APPEND to the result, otherwise set result +-# to NONDIR_REPLACEMENT. +-# value returned in "$func_dirname_result" +-# basename: Compute filename of FILE. +-# value retuned in "$func_basename_result" +-# Implementation must be kept synchronized with func_dirname +-# and func_basename. For efficiency, we do not delegate to +-# those functions but instead duplicate the functionality here. +-func_dirname_and_basename () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +- func_basename_result="${1##*/}" +-} +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-func_stripname () +-{ +- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are +- # positional parameters, so assign one to ordinary parameter first. +- func_stripname_result=${3} +- func_stripname_result=${func_stripname_result#"${1}"} +- func_stripname_result=${func_stripname_result%"${2}"} +-} +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=${1%%=*} +- func_opt_split_arg=${1#*=} +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- case ${1} in +- *.lo) func_lo2o_result=${1%.lo}.${objext} ;; +- *) func_lo2o_result=${1} ;; +- esac +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=${1%.*}.lo +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=$(( $* )) +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=${#1} +-} +- +-_LT_EOF +- ;; +- *) # Bourne compatible functions. +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- # Extract subdirectory from the argument. +- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` +- if test "X$func_dirname_result" = "X${1}"; then +- func_dirname_result="${3}" +- else +- func_dirname_result="$func_dirname_result${2}" +- fi +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result=`$ECHO "${1}" | $SED "$basename"` +-} +- +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-# func_strip_suffix prefix name +-func_stripname () +-{ +- case ${2} in +- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; +- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; +- esac +-} +- +-# sed scripts: +-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +-my_sed_long_arg='1s/^-[^=]*=//' +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` +- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=`expr "$@"` +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +-} +- +-_LT_EOF +-esac +- +-case $lt_shell_append in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$1+=\$2" +-} +-_LT_EOF +- ;; +- *) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$1=\$$1\$2" +-} +- +-_LT_EOF +- ;; +- esac ++ sed '$q' "$ltmain" >> "$cfgfile" \ ++ || (rm -f "$cfgfile"; exit 1) + ++ if test x"$xsi_shell" = xyes; then ++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ ++func_dirname ()\ ++{\ ++\ case ${1} in\ ++\ */*) func_dirname_result="${1%/*}${2}" ;;\ ++\ * ) func_dirname_result="${3}" ;;\ ++\ esac\ ++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_basename ()$/,/^} # func_basename /c\ ++func_basename ()\ ++{\ ++\ func_basename_result="${1##*/}"\ ++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ ++func_dirname_and_basename ()\ ++{\ ++\ case ${1} in\ ++\ */*) func_dirname_result="${1%/*}${2}" ;;\ ++\ * ) func_dirname_result="${3}" ;;\ ++\ esac\ ++\ func_basename_result="${1##*/}"\ ++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ ++func_stripname ()\ ++{\ ++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ ++\ # positional parameters, so assign one to ordinary parameter first.\ ++\ func_stripname_result=${3}\ ++\ func_stripname_result=${func_stripname_result#"${1}"}\ ++\ func_stripname_result=${func_stripname_result%"${2}"}\ ++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ ++func_split_long_opt ()\ ++{\ ++\ func_split_long_opt_name=${1%%=*}\ ++\ func_split_long_opt_arg=${1#*=}\ ++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ ++func_split_short_opt ()\ ++{\ ++\ func_split_short_opt_arg=${1#??}\ ++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ ++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ ++func_lo2o ()\ ++{\ ++\ case ${1} in\ ++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ ++\ *) func_lo2o_result=${1} ;;\ ++\ esac\ ++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_xform ()$/,/^} # func_xform /c\ ++func_xform ()\ ++{\ ++ func_xform_result=${1%.*}.lo\ ++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_arith ()$/,/^} # func_arith /c\ ++func_arith ()\ ++{\ ++ func_arith_result=$(( $* ))\ ++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_len ()$/,/^} # func_len /c\ ++func_len ()\ ++{\ ++ func_len_result=${#1}\ ++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++fi ++ ++if test x"$lt_shell_append" = xyes; then ++ sed -e '/^func_append ()$/,/^} # func_append /c\ ++func_append ()\ ++{\ ++ eval "${1}+=\\${2}"\ ++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ ++func_append_quoted ()\ ++{\ ++\ func_quote_for_eval "${2}"\ ++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ ++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ # Save a `func_append' function call where possible by direct use of '+=' ++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++else ++ # Save a `func_append' function call even when '+=' is not available ++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++fi ++ ++if test x"$_lt_function_replace_fail" = x":"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 ++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} ++fi + +- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) + +- mv -f "$cfgfile" "$ofile" || ++ mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +Index: binutils-2.24/binutils/configure +=================================================================== +--- binutils-2.24.orig/binutils/configure 2013-11-04 07:33:37.000000000 -0800 ++++ binutils-2.24/binutils/configure 2013-12-15 11:10:23.877118697 -0800 +@@ -655,8 +655,11 @@ + LIPO + NMEDIT + DSYMUTIL ++MANIFEST_TOOL + RANLIB ++ac_ct_AR + AR ++DLLTOOL + OBJDUMP + LN_S + NM +@@ -769,6 +772,7 @@ + with_pic + enable_fast_install + with_gnu_ld ++with_libtool_sysroot + enable_libtool_lock + enable_targets + enable_deterministic_archives +@@ -1434,6 +1438,8 @@ + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] ++ --with-libtool-sysroot=DIR Search for dependent libraries within DIR ++ (or the compiler's sysroot if not specified). + --with-zlib include zlib support (auto/yes/no) default=auto + --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib +@@ -5152,8 +5158,8 @@ + + + +-macro_version='2.2.7a' +-macro_revision='1.3134' ++macro_version='2.4' ++macro_revision='1.3293' + + + +@@ -5193,7 +5199,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 + $as_echo_n "checking how to print strings... " >&6; } + # Test print first, because it will be a builtin if present. +-if test "X`print -r -- -n 2>/dev/null`" = X-n && \ ++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' + elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then +@@ -5879,8 +5885,8 @@ + # Try some XSI features + xsi_shell=no + ( _lt_dummy="a/b/c" +- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ +- = c,a/b,, \ ++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ ++ = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +@@ -5929,6 +5935,80 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 ++$as_echo_n "checking how to convert $build file names to $host format... " >&6; } ++if test "${lt_cv_to_host_file_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ++ ;; ++ esac ++ ;; ++ *-*-cygwin* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ++ ;; ++ esac ++ ;; ++ * ) # unhandled hosts (and "normal" native builds) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++esac ++ ++fi ++ ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 ++$as_echo "$lt_cv_to_host_file_cmd" >&6; } ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 ++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } ++if test "${lt_cv_to_tool_file_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ #assume ordinary cross tools, or native build. ++lt_cv_to_tool_file_cmd=func_convert_file_noop ++case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ esac ++ ;; ++esac ++ ++fi ++ ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 ++$as_echo "$lt_cv_to_tool_file_cmd" >&6; } ++ ++ ++ ++ ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 + $as_echo_n "checking for $LD option to reload object files... " >&6; } + if test "${lt_cv_ld_reload_flag+set}" = set; then : +@@ -5945,6 +6025,11 @@ + esac + reload_cmds='$LD$reload_flag -o $output$reload_objs' + case $host_os in ++ cygwin* | mingw* | pw32* | cegcc*) ++ if test "$GCC" != yes; then ++ reload_cmds=false ++ fi ++ ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' +@@ -6113,7 +6198,8 @@ + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else +- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' ++ # Keep this pattern in sync with the one in func_win32_libid. ++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; +@@ -6267,6 +6353,21 @@ + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 + $as_echo "$lt_cv_deplibs_check_method" >&6; } ++ ++file_magic_glob= ++want_nocaseglob=no ++if test "$build" = "$host"; then ++ case $host_os in ++ mingw* | pw32*) ++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then ++ want_nocaseglob=yes ++ else ++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` ++ fi ++ ;; ++ esac ++fi ++ + file_magic_cmd=$lt_cv_file_magic_cmd + deplibs_check_method=$lt_cv_deplibs_check_method + test -z "$deplibs_check_method" && deplibs_check_method=unknown +@@ -6282,9 +6383,162 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +-set dummy ${ac_tool_prefix}ar; ac_word=$2 ++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. ++set dummy ${ac_tool_prefix}dlltool; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_DLLTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$DLLTOOL"; then ++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++DLLTOOL=$ac_cv_prog_DLLTOOL ++if test -n "$DLLTOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 ++$as_echo "$DLLTOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_DLLTOOL"; then ++ ac_ct_DLLTOOL=$DLLTOOL ++ # Extract the first word of "dlltool", so it can be a program name with args. ++set dummy dlltool; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_DLLTOOL"; then ++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_DLLTOOL="dlltool" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL ++if test -n "$ac_ct_DLLTOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 ++$as_echo "$ac_ct_DLLTOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_DLLTOOL" = x; then ++ DLLTOOL="false" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ DLLTOOL=$ac_ct_DLLTOOL ++ fi ++else ++ DLLTOOL="$ac_cv_prog_DLLTOOL" ++fi ++ ++test -z "$DLLTOOL" && DLLTOOL=dlltool ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 ++$as_echo_n "checking how to associate runtime and link libraries... " >&6; } ++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_sharedlib_from_linklib_cmd='unknown' ++ ++case $host_os in ++cygwin* | mingw* | pw32* | cegcc*) ++ # two different shell functions defined in ltmain.sh ++ # decide which to use based on capabilities of $DLLTOOL ++ case `$DLLTOOL --help 2>&1` in ++ *--identify-strict*) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ++ ;; ++ *) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ++ ;; ++ esac ++ ;; ++*) ++ # fallback: assume linklib IS sharedlib ++ lt_cv_sharedlib_from_linklib_cmd="$ECHO" ++ ;; ++esac ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 ++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } ++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd ++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO ++ ++ ++ ++ ++ ++ ++ ++if test -n "$ac_tool_prefix"; then ++ for ac_prog in ar ++ do ++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. ++set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_prog_AR+set}" = set; then : +@@ -6300,7 +6554,7 @@ + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_AR="${ac_tool_prefix}ar" ++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -6320,11 +6574,15 @@ + fi + + ++ test -n "$AR" && break ++ done + fi +-if test -z "$ac_cv_prog_AR"; then ++if test -z "$AR"; then + ac_ct_AR=$AR +- # Extract the first word of "ar", so it can be a program name with args. +-set dummy ar; ac_word=$2 ++ for ac_prog in ar ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +@@ -6340,7 +6598,7 @@ + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_AR="ar" ++ ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -6359,6 +6617,10 @@ + $as_echo "no" >&6; } + fi + ++ ++ test -n "$ac_ct_AR" && break ++done ++ + if test "x$ac_ct_AR" = x; then + AR="false" + else +@@ -6370,12 +6632,10 @@ + esac + AR=$ac_ct_AR + fi +-else +- AR="$ac_cv_prog_AR" + fi + +-test -z "$AR" && AR=ar +-test -z "$AR_FLAGS" && AR_FLAGS=cru ++: ${AR=ar} ++: ${AR_FLAGS=cru} + + + +@@ -6387,6 +6647,64 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 ++$as_echo_n "checking for archiver @FILE support... " >&6; } ++if test "${lt_cv_ar_at_file+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_ar_at_file=no ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ echo conftest.$ac_objext > conftest.lst ++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 ++ (eval $lt_ar_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if test "$ac_status" -eq 0; then ++ # Ensure the archiver fails upon bogus file names. ++ rm -f conftest.$ac_objext libconftest.a ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 ++ (eval $lt_ar_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if test "$ac_status" -ne 0; then ++ lt_cv_ar_at_file=@ ++ fi ++ fi ++ rm -f conftest.* libconftest.a ++ ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 ++$as_echo "$lt_cv_ar_at_file" >&6; } ++ ++if test "x$lt_cv_ar_at_file" = xno; then ++ archiver_list_spec= ++else ++ archiver_list_spec=$lt_cv_ar_at_file ++fi ++ ++ ++ ++ ++ ++ ++ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. + set dummy ${ac_tool_prefix}strip; ac_word=$2 +@@ -6721,8 +7039,8 @@ + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + + # Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + + # Handle CRLF in mingw tool chain + opt_cr= +@@ -6758,6 +7076,7 @@ + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi ++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no +@@ -6799,6 +7118,18 @@ + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext ++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ ++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) ++/* DATA imports from DLLs on WIN32 con't be const, because runtime ++ relocations are performed -- see ld's documentation on pseudo-relocs. */ ++# define LT_DLSYM_CONST ++#elif defined(__osf__) ++/* This system does not cope well with relocations in const data. */ ++# define LT_DLSYM_CONST ++#else ++# define LT_DLSYM_CONST const ++#endif ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -6810,7 +7141,7 @@ + cat <<_LT_EOF >> conftest.$ac_ext + + /* The mapping between symbol names and symbols. */ +-const struct { ++LT_DLSYM_CONST struct { + const char *name; + void *address; + } +@@ -6836,8 +7167,8 @@ + _LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext +- lt_save_LIBS="$LIBS" +- lt_save_CFLAGS="$CFLAGS" ++ lt_globsym_save_LIBS=$LIBS ++ lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 +@@ -6847,8 +7178,8 @@ + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi +- LIBS="$lt_save_LIBS" +- CFLAGS="$lt_save_CFLAGS" ++ LIBS=$lt_globsym_save_LIBS ++ CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi +@@ -6885,6 +7216,19 @@ + $as_echo "ok" >&6; } + fi + ++# Response file support. ++if test "$lt_cv_nm_interface" = "MS dumpbin"; then ++ nm_file_list_spec='@' ++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then ++ nm_file_list_spec='@' ++fi ++ ++ ++ ++ ++ ++ ++ + + + +@@ -6905,6 +7249,42 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 ++$as_echo_n "checking for sysroot... " >&6; } ++ ++# Check whether --with-libtool-sysroot was given. ++if test "${with_libtool_sysroot+set}" = set; then : ++ withval=$with_libtool_sysroot; ++else ++ with_libtool_sysroot=no ++fi ++ ++ ++lt_sysroot= ++case ${with_libtool_sysroot} in #( ++ yes) ++ if test "$GCC" = yes; then ++ lt_sysroot=`$CC --print-sysroot 2>/dev/null` ++ fi ++ ;; #( ++ /*) ++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"` ++ ;; #( ++ no|'') ++ ;; #( ++ *) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5 ++$as_echo "${with_libtool_sysroot}" >&6; } ++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5 ++ ;; ++esac ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 ++$as_echo "${lt_sysroot:-no}" >&6; } ++ ++ ++ ++ + + # Check whether --enable-libtool-lock was given. + if test "${enable_libtool_lock+set}" = set; then : +@@ -7112,6 +7492,123 @@ + + need_locks="$enable_libtool_lock" + ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. ++set dummy ${ac_tool_prefix}mt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$MANIFEST_TOOL"; then ++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL ++if test -n "$MANIFEST_TOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 ++$as_echo "$MANIFEST_TOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL ++ # Extract the first word of "mt", so it can be a program name with args. ++set dummy mt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_MANIFEST_TOOL"; then ++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL ++if test -n "$ac_ct_MANIFEST_TOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 ++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_MANIFEST_TOOL" = x; then ++ MANIFEST_TOOL=":" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL ++ fi ++else ++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" ++fi ++ ++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 ++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } ++if test "${lt_cv_path_mainfest_tool+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_path_mainfest_tool=no ++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 ++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out ++ cat conftest.err >&5 ++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then ++ lt_cv_path_mainfest_tool=yes ++ fi ++ rm -f conftest* ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 ++$as_echo "$lt_cv_path_mainfest_tool" >&6; } ++if test "x$lt_cv_path_mainfest_tool" != xyes; then ++ MANIFEST_TOOL=: ++fi ++ ++ ++ ++ ++ + + case $host_os in + rhapsody* | darwin*) +@@ -7675,6 +8172,8 @@ + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 ++ echo "$RANLIB libconftest.a" >&5 ++ $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF + int main() { return 0;} + _LT_EOF +@@ -7870,7 +8369,8 @@ + LIBTOOL_DEPS="$ltmain" + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)' ++LIBTOOL="$LIBTOOL/${host_alias}-libtool" + + + +@@ -7959,7 +8459,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=${host_alias}-libtool + can_build_shared=yes + + # All known linkers require a `.a' archive for static linking (except MSVC, +@@ -8257,8 +8757,6 @@ + lt_prog_compiler_pic= + lt_prog_compiler_static= + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +-$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' +@@ -8424,6 +8922,12 @@ + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; ++ nagfor*) ++ # NAG Fortran compiler ++ lt_prog_compiler_wl='-Wl,-Wl,,' ++ lt_prog_compiler_pic='-PIC' ++ lt_prog_compiler_static='-Bstatic' ++ ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) +@@ -8486,7 +8990,7 @@ + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in +- f77* | f90* | f95*) ++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; +@@ -8543,13 +9047,17 @@ + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; + esac +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +-$as_echo "$lt_prog_compiler_pic" >&6; } +- +- +- +- + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 ++$as_echo_n "checking for $compiler option to produce PIC... " >&6; } ++if test "${lt_cv_prog_compiler_pic+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 ++$as_echo "$lt_cv_prog_compiler_pic" >&6; } ++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + + # + # Check to make sure the PIC flag actually works. +@@ -8610,6 +9118,11 @@ + + + ++ ++ ++ ++ ++ + # + # Check to make sure the static flag actually works. + # +@@ -8960,7 +9473,8 @@ + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes +- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +@@ -9008,7 +9522,7 @@ + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then +- tmp_addflag= ++ tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler +@@ -9059,12 +9573,12 @@ + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' +- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' ++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ +- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' ++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac +@@ -9078,8 +9592,8 @@ + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + +@@ -9097,8 +9611,8 @@ + + _LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -9144,8 +9658,8 @@ + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -9275,7 +9789,13 @@ + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath_+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -9288,22 +9808,29 @@ + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath_ ++fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +@@ -9315,7 +9842,13 @@ + else + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath_+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -9328,22 +9861,29 @@ + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath_ ++fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, +@@ -9388,20 +9928,63 @@ + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. +- hardcode_libdir_flag_spec=' ' +- allow_undefined_flag=unsupported +- # Tell ltmain to make .lib files, not .a files. +- libext=lib +- # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" +- # FIXME: Setting linknames here is a bad hack. +- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' +- # The linker will automatically build a .lib file if we build a DLL. +- old_archive_from_new_cmds='true' +- # FIXME: Should let the user specify the lib program. +- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' +- fix_srcfile_path='`cygpath -w "$srcfile"`' +- enable_shared_with_static_runtimes=yes ++ case $cc_basename in ++ cl*) ++ # Native MSVC ++ hardcode_libdir_flag_spec=' ' ++ allow_undefined_flag=unsupported ++ always_export_symbols=yes ++ file_list_spec='@' ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' ++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; ++ else ++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' ++ # The linker will not automatically build a static lib if we build a DLL. ++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true' ++ enable_shared_with_static_runtimes=yes ++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ++ # Don't use ranlib ++ old_postinstall_cmds='chmod 644 $oldlib' ++ postlink_cmds='lt_outputfile="@OUTPUT@"~ ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile="$lt_outputfile.exe" ++ lt_tool_outputfile="$lt_tool_outputfile.exe" ++ ;; ++ esac~ ++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' ++ ;; ++ *) ++ # Assume MSVC wrapper ++ hardcode_libdir_flag_spec=' ' ++ allow_undefined_flag=unsupported ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' ++ # The linker will automatically build a .lib file if we build a DLL. ++ old_archive_from_new_cmds='true' ++ # FIXME: Should let the user specify the lib program. ++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' ++ enable_shared_with_static_runtimes=yes ++ ;; ++ esac + ;; + + darwin* | rhapsody*) +@@ -9462,7 +10045,7 @@ + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) +- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no +@@ -9470,7 +10053,7 @@ + + hpux9*) + if test "$GCC" = yes; then +- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi +@@ -9486,7 +10069,7 @@ + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi +@@ -9510,10 +10093,10 @@ + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else +@@ -9592,23 +10175,36 @@ + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ # This should be the same for all languages, so no per-tag cache variable. ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 ++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } ++if test "${lt_cv_irix_exported_symbol+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-int foo(void) {} ++int foo (void) { return 0; } + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' +- ++ lt_cv_irix_exported_symbol=yes ++else ++ lt_cv_irix_exported_symbol=no + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +- LDFLAGS="$save_LDFLAGS" ++ LDFLAGS="$save_LDFLAGS" ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 ++$as_echo "$lt_cv_irix_exported_symbol" >&6; } ++ if test "$lt_cv_irix_exported_symbol" = yes; then ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ++ fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' +@@ -9693,7 +10289,7 @@ + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' +- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' +@@ -9712,9 +10308,9 @@ + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' +- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) +@@ -10290,8 +10886,9 @@ + need_version=no + need_lib_prefix=no + +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) ++ case $GCC,$cc_basename in ++ yes,*) ++ # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ +@@ -10324,13 +10921,71 @@ + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac ++ dynamic_linker='Win32 ld.exe' ++ ;; ++ ++ *,cl*) ++ # Native MSVC ++ libname_spec='$name' ++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ++ library_names_spec='${libname}.dll.lib' ++ ++ case $build_os in ++ mingw*) ++ sys_lib_search_path_spec= ++ lt_save_ifs=$IFS ++ IFS=';' ++ for lt_path in $LIB ++ do ++ IFS=$lt_save_ifs ++ # Let DOS variable expansion print the short 8.3 style file name. ++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` ++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" ++ done ++ IFS=$lt_save_ifs ++ # Convert to MSYS style. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ++ ;; ++ cygwin*) ++ # Convert to unix form, then to dos form, then back to unix form ++ # but this time dos style (no spaces!) so that the unix form looks ++ # like /cygdrive/c/PROGRA~1:/cygdr... ++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` ++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` ++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ ;; ++ *) ++ sys_lib_search_path_spec="$LIB" ++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then ++ # It is most probably a Windows format PATH. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ # FIXME: find the short name or the path components, as spaces are ++ # common. (e.g. "Program Files" -> "PROGRA~1") ++ ;; ++ esac ++ ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds ++ postinstall_cmds='base_file=`basename \${file}`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ dldir=$destdir/`dirname \$dlpath`~ ++ test -d \$dldir || mkdir -p \$dldir~ ++ $install_prog $dir/$dlname \$dldir/$dlname' ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ ++ dlpath=$dir/\$dldll~ ++ $RM \$dlpath' ++ shlibpath_overrides_runpath=yes ++ dynamic_linker='Win32 link.exe' + ;; + + *) ++ # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ++ dynamic_linker='Win32 ld.exe' + ;; + esac +- dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; +@@ -10422,7 +11077,7 @@ + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +@@ -11262,10 +11917,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -11368,10 +12023,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -14948,13 +15603,20 @@ + lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' + lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' + lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' ++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' ++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' + reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' + reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' + OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' + deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' + file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' ++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' ++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' ++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' ++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' + AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' + AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' ++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' + STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' + RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' + old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +@@ -14969,14 +15631,17 @@ + lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' ++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' ++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' + objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' + MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' ++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' + lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' + need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' ++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' + DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' + NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' + LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +@@ -15009,12 +15674,12 @@ + hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' + inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' + link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' + always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' + export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' + exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' + include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' + prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' ++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' + file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' + variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' + need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +@@ -15069,8 +15734,13 @@ + OBJDUMP \ + deplibs_check_method \ + file_magic_cmd \ ++file_magic_glob \ ++want_nocaseglob \ ++DLLTOOL \ ++sharedlib_from_linklib_cmd \ + AR \ + AR_FLAGS \ ++archiver_list_spec \ + STRIP \ + RANLIB \ + CC \ +@@ -15080,12 +15750,14 @@ + lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ ++nm_file_list_spec \ + lt_prog_compiler_no_builtin_flag \ +-lt_prog_compiler_wl \ + lt_prog_compiler_pic \ ++lt_prog_compiler_wl \ + lt_prog_compiler_static \ + lt_cv_prog_compiler_c_o \ + need_locks \ ++MANIFEST_TOOL \ + DSYMUTIL \ + NMEDIT \ + LIPO \ +@@ -15101,7 +15773,6 @@ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ +-fix_srcfile_path \ + exclude_expsyms \ + include_expsyms \ + file_list_spec \ +@@ -15137,6 +15808,7 @@ + module_expsym_cmds \ + export_symbols_cmds \ + prelink_cmds \ ++postlink_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + finish_cmds \ +@@ -15894,7 +16566,8 @@ + # NOTE: Changes made to this file will be lost: look at ltmain.sh. + # + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, ++# Inc. + # Written by Gordon Matzigkeit, 1996 + # + # This file is part of GNU Libtool. +@@ -15997,19 +16670,42 @@ + # turn newlines into spaces. + NL2SP=$lt_lt_NL2SP + ++# convert \$build file names to \$host format. ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++ ++# convert \$build files to toolchain format. ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++ + # An object symbol dumper. + OBJDUMP=$lt_OBJDUMP + + # Method to check whether dependent libraries are shared objects. + deplibs_check_method=$lt_deplibs_check_method + +-# Command to use when deplibs_check_method == "file_magic". ++# Command to use when deplibs_check_method = "file_magic". + file_magic_cmd=$lt_file_magic_cmd + ++# How to find potential files when deplibs_check_method = "file_magic". ++file_magic_glob=$lt_file_magic_glob ++ ++# Find potential files using nocaseglob when deplibs_check_method = "file_magic". ++want_nocaseglob=$lt_want_nocaseglob ++ ++# DLL creation program. ++DLLTOOL=$lt_DLLTOOL ++ ++# Command to associate shared and link libraries. ++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd ++ + # The archiver. + AR=$lt_AR ++ ++# Flags to create an archive. + AR_FLAGS=$lt_AR_FLAGS + ++# How to feed a file listing to the archiver. ++archiver_list_spec=$lt_archiver_list_spec ++ + # A symbol stripping program. + STRIP=$lt_STRIP + +@@ -16039,6 +16735,12 @@ + # Transform the output of nm in a C name address pair when lib prefix is needed. + global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + ++# Specify filename containing input files for \$NM. ++nm_file_list_spec=$lt_nm_file_list_spec ++ ++# The root where to search for dependent libraries,and in which our libraries should be installed. ++lt_sysroot=$lt_sysroot ++ + # The name of the directory that contains temporary libtool files. + objdir=$objdir + +@@ -16048,6 +16750,9 @@ + # Must we lock files when doing compilation? + need_locks=$lt_need_locks + ++# Manifest tool. ++MANIFEST_TOOL=$lt_MANIFEST_TOOL ++ + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. + DSYMUTIL=$lt_DSYMUTIL + +@@ -16162,12 +16867,12 @@ + # Compiler flag to turn off builtin functions. + no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +-# How to pass a linker flag through the compiler. +-wl=$lt_lt_prog_compiler_wl +- + # Additional compiler flags for building library objects. + pic_flag=$lt_lt_prog_compiler_pic + ++# How to pass a linker flag through the compiler. ++wl=$lt_lt_prog_compiler_wl ++ + # Compiler flag to prevent dynamic linking. + link_static_flag=$lt_lt_prog_compiler_static + +@@ -16254,9 +16959,6 @@ + # Whether libtool must link a program against all its dependency libraries. + link_all_deplibs=$link_all_deplibs + +-# Fix the shell variable \$srcfile for the compiler. +-fix_srcfile_path=$lt_fix_srcfile_path +- + # Set to "yes" if exported symbols are required. + always_export_symbols=$always_export_symbols + +@@ -16272,6 +16974,9 @@ + # Commands necessary for linking programs (against libraries) with templates. + prelink_cmds=$lt_prelink_cmds + ++# Commands necessary for finishing linking programs. ++postlink_cmds=$lt_postlink_cmds ++ + # Specify filename containing input files. + file_list_spec=$lt_file_list_spec + +@@ -16304,210 +17009,169 @@ + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? +- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) +- +- case $xsi_shell in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result="${1##*/}" +-} +- +-# func_dirname_and_basename file append nondir_replacement +-# perform func_basename and func_dirname in a single function +-# call: +-# dirname: Compute the dirname of FILE. If nonempty, +-# add APPEND to the result, otherwise set result +-# to NONDIR_REPLACEMENT. +-# value returned in "$func_dirname_result" +-# basename: Compute filename of FILE. +-# value retuned in "$func_basename_result" +-# Implementation must be kept synchronized with func_dirname +-# and func_basename. For efficiency, we do not delegate to +-# those functions but instead duplicate the functionality here. +-func_dirname_and_basename () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +- func_basename_result="${1##*/}" +-} +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-func_stripname () +-{ +- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are +- # positional parameters, so assign one to ordinary parameter first. +- func_stripname_result=${3} +- func_stripname_result=${func_stripname_result#"${1}"} +- func_stripname_result=${func_stripname_result%"${2}"} +-} +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=${1%%=*} +- func_opt_split_arg=${1#*=} +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- case ${1} in +- *.lo) func_lo2o_result=${1%.lo}.${objext} ;; +- *) func_lo2o_result=${1} ;; +- esac +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=${1%.*}.lo +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=$(( $* )) +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=${#1} +-} +- +-_LT_EOF +- ;; +- *) # Bourne compatible functions. +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- # Extract subdirectory from the argument. +- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` +- if test "X$func_dirname_result" = "X${1}"; then +- func_dirname_result="${3}" +- else +- func_dirname_result="$func_dirname_result${2}" +- fi +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result=`$ECHO "${1}" | $SED "$basename"` +-} +- +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-# func_strip_suffix prefix name +-func_stripname () +-{ +- case ${2} in +- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; +- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; +- esac +-} +- +-# sed scripts: +-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +-my_sed_long_arg='1s/^-[^=]*=//' +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` +- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=`expr "$@"` +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +-} +- +-_LT_EOF +-esac +- +-case $lt_shell_append in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$1+=\$2" +-} +-_LT_EOF +- ;; +- *) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$1=\$$1\$2" +-} +- +-_LT_EOF +- ;; +- esac ++ sed '$q' "$ltmain" >> "$cfgfile" \ ++ || (rm -f "$cfgfile"; exit 1) + ++ if test x"$xsi_shell" = xyes; then ++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ ++func_dirname ()\ ++{\ ++\ case ${1} in\ ++\ */*) func_dirname_result="${1%/*}${2}" ;;\ ++\ * ) func_dirname_result="${3}" ;;\ ++\ esac\ ++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_basename ()$/,/^} # func_basename /c\ ++func_basename ()\ ++{\ ++\ func_basename_result="${1##*/}"\ ++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ ++func_dirname_and_basename ()\ ++{\ ++\ case ${1} in\ ++\ */*) func_dirname_result="${1%/*}${2}" ;;\ ++\ * ) func_dirname_result="${3}" ;;\ ++\ esac\ ++\ func_basename_result="${1##*/}"\ ++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ ++func_stripname ()\ ++{\ ++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ ++\ # positional parameters, so assign one to ordinary parameter first.\ ++\ func_stripname_result=${3}\ ++\ func_stripname_result=${func_stripname_result#"${1}"}\ ++\ func_stripname_result=${func_stripname_result%"${2}"}\ ++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ ++func_split_long_opt ()\ ++{\ ++\ func_split_long_opt_name=${1%%=*}\ ++\ func_split_long_opt_arg=${1#*=}\ ++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ ++func_split_short_opt ()\ ++{\ ++\ func_split_short_opt_arg=${1#??}\ ++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ ++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ ++func_lo2o ()\ ++{\ ++\ case ${1} in\ ++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ ++\ *) func_lo2o_result=${1} ;;\ ++\ esac\ ++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_xform ()$/,/^} # func_xform /c\ ++func_xform ()\ ++{\ ++ func_xform_result=${1%.*}.lo\ ++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_arith ()$/,/^} # func_arith /c\ ++func_arith ()\ ++{\ ++ func_arith_result=$(( $* ))\ ++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_len ()$/,/^} # func_len /c\ ++func_len ()\ ++{\ ++ func_len_result=${#1}\ ++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++fi ++ ++if test x"$lt_shell_append" = xyes; then ++ sed -e '/^func_append ()$/,/^} # func_append /c\ ++func_append ()\ ++{\ ++ eval "${1}+=\\${2}"\ ++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ ++func_append_quoted ()\ ++{\ ++\ func_quote_for_eval "${2}"\ ++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ ++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ # Save a `func_append' function call where possible by direct use of '+=' ++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++else ++ # Save a `func_append' function call even when '+=' is not available ++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++fi ++ ++if test x"$_lt_function_replace_fail" = x":"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 ++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} ++fi + +- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) + +- mv -f "$cfgfile" "$ofile" || ++ mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +Index: binutils-2.24/gas/configure +=================================================================== +--- binutils-2.24.orig/gas/configure 2013-11-04 07:33:37.000000000 -0800 ++++ binutils-2.24/gas/configure 2013-12-15 11:10:23.880452030 -0800 +@@ -645,8 +645,11 @@ + LIPO + NMEDIT + DSYMUTIL ++MANIFEST_TOOL + RANLIB ++ac_ct_AR + AR ++DLLTOOL + OBJDUMP + LN_S + NM +@@ -759,6 +762,7 @@ + with_pic + enable_fast_install + with_gnu_ld ++with_libtool_sysroot + enable_libtool_lock + enable_targets + enable_checking +@@ -1420,6 +1424,8 @@ + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] ++ --with-libtool-sysroot=DIR Search for dependent libraries within DIR ++ (or the compiler's sysroot if not specified). + --with-zlib include zlib support (auto/yes/no) default=auto + + Some influential environment variables: +@@ -5135,8 +5141,8 @@ + + + +-macro_version='2.2.7a' +-macro_revision='1.3134' ++macro_version='2.4' ++macro_revision='1.3293' + + + +@@ -5176,7 +5182,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 + $as_echo_n "checking how to print strings... " >&6; } + # Test print first, because it will be a builtin if present. +-if test "X`print -r -- -n 2>/dev/null`" = X-n && \ ++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' + elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then +@@ -5862,8 +5868,8 @@ + # Try some XSI features + xsi_shell=no + ( _lt_dummy="a/b/c" +- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ +- = c,a/b,, \ ++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ ++ = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +@@ -5912,6 +5918,80 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 ++$as_echo_n "checking how to convert $build file names to $host format... " >&6; } ++if test "${lt_cv_to_host_file_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ++ ;; ++ esac ++ ;; ++ *-*-cygwin* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ++ ;; ++ esac ++ ;; ++ * ) # unhandled hosts (and "normal" native builds) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++esac ++ ++fi ++ ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 ++$as_echo "$lt_cv_to_host_file_cmd" >&6; } ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 ++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } ++if test "${lt_cv_to_tool_file_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ #assume ordinary cross tools, or native build. ++lt_cv_to_tool_file_cmd=func_convert_file_noop ++case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ esac ++ ;; ++esac ++ ++fi ++ ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 ++$as_echo "$lt_cv_to_tool_file_cmd" >&6; } ++ ++ ++ ++ ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 + $as_echo_n "checking for $LD option to reload object files... " >&6; } + if test "${lt_cv_ld_reload_flag+set}" = set; then : +@@ -5928,6 +6008,11 @@ + esac + reload_cmds='$LD$reload_flag -o $output$reload_objs' + case $host_os in ++ cygwin* | mingw* | pw32* | cegcc*) ++ if test "$GCC" != yes; then ++ reload_cmds=false ++ fi ++ ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' +@@ -6096,7 +6181,8 @@ + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else +- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' ++ # Keep this pattern in sync with the one in func_win32_libid. ++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; +@@ -6250,6 +6336,21 @@ + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 + $as_echo "$lt_cv_deplibs_check_method" >&6; } ++ ++file_magic_glob= ++want_nocaseglob=no ++if test "$build" = "$host"; then ++ case $host_os in ++ mingw* | pw32*) ++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then ++ want_nocaseglob=yes ++ else ++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` ++ fi ++ ;; ++ esac ++fi ++ + file_magic_cmd=$lt_cv_file_magic_cmd + deplibs_check_method=$lt_cv_deplibs_check_method + test -z "$deplibs_check_method" && deplibs_check_method=unknown +@@ -6265,9 +6366,162 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. ++set dummy ${ac_tool_prefix}dlltool; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_DLLTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$DLLTOOL"; then ++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++DLLTOOL=$ac_cv_prog_DLLTOOL ++if test -n "$DLLTOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 ++$as_echo "$DLLTOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_DLLTOOL"; then ++ ac_ct_DLLTOOL=$DLLTOOL ++ # Extract the first word of "dlltool", so it can be a program name with args. ++set dummy dlltool; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_DLLTOOL"; then ++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_DLLTOOL="dlltool" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL ++if test -n "$ac_ct_DLLTOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 ++$as_echo "$ac_ct_DLLTOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_DLLTOOL" = x; then ++ DLLTOOL="false" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ DLLTOOL=$ac_ct_DLLTOOL ++ fi ++else ++ DLLTOOL="$ac_cv_prog_DLLTOOL" ++fi ++ ++test -z "$DLLTOOL" && DLLTOOL=dlltool ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 ++$as_echo_n "checking how to associate runtime and link libraries... " >&6; } ++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_sharedlib_from_linklib_cmd='unknown' ++ ++case $host_os in ++cygwin* | mingw* | pw32* | cegcc*) ++ # two different shell functions defined in ltmain.sh ++ # decide which to use based on capabilities of $DLLTOOL ++ case `$DLLTOOL --help 2>&1` in ++ *--identify-strict*) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ++ ;; ++ *) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ++ ;; ++ esac ++ ;; ++*) ++ # fallback: assume linklib IS sharedlib ++ lt_cv_sharedlib_from_linklib_cmd="$ECHO" ++ ;; ++esac ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 ++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } ++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd ++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO ++ ++ ++ ++ ++ ++ ++ + if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +-set dummy ${ac_tool_prefix}ar; ac_word=$2 ++ for ac_prog in ar ++ do ++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. ++set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_prog_AR+set}" = set; then : +@@ -6283,7 +6537,7 @@ + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_AR="${ac_tool_prefix}ar" ++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -6303,11 +6557,15 @@ + fi + + ++ test -n "$AR" && break ++ done + fi +-if test -z "$ac_cv_prog_AR"; then ++if test -z "$AR"; then + ac_ct_AR=$AR +- # Extract the first word of "ar", so it can be a program name with args. +-set dummy ar; ac_word=$2 ++ for ac_prog in ar ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +@@ -6323,7 +6581,7 @@ + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_AR="ar" ++ ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -6342,6 +6600,10 @@ + $as_echo "no" >&6; } + fi + ++ ++ test -n "$ac_ct_AR" && break ++done ++ + if test "x$ac_ct_AR" = x; then + AR="false" + else +@@ -6353,16 +6615,72 @@ + esac + AR=$ac_ct_AR + fi +-else +- AR="$ac_cv_prog_AR" + fi + +-test -z "$AR" && AR=ar +-test -z "$AR_FLAGS" && AR_FLAGS=cru ++: ${AR=ar} ++: ${AR_FLAGS=cru} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 ++$as_echo_n "checking for archiver @FILE support... " >&6; } ++if test "${lt_cv_ar_at_file+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_ar_at_file=no ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ + ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ echo conftest.$ac_objext > conftest.lst ++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 ++ (eval $lt_ar_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if test "$ac_status" -eq 0; then ++ # Ensure the archiver fails upon bogus file names. ++ rm -f conftest.$ac_objext libconftest.a ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 ++ (eval $lt_ar_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if test "$ac_status" -ne 0; then ++ lt_cv_ar_at_file=@ ++ fi ++ fi ++ rm -f conftest.* libconftest.a + ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 ++$as_echo "$lt_cv_ar_at_file" >&6; } + ++if test "x$lt_cv_ar_at_file" = xno; then ++ archiver_list_spec= ++else ++ archiver_list_spec=$lt_cv_ar_at_file ++fi + + + +@@ -6704,8 +7022,8 @@ + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + + # Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + + # Handle CRLF in mingw tool chain + opt_cr= +@@ -6741,6 +7059,7 @@ + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi ++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no +@@ -6782,6 +7101,18 @@ + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext ++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ ++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) ++/* DATA imports from DLLs on WIN32 con't be const, because runtime ++ relocations are performed -- see ld's documentation on pseudo-relocs. */ ++# define LT_DLSYM_CONST ++#elif defined(__osf__) ++/* This system does not cope well with relocations in const data. */ ++# define LT_DLSYM_CONST ++#else ++# define LT_DLSYM_CONST const ++#endif ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -6793,7 +7124,7 @@ + cat <<_LT_EOF >> conftest.$ac_ext + + /* The mapping between symbol names and symbols. */ +-const struct { ++LT_DLSYM_CONST struct { + const char *name; + void *address; + } +@@ -6819,8 +7150,8 @@ + _LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext +- lt_save_LIBS="$LIBS" +- lt_save_CFLAGS="$CFLAGS" ++ lt_globsym_save_LIBS=$LIBS ++ lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 +@@ -6830,8 +7161,8 @@ + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi +- LIBS="$lt_save_LIBS" +- CFLAGS="$lt_save_CFLAGS" ++ LIBS=$lt_globsym_save_LIBS ++ CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi +@@ -6868,6 +7199,19 @@ + $as_echo "ok" >&6; } + fi + ++# Response file support. ++if test "$lt_cv_nm_interface" = "MS dumpbin"; then ++ nm_file_list_spec='@' ++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then ++ nm_file_list_spec='@' ++fi ++ ++ ++ ++ ++ ++ ++ + + + +@@ -6888,6 +7232,42 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 ++$as_echo_n "checking for sysroot... " >&6; } ++ ++# Check whether --with-libtool-sysroot was given. ++if test "${with_libtool_sysroot+set}" = set; then : ++ withval=$with_libtool_sysroot; ++else ++ with_libtool_sysroot=no ++fi ++ ++ ++lt_sysroot= ++case ${with_libtool_sysroot} in #( ++ yes) ++ if test "$GCC" = yes; then ++ lt_sysroot=`$CC --print-sysroot 2>/dev/null` ++ fi ++ ;; #( ++ /*) ++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"` ++ ;; #( ++ no|'') ++ ;; #( ++ *) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5 ++$as_echo "${with_libtool_sysroot}" >&6; } ++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5 ++ ;; ++esac ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 ++$as_echo "${lt_sysroot:-no}" >&6; } ++ ++ ++ ++ + + # Check whether --enable-libtool-lock was given. + if test "${enable_libtool_lock+set}" = set; then : +@@ -7095,6 +7475,123 @@ + + need_locks="$enable_libtool_lock" + ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. ++set dummy ${ac_tool_prefix}mt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$MANIFEST_TOOL"; then ++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL ++if test -n "$MANIFEST_TOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 ++$as_echo "$MANIFEST_TOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL ++ # Extract the first word of "mt", so it can be a program name with args. ++set dummy mt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_MANIFEST_TOOL"; then ++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL ++if test -n "$ac_ct_MANIFEST_TOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 ++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_MANIFEST_TOOL" = x; then ++ MANIFEST_TOOL=":" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL ++ fi ++else ++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" ++fi ++ ++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 ++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } ++if test "${lt_cv_path_mainfest_tool+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_path_mainfest_tool=no ++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 ++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out ++ cat conftest.err >&5 ++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then ++ lt_cv_path_mainfest_tool=yes ++ fi ++ rm -f conftest* ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 ++$as_echo "$lt_cv_path_mainfest_tool" >&6; } ++if test "x$lt_cv_path_mainfest_tool" != xyes; then ++ MANIFEST_TOOL=: ++fi ++ ++ ++ ++ ++ + + case $host_os in + rhapsody* | darwin*) +@@ -7658,6 +8155,8 @@ + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 ++ echo "$RANLIB libconftest.a" >&5 ++ $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF + int main() { return 0;} + _LT_EOF +@@ -7853,7 +8352,8 @@ + LIBTOOL_DEPS="$ltmain" + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)' ++LIBTOOL="$LIBTOOL/${host_alias}-libtool" + + + +@@ -7942,7 +8442,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=${host_alias}-libtool + can_build_shared=yes + + # All known linkers require a `.a' archive for static linking (except MSVC, +@@ -8240,8 +8740,6 @@ + lt_prog_compiler_pic= + lt_prog_compiler_static= + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +-$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' +@@ -8407,6 +8905,12 @@ + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; ++ nagfor*) ++ # NAG Fortran compiler ++ lt_prog_compiler_wl='-Wl,-Wl,,' ++ lt_prog_compiler_pic='-PIC' ++ lt_prog_compiler_static='-Bstatic' ++ ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) +@@ -8469,7 +8973,7 @@ + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in +- f77* | f90* | f95*) ++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; +@@ -8526,13 +9030,17 @@ + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; + esac +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +-$as_echo "$lt_prog_compiler_pic" >&6; } +- +- +- +- + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 ++$as_echo_n "checking for $compiler option to produce PIC... " >&6; } ++if test "${lt_cv_prog_compiler_pic+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 ++$as_echo "$lt_cv_prog_compiler_pic" >&6; } ++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + + # + # Check to make sure the PIC flag actually works. +@@ -8593,6 +9101,11 @@ + + + ++ ++ ++ ++ ++ + # + # Check to make sure the static flag actually works. + # +@@ -8943,7 +9456,8 @@ + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes +- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +@@ -8991,7 +9505,7 @@ + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then +- tmp_addflag= ++ tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler +@@ -9042,12 +9556,12 @@ + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' +- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' ++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ +- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' ++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac +@@ -9061,8 +9575,8 @@ + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + +@@ -9080,8 +9594,8 @@ + + _LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -9127,8 +9641,8 @@ + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -9258,7 +9772,13 @@ + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath_+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -9271,22 +9791,29 @@ + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath_ ++fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +@@ -9298,7 +9825,13 @@ + else + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath_+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -9311,22 +9844,29 @@ + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath_ ++fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, +@@ -9371,20 +9911,63 @@ + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. +- hardcode_libdir_flag_spec=' ' +- allow_undefined_flag=unsupported +- # Tell ltmain to make .lib files, not .a files. +- libext=lib +- # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" +- # FIXME: Setting linknames here is a bad hack. +- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' +- # The linker will automatically build a .lib file if we build a DLL. +- old_archive_from_new_cmds='true' +- # FIXME: Should let the user specify the lib program. +- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' +- fix_srcfile_path='`cygpath -w "$srcfile"`' +- enable_shared_with_static_runtimes=yes ++ case $cc_basename in ++ cl*) ++ # Native MSVC ++ hardcode_libdir_flag_spec=' ' ++ allow_undefined_flag=unsupported ++ always_export_symbols=yes ++ file_list_spec='@' ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' ++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; ++ else ++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' ++ # The linker will not automatically build a static lib if we build a DLL. ++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true' ++ enable_shared_with_static_runtimes=yes ++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ++ # Don't use ranlib ++ old_postinstall_cmds='chmod 644 $oldlib' ++ postlink_cmds='lt_outputfile="@OUTPUT@"~ ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile="$lt_outputfile.exe" ++ lt_tool_outputfile="$lt_tool_outputfile.exe" ++ ;; ++ esac~ ++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' ++ ;; ++ *) ++ # Assume MSVC wrapper ++ hardcode_libdir_flag_spec=' ' ++ allow_undefined_flag=unsupported ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' ++ # The linker will automatically build a .lib file if we build a DLL. ++ old_archive_from_new_cmds='true' ++ # FIXME: Should let the user specify the lib program. ++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' ++ enable_shared_with_static_runtimes=yes ++ ;; ++ esac + ;; + + darwin* | rhapsody*) +@@ -9445,7 +10028,7 @@ + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) +- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no +@@ -9453,7 +10036,7 @@ + + hpux9*) + if test "$GCC" = yes; then +- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi +@@ -9469,7 +10052,7 @@ + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi +@@ -9493,10 +10076,10 @@ + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else +@@ -9575,23 +10158,36 @@ + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ # This should be the same for all languages, so no per-tag cache variable. ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 ++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } ++if test "${lt_cv_irix_exported_symbol+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-int foo(void) {} ++int foo (void) { return 0; } + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' +- ++ lt_cv_irix_exported_symbol=yes ++else ++ lt_cv_irix_exported_symbol=no + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +- LDFLAGS="$save_LDFLAGS" ++ LDFLAGS="$save_LDFLAGS" ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 ++$as_echo "$lt_cv_irix_exported_symbol" >&6; } ++ if test "$lt_cv_irix_exported_symbol" = yes; then ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ++ fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' +@@ -9676,7 +10272,7 @@ + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' +- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' +@@ -9695,9 +10291,9 @@ + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' +- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) +@@ -10273,8 +10869,9 @@ + need_version=no + need_lib_prefix=no + +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) ++ case $GCC,$cc_basename in ++ yes,*) ++ # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ +@@ -10307,13 +10904,71 @@ + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac ++ dynamic_linker='Win32 ld.exe' ++ ;; ++ ++ *,cl*) ++ # Native MSVC ++ libname_spec='$name' ++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ++ library_names_spec='${libname}.dll.lib' ++ ++ case $build_os in ++ mingw*) ++ sys_lib_search_path_spec= ++ lt_save_ifs=$IFS ++ IFS=';' ++ for lt_path in $LIB ++ do ++ IFS=$lt_save_ifs ++ # Let DOS variable expansion print the short 8.3 style file name. ++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` ++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" ++ done ++ IFS=$lt_save_ifs ++ # Convert to MSYS style. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ++ ;; ++ cygwin*) ++ # Convert to unix form, then to dos form, then back to unix form ++ # but this time dos style (no spaces!) so that the unix form looks ++ # like /cygdrive/c/PROGRA~1:/cygdr... ++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` ++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` ++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ ;; ++ *) ++ sys_lib_search_path_spec="$LIB" ++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then ++ # It is most probably a Windows format PATH. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ # FIXME: find the short name or the path components, as spaces are ++ # common. (e.g. "Program Files" -> "PROGRA~1") ++ ;; ++ esac ++ ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds ++ postinstall_cmds='base_file=`basename \${file}`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ dldir=$destdir/`dirname \$dlpath`~ ++ test -d \$dldir || mkdir -p \$dldir~ ++ $install_prog $dir/$dlname \$dldir/$dlname' ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ ++ dlpath=$dir/\$dldll~ ++ $RM \$dlpath' ++ shlibpath_overrides_runpath=yes ++ dynamic_linker='Win32 link.exe' + ;; + + *) ++ # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ++ dynamic_linker='Win32 ld.exe' + ;; + esac +- dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; +@@ -10405,7 +11060,7 @@ + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +@@ -11245,10 +11900,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -11351,10 +12006,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -15064,13 +15719,20 @@ + lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' + lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' + lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' ++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' ++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' + reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' + reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' + OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' + deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' + file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' ++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' ++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' ++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' ++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' + AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' + AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' ++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' + STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' + RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' + old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +@@ -15085,14 +15747,17 @@ + lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' ++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' ++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' + objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' + MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' ++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' + lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' + need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' ++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' + DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' + NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' + LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +@@ -15125,12 +15790,12 @@ + hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' + inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' + link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' + always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' + export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' + exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' + include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' + prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' ++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' + file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' + variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' + need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +@@ -15185,8 +15850,13 @@ + OBJDUMP \ + deplibs_check_method \ + file_magic_cmd \ ++file_magic_glob \ ++want_nocaseglob \ ++DLLTOOL \ ++sharedlib_from_linklib_cmd \ + AR \ + AR_FLAGS \ ++archiver_list_spec \ + STRIP \ + RANLIB \ + CC \ +@@ -15196,12 +15866,14 @@ + lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ ++nm_file_list_spec \ + lt_prog_compiler_no_builtin_flag \ +-lt_prog_compiler_wl \ + lt_prog_compiler_pic \ ++lt_prog_compiler_wl \ + lt_prog_compiler_static \ + lt_cv_prog_compiler_c_o \ + need_locks \ ++MANIFEST_TOOL \ + DSYMUTIL \ + NMEDIT \ + LIPO \ +@@ -15217,7 +15889,6 @@ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ +-fix_srcfile_path \ + exclude_expsyms \ + include_expsyms \ + file_list_spec \ +@@ -15253,6 +15924,7 @@ + module_expsym_cmds \ + export_symbols_cmds \ + prelink_cmds \ ++postlink_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + finish_cmds \ +@@ -16017,7 +16689,8 @@ + # NOTE: Changes made to this file will be lost: look at ltmain.sh. + # + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, ++# Inc. + # Written by Gordon Matzigkeit, 1996 + # + # This file is part of GNU Libtool. +@@ -16120,19 +16793,42 @@ + # turn newlines into spaces. + NL2SP=$lt_lt_NL2SP + ++# convert \$build file names to \$host format. ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++ ++# convert \$build files to toolchain format. ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++ + # An object symbol dumper. + OBJDUMP=$lt_OBJDUMP + + # Method to check whether dependent libraries are shared objects. + deplibs_check_method=$lt_deplibs_check_method + +-# Command to use when deplibs_check_method == "file_magic". ++# Command to use when deplibs_check_method = "file_magic". + file_magic_cmd=$lt_file_magic_cmd + ++# How to find potential files when deplibs_check_method = "file_magic". ++file_magic_glob=$lt_file_magic_glob ++ ++# Find potential files using nocaseglob when deplibs_check_method = "file_magic". ++want_nocaseglob=$lt_want_nocaseglob ++ ++# DLL creation program. ++DLLTOOL=$lt_DLLTOOL ++ ++# Command to associate shared and link libraries. ++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd ++ + # The archiver. + AR=$lt_AR ++ ++# Flags to create an archive. + AR_FLAGS=$lt_AR_FLAGS + ++# How to feed a file listing to the archiver. ++archiver_list_spec=$lt_archiver_list_spec ++ + # A symbol stripping program. + STRIP=$lt_STRIP + +@@ -16162,6 +16858,12 @@ + # Transform the output of nm in a C name address pair when lib prefix is needed. + global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + ++# Specify filename containing input files for \$NM. ++nm_file_list_spec=$lt_nm_file_list_spec ++ ++# The root where to search for dependent libraries,and in which our libraries should be installed. ++lt_sysroot=$lt_sysroot ++ + # The name of the directory that contains temporary libtool files. + objdir=$objdir + +@@ -16171,6 +16873,9 @@ + # Must we lock files when doing compilation? + need_locks=$lt_need_locks + ++# Manifest tool. ++MANIFEST_TOOL=$lt_MANIFEST_TOOL ++ + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. + DSYMUTIL=$lt_DSYMUTIL + +@@ -16285,12 +16990,12 @@ + # Compiler flag to turn off builtin functions. + no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +-# How to pass a linker flag through the compiler. +-wl=$lt_lt_prog_compiler_wl +- + # Additional compiler flags for building library objects. + pic_flag=$lt_lt_prog_compiler_pic + ++# How to pass a linker flag through the compiler. ++wl=$lt_lt_prog_compiler_wl ++ + # Compiler flag to prevent dynamic linking. + link_static_flag=$lt_lt_prog_compiler_static + +@@ -16377,9 +17082,6 @@ + # Whether libtool must link a program against all its dependency libraries. + link_all_deplibs=$link_all_deplibs + +-# Fix the shell variable \$srcfile for the compiler. +-fix_srcfile_path=$lt_fix_srcfile_path +- + # Set to "yes" if exported symbols are required. + always_export_symbols=$always_export_symbols + +@@ -16395,6 +17097,9 @@ + # Commands necessary for linking programs (against libraries) with templates. + prelink_cmds=$lt_prelink_cmds + ++# Commands necessary for finishing linking programs. ++postlink_cmds=$lt_postlink_cmds ++ + # Specify filename containing input files. + file_list_spec=$lt_file_list_spec + +@@ -16427,210 +17132,169 @@ + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? +- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) +- +- case $xsi_shell in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result="${1##*/}" +-} +- +-# func_dirname_and_basename file append nondir_replacement +-# perform func_basename and func_dirname in a single function +-# call: +-# dirname: Compute the dirname of FILE. If nonempty, +-# add APPEND to the result, otherwise set result +-# to NONDIR_REPLACEMENT. +-# value returned in "$func_dirname_result" +-# basename: Compute filename of FILE. +-# value retuned in "$func_basename_result" +-# Implementation must be kept synchronized with func_dirname +-# and func_basename. For efficiency, we do not delegate to +-# those functions but instead duplicate the functionality here. +-func_dirname_and_basename () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +- func_basename_result="${1##*/}" +-} +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-func_stripname () +-{ +- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are +- # positional parameters, so assign one to ordinary parameter first. +- func_stripname_result=${3} +- func_stripname_result=${func_stripname_result#"${1}"} +- func_stripname_result=${func_stripname_result%"${2}"} +-} +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=${1%%=*} +- func_opt_split_arg=${1#*=} +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- case ${1} in +- *.lo) func_lo2o_result=${1%.lo}.${objext} ;; +- *) func_lo2o_result=${1} ;; +- esac +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=${1%.*}.lo +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=$(( $* )) +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=${#1} +-} +- +-_LT_EOF +- ;; +- *) # Bourne compatible functions. +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- # Extract subdirectory from the argument. +- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` +- if test "X$func_dirname_result" = "X${1}"; then +- func_dirname_result="${3}" +- else +- func_dirname_result="$func_dirname_result${2}" +- fi +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result=`$ECHO "${1}" | $SED "$basename"` +-} +- +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-# func_strip_suffix prefix name +-func_stripname () +-{ +- case ${2} in +- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; +- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; +- esac +-} +- +-# sed scripts: +-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +-my_sed_long_arg='1s/^-[^=]*=//' +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` +- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=`expr "$@"` +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +-} +- +-_LT_EOF +-esac +- +-case $lt_shell_append in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$1+=\$2" +-} +-_LT_EOF +- ;; +- *) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$1=\$$1\$2" +-} +- +-_LT_EOF +- ;; +- esac ++ sed '$q' "$ltmain" >> "$cfgfile" \ ++ || (rm -f "$cfgfile"; exit 1) + ++ if test x"$xsi_shell" = xyes; then ++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ ++func_dirname ()\ ++{\ ++\ case ${1} in\ ++\ */*) func_dirname_result="${1%/*}${2}" ;;\ ++\ * ) func_dirname_result="${3}" ;;\ ++\ esac\ ++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_basename ()$/,/^} # func_basename /c\ ++func_basename ()\ ++{\ ++\ func_basename_result="${1##*/}"\ ++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ ++func_dirname_and_basename ()\ ++{\ ++\ case ${1} in\ ++\ */*) func_dirname_result="${1%/*}${2}" ;;\ ++\ * ) func_dirname_result="${3}" ;;\ ++\ esac\ ++\ func_basename_result="${1##*/}"\ ++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ ++func_stripname ()\ ++{\ ++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ ++\ # positional parameters, so assign one to ordinary parameter first.\ ++\ func_stripname_result=${3}\ ++\ func_stripname_result=${func_stripname_result#"${1}"}\ ++\ func_stripname_result=${func_stripname_result%"${2}"}\ ++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ ++func_split_long_opt ()\ ++{\ ++\ func_split_long_opt_name=${1%%=*}\ ++\ func_split_long_opt_arg=${1#*=}\ ++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ ++func_split_short_opt ()\ ++{\ ++\ func_split_short_opt_arg=${1#??}\ ++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ ++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ ++func_lo2o ()\ ++{\ ++\ case ${1} in\ ++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ ++\ *) func_lo2o_result=${1} ;;\ ++\ esac\ ++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_xform ()$/,/^} # func_xform /c\ ++func_xform ()\ ++{\ ++ func_xform_result=${1%.*}.lo\ ++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_arith ()$/,/^} # func_arith /c\ ++func_arith ()\ ++{\ ++ func_arith_result=$(( $* ))\ ++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_len ()$/,/^} # func_len /c\ ++func_len ()\ ++{\ ++ func_len_result=${#1}\ ++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++fi ++ ++if test x"$lt_shell_append" = xyes; then ++ sed -e '/^func_append ()$/,/^} # func_append /c\ ++func_append ()\ ++{\ ++ eval "${1}+=\\${2}"\ ++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ ++func_append_quoted ()\ ++{\ ++\ func_quote_for_eval "${2}"\ ++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ ++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ # Save a `func_append' function call where possible by direct use of '+=' ++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++else ++ # Save a `func_append' function call even when '+=' is not available ++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++fi ++ ++if test x"$_lt_function_replace_fail" = x":"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 ++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} ++fi + +- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) + +- mv -f "$cfgfile" "$ofile" || ++ mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +Index: binutils-2.24/gprof/configure +=================================================================== +--- binutils-2.24.orig/gprof/configure 2013-12-15 11:09:51.443785606 -0800 ++++ binutils-2.24/gprof/configure 2013-12-15 11:10:23.880452030 -0800 +@@ -629,8 +629,11 @@ + LIPO + NMEDIT + DSYMUTIL ++MANIFEST_TOOL + RANLIB ++ac_ct_AR + AR ++DLLTOOL + OBJDUMP + LN_S + NM +@@ -743,6 +746,7 @@ + with_pic + enable_fast_install + with_gnu_ld ++with_libtool_sysroot + enable_libtool_lock + enable_nls + enable_maintainer_mode +@@ -1397,6 +1401,8 @@ + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] ++ --with-libtool-sysroot=DIR Search for dependent libraries within DIR ++ (or the compiler's sysroot if not specified). + + Some influential environment variables: + CC C compiler command +@@ -5065,8 +5071,8 @@ + + + +-macro_version='2.2.7a' +-macro_revision='1.3134' ++macro_version='2.4' ++macro_revision='1.3293' + + + +@@ -5106,7 +5112,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 + $as_echo_n "checking how to print strings... " >&6; } + # Test print first, because it will be a builtin if present. +-if test "X`print -r -- -n 2>/dev/null`" = X-n && \ ++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' + elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then +@@ -5792,8 +5798,8 @@ + # Try some XSI features + xsi_shell=no + ( _lt_dummy="a/b/c" +- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ +- = c,a/b,, \ ++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ ++ = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +@@ -5842,6 +5848,80 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 ++$as_echo_n "checking how to convert $build file names to $host format... " >&6; } ++if test "${lt_cv_to_host_file_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ++ ;; ++ esac ++ ;; ++ *-*-cygwin* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ++ ;; ++ esac ++ ;; ++ * ) # unhandled hosts (and "normal" native builds) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++esac ++ ++fi ++ ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 ++$as_echo "$lt_cv_to_host_file_cmd" >&6; } ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 ++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } ++if test "${lt_cv_to_tool_file_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ #assume ordinary cross tools, or native build. ++lt_cv_to_tool_file_cmd=func_convert_file_noop ++case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ esac ++ ;; ++esac ++ ++fi ++ ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 ++$as_echo "$lt_cv_to_tool_file_cmd" >&6; } ++ ++ ++ ++ ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 + $as_echo_n "checking for $LD option to reload object files... " >&6; } + if test "${lt_cv_ld_reload_flag+set}" = set; then : +@@ -5858,6 +5938,11 @@ + esac + reload_cmds='$LD$reload_flag -o $output$reload_objs' + case $host_os in ++ cygwin* | mingw* | pw32* | cegcc*) ++ if test "$GCC" != yes; then ++ reload_cmds=false ++ fi ++ ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' +@@ -6026,7 +6111,8 @@ + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else +- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' ++ # Keep this pattern in sync with the one in func_win32_libid. ++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; +@@ -6103,11 +6189,6 @@ + lt_cv_deplibs_check_method=pass_all + ;; + +-linux-uclibc*) +- lt_cv_deplibs_check_method=pass_all +- lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` +- ;; +- + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' +@@ -6185,6 +6266,21 @@ + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 + $as_echo "$lt_cv_deplibs_check_method" >&6; } ++ ++file_magic_glob= ++want_nocaseglob=no ++if test "$build" = "$host"; then ++ case $host_os in ++ mingw* | pw32*) ++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then ++ want_nocaseglob=yes ++ else ++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` ++ fi ++ ;; ++ esac ++fi ++ + file_magic_cmd=$lt_cv_file_magic_cmd + deplibs_check_method=$lt_cv_deplibs_check_method + test -z "$deplibs_check_method" && deplibs_check_method=unknown +@@ -6200,9 +6296,162 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +-set dummy ${ac_tool_prefix}ar; ac_word=$2 ++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. ++set dummy ${ac_tool_prefix}dlltool; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_DLLTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$DLLTOOL"; then ++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++DLLTOOL=$ac_cv_prog_DLLTOOL ++if test -n "$DLLTOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 ++$as_echo "$DLLTOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_DLLTOOL"; then ++ ac_ct_DLLTOOL=$DLLTOOL ++ # Extract the first word of "dlltool", so it can be a program name with args. ++set dummy dlltool; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_DLLTOOL"; then ++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_DLLTOOL="dlltool" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL ++if test -n "$ac_ct_DLLTOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 ++$as_echo "$ac_ct_DLLTOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_DLLTOOL" = x; then ++ DLLTOOL="false" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ DLLTOOL=$ac_ct_DLLTOOL ++ fi ++else ++ DLLTOOL="$ac_cv_prog_DLLTOOL" ++fi ++ ++test -z "$DLLTOOL" && DLLTOOL=dlltool ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 ++$as_echo_n "checking how to associate runtime and link libraries... " >&6; } ++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_sharedlib_from_linklib_cmd='unknown' ++ ++case $host_os in ++cygwin* | mingw* | pw32* | cegcc*) ++ # two different shell functions defined in ltmain.sh ++ # decide which to use based on capabilities of $DLLTOOL ++ case `$DLLTOOL --help 2>&1` in ++ *--identify-strict*) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ++ ;; ++ *) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ++ ;; ++ esac ++ ;; ++*) ++ # fallback: assume linklib IS sharedlib ++ lt_cv_sharedlib_from_linklib_cmd="$ECHO" ++ ;; ++esac ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 ++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } ++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd ++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO ++ ++ ++ ++ ++ ++ ++ ++if test -n "$ac_tool_prefix"; then ++ for ac_prog in ar ++ do ++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. ++set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_prog_AR+set}" = set; then : +@@ -6218,7 +6467,7 @@ + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_AR="${ac_tool_prefix}ar" ++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -6238,11 +6487,15 @@ + fi + + ++ test -n "$AR" && break ++ done + fi +-if test -z "$ac_cv_prog_AR"; then ++if test -z "$AR"; then + ac_ct_AR=$AR +- # Extract the first word of "ar", so it can be a program name with args. +-set dummy ar; ac_word=$2 ++ for ac_prog in ar ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +@@ -6258,7 +6511,7 @@ + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_AR="ar" ++ ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -6277,6 +6530,10 @@ + $as_echo "no" >&6; } + fi + ++ ++ test -n "$ac_ct_AR" && break ++done ++ + if test "x$ac_ct_AR" = x; then + AR="false" + else +@@ -6288,16 +6545,72 @@ + esac + AR=$ac_ct_AR + fi +-else +- AR="$ac_cv_prog_AR" + fi + +-test -z "$AR" && AR=ar +-test -z "$AR_FLAGS" && AR_FLAGS=cru ++: ${AR=ar} ++: ${AR_FLAGS=cru} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 ++$as_echo_n "checking for archiver @FILE support... " >&6; } ++if test "${lt_cv_ar_at_file+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_ar_at_file=no ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ + ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ echo conftest.$ac_objext > conftest.lst ++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 ++ (eval $lt_ar_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if test "$ac_status" -eq 0; then ++ # Ensure the archiver fails upon bogus file names. ++ rm -f conftest.$ac_objext libconftest.a ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 ++ (eval $lt_ar_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if test "$ac_status" -ne 0; then ++ lt_cv_ar_at_file=@ ++ fi ++ fi ++ rm -f conftest.* libconftest.a + ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 ++$as_echo "$lt_cv_ar_at_file" >&6; } + ++if test "x$lt_cv_ar_at_file" = xno; then ++ archiver_list_spec= ++else ++ archiver_list_spec=$lt_cv_ar_at_file ++fi + + + +@@ -6639,8 +6952,8 @@ + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + + # Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + + # Handle CRLF in mingw tool chain + opt_cr= +@@ -6676,6 +6989,7 @@ + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi ++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no +@@ -6717,6 +7031,18 @@ + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext ++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ ++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) ++/* DATA imports from DLLs on WIN32 con't be const, because runtime ++ relocations are performed -- see ld's documentation on pseudo-relocs. */ ++# define LT_DLSYM_CONST ++#elif defined(__osf__) ++/* This system does not cope well with relocations in const data. */ ++# define LT_DLSYM_CONST ++#else ++# define LT_DLSYM_CONST const ++#endif ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -6728,7 +7054,7 @@ + cat <<_LT_EOF >> conftest.$ac_ext + + /* The mapping between symbol names and symbols. */ +-const struct { ++LT_DLSYM_CONST struct { + const char *name; + void *address; + } +@@ -6754,8 +7080,8 @@ + _LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext +- lt_save_LIBS="$LIBS" +- lt_save_CFLAGS="$CFLAGS" ++ lt_globsym_save_LIBS=$LIBS ++ lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 +@@ -6765,8 +7091,8 @@ + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi +- LIBS="$lt_save_LIBS" +- CFLAGS="$lt_save_CFLAGS" ++ LIBS=$lt_globsym_save_LIBS ++ CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi +@@ -6803,6 +7129,17 @@ + $as_echo "ok" >&6; } + fi + ++# Response file support. ++if test "$lt_cv_nm_interface" = "MS dumpbin"; then ++ nm_file_list_spec='@' ++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then ++ nm_file_list_spec='@' ++fi ++ ++ ++ ++ ++ + + + +@@ -6824,6 +7161,44 @@ + + + ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 ++$as_echo_n "checking for sysroot... " >&6; } ++ ++# Check whether --with-libtool-sysroot was given. ++if test "${with_libtool_sysroot+set}" = set; then : ++ withval=$with_libtool_sysroot; ++else ++ with_libtool_sysroot=no ++fi ++ ++ ++lt_sysroot= ++case ${with_libtool_sysroot} in #( ++ yes) ++ if test "$GCC" = yes; then ++ lt_sysroot=`$CC --print-sysroot 2>/dev/null` ++ fi ++ ;; #( ++ /*) ++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"` ++ ;; #( ++ no|'') ++ ;; #( ++ *) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5 ++$as_echo "${with_libtool_sysroot}" >&6; } ++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5 ++ ;; ++esac ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 ++$as_echo "${lt_sysroot:-no}" >&6; } ++ ++ ++ ++ ++ + # Check whether --enable-libtool-lock was given. + if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +@@ -7030,6 +7405,123 @@ + + need_locks="$enable_libtool_lock" + ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. ++set dummy ${ac_tool_prefix}mt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$MANIFEST_TOOL"; then ++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL ++if test -n "$MANIFEST_TOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 ++$as_echo "$MANIFEST_TOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL ++ # Extract the first word of "mt", so it can be a program name with args. ++set dummy mt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_MANIFEST_TOOL"; then ++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL ++if test -n "$ac_ct_MANIFEST_TOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 ++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_MANIFEST_TOOL" = x; then ++ MANIFEST_TOOL=":" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL ++ fi ++else ++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" ++fi ++ ++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 ++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } ++if test "${lt_cv_path_mainfest_tool+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_path_mainfest_tool=no ++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 ++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out ++ cat conftest.err >&5 ++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then ++ lt_cv_path_mainfest_tool=yes ++ fi ++ rm -f conftest* ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 ++$as_echo "$lt_cv_path_mainfest_tool" >&6; } ++if test "x$lt_cv_path_mainfest_tool" != xyes; then ++ MANIFEST_TOOL=: ++fi ++ ++ ++ ++ ++ + + case $host_os in + rhapsody* | darwin*) +@@ -7593,6 +8085,8 @@ + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 ++ echo "$RANLIB libconftest.a" >&5 ++ $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF + int main() { return 0;} + _LT_EOF +@@ -7788,7 +8282,8 @@ + LIBTOOL_DEPS="$ltmain" + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)' ++LIBTOOL="$LIBTOOL/${host_alias}-libtool" + + + +@@ -7877,7 +8372,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=${host_alias}-libtool + can_build_shared=yes + + # All known linkers require a `.a' archive for static linking (except MSVC, +@@ -8175,8 +8670,6 @@ + lt_prog_compiler_pic= + lt_prog_compiler_static= + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +-$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' +@@ -8342,6 +8835,12 @@ + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; ++ nagfor*) ++ # NAG Fortran compiler ++ lt_prog_compiler_wl='-Wl,-Wl,,' ++ lt_prog_compiler_pic='-PIC' ++ lt_prog_compiler_static='-Bstatic' ++ ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) +@@ -8404,7 +8903,7 @@ + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in +- f77* | f90* | f95*) ++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; +@@ -8461,13 +8960,17 @@ + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; + esac +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +-$as_echo "$lt_prog_compiler_pic" >&6; } +- +- +- +- + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 ++$as_echo_n "checking for $compiler option to produce PIC... " >&6; } ++if test "${lt_cv_prog_compiler_pic+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 ++$as_echo "$lt_cv_prog_compiler_pic" >&6; } ++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + + # + # Check to make sure the PIC flag actually works. +@@ -8528,6 +9031,11 @@ + + + ++ ++ ++ ++ ++ + # + # Check to make sure the static flag actually works. + # +@@ -8878,7 +9386,8 @@ + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes +- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +@@ -8926,7 +9435,7 @@ + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then +- tmp_addflag= ++ tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler +@@ -8977,12 +9486,12 @@ + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' +- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' ++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ +- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' ++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac +@@ -8996,8 +9505,8 @@ + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + +@@ -9015,8 +9524,8 @@ + + _LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -9062,8 +9571,8 @@ + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -9193,7 +9702,13 @@ + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath_+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -9206,22 +9721,29 @@ + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath_ ++fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +@@ -9233,7 +9755,13 @@ + else + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath_+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -9246,22 +9774,29 @@ + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath_ ++fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, +@@ -9306,20 +9841,63 @@ + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. +- hardcode_libdir_flag_spec=' ' +- allow_undefined_flag=unsupported +- # Tell ltmain to make .lib files, not .a files. +- libext=lib +- # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" +- # FIXME: Setting linknames here is a bad hack. +- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' +- # The linker will automatically build a .lib file if we build a DLL. +- old_archive_from_new_cmds='true' +- # FIXME: Should let the user specify the lib program. +- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' +- fix_srcfile_path='`cygpath -w "$srcfile"`' +- enable_shared_with_static_runtimes=yes ++ case $cc_basename in ++ cl*) ++ # Native MSVC ++ hardcode_libdir_flag_spec=' ' ++ allow_undefined_flag=unsupported ++ always_export_symbols=yes ++ file_list_spec='@' ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' ++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; ++ else ++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' ++ # The linker will not automatically build a static lib if we build a DLL. ++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true' ++ enable_shared_with_static_runtimes=yes ++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ++ # Don't use ranlib ++ old_postinstall_cmds='chmod 644 $oldlib' ++ postlink_cmds='lt_outputfile="@OUTPUT@"~ ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile="$lt_outputfile.exe" ++ lt_tool_outputfile="$lt_tool_outputfile.exe" ++ ;; ++ esac~ ++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' ++ ;; ++ *) ++ # Assume MSVC wrapper ++ hardcode_libdir_flag_spec=' ' ++ allow_undefined_flag=unsupported ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' ++ # The linker will automatically build a .lib file if we build a DLL. ++ old_archive_from_new_cmds='true' ++ # FIXME: Should let the user specify the lib program. ++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' ++ enable_shared_with_static_runtimes=yes ++ ;; ++ esac + ;; + + darwin* | rhapsody*) +@@ -9380,7 +9958,7 @@ + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) +- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no +@@ -9388,7 +9966,7 @@ + + hpux9*) + if test "$GCC" = yes; then +- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi +@@ -9404,7 +9982,7 @@ + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi +@@ -9428,10 +10006,10 @@ + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else +@@ -9510,23 +10088,36 @@ + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ # This should be the same for all languages, so no per-tag cache variable. ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 ++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } ++if test "${lt_cv_irix_exported_symbol+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-int foo(void) {} ++int foo (void) { return 0; } + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' +- ++ lt_cv_irix_exported_symbol=yes ++else ++ lt_cv_irix_exported_symbol=no + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +- LDFLAGS="$save_LDFLAGS" ++ LDFLAGS="$save_LDFLAGS" ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 ++$as_echo "$lt_cv_irix_exported_symbol" >&6; } ++ if test "$lt_cv_irix_exported_symbol" = yes; then ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ++ fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' +@@ -9611,7 +10202,7 @@ + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' +- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' +@@ -9630,9 +10221,9 @@ + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' +- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) +@@ -10208,8 +10799,9 @@ + need_version=no + need_lib_prefix=no + +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) ++ case $GCC,$cc_basename in ++ yes,*) ++ # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ +@@ -10242,13 +10834,71 @@ + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac ++ dynamic_linker='Win32 ld.exe' ++ ;; ++ ++ *,cl*) ++ # Native MSVC ++ libname_spec='$name' ++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ++ library_names_spec='${libname}.dll.lib' ++ ++ case $build_os in ++ mingw*) ++ sys_lib_search_path_spec= ++ lt_save_ifs=$IFS ++ IFS=';' ++ for lt_path in $LIB ++ do ++ IFS=$lt_save_ifs ++ # Let DOS variable expansion print the short 8.3 style file name. ++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` ++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" ++ done ++ IFS=$lt_save_ifs ++ # Convert to MSYS style. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ++ ;; ++ cygwin*) ++ # Convert to unix form, then to dos form, then back to unix form ++ # but this time dos style (no spaces!) so that the unix form looks ++ # like /cygdrive/c/PROGRA~1:/cygdr... ++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` ++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` ++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ ;; ++ *) ++ sys_lib_search_path_spec="$LIB" ++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then ++ # It is most probably a Windows format PATH. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ # FIXME: find the short name or the path components, as spaces are ++ # common. (e.g. "Program Files" -> "PROGRA~1") ++ ;; ++ esac ++ ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds ++ postinstall_cmds='base_file=`basename \${file}`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ dldir=$destdir/`dirname \$dlpath`~ ++ test -d \$dldir || mkdir -p \$dldir~ ++ $install_prog $dir/$dlname \$dldir/$dlname' ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ ++ dlpath=$dir/\$dldll~ ++ $RM \$dlpath' ++ shlibpath_overrides_runpath=yes ++ dynamic_linker='Win32 link.exe' + ;; + + *) ++ # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ++ dynamic_linker='Win32 ld.exe' + ;; + esac +- dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; +@@ -10340,7 +10990,7 @@ + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +@@ -11180,10 +11830,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -11286,10 +11936,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -12831,13 +13481,20 @@ + lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' + lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' + lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' ++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' ++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' + reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' + reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' + OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' + deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' + file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' ++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' ++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' ++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' ++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' + AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' + AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' ++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' + STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' + RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' + old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +@@ -12852,14 +13509,17 @@ + lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' ++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' ++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' + objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' + MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' ++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' + lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' + need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' ++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' + DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' + NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' + LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +@@ -12892,12 +13552,12 @@ + hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' + inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' + link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' + always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' + export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' + exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' + include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' + prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' ++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' + file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' + variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' + need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +@@ -12952,8 +13612,13 @@ + OBJDUMP \ + deplibs_check_method \ + file_magic_cmd \ ++file_magic_glob \ ++want_nocaseglob \ ++DLLTOOL \ ++sharedlib_from_linklib_cmd \ + AR \ + AR_FLAGS \ ++archiver_list_spec \ + STRIP \ + RANLIB \ + CC \ +@@ -12963,12 +13628,14 @@ + lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ ++nm_file_list_spec \ + lt_prog_compiler_no_builtin_flag \ +-lt_prog_compiler_wl \ + lt_prog_compiler_pic \ ++lt_prog_compiler_wl \ + lt_prog_compiler_static \ + lt_cv_prog_compiler_c_o \ + need_locks \ ++MANIFEST_TOOL \ + DSYMUTIL \ + NMEDIT \ + LIPO \ +@@ -12984,7 +13651,6 @@ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ +-fix_srcfile_path \ + exclude_expsyms \ + include_expsyms \ + file_list_spec \ +@@ -13020,6 +13686,7 @@ + module_expsym_cmds \ + export_symbols_cmds \ + prelink_cmds \ ++postlink_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + finish_cmds \ +@@ -13776,7 +14443,8 @@ + # NOTE: Changes made to this file will be lost: look at ltmain.sh. + # + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, ++# Inc. + # Written by Gordon Matzigkeit, 1996 + # + # This file is part of GNU Libtool. +@@ -13879,19 +14547,42 @@ + # turn newlines into spaces. + NL2SP=$lt_lt_NL2SP + ++# convert \$build file names to \$host format. ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++ ++# convert \$build files to toolchain format. ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++ + # An object symbol dumper. + OBJDUMP=$lt_OBJDUMP + + # Method to check whether dependent libraries are shared objects. + deplibs_check_method=$lt_deplibs_check_method + +-# Command to use when deplibs_check_method == "file_magic". ++# Command to use when deplibs_check_method = "file_magic". + file_magic_cmd=$lt_file_magic_cmd + ++# How to find potential files when deplibs_check_method = "file_magic". ++file_magic_glob=$lt_file_magic_glob ++ ++# Find potential files using nocaseglob when deplibs_check_method = "file_magic". ++want_nocaseglob=$lt_want_nocaseglob ++ ++# DLL creation program. ++DLLTOOL=$lt_DLLTOOL ++ ++# Command to associate shared and link libraries. ++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd ++ + # The archiver. + AR=$lt_AR ++ ++# Flags to create an archive. + AR_FLAGS=$lt_AR_FLAGS + ++# How to feed a file listing to the archiver. ++archiver_list_spec=$lt_archiver_list_spec ++ + # A symbol stripping program. + STRIP=$lt_STRIP + +@@ -13921,6 +14612,12 @@ + # Transform the output of nm in a C name address pair when lib prefix is needed. + global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + ++# Specify filename containing input files for \$NM. ++nm_file_list_spec=$lt_nm_file_list_spec ++ ++# The root where to search for dependent libraries,and in which our libraries should be installed. ++lt_sysroot=$lt_sysroot ++ + # The name of the directory that contains temporary libtool files. + objdir=$objdir + +@@ -13930,6 +14627,9 @@ + # Must we lock files when doing compilation? + need_locks=$lt_need_locks + ++# Manifest tool. ++MANIFEST_TOOL=$lt_MANIFEST_TOOL ++ + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. + DSYMUTIL=$lt_DSYMUTIL + +@@ -14044,12 +14744,12 @@ + # Compiler flag to turn off builtin functions. + no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +-# How to pass a linker flag through the compiler. +-wl=$lt_lt_prog_compiler_wl +- + # Additional compiler flags for building library objects. + pic_flag=$lt_lt_prog_compiler_pic + ++# How to pass a linker flag through the compiler. ++wl=$lt_lt_prog_compiler_wl ++ + # Compiler flag to prevent dynamic linking. + link_static_flag=$lt_lt_prog_compiler_static + +@@ -14136,9 +14836,6 @@ + # Whether libtool must link a program against all its dependency libraries. + link_all_deplibs=$link_all_deplibs + +-# Fix the shell variable \$srcfile for the compiler. +-fix_srcfile_path=$lt_fix_srcfile_path +- + # Set to "yes" if exported symbols are required. + always_export_symbols=$always_export_symbols + +@@ -14154,6 +14851,9 @@ + # Commands necessary for linking programs (against libraries) with templates. + prelink_cmds=$lt_prelink_cmds + ++# Commands necessary for finishing linking programs. ++postlink_cmds=$lt_postlink_cmds ++ + # Specify filename containing input files. + file_list_spec=$lt_file_list_spec + +@@ -14186,210 +14886,169 @@ + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? +- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) +- +- case $xsi_shell in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result="${1##*/}" +-} +- +-# func_dirname_and_basename file append nondir_replacement +-# perform func_basename and func_dirname in a single function +-# call: +-# dirname: Compute the dirname of FILE. If nonempty, +-# add APPEND to the result, otherwise set result +-# to NONDIR_REPLACEMENT. +-# value returned in "$func_dirname_result" +-# basename: Compute filename of FILE. +-# value retuned in "$func_basename_result" +-# Implementation must be kept synchronized with func_dirname +-# and func_basename. For efficiency, we do not delegate to +-# those functions but instead duplicate the functionality here. +-func_dirname_and_basename () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +- func_basename_result="${1##*/}" +-} +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-func_stripname () +-{ +- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are +- # positional parameters, so assign one to ordinary parameter first. +- func_stripname_result=${3} +- func_stripname_result=${func_stripname_result#"${1}"} +- func_stripname_result=${func_stripname_result%"${2}"} +-} +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=${1%%=*} +- func_opt_split_arg=${1#*=} +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- case ${1} in +- *.lo) func_lo2o_result=${1%.lo}.${objext} ;; +- *) func_lo2o_result=${1} ;; +- esac +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=${1%.*}.lo +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=$(( $* )) +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=${#1} +-} +- +-_LT_EOF +- ;; +- *) # Bourne compatible functions. +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- # Extract subdirectory from the argument. +- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` +- if test "X$func_dirname_result" = "X${1}"; then +- func_dirname_result="${3}" +- else +- func_dirname_result="$func_dirname_result${2}" +- fi +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result=`$ECHO "${1}" | $SED "$basename"` +-} +- +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-# func_strip_suffix prefix name +-func_stripname () +-{ +- case ${2} in +- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; +- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; +- esac +-} +- +-# sed scripts: +-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +-my_sed_long_arg='1s/^-[^=]*=//' +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` +- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=`expr "$@"` +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +-} +- +-_LT_EOF +-esac +- +-case $lt_shell_append in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$1+=\$2" +-} +-_LT_EOF +- ;; +- *) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$1=\$$1\$2" +-} +- +-_LT_EOF +- ;; +- esac ++ sed '$q' "$ltmain" >> "$cfgfile" \ ++ || (rm -f "$cfgfile"; exit 1) + ++ if test x"$xsi_shell" = xyes; then ++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ ++func_dirname ()\ ++{\ ++\ case ${1} in\ ++\ */*) func_dirname_result="${1%/*}${2}" ;;\ ++\ * ) func_dirname_result="${3}" ;;\ ++\ esac\ ++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_basename ()$/,/^} # func_basename /c\ ++func_basename ()\ ++{\ ++\ func_basename_result="${1##*/}"\ ++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ ++func_dirname_and_basename ()\ ++{\ ++\ case ${1} in\ ++\ */*) func_dirname_result="${1%/*}${2}" ;;\ ++\ * ) func_dirname_result="${3}" ;;\ ++\ esac\ ++\ func_basename_result="${1##*/}"\ ++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ ++func_stripname ()\ ++{\ ++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ ++\ # positional parameters, so assign one to ordinary parameter first.\ ++\ func_stripname_result=${3}\ ++\ func_stripname_result=${func_stripname_result#"${1}"}\ ++\ func_stripname_result=${func_stripname_result%"${2}"}\ ++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ ++func_split_long_opt ()\ ++{\ ++\ func_split_long_opt_name=${1%%=*}\ ++\ func_split_long_opt_arg=${1#*=}\ ++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ ++func_split_short_opt ()\ ++{\ ++\ func_split_short_opt_arg=${1#??}\ ++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ ++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ ++func_lo2o ()\ ++{\ ++\ case ${1} in\ ++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ ++\ *) func_lo2o_result=${1} ;;\ ++\ esac\ ++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_xform ()$/,/^} # func_xform /c\ ++func_xform ()\ ++{\ ++ func_xform_result=${1%.*}.lo\ ++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_arith ()$/,/^} # func_arith /c\ ++func_arith ()\ ++{\ ++ func_arith_result=$(( $* ))\ ++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_len ()$/,/^} # func_len /c\ ++func_len ()\ ++{\ ++ func_len_result=${#1}\ ++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++fi ++ ++if test x"$lt_shell_append" = xyes; then ++ sed -e '/^func_append ()$/,/^} # func_append /c\ ++func_append ()\ ++{\ ++ eval "${1}+=\\${2}"\ ++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ ++func_append_quoted ()\ ++{\ ++\ func_quote_for_eval "${2}"\ ++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ ++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ # Save a `func_append' function call where possible by direct use of '+=' ++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++else ++ # Save a `func_append' function call even when '+=' is not available ++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++fi ++ ++if test x"$_lt_function_replace_fail" = x":"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 ++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} ++fi + +- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) + +- mv -f "$cfgfile" "$ofile" || ++ mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +Index: binutils-2.24/ld/configure +=================================================================== +--- binutils-2.24.orig/ld/configure 2013-11-04 07:33:39.000000000 -0800 ++++ binutils-2.24/ld/configure 2013-12-15 11:12:06.120451266 -0800 +@@ -646,8 +646,11 @@ + LIPO + NMEDIT + DSYMUTIL ++MANIFEST_TOOL + RANLIB ++ac_ct_AR + AR ++DLLTOOL + OBJDUMP + LN_S + NM +@@ -785,6 +788,7 @@ + with_pic + enable_fast_install + with_gnu_ld ++with_libtool_sysroot + enable_libtool_lock + enable_nls + enable_initfini_array +@@ -1452,6 +1456,8 @@ + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] ++ --with-libtool-sysroot=DIR Search for dependent libraries within DIR ++ (or the compiler's sysroot if not specified). + --with-zlib include zlib support (auto/yes/no) default=auto + + Some influential environment variables: +@@ -6125,8 +6131,8 @@ + + + +-macro_version='2.2.7a' +-macro_revision='1.3134' ++macro_version='2.4' ++macro_revision='1.3293' + + + +@@ -6166,7 +6172,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 + $as_echo_n "checking how to print strings... " >&6; } + # Test print first, because it will be a builtin if present. +-if test "X`print -r -- -n 2>/dev/null`" = X-n && \ ++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' + elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then +@@ -6852,8 +6858,8 @@ + # Try some XSI features + xsi_shell=no + ( _lt_dummy="a/b/c" +- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ +- = c,a/b,, \ ++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ ++ = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +@@ -6902,6 +6908,80 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 ++$as_echo_n "checking how to convert $build file names to $host format... " >&6; } ++if test "${lt_cv_to_host_file_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ++ ;; ++ esac ++ ;; ++ *-*-cygwin* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ++ ;; ++ *-*-cygwin* ) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++ * ) # otherwise, assume *nix ++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ++ ;; ++ esac ++ ;; ++ * ) # unhandled hosts (and "normal" native builds) ++ lt_cv_to_host_file_cmd=func_convert_file_noop ++ ;; ++esac ++ ++fi ++ ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 ++$as_echo "$lt_cv_to_host_file_cmd" >&6; } ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 ++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } ++if test "${lt_cv_to_tool_file_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ #assume ordinary cross tools, or native build. ++lt_cv_to_tool_file_cmd=func_convert_file_noop ++case $host in ++ *-*-mingw* ) ++ case $build in ++ *-*-mingw* ) # actually msys ++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ++ ;; ++ esac ++ ;; ++esac ++ ++fi ++ ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 ++$as_echo "$lt_cv_to_tool_file_cmd" >&6; } ++ ++ ++ ++ ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 + $as_echo_n "checking for $LD option to reload object files... " >&6; } + if test "${lt_cv_ld_reload_flag+set}" = set; then : +@@ -6918,6 +6998,11 @@ + esac + reload_cmds='$LD$reload_flag -o $output$reload_objs' + case $host_os in ++ cygwin* | mingw* | pw32* | cegcc*) ++ if test "$GCC" != yes; then ++ reload_cmds=false ++ fi ++ ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' +@@ -7086,7 +7171,8 @@ + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else +- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' ++ # Keep this pattern in sync with the one in func_win32_libid. ++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; +@@ -7240,6 +7326,21 @@ + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 + $as_echo "$lt_cv_deplibs_check_method" >&6; } ++ ++file_magic_glob= ++want_nocaseglob=no ++if test "$build" = "$host"; then ++ case $host_os in ++ mingw* | pw32*) ++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then ++ want_nocaseglob=yes ++ else ++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` ++ fi ++ ;; ++ esac ++fi ++ + file_magic_cmd=$lt_cv_file_magic_cmd + deplibs_check_method=$lt_cv_deplibs_check_method + test -z "$deplibs_check_method" && deplibs_check_method=unknown +@@ -7255,9 +7356,162 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +-set dummy ${ac_tool_prefix}ar; ac_word=$2 ++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. ++set dummy ${ac_tool_prefix}dlltool; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_DLLTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$DLLTOOL"; then ++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++DLLTOOL=$ac_cv_prog_DLLTOOL ++if test -n "$DLLTOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 ++$as_echo "$DLLTOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_DLLTOOL"; then ++ ac_ct_DLLTOOL=$DLLTOOL ++ # Extract the first word of "dlltool", so it can be a program name with args. ++set dummy dlltool; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_DLLTOOL"; then ++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_DLLTOOL="dlltool" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL ++if test -n "$ac_ct_DLLTOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 ++$as_echo "$ac_ct_DLLTOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_DLLTOOL" = x; then ++ DLLTOOL="false" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ DLLTOOL=$ac_ct_DLLTOOL ++ fi ++else ++ DLLTOOL="$ac_cv_prog_DLLTOOL" ++fi ++ ++test -z "$DLLTOOL" && DLLTOOL=dlltool ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 ++$as_echo_n "checking how to associate runtime and link libraries... " >&6; } ++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_sharedlib_from_linklib_cmd='unknown' ++ ++case $host_os in ++cygwin* | mingw* | pw32* | cegcc*) ++ # two different shell functions defined in ltmain.sh ++ # decide which to use based on capabilities of $DLLTOOL ++ case `$DLLTOOL --help 2>&1` in ++ *--identify-strict*) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ++ ;; ++ *) ++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ++ ;; ++ esac ++ ;; ++*) ++ # fallback: assume linklib IS sharedlib ++ lt_cv_sharedlib_from_linklib_cmd="$ECHO" ++ ;; ++esac ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 ++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } ++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd ++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO ++ ++ ++ ++ ++ ++ ++ ++if test -n "$ac_tool_prefix"; then ++ for ac_prog in ar ++ do ++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. ++set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_prog_AR+set}" = set; then : +@@ -7273,7 +7527,7 @@ + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_AR="${ac_tool_prefix}ar" ++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -7293,11 +7547,15 @@ + fi + + ++ test -n "$AR" && break ++ done + fi +-if test -z "$ac_cv_prog_AR"; then ++if test -z "$AR"; then + ac_ct_AR=$AR +- # Extract the first word of "ar", so it can be a program name with args. +-set dummy ar; ac_word=$2 ++ for ac_prog in ar ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 + $as_echo_n "checking for $ac_word... " >&6; } + if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +@@ -7313,7 +7571,7 @@ + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_prog_ac_ct_AR="ar" ++ ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +@@ -7332,6 +7590,10 @@ + $as_echo "no" >&6; } + fi + ++ ++ test -n "$ac_ct_AR" && break ++done ++ + if test "x$ac_ct_AR" = x; then + AR="false" + else +@@ -7343,12 +7605,10 @@ + esac + AR=$ac_ct_AR + fi +-else +- AR="$ac_cv_prog_AR" + fi + +-test -z "$AR" && AR=ar +-test -z "$AR_FLAGS" && AR_FLAGS=cru ++: ${AR=ar} ++: ${AR_FLAGS=cru} + + + +@@ -7360,6 +7620,64 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 ++$as_echo_n "checking for archiver @FILE support... " >&6; } ++if test "${lt_cv_ar_at_file+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_ar_at_file=no ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ echo conftest.$ac_objext > conftest.lst ++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 ++ (eval $lt_ar_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if test "$ac_status" -eq 0; then ++ # Ensure the archiver fails upon bogus file names. ++ rm -f conftest.$ac_objext libconftest.a ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 ++ (eval $lt_ar_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if test "$ac_status" -ne 0; then ++ lt_cv_ar_at_file=@ ++ fi ++ fi ++ rm -f conftest.* libconftest.a ++ ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 ++$as_echo "$lt_cv_ar_at_file" >&6; } ++ ++if test "x$lt_cv_ar_at_file" = xno; then ++ archiver_list_spec= ++else ++ archiver_list_spec=$lt_cv_ar_at_file ++fi ++ ++ ++ ++ ++ ++ ++ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. + set dummy ${ac_tool_prefix}strip; ac_word=$2 +@@ -7694,8 +8012,8 @@ + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + + # Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + + # Handle CRLF in mingw tool chain + opt_cr= +@@ -7731,6 +8049,7 @@ + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi ++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no +@@ -7772,6 +8091,18 @@ + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext ++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ ++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) ++/* DATA imports from DLLs on WIN32 con't be const, because runtime ++ relocations are performed -- see ld's documentation on pseudo-relocs. */ ++# define LT_DLSYM_CONST ++#elif defined(__osf__) ++/* This system does not cope well with relocations in const data. */ ++# define LT_DLSYM_CONST ++#else ++# define LT_DLSYM_CONST const ++#endif ++ + #ifdef __cplusplus + extern "C" { + #endif +@@ -7783,7 +8114,7 @@ + cat <<_LT_EOF >> conftest.$ac_ext + + /* The mapping between symbol names and symbols. */ +-const struct { ++LT_DLSYM_CONST struct { + const char *name; + void *address; + } +@@ -7809,8 +8140,8 @@ + _LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext +- lt_save_LIBS="$LIBS" +- lt_save_CFLAGS="$CFLAGS" ++ lt_globsym_save_LIBS=$LIBS ++ lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 +@@ -7820,8 +8151,8 @@ + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi +- LIBS="$lt_save_LIBS" +- CFLAGS="$lt_save_CFLAGS" ++ LIBS=$lt_globsym_save_LIBS ++ CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi +@@ -7858,6 +8189,23 @@ + $as_echo "ok" >&6; } + fi + ++# Response file support. ++if test "$lt_cv_nm_interface" = "MS dumpbin"; then ++ nm_file_list_spec='@' ++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then ++ nm_file_list_spec='@' ++fi ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +@@ -7874,6 +8222,38 @@ + + + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 ++$as_echo_n "checking for sysroot... " >&6; } ++ ++# Check whether --with-libtool-sysroot was given. ++if test "${with_libtool_sysroot+set}" = set; then : ++ withval=$with_libtool_sysroot; ++else ++ with_libtool_sysroot=no ++fi ++ ++ ++lt_sysroot= ++case ${with_libtool_sysroot} in #( ++ yes) ++ if test "$GCC" = yes; then ++ lt_sysroot=`$CC --print-sysroot 2>/dev/null` ++ fi ++ ;; #( ++ /*) ++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"` ++ ;; #( ++ no|'') ++ ;; #( ++ *) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5 ++$as_echo "${with_libtool_sysroot}" >&6; } ++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5 ++ ;; ++esac ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 ++$as_echo "${lt_sysroot:-no}" >&6; } + + + +@@ -8085,6 +8465,123 @@ + + need_locks="$enable_libtool_lock" + ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. ++set dummy ${ac_tool_prefix}mt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$MANIFEST_TOOL"; then ++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL ++if test -n "$MANIFEST_TOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 ++$as_echo "$MANIFEST_TOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL ++ # Extract the first word of "mt", so it can be a program name with args. ++set dummy mt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_MANIFEST_TOOL"; then ++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL ++if test -n "$ac_ct_MANIFEST_TOOL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 ++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_MANIFEST_TOOL" = x; then ++ MANIFEST_TOOL=":" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL ++ fi ++else ++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" ++fi ++ ++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 ++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } ++if test "${lt_cv_path_mainfest_tool+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_path_mainfest_tool=no ++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 ++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out ++ cat conftest.err >&5 ++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then ++ lt_cv_path_mainfest_tool=yes ++ fi ++ rm -f conftest* ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 ++$as_echo "$lt_cv_path_mainfest_tool" >&6; } ++if test "x$lt_cv_path_mainfest_tool" != xyes; then ++ MANIFEST_TOOL=: ++fi ++ ++ ++ ++ ++ + + case $host_os in + rhapsody* | darwin*) +@@ -8648,6 +9145,8 @@ + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 ++ echo "$RANLIB libconftest.a" >&5 ++ $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF + int main() { return 0;} + _LT_EOF +@@ -8716,6 +9215,16 @@ + + + ++func_stripname_cnf () ++{ ++ case ${2} in ++ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; ++ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; ++ esac ++} # func_stripname_cnf ++ ++ ++ + + + # Set options +@@ -8844,7 +9353,8 @@ + LIBTOOL_DEPS="$ltmain" + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++LIBTOOL='$(SHELL) $(top_builddir)' ++LIBTOOL="$LIBTOOL/${host_alias}-libtool" + + + +@@ -8933,7 +9443,7 @@ + esac + + # Global variables: +-ofile=libtool ++ofile=${host_alias}-libtool + can_build_shared=yes + + # All known linkers require a `.a' archive for static linking (except MSVC, +@@ -9231,8 +9741,6 @@ + lt_prog_compiler_pic= + lt_prog_compiler_static= + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +-$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' +@@ -9398,6 +9906,12 @@ + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; ++ nagfor*) ++ # NAG Fortran compiler ++ lt_prog_compiler_wl='-Wl,-Wl,,' ++ lt_prog_compiler_pic='-PIC' ++ lt_prog_compiler_static='-Bstatic' ++ ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) +@@ -9460,7 +9974,7 @@ + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in +- f77* | f90* | f95*) ++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; +@@ -9517,13 +10031,17 @@ + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; + esac +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +-$as_echo "$lt_prog_compiler_pic" >&6; } +- +- +- +- + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 ++$as_echo_n "checking for $compiler option to produce PIC... " >&6; } ++if test "${lt_cv_prog_compiler_pic+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 ++$as_echo "$lt_cv_prog_compiler_pic" >&6; } ++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + + # + # Check to make sure the PIC flag actually works. +@@ -9584,6 +10102,11 @@ + + + ++ ++ ++ ++ ++ + # + # Check to make sure the static flag actually works. + # +@@ -9934,7 +10457,8 @@ + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes +- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +@@ -9982,7 +10506,7 @@ + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then +- tmp_addflag= ++ tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler +@@ -10033,12 +10557,12 @@ + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' +- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' ++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ +- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' ++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac +@@ -10052,8 +10576,8 @@ + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + +@@ -10071,8 +10595,8 @@ + + _LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -10118,8 +10642,8 @@ + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -10249,7 +10773,13 @@ + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath_+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -10262,22 +10792,29 @@ + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath_ ++fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" +@@ -10289,7 +10826,13 @@ + else + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath_+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -10302,22 +10845,29 @@ + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath_"; then ++ lt_cv_aix_libpath_="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath_ ++fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, +@@ -10362,20 +10912,63 @@ + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. +- hardcode_libdir_flag_spec=' ' +- allow_undefined_flag=unsupported +- # Tell ltmain to make .lib files, not .a files. +- libext=lib +- # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" +- # FIXME: Setting linknames here is a bad hack. +- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' +- # The linker will automatically build a .lib file if we build a DLL. +- old_archive_from_new_cmds='true' +- # FIXME: Should let the user specify the lib program. +- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' +- fix_srcfile_path='`cygpath -w "$srcfile"`' +- enable_shared_with_static_runtimes=yes ++ case $cc_basename in ++ cl*) ++ # Native MSVC ++ hardcode_libdir_flag_spec=' ' ++ allow_undefined_flag=unsupported ++ always_export_symbols=yes ++ file_list_spec='@' ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' ++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; ++ else ++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' ++ # The linker will not automatically build a static lib if we build a DLL. ++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true' ++ enable_shared_with_static_runtimes=yes ++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ++ # Don't use ranlib ++ old_postinstall_cmds='chmod 644 $oldlib' ++ postlink_cmds='lt_outputfile="@OUTPUT@"~ ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile="$lt_outputfile.exe" ++ lt_tool_outputfile="$lt_tool_outputfile.exe" ++ ;; ++ esac~ ++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' ++ ;; ++ *) ++ # Assume MSVC wrapper ++ hardcode_libdir_flag_spec=' ' ++ allow_undefined_flag=unsupported ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' ++ # The linker will automatically build a .lib file if we build a DLL. ++ old_archive_from_new_cmds='true' ++ # FIXME: Should let the user specify the lib program. ++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' ++ enable_shared_with_static_runtimes=yes ++ ;; ++ esac + ;; + + darwin* | rhapsody*) +@@ -10436,7 +11029,7 @@ + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) +- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no +@@ -10444,7 +11037,7 @@ + + hpux9*) + if test "$GCC" = yes; then +- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi +@@ -10460,7 +11053,7 @@ + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi +@@ -10484,10 +11077,10 @@ + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) +- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else +@@ -10566,23 +11159,36 @@ + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ # This should be the same for all languages, so no per-tag cache variable. ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 ++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } ++if test "${lt_cv_irix_exported_symbol+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-int foo(void) {} ++int foo (void) { return 0; } + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' +- ++ lt_cv_irix_exported_symbol=yes ++else ++ lt_cv_irix_exported_symbol=no + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +- LDFLAGS="$save_LDFLAGS" ++ LDFLAGS="$save_LDFLAGS" ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 ++$as_echo "$lt_cv_irix_exported_symbol" >&6; } ++ if test "$lt_cv_irix_exported_symbol" = yes; then ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ++ fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' +@@ -10667,7 +11273,7 @@ + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' +- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' +@@ -10686,9 +11292,9 @@ + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' +- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) +@@ -11264,8 +11870,9 @@ + need_version=no + need_lib_prefix=no + +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) ++ case $GCC,$cc_basename in ++ yes,*) ++ # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ +@@ -11298,13 +11905,71 @@ + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac ++ dynamic_linker='Win32 ld.exe' ++ ;; ++ ++ *,cl*) ++ # Native MSVC ++ libname_spec='$name' ++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ++ library_names_spec='${libname}.dll.lib' ++ ++ case $build_os in ++ mingw*) ++ sys_lib_search_path_spec= ++ lt_save_ifs=$IFS ++ IFS=';' ++ for lt_path in $LIB ++ do ++ IFS=$lt_save_ifs ++ # Let DOS variable expansion print the short 8.3 style file name. ++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` ++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" ++ done ++ IFS=$lt_save_ifs ++ # Convert to MSYS style. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ++ ;; ++ cygwin*) ++ # Convert to unix form, then to dos form, then back to unix form ++ # but this time dos style (no spaces!) so that the unix form looks ++ # like /cygdrive/c/PROGRA~1:/cygdr... ++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` ++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` ++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ ;; ++ *) ++ sys_lib_search_path_spec="$LIB" ++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then ++ # It is most probably a Windows format PATH. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ # FIXME: find the short name or the path components, as spaces are ++ # common. (e.g. "Program Files" -> "PROGRA~1") ++ ;; ++ esac ++ ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds ++ postinstall_cmds='base_file=`basename \${file}`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ dldir=$destdir/`dirname \$dlpath`~ ++ test -d \$dldir || mkdir -p \$dldir~ ++ $install_prog $dir/$dlname \$dldir/$dlname' ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ ++ dlpath=$dir/\$dldll~ ++ $RM \$dlpath' ++ shlibpath_overrides_runpath=yes ++ dynamic_linker='Win32 link.exe' + ;; + + *) ++ # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ++ dynamic_linker='Win32 ld.exe' + ;; + esac +- dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; +@@ -11396,7 +12061,7 @@ + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +@@ -12192,7 +12857,7 @@ + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 12195 "configure" ++#line $LINENO "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -12236,10 +12901,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -12298,7 +12963,7 @@ + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 12301 "configure" ++#line $LINENO "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -12342,10 +13007,10 @@ + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ + #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +-void fnord () __attribute__((visibility("default"))); ++int fnord () __attribute__((visibility("default"))); + #endif + +-void fnord () { int i=42; } ++int fnord () { return 42; } + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); +@@ -12737,6 +13402,7 @@ + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC ++ lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX +@@ -12754,6 +13420,7 @@ + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} ++ CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + for cc_temp in $compiler""; do +@@ -12893,8 +13560,8 @@ + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then +- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' +@@ -13036,7 +13703,13 @@ + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath__CXX+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -13049,22 +13722,29 @@ + _ACEOF + if ac_fn_cxx_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath__CXX"; then ++ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath__CXX"; then ++ lt_cv_aix_libpath__CXX="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath__CXX ++fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + +@@ -13077,7 +13757,13 @@ + else + # Determine the default libpath from the value encoded in an + # empty executable. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ if test "${lt_cv_aix_libpath+set}" = set; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if test "${lt_cv_aix_libpath__CXX+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +@@ -13090,22 +13776,29 @@ + _ACEOF + if ac_fn_cxx_try_link "$LINENO"; then : + +-lt_aix_libpath_sed=' +- /Import File Strings/,/^$/ { +- /^0/ { +- s/^0 *\(.*\)$/\1/ +- p +- } +- }' +-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-# Check for a 64-bit object if we didn't find anything. +-if test -z "$aix_libpath"; then +- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +-fi ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath__CXX"; then ++ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ++ if test -z "$lt_cv_aix_libpath__CXX"; then ++ lt_cv_aix_libpath__CXX="/usr/lib:/lib" ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath__CXX ++fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, +@@ -13148,29 +13841,75 @@ + ;; + + cygwin* | mingw* | pw32* | cegcc*) +- # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, +- # as there is no search path for DLLs. +- hardcode_libdir_flag_spec_CXX='-L$libdir' +- export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' +- allow_undefined_flag_CXX=unsupported +- always_export_symbols_CXX=no +- enable_shared_with_static_runtimes_CXX=yes +- +- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then +- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- else +- ld_shlibs_CXX=no +- fi +- ;; ++ case $GXX,$cc_basename in ++ ,cl* | no,cl*) ++ # Native MSVC ++ # hardcode_libdir_flag_spec is actually meaningless, as there is ++ # no search path for DLLs. ++ hardcode_libdir_flag_spec_CXX=' ' ++ allow_undefined_flag_CXX=unsupported ++ always_export_symbols_CXX=yes ++ file_list_spec_CXX='@' ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=".dll" ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' ++ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; ++ else ++ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' ++ # The linker will not automatically build a static lib if we build a DLL. ++ # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' ++ enable_shared_with_static_runtimes_CXX=yes ++ # Don't use ranlib ++ old_postinstall_cmds_CXX='chmod 644 $oldlib' ++ postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile="$lt_outputfile.exe" ++ lt_tool_outputfile="$lt_tool_outputfile.exe" ++ ;; ++ esac~ ++ func_to_tool_file "$lt_outputfile"~ ++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' ++ ;; ++ *) ++ # g++ ++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, ++ # as there is no search path for DLLs. ++ hardcode_libdir_flag_spec_CXX='-L$libdir' ++ export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' ++ allow_undefined_flag_CXX=unsupported ++ always_export_symbols_CXX=no ++ enable_shared_with_static_runtimes_CXX=yes ++ ++ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then ++ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ # If the export-symbols file already is a .def file (1st line ++ # is EXPORTS), use it as is; otherwise, prepend... ++ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then ++ cp $export_symbols $output_objdir/$soname.def; ++ else ++ echo EXPORTS > $output_objdir/$soname.def; ++ cat $export_symbols >> $output_objdir/$soname.def; ++ fi~ ++ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ else ++ ld_shlibs_CXX=no ++ fi ++ ;; ++ esac ++ ;; + darwin* | rhapsody*) + + +@@ -13276,7 +14015,7 @@ + ;; + *) + if test "$GXX" = yes; then +- archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no +@@ -13347,10 +14086,10 @@ + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) +- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) +- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi +@@ -13391,9 +14130,9 @@ + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then +- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else +- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' ++ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes +@@ -13463,20 +14202,20 @@ + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ +- compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' ++ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ +- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ ++ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ +- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' ++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ +- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' +@@ -13671,7 +14410,7 @@ + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) +- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + +@@ -13717,7 +14456,7 @@ + + solaris*) + case $cc_basename in +- CC*) ++ CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' +@@ -13758,9 +14497,9 @@ + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then +- archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' ++ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when +@@ -13895,6 +14634,13 @@ + }; + _LT_EOF + ++ ++_lt_libdeps_save_CFLAGS=$CFLAGS ++case "$CC $CFLAGS " in #( ++*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; ++*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; ++esac ++ + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +@@ -13908,7 +14654,7 @@ + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do +- case $p in ++ case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. +@@ -13917,13 +14663,22 @@ + test $p = "-R"; then + prev=$p + continue +- else +- prev= + fi + ++ # Expand the sysroot to ease extracting the directories later. ++ if test -z "$prev"; then ++ case $p in ++ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; ++ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; ++ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; ++ esac ++ fi ++ case $p in ++ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; ++ esac + if test "$pre_test_object_deps_done" = no; then +- case $p in +- -L* | -R*) ++ case ${prev} in ++ -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. +@@ -13943,8 +14698,10 @@ + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi ++ prev= + ;; + ++ *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. +@@ -13980,6 +14737,7 @@ + fi + + $RM -f confest.$objext ++CFLAGS=$_lt_libdeps_save_CFLAGS + + # PORTME: override above test on systems where it is broken + case $host_os in +@@ -14015,7 +14773,7 @@ + + solaris*) + case $cc_basename in +- CC*) ++ CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as +@@ -14080,8 +14838,6 @@ + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX= + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +-$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then +@@ -14186,6 +14942,11 @@ + ;; + esac + ;; ++ mingw* | cygwin* | os2* | pw32* | cegcc*) ++ # This hack is so that the source file can tell whether it is being ++ # built for inclusion in a dll (and should export symbols for example). ++ lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ++ ;; + dgux*) + case $cc_basename in + ec++*) +@@ -14338,7 +15099,7 @@ + ;; + solaris*) + case $cc_basename in +- CC*) ++ CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' +@@ -14403,10 +15164,17 @@ + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; + esac +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5 +-$as_echo "$lt_prog_compiler_pic_CXX" >&6; } +- + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 ++$as_echo_n "checking for $compiler option to produce PIC... " >&6; } ++if test "${lt_cv_prog_compiler_pic_CXX+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 ++$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } ++lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + + # + # Check to make sure the PIC flag actually works. +@@ -14464,6 +15232,8 @@ + + + ++ ++ + # + # Check to make sure the static flag actually works. + # +@@ -14641,6 +15411,7 @@ + $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ++ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. +@@ -14655,15 +15426,20 @@ + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" +- ;; ++ ;; + cygwin* | mingw* | cegcc*) +- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' +- ;; ++ case $cc_basename in ++ cl*) ;; ++ *) ++ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ++ exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ++ ;; ++ esac ++ ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +- ;; ++ ;; + esac +- exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 + $as_echo "$ld_shlibs_CXX" >&6; } +@@ -14926,8 +15702,9 @@ + need_version=no + need_lib_prefix=no + +- case $GCC,$host_os in +- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) ++ case $GCC,$cc_basename in ++ yes,*) ++ # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ +@@ -14959,13 +15736,71 @@ + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac ++ dynamic_linker='Win32 ld.exe' ++ ;; ++ ++ *,cl*) ++ # Native MSVC ++ libname_spec='$name' ++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ++ library_names_spec='${libname}.dll.lib' ++ ++ case $build_os in ++ mingw*) ++ sys_lib_search_path_spec= ++ lt_save_ifs=$IFS ++ IFS=';' ++ for lt_path in $LIB ++ do ++ IFS=$lt_save_ifs ++ # Let DOS variable expansion print the short 8.3 style file name. ++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` ++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" ++ done ++ IFS=$lt_save_ifs ++ # Convert to MSYS style. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ++ ;; ++ cygwin*) ++ # Convert to unix form, then to dos form, then back to unix form ++ # but this time dos style (no spaces!) so that the unix form looks ++ # like /cygdrive/c/PROGRA~1:/cygdr... ++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` ++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` ++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ ;; ++ *) ++ sys_lib_search_path_spec="$LIB" ++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then ++ # It is most probably a Windows format PATH. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ # FIXME: find the short name or the path components, as spaces are ++ # common. (e.g. "Program Files" -> "PROGRA~1") ++ ;; ++ esac ++ ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds ++ postinstall_cmds='base_file=`basename \${file}`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ dldir=$destdir/`dirname \$dlpath`~ ++ test -d \$dldir || mkdir -p \$dldir~ ++ $install_prog $dir/$dlname \$dldir/$dlname' ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ ++ dlpath=$dir/\$dldll~ ++ $RM \$dlpath' ++ shlibpath_overrides_runpath=yes ++ dynamic_linker='Win32 link.exe' + ;; + + *) ++ # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ++ dynamic_linker='Win32 ld.exe' + ;; + esac +- dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; +@@ -15056,7 +15891,7 @@ + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +@@ -15515,6 +16350,7 @@ + fi # test -n "$compiler" + + CC=$lt_save_CC ++ CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC +@@ -17754,13 +18590,20 @@ + lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' + lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' + lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' ++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' ++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' + reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' + reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' + OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' + deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' + file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' ++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' ++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' ++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' ++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' + AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' + AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' ++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' + STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' + RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' + old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +@@ -17775,14 +18618,17 @@ + lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' ++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' ++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' + objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' + MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' ++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' + lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' + need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' ++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' + DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' + NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' + LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +@@ -17815,12 +18661,12 @@ + hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' + inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' + link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' + always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' + export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' + exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' + include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' + prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' ++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' + file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' + variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' + need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +@@ -17859,8 +18705,8 @@ + compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' + GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +-lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' ++lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' + lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' + lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' + archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +@@ -17887,12 +18733,12 @@ + hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' + inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' + link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +-fix_srcfile_path_CXX='`$ECHO "$fix_srcfile_path_CXX" | $SED "$delay_single_quote_subst"`' + always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' + export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' + exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' + include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' + prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' ++postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' + file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' + hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' + compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +@@ -17930,8 +18776,13 @@ + OBJDUMP \ + deplibs_check_method \ + file_magic_cmd \ ++file_magic_glob \ ++want_nocaseglob \ ++DLLTOOL \ ++sharedlib_from_linklib_cmd \ + AR \ + AR_FLAGS \ ++archiver_list_spec \ + STRIP \ + RANLIB \ + CC \ +@@ -17941,12 +18792,14 @@ + lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ ++nm_file_list_spec \ + lt_prog_compiler_no_builtin_flag \ +-lt_prog_compiler_wl \ + lt_prog_compiler_pic \ ++lt_prog_compiler_wl \ + lt_prog_compiler_static \ + lt_cv_prog_compiler_c_o \ + need_locks \ ++MANIFEST_TOOL \ + DSYMUTIL \ + NMEDIT \ + LIPO \ +@@ -17962,7 +18815,6 @@ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ +-fix_srcfile_path \ + exclude_expsyms \ + include_expsyms \ + file_list_spec \ +@@ -17984,8 +18836,8 @@ + reload_flag_CXX \ + compiler_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ +-lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ ++lt_prog_compiler_wl_CXX \ + lt_prog_compiler_static_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + export_dynamic_flag_spec_CXX \ +@@ -17997,7 +18849,6 @@ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ +-fix_srcfile_path_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX \ + file_list_spec_CXX \ +@@ -18031,6 +18882,7 @@ + module_expsym_cmds \ + export_symbols_cmds \ + prelink_cmds \ ++postlink_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + finish_cmds \ +@@ -18045,7 +18897,8 @@ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + export_symbols_cmds_CXX \ +-prelink_cmds_CXX; do ++prelink_cmds_CXX \ ++postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" +@@ -18838,7 +19691,8 @@ + # NOTE: Changes made to this file will be lost: look at ltmain.sh. + # + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, ++# Inc. + # Written by Gordon Matzigkeit, 1996 + # + # This file is part of GNU Libtool. +@@ -18941,19 +19795,42 @@ + # turn newlines into spaces. + NL2SP=$lt_lt_NL2SP + ++# convert \$build file names to \$host format. ++to_host_file_cmd=$lt_cv_to_host_file_cmd ++ ++# convert \$build files to toolchain format. ++to_tool_file_cmd=$lt_cv_to_tool_file_cmd ++ + # An object symbol dumper. + OBJDUMP=$lt_OBJDUMP + + # Method to check whether dependent libraries are shared objects. + deplibs_check_method=$lt_deplibs_check_method + +-# Command to use when deplibs_check_method == "file_magic". ++# Command to use when deplibs_check_method = "file_magic". + file_magic_cmd=$lt_file_magic_cmd + ++# How to find potential files when deplibs_check_method = "file_magic". ++file_magic_glob=$lt_file_magic_glob ++ ++# Find potential files using nocaseglob when deplibs_check_method = "file_magic". ++want_nocaseglob=$lt_want_nocaseglob ++ ++# DLL creation program. ++DLLTOOL=$lt_DLLTOOL ++ ++# Command to associate shared and link libraries. ++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd ++ + # The archiver. + AR=$lt_AR ++ ++# Flags to create an archive. + AR_FLAGS=$lt_AR_FLAGS + ++# How to feed a file listing to the archiver. ++archiver_list_spec=$lt_archiver_list_spec ++ + # A symbol stripping program. + STRIP=$lt_STRIP + +@@ -18983,6 +19860,12 @@ + # Transform the output of nm in a C name address pair when lib prefix is needed. + global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + ++# Specify filename containing input files for \$NM. ++nm_file_list_spec=$lt_nm_file_list_spec ++ ++# The root where to search for dependent libraries,and in which our libraries should be installed. ++lt_sysroot=$lt_sysroot ++ + # The name of the directory that contains temporary libtool files. + objdir=$objdir + +@@ -18992,6 +19875,9 @@ + # Must we lock files when doing compilation? + need_locks=$lt_need_locks + ++# Manifest tool. ++MANIFEST_TOOL=$lt_MANIFEST_TOOL ++ + # Tool to manipulate archived DWARF debug symbol files on Mac OS X. + DSYMUTIL=$lt_DSYMUTIL + +@@ -19106,12 +19992,12 @@ + # Compiler flag to turn off builtin functions. + no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +-# How to pass a linker flag through the compiler. +-wl=$lt_lt_prog_compiler_wl +- + # Additional compiler flags for building library objects. + pic_flag=$lt_lt_prog_compiler_pic + ++# How to pass a linker flag through the compiler. ++wl=$lt_lt_prog_compiler_wl ++ + # Compiler flag to prevent dynamic linking. + link_static_flag=$lt_lt_prog_compiler_static + +@@ -19198,9 +20084,6 @@ + # Whether libtool must link a program against all its dependency libraries. + link_all_deplibs=$link_all_deplibs + +-# Fix the shell variable \$srcfile for the compiler. +-fix_srcfile_path=$lt_fix_srcfile_path +- + # Set to "yes" if exported symbols are required. + always_export_symbols=$always_export_symbols + +@@ -19216,6 +20099,9 @@ + # Commands necessary for linking programs (against libraries) with templates. + prelink_cmds=$lt_prelink_cmds + ++# Commands necessary for finishing linking programs. ++postlink_cmds=$lt_postlink_cmds ++ + # Specify filename containing input files. + file_list_spec=$lt_file_list_spec + +@@ -19262,210 +20148,169 @@ + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? +- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) +- +- case $xsi_shell in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result="${1##*/}" +-} +- +-# func_dirname_and_basename file append nondir_replacement +-# perform func_basename and func_dirname in a single function +-# call: +-# dirname: Compute the dirname of FILE. If nonempty, +-# add APPEND to the result, otherwise set result +-# to NONDIR_REPLACEMENT. +-# value returned in "$func_dirname_result" +-# basename: Compute filename of FILE. +-# value retuned in "$func_basename_result" +-# Implementation must be kept synchronized with func_dirname +-# and func_basename. For efficiency, we do not delegate to +-# those functions but instead duplicate the functionality here. +-func_dirname_and_basename () +-{ +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +- func_basename_result="${1##*/}" +-} +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-func_stripname () +-{ +- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are +- # positional parameters, so assign one to ordinary parameter first. +- func_stripname_result=${3} +- func_stripname_result=${func_stripname_result#"${1}"} +- func_stripname_result=${func_stripname_result%"${2}"} +-} +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=${1%%=*} +- func_opt_split_arg=${1#*=} +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- case ${1} in +- *.lo) func_lo2o_result=${1%.lo}.${objext} ;; +- *) func_lo2o_result=${1} ;; +- esac +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=${1%.*}.lo +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=$(( $* )) +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=${#1} +-} +- +-_LT_EOF +- ;; +- *) # Bourne compatible functions. +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_dirname file append nondir_replacement +-# Compute the dirname of FILE. If nonempty, add APPEND to the result, +-# otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- # Extract subdirectory from the argument. +- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` +- if test "X$func_dirname_result" = "X${1}"; then +- func_dirname_result="${3}" +- else +- func_dirname_result="$func_dirname_result${2}" +- fi +-} +- +-# func_basename file +-func_basename () +-{ +- func_basename_result=`$ECHO "${1}" | $SED "$basename"` +-} +- +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-# func_strip_suffix prefix name +-func_stripname () +-{ +- case ${2} in +- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; +- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; +- esac +-} +- +-# sed scripts: +-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +-my_sed_long_arg='1s/^-[^=]*=//' +- +-# func_opt_split +-func_opt_split () +-{ +- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` +- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +-} +- +-# func_lo2o object +-func_lo2o () +-{ +- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +-} +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +-} +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=`expr "$@"` +-} +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +-} +- +-_LT_EOF +-esac +- +-case $lt_shell_append in +- yes) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$1+=\$2" +-} +-_LT_EOF +- ;; +- *) +- cat << \_LT_EOF >> "$cfgfile" +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "$1=\$$1\$2" +-} +- +-_LT_EOF +- ;; +- esac ++ sed '$q' "$ltmain" >> "$cfgfile" \ ++ || (rm -f "$cfgfile"; exit 1) + ++ if test x"$xsi_shell" = xyes; then ++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ ++func_dirname ()\ ++{\ ++\ case ${1} in\ ++\ */*) func_dirname_result="${1%/*}${2}" ;;\ ++\ * ) func_dirname_result="${3}" ;;\ ++\ esac\ ++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_basename ()$/,/^} # func_basename /c\ ++func_basename ()\ ++{\ ++\ func_basename_result="${1##*/}"\ ++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ ++func_dirname_and_basename ()\ ++{\ ++\ case ${1} in\ ++\ */*) func_dirname_result="${1%/*}${2}" ;;\ ++\ * ) func_dirname_result="${3}" ;;\ ++\ esac\ ++\ func_basename_result="${1##*/}"\ ++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ ++func_stripname ()\ ++{\ ++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ ++\ # positional parameters, so assign one to ordinary parameter first.\ ++\ func_stripname_result=${3}\ ++\ func_stripname_result=${func_stripname_result#"${1}"}\ ++\ func_stripname_result=${func_stripname_result%"${2}"}\ ++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ ++func_split_long_opt ()\ ++{\ ++\ func_split_long_opt_name=${1%%=*}\ ++\ func_split_long_opt_arg=${1#*=}\ ++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ ++func_split_short_opt ()\ ++{\ ++\ func_split_short_opt_arg=${1#??}\ ++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ ++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ ++func_lo2o ()\ ++{\ ++\ case ${1} in\ ++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ ++\ *) func_lo2o_result=${1} ;;\ ++\ esac\ ++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_xform ()$/,/^} # func_xform /c\ ++func_xform ()\ ++{\ ++ func_xform_result=${1%.*}.lo\ ++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_arith ()$/,/^} # func_arith /c\ ++func_arith ()\ ++{\ ++ func_arith_result=$(( $* ))\ ++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_len ()$/,/^} # func_len /c\ ++func_len ()\ ++{\ ++ func_len_result=${#1}\ ++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++fi ++ ++if test x"$lt_shell_append" = xyes; then ++ sed -e '/^func_append ()$/,/^} # func_append /c\ ++func_append ()\ ++{\ ++ eval "${1}+=\\${2}"\ ++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ ++func_append_quoted ()\ ++{\ ++\ func_quote_for_eval "${2}"\ ++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ ++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++test 0 -eq $? || _lt_function_replace_fail=: ++ ++ ++ # Save a `func_append' function call where possible by direct use of '+=' ++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++else ++ # Save a `func_append' function call even when '+=' is not available ++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ ++ && mv -f "$cfgfile.tmp" "$cfgfile" \ ++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") ++ test 0 -eq $? || _lt_function_replace_fail=: ++fi ++ ++if test x"$_lt_function_replace_fail" = x":"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 ++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} ++fi + +- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ +- || (rm -f "$cfgfile"; exit 1) + +- mv -f "$cfgfile" "$ofile" || ++ mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +@@ -19493,12 +20338,12 @@ + # Compiler flag to turn off builtin functions. + no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +-# How to pass a linker flag through the compiler. +-wl=$lt_lt_prog_compiler_wl_CXX +- + # Additional compiler flags for building library objects. + pic_flag=$lt_lt_prog_compiler_pic_CXX + ++# How to pass a linker flag through the compiler. ++wl=$lt_lt_prog_compiler_wl_CXX ++ + # Compiler flag to prevent dynamic linking. + link_static_flag=$lt_lt_prog_compiler_static_CXX + +@@ -19585,9 +20430,6 @@ + # Whether libtool must link a program against all its dependency libraries. + link_all_deplibs=$link_all_deplibs_CXX + +-# Fix the shell variable \$srcfile for the compiler. +-fix_srcfile_path=$lt_fix_srcfile_path_CXX +- + # Set to "yes" if exported symbols are required. + always_export_symbols=$always_export_symbols_CXX + +@@ -19603,6 +20445,9 @@ + # Commands necessary for linking programs (against libraries) with templates. + prelink_cmds=$lt_prelink_cmds_CXX + ++# Commands necessary for finishing linking programs. ++postlink_cmds=$lt_postlink_cmds_CXX ++ + # Specify filename containing input files. + file_list_spec=$lt_file_list_spec_CXX + +Index: binutils-2.24/bfd/configure.in +=================================================================== +--- binutils-2.24.orig/bfd/configure.in 2013-12-02 01:30:28.000000000 -0800 ++++ binutils-2.24/bfd/configure.in 2013-12-15 11:10:23.887118697 -0800 +@@ -568,7 +568,7 @@ + x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` + changequote([,])dnl + if test -n "$x"; then +- SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" ++ SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a" + fi + + # More hacks to build DLLs on Windows. +Index: binutils-2.24/opcodes/configure.in +=================================================================== +--- binutils-2.24.orig/opcodes/configure.in 2013-11-04 07:33:40.000000000 -0800 ++++ binutils-2.24/opcodes/configure.in 2013-12-15 11:10:23.887118697 -0800 +@@ -162,7 +162,7 @@ + x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` + changequote([,])dnl + if test -n "$x"; then +- SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" ++ SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a" + fi + + case "${host}" in diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/libtool-rpath-fix.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/libtool-rpath-fix.patch new file mode 100644 index 0000000..4fcffa4 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/libtool-rpath-fix.patch @@ -0,0 +1,39 @@ +Upstream-Status: Inappropriate [embedded specific] + +Enabling sysroot support in libtool exposed a bug where the final +library had an RPATH encoded into it which still pointed to the +sysroot. This works around the issue until it gets sorted out +upstream. + +Fix suggested by Richard Purdie +Signed-off-by: Scott Garman + +Index: binutils-2.22/ltmain.sh +=================================================================== +--- binutils-2.22.orig/ltmain.sh ++++ binutils-2.22/ltmain.sh +@@ -8035,9 +8035,11 @@ EOF + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then ++ func_replace_sysroot "$libdir" ++ libdir=$func_replace_sysroot_result ++ func_stripname '=' '' "$libdir" ++ libdir=$func_stripname_result + if test -n "$hardcode_libdir_separator"; then +- func_replace_sysroot "$libdir" +- libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else +@@ -8770,6 +8772,10 @@ EOF + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then ++ func_replace_sysroot "$libdir" ++ libdir=$func_replace_sysroot_result ++ func_stripname '=' '' "$libdir" ++ libdir=$func_stripname_result + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/mips64-default-ld-emulation.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/mips64-default-ld-emulation.patch new file mode 100644 index 0000000..51eaf0b --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/mips64-default-ld-emulation.patch @@ -0,0 +1,54 @@ +for mips64*-*-linux we change the default emulations to be +N64 instead of N32 + +Upstream-Status: Inappropriate [ OE configuration Specific] + +Signed-off-by: Khem Raj + +Index: binutils-2.24/bfd/config.bfd +=================================================================== +--- binutils-2.24.orig/bfd/config.bfd 2013-11-04 07:33:37.000000000 -0800 ++++ binutils-2.24/bfd/config.bfd 2013-12-15 11:54:57.113765374 -0800 +@@ -1052,14 +1052,14 @@ + targ_defvec=bfd_elf32_bigmips_vec + targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec" + ;; +- mips64*el-*-linux*) +- targ_defvec=bfd_elf32_ntradlittlemips_vec +- targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec" +- ;; +- mips64*-*-linux*) +- targ_defvec=bfd_elf32_ntradbigmips_vec +- targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" +- ;; ++ mips64*el-*-linux*) ++ targ_defvec=bfd_elf64_tradlittlemips_vec ++ targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradbigmips_vec" ++ ;; ++ mips64*-*-linux*) ++ targ_defvec=bfd_elf64_tradbigmips_vec ++ targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradlittlemips_vec" ++ ;; + mips*el-*-linux*) + targ_defvec=bfd_elf32_tradlittlemips_vec + targ_selvecs="bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec" +Index: binutils-2.24/ld/configure.tgt +=================================================================== +--- binutils-2.24.orig/ld/configure.tgt 2013-11-26 03:37:33.000000000 -0800 ++++ binutils-2.24/ld/configure.tgt 2013-12-15 11:50:52.273766155 -0800 +@@ -471,11 +471,11 @@ + mips*-*-vxworks*) targ_emul=elf32ebmipvxworks + targ_extra_emuls="elf32elmipvxworks" ;; + mips*-*-windiss) targ_emul=elf32mipswindiss ;; +-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 +- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" ++mips64*el-*-linux-*) targ_emul=elf64ltsmip ++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" + targ_extra_libpath=$targ_extra_emuls ;; +-mips64*-*-linux-*) targ_emul=elf32btsmipn32 +- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" ++mips64*-*-linux-*) targ_emul=elf64btsmip ++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" + targ_extra_libpath=$targ_extra_emuls ;; + mips*el-*-linux-*) targ_emul=elf32ltsmip + targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/relocatable_sdk.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/relocatable_sdk.patch new file mode 100644 index 0000000..7408c31 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/relocatable_sdk.patch @@ -0,0 +1,49 @@ +Upstream-Status: Inappropriate [SDK specific] + +This patch will modify the ELF linker scripts so that the crosssdk linker will +generate binaries with a 4096 bytes PT_INTERP section. When the binaries will +be relocated, at SDK install time, the interpreter path can be easily changed +by the relocating script. + +Signed-off-by: Laurentiu Palcu + +Index: binutils_git/ld/genscripts.sh +=================================================================== +--- binutils_git.orig/ld/genscripts.sh 2012-11-21 11:58:23.325441925 +0200 ++++ binutils_git/ld/genscripts.sh 2012-11-21 12:03:42.106815400 +0200 +@@ -290,6 +290,7 @@ + LD_FLAG=r + DATA_ALIGNMENT=${DATA_ALIGNMENT_r} + DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})" ++PARTIAL_LINKING=" " + ( echo "/* Script for ld -r: link without relocation */" + . ${CUSTOMIZER_SCRIPT} + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc +@@ -298,10 +299,12 @@ + LD_FLAG=u + DATA_ALIGNMENT=${DATA_ALIGNMENT_u} + CONSTRUCTING=" " ++PARTIAL_LINKING=" " + ( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */" + . ${CUSTOMIZER_SCRIPT} + . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu ++unset PARTIAL_LINKING + + LD_FLAG= + DATA_ALIGNMENT=${DATA_ALIGNMENT_} +Index: binutils_git/ld/scripttempl/elf.sc +=================================================================== +--- binutils_git.orig/ld/scripttempl/elf.sc 2012-11-21 12:02:26.800377384 +0200 ++++ binutils_git/ld/scripttempl/elf.sc 2012-11-21 12:04:16.166109621 +0200 +@@ -124,8 +124,8 @@ + DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);" + DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);" + fi +-if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then +- INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }" ++if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}${PARTIAL_LINKING}"; then ++ INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp); . = 0x1000; }" + fi + if test -z "$PLT"; then + IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }" diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/replace_macros_with_static_inline.patch b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/replace_macros_with_static_inline.patch new file mode 100644 index 0000000..834f55c --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils-linaro-2.24/replace_macros_with_static_inline.patch @@ -0,0 +1,188 @@ +Upstream-Status: Backport + +From 27b829ee701e29804216b3803fbaeb629be27491 Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Wed, 29 Jan 2014 13:46:39 +0000 +Subject: [PATCH 1/1] Following up on Tom's suggestion I am checking in a patch to replace the various + bfd_xxx_set macros with static inline functions, so that we can avoid compile time + warnings about comma expressions with unused values. + + * bfd-in.h (bfd_set_section_vma): Delete. + (bfd_set_section_alignment): Delete. + (bfd_set_section_userdata): Delete. + (bfd_set_cacheable): Delete. + * bfd.c (bfd_set_cacheable): New static inline function. + * section.c (bfd_set_section_userdata): Likewise. + (bfd_set_section_vma): Likewise. + (bfd_set_section_alignment): Likewise. + * bfd-in2.h: Regenerate. +--- + bfd/ChangeLog | 12 ++++++++++++ + bfd/bfd-in.h | 5 ----- + bfd/bfd-in2.h | 41 +++++++++++++++++++++++++++++++++++------ + bfd/bfd.c | 8 ++++++++ + bfd/section.c | 26 ++++++++++++++++++++++++++ + 5 files changed, 81 insertions(+), 11 deletions(-) + +diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h +index 3afd71b..c7c5a7d 100644 +--- a/bfd/bfd-in.h ++++ b/bfd/bfd-in.h +@@ -292,9 +292,6 @@ typedef struct bfd_section *sec_ptr; + + #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) + +-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) +-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) +-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) + /* Find the address one past the end of SEC. */ + #define bfd_get_section_limit(bfd, sec) \ + (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ +@@ -517,8 +514,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *); + + #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) + +-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +- + extern bfd_boolean bfd_cache_close + (bfd *abfd); + /* NB: This declaration should match the autogenerated one in libbfd.h. */ +diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h +index 71996db..b5aeb40 100644 +--- a/bfd/bfd-in2.h ++++ b/bfd/bfd-in2.h +@@ -299,9 +299,6 @@ typedef struct bfd_section *sec_ptr; + + #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) + +-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) +-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) +-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) + /* Find the address one past the end of SEC. */ + #define bfd_get_section_limit(bfd, sec) \ + (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ +@@ -524,8 +521,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *); + + #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) + +-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +- + extern bfd_boolean bfd_cache_close + (bfd *abfd); + /* NB: This declaration should match the autogenerated one in libbfd.h. */ +@@ -1029,7 +1024,7 @@ bfd *bfd_openr (const char *filename, const char *target); + + bfd *bfd_fdopenr (const char *filename, const char *target, int fd); + +-bfd *bfd_openstreamr (const char *, const char *, void *); ++bfd *bfd_openstreamr (const char * filename, const char * target, void * stream); + + bfd *bfd_openr_iovec (const char *filename, const char *target, + void *(*open_func) (struct bfd *nbfd, +@@ -1596,6 +1591,32 @@ struct relax_table { + int size; + }; + ++/* Note: the following are provided as inline functions rather than macros ++ because not all callers use the return value. A macro implementation ++ would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some ++ compilers will complain about comma expressions that have no effect. */ ++static inline bfd_boolean ++bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val) ++{ ++ ptr->userdata = val; ++ return TRUE; ++} ++ ++static inline bfd_boolean ++bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val) ++{ ++ ptr->vma = ptr->lma = val; ++ ptr->user_set_vma = TRUE; ++ return TRUE; ++} ++ ++static inline bfd_boolean ++bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val) ++{ ++ ptr->alignment_power = val; ++ return TRUE; ++} ++ + /* These sections are global, and are managed by BFD. The application + and target back end are not permitted to change the values in + these sections. */ +@@ -6415,6 +6436,14 @@ struct bfd + unsigned int selective_search : 1; + }; + ++/* See note beside bfd_set_section_userdata. */ ++static inline bfd_boolean ++bfd_set_cacheable (bfd * abfd, bfd_boolean val) ++{ ++ abfd->cacheable = val; ++ return TRUE; ++} ++ + typedef enum bfd_error + { + bfd_error_no_error = 0, +diff --git a/bfd/bfd.c b/bfd/bfd.c +index 8d0580c..2d174f3 100644 +--- a/bfd/bfd.c ++++ b/bfd/bfd.c +@@ -311,6 +311,14 @@ CODE_FRAGMENT + . unsigned int selective_search : 1; + .}; + . ++.{* See note beside bfd_set_section_userdata. *} ++.static inline bfd_boolean ++.bfd_set_cacheable (bfd * abfd, bfd_boolean val) ++.{ ++. abfd->cacheable = val; ++. return TRUE; ++.} ++. + */ + + #include "sysdep.h" +diff --git a/bfd/section.c b/bfd/section.c +index fb19d8c..a661228 100644 +--- a/bfd/section.c ++++ b/bfd/section.c +@@ -542,6 +542,32 @@ CODE_FRAGMENT + . int size; + .}; + . ++.{* Note: the following are provided as inline functions rather than macros ++. because not all callers use the return value. A macro implementation ++. would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some ++. compilers will complain about comma expressions that have no effect. *} ++.static inline bfd_boolean ++.bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val) ++.{ ++. ptr->userdata = val; ++. return TRUE; ++.} ++. ++.static inline bfd_boolean ++.bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val) ++.{ ++. ptr->vma = ptr->lma = val; ++. ptr->user_set_vma = TRUE; ++. return TRUE; ++.} ++. ++.static inline bfd_boolean ++.bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val) ++.{ ++. ptr->alignment_power = val; ++. return TRUE; ++.} ++. + .{* These sections are global, and are managed by BFD. The application + . and target back end are not permitted to change the values in + . these sections. *} +-- +1.7.1 + diff --git a/meta-linaro-toolchain/recipes-devtools/binutils/binutils_linaro-2.24.bb b/meta-linaro-toolchain/recipes-devtools/binutils/binutils_linaro-2.24.bb new file mode 100644 index 0000000..ef5b7c5 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/binutils/binutils_linaro-2.24.bb @@ -0,0 +1,39 @@ +require recipes-devtools/binutils/binutils.inc +require recipes-devtools/binutils/binutils-${PV}.inc + +DEPENDS += "flex bison zlib" + +EXTRA_OECONF += "--with-sysroot=/ \ + --enable-install-libbfd \ + --enable-install-libiberty \ + --enable-shared \ + " + +EXTRA_OECONF_class-native = "--enable-targets=all \ + --enable-64-bit-bfd \ + --enable-install-libbfd \ + --enable-install-libiberty" + +do_install_class-native () { + autotools_do_install + + # Install the libiberty header + install -d ${D}${includedir} + install -m 644 ${S}/include/ansidecl.h ${D}${includedir} + install -m 644 ${S}/include/libiberty.h ${D}${includedir} + + # We only want libiberty, libbfd and libopcodes + rm -rf ${D}${bindir} + rm -rf ${D}${prefix}/${TARGET_SYS} + rm -rf ${D}${prefix}/lib/ldscripts + rm -rf ${D}${prefix}/share/info + rm -rf ${D}${prefix}/share/locale + rm -rf ${D}${prefix}/share/man + rmdir ${D}${prefix}/share || : + rmdir ${D}/${libdir}/gcc-lib || : + rmdir ${D}/${libdir}64/gcc-lib || : + rmdir ${D}/${libdir} || : + rmdir ${D}/${libdir}64 || : +} + +BBCLASSEXTEND = "native" diff --git a/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/external-linaro-toolchain.bb b/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/external-linaro-toolchain.bb new file mode 100644 index 0000000..9e8ad6e --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/external-linaro-toolchain.bb @@ -0,0 +1,376 @@ +require recipes-core/glibc/glibc-package.inc + +INHIBIT_DEFAULT_DEPS = "1" +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" + +# License applies to this recipe code, not the toolchain itself +LICENSE = "MIT" +LIC_FILES_CHKSUM = "\ + file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \ +" + +PROVIDES += "\ + linux-libc-headers \ + virtual/${TARGET_PREFIX}gcc \ + virtual/${TARGET_PREFIX}g++ \ + virtual/${TARGET_PREFIX}gcc-initial \ + virtual/${TARGET_PREFIX}binutils \ + virtual/${TARGET_PREFIX}libc-for-gcc \ + virtual/${TARGET_PREFIX}compilerlibs \ + virtual/libc \ + virtual/libintl \ + virtual/libiconv \ + glibc-thread-db \ + glibc \ + libgcc \ + libg2c \ + libg2c-dev \ + libssp \ + libssp-dev \ + libssp-staticdev \ + libgfortran \ + libgfortran-dev \ + libgfortran-staticdev \ + libmudflap \ + libmudflap-dev \ + libgomp \ + libgomp-dev \ + libgomp-staticdev \ + libitm \ + libitm-dev \ + libitm-staticdev \ + virtual/linux-libc-headers \ + libgcov-dev \ +" + +PV = "${ELT_VER_MAIN}" + +# https://launchpad.net/linaro-toolchain-binaries +SRC_URI = "file://SUPPORTED" + +do_install() { + install -d ${D}${base_libdir} + install -d ${D}${bindir} + install -d ${D}${sbindir} + install -d ${D}${libdir} + install -d ${D}${libexecdir} + install -d ${D}${datadir} + install -d ${D}${includedir} + + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/lib/* ${D}${base_libdir} + if [ -d ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/lib/${ELT_TARGET_SYS} ]; then + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/lib/${ELT_TARGET_SYS}/* ${D}${base_libdir} + else + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/lib/* ${D}${base_libdir} + fi + if [ -d ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/lib/${ELT_TARGET_SYS} ]; then + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/lib/${ELT_TARGET_SYS}/* ${D}${libdir} + else + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/lib/* ${D}${libdir} + fi + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/share/* ${D}${datadir} + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/include/* ${D}${includedir} + if [ -d ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/include/${ELT_TARGET_SYS} ]; then + cp -a ${EXTERNAL_TOOLCHAIN}/${ELT_TARGET_SYS}/libc/usr/include/${ELT_TARGET_SYS}/* ${D}${includedir} + + rm -r ${D}${includedir}/${ELT_TARGET_SYS} + fi + + # fix up the copied symlinks (they are still pointing to the multiarch directory) + linker_name="${@base_contains("TUNE_FEATURES", "aarch64", "ld-linux-aarch64.so.1", base_contains("TUNE_FEATURES", "callconvention-hard", "ld-linux-armhf.so.3", "ld-linux.so.3",d), d)}" + ln -sf ld-${ELT_VER_LIBC}.so ${D}${base_libdir}/${linker_name} + ln -sf ../../lib/libnsl.so.1 ${D}${libdir}/libnsl.so + ln -sf ../../lib/librt.so.1 ${D}${libdir}/librt.so + ln -sf ../../lib/libcrypt.so.1 ${D}${libdir}/libcrypt.so + ln -sf ../../lib/libnss_nis.so.2 ${D}${libdir}/libnss_nis.so + ln -sf ../../lib/libresolv.so.2 ${D}${libdir}/libresolv.so + ln -sf ../../lib/libnss_dns.so.2 ${D}${libdir}/libnss_dns.so + ln -sf ../../lib/libnss_hesiod.so.2 ${D}${libdir}/libnss_hesiod.so + ln -sf ../../lib/libutil.so.1 ${D}${libdir}/libutil.so + ln -sf ../../lib/libnss_files.so.2 ${D}${libdir}/libnss_files.so + ln -sf ../../lib/libnss_compat.so.2 ${D}${libdir}/libnss_compat.so + ln -sf ../../lib/libcidn.so.1 ${D}${libdir}/libcidn.so + ln -sf ../../lib/libBrokenLocale.so.1 ${D}${libdir}/libBrokenLocale.so + ln -sf ../../lib/libthread_db.so.1 ${D}${libdir}/libthread_db.so + ln -sf ../../lib/libanl.so.1 ${D}${libdir}/libanl.so + ln -sf ../../lib/libdl.so.2 ${D}${libdir}/libdl.so + ln -sf ../../lib/libnss_nisplus.so.2 ${D}${libdir}/libnss_nisplus.so + ln -sf ../../lib/libm.so.6 ${D}${libdir}/libm.so + + if [ -d ${D}${base_libdir}/arm-linux-gnueabi ]; then + rm -rf ${D}${base_libdir}/arm-linux-gnueabi + fi + + if [ -d ${D}${base_libdir}/ldscripts ]; then + rm -rf ${D}${base_libdir}/ldscripts + fi + + if [ -f ${D}${libdir}/libc.so ];then + sed -i -e "s# /lib/${ELT_TARGET_SYS}# ../../lib#g" -e "s# /usr/lib/${ELT_TARGET_SYS}# .#g" -e "s# /lib/ld-linux# ../../lib/ld-linux#g" ${D}${libdir}/libc.so + fi + if [ -f ${D}${base_libdir}/libc.so ];then + sed -i -e "s# /lib/${ELT_TARGET_SYS}# ../../lib#g" -e "s# /usr/lib/${ELT_TARGET_SYS}# .#g" -e "s# /lib/ld-linux# ../../lib/ld-linux#g" ${D}${base_libdir}/libc.so + fi + if [ -f ${D}${libdir}/libpthread.so ];then + sed -i -e "s# /lib/${ELT_TARGET_SYS}# ../../lib#g" -e "s# /usr/lib/${ELT_TARGET_SYS}# .#g" ${D}${libdir}/libpthread.so + fi + if [ -f ${D}${base_libdir}/libpthread.so ];then + sed -i -e "s# /lib/${ELT_TARGET_SYS}# ../../lib#g" -e "s# /usr/lib/${ELT_TARGET_SYS}# .#g" ${D}${base_libdir}/libpthread.so + fi +} + +PACKAGES =+ "\ + libgcov-dev \ + libgcc \ + libgcc-dev \ + libstdc++ \ + libstdc++-dev \ + libstdc++-staticdev \ + libatomic \ + libatomic-dev \ + libatomic-staticdev \ + libasan \ + libasan-dev \ + libasan-staticdev \ + linux-libc-headers \ + libubsan \ + libubsan-dev \ + libubsan-staticdev \ + linux-libc-headers-dev \ + libssp \ + libssp-dev \ + libssp-staticdev \ + libgfortran \ + libgfortran-dev \ + libgfortran-staticdev \ + libmudflap \ + libmudflap-dev \ + libmudflap-staticdev \ + libgomp \ + libgomp-dev \ + libgomp-staticdev \ + libitm \ + libitm-dev \ + libitm-staticdev \ +" + +INSANE_SKIP_${PN}-dbg = "staticdev" +INSANE_SKIP_${PN}-utils += "ldflags" +INSANE_SKIP_libstdc++ += "ldflags" +INSANE_SKIP_libgcc += "ldflags" +INSANE_SKIP_gdbserver += "ldflags" + +# OE-core has literally listed 'glibc' in LIBC_DEPENDENCIES :/ +RPROVIDES_${PN} = "glibc" +# Add runtime provides for the other libc* packages as well +RPROVIDES_${PN}-dev = "glibc-dev" +RPROVIDES_${PN}-doc = "glibc-doc" +RPROVIDES_${PN}-dbg = "glibc-dbg" +RPROVIDES_${PN}-pic = "glibc-pic" +RPROVIDES_${PN}-utils = "glibc-utils" + +PKG_${PN} = "glibc" +PKG_${PN}-dev = "glibc-dev" +PKG_${PN}-doc = "glibc-doc" +PKG_${PN}-dbg = "glibc-dbg" +PKG_${PN}-pic = "glibc-pic" +PKG_${PN}-utils = "glibc-utils" +PKG_${PN}-gconv = "glibc-gconv" +PKG_${PN}-extra-nss = "glibc-extra-nss" +PKG_${PN}-thread-db = "glibc-thread-db" +PKG_${PN}-pcprofile = "glibc-pcprofile" +PKG_${PN}-staticdev = "glibc-staticdev" + +PKGV_${PN} = "${ELT_VER_LIBC}" +PKGV_${PN}-dev = "${ELT_VER_LIBC}" +PKGV_${PN}-doc = "${ELT_VER_LIBC}" +PKGV_${PN}-dbg = "${ELT_VER_LIBC}" +PKGV_${PN}-pic = "${ELT_VER_LIBC}" +PKGV_${PN}-utils = "${ELT_VER_LIBC}" +PKGV_${PN}-gconv = "${ELT_VER_LIBC}" +PKGV_${PN}-extra-nss = "${ELT_VER_LIBC}" +PKGV_${PN}-thread-db = "${ELT_VER_LIBC}" +PKGV_${PN}-pcprofile = "${ELT_VER_LIBC}" +PKGV_${PN}-staticdev = "${ELT_VER_LIBC}" +PKGV_catchsegv = "${ELT_VER_LIBC}" +PKGV_libsegfault = "${ELT_VER_LIBC}" +PKGV_sln = "${ELT_VER_LIBC}" +PKGV_nscd = "${ELT_VER_LIBC}" +PKGV_ldd = "${ELT_VER_LIBC}" +PKGV_libgcc = "${ELT_VER_GCC}" +PKGV_libgcc-dev = "${ELT_VER_GCC}" +PKGV_libstdc++ = "${ELT_VER_GCC}" +PKGV_libstdc++-dev = "${ELT_VER_GCC}" +PKGV_libstdc++-staticdev = "${ELT_VER_GCC}" +PKGV_libatomic = "${ELT_VER_GCC}" +PKGV_libatomic = "${ELT_VER_GCC}" +PKGV_libatomic = "${ELT_VER_GCC}" +PKGV_libasan = "${ELT_VER_GCC}" +PKGV_libasan-dev = "${ELT_VER_GCC}" +PKGV_libasan-staticdev = "${ELT_VER_GCC}" +PKGV_libubsan = "${ELT_VER_GCC}" +PKGV_libubsan-dev = "${ELT_VER_GCC}" +PKGV_libubsan-staticdev = "${ELT_VER_GCC}" +PKGV_linux-libc-headers = "${ELT_VER_KERNEL}" +PKGV_linux-libc-headers-dev = "${ELT_VER_KERNEL}" +PKGV_gdbserver = "${ELT_VER_GDBSERVER}" + +FILES_libgcov-dev = "${libdir}/${TARGET_SYS}/${BINV}/libgcov.a" + +FILES_libsegfault = "${base_libdir}/libSegFault*" + +FILES_catchsegv = "${bindir}/catchsegv" +RDEPENDS_catchsegv = "libsegfault" + +FILES_libatomic = "${base_libdir}/libatomic.so.*" +FILES_libatomic-dev = "\ + ${base_libdir}/libatomic.so \ + ${base_libdir}/libatomic.la \ +" +FILES_libatomic-staticdev = "${base_libdir}/libatomic.a" + +FILES_libasan = "${base_libdir}/libasan.so.*" +FILES_libasan-dev = "\ + ${base_libdir}/libasan.so \ + ${base_libdir}/libasan.la \ +" +FILES_libasan-staticdev = "${base_libdir}/libasan.a" + +FILES_libubsan = "${base_libdir}/libubsan.so.*" +FILES_libubsan-dev = "\ + ${base_libdir}/libubsan.so \ + ${base_libdir}/libubsan.la \ +" +FILES_libubsan-staticdev = "${base_libdir}/libubsan.a" + +FILES_libgcc = "${base_libdir}/libgcc_s.so.1" +FILES_libgcc-dev = "${base_libdir}/libgcc_s.so" +FILES_libstdc++ = "${base_libdir}/libstdc++.so.*" +FILES_libstdc++-dev = "\ + ${includedir}/c++/${PV} \ + ${base_libdir}/libstdc++.so" +FILES_libstdc++-staticdev = "\ + ${base_libdir}/libstdc++.a \ + ${base_libdir}/libsupc++.a \ +" +FILES_linux-libc-headers = "\ + ${includedir}/asm* \ + ${includedir}/linux \ + ${includedir}/mtd \ + ${includedir}/rdma \ + ${includedir}/scsi \ + ${includedir}/sound \ + ${includedir}/video \ +" +FILES_${PN} += "\ + ${libdir}/bin \ + ${libdir}/locale \ + ${libdir}/gconv/gconv-modules \ + ${datadir}/zoneinfo \ + ${base_libdir}/libcrypt*.so.* \ + ${base_libdir}/libcrypt-*.so \ + ${base_libdir}/libc.so.* \ + ${base_libdir}/libc-*.so \ + ${base_libdir}/libm.so.* \ + ${base_libdir}/libmemusage.so \ + ${base_libdir}/libm-*.so \ + ${base_libdir}/ld*.so.* \ + ${base_libdir}/ld-*.so \ + ${base_libdir}/libpthread*.so.* \ + ${base_libdir}/libpthread-*.so \ + ${base_libdir}/libresolv*.so.* \ + ${base_libdir}/libresolv-*.so \ + ${base_libdir}/librt*.so.* \ + ${base_libdir}/librt-*.so \ + ${base_libdir}/libutil*.so.* \ + ${base_libdir}/libutil-*.so \ + ${base_libdir}/libnsl*.so.* \ + ${base_libdir}/libnsl-*.so \ + ${base_libdir}/libnss_files*.so.* \ + ${base_libdir}/libnss_files-*.so \ + ${base_libdir}/libnss_compat*.so.* \ + ${base_libdir}/libnss_compat-*.so \ + ${base_libdir}/libnss_dns*.so.* \ + ${base_libdir}/libnss_dns-*.so \ + ${base_libdir}/libnss_nis*.so.* \ + ${base_libdir}/libnss_nisplus-*.so \ + ${base_libdir}/libnss_nisplus*.so.* \ + ${base_libdir}/libnss_nis-*.so \ + ${base_libdir}/libnss_hesiod*.so.* \ + ${base_libdir}/libnss_hesiod-*.so \ + ${base_libdir}/libdl*.so.* \ + ${base_libdir}/libdl-*.so \ + ${base_libdir}/libanl*.so.* \ + ${base_libdir}/libanl-*.so \ + ${base_libdir}/libBrokenLocale*.so.* \ + ${base_libdir}/libBrokenLocale-*.so \ + ${base_libdir}/libcidn*.so.* \ + ${base_libdir}/libcidn-*.so \ + ${base_libdir}/libthread_db*.so.* \ + ${base_libdir}/libthread_db-*.so \ + ${base_libdir}/libmemusage.so \ + ${base_libdir}/libSegFault.so \ + ${base_libdir}/libpcprofile.so \ + " + +FILES_libstdc++ = "${base_libdir}/libstdc++.so.*" +FILES_libstdc++-dev = "\ + ${includedir}/c++/ \ + ${base_libdir}/libstdc++.so \ + ${base_libdir}/libstdc++.la \ + ${base_libdir}/libsupc++.la" +FILES_libstdc++-staticdev = "\ + ${base_libdir}/libstdc++.a \ + ${base_libdir}/libsupc++.a" + +FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch" + +FILES_libssp = "${base_libdir}/libssp.so.*" +FILES_libssp-dev = " \ + ${base_libdir}/libssp*.so \ + ${base_libdir}/libssp*_nonshared.a \ + ${base_libdir}/libssp*.la \ + ${base_libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp" +FILES_libssp-staticdev = " \ + ${base_libdir}/libssp*.a" + +FILES_libgfortran = "${base_libdir}/libgfortran.so.*" +FILES_libgfortran-dev = " \ + ${base_libdir}/libgfortran.so" +FILES_libgfortran-staticdev = " \ + ${base_libdir}/libgfortran.a \ + ${base_libdir}/libgfortranbegin.a" + +FILES_libmudflap = "${base_libdir}/libmudflap*.so.*" +FILES_libmudflap-dev = "\ + ${base_libdir}/libmudflap*.so \ + ${base_libdir}/libmudflap*.a \ + ${base_libdir}/libmudflap*.la" + +FILES_libitm = "${base_libdir}/libitm*${SOLIBS}" +FILES_libitm-dev = "\ + ${base_libdir}/libitm*${SOLIBSDEV} \ + ${base_libdir}/libitm*.la \ + ${base_libdir}/libitm.spec \ + " +FILES_libitm-staticdev = "\ + ${base_libdir}/libitm*.a \ + " + +FILES_libgomp = "${base_libdir}/libgomp*${SOLIBS}" +FILES_libgomp-dev = "\ + ${base_libdir}/libgomp*${SOLIBSDEV} \ + ${base_libdir}/libgomp*.la \ + ${base_libdir}/libgomp.spec \ + ${base_libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \ + " +FILES_libgomp-staticdev = "\ + ${base_libdir}/libgomp*.a \ + " +ELT_VER_MAIN ??= "" + +python () { + if not d.getVar("ELT_VER_MAIN"): + raise bb.parse.SkipPackage("External Linaro toolchain not configured (ELT_VER_MAIN not set).") diff --git a/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/files/SUPPORTED b/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/files/SUPPORTED new file mode 100644 index 0000000..9615075 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/external-linaro-toolchain/files/SUPPORTED @@ -0,0 +1 @@ +POSIX diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.8.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.8.bb new file mode 100644 index 0000000..81c4700 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.8.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.8.inc +require recipes-devtools/gcc/gcc-cross-canadian_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.9.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.9.bb new file mode 100644 index 0000000..c473b6f --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-canadian_linaro-4.9.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.9.inc +require recipes-devtools/gcc/gcc-cross-canadian_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.8.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.8.bb new file mode 100644 index 0000000..c13cecf --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.8.bb @@ -0,0 +1,3 @@ +BASEPV = "4.8" +PV = "linaro-${BASEPV}" +require recipes-devtools/gcc/gcc-cross-initial_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.9.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.9.bb new file mode 100644 index 0000000..3a7abea --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross-initial_linaro-4.9.bb @@ -0,0 +1,3 @@ +BASEPV = "4.9" +PV = "linaro-${BASEPV}" +require recipes-devtools/gcc/gcc-cross-initial_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.8.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.8.bb new file mode 100644 index 0000000..05de58b --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.8.bb @@ -0,0 +1,3 @@ +BASEPV = "4.8" +PV = "linaro-${BASEPV}" +require recipes-devtools/gcc/gcc-cross_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.9.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.9.bb new file mode 100644 index 0000000..cc76e36 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-cross_linaro-4.9.bb @@ -0,0 +1,3 @@ +BASEPV = "4.9" +PV = "linaro-${BASEPV}" +require recipes-devtools/gcc/gcc-cross_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.8.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.8.bb new file mode 100644 index 0000000..09276a2 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.8.bb @@ -0,0 +1,4 @@ +require gcc-linaro-common-4.8.inc +require recipes-devtools/gcc/gcc-crosssdk-initial_${BASEPV}.bb + +EXTRA_OECONF += " --with-native-system-header-dir=${SYSTEMHEADERS} " diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.9.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.9.bb new file mode 100644 index 0000000..eb3719e --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk-initial_linaro-4.9.bb @@ -0,0 +1,4 @@ +require gcc-linaro-common-4.9.inc +require recipes-devtools/gcc/gcc-crosssdk-initial_${BASEPV}.bb + +EXTRA_OECONF += " --with-native-system-header-dir=${SYSTEMHEADERS} " diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.8.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.8.bb new file mode 100644 index 0000000..e622a48 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.8.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.8.inc +require recipes-devtools/gcc/gcc-crosssdk_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.9.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.9.bb new file mode 100644 index 0000000..5c3ab13 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-crosssdk_linaro-4.9.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.9.inc +require recipes-devtools/gcc/gcc-crosssdk_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8.inc b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8.inc new file mode 100644 index 0000000..76660d3 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8.inc @@ -0,0 +1,73 @@ +require recipes-devtools/gcc/gcc-4.8.inc +PV = "linaro-${BASEPV}" + +MMYY = "14.04" +RELEASE = "20${MMYY}" +PR = "r${RELEASE}" +BINV = "4.8.3" + +FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/gcc-${PV}' ], d)}" +FILESPATH_append := ":${COREBASE}/meta/recipes-devtools/gcc/gcc-4.8" + +SRC_URI = "https://releases.linaro.org/${MMYY}/components/toolchain/gcc-linaro/${BASEPV}/gcc-${PV}-${RELEASE}.tar.xz \ + file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \ + file://0002-uclibc-conf.patch \ + file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \ + file://0004-uclibc-locale.patch \ + file://0005-uclibc-locale-no__x.patch \ + file://0006-uclibc-locale-wchar_fix.patch \ + file://0007-uclibc-locale-update.patch \ + file://0008-missing-execinfo_h.patch \ + file://0009-c99-snprintf.patch \ + file://0010-c99-complex-ugly-hack.patch \ + file://0011-index_macro.patch \ + file://0012-libmudflap-susv3-legacy.patch \ + file://0013-libstdc-namespace.patch \ + file://0014-sh-pr24836.patch \ + file://0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch;apply=no \ + file://0016-gcc-poison-system-directories.patch \ + file://0017-gcc-poison-dir-extend.patch \ + file://0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \ + file://0019-64-bit-multilib-hack.patch \ + file://0020-optional-libstdc.patch \ + file://0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \ + file://0022-COLLECT_GCC_OPTIONS.patch \ + file://0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \ + file://0024-PR-target-32219.patch \ + file://0025-fortran-cross-compile-hack.patch \ + file://0026-libgcc-sjlj-check.patch \ + file://0027-cpp-honor-sysroot.patch \ + file://0028-MIPS64-Default-to-N64-ABI.patch \ + file://0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \ + file://0030-gcc-Fix-argument-list-too-long-error.patch \ + file://0031-Disable-sdt.patch \ + file://0032-libtool.patch \ + file://0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \ + file://0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch \ + file://0035-wcast-qual-PR-55383.patch \ + file://0037-gcc-4.8-PR56797.patch \ + file://0038-gcc-4.8-build-args.patch;apply=no \ + file://0039-gcc-4.8-PR57717.patch;apply=no \ + file://0040-fix-g++-sysroot.patch \ + file://0041-libtool-avoid-libdir.patch \ + file://0042-pr57748.patch \ + file://0043-cpp.patch \ + file://0044-gengtypes.patch \ + file://0045-gcc-4.8-PR57717-PowerPC-E500v2.patch \ + file://0046-libatomic-deptracking.patch \ + file://0047-repomembug.patch \ + file://0048-PR58854_fix_arm_apcs_epilogue.patch;apply=no \ + file://0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \ + file://0050-PR-target-58595.patch \ + file://use-lib-for-aarch64.patch \ + file://0001-AArch64-Define-BE-loader-name.patch \ + file://AArch64-Define-BE-loader-name-default-be.patch \ + file://add-install-ptest-to-Makefile.patch \ + file://run-ptest \ + " + +SRC_URI[md5sum] = "5ba2f3a449b1658ccc09d27cc7ab3c03" +SRC_URI[sha256sum] = "9a72b00f50265fc6ea92e95383fa0b25450cf15fc685a33a67ad15e10a008808" + +S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}-${RELEASE}" +B = "${WORKDIR}/gcc-${PV}-${RELEASE}/build.${HOST_SYS}.${TARGET_SYS}" diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0001-AArch64-Define-BE-loader-name.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0001-AArch64-Define-BE-loader-name.patch new file mode 100644 index 0000000..b529d6d --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0001-AArch64-Define-BE-loader-name.patch @@ -0,0 +1,42 @@ +From 33a9ec1309cf9e4c8b64f289acf509c81d5bb3f8 Mon Sep 17 00:00:00 2001 +From: mshawcroft +Date: Mon, 20 Jan 2014 17:41:54 +0000 +Subject: [PATCH] [AArch64] Define BE loader name. + + Backport from mainline + 2014-03-19 Victor Kamensky + + 2014-01-20 Marcus Shawcroft + + * config/aarch64/aarch64-linux.h (GLIBC_DYNAMIC_LINKER): Expand + loader name using mbig-endian. + (LINUX_TARGET_LINK_SPEC): Pass linker -m flag. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206845 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + gcc/config/aarch64/aarch64-linux.h | 5 +++-- + 2 files changed, 9 insertions(+), 2 deletions(-) + +Index: gcc-linaro-4.8-2014.03/gcc/config/aarch64/aarch64-linux.h +=================================================================== +--- gcc-linaro-4.8-2014.03.orig/gcc/config/aarch64/aarch64-linux.h ++++ gcc-linaro-4.8-2014.03/gcc/config/aarch64/aarch64-linux.h +@@ -21,7 +21,7 @@ + #ifndef GCC_AARCH64_LINUX_H + #define GCC_AARCH64_LINUX_H + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64.so.1" ++#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1" + + #define CPP_SPEC "%{pthread:-D_REENTRANT}" + +@@ -32,7 +32,8 @@ + %{rdynamic:-export-dynamic} \ + -dynamic-linker " GNU_USER_DYNAMIC_LINKER " \ + -X \ +- %{mbig-endian:-EB} %{mlittle-endian:-EL}" ++ %{mbig-endian:-EB} %{mlittle-endian:-EL} \ ++ -maarch64linux%{mbig-endian:b}" + + #define LINK_SPEC LINUX_TARGET_LINK_SPEC + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch new file mode 100644 index 0000000..fe564c1 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch @@ -0,0 +1,39 @@ +From bf3d96ae58fa180b8b468d25dc2e0209daca2751 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:37:11 +0400 +Subject: [PATCH 01/35] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [embedded specific] +--- + configure | 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index f16d506..d260ee2 100755 +--- a/configure ++++ b/configure +@@ -7490,7 +7490,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/configure.ac b/configure.ac +index d5d609b..b5beb30 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2878,7 +2878,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/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0002-uclibc-conf.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0002-uclibc-conf.patch new file mode 100644 index 0000000..dda3b10 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0002-uclibc-conf.patch @@ -0,0 +1,53 @@ +From d030973c872c00d916921d84deee0af2c0d38081 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:38:25 +0400 +Subject: [PATCH 02/35] uclibc-conf + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + contrib/regression/objs-gcc.sh | 4 ++++ + libjava/classpath/ltconfig | 4 ++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh +index 60b0497..6dc7ead 100755 +--- a/contrib/regression/objs-gcc.sh ++++ b/contrib/regression/objs-gcc.sh +@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ] + then + make all-gdb all-dejagnu all-ld || exit 1 + make install-gdb install-dejagnu install-ld || exit 1 ++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ] ++ then ++ make all-gdb all-dejagnu all-ld || exit 1 ++ make install-gdb install-dejagnu install-ld || exit 1 + elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then + make bootstrap || exit 1 + make install || exit 1 +diff --git a/libjava/classpath/ltconfig b/libjava/classpath/ltconfig +index 743d951..ae4ea60 100755 +--- a/libjava/classpath/ltconfig ++++ b/libjava/classpath/ltconfig +@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + # Transform linux* to *-*-linux-gnu*, to support old configure scripts. + case $host_os in +-linux-gnu*) ;; ++linux-gnu*|linux-uclibc*) ;; + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` + esac + +@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + ;; + + # This must be Linux ELF. +-linux-gnu*) ++linux*) + version_type=linux + need_lib_prefix=no + need_version=no +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0003-gcc-uclibc-locale-ctype_touplow_t.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0003-gcc-uclibc-locale-ctype_touplow_t.patch new file mode 100644 index 0000000..7098e99 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0003-gcc-uclibc-locale-ctype_touplow_t.patch @@ -0,0 +1,87 @@ +From d2d9dd756c4356d14dd7ae003856344cb4f37985 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:40:12 +0400 +Subject: [PATCH 03/35] gcc-uclibc-locale-ctype_touplow_t + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libstdc++-v3/config/locale/generic/c_locale.cc | 5 +++++ + libstdc++-v3/config/locale/generic/c_locale.h | 9 +++++++++ + libstdc++-v3/config/os/gnu-linux/ctype_base.h | 9 +++++++++ + 3 files changed, 23 insertions(+) + +diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc +index 0d309a5..f2f1e1f 100644 +--- a/libstdc++-v3/config/locale/generic/c_locale.cc ++++ b/libstdc++-v3/config/locale/generic/c_locale.cc +@@ -263,5 +263,10 @@ _GLIBCXX_END_NAMESPACE_VERSION + #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT + #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \ + extern "C" void ldbl (void) __attribute__ ((alias (#dbl))) ++#ifdef __UCLIBC__ ++// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int* ++_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs); ++#else + _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi); ++#endif + #endif // _GLIBCXX_LONG_DOUBLE_COMPAT +diff --git a/libstdc++-v3/config/locale/generic/c_locale.h b/libstdc++-v3/config/locale/generic/c_locale.h +index b5fd989..3da9a5d 100644 +--- a/libstdc++-v3/config/locale/generic/c_locale.h ++++ b/libstdc++-v3/config/locale/generic/c_locale.h +@@ -40,13 +40,22 @@ + + #include + ++#ifdef __UCLIBC__ ++#include ++#include ++#endif ++ + #define _GLIBCXX_NUM_CATEGORIES 0 + + namespace std _GLIBCXX_VISIBILITY(default) + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION + ++#ifdef __UCLIBC__ ++ typedef __ctype_touplow_t* __c_locale; ++#else + typedef int* __c_locale; ++#endif + + // Convert numeric value of type double and long double to string and + // return length of string. If vsnprintf is available use it, otherwise +diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_base.h b/libstdc++-v3/config/os/gnu-linux/ctype_base.h +index 2d8e978..14eb08f 100644 +--- a/libstdc++-v3/config/os/gnu-linux/ctype_base.h ++++ b/libstdc++-v3/config/os/gnu-linux/ctype_base.h +@@ -33,6 +33,11 @@ + + // Information as gleaned from /usr/include/ctype.h + ++#ifdef __UCLIBC__ ++#include ++#include ++#endif ++ + namespace std _GLIBCXX_VISIBILITY(default) + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION +@@ -41,7 +46,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + struct ctype_base + { + // Non-standard typedefs. ++#ifdef __UCLIBC__ ++ typedef const __ctype_touplow_t* __to_type; ++#else + typedef const int* __to_type; ++#endif + + // NB: Offsets into ctype::_M_table force a particular size + // on the mask type. Because of this, we don't use an enum. +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0004-uclibc-locale.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0004-uclibc-locale.patch new file mode 100644 index 0000000..49f5f33 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0004-uclibc-locale.patch @@ -0,0 +1,2862 @@ +From a55c751a449c2cbf0b3fcc07aab1b86bf9661510 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:41:39 +0400 +Subject: [PATCH 04/35] uclibc-locale + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libstdc++-v3/acinclude.m4 | 37 ++ + .../config/locale/uclibc/c++locale_internal.h | 63 ++ + libstdc++-v3/config/locale/uclibc/c_locale.cc | 160 +++++ + libstdc++-v3/config/locale/uclibc/c_locale.h | 117 ++++ + .../config/locale/uclibc/codecvt_members.cc | 308 +++++++++ + .../config/locale/uclibc/collate_members.cc | 80 +++ + libstdc++-v3/config/locale/uclibc/ctype_members.cc | 300 +++++++++ + .../config/locale/uclibc/messages_members.cc | 100 +++ + .../config/locale/uclibc/messages_members.h | 118 ++++ + .../config/locale/uclibc/monetary_members.cc | 692 ++++++++++++++++++++ + .../config/locale/uclibc/numeric_members.cc | 160 +++++ + libstdc++-v3/config/locale/uclibc/time_members.cc | 406 ++++++++++++ + libstdc++-v3/config/locale/uclibc/time_members.h | 68 ++ + libstdc++-v3/configure | 75 +++ + libstdc++-v3/include/c_compatibility/wchar.h | 2 + + libstdc++-v3/include/c_std/cwchar | 2 + + 16 files changed, 2688 insertions(+) + create mode 100644 libstdc++-v3/config/locale/uclibc/c++locale_internal.h + create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.h + create mode 100644 libstdc++-v3/config/locale/uclibc/codecvt_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/collate_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/ctype_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.h + create mode 100644 libstdc++-v3/config/locale/uclibc/monetary_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/numeric_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.h + +diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 +index 0871a6a..326d7ef 100644 +--- a/libstdc++-v3/acinclude.m4 ++++ b/libstdc++-v3/acinclude.m4 +@@ -1905,6 +1905,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ + # Default to "generic". + if test $enable_clocale_flag = auto; then + case ${target_os} in ++ *-uclibc*) ++ enable_clocale_flag=uclibc ++ ;; + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + enable_clocale_flag=gnu + ;; +@@ -2069,6 +2072,40 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ + CTIME_CC=config/locale/generic/time_members.cc + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h + ;; ++ uclibc) ++ AC_MSG_RESULT(uclibc) ++ ++ # Declare intention to use gettext, and add support for specific ++ # languages. ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT ++ ALL_LINGUAS="de fr" ++ ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. ++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then ++ USE_NLS=yes ++ fi ++ # Export the build objects. ++ for ling in $ALL_LINGUAS; do \ ++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ ++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ ++ done ++ AC_SUBST(glibcxx_MOFILES) ++ AC_SUBST(glibcxx_POFILES) ++ ++ CLOCALE_H=config/locale/uclibc/c_locale.h ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc ++ CMESSAGES_H=config/locale/uclibc/messages_members.h ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc ++ CTIME_H=config/locale/uclibc/time_members.h ++ CTIME_CC=config/locale/uclibc/time_members.cc ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h ++ ;; + esac + + # This is where the testsuite looks for locale catalogs, using the +diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +new file mode 100644 +index 0000000..2ae3e4a +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +@@ -0,0 +1,63 @@ ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*- ++ ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// Written by Jakub Jelinek ++ ++#include ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning clean this up ++#endif ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l; ++extern "C" __typeof(strcoll_l) __strcoll_l; ++extern "C" __typeof(strftime_l) __strftime_l; ++extern "C" __typeof(strtod_l) __strtod_l; ++extern "C" __typeof(strtof_l) __strtof_l; ++extern "C" __typeof(strtold_l) __strtold_l; ++extern "C" __typeof(strxfrm_l) __strxfrm_l; ++extern "C" __typeof(newlocale) __newlocale; ++extern "C" __typeof(freelocale) __freelocale; ++extern "C" __typeof(duplocale) __duplocale; ++extern "C" __typeof(uselocale) __uselocale; ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++extern "C" __typeof(iswctype_l) __iswctype_l; ++extern "C" __typeof(towlower_l) __towlower_l; ++extern "C" __typeof(towupper_l) __towupper_l; ++extern "C" __typeof(wcscoll_l) __wcscoll_l; ++extern "C" __typeof(wcsftime_l) __wcsftime_l; ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; ++extern "C" __typeof(wctype_l) __wctype_l; ++#endif ++ ++#endif // GLIBC 2.3 and later +diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc +new file mode 100644 +index 0000000..5081dc1 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc +@@ -0,0 +1,160 @@ ++// Wrapper for underlying C-language localization -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.8 Standard locale categories. ++// ++ ++// Written by Benjamin Kosnik ++ ++#include // For errno ++#include ++#include ++#include ++#include ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) ++#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) ++#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) ++#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) ++#define __strtof_l(S, E, L) strtof((S), (E)) ++#define __strtod_l(S, E, L) strtod((S), (E)) ++#define __strtold_l(S, E, L) strtold((S), (E)) ++#warning should dummy __newlocale check for C|POSIX ? ++#define __newlocale(a, b, c) NULL ++#define __freelocale(a) ((void)0) ++#define __duplocale(a) __c_locale() ++#endif ++ ++namespace std ++{ ++ template<> ++ void ++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, ++ const __c_locale& __cloc) ++ { ++ if (!(__err & ios_base::failbit)) ++ { ++ char* __sanity; ++ errno = 0; ++ float __f = __strtof_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __f; ++ else ++ __err |= ios_base::failbit; ++ } ++ } ++ ++ template<> ++ void ++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, ++ const __c_locale& __cloc) ++ { ++ if (!(__err & ios_base::failbit)) ++ { ++ char* __sanity; ++ errno = 0; ++ double __d = __strtod_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __d; ++ else ++ __err |= ios_base::failbit; ++ } ++ } ++ ++ template<> ++ void ++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, ++ const __c_locale& __cloc) ++ { ++ if (!(__err & ios_base::failbit)) ++ { ++ char* __sanity; ++ errno = 0; ++ long double __ld = __strtold_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __ld; ++ else ++ __err |= ios_base::failbit; ++ } ++ } ++ ++ void ++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, ++ __c_locale __old) ++ { ++ __cloc = __newlocale(1 << LC_ALL, __s, __old); ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ if (!__cloc) ++ { ++ // This named locale is not supported by the underlying OS. ++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale " ++ "name not valid")); ++ } ++#endif ++ } ++ ++ void ++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc) ++ { ++ if (_S_get_c_locale() != __cloc) ++ __freelocale(__cloc); ++ } ++ ++ __c_locale ++ locale::facet::_S_clone_c_locale(__c_locale& __cloc) ++ { return __duplocale(__cloc); } ++} // namespace std ++ ++namespace __gnu_cxx ++{ ++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = ++ { ++ "LC_CTYPE", ++ "LC_NUMERIC", ++ "LC_TIME", ++ "LC_COLLATE", ++ "LC_MONETARY", ++ "LC_MESSAGES", ++#if _GLIBCXX_NUM_CATEGORIES != 0 ++ "LC_PAPER", ++ "LC_NAME", ++ "LC_ADDRESS", ++ "LC_TELEPHONE", ++ "LC_MEASUREMENT", ++ "LC_IDENTIFICATION" ++#endif ++ }; ++} ++ ++namespace std ++{ ++ const char* const* const locale::_S_categories = __gnu_cxx::category_names; ++} // namespace std +diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h +new file mode 100644 +index 0000000..da07c1f +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h +@@ -0,0 +1,117 @@ ++// Wrapper for underlying C-language localization -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.8 Standard locale categories. ++// ++ ++// Written by Benjamin Kosnik ++ ++#ifndef _C_LOCALE_H ++#define _C_LOCALE_H 1 ++ ++#pragma GCC system_header ++ ++#include // get std::strlen ++#include // get std::snprintf or std::sprintf ++#include ++#include // For codecvt ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this ++#endif ++#ifdef __UCLIBC_HAS_LOCALE__ ++#include // For codecvt using iconv, iconv_t ++#endif ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++#include // For messages ++#endif ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning what is _GLIBCXX_C_LOCALE_GNU for ++#endif ++#define _GLIBCXX_C_LOCALE_GNU 1 ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix categories ++#endif ++// #define _GLIBCXX_NUM_CATEGORIES 6 ++#define _GLIBCXX_NUM_CATEGORIES 0 ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++namespace __gnu_cxx ++{ ++ extern "C" __typeof(uselocale) __uselocale; ++} ++#endif ++ ++namespace std ++{ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ typedef __locale_t __c_locale; ++#else ++ typedef int* __c_locale; ++#endif ++ ++ // Convert numeric value of type _Tv to string and return length of ++ // string. If snprintf is available use it, otherwise fall back to ++ // the unsafe sprintf which, in general, can be dangerous and should ++ // be avoided. ++ template ++ int ++ __convert_from_v(char* __out, ++ const int __size __attribute__ ((__unused__)), ++ const char* __fmt, ++#ifdef __UCLIBC_HAS_XCLOCALE__ ++ _Tv __v, const __c_locale& __cloc, int __prec) ++ { ++ __c_locale __old = __gnu_cxx::__uselocale(__cloc); ++#else ++ _Tv __v, const __c_locale&, int __prec) ++ { ++# ifdef __UCLIBC_HAS_LOCALE__ ++ char* __old = std::setlocale(LC_ALL, NULL); ++ char* __sav = new char[std::strlen(__old) + 1]; ++ std::strcpy(__sav, __old); ++ std::setlocale(LC_ALL, "C"); ++# endif ++#endif ++ ++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); ++ ++#ifdef __UCLIBC_HAS_XCLOCALE__ ++ __gnu_cxx::__uselocale(__old); ++#elif defined __UCLIBC_HAS_LOCALE__ ++ std::setlocale(LC_ALL, __sav); ++ delete [] __sav; ++#endif ++ return __ret; ++ } ++} ++ ++#endif +diff --git a/libstdc++-v3/config/locale/uclibc/codecvt_members.cc b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc +new file mode 100644 +index 0000000..64aa962 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc +@@ -0,0 +1,308 @@ ++// std::codecvt implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include // For MB_CUR_MAX ++#include // For MB_LEN_MAX ++#include ++ ++namespace std ++{ ++ // Specializations. ++#ifdef _GLIBCXX_USE_WCHAR_T ++ codecvt_base::result ++ codecvt:: ++ do_out(state_type& __state, const intern_type* __from, ++ const intern_type* __from_end, const intern_type*& __from_next, ++ extern_type* __to, extern_type* __to_end, ++ extern_type*& __to_next) const ++ { ++ result __ret = ok; ++ state_type __tmp_state(__state); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ ++ // wcsnrtombs is *very* fast but stops if encounters NUL characters: ++ // in case we fall back to wcrtomb and then continue, in a loop. ++ // NB: wcsnrtombs is a GNU extension ++ for (__from_next = __from, __to_next = __to; ++ __from_next < __from_end && __to_next < __to_end ++ && __ret == ok;) ++ { ++ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0', ++ __from_end - __from_next); ++ if (!__from_chunk_end) ++ __from_chunk_end = __from_end; ++ ++ __from = __from_next; ++ const size_t __conv = wcsnrtombs(__to_next, &__from_next, ++ __from_chunk_end - __from_next, ++ __to_end - __to_next, &__state); ++ if (__conv == static_cast(-1)) ++ { ++ // In case of error, in order to stop at the exact place we ++ // have to start again from the beginning with a series of ++ // wcrtomb. ++ for (; __from < __from_next; ++__from) ++ __to_next += wcrtomb(__to_next, *__from, &__tmp_state); ++ __state = __tmp_state; ++ __ret = error; ++ } ++ else if (__from_next && __from_next < __from_chunk_end) ++ { ++ __to_next += __conv; ++ __ret = partial; ++ } ++ else ++ { ++ __from_next = __from_chunk_end; ++ __to_next += __conv; ++ } ++ ++ if (__from_next < __from_end && __ret == ok) ++ { ++ extern_type __buf[MB_LEN_MAX]; ++ __tmp_state = __state; ++ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state); ++ if (__conv > static_cast(__to_end - __to_next)) ++ __ret = partial; ++ else ++ { ++ memcpy(__to_next, __buf, __conv); ++ __state = __tmp_state; ++ __to_next += __conv; ++ ++__from_next; ++ } ++ } ++ } ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ ++ return __ret; ++ } ++ ++ codecvt_base::result ++ codecvt:: ++ do_in(state_type& __state, const extern_type* __from, ++ const extern_type* __from_end, const extern_type*& __from_next, ++ intern_type* __to, intern_type* __to_end, ++ intern_type*& __to_next) const ++ { ++ result __ret = ok; ++ state_type __tmp_state(__state); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ ++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: ++ // in case we store a L'\0' and then continue, in a loop. ++ // NB: mbsnrtowcs is a GNU extension ++ for (__from_next = __from, __to_next = __to; ++ __from_next < __from_end && __to_next < __to_end ++ && __ret == ok;) ++ { ++ const extern_type* __from_chunk_end; ++ __from_chunk_end = static_cast(memchr(__from_next, '\0', ++ __from_end ++ - __from_next)); ++ if (!__from_chunk_end) ++ __from_chunk_end = __from_end; ++ ++ __from = __from_next; ++ size_t __conv = mbsnrtowcs(__to_next, &__from_next, ++ __from_chunk_end - __from_next, ++ __to_end - __to_next, &__state); ++ if (__conv == static_cast(-1)) ++ { ++ // In case of error, in order to stop at the exact place we ++ // have to start again from the beginning with a series of ++ // mbrtowc. ++ for (;; ++__to_next, __from += __conv) ++ { ++ __conv = mbrtowc(__to_next, __from, __from_end - __from, ++ &__tmp_state); ++ if (__conv == static_cast(-1) ++ || __conv == static_cast(-2)) ++ break; ++ } ++ __from_next = __from; ++ __state = __tmp_state; ++ __ret = error; ++ } ++ else if (__from_next && __from_next < __from_chunk_end) ++ { ++ // It is unclear what to return in this case (see DR 382). ++ __to_next += __conv; ++ __ret = partial; ++ } ++ else ++ { ++ __from_next = __from_chunk_end; ++ __to_next += __conv; ++ } ++ ++ if (__from_next < __from_end && __ret == ok) ++ { ++ if (__to_next < __to_end) ++ { ++ // XXX Probably wrong for stateful encodings ++ __tmp_state = __state; ++ ++__from_next; ++ *__to_next++ = L'\0'; ++ } ++ else ++ __ret = partial; ++ } ++ } ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ ++ return __ret; ++ } ++ ++ int ++ codecvt:: ++ do_encoding() const throw() ++ { ++ // XXX This implementation assumes that the encoding is ++ // stateless and is either single-byte or variable-width. ++ int __ret = 0; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ if (MB_CUR_MAX == 1) ++ __ret = 1; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return __ret; ++ } ++ ++ int ++ codecvt:: ++ do_max_length() const throw() ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ // XXX Probably wrong for stateful encodings. ++ int __ret = MB_CUR_MAX; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return __ret; ++ } ++ ++ int ++ codecvt:: ++ do_length(state_type& __state, const extern_type* __from, ++ const extern_type* __end, size_t __max) const ++ { ++ int __ret = 0; ++ state_type __tmp_state(__state); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ ++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: ++ // in case we advance past it and then continue, in a loop. ++ // NB: mbsnrtowcs is a GNU extension ++ ++ // A dummy internal buffer is needed in order for mbsnrtocws to consider ++ // its fourth parameter (it wouldn't with NULL as first parameter). ++ wchar_t* __to = static_cast(__builtin_alloca(sizeof(wchar_t) ++ * __max)); ++ while (__from < __end && __max) ++ { ++ const extern_type* __from_chunk_end; ++ __from_chunk_end = static_cast(memchr(__from, '\0', ++ __end ++ - __from)); ++ if (!__from_chunk_end) ++ __from_chunk_end = __end; ++ ++ const extern_type* __tmp_from = __from; ++ size_t __conv = mbsnrtowcs(__to, &__from, ++ __from_chunk_end - __from, ++ __max, &__state); ++ if (__conv == static_cast(-1)) ++ { ++ // In case of error, in order to stop at the exact place we ++ // have to start again from the beginning with a series of ++ // mbrtowc. ++ for (__from = __tmp_from;; __from += __conv) ++ { ++ __conv = mbrtowc(NULL, __from, __end - __from, ++ &__tmp_state); ++ if (__conv == static_cast(-1) ++ || __conv == static_cast(-2)) ++ break; ++ } ++ __state = __tmp_state; ++ __ret += __from - __tmp_from; ++ break; ++ } ++ if (!__from) ++ __from = __from_chunk_end; ++ ++ __ret += __from - __tmp_from; ++ __max -= __conv; ++ ++ if (__from < __end && __max) ++ { ++ // XXX Probably wrong for stateful encodings ++ __tmp_state = __state; ++ ++__from; ++ ++__ret; ++ --__max; ++ } ++ } ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ ++ return __ret; ++ } ++#endif ++} +diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc +new file mode 100644 +index 0000000..c2664a7 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc +@@ -0,0 +1,80 @@ ++// std::collate implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) ++#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) ++#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) ++#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) ++#endif ++ ++namespace std ++{ ++ // These are basically extensions to char_traits, and perhaps should ++ // be put there instead of here. ++ template<> ++ int ++ collate::_M_compare(const char* __one, const char* __two) const ++ { ++ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate); ++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); ++ } ++ ++ template<> ++ size_t ++ collate::_M_transform(char* __to, const char* __from, ++ size_t __n) const ++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ int ++ collate::_M_compare(const wchar_t* __one, ++ const wchar_t* __two) const ++ { ++ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate); ++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); ++ } ++ ++ template<> ++ size_t ++ collate::_M_transform(wchar_t* __to, const wchar_t* __from, ++ size_t __n) const ++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); } ++#endif ++} +diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc +new file mode 100644 +index 0000000..7294e3a +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc +@@ -0,0 +1,300 @@ ++// std::ctype implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions. ++// ++ ++// Written by Benjamin Kosnik ++ ++#define _LIBC ++#include ++#undef _LIBC ++#include ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __wctype_l(S, L) wctype((S)) ++#define __towupper_l(C, L) towupper((C)) ++#define __towlower_l(C, L) towlower((C)) ++#define __iswctype_l(C, M, L) iswctype((C), (M)) ++#endif ++ ++namespace std ++{ ++ // NB: The other ctype specializations are in src/locale.cc and ++ // various /config/os/* files. ++ template<> ++ ctype_byname::ctype_byname(const char* __s, size_t __refs) ++ : ctype(0, false, __refs) ++ { ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) ++ { ++ this->_S_destroy_c_locale(this->_M_c_locale_ctype); ++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s); ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper; ++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower; ++ this->_M_table = this->_M_c_locale_ctype->__ctype_b; ++#endif ++ } ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ ctype::__wmask_type ++ ctype::_M_convert_to_wmask(const mask __m) const ++ { ++ __wmask_type __ret; ++ switch (__m) ++ { ++ case space: ++ __ret = __wctype_l("space", _M_c_locale_ctype); ++ break; ++ case print: ++ __ret = __wctype_l("print", _M_c_locale_ctype); ++ break; ++ case cntrl: ++ __ret = __wctype_l("cntrl", _M_c_locale_ctype); ++ break; ++ case upper: ++ __ret = __wctype_l("upper", _M_c_locale_ctype); ++ break; ++ case lower: ++ __ret = __wctype_l("lower", _M_c_locale_ctype); ++ break; ++ case alpha: ++ __ret = __wctype_l("alpha", _M_c_locale_ctype); ++ break; ++ case digit: ++ __ret = __wctype_l("digit", _M_c_locale_ctype); ++ break; ++ case punct: ++ __ret = __wctype_l("punct", _M_c_locale_ctype); ++ break; ++ case xdigit: ++ __ret = __wctype_l("xdigit", _M_c_locale_ctype); ++ break; ++ case alnum: ++ __ret = __wctype_l("alnum", _M_c_locale_ctype); ++ break; ++ case graph: ++ __ret = __wctype_l("graph", _M_c_locale_ctype); ++ break; ++ default: ++ __ret = __wmask_type(); ++ } ++ return __ret; ++ } ++ ++ wchar_t ++ ctype::do_toupper(wchar_t __c) const ++ { return __towupper_l(__c, _M_c_locale_ctype); } ++ ++ const wchar_t* ++ ctype::do_toupper(wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi) ++ { ++ *__lo = __towupper_l(*__lo, _M_c_locale_ctype); ++ ++__lo; ++ } ++ return __hi; ++ } ++ ++ wchar_t ++ ctype::do_tolower(wchar_t __c) const ++ { return __towlower_l(__c, _M_c_locale_ctype); } ++ ++ const wchar_t* ++ ctype::do_tolower(wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi) ++ { ++ *__lo = __towlower_l(*__lo, _M_c_locale_ctype); ++ ++__lo; ++ } ++ return __hi; ++ } ++ ++ bool ++ ctype:: ++ do_is(mask __m, wchar_t __c) const ++ { ++ // Highest bitmask in ctype_base == 10, but extra in "C" ++ // library for blank. ++ bool __ret = false; ++ const size_t __bitmasksize = 11; ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) ++ if (__m & _M_bit[__bitcur] ++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) ++ { ++ __ret = true; ++ break; ++ } ++ return __ret; ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const ++ { ++ for (; __lo < __hi; ++__vec, ++__lo) ++ { ++ // Highest bitmask in ctype_base == 10, but extra in "C" ++ // library for blank. ++ const size_t __bitmasksize = 11; ++ mask __m = 0; ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) ++ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype)) ++ __m |= _M_bit[__bitcur]; ++ *__vec = __m; ++ } ++ return __hi; ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi && !this->do_is(__m, *__lo)) ++ ++__lo; ++ return __lo; ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const ++ { ++ while (__lo < __hi && this->do_is(__m, *__lo) != 0) ++ ++__lo; ++ return __lo; ++ } ++ ++ wchar_t ++ ctype:: ++ do_widen(char __c) const ++ { return _M_widen[static_cast(__c)]; } ++ ++ const char* ++ ctype:: ++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const ++ { ++ while (__lo < __hi) ++ { ++ *__dest = _M_widen[static_cast(*__lo)]; ++ ++__lo; ++ ++__dest; ++ } ++ return __hi; ++ } ++ ++ char ++ ctype:: ++ do_narrow(wchar_t __wc, char __dfault) const ++ { ++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok) ++ return _M_narrow[__wc]; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_ctype); ++#endif ++ const int __c = wctob(__wc); ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return (__c == EOF ? __dfault : static_cast(__c)); ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, ++ char* __dest) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_ctype); ++#endif ++ if (_M_narrow_ok) ++ while (__lo < __hi) ++ { ++ if (*__lo >= 0 && *__lo < 128) ++ *__dest = _M_narrow[*__lo]; ++ else ++ { ++ const int __c = wctob(*__lo); ++ *__dest = (__c == EOF ? __dfault : static_cast(__c)); ++ } ++ ++__lo; ++ ++__dest; ++ } ++ else ++ while (__lo < __hi) ++ { ++ const int __c = wctob(*__lo); ++ *__dest = (__c == EOF ? __dfault : static_cast(__c)); ++ ++__lo; ++ ++__dest; ++ } ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return __hi; ++ } ++ ++ void ++ ctype::_M_initialize_ctype() ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_ctype); ++#endif ++ wint_t __i; ++ for (__i = 0; __i < 128; ++__i) ++ { ++ const int __c = wctob(__i); ++ if (__c == EOF) ++ break; ++ else ++ _M_narrow[__i] = static_cast(__c); ++ } ++ if (__i == 128) ++ _M_narrow_ok = true; ++ else ++ _M_narrow_ok = false; ++ for (size_t __j = 0; ++ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j) ++ _M_widen[__j] = btowc(__j); ++ ++ for (size_t __k = 0; __k <= 11; ++__k) ++ { ++ _M_bit[__k] = static_cast(_ISbit(__k)); ++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]); ++ } ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ } ++#endif // _GLIBCXX_USE_WCHAR_T ++} +diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc +new file mode 100644 +index 0000000..13594d9 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc +@@ -0,0 +1,100 @@ ++// std::messages implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix gettext stuff ++#endif ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++extern "C" char *__dcgettext(const char *domainname, ++ const char *msgid, int category); ++#undef gettext ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) ++#else ++#undef gettext ++#define gettext(msgid) (msgid) ++#endif ++ ++namespace std ++{ ++ // Specializations. ++ template<> ++ string ++ messages::do_get(catalog, int, int, const string& __dfault) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_messages); ++ const char* __msg = const_cast(gettext(__dfault.c_str())); ++ __uselocale(__old); ++ return string(__msg); ++#elif defined __UCLIBC_HAS_LOCALE__ ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_messages); ++ const char* __msg = gettext(__dfault.c_str()); ++ setlocale(LC_ALL, __old); ++ free(__old); ++ return string(__msg); ++#else ++ const char* __msg = gettext(__dfault.c_str()); ++ return string(__msg); ++#endif ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ wstring ++ messages::do_get(catalog, int, int, const wstring& __dfault) const ++ { ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_messages); ++ char* __msg = gettext(_M_convert_to_char(__dfault)); ++ __uselocale(__old); ++ return _M_convert_from_char(__msg); ++# elif defined __UCLIBC_HAS_LOCALE__ ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_messages); ++ char* __msg = gettext(_M_convert_to_char(__dfault)); ++ setlocale(LC_ALL, __old); ++ free(__old); ++ return _M_convert_from_char(__msg); ++# else ++ char* __msg = gettext(_M_convert_to_char(__dfault)); ++ return _M_convert_from_char(__msg); ++# endif ++ } ++#endif ++} +diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h +new file mode 100644 +index 0000000..1424078 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h +@@ -0,0 +1,118 @@ ++// std::messages implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.7.1.2 messages functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix prototypes for *textdomain funcs ++#endif ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++extern "C" char *__textdomain(const char *domainname); ++extern "C" char *__bindtextdomain(const char *domainname, ++ const char *dirname); ++#else ++#undef __textdomain ++#undef __bindtextdomain ++#define __textdomain(D) ((void)0) ++#define __bindtextdomain(D,P) ((void)0) ++#endif ++ ++ // Non-virtual member functions. ++ template ++ messages<_CharT>::messages(size_t __refs) ++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), ++ _M_name_messages(_S_get_c_name()) ++ { } ++ ++ template ++ messages<_CharT>::messages(__c_locale __cloc, const char* __s, ++ size_t __refs) ++ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), ++ _M_name_messages(__s) ++ { ++ char* __tmp = new char[std::strlen(__s) + 1]; ++ std::strcpy(__tmp, __s); ++ _M_name_messages = __tmp; ++ } ++ ++ template ++ typename messages<_CharT>::catalog ++ messages<_CharT>::open(const basic_string& __s, const locale& __loc, ++ const char* __dir) const ++ { ++ __bindtextdomain(__s.c_str(), __dir); ++ return this->do_open(__s, __loc); ++ } ++ ++ // Virtual member functions. ++ template ++ messages<_CharT>::~messages() ++ { ++ if (_M_name_messages != _S_get_c_name()) ++ delete [] _M_name_messages; ++ _S_destroy_c_locale(_M_c_locale_messages); ++ } ++ ++ template ++ typename messages<_CharT>::catalog ++ messages<_CharT>::do_open(const basic_string& __s, ++ const locale&) const ++ { ++ // No error checking is done, assume the catalog exists and can ++ // be used. ++ __textdomain(__s.c_str()); ++ return 0; ++ } ++ ++ template ++ void ++ messages<_CharT>::do_close(catalog) const ++ { } ++ ++ // messages_byname ++ template ++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) ++ : messages<_CharT>(__refs) ++ { ++ if (this->_M_name_messages != locale::facet::_S_get_c_name()) ++ delete [] this->_M_name_messages; ++ char* __tmp = new char[std::strlen(__s) + 1]; ++ std::strcpy(__tmp, __s); ++ this->_M_name_messages = __tmp; ++ ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) ++ { ++ this->_S_destroy_c_locale(this->_M_c_locale_messages); ++ this->_S_create_c_locale(this->_M_c_locale_messages, __s); ++ } ++ } +diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +new file mode 100644 +index 0000000..aa52731 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +@@ -0,0 +1,692 @@ ++// std::moneypunct implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#define _LIBC ++#include ++#undef _LIBC ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning optimize this for uclibc ++#warning tailor for stub locale support ++#endif ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __nl_langinfo_l(N, L) nl_langinfo((N)) ++#endif ++ ++namespace std ++{ ++ // Construct and return valid pattern consisting of some combination of: ++ // space none symbol sign value ++ money_base::pattern ++ money_base::_S_construct_pattern(char __precedes, char __space, char __posn) ++ { ++ pattern __ret; ++ ++ // This insanely complicated routine attempts to construct a valid ++ // pattern for use with monyepunct. A couple of invariants: ++ ++ // if (__precedes) symbol -> value ++ // else value -> symbol ++ ++ // if (__space) space ++ // else none ++ ++ // none == never first ++ // space never first or last ++ ++ // Any elegant implementations of this are welcome. ++ switch (__posn) ++ { ++ case 0: ++ case 1: ++ // 1 The sign precedes the value and symbol. ++ __ret.field[0] = sign; ++ if (__space) ++ { ++ // Pattern starts with sign. ++ if (__precedes) ++ { ++ __ret.field[1] = symbol; ++ __ret.field[3] = value; ++ } ++ else ++ { ++ __ret.field[1] = value; ++ __ret.field[3] = symbol; ++ } ++ __ret.field[2] = space; ++ } ++ else ++ { ++ // Pattern starts with sign and ends with none. ++ if (__precedes) ++ { ++ __ret.field[1] = symbol; ++ __ret.field[2] = value; ++ } ++ else ++ { ++ __ret.field[1] = value; ++ __ret.field[2] = symbol; ++ } ++ __ret.field[3] = none; ++ } ++ break; ++ case 2: ++ // 2 The sign follows the value and symbol. ++ if (__space) ++ { ++ // Pattern either ends with sign. ++ if (__precedes) ++ { ++ __ret.field[0] = symbol; ++ __ret.field[2] = value; ++ } ++ else ++ { ++ __ret.field[0] = value; ++ __ret.field[2] = symbol; ++ } ++ __ret.field[1] = space; ++ __ret.field[3] = sign; ++ } ++ else ++ { ++ // Pattern ends with sign then none. ++ if (__precedes) ++ { ++ __ret.field[0] = symbol; ++ __ret.field[1] = value; ++ } ++ else ++ { ++ __ret.field[0] = value; ++ __ret.field[1] = symbol; ++ } ++ __ret.field[2] = sign; ++ __ret.field[3] = none; ++ } ++ break; ++ case 3: ++ // 3 The sign immediately precedes the symbol. ++ if (__precedes) ++ { ++ __ret.field[0] = sign; ++ __ret.field[1] = symbol; ++ if (__space) ++ { ++ __ret.field[2] = space; ++ __ret.field[3] = value; ++ } ++ else ++ { ++ __ret.field[2] = value; ++ __ret.field[3] = none; ++ } ++ } ++ else ++ { ++ __ret.field[0] = value; ++ if (__space) ++ { ++ __ret.field[1] = space; ++ __ret.field[2] = sign; ++ __ret.field[3] = symbol; ++ } ++ else ++ { ++ __ret.field[1] = sign; ++ __ret.field[2] = symbol; ++ __ret.field[3] = none; ++ } ++ } ++ break; ++ case 4: ++ // 4 The sign immediately follows the symbol. ++ if (__precedes) ++ { ++ __ret.field[0] = symbol; ++ __ret.field[1] = sign; ++ if (__space) ++ { ++ __ret.field[2] = space; ++ __ret.field[3] = value; ++ } ++ else ++ { ++ __ret.field[2] = value; ++ __ret.field[3] = none; ++ } ++ } ++ else ++ { ++ __ret.field[0] = value; ++ if (__space) ++ { ++ __ret.field[1] = space; ++ __ret.field[2] = symbol; ++ __ret.field[3] = sign; ++ } ++ else ++ { ++ __ret.field[1] = symbol; ++ __ret.field[2] = sign; ++ __ret.field[3] = none; ++ } ++ } ++ break; ++ default: ++ ; ++ } ++ return __ret; ++ } ++ ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++ const char*) ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = '.'; ++ _M_data->_M_thousands_sep = ','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = ""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = ""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = ""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; ++ } ++ else ++ { ++ // Named locale. ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, ++ __cloc)); ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, ++ __cloc)); ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); ++ ++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); ++ if (!__nposn) ++ _M_data->_M_negative_sign = "()"; ++ else ++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, ++ __cloc); ++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); ++ ++ // _Intl == true ++ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); ++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, ++ __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ } ++ } ++ ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++ const char*) ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = '.'; ++ _M_data->_M_thousands_sep = ','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = ""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = ""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = ""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; ++ } ++ else ++ { ++ // Named locale. ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, ++ __cloc)); ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, ++ __cloc)); ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); ++ ++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); ++ if (!__nposn) ++ _M_data->_M_negative_sign = "()"; ++ else ++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, ++ __cloc); ++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); ++ ++ // _Intl == false ++ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); ++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ } ++ } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { delete _M_data; } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { delete _M_data; } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ const char*) ++#else ++ const char* __name) ++#endif ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = L'.'; ++ _M_data->_M_thousands_sep = L','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ // Use ctype::widen code without the facet... ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = ++ static_cast(money_base::_S_atoms[__i]); ++ } ++ else ++ { ++ // Named locale. ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(__cloc); ++#else ++ // Switch to named locale so that mbsrtowcs will work. ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, __name); ++#endif ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this... should be monetary ++#endif ++#ifdef __UCLIBC__ ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc; ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; ++# else ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; ++# endif ++#else ++ union { char *__s; wchar_t __w; } __u; ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); ++ _M_data->_M_decimal_point = __u.__w; ++ ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); ++ _M_data->_M_thousands_sep = __u.__w; ++#endif ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ ++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); ++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); ++ ++ wchar_t* __wcs_ps = 0; ++ wchar_t* __wcs_ns = 0; ++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); ++ try ++ { ++ mbstate_t __state; ++ size_t __len = strlen(__cpossign); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ps = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); ++ _M_data->_M_positive_sign = __wcs_ps; ++ } ++ else ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); ++ ++ __len = strlen(__cnegsign); ++ if (!__nposn) ++ _M_data->_M_negative_sign = L"()"; ++ else if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ns = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); ++ _M_data->_M_negative_sign = __wcs_ns; ++ } ++ else ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); ++ ++ // _Intl == true. ++ __len = strlen(__ccurr); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ wchar_t* __wcs = new wchar_t[__len]; ++ mbsrtowcs(__wcs, &__ccurr, __len, &__state); ++ _M_data->_M_curr_symbol = __wcs; ++ } ++ else ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); ++ } ++ catch (...) ++ { ++ delete _M_data; ++ _M_data = 0; ++ delete __wcs_ps; ++ delete __wcs_ns; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ __throw_exception_again; ++ } ++ ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, ++ __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ } ++ } ++ ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ const char*) ++#else ++ const char* __name) ++#endif ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = L'.'; ++ _M_data->_M_thousands_sep = L','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ // Use ctype::widen code without the facet... ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = ++ static_cast(money_base::_S_atoms[__i]); ++ } ++ else ++ { ++ // Named locale. ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(__cloc); ++#else ++ // Switch to named locale so that mbsrtowcs will work. ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, __name); ++#endif ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this... should be monetary ++#endif ++#ifdef __UCLIBC__ ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc; ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; ++# else ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; ++# endif ++#else ++ union { char *__s; wchar_t __w; } __u; ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); ++ _M_data->_M_decimal_point = __u.__w; ++ ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); ++ _M_data->_M_thousands_sep = __u.__w; ++#endif ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ ++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); ++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); ++ ++ wchar_t* __wcs_ps = 0; ++ wchar_t* __wcs_ns = 0; ++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); ++ try ++ { ++ mbstate_t __state; ++ size_t __len; ++ __len = strlen(__cpossign); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ps = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); ++ _M_data->_M_positive_sign = __wcs_ps; ++ } ++ else ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); ++ ++ __len = strlen(__cnegsign); ++ if (!__nposn) ++ _M_data->_M_negative_sign = L"()"; ++ else if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ns = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); ++ _M_data->_M_negative_sign = __wcs_ns; ++ } ++ else ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); ++ ++ // _Intl == true. ++ __len = strlen(__ccurr); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ wchar_t* __wcs = new wchar_t[__len]; ++ mbsrtowcs(__wcs, &__ccurr, __len, &__state); ++ _M_data->_M_curr_symbol = __wcs; ++ } ++ else ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); ++ } ++ catch (...) ++ { ++ delete _M_data; ++ _M_data = 0; ++ delete __wcs_ps; ++ delete __wcs_ns; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ __throw_exception_again; ++ } ++ ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ } ++ } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { ++ if (_M_data->_M_positive_sign_size) ++ delete [] _M_data->_M_positive_sign; ++ if (_M_data->_M_negative_sign_size ++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) ++ delete [] _M_data->_M_negative_sign; ++ if (_M_data->_M_curr_symbol_size) ++ delete [] _M_data->_M_curr_symbol; ++ delete _M_data; ++ } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { ++ if (_M_data->_M_positive_sign_size) ++ delete [] _M_data->_M_positive_sign; ++ if (_M_data->_M_negative_sign_size ++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) ++ delete [] _M_data->_M_negative_sign; ++ if (_M_data->_M_curr_symbol_size) ++ delete [] _M_data->_M_curr_symbol; ++ delete _M_data; ++ } ++#endif ++} +diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +new file mode 100644 +index 0000000..883ec1a +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +@@ -0,0 +1,160 @@ ++// std::numpunct implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#define _LIBC ++#include ++#undef _LIBC ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning tailor for stub locale support ++#endif ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __nl_langinfo_l(N, L) nl_langinfo((N)) ++#endif ++ ++namespace std ++{ ++ template<> ++ void ++ numpunct::_M_initialize_numpunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __numpunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_use_grouping = false; ++ ++ _M_data->_M_decimal_point = '.'; ++ _M_data->_M_thousands_sep = ','; ++ ++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) ++ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i]; ++ ++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) ++ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j]; ++ } ++ else ++ { ++ // Named locale. ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, ++ __cloc)); ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, ++ __cloc)); ++ ++ // Check for NULL, which implies no grouping. ++ if (_M_data->_M_thousands_sep == '\0') ++ _M_data->_M_grouping = ""; ++ else ++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ } ++ ++ // NB: There is no way to extact this info from posix locales. ++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); ++ _M_data->_M_truename = "true"; ++ _M_data->_M_truename_size = 4; ++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); ++ _M_data->_M_falsename = "false"; ++ _M_data->_M_falsename_size = 5; ++ } ++ ++ template<> ++ numpunct::~numpunct() ++ { delete _M_data; } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ void ++ numpunct::_M_initialize_numpunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __numpunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_use_grouping = false; ++ ++ _M_data->_M_decimal_point = L'.'; ++ _M_data->_M_thousands_sep = L','; ++ ++ // Use ctype::widen code without the facet... ++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) ++ _M_data->_M_atoms_out[__i] = ++ static_cast(__num_base::_S_atoms_out[__i]); ++ ++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) ++ _M_data->_M_atoms_in[__j] = ++ static_cast(__num_base::_S_atoms_in[__j]); ++ } ++ else ++ { ++ // Named locale. ++ // NB: In the GNU model wchar_t is always 32 bit wide. ++ union { char *__s; wchar_t __w; } __u; ++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); ++ _M_data->_M_decimal_point = __u.__w; ++ ++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); ++ _M_data->_M_thousands_sep = __u.__w; ++ ++ if (_M_data->_M_thousands_sep == L'\0') ++ _M_data->_M_grouping = ""; ++ else ++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ } ++ ++ // NB: There is no way to extact this info from posix locales. ++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); ++ _M_data->_M_truename = L"true"; ++ _M_data->_M_truename_size = 4; ++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); ++ _M_data->_M_falsename = L"false"; ++ _M_data->_M_falsename_size = 5; ++ } ++ ++ template<> ++ numpunct::~numpunct() ++ { delete _M_data; } ++ #endif ++} +diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc +new file mode 100644 +index 0000000..e0707d7 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc +@@ -0,0 +1,406 @@ ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning tailor for stub locale support ++#endif ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __nl_langinfo_l(N, L) nl_langinfo((N)) ++#endif ++ ++namespace std ++{ ++ template<> ++ void ++ __timepunct:: ++ _M_put(char* __s, size_t __maxlen, const char* __format, ++ const tm* __tm) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, ++ _M_c_locale_timepunct); ++#else ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_timepunct); ++ const size_t __len = strftime(__s, __maxlen, __format, __tm); ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ // Make sure __s is null terminated. ++ if (__len == 0) ++ __s[0] = '\0'; ++ } ++ ++ template<> ++ void ++ __timepunct::_M_initialize_timepunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __timepunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_c_locale_timepunct = _S_get_c_locale(); ++ ++ _M_data->_M_date_format = "%m/%d/%y"; ++ _M_data->_M_date_era_format = "%m/%d/%y"; ++ _M_data->_M_time_format = "%H:%M:%S"; ++ _M_data->_M_time_era_format = "%H:%M:%S"; ++ _M_data->_M_date_time_format = ""; ++ _M_data->_M_date_time_era_format = ""; ++ _M_data->_M_am = "AM"; ++ _M_data->_M_pm = "PM"; ++ _M_data->_M_am_pm_format = ""; ++ ++ // Day names, starting with "C"'s Sunday. ++ _M_data->_M_day1 = "Sunday"; ++ _M_data->_M_day2 = "Monday"; ++ _M_data->_M_day3 = "Tuesday"; ++ _M_data->_M_day4 = "Wednesday"; ++ _M_data->_M_day5 = "Thursday"; ++ _M_data->_M_day6 = "Friday"; ++ _M_data->_M_day7 = "Saturday"; ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ _M_data->_M_aday1 = "Sun"; ++ _M_data->_M_aday2 = "Mon"; ++ _M_data->_M_aday3 = "Tue"; ++ _M_data->_M_aday4 = "Wed"; ++ _M_data->_M_aday5 = "Thu"; ++ _M_data->_M_aday6 = "Fri"; ++ _M_data->_M_aday7 = "Sat"; ++ ++ // Month names, starting with "C"'s January. ++ _M_data->_M_month01 = "January"; ++ _M_data->_M_month02 = "February"; ++ _M_data->_M_month03 = "March"; ++ _M_data->_M_month04 = "April"; ++ _M_data->_M_month05 = "May"; ++ _M_data->_M_month06 = "June"; ++ _M_data->_M_month07 = "July"; ++ _M_data->_M_month08 = "August"; ++ _M_data->_M_month09 = "September"; ++ _M_data->_M_month10 = "October"; ++ _M_data->_M_month11 = "November"; ++ _M_data->_M_month12 = "December"; ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ _M_data->_M_amonth01 = "Jan"; ++ _M_data->_M_amonth02 = "Feb"; ++ _M_data->_M_amonth03 = "Mar"; ++ _M_data->_M_amonth04 = "Apr"; ++ _M_data->_M_amonth05 = "May"; ++ _M_data->_M_amonth06 = "Jun"; ++ _M_data->_M_amonth07 = "Jul"; ++ _M_data->_M_amonth08 = "Aug"; ++ _M_data->_M_amonth09 = "Sep"; ++ _M_data->_M_amonth10 = "Oct"; ++ _M_data->_M_amonth11 = "Nov"; ++ _M_data->_M_amonth12 = "Dec"; ++ } ++ else ++ { ++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); ++ ++ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc); ++ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc); ++ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc); ++ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc); ++ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc); ++ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, ++ __cloc); ++ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc); ++ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc); ++ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc); ++ ++ // Day names, starting with "C"'s Sunday. ++ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc); ++ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc); ++ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc); ++ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc); ++ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc); ++ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc); ++ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc); ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc); ++ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc); ++ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc); ++ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc); ++ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc); ++ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc); ++ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc); ++ ++ // Month names, starting with "C"'s January. ++ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc); ++ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc); ++ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc); ++ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc); ++ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc); ++ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc); ++ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc); ++ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc); ++ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc); ++ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc); ++ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc); ++ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc); ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc); ++ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc); ++ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc); ++ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc); ++ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc); ++ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc); ++ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc); ++ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc); ++ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc); ++ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc); ++ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc); ++ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc); ++ } ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ void ++ __timepunct:: ++ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, ++ const tm* __tm) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); ++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, ++ _M_c_locale_timepunct); ++#else ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_timepunct); ++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm); ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ // Make sure __s is null terminated. ++ if (__len == 0) ++ __s[0] = L'\0'; ++ } ++ ++ template<> ++ void ++ __timepunct::_M_initialize_timepunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __timepunct_cache; ++ ++#warning wide time stuff ++// if (!__cloc) ++ { ++ // "C" locale ++ _M_c_locale_timepunct = _S_get_c_locale(); ++ ++ _M_data->_M_date_format = L"%m/%d/%y"; ++ _M_data->_M_date_era_format = L"%m/%d/%y"; ++ _M_data->_M_time_format = L"%H:%M:%S"; ++ _M_data->_M_time_era_format = L"%H:%M:%S"; ++ _M_data->_M_date_time_format = L""; ++ _M_data->_M_date_time_era_format = L""; ++ _M_data->_M_am = L"AM"; ++ _M_data->_M_pm = L"PM"; ++ _M_data->_M_am_pm_format = L""; ++ ++ // Day names, starting with "C"'s Sunday. ++ _M_data->_M_day1 = L"Sunday"; ++ _M_data->_M_day2 = L"Monday"; ++ _M_data->_M_day3 = L"Tuesday"; ++ _M_data->_M_day4 = L"Wednesday"; ++ _M_data->_M_day5 = L"Thursday"; ++ _M_data->_M_day6 = L"Friday"; ++ _M_data->_M_day7 = L"Saturday"; ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ _M_data->_M_aday1 = L"Sun"; ++ _M_data->_M_aday2 = L"Mon"; ++ _M_data->_M_aday3 = L"Tue"; ++ _M_data->_M_aday4 = L"Wed"; ++ _M_data->_M_aday5 = L"Thu"; ++ _M_data->_M_aday6 = L"Fri"; ++ _M_data->_M_aday7 = L"Sat"; ++ ++ // Month names, starting with "C"'s January. ++ _M_data->_M_month01 = L"January"; ++ _M_data->_M_month02 = L"February"; ++ _M_data->_M_month03 = L"March"; ++ _M_data->_M_month04 = L"April"; ++ _M_data->_M_month05 = L"May"; ++ _M_data->_M_month06 = L"June"; ++ _M_data->_M_month07 = L"July"; ++ _M_data->_M_month08 = L"August"; ++ _M_data->_M_month09 = L"September"; ++ _M_data->_M_month10 = L"October"; ++ _M_data->_M_month11 = L"November"; ++ _M_data->_M_month12 = L"December"; ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ _M_data->_M_amonth01 = L"Jan"; ++ _M_data->_M_amonth02 = L"Feb"; ++ _M_data->_M_amonth03 = L"Mar"; ++ _M_data->_M_amonth04 = L"Apr"; ++ _M_data->_M_amonth05 = L"May"; ++ _M_data->_M_amonth06 = L"Jun"; ++ _M_data->_M_amonth07 = L"Jul"; ++ _M_data->_M_amonth08 = L"Aug"; ++ _M_data->_M_amonth09 = L"Sep"; ++ _M_data->_M_amonth10 = L"Oct"; ++ _M_data->_M_amonth11 = L"Nov"; ++ _M_data->_M_amonth12 = L"Dec"; ++ } ++#if 0 ++ else ++ { ++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); ++ ++ union { char *__s; wchar_t *__w; } __u; ++ ++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc); ++ _M_data->_M_date_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc); ++ _M_data->_M_date_era_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc); ++ _M_data->_M_time_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc); ++ _M_data->_M_time_era_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc); ++ _M_data->_M_date_time_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc); ++ _M_data->_M_date_time_era_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc); ++ _M_data->_M_am = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc); ++ _M_data->_M_pm = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc); ++ _M_data->_M_am_pm_format = __u.__w; ++ ++ // Day names, starting with "C"'s Sunday. ++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc); ++ _M_data->_M_day1 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc); ++ _M_data->_M_day2 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc); ++ _M_data->_M_day3 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc); ++ _M_data->_M_day4 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc); ++ _M_data->_M_day5 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc); ++ _M_data->_M_day6 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc); ++ _M_data->_M_day7 = __u.__w; ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc); ++ _M_data->_M_aday1 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc); ++ _M_data->_M_aday2 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc); ++ _M_data->_M_aday3 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc); ++ _M_data->_M_aday4 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc); ++ _M_data->_M_aday5 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc); ++ _M_data->_M_aday6 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc); ++ _M_data->_M_aday7 = __u.__w; ++ ++ // Month names, starting with "C"'s January. ++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc); ++ _M_data->_M_month01 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc); ++ _M_data->_M_month02 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc); ++ _M_data->_M_month03 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc); ++ _M_data->_M_month04 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc); ++ _M_data->_M_month05 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc); ++ _M_data->_M_month06 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc); ++ _M_data->_M_month07 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc); ++ _M_data->_M_month08 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc); ++ _M_data->_M_month09 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc); ++ _M_data->_M_month10 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc); ++ _M_data->_M_month11 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc); ++ _M_data->_M_month12 = __u.__w; ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc); ++ _M_data->_M_amonth01 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc); ++ _M_data->_M_amonth02 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc); ++ _M_data->_M_amonth03 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc); ++ _M_data->_M_amonth04 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc); ++ _M_data->_M_amonth05 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc); ++ _M_data->_M_amonth06 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc); ++ _M_data->_M_amonth07 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc); ++ _M_data->_M_amonth08 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc); ++ _M_data->_M_amonth09 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc); ++ _M_data->_M_amonth10 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc); ++ _M_data->_M_amonth11 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc); ++ _M_data->_M_amonth12 = __u.__w; ++ } ++#endif // 0 ++ } ++#endif ++} +diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h +new file mode 100644 +index 0000000..ba8e858 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/time_members.h +@@ -0,0 +1,68 @@ ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions ++// ++ ++// Written by Benjamin Kosnik ++ ++ template ++ __timepunct<_CharT>::__timepunct(size_t __refs) ++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), ++ _M_name_timepunct(_S_get_c_name()) ++ { _M_initialize_timepunct(); } ++ ++ template ++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) ++ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), ++ _M_name_timepunct(_S_get_c_name()) ++ { _M_initialize_timepunct(); } ++ ++ template ++ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, ++ size_t __refs) ++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), ++ _M_name_timepunct(__s) ++ { ++ char* __tmp = new char[std::strlen(__s) + 1]; ++ std::strcpy(__tmp, __s); ++ _M_name_timepunct = __tmp; ++ _M_initialize_timepunct(__cloc); ++ } ++ ++ template ++ __timepunct<_CharT>::~__timepunct() ++ { ++ if (_M_name_timepunct != _S_get_c_name()) ++ delete [] _M_name_timepunct; ++ delete _M_data; ++ _S_destroy_c_locale(_M_c_locale_timepunct); ++ } +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index f40ddcf..c57a751 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -15822,6 +15822,9 @@ fi + # Default to "generic". + if test $enable_clocale_flag = auto; then + case ${target_os} in ++ *-uclibc*) ++ enable_clocale_flag=uclibc ++ ;; + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + enable_clocale_flag=gnu + ;; +@@ -16079,6 +16082,78 @@ $as_echo "newlib" >&6; } + CTIME_CC=config/locale/generic/time_members.cc + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h + ;; ++ uclibc) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: uclibc" >&5 ++$as_echo "uclibc" >&6; } ++ ++ # Declare intention to use gettext, and add support for specific ++ # languages. ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT ++ ALL_LINGUAS="de fr" ++ ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. ++ # Extract the first word of "msgfmt", so it can be a program name with args. ++set dummy msgfmt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$check_msgfmt"; then ++ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_check_msgfmt="yes" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no" ++fi ++fi ++check_msgfmt=$ac_cv_prog_check_msgfmt ++if test -n "$check_msgfmt"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_msgfmt" >&5 ++$as_echo "$check_msgfmt" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then ++ USE_NLS=yes ++ fi ++ # Export the build objects. ++ for ling in $ALL_LINGUAS; do \ ++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ ++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ ++ done ++ ++ ++ ++ CLOCALE_H=config/locale/uclibc/c_locale.h ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc ++ CMESSAGES_H=config/locale/uclibc/messages_members.h ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc ++ CTIME_H=config/locale/uclibc/time_members.h ++ CTIME_CC=config/locale/uclibc/time_members.cc ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h ++ ;; + esac + + # This is where the testsuite looks for locale catalogs, using the +diff --git a/libstdc++-v3/include/c_compatibility/wchar.h b/libstdc++-v3/include/c_compatibility/wchar.h +index 580d725..3fe61b8 100644 +--- a/libstdc++-v3/include/c_compatibility/wchar.h ++++ b/libstdc++-v3/include/c_compatibility/wchar.h +@@ -101,7 +101,9 @@ using std::wmemcmp; + using std::wmemcpy; + using std::wmemmove; + using std::wmemset; ++#if _GLIBCXX_HAVE_WCSFTIME + using std::wcsftime; ++#endif + + #if _GLIBCXX_USE_C99 + using std::wcstold; +diff --git a/libstdc++-v3/include/c_std/cwchar b/libstdc++-v3/include/c_std/cwchar +index 0e6b1fc..405aee2 100644 +--- a/libstdc++-v3/include/c_std/cwchar ++++ b/libstdc++-v3/include/c_std/cwchar +@@ -175,7 +175,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + using ::wcscoll; + using ::wcscpy; + using ::wcscspn; ++#if _GLIBCXX_HAVE_WCSFTIME + using ::wcsftime; ++#endif + using ::wcslen; + using ::wcsncat; + using ::wcsncmp; +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0005-uclibc-locale-no__x.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0005-uclibc-locale-no__x.patch new file mode 100644 index 0000000..dcbbfe4 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0005-uclibc-locale-no__x.patch @@ -0,0 +1,257 @@ +From 6a3e8506a12c12728d8b29901defd738be43757f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:42:36 +0400 +Subject: [PATCH 05/35] uclibc-locale-no__x + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + .../config/locale/uclibc/c++locale_internal.h | 45 ++++++++++++++++++++ + libstdc++-v3/config/locale/uclibc/c_locale.cc | 14 ------ + libstdc++-v3/config/locale/uclibc/c_locale.h | 1 + + .../config/locale/uclibc/collate_members.cc | 7 --- + libstdc++-v3/config/locale/uclibc/ctype_members.cc | 7 --- + .../config/locale/uclibc/messages_members.cc | 7 +-- + .../config/locale/uclibc/messages_members.h | 18 +++----- + .../config/locale/uclibc/monetary_members.cc | 4 -- + .../config/locale/uclibc/numeric_members.cc | 3 -- + libstdc++-v3/config/locale/uclibc/time_members.cc | 3 -- + 10 files changed, 55 insertions(+), 54 deletions(-) + +diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +index 2ae3e4a..e74fddf 100644 +--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h ++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +@@ -60,4 +60,49 @@ extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; + extern "C" __typeof(wctype_l) __wctype_l; + #endif + ++# define __nl_langinfo_l nl_langinfo_l ++# define __strcoll_l strcoll_l ++# define __strftime_l strftime_l ++# define __strtod_l strtod_l ++# define __strtof_l strtof_l ++# define __strtold_l strtold_l ++# define __strxfrm_l strxfrm_l ++# define __newlocale newlocale ++# define __freelocale freelocale ++# define __duplocale duplocale ++# define __uselocale uselocale ++ ++# ifdef _GLIBCXX_USE_WCHAR_T ++# define __iswctype_l iswctype_l ++# define __towlower_l towlower_l ++# define __towupper_l towupper_l ++# define __wcscoll_l wcscoll_l ++# define __wcsftime_l wcsftime_l ++# define __wcsxfrm_l wcsxfrm_l ++# define __wctype_l wctype_l ++# endif ++ ++#else ++# define __nl_langinfo_l(N, L) nl_langinfo((N)) ++# define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) ++# define __strtod_l(S, E, L) strtod((S), (E)) ++# define __strtof_l(S, E, L) strtof((S), (E)) ++# define __strtold_l(S, E, L) strtold((S), (E)) ++# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) ++# warning should dummy __newlocale check for C|POSIX ? ++# define __newlocale(a, b, c) NULL ++# define __freelocale(a) ((void)0) ++# define __duplocale(a) __c_locale() ++//# define __uselocale ? ++// ++# ifdef _GLIBCXX_USE_WCHAR_T ++# define __iswctype_l(C, M, L) iswctype((C), (M)) ++# define __towlower_l(C, L) towlower((C)) ++# define __towupper_l(C, L) towupper((C)) ++# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) ++//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T)) ++# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) ++# define __wctype_l(S, L) wctype((S)) ++# endif ++ + #endif // GLIBC 2.3 and later +diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc +index 5081dc1..21430d0 100644 +--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc ++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc +@@ -39,20 +39,6 @@ + #include + #include + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) +-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) +-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) +-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) +-#define __strtof_l(S, E, L) strtof((S), (E)) +-#define __strtod_l(S, E, L) strtod((S), (E)) +-#define __strtold_l(S, E, L) strtold((S), (E)) +-#warning should dummy __newlocale check for C|POSIX ? +-#define __newlocale(a, b, c) NULL +-#define __freelocale(a) ((void)0) +-#define __duplocale(a) __c_locale() +-#endif +- + namespace std + { + template<> +diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h +index da07c1f..4bca5f1 100644 +--- a/libstdc++-v3/config/locale/uclibc/c_locale.h ++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h +@@ -68,6 +68,7 @@ namespace __gnu_cxx + { + extern "C" __typeof(uselocale) __uselocale; + } ++#define __uselocale uselocale + #endif + + namespace std +diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc +index c2664a7..ec5c329 100644 +--- a/libstdc++-v3/config/locale/uclibc/collate_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc +@@ -36,13 +36,6 @@ + #include + #include + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) +-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) +-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) +-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) +-#endif +- + namespace std + { + // These are basically extensions to char_traits, and perhaps should +diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc +index 7294e3a..7b12861 100644 +--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc +@@ -38,13 +38,6 @@ + #undef _LIBC + #include + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __wctype_l(S, L) wctype((S)) +-#define __towupper_l(C, L) towupper((C)) +-#define __towlower_l(C, L) towlower((C)) +-#define __iswctype_l(C, M, L) iswctype((C), (M)) +-#endif +- + namespace std + { + // NB: The other ctype specializations are in src/locale.cc and +diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc +index 13594d9..d7693b4 100644 +--- a/libstdc++-v3/config/locale/uclibc/messages_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc +@@ -39,13 +39,10 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix gettext stuff + #endif +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +-extern "C" char *__dcgettext(const char *domainname, +- const char *msgid, int category); + #undef gettext +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES) + #else +-#undef gettext + #define gettext(msgid) (msgid) + #endif + +diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h +index 1424078..d89da33 100644 +--- a/libstdc++-v3/config/locale/uclibc/messages_members.h ++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h +@@ -36,15 +36,11 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix prototypes for *textdomain funcs + #endif +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +-extern "C" char *__textdomain(const char *domainname); +-extern "C" char *__bindtextdomain(const char *domainname, +- const char *dirname); +-#else +-#undef __textdomain +-#undef __bindtextdomain +-#define __textdomain(D) ((void)0) +-#define __bindtextdomain(D,P) ((void)0) ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++#undef textdomain ++#undef bindtextdomain ++#define textdomain(D) ((void)0) ++#define bindtextdomain(D,P) ((void)0) + #endif + + // Non-virtual member functions. +@@ -70,7 +66,7 @@ extern "C" char *__bindtextdomain(const char *domainname, + messages<_CharT>::open(const basic_string& __s, const locale& __loc, + const char* __dir) const + { +- __bindtextdomain(__s.c_str(), __dir); ++ bindtextdomain(__s.c_str(), __dir); + return this->do_open(__s, __loc); + } + +@@ -90,7 +86,7 @@ extern "C" char *__bindtextdomain(const char *domainname, + { + // No error checking is done, assume the catalog exists and can + // be used. +- __textdomain(__s.c_str()); ++ textdomain(__s.c_str()); + return 0; + } + +diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +index aa52731..2e6f80a 100644 +--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +@@ -43,10 +43,6 @@ + #warning tailor for stub locale support + #endif + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __nl_langinfo_l(N, L) nl_langinfo((N)) +-#endif +- + namespace std + { + // Construct and return valid pattern consisting of some combination of: +diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +index 883ec1a..2c70642 100644 +--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +@@ -41,9 +41,6 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning tailor for stub locale support + #endif +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __nl_langinfo_l(N, L) nl_langinfo((N)) +-#endif + + namespace std + { +diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc +index e0707d7..d848ed5 100644 +--- a/libstdc++-v3/config/locale/uclibc/time_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc +@@ -40,9 +40,6 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning tailor for stub locale support + #endif +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __nl_langinfo_l(N, L) nl_langinfo((N)) +-#endif + + namespace std + { +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0006-uclibc-locale-wchar_fix.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0006-uclibc-locale-wchar_fix.patch new file mode 100644 index 0000000..3406859 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0006-uclibc-locale-wchar_fix.patch @@ -0,0 +1,68 @@ +From 225511a3aeb193a916b3999f0b640a392caa67cd Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:45:57 +0400 +Subject: [PATCH 06/35] uclibc-locale-wchar_fix + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libstdc++-v3/config/locale/uclibc/monetary_members.cc | 4 ++-- + libstdc++-v3/config/locale/uclibc/numeric_members.cc | 13 +++++++++++++ + 2 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +index 2e6f80a..31ebb9f 100644 +--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +@@ -401,7 +401,7 @@ namespace std + # ifdef __UCLIBC_HAS_XLOCALE__ + _M_data->_M_decimal_point = __cloc->decimal_point_wc; + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; +-# else ++# elif defined __UCLIBC_HAS_LOCALE__ + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; + # endif +@@ -556,7 +556,7 @@ namespace std + # ifdef __UCLIBC_HAS_XLOCALE__ + _M_data->_M_decimal_point = __cloc->decimal_point_wc; + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; +-# else ++# elif defined __UCLIBC_HAS_LOCALE__ + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; + # endif +diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +index 2c70642..d5c8961 100644 +--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +@@ -127,12 +127,25 @@ namespace std + { + // Named locale. + // NB: In the GNU model wchar_t is always 32 bit wide. ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this... should be numeric ++#endif ++#ifdef __UCLIBC__ ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc; ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; ++# elif defined __UCLIBC_HAS_LOCALE__ ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; ++# endif ++#else + union { char *__s; wchar_t __w; } __u; + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); + _M_data->_M_decimal_point = __u.__w; + + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); + _M_data->_M_thousands_sep = __u.__w; ++#endif + + if (_M_data->_M_thousands_sep == L'\0') + _M_data->_M_grouping = ""; +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0007-uclibc-locale-update.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0007-uclibc-locale-update.patch new file mode 100644 index 0000000..5851123 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0007-uclibc-locale-update.patch @@ -0,0 +1,542 @@ +From 6ffe7c46f52d27864c3df3663e16ec9ddee71e8f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:46:58 +0400 +Subject: [PATCH 07/35] uclibc-locale-update + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + .../config/locale/uclibc/c++locale_internal.h | 3 + + libstdc++-v3/config/locale/uclibc/c_locale.cc | 74 +++++++++----------- + libstdc++-v3/config/locale/uclibc/c_locale.h | 42 ++++++----- + libstdc++-v3/config/locale/uclibc/ctype_members.cc | 51 ++++++++++---- + .../config/locale/uclibc/messages_members.h | 12 ++-- + .../config/locale/uclibc/monetary_members.cc | 34 +++++---- + .../config/locale/uclibc/numeric_members.cc | 5 ++ + libstdc++-v3/config/locale/uclibc/time_members.cc | 18 +++-- + libstdc++-v3/config/locale/uclibc/time_members.h | 17 +++-- + 9 files changed, 158 insertions(+), 98 deletions(-) + +diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +index e74fddf..971a6b4 100644 +--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h ++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +@@ -31,6 +31,9 @@ + + #include + #include ++#include ++#include ++#include + + #ifdef __UCLIBC_MJN3_ONLY__ + #warning clean this up +diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc +index 21430d0..1b9d8e1 100644 +--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc ++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc +@@ -39,23 +39,20 @@ + #include + #include + +-namespace std +-{ ++_GLIBCXX_BEGIN_NAMESPACE(std) ++ + template<> + void + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { +- if (!(__err & ios_base::failbit)) +- { +- char* __sanity; +- errno = 0; +- float __f = __strtof_l(__s, &__sanity, __cloc); +- if (__sanity != __s && errno != ERANGE) +- __v = __f; +- else +- __err |= ios_base::failbit; +- } ++ char* __sanity; ++ errno = 0; ++ float __f = __strtof_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __f; ++ else ++ __err |= ios_base::failbit; + } + + template<> +@@ -63,16 +60,13 @@ namespace std + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { +- if (!(__err & ios_base::failbit)) +- { +- char* __sanity; +- errno = 0; +- double __d = __strtod_l(__s, &__sanity, __cloc); +- if (__sanity != __s && errno != ERANGE) +- __v = __d; +- else +- __err |= ios_base::failbit; +- } ++ char* __sanity; ++ errno = 0; ++ double __d = __strtod_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __d; ++ else ++ __err |= ios_base::failbit; + } + + template<> +@@ -80,16 +74,13 @@ namespace std + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { +- if (!(__err & ios_base::failbit)) +- { +- char* __sanity; +- errno = 0; +- long double __ld = __strtold_l(__s, &__sanity, __cloc); +- if (__sanity != __s && errno != ERANGE) +- __v = __ld; +- else +- __err |= ios_base::failbit; +- } ++ char* __sanity; ++ errno = 0; ++ long double __ld = __strtold_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __ld; ++ else ++ __err |= ios_base::failbit; + } + + void +@@ -110,17 +101,18 @@ namespace std + void + locale::facet::_S_destroy_c_locale(__c_locale& __cloc) + { +- if (_S_get_c_locale() != __cloc) ++ if (__cloc && _S_get_c_locale() != __cloc) + __freelocale(__cloc); + } + + __c_locale + locale::facet::_S_clone_c_locale(__c_locale& __cloc) + { return __duplocale(__cloc); } +-} // namespace std + +-namespace __gnu_cxx +-{ ++_GLIBCXX_END_NAMESPACE ++ ++_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ++ + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = + { + "LC_CTYPE", +@@ -138,9 +130,11 @@ namespace __gnu_cxx + "LC_IDENTIFICATION" + #endif + }; +-} + +-namespace std +-{ ++_GLIBCXX_END_NAMESPACE ++ ++_GLIBCXX_BEGIN_NAMESPACE(std) ++ + const char* const* const locale::_S_categories = __gnu_cxx::category_names; +-} // namespace std ++ ++_GLIBCXX_END_NAMESPACE +diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h +index 4bca5f1..64a6d46 100644 +--- a/libstdc++-v3/config/locale/uclibc/c_locale.h ++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h +@@ -39,21 +39,23 @@ + #pragma GCC system_header + + #include // get std::strlen +-#include // get std::snprintf or std::sprintf ++#include // get std::vsnprintf or std::vsprintf + #include + #include // For codecvt + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix this + #endif +-#ifdef __UCLIBC_HAS_LOCALE__ ++#ifdef _GLIBCXX_USE_ICONV + #include // For codecvt using iconv, iconv_t + #endif +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +-#include // For messages ++#ifdef HAVE_LIBINTL_H ++#include // For messages + #endif ++#include + + #ifdef __UCLIBC_MJN3_ONLY__ + #warning what is _GLIBCXX_C_LOCALE_GNU for ++// psm: used in os/gnu-linux/ctype_noninline.h + #endif + #define _GLIBCXX_C_LOCALE_GNU 1 + +@@ -78,23 +80,25 @@ namespace std + #else + typedef int* __c_locale; + #endif +- +- // Convert numeric value of type _Tv to string and return length of +- // string. If snprintf is available use it, otherwise fall back to +- // the unsafe sprintf which, in general, can be dangerous and should ++ // Convert numeric value of type double to string and return length of ++ // string. If vsnprintf is available use it, otherwise fall back to ++ // the unsafe vsprintf which, in general, can be dangerous and should + // be avoided. +- template +- int +- __convert_from_v(char* __out, +- const int __size __attribute__ ((__unused__)), +- const char* __fmt, +-#ifdef __UCLIBC_HAS_XCLOCALE__ +- _Tv __v, const __c_locale& __cloc, int __prec) ++ inline int ++ __convert_from_v(const __c_locale& ++#ifndef __UCLIBC_HAS_XCLOCALE__ ++ __cloc __attribute__ ((__unused__)) ++#endif ++ , ++ char* __out, ++ const int __size, ++ const char* __fmt, ...) + { ++ va_list __args; ++#ifdef __UCLIBC_HAS_XCLOCALE__ ++ + __c_locale __old = __gnu_cxx::__uselocale(__cloc); + #else +- _Tv __v, const __c_locale&, int __prec) +- { + # ifdef __UCLIBC_HAS_LOCALE__ + char* __old = std::setlocale(LC_ALL, NULL); + char* __sav = new char[std::strlen(__old) + 1]; +@@ -103,7 +107,9 @@ namespace std + # endif + #endif + +- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); ++ va_start(__args, __fmt); ++ const int __ret = std::vsnprintf(__out, __size, __fmt, __args); ++ va_end(__args); + + #ifdef __UCLIBC_HAS_XCLOCALE__ + __gnu_cxx::__uselocale(__old); +diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc +index 7b12861..13e011d 100644 +--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc +@@ -33,16 +33,20 @@ + + // Written by Benjamin Kosnik + ++#include ++#ifdef __UCLIBC_HAS_LOCALE__ + #define _LIBC + #include + #undef _LIBC ++#else ++#include ++#endif + #include + +-namespace std +-{ ++_GLIBCXX_BEGIN_NAMESPACE(std) ++ + // NB: The other ctype specializations are in src/locale.cc and + // various /config/os/* files. +- template<> + ctype_byname::ctype_byname(const char* __s, size_t __refs) + : ctype(0, false, __refs) + { +@@ -57,6 +61,8 @@ namespace std + #endif + } + } ++ ctype_byname::~ctype_byname() ++ { } + + #ifdef _GLIBCXX_USE_WCHAR_T + ctype::__wmask_type +@@ -138,17 +144,33 @@ namespace std + ctype:: + do_is(mask __m, wchar_t __c) const + { +- // Highest bitmask in ctype_base == 10, but extra in "C" +- // library for blank. ++ // The case of __m == ctype_base::space is particularly important, ++ // due to its use in many istream functions. Therefore we deal with ++ // it first, exploiting the knowledge that on GNU systems _M_bit[5] ++ // is the mask corresponding to ctype_base::space. NB: an encoding ++ // change would not affect correctness! ++ + bool __ret = false; +- const size_t __bitmasksize = 11; +- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) +- if (__m & _M_bit[__bitcur] +- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) +- { +- __ret = true; +- break; +- } ++ if (__m == _M_bit[5]) ++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype); ++ else ++ { ++ // Highest bitmask in ctype_base == 10, but extra in "C" ++ // library for blank. ++ const size_t __bitmasksize = 11; ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) ++ if (__m & _M_bit[__bitcur]) ++ { ++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) ++ { ++ __ret = true; ++ break; ++ } ++ else if (__m == _M_bit[__bitcur]) ++ break; ++ } ++ } ++ + return __ret; + } + +@@ -290,4 +312,5 @@ namespace std + #endif + } + #endif // _GLIBCXX_USE_WCHAR_T +-} ++ ++_GLIBCXX_END_NAMESPACE +diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h +index d89da33..067657a 100644 +--- a/libstdc++-v3/config/locale/uclibc/messages_members.h ++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h +@@ -53,12 +53,16 @@ + template + messages<_CharT>::messages(__c_locale __cloc, const char* __s, + size_t __refs) +- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), +- _M_name_messages(__s) ++ : facet(__refs), _M_c_locale_messages(NULL), ++ _M_name_messages(NULL) + { +- char* __tmp = new char[std::strlen(__s) + 1]; +- std::strcpy(__tmp, __s); ++ const size_t __len = std::strlen(__s) + 1; ++ char* __tmp = new char[__len]; ++ std::memcpy(__tmp, __s, __len); + _M_name_messages = __tmp; ++ ++ // Last to avoid leaking memory if new throws. ++ _M_c_locale_messages = _S_clone_c_locale(__cloc); + } + + template +diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +index 31ebb9f..7679b9c 100644 +--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +@@ -33,9 +33,14 @@ + + // Written by Benjamin Kosnik + ++#include ++#ifdef __UCLIBC_HAS_LOCALE__ + #define _LIBC + #include + #undef _LIBC ++#else ++#include ++#endif + #include + + #ifdef __UCLIBC_MJN3_ONLY__ +@@ -206,7 +211,7 @@ namespace std + } + break; + default: +- ; ++ __ret = pattern(); + } + return __ret; + } +@@ -390,7 +395,9 @@ namespace std + __c_locale __old = __uselocale(__cloc); + #else + // Switch to named locale so that mbsrtowcs will work. +- char* __old = strdup(setlocale(LC_ALL, NULL)); ++ char* __old = setlocale(LC_ALL, NULL); ++ const size_t __llen = strlen(__old) + 1; ++ char* __sav = new char[__llen]; + setlocale(LC_ALL, __name); + #endif + +@@ -477,8 +484,8 @@ namespace std + #ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); + #else +- setlocale(LC_ALL, __old); +- free(__old); ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; + #endif + __throw_exception_again; + } +@@ -498,8 +505,8 @@ namespace std + #ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); + #else +- setlocale(LC_ALL, __old); +- free(__old); ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; + #endif + } + } +@@ -545,8 +552,11 @@ namespace std + __c_locale __old = __uselocale(__cloc); + #else + // Switch to named locale so that mbsrtowcs will work. +- char* __old = strdup(setlocale(LC_ALL, NULL)); +- setlocale(LC_ALL, __name); ++ char* __old = setlocale(LC_ALL, NULL); ++ const size_t __llen = strlen(__old) + 1; ++ char* __sav = new char[__llen]; ++ memcpy(__sav, __old, __llen); ++ setlocale(LC_ALL, __name); + #endif + + #ifdef __UCLIBC_MJN3_ONLY__ +@@ -633,8 +643,8 @@ namespace std + #ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); + #else +- setlocale(LC_ALL, __old); +- free(__old); ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; + #endif + __throw_exception_again; + } +@@ -653,8 +663,8 @@ namespace std + #ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); + #else +- setlocale(LC_ALL, __old); +- free(__old); ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; + #endif + } + } +diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +index d5c8961..8ae8969 100644 +--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +@@ -33,9 +33,14 @@ + + // Written by Benjamin Kosnik + ++#include ++#ifdef __UCLIBC_HAS_LOCALE__ + #define _LIBC + #include + #undef _LIBC ++#else ++#include ++#endif + #include + + #ifdef __UCLIBC_MJN3_ONLY__ +diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc +index d848ed5..f24d53e 100644 +--- a/libstdc++-v3/config/locale/uclibc/time_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc +@@ -53,11 +53,14 @@ namespace std + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, + _M_c_locale_timepunct); + #else +- char* __old = strdup(setlocale(LC_ALL, NULL)); ++ char* __old = setlocale(LC_ALL, NULL); ++ const size_t __llen = strlen(__old) + 1; ++ char* __sav = new char[__llen]; ++ memcpy(__sav, __old, __llen); + setlocale(LC_ALL, _M_name_timepunct); + const size_t __len = strftime(__s, __maxlen, __format, __tm); +- setlocale(LC_ALL, __old); +- free(__old); ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; + #endif + // Make sure __s is null terminated. + if (__len == 0) +@@ -207,11 +210,14 @@ namespace std + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, + _M_c_locale_timepunct); + #else +- char* __old = strdup(setlocale(LC_ALL, NULL)); ++ char* __old = setlocale(LC_ALL, NULL); ++ const size_t __llen = strlen(__old) + 1; ++ char* __sav = new char[__llen]; ++ memcpy(__sav, __old, __llen); + setlocale(LC_ALL, _M_name_timepunct); + const size_t __len = wcsftime(__s, __maxlen, __format, __tm); +- setlocale(LC_ALL, __old); +- free(__old); ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; + #endif + // Make sure __s is null terminated. + if (__len == 0) +diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h +index ba8e858..1665dde 100644 +--- a/libstdc++-v3/config/locale/uclibc/time_members.h ++++ b/libstdc++-v3/config/locale/uclibc/time_members.h +@@ -50,12 +50,21 @@ + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, + size_t __refs) + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), +- _M_name_timepunct(__s) ++ _M_name_timepunct(NULL) + { +- char* __tmp = new char[std::strlen(__s) + 1]; +- std::strcpy(__tmp, __s); ++ const size_t __len = std::strlen(__s) + 1; ++ char* __tmp = new char[__len]; ++ std::memcpy(__tmp, __s, __len); + _M_name_timepunct = __tmp; +- _M_initialize_timepunct(__cloc); ++ ++ try ++ { _M_initialize_timepunct(__cloc); } ++ catch(...) ++ { ++ delete [] _M_name_timepunct; ++ __throw_exception_again; ++ } ++ + } + + template +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0008-missing-execinfo_h.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0008-missing-execinfo_h.patch new file mode 100644 index 0000000..2823809 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0008-missing-execinfo_h.patch @@ -0,0 +1,28 @@ +From 9f2158451981cf0a80cfabdc79ae31bb6976a801 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:48:10 +0400 +Subject: [PATCH 08/35] missing-execinfo_h + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + boehm-gc/include/gc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h +index c51e017..a7ba8dc 100644 +--- a/boehm-gc/include/gc.h ++++ b/boehm-gc/include/gc.h +@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb)); + #if defined(__linux__) || defined(__GLIBC__) + # include + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ +- && !defined(__ia64__) ++ && !defined(__ia64__) && !defined(__UCLIBC__) + # ifndef GC_HAVE_BUILTIN_BACKTRACE + # define GC_HAVE_BUILTIN_BACKTRACE + # endif +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0009-c99-snprintf.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0009-c99-snprintf.patch new file mode 100644 index 0000000..7168778 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0009-c99-snprintf.patch @@ -0,0 +1,28 @@ +From e393e076f1ab82d25e1aa04d6edea27b41d3eb06 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:49:03 +0400 +Subject: [PATCH 09/35] c99-snprintf + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libstdc++-v3/include/c_std/cstdio | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libstdc++-v3/include/c_std/cstdio b/libstdc++-v3/include/c_std/cstdio +index e85bd83..6af839a 100644 +--- a/libstdc++-v3/include/c_std/cstdio ++++ b/libstdc++-v3/include/c_std/cstdio +@@ -139,7 +139,7 @@ namespace std + using ::vsprintf; + } // namespace std + +-#if _GLIBCXX_USE_C99 ++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__) + + #undef snprintf + #undef vfscanf +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0010-c99-complex-ugly-hack.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0010-c99-complex-ugly-hack.patch new file mode 100644 index 0000000..b628571 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0010-c99-complex-ugly-hack.patch @@ -0,0 +1,29 @@ +From 73f69d806e2c9561a54995223431a1076cfd6164 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:49:57 +0400 +Subject: [PATCH 10/35] c99-complex-ugly-hack + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [embedded specific] +--- + libstdc++-v3/configure | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index c57a751..a1333e2 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -18734,6 +18734,9 @@ $as_echo_n "checking for ISO C99 support to TR1 in ... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include ++#ifdef __UCLIBC__ ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs ++#endif + int + main () + { +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0011-index_macro.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0011-index_macro.patch new file mode 100644 index 0000000..8ee79b0 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0011-index_macro.patch @@ -0,0 +1,44 @@ +From b037953e40312b45ab84ed0a3ad882bb5e413101 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:51:02 +0400 +Subject: [PATCH 11/35] index_macro + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libstdc++-v3/include/ext/rope | 3 +++ + libstdc++-v3/include/ext/ropeimpl.h | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope +index 38eb1e8..158d21a 100644 +--- a/libstdc++-v3/include/ext/rope ++++ b/libstdc++-v3/include/ext/rope +@@ -55,6 +55,9 @@ + #include + #include + ++/* cope w/ index defined as macro, SuSv3 proposal */ ++#undef index ++ + # ifdef __GC + # define __GC_CONST const + # else +diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h +index d7b5cbd..b9b3acb 100644 +--- a/libstdc++-v3/include/ext/ropeimpl.h ++++ b/libstdc++-v3/include/ext/ropeimpl.h +@@ -48,6 +48,9 @@ + #include // For uninitialized_copy_n + #include // For power + ++/* cope w/ index defined as macro, SuSv3 proposal */ ++#undef index ++ + namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0012-libmudflap-susv3-legacy.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0012-libmudflap-susv3-legacy.patch new file mode 100644 index 0000000..968d45e --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0012-libmudflap-susv3-legacy.patch @@ -0,0 +1,64 @@ +From a0cb13bdd98a941b81fdafe4cd96e4c569feb651 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:52:36 +0400 +Subject: [PATCH 12/35] libmudflap-susv3-legacy + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [embedded specific] +--- + libmudflap/mf-hooks2.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/libmudflap/mf-hooks2.c b/libmudflap/mf-hooks2.c +index 4af17df..a3c6b2f 100644 +--- a/libmudflap/mf-hooks2.c ++++ b/libmudflap/mf-hooks2.c +@@ -424,7 +424,7 @@ WRAPPER2(void, bzero, void *s, size_t n) + { + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region"); +- bzero (s, n); ++ memset (s, 0, n); + } + + +@@ -434,7 +434,7 @@ WRAPPER2(void, bcopy, const void *src, void *dest, size_t n) + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src"); + MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest"); +- bcopy (src, dest, n); ++ memmove (dest, src, n); + } + + +@@ -444,7 +444,7 @@ WRAPPER2(int, bcmp, const void *s1, const void *s2, size_t n) + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg"); + MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg"); +- return bcmp (s1, s2, n); ++ return n == 0 ? 0 : memcmp (s1, s2, n); + } + + +@@ -453,7 +453,7 @@ WRAPPER2(char *, index, const char *s, int c) + size_t n = strlen (s); + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region"); +- return index (s, c); ++ return strchr (s, c); + } + + +@@ -462,7 +462,7 @@ WRAPPER2(char *, rindex, const char *s, int c) + size_t n = strlen (s); + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region"); +- return rindex (s, c); ++ return strrchr (s, c); + } + + /* XXX: stpcpy, memccpy */ +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0013-libstdc-namespace.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0013-libstdc-namespace.patch new file mode 100644 index 0000000..4a3efde --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0013-libstdc-namespace.patch @@ -0,0 +1,54 @@ +From 104e4d66208f2726b14d2f5eebce90700cbc83c8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:54:02 +0400 +Subject: [PATCH 13/35] libstdc++-namespace + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libstdc++-v3/config/locale/uclibc/messages_members.h | 4 +++- + libstdc++-v3/config/locale/uclibc/time_members.h | 4 +++- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h +index 067657a..dd76a6c 100644 +--- a/libstdc++-v3/config/locale/uclibc/messages_members.h ++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h +@@ -32,7 +32,8 @@ + // + + // Written by Benjamin Kosnik +- ++namespace std ++{ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix prototypes for *textdomain funcs + #endif +@@ -116,3 +117,4 @@ + this->_S_create_c_locale(this->_M_c_locale_messages, __s); + } + } ++} +diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h +index 1665dde..905c433 100644 +--- a/libstdc++-v3/config/locale/uclibc/time_members.h ++++ b/libstdc++-v3/config/locale/uclibc/time_members.h +@@ -33,7 +33,8 @@ + // + + // Written by Benjamin Kosnik +- ++namespace std ++{ + template + __timepunct<_CharT>::__timepunct(size_t __refs) + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), +@@ -75,3 +76,4 @@ + delete _M_data; + _S_destroy_c_locale(_M_c_locale_timepunct); + } ++} +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0014-sh-pr24836.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0014-sh-pr24836.patch new file mode 100644 index 0000000..d74f493 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0014-sh-pr24836.patch @@ -0,0 +1,29 @@ +From edc9acb181810f234b6b9f7d2820b0e4f6a1eeaf Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:54:48 +0400 +Subject: [PATCH 14/35] sh-pr24836 + +Signed-off-by: Khem Raj + +Upstream-Status: Pending + +http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348 +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836 +--- + gcc/configure | 2 +- + gcc/configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Index: gcc-linaro-4.8-2013.10/gcc/configure +=================================================================== +--- gcc-linaro-4.8-2013.10.orig/gcc/configure 2013-11-05 23:39:39.000000000 -0800 ++++ gcc-linaro-4.8-2013.10/gcc/configure 2013-11-06 15:22:43.000000000 -0800 +@@ -23394,7 +23394,7 @@ + tls_first_minor=14 + tls_as_opt="-m64 -Aesame --fatal-warnings" + ;; +- sh-*-* | sh[34]-*-*) ++ sh-*-* | sh[34]*-*-*) + conftest_s=' + .section ".tdata","awT",@progbits + foo: .long 25 diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch new file mode 100644 index 0000000..1081222 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch @@ -0,0 +1,29 @@ +From 50e5366005b0f6af27378e2a5c3cb9f9936a7e62 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:58:36 +0400 +Subject: [PATCH 15/35] arm: Use TARGET_ENDIAN_OPTION for determining + MULTILIB_DEFAULTS + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/config/arm/linux-elf.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h +index 488efa4..753dc3a 100644 +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -46,7 +46,7 @@ + + #undef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", "mlittle-endian", "mfloat-abi=hard", "mno-thumb-interwork" } ++ { "marm", TARGET_ENDIAN_OPTION, "mfloat-abi=hard", "mno-thumb-interwork" } + + /* Now we define the strings used to build the spec file. */ + #undef LIB_SPEC +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0016-gcc-poison-system-directories.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0016-gcc-poison-system-directories.patch new file mode 100644 index 0000000..48e7d40 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0016-gcc-poison-system-directories.patch @@ -0,0 +1,224 @@ +From 160397ef3c3331099af028f1b8d3e085b07d88ad Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:59:00 +0400 +Subject: [PATCH 16/35] gcc: poison-system-directories + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [distribution: codesourcery] +--- + gcc/Makefile.in | 2 +- + gcc/common.opt | 4 ++++ + gcc/config.in | 6 ++++++ + gcc/configure | 20 ++++++++++++++++++-- + gcc/configure.ac | 10 ++++++++++ + gcc/doc/invoke.texi | 9 +++++++++ + gcc/gcc.c | 2 ++ + gcc/incpath.c | 19 +++++++++++++++++++ + 8 files changed, 69 insertions(+), 3 deletions(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 54ea04f..90a2bba 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -2018,7 +2018,7 @@ attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + + incpath.o: incpath.c incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \ + intl.h prefix.h coretypes.h $(TM_H) cppdefault.h $(TARGET_H) \ +- $(MACHMODE_H) ++ $(MACHMODE_H) $(FLAGS_H) toplev.h + + CFLAGS-prefix.o += -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s) + prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h prefix.h \ +diff --git a/gcc/common.opt b/gcc/common.opt +index bdbd3b6..ab86b00 100644 +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -595,6 +595,10 @@ Wpedantic + Common Var(pedantic) Warning + Issue warnings needed for strict compliance to the standard + ++Wpoison-system-directories ++Common Var(flag_poison_system_directories) Init(1) Warning ++Warn for -I and -L options using system directories if cross compiling ++ + Wshadow + Common Var(warn_shadow) Warning + Warn when one local variable shadows another +diff --git a/gcc/config.in b/gcc/config.in +index d80fb9f..0524af7 100644 +--- a/gcc/config.in ++++ b/gcc/config.in +@@ -138,6 +138,12 @@ + #endif + + ++/* Define to warn for use of native system header directories */ ++#ifndef USED_FOR_TARGET ++#undef ENABLE_POISON_SYSTEM_DIRECTORIES ++#endif ++ ++ + /* Define if you want all operations on RTL (the basic data structure of the + optimizer and back end) to be checked for dynamic type safety at runtime. + This is quite expensive. */ +diff --git a/gcc/configure b/gcc/configure +index 135bbf5..b65d21d 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -917,6 +917,7 @@ with_gc + with_system_zlib + enable_maintainer_mode + enable_version_specific_runtime_libs ++enable_poison_system_directories + enable_plugin + enable_libquadmath_support + with_linker_hash_style +@@ -1630,6 +1631,8 @@ Optional Features: + --enable-version-specific-runtime-libs + specify that runtime libraries should be installed + in a compiler-specific directory ++ --enable-poison-system-directories ++ warn for use of native system header directories + --enable-plugin enable plugin support + --disable-libquadmath-support + disable libquadmath support for Fortran +@@ -17828,7 +17831,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 17830 "configure" ++#line 17834 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -17934,7 +17937,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 17936 "configure" ++#line 17940 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -27103,6 +27106,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : + fi + + ++# Check whether --enable-poison-system-directories was given. ++if test "${enable_poison_system_directories+set}" = set; then : ++ enableval=$enable_poison_system_directories; ++else ++ enable_poison_system_directories=no ++fi ++ ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ ++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++ ++fi ++ + # Substitute configuration variables + + +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 6363a21..e226b85 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -5063,6 +5063,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, + [specify that runtime libraries should be + installed in a compiler-specific directory])]) + ++AC_ARG_ENABLE([poison-system-directories], ++ AS_HELP_STRING([--enable-poison-system-directories], ++ [warn for use of native system header directories]),, ++ [enable_poison_system_directories=no]) ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], ++ [1], ++ [Define to warn for use of native system header directories]) ++fi ++ + # Substitute configuration variables + AC_SUBST(subdirs) + AC_SUBST(srcdir) +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 9273d7d..a022622 100644 +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -258,6 +258,7 @@ Objective-C and Objective-C++ Dialects}. + -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol + -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol + -Wpointer-arith -Wno-pointer-to-int-cast @gol ++-Wno-poison-system-directories @gol + -Wredundant-decls -Wno-return-local-addr @gol + -Wreturn-type -Wsequence-point -Wshadow @gol + -Wsign-compare -Wsign-conversion -Wsizeof-pointer-memaccess @gol +@@ -4007,6 +4008,14 @@ headers---for that, @option{-Wunknown-pragmas} must also be used. + for most targets, it is made up of code and thus requires the stack + to be made executable in order for the program to work properly. + ++@item -Wno-poison-system-directories ++@opindex Wno-poison-system-directories ++Do not warn for @option{-I} or @option{-L} options using system ++directories such as @file{/usr/include} when cross compiling. This ++option is intended for use in chroot environments when such ++directories contain the correct headers and libraries for the target ++system rather than the host. ++ + @item -Wfloat-equal + @opindex Wfloat-equal + @opindex Wno-float-equal +diff --git a/gcc/gcc.c b/gcc/gcc.c +index 86077f8..efdb625 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -740,6 +740,8 @@ proper position among the other output files. */ + "%{fuse-ld=*:-fuse-ld=%*}\ + %X %{o*} %{e*} %{N} %{n} %{r}\ + %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}}\ ++ %{Wno-poison-system-directories:--no-poison-system-directories}\ ++ %{Werror=poison-system-directories:--error-poison-system-directories}\ + %{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\ + %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\ + %{fgnu-tm:%:include(libitm.spec)%(link_itm)}\ +diff --git a/gcc/incpath.c b/gcc/incpath.c +index 018da98..cd41c78 100644 +--- a/gcc/incpath.c ++++ b/gcc/incpath.c +@@ -28,6 +28,7 @@ + #include "intl.h" + #include "incpath.h" + #include "cppdefault.h" ++#include "diagnostic-core.h" + + /* Microsoft Windows does not natively support inodes. + VMS has non-numeric inodes. */ +@@ -382,6 +383,24 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) + } + fprintf (stderr, _("End of search list.\n")); + } ++ ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ if (flag_poison_system_directories) ++ { ++ struct cpp_dir *p; ++ ++ for (p = heads[QUOTE]; p; p = p->next) ++ { ++ if ((!strncmp (p->name, "/usr/include", 12)) ++ || (!strncmp (p->name, "/usr/local/include", 18)) ++ || (!strncmp (p->name, "/usr/X11R6/include", 18))) ++ warning (OPT_Wpoison_system_directories, ++ "include location \"%s\" is unsafe for " ++ "cross-compilation", ++ p->name); ++ } ++ } ++#endif + } + + /* Use given -I paths for #include "..." but not #include <...>, and +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0017-gcc-poison-dir-extend.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0017-gcc-poison-dir-extend.patch new file mode 100644 index 0000000..9e81efd --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0017-gcc-poison-dir-extend.patch @@ -0,0 +1,39 @@ +From e99c9c97266d6d3e8cac798aa91408250c4d60cf Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:00:34 +0400 +Subject: [PATCH 17/35] gcc-poison-dir-extend + +Add /sw/include and /opt/include based on the original +zecke-no-host-includes.patch patch. The original patch checked for +/usr/include, /sw/include and /opt/include and then triggered a failure and +aborted. + +Instead, we add the two missing items to the current scan. If the user +wants this to be a failure, they can add "-Werror=poison-system-directories". + +Signed-off-by: Mark Hatle +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/incpath.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/gcc/incpath.c b/gcc/incpath.c +index cd41c78..eac4a92 100644 +--- a/gcc/incpath.c ++++ b/gcc/incpath.c +@@ -393,7 +393,9 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) + { + if ((!strncmp (p->name, "/usr/include", 12)) + || (!strncmp (p->name, "/usr/local/include", 18)) +- || (!strncmp (p->name, "/usr/X11R6/include", 18))) ++ || (!strncmp (p->name, "/usr/X11R6/include", 18)) ++ || (!strncmp (p->name, "/sw/include", 11)) ++ || (!strncmp (p->name, "/opt/include", 12))) + warning (OPT_Wpoison_system_directories, + "include location \"%s\" is unsafe for " + "cross-compilation", +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch new file mode 100644 index 0000000..a28cafd --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch @@ -0,0 +1,73 @@ +From 56207fa2923e8edf774e98ffac82666091076be3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:08:31 +0400 +Subject: [PATCH 18/35] gcc-4.3.3: SYSROOT_CFLAGS_FOR_TARGET + +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? + +Signed-off-by: Paolo Bonzini +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + configure | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/configure b/configure +index 1b76c90..e4dce7c 100755 +--- a/configure ++++ b/configure +@@ -6772,6 +6772,38 @@ 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 +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0019-64-bit-multilib-hack.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0019-64-bit-multilib-hack.patch new file mode 100644 index 0000000..51f4dba --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0019-64-bit-multilib-hack.patch @@ -0,0 +1,82 @@ +From 18fde5740b09324dfb9cf41e9849672573ff5fa0 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:10:06 +0400 +Subject: [PATCH 19/35] 64-bit multilib hack. + +GCC has internal multilib handling code but it assumes a very specific rigid directory +layout. The build system implementation of multilib layout is very generic and allows +complete customisation of the library directories. + +This patch is a partial solution to allow any custom directories to be passed into gcc +and handled correctly. It forces gcc to use the base_libdir (which is the current +directory, "."). We need to do this for each multilib that is configured as we don't +know which compiler options may be being passed into the compiler. Since we have a compiler +per mulitlib at this point that isn't an issue. + +The one problem is the target compiler is only going to work for the default multlilib at +this point. Ideally we'd figure out which multilibs were being enabled with which paths +and be able to patch these entries with a complete set of correct paths but this we +don't have such code at this point. This is something the target gcc recipe should do +and override these platform defaults in its build config. + +RP 15/8/11 + +Signed-off-by: Khem Raj +Signed-off-by: Elvis Dowson + +Upstream-Status: Pending +--- + gcc/config/i386/t-linux64 | 6 ++---- + gcc/config/mips/t-linux64 | 10 +++------- + gcc/config/rs6000/t-linux64 | 5 ++--- + 3 files changed, 7 insertions(+), 14 deletions(-) + +diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64 +index bcea0c6..eb004d7 100644 +--- a/gcc/config/i386/t-linux64 ++++ b/gcc/config/i386/t-linux64 +@@ -32,7 +32,5 @@ + # + comma=, + MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) +-MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) +-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) +-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) +-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) ++MULTILIB_DIRNAMES = . . ++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) +diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64 +index bdbbd4f..16a6366 100644 +--- a/gcc/config/mips/t-linux64 ++++ b/gcc/config/mips/t-linux64 +@@ -17,10 +17,6 @@ + # . + + MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64 +-MULTILIB_DIRNAMES = n32 32 64 +-MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el) +-MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft) +-MULTILIB_OSDIRNAMES = \ +- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \ +- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \ +- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT)) ++MULTILIB_DIRNAMES = . . . ++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ++ +diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64 +index 9175de2..3971019 100644 +--- a/gcc/config/rs6000/t-linux64 ++++ b/gcc/config/rs6000/t-linux64 +@@ -26,7 +26,6 @@ + # MULTILIB_OSDIRNAMES according to what is found on the target. + + MULTILIB_OPTIONS = m64/m32 +-MULTILIB_DIRNAMES = 64 32 ++MULTILIB_DIRNAMES = . . + MULTILIB_EXTRA_OPTS = fPIC +-MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:powerpc64-linux-gnu) +-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu) ++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0020-optional-libstdc.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0020-optional-libstdc.patch new file mode 100644 index 0000000..eff021e --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0020-optional-libstdc.patch @@ -0,0 +1,102 @@ +From 307c8ff3ef666b7bd5ac733863f2fbb27a9d521e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:12:56 +0400 +Subject: [PATCH 20/35] optional libstdc + +gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++ +will not run correctly since by default the linker will try to link against libstdc++ +which shouldn't exist yet. We need an option to disable -lstdc++ +option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc +driver. This patch adds such an option which only disables the -lstdc++. + +A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to +do this officially, the likely answer is don't build libstdc++ separately. + +RP 29/6/10 + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [embedded specific] +--- + gcc/c-family/c.opt | 4 ++++ + gcc/cp/g++spec.c | 1 + + gcc/doc/invoke.texi | 9 +++++++-- + gcc/gcc.c | 1 + + 4 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt +index 10ae84d..dc3ffdf 100644 +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -1299,6 +1299,10 @@ nostdinc++ + C++ ObjC++ + Do not search standard system include directories for C++ + ++nostdlib++ ++Driver ++Do not link standard C++ runtime library ++ + o + C ObjC C++ ObjC++ Joined Separate + ; Documented in common.opt +diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c +index b896eea..f55216b 100644 +--- a/gcc/cp/g++spec.c ++++ b/gcc/cp/g++spec.c +@@ -126,6 +126,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, + switch (decoded_options[i].opt_index) + { + case OPT_nostdlib: ++ case OPT_nostdlib__: + case OPT_nodefaultlibs: + library = -1; + break; +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index a022622..f15c991 100644 +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -190,7 +190,7 @@ in the following sections. + -frepo -fno-rtti -fstats -ftemplate-backtrace-limit=@var{n} @gol + -ftemplate-depth=@var{n} @gol + -fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ @gol +--fno-default-inline -fvisibility-inlines-hidden @gol ++-nostdlib++ -fno-default-inline -fvisibility-inlines-hidden @gol + -fvisibility-ms-compat @gol + -fext-numeric-literals @gol + -Wabi -Wconversion-null -Wctor-dtor-privacy @gol +@@ -453,7 +453,7 @@ Objective-C and Objective-C++ Dialects}. + -nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic @gol + -s -static -static-libgcc -static-libstdc++ @gol + -static-libasan -static-libtsan @gol +--shared -shared-libgcc -symbolic @gol ++-shared -shared-libgcc -symbolic -nostdlib++ @gol + -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol + -u @var{symbol}} + +@@ -9886,6 +9886,11 @@ These entries are usually resolved by entries in + libc. These entry points should be supplied through some other + mechanism when this option is specified. + ++@item -nostdlib++ ++@opindex nostdlib++ ++Do not use the standard system C++ runtime libraries when linking. ++Only the libraries you specify will be passed to the linker. ++ + @cindex @option{-lgcc}, use with @option{-nostdlib} + @cindex @option{-nostdlib} and unresolved references + @cindex unresolved references and @option{-nostdlib} +diff --git a/gcc/gcc.c b/gcc/gcc.c +index efdb625..477752f 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -748,6 +748,7 @@ proper position among the other output files. */ + %(mflib) " STACK_SPLIT_SPEC "\ + %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \ + %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\ ++ %{!nostdlib++:}\ + %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}" + #endif + +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch new file mode 100644 index 0000000..eb3c61f --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch @@ -0,0 +1,59 @@ +From 004696e054ae9dc71d512cc755ccc4074fc62b2d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:14:20 +0400 +Subject: [PATCH 21/35] gcc: disable MASK_RELAX_PIC_CALLS bit + +The new feature added after 4.3.3 +"http://www.pubbs.net/200909/gcc/94048-patch-add-support-for-rmipsjalr.html" +will cause cc1plus eat up all the system memory when build webkit-gtk. +The function mips_get_pic_call_symbol keeps on recursively calling itself. +Disable this feature to walk aside the bug. + +Signed-off-by: Dongxiao Xu +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [configuration] +--- + gcc/configure | 7 ------- + gcc/configure.ac | 7 ------- + 2 files changed, 14 deletions(-) + +diff --git a/gcc/configure b/gcc/configure +index b65d21d..bdab45a 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -25829,13 +25829,6 @@ $as_echo_n "checking assembler and linker for explicit JALR relocation... " >&6; + rm -f conftest.* + fi + fi +- if test $gcc_cv_as_ld_jalr_reloc = yes; then +- if test x$target_cpu_default = x; then +- target_cpu_default=MASK_RELAX_PIC_CALLS +- else +- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS" +- fi +- fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ld_jalr_reloc" >&5 + $as_echo "$gcc_cv_as_ld_jalr_reloc" >&6; } + +diff --git a/gcc/configure.ac b/gcc/configure.ac +index e226b85..5f5c909 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -4099,13 +4099,6 @@ x: + rm -f conftest.* + fi + fi +- if test $gcc_cv_as_ld_jalr_reloc = yes; then +- if test x$target_cpu_default = x; then +- target_cpu_default=MASK_RELAX_PIC_CALLS +- else +- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS" +- fi +- fi + AC_MSG_RESULT($gcc_cv_as_ld_jalr_reloc) + + AC_CACHE_CHECK([linker for .eh_frame personality relaxation], +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0022-COLLECT_GCC_OPTIONS.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0022-COLLECT_GCC_OPTIONS.patch new file mode 100644 index 0000000..40c8abf --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0022-COLLECT_GCC_OPTIONS.patch @@ -0,0 +1,38 @@ +From 7f5c9dcc71c8b83a0b5596266cc4bdf0936e8e00 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:16:28 +0400 +Subject: [PATCH 22/35] COLLECT_GCC_OPTIONS + +This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to +invoke collect2. + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/gcc.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/gcc/gcc.c b/gcc/gcc.c +index 477752f..51062aa 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -4098,6 +4098,15 @@ set_collect_gcc_options (void) + sizeof ("COLLECT_GCC_OPTIONS=") - 1); + + first_time = TRUE; ++#ifdef HAVE_LD_SYSROOT ++ if (target_system_root_changed && target_system_root) ++ { ++ obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1); ++ obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root)); ++ obstack_grow (&collect_obstack, "'", 1); ++ first_time = FALSE; ++ } ++#endif + for (i = 0; (int) i < n_switches; i++) + { + const char *const *args; +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch new file mode 100644 index 0000000..9e4435c --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch @@ -0,0 +1,88 @@ +From 46d52439052f0876a92dcf8a0ab9c60d75c8030b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:17:25 +0400 +Subject: [PATCH 23/35] Use the defaults.h in ${B} instead of ${S}, and t-oe + in ${B} + +Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that +the source can be shared between gcc-cross-initial, +gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build. + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/Makefile.in | 2 +- + gcc/configure | 4 ++-- + gcc/configure.ac | 4 ++-- + gcc/mkconfig.sh | 4 ++-- + 4 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 90a2bba..2320497 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -469,7 +469,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ + TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@ + + xmake_file=@xmake_file@ +-tmake_file=@tmake_file@ ++tmake_file=@tmake_file@ ./t-oe + TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@ + TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@ + TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@ +diff --git a/gcc/configure b/gcc/configure +index bdab45a..d587993 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -11539,8 +11539,8 @@ for f in $tm_file; do + tm_include_list="${tm_include_list} $f" + ;; + defaults.h ) +- tm_file_list="${tm_file_list} \$(srcdir)/$f" +- tm_include_list="${tm_include_list} $f" ++ tm_file_list="${tm_file_list} ./$f" ++ tm_include_list="${tm_include_list} ./$f" + ;; + * ) + tm_file_list="${tm_file_list} \$(srcdir)/config/$f" +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 5f5c909..5e5e84f 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -1720,8 +1720,8 @@ for f in $tm_file; do + tm_include_list="${tm_include_list} $f" + ;; + defaults.h ) +- tm_file_list="${tm_file_list} \$(srcdir)/$f" +- tm_include_list="${tm_include_list} $f" ++ tm_file_list="${tm_file_list} ./$f" ++ tm_include_list="${tm_include_list} ./$f" + ;; + * ) + tm_file_list="${tm_file_list} \$(srcdir)/config/$f" +diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh +index 29fdfc7..e048dce 100644 +--- a/gcc/mkconfig.sh ++++ b/gcc/mkconfig.sh +@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then + if [ $# -ge 1 ]; then + echo '#ifdef IN_GCC' >> ${output}T + for file in "$@"; do +- if test x"$file" = x"defaults.h"; then ++ if test x"$file" = x"./defaults.h"; then + postpone_defaults_h="yes" + else + echo "# include \"$file\"" >> ${output}T +@@ -103,7 +103,7 @@ esac + + # If we postponed including defaults.h, add the #include now. + if test x"$postpone_defaults_h" = x"yes"; then +- echo "# include \"defaults.h\"" >> ${output}T ++ echo "# include \"./defaults.h\"" >> ${output}T + fi + + # Add multiple inclusion protection guard, part two. +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0024-PR-target-32219.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0024-PR-target-32219.patch new file mode 100644 index 0000000..b47d841 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0024-PR-target-32219.patch @@ -0,0 +1,67 @@ +From e0d15f4f8bf28c351b9215ca37f1caa24df0e1fd Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:18:54 +0400 +Subject: [PATCH 24/35] PR target/32219 + +* varasm.c (default_binds_local_p_1): Weak data is not local. + +Signed-off-by: Bernhard Reutner-Fischer +Signed-off-by: Khem Raj + +Upstream-Status: Backport +--- + gcc/testsuite/gcc.dg/visibility-21.c | 14 ++++++++++++++ + gcc/varasm.c | 9 ++++----- + 2 files changed, 18 insertions(+), 5 deletions(-) + create mode 100644 gcc/testsuite/gcc.dg/visibility-21.c + +diff --git a/gcc/testsuite/gcc.dg/visibility-21.c b/gcc/testsuite/gcc.dg/visibility-21.c +new file mode 100644 +index 0000000..be7deda +--- /dev/null ++++ b/gcc/testsuite/gcc.dg/visibility-21.c +@@ -0,0 +1,14 @@ ++/* PR target/32219 */ ++/* { dg-do run } */ ++/* { dg-require-visibility "" } */ ++/* { dg-options "-fPIC" { target fpic } } */ ++ ++extern void f() __attribute__((weak,visibility("hidden"))); ++extern int puts( char const* ); ++int main() ++{ ++ if (f) ++ f(); ++ return 0; ++} ++ +diff --git a/gcc/varasm.c b/gcc/varasm.c +index 6648103..fadba78 100644 +--- a/gcc/varasm.c ++++ b/gcc/varasm.c +@@ -6675,6 +6675,10 @@ default_binds_local_p_1 (const_tree exp, int shlib) + /* Static variables are always local. */ + else if (! TREE_PUBLIC (exp)) + local_p = true; ++ /* hidden weak can't be overridden by something non-local, all ++ that is possible is that it is not defined at all. */ ++ else if (DECL_WEAK (exp)) ++ local_p = false; + /* A variable is local if the user has said explicitly that it will + be. */ + else if ((DECL_VISIBILITY_SPECIFIED (exp) +@@ -6688,11 +6692,6 @@ default_binds_local_p_1 (const_tree exp, int shlib) + local. */ + else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT) + local_p = true; +- /* Default visibility weak data can be overridden by a strong symbol +- in another module and so are not local. */ +- else if (DECL_WEAK (exp) +- && !resolved_locally) +- local_p = false; + /* If PIC, then assume that any global name can be overridden by + symbols resolved from other modules. */ + else if (shlib) +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0025-fortran-cross-compile-hack.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0025-fortran-cross-compile-hack.patch new file mode 100644 index 0000000..0e7914d --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0025-fortran-cross-compile-hack.patch @@ -0,0 +1,46 @@ +From af8a56ea4e17b2909eff2c57704ab43ef24f28d3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:20:01 +0400 +Subject: [PATCH 25/35] fortran cross-compile hack. + +* Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used +used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross +directory. + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [embedded specific] +--- + libgfortran/configure | 2 +- + libgfortran/configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libgfortran/configure b/libgfortran/configure +index 8385e96..b8f7a92 100755 +--- a/libgfortran/configure ++++ b/libgfortran/configure +@@ -12704,7 +12704,7 @@ esac + + # We need gfortran to compile parts of the library + #AC_PROG_FC(gfortran) +-FC="$GFORTRAN" ++#FC="$GFORTRAN" + ac_ext=${ac_fc_srcext-f} + ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' + ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac +index 7d97fed..3f9f484 100644 +--- a/libgfortran/configure.ac ++++ b/libgfortran/configure.ac +@@ -227,7 +227,7 @@ AC_SUBST(enable_static) + + # We need gfortran to compile parts of the library + #AC_PROG_FC(gfortran) +-FC="$GFORTRAN" ++#FC="$GFORTRAN" + AC_PROG_FC(gfortran) + + # extra LD Flags which are required for targets +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0026-libgcc-sjlj-check.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0026-libgcc-sjlj-check.patch new file mode 100644 index 0000000..d4efab9 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0026-libgcc-sjlj-check.patch @@ -0,0 +1,74 @@ +From 08c2398445e6cac282488f64ae6bf29cbcd8db23 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:20:50 +0400 +Subject: [PATCH 26/35] libgcc-sjlj-check + +ac_fn_c_try_compile doesnt seem to keep the intermediate files +which are needed for sjlj test to pass since it greps into the +generated file. So we run the compiler command using AC_TRY_COMMAND +which then generates the needed .s file + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libgcc/configure | 10 ++++++---- + libgcc/configure.ac | 10 ++++------ + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/libgcc/configure b/libgcc/configure +index 1425df6..d18e3cb 100644 +--- a/libgcc/configure ++++ b/libgcc/configure +@@ -4208,17 +4208,19 @@ void foo () + } + + _ACEOF +-CFLAGS_hold=$CFLAGS +-CFLAGS="--save-temps -fexceptions" + libgcc_cv_lib_sjlj_exceptions=unknown +-if ac_fn_c_try_compile; then : ++if { ac_try='${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then + if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then + libgcc_cv_lib_sjlj_exceptions=yes + elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then + libgcc_cv_lib_sjlj_exceptions=no + fi + fi +-CFLAGS=$CFLAGS_hold + rm -f conftest* + + fi +diff --git a/libgcc/configure.ac b/libgcc/configure.ac +index 8b7aba5..c7c9644 100644 +--- a/libgcc/configure.ac ++++ b/libgcc/configure.ac +@@ -216,16 +216,14 @@ void foo () + bar(); + } + ])]) +-CFLAGS_hold=$CFLAGS +-CFLAGS="--save-temps -fexceptions" + libgcc_cv_lib_sjlj_exceptions=unknown +-AS_IF([ac_fn_c_try_compile], +- [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then ++if AC_TRY_COMMAND(${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then ++ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then + libgcc_cv_lib_sjlj_exceptions=yes + elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then + libgcc_cv_lib_sjlj_exceptions=no +- fi]) +-CFLAGS=$CFLAGS_hold ++ fi ++fi + rm -f conftest* + ]) + +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0027-cpp-honor-sysroot.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0027-cpp-honor-sysroot.patch new file mode 100644 index 0000000..05e9521 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0027-cpp-honor-sysroot.patch @@ -0,0 +1,54 @@ +From a0f9bd09c816ad29ecf7c29d6c27f7df97710364 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:22:00 +0400 +Subject: [PATCH 27/35] cpp: honor sysroot. + +Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile +preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location +rather than the --sysroot option specified on the commandline. If access to that directory is +permission denied (unreadable), gcc will error. + +This happens when ccache is in use due to the fact it uses preprocessed source files. + +The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix, +-isystem, -isysroot happen and the correct sysroot is used. + +[YOCTO #2074] + +RP 2012/04/13 + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/cp/lang-specs.h | 2 +- + gcc/gcc.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h +index a001c3e..1aae1e4 100644 +--- a/gcc/cp/lang-specs.h ++++ b/gcc/cp/lang-specs.h +@@ -63,5 +63,5 @@ along with GCC; see the file COPYING3. If not see + {".ii", "@c++-cpp-output", 0, 0, 0}, + {"@c++-cpp-output", + "%{!M:%{!MM:%{!E:\ +- cc1plus -fpreprocessed %i %(cc1_options) %2\ ++ cc1plus -fpreprocessed %i %I %(cc1_options) %2\ + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, +diff --git a/gcc/gcc.c b/gcc/gcc.c +index 51062aa..cf6b99e 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -1042,7 +1042,7 @@ static const struct compiler default_compilers[] = + %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0}, + {".i", "@cpp-output", 0, 0, 0}, + {"@cpp-output", +- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, ++ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, + {".s", "@assembler", 0, 0, 0}, + {"@assembler", + "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0}, +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0028-MIPS64-Default-to-N64-ABI.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0028-MIPS64-Default-to-N64-ABI.patch new file mode 100644 index 0000000..2638720 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0028-MIPS64-Default-to-N64-ABI.patch @@ -0,0 +1,31 @@ +From 301e18d4711db5925e767fad08dffa9cfe0a2f1f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:23:08 +0400 +Subject: [PATCH 28/35] MIPS64: Default to N64 ABI + +MIPS64 defaults to n32 ABI, this patch makes it +so that it defaults to N64 ABI + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [OE config specific] +--- + gcc/config.gcc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/config.gcc b/gcc/config.gcc +index 1a0be50..989c2fb 100644 +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -1797,7 +1797,7 @@ mips*-mti-linux*) + mips64*-*-linux* | mipsisa64*-*-linux*) + tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h" + tmake_file="${tmake_file} mips/t-linux64" +- tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32" ++ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_64" + case ${target} in + mips64el-st-linux-gnu) + tm_file="${tm_file} mips/st.h" +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch new file mode 100644 index 0000000..0e8fffc --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch @@ -0,0 +1,190 @@ +From 29d12344fb682a053de53eb08b95704cf3b67af2 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:24:50 +0400 +Subject: [PATCH 29/35] Define GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER + relative to SYSTEMLIBS_DIR + +This patch defines GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER +relative to SYSTEMLIBS_DIR which can be set in generated headers +This breaks the assumption of hardcoded multilib in gcc +Change is only for the supported architectures in OE including +SH, sparc, alpha for possible future support (if any) + +Removes the do_headerfix task in metadata + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [OE configuration] +--- + gcc/config/alpha/linux-elf.h | 4 ++-- + gcc/config/arm/linux-eabi.h | 4 ++-- + gcc/config/arm/linux-elf.h | 2 +- + gcc/config/i386/linux.h | 2 +- + gcc/config/i386/linux64.h | 6 +++--- + gcc/config/mips/linux.h | 2 +- + gcc/config/mips/linux64.h | 8 ++++---- + gcc/config/rs6000/linux64.h | 8 ++++---- + gcc/config/sh/linux.h | 2 +- + gcc/config/sparc/linux.h | 2 +- + gcc/config/sparc/linux64.h | 4 ++-- + 11 files changed, 22 insertions(+), 22 deletions(-) + +diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h +index 84e0596..3a59d71 100644 +--- a/gcc/config/alpha/linux-elf.h ++++ b/gcc/config/alpha/linux-elf.h +@@ -23,8 +23,8 @@ along with GCC; see the file COPYING3. If not see + #define EXTRA_SPECS \ + { "elf_dynamic_linker", ELF_DYNAMIC_LINKER }, + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" +-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" ++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" ++#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0" + #if DEFAULT_LIBC == LIBC_UCLIBC + #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" + #elif DEFAULT_LIBC == LIBC_GLIBC +diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h +index 4a425c8..80f454d 100644 +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -68,8 +68,8 @@ + GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ + + #undef GLIBC_DYNAMIC_LINKER +-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3" +-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3" ++#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT SYSTEMLIBS_DIR "ld-linux.so.3" ++#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT SYSTEMLIBS_DIR "ld-linux-armhf.so.3" + #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT + + #define GLIBC_DYNAMIC_LINKER \ +diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h +index 753dc3a..d593967 100644 +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -57,7 +57,7 @@ + + #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" + + #define LINUX_TARGET_LINK_SPEC "%{h*} \ + %{static:-Bstatic} \ +diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h +index 3c95ee0..33b8acd 100644 +--- a/gcc/config/i386/linux.h ++++ b/gcc/config/i386/linux.h +@@ -20,4 +20,4 @@ along with GCC; see the file COPYING3. If not see + . */ + + #define GNU_USER_LINK_EMULATION "elf_i386" +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" +diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h +index b793e08..da788b8 100644 +--- a/gcc/config/i386/linux64.h ++++ b/gcc/config/i386/linux64.h +@@ -27,6 +27,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + #define GNU_USER_LINK_EMULATION64 "elf_x86_64" + #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64" + +-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" +-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" +-#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" ++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2" ++#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2" +diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h +index 9b4c68d..7ee5ba8 100644 +--- a/gcc/config/mips/linux.h ++++ b/gcc/config/mips/linux.h +@@ -17,4 +17,4 @@ You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld.so.1" +diff --git a/gcc/config/mips/linux64.h b/gcc/config/mips/linux64.h +index dbba47a..c7ed573 100644 +--- a/gcc/config/mips/linux64.h ++++ b/gcc/config/mips/linux64.h +@@ -22,10 +22,10 @@ along with GCC; see the file COPYING3. If not see + #define GNU_USER_LINK_EMULATION64 "elf64%{EB:b}%{EL:l}tsmip" + #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32" + +-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" +-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1" +-#define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1" +-#define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0" ++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1" ++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld.so.1" ++#define GLIBC_DYNAMIC_LINKERN32 SYSTEMLIBS_DIR "ld.so.1" ++#define UCLIBC_DYNAMIC_LINKERN32 SYSTEMLIBS_DIR "ld-uClibc.so.0" + #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" + #define GNU_USER_DYNAMIC_LINKERN32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ +diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h +index dc6f67f..bc60769 100644 +--- a/gcc/config/rs6000/linux64.h ++++ b/gcc/config/rs6000/linux64.h +@@ -360,10 +360,10 @@ extern int dot_symbols; + #undef LINK_OS_DEFAULT_SPEC + #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" + +-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" +-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" +-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" +-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" ++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1" ++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64.so.1" ++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0" ++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0" + #if DEFAULT_LIBC == LIBC_UCLIBC + #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" + #elif DEFAULT_LIBC == LIBC_GLIBC +diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h +index 9e8f32d..86bf81e 100644 +--- a/gcc/config/sh/linux.h ++++ b/gcc/config/sh/linux.h +@@ -43,7 +43,7 @@ along with GCC; see the file COPYING3. If not see + + #define TARGET_ASM_FILE_END file_end_indicate_exec_stack + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" + + #undef SUBTARGET_LINK_EMUL_SUFFIX + #define SUBTARGET_LINK_EMUL_SUFFIX "_linux" +diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h +index 49283d3..6f0b03a 100644 +--- a/gcc/config/sparc/linux.h ++++ b/gcc/config/sparc/linux.h +@@ -83,7 +83,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); + When the -shared link option is used a final link is not being + done. */ + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" + + #undef LINK_SPEC + #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \ +diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h +index 7d48e96..b01993f 100644 +--- a/gcc/config/sparc/linux64.h ++++ b/gcc/config/sparc/linux64.h +@@ -92,8 +92,8 @@ along with GCC; see the file COPYING3. If not see + When the -shared link option is used a final link is not being + done. */ + +-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" +-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux.so.2" + + #ifdef SPARC_BI_ARCH + +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0030-gcc-Fix-argument-list-too-long-error.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0030-gcc-Fix-argument-list-too-long-error.patch new file mode 100644 index 0000000..2ceaff6 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0030-gcc-Fix-argument-list-too-long-error.patch @@ -0,0 +1,40 @@ +From c1816c160156f99c34e6a0a0311bb0219326804e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:26:37 +0400 +Subject: [PATCH 30/35] gcc: Fix argument list too long error. + +There would be an "Argument list too long" error when the +build directory is longer than 200, this is caused by: + +headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u` + +The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle +it, use the $(sort list) of GNU make which can handle the too long list +would fix the problem, the header would be short enough after sorted. +The "tr ' ' '\012'" was used for translating the space to "\n", the +$(sort list) doesn't need this. + +Signed-off-by: Robert Yang +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 2320497..8562a62 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -4627,7 +4627,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype + # We keep the directory structure for files in config or c-family and .def + # files. All other files are flattened to a single directory. + $(mkinstalldirs) $(DESTDIR)$(plugin_includedir) +- headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`; \ ++ headers="$(sort $(PLUGIN_HEADERS))"; \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \ + for file in $$headers; do \ + if [ -f $$file ] ; then \ +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0031-Disable-sdt.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0031-Disable-sdt.patch new file mode 100644 index 0000000..c714239 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0031-Disable-sdt.patch @@ -0,0 +1,45 @@ +From eb70cb2785af7171897f363298bbfcd83de5ec57 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:28:10 +0400 +Subject: [PATCH 31/35] Disable sdt. + +We don't list dtrace in DEPENDS so we shouldn't be depending on this header. +It may or may not exist from preivous builds though. To be determinstic, disable +sdt.h usage always. This avoids build failures if the header is removed after configure +but before libgcc is compiled for example. + +RP 2012/8/7 + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [hack] +--- + gcc/configure | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/gcc/configure b/gcc/configure +index d587993..8bc0c98 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -26792,12 +26792,12 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5 + $as_echo_n "checking sys/sdt.h in the target C library... " >&6; } + have_sys_sdt_h=no +-if test -f $target_header_dir/sys/sdt.h; then +- have_sys_sdt_h=yes +- +-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h +- +-fi ++#if test -f $target_header_dir/sys/sdt.h; then ++# have_sys_sdt_h=yes ++# ++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h ++# ++#fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5 + $as_echo "$have_sys_sdt_h" >&6; } + +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0032-libtool.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0032-libtool.patch new file mode 100644 index 0000000..3b3d1b6 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0032-libtool.patch @@ -0,0 +1,42 @@ +From 6c715fcfa262adadca81c68a1f3f69aa3187a501 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:29:11 +0400 +Subject: [PATCH 32/35] libtool + +libstdc++ from gcc-runtime gets created with -rpath=/usr/lib/../lib for qemux86-64 +when running on am x86_64 build host. + +This patch stops this speading to libdir in the libstdc++.la file within libtool. +Arguably, it shouldn't be passing this into libtool in the first place but +for now this resolves the nastiest problems this causes. + +func_normal_abspath would resolve an empty path to `pwd` so we need +to filter the zero case. + +RP 2012/8/24 + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + ltmain.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/ltmain.sh b/ltmain.sh +index a03433f..46f47c2 100644 +--- a/ltmain.sh ++++ b/ltmain.sh +@@ -6359,6 +6359,10 @@ func_mode_link () + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" ++ if test -n "$install_libdir"; then ++ func_normal_abspath "$install_libdir" ++ install_libdir=$func_normal_abspath_result ++ fi + + oldlibs= + if test -z "$rpath"; then +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch new file mode 100644 index 0000000..199984d --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch @@ -0,0 +1,43 @@ +From 97e4591c20310425e7aca0e6712a8d9480e7744c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:30:32 +0400 +Subject: [PATCH 33/35] gcc: armv4: pass fix-v4bx to linker to support EABI. + +The LINK_SPEC for linux gets overwritten by linux-eabi.h which +means the value of TARGET_FIX_V4BX_SPEC gets lost and as a result +the option is not passed to linker when chosing march=armv4 +This patch redefines this in linux-eabi.h and reinserts it +for eabi defaulting toolchains. + +We might want to send it upstream. + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/config/arm/linux-eabi.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h +index 80f454d..4db3eb9 100644 +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -77,10 +77,14 @@ + %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ + %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" + ++/* For armv4 we pass --fix-v4bx to linker to support EABI */ ++#undef TARGET_FIX_V4BX_SPEC ++#define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +-#define LINK_SPEC BE8_LINK_SPEC \ ++#define LINK_SPEC BE8_LINK_SPEC TARGET_FIX_V4BX_SPEC \ + LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ + LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) + +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch new file mode 100644 index 0000000..66b9f89 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch @@ -0,0 +1,102 @@ +From fc5e4beaea856a2b486c770ad3addc0f5bb3100e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:33:04 +0400 +Subject: [PATCH 34/35] Use the multilib config files from ${B} instead of + using the ones from ${S} + +Use the multilib config files from ${B} instead of using the ones from ${S} +so that the source can be shared between gcc-cross-initial, +gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build. + +Signed-off-by: Khem Raj +Signed-off-by: Constantin Musca + +Upstream-Status: Inappropriate [configuration] +--- + gcc/configure | 22 ++++++++++++++++++---- + gcc/configure.ac | 22 ++++++++++++++++++---- + 2 files changed, 36 insertions(+), 8 deletions(-) + +diff --git a/gcc/configure b/gcc/configure +index 8bc0c98..3cd0817 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -11519,10 +11519,20 @@ done + tmake_file_= + for f in ${tmake_file} + do +- if test -f ${srcdir}/config/$f +- then +- tmake_file_="${tmake_file_} \$(srcdir)/config/$f" +- fi ++ case $f in ++ */t-linux64 ) ++ if test -f ./config/$f ++ then ++ tmake_file_="${tmake_file_} ./config/$f" ++ fi ++ ;; ++ * ) ++ if test -f ${srcdir}/config/$f ++ then ++ tmake_file_="${tmake_file_} \$(srcdir)/config/$f" ++ fi ++ ;; ++ esac + done + tmake_file="${tmake_file_}" + +@@ -11533,6 +11543,10 @@ tm_file_list="options.h" + tm_include_list="options.h insn-constants.h" + for f in $tm_file; do + case $f in ++ */linux64.h ) ++ tm_file_list="${tm_file_list} ./config/$f" ++ tm_include_list="${tm_include_list} ./config/$f" ++ ;; + ./* ) + f=`echo $f | sed 's/^..//'` + tm_file_list="${tm_file_list} $f" +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 5e5e84f..415a6df 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -1700,10 +1700,20 @@ done + tmake_file_= + for f in ${tmake_file} + do +- if test -f ${srcdir}/config/$f +- then +- tmake_file_="${tmake_file_} \$(srcdir)/config/$f" +- fi ++ case $f in ++ */t-linux64 ) ++ if test -f ./config/$f ++ then ++ tmake_file_="${tmake_file_} ./config/$f" ++ fi ++ ;; ++ * ) ++ if test -f ${srcdir}/config/$f ++ then ++ tmake_file_="${tmake_file_} \$(srcdir)/config/$f" ++ fi ++ ;; ++ esac + done + tmake_file="${tmake_file_}" + +@@ -1714,6 +1724,10 @@ tm_file_list="options.h" + tm_include_list="options.h insn-constants.h" + for f in $tm_file; do + case $f in ++ */linux64.h ) ++ tm_file_list="${tm_file_list} ./config/$f" ++ tm_include_list="${tm_include_list} ./config/$f" ++ ;; + ./* ) + f=`echo $f | sed 's/^..//'` + tm_file_list="${tm_file_list} $f" +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0035-wcast-qual-PR-55383.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0035-wcast-qual-PR-55383.patch new file mode 100644 index 0000000..be4cf4a --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0035-wcast-qual-PR-55383.patch @@ -0,0 +1,55 @@ +From deffdb0b2497a106061d3ea2c6a3fef4fba3445e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:39:51 +0400 +Subject: [PATCH 35/35] wcast-qual PR/55383 + +This is a backport from gcc bugzilla + +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55383 + +This commit fixes a wrong warning behavior. This bug which has no +workaround other than disabling the warning. + +Signed-off-by: Khem Raj + +Upstream-Status: Backport +--- + gcc/c/c-typeck.c | 2 +- + gcc/testsuite/c-c++-common/Wcast-qual-1.c | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c +index ddb6d39..c624120 100644 +--- a/gcc/c/c-typeck.c ++++ b/gcc/c/c-typeck.c +@@ -4464,7 +4464,7 @@ handle_warn_cast_qual (location_t loc, tree type, tree otype) + /* There are qualifiers present in IN_OTYPE that are not present + in IN_TYPE. */ + warning_at (loc, OPT_Wcast_qual, +- "cast discards %q#v qualifier from pointer target type", ++ "cast discards %qv qualifier from pointer target type", + discarded); + + if (added || discarded) +diff --git a/gcc/testsuite/c-c++-common/Wcast-qual-1.c b/gcc/testsuite/c-c++-common/Wcast-qual-1.c +index 640e4f0..56382c7 100644 +--- a/gcc/testsuite/c-c++-common/Wcast-qual-1.c ++++ b/gcc/testsuite/c-c++-common/Wcast-qual-1.c +@@ -85,11 +85,11 @@ f3 (void ***bar) + void + f4 (void * const **bar) + { +- const void ***p9 = (const void ***) bar; /* { dg-warning "cast" } */ ++ const void ***p9 = (const void ***) bar; /* { dg-warning "cast discards .const. qualifier" } */ + void * const **p11 = (void * const **) bar; +- void ** const *p13 = (void ** const *) bar; /* { dg-warning "cast" } */ ++ void ** const *p13 = (void ** const *) bar; /* { dg-warning "cast discards .const. qualifier" } */ + const void * const **p15 = (const void * const **) bar; /* { dg-warning "cast" } */ +- const void ** const *p17 = (const void ** const *) bar; /* { dg-warning "cast" } */ ++ const void ** const *p17 = (const void ** const *) bar; /* { dg-warning "cast discards .const. qualifier" } */ + void * const * const * p19 = (void * const * const *) bar; + const void * const * const *p21 = (const void * const * const *) bar; + } +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0037-gcc-4.8-PR56797.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0037-gcc-4.8-PR56797.patch new file mode 100644 index 0000000..b5d7b86 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0037-gcc-4.8-PR56797.patch @@ -0,0 +1,66 @@ +Upstream-Status: Backport +Signed-off-by: Khem Raj + +From patchwork Fri Apr 19 09:34:49 2013 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [ARM] Fix PR56797 +Date: Thu, 18 Apr 2013 23:34:49 -0000 +From: Greta Yorsh +X-Patchwork-Id: 237891 +Message-Id: <000801ce3ce1$23fbdd60$6bf39820$@yorsh@arm.com> +To: "GCC Patches" +Cc: , "Richard Earnshaw" , + "Ramana Radhakrishnan" + +Fix PR56797 +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56797 + +The problem is that peephole optimizer thinks it can generate an ldm, but +the pattern for ldm no longer matches, because after r188738 it requires +that if one of the destination registers is SP then the base register must +be SP, and it's not SP in the test case. + +The test case fails on armv5t but doesn't fail on armv6t2 or armv7-a because +peephole doesn't trigger there (because there is a different epilogue +sequence). It looks like a latent problem for other architecture or CPUs. + +This patch adds this condition to the peephole optimizer. + +No regression on qemu for arm-none-eabi and fixes the test reported in the +PR. I couldn't minimize the test sufficiently to include it in the +testsuite. + +Ok for trunk? + +Thanks, +Greta + +gcc/ + +2013-04-18 Greta Yorsh + + PR target/56797 + * config/arm/arm.c (load_multiple_sequence): Require SP + as base register for loads if SP is in the register list. + + +diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c +index d00849c..60fef78 100644 +--- a/gcc/config/arm/arm.c ++++ b/gcc/config/arm/arm.c +@@ -10347,6 +10347,13 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *saved_order, + || (i != nops - 1 && unsorted_regs[i] == base_reg)) + return 0; + ++ /* Don't allow SP to be loaded unless it is also the base ++ register. It guarantees that SP is reset correctly when ++ an LDM instruction is interruptted. Otherwise, we might ++ end up with a corrupt stack. */ ++ if (unsorted_regs[i] == SP_REGNUM && base_reg != SP_REGNUM) ++ return 0; ++ + unsorted_offsets[i] = INTVAL (offset); + if (i == 0 || unsorted_offsets[i] < unsorted_offsets[order[0]]) + order[0] = i; diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0038-gcc-4.8-build-args.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0038-gcc-4.8-build-args.patch new file mode 100644 index 0000000..c27e009 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0038-gcc-4.8-build-args.patch @@ -0,0 +1,41 @@ +When cross compiling a target gcc, target flags may be used on the host + +Configure identifies a number of warning flags (WARN_CFLAGS and +WARN_CXXFLAGS) from the $CC value. The cross compiler may be different +from the host compiler and may not support the same set of flags. This +leads to problems such as: + +cc1plus: error: unrecognized command line option "-Wno-narrowing" +cc1plus: error: unrecognized command line option "-Wno-overlength-strings" + +Work around this problem by removing the warning flags from the +BUILD_CXXFLAGS value, in a way similar to the BUILD_CFLAGS. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: gcc-4.8.0/gcc/configure +=================================================================== +--- gcc-4.8.0.orig/gcc/configure ++++ gcc-4.8.0/gcc/configure +@@ -11720,6 +10581,7 @@ STMP_FIXINC=stmp-fixinc + if test x$build != x$host || test "x$coverage_flags" != x + then + BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' ++ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' + BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' + fi + +Index: gcc-4.8.0/gcc/configure.ac +=================================================================== +--- gcc-4.8.0.orig/gcc/configure.ac ++++ gcc-4.8.0/gcc/configure.ac +@@ -1901,6 +1901,7 @@ STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_F + if test x$build != x$host || test "x$coverage_flags" != x + then + BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' ++ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' + BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)' + fi + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0039-gcc-4.8-PR57717.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0039-gcc-4.8-PR57717.patch new file mode 100644 index 0000000..f983f70 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0039-gcc-4.8-PR57717.patch @@ -0,0 +1,23 @@ +This backports fix from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57717 + +Upstream-Status: Backport +Signed-off-by: Khem Raj + +Index: gcc-4.8.1/gcc/config/rs6000/rs6000.c +=================================================================== +--- gcc-4.8.1.orig/gcc/config/rs6000/rs6000.c 2013-05-09 18:54:06.000000000 -0700 ++++ gcc-4.8.1/gcc/config/rs6000/rs6000.c 2013-06-27 08:22:40.459021366 -0700 +@@ -5431,11 +5431,12 @@ + + case TFmode: + case TDmode: +- case TImode: + if (TARGET_E500_DOUBLE) + return (SPE_CONST_OFFSET_OK (offset) + && SPE_CONST_OFFSET_OK (offset + 8)); ++ /* Fall through. */ + ++ case TImode: + extra = 8; + if (!worst_case) + break; diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0040-fix-g++-sysroot.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0040-fix-g++-sysroot.patch new file mode 100644 index 0000000..d50aa5c --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0040-fix-g++-sysroot.patch @@ -0,0 +1,40 @@ +Portions of + +http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26013.html + +are not upstreamed yet. So lets keep missing pieces. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj + +Index: gcc-4.8.1/gcc/configure.ac +=================================================================== +--- gcc-4.8.1.orig/gcc/configure.ac 2013-07-15 15:55:49.488399132 -0700 ++++ gcc-4.8.1/gcc/configure.ac 2013-07-15 16:02:31.772406679 -0700 +@@ -148,7 +148,9 @@ + if test "${with_sysroot+set}" = set; then + gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` + if test "${gcc_gxx_without_sysroot}"; then +- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" ++ if test x${with_sysroot} != x/; then ++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" ++ fi + gcc_gxx_include_dir_add_sysroot=1 + fi + fi +Index: gcc-4.8.1/gcc/configure +=================================================================== +--- gcc-4.8.1.orig/gcc/configure 2013-07-15 15:55:49.472399132 -0700 ++++ gcc-4.8.1/gcc/configure 2013-07-15 16:02:31.780406680 -0700 +@@ -3325,7 +3325,9 @@ + if test "${with_sysroot+set}" = set; then + gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` + if test "${gcc_gxx_without_sysroot}"; then +- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" ++ if test x${with_sysroot} != x/; then ++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" ++ fi + gcc_gxx_include_dir_add_sysroot=1 + fi + fi diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0041-libtool-avoid-libdir.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0041-libtool-avoid-libdir.patch new file mode 100644 index 0000000..2dd9610 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0041-libtool-avoid-libdir.patch @@ -0,0 +1,19 @@ +Avoid using libdir from .la which usually points to a host path + +Upstream-Status: Inappropriate [embedded specific] +Signed-off-by: Jonathan Liu + +diff --git a/ltmain.sh b/ltmain.sh +index a03433f..1902a90 100644 +--- a/ltmain.sh ++++ b/ltmain.sh +@@ -5628,6 +5628,9 @@ func_mode_link () + absdir="$abs_ladir" + libdir="$abs_ladir" + else ++ # Instead of using libdir from .la which usually points to a host path, ++ # use the path the .la is contained in. ++ libdir="$abs_ladir" + dir="$libdir" + absdir="$libdir" + fi diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0042-pr57748.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0042-pr57748.patch new file mode 100644 index 0000000..5356f72 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0042-pr57748.patch @@ -0,0 +1,78 @@ +Upstream-Status: Backport +Signed-off-by: Khem Raj + +2013-08-01 Martin Jambor + + PR middle-end/57748 + * stor-layout.c (compute_record_mode): Treat zero-sized array fields + like incomplete types. + +testsuite/ + * gcc.dg/torture/pr57748.c: New test. + + +Index: gcc-4.8.1/gcc/stor-layout.c +=================================================================== +--- gcc-4.8.1.orig/gcc/stor-layout.c 2013-04-28 10:29:18.000000000 -0700 ++++ gcc-4.8.1/gcc/stor-layout.c 2013-08-01 15:02:08.018006125 -0700 +@@ -1618,7 +1618,9 @@ + && integer_zerop (TYPE_SIZE (TREE_TYPE (field))))) + || ! host_integerp (bit_position (field), 1) + || DECL_SIZE (field) == 0 +- || ! host_integerp (DECL_SIZE (field), 1)) ++ || ! host_integerp (DECL_SIZE (field), 1) ++ || (TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE ++ && tree_low_cst (DECL_SIZE (field), 1) == 0)) + return; + + /* If this field is the whole struct, remember its mode so +Index: gcc-4.8.1/gcc/testsuite/gcc.dg/torture/pr57748.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gcc-4.8.1/gcc/testsuite/gcc.dg/torture/pr57748.c 2013-08-01 15:02:08.062006126 -0700 +@@ -0,0 +1,45 @@ ++/* PR middle-end/57748 */ ++/* { dg-do run } */ ++ ++#include ++ ++extern void abort (void); ++ ++typedef long long V ++ __attribute__ ((vector_size (2 * sizeof (long long)), may_alias)); ++ ++typedef struct S { V a; V b[0]; } P __attribute__((aligned (1))); ++ ++struct __attribute__((packed)) T { char c; P s; }; ++ ++void __attribute__((noinline, noclone)) ++check (struct T *t) ++{ ++ if (t->s.b[0][0] != 3 || t->s.b[0][1] != 4) ++ abort (); ++} ++ ++int __attribute__((noinline, noclone)) ++get_i (void) ++{ ++ return 0; ++} ++ ++void __attribute__((noinline, noclone)) ++foo (P *p) ++{ ++ V a = { 3, 4 }; ++ int i = get_i(); ++ p->b[i] = a; ++} ++ ++int ++main () ++{ ++ struct T *t = (struct T *) malloc (128); ++ ++ foo (&t->s); ++ check (t); ++ ++ return 0; ++} diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0043-cpp.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0043-cpp.patch new file mode 100644 index 0000000..eaf8646 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0043-cpp.patch @@ -0,0 +1,40 @@ +The OE environment sets and exports CPP as being the target gcc. When building +gcc-cross-canadian for a mingw targetted sdk, the following can be found in +build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log: + +configure:3641: checking for _FILE_OFFSET_BITS value needed for large files +configure:3666: gcc -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe conftest.c >&5 +configure:3666: $? = 0 +configure:3698: result: no +configure:3786: checking how to run the C preprocessor +configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 +configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c +configure:3876: $? = 0 + +Note this is a *build* target (in build-x86_64-linux) so it should be using +the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32 headers are +very different, using the wrong cpp is a real problem. It is leaking into +configure through the CPP variable. Ultimately this leads to build failures +related to not being able to include a process.h file for pem-unix.c. + +The fix is to ensure we export a sane CPP value into the build environment when +using build targets. We could define a CPP_FOR_BUILD value which may be the version +which needs to be upstreamed but for now, this fix is good enough to avoid the +problem. + +RP 22/08/2013 + +Upstream-Status: Pending + +Index: gcc-4.8.1/Makefile.in +=================================================================== +--- gcc-4.8.1.orig/Makefile.in 2013-03-30 11:25:03.000000000 +0000 ++++ gcc-4.8.1/Makefile.in 2013-08-13 12:03:17.151988882 +0000 +@@ -149,6 +149,7 @@ + AR="$(AR_FOR_BUILD)"; export AR; \ + AS="$(AS_FOR_BUILD)"; export AS; \ + CC="$(CC_FOR_BUILD)"; export CC; \ ++ CPP="$(CC_FOR_BUILD) -E"; export CPP; \ + CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX_FOR_BUILD)"; export CXX; \ diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0044-gengtypes.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0044-gengtypes.patch new file mode 100644 index 0000000..e38761d --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0044-gengtypes.patch @@ -0,0 +1,97 @@ +gengtype is generated for both the build system and the target. -DGENERATOR_FILE +was added in the patch http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00273.html +and was applied to both versions of gengtype. + +Unfortunately the presence of this flag triggers the build configuration (bconfig.h) +to be included for the target build of gengtype. Compiling gengtype with the target +compiler and bconfig.h can result in errors if the build and target systems are +dissimilar. An example case this fails is cross compiling gcc on linux for a darwin +target system: + +In file included from /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c:25:0: +| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c: In function 'void parse_error(const char*, ...)': +| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/system.h:93:53: error: 'fputc_unlocked' was not declared in this scope +| # define fputc(C, Stream) fputc_unlocked (C, Stream) + +which occurs since auto-build.h and auto-host.h have differnet values of +HAVE_FPUTC_UNLOCKED: + +#define HAVE_FPUTC_UNLOCKED 1 +/* #undef HAVE_FPUTS_UNLOCKED */ + +The obvious fix is to only include the flag on build/ targets which this patch does, however +this also leads to compile errors due to const_tree being undefined but used in double_int.h + +I added a GENERATOR_FILE2 flag to workaround those in the +target case and allow the build to succeed. + +Only the build/gengtypes should have the -DGENERATOR_FILE + +RP 22/8/2013 + +Upstream-Status: Pending + +Index: gcc-4.8.1/gcc/Makefile.in +=================================================================== +--- gcc-4.8.1.orig/gcc/Makefile.in 2013-08-19 11:40:36.844014424 +0000 ++++ gcc-4.8.1/gcc/Makefile.in 2013-08-19 11:40:37.784014402 +0000 +@@ -3903,27 +3903,29 @@ + + gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H) + gengtype-lex.o: $(CONFIG_H) $(BCONFIG_H) +-CFLAGS-gengtype-lex.o += -DGENERATOR_FILE ++CFLAGS-build/gengtype-lex.o += -DGENERATOR_FILE + build/gengtype-lex.o: $(BCONFIG_H) + + gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \ + $(SYSTEM_H) + gengtype-parse.o: $(CONFIG_H) +-CFLAGS-gengtype-parse.o += -DGENERATOR_FILE ++CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE + build/gengtype-parse.o: $(BCONFIG_H) + + gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \ + gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \ + $(XREGEX_H) + gengtype-state.o: $(CONFIG_H) +-CFLAGS-gengtype-state.o += -DGENERATOR_FILE ++CFLAGS-gengtype-state.o += -DGENERATOR_FILE2 ++CFLAGS-build/gengtype-state.o += -DGENERATOR_FILE + build/gengtype-state.o: $(BCONFIG_H) + + gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h \ + rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \ + $(OBSTACK_H) $(XREGEX_H) + gengtype.o: $(CONFIG_H) +-CFLAGS-gengtype.o += -DGENERATOR_FILE ++CFLAGS-gengtype.o += -DGENERATOR_FILE2 ++CFLAGS-build/gengtype.o += -DGENERATOR_FILE + build/gengtype.o: $(BCONFIG_H) + + build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ +@@ -3988,7 +3990,7 @@ + # any system header is included. + gengtype-lex.c : gengtype-lex.l + -$(FLEX) $(FLEXFLAGS) -o$@ $< && { \ +- echo '#include "bconfig.h"' > $@.tmp; \ ++ echo '' > $@.tmp; \ + cat $@ >> $@.tmp; \ + mv $@.tmp $@; \ + } +Index: gcc-4.8.1/gcc/double-int.h +=================================================================== +--- gcc-4.8.1.orig/gcc/double-int.h 2013-01-30 11:04:30.000000000 +0000 ++++ gcc-4.8.1/gcc/double-int.h 2013-08-19 11:41:51.564012719 +0000 +@@ -448,10 +448,12 @@ + + + #ifndef GENERATOR_FILE ++#ifndef GENERATOR_FILE2 + /* Conversion to and from GMP integer representations. */ + + void mpz_set_double_int (mpz_t, double_int, bool); + double_int mpz_get_double_int (const_tree, mpz_t, bool); + #endif ++#endif + + #endif /* DOUBLE_INT_H */ diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0045-gcc-4.8-PR57717-PowerPC-E500v2.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0045-gcc-4.8-PR57717-PowerPC-E500v2.patch new file mode 100644 index 0000000..96fa1da --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0045-gcc-4.8-PR57717-PowerPC-E500v2.patch @@ -0,0 +1,21 @@ +This backports fix from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57717 + +Upstream-Status: Backport +Signed-off-by: Julian Brown + +fix for PR57717 (PowerPC E500v2) +http://gcc.gnu.org/ml/gcc-patches/2013-08/msg00668.html + +--- a/gcc/config/rs6000/rs6000.c 2013-05-09 20:54:06.000000000 -0500 ++++ b/gcc/config/rs6000/rs6000.c 2013-08-28 01:25:24.865218744 -0500 +@@ -6337,9 +6337,7 @@ + && GET_CODE (XEXP (x, 1)) == CONST_INT + && reg_offset_p + && !SPE_VECTOR_MODE (mode) +- && !(TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode +- || mode == DDmode || mode == TDmode +- || mode == DImode)) ++ && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (mode) > UNITS_PER_WORD) + && VECTOR_MEM_NONE_P (mode)) + { + HOST_WIDE_INT val = INTVAL (XEXP (x, 1)); diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0046-libatomic-deptracking.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0046-libatomic-deptracking.patch new file mode 100644 index 0000000..6ea4f42 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0046-libatomic-deptracking.patch @@ -0,0 +1,41 @@ +gcc 4.8 won't build with --disable-dependency-tracking since the *.Ppo files +don't get created unless --enable-dependency-tracking is true. + +This patch ensures we only use those compiler options when its enabled. + +Upstream-Status: Submitted + +(Problem was already reported upstream, attached this patch there +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55930) + +RP +2012/09/22 + +Index: gcc-4.8.1/libatomic/Makefile.am +=================================================================== +--- gcc-4.8.1.orig/libatomic/Makefile.am 2013-01-14 18:16:23.000000000 +0000 ++++ gcc-4.8.1/libatomic/Makefile.am 2013-09-22 10:38:18.904064750 +0000 +@@ -100,7 +100,8 @@ + IFUNC_DEF = -DIFUNC_ALT=$(PAT_S) + IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS)) + +-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo ++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo ++@AMDEP_FALSE@M_DEPS = + M_SIZE = -DN=$(PAT_N) + M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT)) + M_FILE = $(PAT_BASE)_n.c +Index: gcc-4.8.1/libatomic/Makefile.in +=================================================================== +--- gcc-4.8.1.orig/libatomic/Makefile.in 2013-05-31 09:09:26.000000000 +0000 ++++ gcc-4.8.1/libatomic/Makefile.in 2013-09-22 10:40:42.520059917 +0000 +@@ -298,7 +298,8 @@ + PAT_S = $(word 3,$(PAT_SPLIT)) + IFUNC_DEF = -DIFUNC_ALT=$(PAT_S) + IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS)) +-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo ++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo ++@AMDEP_FALSE@M_DEPS = + M_SIZE = -DN=$(PAT_N) + M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT)) + M_FILE = $(PAT_BASE)_n.c diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0047-repomembug.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0047-repomembug.patch new file mode 100644 index 0000000..868a4f3 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0047-repomembug.patch @@ -0,0 +1,53 @@ +When compiling a project using -frepo, .rpo files are written alongside +the .o file, the symbols either have O or C against them. During final linking, +the objects can be recompiled with some of the entries tweaked/chosen by the +tlink.c code (visible with TLINK_VERBOSE=3), it does this by changing O -> C +in the .rpo files. + +My tests showed that init_repo (cp/repo.c) was correctly calling +IDENTIFIER_REPO_CHOSEN against the right identifers and setting the +chosen bit. + +By the time finish_repo() or emit_repo_p() were called, the pointer returned +by get_identifier() for the symbol marked during init_repo had changed and +the chosen bit was no longer set. This lead to linking bugs like: + +collect: relinking +collect2: error: '_ZNK6sudoku5ClearINS_8SequenceEEclERS1_' was assigned to 'board.rpo', but was not defined during recompilation, or vice versa + +The problem is that the garbage collection is getting called before +finish_repo() is called and ggc_protect_identifiers is set to false +so the identifiers are not preserved. They are recreated but the +chosen bits get wiped out which is why the pointer changes and the +chosen bit is not set. + +The fix is to change ggc_protect_identifiers *after* the finish_repo +calls are made. + +Reproduction is tricky since you need to trigger the garbage collector at +just the right moment. + +RP 2013/10/9 + +[YOCTO #5133] + +Upstream-State: Pending + +Index: gcc-4.8.1/gcc/toplev.c +=================================================================== +--- gcc-4.8.1.orig/gcc/toplev.c 2013-03-28 08:29:51.000000000 +0000 ++++ gcc-4.8.1/gcc/toplev.c 2013-10-09 20:27:17.089228023 +0000 +@@ -551,11 +551,11 @@ + if (flag_syntax_only || flag_wpa) + return; + +- ggc_protect_identifiers = false; +- + /* This must also call finalize_compilation_unit. */ + lang_hooks.decls.final_write_globals (); + ++ ggc_protect_identifiers = false; ++ + if (seen_error ()) + return; + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0048-PR58854_fix_arm_apcs_epilogue.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0048-PR58854_fix_arm_apcs_epilogue.patch new file mode 100644 index 0000000..0ef245a --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0048-PR58854_fix_arm_apcs_epilogue.patch @@ -0,0 +1,23 @@ +Backport fix for PR target/58854 + +2013-11-11 Ramana Radhakrishnan + + Backported from mainline + 2013-10-30 Ramana Radhakrishnan + + PR target/58854 + * config/arm/arm.c (arm_expand_epilogue_apcs_frame): Emit blockage + + +Upstream-Status: Backport + +--- gcc-4_8-branch/gcc/config/arm/arm.c 2013/11/11 08:00:45 204664 ++++ gcc-4_8-branch/gcc/config/arm/arm.c 2013/11/11 09:38:14 204665 +@@ -23555,6 +23555,7 @@ + num_regs = bit_count (saved_regs_mask); + if ((offsets->outgoing_args != (1 + num_regs)) || cfun->calls_alloca) + { ++ emit_insn (gen_blockage ()); + /* Unwind the stack to just below the saved registers. */ + emit_insn (gen_addsi3 (stack_pointer_rtx, + hard_frame_pointer_rtx, diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch new file mode 100644 index 0000000..b98f8ff --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch @@ -0,0 +1,42 @@ +From 9e0e19eac2562f73858602fe26e2044eb8b20c47 Mon Sep 17 00:00:00 2001 +From: Alexandru-Cezar Sardan +Date: Wed, 5 Feb 2014 16:52:31 +0200 +Subject: [PATCH] Enable SPE & AltiVec generation on powepc*linux target + +When is configured with --target=powerpc-linux, the resulting GCC will +not be able to generate code for SPE targets (e500v1/v2). +GCC configured with --target=powerpc-linuxspe will not be able to +generate AltiVec instructions (for e6500). +This patch modifies the configured file such that SPE or AltiVec code +can be generated when gcc is configured with --target=powerpc-linux. +The ABI and speciffic instructions can be selected through the +"-mabi=spe or -mabi=altivec" and the "-mspe or -maltivec" parameters. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Alexandru-Cezar Sardan +--- + gcc/config.gcc | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/gcc/config.gcc b/gcc/config.gcc +index cb7a94e..d392c2b 100644 +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -2068,7 +2068,12 @@ powerpc-*-rtems*) + tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm" + ;; + powerpc*-*-linux*) +- tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h" ++ case ${target} in ++ powerpc*-*-linux*spe* | powerpc*-*-linux*altivec*) ++ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h" ;; ++ *) ++ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h rs6000/linuxaltivec.h rs6000/linuxspe.h rs6000/e500.h" ;; ++ esac + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" + case ${target} in +-- +1.7.9.5 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0050-PR-target-58595.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0050-PR-target-58595.patch new file mode 100644 index 0000000..62a3994 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/0050-PR-target-58595.patch @@ -0,0 +1,101 @@ +Backport fix for PR target/58595 + +From: jakub +Date: Thu, 6 Mar 2014 12:07:07 +0000 +Subject: [PATCH] PR target/58595 * config/arm/arm.c + (arm_tls_symbol_p): Remove. (arm_legitimize_address): Call + legitimize_tls_address for any arm_tls_referenced_p expression, + handle constant addend. Call it before testing for !TARGET_ARM. + (thumb_legitimize_address): Don't handle arm_tls_symbol_p here. + + * gcc.dg/tls/pr58595.c: New test. + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208380 138bc75d-0d04-0410-961f-82ee72b054a4 + +Index: gcc-4.8.2/gcc/config/arm/arm.c +=================================================================== +--- gcc-4.8.2.orig/gcc/config/arm/arm.c ++++ gcc-4.8.2/gcc/config/arm/arm.c +@@ -230,7 +230,6 @@ static tree arm_gimplify_va_arg_expr (tr + static void arm_option_override (void); + static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode); + static bool arm_cannot_copy_insn_p (rtx); +-static bool arm_tls_symbol_p (rtx x); + static int arm_issue_rate (void); + static void arm_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; + static bool arm_output_addr_const_extra (FILE *, rtx); +@@ -6573,6 +6572,32 @@ legitimize_tls_address (rtx x, rtx reg) + rtx + arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) + { ++ if (arm_tls_referenced_p (x)) ++ { ++ rtx addend = NULL; ++ ++ if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS) ++ { ++ addend = XEXP (XEXP (x, 0), 1); ++ x = XEXP (XEXP (x, 0), 0); ++ } ++ ++ if (GET_CODE (x) != SYMBOL_REF) ++ return x; ++ ++ gcc_assert (SYMBOL_REF_TLS_MODEL (x) != 0); ++ ++ x = legitimize_tls_address (x, NULL_RTX); ++ ++ if (addend) ++ { ++ x = gen_rtx_PLUS (SImode, x, addend); ++ orig_x = x; ++ } ++ else ++ return x; ++ } ++ + if (!TARGET_ARM) + { + /* TODO: legitimize_address for Thumb2. */ +@@ -6581,9 +6606,6 @@ arm_legitimize_address (rtx x, rtx orig_ + return thumb_legitimize_address (x, orig_x, mode); + } + +- if (arm_tls_symbol_p (x)) +- return legitimize_tls_address (x, NULL_RTX); +- + if (GET_CODE (x) == PLUS) + { + rtx xop0 = XEXP (x, 0); +@@ -6695,9 +6717,6 @@ arm_legitimize_address (rtx x, rtx orig_ + rtx + thumb_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) + { +- if (arm_tls_symbol_p (x)) +- return legitimize_tls_address (x, NULL_RTX); +- + if (GET_CODE (x) == PLUS + && CONST_INT_P (XEXP (x, 1)) + && (INTVAL (XEXP (x, 1)) >= 32 * GET_MODE_SIZE (mode) +@@ -6988,20 +7007,6 @@ thumb_legitimize_reload_address (rtx *x_ + + /* Test for various thread-local symbols. */ + +-/* Return TRUE if X is a thread-local symbol. */ +- +-static bool +-arm_tls_symbol_p (rtx x) +-{ +- if (! TARGET_HAVE_TLS) +- return false; +- +- if (GET_CODE (x) != SYMBOL_REF) +- return false; +- +- return SYMBOL_REF_TLS_MODEL (x) != 0; +-} +- + /* Helper for arm_tls_referenced_p. */ + + static int diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/AArch64-Define-BE-loader-name-default-be.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/AArch64-Define-BE-loader-name-default-be.patch new file mode 100644 index 0000000..eb8ff01 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/AArch64-Define-BE-loader-name-default-be.patch @@ -0,0 +1,38 @@ +Index: gcc-linaro-4.8-2014.03/gcc/config/aarch64/aarch64-linux.h +=================================================================== +--- gcc-linaro-4.8-2014.03.orig/gcc/config/aarch64/aarch64-linux.h ++++ gcc-linaro-4.8-2014.03/gcc/config/aarch64/aarch64-linux.h +@@ -21,10 +21,23 @@ + #ifndef GCC_AARCH64_LINUX_H + #define GCC_AARCH64_LINUX_H + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1" +- + #define CPP_SPEC "%{pthread:-D_REENTRANT}" + ++#if TARGET_BIG_ENDIAN_DEFAULT ++#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{!mlittle-endian:_be}.so.1" ++ ++#define LINUX_TARGET_LINK_SPEC "%{h*} \ ++ %{static:-Bstatic} \ ++ %{shared:-shared} \ ++ %{symbolic:-Bsymbolic} \ ++ %{rdynamic:-export-dynamic} \ ++ -dynamic-linker " GNU_USER_DYNAMIC_LINKER " \ ++ -X \ ++ %{mbig-endian:-EB} %{mlittle-endian:-EL} \ ++ -maarch64linux%{!mlittle-endian:b}" ++#else ++#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1" ++ + #define LINUX_TARGET_LINK_SPEC "%{h*} \ + %{static:-Bstatic} \ + %{shared:-shared} \ +@@ -34,6 +47,7 @@ + -X \ + %{mbig-endian:-EB} %{mlittle-endian:-EL} \ + -maarch64linux%{mbig-endian:b}" ++#endif + + #define LINK_SPEC LINUX_TARGET_LINK_SPEC + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/gcc-4.8-PR56797.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/gcc-4.8-PR56797.patch new file mode 100644 index 0000000..b5d7b86 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/gcc-4.8-PR56797.patch @@ -0,0 +1,66 @@ +Upstream-Status: Backport +Signed-off-by: Khem Raj + +From patchwork Fri Apr 19 09:34:49 2013 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [ARM] Fix PR56797 +Date: Thu, 18 Apr 2013 23:34:49 -0000 +From: Greta Yorsh +X-Patchwork-Id: 237891 +Message-Id: <000801ce3ce1$23fbdd60$6bf39820$@yorsh@arm.com> +To: "GCC Patches" +Cc: , "Richard Earnshaw" , + "Ramana Radhakrishnan" + +Fix PR56797 +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56797 + +The problem is that peephole optimizer thinks it can generate an ldm, but +the pattern for ldm no longer matches, because after r188738 it requires +that if one of the destination registers is SP then the base register must +be SP, and it's not SP in the test case. + +The test case fails on armv5t but doesn't fail on armv6t2 or armv7-a because +peephole doesn't trigger there (because there is a different epilogue +sequence). It looks like a latent problem for other architecture or CPUs. + +This patch adds this condition to the peephole optimizer. + +No regression on qemu for arm-none-eabi and fixes the test reported in the +PR. I couldn't minimize the test sufficiently to include it in the +testsuite. + +Ok for trunk? + +Thanks, +Greta + +gcc/ + +2013-04-18 Greta Yorsh + + PR target/56797 + * config/arm/arm.c (load_multiple_sequence): Require SP + as base register for loads if SP is in the register list. + + +diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c +index d00849c..60fef78 100644 +--- a/gcc/config/arm/arm.c ++++ b/gcc/config/arm/arm.c +@@ -10347,6 +10347,13 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *saved_order, + || (i != nops - 1 && unsorted_regs[i] == base_reg)) + return 0; + ++ /* Don't allow SP to be loaded unless it is also the base ++ register. It guarantees that SP is reset correctly when ++ an LDM instruction is interruptted. Otherwise, we might ++ end up with a corrupt stack. */ ++ if (unsorted_regs[i] == SP_REGNUM && base_reg != SP_REGNUM) ++ return 0; ++ + unsorted_offsets[i] = INTVAL (offset); + if (i == 0 || unsorted_offsets[i] < unsorted_offsets[order[0]]) + order[0] = i; diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/use-lib-for-aarch64.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/use-lib-for-aarch64.patch new file mode 100644 index 0000000..d6bacd8 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.8/use-lib-for-aarch64.patch @@ -0,0 +1,14 @@ +--- + gcc/config/aarch64/t-aarch64-linux | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- gcc-linaro-4.8-2013.04.orig/gcc/config/aarch64/t-aarch64-linux ++++ gcc-linaro-4.8-2013.04/gcc/config/aarch64/t-aarch64-linux +@@ -20,6 +20,6 @@ + + LIB1ASMSRC = aarch64/lib1funcs.asm + LIB1ASMFUNCS = _aarch64_sync_cache_range + + AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) +-MULTILIB_OSDIRNAMES = .=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) ++MULTILIB_OSDIRNAMES = .=../lib$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9.inc b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9.inc new file mode 100644 index 0000000..2334719 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9.inc @@ -0,0 +1,73 @@ +require recipes-devtools/gcc/gcc-4.9.inc +PV = "linaro-${BASEPV}" + +MMYY = "14.11" +RELEASE = "20${MMYY}" +PR = "r${RELEASE}" +BINV = "4.9.3" + +FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/gcc-${PV}' ], d)}" +FILESPATH_append := ":${COREBASE}/meta/recipes-devtools/gcc/gcc-4.9" + +SRC_URI = "https://releases.linaro.org/${MMYY}/components/toolchain/gcc-linaro/${BASEPV}/gcc-${PV}-${RELEASE}.tar.xz \ + file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \ + file://0002-uclibc-conf.patch \ + file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \ + file://0004-uclibc-locale.patch \ + file://0005-uclibc-locale-no__x.patch \ + file://0006-uclibc-locale-wchar_fix.patch \ + file://0007-uclibc-locale-update.patch \ + file://0008-missing-execinfo_h.patch \ + file://0009-c99-snprintf.patch \ + file://0010-c99-complex-ugly-hack.patch \ + file://0011-index_macro.patch \ + file://0013-libstdc-namespace.patch \ + file://0014-sh-pr24836.patch \ + file://0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch \ + file://0016-gcc-poison-system-directories.patch \ + file://0017-gcc-poison-dir-extend.patch \ + file://0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \ + file://0019-64-bit-multilib-hack.patch \ + file://0020-optional-libstdc.patch \ + file://0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \ + file://0022-COLLECT_GCC_OPTIONS.patch \ + file://0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \ + file://0024-PR-target-32219.patch \ + file://0025-fortran-cross-compile-hack.patch \ + file://0026-libgcc-sjlj-check.patch \ + file://0027-cpp-honor-sysroot.patch \ + file://0028-MIPS64-Default-to-N64-ABI.patch \ + file://0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \ + file://0030-gcc-Fix-argument-list-too-long-error.patch \ + file://0031-Disable-sdt.patch \ + file://0032-libtool.patch \ + file://0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \ + file://0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch \ + file://0037-gcc-4.8-PR56797.patch \ + file://0040-fix-g++-sysroot.patch \ + file://0041-libtool-avoid-libdir.patch \ + file://0043-cpp.patch \ + file://0044-gengtypes.patch \ + file://0046-libatomic-deptracking.patch \ + file://0047-repomembug.patch \ + file://0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \ + file://0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch \ + file://0051-eabispe.patch \ + file://0052-Fix-GCC-targeting-E500-SPE-errors-with-the-_Decimal64-type.patch;apply=no \ + file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \ + file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \ + file://0055-PR-rtl-optimization-61801.patch;apply=no \ + file://0056-top-level-reorder_gcc-bug-61144.patch \ + file://0058-gcc-r212171.patch \ + file://0059-gcc-PR-rtl-optimization-63348.patch \ + file://AArch64-Define-BE-loader-name-default-be.patch \ + file://use-lib-for-aarch64.patch \ + file://1001-add-install-ptest-to-Makefile.patch \ + file://run-ptest \ + " + +SRC_URI[md5sum] = "a0fda0cc4408f935086bb156aeef5ff9" +SRC_URI[sha256sum] = "7e176614b4a39259bfe4dad08d89651f511f3e52c2201210037b48cce90cc32a" + +S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}-${RELEASE}" +B = "${WORKDIR}/gcc-${PV}-${RELEASE}/build.${HOST_SYS}.${TARGET_SYS}" diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch new file mode 100644 index 0000000..e588011 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch @@ -0,0 +1,42 @@ +From bf3d96ae58fa180b8b468d25dc2e0209daca2751 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:37:11 +0400 +Subject: [PATCH 01/35] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [embedded specific] +--- + configure | 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index d809535..1b76c90 100755 +--- a/configure ++++ b/configure +@@ -7439,7 +7439,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/configure.ac b/configure.ac +index 48ec1aa..89d1d3f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2873,7 +2873,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 +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0002-uclibc-conf.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0002-uclibc-conf.patch new file mode 100644 index 0000000..dda3b10 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0002-uclibc-conf.patch @@ -0,0 +1,53 @@ +From d030973c872c00d916921d84deee0af2c0d38081 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:38:25 +0400 +Subject: [PATCH 02/35] uclibc-conf + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + contrib/regression/objs-gcc.sh | 4 ++++ + libjava/classpath/ltconfig | 4 ++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh +index 60b0497..6dc7ead 100755 +--- a/contrib/regression/objs-gcc.sh ++++ b/contrib/regression/objs-gcc.sh +@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ] + then + make all-gdb all-dejagnu all-ld || exit 1 + make install-gdb install-dejagnu install-ld || exit 1 ++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ] ++ then ++ make all-gdb all-dejagnu all-ld || exit 1 ++ make install-gdb install-dejagnu install-ld || exit 1 + elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then + make bootstrap || exit 1 + make install || exit 1 +diff --git a/libjava/classpath/ltconfig b/libjava/classpath/ltconfig +index 743d951..ae4ea60 100755 +--- a/libjava/classpath/ltconfig ++++ b/libjava/classpath/ltconfig +@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + # Transform linux* to *-*-linux-gnu*, to support old configure scripts. + case $host_os in +-linux-gnu*) ;; ++linux-gnu*|linux-uclibc*) ;; + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` + esac + +@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + ;; + + # This must be Linux ELF. +-linux-gnu*) ++linux*) + version_type=linux + need_lib_prefix=no + need_version=no +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch new file mode 100644 index 0000000..7098e99 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch @@ -0,0 +1,87 @@ +From d2d9dd756c4356d14dd7ae003856344cb4f37985 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:40:12 +0400 +Subject: [PATCH 03/35] gcc-uclibc-locale-ctype_touplow_t + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libstdc++-v3/config/locale/generic/c_locale.cc | 5 +++++ + libstdc++-v3/config/locale/generic/c_locale.h | 9 +++++++++ + libstdc++-v3/config/os/gnu-linux/ctype_base.h | 9 +++++++++ + 3 files changed, 23 insertions(+) + +diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc +index 0d309a5..f2f1e1f 100644 +--- a/libstdc++-v3/config/locale/generic/c_locale.cc ++++ b/libstdc++-v3/config/locale/generic/c_locale.cc +@@ -263,5 +263,10 @@ _GLIBCXX_END_NAMESPACE_VERSION + #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT + #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \ + extern "C" void ldbl (void) __attribute__ ((alias (#dbl))) ++#ifdef __UCLIBC__ ++// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int* ++_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs); ++#else + _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi); ++#endif + #endif // _GLIBCXX_LONG_DOUBLE_COMPAT +diff --git a/libstdc++-v3/config/locale/generic/c_locale.h b/libstdc++-v3/config/locale/generic/c_locale.h +index b5fd989..3da9a5d 100644 +--- a/libstdc++-v3/config/locale/generic/c_locale.h ++++ b/libstdc++-v3/config/locale/generic/c_locale.h +@@ -40,13 +40,22 @@ + + #include + ++#ifdef __UCLIBC__ ++#include ++#include ++#endif ++ + #define _GLIBCXX_NUM_CATEGORIES 0 + + namespace std _GLIBCXX_VISIBILITY(default) + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION + ++#ifdef __UCLIBC__ ++ typedef __ctype_touplow_t* __c_locale; ++#else + typedef int* __c_locale; ++#endif + + // Convert numeric value of type double and long double to string and + // return length of string. If vsnprintf is available use it, otherwise +diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_base.h b/libstdc++-v3/config/os/gnu-linux/ctype_base.h +index 2d8e978..14eb08f 100644 +--- a/libstdc++-v3/config/os/gnu-linux/ctype_base.h ++++ b/libstdc++-v3/config/os/gnu-linux/ctype_base.h +@@ -33,6 +33,11 @@ + + // Information as gleaned from /usr/include/ctype.h + ++#ifdef __UCLIBC__ ++#include ++#include ++#endif ++ + namespace std _GLIBCXX_VISIBILITY(default) + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION +@@ -41,7 +46,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + struct ctype_base + { + // Non-standard typedefs. ++#ifdef __UCLIBC__ ++ typedef const __ctype_touplow_t* __to_type; ++#else + typedef const int* __to_type; ++#endif + + // NB: Offsets into ctype::_M_table force a particular size + // on the mask type. Because of this, we don't use an enum. +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0004-uclibc-locale.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0004-uclibc-locale.patch new file mode 100644 index 0000000..49f5f33 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0004-uclibc-locale.patch @@ -0,0 +1,2862 @@ +From a55c751a449c2cbf0b3fcc07aab1b86bf9661510 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:41:39 +0400 +Subject: [PATCH 04/35] uclibc-locale + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libstdc++-v3/acinclude.m4 | 37 ++ + .../config/locale/uclibc/c++locale_internal.h | 63 ++ + libstdc++-v3/config/locale/uclibc/c_locale.cc | 160 +++++ + libstdc++-v3/config/locale/uclibc/c_locale.h | 117 ++++ + .../config/locale/uclibc/codecvt_members.cc | 308 +++++++++ + .../config/locale/uclibc/collate_members.cc | 80 +++ + libstdc++-v3/config/locale/uclibc/ctype_members.cc | 300 +++++++++ + .../config/locale/uclibc/messages_members.cc | 100 +++ + .../config/locale/uclibc/messages_members.h | 118 ++++ + .../config/locale/uclibc/monetary_members.cc | 692 ++++++++++++++++++++ + .../config/locale/uclibc/numeric_members.cc | 160 +++++ + libstdc++-v3/config/locale/uclibc/time_members.cc | 406 ++++++++++++ + libstdc++-v3/config/locale/uclibc/time_members.h | 68 ++ + libstdc++-v3/configure | 75 +++ + libstdc++-v3/include/c_compatibility/wchar.h | 2 + + libstdc++-v3/include/c_std/cwchar | 2 + + 16 files changed, 2688 insertions(+) + create mode 100644 libstdc++-v3/config/locale/uclibc/c++locale_internal.h + create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.h + create mode 100644 libstdc++-v3/config/locale/uclibc/codecvt_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/collate_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/ctype_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.h + create mode 100644 libstdc++-v3/config/locale/uclibc/monetary_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/numeric_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.cc + create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.h + +diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 +index 0871a6a..326d7ef 100644 +--- a/libstdc++-v3/acinclude.m4 ++++ b/libstdc++-v3/acinclude.m4 +@@ -1905,6 +1905,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ + # Default to "generic". + if test $enable_clocale_flag = auto; then + case ${target_os} in ++ *-uclibc*) ++ enable_clocale_flag=uclibc ++ ;; + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + enable_clocale_flag=gnu + ;; +@@ -2069,6 +2072,40 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ + CTIME_CC=config/locale/generic/time_members.cc + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h + ;; ++ uclibc) ++ AC_MSG_RESULT(uclibc) ++ ++ # Declare intention to use gettext, and add support for specific ++ # languages. ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT ++ ALL_LINGUAS="de fr" ++ ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. ++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then ++ USE_NLS=yes ++ fi ++ # Export the build objects. ++ for ling in $ALL_LINGUAS; do \ ++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ ++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ ++ done ++ AC_SUBST(glibcxx_MOFILES) ++ AC_SUBST(glibcxx_POFILES) ++ ++ CLOCALE_H=config/locale/uclibc/c_locale.h ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc ++ CMESSAGES_H=config/locale/uclibc/messages_members.h ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc ++ CTIME_H=config/locale/uclibc/time_members.h ++ CTIME_CC=config/locale/uclibc/time_members.cc ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h ++ ;; + esac + + # This is where the testsuite looks for locale catalogs, using the +diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +new file mode 100644 +index 0000000..2ae3e4a +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +@@ -0,0 +1,63 @@ ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*- ++ ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// Written by Jakub Jelinek ++ ++#include ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning clean this up ++#endif ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l; ++extern "C" __typeof(strcoll_l) __strcoll_l; ++extern "C" __typeof(strftime_l) __strftime_l; ++extern "C" __typeof(strtod_l) __strtod_l; ++extern "C" __typeof(strtof_l) __strtof_l; ++extern "C" __typeof(strtold_l) __strtold_l; ++extern "C" __typeof(strxfrm_l) __strxfrm_l; ++extern "C" __typeof(newlocale) __newlocale; ++extern "C" __typeof(freelocale) __freelocale; ++extern "C" __typeof(duplocale) __duplocale; ++extern "C" __typeof(uselocale) __uselocale; ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++extern "C" __typeof(iswctype_l) __iswctype_l; ++extern "C" __typeof(towlower_l) __towlower_l; ++extern "C" __typeof(towupper_l) __towupper_l; ++extern "C" __typeof(wcscoll_l) __wcscoll_l; ++extern "C" __typeof(wcsftime_l) __wcsftime_l; ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; ++extern "C" __typeof(wctype_l) __wctype_l; ++#endif ++ ++#endif // GLIBC 2.3 and later +diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc +new file mode 100644 +index 0000000..5081dc1 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc +@@ -0,0 +1,160 @@ ++// Wrapper for underlying C-language localization -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.8 Standard locale categories. ++// ++ ++// Written by Benjamin Kosnik ++ ++#include // For errno ++#include ++#include ++#include ++#include ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) ++#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) ++#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) ++#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) ++#define __strtof_l(S, E, L) strtof((S), (E)) ++#define __strtod_l(S, E, L) strtod((S), (E)) ++#define __strtold_l(S, E, L) strtold((S), (E)) ++#warning should dummy __newlocale check for C|POSIX ? ++#define __newlocale(a, b, c) NULL ++#define __freelocale(a) ((void)0) ++#define __duplocale(a) __c_locale() ++#endif ++ ++namespace std ++{ ++ template<> ++ void ++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, ++ const __c_locale& __cloc) ++ { ++ if (!(__err & ios_base::failbit)) ++ { ++ char* __sanity; ++ errno = 0; ++ float __f = __strtof_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __f; ++ else ++ __err |= ios_base::failbit; ++ } ++ } ++ ++ template<> ++ void ++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, ++ const __c_locale& __cloc) ++ { ++ if (!(__err & ios_base::failbit)) ++ { ++ char* __sanity; ++ errno = 0; ++ double __d = __strtod_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __d; ++ else ++ __err |= ios_base::failbit; ++ } ++ } ++ ++ template<> ++ void ++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, ++ const __c_locale& __cloc) ++ { ++ if (!(__err & ios_base::failbit)) ++ { ++ char* __sanity; ++ errno = 0; ++ long double __ld = __strtold_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __ld; ++ else ++ __err |= ios_base::failbit; ++ } ++ } ++ ++ void ++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, ++ __c_locale __old) ++ { ++ __cloc = __newlocale(1 << LC_ALL, __s, __old); ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ if (!__cloc) ++ { ++ // This named locale is not supported by the underlying OS. ++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale " ++ "name not valid")); ++ } ++#endif ++ } ++ ++ void ++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc) ++ { ++ if (_S_get_c_locale() != __cloc) ++ __freelocale(__cloc); ++ } ++ ++ __c_locale ++ locale::facet::_S_clone_c_locale(__c_locale& __cloc) ++ { return __duplocale(__cloc); } ++} // namespace std ++ ++namespace __gnu_cxx ++{ ++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = ++ { ++ "LC_CTYPE", ++ "LC_NUMERIC", ++ "LC_TIME", ++ "LC_COLLATE", ++ "LC_MONETARY", ++ "LC_MESSAGES", ++#if _GLIBCXX_NUM_CATEGORIES != 0 ++ "LC_PAPER", ++ "LC_NAME", ++ "LC_ADDRESS", ++ "LC_TELEPHONE", ++ "LC_MEASUREMENT", ++ "LC_IDENTIFICATION" ++#endif ++ }; ++} ++ ++namespace std ++{ ++ const char* const* const locale::_S_categories = __gnu_cxx::category_names; ++} // namespace std +diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h +new file mode 100644 +index 0000000..da07c1f +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h +@@ -0,0 +1,117 @@ ++// Wrapper for underlying C-language localization -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.8 Standard locale categories. ++// ++ ++// Written by Benjamin Kosnik ++ ++#ifndef _C_LOCALE_H ++#define _C_LOCALE_H 1 ++ ++#pragma GCC system_header ++ ++#include // get std::strlen ++#include // get std::snprintf or std::sprintf ++#include ++#include // For codecvt ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this ++#endif ++#ifdef __UCLIBC_HAS_LOCALE__ ++#include // For codecvt using iconv, iconv_t ++#endif ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++#include // For messages ++#endif ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning what is _GLIBCXX_C_LOCALE_GNU for ++#endif ++#define _GLIBCXX_C_LOCALE_GNU 1 ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix categories ++#endif ++// #define _GLIBCXX_NUM_CATEGORIES 6 ++#define _GLIBCXX_NUM_CATEGORIES 0 ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++namespace __gnu_cxx ++{ ++ extern "C" __typeof(uselocale) __uselocale; ++} ++#endif ++ ++namespace std ++{ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ typedef __locale_t __c_locale; ++#else ++ typedef int* __c_locale; ++#endif ++ ++ // Convert numeric value of type _Tv to string and return length of ++ // string. If snprintf is available use it, otherwise fall back to ++ // the unsafe sprintf which, in general, can be dangerous and should ++ // be avoided. ++ template ++ int ++ __convert_from_v(char* __out, ++ const int __size __attribute__ ((__unused__)), ++ const char* __fmt, ++#ifdef __UCLIBC_HAS_XCLOCALE__ ++ _Tv __v, const __c_locale& __cloc, int __prec) ++ { ++ __c_locale __old = __gnu_cxx::__uselocale(__cloc); ++#else ++ _Tv __v, const __c_locale&, int __prec) ++ { ++# ifdef __UCLIBC_HAS_LOCALE__ ++ char* __old = std::setlocale(LC_ALL, NULL); ++ char* __sav = new char[std::strlen(__old) + 1]; ++ std::strcpy(__sav, __old); ++ std::setlocale(LC_ALL, "C"); ++# endif ++#endif ++ ++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); ++ ++#ifdef __UCLIBC_HAS_XCLOCALE__ ++ __gnu_cxx::__uselocale(__old); ++#elif defined __UCLIBC_HAS_LOCALE__ ++ std::setlocale(LC_ALL, __sav); ++ delete [] __sav; ++#endif ++ return __ret; ++ } ++} ++ ++#endif +diff --git a/libstdc++-v3/config/locale/uclibc/codecvt_members.cc b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc +new file mode 100644 +index 0000000..64aa962 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc +@@ -0,0 +1,308 @@ ++// std::codecvt implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include // For MB_CUR_MAX ++#include // For MB_LEN_MAX ++#include ++ ++namespace std ++{ ++ // Specializations. ++#ifdef _GLIBCXX_USE_WCHAR_T ++ codecvt_base::result ++ codecvt:: ++ do_out(state_type& __state, const intern_type* __from, ++ const intern_type* __from_end, const intern_type*& __from_next, ++ extern_type* __to, extern_type* __to_end, ++ extern_type*& __to_next) const ++ { ++ result __ret = ok; ++ state_type __tmp_state(__state); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ ++ // wcsnrtombs is *very* fast but stops if encounters NUL characters: ++ // in case we fall back to wcrtomb and then continue, in a loop. ++ // NB: wcsnrtombs is a GNU extension ++ for (__from_next = __from, __to_next = __to; ++ __from_next < __from_end && __to_next < __to_end ++ && __ret == ok;) ++ { ++ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0', ++ __from_end - __from_next); ++ if (!__from_chunk_end) ++ __from_chunk_end = __from_end; ++ ++ __from = __from_next; ++ const size_t __conv = wcsnrtombs(__to_next, &__from_next, ++ __from_chunk_end - __from_next, ++ __to_end - __to_next, &__state); ++ if (__conv == static_cast(-1)) ++ { ++ // In case of error, in order to stop at the exact place we ++ // have to start again from the beginning with a series of ++ // wcrtomb. ++ for (; __from < __from_next; ++__from) ++ __to_next += wcrtomb(__to_next, *__from, &__tmp_state); ++ __state = __tmp_state; ++ __ret = error; ++ } ++ else if (__from_next && __from_next < __from_chunk_end) ++ { ++ __to_next += __conv; ++ __ret = partial; ++ } ++ else ++ { ++ __from_next = __from_chunk_end; ++ __to_next += __conv; ++ } ++ ++ if (__from_next < __from_end && __ret == ok) ++ { ++ extern_type __buf[MB_LEN_MAX]; ++ __tmp_state = __state; ++ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state); ++ if (__conv > static_cast(__to_end - __to_next)) ++ __ret = partial; ++ else ++ { ++ memcpy(__to_next, __buf, __conv); ++ __state = __tmp_state; ++ __to_next += __conv; ++ ++__from_next; ++ } ++ } ++ } ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ ++ return __ret; ++ } ++ ++ codecvt_base::result ++ codecvt:: ++ do_in(state_type& __state, const extern_type* __from, ++ const extern_type* __from_end, const extern_type*& __from_next, ++ intern_type* __to, intern_type* __to_end, ++ intern_type*& __to_next) const ++ { ++ result __ret = ok; ++ state_type __tmp_state(__state); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ ++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: ++ // in case we store a L'\0' and then continue, in a loop. ++ // NB: mbsnrtowcs is a GNU extension ++ for (__from_next = __from, __to_next = __to; ++ __from_next < __from_end && __to_next < __to_end ++ && __ret == ok;) ++ { ++ const extern_type* __from_chunk_end; ++ __from_chunk_end = static_cast(memchr(__from_next, '\0', ++ __from_end ++ - __from_next)); ++ if (!__from_chunk_end) ++ __from_chunk_end = __from_end; ++ ++ __from = __from_next; ++ size_t __conv = mbsnrtowcs(__to_next, &__from_next, ++ __from_chunk_end - __from_next, ++ __to_end - __to_next, &__state); ++ if (__conv == static_cast(-1)) ++ { ++ // In case of error, in order to stop at the exact place we ++ // have to start again from the beginning with a series of ++ // mbrtowc. ++ for (;; ++__to_next, __from += __conv) ++ { ++ __conv = mbrtowc(__to_next, __from, __from_end - __from, ++ &__tmp_state); ++ if (__conv == static_cast(-1) ++ || __conv == static_cast(-2)) ++ break; ++ } ++ __from_next = __from; ++ __state = __tmp_state; ++ __ret = error; ++ } ++ else if (__from_next && __from_next < __from_chunk_end) ++ { ++ // It is unclear what to return in this case (see DR 382). ++ __to_next += __conv; ++ __ret = partial; ++ } ++ else ++ { ++ __from_next = __from_chunk_end; ++ __to_next += __conv; ++ } ++ ++ if (__from_next < __from_end && __ret == ok) ++ { ++ if (__to_next < __to_end) ++ { ++ // XXX Probably wrong for stateful encodings ++ __tmp_state = __state; ++ ++__from_next; ++ *__to_next++ = L'\0'; ++ } ++ else ++ __ret = partial; ++ } ++ } ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ ++ return __ret; ++ } ++ ++ int ++ codecvt:: ++ do_encoding() const throw() ++ { ++ // XXX This implementation assumes that the encoding is ++ // stateless and is either single-byte or variable-width. ++ int __ret = 0; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ if (MB_CUR_MAX == 1) ++ __ret = 1; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return __ret; ++ } ++ ++ int ++ codecvt:: ++ do_max_length() const throw() ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ // XXX Probably wrong for stateful encodings. ++ int __ret = MB_CUR_MAX; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return __ret; ++ } ++ ++ int ++ codecvt:: ++ do_length(state_type& __state, const extern_type* __from, ++ const extern_type* __end, size_t __max) const ++ { ++ int __ret = 0; ++ state_type __tmp_state(__state); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ ++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: ++ // in case we advance past it and then continue, in a loop. ++ // NB: mbsnrtowcs is a GNU extension ++ ++ // A dummy internal buffer is needed in order for mbsnrtocws to consider ++ // its fourth parameter (it wouldn't with NULL as first parameter). ++ wchar_t* __to = static_cast(__builtin_alloca(sizeof(wchar_t) ++ * __max)); ++ while (__from < __end && __max) ++ { ++ const extern_type* __from_chunk_end; ++ __from_chunk_end = static_cast(memchr(__from, '\0', ++ __end ++ - __from)); ++ if (!__from_chunk_end) ++ __from_chunk_end = __end; ++ ++ const extern_type* __tmp_from = __from; ++ size_t __conv = mbsnrtowcs(__to, &__from, ++ __from_chunk_end - __from, ++ __max, &__state); ++ if (__conv == static_cast(-1)) ++ { ++ // In case of error, in order to stop at the exact place we ++ // have to start again from the beginning with a series of ++ // mbrtowc. ++ for (__from = __tmp_from;; __from += __conv) ++ { ++ __conv = mbrtowc(NULL, __from, __end - __from, ++ &__tmp_state); ++ if (__conv == static_cast(-1) ++ || __conv == static_cast(-2)) ++ break; ++ } ++ __state = __tmp_state; ++ __ret += __from - __tmp_from; ++ break; ++ } ++ if (!__from) ++ __from = __from_chunk_end; ++ ++ __ret += __from - __tmp_from; ++ __max -= __conv; ++ ++ if (__from < __end && __max) ++ { ++ // XXX Probably wrong for stateful encodings ++ __tmp_state = __state; ++ ++__from; ++ ++__ret; ++ --__max; ++ } ++ } ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ ++ return __ret; ++ } ++#endif ++} +diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc +new file mode 100644 +index 0000000..c2664a7 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc +@@ -0,0 +1,80 @@ ++// std::collate implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) ++#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) ++#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) ++#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) ++#endif ++ ++namespace std ++{ ++ // These are basically extensions to char_traits, and perhaps should ++ // be put there instead of here. ++ template<> ++ int ++ collate::_M_compare(const char* __one, const char* __two) const ++ { ++ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate); ++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); ++ } ++ ++ template<> ++ size_t ++ collate::_M_transform(char* __to, const char* __from, ++ size_t __n) const ++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ int ++ collate::_M_compare(const wchar_t* __one, ++ const wchar_t* __two) const ++ { ++ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate); ++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); ++ } ++ ++ template<> ++ size_t ++ collate::_M_transform(wchar_t* __to, const wchar_t* __from, ++ size_t __n) const ++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); } ++#endif ++} +diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc +new file mode 100644 +index 0000000..7294e3a +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc +@@ -0,0 +1,300 @@ ++// std::ctype implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions. ++// ++ ++// Written by Benjamin Kosnik ++ ++#define _LIBC ++#include ++#undef _LIBC ++#include ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __wctype_l(S, L) wctype((S)) ++#define __towupper_l(C, L) towupper((C)) ++#define __towlower_l(C, L) towlower((C)) ++#define __iswctype_l(C, M, L) iswctype((C), (M)) ++#endif ++ ++namespace std ++{ ++ // NB: The other ctype specializations are in src/locale.cc and ++ // various /config/os/* files. ++ template<> ++ ctype_byname::ctype_byname(const char* __s, size_t __refs) ++ : ctype(0, false, __refs) ++ { ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) ++ { ++ this->_S_destroy_c_locale(this->_M_c_locale_ctype); ++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s); ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper; ++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower; ++ this->_M_table = this->_M_c_locale_ctype->__ctype_b; ++#endif ++ } ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ ctype::__wmask_type ++ ctype::_M_convert_to_wmask(const mask __m) const ++ { ++ __wmask_type __ret; ++ switch (__m) ++ { ++ case space: ++ __ret = __wctype_l("space", _M_c_locale_ctype); ++ break; ++ case print: ++ __ret = __wctype_l("print", _M_c_locale_ctype); ++ break; ++ case cntrl: ++ __ret = __wctype_l("cntrl", _M_c_locale_ctype); ++ break; ++ case upper: ++ __ret = __wctype_l("upper", _M_c_locale_ctype); ++ break; ++ case lower: ++ __ret = __wctype_l("lower", _M_c_locale_ctype); ++ break; ++ case alpha: ++ __ret = __wctype_l("alpha", _M_c_locale_ctype); ++ break; ++ case digit: ++ __ret = __wctype_l("digit", _M_c_locale_ctype); ++ break; ++ case punct: ++ __ret = __wctype_l("punct", _M_c_locale_ctype); ++ break; ++ case xdigit: ++ __ret = __wctype_l("xdigit", _M_c_locale_ctype); ++ break; ++ case alnum: ++ __ret = __wctype_l("alnum", _M_c_locale_ctype); ++ break; ++ case graph: ++ __ret = __wctype_l("graph", _M_c_locale_ctype); ++ break; ++ default: ++ __ret = __wmask_type(); ++ } ++ return __ret; ++ } ++ ++ wchar_t ++ ctype::do_toupper(wchar_t __c) const ++ { return __towupper_l(__c, _M_c_locale_ctype); } ++ ++ const wchar_t* ++ ctype::do_toupper(wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi) ++ { ++ *__lo = __towupper_l(*__lo, _M_c_locale_ctype); ++ ++__lo; ++ } ++ return __hi; ++ } ++ ++ wchar_t ++ ctype::do_tolower(wchar_t __c) const ++ { return __towlower_l(__c, _M_c_locale_ctype); } ++ ++ const wchar_t* ++ ctype::do_tolower(wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi) ++ { ++ *__lo = __towlower_l(*__lo, _M_c_locale_ctype); ++ ++__lo; ++ } ++ return __hi; ++ } ++ ++ bool ++ ctype:: ++ do_is(mask __m, wchar_t __c) const ++ { ++ // Highest bitmask in ctype_base == 10, but extra in "C" ++ // library for blank. ++ bool __ret = false; ++ const size_t __bitmasksize = 11; ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) ++ if (__m & _M_bit[__bitcur] ++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) ++ { ++ __ret = true; ++ break; ++ } ++ return __ret; ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const ++ { ++ for (; __lo < __hi; ++__vec, ++__lo) ++ { ++ // Highest bitmask in ctype_base == 10, but extra in "C" ++ // library for blank. ++ const size_t __bitmasksize = 11; ++ mask __m = 0; ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) ++ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype)) ++ __m |= _M_bit[__bitcur]; ++ *__vec = __m; ++ } ++ return __hi; ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi && !this->do_is(__m, *__lo)) ++ ++__lo; ++ return __lo; ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const ++ { ++ while (__lo < __hi && this->do_is(__m, *__lo) != 0) ++ ++__lo; ++ return __lo; ++ } ++ ++ wchar_t ++ ctype:: ++ do_widen(char __c) const ++ { return _M_widen[static_cast(__c)]; } ++ ++ const char* ++ ctype:: ++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const ++ { ++ while (__lo < __hi) ++ { ++ *__dest = _M_widen[static_cast(*__lo)]; ++ ++__lo; ++ ++__dest; ++ } ++ return __hi; ++ } ++ ++ char ++ ctype:: ++ do_narrow(wchar_t __wc, char __dfault) const ++ { ++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok) ++ return _M_narrow[__wc]; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_ctype); ++#endif ++ const int __c = wctob(__wc); ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return (__c == EOF ? __dfault : static_cast(__c)); ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, ++ char* __dest) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_ctype); ++#endif ++ if (_M_narrow_ok) ++ while (__lo < __hi) ++ { ++ if (*__lo >= 0 && *__lo < 128) ++ *__dest = _M_narrow[*__lo]; ++ else ++ { ++ const int __c = wctob(*__lo); ++ *__dest = (__c == EOF ? __dfault : static_cast(__c)); ++ } ++ ++__lo; ++ ++__dest; ++ } ++ else ++ while (__lo < __hi) ++ { ++ const int __c = wctob(*__lo); ++ *__dest = (__c == EOF ? __dfault : static_cast(__c)); ++ ++__lo; ++ ++__dest; ++ } ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return __hi; ++ } ++ ++ void ++ ctype::_M_initialize_ctype() ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_ctype); ++#endif ++ wint_t __i; ++ for (__i = 0; __i < 128; ++__i) ++ { ++ const int __c = wctob(__i); ++ if (__c == EOF) ++ break; ++ else ++ _M_narrow[__i] = static_cast(__c); ++ } ++ if (__i == 128) ++ _M_narrow_ok = true; ++ else ++ _M_narrow_ok = false; ++ for (size_t __j = 0; ++ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j) ++ _M_widen[__j] = btowc(__j); ++ ++ for (size_t __k = 0; __k <= 11; ++__k) ++ { ++ _M_bit[__k] = static_cast(_ISbit(__k)); ++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]); ++ } ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ } ++#endif // _GLIBCXX_USE_WCHAR_T ++} +diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc +new file mode 100644 +index 0000000..13594d9 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc +@@ -0,0 +1,100 @@ ++// std::messages implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix gettext stuff ++#endif ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++extern "C" char *__dcgettext(const char *domainname, ++ const char *msgid, int category); ++#undef gettext ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) ++#else ++#undef gettext ++#define gettext(msgid) (msgid) ++#endif ++ ++namespace std ++{ ++ // Specializations. ++ template<> ++ string ++ messages::do_get(catalog, int, int, const string& __dfault) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_messages); ++ const char* __msg = const_cast(gettext(__dfault.c_str())); ++ __uselocale(__old); ++ return string(__msg); ++#elif defined __UCLIBC_HAS_LOCALE__ ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_messages); ++ const char* __msg = gettext(__dfault.c_str()); ++ setlocale(LC_ALL, __old); ++ free(__old); ++ return string(__msg); ++#else ++ const char* __msg = gettext(__dfault.c_str()); ++ return string(__msg); ++#endif ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ wstring ++ messages::do_get(catalog, int, int, const wstring& __dfault) const ++ { ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_messages); ++ char* __msg = gettext(_M_convert_to_char(__dfault)); ++ __uselocale(__old); ++ return _M_convert_from_char(__msg); ++# elif defined __UCLIBC_HAS_LOCALE__ ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_messages); ++ char* __msg = gettext(_M_convert_to_char(__dfault)); ++ setlocale(LC_ALL, __old); ++ free(__old); ++ return _M_convert_from_char(__msg); ++# else ++ char* __msg = gettext(_M_convert_to_char(__dfault)); ++ return _M_convert_from_char(__msg); ++# endif ++ } ++#endif ++} +diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h +new file mode 100644 +index 0000000..1424078 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h +@@ -0,0 +1,118 @@ ++// std::messages implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.7.1.2 messages functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix prototypes for *textdomain funcs ++#endif ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++extern "C" char *__textdomain(const char *domainname); ++extern "C" char *__bindtextdomain(const char *domainname, ++ const char *dirname); ++#else ++#undef __textdomain ++#undef __bindtextdomain ++#define __textdomain(D) ((void)0) ++#define __bindtextdomain(D,P) ((void)0) ++#endif ++ ++ // Non-virtual member functions. ++ template ++ messages<_CharT>::messages(size_t __refs) ++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), ++ _M_name_messages(_S_get_c_name()) ++ { } ++ ++ template ++ messages<_CharT>::messages(__c_locale __cloc, const char* __s, ++ size_t __refs) ++ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), ++ _M_name_messages(__s) ++ { ++ char* __tmp = new char[std::strlen(__s) + 1]; ++ std::strcpy(__tmp, __s); ++ _M_name_messages = __tmp; ++ } ++ ++ template ++ typename messages<_CharT>::catalog ++ messages<_CharT>::open(const basic_string& __s, const locale& __loc, ++ const char* __dir) const ++ { ++ __bindtextdomain(__s.c_str(), __dir); ++ return this->do_open(__s, __loc); ++ } ++ ++ // Virtual member functions. ++ template ++ messages<_CharT>::~messages() ++ { ++ if (_M_name_messages != _S_get_c_name()) ++ delete [] _M_name_messages; ++ _S_destroy_c_locale(_M_c_locale_messages); ++ } ++ ++ template ++ typename messages<_CharT>::catalog ++ messages<_CharT>::do_open(const basic_string& __s, ++ const locale&) const ++ { ++ // No error checking is done, assume the catalog exists and can ++ // be used. ++ __textdomain(__s.c_str()); ++ return 0; ++ } ++ ++ template ++ void ++ messages<_CharT>::do_close(catalog) const ++ { } ++ ++ // messages_byname ++ template ++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) ++ : messages<_CharT>(__refs) ++ { ++ if (this->_M_name_messages != locale::facet::_S_get_c_name()) ++ delete [] this->_M_name_messages; ++ char* __tmp = new char[std::strlen(__s) + 1]; ++ std::strcpy(__tmp, __s); ++ this->_M_name_messages = __tmp; ++ ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) ++ { ++ this->_S_destroy_c_locale(this->_M_c_locale_messages); ++ this->_S_create_c_locale(this->_M_c_locale_messages, __s); ++ } ++ } +diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +new file mode 100644 +index 0000000..aa52731 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +@@ -0,0 +1,692 @@ ++// std::moneypunct implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#define _LIBC ++#include ++#undef _LIBC ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning optimize this for uclibc ++#warning tailor for stub locale support ++#endif ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __nl_langinfo_l(N, L) nl_langinfo((N)) ++#endif ++ ++namespace std ++{ ++ // Construct and return valid pattern consisting of some combination of: ++ // space none symbol sign value ++ money_base::pattern ++ money_base::_S_construct_pattern(char __precedes, char __space, char __posn) ++ { ++ pattern __ret; ++ ++ // This insanely complicated routine attempts to construct a valid ++ // pattern for use with monyepunct. A couple of invariants: ++ ++ // if (__precedes) symbol -> value ++ // else value -> symbol ++ ++ // if (__space) space ++ // else none ++ ++ // none == never first ++ // space never first or last ++ ++ // Any elegant implementations of this are welcome. ++ switch (__posn) ++ { ++ case 0: ++ case 1: ++ // 1 The sign precedes the value and symbol. ++ __ret.field[0] = sign; ++ if (__space) ++ { ++ // Pattern starts with sign. ++ if (__precedes) ++ { ++ __ret.field[1] = symbol; ++ __ret.field[3] = value; ++ } ++ else ++ { ++ __ret.field[1] = value; ++ __ret.field[3] = symbol; ++ } ++ __ret.field[2] = space; ++ } ++ else ++ { ++ // Pattern starts with sign and ends with none. ++ if (__precedes) ++ { ++ __ret.field[1] = symbol; ++ __ret.field[2] = value; ++ } ++ else ++ { ++ __ret.field[1] = value; ++ __ret.field[2] = symbol; ++ } ++ __ret.field[3] = none; ++ } ++ break; ++ case 2: ++ // 2 The sign follows the value and symbol. ++ if (__space) ++ { ++ // Pattern either ends with sign. ++ if (__precedes) ++ { ++ __ret.field[0] = symbol; ++ __ret.field[2] = value; ++ } ++ else ++ { ++ __ret.field[0] = value; ++ __ret.field[2] = symbol; ++ } ++ __ret.field[1] = space; ++ __ret.field[3] = sign; ++ } ++ else ++ { ++ // Pattern ends with sign then none. ++ if (__precedes) ++ { ++ __ret.field[0] = symbol; ++ __ret.field[1] = value; ++ } ++ else ++ { ++ __ret.field[0] = value; ++ __ret.field[1] = symbol; ++ } ++ __ret.field[2] = sign; ++ __ret.field[3] = none; ++ } ++ break; ++ case 3: ++ // 3 The sign immediately precedes the symbol. ++ if (__precedes) ++ { ++ __ret.field[0] = sign; ++ __ret.field[1] = symbol; ++ if (__space) ++ { ++ __ret.field[2] = space; ++ __ret.field[3] = value; ++ } ++ else ++ { ++ __ret.field[2] = value; ++ __ret.field[3] = none; ++ } ++ } ++ else ++ { ++ __ret.field[0] = value; ++ if (__space) ++ { ++ __ret.field[1] = space; ++ __ret.field[2] = sign; ++ __ret.field[3] = symbol; ++ } ++ else ++ { ++ __ret.field[1] = sign; ++ __ret.field[2] = symbol; ++ __ret.field[3] = none; ++ } ++ } ++ break; ++ case 4: ++ // 4 The sign immediately follows the symbol. ++ if (__precedes) ++ { ++ __ret.field[0] = symbol; ++ __ret.field[1] = sign; ++ if (__space) ++ { ++ __ret.field[2] = space; ++ __ret.field[3] = value; ++ } ++ else ++ { ++ __ret.field[2] = value; ++ __ret.field[3] = none; ++ } ++ } ++ else ++ { ++ __ret.field[0] = value; ++ if (__space) ++ { ++ __ret.field[1] = space; ++ __ret.field[2] = symbol; ++ __ret.field[3] = sign; ++ } ++ else ++ { ++ __ret.field[1] = symbol; ++ __ret.field[2] = sign; ++ __ret.field[3] = none; ++ } ++ } ++ break; ++ default: ++ ; ++ } ++ return __ret; ++ } ++ ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++ const char*) ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = '.'; ++ _M_data->_M_thousands_sep = ','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = ""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = ""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = ""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; ++ } ++ else ++ { ++ // Named locale. ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, ++ __cloc)); ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, ++ __cloc)); ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); ++ ++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); ++ if (!__nposn) ++ _M_data->_M_negative_sign = "()"; ++ else ++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, ++ __cloc); ++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); ++ ++ // _Intl == true ++ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); ++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, ++ __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ } ++ } ++ ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++ const char*) ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = '.'; ++ _M_data->_M_thousands_sep = ','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = ""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = ""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = ""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; ++ } ++ else ++ { ++ // Named locale. ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, ++ __cloc)); ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, ++ __cloc)); ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); ++ ++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); ++ if (!__nposn) ++ _M_data->_M_negative_sign = "()"; ++ else ++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, ++ __cloc); ++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); ++ ++ // _Intl == false ++ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); ++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ } ++ } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { delete _M_data; } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { delete _M_data; } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ const char*) ++#else ++ const char* __name) ++#endif ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = L'.'; ++ _M_data->_M_thousands_sep = L','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ // Use ctype::widen code without the facet... ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = ++ static_cast(money_base::_S_atoms[__i]); ++ } ++ else ++ { ++ // Named locale. ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(__cloc); ++#else ++ // Switch to named locale so that mbsrtowcs will work. ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, __name); ++#endif ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this... should be monetary ++#endif ++#ifdef __UCLIBC__ ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc; ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; ++# else ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; ++# endif ++#else ++ union { char *__s; wchar_t __w; } __u; ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); ++ _M_data->_M_decimal_point = __u.__w; ++ ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); ++ _M_data->_M_thousands_sep = __u.__w; ++#endif ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ ++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); ++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); ++ ++ wchar_t* __wcs_ps = 0; ++ wchar_t* __wcs_ns = 0; ++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); ++ try ++ { ++ mbstate_t __state; ++ size_t __len = strlen(__cpossign); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ps = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); ++ _M_data->_M_positive_sign = __wcs_ps; ++ } ++ else ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); ++ ++ __len = strlen(__cnegsign); ++ if (!__nposn) ++ _M_data->_M_negative_sign = L"()"; ++ else if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ns = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); ++ _M_data->_M_negative_sign = __wcs_ns; ++ } ++ else ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); ++ ++ // _Intl == true. ++ __len = strlen(__ccurr); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ wchar_t* __wcs = new wchar_t[__len]; ++ mbsrtowcs(__wcs, &__ccurr, __len, &__state); ++ _M_data->_M_curr_symbol = __wcs; ++ } ++ else ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); ++ } ++ catch (...) ++ { ++ delete _M_data; ++ _M_data = 0; ++ delete __wcs_ps; ++ delete __wcs_ns; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ __throw_exception_again; ++ } ++ ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, ++ __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ } ++ } ++ ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ const char*) ++#else ++ const char* __name) ++#endif ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = L'.'; ++ _M_data->_M_thousands_sep = L','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ // Use ctype::widen code without the facet... ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = ++ static_cast(money_base::_S_atoms[__i]); ++ } ++ else ++ { ++ // Named locale. ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(__cloc); ++#else ++ // Switch to named locale so that mbsrtowcs will work. ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, __name); ++#endif ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this... should be monetary ++#endif ++#ifdef __UCLIBC__ ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc; ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; ++# else ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; ++# endif ++#else ++ union { char *__s; wchar_t __w; } __u; ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); ++ _M_data->_M_decimal_point = __u.__w; ++ ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); ++ _M_data->_M_thousands_sep = __u.__w; ++#endif ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ ++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); ++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); ++ ++ wchar_t* __wcs_ps = 0; ++ wchar_t* __wcs_ns = 0; ++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); ++ try ++ { ++ mbstate_t __state; ++ size_t __len; ++ __len = strlen(__cpossign); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ps = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); ++ _M_data->_M_positive_sign = __wcs_ps; ++ } ++ else ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); ++ ++ __len = strlen(__cnegsign); ++ if (!__nposn) ++ _M_data->_M_negative_sign = L"()"; ++ else if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ns = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); ++ _M_data->_M_negative_sign = __wcs_ns; ++ } ++ else ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); ++ ++ // _Intl == true. ++ __len = strlen(__ccurr); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ wchar_t* __wcs = new wchar_t[__len]; ++ mbsrtowcs(__wcs, &__ccurr, __len, &__state); ++ _M_data->_M_curr_symbol = __wcs; ++ } ++ else ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); ++ } ++ catch (...) ++ { ++ delete _M_data; ++ _M_data = 0; ++ delete __wcs_ps; ++ delete __wcs_ns; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ __throw_exception_again; ++ } ++ ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ } ++ } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { ++ if (_M_data->_M_positive_sign_size) ++ delete [] _M_data->_M_positive_sign; ++ if (_M_data->_M_negative_sign_size ++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) ++ delete [] _M_data->_M_negative_sign; ++ if (_M_data->_M_curr_symbol_size) ++ delete [] _M_data->_M_curr_symbol; ++ delete _M_data; ++ } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { ++ if (_M_data->_M_positive_sign_size) ++ delete [] _M_data->_M_positive_sign; ++ if (_M_data->_M_negative_sign_size ++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) ++ delete [] _M_data->_M_negative_sign; ++ if (_M_data->_M_curr_symbol_size) ++ delete [] _M_data->_M_curr_symbol; ++ delete _M_data; ++ } ++#endif ++} +diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +new file mode 100644 +index 0000000..883ec1a +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +@@ -0,0 +1,160 @@ ++// std::numpunct implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#define _LIBC ++#include ++#undef _LIBC ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning tailor for stub locale support ++#endif ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __nl_langinfo_l(N, L) nl_langinfo((N)) ++#endif ++ ++namespace std ++{ ++ template<> ++ void ++ numpunct::_M_initialize_numpunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __numpunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_use_grouping = false; ++ ++ _M_data->_M_decimal_point = '.'; ++ _M_data->_M_thousands_sep = ','; ++ ++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) ++ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i]; ++ ++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) ++ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j]; ++ } ++ else ++ { ++ // Named locale. ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, ++ __cloc)); ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, ++ __cloc)); ++ ++ // Check for NULL, which implies no grouping. ++ if (_M_data->_M_thousands_sep == '\0') ++ _M_data->_M_grouping = ""; ++ else ++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ } ++ ++ // NB: There is no way to extact this info from posix locales. ++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); ++ _M_data->_M_truename = "true"; ++ _M_data->_M_truename_size = 4; ++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); ++ _M_data->_M_falsename = "false"; ++ _M_data->_M_falsename_size = 5; ++ } ++ ++ template<> ++ numpunct::~numpunct() ++ { delete _M_data; } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ void ++ numpunct::_M_initialize_numpunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __numpunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_use_grouping = false; ++ ++ _M_data->_M_decimal_point = L'.'; ++ _M_data->_M_thousands_sep = L','; ++ ++ // Use ctype::widen code without the facet... ++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) ++ _M_data->_M_atoms_out[__i] = ++ static_cast(__num_base::_S_atoms_out[__i]); ++ ++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) ++ _M_data->_M_atoms_in[__j] = ++ static_cast(__num_base::_S_atoms_in[__j]); ++ } ++ else ++ { ++ // Named locale. ++ // NB: In the GNU model wchar_t is always 32 bit wide. ++ union { char *__s; wchar_t __w; } __u; ++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); ++ _M_data->_M_decimal_point = __u.__w; ++ ++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); ++ _M_data->_M_thousands_sep = __u.__w; ++ ++ if (_M_data->_M_thousands_sep == L'\0') ++ _M_data->_M_grouping = ""; ++ else ++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ } ++ ++ // NB: There is no way to extact this info from posix locales. ++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); ++ _M_data->_M_truename = L"true"; ++ _M_data->_M_truename_size = 4; ++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); ++ _M_data->_M_falsename = L"false"; ++ _M_data->_M_falsename_size = 5; ++ } ++ ++ template<> ++ numpunct::~numpunct() ++ { delete _M_data; } ++ #endif ++} +diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc +new file mode 100644 +index 0000000..e0707d7 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc +@@ -0,0 +1,406 @@ ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning tailor for stub locale support ++#endif ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __nl_langinfo_l(N, L) nl_langinfo((N)) ++#endif ++ ++namespace std ++{ ++ template<> ++ void ++ __timepunct:: ++ _M_put(char* __s, size_t __maxlen, const char* __format, ++ const tm* __tm) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, ++ _M_c_locale_timepunct); ++#else ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_timepunct); ++ const size_t __len = strftime(__s, __maxlen, __format, __tm); ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ // Make sure __s is null terminated. ++ if (__len == 0) ++ __s[0] = '\0'; ++ } ++ ++ template<> ++ void ++ __timepunct::_M_initialize_timepunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __timepunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_c_locale_timepunct = _S_get_c_locale(); ++ ++ _M_data->_M_date_format = "%m/%d/%y"; ++ _M_data->_M_date_era_format = "%m/%d/%y"; ++ _M_data->_M_time_format = "%H:%M:%S"; ++ _M_data->_M_time_era_format = "%H:%M:%S"; ++ _M_data->_M_date_time_format = ""; ++ _M_data->_M_date_time_era_format = ""; ++ _M_data->_M_am = "AM"; ++ _M_data->_M_pm = "PM"; ++ _M_data->_M_am_pm_format = ""; ++ ++ // Day names, starting with "C"'s Sunday. ++ _M_data->_M_day1 = "Sunday"; ++ _M_data->_M_day2 = "Monday"; ++ _M_data->_M_day3 = "Tuesday"; ++ _M_data->_M_day4 = "Wednesday"; ++ _M_data->_M_day5 = "Thursday"; ++ _M_data->_M_day6 = "Friday"; ++ _M_data->_M_day7 = "Saturday"; ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ _M_data->_M_aday1 = "Sun"; ++ _M_data->_M_aday2 = "Mon"; ++ _M_data->_M_aday3 = "Tue"; ++ _M_data->_M_aday4 = "Wed"; ++ _M_data->_M_aday5 = "Thu"; ++ _M_data->_M_aday6 = "Fri"; ++ _M_data->_M_aday7 = "Sat"; ++ ++ // Month names, starting with "C"'s January. ++ _M_data->_M_month01 = "January"; ++ _M_data->_M_month02 = "February"; ++ _M_data->_M_month03 = "March"; ++ _M_data->_M_month04 = "April"; ++ _M_data->_M_month05 = "May"; ++ _M_data->_M_month06 = "June"; ++ _M_data->_M_month07 = "July"; ++ _M_data->_M_month08 = "August"; ++ _M_data->_M_month09 = "September"; ++ _M_data->_M_month10 = "October"; ++ _M_data->_M_month11 = "November"; ++ _M_data->_M_month12 = "December"; ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ _M_data->_M_amonth01 = "Jan"; ++ _M_data->_M_amonth02 = "Feb"; ++ _M_data->_M_amonth03 = "Mar"; ++ _M_data->_M_amonth04 = "Apr"; ++ _M_data->_M_amonth05 = "May"; ++ _M_data->_M_amonth06 = "Jun"; ++ _M_data->_M_amonth07 = "Jul"; ++ _M_data->_M_amonth08 = "Aug"; ++ _M_data->_M_amonth09 = "Sep"; ++ _M_data->_M_amonth10 = "Oct"; ++ _M_data->_M_amonth11 = "Nov"; ++ _M_data->_M_amonth12 = "Dec"; ++ } ++ else ++ { ++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); ++ ++ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc); ++ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc); ++ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc); ++ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc); ++ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc); ++ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, ++ __cloc); ++ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc); ++ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc); ++ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc); ++ ++ // Day names, starting with "C"'s Sunday. ++ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc); ++ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc); ++ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc); ++ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc); ++ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc); ++ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc); ++ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc); ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc); ++ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc); ++ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc); ++ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc); ++ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc); ++ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc); ++ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc); ++ ++ // Month names, starting with "C"'s January. ++ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc); ++ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc); ++ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc); ++ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc); ++ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc); ++ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc); ++ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc); ++ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc); ++ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc); ++ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc); ++ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc); ++ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc); ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc); ++ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc); ++ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc); ++ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc); ++ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc); ++ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc); ++ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc); ++ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc); ++ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc); ++ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc); ++ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc); ++ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc); ++ } ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ void ++ __timepunct:: ++ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, ++ const tm* __tm) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); ++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, ++ _M_c_locale_timepunct); ++#else ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_timepunct); ++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm); ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ // Make sure __s is null terminated. ++ if (__len == 0) ++ __s[0] = L'\0'; ++ } ++ ++ template<> ++ void ++ __timepunct::_M_initialize_timepunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __timepunct_cache; ++ ++#warning wide time stuff ++// if (!__cloc) ++ { ++ // "C" locale ++ _M_c_locale_timepunct = _S_get_c_locale(); ++ ++ _M_data->_M_date_format = L"%m/%d/%y"; ++ _M_data->_M_date_era_format = L"%m/%d/%y"; ++ _M_data->_M_time_format = L"%H:%M:%S"; ++ _M_data->_M_time_era_format = L"%H:%M:%S"; ++ _M_data->_M_date_time_format = L""; ++ _M_data->_M_date_time_era_format = L""; ++ _M_data->_M_am = L"AM"; ++ _M_data->_M_pm = L"PM"; ++ _M_data->_M_am_pm_format = L""; ++ ++ // Day names, starting with "C"'s Sunday. ++ _M_data->_M_day1 = L"Sunday"; ++ _M_data->_M_day2 = L"Monday"; ++ _M_data->_M_day3 = L"Tuesday"; ++ _M_data->_M_day4 = L"Wednesday"; ++ _M_data->_M_day5 = L"Thursday"; ++ _M_data->_M_day6 = L"Friday"; ++ _M_data->_M_day7 = L"Saturday"; ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ _M_data->_M_aday1 = L"Sun"; ++ _M_data->_M_aday2 = L"Mon"; ++ _M_data->_M_aday3 = L"Tue"; ++ _M_data->_M_aday4 = L"Wed"; ++ _M_data->_M_aday5 = L"Thu"; ++ _M_data->_M_aday6 = L"Fri"; ++ _M_data->_M_aday7 = L"Sat"; ++ ++ // Month names, starting with "C"'s January. ++ _M_data->_M_month01 = L"January"; ++ _M_data->_M_month02 = L"February"; ++ _M_data->_M_month03 = L"March"; ++ _M_data->_M_month04 = L"April"; ++ _M_data->_M_month05 = L"May"; ++ _M_data->_M_month06 = L"June"; ++ _M_data->_M_month07 = L"July"; ++ _M_data->_M_month08 = L"August"; ++ _M_data->_M_month09 = L"September"; ++ _M_data->_M_month10 = L"October"; ++ _M_data->_M_month11 = L"November"; ++ _M_data->_M_month12 = L"December"; ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ _M_data->_M_amonth01 = L"Jan"; ++ _M_data->_M_amonth02 = L"Feb"; ++ _M_data->_M_amonth03 = L"Mar"; ++ _M_data->_M_amonth04 = L"Apr"; ++ _M_data->_M_amonth05 = L"May"; ++ _M_data->_M_amonth06 = L"Jun"; ++ _M_data->_M_amonth07 = L"Jul"; ++ _M_data->_M_amonth08 = L"Aug"; ++ _M_data->_M_amonth09 = L"Sep"; ++ _M_data->_M_amonth10 = L"Oct"; ++ _M_data->_M_amonth11 = L"Nov"; ++ _M_data->_M_amonth12 = L"Dec"; ++ } ++#if 0 ++ else ++ { ++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); ++ ++ union { char *__s; wchar_t *__w; } __u; ++ ++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc); ++ _M_data->_M_date_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc); ++ _M_data->_M_date_era_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc); ++ _M_data->_M_time_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc); ++ _M_data->_M_time_era_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc); ++ _M_data->_M_date_time_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc); ++ _M_data->_M_date_time_era_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc); ++ _M_data->_M_am = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc); ++ _M_data->_M_pm = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc); ++ _M_data->_M_am_pm_format = __u.__w; ++ ++ // Day names, starting with "C"'s Sunday. ++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc); ++ _M_data->_M_day1 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc); ++ _M_data->_M_day2 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc); ++ _M_data->_M_day3 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc); ++ _M_data->_M_day4 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc); ++ _M_data->_M_day5 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc); ++ _M_data->_M_day6 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc); ++ _M_data->_M_day7 = __u.__w; ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc); ++ _M_data->_M_aday1 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc); ++ _M_data->_M_aday2 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc); ++ _M_data->_M_aday3 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc); ++ _M_data->_M_aday4 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc); ++ _M_data->_M_aday5 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc); ++ _M_data->_M_aday6 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc); ++ _M_data->_M_aday7 = __u.__w; ++ ++ // Month names, starting with "C"'s January. ++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc); ++ _M_data->_M_month01 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc); ++ _M_data->_M_month02 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc); ++ _M_data->_M_month03 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc); ++ _M_data->_M_month04 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc); ++ _M_data->_M_month05 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc); ++ _M_data->_M_month06 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc); ++ _M_data->_M_month07 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc); ++ _M_data->_M_month08 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc); ++ _M_data->_M_month09 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc); ++ _M_data->_M_month10 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc); ++ _M_data->_M_month11 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc); ++ _M_data->_M_month12 = __u.__w; ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc); ++ _M_data->_M_amonth01 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc); ++ _M_data->_M_amonth02 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc); ++ _M_data->_M_amonth03 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc); ++ _M_data->_M_amonth04 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc); ++ _M_data->_M_amonth05 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc); ++ _M_data->_M_amonth06 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc); ++ _M_data->_M_amonth07 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc); ++ _M_data->_M_amonth08 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc); ++ _M_data->_M_amonth09 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc); ++ _M_data->_M_amonth10 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc); ++ _M_data->_M_amonth11 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc); ++ _M_data->_M_amonth12 = __u.__w; ++ } ++#endif // 0 ++ } ++#endif ++} +diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h +new file mode 100644 +index 0000000..ba8e858 +--- /dev/null ++++ b/libstdc++-v3/config/locale/uclibc/time_members.h +@@ -0,0 +1,68 @@ ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library 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 library 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 library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions ++// ++ ++// Written by Benjamin Kosnik ++ ++ template ++ __timepunct<_CharT>::__timepunct(size_t __refs) ++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), ++ _M_name_timepunct(_S_get_c_name()) ++ { _M_initialize_timepunct(); } ++ ++ template ++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) ++ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), ++ _M_name_timepunct(_S_get_c_name()) ++ { _M_initialize_timepunct(); } ++ ++ template ++ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, ++ size_t __refs) ++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), ++ _M_name_timepunct(__s) ++ { ++ char* __tmp = new char[std::strlen(__s) + 1]; ++ std::strcpy(__tmp, __s); ++ _M_name_timepunct = __tmp; ++ _M_initialize_timepunct(__cloc); ++ } ++ ++ template ++ __timepunct<_CharT>::~__timepunct() ++ { ++ if (_M_name_timepunct != _S_get_c_name()) ++ delete [] _M_name_timepunct; ++ delete _M_data; ++ _S_destroy_c_locale(_M_c_locale_timepunct); ++ } +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index f40ddcf..c57a751 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -15822,6 +15822,9 @@ fi + # Default to "generic". + if test $enable_clocale_flag = auto; then + case ${target_os} in ++ *-uclibc*) ++ enable_clocale_flag=uclibc ++ ;; + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + enable_clocale_flag=gnu + ;; +@@ -16079,6 +16082,78 @@ $as_echo "newlib" >&6; } + CTIME_CC=config/locale/generic/time_members.cc + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h + ;; ++ uclibc) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: uclibc" >&5 ++$as_echo "uclibc" >&6; } ++ ++ # Declare intention to use gettext, and add support for specific ++ # languages. ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT ++ ALL_LINGUAS="de fr" ++ ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. ++ # Extract the first word of "msgfmt", so it can be a program name with args. ++set dummy msgfmt; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$check_msgfmt"; then ++ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_check_msgfmt="yes" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no" ++fi ++fi ++check_msgfmt=$ac_cv_prog_check_msgfmt ++if test -n "$check_msgfmt"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_msgfmt" >&5 ++$as_echo "$check_msgfmt" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then ++ USE_NLS=yes ++ fi ++ # Export the build objects. ++ for ling in $ALL_LINGUAS; do \ ++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ ++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ ++ done ++ ++ ++ ++ CLOCALE_H=config/locale/uclibc/c_locale.h ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc ++ CMESSAGES_H=config/locale/uclibc/messages_members.h ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc ++ CTIME_H=config/locale/uclibc/time_members.h ++ CTIME_CC=config/locale/uclibc/time_members.cc ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h ++ ;; + esac + + # This is where the testsuite looks for locale catalogs, using the +diff --git a/libstdc++-v3/include/c_compatibility/wchar.h b/libstdc++-v3/include/c_compatibility/wchar.h +index 580d725..3fe61b8 100644 +--- a/libstdc++-v3/include/c_compatibility/wchar.h ++++ b/libstdc++-v3/include/c_compatibility/wchar.h +@@ -101,7 +101,9 @@ using std::wmemcmp; + using std::wmemcpy; + using std::wmemmove; + using std::wmemset; ++#if _GLIBCXX_HAVE_WCSFTIME + using std::wcsftime; ++#endif + + #if _GLIBCXX_USE_C99 + using std::wcstold; +diff --git a/libstdc++-v3/include/c_std/cwchar b/libstdc++-v3/include/c_std/cwchar +index 0e6b1fc..405aee2 100644 +--- a/libstdc++-v3/include/c_std/cwchar ++++ b/libstdc++-v3/include/c_std/cwchar +@@ -175,7 +175,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + using ::wcscoll; + using ::wcscpy; + using ::wcscspn; ++#if _GLIBCXX_HAVE_WCSFTIME + using ::wcsftime; ++#endif + using ::wcslen; + using ::wcsncat; + using ::wcsncmp; +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0005-uclibc-locale-no__x.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0005-uclibc-locale-no__x.patch new file mode 100644 index 0000000..dcbbfe4 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0005-uclibc-locale-no__x.patch @@ -0,0 +1,257 @@ +From 6a3e8506a12c12728d8b29901defd738be43757f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:42:36 +0400 +Subject: [PATCH 05/35] uclibc-locale-no__x + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + .../config/locale/uclibc/c++locale_internal.h | 45 ++++++++++++++++++++ + libstdc++-v3/config/locale/uclibc/c_locale.cc | 14 ------ + libstdc++-v3/config/locale/uclibc/c_locale.h | 1 + + .../config/locale/uclibc/collate_members.cc | 7 --- + libstdc++-v3/config/locale/uclibc/ctype_members.cc | 7 --- + .../config/locale/uclibc/messages_members.cc | 7 +-- + .../config/locale/uclibc/messages_members.h | 18 +++----- + .../config/locale/uclibc/monetary_members.cc | 4 -- + .../config/locale/uclibc/numeric_members.cc | 3 -- + libstdc++-v3/config/locale/uclibc/time_members.cc | 3 -- + 10 files changed, 55 insertions(+), 54 deletions(-) + +diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +index 2ae3e4a..e74fddf 100644 +--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h ++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +@@ -60,4 +60,49 @@ extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; + extern "C" __typeof(wctype_l) __wctype_l; + #endif + ++# define __nl_langinfo_l nl_langinfo_l ++# define __strcoll_l strcoll_l ++# define __strftime_l strftime_l ++# define __strtod_l strtod_l ++# define __strtof_l strtof_l ++# define __strtold_l strtold_l ++# define __strxfrm_l strxfrm_l ++# define __newlocale newlocale ++# define __freelocale freelocale ++# define __duplocale duplocale ++# define __uselocale uselocale ++ ++# ifdef _GLIBCXX_USE_WCHAR_T ++# define __iswctype_l iswctype_l ++# define __towlower_l towlower_l ++# define __towupper_l towupper_l ++# define __wcscoll_l wcscoll_l ++# define __wcsftime_l wcsftime_l ++# define __wcsxfrm_l wcsxfrm_l ++# define __wctype_l wctype_l ++# endif ++ ++#else ++# define __nl_langinfo_l(N, L) nl_langinfo((N)) ++# define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) ++# define __strtod_l(S, E, L) strtod((S), (E)) ++# define __strtof_l(S, E, L) strtof((S), (E)) ++# define __strtold_l(S, E, L) strtold((S), (E)) ++# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) ++# warning should dummy __newlocale check for C|POSIX ? ++# define __newlocale(a, b, c) NULL ++# define __freelocale(a) ((void)0) ++# define __duplocale(a) __c_locale() ++//# define __uselocale ? ++// ++# ifdef _GLIBCXX_USE_WCHAR_T ++# define __iswctype_l(C, M, L) iswctype((C), (M)) ++# define __towlower_l(C, L) towlower((C)) ++# define __towupper_l(C, L) towupper((C)) ++# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) ++//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T)) ++# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) ++# define __wctype_l(S, L) wctype((S)) ++# endif ++ + #endif // GLIBC 2.3 and later +diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc +index 5081dc1..21430d0 100644 +--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc ++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc +@@ -39,20 +39,6 @@ + #include + #include + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) +-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) +-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) +-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) +-#define __strtof_l(S, E, L) strtof((S), (E)) +-#define __strtod_l(S, E, L) strtod((S), (E)) +-#define __strtold_l(S, E, L) strtold((S), (E)) +-#warning should dummy __newlocale check for C|POSIX ? +-#define __newlocale(a, b, c) NULL +-#define __freelocale(a) ((void)0) +-#define __duplocale(a) __c_locale() +-#endif +- + namespace std + { + template<> +diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h +index da07c1f..4bca5f1 100644 +--- a/libstdc++-v3/config/locale/uclibc/c_locale.h ++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h +@@ -68,6 +68,7 @@ namespace __gnu_cxx + { + extern "C" __typeof(uselocale) __uselocale; + } ++#define __uselocale uselocale + #endif + + namespace std +diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc +index c2664a7..ec5c329 100644 +--- a/libstdc++-v3/config/locale/uclibc/collate_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc +@@ -36,13 +36,6 @@ + #include + #include + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) +-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) +-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) +-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) +-#endif +- + namespace std + { + // These are basically extensions to char_traits, and perhaps should +diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc +index 7294e3a..7b12861 100644 +--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc +@@ -38,13 +38,6 @@ + #undef _LIBC + #include + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __wctype_l(S, L) wctype((S)) +-#define __towupper_l(C, L) towupper((C)) +-#define __towlower_l(C, L) towlower((C)) +-#define __iswctype_l(C, M, L) iswctype((C), (M)) +-#endif +- + namespace std + { + // NB: The other ctype specializations are in src/locale.cc and +diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc +index 13594d9..d7693b4 100644 +--- a/libstdc++-v3/config/locale/uclibc/messages_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc +@@ -39,13 +39,10 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix gettext stuff + #endif +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +-extern "C" char *__dcgettext(const char *domainname, +- const char *msgid, int category); + #undef gettext +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES) + #else +-#undef gettext + #define gettext(msgid) (msgid) + #endif + +diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h +index 1424078..d89da33 100644 +--- a/libstdc++-v3/config/locale/uclibc/messages_members.h ++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h +@@ -36,15 +36,11 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix prototypes for *textdomain funcs + #endif +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +-extern "C" char *__textdomain(const char *domainname); +-extern "C" char *__bindtextdomain(const char *domainname, +- const char *dirname); +-#else +-#undef __textdomain +-#undef __bindtextdomain +-#define __textdomain(D) ((void)0) +-#define __bindtextdomain(D,P) ((void)0) ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++#undef textdomain ++#undef bindtextdomain ++#define textdomain(D) ((void)0) ++#define bindtextdomain(D,P) ((void)0) + #endif + + // Non-virtual member functions. +@@ -70,7 +66,7 @@ extern "C" char *__bindtextdomain(const char *domainname, + messages<_CharT>::open(const basic_string& __s, const locale& __loc, + const char* __dir) const + { +- __bindtextdomain(__s.c_str(), __dir); ++ bindtextdomain(__s.c_str(), __dir); + return this->do_open(__s, __loc); + } + +@@ -90,7 +86,7 @@ extern "C" char *__bindtextdomain(const char *domainname, + { + // No error checking is done, assume the catalog exists and can + // be used. +- __textdomain(__s.c_str()); ++ textdomain(__s.c_str()); + return 0; + } + +diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +index aa52731..2e6f80a 100644 +--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +@@ -43,10 +43,6 @@ + #warning tailor for stub locale support + #endif + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __nl_langinfo_l(N, L) nl_langinfo((N)) +-#endif +- + namespace std + { + // Construct and return valid pattern consisting of some combination of: +diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +index 883ec1a..2c70642 100644 +--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +@@ -41,9 +41,6 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning tailor for stub locale support + #endif +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __nl_langinfo_l(N, L) nl_langinfo((N)) +-#endif + + namespace std + { +diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc +index e0707d7..d848ed5 100644 +--- a/libstdc++-v3/config/locale/uclibc/time_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc +@@ -40,9 +40,6 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning tailor for stub locale support + #endif +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __nl_langinfo_l(N, L) nl_langinfo((N)) +-#endif + + namespace std + { +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0006-uclibc-locale-wchar_fix.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0006-uclibc-locale-wchar_fix.patch new file mode 100644 index 0000000..3406859 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0006-uclibc-locale-wchar_fix.patch @@ -0,0 +1,68 @@ +From 225511a3aeb193a916b3999f0b640a392caa67cd Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:45:57 +0400 +Subject: [PATCH 06/35] uclibc-locale-wchar_fix + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libstdc++-v3/config/locale/uclibc/monetary_members.cc | 4 ++-- + libstdc++-v3/config/locale/uclibc/numeric_members.cc | 13 +++++++++++++ + 2 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +index 2e6f80a..31ebb9f 100644 +--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +@@ -401,7 +401,7 @@ namespace std + # ifdef __UCLIBC_HAS_XLOCALE__ + _M_data->_M_decimal_point = __cloc->decimal_point_wc; + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; +-# else ++# elif defined __UCLIBC_HAS_LOCALE__ + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; + # endif +@@ -556,7 +556,7 @@ namespace std + # ifdef __UCLIBC_HAS_XLOCALE__ + _M_data->_M_decimal_point = __cloc->decimal_point_wc; + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; +-# else ++# elif defined __UCLIBC_HAS_LOCALE__ + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; + # endif +diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +index 2c70642..d5c8961 100644 +--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +@@ -127,12 +127,25 @@ namespace std + { + // Named locale. + // NB: In the GNU model wchar_t is always 32 bit wide. ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this... should be numeric ++#endif ++#ifdef __UCLIBC__ ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc; ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; ++# elif defined __UCLIBC_HAS_LOCALE__ ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; ++# endif ++#else + union { char *__s; wchar_t __w; } __u; + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); + _M_data->_M_decimal_point = __u.__w; + + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); + _M_data->_M_thousands_sep = __u.__w; ++#endif + + if (_M_data->_M_thousands_sep == L'\0') + _M_data->_M_grouping = ""; +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0007-uclibc-locale-update.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0007-uclibc-locale-update.patch new file mode 100644 index 0000000..5851123 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0007-uclibc-locale-update.patch @@ -0,0 +1,542 @@ +From 6ffe7c46f52d27864c3df3663e16ec9ddee71e8f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:46:58 +0400 +Subject: [PATCH 07/35] uclibc-locale-update + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + .../config/locale/uclibc/c++locale_internal.h | 3 + + libstdc++-v3/config/locale/uclibc/c_locale.cc | 74 +++++++++----------- + libstdc++-v3/config/locale/uclibc/c_locale.h | 42 ++++++----- + libstdc++-v3/config/locale/uclibc/ctype_members.cc | 51 ++++++++++---- + .../config/locale/uclibc/messages_members.h | 12 ++-- + .../config/locale/uclibc/monetary_members.cc | 34 +++++---- + .../config/locale/uclibc/numeric_members.cc | 5 ++ + libstdc++-v3/config/locale/uclibc/time_members.cc | 18 +++-- + libstdc++-v3/config/locale/uclibc/time_members.h | 17 +++-- + 9 files changed, 158 insertions(+), 98 deletions(-) + +diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +index e74fddf..971a6b4 100644 +--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h ++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +@@ -31,6 +31,9 @@ + + #include + #include ++#include ++#include ++#include + + #ifdef __UCLIBC_MJN3_ONLY__ + #warning clean this up +diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc +index 21430d0..1b9d8e1 100644 +--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc ++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc +@@ -39,23 +39,20 @@ + #include + #include + +-namespace std +-{ ++_GLIBCXX_BEGIN_NAMESPACE(std) ++ + template<> + void + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { +- if (!(__err & ios_base::failbit)) +- { +- char* __sanity; +- errno = 0; +- float __f = __strtof_l(__s, &__sanity, __cloc); +- if (__sanity != __s && errno != ERANGE) +- __v = __f; +- else +- __err |= ios_base::failbit; +- } ++ char* __sanity; ++ errno = 0; ++ float __f = __strtof_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __f; ++ else ++ __err |= ios_base::failbit; + } + + template<> +@@ -63,16 +60,13 @@ namespace std + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { +- if (!(__err & ios_base::failbit)) +- { +- char* __sanity; +- errno = 0; +- double __d = __strtod_l(__s, &__sanity, __cloc); +- if (__sanity != __s && errno != ERANGE) +- __v = __d; +- else +- __err |= ios_base::failbit; +- } ++ char* __sanity; ++ errno = 0; ++ double __d = __strtod_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __d; ++ else ++ __err |= ios_base::failbit; + } + + template<> +@@ -80,16 +74,13 @@ namespace std + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { +- if (!(__err & ios_base::failbit)) +- { +- char* __sanity; +- errno = 0; +- long double __ld = __strtold_l(__s, &__sanity, __cloc); +- if (__sanity != __s && errno != ERANGE) +- __v = __ld; +- else +- __err |= ios_base::failbit; +- } ++ char* __sanity; ++ errno = 0; ++ long double __ld = __strtold_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __ld; ++ else ++ __err |= ios_base::failbit; + } + + void +@@ -110,17 +101,18 @@ namespace std + void + locale::facet::_S_destroy_c_locale(__c_locale& __cloc) + { +- if (_S_get_c_locale() != __cloc) ++ if (__cloc && _S_get_c_locale() != __cloc) + __freelocale(__cloc); + } + + __c_locale + locale::facet::_S_clone_c_locale(__c_locale& __cloc) + { return __duplocale(__cloc); } +-} // namespace std + +-namespace __gnu_cxx +-{ ++_GLIBCXX_END_NAMESPACE ++ ++_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ++ + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = + { + "LC_CTYPE", +@@ -138,9 +130,11 @@ namespace __gnu_cxx + "LC_IDENTIFICATION" + #endif + }; +-} + +-namespace std +-{ ++_GLIBCXX_END_NAMESPACE ++ ++_GLIBCXX_BEGIN_NAMESPACE(std) ++ + const char* const* const locale::_S_categories = __gnu_cxx::category_names; +-} // namespace std ++ ++_GLIBCXX_END_NAMESPACE +diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h +index 4bca5f1..64a6d46 100644 +--- a/libstdc++-v3/config/locale/uclibc/c_locale.h ++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h +@@ -39,21 +39,23 @@ + #pragma GCC system_header + + #include // get std::strlen +-#include // get std::snprintf or std::sprintf ++#include // get std::vsnprintf or std::vsprintf + #include + #include // For codecvt + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix this + #endif +-#ifdef __UCLIBC_HAS_LOCALE__ ++#ifdef _GLIBCXX_USE_ICONV + #include // For codecvt using iconv, iconv_t + #endif +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +-#include // For messages ++#ifdef HAVE_LIBINTL_H ++#include // For messages + #endif ++#include + + #ifdef __UCLIBC_MJN3_ONLY__ + #warning what is _GLIBCXX_C_LOCALE_GNU for ++// psm: used in os/gnu-linux/ctype_noninline.h + #endif + #define _GLIBCXX_C_LOCALE_GNU 1 + +@@ -78,23 +80,25 @@ namespace std + #else + typedef int* __c_locale; + #endif +- +- // Convert numeric value of type _Tv to string and return length of +- // string. If snprintf is available use it, otherwise fall back to +- // the unsafe sprintf which, in general, can be dangerous and should ++ // Convert numeric value of type double to string and return length of ++ // string. If vsnprintf is available use it, otherwise fall back to ++ // the unsafe vsprintf which, in general, can be dangerous and should + // be avoided. +- template +- int +- __convert_from_v(char* __out, +- const int __size __attribute__ ((__unused__)), +- const char* __fmt, +-#ifdef __UCLIBC_HAS_XCLOCALE__ +- _Tv __v, const __c_locale& __cloc, int __prec) ++ inline int ++ __convert_from_v(const __c_locale& ++#ifndef __UCLIBC_HAS_XCLOCALE__ ++ __cloc __attribute__ ((__unused__)) ++#endif ++ , ++ char* __out, ++ const int __size, ++ const char* __fmt, ...) + { ++ va_list __args; ++#ifdef __UCLIBC_HAS_XCLOCALE__ ++ + __c_locale __old = __gnu_cxx::__uselocale(__cloc); + #else +- _Tv __v, const __c_locale&, int __prec) +- { + # ifdef __UCLIBC_HAS_LOCALE__ + char* __old = std::setlocale(LC_ALL, NULL); + char* __sav = new char[std::strlen(__old) + 1]; +@@ -103,7 +107,9 @@ namespace std + # endif + #endif + +- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); ++ va_start(__args, __fmt); ++ const int __ret = std::vsnprintf(__out, __size, __fmt, __args); ++ va_end(__args); + + #ifdef __UCLIBC_HAS_XCLOCALE__ + __gnu_cxx::__uselocale(__old); +diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc +index 7b12861..13e011d 100644 +--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc +@@ -33,16 +33,20 @@ + + // Written by Benjamin Kosnik + ++#include ++#ifdef __UCLIBC_HAS_LOCALE__ + #define _LIBC + #include + #undef _LIBC ++#else ++#include ++#endif + #include + +-namespace std +-{ ++_GLIBCXX_BEGIN_NAMESPACE(std) ++ + // NB: The other ctype specializations are in src/locale.cc and + // various /config/os/* files. +- template<> + ctype_byname::ctype_byname(const char* __s, size_t __refs) + : ctype(0, false, __refs) + { +@@ -57,6 +61,8 @@ namespace std + #endif + } + } ++ ctype_byname::~ctype_byname() ++ { } + + #ifdef _GLIBCXX_USE_WCHAR_T + ctype::__wmask_type +@@ -138,17 +144,33 @@ namespace std + ctype:: + do_is(mask __m, wchar_t __c) const + { +- // Highest bitmask in ctype_base == 10, but extra in "C" +- // library for blank. ++ // The case of __m == ctype_base::space is particularly important, ++ // due to its use in many istream functions. Therefore we deal with ++ // it first, exploiting the knowledge that on GNU systems _M_bit[5] ++ // is the mask corresponding to ctype_base::space. NB: an encoding ++ // change would not affect correctness! ++ + bool __ret = false; +- const size_t __bitmasksize = 11; +- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) +- if (__m & _M_bit[__bitcur] +- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) +- { +- __ret = true; +- break; +- } ++ if (__m == _M_bit[5]) ++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype); ++ else ++ { ++ // Highest bitmask in ctype_base == 10, but extra in "C" ++ // library for blank. ++ const size_t __bitmasksize = 11; ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) ++ if (__m & _M_bit[__bitcur]) ++ { ++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) ++ { ++ __ret = true; ++ break; ++ } ++ else if (__m == _M_bit[__bitcur]) ++ break; ++ } ++ } ++ + return __ret; + } + +@@ -290,4 +312,5 @@ namespace std + #endif + } + #endif // _GLIBCXX_USE_WCHAR_T +-} ++ ++_GLIBCXX_END_NAMESPACE +diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h +index d89da33..067657a 100644 +--- a/libstdc++-v3/config/locale/uclibc/messages_members.h ++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h +@@ -53,12 +53,16 @@ + template + messages<_CharT>::messages(__c_locale __cloc, const char* __s, + size_t __refs) +- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), +- _M_name_messages(__s) ++ : facet(__refs), _M_c_locale_messages(NULL), ++ _M_name_messages(NULL) + { +- char* __tmp = new char[std::strlen(__s) + 1]; +- std::strcpy(__tmp, __s); ++ const size_t __len = std::strlen(__s) + 1; ++ char* __tmp = new char[__len]; ++ std::memcpy(__tmp, __s, __len); + _M_name_messages = __tmp; ++ ++ // Last to avoid leaking memory if new throws. ++ _M_c_locale_messages = _S_clone_c_locale(__cloc); + } + + template +diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +index 31ebb9f..7679b9c 100644 +--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc +@@ -33,9 +33,14 @@ + + // Written by Benjamin Kosnik + ++#include ++#ifdef __UCLIBC_HAS_LOCALE__ + #define _LIBC + #include + #undef _LIBC ++#else ++#include ++#endif + #include + + #ifdef __UCLIBC_MJN3_ONLY__ +@@ -206,7 +211,7 @@ namespace std + } + break; + default: +- ; ++ __ret = pattern(); + } + return __ret; + } +@@ -390,7 +395,9 @@ namespace std + __c_locale __old = __uselocale(__cloc); + #else + // Switch to named locale so that mbsrtowcs will work. +- char* __old = strdup(setlocale(LC_ALL, NULL)); ++ char* __old = setlocale(LC_ALL, NULL); ++ const size_t __llen = strlen(__old) + 1; ++ char* __sav = new char[__llen]; + setlocale(LC_ALL, __name); + #endif + +@@ -477,8 +484,8 @@ namespace std + #ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); + #else +- setlocale(LC_ALL, __old); +- free(__old); ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; + #endif + __throw_exception_again; + } +@@ -498,8 +505,8 @@ namespace std + #ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); + #else +- setlocale(LC_ALL, __old); +- free(__old); ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; + #endif + } + } +@@ -545,8 +552,11 @@ namespace std + __c_locale __old = __uselocale(__cloc); + #else + // Switch to named locale so that mbsrtowcs will work. +- char* __old = strdup(setlocale(LC_ALL, NULL)); +- setlocale(LC_ALL, __name); ++ char* __old = setlocale(LC_ALL, NULL); ++ const size_t __llen = strlen(__old) + 1; ++ char* __sav = new char[__llen]; ++ memcpy(__sav, __old, __llen); ++ setlocale(LC_ALL, __name); + #endif + + #ifdef __UCLIBC_MJN3_ONLY__ +@@ -633,8 +643,8 @@ namespace std + #ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); + #else +- setlocale(LC_ALL, __old); +- free(__old); ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; + #endif + __throw_exception_again; + } +@@ -653,8 +663,8 @@ namespace std + #ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); + #else +- setlocale(LC_ALL, __old); +- free(__old); ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; + #endif + } + } +diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +index d5c8961..8ae8969 100644 +--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc +@@ -33,9 +33,14 @@ + + // Written by Benjamin Kosnik + ++#include ++#ifdef __UCLIBC_HAS_LOCALE__ + #define _LIBC + #include + #undef _LIBC ++#else ++#include ++#endif + #include + + #ifdef __UCLIBC_MJN3_ONLY__ +diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc +index d848ed5..f24d53e 100644 +--- a/libstdc++-v3/config/locale/uclibc/time_members.cc ++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc +@@ -53,11 +53,14 @@ namespace std + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, + _M_c_locale_timepunct); + #else +- char* __old = strdup(setlocale(LC_ALL, NULL)); ++ char* __old = setlocale(LC_ALL, NULL); ++ const size_t __llen = strlen(__old) + 1; ++ char* __sav = new char[__llen]; ++ memcpy(__sav, __old, __llen); + setlocale(LC_ALL, _M_name_timepunct); + const size_t __len = strftime(__s, __maxlen, __format, __tm); +- setlocale(LC_ALL, __old); +- free(__old); ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; + #endif + // Make sure __s is null terminated. + if (__len == 0) +@@ -207,11 +210,14 @@ namespace std + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, + _M_c_locale_timepunct); + #else +- char* __old = strdup(setlocale(LC_ALL, NULL)); ++ char* __old = setlocale(LC_ALL, NULL); ++ const size_t __llen = strlen(__old) + 1; ++ char* __sav = new char[__llen]; ++ memcpy(__sav, __old, __llen); + setlocale(LC_ALL, _M_name_timepunct); + const size_t __len = wcsftime(__s, __maxlen, __format, __tm); +- setlocale(LC_ALL, __old); +- free(__old); ++ setlocale(LC_ALL, __sav); ++ delete [] __sav; + #endif + // Make sure __s is null terminated. + if (__len == 0) +diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h +index ba8e858..1665dde 100644 +--- a/libstdc++-v3/config/locale/uclibc/time_members.h ++++ b/libstdc++-v3/config/locale/uclibc/time_members.h +@@ -50,12 +50,21 @@ + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, + size_t __refs) + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), +- _M_name_timepunct(__s) ++ _M_name_timepunct(NULL) + { +- char* __tmp = new char[std::strlen(__s) + 1]; +- std::strcpy(__tmp, __s); ++ const size_t __len = std::strlen(__s) + 1; ++ char* __tmp = new char[__len]; ++ std::memcpy(__tmp, __s, __len); + _M_name_timepunct = __tmp; +- _M_initialize_timepunct(__cloc); ++ ++ try ++ { _M_initialize_timepunct(__cloc); } ++ catch(...) ++ { ++ delete [] _M_name_timepunct; ++ __throw_exception_again; ++ } ++ + } + + template +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0008-missing-execinfo_h.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0008-missing-execinfo_h.patch new file mode 100644 index 0000000..2823809 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0008-missing-execinfo_h.patch @@ -0,0 +1,28 @@ +From 9f2158451981cf0a80cfabdc79ae31bb6976a801 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:48:10 +0400 +Subject: [PATCH 08/35] missing-execinfo_h + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + boehm-gc/include/gc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h +index c51e017..a7ba8dc 100644 +--- a/boehm-gc/include/gc.h ++++ b/boehm-gc/include/gc.h +@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb)); + #if defined(__linux__) || defined(__GLIBC__) + # include + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ +- && !defined(__ia64__) ++ && !defined(__ia64__) && !defined(__UCLIBC__) + # ifndef GC_HAVE_BUILTIN_BACKTRACE + # define GC_HAVE_BUILTIN_BACKTRACE + # endif +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0009-c99-snprintf.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0009-c99-snprintf.patch new file mode 100644 index 0000000..7168778 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0009-c99-snprintf.patch @@ -0,0 +1,28 @@ +From e393e076f1ab82d25e1aa04d6edea27b41d3eb06 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:49:03 +0400 +Subject: [PATCH 09/35] c99-snprintf + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libstdc++-v3/include/c_std/cstdio | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libstdc++-v3/include/c_std/cstdio b/libstdc++-v3/include/c_std/cstdio +index e85bd83..6af839a 100644 +--- a/libstdc++-v3/include/c_std/cstdio ++++ b/libstdc++-v3/include/c_std/cstdio +@@ -139,7 +139,7 @@ namespace std + using ::vsprintf; + } // namespace std + +-#if _GLIBCXX_USE_C99 ++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__) + + #undef snprintf + #undef vfscanf +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0010-c99-complex-ugly-hack.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0010-c99-complex-ugly-hack.patch new file mode 100644 index 0000000..b628571 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0010-c99-complex-ugly-hack.patch @@ -0,0 +1,29 @@ +From 73f69d806e2c9561a54995223431a1076cfd6164 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:49:57 +0400 +Subject: [PATCH 10/35] c99-complex-ugly-hack + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [embedded specific] +--- + libstdc++-v3/configure | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index c57a751..a1333e2 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -18734,6 +18734,9 @@ $as_echo_n "checking for ISO C99 support to TR1 in ... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include ++#ifdef __UCLIBC__ ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs ++#endif + int + main () + { +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0011-index_macro.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0011-index_macro.patch new file mode 100644 index 0000000..8ee79b0 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0011-index_macro.patch @@ -0,0 +1,44 @@ +From b037953e40312b45ab84ed0a3ad882bb5e413101 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:51:02 +0400 +Subject: [PATCH 11/35] index_macro + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libstdc++-v3/include/ext/rope | 3 +++ + libstdc++-v3/include/ext/ropeimpl.h | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope +index 38eb1e8..158d21a 100644 +--- a/libstdc++-v3/include/ext/rope ++++ b/libstdc++-v3/include/ext/rope +@@ -55,6 +55,9 @@ + #include + #include + ++/* cope w/ index defined as macro, SuSv3 proposal */ ++#undef index ++ + # ifdef __GC + # define __GC_CONST const + # else +diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h +index d7b5cbd..b9b3acb 100644 +--- a/libstdc++-v3/include/ext/ropeimpl.h ++++ b/libstdc++-v3/include/ext/ropeimpl.h +@@ -48,6 +48,9 @@ + #include // For uninitialized_copy_n + #include // For power + ++/* cope w/ index defined as macro, SuSv3 proposal */ ++#undef index ++ + namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0013-libstdc-namespace.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0013-libstdc-namespace.patch new file mode 100644 index 0000000..4a3efde --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0013-libstdc-namespace.patch @@ -0,0 +1,54 @@ +From 104e4d66208f2726b14d2f5eebce90700cbc83c8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:54:02 +0400 +Subject: [PATCH 13/35] libstdc++-namespace + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libstdc++-v3/config/locale/uclibc/messages_members.h | 4 +++- + libstdc++-v3/config/locale/uclibc/time_members.h | 4 +++- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h +index 067657a..dd76a6c 100644 +--- a/libstdc++-v3/config/locale/uclibc/messages_members.h ++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h +@@ -32,7 +32,8 @@ + // + + // Written by Benjamin Kosnik +- ++namespace std ++{ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix prototypes for *textdomain funcs + #endif +@@ -116,3 +117,4 @@ + this->_S_create_c_locale(this->_M_c_locale_messages, __s); + } + } ++} +diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h +index 1665dde..905c433 100644 +--- a/libstdc++-v3/config/locale/uclibc/time_members.h ++++ b/libstdc++-v3/config/locale/uclibc/time_members.h +@@ -33,7 +33,8 @@ + // + + // Written by Benjamin Kosnik +- ++namespace std ++{ + template + __timepunct<_CharT>::__timepunct(size_t __refs) + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), +@@ -75,3 +76,4 @@ + delete _M_data; + _S_destroy_c_locale(_M_c_locale_timepunct); + } ++} +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0014-sh-pr24836.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0014-sh-pr24836.patch new file mode 100644 index 0000000..cb8fd52 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0014-sh-pr24836.patch @@ -0,0 +1,45 @@ +From edc9acb181810f234b6b9f7d2820b0e4f6a1eeaf Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:54:48 +0400 +Subject: [PATCH 14/35] sh-pr24836 + +Signed-off-by: Khem Raj + +Upstream-Status: Pending + +http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348 +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836 +--- + gcc/configure | 2 +- + gcc/configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gcc/configure b/gcc/configure +index e12a180..135bbf5 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -23378,7 +23378,7 @@ foo: .long 25 + tls_first_minor=14 + tls_as_opt="-m64 -Aesame --fatal-warnings" + ;; +- sh-*-* | sh[34]-*-*) ++ sh-*-* | sh[34]*-*-*) + conftest_s=' + .section ".tdata","awT",@progbits + foo: .long 25 +diff --git a/gcc/configure.ac b/gcc/configure.ac +index eba3577..6363a21 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -3141,7 +3141,7 @@ foo: .long 25 + tls_first_minor=14 + tls_as_opt="-m64 -Aesame --fatal-warnings" + ;; +- sh-*-* | sh[34]-*-*) ++ sh-*-* | sh[34]*-*-*) + conftest_s=' + .section ".tdata","awT",@progbits + foo: .long 25 +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch new file mode 100644 index 0000000..ba0a227 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch @@ -0,0 +1,39 @@ +From 50e5366005b0f6af27378e2a5c3cb9f9936a7e62 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:58:36 +0400 +Subject: [PATCH 15/35] arm: Use TARGET_ENDIAN_OPTION for determining + MULTILIB_DEFAULTS + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/config/arm/linux-elf.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: gcc-4.9-20140316/gcc/config/arm/coff.h +=================================================================== +--- gcc-4.9-20140316.orig/gcc/config/arm/coff.h ++++ gcc-4.9-20140316/gcc/config/arm/coff.h +@@ -33,7 +33,7 @@ + + #ifndef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", "mlittle-endian", "mfloat-abi=soft", "mno-thumb-interwork" } ++ { "marm", TARGET_ENDIAN_OPTION, "mfloat-abi=soft", "mno-thumb-interwork" } + #endif + + /* This is COFF, but prefer stabs. */ +Index: gcc-4.9-20140316/gcc/config/arm/elf.h +=================================================================== +--- gcc-4.9-20140316.orig/gcc/config/arm/elf.h ++++ gcc-4.9-20140316/gcc/config/arm/elf.h +@@ -112,7 +112,7 @@ + + #ifndef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", "mlittle-endian", "mfloat-abi=soft", "mno-thumb-interwork", "fno-leading-underscore" } ++ { "marm", TARGET_ENDIAN_OPTION, "mfloat-abi=soft", "mno-thumb-interwork", "fno-leading-underscore" } + #endif + + #define TARGET_ASM_FILE_START_APP_OFF true diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0016-gcc-poison-system-directories.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0016-gcc-poison-system-directories.patch new file mode 100644 index 0000000..475ef96 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0016-gcc-poison-system-directories.patch @@ -0,0 +1,190 @@ +From 160397ef3c3331099af028f1b8d3e085b07d88ad Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 08:59:00 +0400 +Subject: [PATCH 16/35] gcc: poison-system-directories + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [distribution: codesourcery] +--- + gcc/Makefile.in | 2 +- + gcc/common.opt | 4 ++++ + gcc/config.in | 6 ++++++ + gcc/configure | 20 ++++++++++++++++++-- + gcc/configure.ac | 10 ++++++++++ + gcc/doc/invoke.texi | 9 +++++++++ + gcc/gcc.c | 2 ++ + gcc/incpath.c | 19 +++++++++++++++++++ + 8 files changed, 69 insertions(+), 3 deletions(-) + +Index: gcc-4.9-20140316/gcc/common.opt +=================================================================== +--- gcc-4.9-20140316.orig/gcc/common.opt ++++ gcc-4.9-20140316/gcc/common.opt +@@ -603,6 +603,10 @@ Wpedantic + Common Var(pedantic) Warning + Issue warnings needed for strict compliance to the standard + ++Wpoison-system-directories ++Common Var(flag_poison_system_directories) Init(1) Warning ++Warn for -I and -L options using system directories if cross compiling ++ + Wshadow + Common Var(warn_shadow) Warning + Warn when one local variable shadows another +Index: gcc-4.9-20140316/gcc/config.in +=================================================================== +--- gcc-4.9-20140316.orig/gcc/config.in ++++ gcc-4.9-20140316/gcc/config.in +@@ -138,6 +138,12 @@ + #endif + + ++/* Define to warn for use of native system header directories */ ++#ifndef USED_FOR_TARGET ++#undef ENABLE_POISON_SYSTEM_DIRECTORIES ++#endif ++ ++ + /* Define if you want all operations on RTL (the basic data structure of the + optimizer and back end) to be checked for dynamic type safety at runtime. + This is quite expensive. */ +Index: gcc-4.9-20140316/gcc/configure +=================================================================== +--- gcc-4.9-20140316.orig/gcc/configure ++++ gcc-4.9-20140316/gcc/configure +@@ -928,6 +928,7 @@ with_system_zlib + enable_maintainer_mode + enable_link_mutex + enable_version_specific_runtime_libs ++enable_poison_system_directories + enable_plugin + enable_host_shared + enable_libquadmath_support +@@ -1648,6 +1649,8 @@ Optional Features: + --enable-version-specific-runtime-libs + specify that runtime libraries should be installed + in a compiler-specific directory ++ --enable-poison-system-directories ++ warn for use of native system header directories + --enable-plugin enable plugin support + --enable-host-shared build host code as shared libraries + --disable-libquadmath-support +@@ -27702,6 +27705,19 @@ if test "${enable_version_specific_runti + fi + + ++# Check whether --enable-poison-system-directories was given. ++if test "${enable_poison_system_directories+set}" = set; then : ++ enableval=$enable_poison_system_directories; ++else ++ enable_poison_system_directories=no ++fi ++ ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ ++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++ ++fi ++ + # Substitute configuration variables + + +Index: gcc-4.9-20140316/gcc/configure.ac +=================================================================== +--- gcc-4.9-20140316.orig/gcc/configure.ac ++++ gcc-4.9-20140316/gcc/configure.ac +@@ -5366,6 +5366,16 @@ AC_ARG_ENABLE(version-specific-runtime-l + [specify that runtime libraries should be + installed in a compiler-specific directory])]) + ++AC_ARG_ENABLE([poison-system-directories], ++ AS_HELP_STRING([--enable-poison-system-directories], ++ [warn for use of native system header directories]),, ++ [enable_poison_system_directories=no]) ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], ++ [1], ++ [Define to warn for use of native system header directories]) ++fi ++ + # Substitute configuration variables + AC_SUBST(subdirs) + AC_SUBST(srcdir) +Index: gcc-4.9-20140316/gcc/doc/invoke.texi +=================================================================== +--- gcc-4.9-20140316.orig/gcc/doc/invoke.texi ++++ gcc-4.9-20140316/gcc/doc/invoke.texi +@@ -260,6 +260,7 @@ Objective-C and Objective-C++ Dialects}. + -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol + -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol + -Wpointer-arith -Wno-pointer-to-int-cast @gol ++-Wno-poison-system-directories @gol + -Wredundant-decls -Wno-return-local-addr @gol + -Wreturn-type -Wsequence-point -Wshadow @gol + -Wsign-compare -Wsign-conversion -Wfloat-conversion @gol +@@ -4230,6 +4231,14 @@ headers---for that, @option{-Wunknown-pr + for most targets, it is made up of code and thus requires the stack + to be made executable in order for the program to work properly. + ++@item -Wno-poison-system-directories ++@opindex Wno-poison-system-directories ++Do not warn for @option{-I} or @option{-L} options using system ++directories such as @file{/usr/include} when cross compiling. This ++option is intended for use in chroot environments when such ++directories contain the correct headers and libraries for the target ++system rather than the host. ++ + @item -Wfloat-equal + @opindex Wfloat-equal + @opindex Wno-float-equal +Index: gcc-4.9-20140316/gcc/gcc.c +=================================================================== +--- gcc-4.9-20140316.orig/gcc/gcc.c ++++ gcc-4.9-20140316/gcc/gcc.c +@@ -764,6 +764,8 @@ proper position among the other output f + "%{fuse-ld=*:-fuse-ld=%*}\ + %X %{o*} %{e*} %{N} %{n} %{r}\ + %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \ ++ %{Wno-poison-system-directories:--no-poison-system-directories}\ ++ %{Werror=poison-system-directories:--error-poison-system-directories}\ + %{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\ + %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\ + %{fgnu-tm:%:include(libitm.spec)%(link_itm)}\ +Index: gcc-4.9-20140316/gcc/incpath.c +=================================================================== +--- gcc-4.9-20140316.orig/gcc/incpath.c ++++ gcc-4.9-20140316/gcc/incpath.c +@@ -28,6 +28,7 @@ + #include "intl.h" + #include "incpath.h" + #include "cppdefault.h" ++#include "diagnostic-core.h" + + /* Microsoft Windows does not natively support inodes. + VMS has non-numeric inodes. */ +@@ -382,6 +383,24 @@ merge_include_chains (const char *sysroo + } + fprintf (stderr, _("End of search list.\n")); + } ++ ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ if (flag_poison_system_directories) ++ { ++ struct cpp_dir *p; ++ ++ for (p = heads[QUOTE]; p; p = p->next) ++ { ++ if ((!strncmp (p->name, "/usr/include", 12)) ++ || (!strncmp (p->name, "/usr/local/include", 18)) ++ || (!strncmp (p->name, "/usr/X11R6/include", 18))) ++ warning (OPT_Wpoison_system_directories, ++ "include location \"%s\" is unsafe for " ++ "cross-compilation", ++ p->name); ++ } ++ } ++#endif + } + + /* Use given -I paths for #include "..." but not #include <...>, and diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0017-gcc-poison-dir-extend.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0017-gcc-poison-dir-extend.patch new file mode 100644 index 0000000..9e81efd --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0017-gcc-poison-dir-extend.patch @@ -0,0 +1,39 @@ +From e99c9c97266d6d3e8cac798aa91408250c4d60cf Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:00:34 +0400 +Subject: [PATCH 17/35] gcc-poison-dir-extend + +Add /sw/include and /opt/include based on the original +zecke-no-host-includes.patch patch. The original patch checked for +/usr/include, /sw/include and /opt/include and then triggered a failure and +aborted. + +Instead, we add the two missing items to the current scan. If the user +wants this to be a failure, they can add "-Werror=poison-system-directories". + +Signed-off-by: Mark Hatle +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/incpath.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/gcc/incpath.c b/gcc/incpath.c +index cd41c78..eac4a92 100644 +--- a/gcc/incpath.c ++++ b/gcc/incpath.c +@@ -393,7 +393,9 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) + { + if ((!strncmp (p->name, "/usr/include", 12)) + || (!strncmp (p->name, "/usr/local/include", 18)) +- || (!strncmp (p->name, "/usr/X11R6/include", 18))) ++ || (!strncmp (p->name, "/usr/X11R6/include", 18)) ++ || (!strncmp (p->name, "/sw/include", 11)) ++ || (!strncmp (p->name, "/opt/include", 12))) + warning (OPT_Wpoison_system_directories, + "include location \"%s\" is unsafe for " + "cross-compilation", +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch new file mode 100644 index 0000000..a28cafd --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch @@ -0,0 +1,73 @@ +From 56207fa2923e8edf774e98ffac82666091076be3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:08:31 +0400 +Subject: [PATCH 18/35] gcc-4.3.3: SYSROOT_CFLAGS_FOR_TARGET + +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? + +Signed-off-by: Paolo Bonzini +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + configure | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/configure b/configure +index 1b76c90..e4dce7c 100755 +--- a/configure ++++ b/configure +@@ -6772,6 +6772,38 @@ 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 +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0019-64-bit-multilib-hack.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0019-64-bit-multilib-hack.patch new file mode 100644 index 0000000..058be0c --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0019-64-bit-multilib-hack.patch @@ -0,0 +1,82 @@ +From 18fde5740b09324dfb9cf41e9849672573ff5fa0 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:10:06 +0400 +Subject: [PATCH 19/35] 64-bit multilib hack. + +GCC has internal multilib handling code but it assumes a very specific rigid directory +layout. The build system implementation of multilib layout is very generic and allows +complete customisation of the library directories. + +This patch is a partial solution to allow any custom directories to be passed into gcc +and handled correctly. It forces gcc to use the base_libdir (which is the current +directory, "."). We need to do this for each multilib that is configured as we don't +know which compiler options may be being passed into the compiler. Since we have a compiler +per mulitlib at this point that isn't an issue. + +The one problem is the target compiler is only going to work for the default multlilib at +this point. Ideally we'd figure out which multilibs were being enabled with which paths +and be able to patch these entries with a complete set of correct paths but this we +don't have such code at this point. This is something the target gcc recipe should do +and override these platform defaults in its build config. + +RP 15/8/11 + +Signed-off-by: Khem Raj +Signed-off-by: Elvis Dowson + +Upstream-Status: Pending +--- + gcc/config/i386/t-linux64 | 6 ++---- + gcc/config/mips/t-linux64 | 10 +++------- + gcc/config/rs6000/t-linux64 | 5 ++--- + 3 files changed, 7 insertions(+), 14 deletions(-) + +Index: gcc-4.9-20140316/gcc/config/i386/t-linux64 +=================================================================== +--- gcc-4.9-20140316.orig/gcc/config/i386/t-linux64 ++++ gcc-4.9-20140316/gcc/config/i386/t-linux64 +@@ -32,7 +32,5 @@ + # + comma=, + MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) +-MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) +-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu) +-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu) +-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) ++MULTILIB_DIRNAMES = . . ++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) +Index: gcc-4.9-20140316/gcc/config/mips/t-linux64 +=================================================================== +--- gcc-4.9-20140316.orig/gcc/config/mips/t-linux64 ++++ gcc-4.9-20140316/gcc/config/mips/t-linux64 +@@ -17,10 +17,6 @@ + # . + + MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64 +-MULTILIB_DIRNAMES = n32 32 64 +-MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el) +-MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft) +-MULTILIB_OSDIRNAMES = \ +- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \ +- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \ +- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT)) ++MULTILIB_DIRNAMES = . . . ++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ++ +Index: gcc-4.9-20140316/gcc/config/rs6000/t-linux64 +=================================================================== +--- gcc-4.9-20140316.orig/gcc/config/rs6000/t-linux64 ++++ gcc-4.9-20140316/gcc/config/rs6000/t-linux64 +@@ -26,10 +26,9 @@ + # MULTILIB_OSDIRNAMES according to what is found on the target. + + MULTILIB_OPTIONS := m64/m32 +-MULTILIB_DIRNAMES := 64 32 ++MULTILIB_DIRNAMES := . . + MULTILIB_EXTRA_OPTS := +-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu) +-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu) ++MULTILIB_OSDIRNAMES := ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) + + rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c + $(COMPILE) $< diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0020-optional-libstdc.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0020-optional-libstdc.patch new file mode 100644 index 0000000..5b46614 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0020-optional-libstdc.patch @@ -0,0 +1,98 @@ +From 307c8ff3ef666b7bd5ac733863f2fbb27a9d521e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:12:56 +0400 +Subject: [PATCH 20/35] optional libstdc + +gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++ +will not run correctly since by default the linker will try to link against libstdc++ +which shouldn't exist yet. We need an option to disable -lstdc++ +option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc +driver. This patch adds such an option which only disables the -lstdc++. + +A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to +do this officially, the likely answer is don't build libstdc++ separately. + +RP 29/6/10 + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [embedded specific] +--- + gcc/c-family/c.opt | 4 ++++ + gcc/cp/g++spec.c | 1 + + gcc/doc/invoke.texi | 9 +++++++-- + gcc/gcc.c | 1 + + 4 files changed, 13 insertions(+), 2 deletions(-) + +Index: gcc-4.9-20140316/gcc/c-family/c.opt +=================================================================== +--- gcc-4.9-20140316.orig/gcc/c-family/c.opt ++++ gcc-4.9-20140316/gcc/c-family/c.opt +@@ -1323,6 +1323,10 @@ nostdinc++ + C++ ObjC++ + Do not search standard system include directories for C++ + ++nostdlib++ ++Driver ++Do not link standard C++ runtime library ++ + o + C ObjC C++ ObjC++ Joined Separate + ; Documented in common.opt +Index: gcc-4.9-20140316/gcc/cp/g++spec.c +=================================================================== +--- gcc-4.9-20140316.orig/gcc/cp/g++spec.c ++++ gcc-4.9-20140316/gcc/cp/g++spec.c +@@ -138,6 +138,7 @@ lang_specific_driver (struct cl_decoded_ + switch (decoded_options[i].opt_index) + { + case OPT_nostdlib: ++ case OPT_nostdlib__: + case OPT_nodefaultlibs: + library = -1; + break; +Index: gcc-4.9-20140316/gcc/doc/invoke.texi +=================================================================== +--- gcc-4.9-20140316.orig/gcc/doc/invoke.texi ++++ gcc-4.9-20140316/gcc/doc/invoke.texi +@@ -193,6 +193,7 @@ in the following sections. + -fvisibility-inlines-hidden @gol + -fvtable-verify=@var{std|preinit|none} @gol + -fvtv-counts -fvtv-debug @gol ++-nostdlib++ @gol + -fvisibility-ms-compat @gol + -fext-numeric-literals @gol + -Wabi -Wconversion-null -Wctor-dtor-privacy @gol +@@ -457,7 +458,7 @@ Objective-C and Objective-C++ Dialects}. + -nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic @gol + -s -static -static-libgcc -static-libstdc++ @gol + -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol +--shared -shared-libgcc -symbolic @gol ++-shared -shared-libgcc -symbolic -nostdlib++ @gol + -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol + -u @var{symbol}} + +@@ -10285,6 +10286,11 @@ These entries are usually resolved by en + libc. These entry points should be supplied through some other + mechanism when this option is specified. + ++@item -nostdlib++ ++@opindex nostdlib++ ++Do not use the standard system C++ runtime libraries when linking. ++Only the libraries you specify will be passed to the linker. ++ + @cindex @option{-lgcc}, use with @option{-nostdlib} + @cindex @option{-nostdlib} and unresolved references + @cindex unresolved references and @option{-nostdlib} +Index: gcc-4.9-20140316/gcc/gcc.c +=================================================================== +--- gcc-4.9-20140316.orig/gcc/gcc.c ++++ gcc-4.9-20140316/gcc/gcc.c +@@ -772,6 +772,7 @@ proper position among the other output f + %(mflib) " STACK_SPLIT_SPEC "\ + %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \ + %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\ ++ %{!nostdlib++:}\ + %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}" + #endif + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch new file mode 100644 index 0000000..eb3c61f --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch @@ -0,0 +1,59 @@ +From 004696e054ae9dc71d512cc755ccc4074fc62b2d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:14:20 +0400 +Subject: [PATCH 21/35] gcc: disable MASK_RELAX_PIC_CALLS bit + +The new feature added after 4.3.3 +"http://www.pubbs.net/200909/gcc/94048-patch-add-support-for-rmipsjalr.html" +will cause cc1plus eat up all the system memory when build webkit-gtk. +The function mips_get_pic_call_symbol keeps on recursively calling itself. +Disable this feature to walk aside the bug. + +Signed-off-by: Dongxiao Xu +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [configuration] +--- + gcc/configure | 7 ------- + gcc/configure.ac | 7 ------- + 2 files changed, 14 deletions(-) + +diff --git a/gcc/configure b/gcc/configure +index b65d21d..bdab45a 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -25829,13 +25829,6 @@ $as_echo_n "checking assembler and linker for explicit JALR relocation... " >&6; + rm -f conftest.* + fi + fi +- if test $gcc_cv_as_ld_jalr_reloc = yes; then +- if test x$target_cpu_default = x; then +- target_cpu_default=MASK_RELAX_PIC_CALLS +- else +- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS" +- fi +- fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ld_jalr_reloc" >&5 + $as_echo "$gcc_cv_as_ld_jalr_reloc" >&6; } + +diff --git a/gcc/configure.ac b/gcc/configure.ac +index e226b85..5f5c909 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -4099,13 +4099,6 @@ x: + rm -f conftest.* + fi + fi +- if test $gcc_cv_as_ld_jalr_reloc = yes; then +- if test x$target_cpu_default = x; then +- target_cpu_default=MASK_RELAX_PIC_CALLS +- else +- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS" +- fi +- fi + AC_MSG_RESULT($gcc_cv_as_ld_jalr_reloc) + + AC_CACHE_CHECK([linker for .eh_frame personality relaxation], +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0022-COLLECT_GCC_OPTIONS.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0022-COLLECT_GCC_OPTIONS.patch new file mode 100644 index 0000000..40c8abf --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0022-COLLECT_GCC_OPTIONS.patch @@ -0,0 +1,38 @@ +From 7f5c9dcc71c8b83a0b5596266cc4bdf0936e8e00 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:16:28 +0400 +Subject: [PATCH 22/35] COLLECT_GCC_OPTIONS + +This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to +invoke collect2. + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/gcc.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/gcc/gcc.c b/gcc/gcc.c +index 477752f..51062aa 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -4098,6 +4098,15 @@ set_collect_gcc_options (void) + sizeof ("COLLECT_GCC_OPTIONS=") - 1); + + first_time = TRUE; ++#ifdef HAVE_LD_SYSROOT ++ if (target_system_root_changed && target_system_root) ++ { ++ obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1); ++ obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root)); ++ obstack_grow (&collect_obstack, "'", 1); ++ first_time = FALSE; ++ } ++#endif + for (i = 0; (int) i < n_switches; i++) + { + const char *const *args; +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch new file mode 100644 index 0000000..9e4435c --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch @@ -0,0 +1,88 @@ +From 46d52439052f0876a92dcf8a0ab9c60d75c8030b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:17:25 +0400 +Subject: [PATCH 23/35] Use the defaults.h in ${B} instead of ${S}, and t-oe + in ${B} + +Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that +the source can be shared between gcc-cross-initial, +gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build. + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/Makefile.in | 2 +- + gcc/configure | 4 ++-- + gcc/configure.ac | 4 ++-- + gcc/mkconfig.sh | 4 ++-- + 4 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 90a2bba..2320497 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -469,7 +469,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ + TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@ + + xmake_file=@xmake_file@ +-tmake_file=@tmake_file@ ++tmake_file=@tmake_file@ ./t-oe + TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@ + TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@ + TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@ +diff --git a/gcc/configure b/gcc/configure +index bdab45a..d587993 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -11539,8 +11539,8 @@ for f in $tm_file; do + tm_include_list="${tm_include_list} $f" + ;; + defaults.h ) +- tm_file_list="${tm_file_list} \$(srcdir)/$f" +- tm_include_list="${tm_include_list} $f" ++ tm_file_list="${tm_file_list} ./$f" ++ tm_include_list="${tm_include_list} ./$f" + ;; + * ) + tm_file_list="${tm_file_list} \$(srcdir)/config/$f" +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 5f5c909..5e5e84f 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -1720,8 +1720,8 @@ for f in $tm_file; do + tm_include_list="${tm_include_list} $f" + ;; + defaults.h ) +- tm_file_list="${tm_file_list} \$(srcdir)/$f" +- tm_include_list="${tm_include_list} $f" ++ tm_file_list="${tm_file_list} ./$f" ++ tm_include_list="${tm_include_list} ./$f" + ;; + * ) + tm_file_list="${tm_file_list} \$(srcdir)/config/$f" +diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh +index 29fdfc7..e048dce 100644 +--- a/gcc/mkconfig.sh ++++ b/gcc/mkconfig.sh +@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then + if [ $# -ge 1 ]; then + echo '#ifdef IN_GCC' >> ${output}T + for file in "$@"; do +- if test x"$file" = x"defaults.h"; then ++ if test x"$file" = x"./defaults.h"; then + postpone_defaults_h="yes" + else + echo "# include \"$file\"" >> ${output}T +@@ -103,7 +103,7 @@ esac + + # If we postponed including defaults.h, add the #include now. + if test x"$postpone_defaults_h" = x"yes"; then +- echo "# include \"defaults.h\"" >> ${output}T ++ echo "# include \"./defaults.h\"" >> ${output}T + fi + + # Add multiple inclusion protection guard, part two. +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0024-PR-target-32219.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0024-PR-target-32219.patch new file mode 100644 index 0000000..45acf7f --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0024-PR-target-32219.patch @@ -0,0 +1,62 @@ +From e0d15f4f8bf28c351b9215ca37f1caa24df0e1fd Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:18:54 +0400 +Subject: [PATCH 24/35] PR target/32219 + +* varasm.c (default_binds_local_p_1): Weak data is not local. + +Signed-off-by: Bernhard Reutner-Fischer +Signed-off-by: Khem Raj + +Upstream-Status: Backport +--- + gcc/testsuite/gcc.dg/visibility-21.c | 14 ++++++++++++++ + gcc/varasm.c | 9 ++++----- + 2 files changed, 18 insertions(+), 5 deletions(-) + create mode 100644 gcc/testsuite/gcc.dg/visibility-21.c + +Index: gcc-4.9-20140316/gcc/varasm.c +=================================================================== +--- gcc-4.9-20140316.orig/gcc/varasm.c ++++ gcc-4.9-20140316/gcc/varasm.c +@@ -6771,6 +6771,10 @@ default_binds_local_p_1 (const_tree exp, + /* Static variables are always local. */ + else if (! TREE_PUBLIC (exp)) + local_p = true; ++ /* hidden weak can't be overridden by something non-local, all ++ that is possible is that it is not defined at all. */ ++ else if (DECL_WEAK (exp)) ++ local_p = false; + /* A variable is local if the user has said explicitly that it will + be. */ + else if ((DECL_VISIBILITY_SPECIFIED (exp) +@@ -6784,11 +6788,6 @@ default_binds_local_p_1 (const_tree exp, + local. */ + else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT) + local_p = true; +- /* Default visibility weak data can be overridden by a strong symbol +- in another module and so are not local. */ +- else if (DECL_WEAK (exp) +- && !resolved_locally) +- local_p = false; + /* If PIC, then assume that any global name can be overridden by + symbols resolved from other modules. */ + else if (shlib) +Index: gcc-4.9-20140316/gcc/testsuite/gcc.dg/visibility-22.c +=================================================================== +--- /dev/null ++++ gcc-4.9-20140316/gcc/testsuite/gcc.dg/visibility-22.c +@@ -0,0 +1,13 @@ ++/* PR target/32219 */ ++/* { dg-do run } */ ++/* { dg-require-visibility "" } */ ++/* { dg-options "-fPIC" { target fpic } } */ ++ ++extern void f() __attribute__((weak,visibility("hidden"))); ++extern int puts( char const* ); ++int main() ++{ ++ if (f) ++ f(); ++ return 0; ++} diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0025-fortran-cross-compile-hack.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0025-fortran-cross-compile-hack.patch new file mode 100644 index 0000000..0e7914d --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0025-fortran-cross-compile-hack.patch @@ -0,0 +1,46 @@ +From af8a56ea4e17b2909eff2c57704ab43ef24f28d3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:20:01 +0400 +Subject: [PATCH 25/35] fortran cross-compile hack. + +* Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used +used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross +directory. + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [embedded specific] +--- + libgfortran/configure | 2 +- + libgfortran/configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libgfortran/configure b/libgfortran/configure +index 8385e96..b8f7a92 100755 +--- a/libgfortran/configure ++++ b/libgfortran/configure +@@ -12704,7 +12704,7 @@ esac + + # We need gfortran to compile parts of the library + #AC_PROG_FC(gfortran) +-FC="$GFORTRAN" ++#FC="$GFORTRAN" + ac_ext=${ac_fc_srcext-f} + ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' + ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac +index 7d97fed..3f9f484 100644 +--- a/libgfortran/configure.ac ++++ b/libgfortran/configure.ac +@@ -227,7 +227,7 @@ AC_SUBST(enable_static) + + # We need gfortran to compile parts of the library + #AC_PROG_FC(gfortran) +-FC="$GFORTRAN" ++#FC="$GFORTRAN" + AC_PROG_FC(gfortran) + + # extra LD Flags which are required for targets +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0026-libgcc-sjlj-check.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0026-libgcc-sjlj-check.patch new file mode 100644 index 0000000..d4efab9 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0026-libgcc-sjlj-check.patch @@ -0,0 +1,74 @@ +From 08c2398445e6cac282488f64ae6bf29cbcd8db23 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:20:50 +0400 +Subject: [PATCH 26/35] libgcc-sjlj-check + +ac_fn_c_try_compile doesnt seem to keep the intermediate files +which are needed for sjlj test to pass since it greps into the +generated file. So we run the compiler command using AC_TRY_COMMAND +which then generates the needed .s file + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + libgcc/configure | 10 ++++++---- + libgcc/configure.ac | 10 ++++------ + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/libgcc/configure b/libgcc/configure +index 1425df6..d18e3cb 100644 +--- a/libgcc/configure ++++ b/libgcc/configure +@@ -4208,17 +4208,19 @@ void foo () + } + + _ACEOF +-CFLAGS_hold=$CFLAGS +-CFLAGS="--save-temps -fexceptions" + libgcc_cv_lib_sjlj_exceptions=unknown +-if ac_fn_c_try_compile; then : ++if { ac_try='${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then + if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then + libgcc_cv_lib_sjlj_exceptions=yes + elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then + libgcc_cv_lib_sjlj_exceptions=no + fi + fi +-CFLAGS=$CFLAGS_hold + rm -f conftest* + + fi +diff --git a/libgcc/configure.ac b/libgcc/configure.ac +index 8b7aba5..c7c9644 100644 +--- a/libgcc/configure.ac ++++ b/libgcc/configure.ac +@@ -216,16 +216,14 @@ void foo () + bar(); + } + ])]) +-CFLAGS_hold=$CFLAGS +-CFLAGS="--save-temps -fexceptions" + libgcc_cv_lib_sjlj_exceptions=unknown +-AS_IF([ac_fn_c_try_compile], +- [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then ++if AC_TRY_COMMAND(${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then ++ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then + libgcc_cv_lib_sjlj_exceptions=yes + elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then + libgcc_cv_lib_sjlj_exceptions=no +- fi]) +-CFLAGS=$CFLAGS_hold ++ fi ++fi + rm -f conftest* + ]) + +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0027-cpp-honor-sysroot.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0027-cpp-honor-sysroot.patch new file mode 100644 index 0000000..05e9521 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0027-cpp-honor-sysroot.patch @@ -0,0 +1,54 @@ +From a0f9bd09c816ad29ecf7c29d6c27f7df97710364 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:22:00 +0400 +Subject: [PATCH 27/35] cpp: honor sysroot. + +Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile +preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location +rather than the --sysroot option specified on the commandline. If access to that directory is +permission denied (unreadable), gcc will error. + +This happens when ccache is in use due to the fact it uses preprocessed source files. + +The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix, +-isystem, -isysroot happen and the correct sysroot is used. + +[YOCTO #2074] + +RP 2012/04/13 + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/cp/lang-specs.h | 2 +- + gcc/gcc.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h +index a001c3e..1aae1e4 100644 +--- a/gcc/cp/lang-specs.h ++++ b/gcc/cp/lang-specs.h +@@ -63,5 +63,5 @@ along with GCC; see the file COPYING3. If not see + {".ii", "@c++-cpp-output", 0, 0, 0}, + {"@c++-cpp-output", + "%{!M:%{!MM:%{!E:\ +- cc1plus -fpreprocessed %i %(cc1_options) %2\ ++ cc1plus -fpreprocessed %i %I %(cc1_options) %2\ + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, +diff --git a/gcc/gcc.c b/gcc/gcc.c +index 51062aa..cf6b99e 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -1042,7 +1042,7 @@ static const struct compiler default_compilers[] = + %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0}, + {".i", "@cpp-output", 0, 0, 0}, + {"@cpp-output", +- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, ++ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, + {".s", "@assembler", 0, 0, 0}, + {"@assembler", + "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0}, +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0028-MIPS64-Default-to-N64-ABI.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0028-MIPS64-Default-to-N64-ABI.patch new file mode 100644 index 0000000..2638720 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0028-MIPS64-Default-to-N64-ABI.patch @@ -0,0 +1,31 @@ +From 301e18d4711db5925e767fad08dffa9cfe0a2f1f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:23:08 +0400 +Subject: [PATCH 28/35] MIPS64: Default to N64 ABI + +MIPS64 defaults to n32 ABI, this patch makes it +so that it defaults to N64 ABI + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [OE config specific] +--- + gcc/config.gcc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/config.gcc b/gcc/config.gcc +index 1a0be50..989c2fb 100644 +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -1797,7 +1797,7 @@ mips*-mti-linux*) + mips64*-*-linux* | mipsisa64*-*-linux*) + tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h" + tmake_file="${tmake_file} mips/t-linux64" +- tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32" ++ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_64" + case ${target} in + mips64el-st-linux-gnu) + tm_file="${tm_file} mips/st.h" +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch new file mode 100644 index 0000000..969d290 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch @@ -0,0 +1,228 @@ +From 29d12344fb682a053de53eb08b95704cf3b67af2 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:24:50 +0400 +Subject: [PATCH 29/35] Define GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER + relative to SYSTEMLIBS_DIR + +This patch defines GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER +relative to SYSTEMLIBS_DIR which can be set in generated headers +This breaks the assumption of hardcoded multilib in gcc +Change is only for the supported architectures in OE including +SH, sparc, alpha for possible future support (if any) + +Removes the do_headerfix task in metadata + +Signed-off-by: Khem Raj + +Upstream-Status: Inappropriate [OE configuration] +--- + gcc/config/alpha/linux-elf.h | 4 ++-- + gcc/config/arm/linux-eabi.h | 4 ++-- + gcc/config/arm/linux-elf.h | 2 +- + gcc/config/i386/linux.h | 2 +- + gcc/config/i386/linux64.h | 6 +++--- + gcc/config/mips/linux.h | 2 +- + gcc/config/mips/linux64.h | 8 ++++---- + gcc/config/rs6000/linux64.h | 8 ++++---- + gcc/config/sh/linux.h | 2 +- + gcc/config/sparc/linux.h | 2 +- + gcc/config/sparc/linux64.h | 4 ++-- + 11 files changed, 22 insertions(+), 22 deletions(-) + +Index: gcc-4.9.0/gcc/config/alpha/linux-elf.h +=================================================================== +--- gcc-4.9.0.orig/gcc/config/alpha/linux-elf.h 2014-05-07 16:43:50.609106535 +0000 ++++ gcc-4.9.0/gcc/config/alpha/linux-elf.h 2014-05-07 16:43:50.605106535 +0000 +@@ -23,8 +23,8 @@ + #define EXTRA_SPECS \ + { "elf_dynamic_linker", ELF_DYNAMIC_LINKER }, + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" +-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" ++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" ++#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0" + #if DEFAULT_LIBC == LIBC_UCLIBC + #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" + #elif DEFAULT_LIBC == LIBC_GLIBC +Index: gcc-4.9.0/gcc/config/arm/linux-eabi.h +=================================================================== +--- gcc-4.9.0.orig/gcc/config/arm/linux-eabi.h 2014-05-07 16:43:50.609106535 +0000 ++++ gcc-4.9.0/gcc/config/arm/linux-eabi.h 2014-05-07 16:43:50.605106535 +0000 +@@ -68,8 +68,8 @@ + GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ + + #undef GLIBC_DYNAMIC_LINKER +-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3" +-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3" ++#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT SYSTEMLIBS_DIR "ld-linux.so.3" ++#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT SYSTEMLIBS_DIR "ld-linux-armhf.so.3" + #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT + + #define GLIBC_DYNAMIC_LINKER \ +Index: gcc-4.9.0/gcc/config/arm/linux-elf.h +=================================================================== +--- gcc-4.9.0.orig/gcc/config/arm/linux-elf.h 2014-05-07 16:43:50.609106535 +0000 ++++ gcc-4.9.0/gcc/config/arm/linux-elf.h 2014-05-07 16:43:50.605106535 +0000 +@@ -57,7 +57,7 @@ + + #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" + + #define LINUX_TARGET_LINK_SPEC "%{h*} \ + %{static:-Bstatic} \ +Index: gcc-4.9.0/gcc/config/i386/linux.h +=================================================================== +--- gcc-4.9.0.orig/gcc/config/i386/linux.h 2014-05-07 16:43:50.609106535 +0000 ++++ gcc-4.9.0/gcc/config/i386/linux.h 2014-05-07 16:43:50.605106535 +0000 +@@ -20,4 +20,4 @@ + . */ + + #define GNU_USER_LINK_EMULATION "elf_i386" +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" +Index: gcc-4.9.0/gcc/config/i386/linux64.h +=================================================================== +--- gcc-4.9.0.orig/gcc/config/i386/linux64.h 2014-05-07 16:43:50.609106535 +0000 ++++ gcc-4.9.0/gcc/config/i386/linux64.h 2014-05-07 16:43:50.605106535 +0000 +@@ -27,6 +27,6 @@ + #define GNU_USER_LINK_EMULATION64 "elf_x86_64" + #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64" + +-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" +-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" +-#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" ++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2" ++#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2" +Index: gcc-4.9.0/gcc/config/mips/linux.h +=================================================================== +--- gcc-4.9.0.orig/gcc/config/mips/linux.h 2014-05-07 16:43:50.609106535 +0000 ++++ gcc-4.9.0/gcc/config/mips/linux.h 2014-05-07 16:43:50.605106535 +0000 +@@ -18,8 +18,8 @@ + . */ + + #define GLIBC_DYNAMIC_LINKER \ +- "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}" ++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}" + + #undef UCLIBC_DYNAMIC_LINKER + #define UCLIBC_DYNAMIC_LINKER \ +- "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}" ++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}" +Index: gcc-4.9.0/gcc/config/mips/linux64.h +=================================================================== +--- gcc-4.9.0.orig/gcc/config/mips/linux64.h 2014-05-07 16:43:50.609106535 +0000 ++++ gcc-4.9.0/gcc/config/mips/linux64.h 2014-05-07 16:43:50.605106535 +0000 +@@ -23,20 +23,20 @@ + #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32" + + #define GLIBC_DYNAMIC_LINKER32 \ +- "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}" ++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}" + #define GLIBC_DYNAMIC_LINKER64 \ +- "%{mnan=2008:/lib64/ld-linux-mipsn8.so.1;:/lib64/ld.so.1}" ++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}" + #define GLIBC_DYNAMIC_LINKERN32 \ +- "%{mnan=2008:/lib32/ld-linux-mipsn8.so.1;:/lib32/ld.so.1}" ++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}" + + #undef UCLIBC_DYNAMIC_LINKER32 + #define UCLIBC_DYNAMIC_LINKER32 \ +- "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}" ++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}" + #undef UCLIBC_DYNAMIC_LINKER64 + #define UCLIBC_DYNAMIC_LINKER64 \ +- "%{mnan=2008:/lib/ld64-uClibc-mipsn8.so.0;:/lib/ld64-uClibc.so.0}" ++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld64-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld64-uClibc.so.0}" + #define UCLIBC_DYNAMIC_LINKERN32 \ +- "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}" ++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}" + + #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" + #define GNU_USER_DYNAMIC_LINKERN32 \ +Index: gcc-4.9.0/gcc/config/rs6000/linux64.h +=================================================================== +--- gcc-4.9.0.orig/gcc/config/rs6000/linux64.h 2014-05-07 16:43:50.609106535 +0000 ++++ gcc-4.9.0/gcc/config/rs6000/linux64.h 2014-05-07 16:43:50.605106535 +0000 +@@ -367,14 +367,14 @@ + #undef LINK_OS_DEFAULT_SPEC + #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" + +-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1" ++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1" + #ifdef LINUX64_DEFAULT_ABI_ELFv2 +-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/lib64/ld64.so.2}" ++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:" SYSTEMLIBS_DIR "ld64.so.1;:" SYSTEMLIBS_DIR "ld64.so.2}" + #else +-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}" ++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:" SYSTEMLIBS_DIR "ld64.so.2;:" SYSTEMLIBS_DIR "ld64.so.1}" + #endif +-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" +-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" ++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0" ++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0" + #if DEFAULT_LIBC == LIBC_UCLIBC + #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" + #elif DEFAULT_LIBC == LIBC_GLIBC +Index: gcc-4.9.0/gcc/config/sh/linux.h +=================================================================== +--- gcc-4.9.0.orig/gcc/config/sh/linux.h 2014-05-07 16:43:50.609106535 +0000 ++++ gcc-4.9.0/gcc/config/sh/linux.h 2014-05-07 16:43:50.605106535 +0000 +@@ -43,7 +43,7 @@ + + #define TARGET_ASM_FILE_END file_end_indicate_exec_stack + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" + + #undef SUBTARGET_LINK_EMUL_SUFFIX + #define SUBTARGET_LINK_EMUL_SUFFIX "_linux" +Index: gcc-4.9.0/gcc/config/sparc/linux.h +=================================================================== +--- gcc-4.9.0.orig/gcc/config/sparc/linux.h 2014-05-07 16:43:50.609106535 +0000 ++++ gcc-4.9.0/gcc/config/sparc/linux.h 2014-05-07 16:43:50.605106535 +0000 +@@ -83,7 +83,7 @@ + When the -shared link option is used a final link is not being + done. */ + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" + + #undef LINK_SPEC + #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \ +Index: gcc-4.9.0/gcc/config/sparc/linux64.h +=================================================================== +--- gcc-4.9.0.orig/gcc/config/sparc/linux64.h 2014-05-07 16:43:50.609106535 +0000 ++++ gcc-4.9.0/gcc/config/sparc/linux64.h 2014-05-07 16:43:50.605106535 +0000 +@@ -92,8 +92,8 @@ + When the -shared link option is used a final link is not being + done. */ + +-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" +-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux.so.2" + + #ifdef SPARC_BI_ARCH + +Index: gcc-4.9.0/gcc/config/linux.h +=================================================================== +--- gcc-4.9.0.orig/gcc/config/linux.h 2014-05-07 16:43:50.609106535 +0000 ++++ gcc-4.9.0/gcc/config/linux.h 2014-05-07 16:43:50.605106535 +0000 +@@ -73,10 +73,10 @@ + GLIBC_DYNAMIC_LINKER must be defined for each target using them, or + GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets + supporting both 32-bit and 64-bit compilation. */ +-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" +-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" +-#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0" ++#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0" ++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0" ++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0" ++#define UCLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ldx32-uClibc.so.0" + #define BIONIC_DYNAMIC_LINKER "/system/bin/linker" + #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker" + #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0030-gcc-Fix-argument-list-too-long-error.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0030-gcc-Fix-argument-list-too-long-error.patch new file mode 100644 index 0000000..2ceaff6 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0030-gcc-Fix-argument-list-too-long-error.patch @@ -0,0 +1,40 @@ +From c1816c160156f99c34e6a0a0311bb0219326804e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:26:37 +0400 +Subject: [PATCH 30/35] gcc: Fix argument list too long error. + +There would be an "Argument list too long" error when the +build directory is longer than 200, this is caused by: + +headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u` + +The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle +it, use the $(sort list) of GNU make which can handle the too long list +would fix the problem, the header would be short enough after sorted. +The "tr ' ' '\012'" was used for translating the space to "\n", the +$(sort list) doesn't need this. + +Signed-off-by: Robert Yang +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 2320497..8562a62 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -4627,7 +4627,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype + # We keep the directory structure for files in config or c-family and .def + # files. All other files are flattened to a single directory. + $(mkinstalldirs) $(DESTDIR)$(plugin_includedir) +- headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`; \ ++ headers="$(sort $(PLUGIN_HEADERS))"; \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \ + for file in $$headers; do \ + if [ -f $$file ] ; then \ +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0031-Disable-sdt.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0031-Disable-sdt.patch new file mode 100644 index 0000000..2c1d5e0 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0031-Disable-sdt.patch @@ -0,0 +1,113 @@ +From b85265bc94ec1beaf1d3b697c03db62991553467 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:28:10 +0400 +Subject: [PATCH 31/35] Disable sdt. + +We don't list dtrace in DEPENDS so we shouldn't be depending on this header. +It may or may not exist from preivous builds though. To be determinstic, disable +sdt.h usage always. This avoids build failures if the header is removed after configure +but before libgcc is compiled for example. + +RP 2012/8/7 + +Signed-off-by: Khem Raj + +Disable sdt for libstdc++-v3. + +Signed-off-by: Robert Yang + +Upstream-Status: Inappropriate [hack] +--- + gcc/configure | 12 ++++++------ + gcc/configure.ac | 18 +++++++++--------- + libstdc++-v3/configure | 6 +++--- + libstdc++-v3/configure.ac | 2 +- + 4 files changed, 19 insertions(+), 19 deletions(-) + +diff --git a/gcc/configure b/gcc/configure +index 3c550a6..01c7626 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -26812,12 +26812,12 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5 + $as_echo_n "checking sys/sdt.h in the target C library... " >&6; } + have_sys_sdt_h=no +-if test -f $target_header_dir/sys/sdt.h; then +- have_sys_sdt_h=yes +- +-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h +- +-fi ++#if test -f $target_header_dir/sys/sdt.h; then ++# have_sys_sdt_h=yes ++# ++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h ++# ++#fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5 + $as_echo "$have_sys_sdt_h" >&6; } + +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 3601ab6..06e501f 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -4779,15 +4779,15 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then + fi + + # Test for on the target. +-GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H]) +-AC_MSG_CHECKING(sys/sdt.h in the target C library) +-have_sys_sdt_h=no +-if test -f $target_header_dir/sys/sdt.h; then +- have_sys_sdt_h=yes +- AC_DEFINE(HAVE_SYS_SDT_H, 1, +- [Define if your target C library provides sys/sdt.h]) +-fi +-AC_MSG_RESULT($have_sys_sdt_h) ++#GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H]) ++#AC_MSG_CHECKING(sys/sdt.h in the target C library) ++#have_sys_sdt_h=no ++#if test -f $target_header_dir/sys/sdt.h; then ++# have_sys_sdt_h=yes ++# AC_DEFINE(HAVE_SYS_SDT_H, 1, ++# [Define if your target C library provides sys/sdt.h]) ++#fi ++#AC_MSG_RESULT($have_sys_sdt_h) + + # Check if TFmode long double should be used by default or not. + # Some glibc targets used DFmode long double, but with glibc 2.4 +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index 4953c9f..53a1145 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -20578,11 +20578,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + +- if test $glibcxx_cv_sys_sdt_h = yes; then ++# if test $glibcxx_cv_sys_sdt_h = yes; then + +-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h ++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h + +- fi ++# fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sys_sdt_h" >&5 + $as_echo "$glibcxx_cv_sys_sdt_h" >&6; } + +diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac +index 73d430a..f2135e2 100644 +--- a/libstdc++-v3/configure.ac ++++ b/libstdc++-v3/configure.ac +@@ -211,7 +211,7 @@ GLIBCXX_CHECK_SC_NPROCESSORS_ONLN + GLIBCXX_CHECK_SC_NPROC_ONLN + GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP + GLIBCXX_CHECK_SYSCTL_HW_NCPU +-GLIBCXX_CHECK_SDT_H ++#GLIBCXX_CHECK_SDT_H + + # Check for available headers. + AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \ +-- +1.8.3.1 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0032-libtool.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0032-libtool.patch new file mode 100644 index 0000000..3b3d1b6 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0032-libtool.patch @@ -0,0 +1,42 @@ +From 6c715fcfa262adadca81c68a1f3f69aa3187a501 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:29:11 +0400 +Subject: [PATCH 32/35] libtool + +libstdc++ from gcc-runtime gets created with -rpath=/usr/lib/../lib for qemux86-64 +when running on am x86_64 build host. + +This patch stops this speading to libdir in the libstdc++.la file within libtool. +Arguably, it shouldn't be passing this into libtool in the first place but +for now this resolves the nastiest problems this causes. + +func_normal_abspath would resolve an empty path to `pwd` so we need +to filter the zero case. + +RP 2012/8/24 + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + ltmain.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/ltmain.sh b/ltmain.sh +index a03433f..46f47c2 100644 +--- a/ltmain.sh ++++ b/ltmain.sh +@@ -6359,6 +6359,10 @@ func_mode_link () + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" ++ if test -n "$install_libdir"; then ++ func_normal_abspath "$install_libdir" ++ install_libdir=$func_normal_abspath_result ++ fi + + oldlibs= + if test -z "$rpath"; then +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch new file mode 100644 index 0000000..b236c37 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch @@ -0,0 +1,40 @@ +From 97e4591c20310425e7aca0e6712a8d9480e7744c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:30:32 +0400 +Subject: [PATCH 33/35] gcc: armv4: pass fix-v4bx to linker to support EABI. + +The LINK_SPEC for linux gets overwritten by linux-eabi.h which +means the value of TARGET_FIX_V4BX_SPEC gets lost and as a result +the option is not passed to linker when chosing march=armv4 +This patch redefines this in linux-eabi.h and reinserts it +for eabi defaulting toolchains. + +We might want to send it upstream. + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + gcc/config/arm/linux-eabi.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +Index: gcc-4.9-20140316/gcc/config/arm/linux-eabi.h +=================================================================== +--- gcc-4.9-20140316.orig/gcc/config/arm/linux-eabi.h ++++ gcc-4.9-20140316/gcc/config/arm/linux-eabi.h +@@ -77,10 +77,14 @@ + %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ + %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" + ++/* For armv4 we pass --fix-v4bx to linker to support EABI */ ++#undef TARGET_FIX_V4BX_SPEC ++#define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +-#define LINK_SPEC EABI_LINK_SPEC \ ++#define LINK_SPEC TARGET_FIX_V4BX_SPEC EABI_LINK_SPEC \ + LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ + LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch new file mode 100644 index 0000000..66b9f89 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch @@ -0,0 +1,102 @@ +From fc5e4beaea856a2b486c770ad3addc0f5bb3100e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 Mar 2013 09:33:04 +0400 +Subject: [PATCH 34/35] Use the multilib config files from ${B} instead of + using the ones from ${S} + +Use the multilib config files from ${B} instead of using the ones from ${S} +so that the source can be shared between gcc-cross-initial, +gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build. + +Signed-off-by: Khem Raj +Signed-off-by: Constantin Musca + +Upstream-Status: Inappropriate [configuration] +--- + gcc/configure | 22 ++++++++++++++++++---- + gcc/configure.ac | 22 ++++++++++++++++++---- + 2 files changed, 36 insertions(+), 8 deletions(-) + +diff --git a/gcc/configure b/gcc/configure +index 8bc0c98..3cd0817 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -11519,10 +11519,20 @@ done + tmake_file_= + for f in ${tmake_file} + do +- if test -f ${srcdir}/config/$f +- then +- tmake_file_="${tmake_file_} \$(srcdir)/config/$f" +- fi ++ case $f in ++ */t-linux64 ) ++ if test -f ./config/$f ++ then ++ tmake_file_="${tmake_file_} ./config/$f" ++ fi ++ ;; ++ * ) ++ if test -f ${srcdir}/config/$f ++ then ++ tmake_file_="${tmake_file_} \$(srcdir)/config/$f" ++ fi ++ ;; ++ esac + done + tmake_file="${tmake_file_}" + +@@ -11533,6 +11543,10 @@ tm_file_list="options.h" + tm_include_list="options.h insn-constants.h" + for f in $tm_file; do + case $f in ++ */linux64.h ) ++ tm_file_list="${tm_file_list} ./config/$f" ++ tm_include_list="${tm_include_list} ./config/$f" ++ ;; + ./* ) + f=`echo $f | sed 's/^..//'` + tm_file_list="${tm_file_list} $f" +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 5e5e84f..415a6df 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -1700,10 +1700,20 @@ done + tmake_file_= + for f in ${tmake_file} + do +- if test -f ${srcdir}/config/$f +- then +- tmake_file_="${tmake_file_} \$(srcdir)/config/$f" +- fi ++ case $f in ++ */t-linux64 ) ++ if test -f ./config/$f ++ then ++ tmake_file_="${tmake_file_} ./config/$f" ++ fi ++ ;; ++ * ) ++ if test -f ${srcdir}/config/$f ++ then ++ tmake_file_="${tmake_file_} \$(srcdir)/config/$f" ++ fi ++ ;; ++ esac + done + tmake_file="${tmake_file_}" + +@@ -1714,6 +1724,10 @@ tm_file_list="options.h" + tm_include_list="options.h insn-constants.h" + for f in $tm_file; do + case $f in ++ */linux64.h ) ++ tm_file_list="${tm_file_list} ./config/$f" ++ tm_include_list="${tm_include_list} ./config/$f" ++ ;; + ./* ) + f=`echo $f | sed 's/^..//'` + tm_file_list="${tm_file_list} $f" +-- +1.7.10.4 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0037-gcc-4.8-PR56797.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0037-gcc-4.8-PR56797.patch new file mode 100644 index 0000000..b5d7b86 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0037-gcc-4.8-PR56797.patch @@ -0,0 +1,66 @@ +Upstream-Status: Backport +Signed-off-by: Khem Raj + +From patchwork Fri Apr 19 09:34:49 2013 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [ARM] Fix PR56797 +Date: Thu, 18 Apr 2013 23:34:49 -0000 +From: Greta Yorsh +X-Patchwork-Id: 237891 +Message-Id: <000801ce3ce1$23fbdd60$6bf39820$@yorsh@arm.com> +To: "GCC Patches" +Cc: , "Richard Earnshaw" , + "Ramana Radhakrishnan" + +Fix PR56797 +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56797 + +The problem is that peephole optimizer thinks it can generate an ldm, but +the pattern for ldm no longer matches, because after r188738 it requires +that if one of the destination registers is SP then the base register must +be SP, and it's not SP in the test case. + +The test case fails on armv5t but doesn't fail on armv6t2 or armv7-a because +peephole doesn't trigger there (because there is a different epilogue +sequence). It looks like a latent problem for other architecture or CPUs. + +This patch adds this condition to the peephole optimizer. + +No regression on qemu for arm-none-eabi and fixes the test reported in the +PR. I couldn't minimize the test sufficiently to include it in the +testsuite. + +Ok for trunk? + +Thanks, +Greta + +gcc/ + +2013-04-18 Greta Yorsh + + PR target/56797 + * config/arm/arm.c (load_multiple_sequence): Require SP + as base register for loads if SP is in the register list. + + +diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c +index d00849c..60fef78 100644 +--- a/gcc/config/arm/arm.c ++++ b/gcc/config/arm/arm.c +@@ -10347,6 +10347,13 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *saved_order, + || (i != nops - 1 && unsorted_regs[i] == base_reg)) + return 0; + ++ /* Don't allow SP to be loaded unless it is also the base ++ register. It guarantees that SP is reset correctly when ++ an LDM instruction is interruptted. Otherwise, we might ++ end up with a corrupt stack. */ ++ if (unsorted_regs[i] == SP_REGNUM && base_reg != SP_REGNUM) ++ return 0; ++ + unsorted_offsets[i] = INTVAL (offset); + if (i == 0 || unsorted_offsets[i] < unsorted_offsets[order[0]]) + order[0] = i; diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0040-fix-g++-sysroot.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0040-fix-g++-sysroot.patch new file mode 100644 index 0000000..d50aa5c --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0040-fix-g++-sysroot.patch @@ -0,0 +1,40 @@ +Portions of + +http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26013.html + +are not upstreamed yet. So lets keep missing pieces. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj + +Index: gcc-4.8.1/gcc/configure.ac +=================================================================== +--- gcc-4.8.1.orig/gcc/configure.ac 2013-07-15 15:55:49.488399132 -0700 ++++ gcc-4.8.1/gcc/configure.ac 2013-07-15 16:02:31.772406679 -0700 +@@ -148,7 +148,9 @@ + if test "${with_sysroot+set}" = set; then + gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` + if test "${gcc_gxx_without_sysroot}"; then +- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" ++ if test x${with_sysroot} != x/; then ++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" ++ fi + gcc_gxx_include_dir_add_sysroot=1 + fi + fi +Index: gcc-4.8.1/gcc/configure +=================================================================== +--- gcc-4.8.1.orig/gcc/configure 2013-07-15 15:55:49.472399132 -0700 ++++ gcc-4.8.1/gcc/configure 2013-07-15 16:02:31.780406680 -0700 +@@ -3325,7 +3325,9 @@ + if test "${with_sysroot+set}" = set; then + gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` + if test "${gcc_gxx_without_sysroot}"; then +- gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" ++ if test x${with_sysroot} != x/; then ++ gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" ++ fi + gcc_gxx_include_dir_add_sysroot=1 + fi + fi diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0041-libtool-avoid-libdir.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0041-libtool-avoid-libdir.patch new file mode 100644 index 0000000..2dd9610 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0041-libtool-avoid-libdir.patch @@ -0,0 +1,19 @@ +Avoid using libdir from .la which usually points to a host path + +Upstream-Status: Inappropriate [embedded specific] +Signed-off-by: Jonathan Liu + +diff --git a/ltmain.sh b/ltmain.sh +index a03433f..1902a90 100644 +--- a/ltmain.sh ++++ b/ltmain.sh +@@ -5628,6 +5628,9 @@ func_mode_link () + absdir="$abs_ladir" + libdir="$abs_ladir" + else ++ # Instead of using libdir from .la which usually points to a host path, ++ # use the path the .la is contained in. ++ libdir="$abs_ladir" + dir="$libdir" + absdir="$libdir" + fi diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0043-cpp.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0043-cpp.patch new file mode 100644 index 0000000..eaf8646 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0043-cpp.patch @@ -0,0 +1,40 @@ +The OE environment sets and exports CPP as being the target gcc. When building +gcc-cross-canadian for a mingw targetted sdk, the following can be found in +build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log: + +configure:3641: checking for _FILE_OFFSET_BITS value needed for large files +configure:3666: gcc -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe conftest.c >&5 +configure:3666: $? = 0 +configure:3698: result: no +configure:3786: checking how to run the C preprocessor +configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 +configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c +configure:3876: $? = 0 + +Note this is a *build* target (in build-x86_64-linux) so it should be using +the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32 headers are +very different, using the wrong cpp is a real problem. It is leaking into +configure through the CPP variable. Ultimately this leads to build failures +related to not being able to include a process.h file for pem-unix.c. + +The fix is to ensure we export a sane CPP value into the build environment when +using build targets. We could define a CPP_FOR_BUILD value which may be the version +which needs to be upstreamed but for now, this fix is good enough to avoid the +problem. + +RP 22/08/2013 + +Upstream-Status: Pending + +Index: gcc-4.8.1/Makefile.in +=================================================================== +--- gcc-4.8.1.orig/Makefile.in 2013-03-30 11:25:03.000000000 +0000 ++++ gcc-4.8.1/Makefile.in 2013-08-13 12:03:17.151988882 +0000 +@@ -149,6 +149,7 @@ + AR="$(AR_FOR_BUILD)"; export AR; \ + AS="$(AS_FOR_BUILD)"; export AS; \ + CC="$(CC_FOR_BUILD)"; export CC; \ ++ CPP="$(CC_FOR_BUILD) -E"; export CPP; \ + CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX_FOR_BUILD)"; export CXX; \ diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0044-gengtypes.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0044-gengtypes.patch new file mode 100644 index 0000000..e38761d --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0044-gengtypes.patch @@ -0,0 +1,97 @@ +gengtype is generated for both the build system and the target. -DGENERATOR_FILE +was added in the patch http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00273.html +and was applied to both versions of gengtype. + +Unfortunately the presence of this flag triggers the build configuration (bconfig.h) +to be included for the target build of gengtype. Compiling gengtype with the target +compiler and bconfig.h can result in errors if the build and target systems are +dissimilar. An example case this fails is cross compiling gcc on linux for a darwin +target system: + +In file included from /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c:25:0: +| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c: In function 'void parse_error(const char*, ...)': +| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/system.h:93:53: error: 'fputc_unlocked' was not declared in this scope +| # define fputc(C, Stream) fputc_unlocked (C, Stream) + +which occurs since auto-build.h and auto-host.h have differnet values of +HAVE_FPUTC_UNLOCKED: + +#define HAVE_FPUTC_UNLOCKED 1 +/* #undef HAVE_FPUTS_UNLOCKED */ + +The obvious fix is to only include the flag on build/ targets which this patch does, however +this also leads to compile errors due to const_tree being undefined but used in double_int.h + +I added a GENERATOR_FILE2 flag to workaround those in the +target case and allow the build to succeed. + +Only the build/gengtypes should have the -DGENERATOR_FILE + +RP 22/8/2013 + +Upstream-Status: Pending + +Index: gcc-4.8.1/gcc/Makefile.in +=================================================================== +--- gcc-4.8.1.orig/gcc/Makefile.in 2013-08-19 11:40:36.844014424 +0000 ++++ gcc-4.8.1/gcc/Makefile.in 2013-08-19 11:40:37.784014402 +0000 +@@ -3903,27 +3903,29 @@ + + gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H) + gengtype-lex.o: $(CONFIG_H) $(BCONFIG_H) +-CFLAGS-gengtype-lex.o += -DGENERATOR_FILE ++CFLAGS-build/gengtype-lex.o += -DGENERATOR_FILE + build/gengtype-lex.o: $(BCONFIG_H) + + gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \ + $(SYSTEM_H) + gengtype-parse.o: $(CONFIG_H) +-CFLAGS-gengtype-parse.o += -DGENERATOR_FILE ++CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE + build/gengtype-parse.o: $(BCONFIG_H) + + gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \ + gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \ + $(XREGEX_H) + gengtype-state.o: $(CONFIG_H) +-CFLAGS-gengtype-state.o += -DGENERATOR_FILE ++CFLAGS-gengtype-state.o += -DGENERATOR_FILE2 ++CFLAGS-build/gengtype-state.o += -DGENERATOR_FILE + build/gengtype-state.o: $(BCONFIG_H) + + gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h \ + rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \ + $(OBSTACK_H) $(XREGEX_H) + gengtype.o: $(CONFIG_H) +-CFLAGS-gengtype.o += -DGENERATOR_FILE ++CFLAGS-gengtype.o += -DGENERATOR_FILE2 ++CFLAGS-build/gengtype.o += -DGENERATOR_FILE + build/gengtype.o: $(BCONFIG_H) + + build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \ +@@ -3988,7 +3990,7 @@ + # any system header is included. + gengtype-lex.c : gengtype-lex.l + -$(FLEX) $(FLEXFLAGS) -o$@ $< && { \ +- echo '#include "bconfig.h"' > $@.tmp; \ ++ echo '' > $@.tmp; \ + cat $@ >> $@.tmp; \ + mv $@.tmp $@; \ + } +Index: gcc-4.8.1/gcc/double-int.h +=================================================================== +--- gcc-4.8.1.orig/gcc/double-int.h 2013-01-30 11:04:30.000000000 +0000 ++++ gcc-4.8.1/gcc/double-int.h 2013-08-19 11:41:51.564012719 +0000 +@@ -448,10 +448,12 @@ + + + #ifndef GENERATOR_FILE ++#ifndef GENERATOR_FILE2 + /* Conversion to and from GMP integer representations. */ + + void mpz_set_double_int (mpz_t, double_int, bool); + double_int mpz_get_double_int (const_tree, mpz_t, bool); + #endif ++#endif + + #endif /* DOUBLE_INT_H */ diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0046-libatomic-deptracking.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0046-libatomic-deptracking.patch new file mode 100644 index 0000000..6ea4f42 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0046-libatomic-deptracking.patch @@ -0,0 +1,41 @@ +gcc 4.8 won't build with --disable-dependency-tracking since the *.Ppo files +don't get created unless --enable-dependency-tracking is true. + +This patch ensures we only use those compiler options when its enabled. + +Upstream-Status: Submitted + +(Problem was already reported upstream, attached this patch there +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55930) + +RP +2012/09/22 + +Index: gcc-4.8.1/libatomic/Makefile.am +=================================================================== +--- gcc-4.8.1.orig/libatomic/Makefile.am 2013-01-14 18:16:23.000000000 +0000 ++++ gcc-4.8.1/libatomic/Makefile.am 2013-09-22 10:38:18.904064750 +0000 +@@ -100,7 +100,8 @@ + IFUNC_DEF = -DIFUNC_ALT=$(PAT_S) + IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS)) + +-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo ++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo ++@AMDEP_FALSE@M_DEPS = + M_SIZE = -DN=$(PAT_N) + M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT)) + M_FILE = $(PAT_BASE)_n.c +Index: gcc-4.8.1/libatomic/Makefile.in +=================================================================== +--- gcc-4.8.1.orig/libatomic/Makefile.in 2013-05-31 09:09:26.000000000 +0000 ++++ gcc-4.8.1/libatomic/Makefile.in 2013-09-22 10:40:42.520059917 +0000 +@@ -298,7 +298,8 @@ + PAT_S = $(word 3,$(PAT_SPLIT)) + IFUNC_DEF = -DIFUNC_ALT=$(PAT_S) + IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS)) +-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo ++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo ++@AMDEP_FALSE@M_DEPS = + M_SIZE = -DN=$(PAT_N) + M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT)) + M_FILE = $(PAT_BASE)_n.c diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0047-repomembug.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0047-repomembug.patch new file mode 100644 index 0000000..9afd55c --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0047-repomembug.patch @@ -0,0 +1,53 @@ +When compiling a project using -frepo, .rpo files are written alongside +the .o file, the symbols either have O or C against them. During final linking, +the objects can be recompiled with some of the entries tweaked/chosen by the +tlink.c code (visible with TLINK_VERBOSE=3), it does this by changing O -> C +in the .rpo files. + +My tests showed that init_repo (cp/repo.c) was correctly calling +IDENTIFIER_REPO_CHOSEN against the right identifers and setting the +chosen bit. + +By the time finish_repo() or emit_repo_p() were called, the pointer returned +by get_identifier() for the symbol marked during init_repo had changed and +the chosen bit was no longer set. This lead to linking bugs like: + +collect: relinking +collect2: error: '_ZNK6sudoku5ClearINS_8SequenceEEclERS1_' was assigned to 'board.rpo', but was not defined during recompilation, or vice versa + +The problem is that the garbage collection is getting called before +finish_repo() is called and ggc_protect_identifiers is set to false +so the identifiers are not preserved. They are recreated but the +chosen bits get wiped out which is why the pointer changes and the +chosen bit is not set. + +The fix is to change ggc_protect_identifiers *after* the finish_repo +calls are made. + +Reproduction is tricky since you need to trigger the garbage collector at +just the right moment. + +RP 2013/10/9 + +[YOCTO #5133] + +Upstream-Status: Pending + +Index: gcc-4.8.1/gcc/toplev.c +=================================================================== +--- gcc-4.8.1.orig/gcc/toplev.c 2013-03-28 08:29:51.000000000 +0000 ++++ gcc-4.8.1/gcc/toplev.c 2013-10-09 20:27:17.089228023 +0000 +@@ -551,11 +551,11 @@ + if (flag_syntax_only || flag_wpa) + return; + +- ggc_protect_identifiers = false; +- + /* This must also call finalize_compilation_unit. */ + lang_hooks.decls.final_write_globals (); + ++ ggc_protect_identifiers = false; ++ + if (seen_error ()) + return; + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch new file mode 100644 index 0000000..b98f8ff --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch @@ -0,0 +1,42 @@ +From 9e0e19eac2562f73858602fe26e2044eb8b20c47 Mon Sep 17 00:00:00 2001 +From: Alexandru-Cezar Sardan +Date: Wed, 5 Feb 2014 16:52:31 +0200 +Subject: [PATCH] Enable SPE & AltiVec generation on powepc*linux target + +When is configured with --target=powerpc-linux, the resulting GCC will +not be able to generate code for SPE targets (e500v1/v2). +GCC configured with --target=powerpc-linuxspe will not be able to +generate AltiVec instructions (for e6500). +This patch modifies the configured file such that SPE or AltiVec code +can be generated when gcc is configured with --target=powerpc-linux. +The ABI and speciffic instructions can be selected through the +"-mabi=spe or -mabi=altivec" and the "-mspe or -maltivec" parameters. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Alexandru-Cezar Sardan +--- + gcc/config.gcc | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/gcc/config.gcc b/gcc/config.gcc +index cb7a94e..d392c2b 100644 +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -2068,7 +2068,12 @@ powerpc-*-rtems*) + tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm" + ;; + powerpc*-*-linux*) +- tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h" ++ case ${target} in ++ powerpc*-*-linux*spe* | powerpc*-*-linux*altivec*) ++ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h" ;; ++ *) ++ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h rs6000/linuxaltivec.h rs6000/linuxspe.h rs6000/e500.h" ;; ++ esac + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" + case ${target} in +-- +1.7.9.5 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch new file mode 100644 index 0000000..aead6f6 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch @@ -0,0 +1,80 @@ +Upstream-Status: Pending + +From cb9b1c041b634a4c128896e3d3eed4082608c797 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 3 May 2014 19:25:17 -0700 +Subject: [PATCH] Revert "2013-05-21 Christian Bruel + " + +This reverts commit 3983036a8b6b2710c57777194f21507819a73553. + +Signed-off-by: Khem Raj + +Conflicts: + gcc/ChangeLog +--- + gcc/ChangeLog | 219 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- + gcc/dwarf2out.c | 33 +++++---- + 2 files changed, 234 insertions(+), 18 deletions(-) + +diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c +index 1272326..6ac2b28 100644 +--- a/gcc/dwarf2out.c ++++ b/gcc/dwarf2out.c +@@ -10870,27 +10870,25 @@ static dw_loc_descr_ref + multiple_reg_loc_descriptor (rtx rtl, rtx regs, + enum var_init_status initialized) + { +- int size, i; ++ int nregs, size, i; ++ unsigned reg; + dw_loc_descr_ref loc_result = NULL; + +- /* Simple, contiguous registers. */ +- if (regs == NULL_RTX) +- { +- unsigned reg = REGNO (rtl); +- int nregs; +- ++ reg = REGNO (rtl); + #ifdef LEAF_REG_REMAP +- if (crtl->uses_only_leaf_regs) +- { +- int leaf_reg = LEAF_REG_REMAP (reg); +- if (leaf_reg != -1) +- reg = (unsigned) leaf_reg; +- } ++ if (crtl->uses_only_leaf_regs) ++ { ++ int leaf_reg = LEAF_REG_REMAP (reg); ++ if (leaf_reg != -1) ++ reg = (unsigned) leaf_reg; ++ } + #endif ++ gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl)); ++ nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)]; + +- gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl)); +- nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)]; +- ++ /* Simple, contiguous registers. */ ++ if (regs == NULL_RTX) ++ { + size = GET_MODE_SIZE (GET_MODE (rtl)) / nregs; + + loc_result = NULL; +@@ -10918,9 +10916,10 @@ multiple_reg_loc_descriptor (rtx rtl, rtx regs, + { + dw_loc_descr_ref t; + +- t = one_reg_loc_descriptor (dbx_reg_number (XVECEXP (regs, 0, i)), ++ t = one_reg_loc_descriptor (REGNO (XVECEXP (regs, 0, i)), + VAR_INIT_STATUS_INITIALIZED); + add_loc_descr (&loc_result, t); ++ size = GET_MODE_SIZE (GET_MODE (XVECEXP (regs, 0, 0))); + add_loc_descr_op_piece (&loc_result, size); + } + +-- +1.9.2 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0051-eabispe.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0051-eabispe.patch new file mode 100644 index 0000000..55e3890 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0051-eabispe.patch @@ -0,0 +1,23 @@ +Upstream-Status: Pending + +Taken from http://gcc.gnu.org/ml/gcc-patches/2014-04/msg02064.html + +2014-04-30 Cesar Philippidis + + gcc/ + * dwarf2cfi.c (dwf_regno): Don't assert reg is a pseudo + register. + + +diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c +index 4180890..40ef0e2 100644 +--- a/gcc/dwarf2cfi.c ++++ b/gcc/dwarf2cfi.c +@@ -906,7 +906,6 @@ notice_eh_throw (rtx insn) + static inline unsigned + dwf_regno (const_rtx reg) + { +- gcc_assert (REGNO (reg) < FIRST_PSEUDO_REGISTER); + return DWARF_FRAME_REGNUM (REGNO (reg)); + } + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0052-Fix-GCC-targeting-E500-SPE-errors-with-the-_Decimal64-type.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0052-Fix-GCC-targeting-E500-SPE-errors-with-the-_Decimal64-type.patch new file mode 100644 index 0000000..b4be18e --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0052-Fix-GCC-targeting-E500-SPE-errors-with-the-_Decimal64-type.patch @@ -0,0 +1,98 @@ +From e44a6d438db4848c2a555be773568a3cf7994206 Mon Sep 17 00:00:00 2001 +From: Alexandru-Cezar Sardan +Date: Mon, 26 May 2014 12:11:13 +0300 +Subject: [PATCH] Fix E500 with SPE errors with the _Decimal64 type + +[gcc] +2014-04-21 Michael Meissner + + PR target/60735 + * config/rs6000/rs6000.md (mov_softfloat32, FMOVE64 case): + If mode is DDmode and TARGET_E500_DOUBLE allow move. + + * config/rs6000/rs6000.c (rs6000_debug_reg_global): Print some + more debug information for E500 if -mdebug=reg. + +[gcc/testsuite] +2014-04-21 Michael Meissner + + PR target/60735 + * gcc.target/powerpc/pr60735.c: New test. Insure _Decimal64 does + not cause errors if -mspe. + +Upstream status: Accepted + +This solves upstream bug 60735 +(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60735). + +Patch taken from https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=209664 +--- + gcc/config/rs6000/rs6000.c | 18 ++++++++++++++++++ + gcc/config/rs6000/rs6000.md | 3 ++- + gcc/testsuite/gcc.target/powerpc/pr60735.c | 11 +++++++++++ + 3 files changed, 31 insertions(+), 1 deletion(-) + create mode 100644 gcc/testsuite/gcc.target/powerpc/pr60735.c + +diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c +index 494efc5..6dcf440 100644 +--- a/gcc/config/rs6000/rs6000.c ++++ b/gcc/config/rs6000/rs6000.c +@@ -2283,6 +2283,24 @@ rs6000_debug_reg_global (void) + if (rs6000_float_gprs) + fprintf (stderr, DEBUG_FMT_S, "float_gprs", "true"); + ++ fprintf (stderr, DEBUG_FMT_S, "fprs", ++ (TARGET_FPRS ? "true" : "false")); ++ ++ fprintf (stderr, DEBUG_FMT_S, "single_float", ++ (TARGET_SINGLE_FLOAT ? "true" : "false")); ++ ++ fprintf (stderr, DEBUG_FMT_S, "double_float", ++ (TARGET_DOUBLE_FLOAT ? "true" : "false")); ++ ++ fprintf (stderr, DEBUG_FMT_S, "soft_float", ++ (TARGET_SOFT_FLOAT ? "true" : "false")); ++ ++ fprintf (stderr, DEBUG_FMT_S, "e500_single", ++ (TARGET_E500_SINGLE ? "true" : "false")); ++ ++ fprintf (stderr, DEBUG_FMT_S, "e500_double", ++ (TARGET_E500_DOUBLE ? "true" : "false")); ++ + if (TARGET_LINK_STACK) + fprintf (stderr, DEBUG_FMT_S, "link_stack", "true"); + +diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md +index 64c9e7c..9cefe15 100644 +--- a/gcc/config/rs6000/rs6000.md ++++ b/gcc/config/rs6000/rs6000.md +@@ -9395,7 +9395,8 @@ + (match_operand:FMOVE64 1 "input_operand" "r,Y,r,G,H,F"))] + "! TARGET_POWERPC64 + && ((TARGET_FPRS && TARGET_SINGLE_FLOAT) +- || TARGET_SOFT_FLOAT || TARGET_E500_SINGLE) ++ || TARGET_SOFT_FLOAT || TARGET_E500_SINGLE ++ || (mode == DDmode && TARGET_E500_DOUBLE)) + && (gpc_reg_operand (operands[0], mode) + || gpc_reg_operand (operands[1], mode))" + "#" +diff --git a/gcc/testsuite/gcc.target/powerpc/pr60735.c b/gcc/testsuite/gcc.target/powerpc/pr60735.c +new file mode 100644 +index 0000000..9bac30b +--- /dev/null ++++ b/gcc/testsuite/gcc.target/powerpc/pr60735.c +@@ -0,0 +1,11 @@ ++/* { dg-do compile } */ ++/* { dg-options "-mcpu=8548 -mspe -mabi=spe -O2" } */ ++/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */ ++ ++/* In PR60735, the type _Decimal64 generated an insn not found message. */ ++ ++void ++pr60735 (_Decimal64 *p, _Decimal64 *q) ++{ ++ *p = *q; ++} +-- +1.7.9.5 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch new file mode 100644 index 0000000..23b445c --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch @@ -0,0 +1,66 @@ +From a22a222c8f9299f6c07a0274388ade7d4ab8c28d Mon Sep 17 00:00:00 2001 +From: Paul Gortmaker +Date: Fri, 20 Jun 2014 16:41:08 -0400 +Subject: [PATCH] gcc: fix segfault from calling free on non-malloc'd area + +We see the following on a 32bit gcc installed on 64 bit host: + + Reading symbols from ./i586-pokymllib32-linux-gcc...done. + (gdb) run + Starting program: x86-pokymllib32-linux/lib32-gcc/4.9.0-r0/image/usr/bin/i586-pokymllib32-linux-gcc + + Program received signal SIGSEGV, Segmentation fault. + 0xf7e957e0 in free () from /lib/i386-linux-gnu/libc.so.6 + (gdb) bt + #0 0xf7e957e0 in free () from /lib/i386-linux-gnu/libc.so.6 + #1 0x0804b73c in set_multilib_dir () at gcc-4.9.0/gcc/gcc.c:7827 + #2 main (argc=1, argv=0xffffd504) at gcc-4.9.0/gcc/gcc.c:6688 + (gdb) + +The problem arises because we conditionally assign the pointer we +eventually free, and the conditional may assign the pointer to the +non-malloc'd internal string "." which fails when we free it here: + + if (multilib_dir == NULL && multilib_os_dir != NULL + && strcmp (multilib_os_dir, ".") == 0) + { + free (CONST_CAST (char *, multilib_os_dir)); + ... + +As suggested by Jakub, ensure the "." case is also malloc'd via +xstrdup() and hence the pointer for the "." case can be freed. + +Cc: Jakub Jelinek +Cc: Jeff Law +Cc: Matthias Klose +CC: Tobias Burnus +Upstream-Status: Accepted [ https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02069.html ] +Signed-off-by: Paul Gortmaker + +diff --git a/gcc/gcc.c b/gcc/gcc.c +index 9ac18e60d801..168acf7eb0c9 100644 +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -7790,10 +7790,15 @@ set_multilib_dir (void) + q2++; + if (*q2 == ':') + ml_end = q2; +- new_multilib_os_dir = XNEWVEC (char, ml_end - q); +- memcpy (new_multilib_os_dir, q + 1, ml_end - q - 1); +- new_multilib_os_dir[ml_end - q - 1] = '\0'; +- multilib_os_dir = *new_multilib_os_dir ? new_multilib_os_dir : "."; ++ if (ml_end - q == 1) ++ multilib_os_dir = xstrdup ("."); ++ else ++ { ++ new_multilib_os_dir = XNEWVEC (char, ml_end - q); ++ memcpy (new_multilib_os_dir, q + 1, ml_end - q - 1); ++ new_multilib_os_dir[ml_end - q - 1] = '\0'; ++ multilib_os_dir = new_multilib_os_dir; ++ } + + if (q2 < end && *q2 == ':') + { +-- +1.9.2 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch new file mode 100644 index 0000000..4c98ca2 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch @@ -0,0 +1,61 @@ +gcc/Makefile.in: fix parallel building failure + +The gcc-ar.o, gcc-nm.o, gcc-ranlib.o and errors.o included +config.h which was a generated file. But no explicity rule +to clarify the dependency. There was potential building +failure while parallel make. + +For gcc-ar.o, gcc-nm.o and gcc-ranlib.o, they were compiled from one C +source file gcc-ar.c, we add them to ALL_HOST_BACKEND_OBJS, so the +'$(ALL_HOST_OBJS) : | $(generated_files)' rule could work for these +objects. + +For errors.o, it is part of gengtype, and the gengtype generator program +is special: Two versions are built. One is for the build machine, and one +is for the host. We refered what gengtype-parse.o did (which also is part +of gengtype). + +[GCC #61899] +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61899 + +Upstream-Status: Send to gcc-patches@gcc.gnu.org mailing list + +Signed-off-by: Hongxu Jia +--- + gcc/Makefile.in | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 6475cba..56e50bb 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -1481,13 +1481,16 @@ OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \ + opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \ + hash-table.o file-find.o + ++# Objects compiled from one C source file gcc-ar.c ++OBJS-gcc-ar = gcc-ar.o gcc-nm.o gcc-ranlib.o ++ + # This lists all host objects for the front ends. + ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS)) + + ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \ + $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \ + $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \ +- lto-wrapper.o ++ lto-wrapper.o $(OBJS-gcc-ar) + + # This lists all host object files, whether they are included in this + # compilation or not. +@@ -2437,6 +2440,8 @@ gengtype-parse.o: $(CONFIG_H) + CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE + build/gengtype-parse.o: $(BCONFIG_H) + ++errors.o : $(CONFIG_H) ++ + gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \ + gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \ + $(XREGEX_H) +-- +1.8.1.2 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0055-PR-rtl-optimization-61801.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0055-PR-rtl-optimization-61801.patch new file mode 100644 index 0000000..b27abde --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0055-PR-rtl-optimization-61801.patch @@ -0,0 +1,36 @@ +From 556537c4ad0df4cbebb74197bb2bdea75cf5dd35 Mon Sep 17 00:00:00 2001 +From: rguenth +Date: Thu, 17 Jul 2014 07:48:49 +0000 +Subject: [PATCH] 2014-07-17 Richard Biener + + PR rtl-optimization/61801 + * sched-deps.c (sched_analyze_2): For ASM_OPERANDS and + ASM_INPUT don't set reg_pending_barrier if it appears in a + debug-insn. + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@212739 138bc75d-0d04-0410-961f-82ee72b054a4 + +Upstream-Status: Backport [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801] +Signed-off-by: Peter A. Bigot + +--- + gcc/sched-deps.c | 3 ++- + +diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c +index efc4223..df29bd3 100644 +--- a/gcc/sched-deps.c ++++ b/gcc/sched-deps.c +@@ -2750,7 +2750,8 @@ sched_analyze_2 (struct deps_desc *deps, rtx x, rtx insn) + Consider for instance a volatile asm that changes the fpu rounding + mode. An insn should not be moved across this even if it only uses + pseudo-regs because it might give an incorrectly rounded result. */ +- if (code != ASM_OPERANDS || MEM_VOLATILE_P (x)) ++ if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x)) ++ && !DEBUG_INSN_P (insn)) + reg_pending_barrier = TRUE_BARRIER; + + /* For all ASM_OPERANDS, we must traverse the vector of input operands. +-- +1.8.5.5 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0056-top-level-reorder_gcc-bug-61144.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0056-top-level-reorder_gcc-bug-61144.patch new file mode 100644 index 0000000..f448932 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0056-top-level-reorder_gcc-bug-61144.patch @@ -0,0 +1,31 @@ + +Upstream-Status: Backport + +Originally-submitted-by: Peter Urbanec +Signed-off-by: Saul Wold + +--- /dev/null ++++ b/meta/recipes-devtools/gcc/gcc-4.9/0056-top-level-reorder_gcc-bug-61144.patch +@@ -0,0 +1,21 @@ ++--- a/gcc/varpool.c 2014/10/05 02:50:01 215895 +++++ b/gcc/varpool.c 2014/10/05 04:52:19 215896 ++@@ -329,8 +329,16 @@ ++ ++ /* Variables declared 'const' without an initializer ++ have zero as the initializer if they may not be ++- overridden at link or run time. */ ++- if (!DECL_INITIAL (real_decl) +++ overridden at link or run time. +++ +++ It is actually requirement for C++ compiler to optimize const variables +++ consistently. As a GNU extension, do not enfore this rule for user defined +++ weak variables, so we support interposition on: +++ static const int dummy = 0; +++ extern const int foo __attribute__((__weak__, __alias__("dummy"))); +++ */ +++ if ((!DECL_INITIAL (real_decl) +++ || (DECL_WEAK (decl) && !DECL_COMDAT (decl))) ++ && (DECL_EXTERNAL (decl) || decl_replaceable_p (decl))) ++ return error_mark_node; ++ + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0058-gcc-r212171.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0058-gcc-r212171.patch new file mode 100644 index 0000000..4b312d4 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0058-gcc-r212171.patch @@ -0,0 +1,113 @@ +From ca03cf1b133d66eb978c68f6dbc345e9aabcba88 Mon Sep 17 00:00:00 2001 +From: uros +Date: Mon, 30 Jun 2014 19:30:52 +0000 +Subject: [PATCH] r212171 + +* except.c (emit_note_eh_region_end): New helper + function. (convert_to_eh_region_ranges): Use + emit_note_eh_region_end to emit EH_REGION_END note. + * jump.c (cleanup_barriers): Do not split a call and its + corresponding CALL_ARG_LOCATION note. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212171 138bc75d-0d04-0410-961f-82ee72b054a4 + +Upstream-status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=212171] +Signed-off-by: Baoshan Pang +--- + gcc/except.c | 23 ++++++++++++++++++----- + gcc/jump.c | 19 +++++++++++++++---- + 2 files changed, 33 insertions(+), 9 deletions(-) + +diff --git a/gcc/except.c b/gcc/except.c +index dc5c1d2..7ac114f 100644 +--- a/gcc/except.c ++++ b/gcc/except.c +@@ -2466,6 +2466,20 @@ add_call_site (rtx landing_pad, int action, int section) + return call_site_base + crtl->eh.call_site_record_v[section]->length () - 1; + } + ++static rtx ++emit_note_eh_region_end (rtx insn) ++{ ++ rtx next = NEXT_INSN (insn); ++ ++ /* Make sure we do not split a call and its corresponding ++ CALL_ARG_LOCATION note. */ ++ if (next && NOTE_P (next) ++ && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION) ++ insn = next; ++ ++ return emit_note_after (NOTE_INSN_EH_REGION_END, insn); ++} ++ + /* Turn REG_EH_REGION notes back into NOTE_INSN_EH_REGION notes. + The new note numbers will not refer to region numbers, but + instead to call site entries. */ +@@ -2544,8 +2558,8 @@ convert_to_eh_region_ranges (void) + note = emit_note_before (NOTE_INSN_EH_REGION_BEG, + first_no_action_insn_before_switch); + NOTE_EH_HANDLER (note) = call_site; +- note = emit_note_after (NOTE_INSN_EH_REGION_END, +- last_no_action_insn_before_switch); ++ note ++ = emit_note_eh_region_end (last_no_action_insn_before_switch); + NOTE_EH_HANDLER (note) = call_site; + gcc_assert (last_action != -3 + || (last_action_insn +@@ -2569,8 +2583,7 @@ convert_to_eh_region_ranges (void) + first_no_action_insn = NULL_RTX; + } + +- note = emit_note_after (NOTE_INSN_EH_REGION_END, +- last_action_insn); ++ note = emit_note_eh_region_end (last_action_insn); + NOTE_EH_HANDLER (note) = call_site; + } + +@@ -2617,7 +2630,7 @@ convert_to_eh_region_ranges (void) + + if (last_action >= -1 && ! first_no_action_insn) + { +- note = emit_note_after (NOTE_INSN_EH_REGION_END, last_action_insn); ++ note = emit_note_eh_region_end (last_action_insn); + NOTE_EH_HANDLER (note) = call_site; + } + +diff --git a/gcc/jump.c b/gcc/jump.c +index 9418f65..a5e5f52 100644 +--- a/gcc/jump.c ++++ b/gcc/jump.c +@@ -121,15 +121,26 @@ rebuild_jump_labels_chain (rtx chain) + static unsigned int + cleanup_barriers (void) + { +- rtx insn, next, prev; +- for (insn = get_insns (); insn; insn = next) ++ rtx insn; ++ for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + { +- next = NEXT_INSN (insn); + if (BARRIER_P (insn)) + { +- prev = prev_nonnote_insn (insn); ++ rtx prev = prev_nonnote_insn (insn); + if (!prev) + continue; ++ ++ if (CALL_P (prev)) ++ { ++ /* Make sure we do not split a call and its corresponding ++ CALL_ARG_LOCATION note. */ ++ rtx next = NEXT_INSN (prev); ++ ++ if (NOTE_P (next) ++ && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION) ++ prev = next; ++ } ++ + if (BARRIER_P (prev)) + delete_insn (insn); + else if (prev != PREV_INSN (insn)) +-- +1.7.9.5 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0059-gcc-PR-rtl-optimization-63348.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0059-gcc-PR-rtl-optimization-63348.patch new file mode 100644 index 0000000..6d24aa4 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/0059-gcc-PR-rtl-optimization-63348.patch @@ -0,0 +1,59 @@ +From 6eae3e637fcc22d21b51d44d61e3a9cb4825e776 Mon Sep 17 00:00:00 2001 +From: Jackie Huang +Date: Thu, 30 Oct 2014 20:37:14 -0700 +Subject: [PATCH]PR rtl-optimization/63348 + +PR rtl-optimization/63348 +* emit-rtl.c (try_split): Do not emit extra barrier. + +Note: this patch is to fix the side effect introduced by r212171 which was reported at: +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63348 + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215613 138bc75d-0d04-0410-961f-82ee72b054a4 + +Upstream-status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=215613] +Signed-off-by: Baoshan Pang +Signed-off-by: Jackie Huang +--- + gcc/emit-rtl.c | 11 ----------- + 1 files changed, 0 insertions(+), 11 deletions(-) + +diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c +index 4736f8d..ae69dbd 100644 +--- a/gcc/emit-rtl.c ++++ b/gcc/emit-rtl.c +@@ -3422,7 +3422,6 @@ try_split (rtx pat, rtx trial, int last) + { + rtx before = PREV_INSN (trial); + rtx after = NEXT_INSN (trial); +- int has_barrier = 0; + rtx note, seq, tem; + int probability; + rtx insn_last, insn; +@@ -3441,14 +3440,6 @@ try_split (rtx pat, rtx trial, int last) + + split_branch_probability = -1; + +- /* If we are splitting a JUMP_INSN, it might be followed by a BARRIER. +- We may need to handle this specially. */ +- if (after && BARRIER_P (after)) +- { +- has_barrier = 1; +- after = NEXT_INSN (after); +- } +- + if (!seq) + return trial; + +@@ -3594,8 +3585,6 @@ try_split (rtx pat, rtx trial, int last) + tem = emit_insn_after_setloc (seq, trial, INSN_LOCATION (trial)); + + delete_insn (trial); +- if (has_barrier) +- emit_barrier_after (tem); + + /* Recursively call try_split for each new insn created; by the + time control returns here that insn will be fully split, so +-- +1.7.1 + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/AArch64-Define-BE-loader-name-default-be.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/AArch64-Define-BE-loader-name-default-be.patch new file mode 100644 index 0000000..8755241 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/AArch64-Define-BE-loader-name-default-be.patch @@ -0,0 +1,38 @@ +Index: gcc-linaro-4.8-2014.03/gcc/config/aarch64/aarch64-linux.h +=================================================================== +--- gcc-linaro-4.8-2014.03.orig/gcc/config/aarch64/aarch64-linux.h ++++ gcc-linaro-4.8-2014.03/gcc/config/aarch64/aarch64-linux.h +@@ -21,10 +21,23 @@ + #ifndef GCC_AARCH64_LINUX_H + #define GCC_AARCH64_LINUX_H + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" +- + #define CPP_SPEC "%{pthread:-D_REENTRANT}" + ++#if TARGET_BIG_ENDIAN_DEFAULT ++#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{!mlittle-endian:_be}.so.1" ++ ++#define LINUX_TARGET_LINK_SPEC "%{h*} \ ++ %{static:-Bstatic} \ ++ %{shared:-shared} \ ++ %{symbolic:-Bsymbolic} \ ++ %{rdynamic:-export-dynamic} \ ++ -dynamic-linker " GNU_USER_DYNAMIC_LINKER " \ ++ -X \ ++ %{mbig-endian:-EB} %{mlittle-endian:-EL} \ ++ -maarch64linux%{mabi=ilp32:32}%{!mlittle-endian:b}" ++#else ++#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" ++ + #define LINUX_TARGET_LINK_SPEC "%{h*} \ + %{static:-Bstatic} \ + %{shared:-shared} \ +@@ -34,6 +47,7 @@ + -X \ + %{mbig-endian:-EB} %{mlittle-endian:-EL} \ + -maarch64linux%{mabi=ilp32:32}%{mbig-endian:b}" ++#endif + + #define LINK_SPEC LINUX_TARGET_LINK_SPEC + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/use-lib-for-aarch64.patch b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/use-lib-for-aarch64.patch new file mode 100644 index 0000000..62bb110 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-4.9/use-lib-for-aarch64.patch @@ -0,0 +1,13 @@ +diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux +index 147452b..1930046 100644 +--- a/gcc/config/aarch64/t-aarch64-linux ++++ b/gcc/config/aarch64/t-aarch64-linux +@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm + LIB1ASMFUNCS = _aarch64_sync_cache_range + + AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be) +-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) ++MULTILIB_OSDIRNAMES = mabi.lp64=../lib$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu) + MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu) + + MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32 diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.8.inc b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.8.inc new file mode 100644 index 0000000..ea97fdb --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.8.inc @@ -0,0 +1,2 @@ +BASEPV = "4.8" +PV = "linaro-${BASEPV}" diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.9.inc b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.9.inc new file mode 100644 index 0000000..52f0696 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-common-4.9.inc @@ -0,0 +1,2 @@ +BASEPV = "4.9" +PV = "linaro-${BASEPV}" diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.8.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.8.bb new file mode 100644 index 0000000..971c1e4 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.8.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.8.inc +require recipes-devtools/gcc/gcc-runtime_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.9.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.9.bb new file mode 100644 index 0000000..c298881 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-runtime_linaro-4.9.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.9.inc +require recipes-devtools/gcc/gcc-runtime_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-source_linaro-4.8.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-source_linaro-4.8.bb new file mode 100644 index 0000000..433f4e0 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-source_linaro-4.8.bb @@ -0,0 +1,3 @@ +require gcc-linaro-common-4.8.inc +require recipes-devtools/gcc/gcc-${PV}.inc +require recipes-devtools/gcc/gcc-source.inc diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc-source_linaro-4.9.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-source_linaro-4.9.bb new file mode 100644 index 0000000..f77b2b2 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc-source_linaro-4.9.bb @@ -0,0 +1,3 @@ +require gcc-linaro-common-4.9.inc +require recipes-devtools/gcc/gcc-${PV}.inc +require recipes-devtools/gcc/gcc-source.inc diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.8.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.8.bb new file mode 100644 index 0000000..73ff5c4 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.8.bb @@ -0,0 +1,4 @@ +require gcc-linaro-common-4.8.inc +require recipes-devtools/gcc/gcc_${BASEPV}.bb + +DEPENDS += "gmp-native" diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.9.bb b/meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.9.bb new file mode 100644 index 0000000..0306ed8 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/gcc_linaro-4.9.bb @@ -0,0 +1,4 @@ +require gcc-linaro-common-4.9.inc +require recipes-devtools/gcc/gcc_${BASEPV}.bb + +DEPENDS += "gmp-native" diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/libgcc-initial_linaro-4.8.bb b/meta-linaro-toolchain/recipes-devtools/gcc/libgcc-initial_linaro-4.8.bb new file mode 100644 index 0000000..d9a99ec --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/libgcc-initial_linaro-4.8.bb @@ -0,0 +1,3 @@ +require gcc-linaro-common-4.8.inc +require gcc-linaro-4.8.inc +require recipes-devtools/gcc/libgcc-initial.inc diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/libgcc-initial_linaro-4.9.bb b/meta-linaro-toolchain/recipes-devtools/gcc/libgcc-initial_linaro-4.9.bb new file mode 100644 index 0000000..987cc52 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/libgcc-initial_linaro-4.9.bb @@ -0,0 +1,3 @@ +require gcc-linaro-common-4.9.inc +require gcc-linaro-4.9.inc +require recipes-devtools/gcc/libgcc-initial.inc diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.8.bb b/meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.8.bb new file mode 100644 index 0000000..d37d511 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.8.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.8.inc +require recipes-devtools/gcc/libgcc_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.9.bb b/meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.9.bb new file mode 100644 index 0000000..540230d --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/libgcc_linaro-4.9.bb @@ -0,0 +1,2 @@ +require gcc-linaro-common-4.9.inc +require recipes-devtools/gcc/libgcc_${BASEPV}.bb diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/libgfortran_linaro-4.8.bb b/meta-linaro-toolchain/recipes-devtools/gcc/libgfortran_linaro-4.8.bb new file mode 100644 index 0000000..4ec303b --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/libgfortran_linaro-4.8.bb @@ -0,0 +1,4 @@ +require gcc-linaro-common-4.8.inc +require gcc-linaro-4.8.inc +require recipes-devtools/gcc/libgfortran.inc + diff --git a/meta-linaro-toolchain/recipes-devtools/gcc/libgfortran_linaro-4.9.bb b/meta-linaro-toolchain/recipes-devtools/gcc/libgfortran_linaro-4.9.bb new file mode 100644 index 0000000..181ef0a --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gcc/libgfortran_linaro-4.9.bb @@ -0,0 +1,4 @@ +require gcc-linaro-common-4.9.inc +require gcc-linaro-4.9.inc +require recipes-devtools/gcc/libgfortran.inc + diff --git a/meta-linaro-toolchain/recipes-devtools/gdb/gdb-7.8/sim-install-6.6.patch b/meta-linaro-toolchain/recipes-devtools/gdb/gdb-7.8/sim-install-6.6.patch new file mode 100644 index 0000000..f67c25d --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gdb/gdb-7.8/sim-install-6.6.patch @@ -0,0 +1,14 @@ +Upstream-Status: Inappropriate [embedded specific] + +--- gdb-6.1/sim/common/Makefile.in~ 2004-01-15 21:25:06.000000000 +0000 ++++ gdb-6.1/sim/common/Makefile.in 2004-07-22 17:07:46.237809032 +0100 +@@ -34,7 +34,7 @@ + + datadir = @datadir@ + mandir = @mandir@ +-man1dir = $(mandir)/man1 ++man1dir = $(DESTDIR)$(mandir)/man1 + infodir = @infodir@ + includedir = @includedir@ + + diff --git a/meta-linaro-toolchain/recipes-devtools/gdb/gdb-cross-canadian_linaro-7.8.bb b/meta-linaro-toolchain/recipes-devtools/gdb/gdb-cross-canadian_linaro-7.8.bb new file mode 100644 index 0000000..5c79fdd --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gdb/gdb-cross-canadian_linaro-7.8.bb @@ -0,0 +1,3 @@ +require recipes-devtools/gdb/gdb-common.inc +require recipes-devtools/gdb/gdb-cross-canadian.inc +require gdb-${PV}.inc diff --git a/meta-linaro-toolchain/recipes-devtools/gdb/gdb-cross_linaro-7.8.bb b/meta-linaro-toolchain/recipes-devtools/gdb/gdb-cross_linaro-7.8.bb new file mode 100644 index 0000000..b2003b4 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gdb/gdb-cross_linaro-7.8.bb @@ -0,0 +1,4 @@ +require recipes-devtools/gdb/gdb-cross.inc +require gdb-${PV}.inc + +SRC_URI += "file://sim-install-6.6.patch" diff --git a/meta-linaro-toolchain/recipes-devtools/gdb/gdb-linaro-7.8.inc b/meta-linaro-toolchain/recipes-devtools/gdb/gdb-linaro-7.8.inc new file mode 100644 index 0000000..773fcea --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gdb/gdb-linaro-7.8.inc @@ -0,0 +1,20 @@ +LICENSE="GPLv2 & GPLv3 & LGPLv2 & LGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \ + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \ + file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \ + file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674" + + +MMYY = "14.09" +RELEASE = "20${MMYY}" +PR = "r${RELEASE}" +BINV = "7.8" + +S = "${WORKDIR}/${BPN}-${PV}-${RELEASE}" + +FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/gdb-${BINV}' ], d)}" + +SRC_URI = "https://releases.linaro.org/${MMYY}/components/toolchain/gdb-linaro/gdb-${PV}-${RELEASE}.tar.xz" + +SRC_URI[md5sum] = "954e47e397de0b635ecdb5bb5d0f145f" +SRC_URI[sha256sum] = "fbbe96b8d0debf7c2d8c9a4a6c7ca0ba87d536e43289f81c4af56f95e5f7b5ea" diff --git a/meta-linaro-toolchain/recipes-devtools/gdb/gdb_linaro-7.8.bb b/meta-linaro-toolchain/recipes-devtools/gdb/gdb_linaro-7.8.bb new file mode 100644 index 0000000..3ce2de4 --- /dev/null +++ b/meta-linaro-toolchain/recipes-devtools/gdb/gdb_linaro-7.8.bb @@ -0,0 +1,23 @@ +require recipes-devtools/gdb/gdb.inc +require gdb-${PV}.inc + +inherit python-dir + +PACKAGECONFIG ??= "" +PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,python" + +do_configure_prepend() { + if [ -n "${@base_contains('PACKAGECONFIG', 'python', 'python', '', d)}" ]; then + cat > ${WORKDIR}/python << EOF +#!/bin/sh +case "\$2" in + --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}/" ;; + --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;; + --exec-prefix) echo "${exec_prefix}" ;; + *) exit 1 ;; +esac +exit 0 +EOF + chmod +x ${WORKDIR}/python + fi +} diff --git a/meta-linaro/conf/layer.conf b/meta-linaro/conf/layer.conf new file mode 100644 index 0000000..c019548 --- /dev/null +++ b/meta-linaro/conf/layer.conf @@ -0,0 +1,15 @@ +BBPATH .= ":${LAYERDIR}" +BBFILES += "\ + ${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend \ + " + +BBFILE_COLLECTIONS += "linaro" +BBFILE_PATTERN_linaro := "^${LAYERDIR}/" +BBFILE_PRIORITY_linaro = "25" + +# do not error out on bbappends for missing recipes (mysql5) +BB_DANGLINGAPPENDS_WARNONLY = "true" + +# we need meta-networking for (lib)memcached +LAYERDEPENDS_linaro = "networking-layer" diff --git a/meta-linaro/conf/machine/genericarmv7a.conf b/meta-linaro/conf/machine/genericarmv7a.conf new file mode 100644 index 0000000..3f71e60 --- /dev/null +++ b/meta-linaro/conf/machine/genericarmv7a.conf @@ -0,0 +1,34 @@ +#@TYPE: Machine +#@NAME: generic armv7a machine +#@DESCRIPTION: generic machine to be used by linaro-media-create + + +require conf/machine/include/arm/arch-armv7a.inc + +PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg" + +XSERVER ?= "xserver-xorg \ + mesa-driver-swrast \ + xf86-input-evdev \ + xf86-input-mouse \ + xf86-video-fbdev \ + xf86-input-keyboard" + +MACHINE_FEATURES = "usbhost screen" + +# Don't include kernels in standard images +RDEPENDS_kernel-base = "" + +# Use a common kernel recipe for all QEMU machines +PREFERRED_PROVIDER_virtual/kernel ?= "linux-linaro-vexpress" + +KERNEL_IMAGETYPE = "zImage" + +GRUBPLATFORM_pn-grub = "efi" + +# Force auto-serial-console to be used by all image types +# Ideally this would be part of core oe or as a bbclassappend, +# but as we don't have an easy way to append a class, defining +# it here +EXTRA_IMAGE_FEATURES += "autoserial" +FEATURE_PACKAGES_autoserial = "auto-serial-console" diff --git a/meta-linaro/conf/machine/genericarmv7ab.conf b/meta-linaro/conf/machine/genericarmv7ab.conf new file mode 100644 index 0000000..69a08cc --- /dev/null +++ b/meta-linaro/conf/machine/genericarmv7ab.conf @@ -0,0 +1,7 @@ +#@TYPE: Machine +#@NAME: generic armv7a big endian machine +#@DESCRIPTION: generic machine to be used by linaro-media-create + +DEFAULTTUNE ?= "armv7ab" + +require conf/machine/genericarmv7a.conf diff --git a/meta-linaro/conf/machine/lng-rt-x86-64.conf b/meta-linaro/conf/machine/lng-rt-x86-64.conf new file mode 100644 index 0000000..040af95 --- /dev/null +++ b/meta-linaro/conf/machine/lng-rt-x86-64.conf @@ -0,0 +1,4 @@ +include lng.inc +DEFAULTTUNE = "core2-64" +require conf/machine/include/tune-core2.inc +PREFERRED_PROVIDER_virtual/kernel = "linaro-lng-rt-x86-64" diff --git a/meta-linaro/conf/machine/lng-x86-64.conf b/meta-linaro/conf/machine/lng-x86-64.conf new file mode 100644 index 0000000..a90b6e0 --- /dev/null +++ b/meta-linaro/conf/machine/lng-x86-64.conf @@ -0,0 +1,4 @@ +include lng.inc +DEFAULTTUNE = "core2-64" +require conf/machine/include/tune-core2.inc +PREFERRED_PROVIDER_virtual/kernel = "linaro-lng-x86-64" diff --git a/meta-linaro/conf/machine/lng.inc b/meta-linaro/conf/machine/lng.inc new file mode 100644 index 0000000..55bc77b --- /dev/null +++ b/meta-linaro/conf/machine/lng.inc @@ -0,0 +1,6 @@ +KERNEL_IMAGETYPE = "bzImage" + +MACHINE_FEATURES += "x86" + +EXTRA_IMAGE_FEATURES += "autoserial" +FEATURE_PACKAGES_autoserial = "auto-serial-console" diff --git a/meta-linaro/recipes-core/initrdscripts/files/init-boot-linaro.sh b/meta-linaro/recipes-core/initrdscripts/files/init-boot-linaro.sh new file mode 100755 index 0000000..2af2f92 --- /dev/null +++ b/meta-linaro/recipes-core/initrdscripts/files/init-boot-linaro.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +HOME=/root +PATH=/sbin:/bin:/usr/sbin:/usr/bin +PS1="linaro-test [rc=$(echo \$?)]# " +export HOME PS1 PATH + +early_setup() { + mkdir -p /proc /sys /tmp /run + mount -t proc proc /proc + mount -t sysfs sysfs /sys + mount -t devtmpfs none /dev + + ln -s /run /var/run + + chmod 0666 /dev/tty* + chown root:tty /dev/tty* +} + +read_args() { + [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline` + for arg in $CMDLINE; do + optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'` + case $arg in + console=*) + tty=${arg#console=} + tty=${tty#/dev/} + + case $tty in + tty[a-zA-Z]* ) + port=${tty%%,*} + esac ;; + debug) set -x ;; + esac + done +} + +early_setup +read_args + +setsid sh /dev/${port} 2>&1 diff --git a/meta-linaro/recipes-core/initrdscripts/initramfs-boot-linaro_1.0.bb b/meta-linaro/recipes-core/initrdscripts/initramfs-boot-linaro_1.0.bb new file mode 100644 index 0000000..4e5ca09 --- /dev/null +++ b/meta-linaro/recipes-core/initrdscripts/initramfs-boot-linaro_1.0.bb @@ -0,0 +1,13 @@ +DESCRIPTION = "Simple init script" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "file://init-boot-linaro.sh" + +do_install() { + install -m 0755 ${WORKDIR}/init-boot-linaro.sh ${D}/init +} + +inherit allarch + +FILES_${PN} += " /init " diff --git a/meta-linaro/recipes-devtools/qemu/files/3f08ffb4a4741d147634761dc053ed386243a0de.patch b/meta-linaro/recipes-devtools/qemu/files/3f08ffb4a4741d147634761dc053ed386243a0de.patch new file mode 100644 index 0000000..4390b94 --- /dev/null +++ b/meta-linaro/recipes-devtools/qemu/files/3f08ffb4a4741d147634761dc053ed386243a0de.patch @@ -0,0 +1,42 @@ +Upstream-Status: Backport + +[Appears to fix the random segfaults we were seeing in a variety of architectures: +https://bugzilla.yoctoproject.org/show_bug.cgi?id=4216 ] + + +From: Yeongkyoon Lee +Date: Fri, 22 Mar 2013 12:50:17 +0000 (+0900) +Subject: tcg: Fix occasional TCG broken problem when ldst optimization enabled +X-Git-Url: http://git.qemu.org/?p=qemu.git;a=commitdiff_plain;h=52ae646d4a3ebdcdcc973492c6a56f2c49b6578f;hp=3f08ffb4a4741d147634761dc053ed386243a0de + +tcg: Fix occasional TCG broken problem when ldst optimization enabled + +is_tcg_gen_code() checks the upper limit of TCG generated code range wrong, so +that TCG could get broken occasionally only when CONFIG_QEMU_LDST_OPTIMIZATION +enabled. The reason is code_gen_buffer_max_size does not cover the upper range +up to (TCG_MAX_OP_SIZE * OPC_BUF_SIZE), thus code_gen_buffer_max_size should be +modified to code_gen_buffer_size. + +CC: qemu-stable@nongnu.org +Signed-off-by: Yeongkyoon Lee +Reviewed-by: Peter Maydell +Signed-off-by: Aurelien Jarno +--- + +Index: qemu-1.4.0/translate-all.c +=================================================================== +--- qemu-1.4.0.orig/translate-all.c 2013-04-09 10:58:19.000000000 +0000 ++++ qemu-1.4.0/translate-all.c 2013-04-09 10:58:34.783203406 +0000 +@@ -1310,10 +1310,10 @@ + /* check whether the given addr is in TCG generated code buffer or not */ + bool is_tcg_gen_code(uintptr_t tc_ptr) + { +- /* This can be called during code generation, code_gen_buffer_max_size ++ /* This can be called during code generation, code_gen_buffer_size + is used instead of code_gen_ptr for upper boundary checking */ + return (tc_ptr >= (uintptr_t)code_gen_buffer && +- tc_ptr < (uintptr_t)(code_gen_buffer + code_gen_buffer_max_size)); ++ tc_ptr < (uintptr_t)(code_gen_buffer + code_gen_buffer_size)); + } + #endif + diff --git a/meta-linaro/recipes-devtools/qemu/files/enable-i386-linux-user.patch b/meta-linaro/recipes-devtools/qemu/files/enable-i386-linux-user.patch new file mode 100644 index 0000000..bb0d6a3 --- /dev/null +++ b/meta-linaro/recipes-devtools/qemu/files/enable-i386-linux-user.patch @@ -0,0 +1,55 @@ +Enable i386-linux-user + +Signed-off-by: Zhai Edwin + +Upstream-Status: Inappropriate [configuration] + +Index: qemu-0.14.0/Makefile.target +=================================================================== +--- qemu-0.14.0.orig/Makefile.target ++++ qemu-0.14.0/Makefile.target +@@ -78,8 +78,13 @@ ifeq ($(TARGET_BASE_ARCH), i386) + libobj-y += cpuid.o + endif + libobj-$(CONFIG_NEED_MMU) += mmu.o ++ifndef CONFIG_LINUX_USER + libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o + libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o ++else ++libobj-$(TARGET_I386) += dummygl.o ++libobj-$(TARGET_X86_64) += dummygl.o ++endif #CONFIG_LINUX_USER + libobj-$(TARGET_ARM) += dummygl.o + libobj-$(TARGET_MIPS) += dummygl.o + libobj-$(TARGET_PPC) += dummygl.o +Index: qemu-0.14.0/target-i386/dummygl.c +=================================================================== +--- /dev/null ++++ qemu-0.14.0/target-i386/dummygl.c +@@ -0,0 +1,26 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++void opengl_exec_set_parent_window(Display* _dpy, Window _parent_window) ++{ ++ ++} ++ ++void opengl_process_enable(void) ++{ ++ ++} ++ ++ ++void mem_opengl(uint64_t ptr) ++{ ++ ++} ++ ++void helper_opengl(void) ++{ ++} diff --git a/meta-linaro/recipes-devtools/qemu/files/fdt_header.patch b/meta-linaro/recipes-devtools/qemu/files/fdt_header.patch new file mode 100644 index 0000000..dccfe53 --- /dev/null +++ b/meta-linaro/recipes-devtools/qemu/files/fdt_header.patch @@ -0,0 +1,39 @@ +Upstream-Status: Pending + +qemu: define fdt types in libfdt_env.h from qemu + + * fixes + In file included from /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/libfdt.h:55:0, + from /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/work/x86_64-linux/qemu-native/1.4.0-r0/qemu-1.4.0/hw/arm/../../device_tree.c:28: + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:58:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:59:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:60:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:61:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:62:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:63:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:64:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:67:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:70:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:73:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:77:2: error: unknown type name 'fdt64_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:78:2: error: unknown type name 'fdt64_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:82:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:87:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:88:2: error: unknown type name 'fdt32_t' + /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:89:2: error: unknown type name 'fdt32_t' + +Index: qemu-1.4.0/include/libfdt_env.h +=================================================================== +--- qemu-1.4.0.orig/include/libfdt_env.h 2013-02-15 23:05:35.000000000 +0000 ++++ qemu-1.4.0/include/libfdt_env.h 2013-04-13 14:17:27.918885225 +0000 +@@ -21,6 +21,10 @@ + + #include "qemu/bswap.h" + ++typedef uint16_t fdt16_t; ++typedef uint32_t fdt32_t; ++typedef uint64_t fdt64_t; ++ + #ifdef HOST_WORDS_BIGENDIAN + #define fdt32_to_cpu(x) (x) + #define cpu_to_fdt32(x) (x) diff --git a/meta-linaro/recipes-devtools/qemu/files/fix-libcap-header-issue-on-some-distro.patch b/meta-linaro/recipes-devtools/qemu/files/fix-libcap-header-issue-on-some-distro.patch new file mode 100644 index 0000000..13a6ea2 --- /dev/null +++ b/meta-linaro/recipes-devtools/qemu/files/fix-libcap-header-issue-on-some-distro.patch @@ -0,0 +1,84 @@ +fix libcap header issue on some distro + +1, When build qemu-native on SLED 11.2, there is an error: +... +| In file included from /usr/include/bits/sigcontext.h:28, +| from /usr/include/signal.h:339, +| from /buildarea2/tmp/work/i686-linux/qemu-native/1.4.0-r0/ +qemu-1.4.0/include/qemu-common.h:42, +| from fsdev/virtfs-proxy-helper.c:23: +| /usr/include/asm/sigcontext.h:28: error: expected specifier- +qualifier-list before '__u64' +| /usr/include/asm/sigcontext.h:191: error: expected specifier- +qualifier-list before '__u64' +... + +2, The virtfs-proxy-helper.c includes and +qemu-common.h in sequence. The header include map is: +(`-->' presents `include') +... +"virtfs-proxy-helper.c" --> +... +"virtfs-proxy-helper.c" --> "qemu-common.h" --> --> + --> --> --> + --> --> +... + +3, The bug is found on SLED 11.2 x86. In libcap header file +/usr/include/sys/capability.h, it does evil stuff like this: +... + 25 /* + 26 * Make sure we can be included from userland by preventing + 27 * capability.h from including other kernel headers + 28 */ + 29 #define _LINUX_TYPES_H + 30 #define _LINUX_FS_H + 31 #define __LINUX_COMPILER_H + 32 #define __user + 33 + 34 typedef unsigned int __u32; + 35 typedef __u32 __le32; +... +This completely prevents including /usr/include/linux/types.h. +The above ` --> ' is prevented, +and '__u64' is defined in . + +4, Modify virtfs-proxy-helper.c to include +last to workaround the issue. + +http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html +http://patchwork.linuxtv.org/patch/12748/ + +Upstream-Status: Pending +Signed-off-by: Hongxu Jia +--- + fsdev/virtfs-proxy-helper.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c +--- a/fsdev/virtfs-proxy-helper.c ++++ b/fsdev/virtfs-proxy-helper.c +@@ -12,7 +12,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -26,7 +25,11 @@ + #include "virtio-9p-marshal.h" + #include "hw/9pfs/virtio-9p-proxy.h" + #include "fsdev/virtio-9p-marshal.h" +- ++/* ++ * Include this one last due to some versions of it being buggy: ++ * http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html ++ */ ++#include + #define PROGNAME "virtfs-proxy-helper" + + #ifndef XFS_SUPER_MAGIC +-- +1.7.10.4 + diff --git a/meta-linaro/recipes-devtools/qemu/files/init-info.patch b/meta-linaro/recipes-devtools/qemu/files/init-info.patch new file mode 100644 index 0000000..2250444 --- /dev/null +++ b/meta-linaro/recipes-devtools/qemu/files/init-info.patch @@ -0,0 +1,18 @@ +# This is a workaround to the crashes seen on Ubuntu. Setting info to zero +# makes info.info.x11.display zero and avoids the calls to +# opengl_exec_set_parent_window, one of which is crashing. + +Upstream-Status: Pending + +Index: qemu-0.14.0/ui/sdl.c +=================================================================== +--- qemu-0.14.0.orig/ui/sdl.c ++++ qemu-0.14.0/ui/sdl.c +@@ -863,6 +863,7 @@ void sdl_display_init(DisplayState *ds, + vi = SDL_GetVideoInfo(); + host_format = *(vi->vfmt); + ++ bzero(&info, sizeof(info)); + SDL_GetWMInfo(&info); + if (info.subsystem == SDL_SYSWM_X11 && info.info.x11.display) + opengl_exec_set_parent_window(info.info.x11.display, diff --git a/meta-linaro/recipes-devtools/qemu/files/larger_default_ram_size.patch b/meta-linaro/recipes-devtools/qemu/files/larger_default_ram_size.patch new file mode 100644 index 0000000..711c360 --- /dev/null +++ b/meta-linaro/recipes-devtools/qemu/files/larger_default_ram_size.patch @@ -0,0 +1,22 @@ +This patch is taken from debian. 128M is too less sometimes if distro +with lot of packages is booted so this patch raises the default to 384M + +It has not been applied to upstream qemu + +Khem Raj + +Upstream-Status: Pending + +Index: qemu-0.14.0/vl.c +=================================================================== +--- qemu-0.14.0.orig/vl.c ++++ qemu-0.14.0/vl.c +@@ -168,7 +168,7 @@ int main(int argc, char **argv) + //#define DEBUG_NET + //#define DEBUG_SLIRP + +-#define DEFAULT_RAM_SIZE 128 ++#define DEFAULT_RAM_SIZE 384 + + #define MAX_VIRTIO_CONSOLES 1 + diff --git a/meta-linaro/recipes-devtools/qemu/files/no-strip.patch b/meta-linaro/recipes-devtools/qemu/files/no-strip.patch new file mode 100644 index 0000000..d6a4377 --- /dev/null +++ b/meta-linaro/recipes-devtools/qemu/files/no-strip.patch @@ -0,0 +1,15 @@ +Upstream-Status: Inappropriate [configuration] + +Index: qemu-0.14.0/Makefile +=================================================================== +--- qemu-0.14.0.orig/Makefile ++++ qemu-0.14.0/Makefile +@@ -235,7 +235,7 @@ install-sysconfig: + install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig + $(INSTALL_DIR) "$(DESTDIR)$(bindir)" + ifneq ($(TOOLS),) +- $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)" ++ $(INSTALL_PROG) $(TOOLS) "$(DESTDIR)$(bindir)" + endif + ifneq ($(BLOBS),) + $(INSTALL_DIR) "$(DESTDIR)$(datadir)" diff --git a/meta-linaro/recipes-devtools/qemu/files/powerpc_rom.bin b/meta-linaro/recipes-devtools/qemu/files/powerpc_rom.bin new file mode 100644 index 0000000..c404429 Binary files /dev/null and b/meta-linaro/recipes-devtools/qemu/files/powerpc_rom.bin differ diff --git a/meta-linaro/recipes-devtools/qemu/files/relocatable_sdk.patch b/meta-linaro/recipes-devtools/qemu/files/relocatable_sdk.patch new file mode 100644 index 0000000..774a49c --- /dev/null +++ b/meta-linaro/recipes-devtools/qemu/files/relocatable_sdk.patch @@ -0,0 +1,34 @@ +Upstream-Status: Inappropriate [SDK specific] + +In order to be able to change the dynamic loader path when relocating +binaries, the interp section has to be made big enough to accomodate +the new path (4096 is the maximum path length in Linux). + +Signed-off-by: Laurentiu Palcu + +Index: qemu-1.4.0/ldscripts/i386.ld +=================================================================== +--- qemu-1.4.0.orig/ldscripts/i386.ld 2013-02-15 15:05:35.000000000 -0800 ++++ qemu-1.4.0/ldscripts/i386.ld 2013-02-28 22:55:36.138816418 -0800 +@@ -8,7 +8,7 @@ + { + /* Read-only sections, merged into text segment: */ + . = 0x60000000 + SIZEOF_HEADERS; +- .interp : { *(.interp) } ++ .interp : { *(.interp); . = 0x1000; } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } +Index: qemu-1.4.0/ldscripts/x86_64.ld +=================================================================== +--- qemu-1.4.0.orig/ldscripts/x86_64.ld 2013-02-15 15:05:35.000000000 -0800 ++++ qemu-1.4.0/ldscripts/x86_64.ld 2013-02-28 22:55:36.138816418 -0800 +@@ -6,7 +6,7 @@ + { + /* Read-only sections, merged into text segment: */ + . = 0x60000000 + SIZEOF_HEADERS; +- .interp : { *(.interp) } ++ .interp : { *(.interp); . = 0x1000; } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } diff --git a/meta-linaro/recipes-devtools/qemu/files/target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch b/meta-linaro/recipes-devtools/qemu/files/target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch new file mode 100644 index 0000000..852efd1 --- /dev/null +++ b/meta-linaro/recipes-devtools/qemu/files/target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch @@ -0,0 +1,79 @@ +Upstream-Status: Backported + +From dec3fc9657e0682637de4d5a29d947284d01985c Mon Sep 17 00:00:00 2001 +From: Richard Henderson +Date: Wed, 29 May 2013 12:30:51 -0700 +Subject: [PATCH] target-i386: Fix aflag logic for CODE64 and the 0x67 prefix + +The code reorganization in commit 4a6fd938 broke handling of PREFIX_ADR. +While fixing this, tidy and comment the code so that it's more obvious +what's going on in setting both aflag and dflag. + +The TARGET_X86_64 ifdef can be eliminated because CODE64 expands to the +constant zero when TARGET_X86_64 is undefined. + +Cc: Paolo Bonzini +Reported-by: Laszlo Ersek +Signed-off-by: Richard Henderson +Reviewed-by: Paolo Bonzini +Message-id: 1369855851-21400-1-git-send-email-rth@twiddle.net +Signed-off-by: Anthony Liguori +--- + target-i386/translate.c | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +diff --git a/target-i386/translate.c b/target-i386/translate.c +index 0aeccdb..14b0298 100644 +--- a/target-i386/translate.c ++++ b/target-i386/translate.c +@@ -4677,8 +4677,6 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, + } + s->pc = pc_start; + prefixes = 0; +- aflag = s->code32; +- dflag = s->code32; + s->override = -1; + rex_w = -1; + rex_r = 0; +@@ -4801,23 +4799,25 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, + } + + /* Post-process prefixes. */ +- if (prefixes & PREFIX_DATA) { +- dflag ^= 1; +- } +- if (prefixes & PREFIX_ADR) { +- aflag ^= 1; +- } +-#ifdef TARGET_X86_64 + if (CODE64(s)) { +- if (rex_w == 1) { +- /* 0x66 is ignored if rex.w is set */ +- dflag = 2; ++ /* In 64-bit mode, the default data size is 32-bit. Select 64-bit ++ data with rex_w, and 16-bit data with 0x66; rex_w takes precedence ++ over 0x66 if both are present. */ ++ dflag = (rex_w > 0 ? 2 : prefixes & PREFIX_DATA ? 0 : 1); ++ /* In 64-bit mode, 0x67 selects 32-bit addressing. */ ++ aflag = (prefixes & PREFIX_ADR ? 1 : 2); ++ } else { ++ /* In 16/32-bit mode, 0x66 selects the opposite data size. */ ++ dflag = s->code32; ++ if (prefixes & PREFIX_DATA) { ++ dflag ^= 1; + } +- if (!(prefixes & PREFIX_ADR)) { +- aflag = 2; ++ /* In 16/32-bit mode, 0x67 selects the opposite addressing. */ ++ aflag = s->code32; ++ if (prefixes & PREFIX_ADR) { ++ aflag ^= 1; + } + } +-#endif + + s->prefix = prefixes; + s->aflag = aflag; +-- +1.7.9.5 + diff --git a/meta-linaro/recipes-devtools/qemu/files/target-ppc_fix_bit_extraction.patch b/meta-linaro/recipes-devtools/qemu/files/target-ppc_fix_bit_extraction.patch new file mode 100644 index 0000000..631d23b --- /dev/null +++ b/meta-linaro/recipes-devtools/qemu/files/target-ppc_fix_bit_extraction.patch @@ -0,0 +1,70 @@ +Delivered-To: raj.khem@gmail.com +Received: by 10.50.216.195 with SMTP id os3csp11191igc; + Thu, 15 Aug 2013 04:32:45 -0700 (PDT) +X-Received: by 10.180.98.3 with SMTP id ee3mr1508103wib.48.1376566364872; + Thu, 15 Aug 2013 04:32:44 -0700 (PDT) +Return-Path: +Received: from hall.aurel32.net (hall.aurel32.net. [2001:470:1f0b:4a8::1]) + by mx.google.com with ESMTPS id vv5si15578100wjc.49.2013.08.15.04.32.44 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Thu, 15 Aug 2013 04:32:44 -0700 (PDT) +Received-SPF: pass (google.com: best guess record for domain of aurelien@aurel32.net designates 2001:470:1f0b:4a8::1 as permitted sender) client-ip=2001:470:1f0b:4a8::1; +Authentication-Results: mx.google.com; + spf=pass (google.com: best guess record for domain of aurelien@aurel32.net designates 2001:470:1f0b:4a8::1 as permitted sender) smtp.mail=aurelien@aurel32.net +Received: from [2001:470:d4ed:1:2db:dfff:fe14:52d] (helo=ohm.aurel32.net) + by hall.aurel32.net with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) + (Exim 4.80) + (envelope-from ) + id 1V9vnG-0006cO-NN; Thu, 15 Aug 2013 13:32:42 +0200 +Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) + (envelope-from ) + id 1V9vnF-0002Lw-7L; Thu, 15 Aug 2013 13:32:41 +0200 +From: Aurelien Jarno +To: qemu-devel@nongnu.org +Cc: Khem Raj , + Alexander Graf , + qemu-stable@nongnu.org, + qemu-ppc@nongnu.org, + Aurelien Jarno +Subject: [PATCH] target-ppc: fix bit extraction for FPBF and FPL +Date: Thu, 15 Aug 2013 13:32:38 +0200 +Message-Id: <1376566358-8989-1-git-send-email-aurelien@aurel32.net> +X-Mailer: git-send-email 1.7.10.4 + +Bit extraction for the FP BF and L field of the MTFSFI and MTFSF +instructions is wrong and doesn't match the reference manual (which +explain the bit number in big endian format). It has been broken in +commit 7d08d85645def18eac2a9d672c1868a35e0bcf79. + +This patch fixes this, which in turn fixes the problem reported by +Khem Raj about the floor() function of libm. + +Reported-by: Khem Raj +Signed-off-by: Aurelien Jarno + +Upstream-Status: Backport + +--- + target-ppc/translate.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +I don't know if we still have time to get this into 1.6, hence the Cc: +to stable. In anycase it also needs to be fixed in 1.5. + +Index: qemu-1.5.0/target-ppc/translate.c +=================================================================== +--- qemu-1.5.0.orig/target-ppc/translate.c 2013-05-20 08:34:40.000000000 -0700 ++++ qemu-1.5.0/target-ppc/translate.c 2013-08-15 06:49:25.028144352 -0700 +@@ -428,9 +428,9 @@ + EXTRACT_HELPER(SR, 16, 4); + + /* mtfsf/mtfsfi */ +-EXTRACT_HELPER(FPBF, 19, 3); ++EXTRACT_HELPER(FPBF, 23, 3); + EXTRACT_HELPER(FPIMM, 12, 4); +-EXTRACT_HELPER(FPL, 21, 1); ++EXTRACT_HELPER(FPL, 25, 1); + EXTRACT_HELPER(FPFLM, 17, 8); + EXTRACT_HELPER(FPW, 16, 1); + diff --git a/meta-linaro/recipes-devtools/qemu/qemu_git.bb b/meta-linaro/recipes-devtools/qemu/qemu_git.bb new file mode 100644 index 0000000..cae577d --- /dev/null +++ b/meta-linaro/recipes-devtools/qemu/qemu_git.bb @@ -0,0 +1,28 @@ +require recipes-devtools/qemu/qemu.inc + +DEPENDS = "glib-2.0 zlib alsa-lib pixman dtc libsdl jpeg" +DEPENDS_class-native = "zlib-native alsa-lib-native glib-2.0-native pixman-native dtc-native" +DEPENDS_class-nativesdk = "nativesdk-zlib nativesdk-libsdl nativesdk-glib-2.0 nativesdk-pixman nativesdk-dtc" + +SRCREV = "541bbb07eb197a870661ed702ae1f15c7d46aea6" + +LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ + file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913" + +PV = "2.1.0+git${SRCPV}" + +SRC_URI = "git://git.qemu.org/qemu.git \ + file://powerpc_rom.bin \ + " + +S = "${WORKDIR}/git" +EXTRA_OECONF+="--enable-kvm --enable-fdt " +EXTRA_OECONF_aarch64+="--target-list=aarch64-softmmu --enable-tcg-interpreter" +EXTRA_OECONF_class-native = "--target-list='arm-linux-user armeb-linux-user' --extra-cflags='${CFLAGS}'" + +DEFAULT_PREFERENCE_arm = "1" +DEFAULT_PREFERENCE_aarch64 = "1" +DEFAULT_PREFERENCE_armeb = "1" + +#/run folder not shipped +INSANE_SKIP_${PN} += "installed-vs-shipped" diff --git a/meta-linaro/recipes-extra/arndale-pre-boot/arndale-pre-boot_0.0.2.20130101.bb b/meta-linaro/recipes-extra/arndale-pre-boot/arndale-pre-boot_0.0.2.20130101.bb new file mode 100644 index 0000000..46de0d8 --- /dev/null +++ b/meta-linaro/recipes-extra/arndale-pre-boot/arndale-pre-boot_0.0.2.20130101.bb @@ -0,0 +1,24 @@ +DESCRIPTION = "This package contains the BL1 binary for Arndale board, \ +a chip-specific pre-bootloader provided by Samsung." +SUMMARY = "Binary pre-bootloader for Arndale (BL1)" +SECTION = "bootloader" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://BSD;md5=9c3fd1feed485309afa64b43f98ba22a" + +SRCREV = "fddc9ea644ee7d05c439ef7cdecbe20da63cdce3" +PV = "0.0.2.20130101+git${SRCPV}" +PR = "r1" + +SRC_URI = "git://git.linaro.org/pkg/arndale-pre-boot.git" + +S = "${WORKDIR}/git" + +do_install() { + install -D -p -m0644 arndale-bl1.bin ${D}/lib/firmware/arndale/arndale-bl1.bin +} + +PACKAGE_ARCH = "all" + +PACKAGES = "${PN}" + +FILES_${PN} = "/lib/firmware/arndale/arndale-bl1.bin" diff --git a/meta-linaro/recipes-extra/calibrator/calibrator_0.9e.bb b/meta-linaro/recipes-extra/calibrator/calibrator_0.9e.bb new file mode 100644 index 0000000..7911e0f --- /dev/null +++ b/meta-linaro/recipes-extra/calibrator/calibrator_0.9e.bb @@ -0,0 +1,27 @@ +SUMMARY = "Cache-Memory and TLB calibration tool" +DESCRIPTION = "The Calibrator is a small C program that is supposed to \ +analyze a computers (cache-) memory system and extract the following \ +parameters: \ +number of cache levels, main memory access latency, number of TLB levels." +HOMEPAGE = "http://homepages.cwi.nl/~manegold/Calibrator/" +SECTION = "console/tools" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://calibrator.c;endline=39;md5=102be98d5b443582cffa8eb4ee776af8" +PR = "r0" + +SRC_URI = "http://homepages.cwi.nl/~manegold/Calibrator/src/calibrator.c \ + file://fix_conflicting_types_for_round.patch" +SRC_URI[md5sum] = "5355f07ab1103e6d2948e08936d1ff54" +SRC_URI[sha256sum] = "2018ed8fa733155d44ceb1c0066c5cf8df7771cdf7cfca0a07b8dd9bebd9c221" + +S = "${WORKDIR}" + +do_compile() { + ${CC} ${CFLAGS} calibrator.c -o calibrator -lm +} + +do_install() { + install -D -p -m0755 calibrator ${D}${bindir}/calibrator +} + +COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" diff --git a/meta-linaro/recipes-extra/calibrator/files/fix_conflicting_types_for_round.patch b/meta-linaro/recipes-extra/calibrator/files/fix_conflicting_types_for_round.patch new file mode 100644 index 0000000..b7e7a64 --- /dev/null +++ b/meta-linaro/recipes-extra/calibrator/files/fix_conflicting_types_for_round.patch @@ -0,0 +1,95 @@ +Description: rename round() to rnd() to fix conflicting types for 'round' error +Author: Fathi Boudra + +--- + calibrator.c | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) + +--- a/calibrator.c ++++ b/calibrator.c +@@ -128,7 +128,7 @@ void ErrXit(char *format, ...) { + exit(1); + } + +-lng round(dbl x) ++lng rnd(dbl x) + { + return (lng)(x + 0.5); + } +@@ -890,16 +890,16 @@ void plotCache(cacheInfo *cache, lng **r + fprintf(fp, ")\n"); + fprintf(fp, "set y2tics"); + for (l = 0, s = " ("; l <= cache->levels; l++, s = ", ") { +- if (!delay) fprintf(fp, "%s'(%ld)' %f", s, round(CYperIt(cache->latency1[l] - delay)), NSperIt(cache->latency1[l] - delay)); +- else fprintf(fp, "%s'(%ld)' %f", s, round(CYperIt(cache->latency2[l] - delay)), NSperIt(cache->latency2[l] - delay)); ++ if (!delay) fprintf(fp, "%s'(%ld)' %f", s, rnd(CYperIt(cache->latency1[l] - delay)), NSperIt(cache->latency1[l] - delay)); ++ else fprintf(fp, "%s'(%ld)' %f", s, rnd(CYperIt(cache->latency2[l] - delay)), NSperIt(cache->latency2[l] - delay)); + } + for (y = 1; y <= yh; y *= 10) { + fprintf(fp, "%s'%1.3g' %ld", s, (dbl)(y * MHz) / 1000.0, y); + } + fprintf(fp, ")\n"); + for (l = 0; l <= cache->levels; l++) { +- if (!delay) z = (dbl)round(CYperIt(cache->latency1[l] - delay)) * 1000.0 / (dbl)MHz; +- else z = (dbl)round(CYperIt(cache->latency2[l] - delay)) * 1000.0 / (dbl)MHz; ++ if (!delay) z = (dbl)rnd(CYperIt(cache->latency1[l] - delay)) * 1000.0 / (dbl)MHz; ++ else z = (dbl)rnd(CYperIt(cache->latency2[l] - delay)) * 1000.0 / (dbl)MHz; + fprintf(fp, "set label %ld '(%1.3g) ' at %f,%f right\n", l + 1, z, xl, z); + fprintf(fp, "set arrow %ld from %f,%f to %f,%f nohead lt 0\n", l + 1, xl, z, xh, z); + } +@@ -986,16 +986,16 @@ void plotTLB(TLBinfo *TLB, lng **result, + fprintf(fp, "%s'' %ld)\n", s, TLB->mincachelines); + fprintf(fp, "set y2tics"); + for (l = 0, s = " ("; l <= TLB->levels; l++, s = ", ") { +- if (!delay) fprintf(fp, "%s'(%ld)' %f", s, round(CYperIt(TLB->latency1[l] - delay)), NSperIt(TLB->latency1[l] - delay)); +- else fprintf(fp, "%s'(%ld)' %f", s, round(CYperIt(TLB->latency2[l] - delay)), NSperIt(TLB->latency2[l] - delay)); ++ if (!delay) fprintf(fp, "%s'(%ld)' %f", s, rnd(CYperIt(TLB->latency1[l] - delay)), NSperIt(TLB->latency1[l] - delay)); ++ else fprintf(fp, "%s'(%ld)' %f", s, rnd(CYperIt(TLB->latency2[l] - delay)), NSperIt(TLB->latency2[l] - delay)); + } + for (y = 1; y <= yh; y *= 10) { + fprintf(fp, "%s'%1.3g' %ld", s, (dbl)(y * MHz) / 1000.0, y); + } + fprintf(fp, ")\n"); + for (l = 0; l <= TLB->levels; l++) { +- if (!delay) z = (dbl)round(CYperIt(TLB->latency1[l] - delay)) * 1000.0 / (dbl)MHz; +- else z = (dbl)round(CYperIt(TLB->latency2[l] - delay)) * 1000.0 / (dbl)MHz; ++ if (!delay) z = (dbl)rnd(CYperIt(TLB->latency1[l] - delay)) * 1000.0 / (dbl)MHz; ++ else z = (dbl)rnd(CYperIt(TLB->latency2[l] - delay)) * 1000.0 / (dbl)MHz; + fprintf(fp, "set label %ld '(%1.3g) ' at %f,%f right\n", l + 1, z, xl, z); + fprintf(fp, "set arrow %ld from %f,%f to %f,%f nohead lt 0\n", l + 1, xl, z, xh, z); + } +@@ -1023,9 +1023,9 @@ void printCPU(cacheInfo *cache, lng MHz, + FILE *fp = stdout; + + fprintf(fp, "CPU loop + L1 access: "); +- fprintf(fp, " %6.2f ns = %3ld cy\n", NSperIt(cache->latency1[0]), round(CYperIt(cache->latency1[0]))); ++ fprintf(fp, " %6.2f ns = %3ld cy\n", NSperIt(cache->latency1[0]), rnd(CYperIt(cache->latency1[0]))); + fprintf(fp, " ( delay: "); +- fprintf(fp, " %6.2f ns = %3ld cy )\n", NSperIt(delay), round(CYperIt(delay))); ++ fprintf(fp, " %6.2f ns = %3ld cy )\n", NSperIt(delay), rnd(CYperIt(delay))); + fprintf(fp, "\n"); + fflush(fp); + } +@@ -1047,8 +1047,8 @@ void printCache(cacheInfo *cache, lng MH + fprintf(fp, " %3ld KB ", cache->size[l] / 1024); + } + fprintf(fp, " %3ld bytes ", cache->linesize[l + 1]); +- fprintf(fp, " %6.2f ns = %3ld cy " , NSperIt(cache->latency2[l + 1] - cache->latency2[l]), round(CYperIt(cache->latency2[l + 1] - cache->latency2[l]))); +- fprintf(fp, " %6.2f ns = %3ld cy\n", NSperIt(cache->latency1[l + 1] - cache->latency1[l]), round(CYperIt(cache->latency1[l + 1] - cache->latency1[l]))); ++ fprintf(fp, " %6.2f ns = %3ld cy " , NSperIt(cache->latency2[l + 1] - cache->latency2[l]), rnd(CYperIt(cache->latency2[l + 1] - cache->latency2[l]))); ++ fprintf(fp, " %6.2f ns = %3ld cy\n", NSperIt(cache->latency1[l + 1] - cache->latency1[l]), rnd(CYperIt(cache->latency1[l + 1] - cache->latency1[l]))); + } + fprintf(fp, "\n"); + fflush(fp); +@@ -1075,9 +1075,9 @@ void printTLB(TLBinfo *TLB, lng MHz) + } else { + fprintf(fp, " %3ld KB ", TLB->pagesize[l + 1] / 1024); + } +- fprintf(fp, " %6.2f ns = %3ld cy ", NSperIt(TLB->latency2[l + 1] - TLB->latency2[l]), round(CYperIt(TLB->latency2[l + 1] - TLB->latency2[l]))); ++ fprintf(fp, " %6.2f ns = %3ld cy ", NSperIt(TLB->latency2[l + 1] - TLB->latency2[l]), rnd(CYperIt(TLB->latency2[l + 1] - TLB->latency2[l]))); + /* +- fprintf(fp, " %6.2f ns = %3ld cy" , NSperIt(TLB->latency1[l + 1] - TLB->latency1[l]), round(CYperIt(TLB->latency1[l + 1] - TLB->latency1[l]))); ++ fprintf(fp, " %6.2f ns = %3ld cy" , NSperIt(TLB->latency1[l + 1] - TLB->latency1[l]), rnd(CYperIt(TLB->latency1[l + 1] - TLB->latency1[l]))); + */ + fprintf(fp, "\n"); + } diff --git a/meta-linaro/recipes-extra/daq-odp/daq-odp.bb b/meta-linaro/recipes-extra/daq-odp/daq-odp.bb new file mode 100644 index 0000000..6153cdb --- /dev/null +++ b/meta-linaro/recipes-extra/daq-odp/daq-odp.bb @@ -0,0 +1,18 @@ +SUMMARY = "OpenDataPlane Data Acquisition (DAQ) module for Snort." +HOMEPAGE = "https://github.com/muvarov/daq-odp" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2713c79cde0756d6a56337304277b711" + +DEPENDS = "odp daq" +PV = "20140828+git${SRCPV}" + +SRC_URI = "git://github.com/muvarov/daq-odp.git" +SRCREV = "c1dafe0ce4ea93401726ac53b3d129bb89b634ff" +SRCREV_FORMAT = "daq-odp" + +S = "${WORKDIR}/git" + +inherit autotools + +FILES_${PN} += "${libdir}/daq/daq_odp.so ${libdir}/daq/daq_odp.la" +FILES_${PN}-dbg += "${libdir}/daq/.debug/daq_odp.so" diff --git a/meta-linaro/recipes-extra/dwarfutils/README b/meta-linaro/recipes-extra/dwarfutils/README new file mode 100644 index 0000000..5edf841 --- /dev/null +++ b/meta-linaro/recipes-extra/dwarfutils/README @@ -0,0 +1,18 @@ +Patches were submitted upstream and the answer was: + +--------- +Yes, I assume host == build in all releases to date. AFAIK you are the +first to try a canadian-cross build. + +Another issue is that the build is not set up to do the build anywhere +but inside the source tree. It is true that make-clean/CLEANUP fixes up +the mess pretty well, but a separate build directory would be a nice +(and traditional) thing to allow. + +I cannot use your submission for anything (Linaro and I have no +agreement in place) but I think these are interesting and worthwhile +small issues that libdwarf/dwarfdump should be able to deal with. + +Thanks for the suggestion. I made a note and should be able to take a +look at this issue in the near future. +--------- diff --git a/meta-linaro/recipes-extra/dwarfutils/dwarf.inc b/meta-linaro/recipes-extra/dwarfutils/dwarf.inc new file mode 100644 index 0000000..6839f49 --- /dev/null +++ b/meta-linaro/recipes-extra/dwarfutils/dwarf.inc @@ -0,0 +1,12 @@ +DEPENDS = "elfutils" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=db2a565b9d860834e0f2c9cf569fb4e5" + +SRC_URI = "http://www.prevanders.net/libdwarf-${PV}.tar.gz" + +SRC_URI[md5sum] = "83ab49c58439254729f543be6977692b" +SRC_URI[sha256sum] = "c0aede3a7368c27572ae1cc403c4cbdbf6eeb91a05adbb6f41c40ed78b75cdd9" + +S = "${WORKDIR}/dwarf-${PV}/${BPN}" + +inherit autotools diff --git a/meta-linaro/recipes-extra/dwarfutils/dwarfdump/fix-dump.patch b/meta-linaro/recipes-extra/dwarfutils/dwarfdump/fix-dump.patch new file mode 100644 index 0000000..45ca7a8 --- /dev/null +++ b/meta-linaro/recipes-extra/dwarfutils/dwarfdump/fix-dump.patch @@ -0,0 +1,25 @@ +--- + Makefile.in | 4 ++++ + 1 file changed, 4 insertions(+) + +--- dwarfdump.orig/Makefile.in ++++ dwarfdump/Makefile.in +@@ -104,14 +104,18 @@ naming.o: $(srcdir)/naming.c $(srcdir)/ + # in the tree builds. + trivial_naming.o: $(srcdir)/naming.c + $(CC) $(CFLAGS) -DTRIVIAL_NAMING -c $(srcdir)/naming.c -o trivial_naming.o + + tag_tree_build: $(srcdir)/tag_tree.c $(DIRINC)/dwarf.h $(HEADERS) tag_common.o makename.o common.o trivial_naming.o ++ifeq ($(NATIVE),1) + $(CC) $(CFLAGS) $(srcdir)/tag_tree.c tag_common.o common.o makename.o trivial_naming.o $(LDFLAGS) -o tag_tree_build ++endif + + tag_attr_build: $(srcdir)/tag_attr.c $(DIRINC)/dwarf.h $(HEADERS) tag_common.o makename.o common.o trivial_naming.o ++ifeq ($(NATIVE),1) + $(CC) $(CFLAGS) $(srcdir)/tag_attr.c tag_common.o common.o makename.o trivial_naming.o $(LDFLAGS) -o tag_attr_build ++endif + + tmp-tt-table.c tmp-tt-ext-table.c: $(srcdir)/tag_tree_ext.list $(srcdir)/tag_tree.list tag_tree_build + # gcc -E tag_tree.list does not work, so use a .c name + -rm -f tmp-t1.c + cp $(srcdir)/tag_tree.list tmp-t1.c diff --git a/meta-linaro/recipes-extra/dwarfutils/dwarfdump2/fix-dump.patch b/meta-linaro/recipes-extra/dwarfutils/dwarfdump2/fix-dump.patch new file mode 100644 index 0000000..18ffe81 --- /dev/null +++ b/meta-linaro/recipes-extra/dwarfutils/dwarfdump2/fix-dump.patch @@ -0,0 +1,27 @@ +--- + Makefile.in | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +--- dwarfdump2.orig/Makefile.in ++++ dwarfdump2/Makefile.in +@@ -100,14 +100,17 @@ common.o: $(srcdir)/common.cc $(srcdir) + # in the tree builds. + trivial_naming.o: $(srcdir)/naming.cc + $(CXX) $(CXXFLAGS) -DTRIVIAL_NAMING -c $(srcdir)/naming.cc -o trivial_naming.o + + tag_tree_build: $(srcdir)/tag_tree.cc $(DIRINC)/dwarf.h $(HEADERS) tag_common.o trivial_naming.o common.o +- $(CXX) $(CXXFLAGS) $(srcdir)/tag_tree.cc trivial_naming.o tag_common.o common.o $(LDFLAGS) -o tag_tree_build +- ++ifeq ($(NATIVE),1) ++ $(CXX) $(CXXFLAGS) $(srcdir)/tag_tree.cc trivial_naming.o tag_common.o common.o $(LDFLAGS) -o tag_tree_build ++endif + tag_attr_build: $(srcdir)/tag_attr.cc $(DIRINC)/dwarf.h $(HEADERS) trivial_naming.o tag_common.o naming.o common.o +- $(CXX) $(CXXFLAGS) $(srcdir)/tag_attr.cc trivial_naming.o tag_common.o common.o $(LDFLAGS) -o tag_attr_build ++ifeq ($(NATIVE),1) ++ $(CXX) $(CXXFLAGS) $(srcdir)/tag_attr.cc trivial_naming.o tag_common.o common.o $(LDFLAGS) -o tag_attr_build ++endif + + tmp-tt-table.cc tmp-tt-ext-table.cc: $(srcdir)/tag_tree_ext.list $(srcdir)/tag_tree.list tag_tree_build + # gcc -E tag_tree.list does not work, so use a .cc name + -rm -f tmp-t1.cc + cp $(srcdir)/tag_tree.list tmp-t1.cc diff --git a/meta-linaro/recipes-extra/dwarfutils/dwarfdump2_20121130.bb b/meta-linaro/recipes-extra/dwarfutils/dwarfdump2_20121130.bb new file mode 100644 index 0000000..10999d6 --- /dev/null +++ b/meta-linaro/recipes-extra/dwarfutils/dwarfdump2_20121130.bb @@ -0,0 +1,22 @@ +require dwarf.inc + +DEPENDS = "libdwarf libdwarf-native" + +LIC_FILES_CHKSUM = "file://GPL.txt;md5=751419260aa954499f7abaabaa882bbe" + +SRC_URI += "file://fix-dump.patch" + +do_compile_prepend() { + oe_runmake CXX="${BUILD_CXX}" \ + CXXFLAGS="${BUILD_CXXFLAGS} -I${S}/../libdwarf/ -I." \ + LDFLAGS="${BUILD_LDFLAGS} -ldwarf -lelf" NATIVE=1 + rm *.o dwarfdump +} + +do_install() { + install -d ${D}${bindir} ${D}${mandir}/man1 + install -m 0755 dwarfdump ${D}${bindir} + install -m 0644 dwarfdump.1 ${D}${mandir}/man1 +} + +PARALLEL_MAKE = "" diff --git a/meta-linaro/recipes-extra/dwarfutils/dwarfdump_20121130.bb b/meta-linaro/recipes-extra/dwarfutils/dwarfdump_20121130.bb new file mode 100644 index 0000000..1befb31 --- /dev/null +++ b/meta-linaro/recipes-extra/dwarfutils/dwarfdump_20121130.bb @@ -0,0 +1,22 @@ +require dwarf.inc + +DEPENDS = "libdwarf libdwarf-native" + +LIC_FILES_CHKSUM = "file://GPL.txt;md5=751419260aa954499f7abaabaa882bbe" + +SRC_URI += "file://fix-dump.patch" + +do_compile_prepend() { + oe_runmake CC="${BUILD_CC}" \ + CFLAGS="${BUILD_CFLAGS} -I${S}/../libdwarf/ -I." \ + LDFLAGS="${BUILD_LDFLAGS} -ldwarf -lelf" NATIVE=1 + rm *.o dwarfdump +} + +do_install() { + install -d ${D}${bindir} ${D}${mandir}/man1 + install -m 0755 dwarfdump ${D}${bindir} + install -m 0644 dwarfdump.1 ${D}${mandir}/man1 +} + +PARALLEL_MAKE = "" diff --git a/meta-linaro/recipes-extra/dwarfutils/dwarfgen_20121130.bb b/meta-linaro/recipes-extra/dwarfutils/dwarfgen_20121130.bb new file mode 100644 index 0000000..97d3b2f --- /dev/null +++ b/meta-linaro/recipes-extra/dwarfutils/dwarfgen_20121130.bb @@ -0,0 +1,13 @@ +require dwarf.inc + +DEPENDS = "libdwarf libdwarf-native" + +LIC_FILES_CHKSUM = "file://GPL.txt;md5=751419260aa954499f7abaabaa882bbe" + +do_install() { + install -d ${D}${bindir} ${D}${mandir}/man1 + install -m 0755 ${BPN} ${D}${bindir} + install -m 0644 ${BPN}.1 ${D}${mandir}/man1 +} + +PARALLEL_MAKE = "" diff --git a/meta-linaro/recipes-extra/dwarfutils/libdwarf/fix-gennames.patch b/meta-linaro/recipes-extra/dwarfutils/libdwarf/fix-gennames.patch new file mode 100644 index 0000000..901409d --- /dev/null +++ b/meta-linaro/recipes-extra/dwarfutils/libdwarf/fix-gennames.patch @@ -0,0 +1,22 @@ +--- + Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- libdwarf.orig/Makefile.in ++++ libdwarf/Makefile.in +@@ -135,13 +135,13 @@ libdwarf.so: dwarf_names.h dwarf_names.c + $(CC) $(CFLAGS) -shared $(OBJS) dwarf_names.o -o $@ + + none: + echo "do nothing" + common.o: $(srcdir)/common.c $(srcdir)/common.h +- $(CC) $(CFLAGS) -c $(srcdir)/common.c ++ $(BUILD_CC) $(BUILD_CFLAGS) -c $(srcdir)/common.c + gennames: $(srcdir)/gennames.c $(srcdir)/dwarf.h common.o +- $(CC) $(CFLAGS) $(srcdir)/gennames.c common.o $(LDFLAGS) -o gennames ++ $(BUILD_CC) $(BUILD_CFLAGS) $(srcdir)/gennames.c common.o $(BUILD_LDFLAGS) -o gennames + dwarf_names.c dwarf_names.h: gennames $(srcdir)/dwarf.h + rm -f dwarf_names.h dwarf_names.c + ./gennames @dwarf_namestable@ -i $(srcdir) -o . + + diff --git a/meta-linaro/recipes-extra/dwarfutils/libdwarf_20121130.bb b/meta-linaro/recipes-extra/dwarfutils/libdwarf_20121130.bb new file mode 100644 index 0000000..828e0d0 --- /dev/null +++ b/meta-linaro/recipes-extra/dwarfutils/libdwarf_20121130.bb @@ -0,0 +1,13 @@ +require dwarf.inc + +SRC_URI += "file://fix-gennames.patch" + +do_install() { + install -d ${D}${libdir} ${D}${includedir}/libdwarf + install -m 0755 libdwarf.a ${D}${libdir} + install -m 0644 ${S}/dwarf.h ${S}/libdwarf.h ${D}${includedir}/libdwarf +} + +ALLOW_EMPTY_${PN} = "1" + +BBCLASSEXTEND = "native" diff --git a/meta-linaro/recipes-extra/efibootmgr/efibootmgr_0.5.4.bb b/meta-linaro/recipes-extra/efibootmgr/efibootmgr_0.5.4.bb new file mode 100644 index 0000000..1b91418 --- /dev/null +++ b/meta-linaro/recipes-extra/efibootmgr/efibootmgr_0.5.4.bb @@ -0,0 +1,33 @@ +DESCRIPTION = "Linux user-space application to modify the EFI Boot Manager." +SUMMARY = "EFI Boot Manager" +HOMEPAGE = "http://linux.dell.com/efibootmgr/" +SECTION = "base" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" +DEPENDS = "pciutils \ + zlib" +COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" + +PR = "r1" + +SRC_URI = "http://linux.dell.com/efibootmgr/permalink/efibootmgr-${PV}.tar.gz \ + file://ldflags.patch \ + file://docbook-fixes.patch \ + file://w-keep-existing-mbr-signature.patch \ + file://efibootmgr-0.5.4-support-4k-sectors.patch \ + file://efibootmgr-0.5.4-Work-around-broken-Apple-firmware.patch \ + file://efibootmgr-0.5.4-Remove-device-path-padding-on-non-Itanium.patch \ + file://efibootmgr-0.5.4-fix-minor-memory-leak.patch \ + file://efibootmgr-0.5.4-fix-disk-minor-number-discovery.patch \ + file://efibootmgr-0.5.4-make_boot_var-does-not-check-for-failed-status-with-.patch" + +SRC_URI[md5sum] = "cfcf24752d6461b73f7ba964bbf73169" +SRC_URI[sha256sum] = "b562a47a4f5327494992f2ee6ae14a75c5aeb9b4a3a78a06749d5cd2917b8e71" + +S = "${WORKDIR}/efibootmgr-${PV}" + +EXTRA_OEMAKE = "'CC=${CC}' 'CFLAGS=${CFLAGS} -I${S}/src/lib -I${S}/src/include'" + +do_install () { + install -D -p -m0755 src/efibootmgr/efibootmgr ${D}/${sbindir}/efibootmgr +} diff --git a/meta-linaro/recipes-extra/efibootmgr/files/docbook-fixes.patch b/meta-linaro/recipes-extra/efibootmgr/files/docbook-fixes.patch new file mode 100644 index 0000000..fa711da --- /dev/null +++ b/meta-linaro/recipes-extra/efibootmgr/files/docbook-fixes.patch @@ -0,0 +1,22 @@ +diff --git a/src/man/man8/efibootmgr.8.docbook b/src/man/man8/efibootmgr.8.docbook +index aef4444..eb8f266 100644 +--- a/src/man/man8/efibootmgr.8.docbook ++++ b/src/man/man8/efibootmgr.8.docbook +@@ -302,7 +302,7 @@ + Displaying the current settings (must be root). + + +- ++ + [root@localhost ~]# efibootmgr + BootCurrent: 0004 + BootNext: 0003 +@@ -313,7 +313,7 @@ + Boot0002* Hard Drive(Device:80)/HD(Part1,Sig00112233) + Boot0003* PXE Boot: MAC(00D0B7C15D91) + Boot0004* Linux +- ++ + + This shows: + diff --git a/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-Remove-device-path-padding-on-non-Itanium.patch b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-Remove-device-path-padding-on-non-Itanium.patch new file mode 100644 index 0000000..240aa69 --- /dev/null +++ b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-Remove-device-path-padding-on-non-Itanium.patch @@ -0,0 +1,28 @@ +From 2d8f962284f40b918c0fc8385e58fcba219ddc12 Mon Sep 17 00:00:00 2001 +From: Fedora Ninjas +Date: Wed, 28 Nov 2012 17:13:24 -0500 +Subject: [PATCH 2/5] Remove device path padding on non-Itanium + +This code predates EFI support on any x86 hardware, and it's a strict +violation of the specification. Windows doesn't do it either. +--- + src/include/efi.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/include/efi.h b/src/include/efi.h +index be667ae..c2ac853 100644 +--- a/src/include/efi.h ++++ b/src/include/efi.h +@@ -294,7 +294,9 @@ typedef struct { + uint8_t signature[16]; + uint8_t mbr_type; + uint8_t signature_type; ++#ifdef __ia64 + uint8_t padding[6]; /* Emperically needed */ ++#endif + } __attribute__((packed)) HARDDRIVE_DEVICE_PATH; + + typedef struct { +-- +1.8.0 + diff --git a/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-Work-around-broken-Apple-firmware.patch b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-Work-around-broken-Apple-firmware.patch new file mode 100644 index 0000000..a1d9831 --- /dev/null +++ b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-Work-around-broken-Apple-firmware.patch @@ -0,0 +1,30 @@ +From 6edc3ed5479b575f87eb51e335957b05fdd04fe8 Mon Sep 17 00:00:00 2001 +From: Fedora Ninjas +Date: Wed, 28 Nov 2012 16:49:18 -0500 +Subject: [PATCH 1/5] Work around broken Apple firmware + +Alex Murray found that Apple's firmware sets an invalid EFI attribute on +BootCurrent, which newer versions of the kernel then reject. This patch +from him simply masks off the extraneous bit. +--- + src/lib/efivars_sysfs.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/lib/efivars_sysfs.c b/src/lib/efivars_sysfs.c +index 182c70f..ea87325 100644 +--- a/src/lib/efivars_sysfs.c ++++ b/src/lib/efivars_sysfs.c +@@ -55,6 +55,10 @@ sysfs_read_variable(const char *name, efi_variable_t *var) + return EFI_INVALID_PARAMETER; + } + close(fd); ++ /* latest apple firmware sets high bit which appears invalid ++ to the linux kernel if we write it back so lets zero it out ++ if it is set since it would be invalid to set it anyway */ ++ var->Attributes = var->Attributes & ~(1 << 31); + return var->Status; + } + +-- +1.8.0 + diff --git a/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-fix-disk-minor-number-discovery.patch b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-fix-disk-minor-number-discovery.patch new file mode 100644 index 0000000..e9b5358 --- /dev/null +++ b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-fix-disk-minor-number-discovery.patch @@ -0,0 +1,29 @@ +From f9f4ee75ad745637a47bf17ed968101b1ffbcc1d Mon Sep 17 00:00:00 2001 +From: Matt Domsch +Date: Thu, 23 Jul 2009 14:20:19 -0500 +Subject: [PATCH 4/5] fix disk minor number discovery + +Raymund Will noted disk_info_from_fd() incorrectly used logical && +instead of bitwise & when obtaining the minor number. + +Reported in https://bugzilla.novell.com/show_bug.cgi?id=524529#c1 +--- + src/lib/disk.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/lib/disk.c b/src/lib/disk.c +index ebfe619..8ad590b 100644 +--- a/src/lib/disk.c ++++ b/src/lib/disk.c +@@ -55,7 +55,7 @@ disk_info_from_fd(int fd, + return 1; + } + major = buf.st_dev >> 8; +- minor = buf.st_dev && 0xFF; ++ minor = buf.st_dev & 0xFF; + + /* IDE disks can have up to 64 partitions, or 6 bits worth, + * and have one bit for the disk number. +-- +1.8.0 + diff --git a/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-fix-minor-memory-leak.patch b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-fix-minor-memory-leak.patch new file mode 100644 index 0000000..1ff4ce3 --- /dev/null +++ b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-fix-minor-memory-leak.patch @@ -0,0 +1,29 @@ +From 36c3a19c62cc3b6841e363712c3c78ef5915122d Mon Sep 17 00:00:00 2001 +From: Matt Domsch +Date: Thu, 23 Jul 2009 14:18:11 -0500 +Subject: [PATCH 3/5] fix minor memory leak + +David Binderman noted new_data was being allocated but not freed. Not +a big deal as the program exits soon thereafter (and is thus freed), +but worth fixing anyhow. + +Fixes https://bugzilla.novell.com/show_bug.cgi?id=524529#c1 +--- + src/efibootmgr/efibootmgr.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c +index b984143..de67af0 100644 +--- a/src/efibootmgr/efibootmgr.c ++++ b/src/efibootmgr/efibootmgr.c +@@ -328,6 +328,7 @@ add_to_boot_order(uint16_t num) + /* Now new_data has what we need */ + memcpy(&(boot_order.Data), new_data, new_data_size); + boot_order.DataSize = new_data_size; ++ free(new_data); + return create_or_edit_variable(&boot_order); + } + +-- +1.8.0 + diff --git a/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-make_boot_var-does-not-check-for-failed-status-with-.patch b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-make_boot_var-does-not-check-for-failed-status-with-.patch new file mode 100644 index 0000000..75374ac --- /dev/null +++ b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-make_boot_var-does-not-check-for-failed-status-with-.patch @@ -0,0 +1,47 @@ +From 5fcfccb39089febb89945b841f489b5acc7638ce Mon Sep 17 00:00:00 2001 +From: Lane Winner +Date: Tue, 24 Apr 2012 12:58:57 -0500 +Subject: [PATCH 5/5] make_boot_var does not check for failed status with + create_variable. This can result in a memory leak. + Additionally the user should be notified of the + problem. + +We encounter this issue on one system after filling up the UEFI boot list +with dummy devices. + +The patch fix the problem. It was verified on a Mensa system using RHEL 6.0 + +Signed-off-by: Yinghai Lu +--- + src/efibootmgr/efibootmgr.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c +index de67af0..236365a 100644 +--- a/src/efibootmgr/efibootmgr.c ++++ b/src/efibootmgr/efibootmgr.c +@@ -239,6 +239,7 @@ warn_duplicate_name(list_t *boot_list) + static var_entry_t * + make_boot_var(list_t *boot_list) + { ++ efi_status_t status; + var_entry_t *boot; + int free_number; + list_t *pos; +@@ -271,7 +272,12 @@ make_boot_var(list_t *boot_list) + free(boot); + return NULL; + } +- create_variable(&boot->var_data); ++ ++ status = create_variable(&boot->var_data); ++ if (status != EFI_SUCCESS) { ++ free(boot); ++ return NULL; ++ } + list_add_tail(&boot->list, boot_list); + return boot; + } +-- +1.8.0 + diff --git a/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-support-4k-sectors.patch b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-support-4k-sectors.patch new file mode 100644 index 0000000..c380c61 --- /dev/null +++ b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-support-4k-sectors.patch @@ -0,0 +1,176 @@ +Return-Path: pjones@redhat.com +Received: from zmta02.collab.prod.int.phx2.redhat.com (LHLO + zmta02.collab.prod.int.phx2.redhat.com) (10.5.5.32) by + mail04.corp.redhat.com with LMTP; Wed, 14 Jul 2010 14:25:52 -0400 (EDT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by zmta02.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id B69C19F152 + for ; Wed, 14 Jul 2010 14:25:52 -0400 (EDT) +Received: from zmta02.collab.prod.int.phx2.redhat.com ([127.0.0.1]) + by localhost (zmta02.collab.prod.int.phx2.redhat.com [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id jCHcGZehMQ5J for ; + Wed, 14 Jul 2010 14:25:52 -0400 (EDT) +Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) + by zmta02.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id A601C9F14C + for ; Wed, 14 Jul 2010 14:25:52 -0400 (EDT) +Received: from pjones4.install.bos.redhat.com (pjones4.install.bos.redhat.com [10.16.52.154]) + by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6EIPpGh017771; + Wed, 14 Jul 2010 14:25:52 -0400 +From: Peter Jones +To: Matt Domsch +Cc: Peter Jones , Stuart Hayes +Subject: [efibootmgr patch] Handle sector_size != 512. +Date: Wed, 14 Jul 2010 14:26:49 -0400 +Message-Id: <1279132009-26635-1-git-send-email-pjones@redhat.com> +In-Reply-To: <1279121617-17961-1-git-send-email-pjones@redhat.com> +References: <1279121617-17961-1-git-send-email-pjones@redhat.com> +X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 + +Disks can have 4kB sectors now, so don't just bail out when that's the +case. +--- + src/include/disk.h | 3 +++ + src/lib/disk.c | 43 +++++++++++++++++++++++++++++++++---------- + src/lib/gpt.c | 30 ++++++++++++++---------------- + 3 files changed, 50 insertions(+), 26 deletions(-) + +diff --git a/src/include/disk.h b/src/include/disk.h +index eb93d10..8aa37d7 100644 +--- a/src/include/disk.h ++++ b/src/include/disk.h +@@ -65,6 +65,9 @@ enum _interface_type {interface_type_unknown, + ata, atapi, scsi, usb, + i1394, fibre, i2o, md}; + ++ ++unsigned int lcm(unsigned int x, unsigned int y); ++ + int disk_get_pci(int fd, + unsigned char *bus, + unsigned char *device, +diff --git a/src/lib/disk.c b/src/lib/disk.c +index 883864f..9c3a878 100644 +--- a/src/lib/disk.c ++++ b/src/lib/disk.c +@@ -420,6 +420,27 @@ get_sector_size(int filedes) + return sector_size; + } + ++/************************************************************ ++ * lcm ++ * Requires: ++ * - numbers of which to find the lowest common multiple ++ * Modifies: nothing ++ * Returns: ++ * lowest common multiple of x and y ++ ************************************************************/ ++unsigned int ++lcm(unsigned int x, unsigned int y) ++{ ++ unsigned int m = x, n = y, o; ++ ++ while ((o = m % n)) { ++ m = n; ++ n = o; ++ } ++ ++ return (x / n) * y; ++} ++ + /** + * disk_get_partition_info() + * @fd - open file descriptor to disk +@@ -442,26 +463,27 @@ disk_get_partition_info (int fd, + uint8_t *mbr_type, uint8_t *signature_type) + { + legacy_mbr *mbr; +- void *mbr_unaligned; ++ void *mbr_sector; ++ size_t mbr_size; + off_t offset; + int this_bytes_read = 0; + int gpt_invalid=0, mbr_invalid=0; + int rc=0; + int sector_size = get_sector_size(fd); + +- if (sizeof(*mbr) != sector_size) +- return 1; +- mbr_unaligned = malloc(sizeof(*mbr)+sector_size-1); +- mbr = (legacy_mbr *) +- (((unsigned long)mbr_unaligned + sector_size - 1) & +- ~(unsigned long)(sector_size-1)); +- memset(mbr, 0, sizeof(*mbr)); ++ ++ mbr_size = lcm(sizeof(*mbr), sector_size); ++ if ((rc = posix_memalign(&mbr_sector, sector_size, mbr_size)) != 0) ++ goto error; ++ memset(mbr_sector, '\0', mbr_size); ++ + offset = lseek(fd, 0, SEEK_SET); +- this_bytes_read = read(fd, mbr, sizeof(*mbr)); ++ this_bytes_read = read(fd, mbr_sector, mbr_size); + if (this_bytes_read < sizeof(*mbr)) { + rc=1; + goto error_free_mbr; + } ++ mbr = (legacy_mbr *)mbr_sector; + gpt_invalid = gpt_disk_get_partition_info(fd, num, + start, size, + signature, +@@ -479,7 +501,8 @@ disk_get_partition_info (int fd, + } + } + error_free_mbr: +- free(mbr_unaligned); ++ free(mbr_sector); ++ error: + return rc; + } + +diff --git a/src/lib/gpt.c b/src/lib/gpt.c +index d90ddaf..83e7a94 100644 +--- a/src/lib/gpt.c ++++ b/src/lib/gpt.c +@@ -215,26 +215,24 @@ read_lastoddsector(int fd, uint64_t lba, void *buffer, size_t count) + static ssize_t + read_lba(int fd, uint64_t lba, void *buffer, size_t bytes) + { +- int sector_size = get_sector_size(fd); +- off_t offset = lba * sector_size; ++ int sector_size = get_sector_size(fd); ++ off_t offset = lba * sector_size; + ssize_t bytesread; +- void *aligned; +- void *unaligned; +- +- if (bytes % sector_size) +- return EINVAL; ++ void *iobuf; ++ size_t iobuf_size; ++ int rc; + +- unaligned = malloc(bytes+sector_size-1); +- aligned = (void *) +- (((unsigned long)unaligned + sector_size - 1) & +- ~(unsigned long)(sector_size-1)); +- memset(aligned, 0, bytes); ++ iobuf_size = lcm(bytes, sector_size); ++ rc = posix_memalign(&iobuf, sector_size, iobuf_size); ++ if (rc) ++ return rc; ++ memset(iobuf, 0, bytes); + + +- lseek(fd, offset, SEEK_SET); +- bytesread = read(fd, aligned, bytes); +- memcpy(buffer, aligned, bytesread); +- free(unaligned); ++ lseek(fd, offset, SEEK_SET); ++ bytesread = read(fd, iobuf, iobuf_size); ++ memcpy(buffer, iobuf, bytes); ++ free(iobuf); + + /* Kludge. This is necessary to read/write the last + block of an odd-sized disk, until Linux 2.5.x kernel fixes. +-- +1.7.1.1 + diff --git a/meta-linaro/recipes-extra/efibootmgr/files/ldflags.patch b/meta-linaro/recipes-extra/efibootmgr/files/ldflags.patch new file mode 100644 index 0000000..3207920 --- /dev/null +++ b/meta-linaro/recipes-extra/efibootmgr/files/ldflags.patch @@ -0,0 +1,11 @@ +--- efibootmgr-0.5.4.orig/Makefile ++++ efibootmgr-0.5.4/Makefile +@@ -11,6 +11,8 @@ + CFLAGS = $(EXTRA_CFLAGS) -DEFIBOOTMGR_VERSION=\"$(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_SUBLEVEL)$(RELEASE_EXTRALEVEL)\" \ + -Wall -g -D_FILE_OFFSET_BITS=64 + ++ LDFLAGS += -lz ++ + MODULES := src + + BINDIR := /usr/sbin diff --git a/meta-linaro/recipes-extra/efibootmgr/files/w-keep-existing-mbr-signature.patch b/meta-linaro/recipes-extra/efibootmgr/files/w-keep-existing-mbr-signature.patch new file mode 100644 index 0000000..6934808 --- /dev/null +++ b/meta-linaro/recipes-extra/efibootmgr/files/w-keep-existing-mbr-signature.patch @@ -0,0 +1,20 @@ +Description: Fix -w option to leave an existing unique MBR signature intact + This makes the implementation match the documentation. +Author: Colin Watson +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1065261 +Forwarded: no +Last-Update: 2013-02-01 + +Index: b/src/lib/disk.c +=================================================================== +--- a/src/lib/disk.c ++++ b/src/lib/disk.c +@@ -352,7 +352,7 @@ + printf("******************************************************\n\n"); + + } +- else if (opts.write_signature) { ++ else if (!mbr->unique_mbr_signature && opts.write_signature) { + + /* MBR Signatures must be unique for the + EFI Boot Manager diff --git a/meta-linaro/recipes-extra/ganglia/ganglia/gmetad-example.conf b/meta-linaro/recipes-extra/ganglia/ganglia/gmetad-example.conf new file mode 100644 index 0000000..7f2fd7f --- /dev/null +++ b/meta-linaro/recipes-extra/ganglia/ganglia/gmetad-example.conf @@ -0,0 +1,122 @@ +# This is an example of a Ganglia Meta Daemon configuration file +# http://ganglia.sourceforge.net/ +# +#------------------------------------------------------------------------------- +# Setting the debug_level to 1 will keep daemon in the forground and +# show only error messages. Setting this value higher than 1 will make +# gmetad output debugging information and stay in the foreground. +# default: 0 +# debug_level 10 +# +#------------------------------------------------------------------------------- +# What to monitor. The most important section of this file. +# +# The data_source tag specifies either a cluster or a grid to +# monitor. If we detect the source is a cluster, we will maintain a complete +# set of RRD databases for it, which can be used to create historical +# graphs of the metrics. If the source is a grid (it comes from another gmetad), +# we will only maintain summary RRDs for it. +# +# Format: +# data_source "my cluster" [polling interval] address1:port addreses2:port ... +# +# The keyword 'data_source' must immediately be followed by a unique +# string which identifies the source, then an optional polling interval in +# seconds. The source will be polled at this interval on average. +# If the polling interval is omitted, 15sec is asssumed. +# +# A list of machines which service the data source follows, in the +# format ip:port, or name:port. If a port is not specified then 8649 +# (the default gmond port) is assumed. +# default: There is no default value +# +# data_source "my cluster" 10 localhost my.machine.edu:8649 1.2.3.5:8655 +# data_source "my grid" 50 1.3.4.7:8655 grid.org:8651 grid-backup.org:8651 +# data_source "another source" 1.3.4.7:8655 1.3.4.8 + +data_source "my cluster" localhost + +# +# Round-Robin Archives +# You can specify custom Round-Robin archives here (defaults are listed below) +# +# RRAs "RRA:AVERAGE:0.5:1:244" "RRA:AVERAGE:0.5:24:244" "RRA:AVERAGE:0.5:168:244" "RRA:AVERAGE:0.5:672:244" \ +# "RRA:AVERAGE:0.5:5760:374" +# + +# +#------------------------------------------------------------------------------- +# Scalability mode. If on, we summarize over downstream grids, and respect +# authority tags. If off, we take on 2.5.0-era behavior: we do not wrap our output +# in tags, we ignore all tags we see, and always assume +# we are the "authority" on data source feeds. This approach does not scale to +# large groups of clusters, but is provided for backwards compatibility. +# default: on +# scalable off +# +#------------------------------------------------------------------------------- +# The name of this Grid. All the data sources above will be wrapped in a GRID +# tag with this name. +# default: unspecified +# gridname "MyGrid" +# +#------------------------------------------------------------------------------- +# The authority URL for this grid. Used by other gmetads to locate graphs +# for our data sources. Generally points to a ganglia/ +# website on this machine. +# default: "http://hostname/ganglia/", +# where hostname is the name of this machine, as defined by gethostname(). +# authority "http://mycluster.org/newprefix/" +# +#------------------------------------------------------------------------------- +# List of machines this gmetad will share XML with. Localhost +# is always trusted. +# default: There is no default value +# trusted_hosts 127.0.0.1 169.229.50.165 my.gmetad.org +# +#------------------------------------------------------------------------------- +# If you want any host which connects to the gmetad XML to receive +# data, then set this value to "on" +# default: off +# all_trusted on +# +#------------------------------------------------------------------------------- +# If you don't want gmetad to setuid then set this to off +# default: on +# setuid off +# +#------------------------------------------------------------------------------- +# User gmetad will setuid to (defaults to "nobody") +# default: "nobody" +# setuid_username "nobody" +# +#------------------------------------------------------------------------------- +# The port gmetad will answer requests for XML +# default: 8651 +# xml_port 8651 +# +#------------------------------------------------------------------------------- +# The port gmetad will answer queries for XML. This facility allows +# simple subtree and summation views of the XML tree. +# default: 8652 +# interactive_port 8652 +# +#------------------------------------------------------------------------------- +# The number of threads answering XML requests +# default: 4 +# server_threads 10 +# +#------------------------------------------------------------------------------- +# Where gmetad stores its round-robin databases +# default: "/var/lib/ganglia/rrds" +# rrd_rootdir "/some/other/place" +# +#------------------------------------------------------------------------------- +# In earlier versions of gmetad, hostnames were handled in a case +# sensitive manner +# If your hostname directories have been renamed to lower case, +# set this option to 0 to disable backward compatibility. +# From version 3.2, backwards compatibility will be disabled by default. +# default: 1 (for gmetad < 3.2) +# default: 0 (for gmetad >= 3.2) +case_sensitive_hostnames 1 diff --git a/meta-linaro/recipes-extra/ganglia/ganglia/gmetad.init b/meta-linaro/recipes-extra/ganglia/ganglia/gmetad.init new file mode 100755 index 0000000..822f59c --- /dev/null +++ b/meta-linaro/recipes-extra/ganglia/ganglia/gmetad.init @@ -0,0 +1,48 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: gmetad +# Required-Start: $local_fs +# Should-Start: +# Required-Stop: $local_fs +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: gmetad initscript +# Description: Starts the gmetad monitoring daemon +### END INIT INFO + +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +DESC="Ganglia Monitor Meta-Daemon" +NAME="gmetad" +GMETAD=`which $NAME` + +. /etc/init.d/functions || exit 1 + +# Exit if the package is not installed +[ -x "$GMETAD" ] || exit 0 + +case "$1" in + start) + echo -n "Starting $DESC: $NAME... " + start-stop-daemon -S -x $GMETAD -- $GMETAD_ARGS + echo "done." + ;; + stop) + echo -n "Stopping $DESC: $NAME... " + start-stop-daemon -K -x $GMETAD + echo "done." + ;; + restart) + echo "Restarting $DESC: $NAME... " + $0 stop + $0 start + echo "done." + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta-linaro/recipes-extra/ganglia/ganglia/gmond-example.conf b/meta-linaro/recipes-extra/ganglia/ganglia/gmond-example.conf new file mode 100644 index 0000000..a94b4b5 --- /dev/null +++ b/meta-linaro/recipes-extra/ganglia/ganglia/gmond-example.conf @@ -0,0 +1,383 @@ +/* This configuration is as close to 2.5.x default behavior as possible + The values closely match ./gmond/metric.h definitions in 2.5.x */ +globals { + daemonize = yes + setuid = yes + user = nobody + debug_level = 0 + max_udp_msg_len = 1472 + mute = no + deaf = yes + allow_extra_data = yes + host_dmax = 86400 /*secs. Expires (removes from web interface) hosts in 1 day */ + host_tmax = 20 /*secs */ + cleanup_threshold = 300 /*secs */ + gexec = no + # By default gmond will use reverse DNS resolution when displaying your hostname + # Uncommeting following value will override that value. + # override_hostname = "mywebserver.domain.com" + # If you are not using multicast this value should be set to something other than 0. + # Otherwise if you restart aggregator gmond you will get empty graphs. 60 seconds is reasonable + send_metadata_interval = 20 /*secs */ + +} + +/* + * The cluster attributes specified will be used as part of the + * tag that will wrap all hosts collected by this instance. + */ +cluster { + name = "unspecified" + owner = "unspecified" + latlong = "unspecified" + url = "unspecified" +} + +/* The host section describes attributes of the host, like the location */ +host { + location = "unspecified" +} + +/* Feel free to specify as many udp_send_channels as you like. Gmond + used to only support having a single channel */ +udp_send_channel { + #bind_hostname = yes # Highly recommended, soon to be default. + # This option tells gmond to use a source address + # that resolves to the machine's hostname. Without + # this, the metrics may appear to come from any + # interface and the DNS names associated with + # those IPs will be used to create the RRDs. + mcast_join = 239.2.11.71 + port = 8649 + ttl = 1 +} + +/* You can specify as many udp_recv_channels as you like as well. */ +udp_recv_channel { + mcast_join = 239.2.11.71 + port = 8649 + bind = 239.2.11.71 + retry_bind = true + # Size of the UDP buffer. If you are handling lots of metrics you really + # should bump it up to e.g. 10MB or even higher. + # buffer = 10485760 +} + +/* You can specify as many tcp_accept_channels as you like to share + an xml description of the state of the cluster */ +tcp_accept_channel { + port = 8649 + # If you want to gzip XML output + gzip_output = no +} + +/* Channel to receive sFlow datagrams */ +#udp_recv_channel { +# port = 6343 +#} + +/* Optional sFlow settings */ +#sflow { +# udp_port = 6343 +# accept_vm_metrics = yes +# accept_jvm_metrics = yes +# multiple_jvm_instances = no +# accept_http_metrics = yes +# multiple_http_instances = no +# accept_memcache_metrics = yes +# multiple_memcache_instances = no +#} + +/* Each metrics module that is referenced by gmond must be specified and + loaded. If the module has been statically linked with gmond, it does + not require a load path. However all dynamically loadable modules must + include a load path. */ +modules { + module { + name = "core_metrics" + } + module { + name = "cpu_module" + path = "modcpu.so" + } + module { + name = "disk_module" + path = "moddisk.so" + } + module { + name = "load_module" + path = "modload.so" + } + module { + name = "mem_module" + path = "modmem.so" + } + module { + name = "net_module" + path = "modnet.so" + } + module { + name = "proc_module" + path = "modproc.so" + } + module { + name = "sys_module" + path = "modsys.so" + } +} + +/* The old internal 2.5.x metric array has been replaced by the following + collection_group directives. What follows is the default behavior for + collecting and sending metrics that is as close to 2.5.x behavior as + possible. */ + +/* This collection group will cause a heartbeat (or beacon) to be sent every + 20 seconds. In the heartbeat is the GMOND_STARTED data which expresses + the age of the running gmond. */ +collection_group { + collect_once = yes + time_threshold = 20 + metric { + name = "heartbeat" + } +} + +/* This collection group will send general info about this host every + 1200 secs. + This information doesn't change between reboots and is only collected + once. */ +collection_group { + collect_once = yes + time_threshold = 1200 + metric { + name = "cpu_num" + title = "CPU Count" + } + metric { + name = "cpu_speed" + title = "CPU Speed" + } + metric { + name = "mem_total" + title = "Memory Total" + } + /* Should this be here? Swap can be added/removed between reboots. */ + metric { + name = "swap_total" + title = "Swap Space Total" + } + metric { + name = "boottime" + title = "Last Boot Time" + } + metric { + name = "machine_type" + title = "Machine Type" + } + metric { + name = "os_name" + title = "Operating System" + } + metric { + name = "os_release" + title = "Operating System Release" + } + metric { + name = "location" + title = "Location" + } +} + +/* This collection group will send the status of gexecd for this host + every 300 secs.*/ +/* Unlike 2.5.x the default behavior is to report gexecd OFF. */ +collection_group { + collect_once = yes + time_threshold = 300 + metric { + name = "gexec" + title = "Gexec Status" + } +} + +/* This collection group will collect the CPU status info every 20 secs. + The time threshold is set to 90 seconds. In honesty, this + time_threshold could be set significantly higher to reduce + unneccessary network chatter. */ +collection_group { + collect_every = 20 + time_threshold = 90 + /* CPU status */ + metric { + name = "cpu_user" + value_threshold = "1.0" + title = "CPU User" + } + metric { + name = "cpu_system" + value_threshold = "1.0" + title = "CPU System" + } + metric { + name = "cpu_idle" + value_threshold = "5.0" + title = "CPU Idle" + } + metric { + name = "cpu_nice" + value_threshold = "1.0" + title = "CPU Nice" + } + metric { + name = "cpu_aidle" + value_threshold = "5.0" + title = "CPU aidle" + } + metric { + name = "cpu_wio" + value_threshold = "1.0" + title = "CPU wio" + } + metric { + name = "cpu_steal" + value_threshold = "1.0" + title = "CPU steal" + } + /* The next two metrics are optional if you want more detail... + ... since they are accounted for in cpu_system. + metric { + name = "cpu_intr" + value_threshold = "1.0" + title = "CPU intr" + } + metric { + name = "cpu_sintr" + value_threshold = "1.0" + title = "CPU sintr" + } + */ +} + +collection_group { + collect_every = 20 + time_threshold = 90 + /* Load Averages */ + metric { + name = "load_one" + value_threshold = "1.0" + title = "One Minute Load Average" + } + metric { + name = "load_five" + value_threshold = "1.0" + title = "Five Minute Load Average" + } + metric { + name = "load_fifteen" + value_threshold = "1.0" + title = "Fifteen Minute Load Average" + } +} + +/* This group collects the number of running and total processes */ +collection_group { + collect_every = 80 + time_threshold = 950 + metric { + name = "proc_run" + value_threshold = "1.0" + title = "Total Running Processes" + } + metric { + name = "proc_total" + value_threshold = "1.0" + title = "Total Processes" + } +} + +/* This collection group grabs the volatile memory metrics every 40 secs and + sends them at least every 180 secs. This time_threshold can be increased + significantly to reduce unneeded network traffic. */ +collection_group { + collect_every = 40 + time_threshold = 180 + metric { + name = "mem_free" + value_threshold = "1024.0" + title = "Free Memory" + } + metric { + name = "mem_shared" + value_threshold = "1024.0" + title = "Shared Memory" + } + metric { + name = "mem_buffers" + value_threshold = "1024.0" + title = "Memory Buffers" + } + metric { + name = "mem_cached" + value_threshold = "1024.0" + title = "Cached Memory" + } + metric { + name = "swap_free" + value_threshold = "1024.0" + title = "Free Swap Space" + } +} + +collection_group { + collect_every = 40 + time_threshold = 300 + metric { + name = "bytes_out" + value_threshold = 4096 + title = "Bytes Sent" + } + metric { + name = "bytes_in" + value_threshold = 4096 + title = "Bytes Received" + } + metric { + name = "pkts_in" + value_threshold = 256 + title = "Packets Received" + } + metric { + name = "pkts_out" + value_threshold = 256 + title = "Packets Sent" + } +} + +/* Different than 2.5.x default since the old config made no sense */ +collection_group { + collect_every = 1800 + time_threshold = 3600 + metric { + name = "disk_total" + value_threshold = 1.0 + title = "Total Disk Space" + } +} + +collection_group { + collect_every = 40 + time_threshold = 180 + metric { + name = "disk_free" + value_threshold = 1.0 + title = "Disk Space Available" + } + metric { + name = "part_max_used" + value_threshold = 1.0 + title = "Maximum Disk Space Used" + } +} + +include ("/etc/conf.d/*.conf") + diff --git a/meta-linaro/recipes-extra/ganglia/ganglia/gmond.init b/meta-linaro/recipes-extra/ganglia/ganglia/gmond.init new file mode 100755 index 0000000..4509329 --- /dev/null +++ b/meta-linaro/recipes-extra/ganglia/ganglia/gmond.init @@ -0,0 +1,46 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: gmond +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Starts ganglia monitor +# Description: Starts the gmond monitoring daemon +### END INIT INFO + +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +DESC="Ganglia Monitor Daemon" +NAME="gmond" +GMOND=`which $NAME` + +. /etc/init.d/functions || exit 1 + +# Exit if the package is not installed +[ -x "$GMOND" ] || exit 0 + +case "$1" in + start) + echo -n "Starting $DESC: $NAME... " + start-stop-daemon -S -x $GMOND -- $GMOND_ARGS + echo "done." + ;; + stop) + echo -n "Stopping $DESC: $NAME... " + start-stop-daemon -K -x $GMOND + echo "done." + ;; + restart) + echo "Restarting $DESC: $NAME... " + $0 stop + $0 start + echo "done." + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta-linaro/recipes-extra/ganglia/ganglia_3.6.0.bb b/meta-linaro/recipes-extra/ganglia/ganglia_3.6.0.bb new file mode 100644 index 0000000..7bed70d --- /dev/null +++ b/meta-linaro/recipes-extra/ganglia/ganglia_3.6.0.bb @@ -0,0 +1,70 @@ +DESCRIPTION = "Ganglia is a scalable distributed monitoring \ +system for high-performance computing systems such as \ +clusters and Grids." +HOMEPAGE = "http://ganglia.sourceforge.net/" +SECTION = "console/utils" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://NEWS;md5=ff8c91481123c7d3be4e31fcac997747" +DEPENDS = "apr confuse pcre python rrdtool" + +SRC_URI = "\ + ${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \ + file://gmetad-example.conf \ + file://gmetad.init \ + file://gmond-example.conf \ + file://gmond.init \ + " +SRC_URI[md5sum] = "05926bb18c22af508a3718a90b2e9a2c" +SRC_URI[sha256sum] = "89eae02e1a117040d60b3b561fe55f88d7f8cf41b94af1492969ef68e6797886" + +EXTRA_OECONF += " \ + --with-gmetad \ + --disable-python \ + " + +inherit pkgconfig autotools-brokensep pythonnative update-rc.d + +# The ganglia autoconf setup doesn't include libmetrics in its +# AC_OUTPUT list -- it reconfigures libmetrics using its own rules. +# Unfortunately this means an OE autoreconf will not regenerate +# ltmain.sh (and others) in libmetrics and as such the build will +# fail. We explicitly force regeneration of that directory. + +do_configure_append() { + (cd ${S} ; autoreconf -fvi ) + (cd ${S}/libmetrics ; autoreconf -fvi) +} + +do_install_append() { + install -d ${D}${sysconfdir}/init.d + # gmetad expects the following directory and owned by user 'nobody' + install -o nobody -d ${D}${localstatedir}/lib/${PN}/rrds + # gmond and gmetad configurations + install -m 0644 ${WORKDIR}/gmetad-example.conf ${D}${sysconfdir}/gmetad.conf + install -m 0644 ${WORKDIR}/gmond-example.conf ${D}${sysconfdir}/gmond.conf + # Init scripts + install -m 0755 ${WORKDIR}/gmetad.init ${D}${sysconfdir}/init.d/gmetad + install -m 0755 ${WORKDIR}/gmond.init ${D}${sysconfdir}/init.d/gmond + # Fixup hard-coded paths + sed -i -e 's!^PATH=.*!PATH=${base_sbindir}:${sbindir}:${base_bindir}:${bindir}!' ${D}${sysconfdir}/init.d/gmetad + sed -i -e 's!^PATH=.*!PATH=${base_sbindir}:${sbindir}:${base_bindir}:${bindir}!' ${D}${sysconfdir}/init.d/gmond + sed -i -e 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/gmetad + sed -i -e 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/gmond + sed -i -e 's!/etc/conf.d/!${sysconfdir}/conf.d/!g' ${D}${sysconfdir}/gmond.conf +} + +PACKAGES =+ "gmetad" + +RDEPENDS_${PN} = "gmetad" + +BBCLASSEXTEND = "native" + +FILES_gmetad = "\ + ${sbindir}/gmetad \ + ${sysconfdir}/init.d/gmetad \ +" + +INITSCRIPT_PACKAGES = "${PN} gmetad" +INITSCRIPT_NAME_ganglia = "gmond" +INITSCRIPT_NAME_gmetad = "gmetad" +INITSCRIPT_PARAMS = "defaults 66" diff --git a/meta-linaro/recipes-extra/hiphopvm/files/hrw-check-for-libdwarf-in-our-place-first.patch b/meta-linaro/recipes-extra/hiphopvm/files/hrw-check-for-libdwarf-in-our-place-first.patch new file mode 100644 index 0000000..bcc8352 --- /dev/null +++ b/meta-linaro/recipes-extra/hiphopvm/files/hrw-check-for-libdwarf-in-our-place-first.patch @@ -0,0 +1,32 @@ +From: Marcin Juszkiewicz + +We have two files named dwarf.h: +- /usr/include/dwarf.h from elfutils +- /usr/include/libdwarf/dwarf.h from libdwarf + +HHVM checks for dwarf.h and assumes that libdwarf.h is in same directory which +is wrong for OE and probably also in RedHat based systems (Debian handles it in +other way). + +Upstream-Status: pending + +--- + CMake/FindLibDwarf.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- git.orig/CMake/FindLibDwarf.cmake ++++ git/CMake/FindLibDwarf.cmake +@@ -18,12 +18,12 @@ endif (LIBDWARF_LIBRARIES AND LIBDWARF_I + + find_path (DWARF_INCLUDE_DIR + NAMES + dwarf.h + PATHS +- /usr/include + /usr/include/libdwarf ++ /usr/include + /usr/local/include + /opt/local/include + /sw/include + ENV CPATH) # PATH and INCLUDE will also work + diff --git a/meta-linaro/recipes-extra/hiphopvm/hiphopvm_git.bb b/meta-linaro/recipes-extra/hiphopvm/hiphopvm_git.bb new file mode 100644 index 0000000..77cd299 --- /dev/null +++ b/meta-linaro/recipes-extra/hiphopvm/hiphopvm_git.bb @@ -0,0 +1,67 @@ +DEPENDS = " \ +binutils \ +bison-native \ +boost \ +bzip2 \ +cmake \ +elfutils \ +expat \ +flex-native \ +gd \ +glog \ +icu \ +libcap \ +libc-client \ +libdwarf \ +libevent-fb \ +libmcrypt \ +libmemcached \ +libunwind \ +libxml2 \ +mysql5 \ +ncurses \ +onig \ +openldap \ +openssl \ +libpam \ +pcre \ +readline \ +zlib \ +tbb \ +${EXTRA_DEPENDS} \ +" + +# optional (for now) dependencies: +EXTRA_DEPENDS = "gperftools" +EXTRA_DEPENDS_aarch64 = "" + +# 64-bit platforms only +COMPATIBLE_HOST = '(x86_64.*|aarch64.*)-linux' + +LICENSE = "PHP Zend" + +LIC_FILES_CHKSUM = " \ + file://LICENSE.PHP;md5=cb564efdf78cce8ea6e4b5a4f7c05d97 \ + file://LICENSE.ZEND;md5=69e7a9c51846dd6692f1b946f95f6c60" + +SRC_URI = "git://github.com/facebook/hhvm.git \ + file://hrw-check-for-libdwarf-in-our-place-first.patch \ + " + +SRCREV = "4c4d11304aef8857dcce8524e7fd9223e00191b5" + +PV = "2.0.2+git${SRCPV}" + +S = "${WORKDIR}/git" + +do_configure_prepend() { + export HPHP_HOME="${B}" + export HPHP_LIB="${B}"/bin + export USE_HHVM=1 + export BOOST_INCLUDEDIR=${STAGING_INCDIR} + export BOOST_LIBRARYDIR=${STAGING_LIBDIR} + export LIBGLOG_INCLUDE_DIR=${STAGING_INCDIR} + export LIBGLOG_LIBRARY=${STAGING_LIBDIR} +} + +inherit cmake diff --git a/meta-linaro/recipes-extra/idlestat/idlestat_git.bb b/meta-linaro/recipes-extra/idlestat/idlestat_git.bb new file mode 100644 index 0000000..7018cc1 --- /dev/null +++ b/meta-linaro/recipes-extra/idlestat/idlestat_git.bb @@ -0,0 +1,16 @@ +DESCRIPTION = "tool to show how long a CPU or cluster enters idle state" +SUMMARY = "Idlestat is a tool which can show how long a CPU or cluster \ +enters idle state. This infomation is obtained using traces from trace-cmd \ +or ftrace tools." +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://Makefile;md5=1e2d28a88b081f97157089bb67d4249d" +SRCREV = "6de5e87ccf87beb0946c627c10554efb1480326f" +PV = "0.2+git${SRCPV}" + +SRC_URI = "git://git.linaro.org/power/idlestat.git" + +S = "${WORKDIR}/git" + +do_install () { + install -D -p -m0755 idlestat ${D}/${sbindir}/idlestat +} diff --git a/meta-linaro/recipes-extra/latency-test/latency-test_git.bb b/meta-linaro/recipes-extra/latency-test/latency-test_git.bb new file mode 100644 index 0000000..2d6f0ae --- /dev/null +++ b/meta-linaro/recipes-extra/latency-test/latency-test_git.bb @@ -0,0 +1,19 @@ +SUMMARY = "Latency test" +DESCRIPTION = "Test to measure the latency of the Linux kernel" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://latency.c;endline=39;md5=0ac97d68f333880973b054365ea2acc5" +SRCREV = "e9671a414d832d37b16359b6a180c7c306199c55" + +COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" + +SRC_URI = "git://git.linaro.org/people/mike.holmes/latency-test.git" + +S = "${WORKDIR}/git" + +do_compile() { + oe_runmake test +} + +do_install() { + install -D -p -m0755 latency ${D}${bindir}/latency +} diff --git a/meta-linaro/recipes-extra/libevent/files/LICENSE.txt b/meta-linaro/recipes-extra/libevent/files/LICENSE.txt new file mode 100644 index 0000000..5a315e4 --- /dev/null +++ b/meta-linaro/recipes-extra/libevent/files/LICENSE.txt @@ -0,0 +1,74 @@ +Libevent is available for use under the following license, commonly known +as the 3-clause (or "modified") BSD license: + +============================== +Copyright (c) 2000-2007 Niels Provos +Copyright (c) 2007-2010 Niels Provos and Nick Mathewson + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +============================== + +Portions of Libevent are based on works by others, also made available by +them under the three-clause BSD license above. The copyright notices are +available in the corresponding source files; the license is as above. Here's +a list: + +log.c: + Copyright (c) 2000 Dug Song + Copyright (c) 1993 The Regents of the University of California. + +strlcpy.c: + Copyright (c) 1998 Todd C. Miller + +win32select.c: + Copyright (c) 2003 Michael A. Davis + +evport.c: + Copyright (c) 2007 Sun Microsystems + +ht-internal.h: + Copyright (c) 2002 Christopher Clark + +minheap-internal.h: + Copyright (c) 2006 Maxim Yegorushkin + +============================== + +The arc4module is available under the following, sometimes called the +"OpenBSD" license: + + Copyright (c) 1996, David Mazieres + Copyright (c) 2008, Damien Miller + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/meta-linaro/recipes-extra/libevent/files/libevent-1.4.14.fb-changes.diff b/meta-linaro/recipes-extra/libevent/files/libevent-1.4.14.fb-changes.diff new file mode 100644 index 0000000..0f29aac --- /dev/null +++ b/meta-linaro/recipes-extra/libevent/files/libevent-1.4.14.fb-changes.diff @@ -0,0 +1,611 @@ +diff --git a/event.c b/event.c +index 74ba5c4..06984b8 100644 +--- a/event.c ++++ b/event.c +@@ -138,10 +138,12 @@ detect_monotonic(void) + static int + gettime(struct event_base *base, struct timeval *tp) + { ++/* + if (base->tv_cache.tv_sec) { + *tp = base->tv_cache; + return (0); + } ++*/ + + #if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) + if (use_monotonic) { +@@ -481,7 +483,7 @@ event_base_loop(struct event_base *base, int flags) + int res, done; + + /* clear time cache */ +- base->tv_cache.tv_sec = 0; ++ /* base->tv_cache.tv_sec = 0; */ + + if (base->sig.ev_signal_added) + evsignal_base = base; +@@ -533,13 +535,13 @@ event_base_loop(struct event_base *base, int flags) + gettime(base, &base->event_tv); + + /* clear time cache */ +- base->tv_cache.tv_sec = 0; ++ /* base->tv_cache.tv_sec = 0; */ + + res = evsel->dispatch(base, evbase, tv_p); + + if (res == -1) + return (-1); +- gettime(base, &base->tv_cache); ++ /* gettime(base, &base->tv_cache); */ + + timeout_process(base); + +@@ -552,7 +554,7 @@ event_base_loop(struct event_base *base, int flags) + } + + /* clear time cache */ +- base->tv_cache.tv_sec = 0; ++ /* base->tv_cache.tv_sec = 0; */ + + event_debug(("%s: asked to terminate loop.", __func__)); + return (0); +diff --git a/evhttp.h b/evhttp.h +index 7ddf720..13c8b79 100644 +--- a/evhttp.h ++++ b/evhttp.h +@@ -81,12 +81,50 @@ struct evhttp *evhttp_new(struct event_base *base); + * @param http a pointer to an evhttp object + * @param address a string containing the IP address to listen(2) on + * @param port the port number to listen on +- * @return a newly allocated evhttp struct ++ * @return 0 on success, -1 on error + * @see evhttp_free() + */ + int evhttp_bind_socket(struct evhttp *http, const char *address, u_short port); + + /** ++ * Binds an HTTP server on the specified address and port, using backlog. ++ * ++ * Can be called multiple times to bind the same http server ++ * to multiple different ports. ++ * ++ * @param http a pointer to an evhttp object ++ * @param address a string containing the IP address to listen(2) on ++ * @param port the port number to listen on ++ * @param backlog the backlog value for listen(2) ++ * @return 0 on success, -1 on error ++ * @see evhttp_free() ++ */ ++int evhttp_bind_socket_backlog(struct evhttp *http, const char *address, u_short port, int backlog); ++ ++/** ++ * Like evhttp_bind_socket(), but returns the socket file descriptor. ++ * ++ * @param http a pointer to an evhttp object ++ * @param address a string containing the IP address to listen(2) on ++ * @param port the port number to listen on ++ * @return Socket file descriptor on success, -1 on failure ++ * @see evhttp_bind_socket() ++ */ ++int evhttp_bind_socket_with_fd(struct evhttp *http, const char *address, u_short port); ++ ++/** ++ * Like evhttp_bind_socket(), but returns the socket file descriptor. ++ * ++ * @param http a pointer to an evhttp object ++ * @param address a string containing the IP address to listen(2) on ++ * @param port the port number to listen on ++ * @param backlog the backlog value for listen(2) ++ * @return Socket file descriptor on success, -1 on failure ++ * @see evhttp_bind_socket() ++ */ ++int evhttp_bind_socket_backlog_fd(struct evhttp *http, const char *address, u_short port, int backlog); ++ ++/** + * Makes an HTTP server accept connections on the specified socket + * + * This may be useful to create a socket and then fork multiple instances +@@ -105,6 +143,21 @@ int evhttp_bind_socket(struct evhttp *http, const char *address, u_short port); + int evhttp_accept_socket(struct evhttp *http, int fd); + + /** ++ * Makes an HTTP server stop accepting connections on the specified socket ++ * ++ * This may be useful when a socket has been sent via file descriptor passing ++ * and is no longer needed by the current process. ++ * ++ * This function does not close the socket. ++ * ++ * @param http a pointer to an evhttp object ++ * @param fd a socket fd that is currently accepting connections ++ * @return 0 on success, -1 on failure. ++ * @see evhttp_accept_socket() ++ */ ++int evhttp_del_accept_socket(struct evhttp *http, int fd); ++ ++/** + * Free the previously created HTTP server. + * + * Works only if no requests are currently being served. +@@ -134,6 +187,28 @@ void evhttp_set_gencb(struct evhttp *, + */ + void evhttp_set_timeout(struct evhttp *, int timeout_in_secs); + ++/** ++ * Limit the number of simultaneous connections via this http instance. ++ * ++ * @param http an evhttp object ++ * @param nlimit the maximum number of connections, zero is unlimited ++ */ ++int evhttp_set_connection_limit(struct evhttp *http, int nlimit); ++ ++/** ++ * Return the maximum number of connections allowed for this instance. ++ * ++ * @param http an evhttp object ++ */ ++int evhttp_get_connection_limit(struct evhttp *http); ++ ++/** ++ * Return the number of connections in this instance. ++ * ++ * @param http an evhttp object ++ */ ++int evhttp_get_connection_count(struct evhttp *http); ++ + /* Request/Response functionality */ + + /** +@@ -157,6 +232,19 @@ void evhttp_send_error(struct evhttp_request *req, int error, + void evhttp_send_reply(struct evhttp_request *req, int code, + const char *reason, struct evbuffer *databuf); + ++/** ++ * Send an HTML reply synchronously as much as possible by calling _begin(). ++ * Great for a worker thread to send the reply immediately without queuing up ++ * events back to the loop. Call _end() to send the rest of the packet from ++ * event loop. ++ * ++ * When _begin() returns needs to be fed into _end() as the 1st parameter ++ * "nwritten". ++ */ ++int evhttp_send_reply_sync_begin(struct evhttp_request *req, int code, ++ const char *reason, struct evbuffer *databuf); ++void evhttp_send_reply_sync_end(int nwritten, struct evhttp_request *req); ++ + /* Low-level response interface, for streaming/chunked replies */ + void evhttp_send_reply_start(struct evhttp_request *, int, const char *); + void evhttp_send_reply_chunk(struct evhttp_request *, struct evbuffer *); +@@ -210,6 +298,7 @@ struct { + + enum evhttp_request_kind kind; + enum evhttp_cmd_type type; ++ char *ext_method; /* webdav methods, for example */ + + char *uri; /* uri after HTTP request was parsed */ + +@@ -224,6 +313,8 @@ struct { + int chunked:1, /* a chunked request */ + userdone:1; /* the user has sent all data */ + ++ int referenced; ++ + struct evbuffer *output_buffer; /* outgoing post or data */ + + /* Callback */ +diff --git a/http-internal.h b/http-internal.h +index 9cd03cd..3f60f54 100644 +--- a/http-internal.h ++++ b/http-internal.h +@@ -116,6 +116,9 @@ struct evhttp { + TAILQ_HEAD(httpcbq, evhttp_cb) callbacks; + struct evconq connections; + ++ int connection_count; ++ int connection_limit; ++ + int timeout; + + void (*gencb)(struct evhttp_request *req, void *); +diff --git a/http.c b/http.c +index efcec40..e10d114 100644 +--- a/http.c ++++ b/http.c +@@ -219,6 +219,13 @@ static int evhttp_decode_uri_internal(const char *uri, size_t length, + void evhttp_read(int, short, void *); + void evhttp_write(int, short, void *); + ++ ++void evhttp_server_drop_connection(struct evhttp_connection *evcon); ++void evhttp_server_add_connection(struct evhttp *http, ++ struct evhttp_connection *evcon); ++void evhttp_pause(struct evhttp *http); ++void evhttp_resume(struct evhttp *http); ++ + #ifndef HAVE_STRSEP + /* strsep replacement for platforms that lack it. Only works if + * del is one character long. */ +@@ -478,7 +485,6 @@ evhttp_make_header_response(struct evhttp_connection *evcon, + evhttp_add_header(req->output_headers, + "Connection", "keep-alive"); + +- if (req->minor == 1 || is_keepalive) { + /* + * we need to add the content length if the + * user did not give it, this is required for +@@ -488,7 +494,6 @@ evhttp_make_header_response(struct evhttp_connection *evcon, + req->output_headers, + (long)EVBUFFER_LENGTH(req->output_buffer)); + } +- } + + /* Potentially add headers for unidentified content. */ + if (EVBUFFER_LENGTH(req->output_buffer)) { +@@ -687,14 +692,14 @@ void + evhttp_write(int fd, short what, void *arg) + { + struct evhttp_connection *evcon = arg; +- int n; + + if (what == EV_TIMEOUT) { + evhttp_connection_fail(evcon, EVCON_HTTP_TIMEOUT); + return; + } + +- n = evbuffer_write(evcon->output_buffer, fd); ++ if (EVBUFFER_LENGTH(evcon->output_buffer) != 0) { ++ int n = evbuffer_write(evcon->output_buffer, fd); + if (n == -1) { + event_debug(("%s: evbuffer_write", __func__)); + evhttp_connection_fail(evcon, EVCON_HTTP_EOF); +@@ -706,6 +711,7 @@ evhttp_write(int fd, short what, void *arg) + evhttp_connection_fail(evcon, EVCON_HTTP_EOF); + return; + } ++ } + + if (EVBUFFER_LENGTH(evcon->output_buffer) != 0) { + evhttp_add_event(&evcon->ev, +@@ -1012,11 +1018,9 @@ evhttp_connection_free(struct evhttp_connection *evcon) + TAILQ_REMOVE(&evcon->requests, req, next); + evhttp_request_free(req); + } +- +- if (evcon->http_server != NULL) { +- struct evhttp *http = evcon->http_server; +- TAILQ_REMOVE(&http->connections, evcon, next); +- } ++ ++ if (evcon->http_server != NULL) ++ evhttp_server_drop_connection(evcon); + + if (event_initialized(&evcon->close_ev)) + event_del(&evcon->close_ev); +@@ -1101,10 +1105,16 @@ evhttp_connection_reset(struct evhttp_connection *evcon) + } + evcon->state = EVCON_DISCONNECTED; + +- evbuffer_drain(evcon->input_buffer, +- EVBUFFER_LENGTH(evcon->input_buffer)); +- evbuffer_drain(evcon->output_buffer, +- EVBUFFER_LENGTH(evcon->output_buffer)); ++ /* ++ * These can grow quite large if processing a large photo or video ++ * upload/download. Instead of keeping the buffers around, just ++ * free and allocate new. ++ */ ++ evbuffer_free(evcon->input_buffer); ++ evcon->input_buffer = evbuffer_new(); ++ ++ evbuffer_free(evcon->output_buffer); ++ evcon->output_buffer = evbuffer_new(); + } + + static void +@@ -1278,19 +1288,52 @@ evhttp_parse_request_line(struct evhttp_request *req, char *line) + if (line == NULL) + return (-1); + uri = strsep(&line, " "); +- if (line == NULL) +- return (-1); ++ if (line == NULL) { ++ version = "HTTP/1.0"; ++ } else { + version = strsep(&line, " "); + if (line != NULL) + return (-1); ++ } + + /* First line */ ++ req->ext_method = NULL; + if (strcmp(method, "GET") == 0) { + req->type = EVHTTP_REQ_GET; + } else if (strcmp(method, "POST") == 0) { + req->type = EVHTTP_REQ_POST; + } else if (strcmp(method, "HEAD") == 0) { + req->type = EVHTTP_REQ_HEAD; ++ } else if (strcmp(method, "OPTIONS") == 0) { ++ req->type = EVHTTP_REQ_POST; ++ req->ext_method = "OPTIONS"; ++ } else if (strcmp(method, "REPORT") == 0) { ++ req->type = EVHTTP_REQ_POST; ++ req->ext_method = "REPORT"; ++ } else if (strcmp(method, "PROPFIND") == 0) { ++ req->type = EVHTTP_REQ_POST; ++ req->ext_method = "PROPFIND"; ++ } else if (strcmp(method, "PROPPATH") == 0) { ++ req->type = EVHTTP_REQ_POST; ++ req->ext_method = "PROPPATH"; ++ } else if (strcmp(method, "MKCOL") == 0) { ++ req->type = EVHTTP_REQ_POST; ++ req->ext_method = "MKCOL"; ++ } else if (strcmp(method, "MKCALENDAR") == 0) { ++ req->type = EVHTTP_REQ_POST; ++ req->ext_method = "MKCALENDAR"; ++ } else if (strcmp(method, "PUT") == 0) { ++ req->type = EVHTTP_REQ_POST; ++ req->ext_method = "PUT"; ++ } else if (strcmp(method, "DELETE") == 0) { ++ req->type = EVHTTP_REQ_POST; ++ req->ext_method = "DELETE"; ++ } else if (strcmp(method, "LOCK") == 0) { ++ req->type = EVHTTP_REQ_POST; ++ req->ext_method = "LOCK"; ++ } else if (strcmp(method, "UNLOCK") == 0) { ++ req->type = EVHTTP_REQ_POST; ++ req->ext_method = "UNLOCK"; + } else { + event_debug(("%s: bad method %s on request %p from %s", + __func__, method, req, req->remote_host)); +@@ -1963,10 +2006,44 @@ evhttp_send_reply(struct evhttp_request *req, int code, const char *reason, + evhttp_send(req, databuf); + } + ++int ++evhttp_send_reply_sync_begin(struct evhttp_request *req, int code, ++ const char *reason, struct evbuffer *databuf) { ++ evhttp_response_code(req, code, reason); ++ struct evhttp_connection *evcon = req->evcon; ++ ++ assert(TAILQ_FIRST(&evcon->requests) == req); ++ ++ /* xxx: not sure if we really should expose the data buffer this way */ ++ if (databuf != NULL) ++ evbuffer_add_buffer(req->output_buffer, databuf); ++ ++ /* Adds headers to the response */ ++ evhttp_make_header(evcon, req); ++ ++ return evbuffer_write(evcon->output_buffer, evcon->fd); ++} ++ ++void ++evhttp_send_reply_sync_end(int nwritten, struct evhttp_request *req) { ++ struct evhttp_connection *evcon = req->evcon; ++ ++ if (nwritten <= 0) { ++ evhttp_connection_fail(evcon, EVCON_HTTP_EOF); ++ } else if (EVBUFFER_LENGTH(evcon->output_buffer) == 0) { ++ evhttp_send_done(evcon, NULL); ++ } else { ++ evhttp_write_buffer(evcon, evhttp_send_done, NULL); ++ } ++} ++ ++ + void + evhttp_send_reply_start(struct evhttp_request *req, int code, + const char *reason) + { ++ req->referenced = 1; ++ + evhttp_response_code(req, code, reason); + if (req->major == 1 && req->minor == 1) { + /* use chunked encoding for HTTP/1.1 */ +@@ -1986,6 +2063,8 @@ evhttp_send_reply_chunk(struct evhttp_request *req, struct evbuffer *databuf) + if (evcon == NULL) + return; + ++ if (req->referenced < 0) return; ++ + if (req->chunked) { + evbuffer_add_printf(evcon->output_buffer, "%x\r\n", + (unsigned)EVBUFFER_LENGTH(databuf)); +@@ -2007,7 +2086,14 @@ evhttp_send_reply_end(struct evhttp_request *req) + return; + } + +- /* we expect no more calls form the user on this request */ ++ if (req->referenced < 0) { ++ req->referenced = 0; ++ evhttp_request_free(req); ++ return; ++ } ++ req->referenced = 0; ++ ++ /* we expect no more calls form the user on this request */ + req->userdone = 1; + + if (req->chunked) { +@@ -2293,7 +2379,8 @@ accept_socket(int fd, short what, void *arg) + } + + int +-evhttp_bind_socket(struct evhttp *http, const char *address, u_short port) ++evhttp_bind_socket_backlog_fd(struct evhttp *http, const char *address, ++ u_short port, int backlog) + { + int fd; + int res; +@@ -2301,7 +2388,7 @@ evhttp_bind_socket(struct evhttp *http, const char *address, u_short port) + if ((fd = bind_socket(address, port, 1 /*reuse*/)) == -1) + return (-1); + +- if (listen(fd, 128) == -1) { ++ if (listen(fd, backlog) == -1) { + event_warn("%s: listen", __func__); + EVUTIL_CLOSESOCKET(fd); + return (-1); +@@ -2309,13 +2396,42 @@ evhttp_bind_socket(struct evhttp *http, const char *address, u_short port) + + res = evhttp_accept_socket(http, fd); + +- if (res != -1) ++ if (res != -1) { + event_debug(("Bound to port %d - Awaiting connections ... ", + port)); ++ return (fd); ++ } + + return (res); + } + ++static int ++mask_fd(int fd) ++{ ++ return fd > 0 ? 0 : fd; ++} ++ ++int ++evhttp_bind_socket(struct evhttp *http, const char *address, u_short port) ++{ ++ return mask_fd(evhttp_bind_socket_backlog_fd(http, address, port, 128)); ++} ++ ++int ++evhttp_bind_socket_with_fd(struct evhttp *http, const char *address, ++ u_short port) ++{ ++ return evhttp_bind_socket_backlog_fd(http, address, port, 128); ++} ++ ++int ++evhttp_bind_socket_backlog(struct evhttp *http, const char *address, ++ u_short port, int backlog) ++{ ++ return mask_fd( ++ evhttp_bind_socket_backlog_fd(http, address, port, backlog)); ++} ++ + int + evhttp_accept_socket(struct evhttp *http, int fd) + { +@@ -2345,6 +2461,25 @@ evhttp_accept_socket(struct evhttp *http, int fd) + return (0); + } + ++int ++evhttp_del_accept_socket(struct evhttp *http, int fd) ++{ ++ struct evhttp_bound_socket *bound; ++ TAILQ_FOREACH(bound, &http->sockets, next) { ++ if (bound->bind_ev.ev_fd == fd) ++ break; ++ } ++ ++ if (bound == NULL) ++ return (-1); ++ ++ TAILQ_REMOVE(&http->sockets, bound, next); ++ event_del(&bound->bind_ev); ++ free(bound); ++ ++ return (0); ++} ++ + static struct evhttp* + evhttp_new_object(void) + { +@@ -2527,6 +2662,11 @@ evhttp_request_new(void (*cb)(struct evhttp_request *, void *), void *arg) + void + evhttp_request_free(struct evhttp_request *req) + { ++ if (req->referenced) { ++ req->referenced = -1; ++ return; ++ } ++ + if (req->remote_host != NULL) + free(req->remote_host); + if (req->uri != NULL) +@@ -2657,13 +2797,78 @@ evhttp_get_request(struct evhttp *http, int fd, + * if we want to accept more than one request on a connection, + * we need to know which http server it belongs to. + */ +- evcon->http_server = http; +- TAILQ_INSERT_TAIL(&http->connections, evcon, next); ++ ++ evhttp_server_add_connection(http, evcon); + + if (evhttp_associate_new_request_with_connection(evcon) == -1) + evhttp_connection_free(evcon); + } + ++void ++evhttp_pause(struct evhttp *http) ++{ ++ struct evhttp_bound_socket *bound; ++ TAILQ_FOREACH(bound, &http->sockets, next) { ++ event_del(&bound->bind_ev); ++ } ++} ++ ++void ++evhttp_resume(struct evhttp *http) ++{ ++ struct evhttp_bound_socket *bound; ++ TAILQ_FOREACH(bound, &http->sockets, next) { ++ event_add(&bound->bind_ev, 0); ++ } ++} ++ ++int ++evhttp_get_connection_limit(struct evhttp *http) ++{ ++ return http->connection_limit; ++} ++ ++int ++evhttp_set_connection_limit(struct evhttp *http, int nlimit) ++{ ++ int olimit = http->connection_limit; ++ http->connection_limit = nlimit; ++ return olimit; ++} ++ ++int ++evhttp_get_connection_count(struct evhttp *http) ++{ ++ return http != NULL ? http->connection_count : 0; ++} ++ ++void ++evhttp_server_add_connection(struct evhttp *http, ++ struct evhttp_connection *evcon) ++{ ++ evcon->http_server = http; ++ TAILQ_INSERT_TAIL(&http->connections, evcon, next); ++ ++ http->connection_count++; ++ if (http->connection_limit > 0 ++ && http->connection_count >= http->connection_limit) ++ { ++ evhttp_pause(http); ++ } ++} ++ ++void ++evhttp_server_drop_connection(struct evhttp_connection *evcon) ++{ ++ struct evhttp *http = evcon->http_server; ++ TAILQ_REMOVE(&http->connections, evcon, next); ++ http->connection_count--; ++ if (http->connection_limit > 0 ++ && http->connection_count < http->connection_limit) ++ { ++ evhttp_resume(http); ++ } ++} + + /* + * Network helper functions that we do not want to export to the rest of diff --git a/meta-linaro/recipes-extra/libevent/libevent-fb_1.4.14b.bb b/meta-linaro/recipes-extra/libevent/libevent-fb_1.4.14b.bb new file mode 100644 index 0000000..fda0390 --- /dev/null +++ b/meta-linaro/recipes-extra/libevent/libevent-fb_1.4.14b.bb @@ -0,0 +1,20 @@ +require recipes-support/libevent/libevent_2.0.21.bb + +PROVIDES = "libevent" + +INC_PR = "1" + +SRC_URI = "http://github.com/downloads/libevent/libevent/libevent-${PV}-stable.tar.gz;name=archive \ + http://libevent.org/LICENSE.txt;name=license \ + file://libevent-1.4.14.fb-changes.diff" + +SRC_URI[archive.md5sum] = "a00e037e4d3f9e4fe9893e8a2d27918c" +SRC_URI[archive.sha256sum] = "afa61b476a222ba43fc7cca2d24849ab0bbd940124400cb699915d3c60e46301" + +SRC_URI[license.md5sum] = "412e611443304db6a338ab32728ae297" +SRC_URI[license.sha256sum] = "55739d5492273a7058c66b682012330a84c34eaa666f5c7030b0312573235270" + + +S = "${WORKDIR}/libevent-${PV}-stable/" + +LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE.txt;md5=412e611443304db6a338ab32728ae297" diff --git a/meta-linaro/recipes-extra/lng-network-config/files/70-persistent-net.rules b/meta-linaro/recipes-extra/lng-network-config/files/70-persistent-net.rules new file mode 100644 index 0000000..5a8be41 --- /dev/null +++ b/meta-linaro/recipes-extra/lng-network-config/files/70-persistent-net.rules @@ -0,0 +1,43 @@ +# lng-amarillo-01 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="66:06:3e:f9:4f:ae", +ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" + +# lng-arndale-01 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:8e:8f:32:21:98", +ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" + +# lng-arndale-02 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:8c:cc:92:21:98", +ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" + +# lng-arndale-03 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:f4:0c:d6:16:33", +ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" + +# lng-arndale-04 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:8f:4f:09:5e:44", +ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" + +# lng-arndale-05 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:b6:8d:b5:c7:24", +ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" + +# lng-generator-01 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d8:9d:67:26:ae:e8", +ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" + +# lng-generator-02 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d8:9d:67:26:cd:d8", +ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" + +# lng-keystone-01 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="c4:ed:ba:99:f4:09", +ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" + +# lng-keystone-02 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="c4:ed:ba:9a:8c:47", +ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" + +# lng-keystone-03 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="c4:ed:ba:9a:67:60", +ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" diff --git a/meta-linaro/recipes-extra/lng-network-config/lng-network-config_0.1.bb b/meta-linaro/recipes-extra/lng-network-config/lng-network-config_0.1.bb new file mode 100644 index 0000000..2987b04 --- /dev/null +++ b/meta-linaro/recipes-extra/lng-network-config/lng-network-config_0.1.bb @@ -0,0 +1,11 @@ +SUMMARY = "This package contains LNG specific configuration" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +RDEPENDS_${PN} = "udev" + +SRC_URI = "file://70-persistent-net.rules" + +do_install() { + install -D -p -m644 ${WORKDIR}/70-persistent-net.rules ${D}/etc/udev/rules.d/70-persistent-net.rules +} diff --git a/meta-linaro/recipes-extra/lshw/files/cross-compile.patch b/meta-linaro/recipes-extra/lshw/files/cross-compile.patch new file mode 100644 index 0000000..221b7e5 --- /dev/null +++ b/meta-linaro/recipes-extra/lshw/files/cross-compile.patch @@ -0,0 +1,39 @@ +--- + src/Makefile | 2 +- + src/core/Makefile | 2 +- + src/gui/Makefile | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +--- a/src/Makefile ++++ b/src/Makefile +@@ -18,7 +18,7 @@ export MANDIR + export DATADIR + export SQLITE + +-CXX?=c++ ++CXX?=$(CROSS_COMPILE)c++ + INCLUDES=-I./core/ + DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" + CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) +--- a/src/core/Makefile ++++ b/src/core/Makefile +@@ -1,6 +1,6 @@ + PACKAGENAME?=lshw + +-CXX=c++ ++CXX?=$(CROSS_COMPILE)c++ + INCLUDES= + DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\" + CXXFLAGS?=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS) +--- a/src/gui/Makefile ++++ b/src/gui/Makefile +@@ -1,7 +1,7 @@ + PACKAGENAME?=lshw + +-CXX?=c++ +-CC?=cc ++CXX?=$(CROSS_COMPILE)c++ ++CC?=$(CROSS_COMPILE)cc + STRIP?=strip + OBJCOPY?=objcopy + diff --git a/meta-linaro/recipes-extra/lshw/lshw_02.16.bb b/meta-linaro/recipes-extra/lshw/lshw_02.16.bb new file mode 100644 index 0000000..214d2ba --- /dev/null +++ b/meta-linaro/recipes-extra/lshw/lshw_02.16.bb @@ -0,0 +1,33 @@ +DESCRIPTION = "A small tool to provide detailed information on the hardware \ +configuration of the machine. It can report exact memory configuration, \ +firmware version, mainboard configuration, CPU version and speed, cache \ +configuration, bus speed, etc. on DMI-capable or EFI systems." +SUMMARY = "Hardware lister" +HOMEPAGE = "http://ezix.org/project/wiki/HardwareLiSter" +SECTION = "console/tools" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +DEPENDS = "pciutils \ + usbutils" +COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux" + +PR="r1" + +SRC_URI="http://ezix.org/software/files/lshw-B.${PV}.tar.gz \ + file://cross-compile.patch" + +SRC_URI[md5sum] = "67479167add605e8f001097c30e96d0d" +SRC_URI[sha256sum] = "809882429555b93259785cc261dbff04c16c93d064db5f445a51945bc47157cb" + +S="${WORKDIR}/lshw-B.${PV}" + +do_compile() { + # build core only - don't ship gui + oe_runmake -C src core +} + +do_install() { + oe_runmake install DESTDIR=${D} + # data files provided by dependencies + rm -rf ${D}/usr/share/lshw +} diff --git a/meta-linaro/recipes-extra/meta-toolchain-hhvm/meta-toolchain-hhvm.bb b/meta-linaro/recipes-extra/meta-toolchain-hhvm/meta-toolchain-hhvm.bb new file mode 100644 index 0000000..bcb84a5 --- /dev/null +++ b/meta-linaro/recipes-extra/meta-toolchain-hhvm/meta-toolchain-hhvm.bb @@ -0,0 +1,4 @@ +TOOLCHAIN_TARGET_TASK = "packagegroup-core-standalone-hhvm-sdk-target" +TOOLCHAIN_OUTPUTNAME = "${SDK_NAME}-toolchain-hhvm-${DISTRO_VERSION}" +PROVIDES = "meta-toolchain-sdk" +require recipes-core/meta/meta-toolchain.bb diff --git a/meta-linaro/recipes-extra/meta-toolchain-hhvm/packagegroup-core-standalone-hhvm-sdk-target.bb b/meta-linaro/recipes-extra/meta-toolchain-hhvm/packagegroup-core-standalone-hhvm-sdk-target.bb new file mode 100644 index 0000000..1445eb4 --- /dev/null +++ b/meta-linaro/recipes-extra/meta-toolchain-hhvm/packagegroup-core-standalone-hhvm-sdk-target.bb @@ -0,0 +1,57 @@ +SUMMARY = "HipHop VM porting SDK (target tools)" +LICENSE = "MIT" + +inherit packagegroup + +RDEPENDS_${PN} = "\ + packagegroup-core-standalone-sdk-target \ + binutils-dev \ + binutils-staticdev \ + bison \ + boost-dev \ + boost-staticdev \ + boost \ + bzip2-dev \ + cmake \ + curl-dev \ + elfutils-dev \ + elfutils-staticdev \ + expat \ + flex \ + gd-dev \ + gd-staticdev \ + glog-dev \ + icu-dev \ + libcap-dev \ + libcap-staticdev \ + libc-client-dev \ + libc-client-staticdev \ + libdwarf-dev \ + libdwarf-staticdev \ + libevent-fb-dev \ + libevent-fb-staticdev \ + libglade-dev \ + libmcrypt-dev \ + libmemcached-dev \ + libmemcached-staticdev \ + libmysqlclient-dev \ + libmysqlclient-staticdev \ + libmysqlclient-r-dev \ + libmysqlclient-r-staticdev \ + libpam-dev \ + libpcre-dev \ + libpcre-staticdev \ + libunwind-dev \ + libunwind-staticdev \ + libxml2-dev \ + libxml2-staticdev \ + ncurses-dev \ + ncurses-staticdev \ + onig-dev \ + openldap-dev \ + openssl-dev \ + openssl-staticdev \ + readline-dev \ + tbb-dev \ + zlib-dev \ + " diff --git a/meta-linaro/recipes-extra/odp/odp.bb b/meta-linaro/recipes-extra/odp/odp.bb new file mode 100644 index 0000000..c62f4dc --- /dev/null +++ b/meta-linaro/recipes-extra/odp/odp.bb @@ -0,0 +1,24 @@ +DESCRIPTION = "OpenDataPlane (ODP) provides a data plane application programming \ + environment that is easy to use, high performance, and portable between networking SoCs." +HOMEPAGE = "http://www.opendataplane.org" +SECTION = "console/network" + +LICENSE = "BSD | GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2" +PV = "20140820+git${SRCPV}" + +DEPENDS = "openssl" + +SRC_URI = "git://git.linaro.org/lng/odp.git;name=odp" + +SRCREV_odp = "26238333b5b0896366c844aeb7253e60abd99f5a" +SRCREV_FORMAT = "odp" + +S = "${WORKDIR}/git" + +inherit autotools + +RDEPENDS_${PN} = "libcrypto" + +# ODP primary shipped as static library plus some API test and samples/ +FILES_${PN}-staticdev += "${datadir}/opendataplane/*.la" diff --git a/meta-linaro/recipes-extra/powerdebug/powerdebug_0.7.3.bb b/meta-linaro/recipes-extra/powerdebug/powerdebug_0.7.3.bb new file mode 100644 index 0000000..9b6f3a0 --- /dev/null +++ b/meta-linaro/recipes-extra/powerdebug/powerdebug_0.7.3.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "tool to display regulator, sensor and clock information" +SUMMARY = "PowerDebug is a tool to display regulator, sensor and clock \ +information. Data is refreshed every few seconds. There is also dump option \ +to display the information just once." +LICENSE = "EPL-1.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=cdd7b8fa70e88be67e325baae3b8ee95" +DEPENDS = "ncurses" + +MMYY = "14.06" +RELEASE = "20${MMYY}" + +SRC_URI = "http://releases.linaro.org/${MMYY}/components/power-management/powerdebug/linaro-powerdebug-${PV}-${RELEASE}.tar.bz2" + +SRC_URI[md5sum] = "f381946c5ca2f8075ed1bedc5f2a2876" +SRC_URI[sha256sum] = "bfc4c92d8a8a1c8ee208a12310d3c763f111cf76d283facedb7ef56cafd074a1" + +S = "${WORKDIR}/powerdebug-${PV}-${RELEASE}" + +do_install () { + install -D -p -m0755 powerdebug ${D}/${sbindir}/powerdebug + install -D -p -m0644 powerdebug.8 ${D}${mandir}/man8/powerdebug.8 +} diff --git a/meta-linaro/recipes-extra/stress/files/texinfo.patch b/meta-linaro/recipes-extra/stress/files/texinfo.patch new file mode 100644 index 0000000..5ac5951 --- /dev/null +++ b/meta-linaro/recipes-extra/stress/files/texinfo.patch @@ -0,0 +1,79 @@ +--- a/doc/stress.texi ++++ b/doc/stress.texi +@@ -62,47 +62,47 @@ + + @table @samp + @item -? +-@itemx --help ++@item --help + Show help information. + +-@itemx --version ++@item --version + Show version information. + + @item -v +-@itemx --verbose ++@item --verbose + Turn up verbosity. + + @item -q +-@itemx --quiet ++@item --quiet + Turn down verbosity. + + @item -n +-@itemx --dry-run ++@item --dry-run + Show what would have been done. + + @item -t @var{secs} +-@itemx --timeout @var{secs} ++@item --timeout @var{secs} + Time out after @var{secs} seconds. + +-@itemx --backoff @var{usecs} ++@item --backoff @var{usecs} + Wait for factor of @var{usecs} microseconds before starting work. + + @item -c @var{forks} +-@itemx --cpu @var{forks} ++@item --cpu @var{forks} + Spawn @var{forks} processes each spinning on @samp{sqrt()}. + + @item -i @var{forks} +-@itemx --io @var{forks} ++@item --io @var{forks} + Spawn @var{forks} processes each spinning on @samp{sync()}. + + @item -m @var{forks} +-@itemx --vm @var{forks} ++@item --vm @var{forks} + Spawn @var{forks} processes each spinning on @samp{malloc()}. + +-@itemx --vm-bytes @var{bytes} ++@item --vm-bytes @var{bytes} + Allocate @var{bytes} number of bytes. The default is 1. + +-@itemx --vm-hang ++@item --vm-hang + Instruct each vm hog process to go to sleep after allocating memory. This + contrasts with their normal behavior, which is to free the memory and + reallocate @emph{ad infinitum}. This is useful for simulating low memory +@@ -114,13 +114,13 @@ + @end example + + @item -d @var{forks} +-@itemx --hdd @var{forks} ++@item --hdd @var{forks} + Spawn @var{forks} processes each spinning on @samp{write()}. + +-@itemx --hdd-bytes @var{bytes} ++@item --hdd-bytes @var{bytes} + Write @var{bytes} number of bytes. The default is 1GB. + +-@itemx --hdd-noclean ++@item --hdd-noclean + Do not unlink file(s) to which random ASCII data is written. + + @end table diff --git a/meta-linaro/recipes-extra/stress/stress_1.0.4.bb b/meta-linaro/recipes-extra/stress/stress_1.0.4.bb new file mode 100644 index 0000000..44f2fc6 --- /dev/null +++ b/meta-linaro/recipes-extra/stress/stress_1.0.4.bb @@ -0,0 +1,14 @@ +DESCRIPTION = "Deliberately simple workload generator for POSIX systems. It \ +imposes a configurable amount of CPU, memory, I/O, and disk stress on the system." +HOMEPAGE = "http://people.seas.harvard.edu/~apw/stress/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" + +SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/stress/stress-${PV}.tar.gz/a607afa695a511765b40993a64c6e2f4/stress-${PV}.tar.gz \ + file://texinfo.patch \ + " + +SRC_URI[md5sum] = "a607afa695a511765b40993a64c6e2f4" +SRC_URI[sha256sum] = "369c997f65e8426ae8b318d4fdc8e6f07a311cfa77cc4b25dace465c582163c0" + +inherit autotools diff --git a/meta-linaro/recipes-extra/trinity/trinity_1.3.bb b/meta-linaro/recipes-extra/trinity/trinity_1.3.bb new file mode 100644 index 0000000..a4f2777 --- /dev/null +++ b/meta-linaro/recipes-extra/trinity/trinity_1.3.bb @@ -0,0 +1,42 @@ +SUMMARY = "a Linux System call fuzz teste." +DESCRIPTION = "Trinity, a Linux System call fuzz tester." +HOMEPAGE = "http://codemonkey.org.uk/projects/trinity/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=96094d47cfbd2cc45eb46ce0fc423c04" + +COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux" + +# v1.3 tag +SRCREV = "7f333fdbb1933e38a67aa136cbf6a1e5df06c775" +SRC_URI = "git://github.com/kernelslacker/trinity.git;protocol=https \ + " + +S = "${WORKDIR}/git" + +inherit useradd + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM_${PN} = "--system --create-home --shell /bin/sh ${PN} " + +do_configure () { + ./configure.sh +} + +# workaround random build failures +do_compile () { + ${MAKE} +} + +do_install () { + oe_runmake install DESTDIR=${D}/usr + install -o ${PN} -d -m 0755 ${D}/${datadir}/${PN} + install -o ${PN} -m 0755 ${S}/scripts/test-all-syscalls-parallel.sh ${D}/${datadir}/${PN} + install -o ${PN} -m 0755 ${S}/scripts/test-all-syscalls-sequentially.sh ${D}/${datadir}/${PN} + install -o ${PN} -m 0755 ${S}/scripts/test-multi.sh ${D}/${datadir}/${PN} + install -o ${PN} -m 0755 ${S}/scripts/test-vm.sh ${D}/${datadir}/${PN} +} + +PACKAGES =+ "${PN}-example" + +FILES_${PN} = "${bindir}/trinity" +FILES_${PN}-example = "${datadir}/${PN}" diff --git a/meta-linaro/recipes-extra/usecpu/usecpu_git.bb b/meta-linaro/recipes-extra/usecpu/usecpu_git.bb new file mode 100644 index 0000000..69c4677 --- /dev/null +++ b/meta-linaro/recipes-extra/usecpu/usecpu_git.bb @@ -0,0 +1,18 @@ +SUMMARY = "Uses the CPU" +DESCRIPTION = "This program uses the CPU on a System" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://use_cpu.c;endline=39;md5=f39117026e553ebdce39f633b7b92f9f" +SRCREV = "e246c70aa6cac5df0e593ef3416380ff75a70dc0" +PV = "0.1+git${SRCPV}" + +SRC_URI = "git://git.linaro.org/lng/usecpu.git" + +S = "${WORKDIR}/git" + +do_compile() { + oe_runmake use_cpu +} + +do_install() { + install -D -p -m0755 use_cpu ${D}${bindir}/use_cpu +} diff --git a/meta-linaro/recipes-kernel/gator/gator/gator.init b/meta-linaro/recipes-kernel/gator/gator/gator.init new file mode 100755 index 0000000..11ac345 --- /dev/null +++ b/meta-linaro/recipes-kernel/gator/gator/gator.init @@ -0,0 +1,48 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: gatord +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Starts gatord +# Description: Starts the Gator Daemon for ARM DS5 +### END INIT INFO + +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +DESC="Gator" +NAME="gatord" +GATOR=`which $NAME` + +. /etc/init.d/functions || exit 1 + +# Exit if the package is not installed +[ -x "$GATOR" ] || exit 0 + +case "$1" in + start) + echo -n "Starting $DESC: $NAME... " + depmod -a||true + modprobe gator + start-stop-daemon -S -b -x $GATOR -- $GATOR_ARGS + echo "done." + ;; + stop) + echo -n "Stopping $DESC: $NAME... " + start-stop-daemon -K -x $GATOR + echo "done." + ;; + restart) + echo "Restarting $DESC: $NAME... " + $0 stop + $0 start + echo "done." + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta-linaro/recipes-kernel/gator/gator_git.bb b/meta-linaro/recipes-kernel/gator/gator_git.bb new file mode 100644 index 0000000..1c8431b --- /dev/null +++ b/meta-linaro/recipes-kernel/gator/gator_git.bb @@ -0,0 +1,33 @@ +SUMMARY = "DS-5 Gator daemon" +DESCRIPTION = "Target-side daemon gathering data for ARM Streamline Performance Analyzer." + +LICENSE = "GPL-2" +LIC_FILES_CHKSUM = "file://driver/LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +SRCREV = "bc8a84cf0b138a2951679581453da7bd93003db6" +PV = "5.19+git${SRCPV}" + +SRC_URI = "git://git.linaro.org/arm/ds5/gator.git;protocol=http;branch=linaro \ + file://gator.init" + +S = "${WORKDIR}/git" + +inherit update-rc.d + +EXTRA_OEMAKE = "'CFLAGS=${CFLAGS} ${TARGET_CC_ARCH} -DETCDIR=\"${sysconfdir}\"' \ + 'LDFLAGS=${LDFLAGS} ${TARGET_CC_ARCH}' 'CROSS_COMPILE=${TARGET_PREFIX}' \ + 'CXXFLAGS=${CXXFLAGS} ${TARGET_CC_ARCH} -fno-rtti'" + +do_compile() { + # The regular makefile tries to be 'smart' by hardcoding ABI assumptions, let's use the clean makefile for everything. + cp ${S}/daemon/Makefile_aarch64 ${S}/daemon/Makefile + oe_runmake -C daemon CC='${CC}' CXX='${CXX}' +} + +do_install() { + install -D -p -m0755 daemon/gatord ${D}/${sbindir}/gatord + install -D -p -m0755 ${WORKDIR}/gator.init ${D}/${sysconfdir}/init.d/gator +} + +INITSCRIPT_NAME = "gator" +INITSCRIPT_PARAMS = "defaults 66" diff --git a/meta-linaro/recipes-kernel/linux/bootwrapper.inc b/meta-linaro/recipes-kernel/linux/bootwrapper.inc new file mode 100644 index 0000000..c3a5634 --- /dev/null +++ b/meta-linaro/recipes-kernel/linux/bootwrapper.inc @@ -0,0 +1,67 @@ +SRC_URI_append= " git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/boot-wrapper-aarch64.git;protocol=http;branch=master;name=bootwrapper;destsuffix=bootwrapper \ +" + +SRCREV_bootwrapper = "2ff0b45423226d3de898a52a81b8e90b20fecd60" +BW = "${WORKDIR}/bootwrapper" +DTBDIR="${S}/arch/arm64/boot/dts/" + +# Bootwrapper needs libgcc_s.so +DEPENDS =+ "libgcc" + +export WRAPCFLAGS = "${CFLAGS}" +export WRAPCPPFLAGS = "${CPPFLAGS}" +export WRAPCXXFLAGS = "${CXXFLAGS}" +export WRAPLDFLAGS = "${LDFLAGS}" + +do_compile_append() { + cd ${S} + oe_runmake dtbs + cd ${BW} + + # Ensure the compile can find libgcc.a and other userspace friends + export CFLAGS="${WRAPCFLAGS}" + export CPPFLAGS="${WRAPCPPFLAGS}" + export CXXFLAGS="${WRAPCXXFLAGS}" + export LDFLAGS="${WRAPLDFLAGS}" + + autoreconf -vfi + ./configure --host=aarch64-linux-gnu \ + --with-kernel-dir="${S}" \ + --with-cmdline="${BOOTARGS_COMMON} root=/dev/vda" + make IMAGE=linux-system-foundation.axf clean + make DTC=${S}/scripts/dtc/dtc \ + KERNEL_DTB="${DTBDIR}/foundation-v8.dtb" \ + IMAGE=linux-system-foundation.axf + make IMAGE=img-foundation.axf clean + ./configure --host=aarch64-linux-gnu \ + --with-kernel-dir="${S}" \ + --with-cmdline="${BOOTARGS_COMMON} root=/dev/vda2" + make DTC=${S}/scripts/dtc/dtc \ + KERNEL_DTB="${DTBDIR}/foundation-v8.dtb" \ + IMAGE=img-foundation.axf + make IMAGE=img.axf clean + ./configure --host=aarch64-linux-gnu \ + --with-kernel-dir="${S}" \ + --with-cmdline="${BOOTARGS_COMMON} root=/dev/mmcblk0p2" + make DTC=${S}/scripts/dtc/dtc \ + KERNEL_DTB="${DTBDIR}/rtsm_ve-aemv8a.dtb" \ + IMAGE=img.axf +} + +do_install_append() { + install -m 0644 ${BW}/img-foundation.axf ${D}/boot/img-foundation.axf +} + +do_deploy_append() { + install -d ${DEPLOYDIR} + install -m 0644 ${BW}/img.axf ${DEPLOYDIR}/img-${PV}.axf + install -m 0644 ${BW}/linux-system-foundation.axf ${DEPLOYDIR}/linux-system-foundation-${PV}.axf + install -m 0644 ${BW}/img-foundation.axf ${DEPLOYDIR}/img-foundation-${PV}.axf + cd ${DEPLOYDIR} + ln -sf img-${PV}.axf img.axf + ln -sf linux-system-foundation-${PV}.axf linux-system-foundation.axf + ln -sf img-foundation-${PV}.axf img-foundation.axf +} + +PACKAGES =+ "kernel-bootwrapper" +FILES_kernel-bootwrapper = "/boot/img-foundation.axf" diff --git a/meta-linaro/recipes-kernel/linux/linaro-kernel.inc b/meta-linaro/recipes-kernel/linux/linaro-kernel.inc new file mode 100644 index 0000000..0f6f572 --- /dev/null +++ b/meta-linaro/recipes-kernel/linux/linaro-kernel.inc @@ -0,0 +1,15 @@ +DESCRIPTION = "Linaro Kernel common bits" +SECTION = "kernel" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" + +inherit kernel siteinfo +require recipes-kernel/linux/linux-dtb.inc + +SRC_URI = " \ + git://git.linaro.org/git/ci/ubuntu-kernel-ci.git;protocol=http;branch=master;name=ubuntu-ci;destsuffix=ubuntu-ci \ +" +S = "${WORKDIR}/git" + +SRCREV_ubuntu-ci = "33beed2b73c3de0556317317034569e909e90f1d" +SRCREV_FORMAT = "kernel" diff --git a/meta-linaro/recipes-kernel/linux/linaro-lng-rt-x86-64_git.bb b/meta-linaro/recipes-kernel/linux/linaro-lng-rt-x86-64_git.bb new file mode 100644 index 0000000..cd75e84 --- /dev/null +++ b/meta-linaro/recipes-kernel/linux/linaro-lng-rt-x86-64_git.bb @@ -0,0 +1,9 @@ +DESCRIPTION = "Linaro LNG Kernel For x86" + +require linaro-lng.inc + +PV = "3.14+git${SRCPV}" + +inherit kernel siteinfo + +SRC_URI = "git://git.linaro.org/kernel/linux-linaro-lng.git;branch=linux-linaro-lng-v3.14-rt" diff --git a/meta-linaro/recipes-kernel/linux/linaro-lng-x86-64_git.bb b/meta-linaro/recipes-kernel/linux/linaro-lng-x86-64_git.bb new file mode 100644 index 0000000..334acbd --- /dev/null +++ b/meta-linaro/recipes-kernel/linux/linaro-lng-x86-64_git.bb @@ -0,0 +1,9 @@ +DESCRIPTION = "Linaro LNG Kernel For x86" + +require linaro-lng.inc + +PV = "3.14+git${SRCPV}" + +inherit kernel siteinfo + +SRC_URI = "git://git.linaro.org/kernel/linux-linaro-lng.git;branch=linux-linaro-lng-v3.14" diff --git a/meta-linaro/recipes-kernel/linux/linaro-lng.inc b/meta-linaro/recipes-kernel/linux/linaro-lng.inc new file mode 100644 index 0000000..00ea523 --- /dev/null +++ b/meta-linaro/recipes-kernel/linux/linaro-lng.inc @@ -0,0 +1,31 @@ +DESCRIPTION = "Linaro LNG Kernel Basic support recipe" +SECTION = "kernel" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" + +SRCREV = "${AUTOREV}" +SRCREV_FORMAT = "kernel" +S = "${WORKDIR}/git" + +COMPATIBLE_MACHINE = "(lng-x86-64|lng-rt-x86-64)" + +do_configure_prepend_lng-x86-64() { + scripts/kconfig/merge_config.sh -m arch/x86/configs/x86_64_defconfig \ + linaro/configs/hugepage.conf linaro/configs/ovs.conf \ + linaro/configs/kvm-host.conf linaro/configs/no_hz_full.conf + scripts/config -e CONFIG_DEVTMPFS + scripts/config -e CONFIG_DEVTMPFS_MOUNT + scripts/config -e CONFIG_E1000E + scripts/config -e CONFIG_IXGBE +} + +do_configure_prepend_lng-rt-x86-64() { + scripts/kconfig/merge_config.sh -m arch/x86/configs/x86_64_defconfig \ + linaro/configs/hugepage.conf linaro/configs/preempt-rt.conf \ + linaro/configs/ovs.conf linaro/configs/kvm-host.conf \ + linaro/configs/no_hz_full.conf + scripts/config -e CONFIG_DEVTMPFS + scripts/config -e CONFIG_DEVTMPFS_MOUNT + scripts/config -e CONFIG_E1000E + scripts/config -e CONFIG_IXGBE +} diff --git a/meta-linaro/recipes-kernel/linux/linux-linaro-aarch64.bb b/meta-linaro/recipes-kernel/linux/linux-linaro-aarch64.bb new file mode 100644 index 0000000..6e181a7 --- /dev/null +++ b/meta-linaro/recipes-kernel/linux/linux-linaro-aarch64.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "Linaro recipe for Aarch64 fast model kernels" + +SRCREV_kernel="7123b02be92f8bfeffbf31f44252c24eb838a84d" +PV = "3.17+git${SRCPV}" + +SRC_URI_append = " git://git.linaro.org/git/kernel/linux-linaro-tracking.git;protocol=http;name=kernel;nobranch=1 " +DEPENDS_append_aarch64 = " libgcc" +KERNEL_CC_append_aarch64 = " ${TOOLCHAIN_OPTIONS}" +KERNEL_LD_append_aarch64 = " ${TOOLCHAIN_OPTIONS}" + + +include linaro-kernel.inc +include bootwrapper.inc + +COMPATIBLE_HOST = "aarch64" +KERNEL_IMAGETYPE = "Image" +BOOTARGS_COMMON = "console=ttyAMA0 mem=2048M devtmpfs.mount=1 earlyprintk=pl011,0x1c090000 consolelog=9 rw" + +do_configure_prepend() { + . ../ubuntu-ci/configs/vexpress64.cfg + ARCH=arm64 scripts/kconfig/merge_config.sh -m $linaro_base_config_frags $ubuntu_config_frag $board_config_frags +} diff --git a/meta-linaro/recipes-kernel/linux/linux-linaro-stable-vexpress_git.bb b/meta-linaro/recipes-kernel/linux/linux-linaro-stable-vexpress_git.bb new file mode 100644 index 0000000..ed27cae --- /dev/null +++ b/meta-linaro/recipes-kernel/linux/linux-linaro-stable-vexpress_git.bb @@ -0,0 +1,16 @@ +DESCRIPTION = "Linaro Stable Kernel For Vexpress/KVM" + +PV = "3.10+git${SRCPV}" +SRCREV_kernel="bfbceba4d4e9a3a538a80a1a0af18db55c9924a4" +SRC_URI_append = " git://git.linaro.org/git/kernel/linux-linaro-stable.git;protocol=http;branch=linux-linaro-lsk;name=kernel " +require linaro-kernel.inc + +KERNEL_DEVICETREE = "vexpress-v2p-ca15-tc1.dtb" +BOOTARGS_COMMON = "root=/dev/mmcblk0p2 console=ttyAMA0 consolelog=9 mem=1024M rw rootwait" +COMPATIBLE_HOST = "arm.*" +KERNEL_IMAGETYPE = "zImage" + +do_configure_prepend() { + . ../ubuntu-ci/configs/lsk-vexpress.cfg + ARCH=arm scripts/kconfig/merge_config.sh -m $linaro_base_config_frags $ubuntu_config_frag $board_config_frags +} diff --git a/meta-linaro/recipes-kernel/linux/linux-linaro-vexpress_git.bb b/meta-linaro/recipes-kernel/linux/linux-linaro-vexpress_git.bb new file mode 100644 index 0000000..d7d20e1 --- /dev/null +++ b/meta-linaro/recipes-kernel/linux/linux-linaro-vexpress_git.bb @@ -0,0 +1,16 @@ +DESCRIPTION = "Linaro Kernel For Vexpress/KVM" + +SRCREV_kernel="7123b02be92f8bfeffbf31f44252c24eb838a84d" +PV = "3.17+git${SRCPV}" +SRC_URI_append = " git://git.linaro.org/git/kernel/linux-linaro-tracking.git;protocol=http;branch=linux-linaro;name=kernel " +require linaro-kernel.inc + +KERNEL_DEVICETREE = "vexpress-v2p-ca15-tc1.dtb" +BOOTARGS_COMMON = "root=/dev/mmcblk0p2 console=ttyAMA0 consolelog=9 mem=1024M rw rootwait" +COMPATIBLE_HOST = "arm.*" +KERNEL_IMAGETYPE = "zImage" + +do_configure_prepend() { + . ../ubuntu-ci/configs/vexpress.cfg + ARCH=arm scripts/kconfig/merge_config.sh -m $linaro_base_config_frags $ubuntu_config_frag $board_config_frags +} diff --git a/meta-linaro/recipes-kernel/perf/files/0001-perf-tools-Fix-arm64-build-error.patch b/meta-linaro/recipes-kernel/perf/files/0001-perf-tools-Fix-arm64-build-error.patch new file mode 100644 index 0000000..4a4da97 --- /dev/null +++ b/meta-linaro/recipes-kernel/perf/files/0001-perf-tools-Fix-arm64-build-error.patch @@ -0,0 +1,42 @@ +From 7d885749b6de2c9a1168d566e2380207b9177108 Mon Sep 17 00:00:00 2001 +From: Mark Salter +Date: Fri, 25 Jul 2014 18:02:46 -0400 +Subject: [PATCH] perf tools: Fix arm64 build error + +I'm seeing the following build error on arm64: + + In file included from util/event.c:3:0: + util/event.h:95:17: error: 'PERF_REGS_MAX' undeclared here (not in a function) + u64 cache_regs[PERF_REGS_MAX]; + ^ + +This patch adds a PERF_REGS_MAX definition for arm64. + +Signed-off-by: Mark Salter +Acked-by: Jean Pihet +Cc: Ingo Molnar +Cc: Jean Pihet +Cc: Paul Mackerras +Cc: Peter Zijlstra +Link: http://lkml.kernel.org/r/1406325766-8085-1-git-send-email-msalter@redhat.com +Signed-off-by: Arnaldo Carvalho de Melo +--- + tools/perf/arch/arm64/include/perf_regs.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tools/perf/arch/arm64/include/perf_regs.h b/tools/perf/arch/arm64/include/perf_regs.h +index e9441b9..1d3f39c 100644 +--- a/tools/perf/arch/arm64/include/perf_regs.h ++++ b/tools/perf/arch/arm64/include/perf_regs.h +@@ -6,6 +6,8 @@ + #include + + #define PERF_REGS_MASK ((1ULL << PERF_REG_ARM64_MAX) - 1) ++#define PERF_REGS_MAX PERF_REG_ARM64_MAX ++ + #define PERF_REG_IP PERF_REG_ARM64_PC + #define PERF_REG_SP PERF_REG_ARM64_SP + +-- +2.1.3 + diff --git a/meta-linaro/recipes-kernel/perf/files/0001-perf-tools-Fix-build-breakage-on-arm64-targets.patch b/meta-linaro/recipes-kernel/perf/files/0001-perf-tools-Fix-build-breakage-on-arm64-targets.patch new file mode 100644 index 0000000..cb03946 --- /dev/null +++ b/meta-linaro/recipes-kernel/perf/files/0001-perf-tools-Fix-build-breakage-on-arm64-targets.patch @@ -0,0 +1,45 @@ +From 660d13296bbbe79635d1d9d700080b88061faffb Mon Sep 17 00:00:00 2001 +From: Will Deacon +Date: Tue, 30 Sep 2014 12:27:12 +0100 +Subject: [PATCH] perf tools: Fix build breakage on arm64 targets + +Attempting to build the perf tool for an arm64 target results in the +following failure: + + arch/arm64/util/unwind-libunwind.c: In function 'libunwind__arch_reg_id': + arch/arm64/util/unwind-libunwind.c:77:3: error: implicit declaration of function 'pr_err' + pr_err("unwind: invalid reg id %d\n", regnum); + ^ + arch/arm64/util/unwind-libunwind.c:77:3: error: nested extern declaration of 'pr_err' + +This is due to commit 84f5d36f4866 ("perf tools: Move pr_* debug macros +into debug object") moving the pr_* macros into a new header file, but +failing to update architectures other than x86. + +This patch adds the missing include, and fixes the build again. + +Signed-off-by: Will Deacon +Cc: Jean Pihet +Cc: Jiri Olsa +Cc: linux-arm-kernel@lists.infradead.org +Link: http://lkml.kernel.org/r/1412076432-22045-1-git-send-email-will.deacon@arm.com +Signed-off-by: Arnaldo Carvalho de Melo +--- + tools/perf/arch/arm64/util/unwind-libunwind.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/perf/arch/arm64/util/unwind-libunwind.c b/tools/perf/arch/arm64/util/unwind-libunwind.c +index 436ee43..a87afa9 100644 +--- a/tools/perf/arch/arm64/util/unwind-libunwind.c ++++ b/tools/perf/arch/arm64/util/unwind-libunwind.c +@@ -3,6 +3,7 @@ + #include + #include "perf_regs.h" + #include "../../util/unwind.h" ++#include "../../util/debug.h" + + int libunwind__arch_reg_id(int regnum) + { +-- +2.1.3 + diff --git a/meta-linaro/recipes-kernel/perf/perf.bbappend b/meta-linaro/recipes-kernel/perf/perf.bbappend new file mode 100644 index 0000000..075e673 --- /dev/null +++ b/meta-linaro/recipes-kernel/perf/perf.bbappend @@ -0,0 +1,21 @@ +LICENSE = "GPL-2" +LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" + +PV = "3.17" + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +SRC_URI = "${DEBIAN_MIRROR}/main/l/linux-tools/linux-tools_3.17.orig.tar.xz \ + file://0001-perf-tools-Fix-arm64-build-error.patch \ + file://0001-perf-tools-Fix-build-breakage-on-arm64-targets.patch \ +" + +SRC_URI[md5sum] = "6c78f25c86761a60b89235e12bc109a8" +SRC_URI[sha256sum] = "51162320841053fcf06070b6d5a6d984fb4c429e3ba3dc6d4eec021d374b926f" + +S = "${WORKDIR}/linux-tools-${PV}" +B = "${WORKDIR}/linux-tools-${PV}" + +do_compile_prepend() { + mkdir -p ${S}/include/generated + echo "#define UTS_RELEASE \"${PV}\"" > ${S}/include/generated/utsrelease.h +} diff --git a/meta-linaro/recipes-kernel/trace-cmd/kernelshark_2.3.2.bb b/meta-linaro/recipes-kernel/trace-cmd/kernelshark_2.3.2.bb new file mode 100644 index 0000000..dbc2a9d --- /dev/null +++ b/meta-linaro/recipes-kernel/trace-cmd/kernelshark_2.3.2.bb @@ -0,0 +1,23 @@ +SUMMARY = "Graphical trace viewer for Ftrace" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ + file://kernel-shark.c;beginline=6;endline=8;md5=2c22c965a649ddd7973d7913c5634a5e" +DEPENDS = "gtk+" +SRCREV = "79e08f8edb38c4c5098486caaa87ca90ba00f547" +PV = "2.3.2" + +SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git;branch=trace-cmd-stable-v2.3" + +S = "${WORKDIR}/git" + +do_install() { + ${MAKE} NO_PYTHON=1 prefix=${prefix} plugin_dir=${libdir}/trace-cmd/plugins DESTDIR=${D} install_gui + # remove files already shipped in trace-cmd package + rm -f ${D}${bindir}/trace-cmd + rm -rf ${D}${libdir}/trace-cmd + rmdir ${D}${libdir} +} + +RDEPENDS_${PN} = "trace-cmd" + +FILESPATH = "${FILE_DIRNAME}/trace-cmd" diff --git a/meta-linaro/recipes-kernel/trace-cmd/trace-cmd_2.3.2.bb b/meta-linaro/recipes-kernel/trace-cmd/trace-cmd_2.3.2.bb new file mode 100644 index 0000000..28143b1 --- /dev/null +++ b/meta-linaro/recipes-kernel/trace-cmd/trace-cmd_2.3.2.bb @@ -0,0 +1,21 @@ +SUMMARY = "User interface to Ftrace" +LICENSE = "GPLv2 & LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ + file://trace-cmd.c;beginline=6;endline=8;md5=2c22c965a649ddd7973d7913c5634a5e \ + file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff \ + file://trace-input.c;beginline=5;endine=8;md5=dafd8a1cade30b847a8686dd3628cea4" + +DEPENDS = "swig-native" + +SRCREV = "79e08f8edb38c4c5098486caaa87ca90ba00f547" +PV = "2.3.2" + +SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git;branch=trace-cmd-stable-v2.3" + +S = "${WORKDIR}/git" + +do_install() { + ${MAKE} NO_PYTHON=1 prefix=${prefix} plugin_dir=${libdir}/trace-cmd/plugins DESTDIR=${D} install +} + +FILES_${PN}-dbg += "${libdir}/trace-cmd/plugins/.debug/" diff --git a/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-console-login b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-console-login new file mode 100755 index 0000000..cf482e6 --- /dev/null +++ b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-console-login @@ -0,0 +1,6 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +# Start auto-login for root at consoles +exec openvt -c 1 -- /usr/bin/auto-root-login diff --git a/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-getty b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-getty new file mode 100755 index 0000000..7b181bc --- /dev/null +++ b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-getty @@ -0,0 +1,38 @@ +#!/bin/sh -e + +[ -f /etc/default/autogetty ] && . /etc/default/autogetty + +[ 1 -gt $ENABLED ] && exit + +while true; do + for arg in $(cat /proc/cmdline); do + case $arg in + console=*) + tty=${arg#console=} + tty=${tty#/dev/} + secure=`echo "${tty}" | cut -f1 -d,` + secure=`/bin/egrep "^${secure}$" /etc/securetty || true` + + if [ -n "$tty" -a -n "${secure}" ]; then + PORT=${tty%%,*} + + tmp=${tty##$PORT,} + SPEED=${tmp%%n*} + + # if console=/dev/tty* without speed is given + [ $SPEED = $PORT ] && SPEED=115200 + BITS=${tmp##${SPEED}n} + + # 8bit serial is default + [ -z $BITS ] && BITS=8 + # [ 8 -eq $BITS ] && GETTY_ARGS="$GETTY_ARGS -8 " + + [ -z $SPEED ] && SPEED='115200,57600,38400,19200,9600' + + GETTY_ARGS="$AUTOGETTY_ARGS $GETTY_ARGS $SPEED $PORT" + /sbin/getty $GETTY_ARGS + unset GETTY_ARGS + fi + esac + done +done diff --git a/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-root-login b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-root-login new file mode 100755 index 0000000..c9b1092 --- /dev/null +++ b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-root-login @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /bin/login -f root diff --git a/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-serial-console b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-serial-console new file mode 100755 index 0000000..12da6fc --- /dev/null +++ b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-serial-console @@ -0,0 +1,29 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/auto-getty +NAME="auto-getty" + +case "$1" in + start) + echo -n "Starting auto-serial-console: " + start-stop-daemon -S -b -n $NAME --exec $DAEMON + echo "done" + ;; + stop) + echo -n "Stopping auto-serial-console: " + start-stop-daemon -K -n $NAME + echo "done" + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "Usage: auto-serial-console { start | stop | restart }" >&2 + exit 1 + ;; +esac + +exit 0 + diff --git a/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/autogetty b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/autogetty new file mode 100644 index 0000000..c0f888e --- /dev/null +++ b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/autogetty @@ -0,0 +1,5 @@ +# here you can provide what to run instead of /bin/login +AUTOGETTY_ARGS="-n -l /usr/bin/auto-root-login" + +# Should autogetty be enabled? +ENABLED=1 diff --git a/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console_0.1.bb b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console_0.1.bb new file mode 100644 index 0000000..040c64b --- /dev/null +++ b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console_0.1.bb @@ -0,0 +1,48 @@ +SUMMARY = "Auto Serial Console and Auto Login scripts" +DESCRIPTION = "Scripts to auto login with root and call the console tty from the kernel cmd line" +SECTION = "base" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "\ + file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \ +" + +PR = "r2" + +inherit update-rc.d + +SRC_URI = "\ + file://autogetty \ + file://auto-root-login \ + file://auto-getty \ + file://auto-console-login \ + file://auto-serial-console \ +" + +PACKAGES =+ "auto-console-login" +RDEPENDS_${PN} = "auto-console-login" + +FILES_auto-console-login = "\ + ${bindir}/auto-root-login \ + ${sysconfdir}/init.d/auto-console-login \ +" + +S = "${WORKDIR}" + +INITSCRIPT_PACKAGES = "${PN} auto-console-login" +INITSCRIPT_NAME_auto-serial-console = "auto-serial-console" +INITSCRIPT_NAME_auto-console-login = "auto-console-login" +INITSCRIPT_PARAMS = "start 99 5 ." + +do_install () { + install -m 0755 -d ${D}${sysconfdir}/default + install -m 0644 ${WORKDIR}/autogetty ${D}${sysconfdir}/default/autogetty + + install -m 0755 -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/auto-console-login ${D}${sysconfdir}/init.d/auto-console-login + install -m 0755 ${WORKDIR}/auto-serial-console ${D}${sysconfdir}/init.d/auto-serial-console + + install -m 0755 -d ${D}${bindir} + install -m 0755 ${WORKDIR}/auto-root-login ${D}${bindir}/auto-root-login + install -m 0755 ${WORKDIR}/auto-getty ${D}${bindir}/auto-getty +} diff --git a/meta-linaro/recipes-linaro/files-injection/files-injection.bb b/meta-linaro/recipes-linaro/files-injection/files-injection.bb new file mode 100644 index 0000000..de4677b --- /dev/null +++ b/meta-linaro/recipes-linaro/files-injection/files-injection.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "Random files to be injected into rootfs" +LICENSE = "CLOSED" + +SRC_URI = "file://files-to-inject.tar.xz" + +S = "${WORKDIR}/files-to-inject/" + +# all files will be put in /opt/ directory with keeping tarball structure + +do_install() { + install -d ${D}/opt/ + cp -a ${S} ${D}/opt/ +} + +FILES_${PN} = "/opt" + +# How to use it? +# +# unpack files/files-to-inject.tar.xz tarball, add own files, compress it. +# add "files-injection" into CORE_IMAGE_EXTRA_INSTALL in your build/conf/local.conf +# build rootfs +# diff --git a/meta-linaro/recipes-linaro/files-injection/files/files-to-inject.tar.xz b/meta-linaro/recipes-linaro/files-injection/files/files-to-inject.tar.xz new file mode 100644 index 0000000..50e169d Binary files /dev/null and b/meta-linaro/recipes-linaro/files-injection/files/files-to-inject.tar.xz differ diff --git a/meta-linaro/recipes-linaro/files-injection/files/files-to-inject/empty b/meta-linaro/recipes-linaro/files-injection/files/files-to-inject/empty new file mode 100644 index 0000000..e69de29 diff --git a/meta-linaro/recipes-linaro/images/linaro-image-alip.bb b/meta-linaro/recipes-linaro/images/linaro-image-alip.bb new file mode 100644 index 0000000..8a76907 --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-image-alip.bb @@ -0,0 +1,9 @@ +DESCRIPTION = "Linaro image with basic X11 and firefox" + +inherit core-image + +IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-openssh" + +LICENSE = "MIT" + +IMAGE_INSTALL += "firefox gator openssh-sftp-server" diff --git a/meta-linaro/recipes-linaro/images/linaro-image-arago.bb b/meta-linaro/recipes-linaro/images/linaro-image-arago.bb new file mode 100644 index 0000000..ac61feb --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-image-arago.bb @@ -0,0 +1,20 @@ +SUMMARY = "Arago based image for testing" +DESCRIPTION = "Image capable of booting and testing device." +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +require linaro-image-common.inc + +# List of packages to install +IMAGE_INSTALL += "\ + bc \ + bonnie++ \ + bridge-utils \ + evtest \ + hdparm \ + iozone3 \ + iperf \ + lmbench \ + memtester \ + rt-tests \ + " diff --git a/meta-linaro/recipes-linaro/images/linaro-image-common.inc b/meta-linaro/recipes-linaro/images/linaro-image-common.inc new file mode 100644 index 0000000..223df3a --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-image-common.inc @@ -0,0 +1,93 @@ +inherit core-image + +IMAGE_FEATURES += "ssh-server-openssh nfs-server package-management" + +HUGETLB_armv7a = "libhugetlbfs-tests" +HUGETLB_aarch64 = "libhugetlbfs-tests" +HUGETLB ?= "" + +IMAGE_INSTALL += " \ + bash \ + e2fsprogs-e2fsck \ + kexec-tools \ + linaro-lava-tests \ + nss-myhostname \ + procps \ + stress \ + stress-dbg \ + sudo \ + util-linux-fsck \ + " + +SDK_IMAGE_INSTALL += "\ + acpica \ + bison \ + boost-date-time \ + boost-filesystem \ + boost-graph \ + boost-iostreams \ + boost-program-options \ + boost-regex \ + boost-signals \ + boost-system \ + boost-thread \ + cmake \ + curl \ + dmidecode \ + efibootmgr \ + elfutils-dev \ + expat \ + flex \ + gator \ + gd \ + git \ + glog \ + icu \ + idlestat \ + libbz2 \ + libc-client-dev \ + libcap \ + libdwarf-dev \ + libevent-fb \ + libmcrypt \ + libmemcached \ + libmysqlclient-r \ + libpam \ + libpcre \ + libunwind \ + libxml2 \ + lshw \ + ltp \ + ncurses \ + onig \ + openldap \ + openssh-sftp-server \ + openssl \ + perf \ + pm-qa \ + powerdebug \ + powertop \ + python \ + python-misc \ + python-multiprocessing \ + python-numpy \ + python-scons \ + python-shell \ + python-threading \ + qemu \ + readline \ + sshfs-fuse \ + tbb \ + trace-cmd \ + xserver-xorg-xvfb \ + xz \ + zlib \ + ${HUGETLB} \ + " + +IMAGE_PREPROCESS_COMMAND += "make_boot_verbose; " + + +fakeroot make_boot_verbose () { + sed -i -e 's/VERBOSE=no/VERBOSE=yes/' ${IMAGE_ROOTFS}/etc/default/rcS +} diff --git a/meta-linaro/recipes-linaro/images/linaro-image-kvm.bb b/meta-linaro/recipes-linaro/images/linaro-image-kvm.bb new file mode 100644 index 0000000..e9512fa --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-image-kvm.bb @@ -0,0 +1,6 @@ +require linaro-image-common.inc + +DESCRIPTION = "A small image for Linaro KVM validation." + +IMAGE_INSTALL += "qemu kernel-image kernel-bootwrapper" + diff --git a/meta-linaro/recipes-linaro/images/linaro-image-lamp.bb b/meta-linaro/recipes-linaro/images/linaro-image-lamp.bb new file mode 100644 index 0000000..2eec075 --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-image-lamp.bb @@ -0,0 +1,20 @@ +require linaro-image-common.inc + +IMAGE_INSTALL += " \ + apache2 \ + fwts \ + acpitests \ + grub \ + mysql5-server \ + mysql5-client \ + php-fpm \ + php-fpm-apache2 \ + packagegroup-core-buildessential \ + ${SDK_IMAGE_INSTALL}" + +IMAGE_FEATURES += "\ + dev-pkgs \ + staticdev-pkgs \ + tools-debug \ + tools-sdk \ + " diff --git a/meta-linaro/recipes-linaro/images/linaro-image-leg-java.bb b/meta-linaro/recipes-linaro/images/linaro-image-leg-java.bb new file mode 100644 index 0000000..c0f2c47 --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-image-leg-java.bb @@ -0,0 +1,29 @@ +require linaro-image-lamp.bb + +DESCRIPTION = "A Lamp-based image for Linaro Enterprise Java validation." + +IMAGE_INSTALL += " \ + alsa-conf \ + alsa-lib-dev \ + alsa-lib \ + alsa-oss \ + alsa-utils-alsaconf \ + alsa-utils-alsamixer \ + cups-dev \ + ganglia \ + git \ + htop \ + links \ + openjdk-8-doc \ + openjdk-8-jdk \ + openjdk-8-jre \ + openjdk-8-jtreg \ + openjdk-8-source \ + sed \ + tmux \ + vim \ + x11vnc \ + xauth \ + xserver-xorg-xvfb \ + zip \ + " diff --git a/meta-linaro/recipes-linaro/images/linaro-image-lng.bb b/meta-linaro/recipes-linaro/images/linaro-image-lng.bb new file mode 100644 index 0000000..7d46d68 --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-image-lng.bb @@ -0,0 +1,64 @@ +require linaro-image-common.inc + +IMAGE_INSTALL += " \ + arndale-pre-boot \ + bridge-utils \ + calibrator \ + curl \ + cronie \ + daq-odp \ + fping \ + git \ + lmbench \ + lng-network-config \ + ltp \ + netperf \ + odp \ + openssh-sftp-server \ + openvswitch \ + packagegroup-core-buildessential \ + procps \ + python-numpy \ + qemu \ + rt-tests \ + snort \ + trace-cmd \ + tunctl \ + usecpu \ + " + +IMAGE_INSTALL_append_armv7a = " \ + latency-test \ + systemtap \ + valgrind \ + trinity-example \ + " + +IMAGE_INSTALL_append_aarch64 = " \ + trinity-example \ + " + +IMAGE_INSTALL_append_qemux86 = " \ + " + +IMAGE_FEATURES += "\ + dev-pkgs \ + staticdev-pkgs \ + tools-debug \ + tools-sdk \ + " +IMAGE_FSTYPES_append_qemux86 += "cpio.gz" +IMAGE_FSTYPES_lng-x86-64 = "tar.gz cpio.gz" +IMAGE_FSTYPES_lng-rt-x86-64 = "tar.gz cpio.gz" + +EXTRA_IMAGE_FEATURES_append_qemux86 = " autoserial" +FEATURE_PACKAGES_autoserial = "auto-serial-console" + +IMAGE_PREPROCESS_COMMAND_qemux86 += "qemux86_fixup;" + +qemux86_fixup() { + sed -i '/getty 115200 ttyS0/d' ${IMAGE_ROOTFS}/etc/inittab + + echo "auto eth0" >> ${IMAGE_ROOTFS}/etc/network/interfaces + echo "iface eth0 inet dhcp" >> ${IMAGE_ROOTFS}/etc/network/interfaces +} diff --git a/meta-linaro/recipes-linaro/images/linaro-image-minimal-initramfs.bb b/meta-linaro/recipes-linaro/images/linaro-image-minimal-initramfs.bb new file mode 100644 index 0000000..f928797 --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-image-minimal-initramfs.bb @@ -0,0 +1,39 @@ +SUMMARY = "Initramfs image for kernel boot testing" +DESCRIPTION = "Small image capable of booting a device." +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +BAD_RECOMMENDATIONS += "busybox-syslog" + +export IMAGE_BASENAME = "linaro-image-minimal-initramfs" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES} ${INITRAMFS_FSTYPES}.u-boot" + +# Do not pollute the initrd image with rootfs features +IMAGE_FEATURES = "" + +# List of packages to install +IMAGE_INSTALL = "\ + base-passwd \ + bash \ + busybox \ + bzip2 \ + dhcp-client \ + dosfstools \ + e2fsprogs \ + e2fsprogs-mke2fs \ + gzip \ + initramfs-boot-linaro \ + net-tools \ + parted \ + tar \ + u-boot-mkimage \ + wget \ + " + +# Keep extra language files from being installed +IMAGE_LINGUAS = "" + +IMAGE_ROOTFS_SIZE = "8192" + +inherit core-image image_types_uboot diff --git a/meta-linaro/recipes-linaro/images/linaro-image-minimal.bb b/meta-linaro/recipes-linaro/images/linaro-image-minimal.bb new file mode 100644 index 0000000..abe579b --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-image-minimal.bb @@ -0,0 +1,2 @@ +require recipes-core/images/core-image-minimal.bb +require linaro-image-common.inc diff --git a/meta-linaro/recipes-linaro/images/linaro-image-sdk.bb b/meta-linaro/recipes-linaro/images/linaro-image-sdk.bb new file mode 100644 index 0000000..560da60 --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-image-sdk.bb @@ -0,0 +1,12 @@ +require linaro-image-common.inc + +DESCRIPTION = "A small SDK based image for Linaro development work." + +IMAGE_INSTALL += "${SDK_IMAGE_INSTALL}" + +IMAGE_FEATURES += "\ + dev-pkgs \ + staticdev-pkgs \ + tools-debug \ + tools-sdk \ + " diff --git a/meta-linaro/recipes-linaro/images/linaro-image-toolchain-benchmark.bb b/meta-linaro/recipes-linaro/images/linaro-image-toolchain-benchmark.bb new file mode 100644 index 0000000..16aa531 --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-image-toolchain-benchmark.bb @@ -0,0 +1,18 @@ +SUMMARY = "Base image for toolchain benchmarking" +DESCRIPTION = "Image capable of benchmarking the toolchain." +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +require recipes-core/images/core-image-minimal.bb +require linaro-image-common.inc + +IMAGE_INSTALL += "\ + bzip2 \ + cpufrequtils \ + netcat \ + openssh-sftp-server \ + rsync \ + tar \ + util-linux \ + xz \ + " diff --git a/meta-linaro/recipes-linaro/images/linaro-sysroot-alip.bb b/meta-linaro/recipes-linaro/images/linaro-sysroot-alip.bb new file mode 100644 index 0000000..3d0d1cc --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-sysroot-alip.bb @@ -0,0 +1,19 @@ +require linaro-image-alip.bb + +IMAGE_FEATURES += "\ + dev-pkgs \ + " + +IMAGE_PREPROCESS_COMMAND += "do_delete_not_needed_dirs; " + +fakeroot do_delete_not_needed_dirs () { + for dir in bin boot dev etc home media mnt opt proc run sbin sys tmp var; + do + rm -rf ${IMAGE_ROOTFS}/${dir} + done + + for dir in arm-oe-linux-gnueabi aarch64-oe-linux bin games sbin share src + do + rm -rf ${IMAGE_ROOTFS}/usr/${dir} + done +} diff --git a/meta-linaro/recipes-linaro/images/linaro-sysroot-lamp.bb b/meta-linaro/recipes-linaro/images/linaro-sysroot-lamp.bb new file mode 100644 index 0000000..67eeb0f --- /dev/null +++ b/meta-linaro/recipes-linaro/images/linaro-sysroot-lamp.bb @@ -0,0 +1,24 @@ +inherit core-image + +IMAGE_INSTALL = " \ + packagegroup-core-standalone-hhvm-sdk-target \ + " + +IMAGE_FEATURES += "\ + dev-pkgs \ + staticdev-pkgs \ + " + +IMAGE_PREPROCESS_COMMAND += "do_delete_not_needed_dirs; " + +fakeroot do_delete_not_needed_dirs () { + for dir in bin boot dev etc home media mnt opt proc run sbin sys tmp var; + do + rm -rf ${IMAGE_ROOTFS}/${dir} + done + + for dir in aarch64-oe-linux bin games sbin share src + do + rm -rf ${IMAGE_ROOTFS}/usr/${dir} + done +} diff --git a/meta-linaro/recipes-linaro/linaro-lava-tests/files/LICENSE b/meta-linaro/recipes-linaro/linaro-lava-tests/files/LICENSE new file mode 100644 index 0000000..296f7d6 --- /dev/null +++ b/meta-linaro/recipes-linaro/linaro-lava-tests/files/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012 Linaro Ltd. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/meta-linaro/recipes-linaro/linaro-lava-tests/files/hello.c b/meta-linaro/recipes-linaro/linaro-lava-tests/files/hello.c new file mode 100644 index 0000000..247bbe7 --- /dev/null +++ b/meta-linaro/recipes-linaro/linaro-lava-tests/files/hello.c @@ -0,0 +1,8 @@ +#include + +int main(void) +{ + printf ("hello world\n"); + + return 0; +} diff --git a/meta-linaro/recipes-linaro/linaro-lava-tests/files/hello.cc b/meta-linaro/recipes-linaro/linaro-lava-tests/files/hello.cc new file mode 100644 index 0000000..c0b335d --- /dev/null +++ b/meta-linaro/recipes-linaro/linaro-lava-tests/files/hello.cc @@ -0,0 +1,8 @@ +#include + +int main(void) +{ + std::cout << "hello world" << std::endl; + + return 0; +} diff --git a/meta-linaro/recipes-linaro/linaro-lava-tests/files/info.php b/meta-linaro/recipes-linaro/linaro-lava-tests/files/info.php new file mode 100644 index 0000000..554a22c --- /dev/null +++ b/meta-linaro/recipes-linaro/linaro-lava-tests/files/info.php @@ -0,0 +1,5 @@ + diff --git a/meta-linaro/recipes-linaro/linaro-lava-tests/files/mysql.php b/meta-linaro/recipes-linaro/linaro-lava-tests/files/mysql.php new file mode 100644 index 0000000..258b184 --- /dev/null +++ b/meta-linaro/recipes-linaro/linaro-lava-tests/files/mysql.php @@ -0,0 +1,9 @@ + diff --git a/meta-linaro/recipes-linaro/linaro-lava-tests/linaro-lava-tests.bb b/meta-linaro/recipes-linaro/linaro-lava-tests/linaro-lava-tests.bb new file mode 100644 index 0000000..389d2ff --- /dev/null +++ b/meta-linaro/recipes-linaro/linaro-lava-tests/linaro-lava-tests.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "Scripts and files for LAVA tests" +LICENSE = "Expat" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3725c2bb543d06ff759f9db9b5d986ac" +PR = "r2" + +SRC_URI = "\ + file://hello.c \ + file://hello.cc \ + file://info.php \ + file://mysql.php \ + file://LICENSE \ + " + +S = "${WORKDIR}" + +do_install() { + install -d ${D}/home/root ${D}/usr/share/apache2/htdocs/ + install -m 0644 hello.* ${D}/home/root/ + install -m 0644 *.php ${D}/usr/share/apache2/htdocs/ +} + +FILES_${PN} = "/" diff --git a/meta-linaro/recipes-support/confuse/confuse_2.7.bb b/meta-linaro/recipes-support/confuse/confuse_2.7.bb new file mode 100644 index 0000000..7f937aa --- /dev/null +++ b/meta-linaro/recipes-support/confuse/confuse_2.7.bb @@ -0,0 +1,16 @@ +DESCRIPTION = "Library for parsing configuration files." +HOMEPAGE = "http://www.nongnu.org/confuse/" +SECTION = "libs" +LICENSE = "ISC" +LIC_FILES_CHKSUM = "file://NEWS;md5=18e885b42b86362019e0cab8dc2a393b" + +SRC_URI = "http://download.savannah.gnu.org/releases/confuse/confuse-${PV}.tar.gz \ + " +SRC_URI[md5sum] = "45932fdeeccbb9ef4228f1c1a25e9c8f" +SRC_URI[sha256sum] = "e32574fd837e950778dac7ade40787dd2259ef8e28acd6ede6847ca895c88778" + +inherit autotools binconfig pkgconfig lib_package gettext + +EXTRA_OECONF = "--enable-shared" + +BBCLASSEXTEND = "native" diff --git a/meta-linaro/recipes-support/rt-app/rt-app_git.bb b/meta-linaro/recipes-support/rt-app/rt-app_git.bb new file mode 100644 index 0000000..119ddfe --- /dev/null +++ b/meta-linaro/recipes-support/rt-app/rt-app_git.bb @@ -0,0 +1,13 @@ +SUMMARRY = "rt-app is a test application that starts multiple periodic threads in order to simulate a real-time periodic load. " + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING.in;md5=e43fc16fccd8519fba405f0a0ff6e8a3" + +PV = "0.1+0.2-alpha2" +SRCREV = "17be4548c4260b80be623e0e1317e98a770dea7a" +SRC_URI = "git://github.com/gbagnoli/rt-app" + +S = "${WORKDIR}/git" + +inherit autotools + -- cgit v1.2.3-54-g00ecf