summaryrefslogtreecommitdiffstats
path: root/yocto-poky/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-eglibc-options-groups-support.patch
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2016-06-20 12:57:21 -0500
committerPatrick Williams <patrick@stwcx.xyz>2016-06-24 15:22:19 -0500
commitd8c66bc71e9a0303f1d300b9fa59c60dbfe10056 (patch)
tree0d5c0ade4cc7ae9d8df42bcb3ad376d95398465e /yocto-poky/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-eglibc-options-groups-support.patch
parent353dbdaaa97d78d064f0638221f57311f21f0bb3 (diff)
downloadtalos-openbmc-d8c66bc71e9a0303f1d300b9fa59c60dbfe10056.tar.gz
talos-openbmc-d8c66bc71e9a0303f1d300b9fa59c60dbfe10056.zip
Squashed 'yocto-poky/' changes from b1f23d1..8358e54
Upgrade subtree to Yocto-2.1. 6c1c013 build-appliance-image: Update to krogoth head revision 5f84d65 syslinux.bbclass: Remove APPEND from variable dependency d9dd864 bitbake: toaster-tests: tests for build dashboard 1cf8f21 bitbake: toaster: add modal to select custom image for editing a40a3e6 bitbake: toaster: add build dashboard buttons to edit/create custom images e65c980 bitbake: toaster-tests: make helper click on input before entering text 484cbf8 bitbake: toaster-tests: add tests for new custom image page 437b728 bitbake: toaster: prevent exception when Project.release is null cfc22d3 bitbake: toaster: only prevent duplicate custom image names within a project 3036413 bitbake: toaster: disable/enable "Add layer" button according to input's content 040dbf6 bitbake: toaster: fix sorting after hiding a column in build tables 1b11b79 bitbake: toaster: ensure ToasterTable headings are reset when order by changes 9855840 image.bbclass: The wrong name is being used for the debug filesystem 38c7e2d image_types: Ensure rootfs dependencies cover DEBUGFS 0c3eaa7 syslinux.bbclass: The AUTO_SYSLINUXMENU value needs to be boolean 9c8a049 perf: pass DESTDIR in EXTRA_OEMAKE 9de7324 buildtools-tarball: set INHIBIT_DEFAULT_DEPS ef09105 xf86-video-omapfb: remove EXTRA_OECONF_armv7a c2f7da2 base.bbclass: Introduce PACKAGECONFIG_CONFARGS variable e1c6890 git: update to 2.7.4 98bf7de license.bbclass: do write_deploy_manifest in image postprocessing 519600c devtool: sdk-update: fix handling of UNINATIVE_CHECKSUM changes c7980b6 bitbake: main: fix processing of BBEVENTLOG ee25d0e toasterconf.json: Update for krogoth release b8e5de2 toasterconf.json: Remove fido from supported configurations c59771e toasterconf.json: Update for krogoth release d0bce0b toasterconf.json: Remove fido from supported configurations d25eea3 poky-tiny.conf: set PREFERRED_VERSION_linux-yocto-tiny to 4.4 9f970b6 dev-manual, profile-manual, ref-manual: Purging Oprofile stuff 1d93104 ref-manual: Added description for the testsdk.bbclass. db47094 ref-manual: Updated the remove-libtool.bbclass description. a16eeca ref-manual: Added gobject-introspection.bbclass description. 3e761b4 ref-manual: Added reference for npm.bbclass. 5e50157 ref-manual: Fixed typo in the nopackages.bbclass description f7b68c7 ref-manual: Added description for bash-completion.bbclass ece900a ref-manual: Added nopackages.bbclass description. Fixed stray typo. 9143e9e ref-manual: Added description for the INSTALL_TIMEZONE_FILE variable. 6391dbf ref-manual: Updated the PREFERRED_PROVIDER variable with a note. 6d86f7a ref-manual: Dropped references to the autotools_stage class 4d5ff5e ref-manual, dev-manual: Scrubbed boot-directdisk and bootimg classes cd2aaaa ref-manual: Updated the uninative.bbclass description. e975d26 documentation: Converted "meta-yocto" to "meta-poky" 84452ee bsp-guide: Updated yocto-bsp create example output. e00a62c ref-manual: Added the migration section for 2.1 02db9e6 yocto-project-qs, ref-manual: Upgraded minimum Git requirement 989841f ref-manual: Added rootfs-postcommands class description. d06b343 ref-manual: Updated the EXTRA_OEMAKE variable description. ecb2eb6 dev-manual: Updated "Additional Implementation Details" section 004b939 bitbake: lib/bb/utils: add docstring for contains() 524d04c ca-certificates: support Toybox ecaf12e oetest: make console output more verbose 4946ecf dhcp: CVE-2016-2774 c219c6d buildtools-tarball: fix perl being included when building with ipk 9fe7738 buildtools-tarball.bb: fix unexpected operator ed07f43 lib/oeqa/selftest/base.py: Correct a reference to meta/lib/oeqa/selftest 8953d83 oe-selftest: Correct the usage examples dee47ad devtool: sdk-update: reset git metadata on update 396e64d build-appliance-image: Load TUN at startup 55068b1 default-providers.inc: set openssl PREFERRED_PROVIDER to openssl 74ab080 bind: CVE-2016-2088 d488d78 rpm: Disable __sync_add_and_fetch_8 on nios2 9d2d1ae kernel: fitimage: Fix do_deploy taskhash mismatch 4693593 images: zero out the rootfs_extra_space in initramfs images 8beb671 ext-sdk-prepare.py: exclude do_rm_work from unexpected output; create unit test 0262bc5 bitbake: bitbake-user-manual: Updated the 'bitbake -h' output example. 890ccd3 bitbake: bitbake-user-manual: Updated "Conditional Metadata" section 20a0121 bitbake: bitbake-user-manual: Updated discussion about using "inherit" 9f374c4 bitbake: providers: Add PREFERRED_RPROVIDER support 4b8b110 bitbake: providers: We don't depend on previous build results 8e7282c bitbake: cooker/knotty: Prefix parse logs with filename being parsed 1131303 bitbake: cooker: pass exception to finishAsyncCommand ffa2ca0 fs-perms.txt: fix ROOT_HOME's permission fd66a38 Revert "fs-perms.txt: fix ROOT_HOME's permission" 9ec9557 buildstats: Fix tracebacks for early task failures 7f9d01e default-providers: Update to use PREFERRED_RPROVIDER 76f4bbc oeqa/selftest/sstatetests: fix no-op sstate test 6326812 buildhistory: don't alter SDK creation stamps bb40b5e dhcp: Enable update-rc.d service 27e202f meta/classes/qemu.bbclass: set -cpu of ppce5500/ppce6500 to e500mc 7c5823a shadow: Disable syslog for more commands 60a8719 devtool: upgrade: handle recipes where source is not first entry in SRC_URI 8353557 devtool: update-recipe: handle where SRC_URI is appended to with += aab3c8d linux-yocto: make aufs4 optional d75d2be linux-yocto: tiny and pin ctrl config updates 8547cbf linux-yocto/4.4: BXT enablement ffad386 linux-yocto/4.1: mainline SPI backports 4ba33a3 linux-yocto/4.4: gpio-pca953x: fix the "drive" property cannot read/write 86571db devtool: don't copy .git when building the eSDK 83eac65 package.bbclass: improve permission handling eeae2ac fs-perms.txt: fix ROOT_HOME's permission 1db3dc8 runqemu: let ramfs equal to cpio.gz a8c8e81 gcc-common.inc: String format tweak for available tunes a7c426a pbzip2: fix LIC_FILES_CHKSUM following 1.1.12 -> 1.1.13 upgrade 1229009 pbzip2: don't skip do_configure 1e4ee30 useradd_base.bbclass: remove flock option '-w' cb45ef3 matchbox-keyboard: Hide desktop launcher 69e20ca npm.bbclass: Stop packagenames containing underscores from being generated c3c55478 bind: CVE-2016-1285 CVE-2016-1286 c4387a8 image.bbclass: add DEB_{PRE, POST}PROCESS_COMMANDS to rootfs_command_variables list 967bc74 rootfs.py: apply ROOTFS_POSTINSTALL_COMMAND to all package formats f7352ca wic: fix bug in handling fsoptions b2f5de5 buildtools-tarball.bb: set TOOLCHAIN_NEED_CONFIGSITE_CACHE to null a460b04 rpm: more verbose errors in rpmTempFile a43991d rootfs-postcommands: handle broken links when writing manifest 2c81e17 socat: Use c_ispeed and c_ospeed based upon libc 5c8124d archiver: Improve debug output e912c46 kbd: remove uclibc-stdarg.patch 965fd3c image.bbclass: use max() instead of indexing booleans 6d85874 linux-yocto-tiny: fix KBRANCH 440d949 sudo: fix pam config on systemd systems 3fd5a6d sysvinit: make lastb.1 an alternative 175263e lib/oe/lsb: sanitise the distro identifier 9262d2f package.bbclass: handle links in sorted order 29cf263 sanity: allow sftp and ssh mirrors f503317 toaster.bbclass: improve package information collection 88f4178 rsync: remove upstream's rebuild logic 8d59d06 rsync: pass cached configure values through the right variable 384e41c rsync: don't install acinclude.m4 e80800e Revert "oeqa/selftest/wic: add test case for sparse images" 45c0763 Revert "wic/utils/partitionedfs.py: assemble .wic images as sparse files" e0e5426 bitbake: runqueue: Improve 'mulitiple .bb files are due to be built' message 380004b archiver: Ensure sstate-inputdir directory is created 3ad70a5 linux-yocto-tiny: fix COMPATIBLE_MACHINE 0e59727 glib-2.0: Put glib-compile-schemas back in -utils d27ca36 oeqa/runexported.py: Fix exported test 85dbd7b oeqa/selftest/sstatetests: split 32/64 build host from no-op action tests 57be6dd util-linux: take ownership of hwclock if installed acc1f96 meta: remove redundant ac_cv_sizeof_off_t assignments 92759d8 meta/site: remove sizeof_off_t 5602f64 archiver: Fix ASSUME_PROVIDED issues fab626c distrodata: Exclude DATETIME reference from sstate checksum faaeaf9 build-appliance-image: Support for VirtualBox guest additions 778121a local.conf.sample: Make it possible to override EXTRA_IMAGE_FEATURES f947c27 poky.conf: add Fedora 23 to supported distros f33a110 maintainers.inc: remove adt-installer 83d4fab local.conf.sample: remove reference to adt 52cfdb6 bitbake: toaster: fixes for customimage package not found dae4ffb bitbake: data_smart: Restrict expansion regexp to not include : characters 7e739ac bitbake: tests/utils.py: test origvalue in a callback matches what is expected e1e459e bitbake: lib/bb/utils.py: Fix a bug in edit_metadata() that could corrupt vars 43150ab oeqa/selftest/wic: add test case for sparse images 29bc2f7 wic/utils/partitionedfs.py: assemble .wic images as sparse files 7fdb061 image-vm.bbclass/image_types.bbclass: IMAGE_NAME -> IMAGE_LINK_NAME 04e1978 image_types.bbclass: fix elf 513ea49 image_types.bbclass: set nodesize for btrfs bad434b libxml2: fix AM_PATH_XML2 9fe3d01 useradd_base.bbclass: prevent variable expansion in $opts fb8e5f9 extrausers.bbclass: drop retry count for perform_user/group* calls f737af4 build-perf-test: add eSDK installed size to metrics 50f5ca3 rpm: brace expansion is a bashism 66ecbd3 openssl.inc: minor packaging cleanup e38ec0c systemd-systemctl-native: fix unit detection 4019058 apr-util: fix path in rules.mk for nativesdk bdf453f bdwgc: installed-vs-shipped for nativesdk 12ca8df libsolv: fix installed-vs-shipped for nativesdk c88c894 desktop-file-utils-native: disable emacs d4f6c0e toaster: add DL_DIR and SSTATE_DIR to oe toasterconf 69b3f87 toaster.bbclass: strip task from the target aa45c75 x11-common: Add PACKAGECONFIG for screen blanking d366a33 opkg-utils: re-do find/ls code to not fail on filenames with spaces 5e360ca image-live.bbclass: fix iso + efi only f5adb23 Add missing runtime dependency to python-pygobject 0720425 devtool: Create unlocked-sigs.inc containing items in the workspace 64cca7e sstatesig.py: Add a method to "unlock" recipes 1cb99dd populate_sdk_ext.bbclass: Enable locked sigs errors 2431ed7 sstatesig.py: Improve the SIGGEN_LOCKEDSIGS_TASKSIG_CHECK message 7e90280 sstatesig.py: Split single locked sigs check into multiple checks 7ce800c toasterconf.json: Set default distro to nodistro 1b7b548 dev-manual: Updated poky-floating-revisions file snippit example. 8d9e233 dev-manual: set correct task name for do_kernel_configme 6971029 poky-floating-revisions: Fix typo 14e2b90 toasterconf.json: Add DL_DIR and SSTATE_DIR to poky toasterconf 296dfbc build-appliance-image: Update to master head revision 00c4c9b poky: Convetion is 2.1, not 2.1.0 8cd1dec build-appliance-image: Update to master head revision ecd58bb poky.conf: Bump version for 2.1.0 krogoth release e955b5d bitbake: Update version to 1.30.0 4fd14e3 build-appliance-image: Update to master head revision 133224f documentation: Fixed references using the DISTRO_NAME variable 3831ca0 documentation: Updated release date in manual history tables. b590fab dev-manual, ref-manual, sdk-manual: Removing oprofile references. d2084cc Makefile: Removed adt-manual support 2677098 mega-manual: Removed the adt title .PNG file. d9b4c80 README: Updated to remove the ADT manual and add the SDK manual. 9796cbb mega-manual.sed: Removed adt-manual processing aa4b72b yocto-project-qs: Updated the minnowboard example. f2505af poky.ent: Added lower-case distro name variable. ee42a9b kernel-dev: Applied review comments to "Adding Recipe-Space Kernel Features" d57fe7c ref-manual: Updated the PREFERRED_VERSION variable description. 53bade8 dev-manual: Added new section describing hardware and non-hardware config 763ae4e ref-manual: Updated verbiage on proxy handling a1295ed ref-manual: Updated PREFERRED_VERSION variable description 879eec2 ref-manual: Updated debugging tips and tricks 23dbf81 kernel-dev: Added new "Adding Recipe-Space Kernel Features" section. f30bfe9 kernel-dev: Updated the "Kernel Metadata Location" section. 53729bc sdk-manual: Removed three sections of writer notes. 9f0c571 sdk-manual: Applied review edits. d4bdafa sdk-manual: Added sections in Appendix B. d94fa00 dev-manual, profile-manual: Removed oprofile section and link 4f3dfa8 bitbake: bitbake: update LICENSE file with QUnit details 013984d bitbake: tests: browser Add test to run the js unit tests 7609888 bitbake: toaster: views jsunittest Add MACHINE and an extra layer to test project fbc2c5d bitbake: toaster: tests Set MACHINE for the test projects cb6b4eb bitbake: toaster: Add quint to project so that it can be used offline 18cb7fe bitbake: toaster: add rev dep column to image detail pages 7a309d9 bitbake: buildinfohelper: work around unicode exceptions 860cba8 bitbake: toasterui: update build in internal state acb9407 bitbake: buildinfohelper: fix KeyError 52c8740 bitbake: toaster: get bitbake location from BBBASEDIR f5d3ef6 bitbake: toaster: export BBBASEDIR variable 71ff9b9 bitbake: toaster: update projectconf.html for DL_DIR and SSTATE_DIR 705d44f bitbake: toaster: update view to support DL_DIR and SSTATE_DIR 4aafcae bitbake: toaster: use empty token 5ce4665 bitbake: toaster: runbuilds Clean up runbuilds 55b6fab bitbake: toaster: runbuilds Make runbuilds aware of the build CANCELLED state f4cee88 bitbake: toaster: models Exclude the CANCELLED builds from get_number_of_builds 296d373 bitbake: toaster: mrb_section template Add build cancel button f1b49dc bitbake: toaster: tables BuildsTable exclude cancelled builds 22242ae bitbake: buildinfohelper: Add handler for cancelling a build 9dcb9cb bitbake: toaster: bldcontrol models Add a cancelling state the BuildRequest dfa8510 bitbake: toaster: models Add cancelled state to build outcome 5f862bb bitbake: toaster: update BuildEnvironmentController and BitbakeController 0db62c5 bitbake: toaster: libtoaster Update implementation of startABuild and cancelABuild afab95c bitbake: toaster: xhr Update the implementation of the build cancellation request eead032 bitbake: toaster: Move xhr calls for starting and stopping builds f5aa970 bitbake: toaster: bldcontrol Add forceShutDown function to BitbakeController d6992a8 bitbake: toasterui: shutdown on BuildCompleted event c4ae028 bitbake: toaster: use bash explicitly 4adddfd bitbake: toaster: fix jethro build b1a919a bitbake: toaster: update conf/local.conf 590a815 bitbake: toaster: stop bitbake server after the build a8f6001 bitbake: toaster: add new parameter to _shellcmd a43a16b bitbake: toaster: reimplement triggerBuild ab18c20 bitbake: toaster: modified setLayers API 22fba9b bitbake: toaster: add brbe parameter to triggerBuild 829a0bd bitbake: toaster: remove release API 7068e8a bitbake: toaster: remove startBBServer API 9d4c62d bitbake: toasterui: fix brbe reporting 5bcce68 bitbake: buildinfohelper: improve handling of providermap 61b6b98 bitbake: uievent: improve BBUIEventQueue code 0b0d754 bitbake: toasterui: add brbe parameter to buildinfohelper 94ac3f0 bitbake: toaster: set BITBAKE_UI environment variable e23a23b bitbake: toaster: get rid of noui option f77baec bitbake: toaster: don't start bitbake server 4127fef image_types: use compress framework to produce checksums for images 60786b8 runqemu-gen-tapdevs: Add note about NetworkManager & tap devices 634aeed libtool: fix contaminated path to lt_truncate_bin 298d875 create-pull-request: fix for newer git 4faeff9 wget: fix build when len(TMPDIR) == 410 b667f4d sanity.bbclass: fix a hardcode in check_path_length() 94b3583 grub: remove unused 0001-Fix-build-with-glibc-2.20.patch ef163ab glibc: remove unused CVE patches b050ab2 clutter-gst-3.0: remove unused enable-tests.patch 064ebd5 cmake: remove unused dont-run-cross-binaries.patch a71db4c tcl: remove unused fix-configure.patch 476eeea rpm: remove two unused patch 3d56864 ffmpeg, gstreamer1.0-libav: add textrel INSANE_SKIPs 8cc10a9 ffmpeg: Make configure options explicit 45c1944 bzip2: set correct soname cbe33ec useradd.bbclass: remove user/group created by the package in clean* task c115740 bitbake: fetch2/git.py: remove .indirectiondir workaround 4f07c22 bitbake: persist_data: Return str instead of unicode for sqlite3 text queries d8f1f42 scripts/oe-selftest: avoid the creation of coverage file when coverage not installed 6e5e225 scripts/oe-selftest: remove coverage file if any coverage option is given 5edfec4 scripts/oe-selftest: remove unneeded coverage warning 8109e93 patch.bbclass: remove useless path assignment 7963613 gstreamer: remove now-redundant expansion in do_split_packages 37f4f5b package: do_split_packages: expand variables in extra_depends 2ed2089 xf86-video-intel: Add patch to fix some poor image quality c1436b3 sanity: Increase minimum git version to 1.8.3.1 672545b scripts/oe-buildenv-internal: Fix regression in BB_ENV_EXTRAWHITE setting f7fed7c license.bbclass: fix warnings when run in unprivileged "container" env 43071a0 externalsrc: avoid race in temporary git index file f4f1d20 scripts/lib/bsp/help.py: Typo in help for yocto-bsp create 1bd2c8e bdwgc: use github repo for source location 0e6743b xf86-video-intel: Add patch to allow UXA to build 21e31c2 package_manager.py: better error handling in opkg's package listing f2d5e20 systemd: make systemd-serialgetty optional e699404 ncurses: reorder PACKAGES f94ad4d bluez5.inc: remove obsolete workaround a0cd8c0 buildtools-tarball: Add texinfo (for makeinfo) 9877795 cogl: fix G-I .typelib installation b13184c classes/buildhistory: fix grammar in comments e5c0a9f classes/buildhistory: fix filtering of depends-nokernel.dot 4d364f2 classes/buildhistory: optimise getting package size list af5f423 bitbake: siggen: Ensure tainted stamps are accounted for with writing custom stamps 47e9e12 bitbake: siggen: Fix nostamp taint handling 8033627 bitbake: siggen: Add checksum recalculation/checking code 3e1b5e0 bitbake: siggen: Fix check calculation problem with file_checksums 39b637c bitbake: siggen: Drop misleading duplicate method 2c722e2 bitbake: tests/fetch.py: Improve unit tests for trusted network check cf6d12d bitbake: fetch2: BB_ALLOWED_NETWORKS should not care about port numbers 158575c bitbake: toaster: orm better detect requires during CustomImageRecipe generation c634473 bitbake: toaster: Correct typo on build form help text c9ad1e6 bitbake: toaster: buildinfohelper Add additional metadata to the built layer 072a0b3 poky: Exclude DATE from DISTRO/SDK_VERSION checksums f3c029f build-appliance-image: Exclude DDATETIME from task signature 7833eb4 image-vm: Exclude DISK_SIGNATURE_GENERATED from task signature 85ff4ff populate_sdk_ext: Exclude BBTASKDEPDATA from task signature 66412ab opkg-utils: opkg-build exit when fail to list files. 6b8f8a4 kernel-yocto: enforce SRC_URI specified branch 6ebd43c linux-yocto/4.4: UVC: Add support for R200 depth camera 6d2299f linux-yocto/4.4: fix PAT for 32bit x86 5559301 Revert "linux-yocto: Work around PAT issue on qemux86" 686c74f linux-yocto-dev: bump to v4.6-rcX b3ba813 linux-yocto/4.1: ahci: backport AHCI runtime PM 8f7bbea linux-yocto/4.4: gpio-pca953x: add PCAL9535 interrupt support 4a50c05 linux-yocto/4.1: telemetry and dmaengine backports 31a10cb wic/isoimage-isohybrid.py: change cpio generated uid&gid to root 5cabf3b wic/isoimage-isohybrid.py: use glob to find initramfs location 5c60c36 bluez5: add ptest support fc8b24d oe/patch: print cleaner error message when patch fails to apply bf14014 oe/patch: more detailed error reporting a2bf9e3 insane.bbclass: avoid false positives on library location 1f2f43c grub-efi.bbclass: use GRUB_ROOT rather than APPEND for root device bf58526 bitbake.conf: Add BB_WORKERCONTEXT to HASHBASE_WHITELIST 1c1e851 gdb-cross-canadian: use PACKAGECONFIG for python and readline 370a50a base: Fixup PACKAGECONFIG incorrect mappings dea3423 classes/packagegroup: Refactor code to be simpler 5defbcd default-distrovars.inc: remove libassuan from LGPLv2_WHITELIST_GPL-3.0 58d8123 libassuan: use package specific licensing 1f2a01b init-install-efi.sh: remove all root=foo from grub.cfg 3ce7d8c init-install.sh: fix disk_size 46eed0a ltp: fix test_proc_kill hanging 207ee90 ltp: add periodic output for memcg stress test feafad1 epiphany: Depend on intltool-native for configure 2510239 image: Fix debugfs image type recursion loop 7dcb4c4 bitbake: toaster: tests Migrate landing page tests to Selenium 5b848fa bitbake: toaster: tests Migrate all projects page tests to Selenium f2a38ea bitbake: toaster: tests Migrate project builds page tests to Selenium 961cd90 bitbake: toaster: tests Migrate all builds page and project page tests to Selenium f859a3d bitbake: toaster: tests Migrate to Selenium for UI tests 965c72c yocto-bsp: Set correct default branches and branches base for i386, qemu and x86_64 archs d110eba selftest/signing: Use packagedata to obtain PR value for signing test 34f11b5 lib/oe/packagedata: Add import os 0012b90 base.bbclass: avoid duplicate call to d.getVar('LICENSE', True) efe73cb base.bbclass: drop obsolete HOSTTOOLS_WHITELIST_GPL-3.0 5293b83 man: use BUILD_CC and target include files for configure 5121705 scripts, lib: Don't limit traceback lengths to arbitrary values 3168134 bitbake: bitbake: Don't limit traceback lengths to arbitrary values 88ea0b9 image-vm.bbclass: remove invalid code 4d1df2c image-live.bbclass/image-vm.bbclass: remove duplicated code d6d7526 bootimg.bbclass: merge it into image-live.bbclass 723fa56 boot-directdisk.bbclass: merge it into image-vm.bbclass 9e588481 man: fix several annoying compile/build warnings aa13b97 image.bbclass: Make unneeded packages for a read-only rootfs configurable 4dde12f relocate_sdk: additional error checks 22bd875 systemd: fix build with gcrypt PACKAGECONFIG disabled 4b77909 devtool: modify: call shutdown on tinfoil when done 43da712 toolchain-shar-extract.sh: ensure all_proxy is allowed through 2aec71e oe-publish-sdk: exclude sstate-cache if publishing minimal SDK 8ef7016 oe-publish-sdk: prevent specifying a directory for the SDK argument 591b97c classes/populate_sdk_ext: support setting vars from environment at build time c37d542 scripts, lib: Don't limit traceback lengths to arbitrary values 8049f25 pyton-numpy: Add definition of off_t size b75505e image-live.bbclass: DEPENDS on syslinux 3ece012 ldconfig-native: Fix ELF flags on 64-bit binaries d492aec recipes-support/rng-tools: Change runlevel start from S to 2, 3, 4, 5. ab5c62e oeqa/runtime/parselogs.py: Add systemd unit circular dependencies errors. 9be3fb2 systemd-serialgetty: allow baud rate overriding cf6788c psmisc: Remove including sys/user.h and __WORDSIZE ede11b6 selftest: Added testcase decorator to tests ccfe48c linux-yocto: add overlayfs feature 6ae0224 linux-yocto/4.4: broxton and usb type-c backports e1ae3ee linux-yocto/4.4: drm/i915/skl: Fix DMC load on Skylake J0 and K0 0a1d621 linux-yocto/4.1: Intel Broxton: pwm backports 6ce8802 linux-yocto/4.1: Apollo Lake/Broxton mmc backports a256628 linux-yocto/4.1: i2c: designware: Backport i2c patches fbd209d linux-yocto/4.1: device property backports ccf1b33 linux-yocto/qemuarm64: enable 32 bit compatibility dacf9f2 linux-yocto/4.1: SMBus/iTCO backports ab6fd48 default-distrovars.inc: remove gnutls + libtasn1 from LGPLv2_WHITELIST_GPL-3.0 2123a7e sanity.bbclass: Use pythonexception to raise real exceptions without backtraces 6af88d8 sanity: Require bitbake 1.29.1 1b2df6e uninative: Switch md5sum -> sha256 f719386 bitbake: cookerdata.py: remove slash in the end e26087f bitbake: Bump version to 1.29.1 d73da22 bitbake: build/utils: Allow python functions to execute with real exception handling 672c07d bitbake: fetch2: Ensure that incorrect checksumed files are always renamed 2554be4 bitbake: cooker: fix CookerParser.shutdown() 53b5dc0 gcc: Fix musl ldso name for mips64 dd31bca selftest/buildoptions.py: use INHERIT += 71db079 archiver.bbclass: addtask do_deploy_archives_setscene 1ca71e5 bitbake: cooker: Ensure bbappend order is deterministic 292c3e8 bitbake: checksum: In FileChecksumCache don't follow directory symlinks 326fc29 gcc-5.3/gcc-4.9: -fdebug-prefix-map support to remap relative path 9e20f94 ptest-runner_2.0.bb: Update recipe to point git.yoctoproject.org repo. 437841c man: fix src/Makefile to work with parallel make abb5b46 oeqa/selftest/bbtests: Test bbappend order ddbeb56 bitbake: cookerdata: Improve handling of ParseError 6dff639 gcc: Backport fixes for musl ssp configuration ab20659 siteinfo: Fix musl 64bit targets cd16b65 musl: Update to tip 0883aff buildhistory.bbclass: create image directory when needed c093f7c runqemu: fix for iso f1f9f89 init-live.sh: fix overlay fs 4e7eaed init-live.sh: fix ROOT_MOUNT 1622077 no-static-libs.inc: build static libusb1-native b3e4a31 sstatesig: Ensure we keep native depends for allarch recipes 528a890 oe-selftest: generate .env only in test_image_env 21823cb build-appliance-image: Update to master head revision 7d251f7 build-appliance-image: Fix permissions 60656d0 bitbake: fetch2/wget.py: _check_latest_version_by_dir fix prefix detection 45ee2b1 bitbake: fetch2/wget.py: _check_latest_version_by_dir use group names 55cd35b conf/bitbake.conf package.bbclass: fix dbg package not contain sources while -fdebug-prefix-map used e2b919c externalsrc: remove nostamp from do_configure bbfc210 externalsrc: do not use do_configure[nostamp] for git srctrees 9ee403b archiver.bbclass: Just archive gcc-source for all gcc recipes 37683ef oeqa/utils/ftools: improve remove_from_file algorithm 3a934a8 scripts:/oe-selftest: Use timestamp instead of test names in coverage data file 71304d8 xcursor-transparent-theme: upgrade to latest git revision 7c5343a gdb: Fix build on mips64/musl 856be1f libunwind: Fix build on mips/mips64 for musl targets dd61341 toolchain-shar-extract.sh: check the length for target_sdk_dir c3c793b relocate_sdk: fixed .gccrelocprefix section handling cc97d57 glib-2.0: Fix packaging cef8bc9 gio-module-cache: Add class for Gio modules 0cda9d8 glib-2.0: Install gio-querymodules in main package 9ac1b6f oe-git-proxy: support username / password in http proxy a15541d oe-git-proxy: also check all_proxy and http_proxy env variables 92b2bc5 wic: Update after task ordering changes d6cb46c image.bbclass: run wicenv task only for wic images 5cb7705 wic: fix type of no-table option 1209eb2 matchbox-desktop: Do not close desktop on alt-F4 0361676 rootfs-postcommands: don't write manifest when IMAGE_MANIFEST empty abd5b24 bitbake.conf: rename 'gobject-introspection-data' machine feature to 'qemu-usermode' f81065f selftest/devtool: Update after make PROVIDER changes 25a04ee make, remake: make them properly exclude each other f3a92ff kernel.bbclass: consider .csp firmware files 0569b69 tzdata: update to 2016c a7e726a tzcode: update to 2016c 201d9d3 icecc.bbclass: replace icc with icecc da00f6c icecc.bbclass: expand package arch 3f1702c icecc.bbclass: add icc_is_allarch inherit check 39170fe classes/sanity: use proper multi-line string literals 33a6135 oe-buildenv-internal: simplify derivation of BB_ENV_EXTRAWHITE c6ab828 u-boot.inc: Add sub-dir support for SPL_BINARY ddedab4 quilt: run ptest as normal user afa4d5e site: Cache config vars for ccache 04344eb gdb-cross: use PACKAGECONFIG for python and readline 5005cab add !meta-poky to .gitignore file 1dd9348 scripts/lib/bsp/help.py: Add missing options to yocto-bsp help and usage 54eca75 poky-sanity.bbclass: update conf/templateconf.cfg for existing installations 2b992f3 site.conf.sample: fix reference to oe-git-proxy script af63b49 conf-notes: remove reference to adt-installer 1d219ce linux-yocto: Update SRCREV for genericx86* for 4.4 8d4f43e linux-yocto: Update SRCREV for genericx86* for 4.1 84d5924 bitbake: fetch2: Handle lockfiles for file:// urls redirected to mirrors b036afb bitbake: toaster: get all dependents for pkg for removal 9bf98a9 bitbake: toaster: new customise package-remove modal dlg d5a419d bitbake: toaster: show full list of dependents to remove fda94f4 bitbake: bitbake: fetch2/gitsm: Fix fetch when the repository contains nested submodules 1341c17 pseudo: backport a patch to fix xattr removal 07f0af3 uninative: don't try to relocate static binaries c3c0d0a lib/oe/qa: add method to check if static or dynamic linked 10b6037 uninative: ensure patchelf errors are visible 86d7e44 libmad: remove use of obsolete _thumb over-ride e7395c8 perf: package python modules into perf-python b47225f perf: fix python scripts QA errors ea8b914 linux-yocto/4.1: MFD backports b6563a1 linux-yocto/4.1: device property : Backport device property patches 46baceb linux-yocto: ktypes/standard: Add tmpfs-posix-acl feature bdf6b20 linux-firmware: Break out some additional firmware 6d8141f linux-firmware: Clean-up and sync license data cea2a21 linux-firmware: Collapse iwlwifi firmware blobs for 7260 and 7265 3b3fe1d linux-firmware: Update to latest HEAD d7cf2c3 archiver.bbclass: Fix tar name for git repositories 2cb4cb7 archiver.bbclass: Fix gcc-source corner case c29eea0 archiver.bbclass: Fix use of ARCHIVER_WORKDIR and ARCHIVER_OUTDIR 8b7ee6e archiver.bbclass: Don't expand python functions in dumpdata bc100b3 bind: /var/cache/bind 04d883c sysvinit: downgrade ALTERNATIVE_PRIORITY[mountpoint] 688d9a6 util-linux: split out util-linux-mountpoint 85ff75d gconf: fix buildpaths QA issue 7f7c9ab python-pygobject: use Python 2 instead of Python 3 e33124f sanity.bbclass: check host tool dependencies on change in NATIVELSBSTRING 4fe64d7 libunwind: Fix build with fstack-protector on musl 4aa08b8 ltp: Fix build on x86/musl 959b7f2 package.bbclass: Treat .node files same as .so when checking what to strip e0bc781 bootimg.bbclass: only inherit syslinux when pcbios 1b1de89 grub-efi.bbclass: make it can build vm and live together 4ebaeb2 bootimg.bbclass: fix settings for grub-efi.bbclass af1f77a pixz: Fix build on big-endian/musl systems 421289c sanity.bbclass cleanup 93e411e matchbox-wm: Update to fix XChangeProperty datatype issue c843022 matchbox-panel-2: Fix Home-button icon load issue 01f6818 gstreamer1.0: fix introspection support also for git recipes 171adb1 gstreamer1.0-plugins-bad: fix incorrect handling of Cflags in gstreamer-gl.pc file 6462d08 x86-base.inc: suggest the latest kernel c5c9ed6 at: fix configure option with/without-selinux 9b2b1f0 no-static-libs: just like target and native, nativesk-libcap doesn't like unrecognised options bf90d0c linux-firmware: package firmware for Marvell 88W8688 cd17ab0 tune-arm926ejs: Handle missing thumb suffix 5b70c7e nativesdk-coreutils: a lot of warnings fixed b47c53b runqemu-internal: split the code into functions fae732f runqemu-internal: cleanup unsed code e469bb7 runqemu: simplify checking for iso and ramfs 3610329 runqemu: add support for qcow2 and vdi d85ca4a runqemu: remove ISO and RAMFS from help text 58bc854 runqemu: simplify the checking for vm images 6716eb2 runqemu: fix ROOTFS for vmdk 258cfa8 python(3): Disable tkinter 5988b5c selftest/signing.py: RPM_GPG_PASSPHRASE_FILE -> RPM_GPG_PASSPHRASE 3e5c5fe gpg_sign.py: get rid of pexpect 05d7e0d rpm: check _gpg_passphrase before ask for input 13a31b1 oe-publish-sdk: fix remote publishing 9926425 oe-publish-sdk: improve help output slightly 905286c oe-publish-sdk: drop SDK installer file from published output 0523378 devtool: add: create git repository if URL specified as positional argument 11c1d30 devtool: add: delete externalsrc files on npm recipe do_install 552a68a devtool: configure-help: fix error if do_configure not already run eab3f06 bitbake.conf: whitelist proxy variables in config hash 58d2e56 classes/populate_sdk_ext: parse metadata on minimal SDK install 0684572 devtool: sdk-install: add option to allow building from source 50addfb classes/distutils*: don't hide logs when setup script fails 0ec30c7 classes/packagegroup: drop complementary -ptest if ptest not in DISTRO_FEATURES d96ea29 classes/packagegroup: fix dbg/dev/ptest complementary packages b58e5b1 bitbake: bitbake: xmlrpc: set single use mode differently 2df514b sdk-manual: Added note for running remote apps with SSH port forw enabled. 12f5c25 poky.ent: Added code name for 2.1 release to the variable 64241e0 sdk-manual: Applied more review edits to the manual per Eggleton. b44d9e5 ref-manual: Created distrodata and checkpkg tasks, updated distrodata class 54050ff sdk-manual: Applied 2nd round of review edits. 6db8cbc sdk-manual: Applied review edits to the manual. 922eaeb sdk-manual: Updated the SDK devtool modify flow diagram. 2bbf77a dev-manual: Fixed a grammar error 286b76f sdk-manual, mega-manual: Updated the SDK devtool modify diagram c3946bc dev-manual, profile-manual, ref-manual: Updates to remove meta-toolchain 7233e35 sdk-manual: Edits to add extensible SDK configuration sections. b31bf7c ref-manual, sdk-manual: Changed section heading. 670735e ref-manual: Added some SDK manual support to introduction 266742b profile-manual: Updated screen output for oe-init-build-env 0654224 kernel-dev: Changed a link from an example to in-text. 19e3648 dev-manual: Edits from a 2.1 read-through. a389684 poky.ent: Fixed a typo in one of the variables "ftar" to "tar" b5d3065 poky.ent, bsp-guide: Removed eMenlow example and updated 2.1 variables 884b528 yocto-project-qs: Performed a read-through edit. 4b42385 poky.ent: Updated copyright year and version variables. ae48b1f mega-manual: Added two new sections for the sdk manual 815d686 sdk-manual: Added some intro stuff about the SDK 4c5157f ref-manual: Resolving a conflict 4306f7f sdk-manual, mega-manual: Added new figure for Eclipse flow. 0bb6e48 sdk-manual: WIP on the book. 5a64701 sdk-manual, mega-manual, Makefile: Added new figures 32629e0 Makefile: Resolving a conflict af40e9a sdk-manual: Added a new figure for installed extensible sdk directory. 62477889 sdk-manual: Applied some "red" text formatting to indicate notes 7ab8afa Makefile: Added the ".png" part to a figure I forgot. fc43555 sdk-manual: Added a red-text "role" to the style sheet. d07100d sdk-manual: Added new section detailing installed SDK directory. b750729 sdk-manual-customization: Fixed XSL Appendix numbering parameter ad7a994 Makefile: Updated the figure list for the mega-manual. 890f721 sdk-manual: WIP - Various small edits as WIP f15f96c sdk-manual: New content for outline purposes. 4643b04 sdk-manual: Updated with two new appendices for new files. d05566b sdk-manual: Added sdk-environment.png diagram. 0936eed sdk-manual: Added two appendix files to SDK Manual. 6996a1c Makefile: Added sdk-environment.png to figure list for SDK Manual 6cdb356 toaster-manual: Edits to a previous patch. 77594c0 mega-manual, Makefile: Added support for three new toaster figures. 00fe95d toaster-manual: Explain the local release d06c7b8 documentation: remove all references to Hob be8af37 ref-manual: Updated COREBASE_FILES variable. 5c7e5aa bitbake: bitbake-user-manual: include/require checks current directory 7ec8f28 bitbake: bitbake-user-manual: Updated the "inherit Directive" section. 75cba54 bitbake: bitbake-user-manual: Updated the copyright year to 2016 2918b50 bitbake: toasterui: remove ParseStarted from the event list ab2abd4 bitbake: toasterui: Remove the excessive exception logging d8137be bitbake: cache: Make BB_DONT_CACHE variable external 1d1aaa2 bitbake: toaster: orm generate CustomImageRecipe contents try secondary path 5c49230 bitbake: toaster: localhostbecontroller put generated layer in the builddir b60c994 bitbake: toaster: localhostbecontroller Allow file:/// uri type for git repo 3025092 bitbake: toaster: orm Add a constant for the CustomImageRecipe's layer name 3df6551 bitbake: toaster: localhostbecontroller Don't clear out toaster custom layer dir 2f2f784 parselogs: add new whitelist entries to address 4.4.3 issues 8037ba4 bitbake: bb/tests/fetch: Update cups url dab6d59 oe-buildenv-internal: Correct the sed expression which updates $PATH 068afc5 tzdata: update to 2016b e140272 tzcode: update to 2016b c0b3667 ffmpeg: Remove RSUGGEST=mplayer e528a0a lttng-tools: Remove lttng-ust from PACKAGECONFIG for musl 42b9bdf packagegroup: Disable packages not available on musl f148a2e world-broken: Add packages broken on musl 624ca6a siteinfo: Move apr configure cache to common-linux 90234f1 parselogs: add new whitelist entries to address 4.4.3 issues 13a2a3f u-boot: Upgrade to 2016.03 release ecf3396 grub: add -Wno-error=trampolines to native CFLAGS 07515b0 dhcpd: create dhcpd user for dhcp dameon b9ad80d valgrind: fix buildpath QA issue 7985006 gcc-5.3/gcc-4.9:Reuse -fdebug-prefix-map to replace -ffile-prefix-map 2faa718 gcc-5.3/gcc-4.9:replace build path with target path in __FILE__ 76f10fd oe-buildenv-internal: Some clean up 4d1efc3 oe-buildenv-internal: Add variables individually to BB_ENV_EXTRAWHITE 39ac332 oe-buildenv-internal: Add paths to $PATH individually dd5f2f7 oe-init-build-env*: Make them actually return failures ea28de6 oe-init-build-env*: Remove unnecessary differences between the scripts 51aa00f oe-init-build-env*: Update/correct comment about specifying arguments 16fb9b8 oe-init-build-env*: Allow $OEROOT to be predefined 3173979 bluez5: allow D-Bus to spawn obexd in systems without systemd 10ef68f oeqa: remove RPM 4 self test d915965 lib/package_manager: remove RPM4 support code 03fce73 smartpm: remove rpm4 patch 1e9de52 rpm: remove RPM 4 a7dd04d grub: fix documentation rebuilds ee4f61b oe-selftest: Fixed --list-tests-by tag option 068e898 gcc-runtime.inc: set LICENSE for all gcc-runtime packages 788dfdd ParaTypeFFL-1.3: Add license file 62ddde6 externalsrc: use shared stamp directory if B=S 1969332 rpm: fix error when 'lua' is enabled a31301e matchbox-keyboard: Update to latest HEAD to fix 64bit issue 40a55f1 oeqa/selftest/buildoptions: test read-only-rootfs f64fdd2 oeqa/selftest/sstatetests: verify more variables don't impact the hash ac347da gobject-introspection.bbclass: wrap comments at 80 columns ae63b88 qemuarm64.conf: don't clear MACHINE_FEATURES cad415d sanity.bbclass: allow customizing config file update error messages 96a5cb4 sanity.bbclass: fix success message when config file was updated 805aca8 sanity.bbclass: expand error messages for version checks 7d6801c lighttpd: fix /usr/lib/mod_cgi.so: undefined symbol: chunkqueue_written 5f7b9f0 valgrind: Disable nios2 support aaaccc4 systemtap: Disable nios2 support 5857b20 lttng-modules: Add nios2 support 26248cd kexec: Disable on nios2 3e4d99b packagegroup-core-sdk: Disable sanitizers for nios2 797ffc8 bdgwc: Backport nios2 support 238e2c1 libatomic-ops: Backport nios2 support 7e83af3 selftest/buildoptions: Renamed one test case 0d9f515 python-numpy: Fix build on musl e1f3f4c socat: Access c_ispeed and c_ospeed via APIs bb4e6e0 watchdog: Disable nfs on musl targets f00cca8 bdwgc: Check for getcontext() API during configure 51464e7 devtool: change config symlink name to .config.new 8c0148f systemd: Fix and expand ptests 427e369 oeqa/utils/testexport.py: add functionality for exporting binaries 2191623 init-live : make it easier to add custom boot targets 57a525c useradd_base.bbclass: replace retry logic with flock 5d06f00 image.bbclass: track ROOTFS_POSTUNINSTALL_COMMAND in do_rootfs vardeps 6129d86 eudev: split eudev-hwdb from eudev 9aa27fe openssl: don't move libcrypto to base_libdir 370419e xcb-util-image: Fix build with clang 8727975 musl: Update to get mips64 port 4653fdd dhcp: enable gentle shutdown e382d96 coreutils: fix reporting 'unknown' by `uname -p' and `uname -i' 3b8cd1d ncurses_6: Improve installation 9cc65ed Revert "selftest: Added MACHINE = "qemux86" to tests that use runqemu" 3c5ee61 busybox: Drop -r passthrough patch 2c666af linux-yocto/4.1: usb: add usb_otg_caps to usb_gadget structure. 8dc9162 linux-yocto/4.1: Intel Broxton and Sunrisepoint-H: pinctrl and drm 99ad4c9 linux-yocto/4.1: powercap/RAPL: Backport powercap/RAPL c4f544e linux-yocto/4.1: Thermal: Enable Broxton SoC thermal reporting device 123c2c6 linux-yocto/4.1: usb backports for Apollo Lake/Broxton 600b700 recipetool: create: don't create extra files directory unconditionally 8debfea local.conf.sample: Disable prelink by default efa0881 oeqa/selftest/recipetool: Fix test_recipetool_create_simple c9d269c Revert "packagegroup-core-x11-sato: add python-pygobject and gtk+3" d24a39a oeqa/recipetool: Fix syntax error 55a1e52 oeqa/recipetool: Improve debugging output by adding dirlist 637b3c8 uninative: Add a fix for icu-native to use the correct ABI 9dbfbe9 scripts/oe-selftest: Add short names to most common options 681a452 gcc: Fix the license on GNU OpenMP 15c5b2a Revert "gcc: Fix the license on GNU OpenMP" d5cdb48 perl: fix missing dependency for perl-misc 0eb52b9 classes/buildhistory: record a few more variables for extensible SDK cbb4c5b package-deb: Ignore circular dependencies fcc7ff0 package_deb: Fix python runtime error 9155b24 python-numpy: fix buildpaths QA issue 9e69963 python: move ast module into python-core 1a35166 xserver: require sufficiently new libdrm 36bf666 package_manager.py: Fix race condition in OpkgIndexer.write_index() 35be679 scripts/oe-selftest: Add search expression matching to run/list options 4489ef1 glib-2.0: relocate the GIO module directory for native builds cf3402e image-buildinfo.bbclass: fix performance problems e2fe28c linux-yocto/4.4: gpio-pca953x: add "drive" property 3d45853 python3: fix do_configure check platform triplet error 03b167d ncurses_6: Fix an install race condition 09eab6b build-appliance: make the inclusion of downloaded sources optional 8ea5cdc builder: remove hob from autostart ff5d9f7 Revert "gstreamer1.0-plugins-XXX: move inherit gettext into common .inc file" c99da8d musl: disable building of gobject introspection data 0dea50e machine/include/arch-x86: Make x32 ABI not supporting gobject-introspection-data 8c14c74 bitbake.conf: add 'gobject-introspection-data' to DISTRO/MACHINE_FEATURES_BACKFILL 2e27994 packagegroup-core-x11-sato: add python-pygobject and gtk+3 8b1fa2a webkitgtk: enable gobject introspection 7bd32b9 recipes-gnome: fix introspection support efd37c5 python-pygobject: update to 3.18.2 ff3500b gnomebase.bbclass: do not disable gobject introspection ac5cc0c gstreamer: enable gobject introspection 03cd714 libsoup-2.4: enable gobject introspection c1d67e4 clutter: enable gobject introspection 0ec412b gtk+3: enable gobject-introspection d6f8028 gtk+: enable gobject introspection 0d1e4b2 avahi: enable gobject-introspection d2e0dc1 python-pygtk: remove the recipe 0c6d7cb avahi-ui: remove the dependency on python-pygtk by disabling avahi-discover 4fbf761 vala.bbclass: remove pre-packaged vapigen.m4 from tarballs 235455d vala: enable the use of vapigen by packages with vala support d1b96f1 gobject-introspection.bbclass: add a class that enables gobject introspection 96b5847 gtk-doc-stub: remove introspection stubs 3a1d9fb gobject-introspection: Override GIO_MODULE_DIR when scanning 10e9977 gobject-introspection: add the recipe 3c66619 bitbake: fetch2/npm: fix ud.registry so that alternative registries can be handled 0155472 ref-manual: Updated "Application Development SDK" section. 4438460 ref-manual: Applied review edits to several SDK variables. 3c727ff ref-manual: Updated "Cross-Development Toolchain Development" section. af1517c ref-manual: Updated "Build History SDK Information" section. d9fc04b dev-manual, mega-manual: Updated "Application Development SDK" section. 357aa33 ref-manual, mega-manual: Updated "SDK Generation" section. 54490c0 ref-manual: Added several extensible SDK variables to glossary. 6dfd441 ref-manual: Updated IMAGE_PKGTYPE variable. 77f002c ref-manual: Updated "Cross-Development Toolchain Generation" ee90cc6 ref-manual: Updated the "Build History SDK Information" section. 53dd8a0 dev-manual: Moved "Optionally Using an External Toolchain" to Tasks chapter. 9d76cfe meta: toolchain-shar-relocate.sh: Fix for extracting SDK in the same directory as SDK script. 054abad nettle: The variable named p in the patch file was incorrectly named. 93a5417 valgrind: Make dep on glibc-utils conditional on TCLIBC = glibc 40c9774 make 4.1: fix segfault when ttyname fails 7f27713 gcc: Disable libitm for MicroBlaze 81d58d6 sign_package_feed: add feed signature type 42f612c package_manager: sign IPK package feeds c637783 signing-keys: create ipk package 14e809e gpg_sign: export_pubkey: add signature type support 0b088e0 gpg_sign: detach_sign: fix gpg > 2.1 STDIN file descriptor 2fccd8a gpg_sign: add local ipk package signing functionality 6bd6a2b systemd: add comment stating that resolved needs gcrypt a5fd57d selftest/bblayers.py: Remove harcoded recipe files dce7290 selftest/prservice.py: Sanitize package version when looking for stamp cbd87f3 lsof: update UPSTREAM_CHECK_URI 57fb05a eudev: provide UPSTREAM_CHECK_URI 3f8d5bf toaster.bbclass: show packages that were setscened into existence too 39e1351 gcc: Fix the license on GNU OpenMP c6aeef3 linux-yocto/4.4: Galileo updates 37b61b0 siteinfo: Add ppc64le support. 0265fcc nettle: disable static for 2.7.1 8660cd1 nettle: Security fix CVE-2015-8804 dae5715 nettle: Security fix CVE-2015-8803 and CVE-2015-8805 24aea3a glib-2.0: silence warnings when parsing headers for introspection 3331992 qemu: Limit paths searched during user mode emulation b578a06 image-mklibs: handle position independent binaries c706b5e libpam: define limits.conf as CONFFILES of package libpam-runtime 82dec46 perl-rdepends: Remove circular dependencies 815c36f rpm: Sync CVS to regular version 775f22e rpm: Fix musl integration with RPM5 001bdef gcc: Disable libitm for nios2 d53413d bitbake: server/process: Try connecting 4 times before giving up 0f01059 bitbake: toaster: models List only have the specified project's imported layers 0dcab02 bitbake: toaster: rework task buildstats storage and display cc74a8a bitbake: toaster: use force_bytes to display non-ascii project names aebc22d bitbake: fetch2: Make SRC_URI[md5sum] and SRC_URI[sha256sum] expand their values d405f97 bitbake: xmlrpc: fix bug in setting XMLRPCServer.single_use c50bdb3 bitbake: fetch2/npm: add missing URL argument to ParameterError fbf27c4 bitbake: fetch2/npm: properly handle npm dependencies ef6a451 bitbake: fetch2/npm: fix errors with some version specifications ad50ce9 populate_sdk_ext: Correct commit 8b81bb56c69aabdea984352f8e267a9783c0bdbc bc0e99d recipetool: create: shrinkwrap and lockdown npm modules 309b2e6 recipetool: create: support creation of additional files by plugins 2279eb2 recipetool: create: check if npm available if npm:// URL specified 9145500 recipetool: create: split npm module dependencies into packages d46827c recipetool: create: add license file crunching 3fd244b recipetool: create: match *LICENSE* as a license file 2b6a352 recipetool: create: improve mapping for autotools program macros 1607fac recipetool: create: be more tolerant of spacing in configure.ac 9dca5c8 lib/sstatesig: skip shared_workdir when checking locked sigs 142bad3 python3: fix patching get_python_lib() in distutils/sysconfig.py 50d07e9 python3-native: use the previous version of python-config script 5dce2e3 qemu.bbclass: add qemu_wrapper_cmdline() 8b5afcd db: remove the NO_UPDATE_REASON and replace it a comment about RPM 5699c67 rpmresolve: It is not necessary to manually specify -lpopt 8ea55ba rpm: A number of the patches have been submitted upstream 6833c5d rpm: Enable specific crypto and digest settings via variables 59a4d99 security_flags.inc: Special flags are needed for RPM 007c284 rpm: Uprev to rpm-5.4.16 (pre) and rpm-5.4+cvs to current CVS head a27ca6d yocto-bsp: Update templates to 4.4 kernel 2d0933c conf/distro/include: drop old recipes 1fd183e bblayers.conf.sample: remove BBLAYERS_NON_REMOVABLE 477b8fb poky: Enable uninative 1b7cc9c linux-yocto/4.4: explicitly enable ftrace in tracing fragment aee7482 linux-yocto/4.4: iwlwifi: mvm: don't allow sched scans without matches to be started 2408f49 linux-yocto/kernel-meta: ktype refactoring: move DEBUG_KERNEL, EXPERT and EMBEDDED 9ac029b xmlto: tell xmlto where cp is 6d89b52 toaster.bbclass: improve how we gather buildstats for Toaster 4dd3e40 image-prelink: use STAGING_*_NATIVE variables 2193e9d strace: Backport fixes for compiling with clang ee8ff42 ghostscript: 9.16 -> 9.18 3f5725c fontconfig: Revert changes made to FcConfigAppFontAddDir() recently 433d866 populate_sdk_ext: Make populate_sdk_ext nostamp e186d6d systemd: binfmt should be added to SYSTEMD_PACKAGES only if binfmt is enabled b051a95 license.bbclass: fix host contamination warnings for license files f8a9774 oeqa/selftest/buildoptions: Test build does not fail without git rev 656aeff busybox.inc: add tail symlink so busybox can commit suicide cleanly a321f4e avahi-ui: add dbus to PACKAGECONFIG 1bd4b72 avahi: add missing intltool-native build dependency 72f9e39 avahi: make dbus optional but default 424466b oe-setup-builddir: tidy up local.conf and bblayers.conf commentary 07919e9 net-tools: Add SCTP option support e8254bc tune-corei7.inc: Fix PACKAGE_EXTRA_ARCHS for corei7-32 5346675 eudev: remove redundant udev_run assignment adad264 xcursor-transparent-theme: use a version glob in the selftest bbappend 946d00c populate_sdk_ext: Update after uninative changes ba57ba1 image.bbclass: support chaining compression (aka conversion) commands 5ac3dc7 image.bbclass: fix incomplete .rootfs customization 3322fa7 bitbake: toasterui: fix warning 'Unknown event' 621cbc8 bitbake: toasterui: exit on final events 8e138b7 bitbake: toasterui: make toasterui to work in build mode 0a61306 bitbake: toasterui: check if setEventMask succeeded ac941ac bitbake: command: make setEventMask readonly dd3da9a bitbake: toasterui: update list of events f56fa5d bitbake: toasterui: reformat list of events a71d32a bitbake: toaster: remove sshbecontroller module 3db71b4 bitbake: toaster: don't use sshbecontroller 790b2d1 bitbake: toaster: raise NotImplementedError 96535ba bitbake: toaster: bring back the strict directive 5b8b399 bitbake: toaster: change 'revision' to 'Git revision' 07ead98 bitbake: toaster: views api Package info return both kinds of RDEPENDS 9cda2ab bitbake: toaster: fixup dependency excludes for customimage a54cebe bitbake: fetch2/npm: ignore unknown headers in tarballs 0cd1be1 bitbake: fetch2/npm: handle alternative dependency syntax d999927 bitbake: fetch2/npm: fix indentation 26ee4dd image creation: allow overriding .rootfs suffix e43fcdf scripts/hob: drop 59b4cef classes/packageinfo: remove bbf2a5d conf/documentation.conf: remove BBLAYERS_NON_REMOVABLE 7054882 yocto-uninative: Add common include for uninative d2c96ca mtools: Drop GCONV_PATH manipulation d27644e uninative: Handle relocate of GCONV_PATH in libc 0523499 uninative: Add checksum support 73265d1 uninative: Refactor common code 4feb00d uninative: Use CXX11 ABI for interoperation between gcc4 and gcc5 013dd24 uninative: correctly enable uninative 034618d glibc: Add relocation of GCONV_PATH 8dca343 uninative-tarball: Add glibc-gconv-iso8859-1 for guile 1f50f29 dkpg: Use tar everywhere (not gtar) b158d6c gtk3+: Add missing DEPENDS on wayland-native e395e81 tune-cortexa17.inc: apply changes similar to a15 ea53d1e sstate: Allow late expansion of NATIVELSBSTRING bd3a1d5 linux-yocto: Update SRCREV for genericx86* for 4.4 70c6df2 linux-yocto: Update SRCREV for genericx86* for 4.1 ae85c4b linuxloader/image-prelink/image-mklibs: Fix non-standard path prelinking 0b84897 insane/prelink: Handle nonstandard library paths 6b564ae ext-sdk-prepare: Catch setscene tasks which should have run but didn't d8efd2e createrepo: Fix stat floating timestamps ce5a9df xmlto: ensure /bin/bash is used as bash 70b4f36 openssl: add a patch to fix parallel builds 1632742 xdg-utils: remove trailing whitespace in multiline string 816391a btrfs-tools: Add libgcc to RDEPENDS e467156 bitbake.conf: Add libgcc-native to ASSUME_PROVIDED a91713f net-tools: Override CFLAGS/LDFLAGS in do_install too fb0c3c5 nspr: Fix build regression on musl from last upgrade 37f5fb9 gdb: fix builds with internal readline and no static libraries 6518db4 feature-arm-thumb.inc: Fix thumb tune override warning afb1d09 recipetool: create: fix support for AX_CHECK_LIBRARY 463fd5e formfactor: assume a keyboard is plugged in e2107f5 acl: Fix re pattern in test cases 82a8064 gcc-runtime.inc: disable libitm for little endian MIPS too 25d9c4e devtool: add build-sdk subcommand 41eb36d devtool: build-image: rename module 82d0c8a oeqa/buildoptions: Improve unsafe references tests 4284fdf insane.bbclass: make the checking stricter for unsafe references in scripts 5cd71fe yocto-project-qs: Updated flow to mention Toaster cd041b7 dev-manual: Applied review comments to the devshell section. f54fe56 ref-manual: Updates for nativesdk clarifications. a882267 dev-manual: Fixed typo in the devshell section. 70c7e36 dev-manual: Created devtool upgrade section. b2b22d5 dev-manual, mega-manual, Makefile: Added support for new upgrade flow 0b7d8a4 dev-manual, mega-manual: Updated the workspace directory structure image 050e021 dev-manual: Applied review changes to the devtool section. 09ecf38 dev-manual, mega-manual: Updated three figures for devtool f33ffaa dev-manual: Applied more review comments to the section. fe70eb2 dev-manual, mega-manual: Updated the devtool modify flow diagram. eb3b414 dev-manual, mega-manual: Updated the devtool add flow diagram. 4c5bd3f dev-manual, mega-manual: Updated the devtool workspace figure. 9cee16b dev-manual: Applied review comments to the devtool section c678d1a dev-manual: Updated the devtool add section. a09238a dev-manual, mega-manual: Updated devtool add flow diagram 7699f0a dev-manual: Added section for devtool modify flow 1eecaea dev-manual, mega-manual: Added new figure for devtool modify flow 9582da6 dev-manual: Edits to the devtool-add section. 740369f dev-manual, mega-manual: Updated the devtool add flow figure a848e9f dev-manual, mega-manual: Updated the workflow layer content figure. 34e08b3 dev-manual: Added new "writernotes" style. 17a21e6 Makefile, dev-manual, mega-manual: Added new figure support d346c35 dev-manual: Applied review comments to devshell section. 3b41049 ref-manual, dev-manual: Clarifying "native" and "sdknative" a1970eb dev-manual: Updated devshell section. a58cde0 toaster-manual: Updated how manage.py createsuperuser command is run c5b4f69 ref-manual, dev-manual: Clarification of "native" and "sdknative" 952bcc7 toaster-manual: Removed prompts for json file. 34c75fa ref-manual: Updated the S variable description with feedback 2b2ced0 ref-manual: Updated the staging.bbclass description b9dddd5 ref-manual: Updated the S variable description. 41e9f7c dev-manual, ref-manual: Updated licensing text information. 5066fbc ref-manual: Added order information for conf file parsing. ad6b2f2 toaster-manual: Removed typo - double "allow" words. c8c533e ref-manual: Updated the do_populate_sysroot task. 2a3942b dev-manual: Updated section on adding license text. 77b3d06 ref-manual: Updated the S variable entry in the glossary. a1a4808 toaster-manual: Applied a patch to weed out build mode (modes). 353b755 bitbake: bitbake-user-manual: Added expand() function to list. 638ad17 bitbake: bitbake-user-manual: Added note for Python variable ref expansion. da22add bitbake: bitbake-user-manual: Enhance environment variable discussion. f11de9d e2fsprogs: do not enable non-stable features by default b04280a sdk_update.py: Enable local sdk-update tests 14dd07c sdk.py: Fix undefined variable c12e919 eudev: recipe formatting improvements 73a43fc openssl: Security fix Drown via 1.0.2g update ed14aef layer.conf: Update after replacement of udev with eudev e72233a bootimg: set default value for LABELS variable 4eaef67 sanity: Do not mistake meta-yocto-bsp for meta-yocto 86759de sanity.bbclass: remove conflict checking for image vm and live bb1c719 syslinux.bbclass: make vm and live can be built together 5c5c13d recipetool: create: add basic support for new npm fetcher/class 2be37a9 recipetool: create: add basic support for generating linux kernel recipes 5cf15ff recipetool: create: add support for out-of-tree kernel modules 937ecd0 bitbake: toaster: cleanup of bin/toaster startup code a7d1b95 bitbake: ui: remove the puccho ui a9dc72f bitbake: hob: removal of hob ui and associated ui files 27468db bitbake: fetch2/npm: Add missing ParameterError import 44e3461 bitbake: npm: in cases where shrinkwrap resolved a git URL, ignore it and grab dist.tarball 2a73181 bitbake: fetch2: Fix unpack for absolute file urls 865d2fe bitbake: fetch2: fixes copying of file://dir; subdir=foo, bug 6128 and bug 6129 fb437d3 meta-yocto-bsp: bump to linux-yocto 4.4 for the non-x86 BSPs fbedac4 maintainers.inc: Add new eudev package and change maintainership for udev 0138874 gcc: Add support for atomic opertions (libitm) where available 70153b4 classes/externalsrc: fix symlinking if symlink exists pointing to another path eac4061 populate_sdk_ext: Only write LCONF_VERSION to bblayers if it is set c366343 automake: don't delete .pyc files d6e63be cracklib: fix Python packaging a005d25 populate_sdk_base: handle empty SDK_PACKAGING_FUNC ec3be9f linux-yocto/4.4: update to 4.4.3 6ed16ff linux-yocto/4.1: iwlwifi: mvm: don't allow sched scans without matches to be started 2497e80 linux-yocto/4.4: update to -stable 4.4.2 aa2c1f7 linux-yocto: braswell: Remove feature and move DRM_I915_PRELIMINARY_HW_SUPPORT option 702701d linux-yocto/4.4: yaffs2 build fixes c2152b8 linux-yocto/4.1: update to 4.1.18 45d4cd7 linux-yocto/4.1: clkdev updates 79ecef6 linux-yocto/4.1: Galileo updates 5f61693 usbutils: Fix for new eudev implementation c89b777 libgudev: Fix for new eudev implementation 3e5e540 eudev: Replaces udev with eudev for compatibility when using sysvinit on newer kernels 674e55f populate_sdk_ext: Delete the buildtools tar file after installation d8acef2 libarchive: Set xattrs after setting times 431c1e1 combo-layer: handle empty commits during "init --history" 695cc45 classes/populate_sdk_ext: prepend to PATH rather than appending b145480 classes/module: allow substitution of the modules_install target name b03936c grub2.inc: drop bogus dependency on xz 7328765 grub2.inc: avoid passing -isystem to native builds 576587d grub2.inc: dont export TARGET_CFLAGS etc to grub2 configure 97a3322 harfbuzz: update 1.2.1 -> 1.2.3 edf93a0 gstreamer1.0-plugins-bad.inc: limit ARM_INSTRUCTION_SET over-rides to armv4/armv5 89140b0 dhcp: CVE-2015-8605 6ccd8cd sato/images: Add ptest image f38debb layer.conf: Whitelist cantarell-fonts fontconfig dependency b307937 pango: make ${PN}-ptest RDEPENDS on cantarell-fonts 0c80f29 cantarell-fonts: Add recipe 4006a7f sanity: Fix int verses string reference 2e27c4b bitbake: fetch2/npm: Enable fetcher 1c060d7 pseudo: Increase number of retries 030d920 bitbake: providers: Fix PREFERRED_VERSION lookup for '_' in PN c679a3d bitbake: fetch2: Skip lockfiles and donestamps for local files d01042e bitbake: fetch2/__init__.py: Error if lockfile path invalid ab7b7bf bitbake: fetch2/__init__: Fix decodeurl to better handle urls without paths 06b4d8f bitbake: fetch2/wget: Set localfile for directories 8d7e799 genericx86-common: Update PREFERRED_VERSION_linux-yocto to 4.4 65d6a62 gstreamer1.0-plugins-bad.inc: enable webp PACKAGECONFIG by default cd00748 gettext: Delete libintl.la file from install b33efa9 systemctl: handle RequiredBy dependencies 8caa592 ffmpeg: add bzlib, lzma and xv PACKAGECONFIGs 0011760 rootfs-postcommands: fix ssh_allow_empty_password checking 96f5f89 musl: Add linux-libc-headers to deps 3354878 mesa: Fix build on musl 7651342 dosfstools_2.11: fix build following removal of -e from EXTRA_OEMAKE 6c8abea uclibc support for rng-tools c7e5a38 oeqa/sdkext: Add sdk_update.SDKUpdateTest class. 738bd1a classes/testsdk: Pass tcname to SDK and SDKExt contexts 2a410b2 classes/testsdk: Move the removal of bitbake PATH to eSDK context only eb1f8b9 classes/testsdk: Move code for avoid PATHs to oeqa.utils 55d4849 gstreamer1.0-plugins-XXX: control orc PACKAGECONFIG via GSTREAMER_ORC 083c63d boost.inc: fix BJAM_OPTS --build-dir option f4e17c6 shared-mime-info: update to 1.6 4ffdfdf vala: update to 0.30.1 f53f374 python-git: update to 1.0.2 ec73437 pax-utils: update to 1.1.5 447ddb9 nettle: update to 3.2 26a3d25 ncurses: update to revision 20160213 dc42d30 libdrm: update to 2.4.67 0296e0a gtk+3: update to 3.18.8 e08ad62 gtk-icon-utils-native: update to 3.18.8 9daf153 git: update to 2.7.2 927dfaf gnupg: update to 2.1.11 2c39358 clutter-gst-3.0: update to 3.0.16 b8a1e59 ccache: update to 3.2.4 4d4aa1f libsolv: update to 0.6.19 8c2e420 ffmpeg: update to 3.0 afce247 nspr: update to 4.12 b19dbe5 pcmanfm: update to 1.2.4 6b41608 libfm: update to 1.2.4 325a9d3 epiphany: update to 3.18.4 d4da534 wic: don't throw away our created swap partition 5f82d17 automake: set test-driver path relative to top_builddir b41862d uninative-tarball: respect SDKMACHINE when building 4d1c14f boost.inc: enable more verbose build logs 7f84ad0 gstreamer1.0-plugins-XXX: move inherit gettext into common .inc file 2ce48e6 gstreamer1.0.inc: add explicit PACKAGECONFIG init 935d88a gstreamer1.0-libav: move LIBAV_EXTRA_CONFIGURE_COMMON_ARG into .inc 3a8ff19 gstreamer1.0-libav_git: add --ranlib option to LIBAV_EXTRA_CONFIGURE_COMMON_ARG b8bdb99 boost.inc: limit ARM_INSTRUCTION_SET over-rides to armv4/armv5 9ca8f30 populate_sdk_ext: Add images to SDK_INSTALL_TARGETS 07dc765 boot-directdisk.bbclass: drop IS_VM chechking a87574c image-live/boot-directdisk.bbclass: remove AUTO_SYSLINUXCFG 76eb815 testimage.bbclass: reuse generic test suites 6571a84 testimage.bbclass: add generic, image test suites 8c45747 gconf: remove redundant dependencies a74c389 gtk-doc-stub: don't inherit autotools 2269f90 os-release: sanitise VERSION_ID field 9d86b26 apr-util: add ldap crypto and sqlite3 to PACKAGECONFIG d8d2f57 apr-util: fix loadable module packaging 77cfa2b glibc.inc: improve optimisation level sanity checking 04c4719 rsync: add native variant 2c20fe4 core-tools-profile: add lttng tools for aarch64 8a0b997 lttng-ust: add support for aarch64_be 6081c35 liburcu: add support for aarch64_be 07a3c71 harfbuzz: add explicit dependency on fontconfig 73cc8b8 harfbuzz: update 1.2.0 -> 1.2.1 bb151b8 fontconfig: Don't add font directories from host e9f5134 musl: Upgrade to 1.1.14 bf4d380 oe-selftest: devtool: add an additional test for devtool upgrade 4bae2f2 oe-selftest: devtool: rework devtool upgrade test 10290f2 devtool: upgrade: print new recipe name 5cd3be3 devtool: upgrade: drop PR on upgrade e6f684b devtool: upgrade: eliminate unnecessary datastore copy 860574e devtool: upgrade: fix several issues with extraction of new source 66a781c devtool: upgrade: fix constructing new branch from tarball releases d30cc76 devtool: upgrade: fix renaming of recipe if PV is not in name 75eeeab devtool: upgrade: fix moving version-specific files directory 81ebb0b devtool: upgrade: fix version argument checking e953b57 devtool: upgrade: drop superfluous call to validate_pn 492b1eb devtool: upgrade: make source tree path optional 942ae25 devtool: modify: fix source tree default name when mapping virtuals e2334e1 devtool: add: tweak auto-determining name failure message 55ae566 uninative.bbclass: if the loader can't be found disable instead of failing 50b8740 uninative: use check_output instead of Popen directly 4495e8b lib/oe/qa: add explicit exception for 'file isn't an ELF' 4553bb1 libdrm: fix build with uclibc 4e5a871 strace: fix ptest execution e8e0489 clutter-1.0: Fix confgure test errors found by clang b748f40 oeqa/parselogs: Updated whitelist 4b32351 buildstats.bbclass: Don't assume /proc/<pid>/io present 07e1f10 sysvinit-inittab: Move start_getty scrip to base_bindir. 8d07e14 oeqa/selftest/prservice: Added new TC: check pr-server starts and stop correctly on localhost. d2a563c oe-selftest: Add support for lib/oeqa/selftest subdirectories 7f58b92 musl: Upgrade to 1.1.14 73bf792 devtool: update-recipe: create config fragment 2fbd1d7 devtool: sync: update kernel config 26f951b git: fix installed-vs-shipped QA Issue 033db24 btrfs-tools: fix symlink creation multiple times 9af773f bison/gettext: add --with-bisonlocaledir to assign BISON_LOCALEDIR b14e2ae gcc: use relative path for configure script 1f00fb2 depmodwrapper-cross: nopackages to avoid QA [buildpaths] issue 00a6f5a oeqa/utils: added new network module 3f7aa6f scripts/oe-selftest: Use site.USER_SITE to run coverage configuration code for sub-process 1c6c76e scripts/oe-selftest: Add filtering to the coverage data gathered by oe-selftest 4a21827 oeqa/selftest/signing: Added test for locked signatures 604dc1c package: check inherit instead of PN to decide if a recipe is a packagegroup b4df005 tune-cortexa9.inc: add vfpv3 tunes 889a5cc mirrors/own-mirrors/sanity: Updates after npm fetcher addition 28d17cf npm.bbclass: Add npm class to match fetcher bc5a1d1 base: Add nodejs-native dependency for npm:// urls 9d5483c meta-yocto: Rename to meta-poky to better match its purpose ab3a718 adt-installer: Drop since its replaced by the extensible SDK c1c6a9d sanity: Improve configuration upgrade capabilities (support meta-yocto -> poky transition) 2587101 image: Run do_rootfs_wicenv after do_image e0fd964 bitbake: toaster: change 'delete layer' to 'remove layer' 6e82820 bitbake: toaster: rename 'run again' button c8dd72c bitbake: toaster: fix banner after customimage package add 149f574 bitbake: toaster: custom breadcrumb for the default project 4a12865 bitbake: prserv: Add dump_db() bdb51ab bitbake: toaster: remove custom images from Image Recipes 98d462c bitbake: toaster: show suffix for image files and basename for artifact files 88b5660 bitbake: toaster: add missing link to image recipe details 25b179d bitbake: toaster: adjust the search field width a97081b bitbake: toaster: make 'configuration' the first tab e1fc319 bitbake: toaster: link to configuration in all breadcrumbs df2808f bitbake: toaster: reduce max height of modal dialogs 6c51f08 bitbake: toaster: disable add layer button on click d4a663a bitbake: toaster: apply error class to name field 48f0ae2 bitbake: toaster: fix custom image name form 07eb4f2 bitbake: toaster: comment out project release change 12ade9b bitbake: fetch2/npm: Add mirroring support for npm fetcher ca5b6d6 bitbake: fetch2/npm: Add npm fetcher 813bd1f bitbake: utils.py: Add sha1_file call 7bb9e8d signing-keys: Make signing keys the only publisher of keys 64ab17b systemd: Upgrade to 229 44248af harfbuzz: update to version 1.2.0 f4f5573 perf: add sysroot handling to subcmd 7a95c2c oeqa/selftest/buildoptions: build -minimal instead of -sato images 2980ac0 bitbake.conf: add findutils-native to ASSUME_PROVIDED 2e152ff findutils: upgrade to 4.6.0 951ce18 mesa: add missing space to RRECOMMENDS append 2305610 uclibc: Do not use immediate expansion operator aab3900 security_flags: Disable ssp when compiling uclibc afb954e rpm: fix building rpm 5 with internal beecrypt 069cdbe alsa-lib: topology: Add missing include sys/stat.h b879aed libsdl2: Fix patch after upgrade 3d4f71d gstreamer1.0-libav_git: update 1.7.1 -> 1.7.2 9d83a3e gstreamer1.0-plugins-ugly_git: update 1.7.1 -> 1.7.2 6456a6f gstreamer1.0-plugins-bad_git: update 1.7.1 -> 1.7.2 821498f gstreamer1.0-plugins-good_git: update 1.7.1 -> 1.7.2 04e77c1 gstreamer1.0-plugins-base_git: update 1.7.1 -> 1.7.2 e67c91d gstreamer1.0_git: update 1.7.1 -> 1.7.2 ea8c34e libnewt: Fix build with PIE flags 66a833a pseudo: Fix build when security flags are enabled 91a1baa glibc: Upgrade to 2.23 c1f9507 no-static-libs: remove eglinfo 0ab67d6 freetype: use autotools instead of a manual do_configure 4883ccc classes/populate_sdk_ext: add a better config extension mechanism 524ee08 recipetool: create: improve CMake package mapping 7b6e5b0 recipetool: create: add additional extension mechanisms b2d4472 devtool: modify: tweak help description for behaviour change a8e0e5e devtool: deploy-target: preserve existing files 2059a34 devtool: undeploy-target: support undeploying all recipes b95c72c devtool: deploy-target: write deployed files list to target 62989ef devtool: sdk-update: tweak command-line handling of updateserver cada5a8 devtool: (un)deploy-target: add help descriptions 6bd88e6 scripts/lib/argparse_oe: tweak title above options 32ef523 devtool: categorise and order subcommands in help output 9f7df76 devtool: update-recipe: don't show workspace recipe warning if no update 51972ed devtool: reset: fix preserving patches/other files next to recipes e54f9c1 devtool / recipetool: use common code for launching editor dd35f69 devtool: minor fix for error message 41242a2 staging.bbclass: remove trail slash from SYSROOT_DESTDIR aeb8964 terminal.bbclass: import oe.terminal for oe.terminal.prioritized() bee556a recipe_sanity.bbclass: skip DataSmart in recipe_sanity_eh() 2d293bd image.bbclass: fix circular dependency when IMAGE_FSTYPES append hddimg a332360 toolchain-scripts.bbclass: add three other path to PATH in env.sh 4d2910f libsoup-2.4: disable libsoup-gnome by default 619f6c6 libsoup-2.4: prevent PACKAGECONFIG dependant package renaming 13e726f libsoup-2.4: minor formatting improvements dd0ef3c populate_sdk_ext.bbclass: Add SDK_RECRDEP_TASKS variable 4c5c40d devtool: Don't recursively look for .devtoolbase in --basepath 0220180 populate_sdk_ext: Don't ignore SDK_TARGETS value 8c0ba8d bitbake: toaster: toastergui Fix invalid char test and implementation 913e9b1 bitbake: toaster: PackagesTable show only installed packages 94bca58 bitbake: toaster: toastergui unit tests convert to use fixtures 8796ac8 bitbake: toaster: SoftwareRecipesTable apply default order_by 8469e58 bitbake: toaster: orm migrations Sort out migrations mess 78b6109 cml1/sstate: Fix missing getVar parameter 7e19f88 linux-yocto/4.1: capabilities backports 54bfbcc waf.bbclass: Remove --disable-static from EXTRA_OECONF 51fc304 gcc-5.3: backport fix for PR-target-65358 ed20c6c epiphany: Add libxml2-native to DEPENDS 2021f63 libsdl2: update to 2.0.4 947b3bf cmake: Update to 3.4.3. 4699483 sstate.bbclass: use oe.gpg_sign for gpg signing db7c7c2 oe/gpg_sign: add 'passphrase' argument to detach_sign method e845b75 sign_rpm.bbclass: do not store key details in signer instance d5be866 oe/gpg_sign: add 'armor' argument to detach_sign() 03554b7 oe/gpg_sign: add verify() method af7e516 ruby: break out ri-docs and rdoc into separate packages 8bcf139 insane.bbclass: print more info for build-deps and file-rdeps 5f3dfea curl: re-enable proxy support by default 1f61888 libtool: Don't hardcode grep paths a3b996a cml1.bbclass: fix do_menuconfig 91bfe50 cups: upgrade to 2.1.3 eeac0a9 coreutils: upgrade to 8.25 01dc859 findutils: upgrade to 4.5.19 bf7d5f6 diffstat: upgrade to 1.61 247f3b4 grep: upgrade to 2.23 4e5e501 bitbake: data_smart: Drop default expand=False to getVarFlag [API change] c7610aa bitbake: data_smart: Drop default expand=False to getVar [API change] 4f0ab27 bitbake: SignatureGeneratorBasic: make checksum cache file configurable 0cdf193 bitbake: MultiProcessCache: make cache filename configurable ca552bb bitbake: FileChecksumCache: add get_checksums() method 8f61f2d bitbake: bb/runqueue: save task file dependency cache onto disk 5177b1e bitbake: SignatureGenerator: add method for saving the file checksum cache 97617fd bitbake: bb/cache: drop some unused arguments 5a87d8c bitbake: Allow Hob to run images on a custom simulator, other than qemu 7fc38ea gma500-gfx-check: Fixes infinite calling to modprobe gma500_gfx be7b52a pulseaudio: 6.0 -> 8.0 c52b8f6 alsa-plugins: 1.0.29 -> 1.1.0 a231a4e alsa-utils: 1.0.29 -> 1.1.0 1adbb73 alsa-tools: 1.0.29 -> 1.1.0 3a82e2e avahi: update to version 0.6.32 14daeb5 no-static-libs.inc: Add libcap-native c001863 libsdl2: Fix build with static libraries disabled a46dc87 uboot-inc: Backport patch to fix Beaglebone Black bootloader c7355b9 busybox: drop patches that are not valid anymore 47d0119 pcmciautils: Update SRC_URI f37ac5b debianutils: Upgrade 4.5.1 -> 4.7 adfcaf2 busybox: Add musl config for _git recipe 46824dc debianutils: Fix SRC_URI to use debian snapshot 3df8701 nfs-utils: bugfix: adjust name of statd service unit c15bf55 musl: Upgrade to 1.1.13+ 07e7879 dpkg: Update to 1.18.4 5794b56 glew: upgrade to 1.13.0. aea0746 glew: rewrite to use upstream build system 0b1c324 socat: Fix build with musl 04c6a48 binutils: Fix useless rpaths QA warning eb6d14e image/populate_sdk: seprate variables to fix dependency c9e5e34 gcc: Backport nios2 r31 fix 012460d sqlite3: update 3.10.2 -> 3.11.0 f770a6e insane: wrap autotools checks in inherits_class(autotools) checks 35011d9 cmake: don't inherit autotools 9cd64ed oeqa/selftest/bbtests: Test bitbake --setscene-only option 7e5b451 glew: don't put our CFLAGS into the pkgconfig file b1145cc dbus: update large file patch fad63e3 coreutils: fix problem with acl for 6.9 version 351039f gcc-4.9/5.3: Ignore -fdebug-prefix-map in producer string 7a11650 bitbake.conf: use target path as compile dir in debugging info ef30119 glibc: Security fix CVE-2015-7547 c834ebc glibc: CVE-2015-8776 842177a glibc: CVE-2015-9761 efa1ae5 glibc: CVE-2015-8779 aefe1fa glibc: CVE-2015-8777.patch 152914f oeqa/parselogs: Whitelist dmi firmware failure message in 4.4 kernels 683ea31 rng-tools: Fix underquoted m4 and libgcrypt floating dependency 7a700f5 lib/qa.py: raise ValueError if file isn't an ELF 334e1b5 lib/oe/qa: ELFFile: check that a path is a file before opening it 11359e9 rng-tools: fix the build with musl a258589 bitbake: bb.ui.knotty: prefix task messages with recipe/task 4bf8b21 bitbake: Move bb.{debug,note,..} into their own logging domain 3b35de3 layer.conf: Add gstreamer1.0-meta-base to SIGGEN_EXCLUDERECIPES_ABISAFE 14e9385 sstate: Add ca-certificates-native to postinst recipes list 73e53e4 nss: define RPATH variable for nss-native 6e4e9f7 Revert "lsbinitscripts: fix the path for mountpoint" 6db39e1 libunwind: Fix build on ppc 47896a7 dbus-glib: 0.104 -> 0.106 93d8fc1 conf/no-static-libs: add explicit rule for libical 637b44c runtime/systemd: Fix for boot time string parse error ef5b8b4 security_flags: Add SECURITY_CFLAGS to TARGET_CC_ARCH for binutils 1387785 binutils: Use tip of 2.26 branch da13f0b buildhistory.bbclass: remove out-dated information on request a56da4a Remove obsolete references to exmap 8b21720 bitbake: knotty: Set exit failure code on runQueueTaskFailed events a9223e2 bitbake: taskdata: Fix traceback issue with missing provider 7593756 bitbake: cooker: Improve cache handling 9cb38c1 poky: Disable static libs by default f852014 bitbake.conf: Remove unhelpful default value for EXTRA_OEMAKE b050c50 apmd: fix build with static libraries disabled d585a71 oeqa: Update to handle domain specific references in build logs 9300749 libpng12: Handle no static libs 67ea65e ed_0.5: Handle --disable-static option 438d6d6 conf/distro/include: Add no-static-libs.inc 2eb19cc classes/buildhistory: fix for python function parsing change 1a3204c valgrind: Fix build with musl e8b0da1 rpm: Fix build with musl 48144e0 gstreamer1.0-meta-base: Mark as machine specific due to COMBINED_FEATURES ff8ca89 gdb-cross-canadian: Add missing virtual/* DEPENDS 120a160 e2fsprogs: Update to upstream version of a patch 5394ada gdb: Rationalise PACKAGECONFIG ce0f8ab insane: Add --disable-static to UNKNOWN_CONFIGURE_WHITELIST 94abdb2 linux-yocto: Work around PAT issue on qemux86 6fb493a libgcrypt: update 1.6.4 -> 1.6.5 bf9ad22 musl: Upgrade to tip of tree 5d156bc oe-selftest: don't use specific tasks 80e8928 oe-selftest: pylinted wic tests 9b6dc9b wic-image-minimal: use uuid for root partition ab7cb65 wic: fix processing of --use-uuid 51e0a8a oe-selftest: add new wic testcase 2100f82 wic-image-minimal: update .wks to boot by qemu 4b26601 wic-image-minimal: change IMAGE_FSTYPES f799e21 oeqa/targetcontrol: support wic image type 7066f16 oeqa/targetcontrol: make ssh control optional 0ade658 qemurunner: add parameter to method 'start' d083fec oe-selftest: remove unused parameter c26a9c3 runqemu: support path/to/<image>-<machine>.wic c7f0578 runqemu: don't set KERNEL for wic images 2c3a009 runqemu: add support for wic images 64d2f13 scripts/sstate-cache-management.sh: Change wording 6740dd5 qemu.inc: Add rng-tools to qemu images ce3df21 rng-tools: Import recipe from meta-openembedded 36b43b2 lib/oe/terminal: set workdir for konsole terminal 03e1950 mmc-utils: upgrade to latest git version b5b8003 ltp: Upgrade to 20160126 and fix build on musl f6b3957 initscripts: start urandom after populate-volatiles 85ac8eb initscripts: populate-volatiles.sh: add mount-bind feature be5b72c libdrm: don't detect components that have been disabled 5fc5996 buildhistory: Fix regex to handle versions without spaces 7c3d4c0 debian: Fix superfluous setting for RPROVIDES 2eba066 autotools: Fix interaction with bitbake -b 9c8fee9 autotools: Correct dependency search logic error 971fafb maintainers.inc: include libjpeg-turbo and mmc-utils 4e0b334 scripts/runqemu-internal: Work around qemux86 PAT bugs in linux 4.4.1 283a302 sanity: Bump minimum version to 1.29.0 1c2d632 bitbake: Bump version post release to 1.29.0 a12dcc4 base.bbclass: fix support for gitsm:// bc72f64 linux-yocto: Update SRCREV for genericx86* for 4.4 be89a1d linux-yocto: Update SRCREV for genericx86* for 4.1 4a8d20a poky: update qemu* to prefer 4.4 kernel d255f4f linux-yocto/4.1: galileo backports and support fdcb373 linux-yocto/4.1: update to v4.1.17 5688cab linux-yocto/4.4: update to v4.4.1 f9f93ae bitbake: cooker: gracefully shutdown parsers 1f7f077 bitbake: buildinfohelper: unset brbe variable when build finishes 9a6cb10 nativesdk-buildtools-perl-dummy.bb: Fix variable expansion in python code 5e978d7 classes/testsdk: do_testsdkext avoid STAGING_DIR/BASE_WORKDIR in PATH f56e9aa freetype: update 2.6.2 -> 2.6.3 1ba1aa3 freetype: minor formatting improvements 0d5e611 piglit: upgrade SRCREV 72c6b62 libbsd: Security fix and update 0.8.2 78be954 gstreamer1.0-plugins-bad_git: fix gst_structure_get() etc compiler warnings fdd8979 gstreamer1.0-plugins-good_git: fix gst_structure_get() compiler warning a23a50e python-setuptools: Add python-compile on RDEPENDS 914ff14 qemu: Security fix CVE-2016-2198 0938353 qemu: Security fix CVE-2016-2197 1f3e1d1 curl: add PACKAGECONFIG options for less common / legacy protocols 19045ba toaster: tests Remove symlinks from toasteruitest folder 738a9b7 classes/sanity: check_perl_modules provide output when fail e64ce73 oe-selftest: devtool: add another devtool add test a5095d1 recipetool: create: set S when we set SRC_URI from local git repo ca5a36c recipetool: create: convert http git URLs that don't end in .git but contain /git/ 4c71afb recipetool: create: ensure URL parameters don't make it into the name 86f3464 devtool: add: fix adding from a local source directory fa50153 devtool: modify: make -x the default behaviour f767757 recipetool: create: determine name/version from github/bitbucket URLs d94c7e3 recipetool: create: support cmake find_library directive ddfe744 devtool: commit for extra tasks that modify source when extracting e36cb6c classes/externalsrc: create symlinks for workdir and logs 20034c3 classes/externalsrc: disable rm_work when active c38f253 uninative.bbclass: capture stdout/err from patchelf-uninative 9065222 db: update HOMEPAGE f0d5478 mdadm: update to version 3.4 79d5041 iproute2: update to version 4.4.0 21e3b2a image_types_uboot: add cpio.gz.uboot to supported IMAGE_TYPES 6fab5fc recipetool.newappend: add -e/--edit argument 252f97e liburcu: Add nios2 support e72ab70 strace: Fix build for arc, metag, nios2, or1k, tile 691277f udhcpc: specify full path for ip command calls f141f0b alsa-lib: avoid including <sys/poll.h> directly a1ad3d0 oprofile: Add nios2 support fd7dd07 nspr: Add nios2 support 954dc45 guile: Fix nios2 support 611e3d8 binutils: Repair nios2 PLT and GP handling 027eac5 gstreamer1.0-meta-base: make gstreamer1.0-plugins-base-alsa conditional 056d82c curl: drop obsolete pkgconfig_fix.patch 0e62f01 iproute2: update to version 4.4.0 216e618 quota: update to version 4.03 25d2956 oeqa/selftest/sstatetests.py: check that PARALLEL_MAKE doesn't change signatures 2966016 bitbake.conf: remove unused ALLOWED_FLAGS 3bdeda5 libproxy: remove GPLv3 logic and spurious exports 86994fd libproxy: add PACKAGECONFIG control for gnome3 033d754 libproxy: replace PACKAGECONFIG equivalent with the real thing e65a29e openssh: Properly skip ptrace test if tools are missing e1a1e0b openssh: Fix regex that sets sftp-server path for tests d7faf67 insane.bbclass: Support MicroBlaze with musl 9937c93 hdparm: Explicitly set EXTRA_OEMAKE as required 7475c4c qemu: Security fix CVE-2016-1568 4857511 xserver-xorg: Add PACKAGECONFIG for crypto libraries 34798fa mesa: upgrade 10.6.3 -> 11.1.1 7edea7c initrdscripts: fix mmc device as install target c3ef2bb libsoup-2.4: Remove unnecessary gnutls dependency 04454b2 wpa-supplicant: Only depend on libgcrypt when needed 4de0ee6 systemd: Don't depend on gcrypt unnecessarily 0da96bf buildstats.bbclass: remove dead URL from comment 326592d Remove obsolete references to exmap a0cc1c3 curl: update 7.47.0 -> 7.47.1 a0d3eb9 sign_package_feed.bbclass: fix task dependencies 8cb1e83 oe/gpg_sign: fix incorrect variable name 902a68f meta/conf/layer.conf: adapt to more flexible initramfs-framework RDEPENDS 5b2b343 tune-corei7.inc: tell qemu to emulate a matching processor 5b70ee4 pixz: fix upstream version check 62a6f97 webkitgtk: update to 2.10.7 1cd6912 libwnck3: update to 3.14.1 e53eef9 iso-codes: update to 3.65 30cf8aa bash-completion: fix upstream version check 8098256 gstreamer1.0: fix upstream check for unstable versions from git c24b0ab ffmpeg: update to 2.8.6 9237097 python: merge python-elementtree into python-xml 5ac4172 piglit: add missing dependency on python-xml 4d3ca42 systemd: tighten timesyncd and journal-gateway user accounts 6be3031 systemd: extend PACKAGECONFIG flags 85728ec systemd: rename systemd-zsh to systemd-zsh-completion 22a2866 systemd: move some tools into systemd-extra-utils package 9909104 classes/useradd: handle whitespace only USERADD/GROUPADD/GROUPMEMS e485686 systemd: realign packages list 41d0f83 systemd: move bash completion into separate package 9a80afd nettle.inc: drop duplicate LIC_FILES_CHKSUM and SRC_URI hashes 72ec267 gdb: drop unnecessary CC_FOR_BUILD etc exports 00d6b67 gdb: build fix for MIPS + musl libc 40e4e8c strace: build fix for MIPS + musl libc 299b426 uclibc: fetch from master branch not 1.0 4ac4d28 uclibc-ng: Bump up to 1.0.12 release 70bfd4c musl: Upgrade to tip of tree d1496b4 e2fsprogs: Fix multiple xattr handling 9d4b526 cdrtools-native: Explicitly set EXTRA_OEMAKE as required 864797a oeqa/prservice: Fix whitespace problem 7cd8351 pseudo: uprev to 1.7.5 246b02e ptest-runner: Explicitly set EXTRA_OEMAKE as required 7932525 unzip: Explicitly set EXTRA_OEMAKE as required 4ef055c sysklogd: Explicitly set EXTRA_OEMAKE as required 625066b stat: Explicitly set EXTRA_OEMAKE as required 07e81c8 pigz: Explicitly set EXTRA_OEMAKE as required 936223b iputils: Explicitly set EXTRA_OEMAKE as required 1e3fdbb ed: Explicitly set EXTRA_OEMAKE as required ef36b6f gptfdisk: Explicitly set EXTRA_OEMAKE as required 59ee206 dmidecode: Explicitly set EXTRA_OEMAKE as required d17758a libacpi: Explicitly set EXTRA_OEMAKE as required 44e8d0f apmd: Explicitly set EXTRA_OEMAKE as required 961d898 perl: Explicitly set EXTRA_OEMAKE as required ecb9c34 oeqa: Improve test failure messages ae2f3a3 sstate: Ensure populate_lic sstate objects are cleaned 26f26e5 package_deb: Ensure allarch deb packages aren't target specific b3a2065 base: Make do_cleansstate nostamp 37357ab classes/testimage: Fix exportTests function. f895a61 classes/testsdk: Add help information on how to run tests. e22fbce oeqa/sdkext/devtool.py: Add location test to ensure that devtool is the eSDK one. 92d0cc5 oeqa/sdkext: Add devtool basic tests for eSDK. a619ea2 oeqa/oetest: Fix compatibility SDK tests using eSDK. 062dbd6 classes/populate_sdk_ext: Add SDK_EXT_TARGET_MANIFEST and SDK_EXT_HOST_MANIFEST 4cfdf17 testsdkext: Add skeleton for support Extensible SDK tests. 5580d7b classes/testsdk: Add compatibility SDK testsuite to eSDK 7181da7 oeqa/oetest: oeSDKTest when run a command redirect env output to null f3c2ce2 classes/testsdk: Add function run_test_context 3577c35 oetest.py/TestContext: Move loadTests and runTests inside it. 8009418 testimage/testsdk: Move get test suites routine inside TestContext. b588b80 testimage/testsdk: Modularize TestContext. 59791d1 toolchain-shar-extract.sh: Add proxy variable to new env. abd8158 classes/testsdk: Add call to export_proxies on testsdkext. 42f2ac4 classes/testsdk: Add testsdkext task only install. 90590ab get_test_suites: Add sdkext type for load test suites. 2ecc319 populate_sdk_ext: Set TOOLCHAINEXT_OUTPUTNAME. 7b459be classes/testimage: Add defeault inherit for testsdk. 24326a9 classes/testsdk: Add new class testsdk. 3d1d30b testimage: Modularize helper functions for get test lists. 8b5ee36 bitbake.conf/base: Improve handling of SRCPV 947e526 oeqa: setup bitbake logger after tinfoil.shutdown 400f530 bitbake: build: Improve python execution tracebacks aece748 bitbake: build/data: Don't expand python functions before execution [API change] e39cfb1 bitbake: cooker: Don't expand python functions in variable dumps f652b6b bitbake: data: Don't expand python functions for variable dependencies d3e0c44 bitbake: data_smart: Avoid expanding anonymous python functions e0eb2ea bitbake: toaster: models Remove manual transaction control from lsupdates 48622e1 bitbake: toaster: build section Improve display of builds when > 1 targets 4d0ba0f bitbake: toaster: templates make build data breadcrumb consistent 99184d7 bitbake: BBHandler/ast: Merge handMethod and handleMethodFlags 6ba69b4 bitbake: utils: Drop datastore function inspection during exception f8a44b1 bitbake: cooker: extended dot styling 30c132b bitbake: toaster: Enable Image Customisation feature 5e14a8f bitbake: toaster: xhr_customrecipe_packages Add dependencies to included packages 749f5a6 bitbake: toaster: orm generate_recipe_content only exclude locale packages 6269411 bitbake: toaster: customrecipe page Add last successful build link and conditionals 8d5b61e bitbake: toaster: models Add update_package_list for CustomImageRecipe 86db0bd bitbake: toaster: orm Add last_updated field to CustomImageRecipe 18d8b17 bitbake: toaster: models add get_last_successful_built_target method 8885b7b bitbake: toaster: pkg_dependencies_popover just show direct dependencies 40f6eff bitbake: toaster: models add all_depends method for Package_DependencyManager a8ab1c6 bitbake: toaster: buildinfohelper CustomImagePackage update dependency info 0fee829 bitbake: toaster: newcustomimage_modal add frontend name validation cb6d290 bitbake: toaster: API CustomImageRecipe check the recipe name supplied is valid 5634a25 bitbake: toaster: views CustomRecipe API add size information to the package lists 6fbceb0 bitbake: toaster: models Invalidate ToasterTables cache when a m2m field changes 998f9af bitbake: toaster: customrecipe Add dependency tracking to package selection 9976e4f bitbake: toaster: tables move template logic into the pkg_add_rm_btn d77c247 bitbake: toaster: CustomImageRecipe generate overwrite IMAGE_FEATURES 481dc11 bitbake: toaster: make locale packages uneditable in custom image page a757d39 bitbake: toaster: include locale and packagegroup packages in custom image baac458 bitbake: toaster: update custom image package table filters efbffe3 bitbake: toaster: move recent builds query to model b514785 bitbake: toaster: update customimagerecipe migration df58f5b bitbake: toaster: add merge migration to resolve conflict 38f4913 bitbake: toaster: orm generate_recipe_file_contents Handler for require recipe 769017e bitbake: toaster: project builds Poll the server to get latest progress for build 971d65c bitbake: toaster: localhostbectrl Update the dirpath of customrecipe's base layer 6d9f342 bitbake: toaster: tables Check layer presence in project for customise_btn 76c0008 bitbake: toaster: toastergui tests Add addtional data to the setUp for new tables 70a078e bitbake: toaster: tables SelectPackagesTable rename recipe_id to custrecipeid 7e4c231 bitbake: toaster: toastergui tests Update package test to use CustomImagePackage 4b3c9d6 bitbake: toaster: customrecipe Add further front end features using new API b213907 bitbake: toaster: xhr_customrecipe_packages add GET info for package response a9668ee bitbake: toaster: xhr_customrecipe_id change to use CustomImagePackage 439314c bitbake: toaster: API allow CustomImageRecipe to be updated after creation 9ea4de6 bitbake: toaster: tables Change SelectPackagesTable to use ProjectPackage 20f400b bitbake: toaster: tables add recipe download link to CustomImagesTable 1c9ce1c bitbake: toaster: newcustomimage_modal use libtoaster method for new CustomRecipe 8b1d043 bitbake: toaster: libtoaster Add createCustomRecipe method 32048fa bitbake: toaster: orm Add convenience method to get all pkgs in a CustomImageRecipe c80b7df bitbake: toaster: orm get_project_layer_versions to return layer_version objects 796e348 bitbake: toaster: toastergui tests Add unit test for download custom recipe 04d8c94 bitbake: toaster: toastergui tests Update to reflect changes to CustomImageRecipe 4e8a0aa bitbake: toaster: views xhr_customrecipe_packages clean up API 66b5608 bitbake: toaster: toastertable remove title from Show all in table ce72896 bitbake: toaster: Add recipe details page 5f52614 bitbake: toaster: newcustomimage Move modal dialog out of newcustomimage template 2a3dd32 bitbake: toaster: Continue front end features to custom image recipe page. d6e7e4a bitbake: toaster: tables Add table for Packages and update SelectPackagesTable 43f0a05 bitbake: toaster: views Add view to download custom recipe 2cf55af bitbake: toaster: move CustomImageRecipe generation to API entry point c402ac2 bitbake: toaster: orm add CustomImageRecipe generate contents function a6e4f94 bitbake: toaster: buildinfohelper Add the concept of CustomImagePackage e1bfe1c bitbake: toaster: orm: Add db migration for new CustomImagePackage table f760a78 bitbake: toaster: orm Add CustomImagePackage table 4117af2 bitbake: toaster: orm: Add db migration for new CustomImageRecipe inheritance change 1f10289 bitbake: toaster: orm make CustomImageRecipe inherit from Recipe 648753b bitbake: toaster: orm Add sum of dependencies size function to PackageDependencyManager a92fc30 bitbake: toaster: tablejs Add an event handler to manually trigger a data reload 4c82878 bitbake: toaster: ToasterTables simplify filter function move common part to widget 3e1e8e6 bitbake: toaster: models fall back to a sensible string for no vcs reference 14d09c8 bitbake: toaster: localhostbecontroller CustomRecipe now base_recipe is Recipe 7d5d8d0 scripts/lib/bsp/engine: trailing whitespace cleanup dfeda17 scripts/lib/bsp/engine: fix path separator d482d84 maintainers: remove gtk-theme-torturer and gnome-mime-data d0d85a4 bitbake: bb/fetch2: Move export_proxies function from wget to utils. 7226ce2 glibc-locale: fix QA warning 4a2f42f formfactor: add machconfig for Beaglebone eb53c54 sstatetests: Fix after change to sstate populate_lic SWSPEC a43b9ef gstreamer1.0-plugins-base: move freetype dependency into 1.6.3 recipe fb4f05b gstreamer1.0-plugins-base_git: update to git master 1.7.1-79-g6414289 fc81c80 gstreamer1.0-plugins-bad_git: avoid including <sys/poll.h> directly 3f02474 gstreamer1.0-plugins-good_git: avoid including <sys/poll.h> directly 9b0a74a gstreamer1.0: avoid including <sys/poll.h> directly f9e565e gmp_4.2.1: fix build for MIPS 6d570c8 gmp.inc: limit ARM_INSTRUCTION_SET over-rides to armv4/armv5 3aecdd9 gmp: move BBCLASSEXTEND = "native nativesdk" from gmp.inc into 6.1.0 recipe 263a65d gmp: move SRC_URI out of gmp.inc + minor reformatting aacae25 image_types.bbclass: Embed IMAGE_NAME in ubinize config file 9c0d4ec toolchain-scripts: drop PYTHONHOME 6560f80 python: set PYTHONHOME for nativesdk 92ae4e2 gcc: musl related fixes for ppc/secure-plt and gthr 9e5222c gcc: Assume libssp and dl_iterate_phdr on musl 281bd41 security_flags: wipe security flags for gcc/glibc and related libraries 61a5875 security_flags: use -fstack-protector-strong a07f2fd security_flags: ensure security flags only apply to target builds 8d57d1d gcc: Fix build on musl with -fstack-protector eb134c6 isoimage-isohybrid.py: fix cpio working directory 8bedf76 glib-2.0: use the system libpcre 1ae132e libpcre: enable unicode properties by default 3adb8d5 python3: remove optimize by default patch 1df1ac9 security_flags.inc: don't do -pie for syslinux 562c75c neon: convert to PACKAGECONFIG 6228cf8 bitbake: toaster: reinstate ID on edit columns button 916c73d bitbake: cooker: shutdown cooker parser on shutdown 8857498 bitbake: fetch2/osc: Clean up old variable syntax 54da829 bitbake: fetch2/osc: Remove hardcoded url c57ba52 cross-localedef-native: add ABI breaking glibc patch 0cc825f uninative: Improve error handling 576a248 patchelf: Add patch to handle large files bbdbe00 package_manager.py: fix python indentation bug (opkg) ea40a0b populate_sdk_ext: Make populate_sdk_ext depend on sdk_extra_conf 4f7656a populate_sdk_ext: Add support for a "minimal" type 71bb332 populate_sdk_ext: Don't set sdk_update_targets in the config 5b7a43e toolchain-scripts.bbclass: Use PYTHONPATH instead of PYTHONHOME f1f8447 copy_buildsystem.py: Pass the nativelsb argument to gen-lockedsig-cache b130805 gnome-mime-data: remove 12d5fa8 gtk-theme-torturer: remove from oe-core 659d755 openssl.inc: drop obsolete mtx-1 and mtx-2 over-rides 32b498c scripts/devtool: Add getVarFlag expand argument ed5daa1 bitbake.conf/native/nativesdk: Set PKG_CONFIG_SYSTEM_ at top level 8fa2d52 pango: unset LDFLAGS when building gen_all_unicode edfaa04 pango: merge bb and inc 00ccf51 e2fsprogs: Ensure we use the right mke2fs.conf when restoring from sstate 66a6ec2 nativesdk: Set PKG_CONFIG_SYSTEM_ variables 34e95b0 local.conf.sample.extended: Document HOW-TO enable systemd or busbox for init system 077d32e local.conf.sample: Remove trailing whitespaces 6ae662a bitbake: parse/ast: Mark anonymous functions as python functions 9913fd8 bitbake: codeparser: Improve handling of data.expand() dependencies 4628fe1 bitbake: lib/bb: Add expansion parameter to getVarFlag b98866d bitbake: fetch2/gitsm: Fix when repository change submodules 390c2c1 bitbake: data_smart: Add missing expand parameter to getVar call 56454f6 bitbake: bitbake: prserv: do not clear umask when daemonizing abf8a8f bitbake: bitbake: prserv: SIGTERM handling hung process be032fc bitbake: bitbake: prserv: -wal and -shm sqlite lost when daemonizing 1e95ebd poky-tiny: Use musl for default system C library 6594bd5 maintainers.inc: Set me as Maintainer of QEMU. 86851d5 insane: Fix populate_sysroot sanity test path d09a25e socat: upgrade to 1.7.3.1 fad264b libffi: move from recipes-gnome to recipes-support d3753dd libffi: ensure sysroot paths are not in libffi.pc c72614b syslinux: remove LDFLAGS manipulation 8ad11fc lttng-tools: Fix ptest installed la files 66ed16b gnutls: update 3.4.8 -> 3.4.9 149cb17 python-distutils: add missing dependency on python-email 3473962 nss-myhostname: Fix build on musl 42e37d7 linux-firmware: update to latest revision 52442afee ce1bed7 license.bbclass: add LICENSE_CREATE_PACKAGE to perform_packagecopy vardeps e43504b i2c-tools: point SRC_URI at Yocto source mirrors 2d7622c gnutls.inc: allow libidn support to be controlled via PACKAGECONFIG 60ebe1c gnutls.inc: add gmp to DEPENDS 935aa96 gnutls.inc: minor formatting improvements 3fa1c54 Revert "kernel/kernel-arch: Explicitly mapping between i386/x86_64 and x86 for kernel ARCH" 0b82af2 wic: isoimage-isohybrid: check for syslinux-native 9699441 formfactor: add machconfig for qemumips64 4701dc9 ncurses: use closing curly brackets in FILES_${PN}-tools variable 9d9f233 util-linux: Change ALTERNATIVE_PRIORITY above busybox 8f2306c mktemp: lower the priority of standalone mktemp package 6251846 libxsettings-client: drop obsolete disable_Os_option.patch 7894633 wic: default to empty bootloader config 090fb51 copy_buildsystem: add ability to exclude layers 8dc600f toaster.bbclass: reinstate scan for artifacts in the sdk directory eee675b toaster.bbclass: attach image file scan postfunc to do_image_complete 0c0b072 meta: add ASSUME_PROVIDED dependency on wget-native for http fetches f926610 gtk+3: Tweak getVar to use True, not 1 7fa6eeb classes/lib: Add expand parameter to getVarFlag 252e645 python-pycurl: remove unnecessary exports 9fd214d sstate: Fix SSTATE_SWSPEC only used by populate_lic tasks 4ea6a64 package.bbclass: Add data expansion to do_split_packages() 6ab5001 busybox/gtk/perl/base-passwd: Ensure data is correctly expanded e8860f7 ref-manual: Fixed typo in FAQ 14.15 section. 9d2925e ref-manual: Updated FAQ entry regarding Proxy for SOCKS 29a44da ref-manual: Fixed type in LICENSE_CREATE_PACKAGE variable description 4181e58 ref-manual: Updated warning regarding libexecdir 0d8bd7d ref-manual: Added description for LICENSE_CREATE_PACKAGE variable. 6aca5b8 ref-manual: Added remove-libtool class 5e2201e toaster-manual: Updated the "Installation" to have TOASTER_DIR information 3aa162a p11-kit: fix packaging warnings 60c9759 piglit: don't use /tmp to write generated sources to b33e440 libical: Work around hardcoded paths in pkgconfig file a131b6e documentation.conf: align the documentation for DEBUG_OPTIMIZATION and FULL_OPTIMIZATION with bitbake.conf 974a8c0 pciutils: Explicitly set EXTRA_OEMAKE as required 2d3e6f3 openssl: Explicitly set EXTRA_OEMAKE as required b07e161 dbus: add user sessions support 877eae1 dbus: use ${systemd_system_unitdir} 6010088 populate_sdk_ext: Add SSTATE_MIRRORS to config blacklist 70ec867 insane: add test for -dev packaging containing real libraries 38d6f1f python3: set INSANE_SKIP as libpython3.so is a trampoline library 4ac4023 p11-kit: fix module packaging 9a27010 libnl: package the libnl-cli modules in libnl-cli 111af1d remove-libtool: add new class 333dce4 gtk-immodules-cache.bbclass: fix immodules-cache path b1e41f4 Revert "matchbox-keyboard: export GTK_IM_MODULE_FILE location" ac1f311 directfb: use Yocto source mirrors for SRC_URI 4d80f7a gcc-configure-common.inc: drop --enable-target-optspace from configure 654eddc machine/include: drop tune-cortexm*.inc and tune-cortexr4.inc 322015a liboil: drop recipe from oe-core 41d50f9 boost: Fix build on soft-float ABI arm systems 07a91a6 libnss-mdns: Check for nss.h before using 1b34f55 db: Use cross libtool 64089c6 libtool-cross: Unset pre|post dep objects 457f417 docbook-xsl-stylesheets: create a link for easy refer 1ba62f9 pth: Remove dead code a4a5d1f3 bitbake: cooker, bitbake-worker: Fix spelling of "received" 8f6b9c7 bitbake: cooker: Only start as many parse threads as we need 602da7c bitbake: knotty: Don't show errors for universe provider issues 1dd2d76 linux-yocto: Adds new genericx86 and genericx86-64 SRCREVs for kernel 4.4 b8fa9d3 poky: Add poky-world-exclude.inc and add qwt-as 5503a22 sstate: Revert using -m option to tar in sstate 6023798 libarchive-native: Disable libxml2 support b09b054 pcmciautils: Fix makefile race 89df5f1 binutils: Use target provided zlib c85c54f binutils: Upgrade to 2.26 ba2fdcd native.bbclass: Set CXXFLAGS from BUILD_CXXFLAGS not BUILD_CFLAGS 2394b15 gstreamer1.0-plugins-base: Add video crop supporting when convert frame 2724908 gstreamer1.0-plugins-bad: Fix memory leak of navigation thread db81fc9 lib/oe/package_manager: remove package feed lists c43da12 externalsrc: use shared CONFIGURESTAMPFILE if B=S c6b8227 Make sure that the directory for CONFIGURESTAMPFILE exists ca06179 autotools.bbclass: use oe_runmake instead of ${MAKE} f4f9f2f gcc, qemuppc: Explicitly disable forcing SPE flags 691f7e4 pango.inc: misc dependency fixes 70efb8d pango.inc: limit ptest specific do_compile_prepend to target builds c1273d4 systemtap_git.inc: do not immediate expand SELECTED_OPTIMIZATION e631be2 glibc.inc: do not immediate expand SELECTED_OPTIMIZATION 770d9ff mkelfimage: fix target cflags leaks to host c936bf0 base: Move COMPATIBLE_MACHINE out the scope of SOURCE_MIRROR_FETCH 3072361 bitbake: bitbake: BBUIHelper: Remove function findServerDetails 28c041c bitbake: fetch2: Simplify logic in verify_checksum() 5375e64 bitbake: bitbake: Set process names to be meaninful 5b234d1 bitbake: utils: Add ability to change the process name 0b06924 bitbake: data.py: avoid double newlines at the end of functions in emit_var() 68600ae bitbake: build.py: minor shell_trap_code() formatting tweaks 423a264 conf/distro/poky.conf: use example.com for connectivity check 6c058ce curl: update 7.46.0 -> 7.47.0 ( CVE-2016-0754 CVE-2016-0755 ) adbe63d openssl: update 1.0.2e -> 1.0.2f ( CVE-2016-0701 CVE-2015-3197 ) 85b6679 autotools.bbclass: don't create subshell to delete configure scripts 2f1bcc1 sstate: Add back packagedata on packagedata dependencies 346b225 libical: update to 2.0.0 b696bb3 kexec: package kdump init script/configuration file correctly 51cebbf connman: fix crash with iptables 1.6 7f54fab autotools_stage.bbclass: remove it 07c4bc1 gdb-common.inc: add PACKAGECONFIG for readline 5869e35 tzdata: update to 2016a c9cc707 tzcode: update to 2016a aff2f58 glibc-testing.inc: drop pruning of PATCH_GET from the testglibc script dfb9d41 gcc-cross.inc: drop pruning of PATCH_GET from the testgcc script 9e7d929 bitbake.conf: stop exporting PATCH_GET = "0" 5410aff sstate: Improve handling of useradd dependencies 9823802 gtk-icon-utils-native: Drop problematic dependency 6c04e0d glib.inc: limit ARM_INSTRUCTION_SET over-rides to armv4/armv5 83476b5 glib-2.0: drop add-march-i486-into-CFLAGS-automatically.patch fab76ae glib-2.0: refresh configure-libtool.patch 593dcd4 systemd: fix systemctl enable script for template units 3c90507 glib: use bash-completion.bbclass d88ed5d kmod: use bash-completion.bbclass 0f3780c git: use bash-completion.bbclass 9d20661 util-linux: use bash-completion.bbclass 0e5b0bf dbus-glib: use bash-completion.bbclass 9cddc0a bash-completion.bbclass: add class ddb786c bash-completion: move in recipe from meta-oe 74e2f68 ffmpeg: add a recipe, and remove the libav recipe eb7e554 lib/oe/patch: Make GitApplyTree._applypatch() support read-only .git/hooks 3ed566e gcc: fix hidden weak symbols by removing buggy gcc patch 51d9ba6 dpkg: fix CVE-2015-0860 f80d16e qemu.bbclass: clarify QEMU_EXTRAOPTIONS 3dca294 pango.inc: drop obsolete dependency on qemu-native a16e9a2f dbus: upgrade to 1.10.6 7081458 buildhistory: fix the check for existence of a git repo d74325e connman: tidy up connman-conf usage 79f4495 connman-conf: convert to systemd oneshot 5c35883 bitbake-whatchanged: avoid double do_ task name prefix 7881c02 netbase: add ipv6 host to /etc/hosts 93fcee6 linux-yocto/4.4: CVEs and preempt-rt update 07c182f linux-yocto/4.1: update to 4.1.16 7003698 gstreamer1.0-plugins-bad: fix compiler warnings with -Os in 1.7.1 6e90145 gstreamer1.0-plugins-good: fix compiler warnings with -Os in 1.7.1 3cd70c8 libsoup-2.4: add glib-2.0-native dependency d5b3b97 libtirpc: remove stray .orig file from Use-netbsd-queue.h.patch 209066c ptest-runner: Add ptest-runner_2.0 recipe. 4953e26 musl: Upgrade to tip of tree 52413d0 libdrm: Refresh patch to match upstream submission 66e215f fts: Correct LIC_FILES_CHKSUM be4c446 pth: Delete df95988 elfutils: Fix build with uclibc/musl 047ad2c grub: Backport fix for largefile detection/use 956be0c oeqa/runtime/rpm: be more verbose if test_rpm_query_nonroot fails 3b5288f libc-package.bbclass: add LOCALE_UTF8_IS_DEFAULT 4f3ef90 ref-manual: Updated the BBMASK variable description. b2b7214 dev-manual: Restored ptest-runner2 to ptest-runner d484e58 ref-manual: Removed obsolete do_deploy statement from "Shared State" 7705b87 toaster-manual: Updated instructions for production setup. 4b4a8a6 ref-manual: Updated the SDK figure. d7481ce ref-manual: Added do_image and do_image_complete tasks d39e9d1 ref-manual: Rewrite of "Image Generation" and devtool text. 1e7735e ref-manual, mega-manual: Updated the Image Creation figure fded4fa ref-manual: Updated configuration of auto.conf in closer look 9f192c8 dev-manual: Updated the devtool help examples. 4bbd39d dev-manual: Grammar fix to kickstart section. 75078dd dev-manual: Updated wic reference section 9ed7881 poky-ent: Grouped Fedora perl packages for niceness 3ac0416 local.conf.sample.extended: Update the info about BBMASK d61d290 bitbake: bitbake-user-manual-ref-variables: Update the help for BBMASK a948f52 bitbake: cooker: Allow BBMASK to contain multiple regular expressions e82101a bitbake: bitbake-user-manual-metadata: Updated 'dir' flag 100d6c2 bitbake: bitbake-user-manual: Updated the example BitBake directory 11be341 documentation.conf: Update the help for BBMASK 3d2c0f5 cmake: update to 3.4.2 4364850 at-spi2-core: update to 2.18.3 c763940 webkitgtk: update to 2.10.5 1e95815 libsecret: update to 0.18.4 9259a43 freetype: update to 2.6.2 5ec6dbb gdk-pixbuf: update to 2.32.3 9c84fbc glib-2.0: update to 2.46.2 bd7278c gtk+3: update to 3.18.6 d609cd5 gtk+: update to 2.24.29 6197313 gtk-icon-utils-native: update to 3.18.6 1556f0e libsoup-2.4: update to 2.52.2 dff038a waffle: update to 1.5.2 89bd19f vala: update to 0.30.0 6c02099 rxvt-unicode: update to 9.22 245af2b btrfs-tools: Disable backtrace on musl fa01d37 bsd-headers: Fix LICENCE and dev package RDEPENDS 05e11a5 gdb: Fix build failures on musl 72c1aa2 ltp: Add rdep on ldd 1d0332d argp-standalone: Fix build when S != B 9f22898 bitbake: fetch2/wget: fallback to GET if HEAD is rejected in checkstatus() d11cc29 busybox: fix stop -vs- start typo in rcS script 9f4b088 mtools: keep v3.9.9 recipe in sync with the v4.0.18 version 2c14be3 gen-lockedsig-cache: fix bad destination path joining 9dea876 distutils-common-base: do not set PACKAGES - use defaults from bitbake.conf 4ead707 insane: remove unused variable assignment 44e9c3b meta: fix capitalisation in Upstream-Status 06b4572 pixman: only check even upstream versions 0f74387 gcr: check only even upstream versions a2848ee avahi: Add patch to fix Win10 mDNS issues 04ef34f xf86-input-libinput: initial add 0.16.0 8a2dfa1 image.bbclass: check INITRAMFS_MAXSIZE 962cc37 systemd: make TEST_DIR configurable 9967746 bind: update to 9.10.3-P3 cac47db uninative: handle UNINATIVE_URL being file:/// 9995814 uninative: fix path to patchelf-uninative 2495dfa scripts/wipe-sysroot: also delete uninative sysroot bb97157 meta/lib: new module for handling GPG signing aadb879 devtool: extract: use the correct datastore for builddir fa801e7 busybox: backport upstream truncate open mode fix 6996b26 gstreamer1.0-plugins-base.inc: drop obsolete dependency on liboil 1c4a8cc e2fsprogs: disable blkid 0de8766 pango.inc: drop obsolete FULL_OPTIMIZATION over-ride 89a7ed5 devtool: add configure-help subcommand 84720c8 devtool: properly handle bb.build.FuncFailed when extracting source c3f0f7b devtool: add: warn if modified recipe found in attic directory e559b66 devtool: build-image: allow specifying packages to add to image e00eac8 devtool: move edit-recipe to a separate module 6720bda image: Don't create tasks with '.' in the name 88ca227 rootfs-postcommands: fix allow-empty-password on read-only rootfs fdac363 kernel: Clean DEPLOYDIR before do_deploy runs c2231de gcc-cross-canadian: Add missing DEPENDS on virtual/${HOST_PREFIX}gcc-crosssdk 5fdedb6 libtirpc: Drop unneeded xz-native dependency 7a98fb7 libuser: Drop unneeded xz-native dependency 72f98ba bitbake: toaster: Update UI test runner c192bd6 Revert "xz: Allow to work with ASSUME_PROVIDED xz-native" 6df607b acpid: upgrade to 2.0.26 7a52f67 build-perf-test.sh: add eSDK testing 5c367ec build-perf-test.sh: more generic timing function 44fee2b python3-pip: Upgrade to 8.0.0 9d95a9d orc: update HOMEPAGE 0c1c93e gstreamer1.0-plugins.inc: drop obsolete ${S}/po/Makefile.in.in workaround be145ad busybox: Add support for busybox-init 716fa93 pulseaudio.inc: drop obsolete dependency on liboil 55bfaa2 sqlite3: update 3.10.0 -> 3.10.2 6bb1dd1 sqlite3.inc: add PACKAGECONFIG to support building against libedit 39f6a9e sqlite3.inc: dynamically link the sqlite3 command-line utility 9b2835e sqlite: formatting improvements, move more stuff into sqlite3.inc 89ed462 sqlite3.inc: drop obsolete config_BUILD_CC, etc exports 6188419 sqlite3.inc: fix readline PACKAGECONFIG 939de8d sqlite3: fix the parallel build fix patch a304b82 weston: Add missing DEPENDS on wayland-native 4a5458f bitbake: fetch2: Don't show checksum warnings if a single checksum was supplied e66599f uninative: Fix conflicts with normal sysroot 4833bee insane: Drop do_stage test 861c916 populate_sdk: Use pixz instead of xz a1c35f3 lib/oe/sdk: Partially revert "sdk.py: fix conflicts of packages" 29c5eda uninative: Add fetch capability b54fa25 pixz: Add 1.0.6 d47572d xz: Allow to work with ASSUME_PROVIDED xz-native 0aeb33f lib/oe/package_manager: prevent testing an undefined variable c1f4e92 recipetool: create: better fix for fetch error handling 10c8d14 recipetool: create: fix extraction of name from URLs ending in / b307e0a recipetool: create: extract SRC_URI from local git repositories 50e40fc devtool / recipetool: support specifying a subdirectory within the fetched source 7e1691d recipetool: create: strip quotes from values extracted from CMakeLists.txt 477fa84 gen-lockedsig-cache: copy correct native sstate into ext SDK 204e4ab toolchain-shar-extract.sh: improve behaviour when xz is not installed 979c8fb classes/populate_sdk*: add dependencies on script files f220abc classes/populate_sdk_ext: drop ext-sdk-prepare.py when installing b435225 devtool: add sdk-install subcommand 44d1a2a devtool: sdk-update: improve SDK update process robustness 3360baa devtool: sdk-update: improve temp directory handling d193531 devtool: build: ensure pkgdata is written out d3a4f72 classes/populate_sdk_ext: add option to bring in pkgdata for world a9dfced linux-libc-headers: Port patches for linux-headers for musl 3cffa6d libsolv: Update to 0.6.17+ d9134cf glib-2.0: Fix locale location on musl 527cd95 syslinux: Set LD to avoid using build host ld 136db70 binutils: Fix gold linking errors due to unresolved R_ARM_MOVW_ABS_NC 704e342 puzzles: Silence warning on arm with clang bee65f9 eglinfo: Fix build on raspberrypi 6296c0f mdadm: Fix build with musl 67eef11 gpgme: Define __error_t_defined on musl 368e838 console-tools: Fix header inclusion when not using glibc 5a8c935 uclibc: Update to 1.0.11 1113d58 unfs3: Depend on libtirpc when building on musl 2ecfc02 guile: Fix build with musl 2df08b8 bsd-headers: Package cdefs.h 29deaf0 musl: Create ld.so as a relative symlink 2d028b3 fts: Fix linker hash-style option 8dd1aa8 dosfstools: Correct cross-compile CFLAGS and fix build with musl 21550d1 nss: Undefine HAVE_SYS_CDEFS_H 92e6a7a apmd: Fix build with musl 5d661c5 pcmciautils: Fix parallel build and include sys/types.h 86795ff kexec-tools: Define _GNU_SOURCE for getting loff_t definition ff8006f systemd: Skip parsing on musl based targets f2856a1 oprofile: fix build with musl 226c450 portmap: Point to tirpc headers and libraries on musl 5512c2f nfs-utils: Disable tcp-wrappers for musl 06d0204 bsd-headers,musl: Add recipe for bsd missing features c2c9202 tcf-agent: Implement canonicalize_file_name() for musl as well f294813 chkconfig: Avoid using caddr_t b2aca09 nspr: Drop older glibc code c0976fc irda-utils: Fix header inclusions a3f9721 iproute2: Fix build with musl 22333f0 libuser: Fix build when secure getenv is not there ea9dc99 iputils: Use member based initialization for mrghdr struct b207868 pax: Fix build with musl 1076499 tar: Fix build for musl based targets e451023 rt-tests: Fix build with non-gcc compilers 68da390 webkitgtk: Fix build with clang/musl da81635 console-tools: Include sys/types.h for u_char and u_short defs 205a07a sysklogd: untangle header inclusion maze 9f40dba babeltrace: Add missing header for MAXNAMLEN define 2458850 libunwind: backtrace APIs are glibc specific abdfacb apt: Add support for building for musl targets ec187d3 puzzles: Zero'ise structs before use 3cd0a8c dpkg: Add musleabi to known architectures aaa8516 xinetd: Fix build with musl 93fb408 watchdog: Fix build with musl 7509ffd gzip: Fix build with musl 1d28cbc directfb: Fix build with musl 7b6b312 net-tools: Link with libintl on uclibc ee1bfdb parted: Fix build with uclibc ed5da2a mtools: Fix build with uclibc 5384f08 gnutls: Link with libuargp on uclibc 493e557 guile: Fix build with uclibc 1636f6f packagegroup-self-hosted.bb: Move glibc-gconv-ibm850 to glibc only case 3e7d7ab util-linux: Fix ptest builds on musl 77825f8 gnutls: Link with libargp on musl and depend on argp-standalone 1a6fe71 argp-standalone: Add recipe a7d780c gdk-pixbuf: Fix latent build issue exposed by musl f2cf5d3 xserver-xorg: Fix build with musl b8de631 libcgroup: Add dependency on fts when building on musl 87c3e98 connman: include config.h for HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR cc55fc7 fts: Add recipe 6e3950b tcp-wrappers: Fix build with musl 68f88a5 ppp: Fix build with musl 4972edd blktrace: Include <sys/types.h for dev_t d629fa1 powertop: Include right headers for timval struct 063dc38 update-alternatives: when warning about alt_link==alt_target, say what PN 6baafa1 python-setuptools: Unify and upgrade python-setuptools and python3-setuptools to 19.4 f0e500e gstreamer1.0-libav: update git recipe to 1.7.1 90cbdfb gstreamer1.0-plugins-ugly: update git recipe to 1.7.1 6752484 gstreamer1.0-plugins-bad: update git recipe to 1.7.1 ad8f201 gstreamer1.0-plugins-good: update git recipe to 1.7.1 2ca9f20 gstreamer1.0-plugins-base: update git recipe to 1.7.1 3c7f2b8 gstreamer1.0: update git recipe to 1.7.1 7c810d0 gstreamer1.0-libav: update 1.6.2 -> 1.6.3 a4b8e9a gstreamer1.0-plugins-ugly: update 1.6.2 -> 1.6.3 8170e06 gstreamer1.0-plugins-bad: update 1.6.2 -> 1.6.3 497ebc9 gstreamer1.0-plugins-good: update 1.6.2 -> 1.6.3 3d87902 gstreamer1.0-plugins-base: update 1.6.2 -> 1.6.3 1e256ee gstreamer1.0: update 1.6.2 -> 1.6.3 dacf2aa gst-plugins-package.inc: drop perl RDEPEND for XXX-apps packages 676275f gstreamer1.0-plugins.inc: don't set base SRC_URI via python 852f098 gstreamer1.0-plugins.inc: drop obsolete lib-link.m4 workaround a32ac26 gstreamer1.0-plugins-bad.inc: update hls dependency gnutls -> nettle 97e0752 gstreamer1.0-plugins-bad.inc: don't set ${S} or apply version specific patch 78e9361 gstreamer1.0-plugins-good.inc: remove duplicate --disable-examples 0edabfd gstreamer1.0-plugins.inc: convert GSTREAMER_1_0_DEBUG to a PACKAGECONFIG 81cd227 gstreamer1.0-plugins.inc: add missing glib-2.0-native dependency a0b1e66 gstreamer1.0.inc: add missing glib-2.0-native dependency e5fb79d gstreamer1.0-rtsp-server.inc: minor formatting improvements 434aa8e gstreamer1.0-omx: minor formatting improvements + update HOMEPAGE 69bcd33 gstreamer1.0-libav: minor formatting improvements + update HOMEPAGE 1d6e61a gstreamer1.0-plugins-ugly: minor formatting improvements c45ce26 gstreamer1.0-plugins-bad: minor formatting improvements c1ea981 gstreamer1.0-plugins-good: minor formatting improvements beb8091 gstreamer1.0-plugins-base: minor formatting improvements 61f30b4 gstreamer1.0-plugins.inc: minor formatting improvements 981145a gstreamer1.0: minor formatting improvements 9f1a943 gst-plugins-package.inc: minor formatting improvements 9e08b69 gst-player: minor formatting improvements a8ed2c8 valgrind: remove unused valgrind-remove-rpath.patch e24123d emptytest: exclude from world builds 6808035 build-appliance-image: bump version to 14.0.0 eb418c3 insane.bbclass: fix package_qa_walk() e185004 insane.bbclass: print all the QA messages 95fa36e weston: upgrade 1.8.0 -> 1.9.0 1bc0c89 wayland: upgrade 1.8.1 -> 1.9.0 03dae8e glib-2.0: fix the ptest 68c5e6d insane.bbclass:buildpaths: ignore ipkg/dpkg's CONTROL dir 258676b sstate: display the sysroot name when cleaning for clarity f35b2e2 bitbake: set default libexecdir to $prefix/libexec 40f0c2d gawk: fix libexecdir/libdir/BPN confusion 2458f41 mesa: update SRC_URI fdb12f9 e2fsprogs: set PV to 1.42.99+1.43+git${SRCPV} 9cf1ec0 valgrind: avoid neon for targets which don't support it b191f58 valgrind: re-enable ARM intdiv and vcvt_fixed_float_VFP tests b0b3412 valgrind: let valgrind determine its own optimisation flags 92abb5f meta/files/toolchain-shar-relocate.sh: Detect different python binaries and select one that exists. 924e2c3 python-nose: upgrade to 1.3.7 02440b5 python-native: Make python-native also RPROVIDE python-unittest-native b7ca05d linux-libc-headers: update to 4.4 f73ee59 libpng12: upgrade to 1.2.56 3a59486 libpng: upgrade to 1.6.21 63a49f8 libtirpc: remove redundant va_list patch 55a8df2 perl: Upgrade to 5.22.1 a840588 oeqa/selftest/signing: use temporary rpmdb 65c1de9 kexec-tools: inherit update-rc.d ba837f1 autotools: don't output the full config.log on configure failure 3e3cb62 bitbake.conf: Remove horrible variable expansion hacks b963efb mesa: add missing wayland-native build dependency 9dd6c81 maintainers.inc: Correct maintainership for several packages bd1a534 bitbake: toaster: run bitbake server with --read option 76a281c bitbake: taskdata: add the ability to access world targets list 11a1f49 bitbake: cache.py: check existence before add to cachedata.rproviders 05c1775 bitbake: taskdata.py: add RuntimeProviders to close matches cf9cb65 bitbake: data_smart: Don't show exceptions for EOL literals b80219e udev: Add 2 patches to support 4.4 kernel 1013385 gcc-runtime.inc: provide libquadmath 60b237f kexec: update supported architecture list 92a0032 strace: update 4.10 -> 4.11 0aa8169 strace: fix ARCH definition in tests/Makefile 2408149 strace: remove need for git-version-gen script 9ca6a5f strace: fix --disable-aio configure option dd90f32 strace: drop unnecessary dependency on acl aadae7b libnewt: Fix linking error due missing symbols 571289d lib/oe/package_manager.py: Remove list() from PkgsList class 6ebda8e lib/oe/rootfs: Use list_pkgs() instead of list() 03075f6 lib/oe/utils: Add function format_pkg_list() c708411 lib/oe/package_manager: Add list_pkgs() to PkgsList class 113e136 python3: Minor upgrade 3.5.0 -> 3.5.1 918149d python-numpy: upgrade to 1.10.4 eae7584 swig: upgrade to 3.0.8 21f7677 python-scons: upgrade to 2.4.1 7721652 python-pycurl: upgrade to 7.21.5 2ef401f python-mako: upgrade to 1.0.3 2a608cc python-setuptools: Upgrade to 19.2 6395bc8 python3-setuptools: upgrade to 19.2 40738af python: Upgrade 2.7.9 > 2.7.11 35855a0 wic: pylinted ksparser module e3b3bcf wic: add help for 'include' command bfaabe5 wic: move parts of canned .wks into common.wks.inc 50a3dc5 wic: implement search of includes 15ea180 wic: refactor get_boot_config d304162 wic: ksparser: add support for include 3fc6aaa wic: do not remove build dir in source plugins 8d34eea wic: use unique partition number 43b4058 wic: move wks parsing code to KickStart._parse 3860640 nss: update to 3.21 ea39ad0 libjpeg-turbo: fix upstream version check (sort of) 48a8a89 libical: fix upstream version check c6f71c5 gnutls: update to 3.4.8 7a80f84 sysstat: fix upstream version check 2aabf9a pbzip2: update to 1.1.13 77aee28 ncurses: fix upstream version check 56e4ff6 libsolv: fix upstream version check d46bc77 e2fsprogs: fix upstream version check 0436e3f build-appliance-image: bump version to 14.0 a206a19 btrfs-tools: update to 4.4 a1790bc bootchart2: update to 0.14.8 68c7113 poky.conf: Delete BB_SIGNATURE_HANDLER settings 0916235 rpm: remove bashisms: [ x == x ] -> [ x = x ] 2dbd61f uclibc: remove a use of immediate expansion and oe_filter_out () 32eeb00 gcc-runtime: switch to removal override syntax to modify CXXFLAGS c886a78 bitbake: tests/codeparser.py: Add filename/lineno flags to test variable f130033 bitbake: toaster: write variables to toaster.conf 1835768 sstate: replace verbose manifest removal with a single count d4c721a libdrm: Upgrade 2.4.65 -> 2.4.66 b5508a8 slang: Add dependency on ncurses 27b2df2 valgrind: make it explicit that valgrind supports armv7a and above 5dc38a3 sign_rpm.bbclass: fix task dependencies 27c39c4 opkg-utils: store alternatives in nonarch_libdir 77fde15 security_flags.inc: remove obsolete workarounds for curl 31ce027 cups: update systemd support a4b48c2 coreutils: Add xattr PACKAGECONFIG 7a0b1c1 oeqa/runtime/parselogs: use -F to search fixed strings for grep b8e11e2 libinput: Upgrade 0.21.0 -> 1.1.4 a9f2e87 postinst-intercepts: always use set -e de0848f maintainers: mark Khem as nominal owner for uclibc 3235f5e formfactor: remove unused beagleboard configuration 6c64700 alsa-state: remove beagleboard configuration f0d47a6 bitbake: Revert "runqueue.py: Ensure one setscene function doesn't mask out another which needs to run" 9e867ef sstate: Add packagedata to list of tasks not to recurse 5e881c1 classes/populate_sdk_ext: fix task dependency regression 2e9f092 image: Handle image types containing '-' correctly 0612ca4 oe-selftest: devtool: fix test_devtool_add_library if python was built first c1492c4 recipetool: create: add a couple more license checksums 2c8c9fe recipetool: create: add basic support for extracting dependencies from cmake 3eb397f recipetool: create: force GL libraries to virtual/* 726dbda recipetool: create: move dependency mapping code to RecipeHandler 788e4bb recipetool: create: fix overzealous mapping of git URLs ece0a2e recipetool: create: support additional autoconf macros from autoconf-archive 903d471 recipetool: create: detect flex/bison dependency a66f4ac recipetool: create: pick up boost macros in configure.ac dbe91a3 recipetool: create: improve extraction of pkg-config / lib deps e7bedb9 wic: rename kickstarter.py -> ksparser.py 3bb6ea6 wic: override ArgumentParser.error d652203 wic: removed unused imports d2090a6 wic: improve processing of parseing errors 1ed97cc wic: catch KickStartError bda77fd wic: add custom exception KickStartError ef211a5 bootimg/image-vm/image-live: Improve image dependencies 0910bc6 image: Always run do_rootfs_wicenv 12e37e7 selftest/buildhistory: Improve test to remove sources of error 05716dd bootimg/image: Enhance bootimg to respect RM_OLD_IMAGE 1c869a9 rootfs-postcommands: Ensure license manifests respect RM_OLD_IMAGE d27491b image: Ensure we don't expand TMPDIR in image commands ce8a206 image: Fix instability of do_image_* checksums fb1654f image: Fix wic environment issues 1da8f52 insane: Start to clean up do_configure_qa code dd28695 insane: Clean up horrible return value processing code 839fb18 e2fsprogs: fix PV b1236dc e2fsprogs: add PACKAGECONFIG for fuse f98e11c bitbake: toastergui: make artifact download more robust 68f3e1e bitbake: toasterui: log OSErrorException metadata events fb94754 bitbake: toasterui: listen for bb.event.MetadataEvent a2f23fa openssh: CVE-2016-1907 320a319 license.bbclass: fix license manifest 4339a82 wic/help.py: document requirements for valid fstab generation d688df8 glib-2.0: add dependency glib-2.0-native back 76e35f1 kernel-yocto.bbclass: move do_kernel_link_vmlinux() into kernel.bbclass d453fa1 kernel-yocto.bbclass: remove do_kernel_link_vmlinux from SRCTREECOVEREDTASKS 2b92f88 libarchive: Add bsdtar and bsdcpio packages e246905 toaster.bbclass: Separate artifact dump from image file dump 4f481bc pax-utils: 1.0.5 -> 1.1.4 f9974f2 sqlite3: upgrade to version 3.10.0 cd7910d connman: upgrade to 1.31 b9169b7 python3: add missing dependency on PN-misc to PN-modules 4b4dea7 useradd-staticids.bbclass: Remove unnecessary spaces 4f2c352 useradd-staticids.bbclass: Read passwd/group files before parsing 4cbdb15 useradd-staticids.bbclass: Simplify the logic for when to add groups b18e40c useradd-staticids.bbclass: Simplify some logic b689aa0 useradd-staticids.bbclass: Make --no-user-group have effect c03ea8d useradd-staticids.bbclass: Treat mutually exclusive options as such af8b005 wic: get rid of 2 getters 2573e28 wic: get rid of set_size and set_source_file setters 5cd222b wic: get rid of get_rootfs and set_rootfs 4d5d5dd wic: get rid of get_timeout getter 26fb2a1 wic: adjust code for new data structure c827238 wic: remove pykickstart code c15ea82 wic: use new kickstart parser f572f44 wic: add kickstart parser module e5e1905 wic: add partition module 180f170 alsa-lib: 1.0.29 -> 1.1.0 a8c25af matchbox-keyboard: export GTK_IM_MODULE_FILE location d75cb1f xf86-input-evdev: upgrade to 2.10.1 2283732 menu-cache: upgrade to 1.0.1 ec7e406 libxi: upgrade to 1.7.6 86f3f25 librsvg: upgrade to 2.40.13 72dd806 libgpg-error: upgrade to 1.21 3c02fe0 libevdev: upgrade to 1.4.6 33e9930 libcroco: upgrade to 0.6.11 5b63c44 gsettings-desktop-schemas: upgrade to 3.19.3 dfff167 gpgme: upgrade to 1.6.0 5abb691 u-boot: Update to 2016.01 release e9280d1 linux-yocto: introduce v4.4 standard/preempt-rt/standard kernel 8c3276e e2fsprogs: 1.42.9 -> 1.43 (master) b248e55 bitbake.conf: rename python-native-runtime 65d0bfc net-tools_1.60-26.bb: Fix do_patch dependency error 99923fc ncurses: 5.9 0 -> 6.0 44d283a autotools.bbclass: use relative path to run configure script b2f1de3 glibc-initial.inc: use relative path to run configure 0fe6e2d bitbake: toaster: increase timeout a5f34bc poky.ent: Added "perl-bignum" package for Fedora afc6cba dev-manual: Updated "Running ptset" section ec047ad yocto-project-qs: Updated the "Next Steps" section 57ddbe8 ref-manual: Removed all variables related to "QMAKE" 7814b33 ref-manual: Updates to cull out qt4 stuff. bf81969 toaster-manual: Updates on how to start Toaster. 798e8b8 bitbake: toastergui: code formatting and clean-up c4b5011 bitbake: toaster tests: fix Django tests for new ToasterTable pages 88a262c bitbake: toastergui: remove unused views and template code 059a274 bitbake: toastergui: fix error and warning counts for builds 4103e0c bitbake: toastergui: make "Apply" button state depend on filter range 6c2d88f bitbake: toastergui: mute label for filter actions with no records f08730a bitbake: toastergui: set default visible and hideable columns 112f374 bitbake: toastergui: serialise decimals correctly e024aab bitbake: toastergui: streamline construction of filter objects fcb20f9 bitbake: toastergui: ensure filter_value updates f9c46f5 bitbake: toastergui: don't hide all elements with .col class eaae82a bitbake: toastergui: convert project builds page to ToasterTable 33b011c bitbake: toastergui: implement "today" and "yesterday" filters f8d383d bitbake: toastergui: implement date range filters for builds b929889 bitbake: toastergui: show recent builds on all builds page 1a4b203 bitbake: toastergui: switch off filter highlights when inactive 809046c bitbake: toastergui: refactor ToasterTable filtering 294579b bitbake: toastergui: convert all builds page to ToasterTable 6c12ca7 bitbake: toastergui: use event delegates for hover help elements ef93dce bitbake: toastergui: switch projects/ view to ToasterTable 417f1d3 bitbake: toaster: check inferred file suffixes against list of known types c02ee05 bitbake: toaster: move image file suffix list to model d29e4cd bitbake: toastergui: use ToasterTable for projects page b1256db openssh: update to 7.1p2 c0e9f2d kernel/kernel-arch: Explicitly mapping between i386/x86_64 and x86 for kernel ARCH f8508de bitbake: Revert "fetch/git: Change to use clearer ssh url syntax for broken servers" b567235 image/image-live: Add back IMAGE_TYPES_MASKED support e914e2a image.bbclass: Handle image base type dependency properly ad32f65 autoconf: add missing perl-module-file-find to RDEPENDS d83dfe6 ca-certificates: update to 20160104 4440560 epiphany: upgrade to 3.18.3 dcf54b4 iso-codes: upgrade to 3.64 d7bee35 lighttpd: upgrade to 1.4.39 08c8923 libwebp: upgrade to 0.5.0 cf0aea7 classes/populate_sdk_ext: avoid unnecessary sstate being brought in ea29bec insane/package: Fix cases where QA errors aren't fatal 2e620a4 classes/populate_sdk_ext: check that extensible SDK prepared correctly 4685c33 classes/buildhistory: save auto.conf and bblayers.conf for extensible SDK 39f6472 classes/populate_sdk_ext: support auto.conf 91877aa classes/populate_sdk_ext.bbclass: handle if local.conf doesn't end with a newline 764c927 util-linux: create util-linux-runuser iff pam in DISTRO_FEATURES 95dce70 rsync: 3.1.1 -> 3.1.2 38aa0fc less: 479 -> 481 4cb2269 iputils: s20121221 -> s20151218 fe47dd7 wget: 1.17 -> 1.17.1 79886e9 git: 2.5.0 -> 2.7.0 d3e16b8 file: 5.24 -> 5.25 3549abc autogen-native: 5.18.5 -> 5.18.6 fb14627 curl: upgrade to 7.46 eaf88d7 xz: upgrade to 5.2.2 8516ff7 sysstat: upgrade to 11.2.0 ae73be1 at: upgrade to 3.18 21efab7 kmod: upgrade to 22 c88efae resolvconf: upgrade to 1.78 6729889 pciutils: upgrade to 3.4.1 edd319c gnupg: 2.1.7 -> 2.1.10 78b58b8 help2man-native: 1.47.1 -> 1.47.3 ac0e0d5 man-pages: 4.02 -> 4.04 1e0cbb9 libgcrypt: 1.6.3 -> 1.6.4 372c23d xmlto: 0.0.26 -> 0.0.28 aaafe33 elfutils: 0.163 -> 0.164 38901a7 dhcp: 4.3.2 -> 4.3.3 ea05e05 image.bbclass: Unconditional includes of populate_sdk_ext fails c08f272 tcmode-default.inc: Fix preferred provider nativesdk-sdk_prefix-libc-initial 5d2f783 dhcp: search libxml2 for bind b69652d tzdata: remove bashism 7c7c249 harfbuzz: update 1.1.2 -> 1.1.3 84623dc libpostproc: duplicate armv7a over-rides for armv7ve 1744198 libav.inc: duplicate armv7a over-rides for armv7ve 102dfa1 gcc-configure-common.inc: duplicate armv7a over-ride for armv7ve b08dfb5 subversion: Upgrade 1.9.2 -> 1.9.3 d6fae0c lttng-ust: Upgrade to 2.7.1 a9cc9b5 lttng-tools: Upgrade to 2.7.1 6b02575 lttng-modules: Upgrade to 2.7.1 a378430 gdb: upgrade to 7.10.1 92cc02f linux-yocto: Update Genericx86* BSPs to 4.1.15 da43a56 bitbake: Revert "fetch2/local.py: avoid using PREMIRROR" 96a34e7 conf/distro/poky-tiny: correctly disable python in opkg-utils 1724ffd bitbake: fetch2/git.py: Add missing "errno" module import. 74fa824 bitbake: bitbake: clean up stamp-base related codes f3f769a local.conf.sample: add qemumips64 43328fe bitbake: runqueue: Fix setscene task dependencies 7b905ca bitbake: toaster: settings Add uid to the toaster cache dir dff7a27 bitbake: toaster: show 'satisfied via' text for reverse deps 89f4932 bitbake: toaster: show 'satisfied via' text for build deps febb898 bitbake: toaster: show list of provides for the recipe 2ff4ccb bitbake: buildinfohelper: add provides info to the db 16a81fb bitbake: toaster: add Provider model 6a28ed3 bitbake: buildinfohelper: use providermap f2b7252 bitbake: cooker: add providermap to dep_tree 7e380d4 bitbake: taskdata: refactor get_providermap 46731da bitbake: main/runqueue: Add --setscene-only option to bitbake 34f8db9 update_font_cache: only scan system font directories e5c011b Add "CVE:" tag to current patches in OE-core f04fb88 scripts/create-pull-request: fix git request-pull syntax 928ceb6 qt4: fix-for-mips-n32.patch: remove it c4a3258 util-linux: create util-linux-runuser package 554ca68 valgrind: include aarch64 in COMPATIBLE_HOST 0ce775a valgrind: update to 3.11.0 21a94f6 valgrind: don't restrict to armv7a b8ebac9 DpkgRootfs: Fix logcheck_error false-positive when use multilib e265fbb package_deb.bbclass: add 'Multi-Arch: foreign' tag to allarch packages 4aeb69d package_manager.py: fixes for multilib deb packaging builds 9ea7428 package_deb.bbclass, cross-canadian.bbclass: DPKG_ARCH mapping function 72e6932 connman.inc: add missing RDEPENDS 675ff42 meta: rename perl-native-runtime 3f4fb39 dbus: support large-file for stat64 0d5e41f freetype: enable out-of-tree builds, and use host zlib 8f2ab19 bluez5: upgrade to 5.37 11f5a42 cogl-1.0: fix may be used uninitialized error 235606f oeqa/runtime/logrotate: fix hardcoded root directory cce6c3e oeqa/runtime/smart: fix hardcoded root directory cd2cf1f boost: update to 1.60.0 afc0255 bitbake.conf: remove 'stamp-base' c8fef7f gcc5: Fix build on NIOS2 eda3947 rpmresolve.c: Fix unfreed pointers that keep DB opened 3c8a451 tzdata: Make /etc/timezone optional b80da02 systemd: arrange for volatile /etc/resolv.conf 5548a76 systemd: add myhostname to nsswitch.conf d6bc841 opkg-utils: add update-alternatives PACKAGECONFIG c3b96ff linux-dtb.inc: use absolute upd-alt paths 3ad08c0 uclibc: Upgrade to 1.0.10 74c3667 populate_sdk_ext: Pass excluded_targets as a list to prune_lockedsigs e306d54 populate_sdk_ext: Change to include siginfo and non sstate task sigs e1a558a populate_sdk: Switch from bzip2 to xz 3341f3f classes: Fix do_rootfs references 0a4e1f9 image: Create separate tasks for rootfs construction fdced52 image: Move pre/post process commands to bbclass cdc0aee image.bbclass: Separate out image generation into a new task, do_image 0269219 populate_sdk_ext: Use new --setscene-only option to bitbake instead of workarounds 1ee0842 sstatesig: Handle special case of gcc-source shared-workdir for printdiff d93c212 bitbake.conf: add virtual/libiconv-native to ASSUME_PROVIDED b2fe2a8 devtool: build: support using BBCLASSEXTENDed names 38ed039 devtool: reset: support recipes with BBCLASSEXTEND 532f429 devtool: refactor code for getting local recipe file ec90168 devtool: add: support adding a native variant 99e3872 devtool: reset: do clean for multiple recipes at once with -a 5ef716c recipetool: create: support creating standalone native/nativesdk recipes 1e503c0 recipetool: create: lower case name when determining from filename 4deed25 devtool: sdk-update: add option to skip preparation step d586a11 devtool: sdk-update: fix error checking c1b7d83 devtool: sdk-update: fix metadata update step efead10 devtool: sdk-update: fix not using updateserver config file option 9348c91 classes/populate_sdk_ext: disable signature warnings d44dcd7 classes/populate_sdk_ext: fix cascading from preparation failure d11051c scripts/oe-publish-sdk: add missing call to git update-server-info fbc2147 libbsd: upgrade to 0.8.1 221d864 bitbake: fetch/git: Change to use clearer ssh url syntax for broken servers 46d62d0 bitbake: knotty: Use non-interactive mode as fallback for dumb terminals bfa7859 bitbake: cooker: fix findFilesMatchingInDir documentation 3d42737 bitbake: cooker: use in instead of count 0e83229 maintainers.inc: remove x11vnc d914c7f meta-yocto: drop qt4 references 0f3ad7c scripts/yocto-layer: Avoids duplication of "meta-" prefix 220ef32 poky-lsb/poky-tiny: update preferred kernel to 4.1 b82e228 yocto-bsp: remove 3.14 and 3.19 bbappends 685daeb conf/local.conf.sample: comment out ASSUME_PROVIDED=libsdl-native 2c5e7e0 image: Really remove lockfiles flag a500e3a boost: ensure boost to remain an empty metapackage b151506 image_types.bbclass: Rebuild when WICVARS change eb4159c gccmakedep: fix buildpaths qa check f54e53c bash: fix buildpaths qa check error 6d111c8 testimage: remove VNC test, x11vnc isn't in oe-core anymore 8bec5c5 x11vnc: remove all references to moved package 8f865e2 x11vnc: move recipe to meta-oe ae1fc96 classes/buildhistory: actually use KiB in extensible SDK sizes files 84f66b5 x11vnc: move recipe to meta-oe c44599d readline: move inputrc into readline f29d642 tune-*: use mcpu instead of mtune for ARM tunes c6a1991 arch-armv7ve: add tune include for armv7ve and use it from cortexa7 and cortexa15 21d61fa cortexa{7,15,17}: add VFPv4 tunes 7f2cb68 feature-arm-vfp.inc: Further simplify with TUNE_CCARGS_MFLOAT e9b2ffc feature-arm-{neon,vfp}.inc: refactor and fix issues 45f726c arch-armv7a.inc: add vfpv4 support also to softfp and big endiand tunes ebe8358 arch-armv7a.inc: Fix PACKAGE_EXTRA_ARCHS for tune-armv7atb-vfpv3, tune-armv7atb-vfpv3d16, cortexa7thf-neon-vfpv4 9280a8e arch-armv5.inc: drop duplicate ARMPKGSFX_DSP and PACKAGE_EXTRA_ARCHS_tune-armv5tehf-vfp 46d6b0e arch-armv[456]*.inc: improve indentation like armv7a 860663a arm/arch-arm*, tune-cortexa*, tune-thunderx.inc, powerpac/arch-powerpc64.inc: Use normal assignment 8c483a1 arch-armv7a, tune-cortexa*: improve indentation 7498b91 arch-armv7a, tune-cortexa*: improve comment VFP -> HF bb9b581 arch-armv7a: add missing space before ?= 15f8344 tune-cortexr4.inc: fix PACKAGE_EXTRA_ARCHS e2736f7 sanity.bbclass: add more information to error message about TUNE_PKGARCH missing in PACKAGE_ARCHS b68d947 mkefidisk.sh: add boot log on console 62d7c97 mkefidisk.sh: add startup script for automated boot 5aa3b93 oeqa/selftest/recipetool: update for libjpeg-turbo migration ffa7469 libjpeg: Replace libjpeg with libjpeg-turbo 29d273f python3: fix installed-vs-shipped when 64bit + multilib db7cee6 pulseaudio: add PACKAGECONFIG for lirc b900ec8 sstate-sysroot-cruft.sh: Extend the whitelist 20843fa iptables: upgrade to 1.6.0 c2bda6c scripts/oe-selftest: Allow to run tests on random/all MACHINEs 8e1435e selftest: Added testcase decorators for 2 tests 32f332c oe-selftest: New option --list-tests 17d886b oe-selftest: Improved --list-classes when determining test names 4ec2da7 selftest: moved tc test_buildhistory_does_not_change_signatures 02d259c scripts/oe-selftest: Remove extra coverage data added to unittests 30c06a4 expat: CVE-2015-1283 315bdc8 packagegroup-core-x11-sato: enable pcmanfm on mips a3e26f9 wic: rawcopy: Copy source file to build folder d6e0da4 grub2: Fix CVE-2015-8370 bb663b0 systemd: enable compatibility libraries by default 3fea163 systemd: add more compression and importd PACKAGECONFIGs d462b70 gcc-sanitizers: link directly against sysroot libstc++ 3eb6135 openjade: Fix build if not installing libtool .la files 6308c47 valgrind: Define __UCLIBC__ for uclibc based systems 3d19a1e security_flags.inc: disable -fstack-protector-XXX for valgrind 807ed8a meta/conf/layer.conf: bump layer version due to Qt4 removal 4fb3e05 packagegroup-core-lsb: treat qt4 packages same as qt3 packages 8b11ed8 qt4: remove recipes and classes 0baadc8 toaster-manual: Updates to toaster use chapter. 908bbff ref-manual: Updated the list of supported image types. 5d27451 dev-manual: Added the --configfile bootloader option. 7b3b1f9 dev-manual: Added three new wic option descriptions. eeffa64 dev-manual: Added the --overhead-factor wic option description. 2beb19b dev-manual: Added the --extra-space wic option description. 95851df dev-manual: Added wic --notable option description. 88a2794 dev-manual: 8bdc707 sdk-manual: Initial Manual framework f1f7625 bsp-guide: Updated the license statement. 6686a31 dev-manual: Correction to the KVM stuff in the runqemu commands. ccc830d documentation: Prepare for 2.1 builds 7af9314 mega-manual: Added four new figures for GUI example. f8185ff bitbake: ast: Add filename/lineno to mapped functions a178c5a bitbake: main: kill server without queue setup 773700d bitbake: xmplrpc: split connect method 05b4fbc bitbake: uievent: refactor retry loop ebc169c bitbake: uievent: get rid of EventHandler attribute 4e0de6e bitbake: uievent: add error to registerEventHandler return 01419d5 bitbake: cooker: add state.get_name method 763506d bitbake: fetch2/__init__.py: Add support for 7-Zip f5bfc1c bitbake: utils: Remove double compile from better_compile b4141f6 bitbake: fetch2/local.py: avoid using PREMIRROR 1ad3595 bitbake: siggen: Change exception note into a warning 4ba49ac bitbake: data: Drop misleading ExpansionError exception 2c94311 bitbake: cooker: Drop useless parsing exception a16b543 bitbake: data: Pass lineno/filename data from build_dependencies 958f0ff bitbake: codeparser: Add support for correct linenumbers db4376e udev-extraconf: introduce multiple blacklist files for more complex setups a8fb429 uclibc: disable parallel builds 401c632 image: Condense do_rootfs function/flags 0051510 image/rootfs-postcommands: Separate out post rootfs commands to separate class 3428edd image: Remove pointless rootfs lock eb5bb0e packagegroup-core-boot:replace busybox to variable cc7bb6c initramfs-framework_1.0:replace busybox for variable. d9ffa59 core-image-minimal-initramfs: replace base-utils 9349f42 base-utils:flexible dependency for command utilities c44b76a orc: Add missing PACKAGES_DYNAMIC 2cd061a bluez5: include the patch only for 5.36 4c35473 meta-yocto-bsp: remove 3.14 and 3.19 bbappends 6af8981 meta-yocto-bsp: Remove uvesafb (v86d) from generic x86 features 614e9ec qemu: add PACKAGECONFIG for Nettle crypto support 09705a4 oeqa/selftest: support sets in devtool comparisons 4b543f7 packagegroup-core-x11-sato: include pulseaudio-misc 23302ee devtool: use cp instead of shutil.copytree d6e7b5b xorg-lib: allow native building without x11 DISTRO_FEATURES 4cba706 busybox: generalize recipe to work with arbitrary install directories 9d001ae cairo: update 1.14.4 -> 1.14.6 6d561fb libdrm: Upgrade to 2.4.65 0f516f0 image-vm.bbclass: uses IMAGE_LINK_NAME c851096 image-live.bbclass: uses IMAGE_LINK_NAME 907b87d rpm: Generate per distribution and multilib macro files c910789 package_manager.py: add debugging support for rpm scriptlet execution 8dd27ef xinput-calibrator: get screen geometry when calibrating e8d36f4 scripts: hand the TEMPLATECONF local over to setup-builddir 0f4fb26 util-linux: Fix floating dependency upon 'readline' 2cb434a linux-firmware: package Broadcom BCM43340 firmware f70d46f rpcbind: Fix build with libtirpc 1.0.1 866c693 libtirpc: upgrade to 1.0.1 5754b83 gstreamer1.0-libav: upgrade to version 1.6.2 6ac601f gstreamer1.0-rtsp-server: upgrade to version 1.6.2 3ac3d33 gstreamer1.0-plugins-ugly: upgrade to version 1.6.2 823b623 gstreamer1.0-plugins-bad: upgrade to version 1.6.2 6d13f30 gstreamer1.0-plugins-good: upgrade to version 1.6.2 05896a5 gstreamer1.0-plugins-base: upgrade to version 1.6.2 a8eb77b gstreamer1.0: upgrade to version 1.6.2 dd5756b mirrors: add archive.apache.org to Apache mirrors cfbd804 guile: remove redundant replacement of .pc file c2e8079 bind: 9.10.2-P4 -> 9.10.3-P2 7204a0f libsndfile1: enable FLAC/Ogg/Vorbis support 35bd254 buildhistory: improve support for extensible SDK ea0abcd buildhistory: fix not recording SDK information b6d191d scripts/oe-selftest: Add support for selftest log with timestamp ab79287 selftest: Added MACHINE = "qemux86" to tests that use runqemu b09080d ncurses: fixes wrong paths in BINCONFIG 8df88fb xcb: don't build-depend on python-native d7759a5 tcmode-default: Use glibc for nativesdk version even on uclibc and musl a7eadc3 qemu: upgrade to 2.5.0 9988ab3 webkitgtk: update to 2.10.4 cedb027 epiphany: update to 3.18.2 6e27dd8 libwebp: update to 0.4.4 efcf4b4 libsecret: update to 0.18.3 0112274 gnome-desktop3: update to 3.18.2 88a656e gcr: update to 3.18.0 883193a linux-yocto: remove 3.14 and 3.19 recipes 4487e3a kernel-yocto: fix checkout bare-cloned kernel repositories 5161944 linux-yocto/4.1: update to v4.1.15 a462d16 linux-yocto-dev: bump to 4.4-rcX 862b3b3 lttng-modules: fix build issue against kernel 4.4 9563aa8 yaffs2: fix checkpoint functionality cefc24d mobile-broadband-provider-info: update to tagged release 20151214 04aa27c icu: fix upstream version check 2865e5f btrfs-tools: update to 4.3.1 5beb3bc iso-codes: update to 3.63 503c08d kexec-tools: update to 2.0.11 4fa2e4b lighttpd: update to 1.4.38 f7a7796 tiff: update to 4.0.6 2498065 libassuan: update to 2.4.2 f2192fa msmtp: update to 1.6.3 7fc3066 liburcu: update to 0.9.1 10d14bc trace-cmd: update to 2.6 fc774e9 python3-pip: update to 7.1.2 c3330aa pytnon-pexpect: update to 4.0.1 aa90b5d ifupdown: update to 0.8.2 4c98105 gptfdisk: update to 1.0.1 edde9af cryptodev: update to 1.8 9da9308 oe-selftest: devtool: add more explicit check for ls output c2435b1 oe-selftest: add tests for simple devtool add / recipetool create URL case 8916731 recipetool: create: fix error when extracting source to a specified directory fe28c25 recipetool: create: improve autotools support 498e483 devtool: sync: tweak help / messages b272c51 devtool: reset: print message about leaving source tree behind 95a234e devtool: status: list recipe file within workspace if one exists e116739 devtool: modify: default source tree path 110f433 devtool: add: allow specifying URL as positional argument ceaa4bf devtool: add: figure out recipe name from recipetool ee0d5a1 devtool: add: allow source tree to be omitted 0d8751f scripts/lib/argparse_oe: handle intermixing of optional positional arguments 1bd7793 devtool: update-recipe: use correct method to get bbappend filename 2074654 devtool: split out function for naming bbappend 6acbdc9 devtool: add: tweak help text 316b57b devtool: edit-recipe: add new subcommand ebe5f0b recipetool: create: basic extraction of name/version from filename db5f964 recipetool: create: support extracting name and version from build scripts 6a7661b recipetool: create: set up priority system for recipe handlers 38803e3 recipetool: create: detect when specified URL returns a web page e78a039 recipetool: create: prevent attempting to unpack entire DL_DIR e61645b recipetool: create: minor fix for potential issue in python handling ae2141b recipetool: create: fix do_install handling for makefile-only software c2f1742 recipetool: create: avoid traceback on fetch error 470f20b recipetool: create: handle https://....git URLs 8e0a84c scripts: print usage in argparse-using scripts when a command-line error occurs 548d433 directfb.inc: enable bfd linker workaround for all arm targets 2381f4a devtool: sdk-update: fix traceback without update server set 7540550 classes/populate_sdk_ext: error out of install if buildtools install fails ecce3d3 classes/populate_sdk_ext: hide build configuration in devtool build* output fd84d0f classes/base: don't print header if BUILDCFG_HEADER not set a4f496a classes/populate_sdk_ext: use uninative to set NATIVELSBSTRING a6f8a3f toaster.bbclass: fix TypeError when parsing build stats 937b7fd libxcb: Add a workaround for gcc5 bug on mips 86c8b8b flex: update to 2.6.0 dad130b opkg: upgrade to v0.3.1 d2b770c systemd: remove merge conflicts accidently left in ca69643 wic/help.py: document that mountpoint is optional for part command 5628dde pixman: check neon support via TUNE_FEATURES, not the _armv7a over-ride 9a74388 xdg-utils: Do not build the in-script documentation 520b37d gettext: Upgrade 0.19.4 -> 0.19.6 cae0e0f gcc-configure-common.inc: add gcc-runtime ABI fixes for armv7m and armv7r cba8fb3 tune-cortexr4.inc: provide an _armv7r over-ride via MACHINEOVERRIDES fd10723 tune-cortexm3.inc: provide an _armv7m over-ride via MACHINEOVERRIDES b6fe440 feature-arm-thumb.inc: drop 'no-thumb-interwork' tuning feature 1d5a4cf feature-arm-thumb.inc: drop legacy _thumb and _thumb-interwork over-rides ca64c16 feature-arm-thumb.inc: drop ARM -vs- thumb comments 95a79a5 rpm: Fix support for db5 and db6 75cec07 oe-buildenv-internal: fix return code 606c9e7 staging.bbclass: make already-stripped can be skipped 647e0e4 buildhistory-collect-srcrevs: hide empty sections d4b5a1f selftest/buildhistory.py: Test buildhistory does not change sigs 4b83f1f gcc5: Upgrade gcc-5.2 -> gcc-5.3 0381b78 bitbake: event/utils/methodpool: Add a cache of compiled code objects c61c1eb bitbake: BBHandler: Improve IN_PYTHON_EOF handling 2a94194 bitbake.conf: Add filename and lineno to BB_SIGNATURE_EXCLUDE_FLAGS 5f40691 bitbake: toaster: remove 2 confusing parameters 3960b6e bitbake: toaster: move setting of default values b194c0c bitbake: toaster: move startup checks to a better place 064d2c7 bitbake: toaster: remove 2 unused functions c505f24 bitbake: toaster: remove addtoConfiguration function c7e4404 bitbake: toaster: updated header of the toaster script af34920 bitbake: toaster: add MANAGE variable 563b786 bitbake: toaster: remove unused variable aa3cc12 bitbake: toaster: split long lines, add/remove whitespace 8e4acac bitbake: toaster: check if address:port is in use 847b935 bitbake: toaster: implement checksocket command 9f3681d buildstats-summary/toaster: Cope with removal of get_bn() 522dcaa bitbake: knotty: Improve exception error message 01d67bf bitbake: knotty: Fix row/column function return value issue 6c12efa bitbake: buildinfohelper: Update for buildstats layout change 28ea1a1 bitbake: fetch: use orig localpath when calling orig method 5cb6d83 bitbake: utils: Improve traceback from better_exec internal errors 0019edc bitbake: ast/event/utils: Improve tracebacks to include file and line numbers more correctly b14ccb2 bitbake: runqueue: Add support for <task>- syntax 5069ab6 m4: Drop unused/unreferenced patch d7e766b toaster: Update for buildstats changes adfdca4 buildstats: Improve to add getrusage data and corrected IO stats 3187647 buildstats: Separate out the build and task data to allow improvements 38a2553 buildstats: Clean up e.data and bb.data references 7b1e48f buildstats: Drop get_bn/set_pn and just use BUILDNAME 7837162 buildstats: Drop disk data from buildstats 030c033 nativesdk-buildtools-perl-dummy: Bump PR e6f2761 combo-layer: Stop using filterdiff f1f3716 meta: more removals of redunant FILES_${PN}-dbg 5fb8fea clutter-gst-3.0: add dependency on libgudev 54f01ca systemd: Upgrade to 228 63bdadc uclibc: Switch to using uclibc-ng 0b5cddd cdrtools-native: update to 3.01 final c4dfb92 grep: update to 2.22 d8608bc procps: update to 3.3.11 52f6a01 babeltrace: update to 1.3.1 0c705d6 powertop: update to 2.8 516d8c9 nfs-utils: update to 1.3.3 9c39a4f systemtap: update to 2.9 fef0ec6 kbd: update to 2.0.3 8668e17 gmp: update to 6.1.0 86e02d0 docbook-xsl-stylesheets: fix UPSTREAM_CHECK_REGEX f065766 mtd-utils: update to 1.5.2 5d32aeb unfs3: update to r497 4e653b5 python-numpy: update to 1.10.1 90b7212 libxml-simple-perl: update to 2.22 689db13 dmidecode: update to 3.0 d301451 cpio: update to 2.12 2bea006 puzzles: update to current commit 2d04c83 gnutls: update to 3.4.7 cf1eb2b libidn: add native and nativesdk support dd58b3b libpng: Update SRC_URI to use GENTOO_MIRROR b763668 libpng12: Upgrade 1.2.54 -> 1.2.55 91c92fc libical: Upgrade 1.0.0 -> 1.0.1 5c6ff26 libxslt: use proper SRC_URI a444eb5 kexec-tools: added the script kdump be9f7f9 ltp: Upgrade 20150420 -> 20150903 81f1e41 musl: Update to latest 1.1.12 release c529e66 util-linux: Upgrade to 2.27.1 bdbc5ee packagegroup-core-sdk: Disable sanitizers for uclibc 692853d libsolv: add new recipe 8bba7de curl: upgrade to 7.45 2e3a172 libsndfile1: 1.0.25 -> 1.0.26 df18352 wget: Upgrade 1.16.3 -> 1.17 81eb101 unifdef: upgrade to 2.11 19c76ad sstate-sysroot-cruft: Add php, python, lua, fontcache generated files to whitelist f80f8ba oeqa/selftest: Added testcase decorators for 2 testcases a5dd1dd uninative.bbclass: Choose the correct loader based on BUILD_ARCH 388e580 license: Fix BB_TASKDEPDATA references f19e8de coreutils/procps: Revert priority change since coreutils > busybox 455ff32 meta: more removals of redunant FILES_${PN}-dbg e0890b6 meta: Drop now pointless manual -dbg packaging b7766e4 package: Add auto package splitting of .debug files 89f13c7 meta/conf/toasterconf.json: remove SDKMACHINE variable as it no longer used 03d715e bitbake: toaster: tables Set a default order for the software recipes table 4ff0d60 bitbake: toaster: rework checking of Django version 4a78416 bitbake: toaster: monkey patch Queryset c1c8eff bitbake: toaster: removed extra calls of migrate 507aafb bitbake: toaster: work around 'database is locked' error 322b470 bitbake: toaster: fixed format strings 84daa40 bitbake: toaster: use OneToOneField instead of ForeignKey c464f34 bitbake: toaster: Amend regex for MySQL database URLs f001a4a bitbake: toaster: Remove compatible_layerversions() method 0adffdf bitbake: toaster: Check Django version against toaster-requirements.txt 8d058cf bitbake: toaster: Update deprecated manage.py command 717c636 bitbake: toaster: Prevent deprecation warnings for RedirectView 0f602c1 bitbake: toaster: Update API used to make runbuilds methods run in transactions 93f5738 bitbake: toaster: rename get_query_set -> get_queryset 23c4806 bitbake: toaster: Start Django machinery for database access 7a0c45e bitbake: toaster: Create default project with get_or_create* method 9de8dfa bitbake: toaster: Fix references to app paths 535fc9b bitbake: toaster: Remove South migrations 8ca4664 bitbake: toaster: Upgrade to Django 1.8.6 and remove South b322dec bitbake: toasterui: process SetBRBE event 0274b68 bitbake: toaster: trigger SetBRBE event fdb8e74 bitbake: toaster: implement BitbakeController.triggerEvent 5de3800 bitbake: event: Fix subprocess event error traceback failures 0da1d71 nopackages: Add class for recipes which don't generate packages 5003d14 sstate: Ensure populate_lic dependencies are not followed 48aad51 populate_sdk_ext/sign_rpm/sign_package_feed: Add missing getVar parameter 98dcdcb autoconf: Disable macro which causes excessive delays when using dash as sh 28fa304 automake: Remove delays in configure scripts using automake f5e681d site/common-linux: Add some macros to avoid sleeps during configure 93adf46 meta-yocto/conf/toasterconf.json: remove SDKMACHINE variable as it no longer used b3d6872 lttng-tools: Revert wrong enforcement of Python 3.0 use 2c11bdd attr: Add patch to account for use of internal glibc header f1c034b libpam: Fix build with musl 33bab59 openssl: Add musl configuration support c4207ee busybox: Add config for musl 083d9d1 gettext: Delete libintl.h and charset.alias 3a0797f sysvinit: Fix build with musl fd21402 musl: Add recipe 781d34f mtools: Use proper glibc override to add glibc packages to recommendations 1b90d67 squashfs-tools: Define FNM_EXTMATCH if not defined 36a709a mtd-utils: Backport and create patches to support musl 41fd73f gdb: Fix build with musl 1ee97d8 autoconf: Add musl support a2ea58b gcc: Add support for building musl configuration 37c74e2 gstreamer1.0: Split bash completion information into separate package fc32a3b attr: add attr dependency to attr-ptest 9205f0a valgrind: import Debian link_tool patch for MIPS c27bbb4 slang: update upstream URI to (official) jedsoft.org 21e35df subversion: update to 1.9.2 39260c3 json-c: add manual upstream version check 4ff0017 mirrors: replace references to archive.apache.org 1672a18 mobile-broadband-provider-info: update to current commit b699b15 nspr: update to 4.11 dec8d20 python-setuptools: update to 18.7.1 b3535e2 openssl: update to 1.0.2e fce2ee7 dropbear.inc: drop legacy CFLAGS and LD tweaks f87063b dropbear: update 2015.70 -> 2015.71 a520495 texinfo: don't create dependency on INHERIT variable 2b2774b sudo: upgrade to 1.8.15 5eb0e90 linux-firmware: update to latest revision bbe4917 c147782 bluez5: upgrade to 5.36 64c3a09 sudo: remove libdir INSANE_SKIP b407a80 libsdl: expand PACKAGECONFIG and enable native builds 39facf9 buildtools-tarball.bb: 32bit tools need pseudo 32bit library bc26a7d rpm: fix file conflicts for MIPS64 N32 01c0285 rpm: Enable MIPS64 N32 transactions a742586 bash: fix testcase run-coproc/run-execscript/run-test/run-heredoc failed a6bb872 cpio: fix test case of symlink-bad-length 787d82b linux-libc-headers: update default KORG_ARCHIVE_COMPRESSION bz2 -> xz 94c0332 linux-libc-headers.inc: remove '-e MAKEFLAGS=' from EXTRA_OEMAKE c7ad779 gcc-4.9: import patch fixing compilation in thumb mode 1260ded gcc-5.2: import patch fixing compilation in thumb mode b4db53a dropbear: Upgrade 2015.68 -> 2015.70 e0162c1 gcc-cross-initial: make dependency on gnu-config-native and autoconf-native explicit fccb128 weston-init: add a native systemd unit file a1fa8d9 python: Fix cross compiling issue c9fdc1b icu: Upgrade 55.1 -> 56.1 95909bc kernel.bbclass: drop unnecessary 'eval' from kernel_do_configure() ec79a19 insane: in libdir test allow libraries in libexecdir 9c0186f rootfs.py: Change logic to unistall packages 23083e7 oeqa/systemd: get runtest target boot time and log c6330a2 oeqa/systemd: journalctl helper function 220a78b scripts: oe-selftest Added new features. 98d2485 oe-buildenv-internal: preserve existing BB_ENV_EXTRAWHITE 9cab798 toolchain-shar-extract.sh: fix ~ not working in path f27401d nativesdk-buildtools-perl-dummy: properly set PACKAGE_ARCH 5e3e2e0 poky.conf: Bump for 2.1 development 7e8ff7b bitbake: toaster: toasterui Add ParseStarted/ParseProgress events to mask f823601 build-appliance-image: Update to master head revision 992e577 linux-yocto: Update genericx86* BSPs to v4.1.13 b4f6950 cmake: Add nios2 support 27b9f04 boost: adjust hard-coded path after python3 upgrade 639cadd sdk.py / OpkgSdk: remove_packaging_data() after install fd4894f devtool: extract: update SRCTREECOVEREDTASKS for kernel 34f1d81 devtool: extract: copy kernel config to srctree 6650357 lib/oe/package_manager: Introducing PACKAGE_FEED_BASE_PATHS/PACKAGE_FEED_ARCHS d7baeb5 selftest/wic.py: Add test for custom bootloader config 8612f26 directdisk-bootloader-config.wks: Add example for custom bootloader config c59dc3b wic/help.py: Document the new option "configfile" 7033873 wic: Allow to use a custom config for bootloaders f95f729 wic/utils/misc.py: Added function to search for files in canned-wks 9773faa wic: Prepare wicboot to allow custom bootloader config 4515186 package_ipk: allow to specify OPKG_ARGS in local.conf 7cf7156 systemd.bbclass: Allow enabling of parameterised services 551cda0 base: check for existing prefix when expanding names in PACKAGECONFIG c093fd8 linux-yocto/4.1: Fix kernel oops on qemuarm boot cda3905 toolchain-shar-extract.sh: ensure cleaned environment will work for ext SDK f9384b0 bitbake: knotty: Enforce terminal line limit to stop crazy scrolling 7a775a1 initramfs-framework: create directory /var/run 2861399 libpcre: drop UPSTREAM_CHECK_ variables 35c28e3 libpcre: upgrade to 8.38 d50ef65 libpng: update 1.6.19 -> 1.6.20 (CVE-2015-8126) 2b736f2 ghostscript: add dependency for pnglibconf.h 976f0e3 package_regex.inc: split the rest of the entries to their recipes 74bfa62 package_regex.inc: split entries which blacklist specific versions to their recipes 75c6929 package_regex.inc: split sourceforge related entries to their own recipes cefeac2 package_regex.inc: split PyPi related entries to their own recipes aa5df2a package_regex.inc: split Debian-related entries into their own recipes 12ba5cc package_regex.inc: split GITTAGREGEX entries into recipe files 642e92f package_regex.inc: split entries with odd-even versioning into their own recipes 96eac69 package_regex.inc: deprecate the file b0bbea5 gstreamer: really fix the helper install race b822216 neard: fix libdir/libexecdir confusion cbfccc6 glibc: fix libdir/libexecdir path confusion d0577f9 sudo: handle libexecdir != libdir/PN. 6f837cc util-linux: Add ptest dbd02bd libav: Correctly handle prefix="" fda9859 libav: Add PACKAGECONFIG options: avdevice, avfilter, avplay, gpl 7ba85f1 libav: Remove deprecated --disable-avserver 2739ed0 busybox: backport upstream fixes for unzip 6decbbb qt4-4.8.7: fix build for mips n32 f1e8938 gstreamer1.0: Convert tests and valgrind config opts to PACKAGECONFIGs 11b9524 cracklib: fix for base_libdir == libdir d9f73ca libbsd: Upgrade to 0.8.0 10d6dc4 libcroco: Upgrade 0.6.8 -> 0.6.9 79b823a shared-mime-info: Upgrade 1.4 -> 1.5 f6ec8a4 xdg-utils: Upgrade to 1.1.1 a3f63f9 gsettings-desktop-schemas: Upgrade 2.16.1 -> 3.18.1 754f6b6 gnome-common: Upgrade 3.14.0 -> 3.18.0 75aba18 clutter-gtk-1.0: Upgrade 1.6.2 -> 1.6.6 c6a6212 clutter-gst-3.0: Upgrade 3.0.8 -> 3.0.14 2da6cd5 clutter-1.0: Upgrade 1.24.2 148c953 cogl-1.0: Upgrade 1.20.0 -> 1.22.0 f54d4e4 ghostscript: Add NIOS2 support 21ba42b harfbuzz: update 1.1.0 -> 1.1.2 058b91e xvideo-tests: move to the latest release 70d459c scripts/oe-pkgdata-util: sort the packages in list-pkg-files 80e3919 wic: insert local Python paths at front 9d788d7 toolchain-scripts.bbclass: unset command_not_found_handle 82ab99f waf.bbclass: remove unused parameter from get_waf_parallel_make() 68d3dfe toolchain-shar-extract.sh: proper fix for additional env setup scripts 0c5d239 base: Improve handling of switching virtual/x providers 3745479 bitbake: bitbake: rename REGEX, REGEX_URI, and GITTAGREGEX. dd282d4 bitbake: toaster: return back 'New project' button 2a8e970 bitbake: toaster: tests Update UI tests to work with 2.0 changes fe8a0a3 bitbake: toaster: tests Automated build-mode backend tests 0497b57 bitbake: toaster: unset environment variables 8b7a548 bitbake: toaster: get rid of complicated heuristics 556b8b6 bitbake: toaster: remove SDKMACHINE from project variables 4186f5b bitbake: toaster: stop using toaster-pre.conf 361faa3 bitbake: toaster: remove writeConfFile API fcbba5a bitbake: toaster: set varibales on bitbake server 993bc7e bitbake: toaster: implement BitbakeController.getVariable 53e981e bitbake: toaster: buildinfohelper Broaden the toaster created recipe data case 57e5f24 bitbake: toaster: do not create duplicate HelpText objects 4c1e5ec bitbake: toaster: remove usage of BUILD_MODE variable 9902895 bitbake: toaster: do not terminate bb server 58765a8 bitbake: toaster: remove stopBBServer API 95a3cf7 bitbake: toaster: reimplemented startBBServer method 76d53b5 bitbake: toaster: remove _setupBE function 87b2f95 bitbake: toaster: implement 'toaster restart-bitbake' 891484a bitbake: toaster: implement start_bitbake function bf25471 bitbake: toaster: implement stop_bitbake function 7c2b225 bitbake: toaster: update brbe and project attributes de812d0 bitbake: toaster: start 'manage.py runbuilds' in the script 28e8ccf bitbake: toaster: make runbuilds to loop a3871a3 bitbake: toaster: use parent of the build dir 2a96d35 bitbake: toaster: check for toaster configuration later d87a534 bitbake: toaster: remove unused variable dc6a489 bitbake: toaster: change toasterconf.json logic to use TEMPLATECONF, like oe-setup-builddir 5a42c2d bitbake: toaster: run bitbake the same way cac91db bitbake: toaster: set DATABASE_URL in toaster script a464bf2 bitbake: toaster: implement get-dburl command e473151 bitbake: toaster: don't allow to run toaster as a script 4de214f bitbake: lib/bb/utils: improve edit_bblayers_conf() handling of bblayers.conf formatting 0debb11 bitbake: lib/bb/utils: fix error in edit_metadata() when deleting first line 9d19dd9 bitbake: wget.py: parse only <a> tags 71ede7b bitbake: toaster: toastergui tests Add generic test for ToasterTables widget 34b22cf bitbake: toaster: tables Fix invalid field name on NewCustomImagesTable 1c59846 bitbake: toaster: tables Add default_orderby field where it was missing or unset d82c541 bitbake: toaster: CustomImageRecipe add search_allowed_fields to this model bdf6241 bitbake: toaster: machines table Fix missing layers information needed for filter b90a8dc bitbake: toaster: tablejs Make sure click handlers consume click event c075bcf bitbake: toaster: projectpage Make sure build targets are space separated 698c74c libsdl: remove redundant configure_tweak patch 35945fd iw: upgrade to version 4.3 15969ae gstreamer1.0-plugins-good: fix PACKAGECONFIG for gudev and add one for v4l2 and libv4l2 e601b38 gstreamer1.0-plugins-bad: fix dependencies for uvch264 PACKAGECONFIG ddf2501 gudev: Add from meta-oe e406fa8 lsb: fix installed-vs-shipped for mips 39ecdce rpm: fix for N32 MIPS64 09b4da6 glibc/0029-fix-getmnt-empty-lines.patch: fix getmntent() 1781a9a init-install-efi: fix script for eMMC installation f808747 init-install-efi: fix script for gummiboot loader 2a55036 linux-firmware: rtl8192cx: Add latest available firmware b60af3b libsdl2: add missing dependency on libxkbcommon for PACKAGECONFIG[wayland] ed31874 libxml2: upgrade to 2.9.3 ecb1c71 libxml2: merge pointless bb/inc split 19a626d openssh: redesign ssh-agent.sh regression test case 81b59e7 gcr: Require x11 DISTRO_FEATURE 934e486 psplash: update to latest git version ccb2a57 sysvinit-inittab: Add wrapper script to verify console exists b7f610d linux-yocto/4.1: Bluetooth:Fix the connection fail of 6lowpan over BT LE d08e761 linux-yocto-rt/4.1: update to -rt15 6aa464c linux-yocto/4.1: fsl-mpc8315e-rdb: Enable EEPROM bd29006 linux-yocto/4.1: update to v4.1.13 5561407 uClibc: enable utmp for shadow compatibility 533fc01 glibc: Backported a patch to fix glibc's bug(18589) 598e372 ncurses: update SRC_URI 51b64ee openssl: enable parallel make 88e45cd busybox: enable resize applet 87de4a1 busybox: disable support for mounting NFS file systems on Linux < 2.6.23 73cc839 busybox: update 1.23.2 -> 1.24.1 f8ac408 busybox: re-order defconfig to align with busybox 1.24.1 3648a37 busybox.inc: remove '-e MAKEFLAGS=' from EXTRA_OEMAKE bf28ea9 busybox.inc: set CC=${CC} via make command line f21dce1 busybox.inc: fix CONFIG_EXTRA_CFLAGS configmangle 6167669 busybox.inc: don't set .config CROSS_COMPILER_PREFIX e1ecccd busybox: move EXTRA_OEMAKE etc into busybox.inc 0e63300 busybox.inc: don't export EXTRA_OEMAKE 3735776 busybox_git: Enable getopt applet b1774f4 harfbuzz: update 1.0.6 -> 1.1.0 31f803a sqlite3: update 3.9.0 -> 3.9.2 7e3474c readline: apply missing upstream patches 99b9d52 readline: prepare for readline6.3 upstream patches e0b6d0c dbus: merge .bb and .inc d99958a pulseaudio: Fix HDMI profile selection 2ba954f initscripts: hide the error in case system is not writeable 4ed84ff nativesdk-buildtools-perl-dummy: fix rebuilding when SDKMACHINE changes b8fdd09 xf86-video-vmware: Add vmwgfx PACKAGECONFIG option dfd5c4d pkgconfig: merge .bb and .inc 61c6887 pkgconfig: upgrade to version 0.29 744e89f ofono: upgrade to version 1.17 996f843 libxml2: remove legacy LDFLAGS += "-ldl" workaround dedabc1 apr: fix LTFLAGS to make it work with ccache 9470956 iproute2: install bridge tool by default 1b8f6a2 lttng-tools: add libgcc to RDEPENDS 22dd6e7 lttng-tools: Upgrade to 2.7 release ef73f21 lttng-tools: Drop unused patch c375976 lttng-ust: Upgrade to 2.7 release f5c1b57 lttng-modules: Upgrade to 2.7 release 8d708a5 libunistring: upgrade to version 0.9.6 f840e59 libtasn1: upgrade to 4.7 012ca02 wpa-supplicant: upgrade to 2.5 872e153 mesa: Make gl libraries RRECOMMEND mesa-megadriver a62fa23 directfb.inc: force bfd linker for armv7a 9b075ca libpng12: update to 1.2.54 6d1eb34 libpng: update to 1.6.19 92a881f orc: update to 0.4.24 2f479b1 libpcap: update to 1.7.4 bd4058f apr-util: add missing RDEPENDS for ptest 1408642 iproute2: update to 4.3.0 e677c25 ruby-native: Depend on openssl-native 9e37812 db: fix race issue for libdb-6.0.la c19036a pango: use ptest-gnome 43b29d9 gst-plugins-bad: improve FILES variables 9fc877f gstreamer1.0-plugins-base: add PACKAGECONFIG for libvisual 7a2bb0d python3: fix building nativesdk-python3 2268a70 python3: Upgrade from 3.4.3 to 3.5 ed8d1be python-git: Add missing dependency dee2a8c guile, mailx, gcc, opensp, gstreamer1.0-libav, libunwind: disable thumb where it fails for qemuarm c0b822f icu: force arm mode f42ef3f rpcbind: Security Advisory - rpcbind - CVE-2015-7236 04034e7 subversion: fix CVE-2015-3187 f91aedf subversion: fix CVE-2015-3184 40cd228 oeqa/sshcontrol: don't source profile d39192a oeqa/runtime/multilib: refactor ELF class extraction cc34104 oe-selftest: Enable code coverage on unit tests 06859de meta/conf/machine: use ' inside quoted values 6be94ec runqemu-internal: Replace wacom-tablet with tablet for usbdevice 0cc3810 recipetool: make plugin registration function name consistent with devtool b381f80 recipetool: add setvar subcommand 1fbd760 lib/oe/recipeutils: refactor patch_recipe_file() to use edit_metadata() 0b850cb devtool: clarify help text 5001f23 devtool: build: enable showing default task in help f79022d devtool: build: use bbappend to set PARALLEL_MAKE 21481bc lib/oe/recipeutils: check in validate_pn() for names instead of filenames 671f41e devtool: ensure we change back to the original dir on error 74505b4 devtool: search: print SUMMARY value 3f46af2 devtool: drop unused plugin_init() functions 176211a devtool: package: use DEPLOY_DIR_<pkgtype> to get deploy directory 0fe7426 devtool: disable creating workspace for extract and search subcommands a360fa7 lib/oe/patch: improve extraction of patch header f79cc4d devtool: upgrade: provide a means to update the source branch b4d4d21 devtool: upgrade: fetch remote repository before checking out new revision 9b7d45c devtool: upgrade: remove erroneous error when not renaming recipe 9a70444 devtool: upgrade: fix updating PV and SRCREV 6a52c73 devtool: upgrade: fix removing other recipes from workspace on reset 44ef78a devtool: include do_patch in SRCTREECOVEREDTASKS 804f5b8 image.py: avoid mkdir race when building multiple images 312862f package_manager.py: define info_dir and status_file when OPKGLIBDIR isn't the default b00f734 image.py: Avoid creating empty .env file in _write_wic_env a88505b lib/oe/terminal: use C locale when determining version 8d784ba toolchain-shar-extract.sh: Ensure it's ran in clean environment 7f3c20f toolchain-shar-extract.sh: do not allow $ in paths for ext SDK 2d21e5d create-pull-request: handle empty ODIR c63b36f scripts/gen-lockedsig-cache: improve output 67af6d6 wic: exec_native_cmd: implement support for pseudo 8ffba25 toolchain-shar-relocate: don't assume last state of env_setup_script is good b8ee7ae sanity: don't enforce DISPLAY for testimage b364183 oeqa/qemurunner: pass nographic to runqemu if DISPLAY isn't set 46755cc base: add automatic dependency on lzip-native for .lz SRC_URI 6ea39c2 base: decode SRC_URI before adding implicit fetch dependencies eded9c2 buildhistory.bbclass: support extending the content of the build history d95df11 license.bbclass: Create image license manifest efdab52 license.bbclass: Add function get_deployed_files cc0d044 license.bbclass: Added function get_deployed_dependencies d45e10e license.bbclass: Added get_boot_dependencies function 8b1e7bc license.bbclass: Split license create manifest 1a210e6 license.bbclass: Write recipeinfo file in license folder 74c7cd5 populate_sdk_ext.bbclass: Be more permissive on the name of the buildtools 5ba6382 populate_sdk_base: Add sysroot symlink check 7fed655 classes/populate_sdk_ext: fail if SDK_ARCH != BUILD_ARCH 2948169 classes/populate_sdk_ext: tweak reporting of workspace exclusion 28a2ea7 classes/populate_sdk_ext: make it clear when SDK installation has failed 124c6aa classes/populate_sdk_ext: tidy up preparation log file writing d348624 boot-directdisk.bbclass: remove HDDIMG before create 03f15e5 sstate: Ensure siginfo and sig files are also touched 615ccae weston: Add PACKAGECONFIG option for colord CMS cdad67c opkg: add cache filename length fixes 2ec77de openjade-native: statically link local libs 29747d4 sysklogd: inhibit updatercd for non-sysvinit add3451 connman: depend on readline 7a557a2 latencytop: obey LDFLAGS 8aeec87 tcf-agent: obey LDFLAGS 9025d2e blkspace: fix ldflags for iowatcher 1732a8a bluez5: enable sysvinit support 160fdd8 sysprof: use packageconfig for the gui 425d020 mc: upgrade to 4.8.15 7386647 packagegroup-core-directfb: Don't depend on pango-modules ac5ed8e xkeyboard-config: Upgrade 2.15 -> 2.16 3a71fab xkbcomp: Upgrade 1.3.0 -> 1.3.1 b7cb308 xinput: Upgrade 1.6.1 -> 1.6.2 05eca73 xf86-video-omap: Upgrade 0.4.3 -> 0.4.4 cfcc5e5 xf86-input-synaptics: Upgrade 1.8.2 -> 1.8.3 4c9256f xf86-input-evdev: Upgrade 2.9.2 -> 2.10.0 96ddcc5 xorg-driver-input: add xorg configuration to FILES a1003f5 xserver-xorg: Upgrade 1.17.2 -> 1.18.0 a336b8a libxcb: Remove unused git-version of the recipe 05ba0db libxcb: Upgrade 1.11 -> 1.11.1 44233d3 pixman: Upgrade 0.32.6 -> 0.32.8 7ab0466 libxi: Upgrade 1.7.4 -> 1.7.5 63feef0 gtk-icon-utils-native: Upgrade 3.16.6 -> 3.18.2 38924d9 package_regex.inc: Add gtk-icon-utils-native 060b482 gtk+3: Upgrade 3.16.6 -> 3.18.2 4f3d2b3 adwaita-icon-theme: Upgrade 3.16.2.1 -> 3.18.0 c8849ac librsvg: Upgrade 2.40.10 -> 2.40.11 81769ca pango: add RPROVIDES for removed packages c9b06f5 pango: Upgrade 1.36.8 -> 1.38.1 ced8d49 gdk-pixbuf: Upgrade 2.30.8 -> 2.32.1 918c773 libsoup-2.4: Upgrade 2.50.0 -> 2.52.1 5bd9305 at-spi2-atk: Upgrade 2.16.0 -> 2.18.1 8eb0c8f atk-spi2-core: Upgrade 2.16.0 -> 2.18.1 78130eb atk: Upgrade 2.16.0 -> 2.18.0 e7141ab glib-networking: Upgrade 2.44.0 -> 2.46.1 fcd7494 glib-2.0: build dependency cleanup 5357764 glib-2.0: Enable more tests while cross-compiling 1e271af glib-2.0: Upgrade 2.44.1 -> 2.46.1 bc1be07 qemu: Backport malloc-trace disabling bca5a7a logrotate: do not move binary logrotate to /usr/bin 0069c0d systemd: drop unneeded $D check in prerm cd1f2b4 systemd: chown hwdb.bin to root:root for do_rootfs 7ca8cd9 systemd: for valgrind, define VALGRIND=1 46fa8ab systemd: make coredump a PACKAGECONFIG ac34784 systemd: add machine-id to conffiles 04937cc systemd: ignore .so filenames in systemd-doc 6821854 systemd: fix Upstream-Status tag 82107b1 mdadm: fix CFLAGS and ptest issues d8adfd2 gcc-4.9: Fix various _FOR_BUILD and related variables 8ae27fa devtool: add sync command 6bfa1dc boost.inc: remove unused parameter from get_boost_parallel_make() 16d7bfd wireless-tools: remove unused files ee923bf gstreamer1.0: fix install race 0ae52c8 gcc-multilib-config: make aarch64 support multilib 8514d21 libxml2: fix CVE-2015-7942 and CVE-2015-8035 e864f71 terminal: Open a new window instead of split on older tmux versions (<1.9) 5056581 flex: fix test-bison-yylval and test-bison-yylloc failed c54540e gdbm 1.8.3: install libgdbm_compat b9f87ed harfbuzz: update to 1.0.6 3f75537 ethtool: bump version to 4.2 9a4da3c openssl: fix ptest issues 9163a5d base-files: stage /etc/skel d60c5ff mktemp: raise the priority to avoid conflicting with coreutils b06eacd libunwind: fix build for qemuarm c4acace gma500_gfx: Avoid inserting gma500_gfx module for certain devices 6c3f680 libsndfile: fix CVE-2014-9756 aa07eb1 python-pycurl: update version to 7.19.5.2 696aa7e rt-tests: upgrade to version 0.96 6ec7dc2 rpcbind: don't use '-w' for starting rpcbind eddd88f libsecret: add dependency on intltool-native 2e8efb1 openssl: use subdir= instead of moving files in do_configure_prepend() 036d2dc openssl: sanity check that the bignum module is present cf366d8 libsdl2: require GLES when building Wayland support 4b38be6 meta: add some missing Upstream-Status tags to patches 42c75cd weston: delete unused patch 521fac6 glibc: fix Upstream-Status tag 44a7bbc linux-firmware: package Broadcom BCM4339 firmware f9d51cd libusb1: fix make install race cb01f6d libusb1: upgrade from 1.0.19 to 1.0.20 b4e6f63 perl: fix spaces in brackets while using CC version a59d019 u-boot: Update to 2015.10 release e67c5b0 bitbake-prserv-tool: check file name 4e2c5e1 recipetool.append: don't choke on a trailing ; in a url a35f79d yocto-bsp: Set SRCREV meta/machine revisions to AUTOREV 9d585b5 yocto-bsp: Set KTYPE to user selected base branch 1542c2a yocto-bsp: Typo on the file extension f674ffa yocto-bsp: Avoid duplication of user patches ({{=machine}}-user-patches.scc) 49a465c package_manager.py: Delete installed_pkgs.txt file ace895d rootfs.py: Stop using installed_pkgs.txt ccb1616 lib/oe/distro_check: don't set empty proxy keys 8137a84 lib/oe/copy_buildsystem: Don't expand BB_TASKDEPDATA a6c68d8 oeqa/selftest/sstatetests: prettier output for allarch test 92328b4 oeqa/selftest/signing: Added new test for signing sstate. fbb03a8 oeqa/selftest/signing: New test for Signing packages in the package feeds. 13a4c38 qemu.bbclass: fix vardeps of QEMU_OPTIONS 51bd011 qemu.bbclass: correct the fsl ppc QEMU_EXTRAOPTIONS 753f31e autotools: Allow recipe-individual configure scripts e281791 allarch: Force TARGET_*FLAGS variable values e28e17e distro/maintainers.inc: include stress package details 76d2e46 image_types: improve wks path specification 70ae7a6 insane.bbclass: Avoid libdir QA check if PACKAGE_DEBUG_SPLIT_STYLE='debug-file-directory' cf0dfdb classes/cpan-base: fix libdir for nativesdk a205c4c bbclass: fix spelling mistakes cf218e5 rootfs_*.bbclass: don't add BUILDNAME to do_rootfs vardepsexclude 7d8616c insane: Don't depend on BB_TASKDEPDATA a9cc27e kernel: fix race condition between compile_kernelmodules and shared_workdir fecb077 classes: Ensure pass setVar/setVarFlag strings, not integers 9167f20 classes/license: fix intermittent license collection warning 43c8867 classes/metadata_scm: fix git errors showing up on non-git repositories 59b27d5 sstate: respect GPG_BIN and GPG_HOME 4415dc5 archiver.bbclass: add bbappend when do_ar_recipe kernel and gcc packages 2f0ff3a archiver.bbclass: fix previous issue regarding work-shared for linux-yocto 0cc4eef waf.bbclass: filter out non -j from PARALLEL_MAKE 95719b0 ptest-gnome: extend EXTRA_OECONF in all builds, not just target 1b25a70 yocto-project-qs, ref-manual, poky.ent: CentOS Package updates 2e649d7 dev-manual: Updated runqemu command options list bd62289 toaster-manual: Removed SDKMACHINE from the json file example. c674cd7 ref-manual: Updated list of supported distros. 33d8cff ref-manual: Updated the GCC 5 migration section for 2.0 d9aabf9 gcc: Drop 4.8 2cb1aee layer.conf: Correct gcc-cross dependency 88f9310 bitbake: toaster: builds pages Fix the download cooker log link d04af8b bitbake: toaster: project pages Link to image recipes table in notifications 70465c7 bitbake: toaster: tests: Re-write some cases to make them more maintainable 536b73f bitbake: data_smart: Only support lowercase OVERRIDES fb01a66 bitbake: fetch2: Remove crazy code in unpack 7db88aa bitbake: parse: Don't try to expand __base_depends/__depends 4c04ce0 bitbake: cache: Don't try to expand __inherit_data 9d8e36a bitbake: toaster: localhostbectrl Pass DATABASE_URL in via the process environment 4677d8b bitbake: toaster: Remove the new-build-input button widget 55f4494 bitbake: toaster: projecttopbar Use the project in context to get num builds e9d4962 bitbake: toaster: projectpage Disable/Enable build input if we have 0 layers 5fa4c73 bitbake: toaster: orm Fix get_number_of_builds to count all apart from IN_PROGRESS c4032f4 bitbake: codeparser: Only load the codeparser cache once e3b66c1 maintainers: mass reassign and cleanup 37ddd3e Revert "local.conf.sample: Disable image-prelink by default" 9cc221d yocto-bsp: Default kernel version to 4.1 on x86_64 7100c42 scripts: runqemu: remove QEMUARCH from help message f47e4ad cairo: update 1.14.2 -> 1.14.4 603b4de cairo.inc: drop obsolete CFLAGS += "-ffat-lto-objects" workaround e8833a6 cmake: update 3.3.1 -> 3.3.2 8b2b068 oe-selftest: add test for bitbake-layers show-recipes 480bbae oeqa/selftest/layerappend: fix test if build directory is not inside COREBASE a301f6e oeqa/selftest/devtool: fix test if build directory is not inside COREBASE fd6bf77 classes/distrodata: split SRC_URI properly before determining type 7cebff6 classes/buildhistory: split package history values only once 10fc534 conf/distro/include: drop old recipes from include files 37cfd80 gitignore: fix overzealous exclusion 1f6599b meta: Fix typos in Upstream-Status labels 7cace4c meta/conf/layer.conf: fix typo ca8e1e5 texinfo-dummy-native: set SUMMARY instead of DESCRIPTION 64cd113 gstreamer1.0-meta-base: set SUMMARY instead of DESCRIPTION 1d42d59 mmc-utils: set SUMMARY instead of DESCRIPTION 6692540 swig: set SUMMARY instead of DESCRIPTION 47ae8eb alsa-plugins: set SUMMARY instead of DESCRIPTION eac5fa9 tzcode-native: set SUMMARY instead of DESCRIPTION 0a30a1f linux-yocto.inc: set SUMMARY instead of DESCRIPTION 19e1a73 python-nose: add SUMMARY b5f58c1 stress: add SUMMARY 5f9392a libunwind: add SUMMARY 1460e01 gptfdisk: add SUMMARY 0821c36 verify-homepage: fix recipe file selection 0c48921 verify-homepage: tidy up output and comments 0e348e7 verify-homepage: get expanded HOMEPAGE value caaca00 verify-homepage: use scriptpath to find bitbake path 649b6bc libaio: don't disable linking to the system libraries 11a9c24 runqemu: don't specify IP when starting a VNC server 3b95964 qemurunner: Remove the timeout in run_serial bbd6d07 libxslt: CVE-2015-7995 a0d2ea9 gstreamer1.0-rtsp-server: upgrade to version 1.6.1 2459ec2 gstreamer1.0-libav: upgrade to version 1.6.1 bce06e7 gstreamer1.0-plugins-ugly: upgrade to version 1.6.1 0ec3c62 gstreamer1.0-plugins-bad: upgrade to version 1.6.1 ba1bc63 gstreamer1.0-plugins-good: upgrade to version 1.6.1 4a55d12 gstreamer1.0-plugins-base: upgrade to version 1.6.1 8360f23 gstreamer1.0: upgrade to version 1.6.1 8800033 prelink: Fix various prelink issues on IA32, ARM, and MIPS. 920fb96 gcc: Update default Power GCC settings to use secure-plt 7b1763a glibc: Fix ld.so / prelink interface for ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA e63e191 qemurunner: Enable timestamps on kernel boot-up a1ca788 openssl: fix mips64 configure support 5a10a6f at: modify sources in do_patch 78e0598 unzip: rename patch to reflect CVE fix b80935a readline: rename patch to contain CVE reference 86d84ff qemu: upgrade to 2.4.0.1 4f0d756 gnome-desktop-testing: fix ptest output format 834de84 default-distrovars: remove less from WHITELIST_GPL-3.0 29bba95 lsof: don't export EXTRA_OEMAKE 3d37768 cmake.bbclass: don't duplicate CMAKE_C_FLAGS in CMAKE_C_FLAGS_RELEASE efc07c2 rm_work.bbclass: Exclude do_rootfs stamp removal 5f9d16b cairo: fix license for cairo-script-interpreter 7328479 openssh: enable X11Forwarding if distro feature x11 is set adeb820 acpid: Upgrade to 2.0.25 781dfd8 libidn: 1.30 -> 1.32 351c69a sqlite: 3.8.10.2 -> 3.9.0 c0fe43c rt-tests: bump to v0.94 cf972f9 gbm: Fix "configure: error: gbm requires --enable-dri" 17733cc xinetd: install xinetd supported services configuration aa1844e combo-layer: introduce ability to exclude component from mass update dcc446f linux-dtb.inc: refactor common code to function get_real_dtb_path_in_kernel af9c7a4 linux-dtb.inc: refactor common code to function normalize_dtb 7eecb81 linux-dtb.inc: explicit test for empty string not needed 54df911 ptest-runner: Allow running of specific tests 54325b2 oeqa/testimage: Add support for test folder export. ecbe135 oeqa/runtime/multilib: run the arch tests on connmand not connman-applet 2d1071e oeqa/runtime: remove dmesg test 42a5378 nfs-utils/statd: fix a segfault 77e3246 qemu: enable user mode for mips64 and mips64el 70600fb gnupg: fix find-version for beta checking ab123ef rpm: define EM_AARCH64 for debugedit af8c136 xserver-xorg: drop empty ${PN}-security-policy package b667067 xserver-xorg: add Xwayland RRECOMMENDS 80f4d71 weston: add a PACKAGECONFIG option for xwayland support 883ab0f systemd: make dbus an optional build time dependency 2c5047f weston: add PACKAGECONFIG to build with systemd-login support 65ffeb5 systemd: add PACKAGECONFIG to build with compatibility libraries 4b29c80 os-release: put double-quotes around variable contents 0f516a5 cpio: fix testcase symlink-bad-lengths [ LIN8-947 ] bceb9cb cpio: Fix symlink-bad-length test for 64-bit [ LIN8-947 ] architectures. 0ff3fc7 gtk+3: fix ALTERNATIVE_PRIORITY conflict with gtk+ eca12a6 coreutils: fix ALTERNATIVE_PRIORITY conflict with procps and mktemp 8de5315 util-linux: fix ALTERNATIVE_PRIORITY conflict with ncurses procps and e2fsprogs 3befb43 console-tools: fix ALTERNATIVE_PRIORITY conflict with kbd 5385ea8 debianutils: fix ALTERNATIVE_PRIORITY conflict with which 3a0bd40 linux-dtb.inc: use same variable name DTB for all elements of KERNEL_DEVICETREE a879312 linux-dtb.inc: remove unneeded 'cd' a23d1ca webkitgtk: Add upstream patch to fix build problem 69836e8 python: don't append -D__SOFTFP__ to TARGET_CC_ARCH for armv6/armv7a 38d1d63 prexport.bbclass: avoid export for native and crosssdk d3da006 recipes: add distro_features_check for some packages 63690f0 scons.bbclass: SCons packages don't require do_configure bffdc65 busybox: Schedule mdev after mountall 13ce7c2 busybox: Fix mdev block device automounting b09f0f2 libarchive: rename patch to reflect CVE 116360f binutils: Fix XLP / Octeon 3 instruction clash fd4f4d2 binutils: Fix octeon3 disassembly patch REVERT: b1f23d1 build-appliance-image: Update to jethro head revision REVERT: 7fe17a2 qemu: Security fix CVE-2016-2198 REVERT: 50700a7 qemu: Security fix CVE-2016-2197 REVERT: 1f0e615 libgcrypt: Security fix CVE-2015-7511 REVERT: dc5f155 uclibc: Security fix CVE-2016-2225 REVERT: ef13511 uclibc: Security fix CVE-2016-2224 REVERT: ae57ea0 libbsd: Security fix CVE-2016-2090 REVERT: eb9666a glibc: Security fix CVE-2015-7547 REVERT: 5b12268 build-appliance-image: Update to jethro head revision REVERT: a3a374a curl: Secuirty fix CVE-2016-0755 REVERT: f4341a9 curl: Security fix CVE-2016-0754 REVERT: 35f4306 nettle: Security fix CVE-2015-8804 REVERT: 3e8a07b nettle: Security fix CVE-2015-8803 and CVE-2015-8805 REVERT: 5ffc326 socat: Security fix CVE-2016-2217 REVERT: 5cc5f99 libpng: Security fix CVE-2015-8472 REVERT: 21a816c libpng: Security fix CVE-2015-8126 REVERT: 6a0fbfa foomatic-filters: Security fixes CVE-2015-8327 REVERT: d57aaf7 foomatic-filters: Security fix CVE-2015-8560 REVERT: 941874a build-appliance-image: Update to jethro head revision REVERT: d74a3cb cross-localedef-native: add ABI breaking glibc patch REVERT: 12fae23 build-appliance-image: Update to jethro head revision REVERT: 67ac9d6 e2fsprogs: Ensure we use the right mke2fs.conf when restoring from sstate REVERT: 5812fc9 build-appliance-image: Update to jethro head revision REVERT: 3de2492 ref-manual: Updated host package install requirements CentOS REVERT: 79de8cf toaster-manual: Updated the "Installation" to have TOASTER_DIR information REVERT: a23d262 toaster-manual: Updated instructions for production setup. REVERT: b6def81 linux-yocto: Update SRCREV for genericx86* for 4.1, fixes CVE-2016-0728 REVERT: db0f8ac linux-yocto: Update SRCREV for genericx86* for 3.19, fixes CVE-2016-0728 REVERT: c8122a0 linux-yocto: Update SRCREV for genericx86* for 3.14, fixes CVE-2016-0728 REVERT: cdeb241 meta-yocto-bsp: Remove uvesafb (v86d) from generic x86 features REVERT: 52cd219 yocto-bsp: Set SRCREV meta/machine revisions to AUTOREV REVERT: a88d6cb yocto-bsp: Set KTYPE to user selected base branch REVERT: 4e74b36 yocto-bsp: Avoid duplication of user patches ({{=machine}}-user-patches.scc) REVERT: 6680773 yocto-bsp: Default kernel version to 4.1 on x86_64 REVERT: 4c075e7 piglit: don't use /tmp to write generated sources to REVERT: ee52ac6 gen-lockedsig-cache: fix bad destination path joining REVERT: e9f95df linux-yocto: Update SRCREV for qemux86* for 4.1, fixes CVE-2016-0728 REVERT: e63bab1 linux-yocto: Update SRCREV for qemux86* for 3.19, fixes CVE-2016-0728 REVERT: 64a4920 linux-yocto: Update SRCREV for qemux86* for 3.14, fixes CVE-2016-0728 REVERT: 5b043da libpng12: update URL that no longer exists REVERT: 655c8a5 libpng: update URL that no longer exists REVERT: 96fda8c busybox: fix build of last applet REVERT: ae037d9 ghostscript: add dependency for pnglibconf.h REVERT: 26eb877 gcr: Require x11 DISTRO_FEATURE REVERT: e632cdb uClibc: enable utmp for shadow compatibility REVERT: e8c9613 git: Security fix CVE-2015-7545 REVERT: 108ea6d glibc-locale: fix QA warning REVERT: 9a88c1d grub: Security fix CVE-2015-8370 REVERT: 443b09a gdk-pixbuf: Security fix CVE-2015-7674 REVERT: 6c91068 librsvg: Security fix CVE-2015-7558 REVERT: 9fd2349 bind: Security fix CVE-2015-8461 REVERT: 5a40d9f bind: Security fix CVE-2015-8000 REVERT: 1bbf183 libxml2: Security fix CVE-2015-8710 REVERT: 2ec6d1d libxml2: Security fix CVE-2015-8241 REVERT: 55aafb5 dpkg: Security fix CVE-2015-0860 REVERT: 029948b tzdata: update to 2016a REVERT: 2bcf141 tzcode: update to 2016a REVERT: cc3a391 kernel-yocto: fix checkout bare-cloned kernel repositories REVERT: 049be17 libpcre: bug fixes include security REVERT: 5e94ac7 qemu: Security fix CVE-2015-7295 REVERT: 7ee1828 qemu: Security fix CVE-2016-1568 REVERT: ca6ec2e qemu: Security fix CVE-2015-8345 REVERT: b55a677 qemu: Security fix CVE-2015-7512 REVERT: 4922f47 qemu: Security fix CVE-2015-7504 REVERT: 3ec0e95 qemu: Security fix CVE-2015-8504 REVERT: 942ce53 openssl: Security fix CVE-2016-0701 REVERT: ce8ae1c openssl: Security fix CVE-2015-3197 REVERT: 080e027 tiff: Security fix CVE-2015-8784 REVERT: c6ae9c1 tiff: Security fix CVE-2015-8781 REVERT: 049b7db bind: CVE-2015-8704 and CVE-2015-8705 REVERT: d632a92 rpmresolve.c: Fix unfreed pointers that keep DB opened REVERT: 5b993ed openssh: CVE-2016-1907 REVERT: 27ee5b4 glibc: CVE-2015-8776 REVERT: a4134af glibc: CVE-2015-9761 REVERT: e10ec6f glibc: CVE-2015-8779 REVERT: a5a965d glibc: CVE-2015-8777.patch REVERT: 2fb7ee2 bitbake: toaster: make runbuilds loop REVERT: b9ad87b nativesdk-buildtools-perl-dummy: Bump PR REVERT: 0a1c63a nativesdk-buildtools-perl-dummy: properly set PACKAGE_ARCH REVERT: d4b400e nativesdk-buildtools-perl-dummy: fix rebuilding when SDKMACHINE changes REVERT: 8c8c4ed Revert "gstreamer1.0-plugins-good.inc: add gudev back to PACKAGECONFIG" REVERT: b832202 Revert "gstreamer: Deal with merge conflict which breaks systemd builds" REVERT: dd0ba9e build-appliance-image: Update to jethro head revision REVERT: 325d205 gstreamer: Deal with merge conflict which breaks systemd builds REVERT: 53b114b build-appliance-image: Update to jethro head revision REVERT: 02be35d poky.conf: Bump version for 2.0.1 jethro release REVERT: f5551f8 ref-manual: Updated the list of supported image types. REVERT: aa179ae dev-manual: Added three new wic option descriptions. REVERT: 20007c8 dev-manual: Added the --overhead-factor wic option description. REVERT: 2dd7f46 dev-manual: Added the --extra-space wic option description. REVERT: 81cc737 dev-manual: Added wic --notable option description. REVERT: 2b1dce5 dev-manual: REVERT: a6f5293 kernel/kernel-arch: Explicitly mapping between i386/x86_64 and x86 for kernel ARCH REVERT: e79a538 openssh: update to 7.1p2 REVERT: b171076 devtool: reset: do clean for multiple recipes at once with -a REVERT: 255115f devtool: sdk-update: fix error checking REVERT: 3f69105 devtool: sdk-update: fix metadata update step REVERT: 5ba94af devtool: sdk-update: fix not using updateserver config file option REVERT: d03d145 classes/populate_sdk_ext: disable signature warnings REVERT: 00ff950 classes/populate_sdk_ext: fix cascading from preparation failure REVERT: 22446c6 scripts/oe-publish-sdk: add missing call to git update-server-info REVERT: 8597a61 devtool: use cp instead of shutil.copytree REVERT: 95cc641 buildhistory: fix not recording SDK information REVERT: 84d48ac recipetool: create: fix error when extracting source to a specified directory REVERT: 4369329 recipetool: create: detect when specified URL returns a web page REVERT: 4c3191f recipetool: create: prevent attempting to unpack entire DL_DIR REVERT: caca77e recipetool: create: fix do_install handling for makefile-only software REVERT: 383159e recipetool: create: avoid traceback on fetch error REVERT: be40baa recipetool: create: handle https://....git URLs REVERT: a897bfd devtool: sdk-update: fix traceback without update server set REVERT: 9c4b61e classes/populate_sdk_ext: error out of install if buildtools install fails REVERT: 4c07dd2 gstreamer1.0-plugins-good.inc: add gudev back to PACKAGECONFIG REVERT: 83b72d8 linux-yocto: Update Genericx86* BSP to 4.1.15 kernel REVERT: 44639bd libaio: don't disable linking to the system libraries REVERT: a0be9bd linux-yocto/4.1: update to v4.1.15 REVERT: 53f0290 libxml2: security fix CVE-2015-5312 REVERT: f4b0c49 libxml2: security fix CVE-2015-8242 REVERT: fb409c9 libxml2: security fix CVE-2015-7500 REVERT: 55d097a libxml2: security fix CVE-2015-7499 REVERT: 8e6b2d6 libxml2: security fix CVE-2015-7497 REVERT: 332eb1d libxml2: security fix CVE-2015-7498 REVERT: cbc4e83 libxml2: security fix CVE-2015-8035 REVERT: c4b71e1 libxml2: security fix CVE-2015-7942 REVERT: fdea03d libxml2: security fix CVE-2015-8317 REVERT: 6fc1109 libxml2: security fix CVE-2015-7941 REVERT: 9eb4ce0 openssl: fix for CVE-2015-3195 REVERT: 6880f82 openssl: fix for CVE-2015-3194 REVERT: 7dcaa84 openssl: fix for CVE-2015-3193 REVERT: 435139b logrotate: do not move binary logrotate to /usr/bin REVERT: 5f49c0a cairo: fix license for cairo-script-interpreter REVERT: a29ec81 glibc: Fix ld.so / prelink interface for ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA REVERT: b1e980f gcc: Update default Power GCC settings to use secure-plt REVERT: ed82690 prelink: Fix various prelink issues on IA32, ARM, and MIPS. REVERT: 9a620da autotools: Allow recipe-individual configure scripts REVERT: f828071 toolchain-scripts.bbclass: unset command_not_found_handle REVERT: 49858bd devtool: upgrade: fetch remote repository before checking out new revision REVERT: d213452 devtool: upgrade: remove erroneous error when not renaming recipe REVERT: fec97f6 devtool: upgrade: fix updating PV and SRCREV REVERT: 3b4f659 devtool: upgrade: fix removing other recipes from workspace on reset REVERT: 61a7de0 devtool: include do_patch in SRCTREECOVEREDTASKS REVERT: 82c0072 toolchain-shar-extract.sh: do not allow $ in paths for ext SDK REVERT: f181e72 scripts/gen-lockedsig-cache: improve output REVERT: 4b5d4ca toolchain-shar-extract.sh: proper fix for additional env setup scripts REVERT: d2ea8f1 toolchain-shar-relocate: don't assume last state of env_setup_script is good REVERT: 02ef437 populate_sdk_ext.bbclass: Be more permissive on the name of the buildtools REVERT: 3653b17 classes/populate_sdk_ext: fail if SDK_ARCH != BUILD_ARCH REVERT: 8879571 classes/populate_sdk_ext: tweak reporting of workspace exclusion REVERT: eeda3c6 classes/populate_sdk_ext: make it clear when SDK installation has failed REVERT: dee9fbe classes/populate_sdk_ext: tidy up preparation log file writing REVERT: d001d46 classes/license: fix intermittent license collection warning REVERT: 777451c classes/metadata_scm: fix git errors showing up on non-git repositories REVERT: cb0ca72 oeqa/selftest/layerappend: fix test if build directory is not inside COREBASE REVERT: 8970ad6 oeqa/selftest/devtool: fix test if build directory is not inside COREBASE REVERT: 4f7fdd0 classes/distrodata: split SRC_URI properly before determining type REVERT: 3b7df55 uninative.bbclass: Choose the correct loader based on BUILD_ARCH REVERT: f3d7c3f openssl: sanity check that the bignum module is present REVERT: 96b1b5c glibc: Backported a patch to fix glibc's bug(18589) REVERT: 7aecb57 directfb.inc: force bfd linker for armv7a REVERT: 75ca2c8 texinfo: don't create dependency on INHERIT variable REVERT: 02c7b3f package_manager.py: define info_dir and status_file when OPKGLIBDIR isn't the default REVERT: 003c94f libsdl2: require GLES when building Wayland support REVERT: ad6db01 gst-plugins-bad: add PACKAGECONFIGs for voamrwbenc, voaacenc, resindvd REVERT: f0d87fe gstreamer1.0-plugins-good: fix PACKAGECONFIG for gudev and add one for v4l2 and libv4l2 REVERT: 35f34a6 gstreamer1.0-plugins-bad: fix dependencies for uvch264 PACKAGECONFIG REVERT: 3b77e20 gstreamer1.0-plugins-{base,good}: update PACKAGECONFIGs REVERT: e2d4412 libunwind: fix build for qemuarm REVERT: ef69078 guile, mailx, gcc, opensp, gstreamer1.0-libav, libunwind: disable thumb where it fails for qemuarm REVERT: 4700e40 icu: force arm mode REVERT: 743ee04 libxcb: Add a workaround for gcc5 bug on mips REVERT: 8a3deca bitbake: fetch: use orig localpath when calling orig method REVERT: 0073b23 yocto-bsp: Typo on the file extension REVERT: 71dbbcd bsp-guide: Updated the license statement. REVERT: 41f1026 dev-manual: Correction to the KVM stuff in the runqemu commands. REVERT: 38e3c6e mega-manual: Added four new figures for GUI example. REVERT: b99ec28 poky.ent: Fixed POKYVERSION variable. REVERT: c670dc7 yocto-project-qs, ref-manual, poky.ent: CentOS Package updates REVERT: b968190 dev-manual: Updated runqemu command options list REVERT: 1278753 toaster-manual: Removed SDKMACHINE from the json file example. REVERT: 7b25b70 ref-manual: Updated list of supported distros. REVERT: d9423fb ref-manual: Updated the GCC 5 migration section for 2.0 REVERT: 347347a bitbake: lib/bb/utils: improve edit_bblayers_conf() handling of bblayers.conf formatting REVERT: 5935783 bitbake: lib/bb/utils: fix error in edit_metadata() when deleting first line REVERT: 7fdad70 rpcbind: Security Advisory - rpcbind - CVE-2015-7236 REVERT: 0cb2fa5 subversion: fix CVE-2015-3187 REVERT: 5b52e9b subversion: fix CVE-2015-3184 REVERT: 59bdde4 linux-firmware: rtl8192cx: Add latest available firmware REVERT: 8ad2bcc init-install-efi: fix script for gummiboot loader REVERT: c3087bd init-install-efi: fix script for eMMC installation REVERT: d2bf9fb pulseaudio: Fix HDMI profile selection REVERT: 0556c58 allarch: Force TARGET_*FLAGS variable values REVERT: e683dac libsndfile: fix CVE-2014-9756 REVERT: 092757e libxslt: CVE-2015-7995 REVERT: dab5555 unzip: rename patch to reflect CVE fix REVERT: 1753d4a readline: rename patch to contain CVE reference REVERT: 9dd3422 libarchive: rename patch to reflect CVE REVERT: 1401976 binutils: Fix octeon3 disassembly patch REVERT: a54a0db opkg: add cache filename length fixes git-subtree-dir: yocto-poky git-subtree-split: 8358e543ab95a1d2b1d19c1e944275daa17378c1 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'yocto-poky/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-eglibc-options-groups-support.patch')
-rw-r--r--yocto-poky/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-eglibc-options-groups-support.patch16842
1 files changed, 0 insertions, 16842 deletions
diff --git a/yocto-poky/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-eglibc-options-groups-support.patch b/yocto-poky/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-eglibc-options-groups-support.patch
deleted file mode 100644
index 0514e282e..000000000
--- a/yocto-poky/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-eglibc-options-groups-support.patch
+++ /dev/null
@@ -1,16842 +0,0 @@
-From 2a5d7bcf0ff791c95ee1388772408a1bf4454694 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 18 Mar 2015 01:33:49 +0000
-Subject: [PATCH 24/27] eglibc: Forward port eglibc options groups support
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- Makeconfig | 20 +-
- Makerules | 19 +
- argp/Makefile | 2 +
- argp/argp-fmtstream.c | 25 +-
- argp/argp-help.c | 13 +-
- argp/argp-namefrob.h | 2 +
- catgets/Makefile | 17 +-
- crypt/Makefile | 20 +-
- crypt/crypt-entry.c | 13 +
- crypt/crypt_common.c | 42 +
- crypt/crypt_util.c | 18 -
- csu/Makefile | 2 +
- debug/Makefile | 41 +-
- debug/segfault.c | 11 +-
- debug/tst-chk1.c | 7 +
- dlfcn/Makefile | 7 +-
- elf/dl-support.c | 3 +
- elf/rtld.c | 17 +-
- extra-lib.mk | 6 +-
- grp/Makefile | 5 +
- hesiod/Makefile | 6 +-
- iconv/Makefile | 7 +
- iconv/gconv_db.c | 3 +
- iconv/gconv_trans.c | 7 +
- iconv/iconv_prog.c | 8 +
- iconvdata/Makefile | 27 +-
- include/netdb.h | 4 +
- inet/Makefile | 22 +-
- intl/Makefile | 3 +-
- intl/dcigettext.c | 39 +-
- io/Makefile | 18 +-
- libidn/Makefile | 5 +-
- libidn/toutf8.c | 11 +-
- libio/Makefile | 66 +-
- libio/__fpurge.c | 2 +-
- libio/fileops.c | 10 +-
- libio/iofwide.c | 26 +
- libio/ioseekoff.c | 2 +-
- libio/ioseekpos.c | 2 +-
- libio/iosetbuffer.c | 4 +
- libio/libioP.h | 18 +-
- libio/wdummyfileops.c | 161 +
- locale/C-ctype.c | 20 +
- locale/Makefile | 41 +-
- locale/catnames.c | 48 +
- locale/dummy-setlocale.c | 33 +
- locale/localeinfo.h | 2 +-
- locale/programs/charmap-dir.c | 6 +
- locale/programs/ld-collate.c | 17 +-
- locale/programs/ld-ctype.c | 27 +-
- locale/programs/ld-messages.c | 5 +
- locale/programs/ld-time.c | 31 +-
- locale/programs/linereader.c | 2 +-
- locale/programs/localedef.c | 8 +
- locale/programs/locfile.c | 5 +-
- locale/programs/locfile.h | 59 +-
- locale/setlocale.c | 30 -
- locale/xlocale.c | 37 +
- localedata/Makefile | 35 +-
- login/Makefile | 17 +-
- malloc/Makefile | 10 +-
- malloc/memusage.c | 7 +-
- malloc/memusage.sh | 2 +-
- math/Makefile | 6 +-
- misc/Makefile | 25 +-
- misc/err.c | 11 +
- misc/error.c | 5 +
- misc/tst-efgcvt.c | 2 +-
- nis/Makefile | 31 +-
- nptl/Makefile | 28 +-
- nptl/pthread_create.c | 5 +
- nscd/Makefile | 33 +-
- nscd/nis_hash.c | 3 +
- nss/Makefile | 67 +-
- nss/fixed-nsswitch.conf | 22 +
- nss/fixed-nsswitch.functions | 121 +
- nss/gen-fixed-nsswitch.c | 803 +++
- nss/getent.c | 46 +-
- nss/getnssent_r.c | 9 +-
- nss/nsswitch.c | 109 +-
- nss/nsswitch.h | 18 +-
- posix/Makefile | 94 +-
- posix/bug-regex1.c | 3 +
- posix/bug-regex6.c | 8 +-
- posix/fnmatch.c | 6 +-
- posix/fnmatch_loop.c | 23 +-
- posix/glob.c | 15 +-
- posix/regcomp.c | 98 +-
- posix/regex.h | 11 +
- posix/regex_internal.c | 45 +-
- posix/regex_internal.h | 23 +-
- posix/regexec-compat.c | 39 +
- posix/regexec.c | 71 +-
- posix/xregex.c | 8215 +++++++++++++++++++++++++++++++
- pwd/Makefile | 2 +
- resolv/Makefile | 21 +-
- stdio-common/Makefile | 35 +-
- stdio-common/_i18n_number.h | 13 +
- stdio-common/fxprintf.c | 5 +
- stdio-common/printf_fp.c | 22 +
- stdio-common/printf_fphex.c | 13 +
- stdio-common/printf_size.c | 8 +
- stdio-common/scanf14.c | 3 +
- stdio-common/tst-popen.c | 3 +
- stdio-common/tst-sprintf.c | 4 +-
- stdio-common/tstdiomisc.c | 5 +
- stdio-common/vfprintf.c | 31 +-
- stdio-common/vfscanf.c | 53 +-
- stdlib/Makefile | 34 +-
- stdlib/strtod_l.c | 13 +
- stdlib/tst-strtod.c | 5 +
- streams/Makefile | 5 +-
- string/Makefile | 14 +-
- string/strcoll_l.c | 5 +
- string/strerror_l.c | 5 +
- string/strxfrm_l.c | 5 +
- string/test-strcmp.c | 28 -
- string/tst-strxfrm.c | 3 +
- string/tst-strxfrm2.c | 3 +
- sunrpc/Makefile | 44 +-
- sysdeps/arm/Makefile | 5 +-
- sysdeps/generic/ldsodefs.h | 8 +
- sysdeps/gnu/Makefile | 3 +-
- sysdeps/ieee754/ldbl-opt/Makefile | 27 +-
- sysdeps/ieee754/ldbl-opt/nldbl-compat.c | 40 +-
- sysdeps/ieee754/ldbl-opt/nldbl-compat.h | 24 +-
- sysdeps/nptl/Makefile | 3 +
- sysdeps/nptl/bits/libc-lock.h | 45 +
- sysdeps/nptl/bits/libc-lockP.h | 50 +-
- sysdeps/nptl/small-macros-fns.c | 72 +
- sysdeps/unix/sysv/linux/gethostid.c | 6 +
- sysdeps/unix/sysv/linux/libc_fatal.c | 3 +
- time/Makefile | 18 +-
- time/strftime_l.c | 12 +-
- time/strptime_l.c | 14 +-
- timezone/Makefile | 2 +-
- wcsmbs/Makefile | 27 +-
- wcsmbs/wcsmbsload.c | 13 +
- wctype/Makefile | 14 +-
- 139 files changed, 11363 insertions(+), 583 deletions(-)
- create mode 100644 crypt/crypt_common.c
- create mode 100644 libio/wdummyfileops.c
- create mode 100644 locale/catnames.c
- create mode 100644 locale/dummy-setlocale.c
- create mode 100644 nscd/nis_hash.c
- create mode 100644 nss/fixed-nsswitch.conf
- create mode 100644 nss/fixed-nsswitch.functions
- create mode 100644 nss/gen-fixed-nsswitch.c
- create mode 100644 posix/regexec-compat.c
- create mode 100644 posix/xregex.c
- create mode 100644 sysdeps/nptl/small-macros-fns.c
-
-diff --git a/Makeconfig b/Makeconfig
-index f136b88..52dae8f 100644
---- a/Makeconfig
-+++ b/Makeconfig
-@@ -609,7 +609,7 @@ elf-objpfx = $(common-objpfx)elf/
- # 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
- # <variable>=<value> assignments for environment variables.
-@@ -1089,6 +1089,24 @@ libm = $(common-objpfx)math/libm.a
- libmvec = $(common-objpfx)mathvec/libmvec.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.
-diff --git a/Makerules b/Makerules
-index f9ca3f5..1dd41aa 100644
---- a/Makerules
-+++ b/Makerules
-@@ -456,6 +456,25 @@ define sed-remove-objpfx
- 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))
-diff --git a/argp/Makefile b/argp/Makefile
-index 1a87629..f7c1e40 100644
---- a/argp/Makefile
-+++ b/argp/Makefile
-@@ -18,6 +18,8 @@
- #
- # Makefile for argp.
- #
-+include ../option-groups.mak
-+
- subdir := argp
-
- include ../Makeconfig
-diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c
-index 2b845e0..c344e7b 100644
---- a/argp/argp-fmtstream.c
-+++ b/argp/argp-fmtstream.c
-@@ -42,6 +42,7 @@
- #ifdef _LIBC
- # include <wchar.h>
- # include <libio/libioP.h>
-+# include <gnu/option-groups.h>
- # define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
- #endif
-
-@@ -100,7 +101,11 @@ __argp_fmtstream_free (argp_fmtstream_t fs)
- __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 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
- 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 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
- *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
-diff --git a/argp/argp-help.c b/argp/argp-help.c
-index b055e45..6b3c4c1 100644
---- a/argp/argp-help.c
-+++ b/argp/argp-help.c
-@@ -51,6 +51,7 @@ char *alloca ();
- #ifdef _LIBC
- # include <../libio/libioP.h>
- # include <wchar.h>
-+# include <gnu/option-groups.h>
- #endif
-
- #ifndef _
-@@ -1702,7 +1703,7 @@ char *__argp_basename (char *name)
- }
-
- 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 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
- #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)
-diff --git a/argp/argp-namefrob.h b/argp/argp-namefrob.h
-index f67c58f..e2002dc 100644
---- a/argp/argp-namefrob.h
-+++ b/argp/argp-namefrob.h
-@@ -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
-diff --git a/catgets/Makefile b/catgets/Makefile
-index 4624a88..05714fd 100644
---- a/catgets/Makefile
-+++ b/catgets/Makefile
-@@ -22,20 +22,23 @@ subdir := catgets
-
- 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
-diff --git a/crypt/Makefile b/crypt/Makefile
-index 34c4dd7..7c18c88 100644
---- a/crypt/Makefile
-+++ b/crypt/Makefile
-@@ -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 @@ LDLIBS-crypt.so = -lfreebl3
- 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)sha256test: $(patsubst %, $(objpfx)%.o,$(sha256-routines))
- $(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
-diff --git a/crypt/crypt-entry.c b/crypt/crypt-entry.c
-index 7e655ba..6ae5c2b 100644
---- a/crypt/crypt-entry.c
-+++ b/crypt/crypt-entry.c
-@@ -27,6 +27,7 @@
- #include <stdio.h>
- #endif
- #include <string.h>
-+#include <gnu/option-groups.h>
- #include <errno.h>
- #include <fips-private.h>
-
-@@ -76,9 +77,11 @@ __crypt_r (key, salt, data)
- 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 @@ __crypt_r (key, salt, data)
- sizeof (struct crypt_data));
- #endif
-
-+#if __OPTION_EGLIBC_CRYPT_UFC
- /*
- * Hack DES tables according to salt
- */
-@@ -144,6 +148,10 @@ __crypt_r (key, salt, data)
- */
- _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 @@ crypt (key, salt)
- 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 */
- }
-
-
-diff --git a/crypt/crypt_common.c b/crypt/crypt_common.c
-new file mode 100644
-index 0000000..cce6a31
---- /dev/null
-+++ b/crypt/crypt_common.c
-@@ -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 <http://www.gnu.org/licenses/>.
-+ *
-+ * 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;
-+ }
-+}
-diff --git a/crypt/crypt_util.c b/crypt/crypt_util.c
-index 1597885..9297974 100644
---- a/crypt/crypt_util.c
-+++ b/crypt/crypt_util.c
-@@ -242,10 +242,6 @@ static ufc_long eperm32tab[4][256][2];
- */
- 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(__key)
- {
- __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;
-- }
--}
-diff --git a/csu/Makefile b/csu/Makefile
-index 9f0855a..b1c3363 100644
---- a/csu/Makefile
-+++ b/csu/Makefile
-@@ -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
-diff --git a/debug/Makefile b/debug/Makefile
-index 9ff357b..d23d97d 100644
---- a/debug/Makefile
-+++ b/debug/Makefile
-@@ -18,6 +18,8 @@
- #
- # Sub-makefile for debug portion of the library.
- #
-+include ../option-groups.mak
-+
- subdir := debug
-
- include ../Makeconfig
-@@ -27,7 +29,7 @@ headers := execinfo.h
- # 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 @@ routines = backtrace backtracesyms backtracesymsfd noophooks \
- 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
-@@ -131,11 +140,15 @@ LDFLAGS-tst-backtrace4 = -rdynamic
- 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
-
- ifeq (,$(CXX))
- tests-unsupported = tst-chk4 tst-chk5 tst-chk6 \
-diff --git a/debug/segfault.c b/debug/segfault.c
-index 3459a2a..ee9a146 100644
---- a/debug/segfault.c
-+++ b/debug/segfault.c
-@@ -30,6 +30,7 @@
- #include <unistd.h>
- #include <_itoa.h>
- #include <ldsodefs.h>
-+#include <gnu/option-groups.h>
-
- /* This file defines macros to access the content of the sigcontext element
- passed up by the signal handler. */
-@@ -68,11 +69,13 @@ write_strsignal (int fd, int signal)
- static void
- catch_segfault (int signal, SIGCONTEXT ctx)
- {
-- int fd, cnt, i;
-- void **arr;
-+ int fd;
- struct sigaction sa;
-+#if __OPTION_EGLIBC_BACKTRACE
-+ int cnt, i;
-+ void **arr;
- uintptr_t pc;
--
-+#endif
- /* This is the name of the file we are writing to. If none is given
- or we cannot write to this file write to stderr. */
- fd = 2;
-@@ -91,6 +94,7 @@ catch_segfault (int signal, SIGCONTEXT ctx)
- REGISTER_DUMP;
- #endif
-
-+#if __OPTION_EGLIBC_BACKTRACE
- WRITE_STRING ("\nBacktrace:\n");
-
- /* Get the backtrace. */
-@@ -113,6 +117,7 @@ catch_segfault (int signal, SIGCONTEXT ctx)
-
- /* Now generate nicely formatted output. */
- __backtrace_symbols_fd (arr + i, cnt - i, fd);
-+#endif
-
- #ifdef HAVE_PROC_SELF
- /* Now the link map. */
-diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c
-index 53559e6..362d92a 100644
---- a/debug/tst-chk1.c
-+++ b/debug/tst-chk1.c
-@@ -31,6 +31,7 @@
- #include <sys/select.h>
- #include <sys/socket.h>
- #include <sys/un.h>
-+#include <gnu/option-groups.h>
-
-
- #define obstack_chunk_alloc malloc
-@@ -307,6 +308,7 @@ do_test (void)
- 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 @@ do_test (void)
- 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 @@ do_test (void)
- 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 @@ do_test (void)
- CHK_FAIL_END
- #endif
-
-+#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
-
- /* Now checks for %n protection. */
-
-@@ -1192,6 +1197,7 @@ do_test (void)
- # 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 @@ do_test (void)
- puts ("cannot set locale");
- ret = 1;
- }
-+#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
-
- int fd = posix_openpt (O_RDWR);
- if (fd != -1)
-diff --git a/dlfcn/Makefile b/dlfcn/Makefile
-index 759780d..3827607 100644
---- a/dlfcn/Makefile
-+++ b/dlfcn/Makefile
-@@ -15,6 +15,8 @@
- # License along with the GNU C Library; if not, see
- # <http://www.gnu.org/licenses/>.
-
-+include ../option-groups.mak
-+
- subdir := dlfcn
-
- include ../Makeconfig
-@@ -36,8 +38,11 @@ endif
- 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 tst-rec-dlopen
-+ tstatexit bug-dl-leaf tst-rec-dlopen
- endif
-+
-+tests-$(OPTION_EGLIBC_CXX_TESTS) += bug-atexit3
-+
- modules-names = glreflib1 glreflib2 glreflib3 failtestmod defaultmod1 \
- defaultmod2 errmsg1mod modatexit modcxaatexit \
- bug-dlsym1-lib1 bug-dlsym1-lib2 bug-atexit1-lib \
-diff --git a/elf/dl-support.c b/elf/dl-support.c
-index 4d036f1..c15f405 100644
---- a/elf/dl-support.c
-+++ b/elf/dl-support.c
-@@ -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 <gnu/option-groups.h>
- #include <errno.h>
- #include <libintl.h>
- #include <stdlib.h>
-@@ -42,7 +43,9 @@ char **_dl_argv = &__progname; /* This is checked for some error messages. */
- 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;
-diff --git a/elf/rtld.c b/elf/rtld.c
-index 6d3add7..fc3a2db 100644
---- a/elf/rtld.c
-+++ b/elf/rtld.c
-@@ -16,6 +16,7 @@
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-+#include <gnu/option-groups.h>
- #include <errno.h>
- #include <dlfcn.h>
- #include <fcntl.h>
-@@ -2201,6 +2202,7 @@ print_missing_version (int errcode __attribute__ ((unused)),
- objname, errstring);
- }
-
-+#if __OPTION_EGLIBC_RTLD_DEBUG
- /* Nonzero if any of the debugging options is enabled. */
- static int any_debug attribute_relro;
-
-@@ -2310,6 +2312,7 @@ a filename can be specified using the LD_DEBUG_OUTPUT environment variable.\n");
- _exit (0);
- }
- }
-+#endif /* __OPTION_EGLIBC_RTLD_DEBUG */
-
- static void
- process_dl_audit (char *str)
-@@ -2349,8 +2352,9 @@ process_envvars (enum mode *modep)
- char **runp = _environ;
- char *envline;
- enum mode mode = normal;
-+#if __OPTION_EGLIBC_RTLD_DEBUG
- char *debug_output = NULL;
--
-+#endif
- /* This is the default place for profiling data file. */
- GLRO(dl_profile_output)
- = &"/var/tmp\0/var/profile"[__libc_enable_secure ? 9 : 0];
-@@ -2377,12 +2381,14 @@ process_envvars (enum mode *modep)
- 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;
-@@ -2448,13 +2454,14 @@ process_envvars (enum mode *modep)
- break;
- }
-
-+#if __OPTION_EGLIBC_RTLD_DEBUG
- /* Where to place the profiling data file. */
- if (memcmp (envline, "DEBUG_OUTPUT", 12) == 0)
- {
- debug_output = &envline[13];
- break;
- }
--
-+#endif
- if (!__libc_enable_secure
- && memcmp (envline, "DYNAMIC_WEAK", 12) == 0)
- GLRO(dl_dynamic_weak) = 1;
-@@ -2491,7 +2498,9 @@ process_envvars (enum mode *modep)
- {
- 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;
-@@ -2538,12 +2547,15 @@ process_envvars (enum mode *modep)
- 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. */
-@@ -2568,6 +2580,7 @@ process_envvars (enum mode *modep)
- /* We use standard output if opening the file failed. */
- GLRO(dl_debug_fd) = STDOUT_FILENO;
- }
-+#endif /* __OPTION_EGLIBC_RTLD_DEBUG */
- }
-
-
-diff --git a/extra-lib.mk b/extra-lib.mk
-index b10748d..d71a06f 100644
---- a/extra-lib.mk
-+++ b/extra-lib.mk
-@@ -25,7 +25,9 @@ install-lib := $(install-lib)
- 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
- 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
-diff --git a/grp/Makefile b/grp/Makefile
-index c63b552..7486f32 100644
---- a/grp/Makefile
-+++ b/grp/Makefile
-@@ -18,6 +18,8 @@
- #
- # Sub-makefile for grp portion of the library.
- #
-+include ../option-groups.mak
-+
- subdir := grp
-
- include ../Makeconfig
-@@ -29,6 +31,9 @@ routines := fgetgrent initgroups setgroups \
- 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
-diff --git a/hesiod/Makefile b/hesiod/Makefile
-index ac0bc01..38263b4 100644
---- a/hesiod/Makefile
-+++ b/hesiod/Makefile
-@@ -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
-diff --git a/iconv/Makefile b/iconv/Makefile
-index 0d55eda..a1847c6 100644
---- a/iconv/Makefile
-+++ b/iconv/Makefile
-@@ -18,6 +18,8 @@
- #
- # Makefile for iconv.
- #
-+include ../option-groups.mak
-+
- subdir := iconv
-
- include ../Makeconfig
-@@ -39,6 +41,11 @@ CFLAGS-iconv_charmap.c = -I../locale/programs
- CFLAGS-dummy-repertoire.c = -I../locale/programs
- CFLAGS-charmap.c = -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
- -DDEFAULT_CHARMAP=null_pointer -DNEED_NULL_POINTER
-+
-+ifneq (y,$(OPTION_EGLIBC_SPAWN))
-+CFLAGS-charmap-dir.c += -DNO_UNCOMPRESS
-+endif
-+
- CFLAGS-linereader.c = -DNO_TRANSLITERATION
- CFLAGS-simple-hash.c = -I../locale
-
-diff --git a/iconv/gconv_db.c b/iconv/gconv_db.c
-index ce46216..ea18964 100644
---- a/iconv/gconv_db.c
-+++ b/iconv/gconv_db.c
-@@ -25,6 +25,7 @@
- #include <sys/param.h>
- #include <bits/libc-lock.h>
- #include <locale/localeinfo.h>
-+#include <gnu/option-groups.h>
-
- #include <dlfcn.h>
- #include <gconv_int.h>
-@@ -828,9 +829,11 @@ free_modules_db (struct gconv_module *node)
- /* 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;
-diff --git a/iconv/gconv_trans.c b/iconv/gconv_trans.c
-index 5d5d4d7..a7d3072 100644
---- a/iconv/gconv_trans.c
-+++ b/iconv/gconv_trans.c
-@@ -23,6 +23,7 @@
- #include <stdint.h>
- #include <string.h>
- #include <stdlib.h>
-+#include <gnu/option-groups.h>
-
- #include <bits/libc-lock.h>
- #include "gconv_int.h"
-@@ -38,15 +39,19 @@ __gconv_transliterate (struct __gconv_step *step,
- unsigned char **outbufstart, size_t *irreversible)
- {
- /* Find out about the locale's transliteration. */
-+#if __OPTION_EGLIBC_LOCALE_CODE
- uint_fast32_t size;
- const uint32_t *from_idx;
- const uint32_t *from_tbl;
- const uint32_t *to_idx;
- const uint32_t *to_tbl;
-+#endif
- const uint32_t *winbuf;
- const uint32_t *winbufend;
-+#if __OPTION_EGLIBC_LOCALE_CODE
- uint_fast32_t low;
- uint_fast32_t high;
-+#endif
-
- /* The input buffer. There are actually 4-byte values. */
- winbuf = (const uint32_t *) *inbufp;
-@@ -58,6 +63,7 @@ __gconv_transliterate (struct __gconv_step *step,
- 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);
-@@ -193,6 +199,7 @@ __gconv_transliterate (struct __gconv_step *step,
- sorted. */
- break;
- }
-+#endif
-
- /* One last chance: use the default replacement. */
- if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN) != 0)
-diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
-index e249bce..403ece5 100644
---- a/iconv/iconv_prog.c
-+++ b/iconv/iconv_prog.c
-@@ -35,6 +35,7 @@
- #ifdef _POSIX_MAPPED_FILES
- # include <sys/mman.h>
- #endif
-+#include <gnu/option-groups.h>
- #include <charmap.h>
- #include <gconv_int.h>
- #include "iconv_prog.h"
-@@ -221,10 +222,17 @@ main (int argc, char *argv[])
- 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)
- {
-diff --git a/iconvdata/Makefile b/iconvdata/Makefile
-index a3d1d09..0832708 100644
---- a/iconvdata/Makefile
-+++ b/iconvdata/Makefile
-@@ -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 @@ modules := ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 \
- 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
-@@ -127,13 +132,13 @@ ifeq (yes,$(build-shared))
- # 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.
-
-@@ -201,7 +206,7 @@ before-compile += $(addprefix $(objpfx),$(generated-modules:=.h))
- 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 \
-@@ -245,7 +250,7 @@ $(addprefix $(inst_gconvdir)/, $(modules.so)): \
- $(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 \
-@@ -254,9 +259,9 @@ ifeq (no,$(cross-compiling))
- $(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
-
-diff --git a/include/netdb.h b/include/netdb.h
-index e1f051d..f6d15aa 100644
---- a/include/netdb.h
-+++ b/include/netdb.h
-@@ -232,6 +232,10 @@ extern enum nss_status _nss_ ## service ## _gethostbyname2_r \
- (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); \
-diff --git a/inet/Makefile b/inet/Makefile
-index f1d871f..7cb1709 100644
---- a/inet/Makefile
-+++ b/inet/Makefile
-@@ -18,6 +18,8 @@
- #
- # Sub-makefile for inet portion of the library.
- #
-+include ../option-groups.mak
-+
- subdir := inet
-
- include ../Makeconfig
-@@ -27,7 +29,8 @@ headers := netinet/ether.h netinet/in.h netinet/in_systm.h \
- 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 \
-@@ -39,18 +42,23 @@ routines := htonl htons \
- getservent_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
-
-diff --git a/intl/Makefile b/intl/Makefile
-index 9ecf8fe..587bc0d 100644
---- a/intl/Makefile
-+++ b/intl/Makefile
-@@ -16,6 +16,7 @@
- # <http://www.gnu.org/licenses/>.
-
- # Makefile for intl subdirectory: message handling code from GNU gettext.
-+include ../option-groups.mak
-
- subdir = intl
-
-@@ -48,7 +49,7 @@ endif
- $(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 \
-diff --git a/intl/dcigettext.c b/intl/dcigettext.c
-index 8a3f091..e271648 100644
---- a/intl/dcigettext.c
-+++ b/intl/dcigettext.c
-@@ -100,11 +100,15 @@ extern int errno;
- # include "libgnuintl.h"
- #endif
- #include "hash-string.h"
-+#ifdef _LIBC
-+# include <gnu/option-groups.h>
-+#endif
-
- /* Handle multi-threaded applications. */
- #ifdef _LIBC
- # include <bits/libc-lock.h>
- # define gl_rwlock_define_initialized __libc_rwlock_define_initialized
-+# define gl_rwlock_define __libc_rwlock_define
- # define gl_rwlock_rdlock __libc_rwlock_rdlock
- # define gl_rwlock_wrlock __libc_rwlock_wrlock
- # define gl_rwlock_unlock __libc_rwlock_unlock
-@@ -523,8 +527,10 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
- saved_errno = errno;
-
- #ifdef _LIBC
-- __libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden)
-- __libc_rwlock_rdlock (__libc_setlocale_lock);
-+# if __OPTION_EGLIBC_LOCALE_CODE
-+ gl_rwlock_define (extern, __libc_setlocale_lock attribute_hidden)
-+ gl_rwlock_rdlock (__libc_setlocale_lock);
-+# endif
- #endif
-
- gl_rwlock_rdlock (_nl_state_lock);
-@@ -550,7 +556,11 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
- #ifdef HAVE_PER_THREAD_LOCALE
- # ifndef IN_LIBGLOCALE
- # ifdef _LIBC
-- localename = strdupa (__current_locale_name (category));
-+# if __OPTION_EGLIBC_LOCALE_CODE
-+ localename = strdupa (__current_locale_name (category));
-+# else
-+ localename = "C";
-+# endif
- # else
- categoryname = category_to_name (category);
- # define CATEGORYNAME_INITIALIZED
-@@ -581,10 +591,12 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
- else
- retval = (char *) (*foundp)->translation;
-
-- gl_rwlock_unlock (_nl_state_lock);
- # ifdef _LIBC
-- __libc_rwlock_unlock (__libc_setlocale_lock);
-+# if __OPTION_EGLIBC_LOCALE_CODE
-+ gl_rwlock_unlock (__libc_setlocale_lock);
-+# endif
- # endif
-+ gl_rwlock_unlock (_nl_state_lock);
- __set_errno (saved_errno);
- return retval;
- }
-@@ -838,10 +850,13 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
- if (plural)
- retval = plural_lookup (domain, n, retval, retlen);
-
-- gl_rwlock_unlock (_nl_state_lock);
- #ifdef _LIBC
-- __libc_rwlock_unlock (__libc_setlocale_lock);
-+# if __OPTION_EGLIBC_LOCALE_CODE
-+
-+ gl_rwlock_unlock (__libc_setlocale_lock);
-+# endif
- #endif
-+ gl_rwlock_unlock (_nl_state_lock);
- return retval;
- }
- }
-@@ -850,10 +865,12 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
- return_untranslated:
- /* Return the untranslated MSGID. */
- FREE_BLOCKS (block_list);
-- gl_rwlock_unlock (_nl_state_lock);
- #ifdef _LIBC
-- __libc_rwlock_unlock (__libc_setlocale_lock);
-+# if __OPTION_EGLIBC_LOCALE_CODE
-+ gl_rwlock_unlock (__libc_setlocale_lock);
-+# endif
- #endif
-+ gl_rwlock_unlock (_nl_state_lock);
- #ifndef _LIBC
- if (!ENABLE_SECURE)
- {
-@@ -1550,7 +1567,11 @@ guess_category_value (int category, const char *categoryname)
- `LC_xxx', and `LANG'. On some systems this can be done by the
- `setlocale' function itself. */
- # ifdef _LIBC
-+# if __OPTION_EGLIBC_LOCALE_CODE
- locale = __current_locale_name (category);
-+# else
-+ locale = "C";
-+# endif
- # else
- locale_defaulted = 0;
- # if HAVE_USELOCALE
-diff --git a/io/Makefile b/io/Makefile
-index 613dce0..697439e 100644
---- a/io/Makefile
-+++ b/io/Makefile
-@@ -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 @@ routines := \
- 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 @@ routines := \
- 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 @@ static-only-routines = stat fstat lstat stat64 fstat64 lstat64 \
- 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
-
-diff --git a/libidn/Makefile b/libidn/Makefile
-index 940fa52..43aad0c 100644
---- a/libidn/Makefile
-+++ b/libidn/Makefile
-@@ -16,6 +16,7 @@
- # <http://www.gnu.org/licenses/>.
-
- # Makefile for libidn subdirectory of GNU C Library.
-+include ../option-groups.mak
-
- subdir := libidn
-
-@@ -23,8 +24,8 @@ include ../Makeconfig
-
- 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
-diff --git a/libidn/toutf8.c b/libidn/toutf8.c
-index c7e67ca..62df478 100644
---- a/libidn/toutf8.c
-+++ b/libidn/toutf8.c
-@@ -33,6 +33,11 @@
- /* Get strlen. */
- #include <string.h>
-
-+/* Get __OPTION_EGLIBC_LOCALE_CODE. */
-+#ifdef _LIBC
-+# include <gnu/option-groups.h>
-+#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
-diff --git a/libio/Makefile b/libio/Makefile
-index 7b3bcf9..27c9186 100644
---- a/libio/Makefile
-+++ b/libio/Makefile
-@@ -18,6 +18,8 @@
- #
- # Specific makefile for libio.
- #
-+include ../option-groups.mak
-+
- subdir := libio
-
- include ../Makeconfig
-@@ -27,16 +29,13 @@ headers := stdio.h libio.h _G_config.h bits/stdio.h bits/stdio-lock.h \
-
- 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 \
-@@ -48,24 +47,49 @@ routines := \
- \
- libc_fatal fmemopen oldfmemopen
-
--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 \
-+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-wfflush \
-- bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 tst-fopenloc2 \
-+ tst-mmap2-eofsync tst-mmap-offend bug-fopena+ \
-+ bug-ungetc2 bug-ungetc3 bug-ungetc4 \
- 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 tst-fputws
-+ 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 tst-fputws
-+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 +188,17 @@ shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops \
- 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
-
-diff --git a/libio/__fpurge.c b/libio/__fpurge.c
-index 065cf61..e32a3e9 100644
---- a/libio/__fpurge.c
-+++ b/libio/__fpurge.c
-@@ -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))
-diff --git a/libio/fileops.c b/libio/fileops.c
-index cbcd6f5..19e43c2 100644
---- a/libio/fileops.c
-+++ b/libio/fileops.c
-@@ -39,6 +39,7 @@
- #include <string.h>
- #include <errno.h>
- #include <unistd.h>
-+#include <gnu/option-groups.h>
- #include <stdlib.h>
- #if _LIBC
- # include "../wcsmbs/wcsmbsload.h"
-@@ -173,7 +174,7 @@ _IO_new_file_close_it (_IO_FILE *fp)
-
- /* 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);
-@@ -348,6 +349,7 @@ _IO_new_file_fopen (_IO_FILE *fp, const char *filename, const char *mode,
- 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;
-@@ -418,6 +420,12 @@ _IO_new_file_fopen (_IO_FILE *fp, const char *filename, const char *mode,
-
- /* 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
- }
- }
-
-diff --git a/libio/iofwide.c b/libio/iofwide.c
-index 0c175d1..3e9f52b 100644
---- a/libio/iofwide.c
-+++ b/libio/iofwide.c
-@@ -26,6 +26,7 @@
-
- #include <libioP.h>
- #ifdef _LIBC
-+# include <gnu/option-groups.h>
- # include <dlfcn.h>
- # include <wchar.h>
- #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,
-@@ -499,3 +502,26 @@ do_max_length (struct _IO_codecvt *codecvt)
- 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
-diff --git a/libio/ioseekoff.c b/libio/ioseekoff.c
-index 11765cf..15d6230 100644
---- a/libio/ioseekoff.c
-+++ b/libio/ioseekoff.c
-@@ -60,7 +60,7 @@ _IO_seekoff_unlocked (fp, offset, dir, mode)
- else
- abort ();
- }
-- if (_IO_fwide (fp, 0) < 0)
-+ if (! _IO_is_wide (fp))
- _IO_free_backup_area (fp);
- else
- _IO_free_wbackup_area (fp);
-diff --git a/libio/ioseekpos.c b/libio/ioseekpos.c
-index a7652a1..6938b68 100644
---- a/libio/ioseekpos.c
-+++ b/libio/ioseekpos.c
-@@ -35,7 +35,7 @@ _IO_seekpos_unlocked (fp, pos, mode)
- /* 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);
-diff --git a/libio/iosetbuffer.c b/libio/iosetbuffer.c
-index 0a41c10..3d99fa0 100644
---- a/libio/iosetbuffer.c
-+++ b/libio/iosetbuffer.c
-@@ -24,6 +24,8 @@
- This exception applies to code released by its copyright holders
- in files containing the exception. */
-
-+#include <gnu/option-groups.h>
-+
- #include "libioP.h"
-
- void
-@@ -38,9 +40,11 @@ _IO_setbuffer (fp, buf, size)
- 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)
-diff --git a/libio/libioP.h b/libio/libioP.h
-index 0f16e2d..d2626d6 100644
---- a/libio/libioP.h
-+++ b/libio/libioP.h
-@@ -44,6 +44,10 @@
- /*# include <comthread.h>*/
- #endif
-
-+#if defined _LIBC
-+# include <gnu/option-groups.h>
-+#endif
-+
- #include <math_ldbl_opt.h>
-
- #include "iolibio.h"
-@@ -523,8 +527,20 @@ extern void _IO_old_init (_IO_FILE *fp, int flags) __THROW;
-
-
- #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, \
-diff --git a/libio/wdummyfileops.c b/libio/wdummyfileops.c
-new file mode 100644
-index 0000000..c0150b8
---- /dev/null
-+++ b/libio/wdummyfileops.c
-@@ -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 <assert.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <libioP.h>
-+
-+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)
-diff --git a/locale/C-ctype.c b/locale/C-ctype.c
-index aa5f19f..06be081 100644
---- a/locale/C-ctype.c
-+++ b/locale/C-ctype.c
-@@ -19,8 +19,11 @@
- #include "localeinfo.h"
- #include <endian.h>
- #include <stdint.h>
-+#include <gnu/option-groups.h>
-
-+#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''.
-@@ -634,6 +637,7 @@ const struct __locale_data _nl_C_LC_CTYPE attribute_hidden =
- { .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 */
-@@ -644,6 +648,22 @@ const struct __locale_data _nl_C_LC_CTYPE attribute_hidden =
- { .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 */
-diff --git a/locale/Makefile b/locale/Makefile
-index f1b4343..599a1a9 100644
---- a/locale/Makefile
-+++ b/locale/Makefile
-@@ -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
-
-@@ -93,6 +109,9 @@ CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
- 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
-
- # Set libof-* for each routine.
- cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
-diff --git a/locale/catnames.c b/locale/catnames.c
-new file mode 100644
-index 0000000..9fad357
---- /dev/null
-+++ b/locale/catnames.c
-@@ -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
-+ };
-diff --git a/locale/dummy-setlocale.c b/locale/dummy-setlocale.c
-new file mode 100644
-index 0000000..219964a
---- /dev/null
-+++ b/locale/dummy-setlocale.c
-@@ -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 <string.h>
-+#include <locale.h>
-+
-+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)
-diff --git a/locale/localeinfo.h b/locale/localeinfo.h
-index bdab9fe..a7516c0 100644
---- a/locale/localeinfo.h
-+++ b/locale/localeinfo.h
-@@ -232,7 +232,7 @@ __libc_tsd_define (extern, __locale_t, LOCALE)
- 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 <tls.h>
- # define NL_CURRENT_INDIRECT 1
- #endif
-diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c
-index cf7adea..ef3b811 100644
---- a/locale/programs/charmap-dir.c
-+++ b/locale/programs/charmap-dir.c
-@@ -19,7 +19,9 @@
- #include <error.h>
- #include <fcntl.h>
- #include <libintl.h>
-+#ifndef NO_UNCOMPRESS
- #include <spawn.h>
-+#endif
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -156,6 +158,7 @@ charmap_closedir (CHARMAP_DIR *cdir)
- 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 @@ fopen_uncompressed (const char *pathname, const char *compressor)
- }
- return NULL;
- }
-+#endif
-
- /* Opens a charmap for reading, given its name (not an alias name). */
- FILE *
-@@ -226,6 +230,7 @@ charmap_open (const char *directory, const char *name)
- if (stream != NULL)
- return stream;
-
-+#ifndef NO_UNCOMPRESS
- memcpy (p, ".gz", 4);
- stream = fopen_uncompressed (pathname, "gzip");
- if (stream != NULL)
-@@ -235,6 +240,7 @@ charmap_open (const char *directory, const char *name)
- stream = fopen_uncompressed (pathname, "bzip2");
- if (stream != NULL)
- return stream;
-+#endif
-
- return NULL;
- }
-diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
-index a39a94f..16e9039 100644
---- a/locale/programs/ld-collate.c
-+++ b/locale/programs/ld-collate.c
-@@ -351,7 +351,7 @@ new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen,
- }
- if (wcs != NULL)
- {
-- size_t nwcs = wcslen ((wchar_t *) wcs);
-+ size_t nwcs = wcslen_uint32 (wcs);
- uint32_t zero = 0;
- /* Handle <U0000> as a single character. */
- if (nwcs == 0)
-@@ -1777,8 +1777,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name);
-
- 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)
- {
-@@ -2011,9 +2010,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
- 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))
- {
-@@ -2037,9 +2036,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
- 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));
-
-diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
-index 3f464ef..b7b6b51 100644
---- a/locale/programs/ld-ctype.c
-+++ b/locale/programs/ld-ctype.c
-@@ -926,7 +926,7 @@ ctype_output (struct localedef_t *locale, const struct charmap_t *charmap,
- 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);
-@@ -1937,7 +1937,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype,
- 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;
- }
-@@ -2471,8 +2471,8 @@ with character code range values one must use the absolute ellipsis `...'"));
- }
-
- 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;
-
-@@ -3929,8 +3929,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
-
- 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;
-@@ -3967,11 +3966,11 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
- for (size_t 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
-@@ -3995,18 +3994,18 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
- 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;
- }
-diff --git a/locale/programs/ld-messages.c b/locale/programs/ld-messages.c
-index ec1a80b..736eed8 100644
---- a/locale/programs/ld-messages.c
-+++ b/locale/programs/ld-messages.c
-@@ -25,6 +25,7 @@
- #include <string.h>
- #include <stdint.h>
- #include <sys/uio.h>
-+#include <gnu/option-groups.h>
-
- #include <assert.h>
-
-@@ -124,6 +125,7 @@ No definition for %s category found"), "LC_MESSAGES"));
- }
- else
- {
-+#if __OPTION_POSIX_REGEXP
- int result;
- regex_t re;
-
-@@ -140,6 +142,7 @@ No definition for %s category found"), "LC_MESSAGES"));
- }
- else if (result != 0)
- regfree (&re);
-+#endif
- }
-
- if (messages->noexpr == NULL)
-@@ -158,6 +161,7 @@ No definition for %s category found"), "LC_MESSAGES"));
- }
- else
- {
-+#if __OPTION_POSIX_REGEXP
- int result;
- regex_t re;
-
-@@ -174,6 +178,7 @@ No definition for %s category found"), "LC_MESSAGES"));
- }
- else if (result != 0)
- regfree (&re);
-+#endif
- }
- }
-
-diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
-index db490c6..75dc505 100644
---- a/locale/programs/ld-time.c
-+++ b/locale/programs/ld-time.c
-@@ -215,8 +215,10 @@ No definition for %s category found"), "LC_TIME"));
- }
- 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 @@ No definition for %s category found"), "LC_TIME"));
- 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 @@ No definition for %s category found"), "LC_TIME"));
- }
-
- /* 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 @@ No definition for %s category found"), "LC_TIME"));
- 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;
-+ }
- }
-
-
-diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
-index 2e05130..653b68c 100644
---- a/locale/programs/linereader.c
-+++ b/locale/programs/linereader.c
-@@ -595,7 +595,7 @@ get_string (struct linereader *lr, const struct charmap_t *charmap,
- {
- int return_widestr = lr->return_widestr;
- char *buf;
-- wchar_t *buf2 = NULL;
-+ uint32_t *buf2 = NULL;
- size_t bufact;
- size_t bufmax = 56;
-
-diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
-index 2a0f2aa..583d233 100644
---- a/locale/programs/localedef.c
-+++ b/locale/programs/localedef.c
-@@ -114,6 +114,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
- #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 @@ static const struct argp_option options[] =
- 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 @@ main (int argc, char *argv[])
- 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 @@ parse_opt (int key, char *arg, struct argp_state *state)
- 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;
-diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c
-index 33da52e..f790c4c 100644
---- a/locale/programs/locfile.c
-+++ b/locale/programs/locfile.c
-@@ -544,6 +544,9 @@ compare_files (const char *filename1, const char *filename2, size_t size,
- 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 @@ add_locale_string (struct locale_file *file, const char *string)
- 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. */
-diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h
-index 6fc441b..118b171 100644
---- a/locale/programs/locfile.h
-+++ b/locale/programs/locfile.h
-@@ -71,6 +71,8 @@ extern void write_all_categories (struct localedef_t *definitions,
-
- 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
-@@ -89,7 +91,8 @@ maybe_swap_uint32 (uint32_t value)
- }
-
- /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */
--static inline void
-+static void
-+__attribute__ ((unused))
- maybe_swap_uint32_array (uint32_t *array, size_t n)
- {
- if (swap_endianness_p)
-@@ -99,7 +102,8 @@ maybe_swap_uint32_array (uint32_t *array, size_t n)
-
- /* Like maybe_swap_uint32_array, but the array of N elements is at
- the end of OBSTACK's current object. */
--static inline void
-+static void
-+__attribute__ ((unused))
- maybe_swap_uint32_obstack (struct obstack *obstack, size_t n)
- {
- maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n);
-@@ -276,4 +280,55 @@ extern void identification_output (struct localedef_t *locale,
- const struct charmap_t *charmap,
- const char *output_path);
-
-+static size_t wcslen_uint32 (const uint32_t *str) __attribute__ ((unused));
-+static uint32_t * wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
-+static uint32_t * wcschr_uint32 (const uint32_t *s, uint32_t ch) __attribute__ ((unused));
-+static int wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) __attribute__ ((unused));
-+static int wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
-+
-+static size_t
-+wcslen_uint32 (const uint32_t *str)
-+{
-+ size_t len = 0;
-+ while (str[len] != 0)
-+ len++;
-+ return len;
-+}
-+
-+static 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 int
-+wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2)
-+{
-+ while (*s1 != 0 && *s1 == *s2)
-+ s1++, s2++;
-+ return *s1 - *s2;
-+}
-+
-+static uint32_t *
-+wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n)
-+{
-+ return memcpy (s1, s2, n * sizeof (uint32_t));
-+}
-+
-+static 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 */
-diff --git a/locale/setlocale.c b/locale/setlocale.c
-index fa9cb3a..8eee284 100644
---- a/locale/setlocale.c
-+++ b/locale/setlocale.c
-@@ -64,36 +64,6 @@ static char *const _nl_current_used[] =
- #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
-diff --git a/locale/xlocale.c b/locale/xlocale.c
-index fec4564..f00269c 100644
---- a/locale/xlocale.c
-+++ b/locale/xlocale.c
-@@ -18,6 +18,7 @@
- <http://www.gnu.org/licenses/>. */
-
- #include <locale.h>
-+#include <gnu/option-groups.h>
- #include "localeinfo.h"
-
- #define DEFINE_CATEGORY(category, category_name, items, a) \
-@@ -25,6 +26,19 @@ extern struct __locale_data _nl_C_##category;
- #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 @@ const struct __locale_struct _nl_C_locobj attribute_hidden =
- .__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 */
-diff --git a/localedata/Makefile b/localedata/Makefile
-index ebf6ac9..1870753 100644
---- a/localedata/Makefile
-+++ b/localedata/Makefile
-@@ -21,12 +21,22 @@ subdir := localedata
-
- 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 @@ locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
- 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
-@@ -95,6 +111,7 @@ tests: $(objdir)/iconvdata/gconv-modules
- tests-static += tst-langinfo-static
-
- ifeq ($(run-built-tests),yes)
-+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 \
-@@ -109,6 +126,7 @@ LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \
- tr_TR.ISO-8859-9 en_GB.UTF-8 uk_UA.UTF-8
- include ../gen-locales.mk
- endif
-+endif
-
- include ../Rules
-
-@@ -191,6 +209,11 @@ endif
-
- 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.
-diff --git a/login/Makefile b/login/Makefile
-index 0f4bb22..4036ddb 100644
---- a/login/Makefile
-+++ b/login/Makefile
-@@ -18,6 +18,7 @@
- #
- # Sub-makefile for login portion of the library.
- #
-+include ../option-groups.mak
-
- subdir := login
-
-@@ -25,14 +26,16 @@ include ../Makeconfig
-
- 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 @@ vpath %.c programs
- tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin
-
- # 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
-
-diff --git a/malloc/Makefile b/malloc/Makefile
-index 67ed293..272ca4d 100644
---- a/malloc/Makefile
-+++ b/malloc/Makefile
-@@ -18,6 +18,8 @@
- #
- # Makefile for malloc routines
- #
-+include ../option-groups.mak
-+
- subdir := malloc
-
- include ../Makeconfig
-@@ -39,9 +41,15 @@ install-lib := libmcheck.a
- 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))
-
-@@ -71,7 +79,7 @@ endif
- # 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
-diff --git a/malloc/memusage.c b/malloc/memusage.c
-index a57ba8e..732ba9d 100644
---- a/malloc/memusage.c
-+++ b/malloc/memusage.c
-@@ -33,6 +33,7 @@
- #include <stdint.h>
- #include <sys/mman.h>
- #include <sys/time.h>
-+#include <gnu/option-groups.h>
-
- #include <memusage.h>
-
-@@ -93,7 +94,11 @@ static __thread uintptr_t start_sp;
- #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;
-diff --git a/malloc/memusage.sh b/malloc/memusage.sh
-index 8ab8cc2..d18f446 100755
---- a/malloc/memusage.sh
-+++ b/malloc/memusage.sh
-@@ -35,7 +35,7 @@ do_missing_arg() {
-
- # 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
-diff --git a/math/Makefile b/math/Makefile
-index 6388bae..ed1c511 100644
---- a/math/Makefile
-+++ b/math/Makefile
-@@ -21,6 +21,8 @@ subdir := math
-
- 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 \
-@@ -34,8 +36,8 @@ aux := setfpucw fpu_control
-
- # 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 = s_lib_version s_matherr s_signgam \
- fclrexcpt fgetexcptflg fraiseexcpt fsetexcptflg \
-diff --git a/misc/Makefile b/misc/Makefile
-index aecb0da..e6b7c23 100644
---- a/misc/Makefile
-+++ b/misc/Makefile
-@@ -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 @@ routines := brk sbrk sstk ioctl \
- 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)
-diff --git a/misc/err.c b/misc/err.c
-index 7b98157..efce8d5 100644
---- a/misc/err.c
-+++ b/misc/err.c
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <string.h>
- #include <stdio.h>
-+#include <gnu/option-groups.h>
-
- #include <wchar.h>
- #define flockfile(s) _IO_flockfile (s)
-@@ -37,6 +38,7 @@ extern char *__progname;
- 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 @@ convert_and_print (const char *format, __gnuc_va_list ap)
-
- __vfwprintf (stderr, wformat, ap);
- }
-+#endif
-
- void
- vwarnx (const char *format, __gnuc_va_list ap)
-@@ -88,9 +91,13 @@ vwarnx (const char *format, __gnuc_va_list ap)
- 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 @@ vwarn (const char *format, __gnuc_va_list ap)
- 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 @@ vwarn (const char *format, __gnuc_va_list ap)
- }
- __set_errno (error);
- __fwprintf (stderr, L"%m\n");
-+#else
-+ abort ();
-+#endif
- }
- else
- {
-diff --git a/misc/error.c b/misc/error.c
-index aaa120d..d6cbc82 100644
---- a/misc/error.c
-+++ b/misc/error.c
-@@ -35,6 +35,7 @@
- #endif
-
- #ifdef _LIBC
-+# include <gnu/option-groups.h>
- # include <libintl.h>
- # include <stdbool.h>
- # include <stdint.h>
-@@ -205,6 +206,7 @@ error_tail (int status, int errnum, const char *message, va_list args)
- #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 @@ error_tail (int status, int errnum, const char *message, va_list args)
-
- if (use_malloc)
- free (wmessage);
-+#else
-+ abort ();
-+#endif
- }
- else
- #endif
-diff --git a/misc/tst-efgcvt.c b/misc/tst-efgcvt.c
-index 5083fec..79ed36c 100644
---- a/misc/tst-efgcvt.c
-+++ b/misc/tst-efgcvt.c
-@@ -59,7 +59,7 @@ static testcase ecvt_tests[] =
- { 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
-diff --git a/nis/Makefile b/nis/Makefile
-index 037e674..c967850 100644
---- a/nis/Makefile
-+++ b/nis/Makefile
-@@ -18,6 +18,8 @@
- #
- # Makefile for NIS/NIS+ part.
- #
-+include ../option-groups.mak
-+
- subdir := nis
-
- include ../Makeconfig
-@@ -30,19 +32,26 @@ endif
-
- # 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 @@ libnsl-routines = yp_xdr ypclnt ypupdate_xdr \
- 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 @@ libnsl-libc = $(common-objpfx)linkobj/libc.so
- # 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
-diff --git a/nptl/Makefile b/nptl/Makefile
-index aaca0a4..596ca3c 100644
---- a/nptl/Makefile
-+++ b/nptl/Makefile
-@@ -18,6 +18,8 @@
- #
- # Sub-makefile for NPTL portion of the library.
- #
-+include ../option-groups.mak
-+
- subdir := nptl
-
- include ../Makeconfig
-@@ -118,7 +120,7 @@ libpthread-routines = nptl-init vars events version pt-interp \
- 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 \
-@@ -138,8 +140,10 @@ libpthread-routines = nptl-init vars events version pt-interp \
- # pthread_setgid pthread_setegid pthread_setregid \
- # pthread_setresgid
-
-+libpthread-routines-$(OPTION_EGLIBC_INET) := herrno res
- libpthread-shared-only-routines = version pt-interp pt-allocrtsig \
- unwind-forcedunwind
-+
- libpthread-static-only-routines = pthread_atfork
-
- # Since cancellation handling is in large parts handled using exceptions
-@@ -220,7 +224,7 @@ tests = tst-typesizes \
- 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 \
-@@ -256,14 +260,14 @@ tests = tst-typesizes \
- 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-stack4 tst-pthread-getattr \
-@@ -271,13 +275,12 @@ tests = tst-typesizes \
- 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-getpid3 \
-@@ -288,9 +291,16 @@ xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \
- tst-mutexpp1 tst-mutexpp6 tst-mutexpp10
- test-srcs = tst-oddstacklimit
-
--# Test expected to fail on most targets (except x86_64) due to bug
--# 18435 - pthread_once hangs when init routine throws an exception.
--test-xfail-tst-once5 = yes
-+# 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
-diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
-index d10f4ea..14257ce 100644
---- a/nptl/pthread_create.c
-+++ b/nptl/pthread_create.c
-@@ -33,6 +33,7 @@
- #include <default-sched.h>
- #include <futex-internal.h>
-
-+#include <gnu/option-groups.h>
- #include <shlib-compat.h>
-
- #include <stap-probe.h>
-@@ -262,8 +263,10 @@ START_THREAD_DEFN
- 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 ();
-@@ -346,8 +349,10 @@ START_THREAD_DEFN
- /* 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
-diff --git a/nscd/Makefile b/nscd/Makefile
-index ede941d..f4f3f8d 100644
---- a/nscd/Makefile
-+++ b/nscd/Makefile
-@@ -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 @@ nscd-modules := nscd connections pwdcache getpwnam_r getpwuid_r grpcache \
- 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
-
-@@ -100,7 +107,15 @@ include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
- $(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
-diff --git a/nscd/nis_hash.c b/nscd/nis_hash.c
-new file mode 100644
-index 0000000..d244c41
---- /dev/null
-+++ b/nscd/nis_hash.c
-@@ -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"
-diff --git a/nss/Makefile b/nss/Makefile
-index 65ab7b5..19f0aef 100644
---- a/nss/Makefile
-+++ b/nss/Makefile
-@@ -18,28 +18,35 @@
- #
- # 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 ethers \
-- spwd netgrp alias sgrp
-+databases-y = grp pwd spwd sgrp
-+databases-$(OPTION_EGLIBC_INET) \
-+ += proto service hosts network ethers \
-+ netgrp
-+databases-$(OPTION_EGLIBC_DB_ALIASES) += alias
-+
-+routines-$(OPTION_EGLIBC_INET) += digits_dots
-
- ifneq (,$(filter sunrpc,$(subdirs)))
--databases += key rpc
-+databases-$(OPTION_EGLIBC_INET) += key rpc
- have-sunrpc := 1
- else
- have-sunrpc := 0
- endif
-+# This is the trivial part which goes into libc itself.
-+routines-y += nsswitch getnssent getnssent_r \
-+ $(addsuffix -lookup,$(databases-y))
-+
- CPPFLAGS-getent.c = -DHAVE_SUNRPC=$(have-sunrpc)
-
- others := getent makedb
-@@ -47,8 +54,9 @@ install-bin := getent makedb
- makedb-modules = xmalloc hash-string
- extra-objs += $(makedb-modules:=.o)
-
--tests = test-netdb tst-nss-test1 test-digits-dots tst-nss-getpwent
--xtests = bug-erange
-+tests = tst-nss-test1 tst-nss-getpwent
-+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
-@@ -63,7 +71,7 @@ subdir-dirs = $(services:%=nss_%)
- 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-,\
-@@ -86,6 +94,45 @@ tests-static = tst-nss-static
- 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))
-diff --git a/nss/fixed-nsswitch.conf b/nss/fixed-nsswitch.conf
-new file mode 100644
-index 0000000..91bb675
---- /dev/null
-+++ b/nss/fixed-nsswitch.conf
-@@ -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
-diff --git a/nss/fixed-nsswitch.functions b/nss/fixed-nsswitch.functions
-new file mode 100644
-index 0000000..2f3fa83
---- /dev/null
-+++ b/nss/fixed-nsswitch.functions
-@@ -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)
-diff --git a/nss/gen-fixed-nsswitch.c b/nss/gen-fixed-nsswitch.c
-new file mode 100644
-index 0000000..6e1c98c
---- /dev/null
-+++ b/nss/gen-fixed-nsswitch.c
-@@ -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 <stdlib.h>
-+#include <stdio.h>
-+#include <errno.h>
-+#include <string.h>
-+#include <stdarg.h>
-+#include <assert.h>
-+#include <ctype.h>
-+
-+#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:
-+ `( <source> ( "[" "!"? (<status> "=" <action> )+ "]" )? )*'
-+ */
-+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 <source> 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 `<database> ":"'. */
-+ 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;
-+}
-diff --git a/nss/getent.c b/nss/getent.c
-index 34df848..674c8ee 100644
---- a/nss/getent.c
-+++ b/nss/getent.c
-@@ -39,6 +39,7 @@
- #include <netinet/ether.h>
- #include <netinet/in.h>
- #include <sys/socket.h>
-+#include <gnu/option-groups.h>
-
- /* Get libc version number. */
- #include <version.h>
-@@ -91,6 +92,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
- 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 @@ aliases_keys (int number, char *key[])
-
- 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 @@ ethers_keys (int number, char *key[])
-
- return result;
- }
-+#endif /* __OPTION_EGLIBC_INET */
-
- /* This is for group */
- static void
-@@ -301,6 +306,7 @@ gshadow_keys (int number, char *key[])
- return result;
- }
-
-+#if __OPTION_EGLIBC_INET
- /* This is for hosts */
- static void
- print_hosts (struct hostent *host)
-@@ -598,6 +604,7 @@ networks_keys (int number, char *key[])
-
- return result;
- }
-+#endif /* __OPTION_EGLIBC_INET */
-
- /* Now is all for passwd */
- static void
-@@ -650,6 +657,7 @@ passwd_keys (int number, char *key[])
- return result;
- }
-
-+#if __OPTION_EGLIBC_INET
- /* This is for protocols */
- static void
- print_protocols (struct protoent *proto)
-@@ -807,6 +815,7 @@ services_keys (int number, char *key[])
-
- return result;
- }
-+#endif /* __OPTION_EGLIBC_INET */
-
- /* This is for shadow */
- static void
-@@ -873,23 +882,36 @@ struct
- } 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)
--D(initgroups)
--D(netgroup)
--D(networks)
-+DN(hosts)
-+DN(initgroups)
-+DN(netgroup)
-+DN(networks)
- D(passwd)
--D(protocols)
-+DN(protocols)
- #if HAVE_SUNRPC
--D(rpc)
-+DN(rpc)
- #endif
--D(services)
-+DN(services)
- D(shadow)
- #undef D
- { NULL, NULL }
-diff --git a/nss/getnssent_r.c b/nss/getnssent_r.c
-index f5b9036..f09f7fe 100644
---- a/nss/getnssent_r.c
-+++ b/nss/getnssent_r.c
-@@ -16,6 +16,7 @@
- <http://www.gnu.org/licenses/>. */
-
- #include <errno.h>
-+#include <gnu/option-groups.h>
- #include <netdb.h>
- #include "nsswitch.h"
-
-@@ -59,11 +60,13 @@ __nss_setent (const char *func_name, db_lookup_function lookup_fct,
- } 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 @@ __nss_endent (const char *func_name, db_lookup_function lookup_fct,
- } 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 @@ __nss_getent_r (const char *getent_func_name,
- 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 @@ __nss_getent_r (const char *getent_func_name,
- 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
-diff --git a/nss/nsswitch.c b/nss/nsswitch.c
-index 9712623..c81e207 100644
---- a/nss/nsswitch.c
-+++ b/nss/nsswitch.c
-@@ -26,6 +26,7 @@
- #include <stdio_ext.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <gnu/option-groups.h>
-
- #include <aliases.h>
- #include <grp.h>
-@@ -41,6 +42,15 @@
- #include "../nscd/nscd_proto.h"
- #include <sysdep.h>
-
-+/* 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 @@ bool __nss_database_custom[NSS_DBSIDX_max];
-
- __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 @@ static name_database *service_table;
- __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 @@ __nss_database_lookup (const char *database, const char *alternate_name,
- 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 @@ __nss_database_lookup (const char *database, const char *alternate_name,
- *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 @@ __nss_database_lookup (const char *database, const char *alternate_name,
- {
- 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 @@ __nss_next2 (service_user **ni, const char *fct_name, const char *fct2_name,
- 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 @@ __nss_configure_lookup (const char *dbname, const char *service_line)
- }
-
- /* 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 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
- 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 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
- 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 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
- #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 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
- }
-
- /* 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 @@ nss_parse_service_list (const char *line)
- + (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 @@ nss_parse_service_list (const char *line)
- 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 @@ nss_getline (char *line)
- 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 @@ nss_new_service (name_database *database, const char *name)
- return *currentp;
- }
- #endif
-+#endif /* __OPTION_EGLIBC_NSSWITCH */
-
-
- #if defined SHARED && defined USE_NSCD
-@@ -834,6 +909,7 @@ nss_load_all_libraries (const char *service, const char *def)
- }
-
-
-+#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_disable_nscd (void (*cb) (size_t, struct traced_file *))
- __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 @@ free_database_entries (name_database_entry *entry)
- {
- 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 @@ libc_freeres_fn (free_mem)
-
- free (top);
- }
-+#endif /* __OPTION_EGLIBC_NSSWITCH */
-diff --git a/nss/nsswitch.h b/nss/nsswitch.h
-index a5318fa..1730977 100644
---- a/nss/nsswitch.h
-+++ b/nss/nsswitch.h
-@@ -65,10 +65,20 @@ typedef struct service_user
- 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 @@ typedef struct name_database_entry
- /* List of service to be used. */
- service_user *service;
- /* Name of the database. */
-- char name[0];
-+ const char *name;
- } name_database_entry;
-
-
-diff --git a/posix/Makefile b/posix/Makefile
-index 15e8818..609ed03 100644
---- a/posix/Makefile
-+++ b/posix/Makefile
-@@ -18,6 +18,8 @@
- #
- # Sub-makefile for POSIX portion of the library.
- #
-+include ../option-groups.mak
-+
- subdir := posix
-
- include ../Makeconfig
-@@ -43,13 +45,24 @@ routines := \
- 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 \
-@@ -61,37 +74,54 @@ routines := \
- posix_madvise \
- get_child_max sched_cpucount sched_cpualloc sched_cpufree
-
-+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-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 \
-+ 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 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-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 tst-getaddrinfo5
--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 +147,10 @@ generated += $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 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 +158,16 @@ endif
- # 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.out $(objpfx)tst-rxspencer-no-utf8-mem.out \
-+ $(objpfx)tst-pcre-mem.out $(objpfx)tst-boost-mem.out
-+endif
-+
- xtests-special += $(objpfx)bug-ga2-mem.out
- endif
-
-@@ -143,6 +180,8 @@ $(objpfx)globtest.out: globtest.sh $(objpfx)globtest
- $(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 +244,10 @@ tst-dir-ARGS = `pwd` `cd $(common-objdir)/$(subdir); pwd` `cd $(common-objdir);
- 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
-diff --git a/posix/bug-regex1.c b/posix/bug-regex1.c
-index 38eb543..17cd1a0 100644
---- a/posix/bug-regex1.c
-+++ b/posix/bug-regex1.c
-@@ -4,6 +4,7 @@
- #include <string.h>
- #include <regex.h>
- #include <wchar.h>
-+#include <gnu/option-groups.h>
-
- int
- main (void)
-@@ -17,7 +18,9 @@ main (void)
- memset (&regex, '\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);
-
-diff --git a/posix/bug-regex6.c b/posix/bug-regex6.c
-index efcc890..3b270c7 100644
---- a/posix/bug-regex6.c
-+++ b/posix/bug-regex6.c
-@@ -22,6 +22,7 @@
- #include <string.h>
- #include <sys/types.h>
- #include <regex.h>
-+#include <gnu/option-groups.h>
-
-
- int
-@@ -30,7 +31,12 @@ main (int argc, char *argv[])
- 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 },
-diff --git a/posix/fnmatch.c b/posix/fnmatch.c
-index fd85efa..01cc9fe 100644
---- a/posix/fnmatch.c
-+++ b/posix/fnmatch.c
-@@ -30,6 +30,10 @@
- #include <ctype.h>
- #include <string.h>
-
-+#if defined _LIBC
-+# include <gnu/option-groups.h>
-+#endif
-+
- #if defined STDC_HEADERS || defined _LIBC
- # include <stdlib.h>
- #endif
-@@ -131,7 +135,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
- # 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
-diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c
-index f46c9df..74e1754 100644
---- a/posix/fnmatch_loop.c
-+++ b/posix/fnmatch_loop.c
-@@ -15,6 +15,8 @@
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-+#include <gnu/option-groups.h>
-+
- #include <stdint.h>
-
- struct STRUCT
-@@ -54,10 +56,15 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
- 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 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
- /* 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 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
- }
- 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. */
-@@ -680,8 +687,10 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
- 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;
-@@ -857,7 +866,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
- goto matched;
- }
- # else
-- hcollseq = collseq[cend];
-+ hcollseq = COLLSEQ_BYTE_LOOKUP (cend);
- # endif
- }
-
-diff --git a/posix/glob.c b/posix/glob.c
-index d65e55d..1ac00a1 100644
---- a/posix/glob.c
-+++ b/posix/glob.c
-@@ -25,6 +25,9 @@
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <stddef.h>
-+#ifdef _LIBC
-+# include <gnu/option-groups.h>
-+#endif
-
- /* Outcomment the following line for production quality code. */
- /* #define NDEBUG 1 */
-@@ -607,6 +610,7 @@ glob (pattern, flags, errfunc, pglob)
- 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 @@ glob (pattern, flags, errfunc, pglob)
- 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 @@ glob (pattern, flags, errfunc, pglob)
- }
- __set_errno (save);
- }
--# else
-+# else
- p = getpwnam (name);
--# endif
-+# endif
- if (p != NULL)
- {
- if (!malloc_pwtmpbuf)
-@@ -713,6 +717,7 @@ glob (pattern, flags, errfunc, pglob)
- }
- }
- }
-+# endif /* ! _LIBC || __OPTION_EGLIBC_GETLOGIN */
- if (home_dir == NULL || home_dir[0] == '\0')
- {
- if (flags & GLOB_TILDE_CHECK)
-diff --git a/posix/regcomp.c b/posix/regcomp.c
-index bf8aa16..6a41251 100644
---- a/posix/regcomp.c
-+++ b/posix/regcomp.c
-@@ -18,6 +18,7 @@
- <http://www.gnu.org/licenses/>. */
-
- #include <stdint.h>
-+#include <gnu/option-groups.h>
-
- #ifdef _LIBC
- # include <locale/weight.h>
-@@ -309,7 +310,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
- {
- 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];
-@@ -319,9 +320,9 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
- {
- 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;
-
-@@ -352,7 +353,11 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
- 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;
-@@ -380,7 +385,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
- 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
-@@ -408,7 +413,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
- 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)
-@@ -417,7 +422,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
- }
- }
- }
--#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
-@@ -860,11 +865,15 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
-
- 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);
-@@ -890,7 +899,7 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
- #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;
-@@ -1788,7 +1797,7 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
- 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;
-@@ -1809,7 +1818,7 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
- 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);
-@@ -1923,7 +1932,7 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
-
- 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;
-@@ -2023,7 +2032,7 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
- 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;
-@@ -2246,7 +2255,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
- 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)))
-@@ -2384,7 +2393,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
- *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:
-@@ -2690,7 +2699,7 @@ build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
- 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. */
-@@ -2786,7 +2795,13 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
- 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;
-@@ -2834,18 +2849,20 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
- 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);
-@@ -2876,11 +2893,11 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
- {
- /* 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;
- }
-@@ -2920,7 +2937,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
- 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))
-@@ -2957,7 +2974,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
- 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)
-@@ -3035,7 +3052,10 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
- 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;
-@@ -3043,9 +3063,15 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
- 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)
- {
- /*
-@@ -3175,7 +3201,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
- #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);
-@@ -3191,7 +3217,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
- 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))
-@@ -3209,7 +3235,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
- }
- 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
-@@ -3259,11 +3285,11 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
-
- #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;
-@@ -3332,7 +3358,7 @@ parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
- 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)
-@@ -3342,7 +3368,7 @@ parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
- 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)
-@@ -3422,7 +3448,9 @@ build_equiv_class (bitset_t sbcset, re_charset_t *mbcset,
- 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)
- {
-@@ -3492,7 +3520,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
- 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;
-@@ -3526,7 +3554,7 @@ build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset,
- && (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))
- {
-@@ -3542,7 +3570,7 @@ build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset,
- *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 { \
-@@ -3653,7 +3681,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
-
- #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
-
-@@ -3665,7 +3693,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
- 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. */
-diff --git a/posix/regex.h b/posix/regex.h
-index 5b1981e..2941f94 100644
---- a/posix/regex.h
-+++ b/posix/regex.h
-@@ -21,6 +21,7 @@
- #define _REGEX_H 1
-
- #include <sys/types.h>
-+#include <gnu/option-groups.h>
-
- /* Allow the use in C++ code. */
- #ifdef __cplusplus
-@@ -156,6 +157,8 @@ typedef unsigned long int reg_syntax_t;
- treated as 'a\{1'. */
- # define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
-
-+/* EGLIBC: Old regex implementation does not support these. */
-+# if __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 @@ typedef unsigned long int reg_syntax_t;
- /* 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 @@ extern reg_syntax_t re_syntax_options;
- (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
- | RE_INTERVALS | RE_NO_EMPTY_RANGES)
-
-+#if __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 @@ extern reg_syntax_t re_syntax_options;
- /* Like REG_NOTBOL, except for the end-of-line. */
- #define REG_NOTEOL (1 << 1)
-
-+#if __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
-diff --git a/posix/regex_internal.c b/posix/regex_internal.c
-index 8597d7e..d53b2a8 100644
---- a/posix/regex_internal.c
-+++ b/posix/regex_internal.c
-@@ -43,8 +43,8 @@ re_string_allocate (re_string_t *pstr, const char *str, int len, int init_len,
- 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 @@ re_string_allocate (re_string_t *pstr, const char *str, int len, int init_len,
- 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 @@ re_string_construct (re_string_t *pstr, const char *str, int len,
- 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 @@ re_string_construct (re_string_t *pstr, const char *str, int len,
- 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 @@ re_string_construct (re_string_t *pstr, const char *str, int len,
- 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 @@ internal_function __attribute_warn_unused_result__
- 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 @@ re_string_construct_common (const char *str, int len, re_string_t *pstr,
- 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 @@ build_wcs_buffer (re_string_t *pstr)
- {
- #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 @@ build_wcs_buffer (re_string_t *pstr)
- {
- 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 @@ build_wcs_upper_buffer (re_string_t *pstr)
- 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 @@ build_wcs_upper_buffer (re_string_t *pstr)
- {
- 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 @@ re_string_translate_buffer (re_string_t *pstr)
- }
-
- /* 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 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
- {
- /* 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 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
- 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 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
- #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 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
- /* 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 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
-
- /* 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 @@ re_string_peek_byte_case (const re_string_t *pstr, int idx)
- 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 @@ re_string_context_at (const re_string_t *input, int idx, int eflags)
- 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 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
- 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);
-diff --git a/posix/regex_internal.h b/posix/regex_internal.h
-index 154e969..c43909a 100644
---- a/posix/regex_internal.h
-+++ b/posix/regex_internal.h
-@@ -26,6 +26,10 @@
- #include <stdlib.h>
- #include <string.h>
-
-+#if defined _LIBC
-+# include <gnu/option-groups.h>
-+#endif
-+
- #if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC
- # include <langinfo.h>
- #endif
-@@ -369,6 +373,13 @@ struct re_string_t
- };
- 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;
-@@ -654,6 +665,14 @@ struct re_dfa_t
- __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))
-@@ -714,7 +733,7 @@ internal_function __attribute__ ((pure, unused))
- 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)
-@@ -726,7 +745,7 @@ static wint_t
- 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];
- }
-diff --git a/posix/regexec-compat.c b/posix/regexec-compat.c
-new file mode 100644
-index 0000000..0f9b7c7
---- /dev/null
-+++ b/posix/regexec-compat.c
-@@ -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 <isamu@yamato.ibm.com>.
-+
-+ 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 <shlib-compat.h>
-+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
-diff --git a/posix/regexec.c b/posix/regexec.c
-index 70cd606..e3b49e4 100644
---- a/posix/regexec.c
-+++ b/posix/regexec.c
-@@ -18,6 +18,7 @@
- <http://www.gnu.org/licenses/>. */
-
- #include <stdint.h>
-+#include <gnu/option-groups.h>
-
- static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
- int n) internal_function;
-@@ -186,11 +187,11 @@ static int build_trtable (const re_dfa_t *dfa,
- 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 @@ regexec (preg, string, nmatch, pmatch, eflags)
- return err != REG_NOERROR;
- }
-
--#ifdef _LIBC
--# include <shlib-compat.h>
--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 @@ re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch,
- 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 @@ out_free:
- 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 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
- 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 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
- 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 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
- 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
-@@ -3836,12 +3821,6 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
- 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);
-@@ -3853,6 +3832,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
- 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)
- {
-@@ -3863,14 +3843,22 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
- 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)
- {
- unsigned int in_collseq = 0;
- const int32_t *table, *indirect;
-- const unsigned char *weights, *extra;
-+ const unsigned char *weights, *extra = NULL;
- const char *collseqwc;
-
- /* match with collating_symbol? */
-@@ -3955,8 +3943,12 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
- }
- }
- 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'};
-@@ -3975,6 +3967,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
- goto check_node_accept_bytes_match;
- }
- }
-+#endif /* __OPTION_EGLIBC_LOCALE_CODE */
- }
- check_node_accept_bytes_match:
- if (!cset->non_match)
-@@ -3990,7 +3983,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
- 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)
-@@ -4048,7 +4041,7 @@ find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
- 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
-@@ -4139,7 +4132,7 @@ extend_buffers (re_match_context_t *mctx, int min_len)
- 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))
-@@ -4152,7 +4145,7 @@ extend_buffers (re_match_context_t *mctx, int min_len)
- 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 */
-diff --git a/posix/xregex.c b/posix/xregex.c
-new file mode 100644
-index 0000000..d3f7ace
---- /dev/null
-+++ b/posix/xregex.c
-@@ -0,0 +1,8215 @@
-+/* 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 <config.h>
-+# endif
-+#endif
-+
-+/*#include <ansidecl.h>*/
-+
-+
-+#ifndef INSIDE_RECURSION
-+
-+# if defined STDC_HEADERS && !defined emacs
-+# include <stddef.h>
-+# else
-+/* We need this for `regex.h', and perhaps for the Emacs include files. */
-+# include <sys/types.h>
-+# endif
-+
-+# if (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_BTOWC)
-+# define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
-+# else
-+# define WIDE_CHAR_SUPPORT 0
-+# endif
-+/* 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: <wchar.h> must be included before <wctype.h>. */
-+# include <wchar.h>
-+# include <wctype.h>
-+# 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 <locale/localeinfo.h>
-+# include <locale/elem-hash.h>
-+# include <langinfo.h>
-+# include <locale/coll-lookup.h>
-+# endif
-+
-+/* This is for other GNU distributions with internationalized messages. */
-+# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
-+# include <libintl.h>
-+# 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 <stdlib.h>
-+# 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 <string.h>
-+# 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 <strings.h>
-+# 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 <limits.h>
-+# 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 <ctype.h>
-+
-+/* 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 <alloca.h>
-+# 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)
-+# include <locale/weight.h>
-+# define FINDIDX findidx
-+#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
-+# define findidx findidxwc
-+# include <locale/weightwc.h>
-+# undef findidx
-+# define FINDIDX findidxwc
-+# 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 <stdio.h>
-+
-+/* It is useful to test things that ``must'' be true when debugging. */
-+# include <assert.h>
-+
-+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 ; i<length ; i++)
-+ printf("[:%lx:]", (long int) *p++);
-+ length = *workp++; /* the length of collating_symbol */
-+ for (i=0 ; i<length ;)
-+ {
-+ printf("[.");
-+ while(*p != 0)
-+ PUT_CHAR((i++,*p++));
-+ i++,p++;
-+ printf(".]");
-+ }
-+ length = *workp++; /* the length of equivalence_class */
-+ for (i=0 ; i<length ;)
-+ {
-+ printf("[=");
-+ while(*p != 0)
-+ PUT_CHAR((i++,*p++));
-+ i++,p++;
-+ printf("=]");
-+ }
-+ length = *workp++; /* the length of char_range */
-+ for (i=0 ; i<length ; i++)
-+ {
-+ wchar_t range_start = *p++;
-+ wchar_t range_end = *p++;
-+ printf("%C-%C", range_start, range_end);
-+ }
-+ length = *workp++; /* the length of char */
-+ for (i=0 ; i<length ; i++)
-+ printf("%C", *p++);
-+ putchar (']');
-+# else
-+ register int c, last = -100;
-+ register int in_range = 0;
-+
-+ printf ("/charset [%s",
-+ (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
-+
-+ assert (p + *p < pend);
-+
-+ for (c = 0; c < 256; c++)
-+ if (c / 8 < *p
-+ && (p[1 + (c/8)] & (1 << (c % 8))))
-+ {
-+ /* Are we starting a range? */
-+ if (last + 1 == c && ! in_range)
-+ {
-+ putchar ('-');
-+ in_range = 1;
-+ }
-+ /* Have we broken a range? */
-+ else if (last + 1 != c && in_range)
-+ {
-+ putchar (last);
-+ in_range = 0;
-+ }
-+
-+ if (! in_range)
-+ putchar (c);
-+
-+ last = c;
-+ }
-+
-+ if (in_range)
-+ putchar (last);
-+
-+ putchar (']');
-+
-+ p += 1 + *p;
-+# endif /* WCHAR */
-+ }
-+ break;
-+
-+ case begline:
-+ printf ("/begline");
-+ break;
-+
-+ case endline:
-+ printf ("/endline");
-+ break;
-+
-+ case on_failure_jump:
-+ PREFIX(extract_number_and_incr) (&mcnt, &p);
-+# ifdef _LIBC
-+ printf ("/on_failure_jump to %td", p + mcnt - start);
-+# else
-+ printf ("/on_failure_jump to %ld", (long int) (p + mcnt - start));
-+# endif
-+ break;
-+
-+ case on_failure_keep_string_jump:
-+ PREFIX(extract_number_and_incr) (&mcnt, &p);
-+# ifdef _LIBC
-+ printf ("/on_failure_keep_string_jump to %td", p + mcnt - start);
-+# else
-+ printf ("/on_failure_keep_string_jump to %ld",
-+ (long int) (p + mcnt - start));
-+# endif
-+ break;
-+
-+ case dummy_failure_jump:
-+ PREFIX(extract_number_and_incr) (&mcnt, &p);
-+# ifdef _LIBC
-+ printf ("/dummy_failure_jump to %td", p + mcnt - start);
-+# else
-+ printf ("/dummy_failure_jump to %ld", (long int) (p + mcnt - start));
-+# endif
-+ break;
-+
-+ case push_dummy_failure:
-+ printf ("/push_dummy_failure");
-+ break;
-+
-+ case maybe_pop_jump:
-+ PREFIX(extract_number_and_incr) (&mcnt, &p);
-+# ifdef _LIBC
-+ printf ("/maybe_pop_jump to %td", p + mcnt - start);
-+# else
-+ printf ("/maybe_pop_jump to %ld", (long int) (p + mcnt - start));
-+# endif
-+ break;
-+
-+ case pop_failure_jump:
-+ PREFIX(extract_number_and_incr) (&mcnt, &p);
-+# ifdef _LIBC
-+ printf ("/pop_failure_jump to %td", p + mcnt - start);
-+# else
-+ printf ("/pop_failure_jump to %ld", (long int) (p + mcnt - start));
-+# endif
-+ break;
-+
-+ case jump_past_alt:
-+ PREFIX(extract_number_and_incr) (&mcnt, &p);
-+# ifdef _LIBC
-+ printf ("/jump_past_alt to %td", p + mcnt - start);
-+# else
-+ printf ("/jump_past_alt to %ld", (long int) (p + mcnt - start));
-+# endif
-+ break;
-+
-+ case jump:
-+ PREFIX(extract_number_and_incr) (&mcnt, &p);
-+# ifdef _LIBC
-+ printf ("/jump to %td", p + mcnt - start);
-+# else
-+ printf ("/jump to %ld", (long int) (p + mcnt - start));
-+# endif
-+ break;
-+
-+ case succeed_n:
-+ PREFIX(extract_number_and_incr) (&mcnt, &p);
-+ p1 = p + mcnt;
-+ PREFIX(extract_number_and_incr) (&mcnt2, &p);
-+# ifdef _LIBC
-+ printf ("/succeed_n to %td, %d times", p1 - start, mcnt2);
-+# else
-+ printf ("/succeed_n to %ld, %d times",
-+ (long int) (p1 - start), mcnt2);
-+# endif
-+ break;
-+
-+ case jump_n:
-+ PREFIX(extract_number_and_incr) (&mcnt, &p);
-+ p1 = p + mcnt;
-+ PREFIX(extract_number_and_incr) (&mcnt2, &p);
-+ printf ("/jump_n to %d, %d times", p1 - start, mcnt2);
-+ break;
-+
-+ case set_number_at:
-+ PREFIX(extract_number_and_incr) (&mcnt, &p);
-+ p1 = p + mcnt;
-+ PREFIX(extract_number_and_incr) (&mcnt2, &p);
-+# ifdef _LIBC
-+ printf ("/set_number_at location %td to %d", p1 - start, mcnt2);
-+# else
-+ printf ("/set_number_at location %ld to %d",
-+ (long int) (p1 - start), mcnt2);
-+# endif
-+ break;
-+
-+ case wordbound:
-+ printf ("/wordbound");
-+ break;
-+
-+ case notwordbound:
-+ printf ("/notwordbound");
-+ break;
-+
-+ case wordbeg:
-+ printf ("/wordbeg");
-+ break;
-+
-+ case wordend:
-+ printf ("/wordend");
-+ break;
-+
-+# ifdef emacs
-+ case before_dot:
-+ printf ("/before_dot");
-+ break;
-+
-+ case at_dot:
-+ printf ("/at_dot");
-+ break;
-+
-+ case after_dot:
-+ printf ("/after_dot");
-+ break;
-+
-+ case syntaxspec:
-+ printf ("/syntaxspec");
-+ mcnt = *p++;
-+ printf ("/%d", mcnt);
-+ break;
-+
-+ case notsyntaxspec:
-+ printf ("/notsyntaxspec");
-+ mcnt = *p++;
-+ printf ("/%d", mcnt);
-+ break;
-+# endif /* emacs */
-+
-+ case wordchar:
-+ printf ("/wordchar");
-+ break;
-+
-+ case notwordchar:
-+ printf ("/notwordchar");
-+ break;
-+
-+ case begbuf:
-+ printf ("/begbuf");
-+ break;
-+
-+ case endbuf:
-+ printf ("/endbuf");
-+ break;
-+
-+ default:
-+ printf ("?%ld", (long int) *(p-1));
-+ }
-+
-+ putchar ('\n');
-+ }
-+
-+# ifdef _LIBC
-+ printf ("%td:\tend of pattern.\n", p - start);
-+# else
-+ printf ("%ld:\tend of pattern.\n", (long int) (p - start));
-+# endif
-+}
-+
-+
-+void
-+PREFIX(print_compiled_pattern) (struct re_pattern_buffer *bufp)
-+{
-+ UCHAR_T *buffer = (UCHAR_T*) bufp->buffer;
-+
-+ 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 <shlib-compat.h>
-+
-+# 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. */
-+# ifndef __BOUNDED_POINTERS__
-+# define __BOUNDED_POINTERS__ 0
-+# endif
-+# 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;
-+
-+ 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 wint_t *)
-+ _NL_CURRENT (LC_COLLATE,
-+ _NL_COLLATE_EXTRAWC);
-+ indirect = (const int32_t *)
-+ _NL_CURRENT (LC_COLLATE,
-+ _NL_COLLATE_INDIRECTWC);
-+
-+ idx = FINDIDX (table, indirect, extra, &cp, 1);
-+ 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;
-+
-+ 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 (table, indirect, extra, &cp, 1);
-+ 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 <jump count> <upper bound>
-+ set_number_at <succeed_n count> <lower bound>
-+ succeed_n <after jump addr> <succeed_n count>
-+ <body of loop>
-+ jump_n <succeed_n addr> <jump count>
-+ (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;
-+
-+ 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 (table, indirect, extra, &cp, 1);
-+ }
-+
-+ /* 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;
-+
-+
-+ /* \<digit> has been turned into a `duplicate' command which is
-+ followed by the numeric value of <digit> 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 __attribute__ ((unused)) = NULL;
-+ const CHAR_T *sdummy __attribute__ ((unused)) = 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 ? &regs : (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
-diff --git a/pwd/Makefile b/pwd/Makefile
-index 7f6de03..916d546 100644
---- a/pwd/Makefile
-+++ b/pwd/Makefile
-@@ -18,6 +18,8 @@
- #
- # Sub-makefile for pwd portion of the library.
- #
-+include ../option-groups.mak
-+
- subdir := pwd
-
- include ../Makeconfig
-diff --git a/resolv/Makefile b/resolv/Makefile
-index 1dcb75f..2e4b630 100644
---- a/resolv/Makefile
-+++ b/resolv/Makefile
-@@ -18,6 +18,8 @@
- #
- # Sub-makefile for resolv portion of the library.
- #
-+include ../option-groups.mak
-+
- subdir := resolv
-
- include ../Makeconfig
-@@ -27,21 +29,22 @@ headers := resolv.h \
- 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
- tests += tst-res_hconf_reorder
- 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 \
-@@ -61,7 +64,7 @@ routines += $(libnss_dns-routines) $(libresolv-routines)
- 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
-
-diff --git a/stdio-common/Makefile b/stdio-common/Makefile
-index d0bf0e1..8655801 100644
---- a/stdio-common/Makefile
-+++ b/stdio-common/Makefile
-@@ -18,6 +18,8 @@
- #
- # Specific makefile for stdio-common.
- #
-+include ../option-groups.mak
-+
- subdir := stdio-common
-
- include ../Makeconfig
-@@ -30,7 +32,7 @@ routines := \
- 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,36 @@ routines := \
- 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 \
-+ 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 \
-+ 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 bug23-2 bug23-3 bug23-4 bug26 tst-fmemopen3
-+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
-
-diff --git a/stdio-common/_i18n_number.h b/stdio-common/_i18n_number.h
-index 3c73044..ac62b3a 100644
---- a/stdio-common/_i18n_number.h
-+++ b/stdio-common/_i18n_number.h
-@@ -19,10 +19,13 @@
- #include <stdbool.h>
- #include <wchar.h>
- #include <wctype.h>
-+#include <gnu/option-groups.h>
-
- #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 @@ _i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
-
- return w;
- }
-+
-+#else
-+
-+static CHAR_T *
-+_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
-+{
-+ return w;
-+}
-+
-+#endif
-diff --git a/stdio-common/fxprintf.c b/stdio-common/fxprintf.c
-index 7b2eb94..8476076 100644
---- a/stdio-common/fxprintf.c
-+++ b/stdio-common/fxprintf.c
-@@ -23,6 +23,7 @@
- #include <wchar.h>
- #include <string.h>
- #include <libioP.h>
-+#include <gnu/option-groups.h>
-
-
- int
-@@ -37,6 +38,7 @@ __fxprintf (FILE *fp, const char *fmt, ...)
- 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 @@ __fxprintf (FILE *fp, const char *fmt, ...)
- wfmt[i] = fmt[i];
- }
- res = __vfwprintf (fp, wfmt, ap);
-+#else
-+ abort();
-+#endif
- }
- else
- res = _IO_vfprintf (fp, fmt, ap);
-diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
-index 3023b20..bd0df66 100644
---- a/stdio-common/printf_fp.c
-+++ b/stdio-common/printf_fp.c
-@@ -39,6 +39,7 @@
- #include <unistd.h>
- #include <stdlib.h>
- #include <wchar.h>
-+#include <gnu/option-groups.h>
- #include <stdbool.h>
- #include <rounding-mode.h>
-
-@@ -142,6 +143,10 @@ extern mp_size_t __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
- extern unsigned int __guess_grouping (unsigned int intdig_max,
- const char *grouping);
-
-+/* 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. */
-
- static wchar_t *group_number (wchar_t *buf, wchar_t *bufend,
- unsigned int intdig_no, const char *grouping,
-@@ -251,7 +256,14 @@ ___printf_fp (FILE *fp,
- 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;
-@@ -261,6 +273,7 @@ ___printf_fp (FILE *fp,
- p.expsign = 0;
-
- /* Figure out the decimal point character. */
-+#if __OPTION_EGLIBC_LOCALE_CODE
- if (info->extra == 0)
- {
- decimal = _NL_CURRENT (LC_NUMERIC, DECIMAL_POINT);
-@@ -280,7 +293,13 @@ ___printf_fp (FILE *fp,
- /* 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)
-@@ -324,6 +343,9 @@ ___printf_fp (FILE *fp,
- }
- else
- grouping = NULL;
-+#else
-+ grouping = NULL;
-+#endif
-
- /* Fetch the argument value. */
- #ifndef __NO_LONG_DOUBLE_MATH
-diff --git a/stdio-common/printf_fphex.c b/stdio-common/printf_fphex.c
-index 6c3b5e9..f660ce0 100644
---- a/stdio-common/printf_fphex.c
-+++ b/stdio-common/printf_fphex.c
-@@ -28,6 +28,7 @@
- #include <_itoa.h>
- #include <_itowa.h>
- #include <locale/localeinfo.h>
-+#include <gnu/option-groups.h>
- #include <stdbool.h>
- #include <rounding-mode.h>
-
-@@ -139,10 +140,18 @@ __printf_fphex (FILE *fp,
- 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 @@ __printf_fphex (FILE *fp,
- }
- /* The decimal point character must never be zero. */
- assert (*decimal != '\0' && decimalwc != L'\0');
-+#else
-+ decimal = ".";
-+ decimalwc = L'.';
-+#endif
-
-
- /* Fetch the argument value. */
-diff --git a/stdio-common/printf_size.c b/stdio-common/printf_size.c
-index 7dcd58e..6fb7491 100644
---- a/stdio-common/printf_size.c
-+++ b/stdio-common/printf_size.c
-@@ -23,6 +23,7 @@
- #include <math.h>
- #include <printf.h>
- #include <libioP.h>
-+#include <gnu/option-groups.h>
-
-
- /* This defines make it possible to use the same code for GNU C library and
-@@ -116,7 +117,14 @@ __printf_size (FILE *fp, const struct printf_info *info,
-
- 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. */
-diff --git a/stdio-common/scanf14.c b/stdio-common/scanf14.c
-index cffccb0..6cc260a 100644
---- a/stdio-common/scanf14.c
-+++ b/stdio-common/scanf14.c
-@@ -3,6 +3,7 @@
- #include <string.h>
- #include <wchar.h>
- #include <libc-internal.h>
-+#include <gnu/option-groups.h>
-
- #define FAIL() \
- do { \
-@@ -48,6 +49,7 @@ main (void)
- /* See explanation above. */
- DIAG_PUSH_NEEDS_COMMENT;
- DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat");
-+#if __OPTION_EGLIBC_LOCALE_CODE
- if (sscanf (" 3.25S x", "%4aS%3c", &lsp, c) != 2)
- FAIL ();
- else
-@@ -57,6 +59,7 @@ main (void)
- 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
-diff --git a/stdio-common/tst-popen.c b/stdio-common/tst-popen.c
-index 5def27f..7c9b91e 100644
---- a/stdio-common/tst-popen.c
-+++ b/stdio-common/tst-popen.c
-@@ -19,6 +19,7 @@
- #include <stdio.h>
- #include <string.h>
- #include <wchar.h>
-+#include <gnu/option-groups.h>
-
- static int
- do_test (void)
-@@ -34,12 +35,14 @@ do_test (void)
- 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)
- {
-diff --git a/stdio-common/tst-sprintf.c b/stdio-common/tst-sprintf.c
-index d5284b9..f1e3d21 100644
---- a/stdio-common/tst-sprintf.c
-+++ b/stdio-common/tst-sprintf.c
-@@ -3,7 +3,7 @@
- #include <locale.h>
- #include <string.h>
- #include <libc-internal.h>
--
-+#include <gnu/option-groups.h>
-
- static int
- do_test (void)
-@@ -11,12 +11,14 @@ do_test (void)
- 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
-diff --git a/stdio-common/tstdiomisc.c b/stdio-common/tstdiomisc.c
-index 5548a71..31ed024 100644
---- a/stdio-common/tstdiomisc.c
-+++ b/stdio-common/tstdiomisc.c
-@@ -4,6 +4,7 @@
- #include <string.h>
- #include <wchar.h>
- #include <libc-internal.h>
-+#include <gnu/option-groups.h>
-
- static int
- t1 (void)
-@@ -134,6 +135,7 @@ F (void)
- 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);
-@@ -171,6 +173,7 @@ F (void)
- 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;
-
-@@ -215,6 +218,7 @@ F (void)
- 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,
-@@ -259,6 +263,7 @@ F (void)
- 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;
- }
-diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
-index 0592e70..f21d973 100644
---- a/stdio-common/vfprintf.c
-+++ b/stdio-common/vfprintf.c
-@@ -29,6 +29,7 @@
- #include <_itoa.h>
- #include <locale/localeinfo.h>
- #include <stdio.h>
-+#include <gnu/option-groups.h>
-
- /* This code is shared between the standard stdio implementation found
- in GNU C library and the libio implementation originally found in
-@@ -140,6 +141,18 @@ typedef wchar_t THOUSANDS_SEP_T;
- # 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. */
-@@ -1065,8 +1078,11 @@ static const uint8_t jump_table[] =
- # 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 (' '); \
-@@ -1079,6 +1095,7 @@ static const uint8_t jump_table[] =
- break; \
- \
- LABEL (form_wcharacter): \
-+ assert (MULTIBYTE_SUPPORT); \
- { \
- /* Wide character. */ \
- char buf[MB_CUR_MAX]; \
-@@ -1145,6 +1162,7 @@ static const uint8_t jump_table[] =
- } \
- else \
- { \
-+ assert (MULTIBYTE_SUPPORT); \
- const wchar_t *s2 = (const wchar_t *) string; \
- mbstate_t mbstate; \
- \
-@@ -1399,7 +1417,9 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
- 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,
-@@ -1728,8 +1748,9 @@ printf_positional (_IO_FILE *s, const CHAR_T *format, int readonly_format,
- size_t cnt;
-
- CHAR_T *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,
-diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
-index 0e204e7..66cc0af 100644
---- a/stdio-common/vfscanf.c
-+++ b/stdio-common/vfscanf.c
-@@ -29,6 +29,7 @@
- #include <wctype.h>
- #include <bits/libc-lock.h>
- #include <locale/localeinfo.h>
-+#include <gnu/option-groups.h>
-
- #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 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
- 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 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
- #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 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
- }
- /* FALLTHROUGH */
- case L_('C'):
-+ assert (MULTIBYTE_SUPPORT);
-+
- if (width == -1)
- width = 1;
-
-@@ -1172,6 +1194,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
- /* FALLTHROUGH */
-
- case L_('S'):
-+ assert (MULTIBYTE_SUPPORT);
-+
- {
- #ifndef COMPILE_WSCANF
- mbstate_t cstate;
-@@ -1419,10 +1443,17 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
- 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 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
- --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 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
- ;
- #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 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
-
- 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 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
- if (flags & LONG)
- {
- size_t now = read_in;
-+ assert (MULTIBYTE_SUPPORT);
- #ifdef COMPILE_WSCANF
- if (__glibc_unlikely (inchar () == WEOF))
- input_error ();
-diff --git a/stdlib/Makefile b/stdlib/Makefile
-index 402466a..7e7e304 100644
---- a/stdlib/Makefile
-+++ b/stdlib/Makefile
-@@ -18,6 +18,8 @@
- #
- # Makefile for stdlib routines
- #
-+include ../option-groups.mak
-+
- subdir := stdlib
-
- include ../Makeconfig
-@@ -30,7 +32,7 @@ headers := stdlib.h bits/stdlib.h bits/stdlib-ldbl.h bits/stdlib-float.h \
- alloca.h fmtmsg.h \
- bits/stdlib-bsearch.h
-
--routines := \
-+routines-y := \
- atof atoi atol atoll \
- abort \
- bsearch qsort msort \
-@@ -39,7 +41,6 @@ routines := \
- 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 @@ routines := \
- 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,24 @@ aux = grouping groupingwc tens_in_limb
- # 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 \
-- tst-setcontext2 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-setcontext2 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 \
- tst-setcontext3 tst-tls-atexit-nodelete
- 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
-
-@@ -116,8 +130,10 @@ CFLAGS-tst-makecontext2.c = $(stack-align-test-flags)
- 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
-
-diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
-index e13ab1e..63efe41 100644
---- a/stdlib/strtod_l.c
-+++ b/stdlib/strtod_l.c
-@@ -17,6 +17,7 @@
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-+#include <gnu/option-groups.h>
- #include <xlocale.h>
-
- extern double ____strtod_l_internal (const char *, char **, int, __locale_t);
-@@ -548,6 +549,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
- /* 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 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
- 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;
-diff --git a/stdlib/tst-strtod.c b/stdlib/tst-strtod.c
-index a469208..28fb423 100644
---- a/stdlib/tst-strtod.c
-+++ b/stdlib/tst-strtod.c
-@@ -23,6 +23,7 @@
- #include <errno.h>
- #include <string.h>
- #include <math.h>
-+#include <gnu/option-groups.h>
-
- struct ltest
- {
-@@ -176,7 +177,9 @@ main (int argc, char ** argv)
-
- status |= long_dbl ();
-
-+#if __OPTION_EGLIBC_LOCALE_CODE
- status |= locale_test ();
-+#endif
-
- return status ? EXIT_FAILURE : EXIT_SUCCESS;
- }
-@@ -219,6 +222,7 @@ long_dbl (void)
- 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 @@ locale_test (void)
-
- return result;
- }
-+#endif /* __OPTION_EGLIBC_LOCALE_CODE */
-diff --git a/streams/Makefile b/streams/Makefile
-index a8a6162..ceb423f 100644
---- a/streams/Makefile
-+++ b/streams/Makefile
-@@ -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
-diff --git a/string/Makefile b/string/Makefile
-index 8424a61..5988834 100644
---- a/string/Makefile
-+++ b/string/Makefile
-@@ -18,6 +18,8 @@
- #
- # Sub-makefile for string portion of library.
- #
-+include ../option-groups.mak
-+
- subdir := string
-
- include ../Makeconfig
-@@ -39,10 +41,12 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
- $(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 @@ strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \
- 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
-
-diff --git a/string/strcoll_l.c b/string/strcoll_l.c
-index 8f1225f..b36b18c 100644
---- a/string/strcoll_l.c
-+++ b/string/strcoll_l.c
-@@ -24,6 +24,7 @@
- #include <stdint.h>
- #include <string.h>
- #include <sys/param.h>
-+#include <gnu/option-groups.h>
-
- #ifndef STRING_TYPE
- # define STRING_TYPE char
-@@ -260,7 +261,11 @@ int
- 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;
-diff --git a/string/strerror_l.c b/string/strerror_l.c
-index 2ed78b5..6584813 100644
---- a/string/strerror_l.c
-+++ b/string/strerror_l.c
-@@ -21,6 +21,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <sys/param.h>
-+#include <gnu/option-groups.h>
-
-
- static __thread char *last_value;
-@@ -29,10 +30,14 @@ static __thread char *last_value;
- 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
- }
-
-
-diff --git a/string/strxfrm_l.c b/string/strxfrm_l.c
-index 8b61ea2..41fdc22 100644
---- a/string/strxfrm_l.c
-+++ b/string/strxfrm_l.c
-@@ -24,6 +24,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <sys/param.h>
-+#include <gnu/option-groups.h>
-
- #ifndef STRING_TYPE
- # define STRING_TYPE char
-@@ -669,7 +670,11 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n, __locale_t l)
- {
- locale_data_t l_data;
- struct __locale_data *current = l->__locales[LC_COLLATE];
-+#if __OPTION_EGLIBC_LOCALE_CODE
- l_data.nrules = current->values[_NL_ITEM_INDEX (_NL_COLLATE_NRULES)].word;
-+#else
-+ l_data.nrules = 0;
-+#endif
-
- /* Handle byte comparison case. */
- if (l_data.nrules == 0)
-diff --git a/string/test-strcmp.c b/string/test-strcmp.c
-index dc4ba6f..a978656 100644
---- a/string/test-strcmp.c
-+++ b/string/test-strcmp.c
-@@ -329,34 +329,6 @@ check (void)
- 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);
-- }
-- }
- }
-
-
-diff --git a/string/tst-strxfrm.c b/string/tst-strxfrm.c
-index f48cfc0..c3a51f9 100644
---- a/string/tst-strxfrm.c
-+++ b/string/tst-strxfrm.c
-@@ -3,6 +3,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <gnu/option-groups.h>
-
-
- char const string[] = "";
-@@ -64,8 +65,10 @@ do_test (void)
- 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;
- }
-diff --git a/string/tst-strxfrm2.c b/string/tst-strxfrm2.c
-index d5a1115..19c7f30 100644
---- a/string/tst-strxfrm2.c
-+++ b/string/tst-strxfrm2.c
-@@ -1,6 +1,7 @@
- #include <locale.h>
- #include <stdio.h>
- #include <string.h>
-+#include <gnu/option-groups.h>
-
- static int
- do_test (void)
-@@ -38,6 +39,7 @@ do_test (void)
- res = 1;
- }
-
-+#if __OPTION_EGLIBC_LOCALE_CODE
- if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL)
- {
- puts ("setlocale failed");
-@@ -75,6 +77,7 @@ do_test (void)
- res = 1;
- }
- }
-+#endif
-
- return res;
- }
-diff --git a/sunrpc/Makefile b/sunrpc/Makefile
-index 60caa0a..5bc70ab 100644
---- a/sunrpc/Makefile
-+++ b/sunrpc/Makefile
-@@ -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-in-tirpc = $(addprefix rpc/,auth.h auth_unix.h clnt.h pmap_clnt.h \
- 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,20 +66,28 @@ headers += $(headers-in-tirpc) $(headers-not-in-tirpc)
- 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
-+need-export-routines-y += xcrypt
-+need-export-routines := $(need-export-routines-y)
-
--routines := auth_none authuxprot bindrsvprt clnt_raw clnt_simp \
-+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 \
-+ key_prot openchild rtime svcauth_des \
- getrpcent getrpcbyname getrpcbynumber \
- getrpcent_r getrpcbyname_r getrpcbynumber_r \
-- clnt_unix svc_unix create_xid $(need-export-routines)
-+ 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)
-@@ -87,25 +96,28 @@ endif
-
- # 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 test-rpcent
--xtests := tst-getmyaddr
-+tests-$(OPTION_EGLIBC_SUNRPC) = tst-xdrmem tst-xdrmem2 test-rpcent
-+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)
-diff --git a/sysdeps/arm/Makefile b/sysdeps/arm/Makefile
-index 17c129b..543791a 100644
---- a/sysdeps/arm/Makefile
-+++ b/sysdeps/arm/Makefile
-@@ -37,10 +37,13 @@ ifeq ($(subdir),csu)
- # 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/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
-index 7a0fe8d..a3e2c0a 100644
---- a/sysdeps/generic/ldsodefs.h
-+++ b/sysdeps/generic/ldsodefs.h
-@@ -435,6 +435,12 @@ extern struct rtld_global _rtld_global __rtld_global_attribute__;
- # 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
-@@ -447,8 +453,10 @@ struct rtld_global_ro
- {
- #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)
-diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
-index ea68037..3175cc3 100644
---- a/sysdeps/gnu/Makefile
-+++ b/sysdeps/gnu/Makefile
-@@ -59,7 +59,8 @@ $(foreach o,$(object-suffixes) $(object-suffixes:=.d),\
- 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
-diff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile
-index 222122d..4509357 100644
---- a/sysdeps/ieee754/ldbl-opt/Makefile
-+++ b/sysdeps/ieee754/ldbl-opt/Makefile
-@@ -11,19 +11,18 @@ libm-routines += s_nexttowardfd
- 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 @@ libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
- 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)
-diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
-index 0198886..55501cd 100644
---- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
-+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
-@@ -26,6 +26,7 @@
- #include <locale/localeinfo.h>
- #include <sys/syslog.h>
- #include <bits/libc-lock.h>
-+#include <gnu/option-groups.h>
-
- #include "nldbl-compat.h"
-
-@@ -33,20 +34,14 @@ libc_hidden_proto (__nldbl_vfprintf)
- 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)
- libc_hidden_proto (__nldbl___vstrfmon_l)
- libc_hidden_proto (__nldbl___isoc99_vsscanf)
- libc_hidden_proto (__nldbl___isoc99_vfscanf)
-+
-+#if __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 @@ __nldbl_fprintf (FILE *stream, const char *fmt, ...)
- }
- weak_alias (__nldbl_fprintf, __nldbl__IO_fprintf)
-
-+#if __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 @@ __nldbl_fwprintf (FILE *stream, const wchar_t *fmt, ...)
-
- return done;
- }
-+#endif
-
- int
- attribute_compat_text_section
-@@ -226,6 +232,7 @@ __nldbl_snprintf (char *s, size_t maxlen, const char *fmt, ...)
- return done;
- }
-
-+#if __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 @@ __nldbl_swprintf (wchar_t *s, size_t n, const wchar_t *fmt, ...)
-
- return done;
- }
-+#endif
-
- int
- attribute_compat_text_section weak_function
-@@ -264,6 +272,7 @@ __nldbl_vdprintf (int d, const char *fmt, va_list arg)
- }
- libc_hidden_def (__nldbl_vdprintf)
-
-+#if __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 @@ __nldbl_vfwprintf (FILE *s, const wchar_t *fmt, va_list ap)
- return res;
- }
- libc_hidden_def (__nldbl_vfwprintf)
-+#endif
-
- int
- attribute_compat_text_section
-@@ -297,6 +307,7 @@ __nldbl_vsnprintf (char *string, size_t maxlen, const char *fmt,
- libc_hidden_def (__nldbl_vsnprintf)
- weak_alias (__nldbl_vsnprintf, __nldbl___vsnprintf)
-
-+#if __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 @@ __nldbl_wprintf (const wchar_t *fmt, ...)
-
- return done;
- }
-+#endif
-
- int
- attribute_compat_text_section
-@@ -419,6 +431,7 @@ __nldbl_scanf (const char *fmt, ...)
- return done;
- }
-
-+#if __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 @@ __nldbl_wscanf (const wchar_t *fmt, ...)
-
- return done;
- }
-+#endif
-
- int
- attribute_compat_text_section
-@@ -506,6 +520,7 @@ __nldbl___fprintf_chk (FILE *stream, int flag, const char *fmt, ...)
- return done;
- }
-
-+#if __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 @@ __nldbl___fwprintf_chk (FILE *stream, int flag, const wchar_t *fmt, ...)
-
- return done;
- }
-+#endif
-
- int
- attribute_compat_text_section
-@@ -563,6 +579,7 @@ __nldbl___sprintf_chk (char *s, int flag, size_t slen, const char *fmt, ...)
- return done;
- }
-
-+#if __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 @@ __nldbl___swprintf_chk (wchar_t *s, size_t n, int flag, size_t slen,
-
- return done;
- }
-+#endif
-
- int
- attribute_compat_text_section
-@@ -590,6 +608,7 @@ __nldbl___vfprintf_chk (FILE *s, int flag, const char *fmt, va_list ap)
- }
- libc_hidden_def (__nldbl___vfprintf_chk)
-
-+#if __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 @@ __nldbl___vfwprintf_chk (FILE *s, int flag, const wchar_t *fmt, va_list ap)
- return res;
- }
- libc_hidden_def (__nldbl___vfwprintf_chk)
-+#endif
-
- int
- attribute_compat_text_section
-@@ -635,6 +655,7 @@ __nldbl___vsprintf_chk (char *string, int flag, size_t slen, const char *fmt,
- }
- libc_hidden_def (__nldbl___vsprintf_chk)
-
-+#if __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 @@ __nldbl___wprintf_chk (int flag, const wchar_t *fmt, ...)
-
- return done;
- }
-+#endif
-
- int
- attribute_compat_text_section
-@@ -775,6 +797,7 @@ __nldbl___printf_fp (FILE *fp, const struct printf_info *info,
- 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 @@ __nldbl___vstrfmon_l (char *s, size_t maxsize, __locale_t loc,
- return res;
- }
- libc_hidden_def (__nldbl___vstrfmon_l)
-+#endif
-
- void
- attribute_compat_text_section
-@@ -941,6 +965,7 @@ __nldbl___isoc99_scanf (const char *fmt, ...)
- return done;
- }
-
-+#if __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 @@ __nldbl___isoc99_wscanf (const wchar_t *fmt, ...)
-
- 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_printf_size, printf_size, GLIBC_2_1);
- compat_symbol (libc, __nldbl___strfmon_l, __strfmon_l, GLIBC_2_1);
- #endif
- #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_2)
-+# if __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_vfwscanf, vfwscanf, GLIBC_2_2);
- 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);
-diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
-index 0d2c8af..f4cea50 100644
---- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
-+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
-@@ -30,6 +30,7 @@
- #include <math.h>
- #include <monetary.h>
- #include <sys/syslog.h>
-+#include <gnu/option-groups.h>
-
-
- /* 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_sscanf);
- NLDBL_DECL (__isoc99_vscanf);
- NLDBL_DECL (__isoc99_vfscanf);
- NLDBL_DECL (__isoc99_vsscanf);
-+#if __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 @@ extern ssize_t __nldbl___vstrfmon (char *, size_t, const char *, va_list)
- 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);
--
-+#if __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 */
-diff --git a/sysdeps/nptl/Makefile b/sysdeps/nptl/Makefile
-index e9339a3..782009b 100644
---- a/sysdeps/nptl/Makefile
-+++ b/sysdeps/nptl/Makefile
-@@ -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)
-diff --git a/sysdeps/nptl/bits/libc-lock.h b/sysdeps/nptl/bits/libc-lock.h
-index 5599cf1..b839378 100644
---- a/sysdeps/nptl/bits/libc-lock.h
-+++ b/sysdeps/nptl/bits/libc-lock.h
-@@ -24,6 +24,14 @@
- #include <stddef.h>
-
-
-+#ifdef _LIBC
-+# include <lowlevellock.h>
-+# include <tls.h>
-+# include <pthread-functions.h>
-+# include <errno.h> /* For EBUSY. */
-+# include <gnu/option-groups.h> /* For __OPTION_EGLIBC_BIG_MACROS. */
-+#endif
-+
- /* Mutex type. */
- #if defined _LIBC || defined _IO_MTSAFE_IO
- # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
-@@ -87,6 +95,15 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
-
- /* Lock the recursive named lock variable. */
- #if defined _LIBC && (IS_IN (libc) || 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 +114,10 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
- } \
- ++(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 +125,14 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
-
- /* Try to lock the recursive named lock variable. */
- #if defined _LIBC && (IS_IN (libc) || 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 +151,10 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
- ++(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 +162,14 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
-
- /* Unlock the recursive named lock variable. */
- #if defined _LIBC && (IS_IN (libc) || 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 +179,10 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
- 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)
-diff --git a/sysdeps/nptl/bits/libc-lockP.h b/sysdeps/nptl/bits/libc-lockP.h
-index f55f621..da98869 100644
---- a/sysdeps/nptl/bits/libc-lockP.h
-+++ b/sysdeps/nptl/bits/libc-lockP.h
-@@ -33,6 +33,8 @@
- #include <lowlevellock.h>
- #include <tls.h>
- #include <pthread-functions.h>
-+#include <errno.h> /* For EBUSY. */
-+#include <gnu/option-groups.h> /* For __OPTION_EGLIBC_BIG_MACROS. */
-
- #if IS_IN (libpthread)
- /* This gets us the declarations of the __pthread_* internal names,
-@@ -171,10 +173,22 @@ typedef pthread_key_t __libc_key_t;
-
- /* Lock the named lock variable. */
- #if IS_IN (libc) || 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) \
-@@ -187,10 +201,22 @@ typedef pthread_key_t __libc_key_t;
-
- /* Try to lock the named lock variable. */
- #if IS_IN (libc) || 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) \
-@@ -206,8 +232,20 @@ typedef pthread_key_t __libc_key_t;
-
- /* Unlock the named lock variable. */
- #if IS_IN (libc) || 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)
-diff --git a/sysdeps/nptl/small-macros-fns.c b/sysdeps/nptl/small-macros-fns.c
-new file mode 100644
-index 0000000..f751053
---- /dev/null
-+++ b/sysdeps/nptl/small-macros-fns.c
-@@ -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 <gnu/option-groups.h>
-+
-+/* 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 <bits/libc-lock.h>
-+
-+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)*/
-diff --git a/sysdeps/unix/sysv/linux/gethostid.c b/sysdeps/unix/sysv/linux/gethostid.c
-index 26e4692..d0a26c8 100644
---- a/sysdeps/unix/sysv/linux/gethostid.c
-+++ b/sysdeps/unix/sysv/linux/gethostid.c
-@@ -21,6 +21,7 @@
- #include <unistd.h>
- #include <netdb.h>
- #include <not-cancel.h>
-+#include <gnu/option-groups.h>
-
- #define HOSTIDFILE "/etc/hostid"
-
-@@ -89,6 +90,7 @@ gethostid (void)
- 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 @@ gethostid (void)
- /* 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
-diff --git a/sysdeps/unix/sysv/linux/libc_fatal.c b/sysdeps/unix/sysv/linux/libc_fatal.c
-index 53a8bbb..cb110d4 100644
---- a/sysdeps/unix/sysv/linux/libc_fatal.c
-+++ b/sysdeps/unix/sysv/linux/libc_fatal.c
-@@ -23,6 +23,7 @@
- #include <string.h>
- #include <sys/mman.h>
- #include <sys/uio.h>
-+#include <gnu/option-groups.h>
-
- static bool
- writev_for_fatal (int fd, const struct iovec *iov, size_t niov, size_t total)
-@@ -40,6 +41,7 @@ writev_for_fatal (int fd, const struct iovec *iov, size_t niov, size_t total)
- 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 @@ backtrace_and_maps (int do_abort, bool written, int fd)
- close_not_cancel_no_status (fd2);
- }
- }
-+#endif /* __OPTION_EGLIBC_BACKTRACE */
- }
- #define BEFORE_ABORT backtrace_and_maps
-
-diff --git a/time/Makefile b/time/Makefile
-index a411f62..2d022ca 100644
---- a/time/Makefile
-+++ b/time/Makefile
-@@ -18,6 +18,8 @@
- #
- # Makefile for time routines
- #
-+include ../option-groups.mak
-+
- subdir := time
-
- include ../Makeconfig
-@@ -30,15 +32,23 @@ routines := offtime asctime clock ctime ctime_r difftime \
- 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
-
--tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
-- tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \
-+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-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 tst-ftime
-
-+tests-$(OPTION_EGLIBC_LOCALE_CODE) \
-+ += tst-strptime tst-ftime_l
-+tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
-+ += tst_wcsftime
-+
- include ../Rules
-
- tz-cflags = -DTZDIR='"$(zonedir)"' \
-diff --git a/time/strftime_l.c b/time/strftime_l.c
-index b48ef34..bfdd618 100644
---- a/time/strftime_l.c
-+++ b/time/strftime_l.c
-@@ -35,6 +35,10 @@
- # include "../locale/localeinfo.h"
- #endif
-
-+#ifdef _LIBC
-+# include <gnu/option-groups.h>
-+#endif
-+
- #if defined emacs && !defined HAVE_BCOPY
- # define HAVE_MEMCPY 1
- #endif
-@@ -882,7 +886,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
- 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 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
-
- 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 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
- 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 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
- 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)
- {
-diff --git a/time/strptime_l.c b/time/strptime_l.c
-index 5640cce..784ccbc 100644
---- a/time/strptime_l.c
-+++ b/time/strptime_l.c
-@@ -29,6 +29,7 @@
-
- #ifdef _LIBC
- # define HAVE_LOCALTIME_R 0
-+# include <gnu/option-groups.h>
- # include "../locale/localeinfo.h"
- #endif
-
-@@ -84,7 +85,7 @@ localtime_r (t, tp)
- 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; \
-@@ -257,8 +258,10 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
- int cnt;
- int cnt_longest;
- size_t val;
-+#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
- size_t num_eras;
- struct era_entry *era = NULL;
-+#endif
- enum ptime_locale_status { not, loc, raw } decided_longest;
- struct __strptime_state
- {
-@@ -820,6 +823,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
- s.want_xday = 1;
- break;
- case 'C':
-+#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
- if (s.decided != raw)
- {
- if (s.era_cnt >= 0)
-@@ -856,10 +860,12 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
-
- 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 +924,10 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
-
- 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 +955,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
-
- s.decided = raw;
- }
-+#endif
- get_number (0, 9999, 4);
- tm->tm_year = val - 1900;
- s.want_century = 0;
-@@ -1118,6 +1126,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
- 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 +1141,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
- 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
-diff --git a/timezone/Makefile b/timezone/Makefile
-index 886b06e..f922684 100644
---- a/timezone/Makefile
-+++ b/timezone/Makefile
-@@ -127,7 +127,7 @@ $(testdata)/XT%: testdata/XT%
-
- $(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)"|' \
-diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
-index 44a4494..db9fc24 100644
---- a/wcsmbs/Makefile
-+++ b/wcsmbs/Makefile
-@@ -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,21 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
- 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
-
--strop-tests := wcscmp wcsncmp 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))
-+routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
-+ += isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf
-+
-+strop-tests := wcscmp wmemcmp wmemcmp wcslen wcschr wcsrchr wcscpy
-+
-+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))
-
- include ../Rules
-
-diff --git a/wcsmbs/wcsmbsload.c b/wcsmbs/wcsmbsload.c
-index 6bb49bc..2ab9d07 100644
---- a/wcsmbs/wcsmbsload.c
-+++ b/wcsmbs/wcsmbsload.c
-@@ -21,6 +21,7 @@
- #include <limits.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <gnu/option-groups.h>
-
- #include <locale/localeinfo.h>
- #include <wcsmbsload.h>
-@@ -143,6 +144,7 @@ __wcsmbs_getfct (const char *to, const char *from, size_t *nstepsp)
- })
-
-
-+#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 @@ __wcsmbs_load_conv (struct __locale_data *new_category)
-
- __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. */
-diff --git a/wctype/Makefile b/wctype/Makefile
-index c56f07c..4e8af43 100644
---- a/wctype/Makefile
-+++ b/wctype/Makefile
-@@ -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
--
--tests := test_wctype test_wcfuncs bug-wctypeh
-+routines := wctrans towctrans towctrans_l
-+routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
-+ := wcfuncs wctype iswctype \
-+ wcfuncs_l wctype_l iswctype_l wctrans_l
-+
-+tests :=
-+tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
-+ += test_wctype test_wcfuncs bug-wctypeh
-
- include ../Rules
---
-2.1.4
-
OpenPOWER on IntegriCloud