From 5fa9e77ee3647ee5613fa7d8a2f6ffcabd8c3280 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 3 Jun 2018 13:20:50 +0000 Subject: [PATCH] Update buildroot 2018.05 Signed-off-by: Pascal Vizeli --- buildroot/CHANGES | 42 + buildroot/DEVELOPERS | 6 +- buildroot/Makefile | 4 +- buildroot/configs/socrates_cyclone5_defconfig | 11 +- .../docs/manual/github_hash_mongrel2.png | Bin 19028 -> 19029 bytes buildroot/docs/manual/logo.png | Bin 117497 -> 117499 bytes buildroot/docs/manual/manual.html | 18 +- buildroot/docs/manual/manual.pdf | Bin 532213 -> 532222 bytes buildroot/docs/manual/manual.text | 4 +- buildroot/docs/website/download.html | 45 +- buildroot/docs/website/favicon.png | Bin 1800 -> 1801 bytes .../website/images/boundary-devices-logo.png | Bin 13303 -> 13305 bytes buildroot/docs/website/images/browser.png | Bin 18174 -> 18175 bytes buildroot/docs/website/images/bug-buddy.png | Bin 5945 -> 5946 bytes .../docs/website/images/buildroot-slides.png | Bin 32836 -> 32837 bytes buildroot/docs/website/images/calao-logo.png | Bin 15385 -> 15386 bytes .../docs/website/images/circuitco-logo.png | Bin 10749 -> 10750 bytes buildroot/docs/website/images/email.png | Bin 4100 -> 4101 bytes .../docs/website/images/fluendo-logo.png | Bin 9097 -> 9098 bytes .../website/images/free-electrons-logo.png | Bin 9173 -> 9174 bytes buildroot/docs/website/images/gift.png | Bin 15905 -> 15906 bytes .../website/images/github_hash_mongrel2.png | Bin 19028 -> 19029 bytes buildroot/docs/website/images/google-logo.png | Bin 12004 -> 12005 bytes buildroot/docs/website/images/hammer.png | Bin 18351 -> 18353 bytes buildroot/docs/website/images/imgtec-logo.png | Bin 5275 -> 5276 bytes buildroot/docs/website/images/irc.png | Bin 7695 -> 7696 bytes buildroot/docs/website/images/logo.png | Bin 117497 -> 117499 bytes buildroot/docs/website/images/logo.xcf | Bin 356006 -> 356067 bytes buildroot/docs/website/images/logo_small.png | Bin 3623 -> 3624 bytes buildroot/docs/website/images/menuconfig.png | Bin 181490 -> 181491 bytes buildroot/docs/website/images/mind-logo.png | Bin 10213 -> 10214 bytes buildroot/docs/website/images/nconfig.png | Bin 88051 -> 88055 bytes .../docs/website/images/owi-smile-logo.png | Bin 25256 -> 25258 bytes buildroot/docs/website/images/package.png | Bin 7745 -> 7746 bytes buildroot/docs/website/images/pdf-icon.png | Bin 10323 -> 10324 bytes .../docs/website/images/synopsys-logo.png | Bin 52423 -> 52426 bytes buildroot/docs/website/images/text.png | Bin 6436 -> 6437 bytes buildroot/docs/website/images/tux-flat.png | Bin 20105 -> 20106 bytes buildroot/docs/website/images/xconfig.png | Bin 224078 -> 224081 bytes buildroot/docs/website/images/zip.png | Bin 8207 -> 8208 bytes buildroot/docs/website/news.html | 42 +- buildroot/fs/common.mk | 2 +- buildroot/linux/Config.in | 10 +- buildroot/package/autofs/autofs.mk | 2 +- ...file.am-Use-install-data-hook-not-in.patch | 35 + .../bash-completion/bash-completion.mk | 3 + buildroot/package/binutils/Config.in.host | 4 +- .../0002-ld-makefile.patch | 0 .../0003-check-ldrunpath-length.patch | 0 .../0004-add-sysroot-fix-from-bug-3049.patch | 0 .../0005-poison-system-directories.patch | 0 buildroot/package/binutils/binutils.hash | 2 +- buildroot/package/binutils/binutils.mk | 11 +- buildroot/package/boost/Config.in | 4 + buildroot/package/busybox/busybox.hash | 8 +- buildroot/package/busybox/busybox.mk | 2 +- buildroot/package/cjson/cjson.hash | 2 +- buildroot/package/cjson/cjson.mk | 2 +- buildroot/package/clang/clang.mk | 4 + buildroot/package/dash/dash.mk | 3 + buildroot/package/elf2flt/elf2flt.mk | 16 + buildroot/package/expect/expect.hash | 4 + buildroot/package/expect/expect.mk | 7 +- buildroot/package/fis/0001-checksum.patch | 176 +- buildroot/package/flare-engine/Config.in | 4 + buildroot/package/gcc/Config.in.host | 2 +- .../0100-uclibc-conf.patch | 0 .../0860-cilk-fix-build-without-wchar.patch | 0 .../0900-remove-selftests.patch | 0 buildroot/package/gcc/gcc.hash | 2 +- buildroot/package/gdb/Config.in.host | 2 +- buildroot/package/gdb/gdb.hash | 2 +- buildroot/package/git/git.hash | 2 +- buildroot/package/git/git.mk | 2 +- buildroot/package/glibc/glibc.hash | 4 +- buildroot/package/glibc/glibc.mk | 4 +- .../package/gstreamer/gst-ffmpeg/Config.in | 4 + ...LAGS-CXXFLAGS-and-CFLAGS-in-Makefile.patch | 36 +- .../irrlicht/0002-remove-sys-sysctl.h.patch | 14 +- buildroot/package/jpeg-turbo/jpeg-turbo.hash | 2 + buildroot/package/jpeg-turbo/jpeg-turbo.mk | 4 +- .../0001-src-CWatchdog.h-Fix-gcc7-build.patch | 14 +- buildroot/package/libcoap/libcoap.mk | 1 + ...ith-ssh2-built-with-a-static-mbedtls.patch | 40 + buildroot/package/libcurl/libcurl.mk | 2 + ...-compilation-issue-with-GCC-5.x-C-11.patch | 2126 +++--- .../package/libfreeimage/0004-fix-gcc-6.patch | 32 +- .../0005-Manage-powf64-with-glibc.patch | 1296 ++-- buildroot/package/libjpeg/libjpeg.mk | 2 +- ...pcgen-program-from-nfs-utils-sources.patch | 6508 ----------------- ...erate-XDR-header-files-from-.x-sour.patch} | 35 +- ...s-needed-to-build-rpcbind-on-top-of.patch} | 0 ...isable-DES-authentification-support.patch} | 0 ...0006-include-stdint.h-for-uintptr_t.patch} | 0 buildroot/package/libtirpc/libtirpc.mk | 8 + .../package/linux-headers/Config.in.host | 10 +- buildroot/package/log4cplus/Config.in | 6 +- buildroot/package/lrzsz/lrzsz.mk | 4 + buildroot/package/nfs-utils/nfs-utils.mk | 23 + buildroot/package/openvmtools/openvmtools.mk | 2 +- buildroot/package/pkg-generic.mk | 3 + buildroot/package/poppler/poppler.mk | 4 + .../0001-proc-sig-fix-build-for-sparc.patch | 43 - buildroot/package/procps-ng/procps-ng.hash | 8 +- buildroot/package/procps-ng/procps-ng.mk | 2 +- ...e-a-main-include-file-QExtSerialPort.patch | 18 +- .../qt-webkit-kiosk/qt-webkit-kiosk.hash | 2 +- .../qt-webkit-kiosk/qt-webkit-kiosk.mk | 2 +- buildroot/package/quota/quota.mk | 2 +- ...print-operations-are-declared-before.patch | 34 +- buildroot/package/samba4/samba4.mk | 2 +- .../0003-use-fhs-install-directories.patch | 384 +- ...g-softetherd-for-upstart-and-systemd.patch | 14 +- ...-to-GetStateDir-in-Cedar-and-Mayaqua.patch | 102 +- buildroot/package/softether/0007-iconv.patch | 34 +- .../softether/0009-uclibc-ai-addrconfig.patch | 22 +- .../sp-oops-extract/0002-stdint-cleanup.patch | 40 +- .../transmission/0001-fix-utypes.patch | 16 +- buildroot/package/urg/0001-select-h.patch | 16 +- ...02-urg-gcc6-fix-narrowing-conversion.patch | 160 +- buildroot/package/xen/xen.hash | 3 +- buildroot/package/xen/xen.mk | 2 +- ...-do-dynamic-linking-of-libtool-libra.patch | 6 +- ...orkqueue-add-missing-pthreads-header.patch | 41 - ...4-xfs_scrub-add-missing-paths-header.patch | 37 - ...-fix-cross-compile-with-libunistring.patch | 37 - ...-fix-build-with-older-kernel-headers.patch | 63 - buildroot/package/xfsprogs/xfsprogs.hash | 2 +- buildroot/package/xfsprogs/xfsprogs.mk | 9 +- buildroot/support/download/cvs | 8 +- buildroot/support/misc/Vagrantfile | 2 +- buildroot/toolchain/Config.in | 6 + 132 files changed, 2662 insertions(+), 9124 deletions(-) create mode 100644 buildroot/package/bash-completion/0001-completions-Makefile.am-Use-install-data-hook-not-in.patch rename buildroot/package/binutils/{arc-2018.03-rc1 => arc-2018.03-rc2}/0002-ld-makefile.patch (100%) rename buildroot/package/binutils/{arc-2018.03-rc1 => arc-2018.03-rc2}/0003-check-ldrunpath-length.patch (100%) rename buildroot/package/binutils/{arc-2018.03-rc1 => arc-2018.03-rc2}/0004-add-sysroot-fix-from-bug-3049.patch (100%) rename buildroot/package/binutils/{arc-2018.03-rc1 => arc-2018.03-rc2}/0005-poison-system-directories.patch (100%) create mode 100644 buildroot/package/expect/expect.hash rename buildroot/package/gcc/{arc-2018.03-rc1 => arc-2018.03-rc2}/0100-uclibc-conf.patch (100%) rename buildroot/package/gcc/{arc-2018.03-rc1 => arc-2018.03-rc2}/0860-cilk-fix-build-without-wchar.patch (100%) rename buildroot/package/gcc/{arc-2018.03-rc1 => arc-2018.03-rc2}/0900-remove-selftests.patch (100%) create mode 100644 buildroot/package/libcurl/0001-Fix-link-with-ssh2-built-with-a-static-mbedtls.patch delete mode 100644 buildroot/package/libtirpc/0003-Add-rpcgen-program-from-nfs-utils-sources.patch rename buildroot/package/libtirpc/{0004-Automatically-generate-XDR-header-files-from-.x-sour.patch => 0003-Automatically-generate-XDR-header-files-from-.x-sour.patch} (98%) rename buildroot/package/libtirpc/{0005-Add-more-XDR-files-needed-to-build-rpcbind-on-top-of.patch => 0004-Add-more-XDR-files-needed-to-build-rpcbind-on-top-of.patch} (100%) rename buildroot/package/libtirpc/{0006-Disable-DES-authentification-support.patch => 0005-Disable-DES-authentification-support.patch} (100%) rename buildroot/package/libtirpc/{0007-include-stdint.h-for-uintptr_t.patch => 0006-include-stdint.h-for-uintptr_t.patch} (100%) delete mode 100644 buildroot/package/procps-ng/0001-proc-sig-fix-build-for-sparc.patch delete mode 100644 buildroot/package/xfsprogs/0003-workqueue-add-missing-pthreads-header.patch delete mode 100644 buildroot/package/xfsprogs/0004-xfs_scrub-add-missing-paths-header.patch delete mode 100644 buildroot/package/xfsprogs/0005-xfs_scrub-fix-cross-compile-with-libunistring.patch delete mode 100644 buildroot/package/xfsprogs/0006-xfs_scrub-fix-build-with-older-kernel-headers.patch diff --git a/buildroot/CHANGES b/buildroot/CHANGES index 4a51dafab..baa85622a 100644 --- a/buildroot/CHANGES +++ b/buildroot/CHANGES @@ -1,3 +1,45 @@ +2018.05, Released June 1st, 2018 + + Minor fixes. + + Download: Work around for hanging connections for packages + from CVS, by adding a 10 minute max timeout. + + Updated/fixed packages: binutils, clang, dash, expect, git, + glibc, jpeg-turbo, libjpeg, log4cplus, openvmtools, xen, + + Issues resolved (http://bugs.uclibc.org): + + #11051: runtime issue on STM32 with usage of binutils 2.29.x + +2018.05-rc3, Released May 28th, 2018 + + Fixes all over the tree. + + Toolchain: ARC tools updated to arc-2018.03-rc2. + + Fs: Ensure hard links in TARGET_DIR are correctly copied for + filesystem input. With the recent changes to the file system + generation logic, hard links were "expanded" in file system + images leading to bloated rootfs images for setups with hard + links. + + Infrastructure: Error out for packages using the 'local' + method but forgetting to specify _SITE. + + Build rpcgen for the host when needed to support distributions + no longer shipping rpcgen with glibc (E.G. recent Fedora). + + Updated/fixed packages: autofs, bash-completion, binutils, + busybox, cjson, elf2flt, libcoap, libcurl, libtirpc, lrzsz, + poppler, procps-ng, qt-webkit-kiosk, quota, samba4, xfsprogs + + Issues resolved (http://bugs.uclibc.org): + + #11031: ld-elf2flt: host/bin/ld.real': execvp: No such file.. + #11036: C compiler cannot create executables + #11046: Git package binaries are ~180MB (compared to ~20MB in.. + 2018.05-rc2, Released May 22nd, 2018 Fixes all over the tree. diff --git a/buildroot/DEVELOPERS b/buildroot/DEVELOPERS index efd331d20..f24ef2752 100644 --- a/buildroot/DEVELOPERS +++ b/buildroot/DEVELOPERS @@ -404,7 +404,7 @@ F: package/pps-tools/ N: Carlo Caione F: package/sunxi-boards/ -N: Carlos Santos +N: Carlos Santos F: package/gtest/ F: package/libpam-radius-auth/ F: package/libpam-tacplus/ @@ -1596,7 +1596,7 @@ F: package/libhttpparser/ N: Rhys Williams F: package/lirc-tools/ -N: Ricardo Martincoski +N: Ricardo Martincoski F: package/atop/ N: Ricardo Martincoski @@ -1929,7 +1929,7 @@ F: package/wayland/ F: package/weston/ F: toolchain/ -N: Tiago Brusamarello +N: Tiago Brusamarello F: package/aer-inject/ N: Timo Ketola diff --git a/buildroot/Makefile b/buildroot/Makefile index 3415f994b..9f32c9600 100644 --- a/buildroot/Makefile +++ b/buildroot/Makefile @@ -87,9 +87,9 @@ all: .PHONY: all # Set and export the version string -export BR2_VERSION := 2018.05-rc2 +export BR2_VERSION := 2018.05 # Actual time the release is cut (for reproducible builds) -BR2_VERSION_EPOCH = 1527024000 +BR2_VERSION_EPOCH = 1527884000 # Save running make version since it's clobbered by the make package RUNNING_MAKE_VERSION := $(MAKE_VERSION) diff --git a/buildroot/configs/socrates_cyclone5_defconfig b/buildroot/configs/socrates_cyclone5_defconfig index 7995f9acf..4c659263d 100644 --- a/buildroot/configs/socrates_cyclone5_defconfig +++ b/buildroot/configs/socrates_cyclone5_defconfig @@ -3,12 +3,12 @@ BR2_cortex_a9=y BR2_ARM_ENABLE_NEON=y BR2_ARM_ENABLE_VFP=y BR2_ARM_FPU_NEON=y -BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_16=y BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/altera/socrates_cyclone5/genimage.cfg" BR2_LINUX_KERNEL=y -BR2_LINUX_KERNEL_CUSTOM_TARBALL=y -BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,altera-opensource,linux-socfpga,rel_socfpga-4.1.33-ltsi_17.07.02_pr)/linux-rel_socfpga-4.1.33-ltsi_17.07.02_pr.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.16.7" BR2_LINUX_KERNEL_DEFCONFIG="socfpga" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="socfpga_cyclone5_socrates" @@ -16,9 +16,8 @@ BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y -BR2_TARGET_UBOOT_CUSTOM_GIT=y -BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/altera-opensource/u-boot-socfpga.git" -BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="v2017.07" +BR2_TARGET_UBOOT_CUSTOM_VERSION=y +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2018.03" BR2_TARGET_UBOOT_BOARD_DEFCONFIG="socfpga_socrates" BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_FORMAT_IMG=y diff --git a/buildroot/docs/manual/github_hash_mongrel2.png b/buildroot/docs/manual/github_hash_mongrel2.png index 6f4fd8a80c79e95941b520fb2ec10dc01006d48c..c695c3181abc3bdf4661692fdbcc4332a02cd856 100644 GIT binary patch delta 16 XcmcaIh4JbXM%K;%KX=}ZECF5sHy{P0 delta 15 WcmcaQh4IQ1MwZS1KlhES0bT$yl?9dn diff --git a/buildroot/docs/manual/logo.png b/buildroot/docs/manual/logo.png index 84df575b0fd38e05d723ccf247dce7539c3dbab7..2db743b4fa93820a2ad38bdafb1dbaafe7805fee 100644 GIT binary patch delta 27 jcmex4mHqcrcGk`SKX=}ZEO)#ad7B@2Z-3y;C|M5xoyrQp delta 24 gcmex8mHp>bc9zZnKlhEScf6Y)d2fH@%_vz90E+JlsQ>@~ diff --git a/buildroot/docs/manual/manual.html b/buildroot/docs/manual/manual.html index ad2cbb846..ac4123f4c 100644 --- a/buildroot/docs/manual/manual.html +++ b/buildroot/docs/manual/manual.html @@ -1,6 +1,6 @@ -The Buildroot user manual

The Buildroot user manual


Table of Contents

I. Getting started
1. About Buildroot
2. System requirements
2.1. Mandatory packages
2.2. Optional packages
3. Getting Buildroot
4. Buildroot quick start
5. Community resources
II. User guide
6. Buildroot configuration
6.1. Cross-compilation toolchain
6.2. /dev management
6.3. init system
7. Configuration of other components
8. General Buildroot usage
8.1. make tips
8.2. Understanding when a full rebuild is necessary
8.3. Understanding how to rebuild packages
8.4. Offline builds
8.5. Building out-of-tree
8.6. Environment variables
8.7. Dealing efficiently with filesystem images
8.8. Graphing the dependencies between packages
8.9. Graphing the build duration
8.10. Graphing the filesystem size contribution of packages
8.11. Integration with Eclipse
8.12. Advanced usage
9. Project-specific customization
9.1. Recommended directory structure
9.2. Keeping customizations outside of Buildroot
9.3. Storing the Buildroot configuration
9.4. Storing the configuration of other components
9.5. Customizing the generated target filesystem
9.6. Adding custom user accounts
9.7. Customization after the images have been created
9.8. Adding project-specific patches
9.9. Adding project-specific packages
9.10. Quick guide to storing your project-specific customizations
10. Frequently Asked Questions & Troubleshooting
10.1. The boot hangs after Starting network…
10.2. Why is there no compiler on the target?
10.3. Why are there no development files on the target?
10.4. Why is there no documentation on the target?
10.5. Why are some packages not visible in the Buildroot config menu?
10.6. Why not use the target directory as a chroot directory?
10.7. Why doesn’t Buildroot generate binary packages (.deb, .ipkg…)?
10.8. How to speed-up the build process?
11. Known issues
12. Legal notice and licensing
12.1. Complying with open source licenses
12.2. Complying with the Buildroot license
13. Beyond Buildroot
13.1. Boot the generated images
13.2. Chroot
III. Developer guide
14. How Buildroot works
15. Coding style
15.1. Config.in file
15.2. The .mk file
15.3. The documentation
15.4. Support scripts
16. Adding support for a particular board
17. Adding new packages to Buildroot
17.1. Package directory
17.2. Config files
17.3. The .mk file
17.4. The .hash file
17.5. Infrastructure for packages with specific build systems
17.6. Infrastructure for autotools-based packages
17.7. Infrastructure for CMake-based packages
17.8. Infrastructure for Python packages
17.9. Infrastructure for LuaRocks-based packages
17.10. Infrastructure for Perl/CPAN packages
17.11. Infrastructure for virtual packages
17.12. Infrastructure for packages using kconfig for configuration files
17.13. Infrastructure for rebar-based packages
17.14. Infrastructure for Waf-based packages
17.15. Integration of Meson-based packages
17.16. Integration of Cargo-based packages
17.17. Infrastructure for Go packages
17.18. Infrastructure for packages building kernel modules
17.19. Infrastructure for asciidoc documents
17.20. Infrastructure specific to the Linux kernel package
17.21. Hooks available in the various build steps
17.22. Gettext integration and interaction with packages
17.23. Tips and tricks
17.24. Conclusion
18. Patching a package
18.1. Providing patches
18.2. How patches are applied
18.3. Format and licensing of the package patches
18.4. Integrating patches found on the Web
19. Download infrastructure
20. Debugging Buildroot
21. Contributing to Buildroot
21.1. Reproducing, analyzing and fixing bugs
21.2. Analyzing and fixing autobuild failures
21.3. Reviewing and testing patches
21.4. Work on items from the TODO list
21.5. Submitting patches
21.6. Reporting issues/bugs or getting help
22. DEVELOPERS file and get-developers
IV. Appendix
23. Makedev syntax documentation
24. Makeusers syntax documentation
25. Migrating from older Buildroot versions
25.1. Migrating to 2016.11
25.2. Migrating to 2017.08

Buildroot 2018.05-rc2 manual generated on 2018-05-22 -21:28:12 UTC from git revision c11ed3a4d9

The Buildroot manual is written by the Buildroot developers. +The Buildroot user manual

The Buildroot user manual


Table of Contents

I. Getting started
1. About Buildroot
2. System requirements
2.1. Mandatory packages
2.2. Optional packages
3. Getting Buildroot
4. Buildroot quick start
5. Community resources
II. User guide
6. Buildroot configuration
6.1. Cross-compilation toolchain
6.2. /dev management
6.3. init system
7. Configuration of other components
8. General Buildroot usage
8.1. make tips
8.2. Understanding when a full rebuild is necessary
8.3. Understanding how to rebuild packages
8.4. Offline builds
8.5. Building out-of-tree
8.6. Environment variables
8.7. Dealing efficiently with filesystem images
8.8. Graphing the dependencies between packages
8.9. Graphing the build duration
8.10. Graphing the filesystem size contribution of packages
8.11. Integration with Eclipse
8.12. Advanced usage
9. Project-specific customization
9.1. Recommended directory structure
9.2. Keeping customizations outside of Buildroot
9.3. Storing the Buildroot configuration
9.4. Storing the configuration of other components
9.5. Customizing the generated target filesystem
9.6. Adding custom user accounts
9.7. Customization after the images have been created
9.8. Adding project-specific patches
9.9. Adding project-specific packages
9.10. Quick guide to storing your project-specific customizations
10. Frequently Asked Questions & Troubleshooting
10.1. The boot hangs after Starting network…
10.2. Why is there no compiler on the target?
10.3. Why are there no development files on the target?
10.4. Why is there no documentation on the target?
10.5. Why are some packages not visible in the Buildroot config menu?
10.6. Why not use the target directory as a chroot directory?
10.7. Why doesn’t Buildroot generate binary packages (.deb, .ipkg…)?
10.8. How to speed-up the build process?
11. Known issues
12. Legal notice and licensing
12.1. Complying with open source licenses
12.2. Complying with the Buildroot license
13. Beyond Buildroot
13.1. Boot the generated images
13.2. Chroot
III. Developer guide
14. How Buildroot works
15. Coding style
15.1. Config.in file
15.2. The .mk file
15.3. The documentation
15.4. Support scripts
16. Adding support for a particular board
17. Adding new packages to Buildroot
17.1. Package directory
17.2. Config files
17.3. The .mk file
17.4. The .hash file
17.5. Infrastructure for packages with specific build systems
17.6. Infrastructure for autotools-based packages
17.7. Infrastructure for CMake-based packages
17.8. Infrastructure for Python packages
17.9. Infrastructure for LuaRocks-based packages
17.10. Infrastructure for Perl/CPAN packages
17.11. Infrastructure for virtual packages
17.12. Infrastructure for packages using kconfig for configuration files
17.13. Infrastructure for rebar-based packages
17.14. Infrastructure for Waf-based packages
17.15. Integration of Meson-based packages
17.16. Integration of Cargo-based packages
17.17. Infrastructure for Go packages
17.18. Infrastructure for packages building kernel modules
17.19. Infrastructure for asciidoc documents
17.20. Infrastructure specific to the Linux kernel package
17.21. Hooks available in the various build steps
17.22. Gettext integration and interaction with packages
17.23. Tips and tricks
17.24. Conclusion
18. Patching a package
18.1. Providing patches
18.2. How patches are applied
18.3. Format and licensing of the package patches
18.4. Integrating patches found on the Web
19. Download infrastructure
20. Debugging Buildroot
21. Contributing to Buildroot
21.1. Reproducing, analyzing and fixing bugs
21.2. Analyzing and fixing autobuild failures
21.3. Reviewing and testing patches
21.4. Work on items from the TODO list
21.5. Submitting patches
21.6. Reporting issues/bugs or getting help
22. DEVELOPERS file and get-developers
IV. Appendix
23. Makedev syntax documentation
24. Makeusers syntax documentation
25. Migrating from older Buildroot versions
25.1. Migrating to 2016.11
25.2. Migrating to 2017.08

Buildroot 2018.05 manual generated on 2018-06-01 +20:24:12 UTC from git revision f3d114a1ef

The Buildroot manual is written by the Buildroot developers. It is licensed under the GNU General Public License, version 2. Refer to the COPYING file in the Buildroot sources for the full text of this license.

Copyright © 2004-2018 The Buildroot developers

logo.png

Part I. Getting started

Chapter 1. About Buildroot

Buildroot is a tool that simplifies and automates the process of @@ -16,8 +16,8 @@ processors everyone is used to having in his PC. They can be PowerPC processors, MIPS processors, ARM processors, etc.

Buildroot supports numerous processors and their variants; it also comes with default configurations for several boards available off-the-shelf. Besides this, a number of third-party projects are based on, -or develop their BSP [1] or -SDK [2] on top of Buildroot.



[1] BSP: Board Support Package

[2] SDK: Software Development Kit

Chapter 2. System requirements

Buildroot is designed to run on Linux systems.

While Buildroot itself will build most host packages it needs for the +or develop their BSP [1] or +SDK [2] on top of Buildroot.



[1] BSP: Board Support Package

[2] SDK: Software Development Kit

Chapter 2. System requirements

Buildroot is designed to run on Linux systems.

While Buildroot itself will build most host packages it needs for the compilation, certain standard Linux utilities are expected to be already installed on the host system. Below you will find an overview of the mandatory and optional packages (note that package names may vary @@ -272,7 +272,7 @@ processor. Under most Linux systems, the compilation toolchain uses the GNU libc (glibc) as the C standard library. This compilation toolchain is called the "host compilation toolchain". The machine on which it is running, and on which you’re working, is called the "host -system" [3].

The compilation toolchain is provided by your distribution, and +system" [3].

The compilation toolchain is provided by your distribution, and Buildroot has nothing to do with it (other than using it to build a cross-compilation toolchain and other tools that are run on the development host).

As said above, the compilation toolchain that comes with your system @@ -547,7 +547,7 @@ The third solution is systemd. http://www.freedesktop.org/wiki/Software/systemd.

The solution recommended by Buildroot developers is to use the BusyBox init as it is sufficient for most embedded -systems. systemd can be used for more complex situations.



[3] This terminology differs from what is used by GNU +systems. systemd can be used for more complex situations.



[3] This terminology differs from what is used by GNU configure, where the host is the machine on which the application will run (which is usually the same as target)

Chapter 7. Configuration of other components

Before attempting to modify any of the components below, make sure you have already configured Buildroot itself, and have enabled the @@ -2640,7 +2640,7 @@ flags. The argument to be given to LIBFOO_CONFIG_SCRIPTS is the file name(s) of the shell script(s) needing fixing. All these names are relative to $(STAGING_DIR)/usr/bin and if needed multiple names can be given.

In addition, the scripts listed in LIBFOO_CONFIG_SCRIPTS are removed -from $(TARGET_DIR)/usr/bin, since they are not needed on the target.

Example 17.1. Config script: divine package

Package divine installs shell script $(STAGING_DIR)/usr/bin/divine-config.

So its fixup would be:

DIVINE_CONFIG_SCRIPTS = divine-config

Example 17.2. Config script: imagemagick package:

Package imagemagick installs the following scripts: +from $(TARGET_DIR)/usr/bin, since they are not needed on the target.

Example 17.1. Config script: divine package

Package divine installs shell script $(STAGING_DIR)/usr/bin/divine-config.

So its fixup would be:

DIVINE_CONFIG_SCRIPTS = divine-config

Example 17.2. Config script: imagemagick package:

Package imagemagick installs the following scripts: $(STAGING_DIR)/usr/bin/{Magick,Magick++,MagickCore,MagickWand,Wand}-config

So it’s fixup would be:

IMAGEMAGICK_CONFIG_SCRIPTS = \
    Magick-config Magick++-config \
    MagickCore-config MagickWand-config Wand-config

On line 14, we specify the list of dependencies this package relies @@ -4902,7 +4902,7 @@ large number of commits in the series;

  • deep impact of the changes in the rest of the project;
  • -RFC [4]; +RFC [4];
  • whenever you feel it will help presenting your work, your choices, the review process, etc. @@ -4984,7 +4984,7 @@ pastebin service. Note that not all available pastebin services will preserve Unix-style line terminators when downloading raw pastes. Following pastebin services are known to work correctly: - https://gist.github.com/ -- http://code.bulix.org/



  • [4] RFC: (Request for comments) change proposal

    Chapter 22. DEVELOPERS file and get-developers

    The main Buildroot directory contains a file named DEVELOPERS that +- http://code.bulix.org/



    [4] RFC: (Request for comments) change proposal

    Chapter 22. DEVELOPERS file and get-developers

    The main Buildroot directory contains a file named DEVELOPERS that lists the developers involved with various areas of Buildroot. Thanks to this file, the get-developer tool allows to:

    • Calculate the list of developers to whom patches should be sent, by diff --git a/buildroot/docs/manual/manual.pdf b/buildroot/docs/manual/manual.pdf index 34181fc72deaefee00e378adea8f3d363aea86f2..9e56c4305960785c61857d72ad37dc51d618392c 100644 GIT binary patch delta 8409 zcmbtZbySpHx2L;tkdhcgX@)K-1q2xcDd|v=h5?a5KpwhV5s(rok#Ioio{+xAUy$oU`}Y^P`35q=g5Sq(~^0-f^Bt2r%mNp5Qq* zwIXbGLkcp-t9Fk~e_m%?2Wx8XlP$tYtpInJgO)m`0g3nZ?j^N!9ZJnaYoI!1scyu7BUXiF=#5jo7Qy-hrVJx8(=4aWV6~;`O2W|0 z{*LX%20|J>Z2_b&ZR>Sgz8xEG&RYVoy{}0hE>qwcs>0~B0xH-Y(sP8Ar9V!qYF^Rw zL*p+hUH($gbmv>bhv#~;L%dH+DD5i`O!ciGq7nno%uF!yR`h}_28O`T_4Xq9S7RO4 zDXHC!Kahi_$Q+j|eu0~gc*=bV^(AT@Se%J_?T1>Jj#T7)*;;bVi16^cc@oa$Ebqyk zT=VzaSxVfJ+$AQ56B8#x5&nm7@%zbz=l)pu+B?Tne zflWImm?$FD<*h7YqMTmf=HpNCYBANP2YCQtzbX4Nm4nB<2R_~oPbjZZzr|cB3M8a` zl7eIo3uvedXdoQ;gOIjPCy&UH1sqW|L@ll0=JM82T}tW7)(n}T|!nvMqNfzUR_4|nv9IXH8~C0Yggq#hNKG5mH$)3no1n*;Nj@w z#3LvBB>#;Nz(4V*+;!b%bW^3N$u;j$F8=X1ue^io$KM{Qv`GzaE2u6(&V5=GS9`i3 zkl`9{amzF4=oZ8vOyKIpit~%4V!g4iwBw&?2@a`o2Bf^G7)Cs|*jouWeS|mvzPxNP zc({F~X{ILETHqX2LDg0J@?@&M6AN|WqN|O}6`RHaBJoTkV`lbi-6b16_iwEbUa8CM zAW6^UqJRP!;U7_?wP-DYBJ^0@o4d+xh*bUAul@W%4XmaeS{dON5CmfVc7?)P{2BDr z_M+uc?l4jn2}RP)D&4ygRpKmYDl_t|><-y6IwiZytD#dU@?Eq_M(8nufDX+oPjh`% zfHQ0!MtgboVsjY(# zJv(k|z5Rh7<(s+hG!}2|6v`v@5a$vxSyflPTu9xba!?$JXs?Whj628D*%7WAB)J`y zeyU;9Ze}C__Eelj_`5CJ2u3lCNpx8=F>;P;GKzeI0lJkmM|mZ}kzo!X6rY1MN6Kxm z0Mi`-`viG|FDfoiPL5sY67uKgENEo1;O>#qB?3U@=N ztaIa+B5HN=-S=x~+iK@VWsk-qZ6`KdIfC3VZ~isdT$4~&yE!5|J>F$Gk?c08ACYh> zYRvgCMAM9p!;YDg2(XsCLQZdYN&9OYiLSlEYDgG@RSZL0PrGM-$=|$%fZCqlE%Y&h zrg)AekPK;mDV({8L{pv^Z+G8E|LJ**AqAv3rPjI7o!vQ0Yy5wk?&`r3-g$=o6^EZI zho}2|h5K1>z~9mRgVLgE2}fkx$H~l;$TB3xRC1{%f~1X`y(OCFcsL_7b1pxBV5i^~ zDhzwD`?eV0;VVyaeU>#lVjBUuFJ^E0kWM6Q7{xMz(Ly|3z9~;2H%r)WHB{~q3VmuP zSRS&!y`Vpo{_9iE4r0>*Hn>_pqo<+$`n|wA&vbr96u{9e8-G||o^HvYnmKNB+|4?^ zPk3gLuy~HjDr}I`Q%odSp%k%oIIr|AL^at~EF_{7@iS|)3u;EzXMaINFXHW6+!O@G zWQt+m=>E|sic*1yi6$P)wqF{fIav;Bpsp=O*Kkzz`HoQr*a70JVa{VYRLIsTjze&H zp%?^7B3eS8&dC3J(TL7Q`f=ayQxh$wkU~Wd2+{#uVrc$)n%lENR$(g$Vh^-vJuPxh zWl|^N_W60gy;K9M?(3Y4}7Yd7y=BC6r$uX$D z^nE7RH0^wdGPv|g(BemG&AjA%jI4~R z{scSm1I6e!&+eSxy?#DN*@18O`fAb`ca`cL;QdMTG2XBj*F(6LYM)j-^?Fo3giA6Zf?#-MRwx?Z<94_6cn29?c zLHmypaM&}+VpztgChU|}gRN2LcSE?-Y*%$6PNkIS6iE-~2sp#9AxJ7QRZk6-eRnN) z;+PRkH#?l=i5=%Sv!kdHjDQ#hQcpEHd+ACjhoI=#xu`bMI$lND>~8U;!wmv1G_xOl zl99!azRjbBG8@31e@?V(jYC26_y>4`KcXC{;JEtm|YU%yyP9vb{uB-m#^Iiq5 zptTKm9uKGyx4_a1a(|mJbbXiML8<3TkC?_a|IL%Gr7PLl;O;&@G^I#}eH~N3_(ZVf z=i5y&tZ1<%ye`8-V(Ly~r%&9{GxicqWZW9dlxU-6=$A&q_kZ$=gj^VhUp8qXfnQ8P zXJs;+u2`0H~5bh;VWPBXshhz~*Ev{|X zxG{6=y4l5PpaTCGb^zYOp|LJ55+Wf*D4J)O8)l?s_O#^@4^dpQ?OJ0bPf+G=X&y!{ zHKi4T$L+W0t!g{y#z+Iy0DifL+`C0P=Xbk<{`_35iR}^;Q)dZ_$YJ5BKVq3vfT~0+ z_yb~@Nr1kjGML@#MuWn`3m)xy^`v!kQuSbd$-N`}VU%3(xF@MAQziWR2CH$Uk-mC` z><>kvmaa5=BiPhzX zo7G$SX5iqRv!K}fFcrjy@j~%;a+Vaa4~tjeqnVXb){cz>?`{;DIX1SkkyN%q_A7*c zoXH*juogTX;i=SST`v5xSGdCrNZCw~Lk;lF1CMgH702bP28zpH4v0@ z3@9G{sDGjsn6suh^{{cpXY`=LR(r|uL^n|U@W+a`kpJ?lJ2?+JjjIM4Vqcrl903nBjfF|&XM+57t2@H;-685k9)U8R*d3DrqRZ;PFYimjL5pj2bBRr-a6f%S6h5LVp=_jNYS3&+S{^9LdV0`Y9p$BmS7{P#O1+ z!@#6%u3qKTfJnc=;O}}RJEyHmbee%lz<|@e9mZdGRzs=sXjjihA z8YBN_!`_l7>$YdV*)AxTVf9G#=O1wPfGx?yK$d}yNA(2f=a{S_g%Oa-j)(Pxa&s(` zk%O~zlMw+3ZmxFVnjgvUs%Yc)UIjD8`^WWQ%6Q4Fij?r05hl_FItk z$BIS^iG;`9Q+~JUT)vFFs`yAGx8>roFw9b1_2x)x^*S}Q)wS@;vy!UygNCt) zZT2ady;B#Q(FDmF$w>4YcS0A}FC&u|$~P_VwgI)etT?7giSk>P*zYyU&Z~zfuvU!q zdr+s*)n|0Ea>%-%smlj6ij^sL^_r3J=`;9FlWfJ;;M-C0elcCwc{S?PFp%-g<;79$ z$`p{J<(;tbD~A6E0Q{}<{Xxk}G5#JAQswd#b2eub(>)mBTRYkQkOmn2w~{JbTbAqQ zByskl{qm>dqw@*;D4I$4Y%4-xdq{bt%&hFfLZkHV{2}h{N{4lCug(~arJb-_*mo4M zFPaUp?fZGEueTo0VfZU|m)PCk+V5rF)NHZ?=vN~i!@x|zQ!lRgh&3_zu;fYi97(nh z)@;-SS6O<((Pd&2Qih>R8n|Dv|JBm zecA1JY2Wte$NkmEh(6yf-YcQqU}=n&@}m=<s2+)K%wi{vGvGTu~7gygz;6qwM|OcjRm!Op%QgY;bxO?6f_(X^GaJo6Dou@ zXvpq5!EehiKHRgJH*_d~(xe5bx&J{o3GYPDB<0NKlTJYzg?(=CS4`@4YR<4Vp=|Bj zaGOr5G)%VkHCtC8a>sX8FOx$QUiGMJ(g}GRq=dzC(qOvr&c%z-b^sZi?V3F+6~=%y z5)C^SnGd6huos~D1tEBQ);_sOoD0dPph+*n*#>c3{}!mdhcFSc*>CaFYoqCOtQUi< zM@Hmx(rDUgA0_YeZeGJhy{C`iW>UQv^gn=}_2f@;L&kwWx^WYWT$0KQ$ewk;ppIU@ z2zR@cz3F`cUt^RHeZ+mI0k+@zpNwJm04E{V&&q`XJM6&*O4bJnWM>$c!1y% zYuBtNxjjo~rP~Skh_rrJoFqxAwRvAq;pZ(YCDzs|;@dz@&%<$l2TYf_?M8lNn~UH1 z!~6c;qrtlAybKf&fFD`BFz|FTGgZmR+wsO4ye6l#R%&>6GDre)SmXB;KbMy(TQ>OW z*l`B(<{+SOZQ#pPW}}i3(s6kWK9y72B=zvW8R*RsY>?tdnqK~r5L>=>s{j*%ry zPsk~)l9KWL7878qni_lhO|^@1v#iTv;OS`QmZFi3W9|?r)gSf~o}VN5?X6-N7|Wlg zio4F7lK(V6_7^&da@@Rd^tx6m!uJdw%Vhu4ymF2?IqVh{wZ74&<@!9qmy!8rjNtNe z5&FPOX|j3ez$N|eZzTPpPm+spvvRnEud|GIoW=ToRW@kohFZ-#k}D>nqQvwUbcOBs z%R`4zWFu%r@QG>1=Lc8VmhvXcvZr>7a7SJ6ZNE82$`$Zzx7}up+z7=@7aaAn=-On0Sy}MGH!C(7_Nxx% z^P|z96%60TZxGppI<^%3^_h6T&aZoSyvRxkT&Z6X2w6v0u*7t$NexJ-GNvuQhU&wEu%^|4o=ozJ` zr|$g3bFX3_Pm&CBv#Z7P|kogbtWHLS|D7R}cZ9Z0BynFlcKwoycg7^cQ zZ_RMzj)9SHmKO5K+NCMIpsXX=1NW_og*qMg2R7`dt;Cz=rdj2(wD?OkdYA?s{Riso zZKsD-+*5juSw3=09-pTQn{%AMpDm~0={>#B-23Rs_9eXDz`p{PJS3;?HTL>ES-OPPE6#$0 zZlJ1-^IB-77n~o+H3GK9F?A}33pM;$%Oq&t0xWO$CC0aO5+i#eW zj)cK22PE8Y_3S93B=7kXn{i3DP>NtPrfEi8;GW?2BrXOknA2tS{`6U|$m3VD$S$XQ zM;&Yy&B@+Zs}LzLJi^mysv*;BF~#zW|3}BLvao` zG8Nq@9f%@D8Nl93pH$rBOd1zTAMSKM;!tIMBVo$fe3H%c9y3 zE@@q_RVqAg&Y$AER=Zu&hL^==t3NoT^$De$h?QBHI+t4n8~;)50x?Yc^twpf#I&sX zmNH?uDP;wd1^+vj8bg^8fgJt$wg&zIAb93A%vhWdYvNMIB5iU|p%nvnPa7Ai0qHNG zp=sUuwi@s$>zy_uRA#dEItlA{IN05E@%BN*mgVEpJPi4nWWMRhYwqA-k1_w8E}+}} zhxrsio3%?*x$kAerP(Gw%&YI!;|?`_w~)T=l-#`)jrI;Cf>?HWJdi}Sh? z)O6{o*x|3^^Pf)7*?GFGEF4>Q5p;CB4yj-Ad7L{AqiYSGwO;E~(5?>Xm%qW40YLtv zR=MDlumJM;8v1;0lQep@WP@T|-m=9_Ra^bqzZ7)6(?N-;LF=pK>bfwpd4o`zOFV8Z zH;ZzV?%>T~9N*flGRVP#+AMQAFYN~4;~RK~vOKu6)CZTfIc{i1ENrxdp7(QyxJA{J z`fPf3y8-vlvo^6mkupcw0I2oLUp!UFA*tqP^V7L}0a}p-sel3Gh zbnChgUGYtgZ7w ztrl-uYd89+A&>L*+!6Z;{~VUO0vbQD(?ZMUa!)qTnbHuG+M|E7IzNj2ft$)uYJS(1 ztjbrs+6knx+|Dt^n4iV^Vr^BdPgnA|oG1tL#X%FRb9nF z9^eaERu#+iHqr!<_sYqSb8@5oJF_zFkZZ<0m0KgpZC$2W(z4;Gs;Nsg2^Ubg3Bv_3>=|*Wcz7!UNl-1BcOsIsLdAh=SJ5~G7P7HFrm z3I(CuEi6NEJsh}%9%l`eMzd-T#z#i#*A_S!4>owW5~7;{!2${90|ol~(9_Nz(MMug zl+Z1unplREnS7Jb=p)|>%IF?X>~mVig9?iWywEmHR~3x~Iakr}=%d1sJ0S0~1r_5# zf<+(5Q+MUpSQvG!h>Si`tf*l~Nitn!O0g|~bjS5{cjNl_w#we&;Cx$~7re|F4i{s`be@u85Dmz10wtuhrCekbbqiz9rupznuf~HKLj)u&O2R*iVpO_fzb?N z6-gNn7B{6BQt}EO(m}WK@kAO6j?UJh(Sh~NM2rXU6?Tnj*_3X_!w~(Z)w+;K#LT7*i$eWlzRq%$7 z4m?eJ=DE_ZaWYsQ&ml!O>=kqYl=|c?0S<@LiNfokMCLP(<>kEha?UHy;x3v3+Rm#^>_KX@0!F$EO3)d69p4sc&32UOAhBmJBL6ov{EOl*`Av=d zqB=qQXOdrjQ4ZC=sJ!2Lr1ih4VJ6_rOi>Fn!@-Gj#lFT7Jmwg;0i97Th2WuE$MR0u z^*wtfH8>&7R&GZIYY@6?F$6$olCTK_iIJDS4k`v$Ylq;`p1GQ)bHew{oHb_ZbduY6R7d;A11N0?+rW0JfAQ2n5`C zUxMO+xA8sepM=ykZ0Jtlu#Ac;Aa zF0Mxjn-stU<#ueNhi-|j%m+pHbQf`jM+b`7sM6rJZ>_0vk*1vbaTXrWQ!?x%m8f;8 z<`Qn6_=%;doDj3C=IR$Mqn)g^i}F;@Rb<-E0UPuM4+S0Yz8WjuA97F2oUC=e+6ro| zxO@m&p19udtlD<}*vVS|tLIT5@Xn(!Mzf8*BFh;!HK?`nOqT-x0Q-LM$eu(n8#_fm zMU8zw+NQ|-*7ks7`U1tMS|ypc3`1#%Hf^CZj~=l)yZoYBBw3;yqB&%q_M+p9Q8It; z7f5pdz;<+SCZQ!U8F@Kf1{X>-IXc9R=KUQW7UCFI?e}V|WN27&SO_N#pkc>DM7&GB zN*~S5pgJ4aeh|DyI7M7c4yV`VO1?6SRQn!0PFO?iLjHyB)dd5k7rwuNum^UZ*{uk+ zhi92GUX$H!7m=wayY#Aq7A8l#$ksDFD+S}DUAt;*&ZR*AvfZDe_(jKE*da~%CDsf- zGSe8keg)z>eX`=L4!{+LrI`-Zxxc~HFCLaz>M%XQhCjV|@~uS=MyAR7Upo&NA~T9O zJBdHrnp9?#Wp*;Obe8sC_Y9W7LOsRJ#~Ld5Wl67-vWUf+i6o zogMrHL3IHY&`#!wHy)TYiQ+qdiq)3|E+5fydS7_1e`Lz$Nzgj z;NMgKx3vxbj9&_eUw_W1ic$$Usr=nu{;x0O;0P223x>&zs?ScLJU9(S1^%OBMtxR1 k1SdG-usK(sn`Bt;pUTWpho$#(QSeg8QStL@>T6N`2h)0j2LJ#7 delta 8403 zcmch6cTkhv_OA5atD#AgDuf=SO8_Z~f&$V^L_mttn?hbXND)B<1Oyu((vcbvLV^Lr z4+W$X2u(ncK#<;U5Wnwt&bepi&i&)w$xO2Mv!3NieFwY^Zq*yaT(aXvGw>^{$e2UpdQ;N1I%JAqnT=HdjoL!c2X9k==I(r{TBo z#%DAT$Gmj*zGV3qIX}k6nC>(-IWF?G+~HdsK%aTRH(su0`ADI*1+4C-iqt0#>YTfk z_fc0y>pf7CTX`>1plMzbp}CCFZTzOKbLuvHy^ok@K1fui#fnaR*asEs7whbM*lS92BF9XI0M zCXaU3<*35SUY;xRAf$#gG&lN5b-URmuTLff?CP<%zBp=DCw}{ z3pa18aFh%=j;4uv86uOeZ8N{$6b>KYtOmCI_kR9xS;X+m@AqqAYu5O!ehRK}7Heo_ zB`@y_)T$?x$6}SqJhGv(4*PZh_*!@~OBlk;A1QM$74naJ%m7e;{36gB|N`1X- za%)R~#SkzhzXZAEMz1gz?=*SkwMTN`-LO+WKb{nF(&Zk05jtSnwdI$fcfNPq&)@fb zt!7ndlxt(XYa`jzT)lBVxhr>lRW134mU=IL3LBsL&N&M4-ujg~%Fu#14|}S54}0og zdG)Y8YAU;W7b_aX8!;6{MMVWgh?1hM6utZ%rd2UJGHbJeWPznDbR89f*u4RT9Jr)}xn) z8b-6mQ-6h~E;B~axX_BXOX_kaJ-o#!r5D-G5i4BB|Ip)ff4=MC&X05lIqT;HLhhzz z0P>0?XRK%p`l2vb#(r6(l}U`hhOJZal`J8kEHxFqoMMiD`PbF5z17by)H7fT7qn~^ zlOIg(bJR}dDQ>ig4WlVcN;Yb)lH3X{ZNuaNBUeSA9cEm5nME(E)9|Ravd36Ewx~aI zd*^};*%F+*u1y=Fmi)4umm4nkIc}hmyACC`-M&iM-XWL7X{epU(hXzs^rp6h$#?=$ zKPxE$(Q?B~4`A$@XzgJZ8vGglNQ^h-BQz&})QmUzWwaE8$rUe~8@29DCWjVpV6?_d z+eg`XQ>ebVuvxayzjU8i?lHzp1E-%RdSR4;$tv)FDQ7Feq)MZiym=p?mr~ISvx>v? zV{i%n*w^4Nh1a!Dyg}tCr(k+7Jb+V1D#6K?V~xGj%TofrphFsHGlk2Es^bw&-YhE^ ziug{Q$c|OYybIAs>doPqtMrZ-zF-CdUMn=q(A2z+Jqab5q{qfsn9=r4G0T?PvK!`p zTI<~FBIjQ( zJI_wp{+HotTv-5YxSp{#!}z7M#hquIwr689riK*vZDVhCuX>zDoWoQ&Z`U%ml0e|U zplgGQ6Si2p?qHA8Ugz|yRn)i!kFLIjER!3-rAniiyifUe;Tgx{7SA|;;gF3jsASm0 z=rzy|;m?joEiO3Ml7Ehyt0db*v1LW_c{8k_{AoK9=?tehb0ZdewH$3}6NRs38QK=6 zX1Kj^1_5r*{u%$raHvhW4@viT95ZFk&9zDO8UGgCzkn!PYMbs;9;abtyf7?m>5jDL zPSeZjg2WNJy{R*11kH&oDpNRxedOZ%d<7MnIy4!C(g?4d3&eDT!|0Tx-^1uiqe+=M z81?#E9Y(u>dJDdr;Ns7obb*Z;P9*}WA0|H!tse^pfT=R^^y9wGBVZPn0`yvb0wIgyP#4ic`@IO= zHJPNw4WQU<=sjRQ(z$tD1Ub?p#%>j%Q=ab?SzGK4_gSuIRz(@ET5qijRH}28kH9_f@4mDIb6uPFl*Pgi*+73 zh~1JT*RSIB)&AA*esTZtws60GVI1Nf)1n~#hWB|!;HRk%=VlzaV$w~w@;eJWBUb?4 zSVRU>5fG9NNCZwWqQPPaNk+_b-TlX-Q=8Y`?jx3EY4oS#sugYnojZ@$g>jgu;#Cho zE08;4N&$8s@|1pZ+qYSmMxTwBU8kAl7o&L*y7hF5!>~|Z&}KT*h)}f-$@B2>f$*OG zX52E%h!B0>s_OWfzSJ(kQF?z5aQ2yn2wv4!=l#@ng*g_{!5jmZWYmZA8V=E6uJFd9 z!JM%#!HlAeLZL=ve;#&4-XMkgsfBKks2dQP`KdoUiP3M!=xa{)+2-@+ zc;$o%*-vYs*_tBLj15|qEZ~}a^hG;newES@?ST_C3MtvJO`I(>SLPWG&F{k=@#W;I zseAbX6SK`-Ay3x7LmrQdH5&UqnLXQeDJ^H+au@xj{UtY9$)&n%2Fvrikcl&m#oKOa z8o$RLY^|SN;*xpoyfD33^ zxo<*))@jX(&rZKeDf&eO9A zp4bZCy*0k}WaW>o;LQ$gyccooO;hnBci)L?W-97l@7`u#z50Pl%B>}iMXux&ogs`9 z`y$I?&UzYm`o+cUampE~ur-Y}tn3wSv!3H!`wm1UxcdsrMt-cM%s~6vkjcQgN@G<> z=Rn*2;Zq!yS3RHJd*WW(^_SGa$BOnw&xpIEw^fA6J)+>U@uKTy2jb6eu`;)@(c(Jr zkla(wvv2Nu6B#AxCB8&_@+Oi?vPj5BfP5?()kC<-+X5QM)TX${V>P_36+m-K2S7UF zkY~nB2&ErPDLvFB@xm%6l={mQRWs$r*lkX1ufCUFjK+@O!X^f&F$_vx0pV1T9tNE- zen^FnqiCa{Z}KdtOC{|o%WIW153!+(<*D|^=%ui7G;f)LgA)?#pS%d_S1I%`8_KeJ zm^7GGewQ+$^AXy$ggFfgHFkCbcewhOv1 zz3{Q-o62U>^52V*2y$xRO)%Wa)Z3GK( zNAf|waAPcNsJr1*4e!@Ixf(vKfByO0l@A^UYTS16`N|}x)8nP#X(F0=7|>irI%QOc z=_KGrpvHsRVP~G@h!2%4n;0?(Z5$rVAMqLhQ+42@`OM0jK?lCl$(jf*BkliEZ7q3I z+(VyhU<$&^jYsXRo)Sch1~Z!Dr8J}FSIHgGGQmtfLM!K*qZZm(!5;E z`HdNkaf8x6hk_=PprGebdvV}+)miCdqnNevG4g){2<4XN(kVe^uW6vyA2X;-vimVt?vlGh7M488$Ufd)10I_~kOxmn@Km2|2Y zZc?QR)5s-P^O6|f1tTHa#=Gx?xYr=|APPbf;ZmehRLV$GFd+75y@`D8>*kGuVy4y zd!{?T*5vu#wy%7DzqNxY@W9$J%kXfWMb-KBa!cq9-B08eg8|NDQVbV=k26Y$pvTG8 z&FMo?>FFESZvZBrEG#n8s?*a8-pGnOOG))RY;wN%9HM?dZC!ERxu;u@CHB1gb5G7Za-R5f!G;@M4NVt+CClavm%M2vdNgmq z|Lfg@3ZLTYtK6|fhZl9BeC0*G=n8Dl+SkYxMVvFTdp`ppyy>L^6fAYPO5mn8fKKDYF##x;=I)%jz`7ItsZFZUh&P$8Y<)uc0Sz{x> zjM4BjjK3k6cIOJpQ-L)if|fDkO>h1K9;5G}x?3;1x5Ub7^gzkR$_J0DCWG|yIZolSuX2uo-!CLqr6hXJ1mYHSmiEx?AA`Wc?IMnDB!(E#j;9jr_b_6!)n;nFI@Z z^Y{C=eK%?LnE_gXX637^s=?0^c-|`bLjU1??9z>tFVaemt%Kz6~UJid= z$s>ok4LYD{<(;f!VMYl<7zK5;bm;RgT+!0`&*FyMK61=kJo)f_@pfH_w}9s8eZiEv z>8_Dq4g0&*!*g=uaap}Wf6kxw*Y!NCayQ#Nf+@VF1e$5&o@NTN(h31x&!rlb1_BF5 zd#;VWfAHF^W{Yo4@(V^s{H|4w)gA$%?6|&l5%;{fNhu(xaHZ!P?io_UGRXDEirH^Z z@u0%lp7il&X&RQkt|lv`hHv?}Zv6GykVMAzd>eiS(y(-LbzlC>u~ixFAmV^d4KIcFkTsm-_x5RATZ!x+H(xGn(BSKixqG2fT7Bi0fm|E}Y1j zB|k5&Qc?*l%57lvN$1YY)?!y-R&eon>@H}^B+rQU1 zt69FguCvO&+xg>mJnCm9h32O0N+hn5<}6%(nS#Y2kp}gocbc?gMtDiHHia*jW~$a6 zDytsyykfbGc7rg?}PDBTLbJwYHGxj@48{1 z^&PXl9!{nSO8+!=ip#*t`IB5y?L``)z7J>Fy9yr5E);N}yt>FE*t^6_C{6x1#be+j zk{oI3Pg=a!;Z+kf=-~=GPW)d0U(sFCnW3?c@iEBFoZis}=EZwRu|nj19A7oT=VO;u zlUAs4Oh~?c)$O~hWBB?uuc%RMuJUF9#o7%kzEV}jdFomwOrxH;lOw2U>tHzLgzm4l zaPKSbMU!4o)Cpjw_Dj#n67*n$!$;EClXsYDny+0g-V2NaSMvF*&Ax!cNHf++0EQ%u z7VePD?>HfG7;*SP^pCs^^vYrpT3BA@bG zzK7of?IrX1gi}?r%1&ox=VK51j!4~a1Qnm?wY99pB{G4}AVX}euKen7$GtrWwJ!g35#16@5{m6V^bvhHsbw73+! zf+kratS~QPL)uavFMiShzZ<>qaZh=3;D}8E>T6JP!8c}>zKbhOM$GzR`D1(GMiMZY zK&AckxQ$?N$-uVkN%&~G%h+3S7XnpYhfjl(7fJj_(&^VTimJQ-iHU+Hv{%e1eF+yx zX1AtVAvtW`c)7zpX5bSuz8dWu(@merB}a0*W*;kv! z94x}ik3VIWzLg|1dtI=gYS6r+Nz8h?Y}GF0Wj=<6M3#AJH7HGp7`Qxq|0(tmb$8?R z^HZ$??i!_mSWBOyy`U1 zve@y`?f>E>sxBbfsPEfxk)*)}L|nF)pC{3(a+4P?muf1VI6Ni=uJ1b^Wg4$?hg59; zuGgZ=tcx4MjFvV3=hl-(rvHJG#af(ehXi+5RF@7|Tp*==kA4GuRK zh`R)o;I*$_1-2j!D-mN7_kX;yR_h9VRVoK;{H5wv$^Z{5x#Yey25Y(`16fM5nRI({ zfP@SNjn#C%mwOT*Bcwxj(E+@)=lSW1!}%o|&%7b_-d*9GX&W6zBhS2nwEo@nOFpGS zQ8TIrH3;&{qnu;+@imvOmUl={Zd)$%#MQrBc~W&H#Sdt_qr?o7K#UZAe7DhH@?}Bi z<7sH-wpxriwWZcBq3|yVZozZwQ0H{*23VAsKRtTkbtj-Gwlt+FA|${@_OO!=xpC1F zs(t_5E1p!f_NCPR_)!0<+e4zn!boH%>1RrRc8M*-(lG2i@%@Uq(c$|gwjBXg4(M#X zNAd+I0?4sq6Cv8wVueLo4Lr_5XVpCZijChtTh_>$I{8*bNQB5?%RsW}c_=_3 z#P6Rkn`2GASyIa`LiDJy(uZo>R+&N(Pp$anMTCSB;qC3lExEmS`?{-4+HnfL?$1+-k^uJY}o=bjvPCV z&1^KRI}@ZF9L#&PpJ|OvJ{{+-(OTEJmFLlzMfwT#8hcuA(6V*SRIS#aWnOG-x8@x2 zLx(M84QZAz>PZ5(t|X3BwJC%DElDy&V<7`AJ4>4^Nu>_dXnFm zZR7;^jv&L`RIfxJlu($_NzyjDVK+M_GTBrvPQ05+SR3QsA*q$SKMb{-eSrS@dnV`c zdzRLJGCQ%|BI%QuJtsEBk(1epjePv~?DC1NZ-O~Kl<>wXR0L7jj_?UiB?t^90Df#c zj{M4(?PniY+WI^dnM_oQmt)(RU@KeDNhN$-G<5CYn9#R{pIy;vuZ=Mz`Fy3HC+$`| z?L{ae-|CH&h|mY_-o#FGcZ18K#NLl-xJR9YLH3Qv^I98LunwkkjrBqpvXuoqW=KG9ie5Y4mHUry^q!nkgkmyPF36+F$ z>q8MA1})+{JI){clYWthJ}RUf;c9};{v;|q;z>1q;fk7W~4lrp?kcR zQl#6glV|)f-QV>cXr*#_b0`om-7Pwg;Iv^uaef0RUGiH7D8o3+C#8E^ z)Qbq4#*_a20F_JjAs@Kw*JQ*_fsR(~=Mbfz`$2PFJvo%Xe{0>=;iS6=gG$~E)XD8p zY4r6<&>+gzhGq#)VTLjsraZ2(V(wN71fu?_uZC&<_5X!PCvX1CC}Rj!(G+8DjGwol z9Lk`9GINUlpI6pN;h!17K+6j>#{{hk#(ydLc(j%;q5c2;1N=W&GM`%~sH0}PWn;uI zNQ^h)DsPm?Z7{PE?Cj^r5irenv}P6y1MJUra%LhKEeo4XK2`^J?#=0#k(eVE4Fm%^ Tb3l+*m{y%$T-?Cikp6!GJoNK} diff --git a/buildroot/docs/manual/manual.text b/buildroot/docs/manual/manual.text index 0bf817033..7367be96f 100644 --- a/buildroot/docs/manual/manual.text +++ b/buildroot/docs/manual/manual.text @@ -161,8 +161,8 @@ List of Examples --------------------------------------------------------------------- -Buildroot 2018.05-rc2 manual generated on 2018-05-22 21:28:17 UTC -from git revision c11ed3a4d9 +Buildroot 2018.05 manual generated on 2018-06-01 20:24:17 UTC from +git revision f3d114a1ef The Buildroot manual is written by the Buildroot developers. It is licensed under the GNU General Public License, version 2. Refer to diff --git a/buildroot/docs/website/download.html b/buildroot/docs/website/download.html index 1ae05e9c6..fd0809378 100644 --- a/buildroot/docs/website/download.html +++ b/buildroot/docs/website/download.html @@ -8,7 +8,7 @@
      Download
      -

      Latest stable / long term support release: 2018.02.2

      +

      Latest long term support release: 2018.02.2

      @@ -41,73 +41,72 @@

      PGP signature

      - - -

      Latest release candidate: 2018.05-rc2

      +
      Source code
      diff --git a/buildroot/docs/website/favicon.png b/buildroot/docs/website/favicon.png index e87ea528c0bfaaa5450047f6114ae5e5ca52c9cf..3bfe1ba76eae9ee9ddc267f8acd1c624bbf3483c 100644 GIT binary patch delta 14 VcmeC+>*QnY4DfU3-N?ei4gejg18x8S delta 13 UcmeC=>)>PQ4DfT`$jZVF02;#sVE_OC diff --git a/buildroot/docs/website/images/boundary-devices-logo.png b/buildroot/docs/website/images/boundary-devices-logo.png index fc7b8aa9f1d238c1c67f248d88bd29c282da9354..35d7a93197183b1c0654454b9410bc4d360ef29e 100644 GIT binary patch delta 21 ccmeyK{xhAmGr-TCcO%Oq5k}t4&qM^}0c2|j)c^nh delta 18 ZcmeyF{ym+gGr-S%BkLoP%`Zd*;M1& diff --git a/buildroot/docs/website/images/email.png b/buildroot/docs/website/images/email.png index 1968c398ef5972bf148fcb104d9dddcd8809cc0d..367dadc7f13ec85ef6e89085b38bb480332741ea 100644 GIT binary patch delta 13 UcmZosXjNeC4DfU3UC1H;02@OCe*gdg delta 12 TcmZowXi;G44DfSb$SME;7)}Fn diff --git a/buildroot/docs/website/images/fluendo-logo.png b/buildroot/docs/website/images/fluendo-logo.png index 4112e200611e720e109d4f58297527ee796e3279..b4d02cb668cc4e17d667fba42419747ff9284a63 100644 GIT binary patch delta 14 VcmeBl?{a7D4DfU3-N@3a3;-lK1b+Yk delta 13 UcmeBj?{sJB4DfT`$l9t503hE4asU7T diff --git a/buildroot/docs/website/images/free-electrons-logo.png b/buildroot/docs/website/images/free-electrons-logo.png index 10955cfb104d4f2f95cfa37f0e6083f6979ee293..0a774041f1b2f29946793b547294ba95f4648933 100644 GIT binary patch delta 14 VcmccWe$Ab=Gr-TCcO%P1WdJOR1!DjJ delta 13 UcmccSe$}0&Gr-S%BkM(F04SFQRsaA1 diff --git a/buildroot/docs/website/images/gift.png b/buildroot/docs/website/images/gift.png index dcbda7315a76df2c9bd422fbe46baec0ac01064b..f527f82837ea6b14e38e54f0b6224b70e9faf8e9 100644 GIT binary patch delta 14 VcmZ2jv#5r(Gr-TCcO#3e9RMoq1k3;c delta 13 UcmZ2fv#^GxGr-S%Bde?(04DeZzW@LL diff --git a/buildroot/docs/website/images/github_hash_mongrel2.png b/buildroot/docs/website/images/github_hash_mongrel2.png index 6f4fd8a80c79e95941b520fb2ec10dc01006d48c..c695c3181abc3bdf4661692fdbcc4332a02cd856 100644 GIT binary patch delta 16 XcmcaIh4JbXM%K;%KX=}ZECF5sHy{P0 delta 15 WcmcaQh4IQ1MwZS1KlhES0bT$yl?9dn diff --git a/buildroot/docs/website/images/google-logo.png b/buildroot/docs/website/images/google-logo.png index 3167bc922d421755e23c3436d03e5181c334910c..bceab166196918575f204d14cce4a4e6d9776008 100644 GIT binary patch delta 14 VcmaD7`!trdGr-TCcO%OKJpeFB1;+pY delta 13 UcmaDF`y`g7Gr-S%BkKb_04xjzx&QzG diff --git a/buildroot/docs/website/images/hammer.png b/buildroot/docs/website/images/hammer.png index dfbcc3509b5d09e15a8fa9a70f086d2f723137b5..454a5e5814db549970f8504d4633857a6a100f3f 100644 GIT binary patch delta 23 fcmZ4A&$zLlk+n0x&z*N8%QYEB-p#jUu4(}QWKRfQ delta 20 ccmdnk&$zyyk)<=h&wV57HJQzKWUguf08~5(MF0Q* diff --git a/buildroot/docs/website/images/imgtec-logo.png b/buildroot/docs/website/images/imgtec-logo.png index b9aaf22bedc0531338daad0c5544892bab87b223..f8a0ffa372ec4c41de18fb4a5edd980768b7a2a2 100644 GIT binary patch delta 14 VcmbQOIY*PVGr-TCcO%Pm5db4n1Zn^P delta 13 UcmbQEIa`yZGr-S%BkOb#03Z+qT>t<8 diff --git a/buildroot/docs/website/images/irc.png b/buildroot/docs/website/images/irc.png index eba7fc34becabba9ac7fd59b7594a08eb4c4f7dc..442be4d74d2b1bc825162e9b36549e98c1231546 100644 GIT binary patch delta 14 VcmeCTnP9`(8Q|y6yOD)k4gez51NHy_ delta 13 UcmbPW({IDl8Q|x>k(FBx03U<{=>Px# diff --git a/buildroot/docs/website/images/logo.png b/buildroot/docs/website/images/logo.png index 84df575b0fd38e05d723ccf247dce7539c3dbab7..2db743b4fa93820a2ad38bdafb1dbaafe7805fee 100644 GIT binary patch delta 27 jcmex4mHqcrcGk`SKX=}ZEO)#ad7B@2Z-3y;C|M5xoyrQp delta 24 gcmex8mHp>bc9zZnKlhEScf6Y)d2fH@%_vz90E+JlsQ>@~ diff --git a/buildroot/docs/website/images/logo.xcf b/buildroot/docs/website/images/logo.xcf index bbfd348f57cd0b8a824ad5d237d4f12fc72d5a1c..97248904bcec530e02cc3fea8f71966c5361f08f 100644 GIT binary patch delta 527 zcmZY5OGq106b9fqckY!q>5Yyi;)r0yjR*#+h~Ntfq7V!yRK>UWpjbgd@P+sS18%CD z0cW9z1k{CS6SEjx2<!qWD+|W>K;f(S51(A9bah`R1H6=bU?IC+SNieKAiN$%Ln@ zLjzxHh6tS2hChJXfT86{%_USuibuI4#?v&Z`*IB<*Qd+G*cU&(HaA*l@XTqeLQ8X7 zoeRNgF9P$VH-*$*-+|kZS{lcYeC77-kkDvYldokZOV9Mk#Qj7w6+WjF_q(kxgVL2d z^Jkwo5t@p6u_NpICXR2$*1jRgv%EJXZGVUi1{=dP>-c+|9#lI%OF@;Z&#(yc)~7jkY0*5}#{14Z+eIn3z=m;O`*4xPRFcaB5oQlW)b@1bj#kum z0W(cCqX!l|s!iQ+w24m|@Xs*s31C!Rj7Pw)XY7VJAIV4c#~ELD4imWG<&JY#yhVrS zDgN2%&iKbGoXz!5T*qdsm4qKGk-%@Zj!85E&O{}sW+DobOoTvC71!V+7p3SAav>$` S)CHBmu4*BQVgI0LaQ_EnL4;=j delta 399 zcmaESS9IB3(G7e?oB53*xi)9oq%dwiXIsRx+0jdqOM;7om6?f=fsf%eBNGc77q6hG zgruZ|sNm+35Ix4pi$kj>%Y|8OjtsNom^>rSYVzf{$D6muuj3ZyVq*bnlVP}nrmZf! zh>IH{$si;sz_&XvnMK(8;FA~|T+B1)9@{ws-oAsxQ+}!R` zz$nSIJ+6qchH3ll62|w;+fP?8&R5=^J%^ElX?w{$#zn&0#Wyi-I!n_dtN^xV`iriy-s#c1Bjc>Dw4tt)_ouWObiz$;4_ty^x7@(R2}J)`ID+%&eEE hN3yW$Zf|E{<>lQzRgjfYYx{I-R#uJebCX%!xB>OGg!}*i diff --git a/buildroot/docs/website/images/logo_small.png b/buildroot/docs/website/images/logo_small.png index 0a4eae8dc20cfe207cba66102d764c7d2b0d2c04..eab9540226e1a63378bd7daec8185f349e91c8ec 100644 GIT binary patch delta 14 VcmZ23vqFZoGr-TCcO#239{?g`1MUC- delta 13 UcmZ1>vs{LyGr-S%BdanW03Rd+;Q#;t diff --git a/buildroot/docs/website/images/menuconfig.png b/buildroot/docs/website/images/menuconfig.png index 3c44f884f855d2b13c6cdf8df5b21ae7f47b5107..423694f3e3f24db0c6dfaa642b10f89743a80a61 100644 GIT binary patch delta 22 dcmey=$^E&Lo3%5*&z-lCrIm$oD+|-RBLHEj2nqlI delta 21 ccmey|$^EI5o24_r&%Kegm6dTTE7Q9p09>F4{{R30 diff --git a/buildroot/docs/website/images/mind-logo.png b/buildroot/docs/website/images/mind-logo.png index 6c3097b31015e3a5ba62285f7bd78f6e68120ecf..ecc3fa09e6a1d888b87ea573faeb2dc8bc0becae 100644 GIT binary patch delta 14 VcmaFr|IDAYGr-TCcO%O~bpS671*ZT2 delta 13 UcmaFn|J0wQGr-S%BkMzT04nPRng9R* diff --git a/buildroot/docs/website/images/nconfig.png b/buildroot/docs/website/images/nconfig.png index c479671c8645bb457660d73855a3aa14b1d2191d..cc05d6e8e82c07298b1be7863f735e946191e4a6 100644 GIT binary patch delta 39 ucmeyop7r~BR@Tk{KX=}ZESFX>@@~Gis1jUaG<9rw;%;lljz4X4cLCKX=}ZEaIAsyql#p%b0-FL~XN$0GAU95C8xG delta 25 hcmX>#llk~eW|qzXKlhES;+mUfHOrVbPti782mpCb2`vpq? diff --git a/buildroot/docs/website/images/xconfig.png b/buildroot/docs/website/images/xconfig.png index cc42289ed80db6e9161799fbc19c4d10757ecca7..cb99a3a353e62103b811d5669d51da3f16f61def 100644 GIT binary patch delta 39 xcmV+?0NDS|)(z3t4F!o%PDc%~1ghQv4TG-UhpyfMx31m-F&Y64x8L{zZ*pIg5n})V delta 34 scmV+-0Nwx5)(y_q4Fri$PDil?s@{XJ-iNT>0k^Q;0x=r5;`jn@axP*KLjV8( diff --git a/buildroot/docs/website/images/zip.png b/buildroot/docs/website/images/zip.png index ae01c9e7360888c6d7ae94626fd09f9635169b59..02a1dc113416d520761a71d08b5e98dd49850f92 100644 GIT binary patch delta 14 VcmeBonBc(L8Q|y6yOD)k0RSU51ONa4 delta 13 UcmbQ>(C@&~8Q|x>k(FBk03Y51^8f$< diff --git a/buildroot/docs/website/news.html b/buildroot/docs/website/news.html index c14b108d1..b2d097b1d 100644 --- a/buildroot/docs/website/news.html +++ b/buildroot/docs/website/news.html @@ -9,6 +9,46 @@

      News

        +
      • +
        +
        +
        +

        2018.05 released

        +

        1 June 2018

        +
        +
        +

        The stable 2018.05 release is out - Thanks to everyone + contributing and testing the release candidates. See the + CHANGES + file for more details + and go to the downloads page to pick up the + 2018.05 release.

        +
        +
        +
      • + +
      • +
        +
        +
        +

        2018.05-rc3 released

        +

        28 May 2018

        +
        +
        +

        Release candidate 3 is out with more cleanups and security + / build fixes. See + the CHANGES + file for details.

        +

        Head to the downloads page to + pick up + the 2018.05-rc3 + release candidate, and report any problems found to + the mailing list + or bug tracker.

        +
        +
        +
      • +
      • @@ -47,7 +87,7 @@

        Head to the downloads page to pick up the - 2018.05-rc1 + 2018.05-rc1 release candidate, and report any problems found to the mailing list or bug tracker.

        diff --git a/buildroot/fs/common.mk b/buildroot/fs/common.mk index 9baf36772..abf35418c 100644 --- a/buildroot/fs/common.mk +++ b/buildroot/fs/common.mk @@ -71,7 +71,7 @@ $(ROOTFS_COMMON_TAR): $(ROOTFS_COMMON_DEPENDENCIES) target-finalize @$(call MESSAGE,"Generating common rootfs tarball") rm -rf $(FS_DIR) mkdir -p $(FS_DIR) - rsync -au $(BASE_TARGET_DIR)/ $(TARGET_DIR) + rsync -auH $(BASE_TARGET_DIR)/ $(TARGET_DIR) echo '#!/bin/sh' > $(FAKEROOT_SCRIPT) echo "set -e" >> $(FAKEROOT_SCRIPT) echo "chown -h -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT) diff --git a/buildroot/linux/Config.in b/buildroot/linux/Config.in index 29c8c7e4f..58d228668 100644 --- a/buildroot/linux/Config.in +++ b/buildroot/linux/Config.in @@ -8,6 +8,10 @@ config BR2_LINUX_KERNEL if BR2_LINUX_KERNEL +comment "Linux kernel in thumb mode may be broken with binutils >= 2.29" + depends on BR2_arm || BR2_armeb + depends on !BR2_BINUTILS_VERSION_2_28_X + # Packages that need to have a kernel with support for loadable modules, # but do not use the kernel-modules infrastructure, should select that # option. @@ -29,7 +33,7 @@ config BR2_LINUX_KERNEL_LATEST_VERSION bool "Latest version (4.16)" config BR2_LINUX_KERNEL_LATEST_CIP_VERSION - bool "Latest CIP SLTS version (v4.4.112-cip18)" + bool "Latest CIP SLTS version (v4.4.130-cip23)" help CIP launched in the spring of 2016 to address the needs of organizations in industries such as power generation and @@ -116,8 +120,8 @@ endif config BR2_LINUX_KERNEL_VERSION string - default "4.16.10" if BR2_LINUX_KERNEL_LATEST_VERSION - default "v4.4.112-cip18" if BR2_LINUX_KERNEL_LATEST_CIP_VERSION + default "4.16.13" if BR2_LINUX_KERNEL_LATEST_VERSION + default "v4.4.130-cip23" if BR2_LINUX_KERNEL_LATEST_CIP_VERSION default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE \ if BR2_LINUX_KERNEL_CUSTOM_VERSION default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL diff --git a/buildroot/package/autofs/autofs.mk b/buildroot/package/autofs/autofs.mk index 87a218441..e7c65ef4b 100644 --- a/buildroot/package/autofs/autofs.mk +++ b/buildroot/package/autofs/autofs.mk @@ -9,7 +9,7 @@ AUTOFS_SOURCE = autofs-$(AUTOFS_VERSION).tar.xz AUTOFS_SITE = $(BR2_KERNEL_MIRROR)/linux/daemons/autofs/v5 AUTOFS_LICENSE = GPL-2.0+ AUTOFS_LICENSE_FILES = COPYING COPYRIGHT -AUTOFS_DEPENDENCIES = host-flex host-bison host-pkgconf +AUTOFS_DEPENDENCIES = host-flex host-bison host-pkgconf host-nfs-utils # autofs looks on the build machine for the path of modprobe, so tell # it explicitly where it will be located on the target. diff --git a/buildroot/package/bash-completion/0001-completions-Makefile.am-Use-install-data-hook-not-in.patch b/buildroot/package/bash-completion/0001-completions-Makefile.am-Use-install-data-hook-not-in.patch new file mode 100644 index 000000000..4d01eb6ee --- /dev/null +++ b/buildroot/package/bash-completion/0001-completions-Makefile.am-Use-install-data-hook-not-in.patch @@ -0,0 +1,35 @@ +From f9a1dfe7a3d0f35474b3f4ded05e3d97be5017bf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Skytt=C3=A4?= +Date: Fri, 25 May 2018 17:38:59 +0200 +Subject: [PATCH] completions/Makefile.am: Use install-data-hook, not + install-data-local + +-hook is run after the main rule, while -local might end up before. +https://www.gnu.org/software/automake/manual/html_node/Extending.html#index-hook-targets + +Closes #212 + +[backported from ee6b37ad7ff5b309cbb9b886a871252abd9398fa] +Signed-off-by: Romain Naour +--- + completions/Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/completions/Makefile.am b/completions/Makefile.am +index e442a9e..5c49796 100644 +--- a/completions/Makefile.am ++++ b/completions/Makefile.am +@@ -993,8 +993,8 @@ symlinks: $(targetdir) $(DATA) + all-local: targetdir = . + all-local: symlinks + +-install-data-local: targetdir = $(DESTDIR)$(bashcompdir) +-install-data-local: symlinks ++install-data-hook: targetdir = $(DESTDIR)$(bashcompdir) ++install-data-hook: symlinks + + check-local: + ret=0 +-- +2.7.4 + diff --git a/buildroot/package/bash-completion/bash-completion.mk b/buildroot/package/bash-completion/bash-completion.mk index 997691864..c43fb15cd 100644 --- a/buildroot/package/bash-completion/bash-completion.mk +++ b/buildroot/package/bash-completion/bash-completion.mk @@ -10,6 +10,9 @@ BASH_COMPLETION_SOURCE = bash-completion-$(BASH_COMPLETION_VERSION).tar.xz BASH_COMPLETION_LICENSE = GPL-2.0 BASH_COMPLETION_LICENSE_FILES = COPYING +# 0001-completions-Makefile.am-Use-install-data-hook-not-in.patch +BASH_COMPLETION_AUTORECONF = YES + # Install bash-completion.pc file BASH_COMPLETION_INSTALL_STAGING = YES diff --git a/buildroot/package/binutils/Config.in.host b/buildroot/package/binutils/Config.in.host index 22478d917..de229895c 100644 --- a/buildroot/package/binutils/Config.in.host +++ b/buildroot/package/binutils/Config.in.host @@ -2,6 +2,8 @@ comment "Binutils Options" choice prompt "Binutils Version" + default BR2_BINUTILS_VERSION_2_28_X if BR2_ARM_INSTRUCTIONS_THUMB + default BR2_BINUTILS_VERSION_2_28_X if BR2_ARM_INSTRUCTIONS_THUMB2 default BR2_BINUTILS_VERSION_2_29_X if !BR2_arc default BR2_BINUTILS_VERSION_ARC if BR2_arc help @@ -24,7 +26,7 @@ endchoice config BR2_BINUTILS_VERSION string - default "arc-2018.03-rc1" if BR2_BINUTILS_VERSION_ARC + default "arc-2018.03-rc2" if BR2_BINUTILS_VERSION_ARC default "2.28.1" if BR2_BINUTILS_VERSION_2_28_X default "2.29.1" if BR2_BINUTILS_VERSION_2_29_X default "2.30" if BR2_BINUTILS_VERSION_2_30_X diff --git a/buildroot/package/binutils/arc-2018.03-rc1/0002-ld-makefile.patch b/buildroot/package/binutils/arc-2018.03-rc2/0002-ld-makefile.patch similarity index 100% rename from buildroot/package/binutils/arc-2018.03-rc1/0002-ld-makefile.patch rename to buildroot/package/binutils/arc-2018.03-rc2/0002-ld-makefile.patch diff --git a/buildroot/package/binutils/arc-2018.03-rc1/0003-check-ldrunpath-length.patch b/buildroot/package/binutils/arc-2018.03-rc2/0003-check-ldrunpath-length.patch similarity index 100% rename from buildroot/package/binutils/arc-2018.03-rc1/0003-check-ldrunpath-length.patch rename to buildroot/package/binutils/arc-2018.03-rc2/0003-check-ldrunpath-length.patch diff --git a/buildroot/package/binutils/arc-2018.03-rc1/0004-add-sysroot-fix-from-bug-3049.patch b/buildroot/package/binutils/arc-2018.03-rc2/0004-add-sysroot-fix-from-bug-3049.patch similarity index 100% rename from buildroot/package/binutils/arc-2018.03-rc1/0004-add-sysroot-fix-from-bug-3049.patch rename to buildroot/package/binutils/arc-2018.03-rc2/0004-add-sysroot-fix-from-bug-3049.patch diff --git a/buildroot/package/binutils/arc-2018.03-rc1/0005-poison-system-directories.patch b/buildroot/package/binutils/arc-2018.03-rc2/0005-poison-system-directories.patch similarity index 100% rename from buildroot/package/binutils/arc-2018.03-rc1/0005-poison-system-directories.patch rename to buildroot/package/binutils/arc-2018.03-rc2/0005-poison-system-directories.patch diff --git a/buildroot/package/binutils/binutils.hash b/buildroot/package/binutils/binutils.hash index ebe1f2ee2..c93822280 100644 --- a/buildroot/package/binutils/binutils.hash +++ b/buildroot/package/binutils/binutils.hash @@ -4,4 +4,4 @@ sha512 d748d22306477d60d921078804d21943248c23fca0707aac9b016a352c01c75ca69e8262 sha512 e747ea20d8d79fcd21b9d9f6695059caa7189d60f19256da398e34b789fea9a133c32b192e9693b5828d27683739b0198431bf8b3e39fb3b04884cf89d9aa839 binutils-2.30.tar.xz # Locally calculated (fetched from Github) -sha512 7b8c4a5ec38a234b3ca097ce38e0e60628561251085fc83a614c8cf476eec53ca77ab34088987c80ce79772d5e2cc513b28a7df45f3dc5d0d3a82296e1f6474f binutils-arc-2018.03-rc1.tar.gz +sha512 c9d41001bd41d96f1cd78748c1e8df9715aab1158c0a1c9c90a2010e335c357d0d6816202b7fcf7c7d8d4a65e25920b0b35af6a59edd0d29fd9edddd8be95a48 binutils-arc-2018.03-rc2.tar.gz diff --git a/buildroot/package/binutils/binutils.mk b/buildroot/package/binutils/binutils.mk index b24e4334c..1c05958f9 100644 --- a/buildroot/package/binutils/binutils.mk +++ b/buildroot/package/binutils/binutils.mk @@ -9,13 +9,13 @@ BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION)) ifeq ($(BINUTILS_VERSION),) ifeq ($(BR2_arc),y) -BINUTILS_VERSION = arc-2018.03-rc1 +BINUTILS_VERSION = arc-2018.03-rc2 else BINUTILS_VERSION = 2.29.1 endif endif # BINUTILS_VERSION -ifeq ($(BINUTILS_VERSION),arc-2018.03-rc1) +ifeq ($(BINUTILS_VERSION),arc-2018.03-rc2) BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION)) BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz BINUTILS_FROM_GIT = y @@ -132,12 +132,13 @@ endif # Hardlinks between binaries in different directories cause a problem # with rpath fixup, so we de-hardlink those binaries, and replace them -# with symbolic links. +# with copies instead. BINUTILS_TOOLS = ar as ld ld.bfd nm objcopy objdump ranlib readelf strip define HOST_BINUTILS_FIXUP_HARDLINKS $(foreach tool,$(BINUTILS_TOOLS),\ - rm -f $(HOST_DIR)/$(GNU_TARGET_NAME)/bin/$(tool) ; \ - ln -s ../../bin/$(GNU_TARGET_NAME)-$(tool) $(HOST_DIR)/$(GNU_TARGET_NAME)/bin/$(tool) + rm -f $(HOST_DIR)/$(GNU_TARGET_NAME)/bin/$(tool) && \ + cp -a $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-$(tool) \ + $(HOST_DIR)/$(GNU_TARGET_NAME)/bin/$(tool) ) endef HOST_BINUTILS_POST_INSTALL_HOOKS += HOST_BINUTILS_FIXUP_HARDLINKS diff --git a/buildroot/package/boost/Config.in b/buildroot/package/boost/Config.in index 0755d9c01..ec0e19ccb 100644 --- a/buildroot/package/boost/Config.in +++ b/buildroot/package/boost/Config.in @@ -104,12 +104,16 @@ config BR2_PACKAGE_BOOST_FIBER # mips support uses the "pause" instruction, only available # since mips32r2/mips64r2. depends on !BR2_MIPS_CPU_MIPS32 && !BR2_MIPS_CPU_MIPS64 + depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_85180 help C++11 userland threads library. comment "boost-fiber needs a toolchain w/ NPTL" depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL +comment "boost-fiber needs a toolchain not affected by GCC bug 85180" + depends on BR2_TOOLCHAIN_HAS_GCC_BUG_85180 + config BR2_PACKAGE_BOOST_FILESYSTEM bool "boost-filesystem" help diff --git a/buildroot/package/busybox/busybox.hash b/buildroot/package/busybox/busybox.hash index 8537ceb4b..066817aef 100644 --- a/buildroot/package/busybox/busybox.hash +++ b/buildroot/package/busybox/busybox.hash @@ -1,7 +1,7 @@ -# From https://busybox.net/downloads/busybox-1.28.3.tar.bz2.sign -md5 82e5ad09ae4a07c266fc179492b51757 busybox-1.28.3.tar.bz2 -sha1 64b47e83dccc5db7fe4ca596b28c9b901a136fe3 busybox-1.28.3.tar.bz2 +# From https://busybox.net/downloads/busybox-1.28.4.tar.bz2.sign +md5 5661d013c9ef7cc31a453640c320f56b busybox-1.28.4.tar.bz2 +sha1 acd0558a659b795da1dfbd7e0ed5353d6836fa37 busybox-1.28.4.tar.bz2 # Locally calculated -sha256 ad0d22033f23e696f9a71a4c2f9210194dda39b024a79151f4ac278995332a6e busybox-1.28.3.tar.bz2 +sha256 e3c14a3699dc7e82fed397392957afc78e37bdf25398ac38ead6e84621b2ae6a busybox-1.28.4.tar.bz2 sha256 bbfc9843646d483c334664f651c208b9839626891d8f17604db2146962f43548 LICENSE diff --git a/buildroot/package/busybox/busybox.mk b/buildroot/package/busybox/busybox.mk index 60a55a2c7..4ead637d6 100644 --- a/buildroot/package/busybox/busybox.mk +++ b/buildroot/package/busybox/busybox.mk @@ -4,7 +4,7 @@ # ################################################################################ -BUSYBOX_VERSION = 1.28.3 +BUSYBOX_VERSION = 1.28.4 BUSYBOX_SITE = http://www.busybox.net/downloads BUSYBOX_SOURCE = busybox-$(BUSYBOX_VERSION).tar.bz2 BUSYBOX_LICENSE = GPL-2.0 diff --git a/buildroot/package/cjson/cjson.hash b/buildroot/package/cjson/cjson.hash index fd511afe6..278484bdd 100644 --- a/buildroot/package/cjson/cjson.hash +++ b/buildroot/package/cjson/cjson.hash @@ -1,3 +1,3 @@ # Locally computed: -sha256 d1ca2665b34fea164a877637b4ad1624aa23390fe75de91b88e18c5d6ec91978 cjson-v1.7.6.tar.gz +sha256 6eb9d852a97ffbe149e747f54d63e39a674fa248bb24902a14c079803067949a cjson-v1.7.7.tar.gz sha256 a36dda207c36db5818729c54e7ad4e8b0c6fba847491ba64f372c1a2037b6d5c LICENSE diff --git a/buildroot/package/cjson/cjson.mk b/buildroot/package/cjson/cjson.mk index fabfe5df3..e91ce9b4b 100644 --- a/buildroot/package/cjson/cjson.mk +++ b/buildroot/package/cjson/cjson.mk @@ -4,7 +4,7 @@ # ################################################################################ -CJSON_VERSION = v1.7.6 +CJSON_VERSION = v1.7.7 CJSON_SITE = $(call github,DaveGamble,cjson,$(CJSON_VERSION)) CJSON_INSTALL_STAGING = YES CJSON_LICENSE = MIT diff --git a/buildroot/package/clang/clang.mk b/buildroot/package/clang/clang.mk index ae0140c78..dc086c6ee 100644 --- a/buildroot/package/clang/clang.mk +++ b/buildroot/package/clang/clang.mk @@ -89,5 +89,9 @@ HOST_CLANG_POST_INSTALL_HOOKS = HOST_CLANG_INSTALL_CLANG_TBLGEN HOST_CLANG_CONF_OPTS += -DLLVM_LINK_LLVM_DYLIB=ON CLANG_CONF_OPTS += -DLLVM_LINK_LLVM_DYLIB=ON +# Prevent clang binaries from linking against LLVM static libs +HOST_CLANG_CONF_OPTS += -DLLVM_DYLIB_COMPONENTS=all +CLANG_CONF_OPTS += -DLLVM_DYLIB_COMPONENTS=all + $(eval $(cmake-package)) $(eval $(host-cmake-package)) diff --git a/buildroot/package/dash/dash.mk b/buildroot/package/dash/dash.mk index 9a26ebb64..80f0ea8cf 100644 --- a/buildroot/package/dash/dash.mk +++ b/buildroot/package/dash/dash.mk @@ -9,6 +9,9 @@ DASH_SITE = http://gondor.apana.org.au/~herbert/dash/files DASH_LICENSE = BSD-3-Clause, GPL-2.0+ (mksignames.c) DASH_LICENSE_FILES = COPYING +# dash does not build in parallel +DASH_MAKE = $(MAKE1) + ifeq ($(BR2_PACKAGE_LIBEDIT),y) DASH_DEPENDENCIES += libedit host-pkgconf DASH_CONF_OPTS += --with-libedit diff --git a/buildroot/package/elf2flt/elf2flt.mk b/buildroot/package/elf2flt/elf2flt.mk index 995dfedeb..557f94d33 100644 --- a/buildroot/package/elf2flt/elf2flt.mk +++ b/buildroot/package/elf2flt/elf2flt.mk @@ -29,4 +29,20 @@ endif HOST_ELF2FLT_CONF_ENV = LIBS="$(HOST_ELF2FLT_LIBS)" +# Hardlinks between binaries in different directories cause a problem +# with rpath fixup, so we de-hardlink those binaries, and replace them +# with copies instead. Note that elf2flt will rename ld to ld.real +# before installing its own ld, but we already took care of the +# original ld from binutils so that it is already de-hardlinked. So +# ld is now the one from elf2flt, and we want to de-hardlinke it. +ELF2FLT_TOOLS = elf2flt flthdr ld +define HOST_ELF2FLT_FIXUP_HARDLINKS + $(foreach tool,$(ELF2FLT_TOOLS),\ + rm -f $(HOST_DIR)/$(GNU_TARGET_NAME)/bin/$(tool) && \ + cp -a $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-$(tool) \ + $(HOST_DIR)/$(GNU_TARGET_NAME)/bin/$(tool) + ) +endef +HOST_ELF2FLT_POST_INSTALL_HOOKS += HOST_ELF2FLT_FIXUP_HARDLINKS + $(eval $(host-autotools-package)) diff --git a/buildroot/package/expect/expect.hash b/buildroot/package/expect/expect.hash new file mode 100644 index 000000000..c89f32390 --- /dev/null +++ b/buildroot/package/expect/expect.hash @@ -0,0 +1,4 @@ +# From https://sourceforge.net/projects/expect/files/Expect/5.45.3/expect5.45.3.tar.gz.SHA256 +sha256 c520717b7195944a69ce1492ec82ca0ac3f3baf060804e6c5ee6d505ea512be9 expect5.45.3.tar.gz +# Locally calculated +sha256 b2415b17dc8d9a287f4509047ef5ac3436baef7ba7c50faef5222dcdf61a2bab README diff --git a/buildroot/package/expect/expect.mk b/buildroot/package/expect/expect.mk index d78ff6c20..ccde33a71 100644 --- a/buildroot/package/expect/expect.mk +++ b/buildroot/package/expect/expect.mk @@ -4,12 +4,13 @@ # ################################################################################ -# Version 5.45.3 -EXPECT_VERSION = 2014-05-02 -EXPECT_SITE = cvs://expect.cvs.sourceforge.net:/cvsroot/expect +EXPECT_VERSION = 5.45.3 +EXPECT_SITE = https://sourceforge.net/projects/expect/files/Expect/$(EXPECT_VERSION) +EXPECT_SOURCE = expect$(EXPECT_VERSION).tar.gz EXPECT_LICENSE = Public domain EXPECT_LICENSE_FILES = README +# 0001-enable-cross-compilation.patch EXPECT_AUTORECONF = YES EXPECT_DEPENDENCIES = tcl EXPECT_CONF_OPTS = --with-tcl=$(BUILD_DIR)/tcl-$(TCL_VERSION)/unix diff --git a/buildroot/package/fis/0001-checksum.patch b/buildroot/package/fis/0001-checksum.patch index 2d48eb64d..a6325eb01 100644 --- a/buildroot/package/fis/0001-checksum.patch +++ b/buildroot/package/fis/0001-checksum.patch @@ -2,94 +2,94 @@ diff -uN fis.orig/crc.c fis/crc.c --- fis.orig/crc.c 1970-01-01 10:00:00.000000000 +1000 +++ fis/crc.c 2008-04-01 11:39:13.000000000 +1100 @@ -0,0 +1,88 @@ -+/* -+ * crc.c -+ * -+ * $Id: crc.c,v 1.1 2006/02/13 09:58:08 andrzej Exp $ -+ * -+ * Gary S. Brown's CRC -+ * Code based on Gary S. Brown CRC (1986). -+ * Generation polynomial is: -+ * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 -+ * -+ * Copyright (C) 2006 Ekiert sp z o.o. -+ * Author: Andrzej Ekiert -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version -+ * 2 of the License, or (at your option) any later version. -+ */ -+ -+#include -+ -+#include "crc.h" -+ -+static const uint32_t crc32_tab[] = { -+ 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, -+ 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, -+ 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, -+ 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, -+ 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, -+ 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, -+ 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, -+ 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, -+ 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, -+ 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, -+ 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, -+ 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, -+ 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, -+ 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, -+ 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, -+ 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, -+ 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, -+ 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, -+ 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, -+ 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, -+ 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, -+ 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, -+ 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, -+ 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, -+ 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, -+ 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, -+ 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, -+ 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, -+ 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, -+ 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, -+ 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, -+ 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, -+ 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, -+ 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, -+ 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, -+ 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, -+ 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, -+ 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, -+ 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, -+ 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, -+ 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, -+ 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, -+ 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, -+ 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, -+ 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, -+ 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, -+ 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, -+ 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, -+ 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, -+ 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, -+ 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, -+ 0x2d02ef8dL -+ }; -+ -+uint32_t crc32(uint8_t *s, uint32_t len) -+{ -+ uint32_t i, val = 0; -+ -+ for (i = 0; i < len; i++) { -+ val = crc32_tab[(val^s[i]) & 0xff] ^ (val >> 8); -+ } -+ return val; -+} -+ ++/* ++ * crc.c ++ * ++ * $Id: crc.c,v 1.1 2006/02/13 09:58:08 andrzej Exp $ ++ * ++ * Gary S. Brown's CRC ++ * Code based on Gary S. Brown CRC (1986). ++ * Generation polynomial is: ++ * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 ++ * ++ * Copyright (C) 2006 Ekiert sp z o.o. ++ * Author: Andrzej Ekiert ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version ++ * 2 of the License, or (at your option) any later version. ++ */ ++ ++#include ++ ++#include "crc.h" ++ ++static const uint32_t crc32_tab[] = { ++ 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, ++ 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, ++ 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, ++ 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, ++ 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, ++ 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, ++ 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, ++ 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, ++ 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, ++ 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, ++ 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, ++ 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, ++ 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, ++ 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, ++ 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, ++ 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, ++ 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, ++ 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, ++ 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, ++ 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, ++ 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, ++ 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, ++ 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, ++ 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, ++ 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, ++ 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, ++ 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, ++ 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, ++ 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, ++ 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, ++ 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, ++ 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, ++ 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, ++ 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, ++ 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, ++ 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, ++ 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, ++ 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, ++ 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, ++ 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, ++ 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, ++ 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, ++ 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, ++ 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, ++ 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, ++ 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, ++ 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, ++ 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, ++ 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, ++ 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, ++ 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, ++ 0x2d02ef8dL ++ }; ++ ++uint32_t crc32(uint8_t *s, uint32_t len) ++{ ++ uint32_t i, val = 0; ++ ++ for (i = 0; i < len; i++) { ++ val = crc32_tab[(val^s[i]) & 0xff] ^ (val >> 8); ++ } ++ return val; ++} ++ diff -uN fis.orig/crc.h fis/crc.h --- fis.orig/crc.h 1970-01-01 10:00:00.000000000 +1000 +++ fis/crc.h 2008-04-01 11:39:13.000000000 +1100 diff --git a/buildroot/package/flare-engine/Config.in b/buildroot/package/flare-engine/Config.in index cdcb01894..e299a6b7d 100644 --- a/buildroot/package/flare-engine/Config.in +++ b/buildroot/package/flare-engine/Config.in @@ -2,6 +2,7 @@ config BR2_PACKAGE_FLARE_ENGINE bool "flare-engine" depends on BR2_INSTALL_LIBSTDCPP depends on !BR2_STATIC_LIBS # SDL2 + depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_85180 select BR2_PACKAGE_SDL2 select BR2_PACKAGE_SDL2_IMAGE select BR2_PACKAGE_SDL2_MIXER @@ -17,3 +18,6 @@ config BR2_PACKAGE_FLARE_ENGINE comment "flare-engine needs a toolchain w/ C++, dynamic library" depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS + +comment "flare-engine needs a toolchain not affected by GCC bug 85180" + depends on BR2_TOOLCHAIN_HAS_GCC_BUG_85180 diff --git a/buildroot/package/gcc/Config.in.host b/buildroot/package/gcc/Config.in.host index 7c08fb359..00e72db03 100644 --- a/buildroot/package/gcc/Config.in.host +++ b/buildroot/package/gcc/Config.in.host @@ -73,7 +73,7 @@ config BR2_GCC_VERSION default "5.5.0" if BR2_GCC_VERSION_5_X default "6.4.0" if BR2_GCC_VERSION_6_X default "7.3.0" if BR2_GCC_VERSION_7_X - default "arc-2018.03-rc1" if BR2_GCC_VERSION_ARC + default "arc-2018.03-rc2" if BR2_GCC_VERSION_ARC default "or1k-musl-5.4.0-20170218" if BR2_GCC_VERSION_OR1K config BR2_EXTRA_GCC_CONFIG_OPTIONS diff --git a/buildroot/package/gcc/arc-2018.03-rc1/0100-uclibc-conf.patch b/buildroot/package/gcc/arc-2018.03-rc2/0100-uclibc-conf.patch similarity index 100% rename from buildroot/package/gcc/arc-2018.03-rc1/0100-uclibc-conf.patch rename to buildroot/package/gcc/arc-2018.03-rc2/0100-uclibc-conf.patch diff --git a/buildroot/package/gcc/arc-2018.03-rc1/0860-cilk-fix-build-without-wchar.patch b/buildroot/package/gcc/arc-2018.03-rc2/0860-cilk-fix-build-without-wchar.patch similarity index 100% rename from buildroot/package/gcc/arc-2018.03-rc1/0860-cilk-fix-build-without-wchar.patch rename to buildroot/package/gcc/arc-2018.03-rc2/0860-cilk-fix-build-without-wchar.patch diff --git a/buildroot/package/gcc/arc-2018.03-rc1/0900-remove-selftests.patch b/buildroot/package/gcc/arc-2018.03-rc2/0900-remove-selftests.patch similarity index 100% rename from buildroot/package/gcc/arc-2018.03-rc1/0900-remove-selftests.patch rename to buildroot/package/gcc/arc-2018.03-rc2/0900-remove-selftests.patch diff --git a/buildroot/package/gcc/gcc.hash b/buildroot/package/gcc/gcc.hash index d9a651b54..817d04e39 100644 --- a/buildroot/package/gcc/gcc.hash +++ b/buildroot/package/gcc/gcc.hash @@ -8,6 +8,6 @@ sha512 02c60e54527c7adf584798d5251f8a0b80c93d5deafce82501b2c28e6692e0bd783927bb sha512 ad41a7e4584e40e92cdf860bc0288500fbaf5dfb7e8c3fcabe9eba809c87bcfa85b46c19c19921b0cdf6d05483faede8287bb9ea120c0d1559449a70e602c8d4 gcc-7.3.0.tar.xz # Locally calculated (fetched from Github) -sha512 16e5f9d1637be9a099a996074dc43803803497965c1eab6c0057f10d193d30dcc405ad852df82c4f8c61b195195ee797b788ba0b235d7b03e4410806ac5f94bc gcc-arc-2018.03-rc1.tar.gz +sha512 a0faf2bb34f6c72b6460c6432639d89915cfc63456cfdf016896b3ef075655b2e9f26e745d841bbc38e776bc7a3729359cca88f1e4fb83489fa6775a3ccb55b8 gcc-arc-2018.03-rc2.tar.gz # Locally calculated (fetched from Github) sha512 2de7cf47333a4092b02d3bb98f4206f14966f1d139a724d09cf3b22f8a43ae0c704f33e6477d6367a03c29b265480dc900169e9d417006c5d46f0ae446b8c6f1 gcc-or1k-musl-5.4.0-20170218.tar.gz diff --git a/buildroot/package/gdb/Config.in.host b/buildroot/package/gdb/Config.in.host index e8dd09e61..0011966d8 100644 --- a/buildroot/package/gdb/Config.in.host +++ b/buildroot/package/gdb/Config.in.host @@ -74,7 +74,7 @@ endif # If cross-gdb is not enabled, the latest working version is chosen. config BR2_GDB_VERSION string - default "arc-2018.03-rc1-gdb" if BR2_arc + default "arc-2018.03-rc2-gdb" if BR2_arc default "7.10.1" if BR2_GDB_VERSION_7_10 default "7.11.1" if BR2_GDB_VERSION_7_11 || !BR2_PACKAGE_HOST_GDB default "7.12.1" if BR2_GDB_VERSION_7_12 diff --git a/buildroot/package/gdb/gdb.hash b/buildroot/package/gdb/gdb.hash index a2af7b35d..cfbaac40f 100644 --- a/buildroot/package/gdb/gdb.hash +++ b/buildroot/package/gdb/gdb.hash @@ -5,4 +5,4 @@ sha512 0ac8d0a495103611ef41167a08313a010dce6ca4c6d827cbe8558a0c1a1a8a6bfa53f1b7 sha512 5eb328910033f0918058be2f92caebf1e8dfc6caa3c730d99d621627e53de3c1b43761c2f683d53555893253c2f06768cbf56cdea051a3d291ffb6cfae87b5e1 gdb-8.0.1.tar.xz # Locally calculated (fetched from Github) -sha512 975f0e09c9fd3ba1ca6aefdeb2da4b2804802606518c0cfdf7abe07c83a61341c1af5c2d2ddfd55ba6112fed420dedc529bc484d0c25b289bbed05edc99d0e72 gdb-arc-2018.03-rc1-gdb.tar.gz +sha512 0c58dd3e8fff8b51a459aba78f4acd1beaa3427e00a63a7242827f22c6af157e4aea91ab754cdc021e0075a5bf2b70df903dba67dbff2415fd0f82c8aab99087 gdb-arc-2018.03-rc2-gdb.tar.gz diff --git a/buildroot/package/git/git.hash b/buildroot/package/git/git.hash index fea1a1e90..4bcc5ee5d 100644 --- a/buildroot/package/git/git.hash +++ b/buildroot/package/git/git.hash @@ -1,4 +1,4 @@ # From: https://www.kernel.org/pub/software/scm/git/sha256sums.asc -sha256 d65d99e9e5b081c1f14ea018973806e942a2eb7d0da2ebc01bd2525adee62d48 git-2.16.3.tar.xz +sha256 6e69b0e9c487e5da52a14d4829f0b6a28b2c18a0bb6fb67c0dc8b5b5658bd532 git-2.16.4.tar.xz sha256 5b2198d1645f767585e8a88ac0499b04472164c0d2da22e75ecf97ef443ab32e COPYING sha256 1922f45d2c49e390032c9c0ba6d7cac904087f7cec51af30c2b2ad022ce0e76a LGPL-2.1 diff --git a/buildroot/package/git/git.mk b/buildroot/package/git/git.mk index 2115e04e3..ac7b8f2e8 100644 --- a/buildroot/package/git/git.mk +++ b/buildroot/package/git/git.mk @@ -4,7 +4,7 @@ # ################################################################################ -GIT_VERSION = 2.16.3 +GIT_VERSION = 2.16.4 GIT_SOURCE = git-$(GIT_VERSION).tar.xz GIT_SITE = $(BR2_KERNEL_MIRROR)/software/scm/git GIT_LICENSE = GPL-2.0, LGPL-2.1+ diff --git a/buildroot/package/glibc/glibc.hash b/buildroot/package/glibc/glibc.hash index 5a90e612b..1fab3a245 100644 --- a/buildroot/package/glibc/glibc.hash +++ b/buildroot/package/glibc/glibc.hash @@ -1,7 +1,7 @@ # Locally calculated (fetched from Github) -sha256 a74489d14f4017bee6a6c6fe76f1de0dbf7d66c8695116de5aadd141c4757892 glibc-glibc-2.27.tar.gz +sha256 33189b3f10c88730a1f686fac794bc01f31765f12ffd75bc5e8a0f2a690d217a glibc-glibc-2.27-57-g6c99e37f6fb640a50a3113b2dbee5d5389843c1e.tar.gz # Locally calculated (fetched from Github) -sha256 d88f60081285b639122a49425e5fcf8c8cbb0f05efde7a3cb206089fae53c232 glibc-arc-2018.03-rc1.tar.gz +sha256 ddc63360393ab88ab6a4a0c81d33481f34c5a9ebd758eec2e6bb35385058b4cb glibc-arc-2018.03-rc2.tar.gz sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LIB diff --git a/buildroot/package/glibc/glibc.mk b/buildroot/package/glibc/glibc.mk index 3ab673c0c..8e82eaa1e 100644 --- a/buildroot/package/glibc/glibc.mk +++ b/buildroot/package/glibc/glibc.mk @@ -5,12 +5,12 @@ ################################################################################ ifeq ($(BR2_arc),y) -GLIBC_VERSION = arc-2018.03-rc1 +GLIBC_VERSION = arc-2018.03-rc2 GLIBC_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,glibc,$(GLIBC_VERSION)) else # Generate version string using: # git describe --match 'glibc-*' --abbrev=40 origin/release/MAJOR.MINOR/master -GLIBC_VERSION = glibc-2.27 +GLIBC_VERSION = glibc-2.27-57-g6c99e37f6fb640a50a3113b2dbee5d5389843c1e # Upstream doesn't officially provide an https download link. # There is one (https://sourceware.org/git/glibc.git) but it's not reliable, # sometimes the connection times out. So use an unofficial github mirror. diff --git a/buildroot/package/gstreamer/gst-ffmpeg/Config.in b/buildroot/package/gstreamer/gst-ffmpeg/Config.in index 32bfdd53c..1e95d016f 100644 --- a/buildroot/package/gstreamer/gst-ffmpeg/Config.in +++ b/buildroot/package/gstreamer/gst-ffmpeg/Config.in @@ -5,6 +5,7 @@ config BR2_PACKAGE_GST_FFMPEG depends on !BR2_MIPS_CPU_MIPS32R6 && !BR2_MIPS_CPU_MIPS64R6 # triggers https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151 on sh depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 || !BR2_sh + depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_85180 select BR2_PACKAGE_GST_PLUGINS_BASE help GStreamer plugin containing one plugin with a set of @@ -28,3 +29,6 @@ endif comment "gst-ffmpeg needs a toolchain w/ gcc >= 5" depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_5 && BR2_sh + +comment "gst-ffmpeg needs a toolchain not affected by GCC bug 85180" + depends on BR2_TOOLCHAIN_HAS_GCC_BUG_85180 diff --git a/buildroot/package/irrlicht/0001-override-CPPFLAGS-CXXFLAGS-and-CFLAGS-in-Makefile.patch b/buildroot/package/irrlicht/0001-override-CPPFLAGS-CXXFLAGS-and-CFLAGS-in-Makefile.patch index 0bb8fcc0b..d6e4b63fd 100644 --- a/buildroot/package/irrlicht/0001-override-CPPFLAGS-CXXFLAGS-and-CFLAGS-in-Makefile.patch +++ b/buildroot/package/irrlicht/0001-override-CPPFLAGS-CXXFLAGS-and-CFLAGS-in-Makefile.patch @@ -20,25 +20,25 @@ index 0712b07..b334e9c 100644 --- a/source/Irrlicht/Makefile +++ b/source/Irrlicht/Makefile @@ -62,7 +62,7 @@ LINKOBJ = $(IRRMESHOBJ) $(IRROBJ) $(IRRPARTICLEOBJ) $(IRRANIMOBJ) \ - ############### - #Compiler flags - CXXINCS = -I../../include -Izlib -Ijpeglib -Ilibpng --CPPFLAGS += $(CXXINCS) -DIRRLICHT_EXPORTS=1 -+override CPPFLAGS += $(CXXINCS) -DIRRLICHT_EXPORTS=1 - CXXFLAGS += -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing - ifndef NDEBUG - CXXFLAGS += -g -D_DEBUG + ############### + #Compiler flags + CXXINCS = -I../../include -Izlib -Ijpeglib -Ilibpng +-CPPFLAGS += $(CXXINCS) -DIRRLICHT_EXPORTS=1 ++override CPPFLAGS += $(CXXINCS) -DIRRLICHT_EXPORTS=1 + CXXFLAGS += -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing + ifndef NDEBUG + CXXFLAGS += -g -D_DEBUG @@ -74,8 +74,8 @@ CXXFLAGS += -pg - endif - CFLAGS := -O3 -fexpensive-optimizations -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES - --sharedlib sharedlib_osx: CXXFLAGS += -fPIC --sharedlib sharedlib_osx: CFLAGS += -fPIC -+sharedlib sharedlib_osx: override CXXFLAGS += -fPIC -+sharedlib sharedlib_osx: override CFLAGS += -fPIC - - #multilib handling - ifeq ($(HOSTTYPE), x86_64) + endif + CFLAGS := -O3 -fexpensive-optimizations -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES + +-sharedlib sharedlib_osx: CXXFLAGS += -fPIC +-sharedlib sharedlib_osx: CFLAGS += -fPIC ++sharedlib sharedlib_osx: override CXXFLAGS += -fPIC ++sharedlib sharedlib_osx: override CFLAGS += -fPIC + + #multilib handling + ifeq ($(HOSTTYPE), x86_64) -- 2.9.3 diff --git a/buildroot/package/irrlicht/0002-remove-sys-sysctl.h.patch b/buildroot/package/irrlicht/0002-remove-sys-sysctl.h.patch index 2e5fc63e6..d9142a9a2 100644 --- a/buildroot/package/irrlicht/0002-remove-sys-sysctl.h.patch +++ b/buildroot/package/irrlicht/0002-remove-sys-sysctl.h.patch @@ -26,13 +26,13 @@ index 0899d1d..ccf5ef5 100644 --- a/source/Irrlicht/COSOperator.cpp +++ b/source/Irrlicht/COSOperator.cpp @@ -13,7 +13,6 @@ - #include - #ifndef _IRR_SOLARIS_PLATFORM_ - #include --#include - #endif - #endif - + #include + #ifndef _IRR_SOLARIS_PLATFORM_ + #include +-#include + #endif + #endif + -- 2.9.3 diff --git a/buildroot/package/jpeg-turbo/jpeg-turbo.hash b/buildroot/package/jpeg-turbo/jpeg-turbo.hash index 320bbb2a9..11b323b8b 100644 --- a/buildroot/package/jpeg-turbo/jpeg-turbo.hash +++ b/buildroot/package/jpeg-turbo/jpeg-turbo.hash @@ -3,3 +3,5 @@ sha1 e788f6defa58b4393a5e1685c018f3b962971457 libjpeg-turbo-1.5.2.tar.gz md5 6b4923e297a7eaa255f08511017a8818 libjpeg-turbo-1.5.2.tar.gz # Locally computed sha256 9098943b270388727ae61de82adec73cf9f0dbb240b3bc8b172595ebf405b528 libjpeg-turbo-1.5.2.tar.gz +sha256 5c08657eda60b7946a913ee22ac73603335a468a6aa95204506a1586a8d677ee LICENSE.md +sha256 53a3e3c299e08856964f4c5986e242c3695837b73c64625092f70c774e8af5d2 README.ijg diff --git a/buildroot/package/jpeg-turbo/jpeg-turbo.mk b/buildroot/package/jpeg-turbo/jpeg-turbo.mk index bb1278f8b..d52ab916e 100644 --- a/buildroot/package/jpeg-turbo/jpeg-turbo.mk +++ b/buildroot/package/jpeg-turbo/jpeg-turbo.mk @@ -7,8 +7,8 @@ JPEG_TURBO_VERSION = 1.5.2 JPEG_TURBO_SOURCE = libjpeg-turbo-$(JPEG_TURBO_VERSION).tar.gz JPEG_TURBO_SITE = https://downloads.sourceforge.net/project/libjpeg-turbo/$(JPEG_TURBO_VERSION) -JPEG_TURBO_LICENSE = jpeg-license (BSD-3-Clause-like) -JPEG_TURBO_LICENSE_FILES = LICENSE.md +JPEG_TURBO_LICENSE = IJG (libjpeg), BSD-3-Clause (TurboJPEG), Zlib (SIMD) +JPEG_TURBO_LICENSE_FILES = LICENSE.md README.ijg JPEG_TURBO_INSTALL_STAGING = YES JPEG_TURBO_PROVIDES = jpeg JPEG_TURBO_DEPENDENCIES = host-pkgconf diff --git a/buildroot/package/kodi-pvr-stalker/0001-src-CWatchdog.h-Fix-gcc7-build.patch b/buildroot/package/kodi-pvr-stalker/0001-src-CWatchdog.h-Fix-gcc7-build.patch index fb9a80257..2d85f6bc6 100644 --- a/buildroot/package/kodi-pvr-stalker/0001-src-CWatchdog.h-Fix-gcc7-build.patch +++ b/buildroot/package/kodi-pvr-stalker/0001-src-CWatchdog.h-Fix-gcc7-build.patch @@ -20,10 +20,10 @@ index c465e91..239d95d 100644 --- a/src/CWatchdog.h +++ b/src/CWatchdog.h @@ -22,6 +22,7 @@ - */ - - #include -+#include - - #include "SAPI.h" - + */ + + #include ++#include + + #include "SAPI.h" + diff --git a/buildroot/package/libcoap/libcoap.mk b/buildroot/package/libcoap/libcoap.mk index 31a6822dd..4f87886ba 100644 --- a/buildroot/package/libcoap/libcoap.mk +++ b/buildroot/package/libcoap/libcoap.mk @@ -9,6 +9,7 @@ LIBCOAP_SITE = $(call github,obgm,libcoap,$(LIBCOAP_VERSION)) LIBCOAP_INSTALL_STAGING = YES LIBCOAP_LICENSE = GPL-2.0+ or BSD-2-Clause LIBCOAP_LICENSE_FILES = COPYING LICENSE.GPL LICENSE.BSD +LIBCOAP_DEPENDENCIES = host-pkgconf LIBCOAP_CONF_OPTS = --disable-examples LIBCOAP_AUTORECONF = YES diff --git a/buildroot/package/libcurl/0001-Fix-link-with-ssh2-built-with-a-static-mbedtls.patch b/buildroot/package/libcurl/0001-Fix-link-with-ssh2-built-with-a-static-mbedtls.patch new file mode 100644 index 000000000..9107fa7c8 --- /dev/null +++ b/buildroot/package/libcurl/0001-Fix-link-with-ssh2-built-with-a-static-mbedtls.patch @@ -0,0 +1,40 @@ +From b5fbc486e805805efb8400373ccec2a3dee1c81b Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Mon, 21 May 2018 12:07:00 +0200 +Subject: [PATCH 1/1] Fix link with ssh2 built with a static mbedtls + +The ssh2 pkg-config file could contain the following lines when build +with a static version of mbedtls: + Libs: -L${libdir} -lssh2 /xxx/libmbedcrypto.a + Libs.private: /xxx/libmbedcrypto.a + +This static mbedtls library must be used to correctly detect ssh2 +support and this library must be copied in libcurl.pc otherwise +compilation of any application (such as upmpdcli) with libcurl will fail +when trying to found mbedtls functions included in libssh2. +So, replace pkg-config --libs-only-l by pkg-config --libs. + +Fixes: + - http://autobuild.buildroot.net/results/43e24b22a77f616d6198c10435dcc23cc3b9088a + +Signed-off-by: Fabrice Fontaine +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 5569a26b4..9e2606885 100755 +--- a/configure.ac ++++ b/configure.ac +@@ -2766,7 +2766,7 @@ if test X"$OPT_LIBSSH2" != Xno; then + CURL_CHECK_PKGCONFIG(libssh2) + + if test "$PKGCONFIG" != "no" ; then +- LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2` ++ LIB_SSH2=`$PKGCONFIG --libs libssh2` + LD_SSH2=`$PKGCONFIG --libs-only-L libssh2` + CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2` + version=`$PKGCONFIG --modversion libssh2` +-- +2.14.1 + diff --git a/buildroot/package/libcurl/libcurl.mk b/buildroot/package/libcurl/libcurl.mk index fbaeaa897..25d74394c 100644 --- a/buildroot/package/libcurl/libcurl.mk +++ b/buildroot/package/libcurl/libcurl.mk @@ -14,6 +14,8 @@ LIBCURL_DEPENDENCIES = host-pkgconf \ LIBCURL_LICENSE = curl LIBCURL_LICENSE_FILES = COPYING LIBCURL_INSTALL_STAGING = YES +# We're patching configure.ac +LIBCURL_AUTORECONF = YES # We disable NTLM support because it uses fork(), which doesn't work # on non-MMU platforms. Moreover, this authentication method is diff --git a/buildroot/package/libfreeimage/0003-LibWebP-fix-compilation-issue-with-GCC-5.x-C-11.patch b/buildroot/package/libfreeimage/0003-LibWebP-fix-compilation-issue-with-GCC-5.x-C-11.patch index 20c11ea00..6964827cc 100644 --- a/buildroot/package/libfreeimage/0003-LibWebP-fix-compilation-issue-with-GCC-5.x-C-11.patch +++ b/buildroot/package/libfreeimage/0003-LibWebP-fix-compilation-issue-with-GCC-5.x-C-11.patch @@ -35,1138 +35,1138 @@ index dac2c93..aaa8111 100644 --- a/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c +++ b/Source/LibWebP/src/dsp/dsp.dec_mips_dsp_r2.c @@ -548,10 +548,10 @@ static void SimpleVFilter16(uint8_t* p, int stride, int thresh) { - // TEMP3 = SRC[D + D1 * BPS] - #define LOAD_4_BYTES(TEMP0, TEMP1, TEMP2, TEMP3, \ - A, A1, B, B1, C, C1, D, D1, SRC) \ -- "lbu %["#TEMP0"], "#A"+"#A1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ -- "lbu %["#TEMP1"], "#B"+"#B1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ -- "lbu %["#TEMP2"], "#C"+"#C1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ -- "lbu %["#TEMP3"], "#D"+"#D1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ -+ "lbu %[" #TEMP0 "], " #A "+" #A1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ -+ "lbu %[" #TEMP1 "], " #B "+" #B1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ -+ "lbu %[" #TEMP2 "], " #C "+" #C1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ -+ "lbu %[" #TEMP3 "], " #D "+" #D1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ - - static void SimpleHFilter16(uint8_t* p, int stride, int thresh) { - int i; + // TEMP3 = SRC[D + D1 * BPS] + #define LOAD_4_BYTES(TEMP0, TEMP1, TEMP2, TEMP3, \ + A, A1, B, B1, C, C1, D, D1, SRC) \ +- "lbu %["#TEMP0"], "#A"+"#A1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ +- "lbu %["#TEMP1"], "#B"+"#B1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ +- "lbu %["#TEMP2"], "#C"+"#C1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ +- "lbu %["#TEMP3"], "#D"+"#D1"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ ++ "lbu %[" #TEMP0 "], " #A "+" #A1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ ++ "lbu %[" #TEMP1 "], " #B "+" #B1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ ++ "lbu %[" #TEMP2 "], " #C "+" #C1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ ++ "lbu %[" #TEMP3 "], " #D "+" #D1 "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ + + static void SimpleHFilter16(uint8_t* p, int stride, int thresh) { + int i; @@ -623,8 +623,8 @@ static void SimpleHFilter16i(uint8_t* p, int stride, int thresh) { - // DST[A * BPS] = TEMP0 - // DST[B + C * BPS] = TEMP1 - #define STORE_8_BYTES(TEMP0, TEMP1, A, B, C, DST) \ -- "usw %["#TEMP0"], "#A"*"XSTR(BPS)"(%["#DST"]) \n\t" \ -- "usw %["#TEMP1"], "#B"+"#C"*"XSTR(BPS)"(%["#DST"]) \n\t" -+ "usw %[" #TEMP0 "], " #A "*"XSTR(BPS)"(%[" #DST "]) \n\t" \ -+ "usw %[" #TEMP1 "], " #B "+" #C "*"XSTR(BPS)"(%[" #DST "]) \n\t" - - static void VE4(uint8_t* dst) { // vertical - const uint8_t* top = dst - BPS; + // DST[A * BPS] = TEMP0 + // DST[B + C * BPS] = TEMP1 + #define STORE_8_BYTES(TEMP0, TEMP1, A, B, C, DST) \ +- "usw %["#TEMP0"], "#A"*"XSTR(BPS)"(%["#DST"]) \n\t" \ +- "usw %["#TEMP1"], "#B"+"#C"*"XSTR(BPS)"(%["#DST"]) \n\t" ++ "usw %[" #TEMP0 "], " #A "*"XSTR(BPS)"(%[" #DST "]) \n\t" \ ++ "usw %[" #TEMP1 "], " #B "+" #C "*"XSTR(BPS)"(%[" #DST "]) \n\t" + + static void VE4(uint8_t* dst) { // vertical + const uint8_t* top = dst - BPS; @@ -725,8 +725,8 @@ static void RD4(uint8_t* dst) { // Down-right - // TEMP0 = SRC[A * BPS] - // TEMP1 = SRC[B + C * BPS] - #define LOAD_8_BYTES(TEMP0, TEMP1, A, B, C, SRC) \ -- "ulw %["#TEMP0"], "#A"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ -- "ulw %["#TEMP1"], "#B"+"#C"*"XSTR(BPS)"(%["#SRC"]) \n\t" -+ "ulw %[" #TEMP0 "], " #A "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ -+ "ulw %[" #TEMP1 "], " #B "+" #C "*"XSTR(BPS)"(%[" #SRC "]) \n\t" - - static void LD4(uint8_t* dst) { // Down-Left - int temp0, temp1, temp2, temp3, temp4; + // TEMP0 = SRC[A * BPS] + // TEMP1 = SRC[B + C * BPS] + #define LOAD_8_BYTES(TEMP0, TEMP1, A, B, C, SRC) \ +- "ulw %["#TEMP0"], "#A"*"XSTR(BPS)"(%["#SRC"]) \n\t" \ +- "ulw %["#TEMP1"], "#B"+"#C"*"XSTR(BPS)"(%["#SRC"]) \n\t" ++ "ulw %[" #TEMP0 "], " #A "*"XSTR(BPS)"(%[" #SRC "]) \n\t" \ ++ "ulw %[" #TEMP1 "], " #B "+" #C "*"XSTR(BPS)"(%[" #SRC "]) \n\t" + + static void LD4(uint8_t* dst) { // Down-Left + int temp0, temp1, temp2, temp3, temp4; @@ -873,24 +873,24 @@ static void DC8uvNoTop(uint8_t* dst) { // DC with no top samples - #define CLIPPING(SIZE) \ - "preceu.ph.qbl %[temp2], %[temp0] \n\t" \ - "preceu.ph.qbr %[temp0], %[temp0] \n\t" \ --".if "#SIZE" == 8 \n\t" \ -+".if " #SIZE " == 8 \n\t" \ - "preceu.ph.qbl %[temp3], %[temp1] \n\t" \ - "preceu.ph.qbr %[temp1], %[temp1] \n\t" \ - ".endif \n\t" \ - "addu.ph %[temp2], %[temp2], %[dst_1] \n\t" \ - "addu.ph %[temp0], %[temp0], %[dst_1] \n\t" \ --".if "#SIZE" == 8 \n\t" \ -+".if " #SIZE " == 8 \n\t" \ - "addu.ph %[temp3], %[temp3], %[dst_1] \n\t" \ - "addu.ph %[temp1], %[temp1], %[dst_1] \n\t" \ - ".endif \n\t" \ - "shll_s.ph %[temp2], %[temp2], 7 \n\t" \ - "shll_s.ph %[temp0], %[temp0], 7 \n\t" \ --".if "#SIZE" == 8 \n\t" \ -+".if " #SIZE " == 8 \n\t" \ - "shll_s.ph %[temp3], %[temp3], 7 \n\t" \ - "shll_s.ph %[temp1], %[temp1], 7 \n\t" \ - ".endif \n\t" \ - "precrqu_s.qb.ph %[temp0], %[temp2], %[temp0] \n\t" \ --".if "#SIZE" == 8 \n\t" \ -+".if " #SIZE " == 8 \n\t" \ - "precrqu_s.qb.ph %[temp1], %[temp3], %[temp1] \n\t" \ - ".endif \n\t" - + #define CLIPPING(SIZE) \ + "preceu.ph.qbl %[temp2], %[temp0] \n\t" \ + "preceu.ph.qbr %[temp0], %[temp0] \n\t" \ +-".if "#SIZE" == 8 \n\t" \ ++".if " #SIZE " == 8 \n\t" \ + "preceu.ph.qbl %[temp3], %[temp1] \n\t" \ + "preceu.ph.qbr %[temp1], %[temp1] \n\t" \ + ".endif \n\t" \ + "addu.ph %[temp2], %[temp2], %[dst_1] \n\t" \ + "addu.ph %[temp0], %[temp0], %[dst_1] \n\t" \ +-".if "#SIZE" == 8 \n\t" \ ++".if " #SIZE " == 8 \n\t" \ + "addu.ph %[temp3], %[temp3], %[dst_1] \n\t" \ + "addu.ph %[temp1], %[temp1], %[dst_1] \n\t" \ + ".endif \n\t" \ + "shll_s.ph %[temp2], %[temp2], 7 \n\t" \ + "shll_s.ph %[temp0], %[temp0], 7 \n\t" \ +-".if "#SIZE" == 8 \n\t" \ ++".if " #SIZE " == 8 \n\t" \ + "shll_s.ph %[temp3], %[temp3], 7 \n\t" \ + "shll_s.ph %[temp1], %[temp1], 7 \n\t" \ + ".endif \n\t" \ + "precrqu_s.qb.ph %[temp0], %[temp2], %[temp0] \n\t" \ +-".if "#SIZE" == 8 \n\t" \ ++".if " #SIZE " == 8 \n\t" \ + "precrqu_s.qb.ph %[temp1], %[temp3], %[temp1] \n\t" \ + ".endif \n\t" + @@ -899,7 +899,7 @@ static void DC8uvNoTop(uint8_t* dst) { // DC with no top samples - int dst_1 = ((int)(DST)[-1] << 16) + (DST)[-1]; \ - int temp0, temp1, temp2, temp3; \ - __asm__ volatile ( \ -- ".if "#SIZE" < 8 \n\t" \ -+ ".if " #SIZE " < 8 \n\t" \ - "ulw %[temp0], 0(%[top]) \n\t" \ - "subu.ph %[dst_1], %[dst_1], %[top_1] \n\t" \ - CLIPPING(4) \ + int dst_1 = ((int)(DST)[-1] << 16) + (DST)[-1]; \ + int temp0, temp1, temp2, temp3; \ + __asm__ volatile ( \ +- ".if "#SIZE" < 8 \n\t" \ ++ ".if " #SIZE " < 8 \n\t" \ + "ulw %[temp0], 0(%[top]) \n\t" \ + "subu.ph %[dst_1], %[dst_1], %[top_1] \n\t" \ + CLIPPING(4) \ @@ -911,7 +911,7 @@ static void DC8uvNoTop(uint8_t* dst) { // DC with no top samples - CLIPPING(8) \ - "usw %[temp0], 0(%[dst]) \n\t" \ - "usw %[temp1], 4(%[dst]) \n\t" \ -- ".if "#SIZE" == 16 \n\t" \ -+ ".if " #SIZE " == 16 \n\t" \ - "ulw %[temp0], 8(%[top]) \n\t" \ - "ulw %[temp1], 12(%[top]) \n\t" \ - CLIPPING(8) \ + CLIPPING(8) \ + "usw %[temp0], 0(%[dst]) \n\t" \ + "usw %[temp1], 4(%[dst]) \n\t" \ +- ".if "#SIZE" == 16 \n\t" \ ++ ".if " #SIZE " == 16 \n\t" \ + "ulw %[temp0], 8(%[top]) \n\t" \ + "ulw %[temp1], 12(%[top]) \n\t" \ + CLIPPING(8) \ diff --git a/Source/LibWebP/src/dsp/dsp.enc_mips32.c b/Source/LibWebP/src/dsp/dsp.enc_mips32.c index 545aa3a..bf1c16d 100644 --- a/Source/LibWebP/src/dsp/dsp.enc_mips32.c +++ b/Source/LibWebP/src/dsp/dsp.enc_mips32.c @@ -31,26 +31,26 @@ static const int kC2 = 35468; - // TEMP0..TEMP3 - registers for corresponding tmp elements - // TEMP4..TEMP5 - temporary registers - #define VERTICAL_PASS(A, B, C, D, TEMP4, TEMP0, TEMP1, TEMP2, TEMP3) \ -- "lh %[temp16], "#A"(%[temp20]) \n\t" \ -- "lh %[temp18], "#B"(%[temp20]) \n\t" \ -- "lh %[temp17], "#C"(%[temp20]) \n\t" \ -- "lh %[temp19], "#D"(%[temp20]) \n\t" \ -- "addu %["#TEMP4"], %[temp16], %[temp18] \n\t" \ -+ "lh %[temp16], " #A "(%[temp20]) \n\t" \ -+ "lh %[temp18], " #B "(%[temp20]) \n\t" \ -+ "lh %[temp17], " #C "(%[temp20]) \n\t" \ -+ "lh %[temp19], " #D "(%[temp20]) \n\t" \ -+ "addu %[" #TEMP4 "], %[temp16], %[temp18] \n\t" \ - "subu %[temp16], %[temp16], %[temp18] \n\t" \ -- "mul %["#TEMP0"], %[temp17], %[kC2] \n\t" \ -+ "mul %[" #TEMP0 "], %[temp17], %[kC2] \n\t" \ - "mul %[temp18], %[temp19], %[kC1] \n\t" \ - "mul %[temp17], %[temp17], %[kC1] \n\t" \ - "mul %[temp19], %[temp19], %[kC2] \n\t" \ -- "sra %["#TEMP0"], %["#TEMP0"], 16 \n\n" \ -+ "sra %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\n" \ - "sra %[temp18], %[temp18], 16 \n\n" \ - "sra %[temp17], %[temp17], 16 \n\n" \ - "sra %[temp19], %[temp19], 16 \n\n" \ -- "subu %["#TEMP2"], %["#TEMP0"], %[temp18] \n\t" \ -- "addu %["#TEMP3"], %[temp17], %[temp19] \n\t" \ -- "addu %["#TEMP0"], %["#TEMP4"], %["#TEMP3"] \n\t" \ -- "addu %["#TEMP1"], %[temp16], %["#TEMP2"] \n\t" \ -- "subu %["#TEMP2"], %[temp16], %["#TEMP2"] \n\t" \ -- "subu %["#TEMP3"], %["#TEMP4"], %["#TEMP3"] \n\t" -+ "subu %[" #TEMP2 "], %[" #TEMP0 "], %[temp18] \n\t" \ -+ "addu %[" #TEMP3 "], %[temp17], %[temp19] \n\t" \ -+ "addu %[" #TEMP0 "], %[" #TEMP4 "], %[" #TEMP3 "] \n\t" \ -+ "addu %[" #TEMP1 "], %[temp16], %[" #TEMP2 "] \n\t" \ -+ "subu %[" #TEMP2 "], %[temp16], %[" #TEMP2 "] \n\t" \ -+ "subu %[" #TEMP3 "], %[" #TEMP4 "], %[" #TEMP3 "] \n\t" - - // macro for one horizontal pass in ITransformOne - // MUL and STORE macros inlined + // TEMP0..TEMP3 - registers for corresponding tmp elements + // TEMP4..TEMP5 - temporary registers + #define VERTICAL_PASS(A, B, C, D, TEMP4, TEMP0, TEMP1, TEMP2, TEMP3) \ +- "lh %[temp16], "#A"(%[temp20]) \n\t" \ +- "lh %[temp18], "#B"(%[temp20]) \n\t" \ +- "lh %[temp17], "#C"(%[temp20]) \n\t" \ +- "lh %[temp19], "#D"(%[temp20]) \n\t" \ +- "addu %["#TEMP4"], %[temp16], %[temp18] \n\t" \ ++ "lh %[temp16], " #A "(%[temp20]) \n\t" \ ++ "lh %[temp18], " #B "(%[temp20]) \n\t" \ ++ "lh %[temp17], " #C "(%[temp20]) \n\t" \ ++ "lh %[temp19], " #D "(%[temp20]) \n\t" \ ++ "addu %[" #TEMP4 "], %[temp16], %[temp18] \n\t" \ + "subu %[temp16], %[temp16], %[temp18] \n\t" \ +- "mul %["#TEMP0"], %[temp17], %[kC2] \n\t" \ ++ "mul %[" #TEMP0 "], %[temp17], %[kC2] \n\t" \ + "mul %[temp18], %[temp19], %[kC1] \n\t" \ + "mul %[temp17], %[temp17], %[kC1] \n\t" \ + "mul %[temp19], %[temp19], %[kC2] \n\t" \ +- "sra %["#TEMP0"], %["#TEMP0"], 16 \n\n" \ ++ "sra %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\n" \ + "sra %[temp18], %[temp18], 16 \n\n" \ + "sra %[temp17], %[temp17], 16 \n\n" \ + "sra %[temp19], %[temp19], 16 \n\n" \ +- "subu %["#TEMP2"], %["#TEMP0"], %[temp18] \n\t" \ +- "addu %["#TEMP3"], %[temp17], %[temp19] \n\t" \ +- "addu %["#TEMP0"], %["#TEMP4"], %["#TEMP3"] \n\t" \ +- "addu %["#TEMP1"], %[temp16], %["#TEMP2"] \n\t" \ +- "subu %["#TEMP2"], %[temp16], %["#TEMP2"] \n\t" \ +- "subu %["#TEMP3"], %["#TEMP4"], %["#TEMP3"] \n\t" ++ "subu %[" #TEMP2 "], %[" #TEMP0 "], %[temp18] \n\t" \ ++ "addu %[" #TEMP3 "], %[temp17], %[temp19] \n\t" \ ++ "addu %[" #TEMP0 "], %[" #TEMP4 "], %[" #TEMP3 "] \n\t" \ ++ "addu %[" #TEMP1 "], %[temp16], %[" #TEMP2 "] \n\t" \ ++ "subu %[" #TEMP2 "], %[temp16], %[" #TEMP2 "] \n\t" \ ++ "subu %[" #TEMP3 "], %[" #TEMP4 "], %[" #TEMP3 "] \n\t" + + // macro for one horizontal pass in ITransformOne + // MUL and STORE macros inlined @@ -59,58 +59,58 @@ static const int kC2 = 35468; - // A - offset in bytes to load from ref and store to dst buffer - // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements - #define HORIZONTAL_PASS(A, TEMP0, TEMP4, TEMP8, TEMP12) \ -- "addiu %["#TEMP0"], %["#TEMP0"], 4 \n\t" \ -- "addu %[temp16], %["#TEMP0"], %["#TEMP8"] \n\t" \ -- "subu %[temp17], %["#TEMP0"], %["#TEMP8"] \n\t" \ -- "mul %["#TEMP0"], %["#TEMP4"], %[kC2] \n\t" \ -- "mul %["#TEMP8"], %["#TEMP12"], %[kC1] \n\t" \ -- "mul %["#TEMP4"], %["#TEMP4"], %[kC1] \n\t" \ -- "mul %["#TEMP12"], %["#TEMP12"], %[kC2] \n\t" \ -- "sra %["#TEMP0"], %["#TEMP0"], 16 \n\t" \ -- "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \ -- "sra %["#TEMP4"], %["#TEMP4"], 16 \n\t" \ -- "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \ -- "subu %[temp18], %["#TEMP0"], %["#TEMP8"] \n\t" \ -- "addu %[temp19], %["#TEMP4"], %["#TEMP12"] \n\t" \ -- "addu %["#TEMP0"], %[temp16], %[temp19] \n\t" \ -- "addu %["#TEMP4"], %[temp17], %[temp18] \n\t" \ -- "subu %["#TEMP8"], %[temp17], %[temp18] \n\t" \ -- "subu %["#TEMP12"], %[temp16], %[temp19] \n\t" \ -+ "addiu %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \ -+ "addu %[temp16], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \ -+ "subu %[temp17], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \ -+ "mul %[" #TEMP0 "], %[" #TEMP4 "], %[kC2] \n\t" \ -+ "mul %[" #TEMP8 "], %[" #TEMP12 "], %[kC1] \n\t" \ -+ "mul %[" #TEMP4 "], %[" #TEMP4 "], %[kC1] \n\t" \ -+ "mul %[" #TEMP12 "], %[" #TEMP12 "], %[kC2] \n\t" \ -+ "sra %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\t" \ -+ "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \ -+ "sra %[" #TEMP4 "], %[" #TEMP4 "], 16 \n\t" \ -+ "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \ -+ "subu %[temp18], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \ -+ "addu %[temp19], %[" #TEMP4 "], %[" #TEMP12 "] \n\t" \ -+ "addu %[" #TEMP0 "], %[temp16], %[temp19] \n\t" \ -+ "addu %[" #TEMP4 "], %[temp17], %[temp18] \n\t" \ -+ "subu %[" #TEMP8 "], %[temp17], %[temp18] \n\t" \ -+ "subu %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \ - "lw %[temp20], 0(%[args]) \n\t" \ -- "sra %["#TEMP0"], %["#TEMP0"], 3 \n\t" \ -- "sra %["#TEMP4"], %["#TEMP4"], 3 \n\t" \ -- "sra %["#TEMP8"], %["#TEMP8"], 3 \n\t" \ -- "sra %["#TEMP12"], %["#TEMP12"], 3 \n\t" \ -- "lbu %[temp16], 0+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \ -- "lbu %[temp17], 1+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \ -- "lbu %[temp18], 2+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \ -- "lbu %[temp19], 3+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \ -- "addu %["#TEMP0"], %[temp16], %["#TEMP0"] \n\t" \ -- "addu %["#TEMP4"], %[temp17], %["#TEMP4"] \n\t" \ -- "addu %["#TEMP8"], %[temp18], %["#TEMP8"] \n\t" \ -- "addu %["#TEMP12"], %[temp19], %["#TEMP12"] \n\t" \ -- "slt %[temp16], %["#TEMP0"], $zero \n\t" \ -- "slt %[temp17], %["#TEMP4"], $zero \n\t" \ -- "slt %[temp18], %["#TEMP8"], $zero \n\t" \ -- "slt %[temp19], %["#TEMP12"], $zero \n\t" \ -- "movn %["#TEMP0"], $zero, %[temp16] \n\t" \ -- "movn %["#TEMP4"], $zero, %[temp17] \n\t" \ -- "movn %["#TEMP8"], $zero, %[temp18] \n\t" \ -- "movn %["#TEMP12"], $zero, %[temp19] \n\t" \ -+ "sra %[" #TEMP0 "], %[" #TEMP0 "], 3 \n\t" \ -+ "sra %[" #TEMP4 "], %[" #TEMP4 "], 3 \n\t" \ -+ "sra %[" #TEMP8 "], %[" #TEMP8 "], 3 \n\t" \ -+ "sra %[" #TEMP12 "], %[" #TEMP12 "], 3 \n\t" \ -+ "lbu %[temp16], 0+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \ -+ "lbu %[temp17], 1+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \ -+ "lbu %[temp18], 2+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \ -+ "lbu %[temp19], 3+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \ -+ "addu %[" #TEMP0 "], %[temp16], %[" #TEMP0 "] \n\t" \ -+ "addu %[" #TEMP4 "], %[temp17], %[" #TEMP4 "] \n\t" \ -+ "addu %[" #TEMP8 "], %[temp18], %[" #TEMP8 "] \n\t" \ -+ "addu %[" #TEMP12 "], %[temp19], %[" #TEMP12 "] \n\t" \ -+ "slt %[temp16], %[" #TEMP0 "], $zero \n\t" \ -+ "slt %[temp17], %[" #TEMP4 "], $zero \n\t" \ -+ "slt %[temp18], %[" #TEMP8 "], $zero \n\t" \ -+ "slt %[temp19], %[" #TEMP12 "], $zero \n\t" \ -+ "movn %[" #TEMP0 "], $zero, %[temp16] \n\t" \ -+ "movn %[" #TEMP4 "], $zero, %[temp17] \n\t" \ -+ "movn %[" #TEMP8 "], $zero, %[temp18] \n\t" \ -+ "movn %[" #TEMP12 "], $zero, %[temp19] \n\t" \ - "addiu %[temp20], $zero, 255 \n\t" \ -- "slt %[temp16], %["#TEMP0"], %[temp20] \n\t" \ -- "slt %[temp17], %["#TEMP4"], %[temp20] \n\t" \ -- "slt %[temp18], %["#TEMP8"], %[temp20] \n\t" \ -- "slt %[temp19], %["#TEMP12"], %[temp20] \n\t" \ -- "movz %["#TEMP0"], %[temp20], %[temp16] \n\t" \ -- "movz %["#TEMP4"], %[temp20], %[temp17] \n\t" \ -+ "slt %[temp16], %[" #TEMP0 "], %[temp20] \n\t" \ -+ "slt %[temp17], %[" #TEMP4 "], %[temp20] \n\t" \ -+ "slt %[temp18], %[" #TEMP8 "], %[temp20] \n\t" \ -+ "slt %[temp19], %[" #TEMP12 "], %[temp20] \n\t" \ -+ "movz %[" #TEMP0 "], %[temp20], %[temp16] \n\t" \ -+ "movz %[" #TEMP4 "], %[temp20], %[temp17] \n\t" \ - "lw %[temp16], 8(%[args]) \n\t" \ -- "movz %["#TEMP8"], %[temp20], %[temp18] \n\t" \ -- "movz %["#TEMP12"], %[temp20], %[temp19] \n\t" \ -- "sb %["#TEMP0"], 0+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \ -- "sb %["#TEMP4"], 1+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \ -- "sb %["#TEMP8"], 2+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \ -- "sb %["#TEMP12"], 3+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" -+ "movz %[" #TEMP8 "], %[temp20], %[temp18] \n\t" \ -+ "movz %[" #TEMP12 "], %[temp20], %[temp19] \n\t" \ -+ "sb %[" #TEMP0 "], 0+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \ -+ "sb %[" #TEMP4 "], 1+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \ -+ "sb %[" #TEMP8 "], 2+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \ -+ "sb %[" #TEMP12 "], 3+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" - - // Does one or two inverse transforms. - static WEBP_INLINE void ITransformOne(const uint8_t* ref, const int16_t* in, + // A - offset in bytes to load from ref and store to dst buffer + // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements + #define HORIZONTAL_PASS(A, TEMP0, TEMP4, TEMP8, TEMP12) \ +- "addiu %["#TEMP0"], %["#TEMP0"], 4 \n\t" \ +- "addu %[temp16], %["#TEMP0"], %["#TEMP8"] \n\t" \ +- "subu %[temp17], %["#TEMP0"], %["#TEMP8"] \n\t" \ +- "mul %["#TEMP0"], %["#TEMP4"], %[kC2] \n\t" \ +- "mul %["#TEMP8"], %["#TEMP12"], %[kC1] \n\t" \ +- "mul %["#TEMP4"], %["#TEMP4"], %[kC1] \n\t" \ +- "mul %["#TEMP12"], %["#TEMP12"], %[kC2] \n\t" \ +- "sra %["#TEMP0"], %["#TEMP0"], 16 \n\t" \ +- "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \ +- "sra %["#TEMP4"], %["#TEMP4"], 16 \n\t" \ +- "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \ +- "subu %[temp18], %["#TEMP0"], %["#TEMP8"] \n\t" \ +- "addu %[temp19], %["#TEMP4"], %["#TEMP12"] \n\t" \ +- "addu %["#TEMP0"], %[temp16], %[temp19] \n\t" \ +- "addu %["#TEMP4"], %[temp17], %[temp18] \n\t" \ +- "subu %["#TEMP8"], %[temp17], %[temp18] \n\t" \ +- "subu %["#TEMP12"], %[temp16], %[temp19] \n\t" \ ++ "addiu %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \ ++ "addu %[temp16], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \ ++ "subu %[temp17], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \ ++ "mul %[" #TEMP0 "], %[" #TEMP4 "], %[kC2] \n\t" \ ++ "mul %[" #TEMP8 "], %[" #TEMP12 "], %[kC1] \n\t" \ ++ "mul %[" #TEMP4 "], %[" #TEMP4 "], %[kC1] \n\t" \ ++ "mul %[" #TEMP12 "], %[" #TEMP12 "], %[kC2] \n\t" \ ++ "sra %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\t" \ ++ "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \ ++ "sra %[" #TEMP4 "], %[" #TEMP4 "], 16 \n\t" \ ++ "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \ ++ "subu %[temp18], %[" #TEMP0 "], %[" #TEMP8 "] \n\t" \ ++ "addu %[temp19], %[" #TEMP4 "], %[" #TEMP12 "] \n\t" \ ++ "addu %[" #TEMP0 "], %[temp16], %[temp19] \n\t" \ ++ "addu %[" #TEMP4 "], %[temp17], %[temp18] \n\t" \ ++ "subu %[" #TEMP8 "], %[temp17], %[temp18] \n\t" \ ++ "subu %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \ + "lw %[temp20], 0(%[args]) \n\t" \ +- "sra %["#TEMP0"], %["#TEMP0"], 3 \n\t" \ +- "sra %["#TEMP4"], %["#TEMP4"], 3 \n\t" \ +- "sra %["#TEMP8"], %["#TEMP8"], 3 \n\t" \ +- "sra %["#TEMP12"], %["#TEMP12"], 3 \n\t" \ +- "lbu %[temp16], 0+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \ +- "lbu %[temp17], 1+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \ +- "lbu %[temp18], 2+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \ +- "lbu %[temp19], 3+"XSTR(BPS)"*"#A"(%[temp20]) \n\t" \ +- "addu %["#TEMP0"], %[temp16], %["#TEMP0"] \n\t" \ +- "addu %["#TEMP4"], %[temp17], %["#TEMP4"] \n\t" \ +- "addu %["#TEMP8"], %[temp18], %["#TEMP8"] \n\t" \ +- "addu %["#TEMP12"], %[temp19], %["#TEMP12"] \n\t" \ +- "slt %[temp16], %["#TEMP0"], $zero \n\t" \ +- "slt %[temp17], %["#TEMP4"], $zero \n\t" \ +- "slt %[temp18], %["#TEMP8"], $zero \n\t" \ +- "slt %[temp19], %["#TEMP12"], $zero \n\t" \ +- "movn %["#TEMP0"], $zero, %[temp16] \n\t" \ +- "movn %["#TEMP4"], $zero, %[temp17] \n\t" \ +- "movn %["#TEMP8"], $zero, %[temp18] \n\t" \ +- "movn %["#TEMP12"], $zero, %[temp19] \n\t" \ ++ "sra %[" #TEMP0 "], %[" #TEMP0 "], 3 \n\t" \ ++ "sra %[" #TEMP4 "], %[" #TEMP4 "], 3 \n\t" \ ++ "sra %[" #TEMP8 "], %[" #TEMP8 "], 3 \n\t" \ ++ "sra %[" #TEMP12 "], %[" #TEMP12 "], 3 \n\t" \ ++ "lbu %[temp16], 0+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \ ++ "lbu %[temp17], 1+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \ ++ "lbu %[temp18], 2+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \ ++ "lbu %[temp19], 3+"XSTR(BPS)"*" #A "(%[temp20]) \n\t" \ ++ "addu %[" #TEMP0 "], %[temp16], %[" #TEMP0 "] \n\t" \ ++ "addu %[" #TEMP4 "], %[temp17], %[" #TEMP4 "] \n\t" \ ++ "addu %[" #TEMP8 "], %[temp18], %[" #TEMP8 "] \n\t" \ ++ "addu %[" #TEMP12 "], %[temp19], %[" #TEMP12 "] \n\t" \ ++ "slt %[temp16], %[" #TEMP0 "], $zero \n\t" \ ++ "slt %[temp17], %[" #TEMP4 "], $zero \n\t" \ ++ "slt %[temp18], %[" #TEMP8 "], $zero \n\t" \ ++ "slt %[temp19], %[" #TEMP12 "], $zero \n\t" \ ++ "movn %[" #TEMP0 "], $zero, %[temp16] \n\t" \ ++ "movn %[" #TEMP4 "], $zero, %[temp17] \n\t" \ ++ "movn %[" #TEMP8 "], $zero, %[temp18] \n\t" \ ++ "movn %[" #TEMP12 "], $zero, %[temp19] \n\t" \ + "addiu %[temp20], $zero, 255 \n\t" \ +- "slt %[temp16], %["#TEMP0"], %[temp20] \n\t" \ +- "slt %[temp17], %["#TEMP4"], %[temp20] \n\t" \ +- "slt %[temp18], %["#TEMP8"], %[temp20] \n\t" \ +- "slt %[temp19], %["#TEMP12"], %[temp20] \n\t" \ +- "movz %["#TEMP0"], %[temp20], %[temp16] \n\t" \ +- "movz %["#TEMP4"], %[temp20], %[temp17] \n\t" \ ++ "slt %[temp16], %[" #TEMP0 "], %[temp20] \n\t" \ ++ "slt %[temp17], %[" #TEMP4 "], %[temp20] \n\t" \ ++ "slt %[temp18], %[" #TEMP8 "], %[temp20] \n\t" \ ++ "slt %[temp19], %[" #TEMP12 "], %[temp20] \n\t" \ ++ "movz %[" #TEMP0 "], %[temp20], %[temp16] \n\t" \ ++ "movz %[" #TEMP4 "], %[temp20], %[temp17] \n\t" \ + "lw %[temp16], 8(%[args]) \n\t" \ +- "movz %["#TEMP8"], %[temp20], %[temp18] \n\t" \ +- "movz %["#TEMP12"], %[temp20], %[temp19] \n\t" \ +- "sb %["#TEMP0"], 0+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \ +- "sb %["#TEMP4"], 1+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \ +- "sb %["#TEMP8"], 2+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" \ +- "sb %["#TEMP12"], 3+"XSTR(BPS)"*"#A"(%[temp16]) \n\t" ++ "movz %[" #TEMP8 "], %[temp20], %[temp18] \n\t" \ ++ "movz %[" #TEMP12 "], %[temp20], %[temp19] \n\t" \ ++ "sb %[" #TEMP0 "], 0+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \ ++ "sb %[" #TEMP4 "], 1+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \ ++ "sb %[" #TEMP8 "], 2+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" \ ++ "sb %[" #TEMP12 "], 3+"XSTR(BPS)"*" #A "(%[temp16]) \n\t" + + // Does one or two inverse transforms. + static WEBP_INLINE void ITransformOne(const uint8_t* ref, const int16_t* in, @@ -161,9 +161,9 @@ static void ITransform(const uint8_t* ref, const int16_t* in, - // K - offset in bytes (kZigzag[n] * 4) - // N - offset in bytes (n * 2) - #define QUANTIZE_ONE(J, K, N) \ -- "lh %[temp0], "#J"(%[ppin]) \n\t" \ -- "lhu %[temp1], "#J"(%[ppsharpen]) \n\t" \ -- "lw %[temp2], "#K"(%[ppzthresh]) \n\t" \ -+ "lh %[temp0], " #J "(%[ppin]) \n\t" \ -+ "lhu %[temp1], " #J "(%[ppsharpen]) \n\t" \ -+ "lw %[temp2], " #K "(%[ppzthresh]) \n\t" \ - "sra %[sign], %[temp0], 15 \n\t" \ - "xor %[coeff], %[temp0], %[sign] \n\t" \ - "subu %[coeff], %[coeff], %[sign] \n\t" \ + // K - offset in bytes (kZigzag[n] * 4) + // N - offset in bytes (n * 2) + #define QUANTIZE_ONE(J, K, N) \ +- "lh %[temp0], "#J"(%[ppin]) \n\t" \ +- "lhu %[temp1], "#J"(%[ppsharpen]) \n\t" \ +- "lw %[temp2], "#K"(%[ppzthresh]) \n\t" \ ++ "lh %[temp0], " #J "(%[ppin]) \n\t" \ ++ "lhu %[temp1], " #J "(%[ppsharpen]) \n\t" \ ++ "lw %[temp2], " #K "(%[ppzthresh]) \n\t" \ + "sra %[sign], %[temp0], 15 \n\t" \ + "xor %[coeff], %[temp0], %[sign] \n\t" \ + "subu %[coeff], %[coeff], %[sign] \n\t" \ @@ -172,9 +172,9 @@ static void ITransform(const uint8_t* ref, const int16_t* in, - "addiu %[temp5], $zero, 0 \n\t" \ - "addiu %[level], $zero, 0 \n\t" \ - "beqz %[temp4], 2f \n\t" \ -- "lhu %[temp1], "#J"(%[ppiq]) \n\t" \ -- "lw %[temp2], "#K"(%[ppbias]) \n\t" \ -- "lhu %[temp3], "#J"(%[ppq]) \n\t" \ -+ "lhu %[temp1], " #J "(%[ppiq]) \n\t" \ -+ "lw %[temp2], " #K "(%[ppbias]) \n\t" \ -+ "lhu %[temp3], " #J "(%[ppq]) \n\t" \ - "mul %[level], %[coeff], %[temp1] \n\t" \ - "addu %[level], %[level], %[temp2] \n\t" \ - "sra %[level], %[level], 17 \n\t" \ + "addiu %[temp5], $zero, 0 \n\t" \ + "addiu %[level], $zero, 0 \n\t" \ + "beqz %[temp4], 2f \n\t" \ +- "lhu %[temp1], "#J"(%[ppiq]) \n\t" \ +- "lw %[temp2], "#K"(%[ppbias]) \n\t" \ +- "lhu %[temp3], "#J"(%[ppq]) \n\t" \ ++ "lhu %[temp1], " #J "(%[ppiq]) \n\t" \ ++ "lw %[temp2], " #K "(%[ppbias]) \n\t" \ ++ "lhu %[temp3], " #J "(%[ppq]) \n\t" \ + "mul %[level], %[coeff], %[temp1] \n\t" \ + "addu %[level], %[level], %[temp2] \n\t" \ + "sra %[level], %[level], 17 \n\t" \ @@ -184,8 +184,8 @@ static void ITransform(const uint8_t* ref, const int16_t* in, - "subu %[level], %[level], %[sign] \n\t" \ - "mul %[temp5], %[level], %[temp3] \n\t" \ - "2: \n\t" \ -- "sh %[temp5], "#J"(%[ppin]) \n\t" \ -- "sh %[level], "#N"(%[pout]) \n\t" -+ "sh %[temp5], " #J "(%[ppin]) \n\t" \ -+ "sh %[level], " #N "(%[pout]) \n\t" - - static int QuantizeBlock(int16_t in[16], int16_t out[16], - const VP8Matrix* const mtx) { + "subu %[level], %[level], %[sign] \n\t" \ + "mul %[temp5], %[level], %[temp3] \n\t" \ + "2: \n\t" \ +- "sh %[temp5], "#J"(%[ppin]) \n\t" \ +- "sh %[level], "#N"(%[pout]) \n\t" ++ "sh %[temp5], " #J "(%[ppin]) \n\t" \ ++ "sh %[level], " #N "(%[pout]) \n\t" + + static int QuantizeBlock(int16_t in[16], int16_t out[16], + const VP8Matrix* const mtx) { @@ -254,14 +254,14 @@ static int Quantize2Blocks(int16_t in[32], int16_t out[32], - // E..H - offsets in bytes to store first results to tmp buffer - // E1..H1 - offsets in bytes to store second results to tmp buffer - #define HORIZONTAL_PASS(A, E, F, G, H, E1, F1, G1, H1) \ -- "lbu %[temp0], 0+"XSTR(BPS)"*"#A"(%[a]) \n\t" \ -- "lbu %[temp1], 1+"XSTR(BPS)"*"#A"(%[a]) \n\t" \ -- "lbu %[temp2], 2+"XSTR(BPS)"*"#A"(%[a]) \n\t" \ -- "lbu %[temp3], 3+"XSTR(BPS)"*"#A"(%[a]) \n\t" \ -- "lbu %[temp4], 0+"XSTR(BPS)"*"#A"(%[b]) \n\t" \ -- "lbu %[temp5], 1+"XSTR(BPS)"*"#A"(%[b]) \n\t" \ -- "lbu %[temp6], 2+"XSTR(BPS)"*"#A"(%[b]) \n\t" \ -- "lbu %[temp7], 3+"XSTR(BPS)"*"#A"(%[b]) \n\t" \ -+ "lbu %[temp0], 0+"XSTR(BPS)"*" #A "(%[a]) \n\t" \ -+ "lbu %[temp1], 1+"XSTR(BPS)"*" #A "(%[a]) \n\t" \ -+ "lbu %[temp2], 2+"XSTR(BPS)"*" #A "(%[a]) \n\t" \ -+ "lbu %[temp3], 3+"XSTR(BPS)"*" #A "(%[a]) \n\t" \ -+ "lbu %[temp4], 0+"XSTR(BPS)"*" #A "(%[b]) \n\t" \ -+ "lbu %[temp5], 1+"XSTR(BPS)"*" #A "(%[b]) \n\t" \ -+ "lbu %[temp6], 2+"XSTR(BPS)"*" #A "(%[b]) \n\t" \ -+ "lbu %[temp7], 3+"XSTR(BPS)"*" #A "(%[b]) \n\t" \ - "addu %[temp8], %[temp0], %[temp2] \n\t" \ - "subu %[temp0], %[temp0], %[temp2] \n\t" \ - "addu %[temp2], %[temp1], %[temp3] \n\t" \ + // E..H - offsets in bytes to store first results to tmp buffer + // E1..H1 - offsets in bytes to store second results to tmp buffer + #define HORIZONTAL_PASS(A, E, F, G, H, E1, F1, G1, H1) \ +- "lbu %[temp0], 0+"XSTR(BPS)"*"#A"(%[a]) \n\t" \ +- "lbu %[temp1], 1+"XSTR(BPS)"*"#A"(%[a]) \n\t" \ +- "lbu %[temp2], 2+"XSTR(BPS)"*"#A"(%[a]) \n\t" \ +- "lbu %[temp3], 3+"XSTR(BPS)"*"#A"(%[a]) \n\t" \ +- "lbu %[temp4], 0+"XSTR(BPS)"*"#A"(%[b]) \n\t" \ +- "lbu %[temp5], 1+"XSTR(BPS)"*"#A"(%[b]) \n\t" \ +- "lbu %[temp6], 2+"XSTR(BPS)"*"#A"(%[b]) \n\t" \ +- "lbu %[temp7], 3+"XSTR(BPS)"*"#A"(%[b]) \n\t" \ ++ "lbu %[temp0], 0+"XSTR(BPS)"*" #A "(%[a]) \n\t" \ ++ "lbu %[temp1], 1+"XSTR(BPS)"*" #A "(%[a]) \n\t" \ ++ "lbu %[temp2], 2+"XSTR(BPS)"*" #A "(%[a]) \n\t" \ ++ "lbu %[temp3], 3+"XSTR(BPS)"*" #A "(%[a]) \n\t" \ ++ "lbu %[temp4], 0+"XSTR(BPS)"*" #A "(%[b]) \n\t" \ ++ "lbu %[temp5], 1+"XSTR(BPS)"*" #A "(%[b]) \n\t" \ ++ "lbu %[temp6], 2+"XSTR(BPS)"*" #A "(%[b]) \n\t" \ ++ "lbu %[temp7], 3+"XSTR(BPS)"*" #A "(%[b]) \n\t" \ + "addu %[temp8], %[temp0], %[temp2] \n\t" \ + "subu %[temp0], %[temp0], %[temp2] \n\t" \ + "addu %[temp2], %[temp1], %[temp3] \n\t" \ @@ -278,14 +278,14 @@ static int Quantize2Blocks(int16_t in[32], int16_t out[32], - "subu %[temp3], %[temp3], %[temp6] \n\t" \ - "addu %[temp6], %[temp4], %[temp5] \n\t" \ - "subu %[temp4], %[temp4], %[temp5] \n\t" \ -- "sw %[temp7], "#E"(%[tmp]) \n\t" \ -- "sw %[temp2], "#H"(%[tmp]) \n\t" \ -- "sw %[temp8], "#F"(%[tmp]) \n\t" \ -- "sw %[temp0], "#G"(%[tmp]) \n\t" \ -- "sw %[temp1], "#E1"(%[tmp]) \n\t" \ -- "sw %[temp3], "#H1"(%[tmp]) \n\t" \ -- "sw %[temp6], "#F1"(%[tmp]) \n\t" \ -- "sw %[temp4], "#G1"(%[tmp]) \n\t" -+ "sw %[temp7], " #E "(%[tmp]) \n\t" \ -+ "sw %[temp2], " #H "(%[tmp]) \n\t" \ -+ "sw %[temp8], " #F "(%[tmp]) \n\t" \ -+ "sw %[temp0], " #G "(%[tmp]) \n\t" \ -+ "sw %[temp1], " #E1 "(%[tmp]) \n\t" \ -+ "sw %[temp3], " #H1 "(%[tmp]) \n\t" \ -+ "sw %[temp6], " #F1 "(%[tmp]) \n\t" \ -+ "sw %[temp4], " #G1 "(%[tmp]) \n\t" - - // macro for one vertical pass in Disto4x4 (TTransform) - // two calls of function TTransform are merged into single one + "subu %[temp3], %[temp3], %[temp6] \n\t" \ + "addu %[temp6], %[temp4], %[temp5] \n\t" \ + "subu %[temp4], %[temp4], %[temp5] \n\t" \ +- "sw %[temp7], "#E"(%[tmp]) \n\t" \ +- "sw %[temp2], "#H"(%[tmp]) \n\t" \ +- "sw %[temp8], "#F"(%[tmp]) \n\t" \ +- "sw %[temp0], "#G"(%[tmp]) \n\t" \ +- "sw %[temp1], "#E1"(%[tmp]) \n\t" \ +- "sw %[temp3], "#H1"(%[tmp]) \n\t" \ +- "sw %[temp6], "#F1"(%[tmp]) \n\t" \ +- "sw %[temp4], "#G1"(%[tmp]) \n\t" ++ "sw %[temp7], " #E "(%[tmp]) \n\t" \ ++ "sw %[temp2], " #H "(%[tmp]) \n\t" \ ++ "sw %[temp8], " #F "(%[tmp]) \n\t" \ ++ "sw %[temp0], " #G "(%[tmp]) \n\t" \ ++ "sw %[temp1], " #E1 "(%[tmp]) \n\t" \ ++ "sw %[temp3], " #H1 "(%[tmp]) \n\t" \ ++ "sw %[temp6], " #F1 "(%[tmp]) \n\t" \ ++ "sw %[temp4], " #G1 "(%[tmp]) \n\t" + + // macro for one vertical pass in Disto4x4 (TTransform) + // two calls of function TTransform are merged into single one @@ -300,10 +300,10 @@ static int Quantize2Blocks(int16_t in[32], int16_t out[32], - // A1..D1 - offsets in bytes to load second results from tmp buffer - // E..H - offsets in bytes to load from w buffer - #define VERTICAL_PASS(A, B, C, D, A1, B1, C1, D1, E, F, G, H) \ -- "lw %[temp0], "#A1"(%[tmp]) \n\t" \ -- "lw %[temp1], "#C1"(%[tmp]) \n\t" \ -- "lw %[temp2], "#B1"(%[tmp]) \n\t" \ -- "lw %[temp3], "#D1"(%[tmp]) \n\t" \ -+ "lw %[temp0], " #A1 "(%[tmp]) \n\t" \ -+ "lw %[temp1], " #C1 "(%[tmp]) \n\t" \ -+ "lw %[temp2], " #B1 "(%[tmp]) \n\t" \ -+ "lw %[temp3], " #D1 "(%[tmp]) \n\t" \ - "addu %[temp8], %[temp0], %[temp1] \n\t" \ - "subu %[temp0], %[temp0], %[temp1] \n\t" \ - "addu %[temp1], %[temp2], %[temp3] \n\t" \ + // A1..D1 - offsets in bytes to load second results from tmp buffer + // E..H - offsets in bytes to load from w buffer + #define VERTICAL_PASS(A, B, C, D, A1, B1, C1, D1, E, F, G, H) \ +- "lw %[temp0], "#A1"(%[tmp]) \n\t" \ +- "lw %[temp1], "#C1"(%[tmp]) \n\t" \ +- "lw %[temp2], "#B1"(%[tmp]) \n\t" \ +- "lw %[temp3], "#D1"(%[tmp]) \n\t" \ ++ "lw %[temp0], " #A1 "(%[tmp]) \n\t" \ ++ "lw %[temp1], " #C1 "(%[tmp]) \n\t" \ ++ "lw %[temp2], " #B1 "(%[tmp]) \n\t" \ ++ "lw %[temp3], " #D1 "(%[tmp]) \n\t" \ + "addu %[temp8], %[temp0], %[temp1] \n\t" \ + "subu %[temp0], %[temp0], %[temp1] \n\t" \ + "addu %[temp1], %[temp2], %[temp3] \n\t" \ @@ -324,18 +324,18 @@ static int Quantize2Blocks(int16_t in[32], int16_t out[32], - "subu %[temp1], %[temp1], %[temp5] \n\t" \ - "subu %[temp0], %[temp0], %[temp6] \n\t" \ - "subu %[temp8], %[temp8], %[temp7] \n\t" \ -- "lhu %[temp4], "#E"(%[w]) \n\t" \ -- "lhu %[temp5], "#F"(%[w]) \n\t" \ -- "lhu %[temp6], "#G"(%[w]) \n\t" \ -- "lhu %[temp7], "#H"(%[w]) \n\t" \ -+ "lhu %[temp4], " #E "(%[w]) \n\t" \ -+ "lhu %[temp5], " #F "(%[w]) \n\t" \ -+ "lhu %[temp6], " #G "(%[w]) \n\t" \ -+ "lhu %[temp7], " #H "(%[w]) \n\t" \ - "madd %[temp4], %[temp3] \n\t" \ - "madd %[temp5], %[temp1] \n\t" \ - "madd %[temp6], %[temp0] \n\t" \ - "madd %[temp7], %[temp8] \n\t" \ -- "lw %[temp0], "#A"(%[tmp]) \n\t" \ -- "lw %[temp1], "#C"(%[tmp]) \n\t" \ -- "lw %[temp2], "#B"(%[tmp]) \n\t" \ -- "lw %[temp3], "#D"(%[tmp]) \n\t" \ -+ "lw %[temp0], " #A "(%[tmp]) \n\t" \ -+ "lw %[temp1], " #C "(%[tmp]) \n\t" \ -+ "lw %[temp2], " #B "(%[tmp]) \n\t" \ -+ "lw %[temp3], " #D "(%[tmp]) \n\t" \ - "addu %[temp8], %[temp0], %[temp1] \n\t" \ - "subu %[temp0], %[temp0], %[temp1] \n\t" \ - "addu %[temp1], %[temp2], %[temp3] \n\t" \ + "subu %[temp1], %[temp1], %[temp5] \n\t" \ + "subu %[temp0], %[temp0], %[temp6] \n\t" \ + "subu %[temp8], %[temp8], %[temp7] \n\t" \ +- "lhu %[temp4], "#E"(%[w]) \n\t" \ +- "lhu %[temp5], "#F"(%[w]) \n\t" \ +- "lhu %[temp6], "#G"(%[w]) \n\t" \ +- "lhu %[temp7], "#H"(%[w]) \n\t" \ ++ "lhu %[temp4], " #E "(%[w]) \n\t" \ ++ "lhu %[temp5], " #F "(%[w]) \n\t" \ ++ "lhu %[temp6], " #G "(%[w]) \n\t" \ ++ "lhu %[temp7], " #H "(%[w]) \n\t" \ + "madd %[temp4], %[temp3] \n\t" \ + "madd %[temp5], %[temp1] \n\t" \ + "madd %[temp6], %[temp0] \n\t" \ + "madd %[temp7], %[temp8] \n\t" \ +- "lw %[temp0], "#A"(%[tmp]) \n\t" \ +- "lw %[temp1], "#C"(%[tmp]) \n\t" \ +- "lw %[temp2], "#B"(%[tmp]) \n\t" \ +- "lw %[temp3], "#D"(%[tmp]) \n\t" \ ++ "lw %[temp0], " #A "(%[tmp]) \n\t" \ ++ "lw %[temp1], " #C "(%[tmp]) \n\t" \ ++ "lw %[temp2], " #B "(%[tmp]) \n\t" \ ++ "lw %[temp3], " #D "(%[tmp]) \n\t" \ + "addu %[temp8], %[temp0], %[temp1] \n\t" \ + "subu %[temp0], %[temp0], %[temp1] \n\t" \ + "addu %[temp1], %[temp2], %[temp3] \n\t" \ @@ -413,70 +413,70 @@ static int Disto16x16(const uint8_t* const a, const uint8_t* const b, - // A - offset in bytes to load from src and ref buffers - // TEMP0..TEMP3 - registers for corresponding tmp elements - #define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \ -- "lw %["#TEMP1"], 0(%[args]) \n\t" \ -- "lw %["#TEMP2"], 4(%[args]) \n\t" \ -- "lbu %[temp16], 0+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ -- "lbu %[temp17], 0+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \ -- "lbu %[temp18], 1+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ -- "lbu %[temp19], 1+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \ -+ "lw %[" #TEMP1 "], 0(%[args]) \n\t" \ -+ "lw %[" #TEMP2 "], 4(%[args]) \n\t" \ -+ "lbu %[temp16], 0+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ -+ "lbu %[temp17], 0+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \ -+ "lbu %[temp18], 1+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ -+ "lbu %[temp19], 1+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \ - "subu %[temp20], %[temp16], %[temp17] \n\t" \ -- "lbu %[temp16], 2+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ -- "lbu %[temp17], 2+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \ -- "subu %["#TEMP0"], %[temp18], %[temp19] \n\t" \ -- "lbu %[temp18], 3+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ -- "lbu %[temp19], 3+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \ -- "subu %["#TEMP1"], %[temp16], %[temp17] \n\t" \ -- "subu %["#TEMP2"], %[temp18], %[temp19] \n\t" \ -- "addu %["#TEMP3"], %[temp20], %["#TEMP2"] \n\t" \ -- "subu %["#TEMP2"], %[temp20], %["#TEMP2"] \n\t" \ -- "addu %[temp20], %["#TEMP0"], %["#TEMP1"] \n\t" \ -- "subu %["#TEMP0"], %["#TEMP0"], %["#TEMP1"] \n\t" \ -- "mul %[temp16], %["#TEMP2"], %[c5352] \n\t" \ -- "mul %[temp17], %["#TEMP2"], %[c2217] \n\t" \ -- "mul %[temp18], %["#TEMP0"], %[c5352] \n\t" \ -- "mul %[temp19], %["#TEMP0"], %[c2217] \n\t" \ -- "addu %["#TEMP1"], %["#TEMP3"], %[temp20] \n\t" \ -- "subu %[temp20], %["#TEMP3"], %[temp20] \n\t" \ -- "sll %["#TEMP0"], %["#TEMP1"], 3 \n\t" \ -- "sll %["#TEMP2"], %[temp20], 3 \n\t" \ -+ "lbu %[temp16], 2+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ -+ "lbu %[temp17], 2+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \ -+ "subu %[" #TEMP0 "], %[temp18], %[temp19] \n\t" \ -+ "lbu %[temp18], 3+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ -+ "lbu %[temp19], 3+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \ -+ "subu %[" #TEMP1 "], %[temp16], %[temp17] \n\t" \ -+ "subu %[" #TEMP2 "], %[temp18], %[temp19] \n\t" \ -+ "addu %[" #TEMP3 "], %[temp20], %[" #TEMP2 "] \n\t" \ -+ "subu %[" #TEMP2 "], %[temp20], %[" #TEMP2 "] \n\t" \ -+ "addu %[temp20], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \ -+ "subu %[" #TEMP0 "], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \ -+ "mul %[temp16], %[" #TEMP2 "], %[c5352] \n\t" \ -+ "mul %[temp17], %[" #TEMP2 "], %[c2217] \n\t" \ -+ "mul %[temp18], %[" #TEMP0 "], %[c5352] \n\t" \ -+ "mul %[temp19], %[" #TEMP0 "], %[c2217] \n\t" \ -+ "addu %[" #TEMP1 "], %[" #TEMP3 "], %[temp20] \n\t" \ -+ "subu %[temp20], %[" #TEMP3 "], %[temp20] \n\t" \ -+ "sll %[" #TEMP0 "], %[" #TEMP1 "], 3 \n\t" \ -+ "sll %[" #TEMP2 "], %[temp20], 3 \n\t" \ - "addiu %[temp16], %[temp16], 1812 \n\t" \ - "addiu %[temp17], %[temp17], 937 \n\t" \ - "addu %[temp16], %[temp16], %[temp19] \n\t" \ - "subu %[temp17], %[temp17], %[temp18] \n\t" \ -- "sra %["#TEMP1"], %[temp16], 9 \n\t" \ -- "sra %["#TEMP3"], %[temp17], 9 \n\t" -+ "sra %[" #TEMP1 "], %[temp16], 9 \n\t" \ -+ "sra %[" #TEMP3 "], %[temp17], 9 \n\t" - - // macro for one vertical pass in FTransform - // temp0..temp15 holds tmp[0]..tmp[15] - // A..D - offsets in bytes to store to out buffer - // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements - #define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \ -- "addu %[temp16], %["#TEMP0"], %["#TEMP12"] \n\t" \ -- "subu %[temp19], %["#TEMP0"], %["#TEMP12"] \n\t" \ -- "addu %[temp17], %["#TEMP4"], %["#TEMP8"] \n\t" \ -- "subu %[temp18], %["#TEMP4"], %["#TEMP8"] \n\t" \ -- "mul %["#TEMP8"], %[temp19], %[c2217] \n\t" \ -- "mul %["#TEMP12"], %[temp18], %[c2217] \n\t" \ -- "mul %["#TEMP4"], %[temp19], %[c5352] \n\t" \ -+ "addu %[temp16], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \ -+ "subu %[temp19], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \ -+ "addu %[temp17], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \ -+ "subu %[temp18], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \ -+ "mul %[" #TEMP8 "], %[temp19], %[c2217] \n\t" \ -+ "mul %[" #TEMP12 "], %[temp18], %[c2217] \n\t" \ -+ "mul %[" #TEMP4 "], %[temp19], %[c5352] \n\t" \ - "mul %[temp18], %[temp18], %[c5352] \n\t" \ - "addiu %[temp16], %[temp16], 7 \n\t" \ -- "addu %["#TEMP0"], %[temp16], %[temp17] \n\t" \ -- "sra %["#TEMP0"], %["#TEMP0"], 4 \n\t" \ -- "addu %["#TEMP12"], %["#TEMP12"], %["#TEMP4"] \n\t" \ -- "subu %["#TEMP4"], %[temp16], %[temp17] \n\t" \ -- "sra %["#TEMP4"], %["#TEMP4"], 4 \n\t" \ -- "addiu %["#TEMP8"], %["#TEMP8"], 30000 \n\t" \ -- "addiu %["#TEMP12"], %["#TEMP12"], 12000 \n\t" \ -- "addiu %["#TEMP8"], %["#TEMP8"], 21000 \n\t" \ -- "subu %["#TEMP8"], %["#TEMP8"], %[temp18] \n\t" \ -- "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \ -- "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \ -- "addiu %[temp16], %["#TEMP12"], 1 \n\t" \ -- "movn %["#TEMP12"], %[temp16], %[temp19] \n\t" \ -- "sh %["#TEMP0"], "#A"(%[temp20]) \n\t" \ -- "sh %["#TEMP4"], "#C"(%[temp20]) \n\t" \ -- "sh %["#TEMP8"], "#D"(%[temp20]) \n\t" \ -- "sh %["#TEMP12"], "#B"(%[temp20]) \n\t" -+ "addu %[" #TEMP0 "], %[temp16], %[temp17] \n\t" \ -+ "sra %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \ -+ "addu %[" #TEMP12 "], %[" #TEMP12 "], %[" #TEMP4 "] \n\t" \ -+ "subu %[" #TEMP4 "], %[temp16], %[temp17] \n\t" \ -+ "sra %[" #TEMP4 "], %[" #TEMP4 "], 4 \n\t" \ -+ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 30000 \n\t" \ -+ "addiu %[" #TEMP12 "], %[" #TEMP12 "], 12000 \n\t" \ -+ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 21000 \n\t" \ -+ "subu %[" #TEMP8 "], %[" #TEMP8 "], %[temp18] \n\t" \ -+ "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \ -+ "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \ -+ "addiu %[temp16], %[" #TEMP12 "], 1 \n\t" \ -+ "movn %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \ -+ "sh %[" #TEMP0 "], " #A "(%[temp20]) \n\t" \ -+ "sh %[" #TEMP4 "], " #C "(%[temp20]) \n\t" \ -+ "sh %[" #TEMP8 "], " #D "(%[temp20]) \n\t" \ -+ "sh %[" #TEMP12 "], " #B "(%[temp20]) \n\t" - - static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) { - int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8; + // A - offset in bytes to load from src and ref buffers + // TEMP0..TEMP3 - registers for corresponding tmp elements + #define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \ +- "lw %["#TEMP1"], 0(%[args]) \n\t" \ +- "lw %["#TEMP2"], 4(%[args]) \n\t" \ +- "lbu %[temp16], 0+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ +- "lbu %[temp17], 0+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \ +- "lbu %[temp18], 1+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ +- "lbu %[temp19], 1+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \ ++ "lw %[" #TEMP1 "], 0(%[args]) \n\t" \ ++ "lw %[" #TEMP2 "], 4(%[args]) \n\t" \ ++ "lbu %[temp16], 0+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ ++ "lbu %[temp17], 0+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \ ++ "lbu %[temp18], 1+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ ++ "lbu %[temp19], 1+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \ + "subu %[temp20], %[temp16], %[temp17] \n\t" \ +- "lbu %[temp16], 2+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ +- "lbu %[temp17], 2+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \ +- "subu %["#TEMP0"], %[temp18], %[temp19] \n\t" \ +- "lbu %[temp18], 3+"XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ +- "lbu %[temp19], 3+"XSTR(BPS)"*"#A"(%["#TEMP2"]) \n\t" \ +- "subu %["#TEMP1"], %[temp16], %[temp17] \n\t" \ +- "subu %["#TEMP2"], %[temp18], %[temp19] \n\t" \ +- "addu %["#TEMP3"], %[temp20], %["#TEMP2"] \n\t" \ +- "subu %["#TEMP2"], %[temp20], %["#TEMP2"] \n\t" \ +- "addu %[temp20], %["#TEMP0"], %["#TEMP1"] \n\t" \ +- "subu %["#TEMP0"], %["#TEMP0"], %["#TEMP1"] \n\t" \ +- "mul %[temp16], %["#TEMP2"], %[c5352] \n\t" \ +- "mul %[temp17], %["#TEMP2"], %[c2217] \n\t" \ +- "mul %[temp18], %["#TEMP0"], %[c5352] \n\t" \ +- "mul %[temp19], %["#TEMP0"], %[c2217] \n\t" \ +- "addu %["#TEMP1"], %["#TEMP3"], %[temp20] \n\t" \ +- "subu %[temp20], %["#TEMP3"], %[temp20] \n\t" \ +- "sll %["#TEMP0"], %["#TEMP1"], 3 \n\t" \ +- "sll %["#TEMP2"], %[temp20], 3 \n\t" \ ++ "lbu %[temp16], 2+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ ++ "lbu %[temp17], 2+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \ ++ "subu %[" #TEMP0 "], %[temp18], %[temp19] \n\t" \ ++ "lbu %[temp18], 3+"XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ ++ "lbu %[temp19], 3+"XSTR(BPS)"*" #A "(%[" #TEMP2 "]) \n\t" \ ++ "subu %[" #TEMP1 "], %[temp16], %[temp17] \n\t" \ ++ "subu %[" #TEMP2 "], %[temp18], %[temp19] \n\t" \ ++ "addu %[" #TEMP3 "], %[temp20], %[" #TEMP2 "] \n\t" \ ++ "subu %[" #TEMP2 "], %[temp20], %[" #TEMP2 "] \n\t" \ ++ "addu %[temp20], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \ ++ "subu %[" #TEMP0 "], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \ ++ "mul %[temp16], %[" #TEMP2 "], %[c5352] \n\t" \ ++ "mul %[temp17], %[" #TEMP2 "], %[c2217] \n\t" \ ++ "mul %[temp18], %[" #TEMP0 "], %[c5352] \n\t" \ ++ "mul %[temp19], %[" #TEMP0 "], %[c2217] \n\t" \ ++ "addu %[" #TEMP1 "], %[" #TEMP3 "], %[temp20] \n\t" \ ++ "subu %[temp20], %[" #TEMP3 "], %[temp20] \n\t" \ ++ "sll %[" #TEMP0 "], %[" #TEMP1 "], 3 \n\t" \ ++ "sll %[" #TEMP2 "], %[temp20], 3 \n\t" \ + "addiu %[temp16], %[temp16], 1812 \n\t" \ + "addiu %[temp17], %[temp17], 937 \n\t" \ + "addu %[temp16], %[temp16], %[temp19] \n\t" \ + "subu %[temp17], %[temp17], %[temp18] \n\t" \ +- "sra %["#TEMP1"], %[temp16], 9 \n\t" \ +- "sra %["#TEMP3"], %[temp17], 9 \n\t" ++ "sra %[" #TEMP1 "], %[temp16], 9 \n\t" \ ++ "sra %[" #TEMP3 "], %[temp17], 9 \n\t" + + // macro for one vertical pass in FTransform + // temp0..temp15 holds tmp[0]..tmp[15] + // A..D - offsets in bytes to store to out buffer + // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements + #define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \ +- "addu %[temp16], %["#TEMP0"], %["#TEMP12"] \n\t" \ +- "subu %[temp19], %["#TEMP0"], %["#TEMP12"] \n\t" \ +- "addu %[temp17], %["#TEMP4"], %["#TEMP8"] \n\t" \ +- "subu %[temp18], %["#TEMP4"], %["#TEMP8"] \n\t" \ +- "mul %["#TEMP8"], %[temp19], %[c2217] \n\t" \ +- "mul %["#TEMP12"], %[temp18], %[c2217] \n\t" \ +- "mul %["#TEMP4"], %[temp19], %[c5352] \n\t" \ ++ "addu %[temp16], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \ ++ "subu %[temp19], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \ ++ "addu %[temp17], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \ ++ "subu %[temp18], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \ ++ "mul %[" #TEMP8 "], %[temp19], %[c2217] \n\t" \ ++ "mul %[" #TEMP12 "], %[temp18], %[c2217] \n\t" \ ++ "mul %[" #TEMP4 "], %[temp19], %[c5352] \n\t" \ + "mul %[temp18], %[temp18], %[c5352] \n\t" \ + "addiu %[temp16], %[temp16], 7 \n\t" \ +- "addu %["#TEMP0"], %[temp16], %[temp17] \n\t" \ +- "sra %["#TEMP0"], %["#TEMP0"], 4 \n\t" \ +- "addu %["#TEMP12"], %["#TEMP12"], %["#TEMP4"] \n\t" \ +- "subu %["#TEMP4"], %[temp16], %[temp17] \n\t" \ +- "sra %["#TEMP4"], %["#TEMP4"], 4 \n\t" \ +- "addiu %["#TEMP8"], %["#TEMP8"], 30000 \n\t" \ +- "addiu %["#TEMP12"], %["#TEMP12"], 12000 \n\t" \ +- "addiu %["#TEMP8"], %["#TEMP8"], 21000 \n\t" \ +- "subu %["#TEMP8"], %["#TEMP8"], %[temp18] \n\t" \ +- "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \ +- "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \ +- "addiu %[temp16], %["#TEMP12"], 1 \n\t" \ +- "movn %["#TEMP12"], %[temp16], %[temp19] \n\t" \ +- "sh %["#TEMP0"], "#A"(%[temp20]) \n\t" \ +- "sh %["#TEMP4"], "#C"(%[temp20]) \n\t" \ +- "sh %["#TEMP8"], "#D"(%[temp20]) \n\t" \ +- "sh %["#TEMP12"], "#B"(%[temp20]) \n\t" ++ "addu %[" #TEMP0 "], %[temp16], %[temp17] \n\t" \ ++ "sra %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \ ++ "addu %[" #TEMP12 "], %[" #TEMP12 "], %[" #TEMP4 "] \n\t" \ ++ "subu %[" #TEMP4 "], %[temp16], %[temp17] \n\t" \ ++ "sra %[" #TEMP4 "], %[" #TEMP4 "], 4 \n\t" \ ++ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 30000 \n\t" \ ++ "addiu %[" #TEMP12 "], %[" #TEMP12 "], 12000 \n\t" \ ++ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 21000 \n\t" \ ++ "subu %[" #TEMP8 "], %[" #TEMP8 "], %[temp18] \n\t" \ ++ "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \ ++ "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \ ++ "addiu %[temp16], %[" #TEMP12 "], 1 \n\t" \ ++ "movn %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \ ++ "sh %[" #TEMP0 "], " #A "(%[temp20]) \n\t" \ ++ "sh %[" #TEMP4 "], " #C "(%[temp20]) \n\t" \ ++ "sh %[" #TEMP8 "], " #D "(%[temp20]) \n\t" \ ++ "sh %[" #TEMP12 "], " #B "(%[temp20]) \n\t" + + static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) { + int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8; @@ -516,14 +516,14 @@ static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) { - #if !defined(WORK_AROUND_GCC) - - #define GET_SSE_INNER(A, B, C, D) \ -- "lbu %[temp0], "#A"(%[a]) \n\t" \ -- "lbu %[temp1], "#A"(%[b]) \n\t" \ -- "lbu %[temp2], "#B"(%[a]) \n\t" \ -- "lbu %[temp3], "#B"(%[b]) \n\t" \ -- "lbu %[temp4], "#C"(%[a]) \n\t" \ -- "lbu %[temp5], "#C"(%[b]) \n\t" \ -- "lbu %[temp6], "#D"(%[a]) \n\t" \ -- "lbu %[temp7], "#D"(%[b]) \n\t" \ -+ "lbu %[temp0], " #A "(%[a]) \n\t" \ -+ "lbu %[temp1], " #A "(%[b]) \n\t" \ -+ "lbu %[temp2], " #B "(%[a]) \n\t" \ -+ "lbu %[temp3], " #B "(%[b]) \n\t" \ -+ "lbu %[temp4], " #C "(%[a]) \n\t" \ -+ "lbu %[temp5], " #C "(%[b]) \n\t" \ -+ "lbu %[temp6], " #D "(%[a]) \n\t" \ -+ "lbu %[temp7], " #D "(%[b]) \n\t" \ - "subu %[temp0], %[temp0], %[temp1] \n\t" \ - "subu %[temp2], %[temp2], %[temp3] \n\t" \ - "subu %[temp4], %[temp4], %[temp5] \n\t" \ + #if !defined(WORK_AROUND_GCC) + + #define GET_SSE_INNER(A, B, C, D) \ +- "lbu %[temp0], "#A"(%[a]) \n\t" \ +- "lbu %[temp1], "#A"(%[b]) \n\t" \ +- "lbu %[temp2], "#B"(%[a]) \n\t" \ +- "lbu %[temp3], "#B"(%[b]) \n\t" \ +- "lbu %[temp4], "#C"(%[a]) \n\t" \ +- "lbu %[temp5], "#C"(%[b]) \n\t" \ +- "lbu %[temp6], "#D"(%[a]) \n\t" \ +- "lbu %[temp7], "#D"(%[b]) \n\t" \ ++ "lbu %[temp0], " #A "(%[a]) \n\t" \ ++ "lbu %[temp1], " #A "(%[b]) \n\t" \ ++ "lbu %[temp2], " #B "(%[a]) \n\t" \ ++ "lbu %[temp3], " #B "(%[b]) \n\t" \ ++ "lbu %[temp4], " #C "(%[a]) \n\t" \ ++ "lbu %[temp5], " #C "(%[b]) \n\t" \ ++ "lbu %[temp6], " #D "(%[a]) \n\t" \ ++ "lbu %[temp7], " #D "(%[b]) \n\t" \ + "subu %[temp0], %[temp0], %[temp1] \n\t" \ + "subu %[temp2], %[temp2], %[temp3] \n\t" \ + "subu %[temp4], %[temp4], %[temp5] \n\t" \ diff --git a/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c index ec58efe..1a3f968 100644 --- a/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c +++ b/Source/LibWebP/src/dsp/dsp.enc_mips_dsp_r2.c @@ -27,25 +27,25 @@ static const int kC2 = 35468; - // I - input (macro doesn't change it) - #define ADD_SUB_HALVES_X4(O0, O1, O2, O3, O4, O5, O6, O7, \ - I0, I1, I2, I3, I4, I5, I6, I7) \ -- "addq.ph %["#O0"], %["#I0"], %["#I1"] \n\t" \ -- "subq.ph %["#O1"], %["#I0"], %["#I1"] \n\t" \ -- "addq.ph %["#O2"], %["#I2"], %["#I3"] \n\t" \ -- "subq.ph %["#O3"], %["#I2"], %["#I3"] \n\t" \ -- "addq.ph %["#O4"], %["#I4"], %["#I5"] \n\t" \ -- "subq.ph %["#O5"], %["#I4"], %["#I5"] \n\t" \ -- "addq.ph %["#O6"], %["#I6"], %["#I7"] \n\t" \ -- "subq.ph %["#O7"], %["#I6"], %["#I7"] \n\t" -+ "addq.ph %[" #O0 "], %[" #I0 "], %[" #I1 "] \n\t" \ -+ "subq.ph %[" #O1 "], %[" #I0 "], %[" #I1 "] \n\t" \ -+ "addq.ph %[" #O2 "], %[" #I2 "], %[" #I3 "] \n\t" \ -+ "subq.ph %[" #O3 "], %[" #I2 "], %[" #I3 "] \n\t" \ -+ "addq.ph %[" #O4 "], %[" #I4 "], %[" #I5 "] \n\t" \ -+ "subq.ph %[" #O5 "], %[" #I4 "], %[" #I5 "] \n\t" \ -+ "addq.ph %[" #O6 "], %[" #I6 "], %[" #I7 "] \n\t" \ -+ "subq.ph %[" #O7 "], %[" #I6 "], %[" #I7 "] \n\t" - - // IO - input/output - #define ABS_X8(IO0, IO1, IO2, IO3, IO4, IO5, IO6, IO7) \ -- "absq_s.ph %["#IO0"], %["#IO0"] \n\t" \ -- "absq_s.ph %["#IO1"], %["#IO1"] \n\t" \ -- "absq_s.ph %["#IO2"], %["#IO2"] \n\t" \ -- "absq_s.ph %["#IO3"], %["#IO3"] \n\t" \ -- "absq_s.ph %["#IO4"], %["#IO4"] \n\t" \ -- "absq_s.ph %["#IO5"], %["#IO5"] \n\t" \ -- "absq_s.ph %["#IO6"], %["#IO6"] \n\t" \ -- "absq_s.ph %["#IO7"], %["#IO7"] \n\t" -+ "absq_s.ph %[" #IO0 "], %[" #IO0 "] \n\t" \ -+ "absq_s.ph %[" #IO1 "], %[" #IO1 "] \n\t" \ -+ "absq_s.ph %[" #IO2 "], %[" #IO2 "] \n\t" \ -+ "absq_s.ph %[" #IO3 "], %[" #IO3 "] \n\t" \ -+ "absq_s.ph %[" #IO4 "], %[" #IO4 "] \n\t" \ -+ "absq_s.ph %[" #IO5 "], %[" #IO5 "] \n\t" \ -+ "absq_s.ph %[" #IO6 "], %[" #IO6 "] \n\t" \ -+ "absq_s.ph %[" #IO7 "], %[" #IO7 "] \n\t" - - // dpa.w.ph $ac0 temp0 ,temp1 - // $ac += temp0[31..16] * temp1[31..16] + temp0[15..0] * temp1[15..0] + // I - input (macro doesn't change it) + #define ADD_SUB_HALVES_X4(O0, O1, O2, O3, O4, O5, O6, O7, \ + I0, I1, I2, I3, I4, I5, I6, I7) \ +- "addq.ph %["#O0"], %["#I0"], %["#I1"] \n\t" \ +- "subq.ph %["#O1"], %["#I0"], %["#I1"] \n\t" \ +- "addq.ph %["#O2"], %["#I2"], %["#I3"] \n\t" \ +- "subq.ph %["#O3"], %["#I2"], %["#I3"] \n\t" \ +- "addq.ph %["#O4"], %["#I4"], %["#I5"] \n\t" \ +- "subq.ph %["#O5"], %["#I4"], %["#I5"] \n\t" \ +- "addq.ph %["#O6"], %["#I6"], %["#I7"] \n\t" \ +- "subq.ph %["#O7"], %["#I6"], %["#I7"] \n\t" ++ "addq.ph %[" #O0 "], %[" #I0 "], %[" #I1 "] \n\t" \ ++ "subq.ph %[" #O1 "], %[" #I0 "], %[" #I1 "] \n\t" \ ++ "addq.ph %[" #O2 "], %[" #I2 "], %[" #I3 "] \n\t" \ ++ "subq.ph %[" #O3 "], %[" #I2 "], %[" #I3 "] \n\t" \ ++ "addq.ph %[" #O4 "], %[" #I4 "], %[" #I5 "] \n\t" \ ++ "subq.ph %[" #O5 "], %[" #I4 "], %[" #I5 "] \n\t" \ ++ "addq.ph %[" #O6 "], %[" #I6 "], %[" #I7 "] \n\t" \ ++ "subq.ph %[" #O7 "], %[" #I6 "], %[" #I7 "] \n\t" + + // IO - input/output + #define ABS_X8(IO0, IO1, IO2, IO3, IO4, IO5, IO6, IO7) \ +- "absq_s.ph %["#IO0"], %["#IO0"] \n\t" \ +- "absq_s.ph %["#IO1"], %["#IO1"] \n\t" \ +- "absq_s.ph %["#IO2"], %["#IO2"] \n\t" \ +- "absq_s.ph %["#IO3"], %["#IO3"] \n\t" \ +- "absq_s.ph %["#IO4"], %["#IO4"] \n\t" \ +- "absq_s.ph %["#IO5"], %["#IO5"] \n\t" \ +- "absq_s.ph %["#IO6"], %["#IO6"] \n\t" \ +- "absq_s.ph %["#IO7"], %["#IO7"] \n\t" ++ "absq_s.ph %[" #IO0 "], %[" #IO0 "] \n\t" \ ++ "absq_s.ph %[" #IO1 "], %[" #IO1 "] \n\t" \ ++ "absq_s.ph %[" #IO2 "], %[" #IO2 "] \n\t" \ ++ "absq_s.ph %[" #IO3 "], %[" #IO3 "] \n\t" \ ++ "absq_s.ph %[" #IO4 "], %[" #IO4 "] \n\t" \ ++ "absq_s.ph %[" #IO5 "], %[" #IO5 "] \n\t" \ ++ "absq_s.ph %[" #IO6 "], %[" #IO6 "] \n\t" \ ++ "absq_s.ph %[" #IO7 "], %[" #IO7 "] \n\t" + + // dpa.w.ph $ac0 temp0 ,temp1 + // $ac += temp0[31..16] * temp1[31..16] + temp0[15..0] * temp1[15..0] @@ -56,15 +56,15 @@ static const int kC2 = 35468; - #define MUL_HALF(O0, I0, I1, I2, I3, I4, I5, I6, I7, \ - I8, I9, I10, I11, I12, I13, I14, I15) \ - "mult $ac0, $zero, $zero \n\t" \ -- "dpa.w.ph $ac0, %["#I2"], %["#I0"] \n\t" \ -- "dpax.w.ph $ac0, %["#I5"], %["#I6"] \n\t" \ -- "dpa.w.ph $ac0, %["#I8"], %["#I9"] \n\t" \ -- "dpax.w.ph $ac0, %["#I11"], %["#I4"] \n\t" \ -- "dpa.w.ph $ac0, %["#I12"], %["#I7"] \n\t" \ -- "dpax.w.ph $ac0, %["#I13"], %["#I1"] \n\t" \ -- "dpa.w.ph $ac0, %["#I14"], %["#I3"] \n\t" \ -- "dpax.w.ph $ac0, %["#I15"], %["#I10"] \n\t" \ -- "mflo %["#O0"], $ac0 \n\t" -+ "dpa.w.ph $ac0, %[" #I2 "], %[" #I0 "] \n\t" \ -+ "dpax.w.ph $ac0, %[" #I5 "], %[" #I6 "] \n\t" \ -+ "dpa.w.ph $ac0, %[" #I8 "], %[" #I9 "] \n\t" \ -+ "dpax.w.ph $ac0, %[" #I11 "], %[" #I4 "] \n\t" \ -+ "dpa.w.ph $ac0, %[" #I12 "], %[" #I7 "] \n\t" \ -+ "dpax.w.ph $ac0, %[" #I13 "], %[" #I1 "] \n\t" \ -+ "dpa.w.ph $ac0, %[" #I14 "], %[" #I3 "] \n\t" \ -+ "dpax.w.ph $ac0, %[" #I15 "], %[" #I10 "] \n\t" \ -+ "mflo %[" #O0 "], $ac0 \n\t" - - #define OUTPUT_EARLY_CLOBBER_REGS_17() \ - OUTPUT_EARLY_CLOBBER_REGS_10(), \ + #define MUL_HALF(O0, I0, I1, I2, I3, I4, I5, I6, I7, \ + I8, I9, I10, I11, I12, I13, I14, I15) \ + "mult $ac0, $zero, $zero \n\t" \ +- "dpa.w.ph $ac0, %["#I2"], %["#I0"] \n\t" \ +- "dpax.w.ph $ac0, %["#I5"], %["#I6"] \n\t" \ +- "dpa.w.ph $ac0, %["#I8"], %["#I9"] \n\t" \ +- "dpax.w.ph $ac0, %["#I11"], %["#I4"] \n\t" \ +- "dpa.w.ph $ac0, %["#I12"], %["#I7"] \n\t" \ +- "dpax.w.ph $ac0, %["#I13"], %["#I1"] \n\t" \ +- "dpa.w.ph $ac0, %["#I14"], %["#I3"] \n\t" \ +- "dpax.w.ph $ac0, %["#I15"], %["#I10"] \n\t" \ +- "mflo %["#O0"], $ac0 \n\t" ++ "dpa.w.ph $ac0, %[" #I2 "], %[" #I0 "] \n\t" \ ++ "dpax.w.ph $ac0, %[" #I5 "], %[" #I6 "] \n\t" \ ++ "dpa.w.ph $ac0, %[" #I8 "], %[" #I9 "] \n\t" \ ++ "dpax.w.ph $ac0, %[" #I11 "], %[" #I4 "] \n\t" \ ++ "dpa.w.ph $ac0, %[" #I12 "], %[" #I7 "] \n\t" \ ++ "dpax.w.ph $ac0, %[" #I13 "], %[" #I1 "] \n\t" \ ++ "dpa.w.ph $ac0, %[" #I14 "], %[" #I3 "] \n\t" \ ++ "dpax.w.ph $ac0, %[" #I15 "], %[" #I10 "] \n\t" \ ++ "mflo %[" #O0 "], $ac0 \n\t" + + #define OUTPUT_EARLY_CLOBBER_REGS_17() \ + OUTPUT_EARLY_CLOBBER_REGS_10(), \ @@ -77,69 +77,69 @@ static const int kC2 = 35468; - // A - offset in bytes to load from src and ref buffers - // TEMP0..TEMP3 - registers for corresponding tmp elements - #define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \ -- "lw %["#TEMP0"], 0(%[args]) \n\t" \ -- "lw %["#TEMP1"], 4(%[args]) \n\t" \ -- "lw %["#TEMP2"], "XSTR(BPS)"*"#A"(%["#TEMP0"]) \n\t" \ -- "lw %["#TEMP3"], "XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ -- "preceu.ph.qbl %["#TEMP0"], %["#TEMP2"] \n\t" \ -- "preceu.ph.qbl %["#TEMP1"], %["#TEMP3"] \n\t" \ -- "preceu.ph.qbr %["#TEMP2"], %["#TEMP2"] \n\t" \ -- "preceu.ph.qbr %["#TEMP3"], %["#TEMP3"] \n\t" \ -- "subq.ph %["#TEMP0"], %["#TEMP0"], %["#TEMP1"] \n\t" \ -- "subq.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP3"] \n\t" \ -- "rotr %["#TEMP0"], %["#TEMP0"], 16 \n\t" \ -- "addq.ph %["#TEMP1"], %["#TEMP2"], %["#TEMP0"] \n\t" \ -- "subq.ph %["#TEMP3"], %["#TEMP2"], %["#TEMP0"] \n\t" \ -- "seh %["#TEMP0"], %["#TEMP1"] \n\t" \ -- "sra %[temp16], %["#TEMP1"], 16 \n\t" \ -- "seh %[temp19], %["#TEMP3"] \n\t" \ -- "sra %["#TEMP3"], %["#TEMP3"], 16 \n\t" \ -- "subu %["#TEMP2"], %["#TEMP0"], %[temp16] \n\t" \ -- "addu %["#TEMP0"], %["#TEMP0"], %[temp16] \n\t" \ -+ "lw %[" #TEMP0 "], 0(%[args]) \n\t" \ -+ "lw %[" #TEMP1 "], 4(%[args]) \n\t" \ -+ "lw %[" #TEMP2 "], "XSTR(BPS)"*" #A "(%[" #TEMP0 "]) \n\t" \ -+ "lw %[" #TEMP3 "], "XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ -+ "preceu.ph.qbl %[" #TEMP0 "], %[" #TEMP2 "] \n\t" \ -+ "preceu.ph.qbl %[" #TEMP1 "], %[" #TEMP3 "] \n\t" \ -+ "preceu.ph.qbr %[" #TEMP2 "], %[" #TEMP2 "] \n\t" \ -+ "preceu.ph.qbr %[" #TEMP3 "], %[" #TEMP3 "] \n\t" \ -+ "subq.ph %[" #TEMP0 "], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \ -+ "subq.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP3 "] \n\t" \ -+ "rotr %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\t" \ -+ "addq.ph %[" #TEMP1 "], %[" #TEMP2 "], %[" #TEMP0 "] \n\t" \ -+ "subq.ph %[" #TEMP3 "], %[" #TEMP2 "], %[" #TEMP0 "] \n\t" \ -+ "seh %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \ -+ "sra %[temp16], %[" #TEMP1 "], 16 \n\t" \ -+ "seh %[temp19], %[" #TEMP3 "] \n\t" \ -+ "sra %[" #TEMP3 "], %[" #TEMP3 "], 16 \n\t" \ -+ "subu %[" #TEMP2 "], %[" #TEMP0 "], %[temp16] \n\t" \ -+ "addu %[" #TEMP0 "], %[" #TEMP0 "], %[temp16] \n\t" \ - "mul %[temp17], %[temp19], %[c2217] \n\t" \ -- "mul %[temp18], %["#TEMP3"], %[c5352] \n\t" \ -- "mul %["#TEMP1"], %[temp19], %[c5352] \n\t" \ -- "mul %[temp16], %["#TEMP3"], %[c2217] \n\t" \ -- "sll %["#TEMP2"], %["#TEMP2"], 3 \n\t" \ -- "sll %["#TEMP0"], %["#TEMP0"], 3 \n\t" \ -- "subu %["#TEMP3"], %[temp17], %[temp18] \n\t" \ -- "addu %["#TEMP1"], %[temp16], %["#TEMP1"] \n\t" \ -- "addiu %["#TEMP3"], %["#TEMP3"], 937 \n\t" \ -- "addiu %["#TEMP1"], %["#TEMP1"], 1812 \n\t" \ -- "sra %["#TEMP3"], %["#TEMP3"], 9 \n\t" \ -- "sra %["#TEMP1"], %["#TEMP1"], 9 \n\t" -+ "mul %[temp18], %[" #TEMP3 "], %[c5352] \n\t" \ -+ "mul %[" #TEMP1 "], %[temp19], %[c5352] \n\t" \ -+ "mul %[temp16], %[" #TEMP3 "], %[c2217] \n\t" \ -+ "sll %[" #TEMP2 "], %[" #TEMP2 "], 3 \n\t" \ -+ "sll %[" #TEMP0 "], %[" #TEMP0 "], 3 \n\t" \ -+ "subu %[" #TEMP3 "], %[temp17], %[temp18] \n\t" \ -+ "addu %[" #TEMP1 "], %[temp16], %[" #TEMP1 "] \n\t" \ -+ "addiu %[" #TEMP3 "], %[" #TEMP3 "], 937 \n\t" \ -+ "addiu %[" #TEMP1 "], %[" #TEMP1 "], 1812 \n\t" \ -+ "sra %[" #TEMP3 "], %[" #TEMP3 "], 9 \n\t" \ -+ "sra %[" #TEMP1 "], %[" #TEMP1 "], 9 \n\t" - - // macro for one vertical pass in FTransform - // temp0..temp15 holds tmp[0]..tmp[15] - // A..D - offsets in bytes to store to out buffer - // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements - #define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \ -- "addu %[temp16], %["#TEMP0"], %["#TEMP12"] \n\t" \ -- "subu %[temp19], %["#TEMP0"], %["#TEMP12"] \n\t" \ -- "addu %[temp17], %["#TEMP4"], %["#TEMP8"] \n\t" \ -- "subu %[temp18], %["#TEMP4"], %["#TEMP8"] \n\t" \ -- "mul %["#TEMP8"], %[temp19], %[c2217] \n\t" \ -- "mul %["#TEMP12"], %[temp18], %[c2217] \n\t" \ -- "mul %["#TEMP4"], %[temp19], %[c5352] \n\t" \ -+ "addu %[temp16], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \ -+ "subu %[temp19], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \ -+ "addu %[temp17], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \ -+ "subu %[temp18], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \ -+ "mul %[" #TEMP8 "], %[temp19], %[c2217] \n\t" \ -+ "mul %[" #TEMP12 "], %[temp18], %[c2217] \n\t" \ -+ "mul %[" #TEMP4 "], %[temp19], %[c5352] \n\t" \ - "mul %[temp18], %[temp18], %[c5352] \n\t" \ - "addiu %[temp16], %[temp16], 7 \n\t" \ -- "addu %["#TEMP0"], %[temp16], %[temp17] \n\t" \ -- "sra %["#TEMP0"], %["#TEMP0"], 4 \n\t" \ -- "addu %["#TEMP12"], %["#TEMP12"], %["#TEMP4"] \n\t" \ -- "subu %["#TEMP4"], %[temp16], %[temp17] \n\t" \ -- "sra %["#TEMP4"], %["#TEMP4"], 4 \n\t" \ -- "addiu %["#TEMP8"], %["#TEMP8"], 30000 \n\t" \ -- "addiu %["#TEMP12"], %["#TEMP12"], 12000 \n\t" \ -- "addiu %["#TEMP8"], %["#TEMP8"], 21000 \n\t" \ -- "subu %["#TEMP8"], %["#TEMP8"], %[temp18] \n\t" \ -- "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \ -- "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \ -- "addiu %[temp16], %["#TEMP12"], 1 \n\t" \ -- "movn %["#TEMP12"], %[temp16], %[temp19] \n\t" \ -- "sh %["#TEMP0"], "#A"(%[temp20]) \n\t" \ -- "sh %["#TEMP4"], "#C"(%[temp20]) \n\t" \ -- "sh %["#TEMP8"], "#D"(%[temp20]) \n\t" \ -- "sh %["#TEMP12"], "#B"(%[temp20]) \n\t" -+ "addu %[" #TEMP0 "], %[temp16], %[temp17] \n\t" \ -+ "sra %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \ -+ "addu %[" #TEMP12 "], %[" #TEMP12 "], %[" #TEMP4 "] \n\t" \ -+ "subu %[" #TEMP4 "], %[temp16], %[temp17] \n\t" \ -+ "sra %[" #TEMP4 "], %[" #TEMP4 "], 4 \n\t" \ -+ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 30000 \n\t" \ -+ "addiu %[" #TEMP12 "], %[" #TEMP12 "], 12000 \n\t" \ -+ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 21000 \n\t" \ -+ "subu %[" #TEMP8 "], %[" #TEMP8 "], %[temp18] \n\t" \ -+ "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \ -+ "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \ -+ "addiu %[temp16], %[" #TEMP12 "], 1 \n\t" \ -+ "movn %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \ -+ "sh %[" #TEMP0 "], " #A "(%[temp20]) \n\t" \ -+ "sh %[" #TEMP4 "], " #C "(%[temp20]) \n\t" \ -+ "sh %[" #TEMP8 "], " #D "(%[temp20]) \n\t" \ -+ "sh %[" #TEMP12 "], " #B "(%[temp20]) \n\t" - - static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) { - const int c2217 = 2217; + // A - offset in bytes to load from src and ref buffers + // TEMP0..TEMP3 - registers for corresponding tmp elements + #define HORIZONTAL_PASS(A, TEMP0, TEMP1, TEMP2, TEMP3) \ +- "lw %["#TEMP0"], 0(%[args]) \n\t" \ +- "lw %["#TEMP1"], 4(%[args]) \n\t" \ +- "lw %["#TEMP2"], "XSTR(BPS)"*"#A"(%["#TEMP0"]) \n\t" \ +- "lw %["#TEMP3"], "XSTR(BPS)"*"#A"(%["#TEMP1"]) \n\t" \ +- "preceu.ph.qbl %["#TEMP0"], %["#TEMP2"] \n\t" \ +- "preceu.ph.qbl %["#TEMP1"], %["#TEMP3"] \n\t" \ +- "preceu.ph.qbr %["#TEMP2"], %["#TEMP2"] \n\t" \ +- "preceu.ph.qbr %["#TEMP3"], %["#TEMP3"] \n\t" \ +- "subq.ph %["#TEMP0"], %["#TEMP0"], %["#TEMP1"] \n\t" \ +- "subq.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP3"] \n\t" \ +- "rotr %["#TEMP0"], %["#TEMP0"], 16 \n\t" \ +- "addq.ph %["#TEMP1"], %["#TEMP2"], %["#TEMP0"] \n\t" \ +- "subq.ph %["#TEMP3"], %["#TEMP2"], %["#TEMP0"] \n\t" \ +- "seh %["#TEMP0"], %["#TEMP1"] \n\t" \ +- "sra %[temp16], %["#TEMP1"], 16 \n\t" \ +- "seh %[temp19], %["#TEMP3"] \n\t" \ +- "sra %["#TEMP3"], %["#TEMP3"], 16 \n\t" \ +- "subu %["#TEMP2"], %["#TEMP0"], %[temp16] \n\t" \ +- "addu %["#TEMP0"], %["#TEMP0"], %[temp16] \n\t" \ ++ "lw %[" #TEMP0 "], 0(%[args]) \n\t" \ ++ "lw %[" #TEMP1 "], 4(%[args]) \n\t" \ ++ "lw %[" #TEMP2 "], "XSTR(BPS)"*" #A "(%[" #TEMP0 "]) \n\t" \ ++ "lw %[" #TEMP3 "], "XSTR(BPS)"*" #A "(%[" #TEMP1 "]) \n\t" \ ++ "preceu.ph.qbl %[" #TEMP0 "], %[" #TEMP2 "] \n\t" \ ++ "preceu.ph.qbl %[" #TEMP1 "], %[" #TEMP3 "] \n\t" \ ++ "preceu.ph.qbr %[" #TEMP2 "], %[" #TEMP2 "] \n\t" \ ++ "preceu.ph.qbr %[" #TEMP3 "], %[" #TEMP3 "] \n\t" \ ++ "subq.ph %[" #TEMP0 "], %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \ ++ "subq.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP3 "] \n\t" \ ++ "rotr %[" #TEMP0 "], %[" #TEMP0 "], 16 \n\t" \ ++ "addq.ph %[" #TEMP1 "], %[" #TEMP2 "], %[" #TEMP0 "] \n\t" \ ++ "subq.ph %[" #TEMP3 "], %[" #TEMP2 "], %[" #TEMP0 "] \n\t" \ ++ "seh %[" #TEMP0 "], %[" #TEMP1 "] \n\t" \ ++ "sra %[temp16], %[" #TEMP1 "], 16 \n\t" \ ++ "seh %[temp19], %[" #TEMP3 "] \n\t" \ ++ "sra %[" #TEMP3 "], %[" #TEMP3 "], 16 \n\t" \ ++ "subu %[" #TEMP2 "], %[" #TEMP0 "], %[temp16] \n\t" \ ++ "addu %[" #TEMP0 "], %[" #TEMP0 "], %[temp16] \n\t" \ + "mul %[temp17], %[temp19], %[c2217] \n\t" \ +- "mul %[temp18], %["#TEMP3"], %[c5352] \n\t" \ +- "mul %["#TEMP1"], %[temp19], %[c5352] \n\t" \ +- "mul %[temp16], %["#TEMP3"], %[c2217] \n\t" \ +- "sll %["#TEMP2"], %["#TEMP2"], 3 \n\t" \ +- "sll %["#TEMP0"], %["#TEMP0"], 3 \n\t" \ +- "subu %["#TEMP3"], %[temp17], %[temp18] \n\t" \ +- "addu %["#TEMP1"], %[temp16], %["#TEMP1"] \n\t" \ +- "addiu %["#TEMP3"], %["#TEMP3"], 937 \n\t" \ +- "addiu %["#TEMP1"], %["#TEMP1"], 1812 \n\t" \ +- "sra %["#TEMP3"], %["#TEMP3"], 9 \n\t" \ +- "sra %["#TEMP1"], %["#TEMP1"], 9 \n\t" ++ "mul %[temp18], %[" #TEMP3 "], %[c5352] \n\t" \ ++ "mul %[" #TEMP1 "], %[temp19], %[c5352] \n\t" \ ++ "mul %[temp16], %[" #TEMP3 "], %[c2217] \n\t" \ ++ "sll %[" #TEMP2 "], %[" #TEMP2 "], 3 \n\t" \ ++ "sll %[" #TEMP0 "], %[" #TEMP0 "], 3 \n\t" \ ++ "subu %[" #TEMP3 "], %[temp17], %[temp18] \n\t" \ ++ "addu %[" #TEMP1 "], %[temp16], %[" #TEMP1 "] \n\t" \ ++ "addiu %[" #TEMP3 "], %[" #TEMP3 "], 937 \n\t" \ ++ "addiu %[" #TEMP1 "], %[" #TEMP1 "], 1812 \n\t" \ ++ "sra %[" #TEMP3 "], %[" #TEMP3 "], 9 \n\t" \ ++ "sra %[" #TEMP1 "], %[" #TEMP1 "], 9 \n\t" + + // macro for one vertical pass in FTransform + // temp0..temp15 holds tmp[0]..tmp[15] + // A..D - offsets in bytes to store to out buffer + // TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements + #define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12) \ +- "addu %[temp16], %["#TEMP0"], %["#TEMP12"] \n\t" \ +- "subu %[temp19], %["#TEMP0"], %["#TEMP12"] \n\t" \ +- "addu %[temp17], %["#TEMP4"], %["#TEMP8"] \n\t" \ +- "subu %[temp18], %["#TEMP4"], %["#TEMP8"] \n\t" \ +- "mul %["#TEMP8"], %[temp19], %[c2217] \n\t" \ +- "mul %["#TEMP12"], %[temp18], %[c2217] \n\t" \ +- "mul %["#TEMP4"], %[temp19], %[c5352] \n\t" \ ++ "addu %[temp16], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \ ++ "subu %[temp19], %[" #TEMP0 "], %[" #TEMP12 "] \n\t" \ ++ "addu %[temp17], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \ ++ "subu %[temp18], %[" #TEMP4 "], %[" #TEMP8 "] \n\t" \ ++ "mul %[" #TEMP8 "], %[temp19], %[c2217] \n\t" \ ++ "mul %[" #TEMP12 "], %[temp18], %[c2217] \n\t" \ ++ "mul %[" #TEMP4 "], %[temp19], %[c5352] \n\t" \ + "mul %[temp18], %[temp18], %[c5352] \n\t" \ + "addiu %[temp16], %[temp16], 7 \n\t" \ +- "addu %["#TEMP0"], %[temp16], %[temp17] \n\t" \ +- "sra %["#TEMP0"], %["#TEMP0"], 4 \n\t" \ +- "addu %["#TEMP12"], %["#TEMP12"], %["#TEMP4"] \n\t" \ +- "subu %["#TEMP4"], %[temp16], %[temp17] \n\t" \ +- "sra %["#TEMP4"], %["#TEMP4"], 4 \n\t" \ +- "addiu %["#TEMP8"], %["#TEMP8"], 30000 \n\t" \ +- "addiu %["#TEMP12"], %["#TEMP12"], 12000 \n\t" \ +- "addiu %["#TEMP8"], %["#TEMP8"], 21000 \n\t" \ +- "subu %["#TEMP8"], %["#TEMP8"], %[temp18] \n\t" \ +- "sra %["#TEMP12"], %["#TEMP12"], 16 \n\t" \ +- "sra %["#TEMP8"], %["#TEMP8"], 16 \n\t" \ +- "addiu %[temp16], %["#TEMP12"], 1 \n\t" \ +- "movn %["#TEMP12"], %[temp16], %[temp19] \n\t" \ +- "sh %["#TEMP0"], "#A"(%[temp20]) \n\t" \ +- "sh %["#TEMP4"], "#C"(%[temp20]) \n\t" \ +- "sh %["#TEMP8"], "#D"(%[temp20]) \n\t" \ +- "sh %["#TEMP12"], "#B"(%[temp20]) \n\t" ++ "addu %[" #TEMP0 "], %[temp16], %[temp17] \n\t" \ ++ "sra %[" #TEMP0 "], %[" #TEMP0 "], 4 \n\t" \ ++ "addu %[" #TEMP12 "], %[" #TEMP12 "], %[" #TEMP4 "] \n\t" \ ++ "subu %[" #TEMP4 "], %[temp16], %[temp17] \n\t" \ ++ "sra %[" #TEMP4 "], %[" #TEMP4 "], 4 \n\t" \ ++ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 30000 \n\t" \ ++ "addiu %[" #TEMP12 "], %[" #TEMP12 "], 12000 \n\t" \ ++ "addiu %[" #TEMP8 "], %[" #TEMP8 "], 21000 \n\t" \ ++ "subu %[" #TEMP8 "], %[" #TEMP8 "], %[temp18] \n\t" \ ++ "sra %[" #TEMP12 "], %[" #TEMP12 "], 16 \n\t" \ ++ "sra %[" #TEMP8 "], %[" #TEMP8 "], 16 \n\t" \ ++ "addiu %[temp16], %[" #TEMP12 "], 1 \n\t" \ ++ "movn %[" #TEMP12 "], %[temp16], %[temp19] \n\t" \ ++ "sh %[" #TEMP0 "], " #A "(%[temp20]) \n\t" \ ++ "sh %[" #TEMP4 "], " #C "(%[temp20]) \n\t" \ ++ "sh %[" #TEMP8 "], " #D "(%[temp20]) \n\t" \ ++ "sh %[" #TEMP12 "], " #B "(%[temp20]) \n\t" + + static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) { + const int c2217 = 2217; @@ -329,11 +329,11 @@ static int Disto16x16(const uint8_t* const a, const uint8_t* const b, - // Intra predictions - - #define FILL_PART(J, SIZE) \ -- "usw %[value], 0+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \ -- "usw %[value], 4+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \ -- ".if "#SIZE" == 16 \n\t" \ -- "usw %[value], 8+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \ -- "usw %[value], 12+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \ -+ "usw %[value], 0+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \ -+ "usw %[value], 4+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \ -+ ".if " #SIZE " == 16 \n\t" \ -+ "usw %[value], 8+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \ -+ "usw %[value], 12+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \ - ".endif \n\t" - - #define FILL_8_OR_16(DST, VALUE, SIZE) do { \ + // Intra predictions + + #define FILL_PART(J, SIZE) \ +- "usw %[value], 0+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \ +- "usw %[value], 4+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \ +- ".if "#SIZE" == 16 \n\t" \ +- "usw %[value], 8+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \ +- "usw %[value], 12+"#J"*"XSTR(BPS)"(%[dst]) \n\t" \ ++ "usw %[value], 0+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \ ++ "usw %[value], 4+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \ ++ ".if " #SIZE " == 16 \n\t" \ ++ "usw %[value], 8+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \ ++ "usw %[value], 12+" #J "*"XSTR(BPS)"(%[dst]) \n\t" \ + ".endif \n\t" + + #define FILL_8_OR_16(DST, VALUE, SIZE) do { \ @@ -348,7 +348,7 @@ static int Disto16x16(const uint8_t* const a, const uint8_t* const b, - FILL_PART( 5, SIZE) \ - FILL_PART( 6, SIZE) \ - FILL_PART( 7, SIZE) \ -- ".if "#SIZE" == 16 \n\t" \ -+ ".if " #SIZE " == 16 \n\t" \ - FILL_PART( 8, 16) \ - FILL_PART( 9, 16) \ - FILL_PART(10, 16) \ + FILL_PART( 5, SIZE) \ + FILL_PART( 6, SIZE) \ + FILL_PART( 7, SIZE) \ +- ".if "#SIZE" == 16 \n\t" \ ++ ".if " #SIZE " == 16 \n\t" \ + FILL_PART( 8, 16) \ + FILL_PART( 9, 16) \ + FILL_PART(10, 16) \ @@ -425,7 +425,7 @@ HORIZONTAL_PRED(dst, left, 16) - CLIPPING() \ - "usw %[temp0], 0(%[dst]) \n\t" \ - "usw %[temp1], 4(%[dst]) \n\t" \ -- ".if "#SIZE" == 16 \n\t" \ -+ ".if " #SIZE " == 16 \n\t" \ - "ulw %[temp0], 8(%[top]) \n\t" \ - "ulw %[temp1], 12(%[top]) \n\t" \ - CLIPPING() \ + CLIPPING() \ + "usw %[temp0], 0(%[dst]) \n\t" \ + "usw %[temp1], 4(%[dst]) \n\t" \ +- ".if "#SIZE" == 16 \n\t" \ ++ ".if " #SIZE " == 16 \n\t" \ + "ulw %[temp0], 8(%[top]) \n\t" \ + "ulw %[temp1], 12(%[top]) \n\t" \ + CLIPPING() \ @@ -1060,8 +1060,8 @@ static void Intra4Preds(uint8_t* dst, const uint8_t* top) { - #if !defined(WORK_AROUND_GCC) - - #define GET_SSE_INNER(A) \ -- "lw %[temp0], "#A"(%[a]) \n\t" \ -- "lw %[temp1], "#A"(%[b]) \n\t" \ -+ "lw %[temp0], " #A "(%[a]) \n\t" \ -+ "lw %[temp1], " #A "(%[b]) \n\t" \ - "preceu.ph.qbr %[temp2], %[temp0] \n\t" \ - "preceu.ph.qbl %[temp0], %[temp0] \n\t" \ - "preceu.ph.qbr %[temp3], %[temp1] \n\t" \ + #if !defined(WORK_AROUND_GCC) + + #define GET_SSE_INNER(A) \ +- "lw %[temp0], "#A"(%[a]) \n\t" \ +- "lw %[temp1], "#A"(%[b]) \n\t" \ ++ "lw %[temp0], " #A "(%[a]) \n\t" \ ++ "lw %[temp1], " #A "(%[b]) \n\t" \ + "preceu.ph.qbr %[temp2], %[temp0] \n\t" \ + "preceu.ph.qbl %[temp0], %[temp0] \n\t" \ + "preceu.ph.qbr %[temp3], %[temp1] \n\t" \ @@ -1185,28 +1185,28 @@ static int SSE4x4(const uint8_t* a, const uint8_t* b) { - // N - offset in bytes (n * 2) - // N1 - offset in bytes ((n + 1) * 2) - #define QUANTIZE_ONE(J, K, N, N1) \ -- "ulw %[temp1], "#J"(%[ppin]) \n\t" \ -- "ulw %[temp2], "#J"(%[ppsharpen]) \n\t" \ -- "lhu %[temp3], "#K"(%[ppzthresh]) \n\t" \ -- "lhu %[temp6], "#K"+4(%[ppzthresh]) \n\t" \ -+ "ulw %[temp1], " #J "(%[ppin]) \n\t" \ -+ "ulw %[temp2], " #J "(%[ppsharpen]) \n\t" \ -+ "lhu %[temp3], " #K "(%[ppzthresh]) \n\t" \ -+ "lhu %[temp6], " #K "+4(%[ppzthresh]) \n\t" \ - "absq_s.ph %[temp4], %[temp1] \n\t" \ - "ins %[temp3], %[temp6], 16, 16 \n\t" \ - "addu.ph %[coeff], %[temp4], %[temp2] \n\t" \ - "shra.ph %[sign], %[temp1], 15 \n\t" \ - "li %[level], 0x10001 \n\t" \ - "cmp.lt.ph %[temp3], %[coeff] \n\t" \ -- "lhu %[temp1], "#J"(%[ppiq]) \n\t" \ -+ "lhu %[temp1], " #J "(%[ppiq]) \n\t" \ - "pick.ph %[temp5], %[level], $0 \n\t" \ -- "lw %[temp2], "#K"(%[ppbias]) \n\t" \ -+ "lw %[temp2], " #K "(%[ppbias]) \n\t" \ - "beqz %[temp5], 0f \n\t" \ -- "lhu %[temp3], "#J"(%[ppq]) \n\t" \ -+ "lhu %[temp3], " #J "(%[ppq]) \n\t" \ - "beq %[temp5], %[level], 1f \n\t" \ - "andi %[temp5], %[temp5], 0x1 \n\t" \ - "andi %[temp4], %[coeff], 0xffff \n\t" \ - "beqz %[temp5], 2f \n\t" \ - "mul %[level], %[temp4], %[temp1] \n\t" \ -- "sh $0, "#J"+2(%[ppin]) \n\t" \ -- "sh $0, "#N1"(%[pout]) \n\t" \ -+ "sh $0, " #J "+2(%[ppin]) \n\t" \ -+ "sh $0, " #N1 "(%[pout]) \n\t" \ - "addu %[level], %[level], %[temp2] \n\t" \ - "sra %[level], %[level], 17 \n\t" \ - "slt %[temp4], %[max_level], %[level] \n\t" \ + // N - offset in bytes (n * 2) + // N1 - offset in bytes ((n + 1) * 2) + #define QUANTIZE_ONE(J, K, N, N1) \ +- "ulw %[temp1], "#J"(%[ppin]) \n\t" \ +- "ulw %[temp2], "#J"(%[ppsharpen]) \n\t" \ +- "lhu %[temp3], "#K"(%[ppzthresh]) \n\t" \ +- "lhu %[temp6], "#K"+4(%[ppzthresh]) \n\t" \ ++ "ulw %[temp1], " #J "(%[ppin]) \n\t" \ ++ "ulw %[temp2], " #J "(%[ppsharpen]) \n\t" \ ++ "lhu %[temp3], " #K "(%[ppzthresh]) \n\t" \ ++ "lhu %[temp6], " #K "+4(%[ppzthresh]) \n\t" \ + "absq_s.ph %[temp4], %[temp1] \n\t" \ + "ins %[temp3], %[temp6], 16, 16 \n\t" \ + "addu.ph %[coeff], %[temp4], %[temp2] \n\t" \ + "shra.ph %[sign], %[temp1], 15 \n\t" \ + "li %[level], 0x10001 \n\t" \ + "cmp.lt.ph %[temp3], %[coeff] \n\t" \ +- "lhu %[temp1], "#J"(%[ppiq]) \n\t" \ ++ "lhu %[temp1], " #J "(%[ppiq]) \n\t" \ + "pick.ph %[temp5], %[level], $0 \n\t" \ +- "lw %[temp2], "#K"(%[ppbias]) \n\t" \ ++ "lw %[temp2], " #K "(%[ppbias]) \n\t" \ + "beqz %[temp5], 0f \n\t" \ +- "lhu %[temp3], "#J"(%[ppq]) \n\t" \ ++ "lhu %[temp3], " #J "(%[ppq]) \n\t" \ + "beq %[temp5], %[level], 1f \n\t" \ + "andi %[temp5], %[temp5], 0x1 \n\t" \ + "andi %[temp4], %[coeff], 0xffff \n\t" \ + "beqz %[temp5], 2f \n\t" \ + "mul %[level], %[temp4], %[temp1] \n\t" \ +- "sh $0, "#J"+2(%[ppin]) \n\t" \ +- "sh $0, "#N1"(%[pout]) \n\t" \ ++ "sh $0, " #J "+2(%[ppin]) \n\t" \ ++ "sh $0, " #N1 "(%[pout]) \n\t" \ + "addu %[level], %[level], %[temp2] \n\t" \ + "sra %[level], %[level], 17 \n\t" \ + "slt %[temp4], %[max_level], %[level] \n\t" \ @@ -1216,15 +1216,15 @@ static int SSE4x4(const uint8_t* a, const uint8_t* b) { - "subu %[level], %[level], %[temp6] \n\t" \ - "mul %[temp5], %[level], %[temp3] \n\t" \ - "or %[ret], %[ret], %[level] \n\t" \ -- "sh %[level], "#N"(%[pout]) \n\t" \ -- "sh %[temp5], "#J"(%[ppin]) \n\t" \ -+ "sh %[level], " #N "(%[pout]) \n\t" \ -+ "sh %[temp5], " #J "(%[ppin]) \n\t" \ - "j 3f \n\t" \ - "2: \n\t" \ -- "lhu %[temp1], "#J"+2(%[ppiq]) \n\t" \ -+ "lhu %[temp1], " #J "+2(%[ppiq]) \n\t" \ - "srl %[temp5], %[coeff], 16 \n\t" \ - "mul %[level], %[temp5], %[temp1] \n\t" \ -- "lw %[temp2], "#K"+4(%[ppbias]) \n\t" \ -- "lhu %[temp3], "#J"+2(%[ppq]) \n\t" \ -+ "lw %[temp2], " #K "+4(%[ppbias]) \n\t" \ -+ "lhu %[temp3], " #J "+2(%[ppq]) \n\t" \ - "addu %[level], %[level], %[temp2] \n\t" \ - "sra %[level], %[level], 17 \n\t" \ - "srl %[temp6], %[sign], 16 \n\t" \ + "subu %[level], %[level], %[temp6] \n\t" \ + "mul %[temp5], %[level], %[temp3] \n\t" \ + "or %[ret], %[ret], %[level] \n\t" \ +- "sh %[level], "#N"(%[pout]) \n\t" \ +- "sh %[temp5], "#J"(%[ppin]) \n\t" \ ++ "sh %[level], " #N "(%[pout]) \n\t" \ ++ "sh %[temp5], " #J "(%[ppin]) \n\t" \ + "j 3f \n\t" \ + "2: \n\t" \ +- "lhu %[temp1], "#J"+2(%[ppiq]) \n\t" \ ++ "lhu %[temp1], " #J "+2(%[ppiq]) \n\t" \ + "srl %[temp5], %[coeff], 16 \n\t" \ + "mul %[level], %[temp5], %[temp1] \n\t" \ +- "lw %[temp2], "#K"+4(%[ppbias]) \n\t" \ +- "lhu %[temp3], "#J"+2(%[ppq]) \n\t" \ ++ "lw %[temp2], " #K "+4(%[ppbias]) \n\t" \ ++ "lhu %[temp3], " #J "+2(%[ppq]) \n\t" \ + "addu %[level], %[level], %[temp2] \n\t" \ + "sra %[level], %[level], 17 \n\t" \ + "srl %[temp6], %[sign], 16 \n\t" \ @@ -1233,20 +1233,20 @@ static int SSE4x4(const uint8_t* a, const uint8_t* b) { - "xor %[level], %[level], %[temp6] \n\t" \ - "subu %[level], %[level], %[temp6] \n\t" \ - "mul %[temp5], %[level], %[temp3] \n\t" \ -- "sh $0, "#J"(%[ppin]) \n\t" \ -- "sh $0, "#N"(%[pout]) \n\t" \ -+ "sh $0, " #J "(%[ppin]) \n\t" \ -+ "sh $0, " #N "(%[pout]) \n\t" \ - "or %[ret], %[ret], %[level] \n\t" \ -- "sh %[temp5], "#J"+2(%[ppin]) \n\t" \ -- "sh %[level], "#N1"(%[pout]) \n\t" \ -+ "sh %[temp5], " #J "+2(%[ppin]) \n\t" \ -+ "sh %[level], " #N1 "(%[pout]) \n\t" \ - "j 3f \n\t" \ - "1: \n\t" \ -- "lhu %[temp1], "#J"(%[ppiq]) \n\t" \ -- "lw %[temp2], "#K"(%[ppbias]) \n\t" \ -- "ulw %[temp3], "#J"(%[ppq]) \n\t" \ -+ "lhu %[temp1], " #J "(%[ppiq]) \n\t" \ -+ "lw %[temp2], " #K "(%[ppbias]) \n\t" \ -+ "ulw %[temp3], " #J "(%[ppq]) \n\t" \ - "andi %[temp5], %[coeff], 0xffff \n\t" \ - "srl %[temp0], %[coeff], 16 \n\t" \ -- "lhu %[temp6], "#J"+2(%[ppiq]) \n\t" \ -- "lw %[coeff], "#K"+4(%[ppbias]) \n\t" \ -+ "lhu %[temp6], " #J "+2(%[ppiq]) \n\t" \ -+ "lw %[coeff], " #K "+4(%[ppbias]) \n\t" \ - "mul %[level], %[temp5], %[temp1] \n\t" \ - "mul %[temp4], %[temp0], %[temp6] \n\t" \ - "addu %[level], %[level], %[temp2] \n\t" \ + "xor %[level], %[level], %[temp6] \n\t" \ + "subu %[level], %[level], %[temp6] \n\t" \ + "mul %[temp5], %[level], %[temp3] \n\t" \ +- "sh $0, "#J"(%[ppin]) \n\t" \ +- "sh $0, "#N"(%[pout]) \n\t" \ ++ "sh $0, " #J "(%[ppin]) \n\t" \ ++ "sh $0, " #N "(%[pout]) \n\t" \ + "or %[ret], %[ret], %[level] \n\t" \ +- "sh %[temp5], "#J"+2(%[ppin]) \n\t" \ +- "sh %[level], "#N1"(%[pout]) \n\t" \ ++ "sh %[temp5], " #J "+2(%[ppin]) \n\t" \ ++ "sh %[level], " #N1 "(%[pout]) \n\t" \ + "j 3f \n\t" \ + "1: \n\t" \ +- "lhu %[temp1], "#J"(%[ppiq]) \n\t" \ +- "lw %[temp2], "#K"(%[ppbias]) \n\t" \ +- "ulw %[temp3], "#J"(%[ppq]) \n\t" \ ++ "lhu %[temp1], " #J "(%[ppiq]) \n\t" \ ++ "lw %[temp2], " #K "(%[ppbias]) \n\t" \ ++ "ulw %[temp3], " #J "(%[ppq]) \n\t" \ + "andi %[temp5], %[coeff], 0xffff \n\t" \ + "srl %[temp0], %[coeff], 16 \n\t" \ +- "lhu %[temp6], "#J"+2(%[ppiq]) \n\t" \ +- "lw %[coeff], "#K"+4(%[ppbias]) \n\t" \ ++ "lhu %[temp6], " #J "+2(%[ppiq]) \n\t" \ ++ "lw %[coeff], " #K "+4(%[ppbias]) \n\t" \ + "mul %[level], %[temp5], %[temp1] \n\t" \ + "mul %[temp4], %[temp0], %[temp6] \n\t" \ + "addu %[level], %[level], %[temp2] \n\t" \ @@ -1259,15 +1259,15 @@ static int SSE4x4(const uint8_t* a, const uint8_t* b) { - "subu.ph %[level], %[level], %[sign] \n\t" \ - "mul.ph %[temp3], %[level], %[temp3] \n\t" \ - "or %[ret], %[ret], %[level] \n\t" \ -- "sh %[level], "#N"(%[pout]) \n\t" \ -+ "sh %[level], " #N "(%[pout]) \n\t" \ - "srl %[level], %[level], 16 \n\t" \ -- "sh %[level], "#N1"(%[pout]) \n\t" \ -- "usw %[temp3], "#J"(%[ppin]) \n\t" \ -+ "sh %[level], " #N1 "(%[pout]) \n\t" \ -+ "usw %[temp3], " #J "(%[ppin]) \n\t" \ - "j 3f \n\t" \ - "0: \n\t" \ -- "sh $0, "#N"(%[pout]) \n\t" \ -- "sh $0, "#N1"(%[pout]) \n\t" \ -- "usw $0, "#J"(%[ppin]) \n\t" \ -+ "sh $0, " #N "(%[pout]) \n\t" \ -+ "sh $0, " #N1 "(%[pout]) \n\t" \ -+ "usw $0, " #J "(%[ppin]) \n\t" \ - "3: \n\t" - - static int QuantizeBlock(int16_t in[16], int16_t out[16], + "subu.ph %[level], %[level], %[sign] \n\t" \ + "mul.ph %[temp3], %[level], %[temp3] \n\t" \ + "or %[ret], %[ret], %[level] \n\t" \ +- "sh %[level], "#N"(%[pout]) \n\t" \ ++ "sh %[level], " #N "(%[pout]) \n\t" \ + "srl %[level], %[level], 16 \n\t" \ +- "sh %[level], "#N1"(%[pout]) \n\t" \ +- "usw %[temp3], "#J"(%[ppin]) \n\t" \ ++ "sh %[level], " #N1 "(%[pout]) \n\t" \ ++ "usw %[temp3], " #J "(%[ppin]) \n\t" \ + "j 3f \n\t" \ + "0: \n\t" \ +- "sh $0, "#N"(%[pout]) \n\t" \ +- "sh $0, "#N1"(%[pout]) \n\t" \ +- "usw $0, "#J"(%[ppin]) \n\t" \ ++ "sh $0, " #N "(%[pout]) \n\t" \ ++ "sh $0, " #N1 "(%[pout]) \n\t" \ ++ "usw $0, " #J "(%[ppin]) \n\t" \ + "3: \n\t" + + static int QuantizeBlock(int16_t in[16], int16_t out[16], @@ -1326,37 +1326,37 @@ static int Quantize2Blocks(int16_t in[32], int16_t out[32], - // A, B, C, D - offset in bytes to load from in buffer - // TEMP0, TEMP1 - registers for corresponding tmp elements - #define HORIZONTAL_PASS_WHT(A, B, C, D, TEMP0, TEMP1) \ -- "lh %["#TEMP0"], "#A"(%[in]) \n\t" \ -- "lh %["#TEMP1"], "#B"(%[in]) \n\t" \ -- "lh %[temp8], "#C"(%[in]) \n\t" \ -- "lh %[temp9], "#D"(%[in]) \n\t" \ -- "ins %["#TEMP1"], %["#TEMP0"], 16, 16 \n\t" \ -+ "lh %[" #TEMP0 "], " #A "(%[in]) \n\t" \ -+ "lh %[" #TEMP1 "], " #B "(%[in]) \n\t" \ -+ "lh %[temp8], " #C "(%[in]) \n\t" \ -+ "lh %[temp9], " #D "(%[in]) \n\t" \ -+ "ins %[" #TEMP1 "], %[" #TEMP0 "], 16, 16 \n\t" \ - "ins %[temp9], %[temp8], 16, 16 \n\t" \ -- "subq.ph %[temp8], %["#TEMP1"], %[temp9] \n\t" \ -- "addq.ph %[temp9], %["#TEMP1"], %[temp9] \n\t" \ -- "precrq.ph.w %["#TEMP0"], %[temp8], %[temp9] \n\t" \ -+ "subq.ph %[temp8], %[" #TEMP1 "], %[temp9] \n\t" \ -+ "addq.ph %[temp9], %[" #TEMP1 "], %[temp9] \n\t" \ -+ "precrq.ph.w %[" #TEMP0 "], %[temp8], %[temp9] \n\t" \ - "append %[temp8], %[temp9], 16 \n\t" \ -- "subq.ph %["#TEMP1"], %["#TEMP0"], %[temp8] \n\t" \ -- "addq.ph %["#TEMP0"], %["#TEMP0"], %[temp8] \n\t" \ -- "rotr %["#TEMP1"], %["#TEMP1"], 16 \n\t" -+ "subq.ph %[" #TEMP1 "], %[" #TEMP0 "], %[temp8] \n\t" \ -+ "addq.ph %[" #TEMP0 "], %[" #TEMP0 "], %[temp8] \n\t" \ -+ "rotr %[" #TEMP1 "], %[" #TEMP1 "], 16 \n\t" - - // macro for one vertical pass in FTransformWHT - // temp0..temp7 holds tmp[0]..tmp[15] - // A, B, C, D - offsets in bytes to store to out buffer - // TEMP0, TEMP2, TEMP4 and TEMP6 - registers for corresponding tmp elements - #define VERTICAL_PASS_WHT(A, B, C, D, TEMP0, TEMP2, TEMP4, TEMP6) \ -- "addq.ph %[temp8], %["#TEMP0"], %["#TEMP4"] \n\t" \ -- "addq.ph %[temp9], %["#TEMP2"], %["#TEMP6"] \n\t" \ -- "subq.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP6"] \n\t" \ -- "subq.ph %["#TEMP6"], %["#TEMP0"], %["#TEMP4"] \n\t" \ -- "addqh.ph %["#TEMP0"], %[temp8], %[temp9] \n\t" \ -- "subqh.ph %["#TEMP4"], %["#TEMP6"], %["#TEMP2"] \n\t" \ -- "addqh.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP6"] \n\t" \ -- "subqh.ph %["#TEMP6"], %[temp8], %[temp9] \n\t" \ -- "usw %["#TEMP0"], "#A"(%[out]) \n\t" \ -- "usw %["#TEMP2"], "#B"(%[out]) \n\t" \ -- "usw %["#TEMP4"], "#C"(%[out]) \n\t" \ -- "usw %["#TEMP6"], "#D"(%[out]) \n\t" -+ "addq.ph %[temp8], %[" #TEMP0 "], %[" #TEMP4 "] \n\t" \ -+ "addq.ph %[temp9], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \ -+ "subq.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \ -+ "subq.ph %[" #TEMP6 "], %[" #TEMP0 "], %[" #TEMP4 "] \n\t" \ -+ "addqh.ph %[" #TEMP0 "], %[temp8], %[temp9] \n\t" \ -+ "subqh.ph %[" #TEMP4 "], %[" #TEMP6 "], %[" #TEMP2 "] \n\t" \ -+ "addqh.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \ -+ "subqh.ph %[" #TEMP6 "], %[temp8], %[temp9] \n\t" \ -+ "usw %[" #TEMP0 "], " #A "(%[out]) \n\t" \ -+ "usw %[" #TEMP2 "], " #B "(%[out]) \n\t" \ -+ "usw %[" #TEMP4 "], " #C "(%[out]) \n\t" \ -+ "usw %[" #TEMP6 "], " #D "(%[out]) \n\t" - - static void FTransformWHT(const int16_t* in, int16_t* out) { - int temp0, temp1, temp2, temp3, temp4; + // A, B, C, D - offset in bytes to load from in buffer + // TEMP0, TEMP1 - registers for corresponding tmp elements + #define HORIZONTAL_PASS_WHT(A, B, C, D, TEMP0, TEMP1) \ +- "lh %["#TEMP0"], "#A"(%[in]) \n\t" \ +- "lh %["#TEMP1"], "#B"(%[in]) \n\t" \ +- "lh %[temp8], "#C"(%[in]) \n\t" \ +- "lh %[temp9], "#D"(%[in]) \n\t" \ +- "ins %["#TEMP1"], %["#TEMP0"], 16, 16 \n\t" \ ++ "lh %[" #TEMP0 "], " #A "(%[in]) \n\t" \ ++ "lh %[" #TEMP1 "], " #B "(%[in]) \n\t" \ ++ "lh %[temp8], " #C "(%[in]) \n\t" \ ++ "lh %[temp9], " #D "(%[in]) \n\t" \ ++ "ins %[" #TEMP1 "], %[" #TEMP0 "], 16, 16 \n\t" \ + "ins %[temp9], %[temp8], 16, 16 \n\t" \ +- "subq.ph %[temp8], %["#TEMP1"], %[temp9] \n\t" \ +- "addq.ph %[temp9], %["#TEMP1"], %[temp9] \n\t" \ +- "precrq.ph.w %["#TEMP0"], %[temp8], %[temp9] \n\t" \ ++ "subq.ph %[temp8], %[" #TEMP1 "], %[temp9] \n\t" \ ++ "addq.ph %[temp9], %[" #TEMP1 "], %[temp9] \n\t" \ ++ "precrq.ph.w %[" #TEMP0 "], %[temp8], %[temp9] \n\t" \ + "append %[temp8], %[temp9], 16 \n\t" \ +- "subq.ph %["#TEMP1"], %["#TEMP0"], %[temp8] \n\t" \ +- "addq.ph %["#TEMP0"], %["#TEMP0"], %[temp8] \n\t" \ +- "rotr %["#TEMP1"], %["#TEMP1"], 16 \n\t" ++ "subq.ph %[" #TEMP1 "], %[" #TEMP0 "], %[temp8] \n\t" \ ++ "addq.ph %[" #TEMP0 "], %[" #TEMP0 "], %[temp8] \n\t" \ ++ "rotr %[" #TEMP1 "], %[" #TEMP1 "], 16 \n\t" + + // macro for one vertical pass in FTransformWHT + // temp0..temp7 holds tmp[0]..tmp[15] + // A, B, C, D - offsets in bytes to store to out buffer + // TEMP0, TEMP2, TEMP4 and TEMP6 - registers for corresponding tmp elements + #define VERTICAL_PASS_WHT(A, B, C, D, TEMP0, TEMP2, TEMP4, TEMP6) \ +- "addq.ph %[temp8], %["#TEMP0"], %["#TEMP4"] \n\t" \ +- "addq.ph %[temp9], %["#TEMP2"], %["#TEMP6"] \n\t" \ +- "subq.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP6"] \n\t" \ +- "subq.ph %["#TEMP6"], %["#TEMP0"], %["#TEMP4"] \n\t" \ +- "addqh.ph %["#TEMP0"], %[temp8], %[temp9] \n\t" \ +- "subqh.ph %["#TEMP4"], %["#TEMP6"], %["#TEMP2"] \n\t" \ +- "addqh.ph %["#TEMP2"], %["#TEMP2"], %["#TEMP6"] \n\t" \ +- "subqh.ph %["#TEMP6"], %[temp8], %[temp9] \n\t" \ +- "usw %["#TEMP0"], "#A"(%[out]) \n\t" \ +- "usw %["#TEMP2"], "#B"(%[out]) \n\t" \ +- "usw %["#TEMP4"], "#C"(%[out]) \n\t" \ +- "usw %["#TEMP6"], "#D"(%[out]) \n\t" ++ "addq.ph %[temp8], %[" #TEMP0 "], %[" #TEMP4 "] \n\t" \ ++ "addq.ph %[temp9], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \ ++ "subq.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \ ++ "subq.ph %[" #TEMP6 "], %[" #TEMP0 "], %[" #TEMP4 "] \n\t" \ ++ "addqh.ph %[" #TEMP0 "], %[temp8], %[temp9] \n\t" \ ++ "subqh.ph %[" #TEMP4 "], %[" #TEMP6 "], %[" #TEMP2 "] \n\t" \ ++ "addqh.ph %[" #TEMP2 "], %[" #TEMP2 "], %[" #TEMP6 "] \n\t" \ ++ "subqh.ph %[" #TEMP6 "], %[temp8], %[temp9] \n\t" \ ++ "usw %[" #TEMP0 "], " #A "(%[out]) \n\t" \ ++ "usw %[" #TEMP2 "], " #B "(%[out]) \n\t" \ ++ "usw %[" #TEMP4 "], " #C "(%[out]) \n\t" \ ++ "usw %[" #TEMP6 "], " #D "(%[out]) \n\t" + + static void FTransformWHT(const int16_t* in, int16_t* out) { + int temp0, temp1, temp2, temp3, temp4; @@ -1385,10 +1385,10 @@ static void FTransformWHT(const int16_t* in, int16_t* out) { - // convert 8 coeffs at time - // A, B, C, D - offsets in bytes to load from out buffer - #define CONVERT_COEFFS_TO_BIN(A, B, C, D) \ -- "ulw %[temp0], "#A"(%[out]) \n\t" \ -- "ulw %[temp1], "#B"(%[out]) \n\t" \ -- "ulw %[temp2], "#C"(%[out]) \n\t" \ -- "ulw %[temp3], "#D"(%[out]) \n\t" \ -+ "ulw %[temp0], " #A "(%[out]) \n\t" \ -+ "ulw %[temp1], " #B "(%[out]) \n\t" \ -+ "ulw %[temp2], " #C "(%[out]) \n\t" \ -+ "ulw %[temp3], " #D "(%[out]) \n\t" \ - "absq_s.ph %[temp0], %[temp0] \n\t" \ - "absq_s.ph %[temp1], %[temp1] \n\t" \ - "absq_s.ph %[temp2], %[temp2] \n\t" \ + // convert 8 coeffs at time + // A, B, C, D - offsets in bytes to load from out buffer + #define CONVERT_COEFFS_TO_BIN(A, B, C, D) \ +- "ulw %[temp0], "#A"(%[out]) \n\t" \ +- "ulw %[temp1], "#B"(%[out]) \n\t" \ +- "ulw %[temp2], "#C"(%[out]) \n\t" \ +- "ulw %[temp3], "#D"(%[out]) \n\t" \ ++ "ulw %[temp0], " #A "(%[out]) \n\t" \ ++ "ulw %[temp1], " #B "(%[out]) \n\t" \ ++ "ulw %[temp2], " #C "(%[out]) \n\t" \ ++ "ulw %[temp3], " #D "(%[out]) \n\t" \ + "absq_s.ph %[temp0], %[temp0] \n\t" \ + "absq_s.ph %[temp1], %[temp1] \n\t" \ + "absq_s.ph %[temp2], %[temp2] \n\t" \ diff --git a/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c index 6c34efb..6a1f8f4 100644 --- a/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c +++ b/Source/LibWebP/src/dsp/dsp.filters_mips_dsp_r2.c @@ -48,7 +48,7 @@ - "srl %[temp0], %[length], 0x2 \n\t" \ - "beqz %[temp0], 4f \n\t" \ - " andi %[temp6], %[length], 0x3 \n\t" \ -- ".if "#INVERSE" \n\t" \ -+ ".if " #INVERSE " \n\t" \ - "lbu %[temp1], -1(%[src]) \n\t" \ - "1: \n\t" \ - "lbu %[temp2], 0(%[src]) \n\t" \ + "srl %[temp0], %[length], 0x2 \n\t" \ + "beqz %[temp0], 4f \n\t" \ + " andi %[temp6], %[length], 0x3 \n\t" \ +- ".if "#INVERSE" \n\t" \ ++ ".if " #INVERSE " \n\t" \ + "lbu %[temp1], -1(%[src]) \n\t" \ + "1: \n\t" \ + "lbu %[temp2], 0(%[src]) \n\t" \ @@ -84,7 +84,7 @@ - "lbu %[temp1], -1(%[src]) \n\t" \ - "lbu %[temp2], 0(%[src]) \n\t" \ - "addiu %[src], %[src], 1 \n\t" \ -- ".if "#INVERSE" \n\t" \ -+ ".if " #INVERSE " \n\t" \ - "addu %[temp3], %[temp1], %[temp2] \n\t" \ - "sb %[temp3], -1(%[src]) \n\t" \ - ".else \n\t" \ + "lbu %[temp1], -1(%[src]) \n\t" \ + "lbu %[temp2], 0(%[src]) \n\t" \ + "addiu %[src], %[src], 1 \n\t" \ +- ".if "#INVERSE" \n\t" \ ++ ".if " #INVERSE " \n\t" \ + "addu %[temp3], %[temp1], %[temp2] \n\t" \ + "sb %[temp3], -1(%[src]) \n\t" \ + ".else \n\t" \ @@ -131,7 +131,7 @@ static WEBP_INLINE void PredictLine(const uint8_t* src, uint8_t* dst, - "ulw %[temp3], 4(%[src]) \n\t" \ - "ulw %[temp4], 4(%[pred]) \n\t" \ - "addiu %[src], %[src], 8 \n\t" \ -- ".if "#INVERSE" \n\t" \ -+ ".if " #INVERSE " \n\t" \ - "addu.qb %[temp5], %[temp1], %[temp2] \n\t" \ - "addu.qb %[temp6], %[temp3], %[temp4] \n\t" \ - ".else \n\t" \ + "ulw %[temp3], 4(%[src]) \n\t" \ + "ulw %[temp4], 4(%[pred]) \n\t" \ + "addiu %[src], %[src], 8 \n\t" \ +- ".if "#INVERSE" \n\t" \ ++ ".if " #INVERSE " \n\t" \ + "addu.qb %[temp5], %[temp1], %[temp2] \n\t" \ + "addu.qb %[temp6], %[temp3], %[temp4] \n\t" \ + ".else \n\t" \ @@ -152,7 +152,7 @@ static WEBP_INLINE void PredictLine(const uint8_t* src, uint8_t* dst, - "lbu %[temp2], 0(%[pred]) \n\t" \ - "addiu %[src], %[src], 1 \n\t" \ - "addiu %[pred], %[pred], 1 \n\t" \ -- ".if "#INVERSE" \n\t" \ -+ ".if " #INVERSE " \n\t" \ - "addu %[temp3], %[temp1], %[temp2] \n\t" \ - ".else \n\t" \ - "subu %[temp3], %[temp1], %[temp2] \n\t" \ + "lbu %[temp2], 0(%[pred]) \n\t" \ + "addiu %[src], %[src], 1 \n\t" \ + "addiu %[pred], %[pred], 1 \n\t" \ +- ".if "#INVERSE" \n\t" \ ++ ".if " #INVERSE " \n\t" \ + "addu %[temp3], %[temp1], %[temp2] \n\t" \ + ".else \n\t" \ + "subu %[temp3], %[temp1], %[temp2] \n\t" \ @@ -177,7 +177,7 @@ static WEBP_INLINE void PredictLine(const uint8_t* src, uint8_t* dst, - __asm__ volatile ( \ - "lbu %[temp1], 0(%[src]) \n\t" \ - "lbu %[temp2], 0(%[pred]) \n\t" \ -- ".if "#INVERSE" \n\t" \ -+ ".if " #INVERSE " \n\t" \ - "addu %[temp3], %[temp1], %[temp2] \n\t" \ - ".else \n\t" \ - "subu %[temp3], %[temp1], %[temp2] \n\t" \ + __asm__ volatile ( \ + "lbu %[temp1], 0(%[src]) \n\t" \ + "lbu %[temp2], 0(%[pred]) \n\t" \ +- ".if "#INVERSE" \n\t" \ ++ ".if " #INVERSE " \n\t" \ + "addu %[temp3], %[temp1], %[temp2] \n\t" \ + ".else \n\t" \ + "subu %[temp3], %[temp1], %[temp2] \n\t" \ diff --git a/Source/LibWebP/src/dsp/dsp.lossless_mips32.c b/Source/LibWebP/src/dsp/dsp.lossless_mips32.c index 68fbe85..abe97c1 100644 --- a/Source/LibWebP/src/dsp/dsp.lossless_mips32.c +++ b/Source/LibWebP/src/dsp/dsp.lossless_mips32.c @@ -285,28 +285,28 @@ static VP8LStreaks HuffmanCostCombinedCount(const uint32_t* X, - // literal_ and successive histograms could be unaligned - // so we must use ulw and usw - #define ADD_TO_OUT(A, B, C, D, E, P0, P1, P2) \ -- "ulw %[temp0], "#A"(%["#P0"]) \n\t" \ -- "ulw %[temp1], "#B"(%["#P0"]) \n\t" \ -- "ulw %[temp2], "#C"(%["#P0"]) \n\t" \ -- "ulw %[temp3], "#D"(%["#P0"]) \n\t" \ -- "ulw %[temp4], "#A"(%["#P1"]) \n\t" \ -- "ulw %[temp5], "#B"(%["#P1"]) \n\t" \ -- "ulw %[temp6], "#C"(%["#P1"]) \n\t" \ -- "ulw %[temp7], "#D"(%["#P1"]) \n\t" \ -+ "ulw %[temp0], " #A "(%[" #P0 "]) \n\t" \ -+ "ulw %[temp1], " #B "(%[" #P0 "]) \n\t" \ -+ "ulw %[temp2], " #C "(%[" #P0 "]) \n\t" \ -+ "ulw %[temp3], " #D "(%[" #P0 "]) \n\t" \ -+ "ulw %[temp4], " #A "(%[" #P1 "]) \n\t" \ -+ "ulw %[temp5], " #B "(%[" #P1 "]) \n\t" \ -+ "ulw %[temp6], " #C "(%[" #P1 "]) \n\t" \ -+ "ulw %[temp7], " #D "(%[" #P1 "]) \n\t" \ - "addu %[temp4], %[temp4], %[temp0] \n\t" \ - "addu %[temp5], %[temp5], %[temp1] \n\t" \ - "addu %[temp6], %[temp6], %[temp2] \n\t" \ - "addu %[temp7], %[temp7], %[temp3] \n\t" \ -- "addiu %["#P0"], %["#P0"], 16 \n\t" \ -- ".if "#E" == 1 \n\t" \ -- "addiu %["#P1"], %["#P1"], 16 \n\t" \ -+ "addiu %[" #P0 "], %[" #P0 "], 16 \n\t" \ -+ ".if " #E " == 1 \n\t" \ -+ "addiu %[" #P1 "], %[" #P1 "], 16 \n\t" \ - ".endif \n\t" \ -- "usw %[temp4], "#A"(%["#P2"]) \n\t" \ -- "usw %[temp5], "#B"(%["#P2"]) \n\t" \ -- "usw %[temp6], "#C"(%["#P2"]) \n\t" \ -- "usw %[temp7], "#D"(%["#P2"]) \n\t" \ -- "addiu %["#P2"], %["#P2"], 16 \n\t" \ -- "bne %["#P0"], %[LoopEnd], 1b \n\t" \ -+ "usw %[temp4], " #A "(%[" #P2 "]) \n\t" \ -+ "usw %[temp5], " #B "(%[" #P2 "]) \n\t" \ -+ "usw %[temp6], " #C "(%[" #P2 "]) \n\t" \ -+ "usw %[temp7], " #D "(%[" #P2 "]) \n\t" \ -+ "addiu %[" #P2 "], %[" #P2 "], 16 \n\t" \ -+ "bne %[" #P0 "], %[LoopEnd], 1b \n\t" \ - ".set pop \n\t" \ - - #define ASM_END_COMMON_0 \ + // literal_ and successive histograms could be unaligned + // so we must use ulw and usw + #define ADD_TO_OUT(A, B, C, D, E, P0, P1, P2) \ +- "ulw %[temp0], "#A"(%["#P0"]) \n\t" \ +- "ulw %[temp1], "#B"(%["#P0"]) \n\t" \ +- "ulw %[temp2], "#C"(%["#P0"]) \n\t" \ +- "ulw %[temp3], "#D"(%["#P0"]) \n\t" \ +- "ulw %[temp4], "#A"(%["#P1"]) \n\t" \ +- "ulw %[temp5], "#B"(%["#P1"]) \n\t" \ +- "ulw %[temp6], "#C"(%["#P1"]) \n\t" \ +- "ulw %[temp7], "#D"(%["#P1"]) \n\t" \ ++ "ulw %[temp0], " #A "(%[" #P0 "]) \n\t" \ ++ "ulw %[temp1], " #B "(%[" #P0 "]) \n\t" \ ++ "ulw %[temp2], " #C "(%[" #P0 "]) \n\t" \ ++ "ulw %[temp3], " #D "(%[" #P0 "]) \n\t" \ ++ "ulw %[temp4], " #A "(%[" #P1 "]) \n\t" \ ++ "ulw %[temp5], " #B "(%[" #P1 "]) \n\t" \ ++ "ulw %[temp6], " #C "(%[" #P1 "]) \n\t" \ ++ "ulw %[temp7], " #D "(%[" #P1 "]) \n\t" \ + "addu %[temp4], %[temp4], %[temp0] \n\t" \ + "addu %[temp5], %[temp5], %[temp1] \n\t" \ + "addu %[temp6], %[temp6], %[temp2] \n\t" \ + "addu %[temp7], %[temp7], %[temp3] \n\t" \ +- "addiu %["#P0"], %["#P0"], 16 \n\t" \ +- ".if "#E" == 1 \n\t" \ +- "addiu %["#P1"], %["#P1"], 16 \n\t" \ ++ "addiu %[" #P0 "], %[" #P0 "], 16 \n\t" \ ++ ".if " #E " == 1 \n\t" \ ++ "addiu %[" #P1 "], %[" #P1 "], 16 \n\t" \ + ".endif \n\t" \ +- "usw %[temp4], "#A"(%["#P2"]) \n\t" \ +- "usw %[temp5], "#B"(%["#P2"]) \n\t" \ +- "usw %[temp6], "#C"(%["#P2"]) \n\t" \ +- "usw %[temp7], "#D"(%["#P2"]) \n\t" \ +- "addiu %["#P2"], %["#P2"], 16 \n\t" \ +- "bne %["#P0"], %[LoopEnd], 1b \n\t" \ ++ "usw %[temp4], " #A "(%[" #P2 "]) \n\t" \ ++ "usw %[temp5], " #B "(%[" #P2 "]) \n\t" \ ++ "usw %[temp6], " #C "(%[" #P2 "]) \n\t" \ ++ "usw %[temp7], " #D "(%[" #P2 "]) \n\t" \ ++ "addiu %[" #P2 "], %[" #P2 "], 16 \n\t" \ ++ "bne %[" #P0 "], %[LoopEnd], 1b \n\t" \ + ".set pop \n\t" \ + + #define ASM_END_COMMON_0 \ diff --git a/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c index 821cda9..31ac181 100644 --- a/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c +++ b/Source/LibWebP/src/dsp/dsp.lossless_mips_dsp_r2.c @@ -29,14 +29,14 @@ static void FUNC_NAME(const TYPE* src, \ - for (x = 0; x < (width >> 2); ++x) { \ - int tmp1, tmp2, tmp3, tmp4; \ - __asm__ volatile ( \ -- ".ifc "#TYPE", uint8_t \n\t" \ -+ ".ifc " #TYPE ", uint8_t \n\t" \ - "lbu %[tmp1], 0(%[src]) \n\t" \ - "lbu %[tmp2], 1(%[src]) \n\t" \ - "lbu %[tmp3], 2(%[src]) \n\t" \ - "lbu %[tmp4], 3(%[src]) \n\t" \ - "addiu %[src], %[src], 4 \n\t" \ - ".endif \n\t" \ -- ".ifc "#TYPE", uint32_t \n\t" \ -+ ".ifc " #TYPE ", uint32_t \n\t" \ - "lw %[tmp1], 0(%[src]) \n\t" \ - "lw %[tmp2], 4(%[src]) \n\t" \ - "lw %[tmp3], 8(%[src]) \n\t" \ + for (x = 0; x < (width >> 2); ++x) { \ + int tmp1, tmp2, tmp3, tmp4; \ + __asm__ volatile ( \ +- ".ifc "#TYPE", uint8_t \n\t" \ ++ ".ifc " #TYPE ", uint8_t \n\t" \ + "lbu %[tmp1], 0(%[src]) \n\t" \ + "lbu %[tmp2], 1(%[src]) \n\t" \ + "lbu %[tmp3], 2(%[src]) \n\t" \ + "lbu %[tmp4], 3(%[src]) \n\t" \ + "addiu %[src], %[src], 4 \n\t" \ + ".endif \n\t" \ +- ".ifc "#TYPE", uint32_t \n\t" \ ++ ".ifc " #TYPE ", uint32_t \n\t" \ + "lw %[tmp1], 0(%[src]) \n\t" \ + "lw %[tmp2], 4(%[src]) \n\t" \ + "lw %[tmp3], 8(%[src]) \n\t" \ @@ -55,7 +55,7 @@ static void FUNC_NAME(const TYPE* src, \ - "lwx %[tmp2], %[tmp2](%[color_map]) \n\t" \ - "lwx %[tmp3], %[tmp3](%[color_map]) \n\t" \ - "lwx %[tmp4], %[tmp4](%[color_map]) \n\t" \ -- ".ifc "#TYPE", uint8_t \n\t" \ -+ ".ifc " #TYPE ", uint8_t \n\t" \ - "ext %[tmp1], %[tmp1], 8, 8 \n\t" \ - "ext %[tmp2], %[tmp2], 8, 8 \n\t" \ - "ext %[tmp3], %[tmp3], 8, 8 \n\t" \ + "lwx %[tmp2], %[tmp2](%[color_map]) \n\t" \ + "lwx %[tmp3], %[tmp3](%[color_map]) \n\t" \ + "lwx %[tmp4], %[tmp4](%[color_map]) \n\t" \ +- ".ifc "#TYPE", uint8_t \n\t" \ ++ ".ifc " #TYPE ", uint8_t \n\t" \ + "ext %[tmp1], %[tmp1], 8, 8 \n\t" \ + "ext %[tmp2], %[tmp2], 8, 8 \n\t" \ + "ext %[tmp3], %[tmp3], 8, 8 \n\t" \ @@ -66,7 +66,7 @@ static void FUNC_NAME(const TYPE* src, \ - "sb %[tmp4], 3(%[dst]) \n\t" \ - "addiu %[dst], %[dst], 4 \n\t" \ - ".endif \n\t" \ -- ".ifc "#TYPE", uint32_t \n\t" \ -+ ".ifc " #TYPE ", uint32_t \n\t" \ - "sw %[tmp1], 0(%[dst]) \n\t" \ - "sw %[tmp2], 4(%[dst]) \n\t" \ - "sw %[tmp3], 8(%[dst]) \n\t" \ + "sb %[tmp4], 3(%[dst]) \n\t" \ + "addiu %[dst], %[dst], 4 \n\t" \ + ".endif \n\t" \ +- ".ifc "#TYPE", uint32_t \n\t" \ ++ ".ifc " #TYPE ", uint32_t \n\t" \ + "sw %[tmp1], 0(%[dst]) \n\t" \ + "sw %[tmp2], 4(%[dst]) \n\t" \ + "sw %[tmp3], 8(%[dst]) \n\t" \ diff --git a/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c index a7864a0..cb3adfe 100644 --- a/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c +++ b/Source/LibWebP/src/dsp/dsp.upsampling_mips_dsp_r2.c @@ -34,15 +34,15 @@ - G = G - t2 + kGCst; \ - B = B + kBCst; \ - __asm__ volatile ( \ -- "shll_s.w %["#R"], %["#R"], 9 \n\t" \ -- "shll_s.w %["#G"], %["#G"], 9 \n\t" \ -- "shll_s.w %["#B"], %["#B"], 9 \n\t" \ -- "precrqu_s.qb.ph %["#R"], %["#R"], $zero \n\t" \ -- "precrqu_s.qb.ph %["#G"], %["#G"], $zero \n\t" \ -- "precrqu_s.qb.ph %["#B"], %["#B"], $zero \n\t" \ -- "srl %["#R"], %["#R"], 24 \n\t" \ -- "srl %["#G"], %["#G"], 24 \n\t" \ -- "srl %["#B"], %["#B"], 24 \n\t" \ -+ "shll_s.w %[" #R "], %[" #R "], 9 \n\t" \ -+ "shll_s.w %[" #G "], %[" #G "], 9 \n\t" \ -+ "shll_s.w %[" #B "], %[" #B "], 9 \n\t" \ -+ "precrqu_s.qb.ph %[" #R "], %[" #R "], $zero \n\t" \ -+ "precrqu_s.qb.ph %[" #G "], %[" #G "], $zero \n\t" \ -+ "precrqu_s.qb.ph %[" #B "], %[" #B "], $zero \n\t" \ -+ "srl %[" #R "], %[" #R "], 24 \n\t" \ -+ "srl %[" #G "], %[" #G "], 24 \n\t" \ -+ "srl %[" #B "], %[" #B "], 24 \n\t" \ - : [R]"+r"(R), [G]"+r"(G), [B]"+r"(B) \ - : \ - ); \ + G = G - t2 + kGCst; \ + B = B + kBCst; \ + __asm__ volatile ( \ +- "shll_s.w %["#R"], %["#R"], 9 \n\t" \ +- "shll_s.w %["#G"], %["#G"], 9 \n\t" \ +- "shll_s.w %["#B"], %["#B"], 9 \n\t" \ +- "precrqu_s.qb.ph %["#R"], %["#R"], $zero \n\t" \ +- "precrqu_s.qb.ph %["#G"], %["#G"], $zero \n\t" \ +- "precrqu_s.qb.ph %["#B"], %["#B"], $zero \n\t" \ +- "srl %["#R"], %["#R"], 24 \n\t" \ +- "srl %["#G"], %["#G"], 24 \n\t" \ +- "srl %["#B"], %["#B"], 24 \n\t" \ ++ "shll_s.w %[" #R "], %[" #R "], 9 \n\t" \ ++ "shll_s.w %[" #G "], %[" #G "], 9 \n\t" \ ++ "shll_s.w %[" #B "], %[" #B "], 9 \n\t" \ ++ "precrqu_s.qb.ph %[" #R "], %[" #R "], $zero \n\t" \ ++ "precrqu_s.qb.ph %[" #G "], %[" #G "], $zero \n\t" \ ++ "precrqu_s.qb.ph %[" #B "], %[" #B "], $zero \n\t" \ ++ "srl %[" #R "], %[" #R "], 24 \n\t" \ ++ "srl %[" #G "], %[" #G "], 24 \n\t" \ ++ "srl %[" #B "], %[" #B "], 24 \n\t" \ + : [R]"+r"(R), [G]"+r"(G), [B]"+r"(B) \ + : \ + ); \ diff --git a/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c b/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c index 66adde5..51cbe9e 100644 --- a/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c +++ b/Source/LibWebP/src/dsp/dsp.yuv_mips_dsp_r2.c @@ -39,12 +39,12 @@ - "addu %[temp5], %[temp0], %[temp1] \n\t" \ - "subu %[temp6], %[temp0], %[temp2] \n\t" \ - "addu %[temp7], %[temp0], %[temp4] \n\t" \ --".if "#K" \n\t" \ -+".if " #K " \n\t" \ - "lbu %[temp0], 1(%[y]) \n\t" \ - ".endif \n\t" \ - "shll_s.w %[temp5], %[temp5], 9 \n\t" \ - "shll_s.w %[temp6], %[temp6], 9 \n\t" \ --".if "#K" \n\t" \ -+".if " #K " \n\t" \ - "mul %[temp0], %[t_con_5], %[temp0] \n\t" \ - ".endif \n\t" \ - "shll_s.w %[temp7], %[temp7], 9 \n\t" \ + "addu %[temp5], %[temp0], %[temp1] \n\t" \ + "subu %[temp6], %[temp0], %[temp2] \n\t" \ + "addu %[temp7], %[temp0], %[temp4] \n\t" \ +-".if "#K" \n\t" \ ++".if " #K " \n\t" \ + "lbu %[temp0], 1(%[y]) \n\t" \ + ".endif \n\t" \ + "shll_s.w %[temp5], %[temp5], 9 \n\t" \ + "shll_s.w %[temp6], %[temp6], 9 \n\t" \ +-".if "#K" \n\t" \ ++".if " #K " \n\t" \ + "mul %[temp0], %[t_con_5], %[temp0] \n\t" \ + ".endif \n\t" \ + "shll_s.w %[temp7], %[temp7], 9 \n\t" \ @@ -54,9 +54,9 @@ - "srl %[temp5], %[temp5], 24 \n\t" \ - "srl %[temp6], %[temp6], 24 \n\t" \ - "srl %[temp7], %[temp7], 24 \n\t" \ -- "sb %[temp5], "#R"(%[dst]) \n\t" \ -- "sb %[temp6], "#G"(%[dst]) \n\t" \ -- "sb %[temp7], "#B"(%[dst]) \n\t" \ -+ "sb %[temp5], " #R "(%[dst]) \n\t" \ -+ "sb %[temp6], " #G "(%[dst]) \n\t" \ -+ "sb %[temp7], " #B "(%[dst]) \n\t" \ - - #define ASM_CLOBBER_LIST() \ - : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), \ + "srl %[temp5], %[temp5], 24 \n\t" \ + "srl %[temp6], %[temp6], 24 \n\t" \ + "srl %[temp7], %[temp7], 24 \n\t" \ +- "sb %[temp5], "#R"(%[dst]) \n\t" \ +- "sb %[temp6], "#G"(%[dst]) \n\t" \ +- "sb %[temp7], "#B"(%[dst]) \n\t" \ ++ "sb %[temp5], " #R "(%[dst]) \n\t" \ ++ "sb %[temp6], " #G "(%[dst]) \n\t" \ ++ "sb %[temp7], " #B "(%[dst]) \n\t" \ + + #define ASM_CLOBBER_LIST() \ + : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), \ -- 2.1.4 diff --git a/buildroot/package/libfreeimage/0004-fix-gcc-6.patch b/buildroot/package/libfreeimage/0004-fix-gcc-6.patch index 7b442abdc..0f10dec71 100644 --- a/buildroot/package/libfreeimage/0004-fix-gcc-6.patch +++ b/buildroot/package/libfreeimage/0004-fix-gcc-6.patch @@ -12,20 +12,20 @@ diff -durN a/Source/LibRawLite/internal/dcraw_common.cpp b/Source/LibRawLite/int --- a/Source/LibRawLite/internal/dcraw_common.cpp +++ b/Source/LibRawLite/internal/dcraw_common.cpp @@ -2479,7 +2479,7 @@ - - void CLASS kodak_radc_load_raw() - { -- static const char src[] = { -+ static const signed char src[] = { - 1,1, 2,3, 3,4, 4,2, 5,7, 6,5, 7,6, 7,8, - 1,0, 2,1, 3,3, 4,4, 5,2, 6,7, 7,6, 8,5, 8,8, - 2,1, 2,3, 3,0, 3,2, 3,4, 4,6, 5,5, 6,7, 6,8, + + void CLASS kodak_radc_load_raw() + { +- static const char src[] = { ++ static const signed char src[] = { + 1,1, 2,3, 3,4, 4,2, 5,7, 6,5, 7,6, 7,8, + 1,0, 2,1, 3,3, 4,4, 5,2, 6,7, 7,6, 8,5, 8,8, + 2,1, 2,3, 3,0, 3,2, 3,4, 4,6, 5,5, 6,7, 6,8, @@ -4519,7 +4519,7 @@ - */ - void CLASS vng_interpolate() - { -- static const signed char *cp, terms[] = { -+ static const int *cp, terms[] = { - -2,-2,+0,-1,0,0x01, -2,-2,+0,+0,1,0x01, -2,-1,-1,+0,0,0x01, - -2,-1,+0,-1,0,0x02, -2,-1,+0,+0,0,0x03, -2,-1,+0,+1,1,0x01, - -2,+0,+0,-1,0,0x06, -2,+0,+0,+0,1,0x02, -2,+0,+0,+1,0,0x03, + */ + void CLASS vng_interpolate() + { +- static const signed char *cp, terms[] = { ++ static const int *cp, terms[] = { + -2,-2,+0,-1,0,0x01, -2,-2,+0,+0,1,0x01, -2,-1,-1,+0,0,0x01, + -2,-1,+0,-1,0,0x02, -2,-1,+0,+0,0,0x03, -2,-1,+0,+1,1,0x01, + -2,+0,+0,-1,0,0x06, -2,+0,+0,+0,1,0x02, -2,+0,+0,+1,0,0x03, diff --git a/buildroot/package/libfreeimage/0005-Manage-powf64-with-glibc.patch b/buildroot/package/libfreeimage/0005-Manage-powf64-with-glibc.patch index f85aef541..948ba06eb 100644 --- a/buildroot/package/libfreeimage/0005-Manage-powf64-with-glibc.patch +++ b/buildroot/package/libfreeimage/0005-Manage-powf64-with-glibc.patch @@ -17,709 +17,709 @@ index 6bf607d..3e52cec 100644 --- a/Source/LibRawLite/dcraw/dcraw.c +++ b/Source/LibRawLite/dcraw/dcraw.c @@ -6727,7 +6727,7 @@ static float powf_lim(float a, float b, float limup) - { - return (b>limup || b < -limup)?0.f:powf(a,b); - } --static float powf64(float a, float b) -+static float powf_64(float a, float b) - { - return powf_lim(a,b,64.f); - } + { + return (b>limup || b < -limup)?0.f:powf(a,b); + } +-static float powf64(float a, float b) ++static float powf_64(float a, float b) + { + return powf_lim(a,b,64.f); + } @@ -6764,7 +6764,7 @@ static float _CanonConvert2EV(short in) - static float _CanonConvertAperture(short in) - { - if (in == (short)0xffe0) return 0.0f; -- else return powf64(2.0f, _CanonConvert2EV(in) / 2.0f); -+ else return powf_64(2.0f, _CanonConvert2EV(in) / 2.0f); - } - - void CLASS setCanonBodyFeatures (unsigned id) + static float _CanonConvertAperture(short in) + { + if (in == (short)0xffe0) return 0.0f; +- else return powf64(2.0f, _CanonConvert2EV(in) / 2.0f); ++ else return powf_64(2.0f, _CanonConvert2EV(in) / 2.0f); + } + + void CLASS setCanonBodyFeatures (unsigned id) @@ -7046,15 +7046,15 @@ void CLASS processNikonLensData (uchar *LensData, unsigned len) - imgdata.lens.nikon.NikonLensIDNumber = LensData[i]; - imgdata.lens.nikon.NikonLensFStops = LensData[i + 1]; - imgdata.lens.makernotes.LensFStops = (float)imgdata.lens.nikon.NikonLensFStops /12.0f; -- imgdata.lens.makernotes.MinFocal = 5.0f * powf64(2.0f, (float)LensData[i + 2] / 24.0f); -- imgdata.lens.makernotes.MaxFocal = 5.0f * powf64(2.0f, (float)LensData[i + 3] / 24.0f); -- imgdata.lens.makernotes.MaxAp4MinFocal = powf64(2.0f, (float)LensData[i + 4] / 24.0f); -- imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(2.0f, (float)LensData[i + 5] / 24.0f); -+ imgdata.lens.makernotes.MinFocal = 5.0f * powf_64(2.0f, (float)LensData[i + 2] / 24.0f); -+ imgdata.lens.makernotes.MaxFocal = 5.0f * powf_64(2.0f, (float)LensData[i + 3] / 24.0f); -+ imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(2.0f, (float)LensData[i + 4] / 24.0f); -+ imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(2.0f, (float)LensData[i + 5] / 24.0f); - imgdata.lens.nikon.NikonMCUVersion = LensData[i + 6]; - if (i != 2) - { -- imgdata.lens.makernotes.CurFocal = 5.0f * powf64(2.0f, (float)LensData[i - 1] / 24.0f); -- imgdata.lens.nikon.NikonEffectiveMaxAp = powf64(2.0f, (float)LensData[i + 7] / 24.0f); -+ imgdata.lens.makernotes.CurFocal = 5.0f * powf_64(2.0f, (float)LensData[i - 1] / 24.0f); -+ imgdata.lens.nikon.NikonEffectiveMaxAp = powf_64(2.0f, (float)LensData[i + 7] / 24.0f); - } - imgdata.lens.makernotes.LensID = - (unsigned long long) LensData[i] << 56 | + imgdata.lens.nikon.NikonLensIDNumber = LensData[i]; + imgdata.lens.nikon.NikonLensFStops = LensData[i + 1]; + imgdata.lens.makernotes.LensFStops = (float)imgdata.lens.nikon.NikonLensFStops /12.0f; +- imgdata.lens.makernotes.MinFocal = 5.0f * powf64(2.0f, (float)LensData[i + 2] / 24.0f); +- imgdata.lens.makernotes.MaxFocal = 5.0f * powf64(2.0f, (float)LensData[i + 3] / 24.0f); +- imgdata.lens.makernotes.MaxAp4MinFocal = powf64(2.0f, (float)LensData[i + 4] / 24.0f); +- imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(2.0f, (float)LensData[i + 5] / 24.0f); ++ imgdata.lens.makernotes.MinFocal = 5.0f * powf_64(2.0f, (float)LensData[i + 2] / 24.0f); ++ imgdata.lens.makernotes.MaxFocal = 5.0f * powf_64(2.0f, (float)LensData[i + 3] / 24.0f); ++ imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(2.0f, (float)LensData[i + 4] / 24.0f); ++ imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(2.0f, (float)LensData[i + 5] / 24.0f); + imgdata.lens.nikon.NikonMCUVersion = LensData[i + 6]; + if (i != 2) + { +- imgdata.lens.makernotes.CurFocal = 5.0f * powf64(2.0f, (float)LensData[i - 1] / 24.0f); +- imgdata.lens.nikon.NikonEffectiveMaxAp = powf64(2.0f, (float)LensData[i + 7] / 24.0f); ++ imgdata.lens.makernotes.CurFocal = 5.0f * powf_64(2.0f, (float)LensData[i - 1] / 24.0f); ++ imgdata.lens.nikon.NikonEffectiveMaxAp = powf_64(2.0f, (float)LensData[i + 7] / 24.0f); + } + imgdata.lens.makernotes.LensID = + (unsigned long long) LensData[i] << 56 | @@ -7563,11 +7563,11 @@ void CLASS process_Sony_0x9050 (uchar * buf, unsigned id) - { - if (buf[0]) - imgdata.lens.makernotes.MaxAp = -- my_roundf(powf64(2.0f, ((float)SonySubstitution[buf[0]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; -+ my_roundf(powf_64(2.0f, ((float)SonySubstitution[buf[0]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; - - if (buf[1]) - imgdata.lens.makernotes.MinAp = -- my_roundf(powf64(2.0f, ((float)SonySubstitution[buf[1]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; -+ my_roundf(powf_64(2.0f, ((float)SonySubstitution[buf[1]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; - } - - if (imgdata.lens.makernotes.CameraMount != LIBRAW_MOUNT_FixedLens) + { + if (buf[0]) + imgdata.lens.makernotes.MaxAp = +- my_roundf(powf64(2.0f, ((float)SonySubstitution[buf[0]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; ++ my_roundf(powf_64(2.0f, ((float)SonySubstitution[buf[0]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; + + if (buf[1]) + imgdata.lens.makernotes.MinAp = +- my_roundf(powf64(2.0f, ((float)SonySubstitution[buf[1]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; ++ my_roundf(powf_64(2.0f, ((float)SonySubstitution[buf[1]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; + } + + if (imgdata.lens.makernotes.CameraMount != LIBRAW_MOUNT_FixedLens) @@ -7577,7 +7577,7 @@ void CLASS process_Sony_0x9050 (uchar * buf, unsigned id) - lid = SonySubstitution[buf[0x3d]] << 8 | - SonySubstitution[buf[0x3c]]; - imgdata.lens.makernotes.CurAp = -- powf64(2.0f, ((float)lid/256.0f - 16.0f) / 2.0f); -+ powf_64(2.0f, ((float)lid/256.0f - 16.0f) / 2.0f); - } - if (buf[0x105] && (imgdata.lens.makernotes.LensMount != LIBRAW_MOUNT_Canon_EF)) - imgdata.lens.makernotes.LensMount = + lid = SonySubstitution[buf[0x3d]] << 8 | + SonySubstitution[buf[0x3c]]; + imgdata.lens.makernotes.CurAp = +- powf64(2.0f, ((float)lid/256.0f - 16.0f) / 2.0f); ++ powf_64(2.0f, ((float)lid/256.0f - 16.0f) / 2.0f); + } + if (buf[0x105] && (imgdata.lens.makernotes.LensMount != LIBRAW_MOUNT_Canon_EF)) + imgdata.lens.makernotes.LensMount = @@ -7957,7 +7957,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - { - unsigned char cc; - fread(&cc, 1, 1, ifp); -- iso_speed = (int)(100.0 * powf64(2.0, (double)(cc) / 12.0 - 5.0)); -+ iso_speed = (int)(100.0 * powf_64(2.0, (double)(cc) / 12.0 - 5.0)); - break; - } - } + { + unsigned char cc; + fread(&cc, 1, 1, ifp); +- iso_speed = (int)(100.0 * powf64(2.0, (double)(cc) / 12.0 - 5.0)); ++ iso_speed = (int)(100.0 * powf_64(2.0, (double)(cc) / 12.0 - 5.0)); + break; + } + } @@ -7989,7 +7989,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - } - break; - case 0x1002: -- imgdata.lens.makernotes.CurAp = powf64(2.0f, getreal(type)/2); -+ imgdata.lens.makernotes.CurAp = powf_64(2.0f, getreal(type)/2); - break; - case 0x20100201: - imgdata.lens.makernotes.LensID = + } + break; + case 0x1002: +- imgdata.lens.makernotes.CurAp = powf64(2.0f, getreal(type)/2); ++ imgdata.lens.makernotes.CurAp = powf_64(2.0f, getreal(type)/2); + break; + case 0x20100201: + imgdata.lens.makernotes.LensID = @@ -8009,10 +8009,10 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - fread(imgdata.lens.makernotes.Lens, len, 1, ifp); - break; - case 0x20100205: -- imgdata.lens.makernotes.MaxAp4MinFocal = powf64(sqrt(2.0f), get2() / 256.0f); -+ imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(sqrt(2.0f), get2() / 256.0f); - break; - case 0x20100206: -- imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(sqrt(2.0f), get2() / 256.0f); -+ imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(sqrt(2.0f), get2() / 256.0f); - break; - case 0x20100207: - imgdata.lens.makernotes.MinFocal = (float)get2(); + fread(imgdata.lens.makernotes.Lens, len, 1, ifp); + break; + case 0x20100205: +- imgdata.lens.makernotes.MaxAp4MinFocal = powf64(sqrt(2.0f), get2() / 256.0f); ++ imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(sqrt(2.0f), get2() / 256.0f); + break; + case 0x20100206: +- imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(sqrt(2.0f), get2() / 256.0f); ++ imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(sqrt(2.0f), get2() / 256.0f); + break; + case 0x20100207: + imgdata.lens.makernotes.MinFocal = (float)get2(); @@ -8023,7 +8023,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - imgdata.lens.makernotes.MaxFocal = imgdata.lens.makernotes.MinFocal; - break; - case 0x2010020a: -- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(sqrt(2.0f), get2() / 256.0f); -+ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(sqrt(2.0f), get2() / 256.0f); - break; - case 0x20100301: - imgdata.lens.makernotes.TeleconverterID = fgetc(ifp) << 8; + imgdata.lens.makernotes.MaxFocal = imgdata.lens.makernotes.MinFocal; + break; + case 0x2010020a: +- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(sqrt(2.0f), get2() / 256.0f); ++ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(sqrt(2.0f), get2() / 256.0f); + break; + case 0x20100301: + imgdata.lens.makernotes.TeleconverterID = fgetc(ifp) << 8; @@ -8121,13 +8121,13 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - if (table_buf[iLensData+9] && - (fabs(imgdata.lens.makernotes.CurFocal) < 0.1f)) - imgdata.lens.makernotes.CurFocal = -- 10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2); -+ 10*(table_buf[iLensData+9]>>2) * powf_64(4, (table_buf[iLensData+9] & 0x03)-2); - if (table_buf[iLensData+10] & 0xf0) - imgdata.lens.makernotes.MaxAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); - if (table_buf[iLensData+10] & 0x0f) - imgdata.lens.makernotes.MinAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); - if ( - (imgdata.lens.makernotes.CamID != 0x12e6c) && // K-r - (imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 + if (table_buf[iLensData+9] && + (fabs(imgdata.lens.makernotes.CurFocal) < 0.1f)) + imgdata.lens.makernotes.CurFocal = +- 10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2); ++ 10*(table_buf[iLensData+9]>>2) * powf_64(4, (table_buf[iLensData+9] & 0x03)-2); + if (table_buf[iLensData+10] & 0xf0) + imgdata.lens.makernotes.MaxAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); + if (table_buf[iLensData+10] & 0x0f) + imgdata.lens.makernotes.MinAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); + if ( + (imgdata.lens.makernotes.CamID != 0x12e6c) && // K-r + (imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 @@ -8148,14 +8148,14 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - if ((table_buf[iLensData+14] > 1) && - (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) - imgdata.lens.makernotes.MaxAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); - } - else if ((imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 - (table_buf[iLensData+15] > 1) && - (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) - { - imgdata.lens.makernotes.MaxAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); - } - } - free(table_buf); + if ((table_buf[iLensData+14] > 1) && + (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) + imgdata.lens.makernotes.MaxAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); + } + else if ((imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 + (table_buf[iLensData+15] > 1) && + (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) + { + imgdata.lens.makernotes.MaxAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); + } + } + free(table_buf); @@ -8321,7 +8321,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - lid = (((ushort)table_buf[2])<<8) | - ((ushort)table_buf[3]); - imgdata.lens.makernotes.CurAp = -- powf64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); -+ powf_64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); - } - break; - case 1536: + lid = (((ushort)table_buf[2])<<8) | + ((ushort)table_buf[3]); + imgdata.lens.makernotes.CurAp = +- powf64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); ++ powf_64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); + } + break; + case 1536: @@ -8801,7 +8801,7 @@ void CLASS parse_makernote (int base, int uptag) - } - break; - case 0x1002: -- imgdata.lens.makernotes.CurAp = powf64(2.0f, getreal(type)/2); -+ imgdata.lens.makernotes.CurAp = powf_64(2.0f, getreal(type)/2); - break; - case 0x20100201: - imgdata.lens.makernotes.LensID = + } + break; + case 0x1002: +- imgdata.lens.makernotes.CurAp = powf64(2.0f, getreal(type)/2); ++ imgdata.lens.makernotes.CurAp = powf_64(2.0f, getreal(type)/2); + break; + case 0x20100201: + imgdata.lens.makernotes.LensID = @@ -8821,10 +8821,10 @@ void CLASS parse_makernote (int base, int uptag) - fread(imgdata.lens.makernotes.Lens, len, 1, ifp); - break; - case 0x20100205: -- imgdata.lens.makernotes.MaxAp4MinFocal = powf64(sqrt(2.0f), get2() / 256.0f); -+ imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(sqrt(2.0f), get2() / 256.0f); - break; - case 0x20100206: -- imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(sqrt(2.0f), get2() / 256.0f); -+ imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(sqrt(2.0f), get2() / 256.0f); - break; - case 0x20100207: - imgdata.lens.makernotes.MinFocal = (float)get2(); + fread(imgdata.lens.makernotes.Lens, len, 1, ifp); + break; + case 0x20100205: +- imgdata.lens.makernotes.MaxAp4MinFocal = powf64(sqrt(2.0f), get2() / 256.0f); ++ imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(sqrt(2.0f), get2() / 256.0f); + break; + case 0x20100206: +- imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(sqrt(2.0f), get2() / 256.0f); ++ imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(sqrt(2.0f), get2() / 256.0f); + break; + case 0x20100207: + imgdata.lens.makernotes.MinFocal = (float)get2(); @@ -8835,7 +8835,7 @@ void CLASS parse_makernote (int base, int uptag) - imgdata.lens.makernotes.MaxFocal = imgdata.lens.makernotes.MinFocal; - break; - case 0x2010020a: -- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(sqrt(2.0f), get2() / 256.0f); -+ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(sqrt(2.0f), get2() / 256.0f); - break; - case 0x20100301: - imgdata.lens.makernotes.TeleconverterID = fgetc(ifp) << 8; + imgdata.lens.makernotes.MaxFocal = imgdata.lens.makernotes.MinFocal; + break; + case 0x2010020a: +- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(sqrt(2.0f), get2() / 256.0f); ++ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(sqrt(2.0f), get2() / 256.0f); + break; + case 0x20100301: + imgdata.lens.makernotes.TeleconverterID = fgetc(ifp) << 8; @@ -8993,13 +8993,13 @@ void CLASS parse_makernote (int base, int uptag) - { - if (table_buf[iLensData+9] && (fabs(imgdata.lens.makernotes.CurFocal) < 0.1f)) - imgdata.lens.makernotes.CurFocal = -- 10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2); -+ 10*(table_buf[iLensData+9]>>2) * powf_64(4, (table_buf[iLensData+9] & 0x03)-2); - if (table_buf[iLensData+10] & 0xf0) - imgdata.lens.makernotes.MaxAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); - if (table_buf[iLensData+10] & 0x0f) - imgdata.lens.makernotes.MinAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); - if ( - (imgdata.lens.makernotes.CamID != 0x12e6c) && // K-r - (imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 + { + if (table_buf[iLensData+9] && (fabs(imgdata.lens.makernotes.CurFocal) < 0.1f)) + imgdata.lens.makernotes.CurFocal = +- 10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2); ++ 10*(table_buf[iLensData+9]>>2) * powf_64(4, (table_buf[iLensData+9] & 0x03)-2); + if (table_buf[iLensData+10] & 0xf0) + imgdata.lens.makernotes.MaxAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); + if (table_buf[iLensData+10] & 0x0f) + imgdata.lens.makernotes.MinAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); + if ( + (imgdata.lens.makernotes.CamID != 0x12e6c) && // K-r + (imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 @@ -9020,14 +9020,14 @@ void CLASS parse_makernote (int base, int uptag) - if ((table_buf[iLensData+14] > 1) && - (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) - imgdata.lens.makernotes.MaxAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); - } - else if ((imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 - (table_buf[iLensData+15] > 1) && - (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) - { - imgdata.lens.makernotes.MaxAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); - } - } - free(table_buf); + if ((table_buf[iLensData+14] > 1) && + (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) + imgdata.lens.makernotes.MaxAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); + } + else if ((imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 + (table_buf[iLensData+15] > 1) && + (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) + { + imgdata.lens.makernotes.MaxAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); + } + } + free(table_buf); @@ -9188,7 +9188,7 @@ void CLASS parse_makernote (int base, int uptag) - lid = (((ushort)table_buf[2])<<8) | - ((ushort)table_buf[3]); - imgdata.lens.makernotes.CurAp = -- powf64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); -+ powf_64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); - } - break; - case 1536: + lid = (((ushort)table_buf[2])<<8) | + ((ushort)table_buf[3]); + imgdata.lens.makernotes.CurAp = +- powf64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); ++ powf_64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); + } + break; + case 1536: @@ -9273,15 +9273,15 @@ void CLASS parse_makernote (int base, int uptag) - { - unsigned char cc; - fread(&cc,1,1,ifp); -- iso_speed = int(100.0 * powf64(2.0f,float(cc)/12.0-5.0)); -+ iso_speed = int(100.0 * powf_64(2.0f,float(cc)/12.0-5.0)); - } - if (tag == 4 && len > 26 && len < 35) { - if ((i=(get4(),get2())) != 0x7fff && (!iso_speed || iso_speed == 65535)) -- iso_speed = 50 * powf64(2.0, i/32.0 - 4); -+ iso_speed = 50 * powf_64(2.0, i/32.0 - 4); - if ((i=(get2(),get2())) != 0x7fff && !aperture) -- aperture = powf64(2.0, i/64.0); -+ aperture = powf_64(2.0, i/64.0); - if ((i=get2()) != 0xffff && !shutter) -- shutter = powf64(2.0, (short) i/-32.0); -+ shutter = powf_64(2.0, (short) i/-32.0); - wbi = (get2(),get2()); - shot_order = (get2(),get2()); - } + { + unsigned char cc; + fread(&cc,1,1,ifp); +- iso_speed = int(100.0 * powf64(2.0f,float(cc)/12.0-5.0)); ++ iso_speed = int(100.0 * powf_64(2.0f,float(cc)/12.0-5.0)); + } + if (tag == 4 && len > 26 && len < 35) { + if ((i=(get4(),get2())) != 0x7fff && (!iso_speed || iso_speed == 65535)) +- iso_speed = 50 * powf64(2.0, i/32.0 - 4); ++ iso_speed = 50 * powf_64(2.0, i/32.0 - 4); + if ((i=(get2(),get2())) != 0x7fff && !aperture) +- aperture = powf64(2.0, i/64.0); ++ aperture = powf_64(2.0, i/64.0); + if ((i=get2()) != 0xffff && !shutter) +- shutter = powf64(2.0, (short) i/-32.0); ++ shutter = powf_64(2.0, (short) i/-32.0); + wbi = (get2(),get2()); + shot_order = (get2(),get2()); + } @@ -9732,7 +9732,7 @@ void CLASS parse_exif (int base) - imgdata.lens.Lens[0] = 0; - break; - case 0x9205: -- imgdata.lens.EXIF_MaxAp = powf64(2.0f, (getreal(type) / 2.0f)); -+ imgdata.lens.EXIF_MaxAp = powf_64(2.0f, (getreal(type) / 2.0f)); - break; - #endif - case 33434: shutter = getreal(type); break; + imgdata.lens.Lens[0] = 0; + break; + case 0x9205: +- imgdata.lens.EXIF_MaxAp = powf64(2.0f, (getreal(type) / 2.0f)); ++ imgdata.lens.EXIF_MaxAp = powf_64(2.0f, (getreal(type) / 2.0f)); + break; + #endif + case 33434: shutter = getreal(type); break; @@ -9745,10 +9745,10 @@ void CLASS parse_exif (int base) - case 36867: - case 36868: get_timestamp(0); break; - case 37377: if ((expo = -getreal(type)) < 128 && shutter == 0.) -- shutter = powf64(2.0, expo); break; -+ shutter = powf_64(2.0, expo); break; - case 37378: - if (fabs(ape = getreal(type))<256.0) -- aperture = powf64(2.0, ape/2); -+ aperture = powf_64(2.0, ape/2); - break; - case 37385: flash_used = getreal(type); break; - case 37386: focal_len = getreal(type); break; + case 36867: + case 36868: get_timestamp(0); break; + case 37377: if ((expo = -getreal(type)) < 128 && shutter == 0.) +- shutter = powf64(2.0, expo); break; ++ shutter = powf_64(2.0, expo); break; + case 37378: + if (fabs(ape = getreal(type))<256.0) +- aperture = powf64(2.0, ape/2); ++ aperture = powf_64(2.0, ape/2); + break; + case 37385: flash_used = getreal(type); break; + case 37386: focal_len = getreal(type); break; @@ -10361,7 +10361,7 @@ int CLASS parse_tiff_ifd (int base) - imgdata.lens.Lens[0] = 0; - break; - case 0x9205: -- imgdata.lens.EXIF_MaxAp = powf64(2.0f, (getreal(type) / 2.0f)); -+ imgdata.lens.EXIF_MaxAp = powf_64(2.0f, (getreal(type) / 2.0f)); - break; - // IB end - #endif + imgdata.lens.Lens[0] = 0; + break; + case 0x9205: +- imgdata.lens.EXIF_MaxAp = powf64(2.0f, (getreal(type) / 2.0f)); ++ imgdata.lens.EXIF_MaxAp = powf_64(2.0f, (getreal(type) / 2.0f)); + break; + // IB end + #endif @@ -11130,22 +11130,22 @@ void CLASS parse_ciff (int offset, int length, int depth) - thumb_length = len; - } - if (type == 0x1818) { -- shutter = powf64(2.0f, -int_to_float((get4(),get4()))); -- aperture = powf64(2.0f, int_to_float(get4())/2); -+ shutter = powf_64(2.0f, -int_to_float((get4(),get4()))); -+ aperture = powf_64(2.0f, int_to_float(get4())/2); - #ifdef LIBRAW_LIBRARY_BUILD - imgdata.lens.makernotes.CurAp = aperture; - #endif - } - if (type == 0x102a) { - // iso_speed = pow (2.0, (get4(),get2())/32.0 - 4) * 50; -- iso_speed = powf64(2.0f, ((get2(),get2()) + get2())/32.0f - 5.0f) * 100.0f; -+ iso_speed = powf_64(2.0f, ((get2(),get2()) + get2())/32.0f - 5.0f) * 100.0f; - #ifdef LIBRAW_LIBRARY_BUILD - aperture = _CanonConvertAperture((get2(),get2())); - imgdata.lens.makernotes.CurAp = aperture; - #else -- aperture = powf64(2.0, (get2(),(short)get2())/64.0); -+ aperture = powf_64(2.0, (get2(),(short)get2())/64.0); - #endif -- shutter = powf64(2.0,-((short)get2())/32.0); -+ shutter = powf_64(2.0,-((short)get2())/32.0); - wbi = (get2(),get2()); - if (wbi > 17) wbi = 0; - fseek (ifp, 32, SEEK_CUR); + thumb_length = len; + } + if (type == 0x1818) { +- shutter = powf64(2.0f, -int_to_float((get4(),get4()))); +- aperture = powf64(2.0f, int_to_float(get4())/2); ++ shutter = powf_64(2.0f, -int_to_float((get4(),get4()))); ++ aperture = powf_64(2.0f, int_to_float(get4())/2); + #ifdef LIBRAW_LIBRARY_BUILD + imgdata.lens.makernotes.CurAp = aperture; + #endif + } + if (type == 0x102a) { + // iso_speed = pow (2.0, (get4(),get2())/32.0 - 4) * 50; +- iso_speed = powf64(2.0f, ((get2(),get2()) + get2())/32.0f - 5.0f) * 100.0f; ++ iso_speed = powf_64(2.0f, ((get2(),get2()) + get2())/32.0f - 5.0f) * 100.0f; + #ifdef LIBRAW_LIBRARY_BUILD + aperture = _CanonConvertAperture((get2(),get2())); + imgdata.lens.makernotes.CurAp = aperture; + #else +- aperture = powf64(2.0, (get2(),(short)get2())/64.0); ++ aperture = powf_64(2.0, (get2(),(short)get2())/64.0); + #endif +- shutter = powf64(2.0,-((short)get2())/32.0); ++ shutter = powf_64(2.0,-((short)get2())/32.0); + wbi = (get2(),get2()); + if (wbi > 17) wbi = 0; + fseek (ifp, 32, SEEK_CUR); @@ -11349,8 +11349,8 @@ void CLASS parse_phase_one (int base) - setPhaseOneFeatures(unique_id); - break; - case 0x0401: -- if (type == 4) imgdata.lens.makernotes.CurAp = powf64(2.0f, (int_to_float(data)/2.0f)); -- else imgdata.lens.makernotes.CurAp = powf64(2.0f, (getreal(type)/2.0f)); -+ if (type == 4) imgdata.lens.makernotes.CurAp = powf_64(2.0f, (int_to_float(data)/2.0f)); -+ else imgdata.lens.makernotes.CurAp = powf_64(2.0f, (getreal(type)/2.0f)); - break; - case 0x0403: - if (type == 4) imgdata.lens.makernotes.CurFocal = int_to_float(data); + setPhaseOneFeatures(unique_id); + break; + case 0x0401: +- if (type == 4) imgdata.lens.makernotes.CurAp = powf64(2.0f, (int_to_float(data)/2.0f)); +- else imgdata.lens.makernotes.CurAp = powf64(2.0f, (getreal(type)/2.0f)); ++ if (type == 4) imgdata.lens.makernotes.CurAp = powf_64(2.0f, (int_to_float(data)/2.0f)); ++ else imgdata.lens.makernotes.CurAp = powf_64(2.0f, (getreal(type)/2.0f)); + break; + case 0x0403: + if (type == 4) imgdata.lens.makernotes.CurFocal = int_to_float(data); @@ -11364,16 +11364,16 @@ void CLASS parse_phase_one (int base) - break; - case 0x0414: - if (type == 4) { -- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, (int_to_float(data)/2.0f)); -+ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, (int_to_float(data)/2.0f)); - } else { -- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, (getreal(type) / 2.0f)); -+ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, (getreal(type) / 2.0f)); - } - break; - case 0x0415: - if (type == 4) { -- imgdata.lens.makernotes.MinAp4CurFocal = powf64(2.0f, (int_to_float(data)/2.0f)); -+ imgdata.lens.makernotes.MinAp4CurFocal = powf_64(2.0f, (int_to_float(data)/2.0f)); - } else { -- imgdata.lens.makernotes.MinAp4CurFocal = powf64(2.0f, (getreal(type) / 2.0f)); -+ imgdata.lens.makernotes.MinAp4CurFocal = powf_64(2.0f, (getreal(type) / 2.0f)); - } - break; - case 0x0416: + break; + case 0x0414: + if (type == 4) { +- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, (int_to_float(data)/2.0f)); ++ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, (int_to_float(data)/2.0f)); + } else { +- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, (getreal(type) / 2.0f)); ++ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, (getreal(type) / 2.0f)); + } + break; + case 0x0415: + if (type == 4) { +- imgdata.lens.makernotes.MinAp4CurFocal = powf64(2.0f, (int_to_float(data)/2.0f)); ++ imgdata.lens.makernotes.MinAp4CurFocal = powf_64(2.0f, (int_to_float(data)/2.0f)); + } else { +- imgdata.lens.makernotes.MinAp4CurFocal = powf64(2.0f, (getreal(type) / 2.0f)); ++ imgdata.lens.makernotes.MinAp4CurFocal = powf_64(2.0f, (getreal(type) / 2.0f)); + } + break; + case 0x0416: @@ -13324,15 +13324,15 @@ void CLASS identify() - case 18: iso_speed = 320; break; - case 19: iso_speed = 400; break; - } -- shutter = powf64(2.0f, (((float)get4())/8.0f)) / 16000.0f; -+ shutter = powf_64(2.0f, (((float)get4())/8.0f)) / 16000.0f; - FORC4 cam_mul[c ^ (c >> 1)] = get4(); - fseek (ifp, 88, SEEK_SET); -- aperture = powf64(2.0f, ((float)get4())/16.0f); -+ aperture = powf_64(2.0f, ((float)get4())/16.0f); - fseek (ifp, 112, SEEK_SET); - focal_len = get4(); - #ifdef LIBRAW_LIBRARY_BUILD - fseek (ifp, 104, SEEK_SET); -- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, ((float)get4())/16.0f); -+ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, ((float)get4())/16.0f); - fseek (ifp, 124, SEEK_SET); - fread(imgdata.lens.makernotes.Lens, 32, 1, ifp); - imgdata.lens.makernotes.CameraMount = LIBRAW_MOUNT_Contax_N; + case 18: iso_speed = 320; break; + case 19: iso_speed = 400; break; + } +- shutter = powf64(2.0f, (((float)get4())/8.0f)) / 16000.0f; ++ shutter = powf_64(2.0f, (((float)get4())/8.0f)) / 16000.0f; + FORC4 cam_mul[c ^ (c >> 1)] = get4(); + fseek (ifp, 88, SEEK_SET); +- aperture = powf64(2.0f, ((float)get4())/16.0f); ++ aperture = powf_64(2.0f, ((float)get4())/16.0f); + fseek (ifp, 112, SEEK_SET); + focal_len = get4(); + #ifdef LIBRAW_LIBRARY_BUILD + fseek (ifp, 104, SEEK_SET); +- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, ((float)get4())/16.0f); ++ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, ((float)get4())/16.0f); + fseek (ifp, 124, SEEK_SET); + fread(imgdata.lens.makernotes.Lens, 32, 1, ifp); + imgdata.lens.makernotes.CameraMount = LIBRAW_MOUNT_Contax_N; diff --git a/Source/LibRawLite/internal/dcraw_common.cpp b/Source/LibRawLite/internal/dcraw_common.cpp index a936a93..0fc4d81 100644 --- a/Source/LibRawLite/internal/dcraw_common.cpp +++ b/Source/LibRawLite/internal/dcraw_common.cpp @@ -5543,7 +5543,7 @@ static float powf_lim(float a, float b, float limup) - { - return (b>limup || b < -limup)?0.f:powf(a,b); - } --static float powf64(float a, float b) -+static float powf_64(float a, float b) - { - return powf_lim(a,b,64.f); - } + { + return (b>limup || b < -limup)?0.f:powf(a,b); + } +-static float powf64(float a, float b) ++static float powf_64(float a, float b) + { + return powf_lim(a,b,64.f); + } @@ -5580,7 +5580,7 @@ static float _CanonConvert2EV(short in) - static float _CanonConvertAperture(short in) - { - if (in == (short)0xffe0) return 0.0f; -- else return powf64(2.0f, _CanonConvert2EV(in) / 2.0f); -+ else return powf_64(2.0f, _CanonConvert2EV(in) / 2.0f); - } - - void CLASS setCanonBodyFeatures (unsigned id) + static float _CanonConvertAperture(short in) + { + if (in == (short)0xffe0) return 0.0f; +- else return powf64(2.0f, _CanonConvert2EV(in) / 2.0f); ++ else return powf_64(2.0f, _CanonConvert2EV(in) / 2.0f); + } + + void CLASS setCanonBodyFeatures (unsigned id) @@ -5862,15 +5862,15 @@ void CLASS processNikonLensData (uchar *LensData, unsigned len) - imgdata.lens.nikon.NikonLensIDNumber = LensData[i]; - imgdata.lens.nikon.NikonLensFStops = LensData[i + 1]; - imgdata.lens.makernotes.LensFStops = (float)imgdata.lens.nikon.NikonLensFStops /12.0f; -- imgdata.lens.makernotes.MinFocal = 5.0f * powf64(2.0f, (float)LensData[i + 2] / 24.0f); -- imgdata.lens.makernotes.MaxFocal = 5.0f * powf64(2.0f, (float)LensData[i + 3] / 24.0f); -- imgdata.lens.makernotes.MaxAp4MinFocal = powf64(2.0f, (float)LensData[i + 4] / 24.0f); -- imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(2.0f, (float)LensData[i + 5] / 24.0f); -+ imgdata.lens.makernotes.MinFocal = 5.0f * powf_64(2.0f, (float)LensData[i + 2] / 24.0f); -+ imgdata.lens.makernotes.MaxFocal = 5.0f * powf_64(2.0f, (float)LensData[i + 3] / 24.0f); -+ imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(2.0f, (float)LensData[i + 4] / 24.0f); -+ imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(2.0f, (float)LensData[i + 5] / 24.0f); - imgdata.lens.nikon.NikonMCUVersion = LensData[i + 6]; - if (i != 2) - { -- imgdata.lens.makernotes.CurFocal = 5.0f * powf64(2.0f, (float)LensData[i - 1] / 24.0f); -- imgdata.lens.nikon.NikonEffectiveMaxAp = powf64(2.0f, (float)LensData[i + 7] / 24.0f); -+ imgdata.lens.makernotes.CurFocal = 5.0f * powf_64(2.0f, (float)LensData[i - 1] / 24.0f); -+ imgdata.lens.nikon.NikonEffectiveMaxAp = powf_64(2.0f, (float)LensData[i + 7] / 24.0f); - } - imgdata.lens.makernotes.LensID = - (unsigned long long) LensData[i] << 56 | + imgdata.lens.nikon.NikonLensIDNumber = LensData[i]; + imgdata.lens.nikon.NikonLensFStops = LensData[i + 1]; + imgdata.lens.makernotes.LensFStops = (float)imgdata.lens.nikon.NikonLensFStops /12.0f; +- imgdata.lens.makernotes.MinFocal = 5.0f * powf64(2.0f, (float)LensData[i + 2] / 24.0f); +- imgdata.lens.makernotes.MaxFocal = 5.0f * powf64(2.0f, (float)LensData[i + 3] / 24.0f); +- imgdata.lens.makernotes.MaxAp4MinFocal = powf64(2.0f, (float)LensData[i + 4] / 24.0f); +- imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(2.0f, (float)LensData[i + 5] / 24.0f); ++ imgdata.lens.makernotes.MinFocal = 5.0f * powf_64(2.0f, (float)LensData[i + 2] / 24.0f); ++ imgdata.lens.makernotes.MaxFocal = 5.0f * powf_64(2.0f, (float)LensData[i + 3] / 24.0f); ++ imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(2.0f, (float)LensData[i + 4] / 24.0f); ++ imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(2.0f, (float)LensData[i + 5] / 24.0f); + imgdata.lens.nikon.NikonMCUVersion = LensData[i + 6]; + if (i != 2) + { +- imgdata.lens.makernotes.CurFocal = 5.0f * powf64(2.0f, (float)LensData[i - 1] / 24.0f); +- imgdata.lens.nikon.NikonEffectiveMaxAp = powf64(2.0f, (float)LensData[i + 7] / 24.0f); ++ imgdata.lens.makernotes.CurFocal = 5.0f * powf_64(2.0f, (float)LensData[i - 1] / 24.0f); ++ imgdata.lens.nikon.NikonEffectiveMaxAp = powf_64(2.0f, (float)LensData[i + 7] / 24.0f); + } + imgdata.lens.makernotes.LensID = + (unsigned long long) LensData[i] << 56 | @@ -6379,11 +6379,11 @@ void CLASS process_Sony_0x9050 (uchar * buf, unsigned id) - { - if (buf[0]) - imgdata.lens.makernotes.MaxAp = -- my_roundf(powf64(2.0f, ((float)SonySubstitution[buf[0]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; -+ my_roundf(powf_64(2.0f, ((float)SonySubstitution[buf[0]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; - - if (buf[1]) - imgdata.lens.makernotes.MinAp = -- my_roundf(powf64(2.0f, ((float)SonySubstitution[buf[1]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; -+ my_roundf(powf_64(2.0f, ((float)SonySubstitution[buf[1]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; - } - - if (imgdata.lens.makernotes.CameraMount != LIBRAW_MOUNT_FixedLens) + { + if (buf[0]) + imgdata.lens.makernotes.MaxAp = +- my_roundf(powf64(2.0f, ((float)SonySubstitution[buf[0]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; ++ my_roundf(powf_64(2.0f, ((float)SonySubstitution[buf[0]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; + + if (buf[1]) + imgdata.lens.makernotes.MinAp = +- my_roundf(powf64(2.0f, ((float)SonySubstitution[buf[1]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; ++ my_roundf(powf_64(2.0f, ((float)SonySubstitution[buf[1]] / 8.0 - 1.06f) / 2.0f)*10.0f) / 10.0f; + } + + if (imgdata.lens.makernotes.CameraMount != LIBRAW_MOUNT_FixedLens) @@ -6393,7 +6393,7 @@ void CLASS process_Sony_0x9050 (uchar * buf, unsigned id) - lid = SonySubstitution[buf[0x3d]] << 8 | - SonySubstitution[buf[0x3c]]; - imgdata.lens.makernotes.CurAp = -- powf64(2.0f, ((float)lid/256.0f - 16.0f) / 2.0f); -+ powf_64(2.0f, ((float)lid/256.0f - 16.0f) / 2.0f); - } - if (buf[0x105] && (imgdata.lens.makernotes.LensMount != LIBRAW_MOUNT_Canon_EF)) - imgdata.lens.makernotes.LensMount = + lid = SonySubstitution[buf[0x3d]] << 8 | + SonySubstitution[buf[0x3c]]; + imgdata.lens.makernotes.CurAp = +- powf64(2.0f, ((float)lid/256.0f - 16.0f) / 2.0f); ++ powf_64(2.0f, ((float)lid/256.0f - 16.0f) / 2.0f); + } + if (buf[0x105] && (imgdata.lens.makernotes.LensMount != LIBRAW_MOUNT_Canon_EF)) + imgdata.lens.makernotes.LensMount = @@ -6773,7 +6773,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - { - unsigned char cc; - fread(&cc, 1, 1, ifp); -- iso_speed = (int)(100.0 * powf64(2.0, (double)(cc) / 12.0 - 5.0)); -+ iso_speed = (int)(100.0 * powf_64(2.0, (double)(cc) / 12.0 - 5.0)); - break; - } - } + { + unsigned char cc; + fread(&cc, 1, 1, ifp); +- iso_speed = (int)(100.0 * powf64(2.0, (double)(cc) / 12.0 - 5.0)); ++ iso_speed = (int)(100.0 * powf_64(2.0, (double)(cc) / 12.0 - 5.0)); + break; + } + } @@ -6805,7 +6805,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - } - break; - case 0x1002: -- imgdata.lens.makernotes.CurAp = powf64(2.0f, getreal(type)/2); -+ imgdata.lens.makernotes.CurAp = powf_64(2.0f, getreal(type)/2); - break; - case 0x20100201: - imgdata.lens.makernotes.LensID = + } + break; + case 0x1002: +- imgdata.lens.makernotes.CurAp = powf64(2.0f, getreal(type)/2); ++ imgdata.lens.makernotes.CurAp = powf_64(2.0f, getreal(type)/2); + break; + case 0x20100201: + imgdata.lens.makernotes.LensID = @@ -6825,10 +6825,10 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - fread(imgdata.lens.makernotes.Lens, len, 1, ifp); - break; - case 0x20100205: -- imgdata.lens.makernotes.MaxAp4MinFocal = powf64(sqrt(2.0f), get2() / 256.0f); -+ imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(sqrt(2.0f), get2() / 256.0f); - break; - case 0x20100206: -- imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(sqrt(2.0f), get2() / 256.0f); -+ imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(sqrt(2.0f), get2() / 256.0f); - break; - case 0x20100207: - imgdata.lens.makernotes.MinFocal = (float)get2(); + fread(imgdata.lens.makernotes.Lens, len, 1, ifp); + break; + case 0x20100205: +- imgdata.lens.makernotes.MaxAp4MinFocal = powf64(sqrt(2.0f), get2() / 256.0f); ++ imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(sqrt(2.0f), get2() / 256.0f); + break; + case 0x20100206: +- imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(sqrt(2.0f), get2() / 256.0f); ++ imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(sqrt(2.0f), get2() / 256.0f); + break; + case 0x20100207: + imgdata.lens.makernotes.MinFocal = (float)get2(); @@ -6839,7 +6839,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - imgdata.lens.makernotes.MaxFocal = imgdata.lens.makernotes.MinFocal; - break; - case 0x2010020a: -- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(sqrt(2.0f), get2() / 256.0f); -+ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(sqrt(2.0f), get2() / 256.0f); - break; - case 0x20100301: - imgdata.lens.makernotes.TeleconverterID = fgetc(ifp) << 8; + imgdata.lens.makernotes.MaxFocal = imgdata.lens.makernotes.MinFocal; + break; + case 0x2010020a: +- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(sqrt(2.0f), get2() / 256.0f); ++ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(sqrt(2.0f), get2() / 256.0f); + break; + case 0x20100301: + imgdata.lens.makernotes.TeleconverterID = fgetc(ifp) << 8; @@ -6937,13 +6937,13 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - if (table_buf[iLensData+9] && - (fabs(imgdata.lens.makernotes.CurFocal) < 0.1f)) - imgdata.lens.makernotes.CurFocal = -- 10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2); -+ 10*(table_buf[iLensData+9]>>2) * powf_64(4, (table_buf[iLensData+9] & 0x03)-2); - if (table_buf[iLensData+10] & 0xf0) - imgdata.lens.makernotes.MaxAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); - if (table_buf[iLensData+10] & 0x0f) - imgdata.lens.makernotes.MinAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); - if ( - (imgdata.lens.makernotes.CamID != 0x12e6c) && // K-r - (imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 + if (table_buf[iLensData+9] && + (fabs(imgdata.lens.makernotes.CurFocal) < 0.1f)) + imgdata.lens.makernotes.CurFocal = +- 10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2); ++ 10*(table_buf[iLensData+9]>>2) * powf_64(4, (table_buf[iLensData+9] & 0x03)-2); + if (table_buf[iLensData+10] & 0xf0) + imgdata.lens.makernotes.MaxAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); + if (table_buf[iLensData+10] & 0x0f) + imgdata.lens.makernotes.MinAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); + if ( + (imgdata.lens.makernotes.CamID != 0x12e6c) && // K-r + (imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 @@ -6964,14 +6964,14 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - if ((table_buf[iLensData+14] > 1) && - (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) - imgdata.lens.makernotes.MaxAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); - } - else if ((imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 - (table_buf[iLensData+15] > 1) && - (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) - { - imgdata.lens.makernotes.MaxAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); - } - } - free(table_buf); + if ((table_buf[iLensData+14] > 1) && + (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) + imgdata.lens.makernotes.MaxAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); + } + else if ((imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 + (table_buf[iLensData+15] > 1) && + (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) + { + imgdata.lens.makernotes.MaxAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); + } + } + free(table_buf); @@ -7137,7 +7137,7 @@ void CLASS parse_makernote_0xc634(int base, int uptag, unsigned dng_writer) - lid = (((ushort)table_buf[2])<<8) | - ((ushort)table_buf[3]); - imgdata.lens.makernotes.CurAp = -- powf64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); -+ powf_64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); - } - break; - case 1536: + lid = (((ushort)table_buf[2])<<8) | + ((ushort)table_buf[3]); + imgdata.lens.makernotes.CurAp = +- powf64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); ++ powf_64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); + } + break; + case 1536: @@ -7617,7 +7617,7 @@ void CLASS parse_makernote (int base, int uptag) - } - break; - case 0x1002: -- imgdata.lens.makernotes.CurAp = powf64(2.0f, getreal(type)/2); -+ imgdata.lens.makernotes.CurAp = powf_64(2.0f, getreal(type)/2); - break; - case 0x20100201: - imgdata.lens.makernotes.LensID = + } + break; + case 0x1002: +- imgdata.lens.makernotes.CurAp = powf64(2.0f, getreal(type)/2); ++ imgdata.lens.makernotes.CurAp = powf_64(2.0f, getreal(type)/2); + break; + case 0x20100201: + imgdata.lens.makernotes.LensID = @@ -7637,10 +7637,10 @@ void CLASS parse_makernote (int base, int uptag) - fread(imgdata.lens.makernotes.Lens, len, 1, ifp); - break; - case 0x20100205: -- imgdata.lens.makernotes.MaxAp4MinFocal = powf64(sqrt(2.0f), get2() / 256.0f); -+ imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(sqrt(2.0f), get2() / 256.0f); - break; - case 0x20100206: -- imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(sqrt(2.0f), get2() / 256.0f); -+ imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(sqrt(2.0f), get2() / 256.0f); - break; - case 0x20100207: - imgdata.lens.makernotes.MinFocal = (float)get2(); + fread(imgdata.lens.makernotes.Lens, len, 1, ifp); + break; + case 0x20100205: +- imgdata.lens.makernotes.MaxAp4MinFocal = powf64(sqrt(2.0f), get2() / 256.0f); ++ imgdata.lens.makernotes.MaxAp4MinFocal = powf_64(sqrt(2.0f), get2() / 256.0f); + break; + case 0x20100206: +- imgdata.lens.makernotes.MaxAp4MaxFocal = powf64(sqrt(2.0f), get2() / 256.0f); ++ imgdata.lens.makernotes.MaxAp4MaxFocal = powf_64(sqrt(2.0f), get2() / 256.0f); + break; + case 0x20100207: + imgdata.lens.makernotes.MinFocal = (float)get2(); @@ -7651,7 +7651,7 @@ void CLASS parse_makernote (int base, int uptag) - imgdata.lens.makernotes.MaxFocal = imgdata.lens.makernotes.MinFocal; - break; - case 0x2010020a: -- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(sqrt(2.0f), get2() / 256.0f); -+ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(sqrt(2.0f), get2() / 256.0f); - break; - case 0x20100301: - imgdata.lens.makernotes.TeleconverterID = fgetc(ifp) << 8; + imgdata.lens.makernotes.MaxFocal = imgdata.lens.makernotes.MinFocal; + break; + case 0x2010020a: +- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(sqrt(2.0f), get2() / 256.0f); ++ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(sqrt(2.0f), get2() / 256.0f); + break; + case 0x20100301: + imgdata.lens.makernotes.TeleconverterID = fgetc(ifp) << 8; @@ -7809,13 +7809,13 @@ void CLASS parse_makernote (int base, int uptag) - { - if (table_buf[iLensData+9] && (fabs(imgdata.lens.makernotes.CurFocal) < 0.1f)) - imgdata.lens.makernotes.CurFocal = -- 10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2); -+ 10*(table_buf[iLensData+9]>>2) * powf_64(4, (table_buf[iLensData+9] & 0x03)-2); - if (table_buf[iLensData+10] & 0xf0) - imgdata.lens.makernotes.MaxAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); - if (table_buf[iLensData+10] & 0x0f) - imgdata.lens.makernotes.MinAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); - if ( - (imgdata.lens.makernotes.CamID != 0x12e6c) && // K-r - (imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 + { + if (table_buf[iLensData+9] && (fabs(imgdata.lens.makernotes.CurFocal) < 0.1f)) + imgdata.lens.makernotes.CurFocal = +- 10*(table_buf[iLensData+9]>>2) * powf64(4, (table_buf[iLensData+9] & 0x03)-2); ++ 10*(table_buf[iLensData+9]>>2) * powf_64(4, (table_buf[iLensData+9] & 0x03)-2); + if (table_buf[iLensData+10] & 0xf0) + imgdata.lens.makernotes.MaxAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0xf0) >>4)/4.0f); + if (table_buf[iLensData+10] & 0x0f) + imgdata.lens.makernotes.MinAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+10] & 0x0f) + 10)/4.0f); + if ( + (imgdata.lens.makernotes.CamID != 0x12e6c) && // K-r + (imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 @@ -7836,14 +7836,14 @@ void CLASS parse_makernote (int base, int uptag) - if ((table_buf[iLensData+14] > 1) && - (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) - imgdata.lens.makernotes.MaxAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); - } - else if ((imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 - (table_buf[iLensData+15] > 1) && - (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) - { - imgdata.lens.makernotes.MaxAp4CurFocal = -- powf64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); -+ powf_64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); - } - } - free(table_buf); + if ((table_buf[iLensData+14] > 1) && + (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) + imgdata.lens.makernotes.MaxAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+14] & 0x7f) -1)/32.0f); + } + else if ((imgdata.lens.makernotes.CamID != 0x12e76) && // K-5 + (table_buf[iLensData+15] > 1) && + (fabs(imgdata.lens.makernotes.MaxAp4CurFocal) < 0.7f)) + { + imgdata.lens.makernotes.MaxAp4CurFocal = +- powf64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); ++ powf_64(2.0f, (float)((table_buf[iLensData+15] & 0x7f) -1)/32.0f); + } + } + free(table_buf); @@ -8004,7 +8004,7 @@ void CLASS parse_makernote (int base, int uptag) - lid = (((ushort)table_buf[2])<<8) | - ((ushort)table_buf[3]); - imgdata.lens.makernotes.CurAp = -- powf64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); -+ powf_64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); - } - break; - case 1536: + lid = (((ushort)table_buf[2])<<8) | + ((ushort)table_buf[3]); + imgdata.lens.makernotes.CurAp = +- powf64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); ++ powf_64(2.0f, ((float)lid/8.0f-1.0f)/2.0f); + } + break; + case 1536: @@ -8089,15 +8089,15 @@ void CLASS parse_makernote (int base, int uptag) - { - unsigned char cc; - fread(&cc,1,1,ifp); -- iso_speed = int(100.0 * powf64(2.0f,float(cc)/12.0-5.0)); -+ iso_speed = int(100.0 * powf_64(2.0f,float(cc)/12.0-5.0)); - } - if (tag == 4 && len > 26 && len < 35) { - if ((i=(get4(),get2())) != 0x7fff && (!iso_speed || iso_speed == 65535)) -- iso_speed = 50 * powf64(2.0, i/32.0 - 4); -+ iso_speed = 50 * powf_64(2.0, i/32.0 - 4); - if ((i=(get2(),get2())) != 0x7fff && !aperture) -- aperture = powf64(2.0, i/64.0); -+ aperture = powf_64(2.0, i/64.0); - if ((i=get2()) != 0xffff && !shutter) -- shutter = powf64(2.0, (short) i/-32.0); -+ shutter = powf_64(2.0, (short) i/-32.0); - wbi = (get2(),get2()); - shot_order = (get2(),get2()); - } + { + unsigned char cc; + fread(&cc,1,1,ifp); +- iso_speed = int(100.0 * powf64(2.0f,float(cc)/12.0-5.0)); ++ iso_speed = int(100.0 * powf_64(2.0f,float(cc)/12.0-5.0)); + } + if (tag == 4 && len > 26 && len < 35) { + if ((i=(get4(),get2())) != 0x7fff && (!iso_speed || iso_speed == 65535)) +- iso_speed = 50 * powf64(2.0, i/32.0 - 4); ++ iso_speed = 50 * powf_64(2.0, i/32.0 - 4); + if ((i=(get2(),get2())) != 0x7fff && !aperture) +- aperture = powf64(2.0, i/64.0); ++ aperture = powf_64(2.0, i/64.0); + if ((i=get2()) != 0xffff && !shutter) +- shutter = powf64(2.0, (short) i/-32.0); ++ shutter = powf_64(2.0, (short) i/-32.0); + wbi = (get2(),get2()); + shot_order = (get2(),get2()); + } @@ -8548,7 +8548,7 @@ void CLASS parse_exif (int base) - imgdata.lens.Lens[0] = 0; - break; - case 0x9205: -- imgdata.lens.EXIF_MaxAp = powf64(2.0f, (getreal(type) / 2.0f)); -+ imgdata.lens.EXIF_MaxAp = powf_64(2.0f, (getreal(type) / 2.0f)); - break; - #endif - case 33434: shutter = getreal(type); break; + imgdata.lens.Lens[0] = 0; + break; + case 0x9205: +- imgdata.lens.EXIF_MaxAp = powf64(2.0f, (getreal(type) / 2.0f)); ++ imgdata.lens.EXIF_MaxAp = powf_64(2.0f, (getreal(type) / 2.0f)); + break; + #endif + case 33434: shutter = getreal(type); break; @@ -8561,10 +8561,10 @@ void CLASS parse_exif (int base) - case 36867: - case 36868: get_timestamp(0); break; - case 37377: if ((expo = -getreal(type)) < 128 && shutter == 0.) -- shutter = powf64(2.0, expo); break; -+ shutter = powf_64(2.0, expo); break; - case 37378: - if (fabs(ape = getreal(type))<256.0) -- aperture = powf64(2.0, ape/2); -+ aperture = powf_64(2.0, ape/2); - break; - case 37385: flash_used = getreal(type); break; - case 37386: focal_len = getreal(type); break; + case 36867: + case 36868: get_timestamp(0); break; + case 37377: if ((expo = -getreal(type)) < 128 && shutter == 0.) +- shutter = powf64(2.0, expo); break; ++ shutter = powf_64(2.0, expo); break; + case 37378: + if (fabs(ape = getreal(type))<256.0) +- aperture = powf64(2.0, ape/2); ++ aperture = powf_64(2.0, ape/2); + break; + case 37385: flash_used = getreal(type); break; + case 37386: focal_len = getreal(type); break; @@ -9171,7 +9171,7 @@ int CLASS parse_tiff_ifd (int base) - imgdata.lens.Lens[0] = 0; - break; - case 0x9205: -- imgdata.lens.EXIF_MaxAp = powf64(2.0f, (getreal(type) / 2.0f)); -+ imgdata.lens.EXIF_MaxAp = powf_64(2.0f, (getreal(type) / 2.0f)); - break; - // IB end - #endif + imgdata.lens.Lens[0] = 0; + break; + case 0x9205: +- imgdata.lens.EXIF_MaxAp = powf64(2.0f, (getreal(type) / 2.0f)); ++ imgdata.lens.EXIF_MaxAp = powf_64(2.0f, (getreal(type) / 2.0f)); + break; + // IB end + #endif @@ -9940,22 +9940,22 @@ void CLASS parse_ciff (int offset, int length, int depth) - thumb_length = len; - } - if (type == 0x1818) { -- shutter = powf64(2.0f, -int_to_float((get4(),get4()))); -- aperture = powf64(2.0f, int_to_float(get4())/2); -+ shutter = powf_64(2.0f, -int_to_float((get4(),get4()))); -+ aperture = powf_64(2.0f, int_to_float(get4())/2); - #ifdef LIBRAW_LIBRARY_BUILD - imgdata.lens.makernotes.CurAp = aperture; - #endif - } - if (type == 0x102a) { - // iso_speed = pow (2.0, (get4(),get2())/32.0 - 4) * 50; -- iso_speed = powf64(2.0f, ((get2(),get2()) + get2())/32.0f - 5.0f) * 100.0f; -+ iso_speed = powf_64(2.0f, ((get2(),get2()) + get2())/32.0f - 5.0f) * 100.0f; - #ifdef LIBRAW_LIBRARY_BUILD - aperture = _CanonConvertAperture((get2(),get2())); - imgdata.lens.makernotes.CurAp = aperture; - #else -- aperture = powf64(2.0, (get2(),(short)get2())/64.0); -+ aperture = powf_64(2.0, (get2(),(short)get2())/64.0); - #endif -- shutter = powf64(2.0,-((short)get2())/32.0); -+ shutter = powf_64(2.0,-((short)get2())/32.0); - wbi = (get2(),get2()); - if (wbi > 17) wbi = 0; - fseek (ifp, 32, SEEK_CUR); + thumb_length = len; + } + if (type == 0x1818) { +- shutter = powf64(2.0f, -int_to_float((get4(),get4()))); +- aperture = powf64(2.0f, int_to_float(get4())/2); ++ shutter = powf_64(2.0f, -int_to_float((get4(),get4()))); ++ aperture = powf_64(2.0f, int_to_float(get4())/2); + #ifdef LIBRAW_LIBRARY_BUILD + imgdata.lens.makernotes.CurAp = aperture; + #endif + } + if (type == 0x102a) { + // iso_speed = pow (2.0, (get4(),get2())/32.0 - 4) * 50; +- iso_speed = powf64(2.0f, ((get2(),get2()) + get2())/32.0f - 5.0f) * 100.0f; ++ iso_speed = powf_64(2.0f, ((get2(),get2()) + get2())/32.0f - 5.0f) * 100.0f; + #ifdef LIBRAW_LIBRARY_BUILD + aperture = _CanonConvertAperture((get2(),get2())); + imgdata.lens.makernotes.CurAp = aperture; + #else +- aperture = powf64(2.0, (get2(),(short)get2())/64.0); ++ aperture = powf_64(2.0, (get2(),(short)get2())/64.0); + #endif +- shutter = powf64(2.0,-((short)get2())/32.0); ++ shutter = powf_64(2.0,-((short)get2())/32.0); + wbi = (get2(),get2()); + if (wbi > 17) wbi = 0; + fseek (ifp, 32, SEEK_CUR); @@ -10159,8 +10159,8 @@ void CLASS parse_phase_one (int base) - setPhaseOneFeatures(unique_id); - break; - case 0x0401: -- if (type == 4) imgdata.lens.makernotes.CurAp = powf64(2.0f, (int_to_float(data)/2.0f)); -- else imgdata.lens.makernotes.CurAp = powf64(2.0f, (getreal(type)/2.0f)); -+ if (type == 4) imgdata.lens.makernotes.CurAp = powf_64(2.0f, (int_to_float(data)/2.0f)); -+ else imgdata.lens.makernotes.CurAp = powf_64(2.0f, (getreal(type)/2.0f)); - break; - case 0x0403: - if (type == 4) imgdata.lens.makernotes.CurFocal = int_to_float(data); + setPhaseOneFeatures(unique_id); + break; + case 0x0401: +- if (type == 4) imgdata.lens.makernotes.CurAp = powf64(2.0f, (int_to_float(data)/2.0f)); +- else imgdata.lens.makernotes.CurAp = powf64(2.0f, (getreal(type)/2.0f)); ++ if (type == 4) imgdata.lens.makernotes.CurAp = powf_64(2.0f, (int_to_float(data)/2.0f)); ++ else imgdata.lens.makernotes.CurAp = powf_64(2.0f, (getreal(type)/2.0f)); + break; + case 0x0403: + if (type == 4) imgdata.lens.makernotes.CurFocal = int_to_float(data); @@ -10174,16 +10174,16 @@ void CLASS parse_phase_one (int base) - break; - case 0x0414: - if (type == 4) { -- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, (int_to_float(data)/2.0f)); -+ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, (int_to_float(data)/2.0f)); - } else { -- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, (getreal(type) / 2.0f)); -+ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, (getreal(type) / 2.0f)); - } - break; - case 0x0415: - if (type == 4) { -- imgdata.lens.makernotes.MinAp4CurFocal = powf64(2.0f, (int_to_float(data)/2.0f)); -+ imgdata.lens.makernotes.MinAp4CurFocal = powf_64(2.0f, (int_to_float(data)/2.0f)); - } else { -- imgdata.lens.makernotes.MinAp4CurFocal = powf64(2.0f, (getreal(type) / 2.0f)); -+ imgdata.lens.makernotes.MinAp4CurFocal = powf_64(2.0f, (getreal(type) / 2.0f)); - } - break; - case 0x0416: + break; + case 0x0414: + if (type == 4) { +- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, (int_to_float(data)/2.0f)); ++ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, (int_to_float(data)/2.0f)); + } else { +- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, (getreal(type) / 2.0f)); ++ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, (getreal(type) / 2.0f)); + } + break; + case 0x0415: + if (type == 4) { +- imgdata.lens.makernotes.MinAp4CurFocal = powf64(2.0f, (int_to_float(data)/2.0f)); ++ imgdata.lens.makernotes.MinAp4CurFocal = powf_64(2.0f, (int_to_float(data)/2.0f)); + } else { +- imgdata.lens.makernotes.MinAp4CurFocal = powf64(2.0f, (getreal(type) / 2.0f)); ++ imgdata.lens.makernotes.MinAp4CurFocal = powf_64(2.0f, (getreal(type) / 2.0f)); + } + break; + case 0x0416: @@ -11996,15 +11996,15 @@ void CLASS identify() - case 18: iso_speed = 320; break; - case 19: iso_speed = 400; break; - } -- shutter = powf64(2.0f, (((float)get4())/8.0f)) / 16000.0f; -+ shutter = powf_64(2.0f, (((float)get4())/8.0f)) / 16000.0f; - FORC4 cam_mul[c ^ (c >> 1)] = get4(); - fseek (ifp, 88, SEEK_SET); -- aperture = powf64(2.0f, ((float)get4())/16.0f); -+ aperture = powf_64(2.0f, ((float)get4())/16.0f); - fseek (ifp, 112, SEEK_SET); - focal_len = get4(); - #ifdef LIBRAW_LIBRARY_BUILD - fseek (ifp, 104, SEEK_SET); -- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, ((float)get4())/16.0f); -+ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, ((float)get4())/16.0f); - fseek (ifp, 124, SEEK_SET); - fread(imgdata.lens.makernotes.Lens, 32, 1, ifp); - imgdata.lens.makernotes.CameraMount = LIBRAW_MOUNT_Contax_N; + case 18: iso_speed = 320; break; + case 19: iso_speed = 400; break; + } +- shutter = powf64(2.0f, (((float)get4())/8.0f)) / 16000.0f; ++ shutter = powf_64(2.0f, (((float)get4())/8.0f)) / 16000.0f; + FORC4 cam_mul[c ^ (c >> 1)] = get4(); + fseek (ifp, 88, SEEK_SET); +- aperture = powf64(2.0f, ((float)get4())/16.0f); ++ aperture = powf_64(2.0f, ((float)get4())/16.0f); + fseek (ifp, 112, SEEK_SET); + focal_len = get4(); + #ifdef LIBRAW_LIBRARY_BUILD + fseek (ifp, 104, SEEK_SET); +- imgdata.lens.makernotes.MaxAp4CurFocal = powf64(2.0f, ((float)get4())/16.0f); ++ imgdata.lens.makernotes.MaxAp4CurFocal = powf_64(2.0f, ((float)get4())/16.0f); + fseek (ifp, 124, SEEK_SET); + fread(imgdata.lens.makernotes.Lens, 32, 1, ifp); + imgdata.lens.makernotes.CameraMount = LIBRAW_MOUNT_Contax_N; -- 2.14.1 diff --git a/buildroot/package/libjpeg/libjpeg.mk b/buildroot/package/libjpeg/libjpeg.mk index edda2a5a1..ab09881fc 100644 --- a/buildroot/package/libjpeg/libjpeg.mk +++ b/buildroot/package/libjpeg/libjpeg.mk @@ -7,7 +7,7 @@ LIBJPEG_VERSION = 9c LIBJPEG_SITE = http://www.ijg.org/files LIBJPEG_SOURCE = jpegsrc.v$(LIBJPEG_VERSION).tar.gz -LIBJPEG_LICENSE = jpeg-license (BSD-3-Clause-like) +LIBJPEG_LICENSE = IJG LIBJPEG_LICENSE_FILES = README LIBJPEG_INSTALL_STAGING = YES LIBJPEG_PROVIDES = jpeg diff --git a/buildroot/package/libtirpc/0003-Add-rpcgen-program-from-nfs-utils-sources.patch b/buildroot/package/libtirpc/0003-Add-rpcgen-program-from-nfs-utils-sources.patch deleted file mode 100644 index f2b15fe2f..000000000 --- a/buildroot/package/libtirpc/0003-Add-rpcgen-program-from-nfs-utils-sources.patch +++ /dev/null @@ -1,6508 +0,0 @@ -From 866b651bcb9f93f47582e5e2e4f1eb3155025298 Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Sat, 10 Nov 2012 16:21:01 +0100 -Subject: [PATCH] Add rpcgen program from nfs-utils sources - -Signed-off-by: Thomas Petazzoni -[yann.morin.1998@free.fr: update for 0.3.1] -Signed-off-by: "Yann E. MORIN" ---- - Makefile.am | 2 +- - configure.ac | 14 +- - rpcgen/Makefile.am | 22 ++ - rpcgen/rpc_clntout.c | 217 ++++++++++ - rpcgen/rpc_cout.c | 706 +++++++++++++++++++++++++++++++++ - rpcgen/rpc_hout.c | 490 +++++++++++++++++++++++ - rpcgen/rpc_main.c | 1067 ++++++++++++++++++++++++++++++++++++++++++++++++++ - rpcgen/rpc_output.h | 16 + - rpcgen/rpc_parse.c | 609 ++++++++++++++++++++++++++++ - rpcgen/rpc_parse.h | 166 ++++++++ - rpcgen/rpc_sample.c | 247 ++++++++++++ - rpcgen/rpc_scan.c | 474 ++++++++++++++++++++++ - rpcgen/rpc_scan.h | 103 +++++ - rpcgen/rpc_svcout.c | 882 +++++++++++++++++++++++++++++++++++++++++ - rpcgen/rpc_tblout.c | 165 ++++++++ - rpcgen/rpc_util.c | 479 ++++++++++++++++++++++ - rpcgen/rpc_util.h | 166 ++++++++ - rpcgen/rpcgen.1 | 521 ++++++++++++++++++++++++ - 18 files changed, 6344 insertions(+), 2 deletions(-) - create mode 100644 rpcgen/Makefile.am - create mode 100644 rpcgen/rpc_clntout.c - create mode 100644 rpcgen/rpc_cout.c - create mode 100644 rpcgen/rpc_hout.c - create mode 100644 rpcgen/rpc_main.c - create mode 100644 rpcgen/rpc_output.h - create mode 100644 rpcgen/rpc_parse.c - create mode 100644 rpcgen/rpc_parse.h - create mode 100644 rpcgen/rpc_sample.c - create mode 100644 rpcgen/rpc_scan.c - create mode 100644 rpcgen/rpc_scan.h - create mode 100644 rpcgen/rpc_svcout.c - create mode 100644 rpcgen/rpc_tblout.c - create mode 100644 rpcgen/rpc_util.c - create mode 100644 rpcgen/rpc_util.h - create mode 100644 rpcgen/rpcgen.1 - -diff --git a/Makefile.am b/Makefile.am -index 466b6dd..8558289 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -1,4 +1,4 @@ --SUBDIRS = src man doc -+SUBDIRS = src man doc rpcgen - ACLOCAL_AMFLAGS = -I m4 - - noinst_HEADERS = tirpc/reentrant.h \ -diff --git a/configure.ac b/configure.ac -index e3cb8af..0ea2e6e 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -58,6 +58,18 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netine - AC_CHECK_LIB([pthread], [pthread_create]) - AC_CHECK_FUNCS([getrpcbyname getrpcbynumber setrpcent endrpcent getrpcent]) - --AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile]) -+AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes) -+ -+AC_MSG_CHECKING([for a C compiler for build tools]) -+if test $cross_compiling = yes; then -+ AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) -+else -+ CC_FOR_BUILD=$CC -+fi -+AC_MSG_RESULT([$CC_FOR_BUILD]) -+AC_SUBST(CC_FOR_BUILD) -+ -+AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile rpcgen/Makefile]) -+ - AC_OUTPUT(libtirpc.pc) - -diff --git a/rpcgen/Makefile.am b/rpcgen/Makefile.am -new file mode 100644 -index 0000000..2277b6f ---- /dev/null -+++ b/rpcgen/Makefile.am -@@ -0,0 +1,22 @@ -+COMPILE = $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -I../tirpc $(AM_CPPFLAGS) \ -+ $(CPPFLAGS_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) -+LINK = $(CC_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) -o $@ -+ -+noinst_PROGRAMS = rpcgen -+ -+rpcgen_SOURCES = \ -+ rpc_clntout.c \ -+ rpc_cout.c \ -+ rpc_hout.c \ -+ rpc_main.c \ -+ rpc_parse.c \ -+ rpc_sample.c \ -+ rpc_scan.c \ -+ rpc_svcout.c \ -+ rpc_tblout.c \ -+ rpc_util.c \ -+ rpc_parse.h \ -+ rpc_scan.h \ -+ rpc_util.h -+ -+dist_man1_MANS = rpcgen.1 -diff --git a/rpcgen/rpc_clntout.c b/rpcgen/rpc_clntout.c -new file mode 100644 -index 0000000..e2f4382 ---- /dev/null -+++ b/rpcgen/rpc_clntout.c -@@ -0,0 +1,217 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#if 0 -+static char sccsid[] = "@(#)rpc_clntout.c 1.11 89/02/22 (C) 1987 SMI"; -+#endif -+ -+/* -+ * rpc_clntout.c, Client-stub outputter for the RPC protocol compiler -+ * Copyright (C) 1987, Sun Microsytsems, Inc. -+ */ -+#include -+#include -+#include -+#include "rpc_parse.h" -+#include "rpc_util.h" -+#include "rpc_output.h" -+ -+/* extern pdeclaration(); */ -+/* void printarglist(); */ -+ -+#define DEFAULT_TIMEOUT 25 /* in seconds */ -+static char RESULT[] = "clnt_res"; -+ -+static void write_program(definition *def); -+static void printbody(proc_list *proc); -+ -+ -+void -+write_stubs(void) -+{ -+ list *l; -+ definition *def; -+ -+ f_print(fout, -+ "\n/* Default timeout can be changed using clnt_control() */\n"); -+ f_print(fout, "static struct timeval TIMEOUT = { %d, 0 };\n", -+ DEFAULT_TIMEOUT); -+ for (l = defined; l != NULL; l = l->next) { -+ def = (definition *) l->val; -+ if (def->def_kind == DEF_PROGRAM) { -+ write_program(def); -+ } -+ } -+} -+ -+static void -+write_program(definition *def) -+{ -+ version_list *vp; -+ proc_list *proc; -+ -+ for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) { -+ for (proc = vp->procs; proc != NULL; proc = proc->next) { -+ f_print(fout, "\n"); -+ ptype(proc->res_prefix, proc->res_type, 1); -+ f_print(fout, "*\n"); -+ pvname(proc->proc_name, vp->vers_num); -+ printarglist(proc, "clnt", "CLIENT *"); -+ f_print(fout, "{\n"); -+ printbody(proc); -+ f_print(fout, "}\n"); -+ } -+ } -+} -+ -+/* -+ * Writes out declarations of procedure's argument list. -+ * In either ANSI C style, in one of old rpcgen style (pass by reference), -+ * or new rpcgen style (multiple arguments, pass by value); -+ */ -+ -+/* sample addargname = "clnt"; sample addargtype = "CLIENT * " */ -+ -+void -+printarglist(proc_list *proc, char *addargname, char *addargtype) -+{ -+ -+ decl_list *l; -+ -+ if (!newstyle) { /* old style: always pass arg by reference */ -+ if (Cflag) { /* C++ style heading */ -+ f_print(fout, "("); -+ ptype(proc->args.decls->decl.prefix, proc->args.decls->decl.type, 1); -+ f_print(fout, "*argp, %s%s)\n", addargtype, addargname); -+ } else { -+ f_print(fout, "(argp, %s)\n", addargname); -+ f_print(fout, "\t"); -+ ptype(proc->args.decls->decl.prefix, proc->args.decls->decl.type, 1); -+ f_print(fout, "*argp;\n"); -+ } -+ } else if (streq(proc->args.decls->decl.type, "void")) { -+ /* newstyle, 0 argument */ -+ if (Cflag) -+ f_print(fout, "(%s%s)\n", addargtype, addargname); -+ else -+ f_print(fout, "(%s)\n", addargname); -+ } else { -+ /* new style, 1 or multiple arguments */ -+ if (!Cflag) { -+ f_print(fout, "("); -+ for (l = proc->args.decls; l != NULL; l = l->next) -+ f_print(fout, "%s, ", l->decl.name); -+ f_print(fout, "%s)\n", addargname); -+ for (l = proc->args.decls; l != NULL; l = l->next) { -+ pdeclaration(proc->args.argname, &l->decl, 1, ";\n"); -+ } -+ } else { /* C++ style header */ -+ f_print(fout, "("); -+ for (l = proc->args.decls; l != NULL; l = l->next) { -+ pdeclaration(proc->args.argname, &l->decl, 0, ", "); -+ } -+ f_print(fout, " %s%s)\n", addargtype, addargname); -+ } -+ } -+ -+ if (!Cflag) -+ f_print(fout, "\t%s%s;\n", addargtype, addargname); -+} -+ -+ -+ -+static char * -+ampr(char *type) -+{ -+ if (isvectordef(type, REL_ALIAS)) { -+ return (""); -+ } else { -+ return ("&"); -+ } -+} -+ -+static void -+printbody(proc_list *proc) -+{ -+ decl_list *l; -+ bool_t args2 = (proc->arg_num > 1); -+ -+ /* For new style with multiple arguments, need a structure in which -+ * to stuff the arguments. */ -+ if (newstyle && args2) { -+ f_print(fout, "\t%s", proc->args.argname); -+ f_print(fout, " arg;\n"); -+ } -+ f_print(fout, "\tstatic "); -+ if (streq(proc->res_type, "void")) { -+ f_print(fout, "char "); -+ } else { -+ ptype(proc->res_prefix, proc->res_type, 0); -+ } -+ f_print(fout, "%s;\n", RESULT); -+ f_print(fout, "\n"); -+ f_print(fout, "\tmemset((char *)%s%s, 0, sizeof(%s));\n", -+ ampr(proc->res_type), RESULT, RESULT); -+ if (newstyle && !args2 && (streq(proc->args.decls->decl.type, "void"))) { -+ /* newstyle, 0 arguments */ -+ f_print(fout, -+ "\tif (clnt_call(clnt, %s, (xdrproc_t) xdr_void, (caddr_t) NULL, " -+ "(xdrproc_t) xdr_%s, (caddr_t) %s%s, TIMEOUT) != RPC_SUCCESS) {\n", -+ proc->proc_name, -+ stringfix(proc->res_type), ampr(proc->res_type), RESULT); -+ -+ } else if (newstyle && args2) { -+ /* newstyle, multiple arguments: stuff arguments into structure */ -+ for (l = proc->args.decls; l != NULL; l = l->next) { -+ f_print(fout, "\targ.%s = %s;\n", -+ l->decl.name, l->decl.name); -+ } -+ f_print(fout, -+ "\tif (clnt_call(clnt, %s, (xdrproc_t) xdr_%s, (caddr_t) &arg, " -+ "(xdrproc_t) xdr_%s, (caddr_t) %s%s, TIMEOUT) != RPC_SUCCESS) {\n", -+ proc->proc_name, proc->args.argname, -+ stringfix(proc->res_type), ampr(proc->res_type), RESULT); -+ } else { /* single argument, new or old style */ -+ f_print(fout, -+ "\tif (clnt_call(clnt, %s, (xdrproc_t) xdr_%s, " -+ "(caddr_t) %s%s, (xdrproc_t) xdr_%s, (caddr_t) %s%s, TIMEOUT) != RPC_SUCCESS) {\n", -+ proc->proc_name, -+ stringfix(proc->args.decls->decl.type), -+ (newstyle ? "&" : ""), -+ (newstyle ? proc->args.decls->decl.name : "argp"), -+ stringfix(proc->res_type), ampr(proc->res_type), RESULT); -+ } -+ f_print(fout, "\t\treturn (NULL);\n"); -+ f_print(fout, "\t}\n"); -+ if (streq(proc->res_type, "void")) { -+ f_print(fout, "\treturn ((void *)%s%s);\n", -+ ampr(proc->res_type), RESULT); -+ } else { -+ f_print(fout, "\treturn (%s%s);\n", ampr(proc->res_type), RESULT); -+ } -+} -diff --git a/rpcgen/rpc_cout.c b/rpcgen/rpc_cout.c -new file mode 100644 -index 0000000..a61214f ---- /dev/null -+++ b/rpcgen/rpc_cout.c -@@ -0,0 +1,706 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#if 0 -+static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI"; -+#endif -+ -+/* -+ * rpc_cout.c, XDR routine outputter for the RPC protocol compiler -+ */ -+#include -+#include -+#include -+#include -+#include -+#include "rpc_parse.h" -+#include "rpc_util.h" -+ -+static int findtype(definition *def, char *type); -+static int undefined(char *type); -+static void print_generic_header(char *procname, int pointerp); -+static void print_header(definition *def); -+static void print_prog_header(proc_list *plist); -+static void print_trailer(void); -+static void print_ifopen(int indent, char *name); -+static void print_ifarg(char *arg); -+static void print_ifsizeof(char *prefix, char *type); -+static void print_ifclose(int indent); -+static void print_ifstat(int indent, char *prefix, char *type, relation rel, -+ char *amax, char *objname, char *name); -+static void emit_enum(definition *def); -+static void emit_program(definition *def); -+static void emit_union(definition *def); -+static void emit_struct(definition *def); -+static void emit_typedef(definition *def); -+static void print_stat(int indent, declaration *dec); -+static void emit_inline(declaration *decl, int flag); -+static void emit_single_in_line(declaration *decl, int flag, relation rel); -+static char * upcase(char *str); -+ -+/* -+ * Emit the C-routine for the given definition -+ */ -+void -+emit(definition *def) -+{ -+ if (def->def_kind == DEF_CONST) { -+ return; -+ } -+ if (def->def_kind == DEF_PROGRAM) { -+ emit_program(def); -+ return; -+ } -+ if (def->def_kind == DEF_TYPEDEF) { -+ /* now we need to handle declarations like -+ * struct typedef foo foo; -+ * since we dont want this to be expanded into 2 calls -+ * to xdr_foo */ -+ -+ if (strcmp(def->def.ty.old_type, def->def_name) == 0) -+ return; -+ }; -+ -+ print_header(def); -+ switch (def->def_kind) { -+ case DEF_UNION: -+ emit_union(def); -+ break; -+ case DEF_ENUM: -+ emit_enum(def); -+ break; -+ case DEF_STRUCT: -+ emit_struct(def); -+ break; -+ case DEF_TYPEDEF: -+ emit_typedef(def); -+ break; -+ default: -+ break; -+ } -+ print_trailer(); -+} -+ -+static int -+findtype(definition *def, char *type) -+{ -+ -+ if (def->def_kind == DEF_PROGRAM || def->def_kind == DEF_CONST) { -+ return (0); -+ } else { -+ return (streq(def->def_name, type)); -+ } -+} -+ -+static int -+undefined(char *type) -+{ -+ definition *def; -+ -+ def = (definition *) FINDVAL(defined, type, findtype); -+ -+ return (def == NULL); -+} -+ -+ -+static void -+print_generic_header(char *procname, int pointerp) -+{ -+ f_print(fout, "\n"); -+ f_print(fout, "bool_t\n"); -+ if (Cflag) { -+ f_print(fout, "xdr_%s(", procname); -+ f_print(fout, "XDR *xdrs, "); -+ f_print(fout, "%s ", procname); -+ if (pointerp) -+ f_print(fout, "*"); -+ f_print(fout, "objp)\n{\n\n"); -+ } else { -+ f_print(fout, "xdr_%s(xdrs, objp)\n", procname); -+ f_print(fout, "\tXDR *xdrs;\n"); -+ f_print(fout, "\t%s ", procname); -+ if (pointerp) -+ f_print(fout, "*"); -+ f_print(fout, "objp;\n{\n\n"); -+ } -+} -+ -+static void -+print_header(definition *def) -+{ -+ print_generic_header(def->def_name, -+ def->def_kind != DEF_TYPEDEF || -+ !isvectordef(def->def.ty.old_type, def->def.ty.rel)); -+ -+ /* Now add Inline support */ -+ -+ -+ if (Inline == 0) -+ return; -+} -+ -+static void -+print_prog_header(proc_list *plist) -+{ -+ print_generic_header(plist->args.argname, 1); -+} -+ -+static void -+print_trailer(void) -+{ -+ f_print(fout, "\treturn (TRUE);\n"); -+ f_print(fout, "}\n"); -+} -+ -+ -+static void -+print_ifopen(int indent, char *name) -+{ -+ tabify(fout, indent); -+ f_print(fout, " if (!xdr_%s(xdrs", name); -+} -+ -+static void -+print_ifarg(char *arg) -+{ -+ f_print(fout, ", %s", arg); -+} -+ -+static void -+print_ifsizeof(char *prefix, char *type) -+{ -+ if (streq(type, "bool")) { -+ f_print(fout, ", sizeof(bool_t), (xdrproc_t)xdr_bool"); -+ } else { -+ f_print(fout, ", sizeof("); -+ if (undefined(type) && prefix) { -+ f_print(fout, "%s ", prefix); -+ } -+ f_print(fout, "%s), (xdrproc_t)xdr_%s", type, type); -+ } -+} -+ -+static void -+print_ifclose(int indent) -+{ -+ f_print(fout, ")) {\n"); -+ tabify(fout, indent); -+ f_print(fout, "\t return (FALSE);\n"); -+ tabify(fout, indent); -+ f_print(fout, " }\n"); -+} -+ -+static void -+print_ifstat(int indent, char *prefix, char *type, relation rel, -+ char *amax, char *objname, char *name) -+{ -+ char *alt = NULL; -+ -+ switch (rel) { -+ case REL_POINTER: -+ print_ifopen(indent, "pointer"); -+ print_ifarg("(char **)"); -+ f_print(fout, "%s", objname); -+ print_ifsizeof(prefix, type); -+ break; -+ case REL_VECTOR: -+ if (streq(type, "string")) { -+ alt = "string"; -+ } else if (streq(type, "opaque")) { -+ alt = "opaque"; -+ } -+ if (alt) { -+ print_ifopen(indent, alt); -+ print_ifarg(objname); -+ } else { -+ print_ifopen(indent, "vector"); -+ print_ifarg("(char *)"); -+ f_print(fout, "%s", objname); -+ } -+ print_ifarg(amax); -+ if (!alt) { -+ print_ifsizeof(prefix, type); -+ } -+ break; -+ case REL_ARRAY: -+ if (streq(type, "string")) { -+ alt = "string"; -+ } else if (streq(type, "opaque")) { -+ alt = "bytes"; -+ } -+ if (streq(type, "string")) { -+ print_ifopen(indent, alt); -+ print_ifarg(objname); -+ } else { -+ if (alt) { -+ print_ifopen(indent, alt); -+ } else { -+ print_ifopen(indent, "array"); -+ } -+ /* The (void*) avoids a gcc-4.1 warning */ -+ print_ifarg("(char **)(void*)"); -+ if (*objname == '&') { -+ f_print(fout, "%s.%s_val, (u_int *)%s.%s_len", -+ objname, name, objname, name); -+ } else { -+ f_print(fout, "&%s->%s_val, (u_int *)&%s->%s_len", -+ objname, name, objname, name); -+ } -+ } -+ print_ifarg(amax); -+ if (!alt) { -+ print_ifsizeof(prefix, type); -+ } -+ break; -+ case REL_ALIAS: -+ print_ifopen(indent, type); -+ print_ifarg(objname); -+ break; -+ } -+ print_ifclose(indent); -+} -+ -+static void -+emit_enum(definition *def) -+{ -+ print_ifopen(1, "enum"); -+ print_ifarg("(enum_t *)objp"); -+ print_ifclose(1); -+} -+ -+static void -+emit_program(definition *def) -+{ -+ decl_list *dl; -+ version_list *vlist; -+ proc_list *plist; -+ -+ for (vlist = def->def.pr.versions; vlist != NULL; vlist = vlist->next) -+ for (plist = vlist->procs; plist != NULL; plist = plist->next) { -+ if (!newstyle || plist->arg_num < 2) -+ continue;/* old style, or single argument */ -+ print_prog_header(plist); -+ for (dl = plist->args.decls; dl != NULL; dl = dl->next) -+ print_stat(1, &dl->decl); -+ print_trailer(); -+ } -+} -+ -+ -+static void -+emit_union(definition *def) -+{ -+ declaration *dflt; -+ case_list *cl; -+ declaration *cs; -+ char *object; -+ char *vecformat = "objp->%s_u.%s"; -+ char *format = "&objp->%s_u.%s"; -+ -+ print_stat(1,&def->def.un.enum_decl); -+ f_print(fout, "\tswitch (objp->%s) {\n", def->def.un.enum_decl.name); -+ for (cl = def->def.un.cases; cl != NULL; cl = cl->next) { -+ -+ f_print(fout, "\tcase %s:\n", cl->case_name); -+ if(cl->contflag == 1) /* a continued case statement */ -+ continue; -+ cs = &cl->case_decl; -+ if (!streq(cs->type, "void")) { -+ object = alloc(strlen(def->def_name) + strlen(format) + -+ strlen(cs->name) + 1); -+ if (isvectordef (cs->type, cs->rel)) { -+ s_print(object, vecformat, def->def_name, -+ cs->name); -+ } else { -+ s_print(object, format, def->def_name, -+ cs->name); -+ } -+ print_ifstat(2, cs->prefix, cs->type, cs->rel, cs->array_max, -+ object, cs->name); -+ free(object); -+ } -+ f_print(fout, "\t\tbreak;\n"); -+ } -+ dflt = def->def.un.default_decl; -+ if (dflt != NULL) { -+ if (!streq(dflt->type, "void")) { -+ f_print(fout, "\tdefault:\n"); -+ object = alloc(strlen(def->def_name) + strlen(format) + -+ strlen(dflt->name) + 1); -+ if (isvectordef (dflt->type, dflt->rel)) { -+ s_print(object, vecformat, def->def_name, -+ dflt->name); -+ } else { -+ s_print(object, format, def->def_name, -+ dflt->name); -+ } -+ -+ print_ifstat(2, dflt->prefix, dflt->type, dflt->rel, -+ dflt->array_max, object, dflt->name); -+ free(object); -+ f_print(fout, "\t\tbreak;\n"); -+ } else { -+ /* Avoid gcc warnings about `value not handled in switch' */ -+ f_print(fout, "\tdefault:\n"); -+ f_print(fout, "\t\tbreak;\n"); -+ } -+ } else { -+ f_print(fout, "\tdefault:\n"); -+ f_print(fout, "\t\treturn (FALSE);\n"); -+ } -+ -+ f_print(fout, "\t}\n"); -+} -+ -+static void -+emit_struct(definition *def) -+{ -+ decl_list *dl; -+ int i, j, size, flag; -+ decl_list *cur = NULL, *psav; -+ bas_type *ptr; -+ char *sizestr, *plus; -+ char ptemp[256]; -+ int can_inline; -+ const char *buf_declaration; -+ -+ -+ if (Inline == 0) { -+ for (dl = def->def.st.decls; dl != NULL; dl = dl->next) -+ print_stat(1, &dl->decl); -+ } else { -+ size = 0; -+ can_inline = 0; -+ for (dl = def->def.st.decls; dl != NULL; dl = dl->next) -+ if ((dl->decl.prefix == NULL) && ((ptr = find_type(dl->decl.type)) != NULL) && ((dl->decl.rel == REL_ALIAS) || (dl->decl.rel == REL_VECTOR))) { -+ -+ if (dl->decl.rel == REL_ALIAS) -+ size += ptr->length; -+ else { -+ can_inline = 1; -+ break; /* can be inlined */ -+ }; -+ } else { -+ if (size >= Inline) { -+ can_inline = 1; -+ break; /* can be inlined */ -+ } -+ size = 0; -+ } -+ if (size > Inline) -+ can_inline = 1; -+ -+ if (can_inline == 0) { /* can not inline, drop back to old mode */ -+ for (dl = def->def.st.decls; dl != NULL; dl = dl->next) -+ print_stat(1, &dl->decl); -+ return; -+ }; -+ -+ -+ -+ -+ flag = PUT; -+ for (j = 0; j < 2; j++) { -+ -+ if (flag == PUT) -+ f_print(fout, "\n\t if (xdrs->x_op == XDR_ENCODE) {\n"); -+ else -+ f_print(fout, "\n \t return (TRUE);\n\t} else if (xdrs->x_op == XDR_DECODE) {\n"); -+ -+ -+ i = 0; -+ size = 0; -+ sizestr = NULL; -+ buf_declaration = "int32_t *"; -+ for (dl = def->def.st.decls; dl != NULL; dl = dl->next) { /* xxx */ -+ -+ /* now walk down the list and check for basic types */ -+ if ((dl->decl.prefix == NULL) && ((ptr = find_type(dl->decl.type)) != NULL) && ((dl->decl.rel == REL_ALIAS) || (dl->decl.rel == REL_VECTOR))) { -+ if (i == 0) -+ cur = dl; -+ i++; -+ -+ if (dl->decl.rel == REL_ALIAS) -+ size += ptr->length; -+ else { -+ /* this is required to handle arrays */ -+ -+ if (sizestr == NULL) -+ plus = " "; -+ else -+ plus = "+"; -+ -+ if (ptr->length != 1) -+ s_print(ptemp, " %s %s * %d", plus, dl->decl.array_max, ptr->length); -+ else -+ s_print(ptemp, " %s %s ", plus, dl->decl.array_max); -+ -+ /*now concatenate to sizestr !!!! */ -+ if (sizestr == NULL) -+ sizestr = strdup(ptemp); -+ else { -+ sizestr = realloc(sizestr, strlen(sizestr) + strlen(ptemp) + 1); -+ if (sizestr == NULL) { -+ -+ f_print(stderr, "Fatal error : no memory \n"); -+ crash(); -+ }; -+ sizestr = strcat(sizestr, ptemp); /*build up length of array */ -+ -+ } -+ } -+ -+ } else { -+ if (i > 0) -+ { -+ if (sizestr == NULL && size < Inline) { -+ /* don't expand into inline code if size < inline */ -+ while (cur != dl) { -+ print_stat(1, &cur->decl); -+ cur = cur->next; -+ } -+ } else { -+ -+ -+ -+ /* were already looking at a xdr_inlineable structure */ -+ if (sizestr == NULL) -+ f_print(fout, "\t %sbuf = XDR_INLINE(xdrs,%d * BYTES_PER_XDR_UNIT);", -+ buf_declaration, size); -+ else if (size == 0) -+ f_print(fout, -+ "\t %sbuf = XDR_INLINE(xdrs,%s * BYTES_PER_XDR_UNIT);", -+ buf_declaration, sizestr); -+ else -+ f_print(fout, -+ "\t %sbuf = XDR_INLINE(xdrs,(%d + %s)* BYTES_PER_XDR_UNIT);", -+ buf_declaration, size, sizestr); -+ buf_declaration = ""; -+ -+ f_print(fout, "\n\t if (buf == NULL) {\n"); -+ -+ psav = cur; -+ while (cur != dl) { -+ print_stat(2, &cur->decl); -+ cur = cur->next; -+ } -+ -+ f_print(fout, "\n\t }\n\t else {\n"); -+ -+ cur = psav; -+ while (cur != dl) { -+ emit_inline(&cur->decl, flag); -+ cur = cur->next; -+ } -+ -+ f_print(fout, "\t }\n"); -+ } -+ } -+ size = 0; -+ i = 0; -+ sizestr = NULL; -+ print_stat(1, &dl->decl); -+ } -+ -+ } -+ if (i > 0) -+ { -+ if (sizestr == NULL && size < Inline) { -+ /* don't expand into inline code if size < inline */ -+ while (cur != dl) { -+ print_stat(1, &cur->decl); -+ cur = cur->next; -+ } -+ } else { -+ -+ /* were already looking at a xdr_inlineable structure */ -+ if (sizestr == NULL) -+ f_print(fout, "\t\t%sbuf = XDR_INLINE(xdrs,%d * BYTES_PER_XDR_UNIT);", -+ buf_declaration, size); -+ else if (size == 0) -+ f_print(fout, -+ "\t\t%sbuf = XDR_INLINE(xdrs,%s * BYTES_PER_XDR_UNIT);", -+ buf_declaration, sizestr); -+ else -+ f_print(fout, -+ "\t\t%sbuf = XDR_INLINE(xdrs,(%d + %s)* BYTES_PER_XDR_UNIT);", -+ buf_declaration, size, sizestr); -+ buf_declaration = ""; -+ -+ f_print(fout, "\n\t\tif (buf == NULL) {\n"); -+ -+ psav = cur; -+ while (cur != NULL) { -+ print_stat(2, &cur->decl); -+ cur = cur->next; -+ } -+ f_print(fout, "\n\t }\n\t else {\n"); -+ -+ cur = psav; -+ while (cur != dl) { -+ emit_inline(&cur->decl, flag); -+ cur = cur->next; -+ } -+ -+ f_print(fout, "\t }\n"); -+ -+ } -+ } -+ flag = GET; -+ } -+ f_print(fout, "\t return(TRUE);\n\t}\n\n"); -+ -+ /* now take care of XDR_FREE case */ -+ -+ for (dl = def->def.st.decls; dl != NULL; dl = dl->next) -+ print_stat(1, &dl->decl); -+ } -+} -+ -+ -+ -+ -+static void -+emit_typedef(definition *def) -+{ -+ char *prefix = def->def.ty.old_prefix; -+ char *type = def->def.ty.old_type; -+ char *amax = def->def.ty.array_max; -+ relation rel = def->def.ty.rel; -+ -+ -+ print_ifstat(1, prefix, type, rel, amax, "objp", def->def_name); -+} -+ -+static void -+print_stat(int indent, declaration *dec) -+{ -+ char *prefix = dec->prefix; -+ char *type = dec->type; -+ char *amax = dec->array_max; -+ relation rel = dec->rel; -+ char name[256]; -+ -+ if (isvectordef(type, rel)) { -+ s_print(name, "objp->%s", dec->name); -+ } else { -+ s_print(name, "&objp->%s", dec->name); -+ } -+ print_ifstat(indent, prefix, type, rel, amax, name, dec->name); -+} -+ -+ -+static void -+emit_inline(declaration *decl, int flag) -+{ -+ -+ /*check whether an array or not */ -+ -+ switch (decl->rel) { -+ case REL_ALIAS: -+ emit_single_in_line(decl, flag, REL_ALIAS); -+ break; -+ case REL_VECTOR: -+ f_print(fout, "\t\t{ register %s *genp; \n", decl->type); -+ f_print(fout, "\t\t int i;\n"); -+ f_print(fout, "\t\t for ( i = 0,genp=objp->%s;\n \t\t\ti < %s; i++){\n\t\t", -+ decl->name, decl->array_max); -+ emit_single_in_line(decl, flag, REL_VECTOR); -+ f_print(fout, "\t\t }\n\t\t };\n"); -+ break; -+ default: -+ break; -+ } -+} -+ -+static void -+emit_single_in_line(declaration *decl, int flag, relation rel) -+{ -+ char *upp_case; -+ int freed=0; -+ -+ if(flag == PUT) -+ f_print(fout,"\t\t (void) IXDR_PUT_"); -+ else -+ if(rel== REL_ALIAS) -+ f_print(fout,"\t\t objp->%s = IXDR_GET_",decl->name); -+ else -+ f_print(fout,"\t\t *genp++ = IXDR_GET_"); -+ -+ upp_case=upcase(decl->type); -+ -+ /* hack - XX */ -+ if(strcmp(upp_case,"INT") == 0) -+ { -+ free(upp_case); -+ freed=1; -+ upp_case="INT32"; -+ } -+ -+ if(strcmp(upp_case,"U_INT") == 0) -+ { -+ free(upp_case); -+ freed=1; -+ upp_case="U_INT32"; -+ } -+ -+ -+ if(flag == PUT) -+ if(rel== REL_ALIAS) -+ f_print(fout,"%s(buf,objp->%s);\n",upp_case,decl->name); -+ else -+ f_print(fout,"%s(buf,*genp++);\n",upp_case); -+ -+ else -+ f_print(fout,"%s(buf);\n",upp_case); -+ if(!freed) -+ free(upp_case); -+ -+} -+ -+ -+static char * -+upcase(char *str) -+{ -+ char *ptr, *hptr; -+ -+ -+ ptr = (char *) malloc(strlen(str)+1); -+ if (ptr == (char *) NULL) { -+ f_print(stderr, "malloc failed \n"); -+ exit(1); -+ }; -+ -+ hptr = ptr; -+ while (*str != '\0') -+ *ptr++ = toupper(*str++); -+ -+ *ptr = '\0'; -+ return (hptr); -+ -+} -diff --git a/rpcgen/rpc_hout.c b/rpcgen/rpc_hout.c -new file mode 100644 -index 0000000..ea1cb24 ---- /dev/null -+++ b/rpcgen/rpc_hout.c -@@ -0,0 +1,490 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#if 0 -+static char sccsid[] = "@(#)rpc_hout.c 1.12 89/02/22 (C) 1987 SMI"; -+#endif -+ -+/* -+ * rpc_hout.c, Header file outputter for the RPC protocol compiler -+ */ -+#include -+#include -+#include "rpc_parse.h" -+#include "rpc_util.h" -+#include "rpc_output.h" -+ -+ -+static int undefined2(char *type, char *stop); -+static void pxdrfuncdecl(char *name, int pointerp); -+static void pconstdef(definition *def); -+static void pargdef(definition *def); -+static void pstructdef(definition *def); -+static void puniondef(definition *def); -+static void pdefine(char *name, char *num); -+static void puldefine(char *name, char *num); -+static int define_printed(proc_list *stop, version_list *start); -+static void pprogramdef(definition *def); -+static void pprocdef(proc_list *proc, version_list *vp, -+ char *addargtype, int server_p, int mode); -+static void parglist(proc_list *proc, char *addargtype); -+static void penumdef(definition *def); -+static void ptypedef(definition *def); -+ -+/* -+ * Print the C-version of an xdr definition -+ */ -+void -+print_datadef(definition *def) -+{ -+ -+ if (def->def_kind == DEF_PROGRAM ) /* handle data only */ -+ return; -+ -+ if (def->def_kind != DEF_CONST) { -+ f_print(fout, "\n"); -+ } -+ switch (def->def_kind) { -+ case DEF_STRUCT: -+ pstructdef(def); -+ break; -+ case DEF_UNION: -+ puniondef(def); -+ break; -+ case DEF_ENUM: -+ penumdef(def); -+ break; -+ case DEF_TYPEDEF: -+ ptypedef(def); -+ break; -+ case DEF_PROGRAM: -+ pprogramdef(def); -+ break; -+ case DEF_CONST: -+ pconstdef(def); -+ break; -+ } -+ if (def->def_kind != DEF_PROGRAM && def->def_kind != DEF_CONST) { -+ pxdrfuncdecl( def->def_name, -+ def->def_kind != DEF_TYPEDEF || -+ !isvectordef(def->def.ty.old_type, def->def.ty.rel)); -+ -+ } -+} -+ -+ -+void -+print_funcdef(definition *def) -+{ -+ switch (def->def_kind) { -+ case DEF_PROGRAM: -+ f_print(fout, "\n"); -+ pprogramdef(def); -+ break; -+ default: -+ break; -+ } -+} -+ -+static void -+pxdrfuncdecl(char *name, int pointerp) -+{ -+ f_print(fout, -+ "#ifdef __cplusplus \n" -+ "extern \"C\" bool_t xdr_%s(XDR *, %s%s);\n" -+ "#elif __STDC__ \n" -+ "extern bool_t xdr_%s(XDR *, %s%s);\n" -+ "#else /* Old Style C */ \n" -+ "bool_t xdr_%s();\n" -+ "#endif /* Old Style C */ \n\n", -+ name, name, pointerp ? "*" : "", -+ name, name, pointerp ? "*" : "", -+ name); -+} -+ -+ -+static void -+pconstdef(definition *def) -+{ -+ pdefine(def->def_name, def->def.co); -+} -+ -+/* print out the definitions for the arguments of functions in the -+ header file -+*/ -+static void -+pargdef(definition *def) -+{ -+ decl_list *l; -+ version_list *vers; -+ char *name; -+ proc_list *plist; -+ -+ -+ for (vers = def->def.pr.versions; vers != NULL; vers = vers->next) { -+ for(plist = vers->procs; plist != NULL; -+ plist = plist->next) { -+ -+ if (!newstyle || plist->arg_num < 2) { -+ continue; /* old style or single args */ -+ } -+ name = plist->args.argname; -+ f_print(fout, "struct %s {\n", name); -+ for (l = plist->args.decls; -+ l != NULL; l = l->next) { -+ pdeclaration(name, &l->decl, 1, ";\n" ); -+ } -+ f_print(fout, "};\n"); -+ f_print(fout, "typedef struct %s %s;\n", name, name); -+ pxdrfuncdecl(name, 0); -+ f_print( fout, "\n" ); -+ } -+ } -+ -+} -+ -+ -+static void -+pstructdef(definition *def) -+{ -+ decl_list *l; -+ char *name = def->def_name; -+ -+ f_print(fout, "struct %s {\n", name); -+ for (l = def->def.st.decls; l != NULL; l = l->next) { -+ pdeclaration(name, &l->decl, 1, ";\n"); -+ } -+ f_print(fout, "};\n"); -+ f_print(fout, "typedef struct %s %s;\n", name, name); -+} -+ -+static void -+puniondef(definition *def) -+{ -+ case_list *l; -+ char *name = def->def_name; -+ declaration *decl; -+ -+ f_print(fout, "struct %s {\n", name); -+ decl = &def->def.un.enum_decl; -+ if (streq(decl->type, "bool")) { -+ f_print(fout, "\tbool_t %s;\n", decl->name); -+ } else { -+ f_print(fout, "\t%s %s;\n", decl->type, decl->name); -+ } -+ f_print(fout, "\tunion {\n"); -+ for (l = def->def.un.cases; l != NULL; l = l->next) { -+ if (l->contflag == 0) -+ pdeclaration(name, &l->case_decl, 2, ";\n"); -+ } -+ decl = def->def.un.default_decl; -+ if (decl && !streq(decl->type, "void")) { -+ pdeclaration(name, decl, 2, ";\n"); -+ } -+ f_print(fout, "\t} %s_u;\n", name); -+ f_print(fout, "};\n"); -+ f_print(fout, "typedef struct %s %s;\n", name, name); -+} -+ -+static void -+pdefine(char *name, char *num) -+{ -+ f_print(fout, "#define %s %s\n", name, num); -+} -+ -+static void -+puldefine(char *name, char *num) -+{ -+ f_print(fout, "#define %s ((u_int32_t)%s)\n", name, num); -+} -+ -+static int -+define_printed(proc_list *stop, version_list *start) -+{ -+ version_list *vers; -+ proc_list *proc; -+ -+ for (vers = start; vers != NULL; vers = vers->next) { -+ for (proc = vers->procs; proc != NULL; proc = proc->next) { -+ if (proc == stop) { -+ return (0); -+ } else if (streq(proc->proc_name, stop->proc_name)) { -+ return (1); -+ } -+ } -+ } -+ abort(); -+ /* NOTREACHED */ -+} -+ -+static void -+pprogramdef(definition *def) -+{ -+ version_list *vers; -+ proc_list *proc; -+ int i; -+ char *ext; -+ -+ pargdef(def); -+ -+ puldefine(def->def_name, def->def.pr.prog_num); -+ for (vers = def->def.pr.versions; vers != NULL; vers = vers->next) { -+ if (tblflag) { -+ f_print(fout, "extern struct rpcgen_table %s_%s_table[];\n", -+ locase(def->def_name), vers->vers_num); -+ f_print(fout, "extern %s_%s_nproc;\n", -+ locase(def->def_name), vers->vers_num); -+ } -+ puldefine(vers->vers_name, vers->vers_num); -+ -+ /* -+ * Print out 3 definitions, one for ANSI-C, another for C++, -+ * a third for old style C -+ */ -+ -+ for (i = 0; i < 3; i++) { -+ if (i == 0) { -+ f_print(fout, "\n#ifdef __cplusplus\n"); -+ ext = "extern \"C\" "; -+ } else if (i == 1) { -+ f_print(fout, "\n#elif __STDC__\n"); -+ ext = "extern "; -+ } else { -+ f_print(fout, "\n#else /* Old Style C */ \n"); -+ ext = "extern "; -+ } -+ -+ -+ for (proc = vers->procs; proc != NULL; proc = proc->next) { -+ if (!define_printed(proc, def->def.pr.versions)) { -+ puldefine(proc->proc_name, proc->proc_num); -+ } -+ f_print(fout, "%s", ext); -+ pprocdef(proc, vers, "CLIENT *", 0, i); -+ f_print(fout, "%s", ext); -+ pprocdef(proc, vers, "struct svc_req *", 1, i); -+ -+ } -+ -+ } -+ f_print(fout, "#endif /* Old Style C */ \n"); -+ } -+} -+ -+static void -+pprocdef(proc_list *proc, version_list *vp, char *addargtype, -+ int server_p, int mode) -+{ -+ ptype(proc->res_prefix, proc->res_type, 1); -+ f_print(fout, "* "); -+ if (server_p) -+ pvname_svc(proc->proc_name, vp->vers_num); -+ else -+ pvname(proc->proc_name, vp->vers_num); -+ -+ /* -+ * mode 0 == cplusplus, mode 1 = ANSI-C, mode 2 = old style C -+ */ -+ if (mode == 0 || mode == 1) -+ parglist(proc, addargtype); -+ else -+ f_print(fout, "();\n"); -+} -+ -+ -+ -+/* print out argument list of procedure */ -+static void -+parglist(proc_list *proc, char *addargtype) -+{ -+ decl_list *dl; -+ -+ f_print(fout, "("); -+ -+ if (proc->arg_num < 2 && newstyle && -+ streq(proc->args.decls->decl.type, "void")) { -+ /* 0 argument in new style: do nothing */ -+ } else { -+ for (dl = proc->args.decls; dl != NULL; dl = dl->next) { -+ ptype(dl->decl.prefix, dl->decl.type, 1); -+ if (!newstyle) -+ f_print(fout, "*"); /* old style passes by reference */ -+ -+ f_print(fout, ", "); -+ } -+ } -+ -+ f_print(fout, "%s);\n", addargtype); -+} -+ -+static void -+penumdef(definition *def) -+{ -+ char *name = def->def_name; -+ enumval_list *l; -+ char *last = NULL; -+ int count = 0; -+ -+ f_print(fout, "enum %s {\n", name); -+ for (l = def->def.en.vals; l != NULL; l = l->next) { -+ f_print(fout, "\t%s", l->name); -+ if (l->assignment) { -+ f_print(fout, " = %s", l->assignment); -+ last = l->assignment; -+ count = 1; -+ } else { -+ if (last == NULL) { -+ f_print(fout, " = %d", count++); -+ } else { -+ f_print(fout, " = %s + %d", last, count++); -+ } -+ } -+ f_print(fout, ",\n"); -+ } -+ f_print(fout, "};\n"); -+ f_print(fout, "typedef enum %s %s;\n", name, name); -+} -+ -+static void -+ptypedef(definition *def) -+{ -+ char *name = def->def_name; -+ char *old = def->def.ty.old_type; -+ char prefix[8]; /* enough to contain "struct ", including NUL */ -+ relation rel = def->def.ty.rel; -+ -+ -+ if (!streq(name, old)) { -+ if (streq(old, "string")) { -+ old = "char"; -+ rel = REL_POINTER; -+ } else if (streq(old, "opaque")) { -+ old = "char"; -+ } else if (streq(old, "bool")) { -+ old = "bool_t"; -+ } -+ if (undefined2(old, name) && def->def.ty.old_prefix) { -+ s_print(prefix, "%s ", def->def.ty.old_prefix); -+ } else { -+ prefix[0] = 0; -+ } -+ f_print(fout, "typedef "); -+ switch (rel) { -+ case REL_ARRAY: -+ f_print(fout, "struct {\n"); -+ f_print(fout, "\tu_int %s_len;\n", name); -+ f_print(fout, "\t%s%s *%s_val;\n", prefix, old, name); -+ f_print(fout, "} %s", name); -+ break; -+ case REL_POINTER: -+ f_print(fout, "%s%s *%s", prefix, old, name); -+ break; -+ case REL_VECTOR: -+ f_print(fout, "%s%s %s[%s]", prefix, old, name, -+ def->def.ty.array_max); -+ break; -+ case REL_ALIAS: -+ f_print(fout, "%s%s %s", prefix, old, name); -+ break; -+ } -+ f_print(fout, ";\n"); -+ } -+} -+ -+void -+pdeclaration(char *name, declaration *dec, int tab, char *separator) -+{ -+ char buf[8]; /* enough to hold "struct ", include NUL */ -+ char *prefix; -+ char *type; -+ -+ if (streq(dec->type, "void")) { -+ return; -+ } -+ tabify(fout, tab); -+ if (streq(dec->type, name) && !dec->prefix) { -+ f_print(fout, "struct "); -+ } -+ if (streq(dec->type, "string")) { -+ f_print(fout, "char *%s", dec->name); -+ } else { -+ prefix = ""; -+ if (streq(dec->type, "bool")) { -+ type = "bool_t"; -+ } else if (streq(dec->type, "opaque")) { -+ type = "char"; -+ } else { -+ if (dec->prefix) { -+ s_print(buf, "%s ", dec->prefix); -+ prefix = buf; -+ } -+ type = dec->type; -+ } -+ switch (dec->rel) { -+ case REL_ALIAS: -+ f_print(fout, "%s%s %s", prefix, type, dec->name); -+ break; -+ case REL_VECTOR: -+ f_print(fout, "%s%s %s[%s]", prefix, type, dec->name, -+ dec->array_max); -+ break; -+ case REL_POINTER: -+ f_print(fout, "%s%s *%s", prefix, type, dec->name); -+ break; -+ case REL_ARRAY: -+ f_print(fout, "struct {\n"); -+ tabify(fout, tab); -+ f_print(fout, "\tu_int %s_len;\n", dec->name); -+ tabify(fout, tab); -+ f_print(fout, "\t%s%s *%s_val;\n", prefix, type, dec->name); -+ tabify(fout, tab); -+ f_print(fout, "} %s", dec->name); -+ break; -+ } -+ } -+ f_print(fout, separator ); -+} -+ -+static int -+undefined2(char *type, char *stop) -+{ -+ list *l; -+ definition *def; -+ -+ for (l = defined; l != NULL; l = l->next) { -+ def = (definition *) l->val; -+ if (def->def_kind != DEF_PROGRAM) { -+ if (streq(def->def_name, stop)) { -+ return (1); -+ } else if (streq(def->def_name, type)) { -+ return (0); -+ } -+ } -+ } -+ return (1); -+} -diff --git a/rpcgen/rpc_main.c b/rpcgen/rpc_main.c -new file mode 100644 -index 0000000..28aa60c ---- /dev/null -+++ b/rpcgen/rpc_main.c -@@ -0,0 +1,1067 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#if 0 -+static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI"; -+#endif -+ -+/* -+ * rpc_main.c, Top level of the RPC protocol compiler. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "rpc_parse.h" -+#include "rpc_util.h" -+#include "rpc_scan.h" -+ -+struct commandline { -+ int cflag; /* xdr C routines */ -+ int hflag; /* header file */ -+ int lflag; /* client side stubs */ -+ int mflag; /* server side stubs */ -+ int nflag; /* netid flag */ -+ int sflag; /* server stubs for the given transport */ -+ int tflag; /* dispatch Table file */ -+ int Ssflag; /* produce server sample code */ -+ int Scflag; /* produce client sample code */ -+ char *infile; /* input module name */ -+ char *outfile; /* output module name */ -+}; -+ -+static char * extendfile(char *file, char *ext); -+static void open_output(char *infile, char *outfile); -+static void add_warning(void); -+static void clear_args(void); -+static void open_input(char *infile, char *define); -+static int check_nettype(char *name, char **list_to_check); -+static void c_output(char *infile, char *define, int extend, char *outfile); -+static void c_initialize(void); -+static char * generate_guard(char *pathname); -+static void h_output(char *infile, char *define, int extend, char *outfile); -+static void s_output(int argc, char **argv, char *infile, -+ char *define, int extend, char *outfile, -+ int nomain, int netflag); -+static void l_output(char *infile, char *define, int extend, char *outfile); -+static void t_output(char *infile, char *define, int extend, char *outfile); -+static void svc_output(char *, char *, int, char *); -+static void clnt_output(char *, char *, int, char *); -+static int do_registers(int argc, char **argv); -+static void addarg(char *cp); -+static void putarg(int where, char *cp); -+static void checkfiles(char *infile, char *outfile); -+static int parseargs(int argc, char **argv, struct commandline *cmd); -+static void usage(void); -+static void options_usage(void); -+ -+/* -+extern void write_sample_svc(); -+int write_sample_clnt(); -+void write_sample_clnt_main(); -+ -+static svc_output(); -+ */ -+ -+#define EXTEND 1 /* alias for TRUE */ -+#define DONT_EXTEND 0 /* alias for FALSE */ -+ -+#define SVR4_CPP "/usr/ccs/lib/cpp" -+#define SUNOS_CPP "/lib/cpp" -+static int cppDefined = 0; /* explicit path for C preprocessor */ -+ -+ -+static char *cmdname; -+ -+static char *svcclosetime = "120"; -+static char *CPP = SVR4_CPP; -+static char CPPFLAGS[] = "-C"; -+static char pathbuf[MAXPATHLEN + 1]; -+static char *allv[] = { -+ "rpcgen", "-s", "udp", "-s", "tcp", -+}; -+static int allc = sizeof(allv)/sizeof(allv[0]); -+static char *allnv[] = { -+ "rpcgen", "-s", "netpath", -+}; -+static int allnc = sizeof(allnv)/sizeof(allnv[0]); -+ -+/* -+ * machinations for handling expanding argument list -+ */ -+#if 0 -+static void addarg(); /* add another argument to the list */ -+static void putarg(); /* put argument at specified location */ -+static void clear_args(); /* clear argument list */ -+static void checkfiles(); /* check if out file already exists */ -+#endif -+ -+ -+ -+#define ARGLISTLEN 20 -+#define FIXEDARGS 2 -+ -+static char *arglist[ARGLISTLEN]; -+static int argcount = FIXEDARGS; -+ -+ -+int nonfatalerrors; /* errors */ -+int inetdflag/* = 1*/; /* Support for inetd */ /* is now the default */ -+int pmflag; /* Support for port monitors */ -+int logflag; /* Use syslog instead of fprintf for errors */ -+int tblflag; /* Support for dispatch table file */ -+ -+/* length at which to start doing an inline */ -+#define INLINE 3 -+ -+int Inline = INLINE; /* length at which to start doing an inline. 3 = default -+ * if 0, no xdr_inline code */ -+ -+int indefinitewait; /* If started by port monitors, hang till it wants */ -+int exitnow; /* If started by port monitors, exit after the call */ -+int timerflag; /* TRUE if !indefinite && !exitnow */ -+int newstyle; /* newstyle of passing arguments (by value) */ -+int Cflag = 0 ; /* ANSI C syntax */ -+static int allfiles; /* generate all files */ -+#ifdef linux -+int tirpcflag = 0; /* no tirpc by default */ -+#else -+int tirpcflag = 1; /* generating code for tirpc, by default */ -+#endif -+ -+int -+main(int argc, char **argv) -+{ -+ struct commandline cmd; -+ -+ (void) memset((char *) &cmd, 0, sizeof(struct commandline)); -+ clear_args(); -+ if (!parseargs(argc, argv, &cmd)) -+ usage(); -+ -+ if (cmd.cflag || cmd.hflag || cmd.lflag || cmd.tflag || cmd.sflag || -+ cmd.mflag || cmd.nflag || cmd.Ssflag || cmd.Scflag) { -+ checkfiles(cmd.infile, cmd.outfile); -+ } else -+ checkfiles(cmd.infile, NULL); -+ -+ if (cmd.cflag) { -+ c_output(cmd.infile, "-DRPC_XDR", DONT_EXTEND, cmd.outfile); -+ } else if (cmd.hflag) { -+ h_output(cmd.infile, "-DRPC_HDR", DONT_EXTEND, cmd.outfile); -+ } else if (cmd.lflag) { -+ l_output(cmd.infile, "-DRPC_CLNT", DONT_EXTEND, cmd.outfile); -+ } else if (cmd.sflag || cmd.mflag || (cmd.nflag)) { -+ s_output(argc, argv, cmd.infile, "-DRPC_SVC", DONT_EXTEND, -+ cmd.outfile, cmd.mflag, cmd.nflag); -+ } else if (cmd.tflag) { -+ t_output(cmd.infile, "-DRPC_TBL", DONT_EXTEND, cmd.outfile); -+ } else if (cmd.Ssflag) { -+ svc_output(cmd.infile, "-DRPC_SERVER", DONT_EXTEND, cmd.outfile); -+ } else if (cmd.Scflag) { -+ clnt_output(cmd.infile, "-DRPC_CLIENT", DONT_EXTEND, cmd.outfile); -+ } else { -+ /* the rescans are required, since cpp may effect input */ -+ c_output(cmd.infile, "-DRPC_XDR", EXTEND, "_xdr.c"); -+ reinitialize(); -+ h_output(cmd.infile, "-DRPC_HDR", EXTEND, ".h"); -+ reinitialize(); -+ l_output(cmd.infile, "-DRPC_CLNT", EXTEND, "_clnt.c"); -+ reinitialize(); -+ if (inetdflag || !tirpcflag) -+ s_output(allc, allv, cmd.infile, "-DRPC_SVC", EXTEND, -+ "_svc.c", cmd.mflag, cmd.nflag); -+ else -+ s_output(allnc, allnv, cmd.infile, "-DRPC_SVC", -+ EXTEND, "_svc.c", cmd.mflag, cmd.nflag); -+ if (tblflag) { -+ reinitialize(); -+ t_output(cmd.infile, "-DRPC_TBL", EXTEND, "_tbl.i"); -+ } -+ if (allfiles) { -+ reinitialize(); -+ svc_output(cmd.infile, "-DRPC_SERVER", EXTEND, "_server.c"); -+ } -+ if (allfiles) { -+ reinitialize(); -+ clnt_output(cmd.infile, "-DRPC_CLIENT", EXTEND, "_client.c"); -+ } -+ } -+ exit(nonfatalerrors); -+ /* NOTREACHED */ -+} -+ -+/* -+ * add extension to filename -+ */ -+static char * -+extendfile(char *file, char *ext) -+{ -+ char *res; -+ char *p; -+ -+ res = alloc(strlen(file) + strlen(ext) + 1); -+ if (res == NULL) { -+ abort(); -+ } -+ p = strrchr(file, '.'); -+ if (p == NULL) { -+ p = file + strlen(file); -+ } -+ (void) strcpy(res, file); -+ (void) strcpy(res + (p - file), ext); -+ return (res); -+} -+ -+/* -+ * Open output file with given extension -+ */ -+static void -+open_output(char *infile, char *outfile) -+{ -+ -+ if (outfile == NULL) { -+ fout = stdout; -+ return; -+ } -+ -+ if (infile != NULL && streq(outfile, infile)) { -+ f_print(stderr, "%s: output would overwrite %s\n", cmdname, -+ infile); -+ crash(); -+ } -+ fout = fopen(outfile, "w"); -+ if (fout == NULL) { -+ f_print(stderr, "%s: unable to open ", cmdname); -+ perror(outfile); -+ crash(); -+ } -+ record_open(outfile); -+ -+} -+ -+static void -+add_warning(void) -+{ -+ f_print(fout, "/*\n"); -+ f_print(fout, " * Please do not edit this file.\n"); -+ f_print(fout, " * It was generated using rpcgen.\n"); -+ f_print(fout, " */\n\n"); -+} -+ -+/* clear list of arguments */ -+static void -+clear_args(void) -+{ -+ int i; -+ for( i=FIXEDARGS; i" : infile; -+ (void) pipe(pd); -+ switch (fork()) { -+ case 0: -+ putarg(0, "cpp"); -+ putarg(1, CPPFLAGS); -+ addarg(define); -+ addarg(infile); -+ addarg((char *)NULL); -+ (void) close(1); -+ (void) dup2(pd[1], 1); -+ (void) close(pd[0]); -+ if (cppDefined) -+ execv(CPP, arglist); -+ else { -+ execvp("cpp", arglist); -+ if (errno == ENOENT) -+ execvp(SVR4_CPP, arglist); -+ if (errno == ENOENT) -+ execvp(SUNOS_CPP, arglist); -+ } -+ perror("execv"); -+ exit(1); -+ case -1: -+ perror("fork"); -+ exit(1); -+ } -+ (void) close(pd[1]); -+ fin = fdopen(pd[0], "r"); -+ if (fin == NULL) { -+ f_print(stderr, "%s: ", cmdname); -+ perror(infilename); -+ crash(); -+ } -+} -+ -+/* valid tirpc nettypes */ -+static char* valid_ti_nettypes[] = -+{ -+ "netpath", -+ "visible", -+ "circuit_v", -+ "datagram_v", -+ "circuit_n", -+ "datagram_n", -+ "udp", -+ "tcp", -+ "raw", -+ NULL -+}; -+ -+/* valid inetd nettypes */ -+static char* valid_i_nettypes[] = -+{ -+ "udp", -+ "tcp", -+ NULL -+}; -+ -+static int -+check_nettype(char *name, char **list_to_check) -+{ -+ int i; -+ for( i = 0; list_to_check[i] != NULL; i++ ) { -+ if( strcmp( name, list_to_check[i] ) == 0 ) { -+ return 1; -+ } -+ } -+ f_print( stderr, "illegal nettype :\'%s\'\n", name ); -+ return 0; -+} -+ -+/* -+ * Compile into an XDR routine output file -+ */ -+ -+static void -+c_output(char *infile, char *define, int extend, char *outfile) -+{ -+ definition *def; -+ char *include; -+ char *outfilename; -+ long tell; -+ -+ c_initialize(); -+ open_input(infile, define); -+ outfilename = extend ? extendfile(infile, outfile) : outfile; -+ open_output(infile, outfilename); -+ add_warning(); -+ if (infile && (include = extendfile(infile, ".h"))) { -+ f_print(fout, "#include \"%s\"\n", include); -+ free(include); -+ /* .h file already contains rpc/rpc.h */ -+ } else -+ f_print(fout, "#include \n"); -+ tell = ftell(fout); -+ while ((def = get_definition()) != NULL) { -+ emit(def); -+ } -+ if (extend && tell == ftell(fout)) { -+ (void) unlink(outfilename); -+ } -+} -+ -+ -+static void -+c_initialize(void) -+{ -+ -+ /* add all the starting basic types */ -+ -+ add_type(1,"int"); -+ add_type(1,"int32_t"); -+ add_type(1,"short"); -+ add_type(1,"bool"); -+ -+ add_type(1,"u_int"); -+ add_type(1,"u_int32_t"); -+ add_type(1,"u_short"); -+ -+} -+ -+char rpcgen_table_dcl[] = "struct rpcgen_table {\n\ -+ char *(*proc)();\n\ -+ xdrproc_t xdr_arg;\n\ -+ unsigned len_arg;\n\ -+ xdrproc_t xdr_res;\n\ -+ unsigned len_res;\n\ -+};\n"; -+ -+ -+static char * -+generate_guard(char *pathname) -+{ -+ char* filename, *guard, *tmp; -+ -+ filename = strrchr(pathname, '/' ); /* find last component */ -+ filename = ((filename == 0) ? pathname : filename+1); -+ guard = strdup(filename); -+ /* convert to upper case */ -+ tmp = guard; -+ while (*tmp) { -+ if (islower(*tmp)) -+ *tmp = toupper(*tmp); -+ tmp++; -+ } -+ -+ guard = extendfile(guard, "_H_RPCGEN"); -+ return( guard ); -+} -+ -+/* -+ * Compile into an XDR header file -+ */ -+static void -+h_output(char *infile, char *define, int extend, char *outfile) -+{ -+ definition *def; -+ char *outfilename; -+ long tell; -+ char *guard; -+ list *l; -+ -+ open_input(infile, define); -+ outfilename = extend ? extendfile(infile, outfile) : outfile; -+ open_output(infile, outfilename); -+ add_warning(); -+ guard = generate_guard( outfilename ? outfilename: infile ); -+ -+ f_print(fout,"#ifndef _%s\n#define _%s\n\n", guard, -+ guard); -+ -+ f_print(fout, "#include \n\n"); -+ -+ f_print(fout, "#ifndef IXDR_GET_INT32\n"); -+ f_print(fout, "#define IXDR_GET_INT32(buf) IXDR_GET_LONG((buf))\n"); -+ f_print(fout, "#endif\n"); -+ f_print(fout, "#ifndef IXDR_PUT_INT32\n"); -+ f_print(fout, "#define IXDR_PUT_INT32(buf, v) IXDR_PUT_LONG((buf), (v))\n"); -+ f_print(fout, "#endif\n"); -+ f_print(fout, "#ifndef IXDR_GET_U_INT32\n"); -+ f_print(fout, "#define IXDR_GET_U_INT32(buf) IXDR_GET_U_LONG((buf))\n"); -+ f_print(fout, "#endif\n"); -+ f_print(fout, "#ifndef IXDR_PUT_U_INT32\n"); -+ f_print(fout, "#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_U_LONG((buf), (v))\n"); -+ f_print(fout, "#endif\n"); -+ -+ tell = ftell(fout); -+ /* print data definitions */ -+ while ((def = get_definition()) != NULL) { -+ print_datadef(def); -+ } -+ -+ /* print function declarations. -+ Do this after data definitions because they might be used as -+ arguments for functions */ -+ for (l = defined; l != NULL; l = l->next) { -+ print_funcdef(l->val); -+ } -+ if (extend && tell == ftell(fout)) { -+ (void) unlink(outfilename); -+ } else if (tblflag) { -+ f_print(fout, rpcgen_table_dcl); -+ } -+ f_print(fout, "\n#endif /* !_%s */\n", guard); -+} -+ -+/* -+ * Compile into an RPC service -+ */ -+static void -+s_output(int argc, char **argv, char *infile, char *define, int extend, -+ char *outfile, int nomain, int netflag) -+{ -+ char *include; -+ definition *def; -+ int foundprogram = 0; -+ char *outfilename; -+ -+ open_input(infile, define); -+ outfilename = extend ? extendfile(infile, outfile) : outfile; -+ open_output(infile, outfilename); -+ add_warning(); -+ if (infile && (include = extendfile(infile, ".h"))) { -+ f_print(fout, "#include \"%s\"\n", include); -+ free(include); -+ } else -+ f_print(fout, "#include \n"); -+ -+ f_print(fout, "#include \n"); -+ f_print(fout, "#include /* getenv, exit */\n"); -+ if (Cflag) { -+ f_print (fout, "#include /* for pmap_unset */\n"); -+ f_print (fout, "#include /* strcmp */ \n"); -+ } -+ if (strcmp(svcclosetime, "-1") == 0) -+ indefinitewait = 1; -+ else if (strcmp(svcclosetime, "0") == 0) -+ exitnow = 1; -+ else if (inetdflag || pmflag) { -+ f_print(fout, "#include \n"); -+ timerflag = 1; -+ } -+ -+#ifndef linux -+ if( !tirpcflag && inetdflag ) -+ f_print(fout, "#include /* TIOCNOTTY */\n"); -+#else -+ if( !tirpcflag ) -+ f_print(fout, "#include /* TIOCNOTTY */\n"); -+#endif -+ if( Cflag && (inetdflag || pmflag ) ) { -+ f_print(fout, "#ifdef __cplusplus\n"); -+ f_print(fout, "#include /* getdtablesize, open */\n"); -+ f_print(fout, "#endif /* __cplusplus */\n"); -+ -+ if( tirpcflag ) -+ f_print(fout, "#include /* setsid */\n"); -+ } -+ if( tirpcflag ) -+ f_print(fout, "#include \n"); -+ -+ f_print(fout, "#include \n"); -+#ifndef linux -+ f_print(fout, "#include \n"); -+#endif -+ if (inetdflag || !tirpcflag ) { -+ f_print(fout, "#include \n"); -+ f_print(fout, "#include \n"); -+ } -+ -+ if ( (netflag || pmflag) && tirpcflag ) { -+ f_print(fout, "#include \n"); -+ } -+ if (/*timerflag &&*/ tirpcflag) -+ f_print(fout, "#include /* rlimit */\n"); -+ if (logflag || inetdflag || pmflag) { -+#ifdef linux -+ f_print(fout, "#include \n"); -+#else -+ f_print(fout, "#ifdef SYSLOG\n"); -+ f_print(fout, "#include \n"); -+ f_print(fout, "#else\n"); -+ f_print(fout, "#define LOG_ERR 1\n"); -+ f_print(fout, "#define openlog(a, b, c)\n"); -+ f_print(fout, "#endif\n"); -+#endif -+ } -+ -+ /* for ANSI-C */ -+ f_print(fout, "\n#ifdef __STDC__\n#define SIG_PF void(*)(int)\n#endif\n"); -+ -+ f_print(fout, "\n#ifdef DEBUG\n#define RPC_SVC_FG\n#endif\n"); -+ if (timerflag) -+ f_print(fout, "\n#define _RPCSVC_CLOSEDOWN %s\n", svcclosetime); -+ while ((def = get_definition()) != NULL) { -+ foundprogram |= (def->def_kind == DEF_PROGRAM); -+ } -+ if (extend && !foundprogram) { -+ (void) unlink(outfilename); -+ return; -+ } -+ write_most(infile, netflag, nomain); -+ if (!nomain) { -+ if( !do_registers(argc, argv) ) { -+ if (outfilename) -+ (void) unlink(outfilename); -+ usage(); -+ } -+ write_rest(); -+ } -+} -+ -+/* -+ * generate client side stubs -+ */ -+static void -+l_output(char *infile, char *define, int extend, char *outfile) -+{ -+ char *include; -+ definition *def; -+ int foundprogram = 0; -+ char *outfilename; -+ -+ open_input(infile, define); -+ outfilename = extend ? extendfile(infile, outfile) : outfile; -+ open_output(infile, outfilename); -+ add_warning(); -+ if (Cflag) -+ f_print (fout, "#include /* for memset */\n"); -+ if (infile && (include = extendfile(infile, ".h"))) { -+ f_print(fout, "#include \"%s\"\n", include); -+ free(include); -+ } else -+ f_print(fout, "#include \n"); -+ while ((def = get_definition()) != NULL) { -+ foundprogram |= (def->def_kind == DEF_PROGRAM); -+ } -+ if (extend && !foundprogram) { -+ (void) unlink(outfilename); -+ return; -+ } -+ write_stubs(); -+} -+ -+/* -+ * generate the dispatch table -+ */ -+static void -+t_output(char *infile, char *define, int extend, char *outfile) -+{ -+ definition *def; -+ int foundprogram = 0; -+ char *outfilename; -+ -+ open_input(infile, define); -+ outfilename = extend ? extendfile(infile, outfile) : outfile; -+ open_output(infile, outfilename); -+ add_warning(); -+ while ((def = get_definition()) != NULL) { -+ foundprogram |= (def->def_kind == DEF_PROGRAM); -+ } -+ if (extend && !foundprogram) { -+ (void) unlink(outfilename); -+ return; -+ } -+ write_tables(); -+} -+ -+/* sample routine for the server template */ -+static void -+svc_output(char *infile, char *define, int extend, char *outfile) -+{ -+ definition *def; -+ char *include; -+ char *outfilename; -+ long tell; -+ -+ open_input(infile, define); -+ outfilename = extend ? extendfile(infile, outfile) : outfile; -+ checkfiles(infile,outfilename); /*check if outfile already exists. -+ if so, print an error message and exit*/ -+ open_output(infile, outfilename); -+ add_sample_msg(); -+ -+ if (infile && (include = extendfile(infile, ".h"))) { -+ f_print(fout, "#include \"%s\"\n", include); -+ free(include); -+ } else -+ f_print(fout, "#include \n"); -+ -+ tell = ftell(fout); -+ while ((def = get_definition()) != NULL) { -+ write_sample_svc(def); -+ } -+ if (extend && tell == ftell(fout)) { -+ (void) unlink(outfilename); -+ } -+} -+ -+ -+/* sample main routine for client */ -+static void -+clnt_output(char *infile, char *define, int extend, char *outfile) -+{ -+ definition *def; -+ char *include; -+ char *outfilename; -+ long tell; -+ int has_program = 0; -+ -+ open_input(infile, define); -+ outfilename = extend ? extendfile(infile, outfile) : outfile; -+ checkfiles(infile, outfilename); /*check if outfile already exists. -+ if so, print an error message and exit*/ -+ -+ open_output(infile, outfilename); -+ add_sample_msg(); -+ if (infile && (include = extendfile(infile, ".h"))) { -+ f_print(fout, "#include \"%s\"\n", include); -+ free(include); -+ } else -+ f_print(fout, "#include \n"); -+ tell = ftell(fout); -+ while ((def = get_definition()) != NULL) { -+ has_program += write_sample_clnt(def); -+ } -+ -+ if (has_program) -+ write_sample_clnt_main(); -+ -+ if (extend && tell == ftell(fout)) { -+ (void) unlink(outfilename); -+ } -+} -+ -+/* -+ * Perform registrations for service output -+ * Return 0 if failed; 1 otherwise. -+ */ -+static int -+do_registers(int argc, char **argv) -+{ -+ int i; -+ -+ if (inetdflag || !tirpcflag) { -+ for (i = 1; i < argc; i++) { -+ if (streq(argv[i], "-s")) { -+ if (!check_nettype(argv[i + 1], valid_i_nettypes)) -+ return 0; -+ write_inetd_register(argv[i + 1]); -+ i++; -+ } -+ } -+ } else { -+ for (i = 1; i < argc; i++) -+ if (streq(argv[i], "-s")) { -+ if (!check_nettype(argv[i + 1], valid_ti_nettypes)) -+ return 0; -+ write_nettype_register(argv[i + 1]); -+ i++; -+ } else if (streq(argv[i], "-n")) { -+ write_netid_register(argv[i + 1]); -+ i++; -+ } -+ } -+ return 1; -+} -+ -+/* -+ * Add another argument to the arg list -+ */ -+static void -+addarg(char *cp) -+{ -+ if (argcount >= ARGLISTLEN) { -+ f_print(stderr, "rpcgen: too many defines\n"); -+ crash(); -+ /*NOTREACHED*/ -+ } -+ arglist[argcount++] = cp; -+ -+} -+ -+static void -+putarg(int where, char *cp) -+{ -+ if (where >= ARGLISTLEN) { -+ f_print(stderr, "rpcgen: arglist coding error\n"); -+ crash(); -+ /*NOTREACHED*/ -+ } -+ arglist[where] = cp; -+ -+} -+ -+/* -+ * if input file is stdin and an output file is specified then complain -+ * if the file already exists. Otherwise the file may get overwritten -+ * If input file does not exist, exit with an error -+ */ -+ -+static void -+checkfiles(char *infile, char *outfile) -+{ -+ -+ struct stat buf; -+ -+ if(infile) /* infile ! = NULL */ -+ if(stat(infile,&buf) < 0) -+ { -+ perror(infile); -+ crash(); -+ }; -+ if (outfile) { -+ if (stat(outfile, &buf) < 0) -+ return; /* file does not exist */ -+ else { -+ f_print(stderr, -+ "file '%s' already exists and may be overwritten\n", outfile); -+ crash(); -+ } -+ } -+} -+ -+/* -+ * Parse command line arguments -+ */ -+static int -+parseargs(int argc, char **argv, struct commandline *cmd) -+{ -+ int i; -+ int j; -+ char c; -+ char flag[(1 << 8 * sizeof(char))]; -+ int nflags; -+ -+ cmdname = argv[0]; -+ cmd->infile = cmd->outfile = NULL; -+ if (argc < 2) { -+ return (0); -+ } -+ allfiles = 0; -+ flag['c'] = 0; -+ flag['h'] = 0; -+ flag['l'] = 0; -+ flag['m'] = 0; -+ flag['o'] = 0; -+ flag['s'] = 0; -+ flag['n'] = 0; -+ flag['t'] = 0; -+ flag['S'] = 0; -+ flag['C'] = 0; -+ for (i = 1; i < argc; i++) { -+ if (argv[i][0] != '-') { -+ if (cmd->infile) { -+ f_print( stderr, "Cannot specify more than one input file!\n"); -+ -+ return (0); -+ } -+ cmd->infile = argv[i]; -+ } else { -+ for (j = 1; argv[i][j] != 0; j++) { -+ c = argv[i][j]; -+ switch (c) { -+ case 'a': -+ allfiles = 1; -+ break; -+ case 'c': -+ case 'h': -+ case 'l': -+ case 'm': -+ case 't': -+ if (flag[(int) c]) { -+ return (0); -+ } -+ flag[(int) c] = 1; -+ break; -+ case 'S': -+ /* sample flag: Ss or Sc. -+ Ss means set flag['S']; -+ Sc means set flag['C']; */ -+ c = argv[i][++j]; /* get next char */ -+ if( c == 's' ) -+ c = 'S'; -+ else if( c == 'c' ) -+ c = 'C'; -+ else -+ return( 0 ); -+ -+ if (flag[(int) c]) { -+ return (0); -+ } -+ flag[(int) c] = 1; -+ break; -+ case 'C': /* ANSI C syntax */ -+ Cflag = 1; -+ break; -+ -+ case 'b': /* turn TIRPC flag off for -+ generating backward compatible -+ */ -+ tirpcflag = 0; -+ break; -+ -+ case 'I': -+ inetdflag = 1; -+ break; -+ case 'N': -+ newstyle = 1; -+ break; -+ case 'L': -+ logflag = 1; -+ break; -+ case 'K': -+ if (++i == argc) { -+ return (0); -+ } -+ svcclosetime = argv[i]; -+ goto nextarg; -+ case 'T': -+ tblflag = 1; -+ break; -+ case 'i' : -+ if (++i == argc) { -+ return (0); -+ } -+ Inline = atoi(argv[i]); -+ goto nextarg; -+ case 'n': -+ case 'o': -+ case 's': -+ if (argv[i][j - 1] != '-' || -+ argv[i][j + 1] != 0) { -+ return (0); -+ } -+ flag[(int) c] = 1; -+ if (++i == argc) { -+ return (0); -+ } -+ if (c == 's') { -+ if (!streq(argv[i], "udp") && -+ !streq(argv[i], "tcp")) { -+ return (0); -+ } -+ } else if (c == 'o') { -+ if (cmd->outfile) { -+ return (0); -+ } -+ cmd->outfile = argv[i]; -+ } -+ goto nextarg; -+ case 'D': -+ if (argv[i][j - 1] != '-') { -+ return (0); -+ } -+ (void) addarg(argv[i]); -+ goto nextarg; -+ case 'Y': -+ if (++i == argc) { -+ return (0); -+ } -+ (void) strcpy(pathbuf, argv[i]); -+ (void) strcat(pathbuf, "/cpp"); -+ CPP = pathbuf; -+ cppDefined = 1; -+ goto nextarg; -+ -+ -+ -+ default: -+ return (0); -+ } -+ } -+ nextarg: -+ ; -+ } -+ } -+ -+ cmd->cflag = flag['c']; -+ cmd->hflag = flag['h']; -+ cmd->lflag = flag['l']; -+ cmd->mflag = flag['m']; -+ cmd->nflag = flag['n']; -+ cmd->sflag = flag['s']; -+ cmd->tflag = flag['t']; -+ cmd->Ssflag = flag['S']; -+ cmd->Scflag = flag['C']; -+ -+ if( tirpcflag ) { -+ pmflag = inetdflag ? 0 : 1; /* pmflag or inetdflag is always TRUE */ -+ if( (inetdflag && cmd->nflag)) { /* netid not allowed with inetdflag */ -+ f_print(stderr, "Cannot use netid flag with inetd flag!\n"); -+ return (0); -+ } -+ } else { /* 4.1 mode */ -+ pmflag = 0; /* set pmflag only in tirpcmode */ -+ inetdflag = 1; /* inetdflag is TRUE by default */ -+ if( cmd->nflag ) { /* netid needs TIRPC */ -+ f_print( stderr, "Cannot use netid flag without TIRPC!\n"); -+ return( 0 ); -+ } -+ } -+ -+ if( newstyle && ( tblflag || cmd->tflag) ) { -+ f_print( stderr, "Cannot use table flags with newstyle!\n"); -+ return( 0 ); -+ } -+ -+ /* check no conflicts with file generation flags */ -+ nflags = cmd->cflag + cmd->hflag + cmd->lflag + cmd->mflag + -+ cmd->sflag + cmd->nflag + cmd->tflag + cmd->Ssflag + cmd->Scflag; -+ -+ if (nflags == 0) { -+ if (cmd->outfile != NULL || cmd->infile == NULL) { -+ return (0); -+ } -+ } else if (nflags > 1) { -+ f_print( stderr, "Cannot have more than one file generation flag!\n"); -+ return (0); -+ } -+ return (1); -+} -+ -+static void -+usage(void) -+{ -+ f_print(stderr, "usage: %s infile\n", cmdname); -+ f_print(stderr, "\t%s [-a][-b][-C][-Dname[=value]] -i size [-I [-K seconds]] [-L][-N][-T] infile\n", -+ cmdname); -+ f_print(stderr, "\t%s [-c | -h | -l | -m | -t | -Sc | -Ss] [-o outfile] [infile]\n", -+ cmdname); -+ f_print(stderr, "\t%s [-s nettype]* [-o outfile] [infile]\n", cmdname); -+ f_print(stderr, "\t%s [-n netid]* [-o outfile] [infile]\n", cmdname); -+ options_usage(); -+ exit(1); -+} -+ -+static void -+options_usage(void) -+{ -+ f_print(stderr, "options:\n"); -+ f_print(stderr, "-a\t\tgenerate all files, including samples\n"); -+ f_print(stderr, "-b\t\tbackward compatibility mode (generates code for SunOS 4.1)\n"); -+ f_print(stderr, "-c\t\tgenerate XDR routines\n"); -+ f_print(stderr, "-C\t\tANSI C mode\n"); -+ f_print(stderr, "-Dname[=value]\tdefine a symbol (same as #define)\n"); -+ f_print(stderr, "-h\t\tgenerate header file\n"); -+ f_print(stderr, "-i size\t\tsize at which to start generating inline code\n"); -+ f_print(stderr, "-I\t\tgenerate code for inetd support in server (for SunOS 4.1)\n"); -+ f_print(stderr, "-K seconds\tserver exits after K seconds of inactivity\n"); -+ f_print(stderr, "-l\t\tgenerate client side stubs\n"); -+ f_print(stderr, "-L\t\tserver errors will be printed to syslog\n"); -+ f_print(stderr, "-m\t\tgenerate server side stubs\n"); -+ f_print(stderr, "-n netid\tgenerate server code that supports named netid\n"); -+ f_print(stderr, "-N\t\tsupports multiple arguments and call-by-value\n"); -+ f_print(stderr, "-o outfile\tname of the output file\n"); -+ f_print(stderr, "-s nettype\tgenerate server code that supports named nettype\n"); -+ f_print(stderr, "-Sc\t\tgenerate sample client code that uses remote procedures\n"); -+ f_print(stderr, "-Ss\t\tgenerate sample server code that defines remote procedures\n"); -+ f_print(stderr, "-t\t\tgenerate RPC dispatch table\n"); -+ f_print(stderr, "-T\t\tgenerate code to support RPC dispatch tables\n"); -+ f_print(stderr, "-Y path\t\tdirectory name to find C preprocessor (cpp)\n"); -+ -+ exit(1); -+} -diff --git a/rpcgen/rpc_output.h b/rpcgen/rpc_output.h -new file mode 100644 -index 0000000..eb25a60 ---- /dev/null -+++ b/rpcgen/rpc_output.h -@@ -0,0 +1,16 @@ -+/* -+ * rpc_output.h -+ * -+ * Declarations for output functions -+ * -+ */ -+ -+#ifndef RPCGEN_NEW_OUTPUT_H -+#define RPCGEN_NEW_OUTPUT_H -+ -+void write_msg_out(void); -+int nullproc(proc_list *); -+void printarglist(proc_list *, char *, char *); -+void pdeclaration(char *, declaration *, int, char *); -+ -+#endif /* RPCGEN_NEW_OUTPUT_H */ -diff --git a/rpcgen/rpc_parse.c b/rpcgen/rpc_parse.c -new file mode 100644 -index 0000000..b53a553 ---- /dev/null -+++ b/rpcgen/rpc_parse.c -@@ -0,0 +1,609 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#if 0 -+static char sccsid[] = "@(#)rpc_parse.c 1.8 89/02/22 (C) 1987 SMI"; -+#endif -+ -+/* -+ * rpc_parse.c, Parser for the RPC protocol compiler -+ * Copyright (C) 1987 Sun Microsystems, Inc. -+ */ -+#include -+#include -+#include "rpc/types.h" -+#include "rpc_scan.h" -+#include "rpc_parse.h" -+#include "rpc_util.h" -+ -+#define ARGNAME "arg" -+ -+/* -+extern char *make_argname(); -+extern char *strdup(); -+ */ -+ -+static void isdefined(definition *defp); -+static void def_struct(definition *defp); -+static void def_program(definition *defp); -+static void def_enum(definition *defp); -+static void def_const(definition *defp); -+static void def_union(definition *defp); -+static void check_type_name(char *name, int new_type); -+static void def_typedef(definition *defp); -+static void get_declaration(declaration *dec, defkind dkind); -+static void get_prog_declaration(declaration *dec, defkind dkind, int num); -+static void get_type(char **prefixp, char **typep, defkind dkind); -+static void unsigned_dec(char **typep); -+ -+/* -+ * return the next definition you see -+ */ -+definition * -+get_definition(void) -+{ -+ definition *defp; -+ token tok; -+ -+ defp = ALLOC(definition); -+ get_token(&tok); -+ switch (tok.kind) { -+ case TOK_STRUCT: -+ def_struct(defp); -+ break; -+ case TOK_UNION: -+ def_union(defp); -+ break; -+ case TOK_TYPEDEF: -+ def_typedef(defp); -+ break; -+ case TOK_ENUM: -+ def_enum(defp); -+ break; -+ case TOK_PROGRAM: -+ def_program(defp); -+ break; -+ case TOK_CONST: -+ def_const(defp); -+ break; -+ case TOK_EOF: -+ free(defp); -+ return (NULL); -+ default: -+ error("definition keyword expected"); -+ } -+ scan(TOK_SEMICOLON, &tok); -+ isdefined(defp); -+ return (defp); -+} -+ -+static void -+isdefined(definition *defp) -+{ -+ STOREVAL(&defined, defp); -+} -+ -+static void -+def_struct(definition *defp) -+{ -+ token tok; -+ declaration dec; -+ decl_list *decls; -+ decl_list **tailp; -+ -+ defp->def_kind = DEF_STRUCT; -+ -+ scan(TOK_IDENT, &tok); -+ defp->def_name = tok.str; -+ scan(TOK_LBRACE, &tok); -+ tailp = &defp->def.st.decls; -+ do { -+ get_declaration(&dec, DEF_STRUCT); -+ decls = ALLOC(decl_list); -+ decls->decl = dec; -+ *tailp = decls; -+ tailp = &decls->next; -+ scan(TOK_SEMICOLON, &tok); -+ peek(&tok); -+ } while (tok.kind != TOK_RBRACE); -+ get_token(&tok); -+ *tailp = NULL; -+} -+ -+static void -+def_program(definition *defp) -+{ -+ token tok; -+ declaration dec; -+ decl_list *decls; -+ decl_list **tailp; -+ version_list *vlist; -+ version_list **vtailp; -+ proc_list *plist; -+ proc_list **ptailp; -+ int num_args; -+ bool_t isvoid = FALSE; /* whether first argument is void */ -+ defp->def_kind = DEF_PROGRAM; -+ scan(TOK_IDENT, &tok); -+ defp->def_name = tok.str; -+ scan(TOK_LBRACE, &tok); -+ vtailp = &defp->def.pr.versions; -+ tailp = &defp->def.st.decls; -+ scan(TOK_VERSION, &tok); -+ do { -+ scan(TOK_IDENT, &tok); -+ vlist = ALLOC(version_list); -+ vlist->vers_name = tok.str; -+ scan(TOK_LBRACE, &tok); -+ ptailp = &vlist->procs; -+ do { -+ /* get result type */ -+ plist = ALLOC(proc_list); -+ get_type(&plist->res_prefix, &plist->res_type, -+ DEF_PROGRAM); -+ if (streq(plist->res_type, "opaque")) { -+ error("illegal result type"); -+ } -+ scan(TOK_IDENT, &tok); -+ plist->proc_name = tok.str; -+ scan(TOK_LPAREN, &tok); -+ /* get args - first one*/ -+ num_args = 1; -+ isvoid = FALSE; -+ /* type of DEF_PROGRAM in the first -+ * get_prog_declaration and DEF_STURCT in the next -+ * allows void as argument if it is the only argument -+ */ -+ get_prog_declaration(&dec, DEF_PROGRAM, num_args); -+ if (streq(dec.type, "void")) -+ isvoid = TRUE; -+ decls = ALLOC(decl_list); -+ plist->args.decls = decls; -+ decls->decl = dec; -+ tailp = &decls->next; -+ /* get args */ -+ while(peekscan(TOK_COMMA, &tok)) { -+ num_args++; -+ get_prog_declaration(&dec, DEF_STRUCT, -+ num_args); -+ decls = ALLOC(decl_list); -+ decls->decl = dec; -+ *tailp = decls; -+ if (streq(dec.type, "void")) -+ isvoid = TRUE; -+ tailp = &decls->next; -+ } -+ /* multiple arguments are only allowed in newstyle */ -+ if( !newstyle && num_args > 1 ) { -+ error("only one argument is allowed" ); -+ } -+ if (isvoid && num_args > 1) { -+ error("illegal use of void in program definition"); -+ } -+ *tailp = NULL; -+ scan(TOK_RPAREN, &tok); -+ scan(TOK_EQUAL, &tok); -+ scan_num(&tok); -+ scan(TOK_SEMICOLON, &tok); -+ plist->proc_num = tok.str; -+ plist->arg_num = num_args; -+ *ptailp = plist; -+ ptailp = &plist->next; -+ peek(&tok); -+ } while (tok.kind != TOK_RBRACE); -+ *ptailp = NULL; -+ *vtailp = vlist; -+ vtailp = &vlist->next; -+ scan(TOK_RBRACE, &tok); -+ scan(TOK_EQUAL, &tok); -+ scan_num(&tok); -+ vlist->vers_num = tok.str; -+ /* make the argument structure name for each arg*/ -+ for(plist = vlist->procs; plist != NULL; -+ plist = plist->next) { -+ plist->args.argname = make_argname(plist->proc_name, -+ vlist->vers_num); -+ /* free the memory ??*/ -+ } -+ scan(TOK_SEMICOLON, &tok); -+ scan2(TOK_VERSION, TOK_RBRACE, &tok); -+ } while (tok.kind == TOK_VERSION); -+ scan(TOK_EQUAL, &tok); -+ scan_num(&tok); -+ defp->def.pr.prog_num = tok.str; -+ *vtailp = NULL; -+} -+ -+ -+static void -+def_enum(definition *defp) -+{ -+ token tok; -+ enumval_list *elist; -+ enumval_list **tailp; -+ -+ defp->def_kind = DEF_ENUM; -+ scan(TOK_IDENT, &tok); -+ defp->def_name = tok.str; -+ scan(TOK_LBRACE, &tok); -+ tailp = &defp->def.en.vals; -+ do { -+ scan(TOK_IDENT, &tok); -+ elist = ALLOC(enumval_list); -+ elist->name = tok.str; -+ elist->assignment = NULL; -+ scan3(TOK_COMMA, TOK_RBRACE, TOK_EQUAL, &tok); -+ if (tok.kind == TOK_EQUAL) { -+ scan_num(&tok); -+ elist->assignment = tok.str; -+ scan2(TOK_COMMA, TOK_RBRACE, &tok); -+ } -+ *tailp = elist; -+ tailp = &elist->next; -+ } while (tok.kind != TOK_RBRACE); -+ *tailp = NULL; -+} -+ -+static void -+def_const(definition *defp) -+{ -+ token tok; -+ -+ defp->def_kind = DEF_CONST; -+ scan(TOK_IDENT, &tok); -+ defp->def_name = tok.str; -+ scan(TOK_EQUAL, &tok); -+ scan2(TOK_IDENT, TOK_STRCONST, &tok); -+ defp->def.co = tok.str; -+} -+ -+static void -+def_union(definition *defp) -+{ -+ token tok; -+ declaration dec; -+ case_list *cases; -+ case_list **tailp; -+ -+ defp->def_kind = DEF_UNION; -+ scan(TOK_IDENT, &tok); -+ defp->def_name = tok.str; -+ scan(TOK_SWITCH, &tok); -+ scan(TOK_LPAREN, &tok); -+ get_declaration(&dec, DEF_UNION); -+ defp->def.un.enum_decl = dec; -+ tailp = &defp->def.un.cases; -+ scan(TOK_RPAREN, &tok); -+ scan(TOK_LBRACE, &tok); -+ scan(TOK_CASE, &tok); -+ while (tok.kind == TOK_CASE) { -+ scan2(TOK_IDENT, TOK_CHARCONST, &tok); -+ cases = ALLOC(case_list); -+ cases->case_name = tok.str; -+ scan(TOK_COLON, &tok); -+ /* now peek at next token */ -+ if(peekscan(TOK_CASE,&tok)) -+ { -+ -+ do -+ { -+ scan2(TOK_IDENT, TOK_CHARCONST, &tok); -+ cases->contflag=1; /* continued case statement */ -+ *tailp = cases; -+ tailp = &cases->next; -+ cases = ALLOC(case_list); -+ cases->case_name = tok.str; -+ scan(TOK_COLON, &tok); -+ -+ }while(peekscan(TOK_CASE,&tok)); -+ } -+ -+ get_declaration(&dec, DEF_UNION); -+ cases->case_decl = dec; -+ cases->contflag=0; /* no continued case statement */ -+ *tailp = cases; -+ tailp = &cases->next; -+ scan(TOK_SEMICOLON, &tok); -+ -+ scan3(TOK_CASE, TOK_DEFAULT, TOK_RBRACE, &tok); -+ } -+ *tailp = NULL; -+ if (tok.kind == TOK_DEFAULT) { -+ scan(TOK_COLON, &tok); -+ get_declaration(&dec, DEF_UNION); -+ defp->def.un.default_decl = ALLOC(declaration); -+ *defp->def.un.default_decl = dec; -+ scan(TOK_SEMICOLON, &tok); -+ scan(TOK_RBRACE, &tok); -+ } else { -+ defp->def.un.default_decl = NULL; -+ } -+} -+ -+static char* reserved_words[] = -+{ -+ "array", -+ "bytes", -+ "destroy", -+ "free", -+ "getpos", -+ "inline", -+ "pointer", -+ "reference", -+ "setpos", -+ "sizeof", -+ "union", -+ "vector", -+ NULL -+ }; -+ -+static char* reserved_types[] = -+{ -+ "opaque", -+ "string", -+ NULL -+ }; -+ -+/* check that the given name is not one that would eventually result in -+ xdr routines that would conflict with internal XDR routines. */ -+static void -+check_type_name(char *name, int new_type) -+{ -+ int i; -+ char tmp[100]; -+ -+ for( i = 0; reserved_words[i] != NULL; i++ ) { -+ if( strcmp( name, reserved_words[i] ) == 0 ) { -+ sprintf(tmp, -+ "illegal (reserved) name :\'%s\' in type definition", name ); -+ error(tmp); -+ } -+ } -+ if( new_type ) { -+ for( i = 0; reserved_types[i] != NULL; i++ ) { -+ if( strcmp( name, reserved_types[i] ) == 0 ) { -+ sprintf(tmp, -+ "illegal (reserved) name :\'%s\' in type definition", name ); -+ error(tmp); -+ } -+ } -+ } -+} -+ -+static void -+def_typedef(definition *defp) -+{ -+ declaration dec; -+ -+ defp->def_kind = DEF_TYPEDEF; -+ get_declaration(&dec, DEF_TYPEDEF); -+ defp->def_name = dec.name; -+ check_type_name( dec.name, 1 ); -+ defp->def.ty.old_prefix = dec.prefix; -+ defp->def.ty.old_type = dec.type; -+ defp->def.ty.rel = dec.rel; -+ defp->def.ty.array_max = dec.array_max; -+} -+ -+static void -+get_declaration(declaration *dec, defkind dkind) -+{ -+ token tok; -+ -+ get_type(&dec->prefix, &dec->type, dkind); -+ dec->rel = REL_ALIAS; -+ if (streq(dec->type, "void")) { -+ return; -+ } -+ -+ check_type_name( dec->type, 0 ); -+ -+ scan2(TOK_STAR, TOK_IDENT, &tok); -+ if (tok.kind == TOK_STAR) { -+ dec->rel = REL_POINTER; -+ scan(TOK_IDENT, &tok); -+ } -+ dec->name = tok.str; -+ if (peekscan(TOK_LBRACKET, &tok)) { -+ if (dec->rel == REL_POINTER) { -+ error("no array-of-pointer declarations -- use typedef"); -+ } -+ dec->rel = REL_VECTOR; -+ scan_num(&tok); -+ dec->array_max = tok.str; -+ scan(TOK_RBRACKET, &tok); -+ } else if (peekscan(TOK_LANGLE, &tok)) { -+ if (dec->rel == REL_POINTER) { -+ error("no array-of-pointer declarations -- use typedef"); -+ } -+ dec->rel = REL_ARRAY; -+ if (peekscan(TOK_RANGLE, &tok)) { -+ dec->array_max = "~0"; /* unspecified size, use max */ -+ } else { -+ scan_num(&tok); -+ dec->array_max = tok.str; -+ scan(TOK_RANGLE, &tok); -+ } -+ } -+ if (streq(dec->type, "opaque")) { -+ if (dec->rel != REL_ARRAY && dec->rel != REL_VECTOR) { -+ error("array declaration expected"); -+ } -+ } else if (streq(dec->type, "string")) { -+ if (dec->rel != REL_ARRAY) { -+ error("variable-length array declaration expected"); -+ } -+ } -+} -+ -+ -+static void -+get_prog_declaration(declaration *dec, defkind dkind, int num) -+{ -+ token tok; -+ char name[10]; /* argument name */ -+ -+ if (dkind == DEF_PROGRAM) { -+ peek(&tok); -+ if (tok.kind == TOK_RPAREN) { /* no arguments */ -+ dec->rel = REL_ALIAS; -+ dec->type = "void"; -+ dec->prefix = NULL; -+ dec->name = NULL; -+ return; -+ } -+ } -+ get_type(&dec->prefix, &dec->type, dkind); -+ dec->rel = REL_ALIAS; -+ if (peekscan(TOK_IDENT, &tok)) /* optional name of argument */ -+ strcpy(name, tok.str); -+ else -+ sprintf(name, "%s%d", ARGNAME, num); /* default name of argument */ -+ -+ dec->name = (char *) strdup(name); -+ -+ if (streq(dec->type, "void")) { -+ return; -+ } -+ -+ if (streq(dec->type, "opaque")) { -+ error("opaque -- illegal argument type"); -+ } -+ if (peekscan(TOK_STAR, &tok)) { -+ if (streq(dec->type, "string")) { -+ error("pointer to string not allowed in program arguments\n"); -+ } -+ dec->rel = REL_POINTER; -+ if (peekscan(TOK_IDENT, &tok)) /* optional name of argument */ -+ dec->name = strdup(tok.str); -+ } -+ if (peekscan(TOK_LANGLE, &tok)) { -+ if (!streq(dec->type, "string")) { -+ error("arrays cannot be declared as arguments to procedures -- use typedef"); -+ } -+ dec->rel = REL_ARRAY; -+ if (peekscan(TOK_RANGLE, &tok)) { -+ dec->array_max = "~0";/* unspecified size, use max */ -+ } else { -+ scan_num(&tok); -+ dec->array_max = tok.str; -+ scan(TOK_RANGLE, &tok); -+ } -+ } -+ if (streq(dec->type, "string")) { -+ if (dec->rel != REL_ARRAY) { /* .x specifies just string as -+ * type of argument -+ * - make it string<> -+ */ -+ dec->rel = REL_ARRAY; -+ dec->array_max = "~0";/* unspecified size, use max */ -+ } -+ } -+} -+ -+ -+ -+static void -+get_type(char **prefixp, char **typep, defkind dkind) -+{ -+ token tok; -+ -+ *prefixp = NULL; -+ get_token(&tok); -+ switch (tok.kind) { -+ case TOK_IDENT: -+ *typep = tok.str; -+ break; -+ case TOK_STRUCT: -+ case TOK_ENUM: -+ case TOK_UNION: -+ *prefixp = tok.str; -+ scan(TOK_IDENT, &tok); -+ *typep = tok.str; -+ break; -+ case TOK_UNSIGNED: -+ unsigned_dec(typep); -+ break; -+ case TOK_SHORT: -+ *typep = "short"; -+ (void) peekscan(TOK_INT, &tok); -+ break; -+ case TOK_INT32: -+ *typep = "int32_t"; -+ (void) peekscan(TOK_INT, &tok); -+ break; -+ case TOK_VOID: -+ if (dkind != DEF_UNION && dkind != DEF_PROGRAM) { -+ error("voids allowed only inside union and program definitions with one argument"); -+ } -+ *typep = tok.str; -+ break; -+ case TOK_STRING: -+ case TOK_OPAQUE: -+ case TOK_CHAR: -+ case TOK_INT: -+ case TOK_FLOAT: -+ case TOK_DOUBLE: -+ case TOK_BOOL: -+ *typep = tok.str; -+ break; -+ default: -+ error("expected type specifier"); -+ } -+} -+ -+static void -+unsigned_dec(char **typep) -+{ -+ token tok; -+ -+ peek(&tok); -+ switch (tok.kind) { -+ case TOK_CHAR: -+ get_token(&tok); -+ *typep = "u_char"; -+ break; -+ case TOK_SHORT: -+ get_token(&tok); -+ *typep = "u_short"; -+ (void) peekscan(TOK_INT, &tok); -+ break; -+ case TOK_INT32: -+ get_token(&tok); -+ *typep = "u_int32_"; -+ (void) peekscan(TOK_INT, &tok); -+ break; -+ case TOK_INT: -+ get_token(&tok); -+ *typep = "u_int"; -+ break; -+ default: -+ *typep = "u_int"; -+ break; -+ } -+} -diff --git a/rpcgen/rpc_parse.h b/rpcgen/rpc_parse.h -new file mode 100644 -index 0000000..2afae10 ---- /dev/null -+++ b/rpcgen/rpc_parse.h -@@ -0,0 +1,166 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+/* @(#)rpc_parse.h 1.3 90/08/29 (C) 1987 SMI */ -+ -+/* -+ * rpc_parse.h, Definitions for the RPCL parser -+ */ -+ -+enum defkind { -+ DEF_CONST, -+ DEF_STRUCT, -+ DEF_UNION, -+ DEF_ENUM, -+ DEF_TYPEDEF, -+ DEF_PROGRAM -+}; -+typedef enum defkind defkind; -+ -+typedef char *const_def; -+ -+enum relation { -+ REL_VECTOR, /* fixed length array */ -+ REL_ARRAY, /* variable length array */ -+ REL_POINTER, /* pointer */ -+ REL_ALIAS, /* simple */ -+}; -+typedef enum relation relation; -+ -+struct typedef_def { -+ char *old_prefix; -+ char *old_type; -+ relation rel; -+ char *array_max; -+}; -+typedef struct typedef_def typedef_def; -+ -+struct enumval_list { -+ char *name; -+ char *assignment; -+ struct enumval_list *next; -+}; -+typedef struct enumval_list enumval_list; -+ -+struct enum_def { -+ enumval_list *vals; -+}; -+typedef struct enum_def enum_def; -+ -+struct declaration { -+ char *prefix; -+ char *type; -+ char *name; -+ relation rel; -+ char *array_max; -+}; -+typedef struct declaration declaration; -+ -+struct decl_list { -+ declaration decl; -+ struct decl_list *next; -+}; -+typedef struct decl_list decl_list; -+ -+struct struct_def { -+ decl_list *decls; -+}; -+typedef struct struct_def struct_def; -+ -+struct case_list { -+ char *case_name; -+ int contflag; -+ declaration case_decl; -+ struct case_list *next; -+}; -+typedef struct case_list case_list; -+ -+struct union_def { -+ declaration enum_decl; -+ case_list *cases; -+ declaration *default_decl; -+}; -+typedef struct union_def union_def; -+ -+struct arg_list { -+ char *argname; /* name of struct for arg*/ -+ decl_list *decls; -+}; -+ -+typedef struct arg_list arg_list; -+ -+struct proc_list { -+ char *proc_name; -+ char *proc_num; -+ arg_list args; -+ int arg_num; -+ char *res_type; -+ char *res_prefix; -+ struct proc_list *next; -+}; -+typedef struct proc_list proc_list; -+ -+struct version_list { -+ char *vers_name; -+ char *vers_num; -+ proc_list *procs; -+ struct version_list *next; -+}; -+typedef struct version_list version_list; -+ -+struct program_def { -+ char *prog_num; -+ version_list *versions; -+}; -+typedef struct program_def program_def; -+ -+struct definition { -+ char *def_name; -+ defkind def_kind; -+ union { -+ const_def co; -+ struct_def st; -+ union_def un; -+ enum_def en; -+ typedef_def ty; -+ program_def pr; -+ } def; -+}; -+typedef struct definition definition; -+ -+definition *get_definition(); -+ -+ -+struct bas_type -+{ -+ char *name; -+ int length; -+ struct bas_type *next; -+}; -+ -+typedef struct bas_type bas_type; -diff --git a/rpcgen/rpc_sample.c b/rpcgen/rpc_sample.c -new file mode 100644 -index 0000000..2b5c81b ---- /dev/null -+++ b/rpcgen/rpc_sample.c -@@ -0,0 +1,247 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#if 0 -+static char sccsid[] = "@(#)rpc_sample.c 1.1 90/08/30 (C) 1987 SMI"; -+ -+#endif -+ -+/* -+ * rpc_sample.c, Sample client-server code outputter for the RPC protocol compiler -+ */ -+ -+#include -+#include -+#include "rpc_parse.h" -+#include "rpc_util.h" -+ -+ -+static char RQSTP[] = "rqstp"; -+ -+static void write_sample_client(char *program_name, version_list *vp); -+static void write_sample_server(definition * def); -+static void return_type(proc_list *plist); -+ -+void -+write_sample_svc(definition *def) -+{ -+ if (def->def_kind != DEF_PROGRAM) -+ return; -+ write_sample_server(def); -+} -+ -+ -+int -+write_sample_clnt(definition *def) -+{ -+ version_list *vp; -+ int count = 0; -+ -+ if (def->def_kind != DEF_PROGRAM) -+ return (0); -+ /* generate sample code for each version */ -+ for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) { -+ write_sample_client(def->def_name, vp); -+ ++count; -+ } -+ return (count); -+} -+ -+ -+static void -+write_sample_client(char *program_name, version_list *vp) -+{ -+ proc_list *proc; -+ int i; -+ decl_list *l; -+ -+ f_print(fout, "\n\nvoid\n"); -+ pvname(program_name, vp->vers_num); -+ if (Cflag) -+ f_print(fout, "( char* host )\n{\n"); -+ else -+ f_print(fout, "(host)\nchar *host;\n{\n"); -+ f_print(fout, "\tCLIENT *clnt;\n"); -+ -+ i = 0; -+ for (proc = vp->procs; proc != NULL; proc = proc->next) { -+ f_print(fout, "\t"); -+ ptype(proc->res_prefix, proc->res_type, 1); -+ f_print(fout, " *result_%d;\n", ++i); -+ /* print out declarations for arguments */ -+ if (proc->arg_num < 2 && !newstyle) { -+ f_print(fout, "\t"); -+ if (!streq(proc->args.decls->decl.type, "void")) -+ ptype(proc->args.decls->decl.prefix, proc->args.decls->decl.type, 1); -+ else -+ f_print(fout, "char* "); /* cannot have "void" type */ -+ f_print(fout, " "); -+ pvname(proc->proc_name, vp->vers_num); -+ f_print(fout, "_arg;\n"); -+ } else if (!streq(proc->args.decls->decl.type, "void")) { -+ for (l = proc->args.decls; l != NULL; l = l->next) { -+ f_print(fout, "\t"); -+ ptype(l->decl.prefix, l->decl.type, 1); -+ f_print(fout, " "); -+ pvname(proc->proc_name, vp->vers_num); -+ f_print(fout, "_%s;\n", l->decl.name); -+ /* pdeclaration(proc->args.argname, &l->decl, 1, ";\n" );*/ -+ } -+ } -+ } -+ -+ /* generate creation of client handle */ -+ f_print(fout, "\tclnt = clnt_create(host, %s, %s, \"%s\");\n", -+ program_name, vp->vers_name, tirpcflag ? "netpath" : "udp"); -+ f_print(fout, "\tif (clnt == NULL) {\n"); -+ f_print(fout, "\t\tclnt_pcreateerror(host);\n"); -+ f_print(fout, "\t\texit(1);\n\t}\n"); -+ -+ /* generate calls to procedures */ -+ i = 0; -+ for (proc = vp->procs; proc != NULL; proc = proc->next) { -+ f_print(fout, "\tresult_%d = ", ++i); -+ pvname(proc->proc_name, vp->vers_num); -+ if (proc->arg_num < 2 && !newstyle) { -+ f_print(fout, "("); -+ if (streq(proc->args.decls->decl.type, "void")) /* cast to void* */ -+ f_print(fout, "(void*)"); -+ f_print(fout, "&"); -+ pvname(proc->proc_name, vp->vers_num); -+ f_print(fout, "_arg, clnt);\n"); -+ } else if (streq(proc->args.decls->decl.type, "void")) { -+ f_print(fout, "(clnt);\n"); -+ } else { -+ f_print(fout, "("); -+ for (l = proc->args.decls; l != NULL; l = l->next) { -+ pvname(proc->proc_name, vp->vers_num); -+ f_print(fout, "_%s, ", l->decl.name); -+ } -+ f_print(fout, "clnt);\n"); -+ } -+ f_print(fout, "\tif (result_%d == NULL) {\n", i); -+ f_print(fout, "\t\tclnt_perror(clnt, \"call failed:\");\n"); -+ f_print(fout, "\t}\n"); -+ } -+ -+ f_print(fout, "\tclnt_destroy( clnt );\n"); -+ f_print(fout, "}\n"); -+} -+ -+static void -+write_sample_server(definition * def) -+{ -+ version_list *vp; -+ proc_list *proc; -+ -+ for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) { -+ for (proc = vp->procs; proc != NULL; proc = proc->next) { -+ f_print(fout, "\n"); -+ /* if( Cflag ) -+ f_print( fout, "extern \"C\"{\n"); -+*/ -+ return_type(proc); -+ f_print(fout, "* \n"); -+ if (Cflag) -+ pvname_svc(proc->proc_name, vp->vers_num); -+ else -+ pvname(proc->proc_name, vp->vers_num); -+ printarglist(proc, RQSTP, "struct svc_req *"); -+ -+ f_print(fout, "{\n"); -+ f_print(fout, "\n\tstatic "); -+ if (!streq(proc->res_type, "void")) -+ return_type(proc); -+ else -+ f_print(fout, "char*"); /* cannot have void type */ -+ /* f_print(fout, " result;\n", proc->res_type); */ -+ f_print(fout, " result;\n"); -+ f_print(fout, -+ "\n\t/*\n\t * insert server code here\n\t */\n\n"); -+ if (!streq(proc->res_type, "void")) -+ f_print(fout, "\treturn(&result);\n}\n"); -+ else /* cast back to void * */ -+ f_print(fout, "\treturn((void*) &result);\n}\n"); -+ /* if( Cflag) -+ f_print( fout, "};\n"); -+*/ -+ -+ } -+ } -+} -+ -+ -+ -+static void -+return_type(proc_list *plist) -+{ -+ ptype( plist->res_prefix, plist->res_type, 1 ); -+} -+ -+void -+add_sample_msg(void) -+{ -+ f_print(fout, "/*\n"); -+ f_print(fout, " * This is sample code generated by rpcgen.\n"); -+ f_print(fout, " * These are only templates and you can use them\n"); -+ f_print(fout, " * as a guideline for developing your own functions.\n"); -+ f_print(fout, " */\n\n"); -+} -+ -+void -+write_sample_clnt_main(void) -+{ -+ list *l; -+ definition *def; -+ version_list *vp; -+ -+ f_print(fout, "\n\n" ); -+ if( Cflag ) -+ f_print(fout,"main( int argc, char* argv[] )\n{\n" ); -+ else -+ f_print(fout, "main(argc, argv)\nint argc;\nchar *argv[];\n{\n" ); -+ -+ f_print(fout, "\tchar *host;"); -+ f_print(fout, "\n\n\tif(argc < 2) {"); -+ f_print(fout, "\n\t\tprintf(\"usage: %%s server_host\\n\", argv[0]);\n" ); -+ f_print(fout, "\t\texit(1);\n\t}"); -+ f_print(fout, "\n\thost = argv[1];\n"); -+ -+ for (l = defined; l != NULL; l = l->next) { -+ def = l->val; -+ if (def->def_kind != DEF_PROGRAM) { -+ continue; -+ } -+ for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) { -+ f_print( fout, "\t" ); -+ pvname(def->def_name, vp->vers_num); -+ f_print( fout, "( host );\n" ); -+ } -+ } -+ f_print(fout, "}\n"); -+} -diff --git a/rpcgen/rpc_scan.c b/rpcgen/rpc_scan.c -new file mode 100644 -index 0000000..f58fa9f ---- /dev/null -+++ b/rpcgen/rpc_scan.c -@@ -0,0 +1,474 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#if 0 -+static char sccsid[] = "@(#)rpc_scan.c 1.11 89/02/22 (C) 1987 SMI"; -+#endif -+ -+/* -+ * rpc_scan.c, Scanner for the RPC protocol compiler -+ * Copyright (C) 1987, Sun Microsystems, Inc. -+ */ -+#include -+#include -+#include -+#include "rpc_scan.h" -+#include "rpc_parse.h" -+#include "rpc_util.h" -+ -+static void unget_token(token *tokp); -+static void findstrconst(char **str, char **val); -+static void findchrconst(char **str, char **val); -+static void findconst(char **str, char **val); -+static void findkind(char **mark, token *tokp); -+static int cppline(char *line); -+static int directive(char *line); -+static void printdirective(char *line); -+static void docppline(char *line, int *lineno, char **fname); -+ -+#define startcomment(where) (where[0] == '/' && where[1] == '*') -+#define endcomment(where) (where[-1] == '*' && where[0] == '/') -+ -+static int pushed = 0; /* is a token pushed */ -+static token lasttok; /* last token, if pushed */ -+ -+/* -+ * scan expecting 1 given token -+ */ -+void -+scan(tok_kind expect, token *tokp) -+{ -+ get_token(tokp); -+ if (tokp->kind != expect) { -+ expected1(expect); -+ } -+} -+ -+/* -+ * scan expecting any of the 2 given tokens -+ */ -+void -+scan2(tok_kind expect1, tok_kind expect2, token *tokp) -+{ -+ get_token(tokp); -+ if (tokp->kind != expect1 && tokp->kind != expect2) { -+ expected2(expect1, expect2); -+ } -+} -+ -+/* -+ * scan expecting any of the 3 given token -+ */ -+void -+scan3(tok_kind expect1, tok_kind expect2, tok_kind expect3, token *tokp) -+{ -+ get_token(tokp); -+ if (tokp->kind != expect1 && tokp->kind != expect2 -+ && tokp->kind != expect3) { -+ expected3(expect1, expect2, expect3); -+ } -+} -+ -+/* -+ * scan expecting a constant, possibly symbolic -+ */ -+void -+scan_num(token *tokp) -+{ -+ get_token(tokp); -+ switch (tokp->kind) { -+ case TOK_IDENT: -+ break; -+ default: -+ error("constant or identifier expected"); -+ } -+} -+ -+/* -+ * Peek at the next token -+ */ -+void -+peek(token *tokp) -+{ -+ get_token(tokp); -+ unget_token(tokp); -+} -+ -+/* -+ * Peek at the next token and scan it if it matches what you expect -+ */ -+int -+peekscan(tok_kind expect, token *tokp) -+{ -+ peek(tokp); -+ if (tokp->kind == expect) { -+ get_token(tokp); -+ return (1); -+ } -+ return (0); -+} -+ -+/* -+ * Get the next token, printing out any directive that are encountered. -+ */ -+void -+get_token(token *tokp) -+{ -+ int commenting; -+ -+ if (pushed) { -+ pushed = 0; -+ *tokp = lasttok; -+ return; -+ } -+ commenting = 0; -+ for (;;) { -+ if (*where == 0) { -+ for (;;) { -+ if (!fgets(curline, MAXLINESIZE, fin)) { -+ tokp->kind = TOK_EOF; -+ *where = 0; -+ return; -+ } -+ linenum++; -+ if (commenting) { -+ break; -+ } else if (cppline(curline)) { -+ docppline(curline, &linenum, -+ &infilename); -+ } else if (directive(curline)) { -+ printdirective(curline); -+ } else { -+ break; -+ } -+ } -+ where = curline; -+ } else if (isspace(*where)) { -+ while (isspace(*where)) { -+ where++; /* eat */ -+ } -+ } else if (commenting) { -+ for (where++; *where; where++) { -+ if (endcomment(where)) { -+ where++; -+ commenting--; -+ break; -+ } -+ } -+ } else if (startcomment(where)) { -+ where += 2; -+ commenting++; -+ } else { -+ break; -+ } -+ } -+ -+ /* -+ * 'where' is not whitespace, comment or directive Must be a token! -+ */ -+ switch (*where) { -+ case ':': -+ tokp->kind = TOK_COLON; -+ where++; -+ break; -+ case ';': -+ tokp->kind = TOK_SEMICOLON; -+ where++; -+ break; -+ case ',': -+ tokp->kind = TOK_COMMA; -+ where++; -+ break; -+ case '=': -+ tokp->kind = TOK_EQUAL; -+ where++; -+ break; -+ case '*': -+ tokp->kind = TOK_STAR; -+ where++; -+ break; -+ case '[': -+ tokp->kind = TOK_LBRACKET; -+ where++; -+ break; -+ case ']': -+ tokp->kind = TOK_RBRACKET; -+ where++; -+ break; -+ case '{': -+ tokp->kind = TOK_LBRACE; -+ where++; -+ break; -+ case '}': -+ tokp->kind = TOK_RBRACE; -+ where++; -+ break; -+ case '(': -+ tokp->kind = TOK_LPAREN; -+ where++; -+ break; -+ case ')': -+ tokp->kind = TOK_RPAREN; -+ where++; -+ break; -+ case '<': -+ tokp->kind = TOK_LANGLE; -+ where++; -+ break; -+ case '>': -+ tokp->kind = TOK_RANGLE; -+ where++; -+ break; -+ -+ case '"': -+ tokp->kind = TOK_STRCONST; -+ findstrconst(&where, &tokp->str); -+ break; -+ case '\'': -+ tokp->kind = TOK_CHARCONST; -+ findchrconst(&where, &tokp->str); -+ break; -+ -+ case '-': -+ case '0': -+ case '1': -+ case '2': -+ case '3': -+ case '4': -+ case '5': -+ case '6': -+ case '7': -+ case '8': -+ case '9': -+ tokp->kind = TOK_IDENT; -+ findconst(&where, &tokp->str); -+ break; -+ -+ default: -+ if (!(isalpha(*where) || *where == '_')) { -+ char buf[100]; -+ char *p; -+ -+ s_print(buf, "illegal character in file: "); -+ p = buf + strlen(buf); -+ if (isprint(*where)) { -+ s_print(p, "%c", *where); -+ } else { -+ s_print(p, "%d", *where); -+ } -+ error(buf); -+ } -+ findkind(&where, tokp); -+ break; -+ } -+} -+ -+static void -+unget_token(token *tokp) -+{ -+ lasttok = *tokp; -+ pushed = 1; -+} -+ -+static void -+findstrconst(char **str, char **val) -+{ -+ char *p; -+ int size; -+ -+ p = *str; -+ do { -+ *p++; -+ } while (*p && *p != '"'); -+ if (*p == 0) { -+ error("unterminated string constant"); -+ } -+ p++; -+ size = p - *str; -+ *val = alloc(size + 1); -+ (void) strncpy(*val, *str, size); -+ (*val)[size] = 0; -+ *str = p; -+} -+ -+static void -+findchrconst(char **str, char **val) -+{ -+ char *p; -+ int size; -+ -+ p = *str; -+ do { -+ *p++; -+ } while (*p && *p != '\''); -+ if (*p == 0) { -+ error("unterminated string constant"); -+ } -+ p++; -+ size = p - *str; -+ if (size != 3) { -+ error("empty char string"); -+ } -+ *val = alloc(size + 1); -+ (void) strncpy(*val, *str, size); -+ (*val)[size] = 0; -+ *str = p; -+} -+ -+static void -+findconst(char **str, char **val) -+{ -+ char *p; -+ int size; -+ -+ p = *str; -+ if (*p == '0' && *(p + 1) == 'x') { -+ p++; -+ do { -+ p++; -+ } while (isxdigit(*p)); -+ } else { -+ do { -+ p++; -+ } while (isdigit(*p)); -+ } -+ size = p - *str; -+ *val = alloc(size + 1); -+ (void) strncpy(*val, *str, size); -+ (*val)[size] = 0; -+ *str = p; -+} -+ -+static token symbols[] = { -+ {TOK_CONST, "const"}, -+ {TOK_UNION, "union"}, -+ {TOK_SWITCH, "switch"}, -+ {TOK_CASE, "case"}, -+ {TOK_DEFAULT, "default"}, -+ {TOK_STRUCT, "struct"}, -+ {TOK_TYPEDEF, "typedef"}, -+ {TOK_ENUM, "enum"}, -+ {TOK_OPAQUE, "opaque"}, -+ {TOK_BOOL, "bool"}, -+ {TOK_VOID, "void"}, -+ {TOK_CHAR, "char"}, -+ {TOK_INT, "int"}, -+ {TOK_UNSIGNED, "unsigned"}, -+ {TOK_SHORT, "short"}, -+ {TOK_INT32, "int32"}, -+ {TOK_FLOAT, "float"}, -+ {TOK_DOUBLE, "double"}, -+ {TOK_STRING, "string"}, -+ {TOK_PROGRAM, "program"}, -+ {TOK_VERSION, "version"}, -+ {TOK_EOF, "??????"}, -+}; -+ -+static void -+findkind(char **mark, token *tokp) -+{ -+ int len; -+ token *s; -+ char *str; -+ -+ str = *mark; -+ for (s = symbols; s->kind != TOK_EOF; s++) { -+ len = strlen(s->str); -+ if (strncmp(str, s->str, len) == 0) { -+ if (!isalnum(str[len]) && str[len] != '_') { -+ tokp->kind = s->kind; -+ tokp->str = s->str; -+ *mark = str + len; -+ return; -+ } -+ } -+ } -+ tokp->kind = TOK_IDENT; -+ for (len = 0; isalnum(str[len]) || str[len] == '_'; len++); -+ tokp->str = alloc(len + 1); -+ (void) strncpy(tokp->str, str, len); -+ tokp->str[len] = 0; -+ *mark = str + len; -+} -+ -+static int -+cppline(char *line) -+{ -+ return (line == curline && *line == '#'); -+} -+ -+static int -+directive(char *line) -+{ -+ return (line == curline && *line == '%'); -+} -+ -+static void -+printdirective(char *line) -+{ -+ f_print(fout, "%s", line + 1); -+} -+ -+static void -+docppline(char *line, int *lineno, char **fname) -+{ -+ char *file; -+ int num; -+ char *p; -+ -+ line++; -+ while (isspace(*line)) { -+ line++; -+ } -+ num = atoi(line); -+ while (isdigit(*line)) { -+ line++; -+ } -+ while (isspace(*line)) { -+ line++; -+ } -+ if (*line != '"') { -+ error("preprocessor error"); -+ } -+ line++; -+ p = file = alloc(strlen(line) + 1); -+ while (*line && *line != '"') { -+ *p++ = *line++; -+ } -+ if (*line == 0) { -+ error("preprocessor error"); -+ } -+ *p = 0; -+ if (*file == 0) { -+ *fname = NULL; -+ free(file); -+ } else { -+ *fname = file; -+ } -+ *lineno = num - 1; -+} -diff --git a/rpcgen/rpc_scan.h b/rpcgen/rpc_scan.h -new file mode 100644 -index 0000000..16f688c ---- /dev/null -+++ b/rpcgen/rpc_scan.h -@@ -0,0 +1,103 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+/* @(#)rpc_scan.h 1.3 90/08/29 (C) 1987 SMI */ -+ -+/* -+ * rpc_scan.h, Definitions for the RPCL scanner -+ */ -+ -+/* -+ * kinds of tokens -+ */ -+enum tok_kind { -+ TOK_IDENT, -+ TOK_CHARCONST, -+ TOK_STRCONST, -+ TOK_LPAREN, -+ TOK_RPAREN, -+ TOK_LBRACE, -+ TOK_RBRACE, -+ TOK_LBRACKET, -+ TOK_RBRACKET, -+ TOK_LANGLE, -+ TOK_RANGLE, -+ TOK_STAR, -+ TOK_COMMA, -+ TOK_EQUAL, -+ TOK_COLON, -+ TOK_SEMICOLON, -+ TOK_CONST, -+ TOK_STRUCT, -+ TOK_UNION, -+ TOK_SWITCH, -+ TOK_CASE, -+ TOK_DEFAULT, -+ TOK_ENUM, -+ TOK_TYPEDEF, -+ TOK_INT, -+ TOK_SHORT, -+ TOK_INT32, -+ TOK_UNSIGNED, -+ TOK_FLOAT, -+ TOK_DOUBLE, -+ TOK_OPAQUE, -+ TOK_CHAR, -+ TOK_STRING, -+ TOK_BOOL, -+ TOK_VOID, -+ TOK_PROGRAM, -+ TOK_VERSION, -+ TOK_EOF -+}; -+typedef enum tok_kind tok_kind; -+ -+/* -+ * a token -+ */ -+struct token { -+ tok_kind kind; -+ char *str; -+}; -+typedef struct token token; -+ -+ -+/* -+ * routine interface -+ */ -+void scan(); -+void scan2(); -+void scan3(); -+void scan_num(); -+void peek(); -+int peekscan(); -+void get_token(); -+void expected1(tok_kind); -+void expected2(tok_kind, tok_kind); -+void expected3(tok_kind, tok_kind, tok_kind); -+ -diff --git a/rpcgen/rpc_svcout.c b/rpcgen/rpc_svcout.c -new file mode 100644 -index 0000000..284a529 ---- /dev/null -+++ b/rpcgen/rpc_svcout.c -@@ -0,0 +1,882 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#if 0 -+ static char sccsid[] = "@(#)rpc_svcout.c 1.29 89/03/30 (C) 1987 SMI"; -+#endif -+ -+/* -+ * rpc_svcout.c, Server-skeleton outputter for the RPC protocol compiler -+ */ -+#include -+#include -+#include "rpc_parse.h" -+#include "rpc_util.h" -+#include "rpc_output.h" -+ -+static void write_real_program(definition *def); -+static void write_program(definition *def, char *storage); -+static void printerr(char *err, char *transp); -+static void printif(char *proc, char *transp, char *prefix, char *arg); -+static void write_inetmost(char *infile); -+static void print_return(char *space); -+static void print_pmapunset(char *space); -+static void print_err_message(char *space); -+static void write_timeout_func(void); -+static void write_pm_most(char *infile, int netflag); -+static void write_rpc_svc_fg(char *infile, char *sp); -+static void open_log_file(char *infile, char *sp); -+ -+static char RQSTP[] = "rqstp"; -+static char TRANSP[] = "transp"; -+static char ARG[] = "argument"; -+static char RESULT[] = "result"; -+static char ROUTINE[] = "local"; -+ -+char _errbuf[256]; /* For all messages */ -+ -+static void -+p_xdrfunc(char *rname, char *typename) -+{ -+ if (Cflag) -+ f_print(fout, "\t\txdr_%s = (xdrproc_t) xdr_%s;\n", rname, -+ stringfix(typename)); -+ else -+ f_print(fout, "\t\txdr_%s = xdr_%s;\n", rname, stringfix(typename)); -+} -+ -+void -+internal_proctype(proc_list *plist) -+{ -+ f_print(fout, "static "); -+ ptype( plist->res_prefix, plist->res_type, 1 ); -+ f_print( fout, "*" ); -+} -+ -+ -+/* -+ * write most of the service, that is, everything but the registrations. -+ */ -+void -+write_most(char *infile, int netflag, int nomain) -+{ -+ if (inetdflag || pmflag) { -+ char* var_type; -+ var_type = (nomain? "extern" : "static"); -+ f_print(fout, "%s int _rpcpmstart;", var_type ); -+ f_print(fout, "\t\t/* Started by a port monitor ? */\n"); -+ f_print(fout, "%s int _rpcfdtype;", var_type ); -+ f_print(fout, "\t\t/* Whether Stream or Datagram ? */\n"); -+ if (timerflag) { -+ f_print(fout, "%s int _rpcsvcdirty;", var_type ); -+ f_print(fout, "\t/* Still serving ? */\n"); -+ } -+ write_svc_aux( nomain ); -+ } -+ /* write out dispatcher and stubs */ -+ write_programs( nomain? (char *)NULL : "static" ); -+ -+ if( nomain ) -+ return; -+ -+ f_print(fout, "\nmain()\n"); -+ f_print(fout, "{\n"); -+ if (inetdflag) { -+ write_inetmost(infile); /* Includes call to write_rpc_svc_fg() */ -+ } else { -+ if( tirpcflag ) { -+ if (netflag) { -+ f_print(fout, "\tregister SVCXPRT *%s;\n", TRANSP); -+ f_print(fout, "\tstruct netconfig *nconf = NULL;\n"); -+ } -+ f_print(fout, "\tpid_t pid;\n"); -+ f_print(fout, "\tint i;\n"); -+ f_print(fout, "\tchar mname[FMNAMESZ + 1];\n\n"); -+ write_pm_most(infile, netflag); -+ f_print(fout, "\telse {\n"); -+ write_rpc_svc_fg(infile, "\t\t"); -+ f_print(fout, "\t}\n"); -+ } else { -+ f_print(fout, "\tregister SVCXPRT *%s;\n", TRANSP); -+ f_print(fout, "\n"); -+ print_pmapunset("\t"); -+ } -+ } -+ -+ if (logflag && !inetdflag) { -+ open_log_file(infile, "\t"); -+ } -+} -+ -+/* -+ * write a registration for the given transport -+ */ -+void -+write_netid_register(char *transp) -+{ -+ list *l; -+ definition *def; -+ version_list *vp; -+ char *sp; -+ char tmpbuf[32]; -+ -+ sp = ""; -+ f_print(fout, "\n"); -+ f_print(fout, "%s\tnconf = getnetconfigent(\"%s\");\n", sp, transp); -+ f_print(fout, "%s\tif (nconf == NULL) {\n", sp); -+ (void) sprintf(_errbuf, "cannot find %s netid.", transp); -+ sprintf(tmpbuf, "%s\t\t", sp); -+ print_err_message(tmpbuf); -+ f_print(fout, "%s\t\texit(1);\n", sp); -+ f_print(fout, "%s\t}\n", sp); -+ f_print(fout, "%s\t%s = svc_tli_create(RPC_ANYFD, nconf, 0, 0, 0);\n", -+ sp, TRANSP); -+ f_print(fout, "%s\tif (%s == NULL) {\n", sp, TRANSP); -+ (void) sprintf(_errbuf, "cannot create %s service.", transp); -+ print_err_message(tmpbuf); -+ f_print(fout, "%s\t\texit(1);\n", sp); -+ f_print(fout, "%s\t}\n", sp); -+ -+ for (l = defined; l != NULL; l = l->next) { -+ def = (definition *) l->val; -+ if (def->def_kind != DEF_PROGRAM) { -+ continue; -+ } -+ for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) { -+ f_print(fout, -+ "%s\t(void) rpcb_unset(%s, %s, nconf);\n", -+ sp, def->def_name, vp->vers_name); -+ f_print(fout, -+ "%s\tif (!svc_reg(%s, %s, %s, ", -+ sp, TRANSP, def->def_name, vp->vers_name); -+ pvname(def->def_name, vp->vers_num); -+ f_print(fout, ", nconf)) {\n"); -+ (void) sprintf(_errbuf, "unable to register (%s, %s, %s).", -+ def->def_name, vp->vers_name, transp); -+ print_err_message(tmpbuf); -+ f_print(fout, "%s\t\texit(1);\n", sp); -+ f_print(fout, "%s\t}\n", sp); -+ } -+ } -+ f_print(fout, "%s\tfreenetconfigent(nconf);\n", sp); -+} -+ -+/* -+ * write a registration for the given transport for TLI -+ */ -+void -+write_nettype_register(char *transp) -+{ -+ list *l; -+ definition *def; -+ version_list *vp; -+ -+ for (l = defined; l != NULL; l = l->next) { -+ def = (definition *) l->val; -+ if (def->def_kind != DEF_PROGRAM) { -+ continue; -+ } -+ for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) { -+ f_print(fout, "\tif (!svc_create("); -+ pvname(def->def_name, vp->vers_num); -+ f_print(fout, ", %s, %s, \"%s\")) {\n ", -+ def->def_name, vp->vers_name, transp); -+ (void) sprintf(_errbuf, -+ "unable to create (%s, %s) for %s.", -+ def->def_name, vp->vers_name, transp); -+ print_err_message("\t\t"); -+ f_print(fout, "\t\texit(1);\n"); -+ f_print(fout, "\t}\n"); -+ } -+ } -+} -+ -+/* -+ * write the rest of the service -+ */ -+void -+write_rest(void) -+{ -+ f_print(fout, "\n"); -+ if (inetdflag) { -+ f_print(fout, "\tif (%s == (SVCXPRT *)NULL) {\n", TRANSP); -+ (void) sprintf(_errbuf, "could not create a handle"); -+ print_err_message("\t\t"); -+ f_print(fout, "\t\texit(1);\n"); -+ f_print(fout, "\t}\n"); -+ if (timerflag) { -+ f_print(fout, "\tif (_rpcpmstart) {\n"); -+ f_print(fout, -+ "\t\t(void) signal(SIGALRM, %s closedown);\n", -+ Cflag? "(SIG_PF)" : "(void(*)())" ); -+ f_print(fout, "\t\t(void) alarm(_RPCSVC_CLOSEDOWN);\n"); -+ f_print(fout, "\t}\n"); -+ } -+ } -+ f_print(fout, "\tsvc_run();\n"); -+ (void) sprintf(_errbuf, "svc_run returned"); -+ print_err_message("\t"); -+ f_print(fout, "\texit(1);\n"); -+ f_print(fout, "\t/* NOTREACHED */\n"); -+ f_print(fout, "}\n"); -+} -+ -+void -+write_programs(char *storage) -+{ -+ list *l; -+ definition *def; -+ -+ /* write out stubs for procedure definitions */ -+ for (l = defined; l != NULL; l = l->next) { -+ def = (definition *) l->val; -+ if (def->def_kind == DEF_PROGRAM) { -+ write_real_program(def); -+ } -+ } -+ -+ /* write out dispatcher for each program */ -+ for (l = defined; l != NULL; l = l->next) { -+ def = (definition *) l->val; -+ if (def->def_kind == DEF_PROGRAM) { -+ write_program(def, storage); -+ } -+ } -+ -+ -+} -+ -+/* write out definition of internal function (e.g. _printmsg_1(...)) -+ which calls server's defintion of actual function (e.g. printmsg_1(...)). -+ Unpacks single user argument of printmsg_1 to call-by-value format -+ expected by printmsg_1. */ -+static void -+write_real_program(definition *def) -+{ -+ version_list *vp; -+ proc_list *proc; -+ decl_list *l; -+ -+ if( !newstyle ) return; /* not needed for old style */ -+ for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) { -+ for (proc = vp->procs; proc != NULL; proc = proc->next) { -+ f_print(fout, "\n"); -+ internal_proctype(proc); -+ f_print(fout, "\n_"); -+ pvname(proc->proc_name, vp->vers_num); -+ if( Cflag ) { -+ f_print(fout, "(" ); -+ /* arg name */ -+ if (proc->arg_num > 1) -+ f_print(fout, proc->args.argname); -+ else -+ ptype(proc->args.decls->decl.prefix, -+ proc->args.decls->decl.type, 0); -+ f_print(fout, " *argp, struct svc_req *%s)\n", -+ RQSTP); -+ } else { -+ f_print(fout, "(argp, %s)\n", RQSTP ); -+ /* arg name */ -+ if (proc->arg_num > 1) -+ f_print(fout, "\t%s *argp;\n", proc->args.argname); -+ else { -+ f_print(fout, "\t"); -+ ptype(proc->args.decls->decl.prefix, -+ proc->args.decls->decl.type, 0); -+ f_print(fout, " *argp;\n"); -+ } -+ f_print(fout, " struct svc_req *%s;\n", RQSTP); -+ } -+ -+ f_print(fout, "{\n"); -+ f_print(fout, "\treturn("); -+ if( Cflag ) -+ pvname_svc(proc->proc_name, vp->vers_num); -+ else -+ pvname(proc->proc_name, vp->vers_num); -+ f_print(fout, "("); -+ if (proc->arg_num < 2) { /* single argument */ -+ if (!streq( proc->args.decls->decl.type, "void")) -+ f_print(fout, "*argp, "); /* non-void */ -+ } else { -+ for (l = proc->args.decls; l != NULL; l = l->next) -+ f_print(fout, "argp->%s, ", l->decl.name); -+ } -+ f_print(fout, "%s));\n}\n", RQSTP); -+ } -+ } -+} -+ -+static void -+write_program(definition *def, char *storage) -+{ -+ version_list *vp; -+ proc_list *proc; -+ int filled; -+ -+ for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) { -+ f_print(fout, "\n"); -+ if (storage != NULL) { -+ f_print(fout, "%s ", storage); -+ } -+ f_print(fout, "void\n"); -+ pvname(def->def_name, vp->vers_num); -+ -+ if (Cflag) { -+ f_print(fout, "(struct svc_req *%s, ", RQSTP); -+ f_print(fout, "register SVCXPRT *%s)\n", TRANSP); -+ } else { -+ f_print(fout, "(%s, %s)\n", RQSTP, TRANSP); -+ f_print(fout, " struct svc_req *%s;\n", RQSTP); -+ f_print(fout, " register SVCXPRT *%s;\n", TRANSP); -+ } -+ -+ f_print(fout, "{\n"); -+ -+ filled = 0; -+ f_print(fout, "\tunion {\n"); -+ for (proc = vp->procs; proc != NULL; proc = proc->next) { -+ if (proc->arg_num < 2) { /* single argument */ -+ if (streq(proc->args.decls->decl.type, -+ "void")) { -+ continue; -+ } -+ filled = 1; -+ f_print(fout, "\t\t"); -+ ptype(proc->args.decls->decl.prefix, -+ proc->args.decls->decl.type, 0); -+ pvname(proc->proc_name, vp->vers_num); -+ f_print(fout, "_arg;\n"); -+ -+ } -+ else { -+ filled = 1; -+ f_print(fout, "\t\t%s", proc->args.argname); -+ f_print(fout, " "); -+ pvname(proc->proc_name, vp->vers_num); -+ f_print(fout, "_arg;\n"); -+ } -+ } -+ if (!filled) { -+ f_print(fout, "\t\tint fill;\n"); -+ } -+ f_print(fout, "\t} %s;\n", ARG); -+ f_print(fout, "\tchar *%s;\n", RESULT); -+ -+ if (Cflag) { -+ f_print(fout, "\txdrproc_t xdr_%s, xdr_%s;\n", ARG, RESULT); -+ f_print(fout, -+ "\tchar *(*%s)(char *, struct svc_req *);\n", -+ ROUTINE); -+ } else { -+ f_print(fout, "\tbool_t (*xdr_%s)(), (*xdr_%s)();\n", ARG, RESULT); -+ f_print(fout, "\tchar *(*%s)();\n", ROUTINE); -+ } -+ -+ f_print(fout, "\n"); -+ -+ if (timerflag) -+ f_print(fout, "\t_rpcsvcdirty = 1;\n"); -+ f_print(fout, "\tswitch (%s->rq_proc) {\n", RQSTP); -+ if (!nullproc(vp->procs)) { -+ f_print(fout, "\tcase NULLPROC:\n"); -+ f_print(fout, -+ "\t\t(void) svc_sendreply(%s, (xdrproc_t) xdr_void, (char *)NULL);\n", -+ TRANSP); -+ print_return("\t\t"); -+ f_print(fout, "\n"); -+ } -+ for (proc = vp->procs; proc != NULL; proc = proc->next) { -+ f_print(fout, "\tcase %s:\n", proc->proc_name); -+ if (proc->arg_num < 2) { /* single argument */ -+ p_xdrfunc( ARG, proc->args.decls->decl.type); -+ } else { -+ p_xdrfunc( ARG, proc->args.argname); -+ } -+ p_xdrfunc( RESULT, proc->res_type); -+ if( Cflag ) -+ f_print(fout, -+ "\t\t%s = (char *(*)(char *, struct svc_req *)) ", -+ ROUTINE); -+ else -+ f_print(fout, "\t\t%s = (char *(*)()) ", ROUTINE); -+ -+ if (newstyle) { /* new style: calls internal routine */ -+ f_print(fout,"_"); -+ } -+ /* Not sure about the following... -+ * rpc_hout always generates foobar_1_svc for -+ * the service procedure, so why should we use -+ * foobar_1 here?! --okir */ -+#if 0 -+ if( Cflag && !newstyle ) -+ pvname_svc(proc->proc_name, vp->vers_num); -+ else -+ pvname(proc->proc_name, vp->vers_num); -+#else -+ pvname_svc(proc->proc_name, vp->vers_num); -+#endif -+ f_print(fout, ";\n"); -+ f_print(fout, "\t\tbreak;\n\n"); -+ } -+ f_print(fout, "\tdefault:\n"); -+ printerr("noproc", TRANSP); -+ print_return("\t\t"); -+ f_print(fout, "\t}\n"); -+ -+ f_print(fout, "\t(void) memset((char *)&%s, 0, sizeof (%s));\n", ARG, ARG); -+ if (Cflag) -+ printif("getargs", TRANSP, "(caddr_t) &", ARG); -+ else -+ printif("getargs", TRANSP, "&", ARG); -+ printerr("decode", TRANSP); -+ print_return("\t\t"); -+ f_print(fout, "\t}\n"); -+ -+ if (Cflag) -+ f_print(fout, "\t%s = (*%s)((char *)&%s, %s);\n", -+ RESULT, ROUTINE, ARG, RQSTP); -+ else -+ f_print(fout, "\t%s = (*%s)(&%s, %s);\n", -+ RESULT, ROUTINE, ARG, RQSTP); -+ f_print(fout, -+ "\tif (%s != NULL && !svc_sendreply(%s, " -+ "(xdrproc_t) xdr_%s, %s)) {\n", -+ RESULT, TRANSP, RESULT, RESULT); -+ printerr("systemerr", TRANSP); -+ f_print(fout, "\t}\n"); -+ -+ if (Cflag) -+ printif("freeargs", TRANSP, "(caddr_t) &", ARG); -+ else -+ printif("freeargs", TRANSP, "&", ARG); -+ (void) sprintf(_errbuf, "unable to free arguments"); -+ print_err_message("\t\t"); -+ f_print(fout, "\t\texit(1);\n"); -+ f_print(fout, "\t}\n"); -+ print_return("\t"); -+ f_print(fout, "}\n"); -+ } -+} -+ -+static void -+printerr(char *err, char *transp) -+{ -+ f_print(fout, "\t\tsvcerr_%s(%s);\n", err, transp); -+} -+ -+static void -+printif(char *proc, char *transp, char *prefix, char *arg) -+{ -+ f_print(fout, "\tif (!svc_%s(%s, (xdrproc_t) xdr_%s, (caddr_t) %s%s)) {\n", -+ proc, transp, arg, prefix, arg); -+} -+ -+int -+nullproc(proc_list *proc) -+{ -+ for (; proc != NULL; proc = proc->next) { -+ if (streq(proc->proc_num, "0")) { -+ return (1); -+ } -+ } -+ return (0); -+} -+ -+static void -+write_inetmost(char *infile) -+{ -+ f_print(fout, "\tregister SVCXPRT *%s;\n", TRANSP); -+ f_print(fout, "\tint sock;\n"); -+ f_print(fout, "\tint proto;\n"); -+ f_print(fout, "\tstruct sockaddr_in saddr;\n"); -+ f_print(fout, "\tint asize = sizeof (saddr);\n"); -+ f_print(fout, "\n"); -+ f_print(fout, -+ "\tif (getsockname(0, (struct sockaddr *)&saddr, &asize) == 0) {\n"); -+ f_print(fout, "\t\tint ssize = sizeof (int);\n\n"); -+ f_print(fout, "\t\tif (saddr.sin_family != AF_INET)\n"); -+ f_print(fout, "\t\t\texit(1);\n"); -+ f_print(fout, "\t\tif (getsockopt(0, SOL_SOCKET, SO_TYPE,\n"); -+ f_print(fout, "\t\t\t\t(char *)&_rpcfdtype, &ssize) == -1)\n"); -+ f_print(fout, "\t\t\texit(1);\n"); -+ f_print(fout, "\t\tsock = 0;\n"); -+ f_print(fout, "\t\t_rpcpmstart = 1;\n"); -+ f_print(fout, "\t\tproto = 0;\n"); -+ open_log_file(infile, "\t\t"); -+ f_print(fout, "\t} else {\n"); -+ write_rpc_svc_fg(infile, "\t\t"); -+ f_print(fout, "\t\tsock = RPC_ANYSOCK;\n"); -+ print_pmapunset("\t\t"); -+ f_print(fout, "\t}\n"); -+} -+ -+static void -+print_return(char *space) -+{ -+ if (exitnow) -+ f_print(fout, "%sexit(0);\n", space); -+ else { -+ if (timerflag) -+ f_print(fout, "%s_rpcsvcdirty = 0;\n", space); -+ f_print(fout, "%sreturn;\n", space); -+ } -+} -+ -+static void -+print_pmapunset(char *space) -+{ -+ list *l; -+ definition *def; -+ version_list *vp; -+ -+ for (l = defined; l != NULL; l = l->next) { -+ def = (definition *) l->val; -+ if (def->def_kind == DEF_PROGRAM) { -+ for (vp = def->def.pr.versions; vp != NULL; -+ vp = vp->next) { -+ f_print(fout, "%s(void) pmap_unset(%s, %s);\n", -+ space, def->def_name, vp->vers_name); -+ } -+ } -+ } -+} -+ -+static void -+print_err_message(char *space) -+{ -+ if (logflag) -+ f_print(fout, "%ssyslog(LOG_ERR, \"%s\");\n", space, _errbuf); -+ else if (inetdflag || pmflag) -+ f_print(fout, "%s_msgout(\"%s\");\n", space, _errbuf); -+ else -+ f_print(fout, "%sfprintf(stderr, \"%s\");\n", space, _errbuf); -+} -+ -+/* -+ * Write the server auxiliary function ( _msgout, timeout) -+ */ -+void -+write_svc_aux(int nomain) -+{ -+ if (!logflag) -+ write_msg_out(); -+ if( !nomain ) -+ write_timeout_func(); -+} -+ -+/* -+ * Write the _msgout function -+ */ -+void -+write_msg_out(void) -+{ -+ f_print(fout, "\n"); -+ f_print(fout, "static\n"); -+ if( !Cflag ) { -+ f_print(fout, "void _msgout(msg)\n"); -+ f_print(fout, "\tchar *msg;\n"); -+ } else { -+ f_print(fout, "void _msgout(char* msg)\n"); -+ } -+ f_print(fout, "{\n"); -+ f_print(fout, "#ifdef RPC_SVC_FG\n"); -+ if (inetdflag || pmflag) -+ f_print(fout, "\tif (_rpcpmstart)\n"); -+ f_print(fout, "\t\tsyslog(LOG_ERR, \"%%s\", msg);\n"); -+ f_print(fout, "\telse\n"); -+ f_print(fout, "\t\t(void) fprintf(stderr, \"%%s\\n\", msg);\n"); -+ f_print(fout, "#else\n"); -+ f_print(fout, "\tsyslog(LOG_ERR, \"%%s\", msg);\n"); -+ f_print(fout, "#endif\n"); -+ f_print(fout, "}\n"); -+} -+ -+/* -+ * Write the timeout function -+ */ -+static void -+write_timeout_func(void) -+{ -+ if (!timerflag) -+ return; -+ f_print(fout, "\n"); -+ f_print(fout, "static void\n"); -+ f_print(fout, "closedown()\n"); -+ f_print(fout, "{\n"); -+ f_print(fout, "\tif (_rpcsvcdirty == 0) {\n"); -+ f_print(fout, "\t\tstatic int size;\n"); -+ f_print(fout, "\t\tint i, openfd;\n"); -+ if (tirpcflag && pmflag) { -+ f_print(fout, "\t\tstruct t_info tinfo;\n\n"); -+ f_print(fout, "\t\tif (!t_getinfo(0, &tinfo) && (tinfo.servtype == T_CLTS))\n"); -+ } else { -+ f_print(fout, "\n\t\tif (_rpcfdtype == SOCK_DGRAM)\n"); -+ } -+ f_print(fout, "\t\t\texit(0);\n"); -+ f_print(fout, "\t\tif (size == 0) {\n"); -+ if( tirpcflag ) { -+ f_print(fout, "\t\t\tstruct rlimit rl;\n\n"); -+ f_print(fout, "\t\t\trl.rlim_max = 0;\n"); -+ f_print(fout, "\t\t\tgetrlimit(RLIMIT_NOFILE, &rl);\n"); -+ f_print(fout, "\t\t\tif ((size = rl.rlim_max) == 0)\n"); -+ f_print(fout, "\t\t\t\treturn;\n"); -+ } else { -+ f_print(fout, "\t\t\tsize = getdtablesize();\n"); -+ } -+ f_print(fout, "\t\t}\n"); -+ f_print(fout, "\t\tfor (i = 0, openfd = 0; i < size && openfd < 2; i++)\n"); -+ f_print(fout, "\t\t\tif (FD_ISSET(i, &svc_fdset))\n"); -+ f_print(fout, "\t\t\t\topenfd++;\n"); -+ f_print(fout, "\t\tif (openfd <= 1)\n"); -+ f_print(fout, "\t\t\texit(0);\n"); -+ f_print(fout, "\t}\n"); -+ f_print(fout, "\t(void) alarm(_RPCSVC_CLOSEDOWN);\n"); -+ f_print(fout, "}\n"); -+} -+ -+/* -+ * Write the most of port monitor support -+ */ -+static void -+write_pm_most(char *infile, int netflag) -+{ -+ list *l; -+ definition *def; -+ version_list *vp; -+ -+ f_print(fout, "\tif (!ioctl(0, I_LOOK, mname) &&\n"); -+ f_print(fout, "\t\t(!strcmp(mname, \"sockmod\") ||"); -+ f_print(fout, " !strcmp(mname, \"timod\"))) {\n"); -+ f_print(fout, "\t\tchar *netid;\n"); -+ if (!netflag) { /* Not included by -n option */ -+ f_print(fout, "\t\tstruct netconfig *nconf = NULL;\n"); -+ f_print(fout, "\t\tSVCXPRT *%s;\n", TRANSP); -+ } -+ if( timerflag ) -+ f_print(fout, "\t\tint pmclose;\n"); -+/* not necessary, defined in /usr/include/stdlib */ -+/* f_print(fout, "\t\textern char *getenv();\n");*/ -+ f_print(fout, "\n"); -+ f_print(fout, "\t\t_rpcpmstart = 1;\n"); -+ if (logflag) -+ open_log_file(infile, "\t\t"); -+ f_print(fout, "\t\tif ((netid = getenv(\"NLSPROVIDER\")) == NULL) {\n"); -+ sprintf(_errbuf, "cannot get transport name"); -+ print_err_message("\t\t\t"); -+ f_print(fout, "\t\t} else if ((nconf = getnetconfigent(netid)) == NULL) {\n"); -+ sprintf(_errbuf, "cannot get transport info"); -+ print_err_message("\t\t\t"); -+ f_print(fout, "\t\t}\n"); -+ /* -+ * A kludgy support for inetd services. Inetd only works with -+ * sockmod, and RPC works only with timod, hence all this jugglery -+ */ -+ f_print(fout, "\t\tif (strcmp(mname, \"sockmod\") == 0) {\n"); -+ f_print(fout, "\t\t\tif (ioctl(0, I_POP, 0) || ioctl(0, I_PUSH, \"timod\")) {\n"); -+ sprintf(_errbuf, "could not get the right module"); -+ print_err_message("\t\t\t\t"); -+ f_print(fout, "\t\t\t\texit(1);\n"); -+ f_print(fout, "\t\t\t}\n"); -+ f_print(fout, "\t\t}\n"); -+ if( timerflag ) -+ f_print(fout, "\t\tpmclose = (t_getstate(0) != T_DATAXFER);\n"); -+ f_print(fout, "\t\tif ((%s = svc_tli_create(0, nconf, NULL, 0, 0)) == NULL) {\n", -+ TRANSP); -+ sprintf(_errbuf, "cannot create server handle"); -+ print_err_message("\t\t\t"); -+ f_print(fout, "\t\t\texit(1);\n"); -+ f_print(fout, "\t\t}\n"); -+ f_print(fout, "\t\tif (nconf)\n"); -+ f_print(fout, "\t\t\tfreenetconfigent(nconf);\n"); -+ for (l = defined; l != NULL; l = l->next) { -+ def = (definition *) l->val; -+ if (def->def_kind != DEF_PROGRAM) { -+ continue; -+ } -+ for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) { -+ f_print(fout, -+ "\t\tif (!svc_reg(%s, %s, %s, ", -+ TRANSP, def->def_name, vp->vers_name); -+ pvname(def->def_name, vp->vers_num); -+ f_print(fout, ", 0)) {\n"); -+ (void) sprintf(_errbuf, "unable to register (%s, %s).", -+ def->def_name, vp->vers_name); -+ print_err_message("\t\t\t"); -+ f_print(fout, "\t\t\texit(1);\n"); -+ f_print(fout, "\t\t}\n"); -+ } -+ } -+ if (timerflag) { -+ f_print(fout, "\t\tif (pmclose) {\n"); -+ f_print(fout, "\t\t\t(void) signal(SIGALRM, %s closedown);\n", -+ Cflag? "(SIG_PF)" : "(void(*)())" ); -+ f_print(fout, "\t\t\t(void) alarm(_RPCSVC_CLOSEDOWN);\n"); -+ f_print(fout, "\t\t}\n"); -+ } -+ f_print(fout, "\t\tsvc_run();\n"); -+ f_print(fout, "\t\texit(1);\n"); -+ f_print(fout, "\t\t/* NOTREACHED */\n"); -+ f_print(fout, "\t}\n"); -+} -+ -+/* -+ * Support for backgrounding the server if self started. -+ */ -+static void -+write_rpc_svc_fg(char *infile, char *sp) -+{ -+ f_print(fout, "#ifndef RPC_SVC_FG\n"); -+ f_print(fout, "%sint size;\n", sp); -+ if( tirpcflag ) -+ f_print(fout, "%sstruct rlimit rl;\n", sp); -+ if (inetdflag) -+ f_print(fout, "%sint pid, i;\n\n", sp); -+ f_print(fout, "%spid = fork();\n", sp); -+ f_print(fout, "%sif (pid < 0) {\n", sp); -+ f_print(fout, "%s\tperror(\"cannot fork\");\n", sp); -+ f_print(fout, "%s\texit(1);\n", sp); -+ f_print(fout, "%s}\n", sp); -+ f_print(fout, "%sif (pid)\n", sp); -+ f_print(fout, "%s\texit(0);\n", sp); -+ /* get number of file descriptors */ -+ if( tirpcflag ) { -+ f_print(fout, "%srl.rlim_max = 0;\n", sp); -+ f_print(fout, "%sgetrlimit(RLIMIT_NOFILE, &rl);\n", sp); -+ f_print(fout, "%sif ((size = rl.rlim_max) == 0)\n", sp); -+ f_print(fout, "%s\texit(1);\n", sp); -+ } else { -+ f_print(fout, "%ssize = getdtablesize();\n", sp); -+ } -+ -+ f_print(fout, "%sfor (i = 0; i < size; i++)\n", sp); -+ f_print(fout, "%s\t(void) close(i);\n", sp); -+ /* Redirect stderr and stdout to console */ -+ f_print(fout, "%si = open(\"/dev/console\", 2);\n", sp); -+ f_print(fout, "%s(void) dup2(i, 1);\n", sp); -+ f_print(fout, "%s(void) dup2(i, 2);\n", sp); -+ /* This removes control of the controlling terminal */ -+ if( tirpcflag ) -+ f_print(fout, "%ssetsid();\n", sp); -+ else { -+ f_print(fout, "%si = open(\"/dev/tty\", 2);\n", sp); -+ f_print(fout, "%sif (i >= 0) {\n", sp); -+ f_print(fout, "%s\t(void) ioctl(i, TIOCNOTTY, (char *)NULL);\n", sp);; -+ f_print(fout, "%s\t(void) close(i);\n", sp); -+ f_print(fout, "%s}\n", sp); -+ } -+ if (!logflag) -+ open_log_file(infile, sp); -+ f_print(fout, "#endif\n"); -+ if (logflag) -+ open_log_file(infile, sp); -+} -+ -+static void -+open_log_file(char *infile, char *sp) -+{ -+ char *s; -+ -+ s = strrchr(infile, '.'); -+ if (s) -+ *s = '\0'; -+ f_print(fout,"%sopenlog(\"%s\", LOG_PID, LOG_DAEMON);\n", sp, infile); -+ if (s) -+ *s = '.'; -+} -+ -+ -+ -+ -+/* -+ * write a registration for the given transport for Inetd -+ */ -+void -+write_inetd_register(char *transp) -+{ -+ list *l; -+ definition *def; -+ version_list *vp; -+ char *sp; -+ int isudp; -+ char tmpbuf[32]; -+ -+ if (inetdflag) -+ sp = "\t"; -+ else -+ sp = ""; -+ if (streq(transp, "udp")) -+ isudp = 1; -+ else -+ isudp = 0; -+ f_print(fout, "\n"); -+ if (inetdflag) { -+ f_print(fout, "\tif ((_rpcfdtype == 0) || (_rpcfdtype == %s)) {\n", -+ isudp ? "SOCK_DGRAM" : "SOCK_STREAM"); -+ } -+ f_print(fout, "%s\t%s = svc%s_create(%s", -+ sp, TRANSP, transp, inetdflag? "sock": "RPC_ANYSOCK"); -+ if (!isudp) -+ f_print(fout, ", 0, 0"); -+ f_print(fout, ");\n"); -+ f_print(fout, "%s\tif (%s == NULL) {\n", sp, TRANSP); -+ (void) sprintf(_errbuf, "cannot create %s service.", transp); -+ (void) sprintf(tmpbuf, "%s\t\t", sp); -+ print_err_message(tmpbuf); -+ f_print(fout, "%s\t\texit(1);\n", sp); -+ f_print(fout, "%s\t}\n", sp); -+ -+ if (inetdflag) { -+ f_print(fout, "%s\tif (!_rpcpmstart)\n\t", sp); -+ f_print(fout, "%s\tproto = IPPROTO_%s;\n", -+ sp, isudp ? "UDP": "TCP"); -+ } -+ for (l = defined; l != NULL; l = l->next) { -+ def = (definition *) l->val; -+ if (def->def_kind != DEF_PROGRAM) { -+ continue; -+ } -+ for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) { -+ f_print(fout, "%s\tif (!svc_register(%s, %s, %s, ", -+ sp, TRANSP, def->def_name, vp->vers_name); -+ pvname(def->def_name, vp->vers_num); -+ if (inetdflag) -+ f_print(fout, ", proto)) {\n"); -+ else -+ f_print(fout, ", IPPROTO_%s)) {\n", -+ isudp ? "UDP": "TCP"); -+ (void) sprintf(_errbuf, "unable to register (%s, %s, %s).", -+ def->def_name, vp->vers_name, transp); -+ print_err_message(tmpbuf); -+ f_print(fout, "%s\t\texit(1);\n", sp); -+ f_print(fout, "%s\t}\n", sp); -+ } -+ } -+ if (inetdflag) -+ f_print(fout, "\t}\n"); -+} -diff --git a/rpcgen/rpc_tblout.c b/rpcgen/rpc_tblout.c -new file mode 100644 -index 0000000..ae002f7 ---- /dev/null -+++ b/rpcgen/rpc_tblout.c -@@ -0,0 +1,165 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#if 0 -+static char sccsid[] = "@(#)rpc_tblout.c 1.4 89/02/22 (C) 1988 SMI"; -+#endif -+ -+/* -+ * rpc_tblout.c, Dispatch table outputter for the RPC protocol compiler -+ */ -+#include -+#include -+#include "rpc_parse.h" -+#include "rpc_util.h" -+#include "rpc_output.h" -+ -+static void write_table(definition *def); -+static void printit(char *prefix, char *type); -+ -+#define TABSIZE 8 -+#define TABCOUNT 5 -+#define TABSTOP (TABSIZE*TABCOUNT) -+ -+static char tabstr[TABCOUNT+1] = "\t\t\t\t\t"; -+ -+static char tbl_hdr[] = "struct rpcgen_table %s_table[] = {\n"; -+static char tbl_end[] = "};\n"; -+ -+static char null_entry[] = "\n\t(char *(*)())0,\n\ -+ \t(xdrproc_t) xdr_void,\t\t\t0,\n\ -+ \t(xdrproc_t) xdr_void,\t\t\t0,\n"; -+ -+ -+static char tbl_nproc[] = "int %s_nproc =\n\tsizeof(%s_table)/sizeof(%s_table[0]);\n\n"; -+ -+void -+write_tables(void) -+{ -+ list *l; -+ definition *def; -+ -+ f_print(fout, "\n"); -+ for (l = defined; l != NULL; l = l->next) { -+ def = (definition *) l->val; -+ if (def->def_kind == DEF_PROGRAM) { -+ write_table(def); -+ } -+ } -+} -+ -+static void -+write_table(definition *def) -+{ -+ version_list *vp; -+ proc_list *proc; -+ int current; -+ int expected; -+ char progvers[100]; -+ int warning; -+ -+ for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) { -+ warning = 0; -+ s_print(progvers, "%s_%s", -+ locase(def->def_name), vp->vers_num); -+ /* print the table header */ -+ f_print(fout, tbl_hdr, progvers); -+ -+ if (nullproc(vp->procs)) { -+ expected = 0; -+ } else { -+ expected = 1; -+ f_print(fout, null_entry); -+ } -+ for (proc = vp->procs; proc != NULL; proc = proc->next) { -+ current = atoi(proc->proc_num); -+ if (current != expected++) { -+ f_print(fout, -+ "\n/*\n * WARNING: table out of order\n */\n"); -+ if (warning == 0) { -+ f_print(stderr, -+ "WARNING %s table is out of order\n", -+ progvers); -+ warning = 1; -+ nonfatalerrors = 1; -+ } -+ expected = current + 1; -+ } -+ f_print(fout, "\n\t(char *(*)())RPCGEN_ACTION("); -+ -+ /* routine to invoke */ -+ if( Cflag && !newstyle ) -+ pvname_svc(proc->proc_name, vp->vers_num); -+ else { -+ if( newstyle ) -+ f_print( fout, "_"); /* calls internal func */ -+ pvname(proc->proc_name, vp->vers_num); -+ } -+ f_print(fout, "),\n"); -+ -+ /* argument info */ -+ if( proc->arg_num > 1 ) -+ printit((char*) NULL, proc->args.argname ); -+ else -+ /* do we have to do something special for newstyle */ -+ printit( proc->args.decls->decl.prefix, -+ proc->args.decls->decl.type ); -+ /* result info */ -+ printit(proc->res_prefix, proc->res_type); -+ } -+ -+ /* print the table trailer */ -+ f_print(fout, tbl_end); -+ f_print(fout, tbl_nproc, progvers, progvers, progvers); -+ } -+} -+ -+static void -+printit(char *prefix, char *type) -+{ -+ int len; -+ int tabs; -+ -+ -+ len = fprintf(fout, "\txdr_%s,", stringfix(type)); -+ /* account for leading tab expansion */ -+ len += TABSIZE - 1; -+ /* round up to tabs required */ -+ tabs = (TABSTOP - len + TABSIZE - 1)/TABSIZE; -+ f_print(fout, "%s", &tabstr[TABCOUNT-tabs]); -+ -+ if (streq(type, "void")) { -+ f_print(fout, "0"); -+ } else { -+ f_print(fout, "sizeof ( "); -+ /* XXX: should "follow" be 1 ??? */ -+ ptype(prefix, type, 0); -+ f_print(fout, ")"); -+ } -+ f_print(fout, ",\n"); -+} -diff --git a/rpcgen/rpc_util.c b/rpcgen/rpc_util.c -new file mode 100644 -index 0000000..b67be57 ---- /dev/null -+++ b/rpcgen/rpc_util.c -@@ -0,0 +1,479 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#if 0 -+static char sccsid[] = "@(#)rpc_util.c 1.11 89/02/22 (C) 1987 SMI"; -+#endif -+ -+/* -+ * rpc_util.c, Utility routines for the RPC protocol compiler -+ */ -+#include -+#include -+#include -+#include -+#include "rpc_scan.h" -+#include "rpc_parse.h" -+#include "rpc_util.h" -+ -+static void printwhere(void); -+ -+ -+#define ARGEXT "argument" -+ -+char curline[MAXLINESIZE]; /* current read line */ -+char *where = curline; /* current point in line */ -+int linenum = 0; /* current line number */ -+ -+char *infilename; /* input filename */ -+ -+#define NFILES 7 -+char *outfiles[NFILES]; /* output file names */ -+int nfiles; -+ -+FILE *fout; /* file pointer of current output */ -+FILE *fin; /* file pointer of current input */ -+ -+list *defined; /* list of defined things */ -+ -+/* -+ * Reinitialize the world -+ */ -+void -+reinitialize(void) -+{ -+ memset(curline, 0, MAXLINESIZE); -+ where = curline; -+ linenum = 0; -+ defined = NULL; -+} -+ -+/* -+ * string equality -+ */ -+int -+streq(char *a, char *b) -+{ -+ return (strcmp(a, b) == 0); -+} -+ -+/* -+ * find a value in a list -+ */ -+definition * -+findval(list *lst, char *val, int (*cmp)(definition *, char *)) -+{ -+ -+ for (; lst != NULL; lst = lst->next) { -+ if ((*cmp) (lst->val, val)) { -+ return (lst->val); -+ } -+ } -+ return (NULL); -+} -+ -+/* -+ * store a value in a list -+ */ -+void -+storeval(lstp, val) -+ list **lstp; -+ definition *val; -+{ -+ list **l; -+ list *lst; -+ -+ -+ for (l = lstp; *l != NULL; l = (list **) & (*l)->next); -+ lst = ALLOC(list); -+ lst->val = val; -+ lst->next = NULL; -+ *l = lst; -+} -+ -+static int -+findit(definition *def, char *type) -+{ -+ return (streq(def->def_name, type)); -+} -+ -+static char * -+fixit(char *type, char *orig) -+{ -+ definition *def; -+ -+ def = (definition *) FINDVAL(defined, type, findit); -+ if (def == NULL || def->def_kind != DEF_TYPEDEF) { -+ return (orig); -+ } -+ switch (def->def.ty.rel) { -+ case REL_VECTOR: -+ return (def->def.ty.old_type); -+ case REL_ALIAS: -+ return (fixit(def->def.ty.old_type, orig)); -+ default: -+ return (orig); -+ } -+} -+ -+char * -+fixtype(char *type) -+{ -+ return (fixit(type, type)); -+} -+ -+char * -+stringfix(char *type) -+{ -+ if (streq(type, "string")) { -+ return ("wrapstring"); -+ } else { -+ return (type); -+ } -+} -+ -+void -+ptype(char *prefix, char *type, int follow) -+{ -+ if (prefix != NULL) { -+ if (streq(prefix, "enum")) { -+ f_print(fout, "enum "); -+ } else { -+ f_print(fout, "struct "); -+ } -+ } -+ if (streq(type, "bool")) { -+ f_print(fout, "bool_t "); -+ } else if (streq(type, "string")) { -+ f_print(fout, "char *"); -+ } else { -+ f_print(fout, "%s ", follow ? fixtype(type) : type); -+ } -+} -+ -+static int -+typedefed(definition *def, char *type) -+{ -+ if (def->def_kind != DEF_TYPEDEF || def->def.ty.old_prefix != NULL) { -+ return (0); -+ } else { -+ return (streq(def->def_name, type)); -+ } -+} -+ -+int -+isvectordef(char *type, relation rel) -+{ -+ definition *def; -+ -+ for (;;) { -+ switch (rel) { -+ case REL_VECTOR: -+ return (!streq(type, "string")); -+ case REL_ARRAY: -+ return (0); -+ case REL_POINTER: -+ return (0); -+ case REL_ALIAS: -+ def = (definition *) FINDVAL(defined, type, typedefed); -+ if (def == NULL) { -+ return (0); -+ } -+ type = def->def.ty.old_type; -+ rel = def->def.ty.rel; -+ } -+ } -+} -+ -+char * -+locase(char *str) -+{ -+ char c; -+ static char buf[100]; -+ char *p = buf; -+ -+ while ((c = *str++) != '\0') { -+ *p++ = (c >= 'A' && c <= 'Z') ? (c - 'A' + 'a') : c; -+ } -+ *p = 0; -+ return (buf); -+} -+ -+void -+pvname_svc(char *pname, char *vnum) -+{ -+ f_print(fout, "%s_%s_svc", locase(pname), vnum); -+} -+ -+void -+pvname(char *pname, char *vnum) -+{ -+ f_print(fout, "%s_%s", locase(pname), vnum); -+} -+ -+/* -+ * print a useful (?) error message, and then die -+ */ -+void -+error(char *msg) -+{ -+ printwhere(); -+ f_print(stderr, "%s, line %d: ", infilename, linenum); -+ f_print(stderr, "%s\n", msg); -+ crash(); -+} -+ -+/* -+ * Something went wrong, unlink any files that we may have created and then -+ * die. -+ */ -+void -+crash(void) -+{ -+ int i; -+ -+ for (i = 0; i < nfiles; i++) { -+ (void) unlink(outfiles[i]); -+ } -+ exit(1); -+} -+ -+void -+record_open(char *file) -+{ -+ if (nfiles < NFILES) { -+ outfiles[nfiles++] = file; -+ } else { -+ f_print(stderr, "too many files!\n"); -+ crash(); -+ } -+} -+ -+static char expectbuf[100]; -+static char *toktostr(); -+ -+/* -+ * error, token encountered was not the expected one -+ */ -+void -+expected1(exp1) -+ tok_kind exp1; -+{ -+ s_print(expectbuf, "expected '%s'", -+ toktostr(exp1)); -+ error(expectbuf); -+} -+ -+/* -+ * error, token encountered was not one of two expected ones -+ */ -+void -+expected2(exp1, exp2) -+ tok_kind exp1, exp2; -+{ -+ s_print(expectbuf, "expected '%s' or '%s'", -+ toktostr(exp1), -+ toktostr(exp2)); -+ error(expectbuf); -+} -+ -+/* -+ * error, token encountered was not one of 3 expected ones -+ */ -+void -+expected3(exp1, exp2, exp3) -+ tok_kind exp1, exp2, exp3; -+{ -+ s_print(expectbuf, "expected '%s', '%s' or '%s'", -+ toktostr(exp1), -+ toktostr(exp2), -+ toktostr(exp3)); -+ error(expectbuf); -+} -+ -+void -+tabify(f, tab) -+ FILE *f; -+ int tab; -+{ -+ while (tab--) { -+ (void) fputc('\t', f); -+ } -+} -+ -+ -+static token tokstrings[] = { -+ {TOK_IDENT, "identifier"}, -+ {TOK_CONST, "const"}, -+ {TOK_RPAREN, ")"}, -+ {TOK_LPAREN, "("}, -+ {TOK_RBRACE, "}"}, -+ {TOK_LBRACE, "{"}, -+ {TOK_LBRACKET, "["}, -+ {TOK_RBRACKET, "]"}, -+ {TOK_STAR, "*"}, -+ {TOK_COMMA, ","}, -+ {TOK_EQUAL, "="}, -+ {TOK_COLON, ":"}, -+ {TOK_SEMICOLON, ";"}, -+ {TOK_UNION, "union"}, -+ {TOK_STRUCT, "struct"}, -+ {TOK_SWITCH, "switch"}, -+ {TOK_CASE, "case"}, -+ {TOK_DEFAULT, "default"}, -+ {TOK_ENUM, "enum"}, -+ {TOK_TYPEDEF, "typedef"}, -+ {TOK_INT, "int"}, -+ {TOK_SHORT, "short"}, -+ {TOK_INT32, "int32"}, -+ {TOK_UNSIGNED, "unsigned"}, -+ {TOK_DOUBLE, "double"}, -+ {TOK_FLOAT, "float"}, -+ {TOK_CHAR, "char"}, -+ {TOK_STRING, "string"}, -+ {TOK_OPAQUE, "opaque"}, -+ {TOK_BOOL, "bool"}, -+ {TOK_VOID, "void"}, -+ {TOK_PROGRAM, "program"}, -+ {TOK_VERSION, "version"}, -+ {TOK_EOF, "??????"} -+}; -+ -+static char * -+toktostr(kind) -+ tok_kind kind; -+{ -+ token *sp; -+ -+ for (sp = tokstrings; sp->kind != TOK_EOF && sp->kind != kind; sp++); -+ return (sp->str); -+} -+ -+static void -+printbuf(void) -+{ -+ char c; -+ int i; -+ int cnt; -+ -+# define TABSIZE 4 -+ -+ for (i = 0; (c = curline[i]) != '\0'; i++) { -+ if (c == '\t') { -+ cnt = 8 - (i % TABSIZE); -+ c = ' '; -+ } else { -+ cnt = 1; -+ } -+ while (cnt--) { -+ (void) fputc(c, stderr); -+ } -+ } -+} -+ -+static void -+printwhere(void) -+{ -+ int i; -+ char c; -+ int cnt; -+ -+ printbuf(); -+ for (i = 0; i < where - curline; i++) { -+ c = curline[i]; -+ if (c == '\t') { -+ cnt = 8 - (i % TABSIZE); -+ } else { -+ cnt = 1; -+ } -+ while (cnt--) { -+ (void) fputc('^', stderr); -+ } -+ } -+ (void) fputc('\n', stderr); -+} -+ -+char * -+make_argname(char *pname, char *vname) -+{ -+ char *name; -+ -+ name = malloc(strlen(pname) + strlen(vname) + strlen(ARGEXT) + 3); -+ if (!name) { -+ fprintf(stderr, "failed in malloc"); -+ exit(1); -+ } -+ sprintf(name, "%s_%s_%s", locase(pname), vname, ARGEXT); -+ return(name); -+} -+ -+bas_type *typ_list_h; -+bas_type *typ_list_t; -+ -+void -+add_type(int len, char *type) -+{ -+ bas_type *ptr; -+ -+ -+ if ((ptr = (bas_type *) malloc(sizeof(bas_type))) == (bas_type *) NULL) { -+ fprintf(stderr, "failed in malloc"); -+ exit(1); -+ } -+ ptr->name = type; -+ ptr->length = len; -+ ptr->next = NULL; -+ if (typ_list_t == NULL) { -+ -+ typ_list_t = ptr; -+ typ_list_h = ptr; -+ } else { -+ -+ typ_list_t->next = ptr; -+ typ_list_t = ptr; -+ } -+} -+ -+ -+bas_type * -+find_type(char *type) -+{ -+ bas_type *ptr; -+ -+ ptr = typ_list_h; -+ -+ -+ while (ptr != NULL) { -+ if (strcmp(ptr->name, type) == 0) -+ return (ptr); -+ else -+ ptr = ptr->next; -+ }; -+ return (NULL); -+} -+ -diff --git a/rpcgen/rpc_util.h b/rpcgen/rpc_util.h -new file mode 100644 -index 0000000..fa115be ---- /dev/null -+++ b/rpcgen/rpc_util.h -@@ -0,0 +1,166 @@ -+/* -+ * Copyright (c) 2009, Sun Microsystems, Inc. -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * - Redistributions of source code must retain the above copyright notice, -+ * this list of conditions and the following disclaimer. -+ * - Redistributions in binary form must reproduce the above copyright notice, -+ * this list of conditions and the following disclaimer in the documentation -+ * and/or other materials provided with the distribution. -+ * - Neither the name of Sun Microsystems, Inc. nor the names of its -+ * contributors may be used to endorse or promote products derived -+ * from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+/* @(#)rpc_util.h 1.5 90/08/29 (C) 1987 SMI */ -+ -+/* -+ * rpc_util.h, Useful definitions for the RPC protocol compiler -+ */ -+ -+#include -+ -+#define alloc(size) malloc((unsigned)(size)) -+#define ALLOC(object) (object *) malloc(sizeof(object)) -+ -+#define s_print (void) sprintf -+#define f_print (void) fprintf -+ -+struct list { -+ definition *val; -+ struct list *next; -+}; -+typedef struct list list; -+ -+#define PUT 1 -+#define GET 2 -+ -+/* -+ * Global variables -+ */ -+#define MAXLINESIZE 1024 -+extern char curline[MAXLINESIZE]; -+extern char *where; -+extern int linenum; -+ -+extern char *infilename; -+extern FILE *fout; -+extern FILE *fin; -+ -+extern list *defined; -+ -+ -+extern bas_type *typ_list_h; -+extern bas_type *typ_list_t; -+ -+/* -+ * All the option flags -+ */ -+extern int inetdflag; -+extern int pmflag; -+extern int tblflag; -+extern int logflag; -+extern int newstyle; -+extern int Cflag; /* C++ flag */ -+extern int tirpcflag; /* flag for generating tirpc code */ -+extern int Inline; /* if this is 0, then do not generate inline code */ -+ -+/* -+ * Other flags related with inetd jumpstart. -+ */ -+extern int indefinitewait; -+extern int exitnow; -+extern int timerflag; -+ -+extern int nonfatalerrors; -+ -+/* -+ * rpc_util routines -+ */ -+void storeval(); -+ -+#define STOREVAL(list,item) \ -+ storeval(list,item) -+ -+definition *findval(); -+ -+#define FINDVAL(list,item,finder) \ -+ findval(list, item, finder) -+ -+ -+/* -+ * rpc_cout routines -+ */ -+void cprint(void); -+void emit(definition *); -+ -+/* -+ * rpc_hout routines -+ */ -+void print_datadef(definition *); -+void print_funcdef(definition *); -+ -+/* -+ * rpc_svcout routines -+ */ -+void write_most(char *, int, int); -+void write_register(void); -+void write_netid_register(char *); -+void write_nettype_register(char *); -+void write_inetd_register(char *); -+void write_rest(void); -+void write_programs(char *); -+void write_svc_aux(int); -+ -+/* -+ * rpc_clntout routines -+ */ -+void write_stubs(void); -+void printarglist(proc_list *, char *, char *); -+ -+/* -+ * rpc_tblout routines -+ */ -+void write_tables(void); -+ -+/* -+ * rpc_util -+ */ -+void pvname_svc(char *, char *); -+void pvname(char *, char *); -+void ptype(char *, char *, int); -+char * make_argname(char *, char *); -+void add_type(int, char *); -+void reinitialize(void); -+void crash(void); -+void error(char *); -+char *fixtype(char *); -+char *stringfix(char *); -+char *locase(char *); -+int isvectordef(char *, relation); -+int streq(char *, char *); -+void tabify(FILE *, int); -+void record_open(char *); -+bas_type *find_type(char *type); -+ -+/* -+ * rpc_sample -+ */ -+void write_sample_svc(definition *); -+int write_sample_clnt(definition *); -+void write_sample_clnt_main(void); -+void add_sample_msg(void); -diff --git a/rpcgen/rpcgen.1 b/rpcgen/rpcgen.1 -new file mode 100644 -index 0000000..89df7ed ---- /dev/null -+++ b/rpcgen/rpcgen.1 -@@ -0,0 +1,521 @@ -+.\" @(#)rpcgen.1 1.35 93/06/02 SMI -+.\" $FreeBSD: src/usr.bin/rpcgen/rpcgen.1,v 1.12.2.4 2002/06/21 15:28:50 charnier Exp $ -+.\" Copyright 1985-1993 Sun Microsystems, Inc. -+.Dd March 28, 1993 -+.Dt RPCGEN 1 -+.Os -+.Sh NAME -+.Nm rpcgen -+.Nd an RPC protocol compiler -+.Sh SYNOPSIS -+.Nm -+.Ar infile -+.Nm -+.Op Fl a -+.Op Fl b -+.Op Fl C -+.Oo -+.Fl D Ns Ar name Ns Op Ar =value -+.Oc -+.Op Fl i Ar size -+.Op Fl I Op Fl K Ar seconds -+.Op Fl L -+.Op Fl M -+.Op Fl N -+.Op Fl T -+.Op Fl Y Ar pathname -+.Ar infile -+.Nm -+.Oo -+.Fl c | -+.Fl h | -+.Fl l | -+.Fl m | -+.Fl t | -+.Fl \&Sc | -+.Fl \&Ss | -+.Fl \&Sm -+.Oc -+.Op Fl o Ar outfile -+.Op Ar infile -+.Nm -+.Op Fl s Ar nettype -+.Op Fl o Ar outfile -+.Op Ar infile -+.Nm -+.Op Fl n Ar netid -+.Op Fl o Ar outfile -+.Op Ar infile -+.\" .SH AVAILABILITY -+.\" .LP -+.\" SUNWcsu -+.Sh DESCRIPTION -+The -+.Nm -+utility is a tool that generates C code to implement an -+.Tn RPC -+protocol. -+The input to -+.Nm -+is a language similar to C known as -+.Tn RPC -+Language (Remote Procedure Call Language). -+.Pp -+The -+.Nm -+utility is normally used as in the first synopsis where -+it takes an input file and generates three output files. -+If the -+.Ar infile -+is named -+.Pa proto.x , -+then -+.Nm -+generates a header in -+.Pa proto.h , -+XDR routines in -+.Pa proto_xdr.c , -+server-side stubs in -+.Pa proto_svc.c , -+and client-side stubs in -+.Pa proto_clnt.c . -+With the -+.Fl T -+option, -+it also generates the -+.Tn RPC -+dispatch table in -+.Pa proto_tbl.i . -+.Pp -+The -+.Nm -+utility can also generate sample client and server files -+that can be customized to suit a particular application. -+The -+.Fl \&Sc , -+.Fl \&Ss -+and -+.Fl \&Sm -+options generate sample client, server and makefile, respectively. -+The -+.Fl a -+option generates all files, including sample files. -+If the -+.Ar infile -+is -+.Pa proto.x , -+then the client side sample file is written to -+.Pa proto_client.c , -+the server side sample file to -+.Pa proto_server.c -+and the sample makefile to -+.Pa makefile.proto . -+.Pp -+The server created can be started both by the port monitors -+(for example, -+.Xr inetd 8 ) -+or by itself. -+When it is started by a port monitor, -+it creates servers only for the transport for which -+the file descriptor -+.Em 0 -+was passed. -+The name of the transport must be specified -+by setting up the environment variable -+.Ev PM_TRANSPORT . -+When the server generated by -+.Nm -+is executed, -+it creates server handles for all the transports -+specified in -+.Ev NETPATH -+environment variable, -+or if it is unset, -+it creates server handles for all the visible transports from -+.Pa /etc/netconfig -+file. -+Note: -+the transports are chosen at run time and not at compile time. -+When the server is self-started, -+it backgrounds itself by default. -+A special define symbol -+.Em RPC_SVC_FG -+can be used to run the server process in foreground. -+.Pp -+The second synopsis provides special features which allow -+for the creation of more sophisticated -+.Tn RPC -+servers. -+These features include support for user provided -+.Em #defines -+and -+.Tn RPC -+dispatch tables. -+The entries in the -+.Tn RPC -+dispatch table contain: -+.Bl -bullet -offset indent -compact -+.It -+pointers to the service routine corresponding to that procedure, -+.It -+a pointer to the input and output arguments, -+.It -+the size of these routines. -+.El -+A server can use the dispatch table to check authorization -+and then to execute the service routine; -+a client library may use it to deal with the details of storage -+management and XDR data conversion. -+.Pp -+The other three synopses shown above are used when -+one does not want to generate all the output files, -+but only a particular one. -+See the -+.Sx EXAMPLES -+section below for examples of -+.Nm -+usage. -+When -+.Nm -+is executed with the -+.Fl s -+option, -+it creates servers for that particular class of transports. -+When -+executed with the -+.Fl n -+option, -+it creates a server for the transport specified by -+.Ar netid . -+If -+.Ar infile -+is not specified, -+.Nm -+accepts the standard input. -+.Pp -+The C preprocessor, -+.Em cc -E -+is run on the input file before it is actually interpreted by -+.Nm . -+For each type of output file, -+.Nm -+defines a special preprocessor symbol for use by the -+.Nm -+programmer: -+.Bl -tag -width indent -+.It RPC_HDR -+defined when compiling into headers -+.It RPC_XDR -+defined when compiling into XDR routines -+.It RPC_SVC -+defined when compiling into server-side stubs -+.It RPC_CLNT -+defined when compiling into client-side stubs -+.It RPC_TBL -+defined when compiling into RPC dispatch tables -+.El -+.Pp -+Any line beginning with -+.Dq % -+is passed directly into the output file, -+uninterpreted by -+.Nm . -+To specify the path name of the C preprocessor use -+.Fl Y -+flag. -+.Pp -+For every data type referred to in -+.Ar infile , -+.Nm -+assumes that there exists a -+routine with the string -+.Em xdr_ -+prepended to the name of the data type. -+If this routine does not exist in the -+.Tn RPC/XDR -+library, it must be provided. -+Providing an undefined data type -+allows customization of -+.Xr xdr 3 -+routines. -+.Sh OPTIONS -+The following options are available: -+.Bl -tag -width indent -+.It Fl a -+Generate all files, including sample files. -+.It Fl b -+Backward compatibility mode. -+Generate transport specific -+.Tn RPC -+code for older versions -+of the operating system. -+.Pp -+Note: in -+.Fx , -+this compatibility flag is turned on by -+default since -+.Fx -+supports only the older -+.Tn ONC RPC -+library. -+.It Fl c -+Compile into -+.Tn XDR -+routines. -+.It Fl C -+Generate header and stub files which can be used with -+.Tn ANSI -+C compilers. Headers generated with this flag can also be -+used with C++ programs. -+.It Fl D Ns Ar name -+.It Fl D Ns Ar name=value -+.\".It Fl D Ns Ar name Ns Op Ar =value -+Define a symbol -+.Ar name . -+Equivalent to the -+.Em #define -+directive in the source. -+If no -+.Ar value -+is given, -+.Ar value -+is defined as -+.Em 1 . -+This option may be specified more than once. -+.It Fl h -+Compile into C data-definitions (a header). -+.Fl T -+option can be used in conjunction to produce a -+header which supports -+.Tn RPC -+dispatch tables. -+.It Fl i Ar size -+Size at which to start generating inline code. -+This option is useful for optimization. -+The default size is 5. -+.Pp -+Note: in order to provide backwards compatibility with the older -+.Nm -+on the -+.Fx -+platform, the default is actually 0 (which means -+that inline code generation is disabled by default). You must specify -+a non-zero value explicitly to override this default. -+.It Fl I -+Compile support for -+.Xr inetd 8 -+in the server side stubs. -+Such servers can be self-started or can be started by -+.Nm inetd . -+When the server is self-started, it backgrounds itself by default. -+A special define symbol -+.Em RPC_SVC_FG -+can be used to run the -+server process in foreground, or the user may simply compile without -+the -+.Fl I -+option. -+.Pp -+If there are no pending client requests, the -+.Nm inetd -+servers exit after 120 seconds (default). -+The default can be changed with the -+.Fl K -+option. -+All the error messages for -+.Nm inetd -+servers -+are always logged with -+.Xr syslog 3 . -+.\" .IP -+.\" Note: -+.\" this option is supported for backward compatibility only. -+.\" By default, -+.\" .B rpcgen -+.\" generates servers that can be invoked through portmonitors. -+.Pp -+.It Fl K Ar seconds -+By default, services created using -+.Nm -+and invoked through -+port monitors wait 120 seconds -+after servicing a request before exiting. -+That interval can be changed using the -+.Fl K -+flag. -+To create a server that exits immediately upon servicing a request, -+use -+.Fl K Ar 0 . -+To create a server that never exits, the appropriate argument is -+.Fl k Ar -1 . -+.Pp -+When monitoring for a server, -+some portmonitors -+.Em always -+spawn a new process in response to a service request. -+If it is known that a server will be used with such a monitor, the -+server should exit immediately on completion. -+For such servers, -+.Nm -+should be used with -+.Fl K Ar 0 . -+.It Fl l -+Compile into client-side stubs. -+.It Fl L -+When the servers are started in foreground, use -+.Xr syslog 3 -+to log the server errors instead of printing them on the standard -+error. -+.It Fl m -+Compile into server-side stubs, -+but do not generate a -+.Qq main -+routine. -+This option is useful for doing callback-routines -+and for users who need to write their own -+.Qq main -+routine to do initialization. -+.It Fl M -+Generate multithread-safe stubs for passing arguments and results between -+rpcgen generated code and user written code. -+This option is useful -+for users who want to use threads in their code. -+However, the -+.Xr rpc_svc_calls 3 -+functions are not yet MT-safe, which means that rpcgen generated server-side -+code will not be MT-safe. -+.It Fl N -+This option allows procedures to have multiple arguments. -+It also uses the style of parameter passing that closely resembles C. -+So, when passing an argument to a remote procedure, you do not have to -+pass a pointer to the argument, but can pass the argument itself. -+This behavior is different from the old style of -+.Nm -+generated code. -+To maintain backward compatibility, -+this option is not the default. -+.It Fl n Ar netid -+Compile into server-side stubs for the transport -+specified by -+.Ar netid . -+There should be an entry for -+.Ar netid -+in the -+netconfig database. -+This option may be specified more than once, -+so as to compile a server that serves multiple transports. -+.It Fl o Ar outfile -+Specify the name of the output file. -+If none is specified, -+standard output is used -+( -+.Fl c , -+.Fl h , -+.Fl l , -+.Fl m , -+.Fl n , -+.Fl s , -+.Fl \&Sc , -+.Fl \&Sm , -+.Fl \&Ss , -+and -+.Fl t -+modes only). -+.It Fl s Ar nettype -+Compile into server-side stubs for all the -+transports belonging to the class -+.Ar nettype . -+The supported classes are -+.Em netpath , -+.Em visible , -+.Em circuit_n , -+.Em circuit_v , -+.Em datagram_n , -+.Em datagram_v , -+.Em tcp , -+and -+.Em udp -+(see -+.Xr rpc 3 -+for the meanings associated with these classes). -+This option may be specified more than once. -+Note: -+the transports are chosen at run time and not at compile time. -+.It Fl \&Sc -+Generate sample client code that uses remote procedure calls. -+.It Fl \&Sm -+Generate a sample -+.Pa Makefile -+which can be used for compiling the application. -+.It Fl \&Ss -+Generate sample server code that uses remote procedure calls. -+.It Fl t -+Compile into -+.Tn RPC -+dispatch table. -+.It Fl T -+Generate the code to support -+.Tn RPC -+dispatch tables. -+.Pp -+The options -+.Fl c , -+.Fl h , -+.Fl l , -+.Fl m , -+.Fl s , -+.Fl \&Sc , -+.Fl \&Sm , -+.Fl \&Ss , -+and -+.Fl t -+are used exclusively to generate a particular type of file, -+while the options -+.Fl D -+and -+.Fl T -+are global and can be used with the other options. -+.It Fl Y Ar pathname -+Give the name of the directory where -+.Nm -+will start looking for the C-preprocessor. -+.El -+.Sh EXAMPLES -+The following example: -+.Dl example% rpcgen -T prot.x -+.Pp -+generates all the five files: -+.Pa prot.h , -+.Pa prot_clnt.c , -+.Pa prot_svc.c , -+.Pa prot_xdr.c -+and -+.Pa prot_tbl.i . -+.Pp -+The following example sends the C data-definitions (header) -+to the standard output. -+.Dl example% rpcgen -h prot.x -+.Pp -+To send the test version of the -+.Fl D Ns Ar TEST , -+server side stubs for -+all the transport belonging to the class -+.Ar datagram_n -+to standard output, use: -+.Dl example% rpcgen -s datagram_n -DTEST prot.x -+.Pp -+To create the server side stubs for the transport indicated -+by -+.Ar netid -+tcp, -+use: -+.Dl example% rpcgen -n tcp -o prot_svc.c prot.x -+.Sh SEE ALSO -+.Xr cc 1 , -+.Xr rpc 3 , -+.Xr syslog 3 , -+.Xr inetd 8 -+.\" .BR rpc_svc_calls (3) -+.Rs -+.%T The rpcgen chapter in the NETP manual -+.Re --- -1.9.1 - diff --git a/buildroot/package/libtirpc/0004-Automatically-generate-XDR-header-files-from-.x-sour.patch b/buildroot/package/libtirpc/0003-Automatically-generate-XDR-header-files-from-.x-sour.patch similarity index 98% rename from buildroot/package/libtirpc/0004-Automatically-generate-XDR-header-files-from-.x-sour.patch rename to buildroot/package/libtirpc/0003-Automatically-generate-XDR-header-files-from-.x-sour.patch index e302c5d1c..2712f53c3 100644 --- a/buildroot/package/libtirpc/0004-Automatically-generate-XDR-header-files-from-.x-sour.patch +++ b/buildroot/package/libtirpc/0003-Automatically-generate-XDR-header-files-from-.x-sour.patch @@ -1,4 +1,4 @@ -From eba198c27f2b8d3f0b27ea4a42f3dc79d397440c Mon Sep 17 00:00:00 2001 +From 001e3f26dc80b8f21bed7d9b5872fe10e8b4af04 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 10 Nov 2012 17:29:53 +0100 Subject: [PATCH] Automatically generate XDR header files from .x sources using @@ -8,21 +8,23 @@ Subject: [PATCH] Automatically generate XDR header files from .x sources using Signed-off-by: Thomas Petazzoni [yann.morin.1998@free.fr: update for 0.3.1] Signed-off-by: "Yann E. MORIN" +[baruch: use external rpcgen] +Signed-off-by: Baruch Siach --- - Makefile.am | 19 +- + Makefile.am | 16 +- src/Makefile.am | 2 +- - tirpc/rpc/rpcb_prot.h | 797 -------------------------------------------------- - tirpc/rpcsvc/crypt.h | 109 ------- - 4 files changed, 17 insertions(+), 910 deletions(-) + tirpc/rpc/rpcb_prot.h | 797 ------------------------------------------ + tirpc/rpcsvc/crypt.h | 109 ------ + 4 files changed, 14 insertions(+), 910 deletions(-) delete mode 100644 tirpc/rpc/rpcb_prot.h delete mode 100644 tirpc/rpcsvc/crypt.h diff --git a/Makefile.am b/Makefile.am -index 8558289..aa5908e 100644 +index 3f6063771faf..368fb8a1aed2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,9 @@ - SUBDIRS = src man doc rpcgen + SUBDIRS = src man doc ACLOCAL_AMFLAGS = -I m4 +GENFILES = tirpc/rpcsvc/crypt.h \ @@ -39,7 +41,7 @@ index 8558289..aa5908e 100644 tirpc/rpc/xdr.h \ tirpc/rpc/types.h \ tirpc/rpc/svc_soc.h \ -@@ -20,7 +22,6 @@ nobase_include_HEADERS = tirpc/netconfig.h \ +@@ -21,7 +23,6 @@ nobase_include_HEADERS = tirpc/netconfig.h \ tirpc/rpc/rpcent.h \ tirpc/rpc/rpc_com.h \ tirpc/rpc/rpcb_prot.x \ @@ -47,7 +49,7 @@ index 8558289..aa5908e 100644 tirpc/rpc/rpcb_clnt.h \ tirpc/rpc/raw.h \ tirpc/rpc/pmap_rmt.h \ -@@ -51,5 +52,17 @@ endif +@@ -48,5 +49,14 @@ endif pkgconfigdir=$(libdir)/pkgconfig pkgconfig_DATA = libtirpc.pc @@ -55,19 +57,16 @@ index 8558289..aa5908e 100644 +nobase_nodist_include_HEADERS = $(GENFILES) +BUILT_SOURCES = $(GENFILES) + -+$(GENFILES): %.h: %.x $(top_builddir)/rpcgen/rpcgen ++$(GENFILES): %.h: %.x + mkdir -p $(dir $@) -+ $(top_builddir)/rpcgen/rpcgen -h -o $@ $< -+ -+$(top_builddir)/rpcgen/rpcgen: force -+ cd rpcgen && $(MAKE) ++ rpcgen -h -o $@ $< + +force: + +CLEANFILES = cscope.* *~ $(GENFILES) DISTCLEANFILES = Makefile.in libtirpc*.tar.gz diff --git a/src/Makefile.am b/src/Makefile.am -index 7428e92..0356171 100644 +index 2af40f16d03a..0b7e23835c36 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,7 +8,7 @@ @@ -81,7 +80,7 @@ index 7428e92..0356171 100644 diff --git a/tirpc/rpc/rpcb_prot.h b/tirpc/rpc/rpcb_prot.h deleted file mode 100644 -index 7ae48b8..0000000 +index 7ae48b805370..000000000000 --- a/tirpc/rpc/rpcb_prot.h +++ /dev/null @@ -1,797 +0,0 @@ @@ -884,7 +883,7 @@ index 7ae48b8..0000000 -#endif /* !_RPCB_PROT_H_RPCGEN */ diff --git a/tirpc/rpcsvc/crypt.h b/tirpc/rpcsvc/crypt.h deleted file mode 100644 -index da1f9cc..0000000 +index da1f9ccb56ea..000000000000 --- a/tirpc/rpcsvc/crypt.h +++ /dev/null @@ -1,109 +0,0 @@ @@ -998,5 +997,5 @@ index da1f9cc..0000000 - -#endif /* !_CRYPT_H_RPCGEN */ -- -1.9.1 +2.17.0 diff --git a/buildroot/package/libtirpc/0005-Add-more-XDR-files-needed-to-build-rpcbind-on-top-of.patch b/buildroot/package/libtirpc/0004-Add-more-XDR-files-needed-to-build-rpcbind-on-top-of.patch similarity index 100% rename from buildroot/package/libtirpc/0005-Add-more-XDR-files-needed-to-build-rpcbind-on-top-of.patch rename to buildroot/package/libtirpc/0004-Add-more-XDR-files-needed-to-build-rpcbind-on-top-of.patch diff --git a/buildroot/package/libtirpc/0006-Disable-DES-authentification-support.patch b/buildroot/package/libtirpc/0005-Disable-DES-authentification-support.patch similarity index 100% rename from buildroot/package/libtirpc/0006-Disable-DES-authentification-support.patch rename to buildroot/package/libtirpc/0005-Disable-DES-authentification-support.patch diff --git a/buildroot/package/libtirpc/0007-include-stdint.h-for-uintptr_t.patch b/buildroot/package/libtirpc/0006-include-stdint.h-for-uintptr_t.patch similarity index 100% rename from buildroot/package/libtirpc/0007-include-stdint.h-for-uintptr_t.patch rename to buildroot/package/libtirpc/0006-include-stdint.h-for-uintptr_t.patch diff --git a/buildroot/package/libtirpc/libtirpc.mk b/buildroot/package/libtirpc/libtirpc.mk index d9bf22b83..319b78c3f 100644 --- a/buildroot/package/libtirpc/libtirpc.mk +++ b/buildroot/package/libtirpc/libtirpc.mk @@ -10,6 +10,7 @@ LIBTIRPC_SITE = http://downloads.sourceforge.net/project/libtirpc/libtirpc/$(LIB LIBTIRPC_LICENSE = BSD-3-Clause LIBTIRPC_LICENSE_FILES = COPYING +LIBTIRPC_DEPENDENCIES = host-nfs-utils LIBTIRPC_INSTALL_STAGING = YES LIBTIRPC_AUTORECONF = YES @@ -18,4 +19,11 @@ LIBTIRPC_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -DGQ" LIBTIRPC_CONF_OPTS = --disable-gssapi +define HOST_LIBTIRPC_INSTALL_CMDS + $(INSTALL) -D -m 0644 $(@D)/tirpc/rpc/types.h $(HOST_DIR)/include/rpc/types.h + $(INSTALL) -D -m 0644 $(@D)/tirpc/netconfig.h $(HOST_DIR)/include/netconfig.h +endef + $(eval $(autotools-package)) +# We are only copying headers; no need for the autotools infrastructure +$(eval $(host-generic-package)) diff --git a/buildroot/package/linux-headers/Config.in.host b/buildroot/package/linux-headers/Config.in.host index c7640f1ab..b99b36e83 100644 --- a/buildroot/package/linux-headers/Config.in.host +++ b/buildroot/package/linux-headers/Config.in.host @@ -249,14 +249,14 @@ endchoice config BR2_DEFAULT_KERNEL_HEADERS string default "3.2.101" if BR2_KERNEL_HEADERS_3_2 - default "4.1.51" if BR2_KERNEL_HEADERS_4_1 - default "4.4.131" if BR2_KERNEL_HEADERS_4_4 - default "4.9.101" if BR2_KERNEL_HEADERS_4_9 + default "4.1.52" if BR2_KERNEL_HEADERS_4_1 + default "4.4.134" if BR2_KERNEL_HEADERS_4_4 + default "4.9.104" if BR2_KERNEL_HEADERS_4_9 default "4.10.17" if BR2_KERNEL_HEADERS_4_10 default "4.11.12" if BR2_KERNEL_HEADERS_4_11 default "4.12.14" if BR2_KERNEL_HEADERS_4_12 default "4.13.16" if BR2_KERNEL_HEADERS_4_13 - default "4.14.42" if BR2_KERNEL_HEADERS_4_14 + default "4.14.46" if BR2_KERNEL_HEADERS_4_14 default "4.15.18" if BR2_KERNEL_HEADERS_4_15 - default "4.16.10" if BR2_KERNEL_HEADERS_4_16 + default "4.16.13" if BR2_KERNEL_HEADERS_4_16 default BR2_DEFAULT_KERNEL_VERSION if BR2_KERNEL_HEADERS_VERSION diff --git a/buildroot/package/log4cplus/Config.in b/buildroot/package/log4cplus/Config.in index fd224dd27..cd5476a08 100644 --- a/buildroot/package/log4cplus/Config.in +++ b/buildroot/package/log4cplus/Config.in @@ -3,7 +3,7 @@ config BR2_PACKAGE_LOG4CPLUS depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_WCHAR depends on BR2_TOOLCHAIN_HAS_THREADS - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11 + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11 depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # std::future help log4cplus is a simple to use C++ logging API providing @@ -13,9 +13,9 @@ config BR2_PACKAGE_LOG4CPLUS http://sourceforge.net/projects/log4cplus -comment "log4cplus needs a toolchain w/ C++, wchar, threads, gcc >= 4.7" +comment "log4cplus needs a toolchain w/ C++, wchar, threads, gcc >= 4.8" depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \ - !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 + !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 comment "log4cplus needs a toolchain not affected by GCC bug 64735" depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735 diff --git a/buildroot/package/lrzsz/lrzsz.mk b/buildroot/package/lrzsz/lrzsz.mk index 5dac07a29..25ecf3dea 100644 --- a/buildroot/package/lrzsz/lrzsz.mk +++ b/buildroot/package/lrzsz/lrzsz.mk @@ -24,6 +24,10 @@ define LRZSZ_INSTALL_TARGET_CMDS $(INSTALL) -m 0755 -D $(@D)/src/lsz $(TARGET_DIR)/usr/bin/sz ln -sf rz $(TARGET_DIR)/usr/bin/lrz ln -sf sz $(TARGET_DIR)/usr/bin/lsz + ln -sf rz $(TARGET_DIR)/usr/bin/rb + ln -sf sz $(TARGET_DIR)/usr/bin/sb + ln -sf rz $(TARGET_DIR)/usr/bin/rx + ln -sf sz $(TARGET_DIR)/usr/bin/sx endef $(eval $(autotools-package)) diff --git a/buildroot/package/nfs-utils/nfs-utils.mk b/buildroot/package/nfs-utils/nfs-utils.mk index 26112d69f..9fa7ae200 100644 --- a/buildroot/package/nfs-utils/nfs-utils.mk +++ b/buildroot/package/nfs-utils/nfs-utils.mk @@ -24,6 +24,20 @@ NFS_UTILS_CONF_OPTS = \ --with-statedir=/run/nfs \ --with-rpcgen=internal +HOST_NFS_UTILS_CONF_OPTS = \ + --disable-nfsv4 \ + --disable-nfsv41 \ + --disable-gss \ + --disable-uuid \ + --disable-ipv6 \ + --without-tcp-wrappers \ + --with-statedir=/run/nfs \ + --disable-caps \ + --disable-tirpc \ + --without-systemd \ + --with-rpcgen=internal +HOST_NFS_UTILS_DEPENDENCIES = host-pkgconf host-libtirpc + NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPCDEBUG) += usr/sbin/rpcdebug NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPC_LOCKD) += usr/sbin/rpc.lockd NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPC_RQUOTAD) += usr/sbin/rpc.rquotad @@ -89,4 +103,13 @@ endef # nfsiostat is interpreted python, so remove it unless it's in the target NFS_UTILS_POST_INSTALL_TARGET_HOOKS += $(if $(BR2_PACKAGE_PYTHON),,NFS_UTILS_REMOVE_NFSIOSTAT) +define HOST_NFS_UTILS_BUILD_CMDS + $(MAKE) -C $(@D)/tools/rpcgen +endef + +define HOST_NFS_UTILS_INSTALL_CMDS + $(INSTALL) -D -m 0755 $(@D)/tools/rpcgen/rpcgen $(HOST_DIR)/bin/rpcgen +endef + $(eval $(autotools-package)) +$(eval $(host-autotools-package)) diff --git a/buildroot/package/openvmtools/openvmtools.mk b/buildroot/package/openvmtools/openvmtools.mk index cc71324ff..9501ef336 100644 --- a/buildroot/package/openvmtools/openvmtools.mk +++ b/buildroot/package/openvmtools/openvmtools.mk @@ -17,7 +17,7 @@ OPENVMTOOLS_CONF_OPTS = --with-dnet \ --without-gtkmm --without-kernel-modules \ --disable-deploypkg --without-xerces OPENVMTOOLS_CONF_ENV += CUSTOM_DNET_CPPFLAGS=" " -OPENVMTOOLS_DEPENDENCIES = libglib2 libdnet +OPENVMTOOLS_DEPENDENCIES = host-nfs-utils libglib2 libdnet # When libfuse is available, openvmtools can build vmblock-fuse, so # make sure that libfuse gets built first diff --git a/buildroot/package/pkg-generic.mk b/buildroot/package/pkg-generic.mk index 8a3b5f90a..9bd2358ef 100644 --- a/buildroot/package/pkg-generic.mk +++ b/buildroot/package/pkg-generic.mk @@ -520,6 +520,9 @@ ifeq ($$($(2)_SITE_METHOD),local) ifeq ($$($(2)_OVERRIDE_SRCDIR),) $(2)_OVERRIDE_SRCDIR = $$($(2)_SITE) endif +ifeq ($$($(2)_OVERRIDE_SRCDIR),) +$$(error $(1) has local site method, but `$(2)_SITE` is not defined) +endif endif ifndef $(2)_LICENSE diff --git a/buildroot/package/poppler/poppler.mk b/buildroot/package/poppler/poppler.mk index 5946cbec2..bad61a661 100644 --- a/buildroot/package/poppler/poppler.mk +++ b/buildroot/package/poppler/poppler.mk @@ -14,6 +14,10 @@ POPPLER_INSTALL_STAGING = YES POPPLER_CONF_OPTS = --with-font-configuration=fontconfig \ --enable-xpdf-headers +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +POPPLER_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -latomic" +endif + ifeq ($(BR2_PACKAGE_CAIRO),y) POPPLER_CONF_OPTS += --enable-cairo-output POPPLER_DEPENDENCIES += cairo diff --git a/buildroot/package/procps-ng/0001-proc-sig-fix-build-for-sparc.patch b/buildroot/package/procps-ng/0001-proc-sig-fix-build-for-sparc.patch deleted file mode 100644 index 74f822aea..000000000 --- a/buildroot/package/procps-ng/0001-proc-sig-fix-build-for-sparc.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 070feb7c5ebd0f2ca721ca5d75bdd3fd8cffe961 Mon Sep 17 00:00:00 2001 -From: Baruch Siach -Date: Fri, 27 Apr 2018 07:34:57 +0300 -Subject: [PATCH] proc/sig: fix build for sparc - -The code undefines SIGLOST which breaks references to SIGPWR. - -Taken from a patch suggested in upstream bug report #93. - -Signed-off-by: Baruch Siach ---- -Upstream status: https://gitlab.com/procps-ng/procps/issues/93 ---- - proc/sig.c | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - -diff --git a/proc/sig.c b/proc/sig.c -index b883185fc28a..6ca9512cc70c 100644 ---- a/proc/sig.c -+++ b/proc/sig.c -@@ -52,10 +52,6 @@ - # undef SIGSTKFLT - #endif - --#if !defined(__GNU__) && defined(SIGLOST) --# undef SIGLOST --#endif -- - #ifndef SIGRTMIN - # warning Standards require that define SIGRTMIN; assuming 32 - # define SIGRTMIN 32 -@@ -87,7 +83,7 @@ static const mapstruct sigtable[] = { - {"ILL", SIGILL}, - {"INT", SIGINT}, - {"KILL", SIGKILL}, --#ifdef SIGLOST -+#if defined(__GNU__) - {"LOST", SIGLOST}, /* Hurd-specific */ - #endif - {"PIPE", SIGPIPE}, --- -2.17.0 - diff --git a/buildroot/package/procps-ng/procps-ng.hash b/buildroot/package/procps-ng/procps-ng.hash index 9488af2d9..123db992e 100644 --- a/buildroot/package/procps-ng/procps-ng.hash +++ b/buildroot/package/procps-ng/procps-ng.hash @@ -1,8 +1,8 @@ # From http://sourceforge.net/projects/procps-ng/files/Production/ -md5 fce371ccc1c15a67af9d85e4057e559d procps-ng-3.3.14.tar.xz -sha1 fcc4631b1185f7250daecee2fcebe15efbbe0d65 procps-ng-3.3.14.tar.xz +md5 2b0717a7cb474b3d6dfdeedfbad2eccc procps-ng-3.3.15.tar.xz +sha1 2929bc64f0cf7b2db997eef79b7187658e47230d procps-ng-3.3.15.tar.xz # Locally calculated after checking signature -# http://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-3.3.14.tar.xz.asc -sha256 5eda0253999b7d786e690edfa73301b3113c7a67058478866e98e9ff6736726c procps-ng-3.3.14.tar.xz +# http://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-3.3.15.tar.xz.asc +sha256 10bd744ffcb3de2d591d2f6acf1a54a7ba070fdcc432a855931a5057149f0465 procps-ng-3.3.15.tar.xz sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING sha256 681e386e44a19d7d0674b4320272c90e66b6610b741e7e6305f8219c42e85366 COPYING.LIB diff --git a/buildroot/package/procps-ng/procps-ng.mk b/buildroot/package/procps-ng/procps-ng.mk index 0d5ce9ddf..e1fddea32 100644 --- a/buildroot/package/procps-ng/procps-ng.mk +++ b/buildroot/package/procps-ng/procps-ng.mk @@ -4,7 +4,7 @@ # ################################################################################ -PROCPS_NG_VERSION = 3.3.14 +PROCPS_NG_VERSION = 3.3.15 PROCPS_NG_SOURCE = procps-ng-$(PROCPS_NG_VERSION).tar.xz PROCPS_NG_SITE = http://downloads.sourceforge.net/project/procps-ng/Production PROCPS_NG_LICENSE = GPL-2.0+, LGPL-2.0+ (libproc and libps) diff --git a/buildroot/package/qextserialport/0001-Create-a-main-include-file-QExtSerialPort.patch b/buildroot/package/qextserialport/0001-Create-a-main-include-file-QExtSerialPort.patch index 09a9eb2b8..e1d99f0fc 100644 --- a/buildroot/package/qextserialport/0001-Create-a-main-include-file-QExtSerialPort.patch +++ b/buildroot/package/qextserialport/0001-Create-a-main-include-file-QExtSerialPort.patch @@ -29,12 +29,12 @@ index 461d56f..f8a678d 100644 --- a/src/qextserialport.pri +++ b/src/qextserialport.pri @@ -3,7 +3,8 @@ - - PUBLIC_HEADERS += $$PWD/qextserialport.h \ - $$PWD/qextserialenumerator.h \ -- $$PWD/qextserialport_global.h -+ $$PWD/qextserialport_global.h \ -+ $$PWD/QExtSerialPort - - HEADERS += $$PUBLIC_HEADERS \ - $$PWD/qextserialport_p.h \ + + PUBLIC_HEADERS += $$PWD/qextserialport.h \ + $$PWD/qextserialenumerator.h \ +- $$PWD/qextserialport_global.h ++ $$PWD/qextserialport_global.h \ ++ $$PWD/QExtSerialPort + + HEADERS += $$PUBLIC_HEADERS \ + $$PWD/qextserialport_p.h \ diff --git a/buildroot/package/qt-webkit-kiosk/qt-webkit-kiosk.hash b/buildroot/package/qt-webkit-kiosk/qt-webkit-kiosk.hash index 8097c88c9..666cb6ce5 100644 --- a/buildroot/package/qt-webkit-kiosk/qt-webkit-kiosk.hash +++ b/buildroot/package/qt-webkit-kiosk/qt-webkit-kiosk.hash @@ -1,2 +1,2 @@ # Locally computed -sha256 ec05f5bcb202265202a6f3ff74372516ce9beb82206ff67ca2b1b6fcb586ecd2 qt-webkit-kiosk-34efddb0bf0c36c8652f90dcd001db123f286f04.tar.gz +sha256 07fbc3f5053f55e4ef6566a15b42b74895314b48a0dfd46f0984f96f0fbb3e02 qt-webkit-kiosk-a7720e50f2bd70aad99e0b465f5c4a57aca48127.tar.gz diff --git a/buildroot/package/qt-webkit-kiosk/qt-webkit-kiosk.mk b/buildroot/package/qt-webkit-kiosk/qt-webkit-kiosk.mk index c279cbe7c..a714fca9c 100644 --- a/buildroot/package/qt-webkit-kiosk/qt-webkit-kiosk.mk +++ b/buildroot/package/qt-webkit-kiosk/qt-webkit-kiosk.mk @@ -4,7 +4,7 @@ # ################################################################################ -QT_WEBKIT_KIOSK_VERSION = 34efddb0bf0c36c8652f90dcd001db123f286f04 +QT_WEBKIT_KIOSK_VERSION = a7720e50f2bd70aad99e0b465f5c4a57aca48127 QT_WEBKIT_KIOSK_SITE = https://github.com/sergey-dryabzhinsky/qt-webkit-kiosk.git QT_WEBKIT_KIOSK_SITE_METHOD = git QT_WEBKIT_KIOSK_DEPENDENCIES = qt5webkit qt5multimedia diff --git a/buildroot/package/quota/quota.mk b/buildroot/package/quota/quota.mk index 5bd9013d6..38e18a60c 100644 --- a/buildroot/package/quota/quota.mk +++ b/buildroot/package/quota/quota.mk @@ -6,7 +6,7 @@ QUOTA_VERSION = 4.01 QUOTA_SITE = http://downloads.sourceforge.net/project/linuxquota/quota-tools/$(QUOTA_VERSION) -QUOTA_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) +QUOTA_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) host-nfs-utils QUOTA_AUTORECONF = YES QUOTA_LICENSE = GPL-2.0+ QUOTA_CONF_OPTS = --disable-strip-binaries diff --git a/buildroot/package/rapidxml/0001-ensure-internal-print-operations-are-declared-before.patch b/buildroot/package/rapidxml/0001-ensure-internal-print-operations-are-declared-before.patch index b21da8d96..fcf1b3cce 100644 --- a/buildroot/package/rapidxml/0001-ensure-internal-print-operations-are-declared-before.patch +++ b/buildroot/package/rapidxml/0001-ensure-internal-print-operations-are-declared-before.patch @@ -19,20 +19,20 @@ Index: b/rapidxml_print.hpp --- a/rapidxml_print.hpp +++ b/rapidxml_print.hpp @@ -101,7 +101,16 @@ - - /////////////////////////////////////////////////////////////////////////// - // Internal printing operations -- -+ -+ template inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent); -+ template inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent); -+ template inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent); -+ template inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent); -+ template inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent); -+ template inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent); -+ template inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent); -+ template inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent); -+ - // Print node - template - inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent) + + /////////////////////////////////////////////////////////////////////////// + // Internal printing operations +- ++ ++ template inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent); ++ template inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent); ++ template inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent); ++ template inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent); ++ template inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent); ++ template inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent); ++ template inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent); ++ template inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent); ++ + // Print node + template + inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent) diff --git a/buildroot/package/samba4/samba4.mk b/buildroot/package/samba4/samba4.mk index c77bc04a8..b03af34cd 100644 --- a/buildroot/package/samba4/samba4.mk +++ b/buildroot/package/samba4/samba4.mk @@ -11,7 +11,7 @@ SAMBA4_INSTALL_STAGING = YES SAMBA4_LICENSE = GPL-3.0+ SAMBA4_LICENSE_FILES = COPYING SAMBA4_DEPENDENCIES = \ - host-e2fsprogs host-heimdal host-python \ + host-e2fsprogs host-heimdal host-python host-nfs-utils \ e2fsprogs popt python zlib \ $(if $(BR2_PACKAGE_LIBAIO),libaio) \ $(if $(BR2_PACKAGE_LIBCAP),libcap) \ diff --git a/buildroot/package/softether/0003-use-fhs-install-directories.patch b/buildroot/package/softether/0003-use-fhs-install-directories.patch index 4377a1482..c489cc1a6 100644 --- a/buildroot/package/softether/0003-use-fhs-install-directories.patch +++ b/buildroot/package/softether/0003-use-fhs-install-directories.patch @@ -47,252 +47,252 @@ Index: b/src/Cedar/Admin.c --- a/src/Cedar/Admin.c +++ b/src/Cedar/Admin.c @@ -10334,7 +10334,7 @@ - - Zero(t, sizeof(RPC_READ_LOG_FILE)); - -- GetExeDir(exe_dir, sizeof(exe_dir)); -+ GetStateDir(exe_dir, sizeof(exe_dir)); - Format(full_path, sizeof(full_path), "%s/%s", exe_dir, filepath); - - // Read file + + Zero(t, sizeof(RPC_READ_LOG_FILE)); + +- GetExeDir(exe_dir, sizeof(exe_dir)); ++ GetStateDir(exe_dir, sizeof(exe_dir)); + Format(full_path, sizeof(full_path), "%s/%s", exe_dir, filepath); + + // Read file Index: b/src/Cedar/Command.c =================================================================== --- a/src/Cedar/Command.c +++ b/src/Cedar/Command.c @@ -527,7 +527,7 @@ - UINT i; - - GetExeName(exe, sizeof(exe)); -- GetExeDir(exe_dir, sizeof(exe_dir)); -+ GetStateDir(exe_dir, sizeof(exe_dir)); - - ok = false; - dirs = EnumDir(exe_dir); + UINT i; + + GetExeName(exe, sizeof(exe)); +- GetExeDir(exe_dir, sizeof(exe_dir)); ++ GetStateDir(exe_dir, sizeof(exe_dir)); + + ok = false; + dirs = EnumDir(exe_dir); @@ -552,7 +552,11 @@ - UCHAR *buf; - IO *io; - #ifndef OS_WIN32 -+#ifdef STATE_DIR -+ wchar_t *filename = L"" STATE_DIR L"/vpn_checker_tmp"; -+#else - wchar_t *filename = L"/tmp/vpn_checker_tmp"; -+#endif - #else // OS_WIN32 - wchar_t filename[MAX_PATH]; - CombinePathW(filename, sizeof(filename), MsGetMyTempDirW(), L"vpn_checker_tmp"); + UCHAR *buf; + IO *io; + #ifndef OS_WIN32 ++#ifdef STATE_DIR ++ wchar_t *filename = L"" STATE_DIR L"/vpn_checker_tmp"; ++#else + wchar_t *filename = L"/tmp/vpn_checker_tmp"; ++#endif + #else // OS_WIN32 + wchar_t filename[MAX_PATH]; + CombinePathW(filename, sizeof(filename), MsGetMyTempDirW(), L"vpn_checker_tmp"); Index: b/src/Cedar/Logging.c =================================================================== --- a/src/Cedar/Logging.c +++ b/src/Cedar/Logging.c @@ -508,7 +508,7 @@ - - e = ZeroMalloc(sizeof(ERASER)); - -- GetExeDir(dir, sizeof(dir)); -+ GetStateDir(dir, sizeof(dir)); - - e->Log = log; - e->MinFreeSpace = min_size; + + e = ZeroMalloc(sizeof(ERASER)); + +- GetExeDir(dir, sizeof(dir)); ++ GetStateDir(dir, sizeof(dir)); + + e->Log = log; + e->MinFreeSpace = min_size; Index: b/src/Cedar/Server.c =================================================================== --- a/src/Cedar/Server.c +++ b/src/Cedar/Server.c @@ -1060,7 +1060,7 @@ - hubname = NULL; - } - -- GetExeDir(exe_dir, sizeof(exe_dir)); -+ GetStateDir(exe_dir, sizeof(exe_dir)); - - // Enumerate in the server_log - if (hubname == NULL) + hubname = NULL; + } + +- GetExeDir(exe_dir, sizeof(exe_dir)); ++ GetStateDir(exe_dir, sizeof(exe_dir)); + + // Enumerate in the server_log + if (hubname == NULL) @@ -1134,7 +1134,7 @@ - return; - } - -- GetExeDir(exe_dir, sizeof(exe_dir)); -+ GetStateDir(exe_dir, sizeof(exe_dir)); - Format(dir_full_path, sizeof(dir_full_path), "%s/%s", exe_dir, dirname); - - dir = EnumDir(dir_full_path); + return; + } + +- GetExeDir(exe_dir, sizeof(exe_dir)); ++ GetStateDir(exe_dir, sizeof(exe_dir)); + Format(dir_full_path, sizeof(dir_full_path), "%s/%s", exe_dir, dirname); + + dir = EnumDir(dir_full_path); Index: b/src/Mayaqua/Encrypt.c =================================================================== --- a/src/Mayaqua/Encrypt.c +++ b/src/Mayaqua/Encrypt.c @@ -579,7 +579,7 @@ - return false; - } - -- GetExeDir(dirname, sizeof(dirname)); -+ GetStateDir(dirname, sizeof(dirname)); - - // Search the CRL file - t = EnumDir(dirname); + return false; + } + +- GetExeDir(dirname, sizeof(dirname)); ++ GetStateDir(dirname, sizeof(dirname)); + + // Search the CRL file + t = EnumDir(dirname); Index: b/src/Mayaqua/FileIO.c =================================================================== --- a/src/Mayaqua/FileIO.c +++ b/src/Mayaqua/FileIO.c @@ -122,8 +122,14 @@ - #include - #include - -+#ifdef STATE_DIR -+static char exe_file_name[MAX_SIZE] = STATE_DIR "/a.out"; -+static wchar_t exe_file_name_w[MAX_SIZE] = L"" STATE_DIR L"/a.out"; -+#else - static char exe_file_name[MAX_SIZE] = "/tmp/a.out"; - static wchar_t exe_file_name_w[MAX_SIZE] = L"/tmp/a.out"; -+#endif -+ - static LIST *hamcore = NULL; - static IO *hamcore_io = NULL; - + #include + #include + ++#ifdef STATE_DIR ++static char exe_file_name[MAX_SIZE] = STATE_DIR "/a.out"; ++static wchar_t exe_file_name_w[MAX_SIZE] = L"" STATE_DIR L"/a.out"; ++#else + static char exe_file_name[MAX_SIZE] = "/tmp/a.out"; + static wchar_t exe_file_name_w[MAX_SIZE] = L"/tmp/a.out"; ++#endif ++ + static LIST *hamcore = NULL; + static IO *hamcore_io = NULL; + @@ -1038,7 +1044,7 @@ - } - - // If the file exist in hamcore/ directory on the local disk, read it -- GetExeDirW(exe_dir, sizeof(exe_dir)); -+ GetStateDirW(exe_dir, sizeof(exe_dir)); - - UniFormat(tmp, sizeof(tmp), L"%s/%S/%S", exe_dir, HAMCORE_DIR_NAME, filename); - + } + + // If the file exist in hamcore/ directory on the local disk, read it +- GetExeDirW(exe_dir, sizeof(exe_dir)); ++ GetStateDirW(exe_dir, sizeof(exe_dir)); + + UniFormat(tmp, sizeof(tmp), L"%s/%S/%S", exe_dir, HAMCORE_DIR_NAME, filename); + @@ -1154,7 +1160,7 @@ - return; - } - -- GetExeDirW(exe_dir, sizeof(exe_dir)); -+ GetStateDirW(exe_dir, sizeof(exe_dir)); - UniFormat(tmp, sizeof(tmp), L"%s/%S", exe_dir, HAMCORE_FILE_NAME); - - UniFormat(tmp2, sizeof(tmp2), L"%s/%S", exe_dir, HAMCORE_FILE_NAME_2); + return; + } + +- GetExeDirW(exe_dir, sizeof(exe_dir)); ++ GetStateDirW(exe_dir, sizeof(exe_dir)); + UniFormat(tmp, sizeof(tmp), L"%s/%S", exe_dir, HAMCORE_FILE_NAME); + + UniFormat(tmp2, sizeof(tmp2), L"%s/%S", exe_dir, HAMCORE_FILE_NAME_2); @@ -1438,6 +1444,33 @@ - GetDirNameFromFilePathW(name, size, exe_file_name_w); - } - -+void GetStateDir(char *name, UINT size) -+{ -+ // Validate arguments -+ if (name == NULL) -+ { -+ return; -+ } -+#ifdef STATE_DIR -+ StrCpy(name, size, STATE_DIR); -+#else -+ GetExeDir(name, size) -+#endif -+} -+void GetStateDirW(wchar_t *name, UINT size) -+{ -+ // Validate arguments -+ if (name == NULL) -+ { -+ return; -+ } -+#ifdef STATE_DIR -+ UniStrCpy(name, size, L"" STATE_DIR L""); -+#else -+ GetExeDirW(name, size) -+#endif -+} -+ - // Get the EXE file name - void GetExeName(char *name, UINT size) - { + GetDirNameFromFilePathW(name, size, exe_file_name_w); + } + ++void GetStateDir(char *name, UINT size) ++{ ++ // Validate arguments ++ if (name == NULL) ++ { ++ return; ++ } ++#ifdef STATE_DIR ++ StrCpy(name, size, STATE_DIR); ++#else ++ GetExeDir(name, size) ++#endif ++} ++void GetStateDirW(wchar_t *name, UINT size) ++{ ++ // Validate arguments ++ if (name == NULL) ++ { ++ return; ++ } ++#ifdef STATE_DIR ++ UniStrCpy(name, size, L"" STATE_DIR L""); ++#else ++ GetExeDirW(name, size) ++#endif ++} ++ + // Get the EXE file name + void GetExeName(char *name, UINT size) + { @@ -2389,7 +2422,7 @@ - else - { - wchar_t dir[MAX_SIZE]; -- GetExeDirW(dir, sizeof(dir)); -+ GetStateDirW(dir, sizeof(dir)); - ConbinePathW(dst, size, dir, &src[1]); - } - } + else + { + wchar_t dir[MAX_SIZE]; +- GetExeDirW(dir, sizeof(dir)); ++ GetStateDirW(dir, sizeof(dir)); + ConbinePathW(dst, size, dir, &src[1]); + } + } Index: b/src/Mayaqua/FileIO.h =================================================================== --- a/src/Mayaqua/FileIO.h +++ b/src/Mayaqua/FileIO.h @@ -349,6 +349,8 @@ - void GetExeNameW(wchar_t *name, UINT size); - void GetExeDir(char *name, UINT size); - void GetExeDirW(wchar_t *name, UINT size); -+void GetStateDir(char *name, UINT size); -+void GetStateDirW(wchar_t *name, UINT size); - void BuildHamcore(char *dst_filename, char *src_dir, bool unix_only); - int CompareHamcore(void *p1, void *p2); - void InitHamcore(); + void GetExeNameW(wchar_t *name, UINT size); + void GetExeDir(char *name, UINT size); + void GetExeDirW(wchar_t *name, UINT size); ++void GetStateDir(char *name, UINT size); ++void GetStateDirW(wchar_t *name, UINT size); + void BuildHamcore(char *dst_filename, char *src_dir, bool unix_only); + int CompareHamcore(void *p1, void *p2); + void InitHamcore(); Index: b/src/Mayaqua/Mayaqua.c =================================================================== --- a/src/Mayaqua/Mayaqua.c +++ b/src/Mayaqua/Mayaqua.c @@ -611,7 +611,11 @@ - _exit(0); - } - -+#ifndef STATE_DIR -+ // This check causes hamcorebuilder to fail in an unprivileged -+ // environment, and is unnecessary for a managed installation. - CheckUnixTempDir(); -+#endif - - // Initialization of Probe - InitProbe(); + _exit(0); + } + ++#ifndef STATE_DIR ++ // This check causes hamcorebuilder to fail in an unprivileged ++ // environment, and is unnecessary for a managed installation. + CheckUnixTempDir(); ++#endif + + // Initialization of Probe + InitProbe(); Index: b/src/Mayaqua/Table.c =================================================================== --- a/src/Mayaqua/Table.c +++ b/src/Mayaqua/Table.c @@ -1191,7 +1191,7 @@ - return; - } - -- GetExeDirW(exe, sizeof(exe)); -+ GetStateDirW(exe, sizeof(exe)); - UniStrCpy(hashtemp, sizeof(hashtemp), strfilename); - BinToStrW(tmp, sizeof(tmp), filehash, MD5_SIZE); - UniStrCat(hashtemp, sizeof(hashtemp), tmp); + return; + } + +- GetExeDirW(exe, sizeof(exe)); ++ GetStateDirW(exe, sizeof(exe)); + UniStrCpy(hashtemp, sizeof(hashtemp), strfilename); + BinToStrW(tmp, sizeof(tmp), filehash, MD5_SIZE); + UniStrCat(hashtemp, sizeof(hashtemp), tmp); @@ -1204,7 +1204,11 @@ - UniStrLower(tmp); - - #ifndef OS_WIN32 -+#ifdef STATE_DIR -+ UniStrCpy(exe, sizeof(exe), L"" STATE_DIR L""); -+#else - UniStrCpy(exe, sizeof(exe), L"/tmp"); -+#endif - #else // OS_WIN32 - StrToUni(exe, sizeof(exe), MsGetTempDir()); - #endif // OS_WIN32 + UniStrLower(tmp); + + #ifndef OS_WIN32 ++#ifdef STATE_DIR ++ UniStrCpy(exe, sizeof(exe), L"" STATE_DIR L""); ++#else + UniStrCpy(exe, sizeof(exe), L"/tmp"); ++#endif + #else // OS_WIN32 + StrToUni(exe, sizeof(exe), MsGetTempDir()); + #endif // OS_WIN32 Index: b/src/Mayaqua/Unix.c =================================================================== --- a/src/Mayaqua/Unix.c +++ b/src/Mayaqua/Unix.c @@ -928,7 +928,7 @@ - StrCpy(tmp, sizeof(tmp), instance_name); - } - -- GetExeDir(dir, sizeof(dir)); -+ GetStateDir(dir, sizeof(dir)); - - // File name generation - Format(name, sizeof(name), "%s/.%s", dir, tmp); + StrCpy(tmp, sizeof(tmp), instance_name); + } + +- GetExeDir(dir, sizeof(dir)); ++ GetStateDir(dir, sizeof(dir)); + + // File name generation + Format(name, sizeof(name), "%s/.%s", dir, tmp); @@ -2260,7 +2260,7 @@ - return; - } - -- GetExeDir(dir, sizeof(dir)); -+ GetStateDir(dir, sizeof(dir)); - - GetExeName(exe_name, sizeof(exe_name)); - StrCat(exe_name, sizeof(exe_name), ":pid_hash"); + return; + } + +- GetExeDir(dir, sizeof(dir)); ++ GetStateDir(dir, sizeof(dir)); + + GetExeName(exe_name, sizeof(exe_name)); + StrCat(exe_name, sizeof(exe_name), ":pid_hash"); @@ -2305,7 +2305,7 @@ - return; - } - -- GetExeDir(dir, sizeof(dir)); -+ GetStateDir(dir, sizeof(dir)); - - GetExeName(exe_name, sizeof(exe_name)); - StrCat(exe_name, sizeof(exe_name), ":pid_hash"); + return; + } + +- GetExeDir(dir, sizeof(dir)); ++ GetStateDir(dir, sizeof(dir)); + + GetExeName(exe_name, sizeof(exe_name)); + StrCat(exe_name, sizeof(exe_name), ":pid_hash"); Index: b/src/bin/hamcore/Makefile.am =================================================================== --- a/src/bin/hamcore/Makefile.am diff --git a/buildroot/package/softether/0004-create-non-forking-softetherd-for-upstart-and-systemd.patch b/buildroot/package/softether/0004-create-non-forking-softetherd-for-upstart-and-systemd.patch index f28876d5f..72913b0bf 100644 --- a/buildroot/package/softether/0004-create-non-forking-softetherd-for-upstart-and-systemd.patch +++ b/buildroot/package/softether/0004-create-non-forking-softetherd-for-upstart-and-systemd.patch @@ -57,13 +57,13 @@ Index: b/src/bin/hamcore/strtable_en.stb --- a/src/bin/hamcore/strtable_en.stb +++ b/src/bin/hamcore/strtable_en.stb @@ -1062,6 +1062,7 @@ - - - # Concerning services (UNIX) -+UNIX_DAEMON_HELP SoftEther VPN non-forking daemon for upstart and systemd.\nCommand Usage:\n %S vpnbridge - Enable bridging features.\n %S vpnclient - Enable client features.\n %S vpnserver - Enable all features.\nThe parameter can be set in the SOFTETHER_MODE environment variable.\n\n - UNIX_SVC_HELP %S service program\nCopyright (c) SoftEther VPN Project. All Rights Reserved.\n\n%S command usage:\n %S start - Start the %S service.\n %S stop - Stop the %S service if the service has been already started.\n\n - UNIX_SVC_STARTED The %S service has been started.\n - UNIX_SVC_STOPPING Stopping the %S service ...\n + + + # Concerning services (UNIX) ++UNIX_DAEMON_HELP SoftEther VPN non-forking daemon for upstart and systemd.\nCommand Usage:\n %S vpnbridge - Enable bridging features.\n %S vpnclient - Enable client features.\n %S vpnserver - Enable all features.\nThe parameter can be set in the SOFTETHER_MODE environment variable.\n\n + UNIX_SVC_HELP %S service program\nCopyright (c) SoftEther VPN Project. All Rights Reserved.\n\n%S command usage:\n %S start - Start the %S service.\n %S stop - Stop the %S service if the service has been already started.\n\n + UNIX_SVC_STARTED The %S service has been started.\n + UNIX_SVC_STOPPING Stopping the %S service ...\n Index: b/src/softetherd/Makefile.am =================================================================== --- /dev/null diff --git a/buildroot/package/softether/0005-change-GetExeDir-to-GetStateDir-in-Cedar-and-Mayaqua.patch b/buildroot/package/softether/0005-change-GetExeDir-to-GetStateDir-in-Cedar-and-Mayaqua.patch index 0c39a60a5..6cb4e728b 100644 --- a/buildroot/package/softether/0005-change-GetExeDir-to-GetStateDir-in-Cedar-and-Mayaqua.patch +++ b/buildroot/package/softether/0005-change-GetExeDir-to-GetStateDir-in-Cedar-and-Mayaqua.patch @@ -29,62 +29,62 @@ Index: b/src/Cedar/Protocol.c --- a/src/Cedar/Protocol.c +++ b/src/Cedar/Protocol.c @@ -161,10 +161,10 @@ - UINT i; - DIRLIST *dir; - wchar_t dirname[MAX_SIZE]; -- wchar_t exedir[MAX_SIZE]; -+ wchar_t statedir[MAX_SIZE]; - -- GetExeDirW(exedir, sizeof(exedir)); -- CombinePathW(dirname, sizeof(dirname), exedir, L"chain_certs"); -+ GetStateDirW(statedir, sizeof(statedir)); -+ CombinePathW(dirname, sizeof(dirname), statedir, L"chain_certs"); - MakeDirExW(dirname); - - if (auto_save) + UINT i; + DIRLIST *dir; + wchar_t dirname[MAX_SIZE]; +- wchar_t exedir[MAX_SIZE]; ++ wchar_t statedir[MAX_SIZE]; + +- GetExeDirW(exedir, sizeof(exedir)); +- CombinePathW(dirname, sizeof(dirname), exedir, L"chain_certs"); ++ GetStateDirW(statedir, sizeof(statedir)); ++ CombinePathW(dirname, sizeof(dirname), statedir, L"chain_certs"); + MakeDirExW(dirname); + + if (auto_save) @@ -461,7 +461,7 @@ - void AddAllChainCertsToCertList(LIST *o) - { - wchar_t dirname[MAX_SIZE]; -- wchar_t exedir[MAX_SIZE]; -+ wchar_t statedir[MAX_SIZE]; - DIRLIST *dir; - // Validate arguments - if (o == NULL) + void AddAllChainCertsToCertList(LIST *o) + { + wchar_t dirname[MAX_SIZE]; +- wchar_t exedir[MAX_SIZE]; ++ wchar_t statedir[MAX_SIZE]; + DIRLIST *dir; + // Validate arguments + if (o == NULL) @@ -469,9 +469,9 @@ - return; - } - -- GetExeDirW(exedir, sizeof(exedir)); -+ GetStateDirW(statedir, sizeof(statedir)); - -- CombinePathW(dirname, sizeof(dirname), exedir, L"chain_certs"); -+ CombinePathW(dirname, sizeof(dirname), statedir, L"chain_certs"); - - MakeDirExW(dirname); - + return; + } + +- GetExeDirW(exedir, sizeof(exedir)); ++ GetStateDirW(statedir, sizeof(statedir)); + +- CombinePathW(dirname, sizeof(dirname), exedir, L"chain_certs"); ++ CombinePathW(dirname, sizeof(dirname), statedir, L"chain_certs"); + + MakeDirExW(dirname); + Index: b/src/Mayaqua/Network.c =================================================================== --- a/src/Mayaqua/Network.c +++ b/src/Mayaqua/Network.c @@ -12588,7 +12588,7 @@ - void AddChainSslCertOnDirectory(struct ssl_ctx_st *ctx) - { - wchar_t dirname[MAX_SIZE]; -- wchar_t exedir[MAX_SIZE]; -+ wchar_t statedir[MAX_SIZE]; - wchar_t txtname[MAX_SIZE]; - DIRLIST *dir; - LIST *o; + void AddChainSslCertOnDirectory(struct ssl_ctx_st *ctx) + { + wchar_t dirname[MAX_SIZE]; +- wchar_t exedir[MAX_SIZE]; ++ wchar_t statedir[MAX_SIZE]; + wchar_t txtname[MAX_SIZE]; + DIRLIST *dir; + LIST *o; @@ -12602,9 +12602,9 @@ - - o = NewListFast(NULL); - -- GetExeDirW(exedir, sizeof(exedir)); -+ GetStateDirW(statedir, sizeof(statedir)); - -- CombinePathW(dirname, sizeof(dirname), exedir, L"chain_certs"); -+ CombinePathW(dirname, sizeof(dirname), statedir, L"chain_certs"); - - MakeDirExW(dirname); - + + o = NewListFast(NULL); + +- GetExeDirW(exedir, sizeof(exedir)); ++ GetStateDirW(statedir, sizeof(statedir)); + +- CombinePathW(dirname, sizeof(dirname), exedir, L"chain_certs"); ++ CombinePathW(dirname, sizeof(dirname), statedir, L"chain_certs"); + + MakeDirExW(dirname); + diff --git a/buildroot/package/softether/0007-iconv.patch b/buildroot/package/softether/0007-iconv.patch index 5f4e3ddb3..09d7777e4 100644 --- a/buildroot/package/softether/0007-iconv.patch +++ b/buildroot/package/softether/0007-iconv.patch @@ -9,20 +9,20 @@ Index: b/src/Mayaqua/Mayaqua.h --- a/src/Mayaqua/Mayaqua.h +++ b/src/Mayaqua/Mayaqua.h @@ -282,17 +282,7 @@ - #include - #endif // MAYAQUA_SUPPORTS_GETIFADDRS - --#ifdef UNIX_LINUX --typedef void *iconv_t; --iconv_t iconv_open (__const char *__tocode, __const char *__fromcode); --size_t iconv (iconv_t __cd, char **__restrict __inbuf, -- size_t *__restrict __inbytesleft, -- char **__restrict __outbuf, -- size_t *__restrict __outbytesleft); --int iconv_close (iconv_t __cd); --#else // UNIX_LINUX - #include --#endif // UNIX_LINUX - - - + #include + #endif // MAYAQUA_SUPPORTS_GETIFADDRS + +-#ifdef UNIX_LINUX +-typedef void *iconv_t; +-iconv_t iconv_open (__const char *__tocode, __const char *__fromcode); +-size_t iconv (iconv_t __cd, char **__restrict __inbuf, +- size_t *__restrict __inbytesleft, +- char **__restrict __outbuf, +- size_t *__restrict __outbytesleft); +-int iconv_close (iconv_t __cd); +-#else // UNIX_LINUX + #include +-#endif // UNIX_LINUX + + + diff --git a/buildroot/package/softether/0009-uclibc-ai-addrconfig.patch b/buildroot/package/softether/0009-uclibc-ai-addrconfig.patch index 9236fa779..7d8f1c67c 100644 --- a/buildroot/package/softether/0009-uclibc-ai-addrconfig.patch +++ b/buildroot/package/softether/0009-uclibc-ai-addrconfig.patch @@ -14,14 +14,14 @@ Index: b/src/Mayaqua/Mayaqua.h --- a/src/Mayaqua/Mayaqua.h +++ b/src/Mayaqua/Mayaqua.h @@ -235,9 +235,11 @@ - #ifdef OS_UNIX - #ifndef UNIX_SOLARIS - #ifndef CPU_SH4 -+#if !defined(__UCLIBC__) || defined(__UCLIBC_SUPPORT_AI_ADDRCONFIG__) - // Getifaddrs system call is supported on UNIX other than Solaris. - // However, it is not supported also by the Linux on SH4 CPU - #define MAYAQUA_SUPPORTS_GETIFADDRS -+#endif // !UCLIBC || UCLIBC_SUPPORT_AI_ADDRCONFIG - #endif // CPU_SH4 - #endif // UNIX_SOLARIS - #endif // OS_UNIX + #ifdef OS_UNIX + #ifndef UNIX_SOLARIS + #ifndef CPU_SH4 ++#if !defined(__UCLIBC__) || defined(__UCLIBC_SUPPORT_AI_ADDRCONFIG__) + // Getifaddrs system call is supported on UNIX other than Solaris. + // However, it is not supported also by the Linux on SH4 CPU + #define MAYAQUA_SUPPORTS_GETIFADDRS ++#endif // !UCLIBC || UCLIBC_SUPPORT_AI_ADDRCONFIG + #endif // CPU_SH4 + #endif // UNIX_SOLARIS + #endif // OS_UNIX diff --git a/buildroot/package/sp-oops-extract/0002-stdint-cleanup.patch b/buildroot/package/sp-oops-extract/0002-stdint-cleanup.patch index 70317a768..255fe8a8c 100644 --- a/buildroot/package/sp-oops-extract/0002-stdint-cleanup.patch +++ b/buildroot/package/sp-oops-extract/0002-stdint-cleanup.patch @@ -10,24 +10,24 @@ Index: sp-oops-extract-0.0.7-1/src/oopslog.c --- sp-oops-extract-0.0.7-1.orig/src/oopslog.c +++ sp-oops-extract-0.0.7-1/src/oopslog.c @@ -64,8 +64,8 @@ static int try_to_check_for_bad_blocks(v - - int main(const int argc, const char *argv[]) - { -- u_int32_t *count, maxcount = 0xffffffff; -- u_int32_t *magic_ptr, magic_value = 0x5d005d00; -+ uint32_t *count, maxcount = 0xffffffff; -+ uint32_t *magic_ptr, magic_value = 0x5d005d00; - - unsigned char *charbuf; - unsigned long size; + + int main(const int argc, const char *argv[]) + { +- u_int32_t *count, maxcount = 0xffffffff; +- u_int32_t *magic_ptr, magic_value = 0x5d005d00; ++ uint32_t *count, maxcount = 0xffffffff; ++ uint32_t *magic_ptr, magic_value = 0x5d005d00; + + unsigned char *charbuf; + unsigned long size; @@ -137,8 +137,8 @@ int main(const int argc, const char *arg - errx(-1, "%s is something weird", device); - - charbuf = buf; -- count = (u_int32_t *) buf; -- magic_ptr = (u_int32_t *) (buf + sizeof(u_int32_t)); -+ count = (uint32_t *) buf; -+ magic_ptr = (uint32_t *) (buf + sizeof(uint32_t)); - - for (i = 0; i < (size / OOPS_PAGE_SIZE); i++) { - pread(fd, buf, OOPS_PAGE_SIZE, i * OOPS_PAGE_SIZE); + errx(-1, "%s is something weird", device); + + charbuf = buf; +- count = (u_int32_t *) buf; +- magic_ptr = (u_int32_t *) (buf + sizeof(u_int32_t)); ++ count = (uint32_t *) buf; ++ magic_ptr = (uint32_t *) (buf + sizeof(uint32_t)); + + for (i = 0; i < (size / OOPS_PAGE_SIZE); i++) { + pread(fd, buf, OOPS_PAGE_SIZE, i * OOPS_PAGE_SIZE); diff --git a/buildroot/package/transmission/0001-fix-utypes.patch b/buildroot/package/transmission/0001-fix-utypes.patch index e67ba6aa0..96403a6c3 100644 --- a/buildroot/package/transmission/0001-fix-utypes.patch +++ b/buildroot/package/transmission/0001-fix-utypes.patch @@ -10,12 +10,12 @@ Signed-off-by: Bernd Kuhls --- transmission-2.82.org/third-party/libutp/utypes.h 2013-08-09 04:47:43.000000000 +0200 +++ transmission-2.82/third-party/libutp/utypes.h 2014-01-02 20:17:18.000000000 +0100 @@ -35,8 +35,15 @@ - typedef const char * cstr; - typedef char * str; - --#ifndef __cplusplus --typedef uint8 bool; --#endif + typedef const char * cstr; + typedef char * str; + +-#ifndef __cplusplus +-typedef uint8 bool; +-#endif +//#ifndef __cplusplus +//typedef uint8 bool; +//#endif @@ -26,5 +26,5 @@ Signed-off-by: Bernd Kuhls +typedef uint8 bool; +#endif +#endif - - #endif //__UTYPES_H__ + + #endif //__UTYPES_H__ diff --git a/buildroot/package/urg/0001-select-h.patch b/buildroot/package/urg/0001-select-h.patch index 630f24737..1d09bb57b 100644 --- a/buildroot/package/urg/0001-select-h.patch +++ b/buildroot/package/urg/0001-select-h.patch @@ -29,11 +29,11 @@ Index: b/src/cpp/connection/SerialDevice_lin.cpp --- a/src/cpp/connection/SerialDevice_lin.cpp +++ b/src/cpp/connection/SerialDevice_lin.cpp @@ -13,7 +13,7 @@ - #include - #include - #include -- -+#include - - class RawSerialDevice - { + #include + #include + #include +- ++#include + + class RawSerialDevice + { diff --git a/buildroot/package/urg/0002-urg-gcc6-fix-narrowing-conversion.patch b/buildroot/package/urg/0002-urg-gcc6-fix-narrowing-conversion.patch index 11ad65bf4..e3db89804 100644 --- a/buildroot/package/urg/0002-urg-gcc6-fix-narrowing-conversion.patch +++ b/buildroot/package/urg/0002-urg-gcc6-fix-narrowing-conversion.patch @@ -8,92 +8,92 @@ Signed-off-by: Samuel Martin --- a/src/cpp/urg/ScipHandler.cpp 2016-09-11 16:11:16.083995214 +0200 +++ b/src/cpp/urg/ScipHandler.cpp 2016-09-11 16:11:24.380832543 +0200 @@ -120,7 +120,7 @@ struct ScipHandler::pImpl - - // QT ̔s - int return_code = -1; -- char qt_expected_response[] = { 0, -1 }; -+ char qt_expected_response[] = { 0, (char)-1 }; - // return_code g߁AsetLaserOutput() p QT 𑗐M - if (response(return_code, "QT\n", qt_expected_response)) { - laser_state_ = LaserOff; + + // QT ̔s + int return_code = -1; +- char qt_expected_response[] = { 0, -1 }; ++ char qt_expected_response[] = { 0, (char)-1 }; + // return_code g߁AsetLaserOutput() p QT 𑗐M + if (response(return_code, "QT\n", qt_expected_response)) { + laser_state_ = LaserOff; @@ -139,7 +139,7 @@ struct ScipHandler::pImpl - - } else if (return_code == Scip11Response) { - // SCIP1.1 vgȐꍇ̂݁ASCIP2.0 𑗐M -- char scip20_expected_response[] = { 0, -1 }; -+ char scip20_expected_response[] = { 0, (char)-1 }; - if (! response(return_code, "SCIP2.0\n", scip20_expected_response)) { - error_message_ = - "SCIP1.1 protocol is not supported. Please update URG firmware, or reconnect after a few seconds because sensor is booting."; + + } else if (return_code == Scip11Response) { + // SCIP1.1 vgȐꍇ̂݁ASCIP2.0 𑗐M +- char scip20_expected_response[] = { 0, -1 }; ++ char scip20_expected_response[] = { 0, (char)-1 }; + if (! response(return_code, "SCIP2.0\n", scip20_expected_response)) { + error_message_ = + "SCIP1.1 protocol is not supported. Please update URG firmware, or reconnect after a few seconds because sensor is booting."; @@ -150,7 +150,7 @@ struct ScipHandler::pImpl - - } else if (return_code == 0xE) { - // TM [hƂ݂ȂATM2 𔭍s -- char tm2_expected_response[] = { 0, -1 }; -+ char tm2_expected_response[] = { 0, (char)-1 }; - if (response(return_code, "TM2\n", tm2_expected_response)) { - laser_state_ = LaserOff; - return changeBothBaudrate(baudrate); + + } else if (return_code == 0xE) { + // TM [hƂ݂ȂATM2 𔭍s +- char tm2_expected_response[] = { 0, -1 }; ++ char tm2_expected_response[] = { 0, (char)-1 }; + if (response(return_code, "TM2\n", tm2_expected_response)) { + laser_state_ = LaserOff; + return changeBothBaudrate(baudrate); @@ -202,7 +202,7 @@ struct ScipHandler::pImpl - snprintf(send_buffer, 10, "SS%06ld\n", baudrate); - int return_code = -1; - // !!! ɐݒΏۂ̃{[[gȀꍇ̖߂l ss_expected... ɒlj -- char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, -1 }; -+ char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, (char)-1 }; - if (! response(return_code, send_buffer, ss_expected_response)) { - error_message_ = "Baudrate change fail."; - return false; + snprintf(send_buffer, 10, "SS%06ld\n", baudrate); + int return_code = -1; + // !!! ɐݒΏۂ̃{[[gȀꍇ̖߂l ss_expected... ɒlj +- char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, -1 }; ++ char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, (char)-1 }; + if (! response(return_code, send_buffer, ss_expected_response)) { + error_message_ = "Baudrate change fail."; + return false; @@ -216,7 +216,7 @@ struct ScipHandler::pImpl - { - // PP ̑Mƃf[^̎M - int return_code = -1; -- char pp_expected_response[] = { 0, -1 }; -+ char pp_expected_response[] = { 0, (char)-1 }; - vector lines; - if (! response(return_code, "PP\n", pp_expected_response, &lines)) { - error_message_ = "PP fail."; + { + // PP ̑Mƃf[^̎M + int return_code = -1; +- char pp_expected_response[] = { 0, -1 }; ++ char pp_expected_response[] = { 0, (char)-1 }; + vector lines; + if (! response(return_code, "PP\n", pp_expected_response, &lines)) { + error_message_ = "PP fail."; @@ -356,7 +356,7 @@ struct ScipHandler::pImpl - - if (on) { - int return_code = -1; -- char expected_response[] = { 0, -1 }; -+ char expected_response[] = { 0, (char)-1 }; - if (! response(return_code, "BM\n", expected_response)) { - error_message_ = "BM fail."; - return false; + + if (on) { + int return_code = -1; +- char expected_response[] = { 0, -1 }; ++ char expected_response[] = { 0, (char)-1 }; + if (! response(return_code, "BM\n", expected_response)) { + error_message_ = "BM fail."; + return false; @@ -369,7 +369,7 @@ struct ScipHandler::pImpl - if (! mx_capturing_) { - // 邽߂ QT ł́A҂‚ׂ - int return_code = -1; -- char qt_expected_response[] = { 0, -1 }; -+ char qt_expected_response[] = { 0, (char)-1 }; - if (! response(return_code, "QT\n", qt_expected_response)) { - return false; - } + if (! mx_capturing_) { + // 邽߂ QT ł́A҂‚ׂ + int return_code = -1; +- char qt_expected_response[] = { 0, -1 }; ++ char qt_expected_response[] = { 0, (char)-1 }; + if (! response(return_code, "QT\n", qt_expected_response)) { + return false; + } @@ -777,7 +777,7 @@ bool ScipHandler::loadParameter(RangeSen - bool ScipHandler::versionLines(vector& lines) - { - int return_code = -1; -- char expected_response[] = { 0, -1 }; -+ char expected_response[] = { 0, (char)-1 }; - if (! pimpl->response(return_code, "VV\n", expected_response, &lines)) { - return false; - } + bool ScipHandler::versionLines(vector& lines) + { + int return_code = -1; +- char expected_response[] = { 0, -1 }; ++ char expected_response[] = { 0, (char)-1 }; + if (! pimpl->response(return_code, "VV\n", expected_response, &lines)) { + return false; + } @@ -792,7 +792,7 @@ bool ScipHandler::setRawTimestampMode(bo - - // TM0 or TM2 ̑M - int return_code = -1; -- char expected_response[] = { 0, -1 }; -+ char expected_response[] = { 0, (char)-1 }; - if (! pimpl->response(return_code, send_command, expected_response)) { - pimpl->error_message_ = (on) ? "TM0 fail." : "TM2 fail."; - return false; + + // TM0 or TM2 ̑M + int return_code = -1; +- char expected_response[] = { 0, -1 }; ++ char expected_response[] = { 0, (char)-1 }; + if (! pimpl->response(return_code, send_command, expected_response)) { + pimpl->error_message_ = (on) ? "TM0 fail." : "TM2 fail."; + return false; @@ -809,7 +809,7 @@ bool ScipHandler::rawTimestamp(int* time - { - // TM1 ̒lԂ - int return_code = -1; -- char expected_response[] = { 0, -1 }; -+ char expected_response[] = { 0, (char)-1 }; - vector lines; - if (! pimpl->response(return_code, "TM1\n", expected_response, &lines)) { - pimpl->error_message_ = "TM1 fail."; + { + // TM1 ̒lԂ + int return_code = -1; +- char expected_response[] = { 0, -1 }; ++ char expected_response[] = { 0, (char)-1 }; + vector lines; + if (! pimpl->response(return_code, "TM1\n", expected_response, &lines)) { + pimpl->error_message_ = "TM1 fail."; diff --git a/buildroot/package/xen/xen.hash b/buildroot/package/xen/xen.hash index fa4d25bab..5daebd4d6 100644 --- a/buildroot/package/xen/xen.hash +++ b/buildroot/package/xen/xen.hash @@ -1,2 +1,3 @@ # Locally computed -sha256 0262a7023f8b12bcacfb0b25e69b2a63291f944f7683d54d8f33d4b2ca556844 xen-4.10.0.tar.gz +sha256 570d654f357d4085accdf752989c1cbc33e2075feac8fcc505d68bdb81b1a0cf xen-4.10.1.tar.gz +sha256 dba0d79260259c013c52e5d4daeaea564a2fbb9ff7fc6778c377a401ec3898de COPYING diff --git a/buildroot/package/xen/xen.mk b/buildroot/package/xen/xen.mk index 1b741a90f..29699cf0f 100644 --- a/buildroot/package/xen/xen.mk +++ b/buildroot/package/xen/xen.mk @@ -4,7 +4,7 @@ # ################################################################################ -XEN_VERSION = 4.10.0 +XEN_VERSION = 4.10.1 XEN_SITE = https://downloads.xenproject.org/release/xen/$(XEN_VERSION) XEN_LICENSE = GPL-2.0 XEN_LICENSE_FILES = COPYING diff --git a/buildroot/package/xfsprogs/0001-mdrestore-do-not-do-dynamic-linking-of-libtool-libra.patch b/buildroot/package/xfsprogs/0001-mdrestore-do-not-do-dynamic-linking-of-libtool-libra.patch index 74636c2eb..9030a2aac 100644 --- a/buildroot/package/xfsprogs/0001-mdrestore-do-not-do-dynamic-linking-of-libtool-libra.patch +++ b/buildroot/package/xfsprogs/0001-mdrestore-do-not-do-dynamic-linking-of-libtool-libra.patch @@ -14,6 +14,8 @@ Signed-off-by: Vicente Olivert Riera [Sent upstream: https://www.spinics.net/lists/xfs/msg36149.html] [baruch: update for v4.15.1; extend to include scrub] Signed-off-by: Baruch Siach +[matt: update for v4.16.1; adjusted libunistring -> libicu] +Signed-off-by: Matt Weber --- mdrestore/Makefile | 2 +- scrub/Makefile | 2 +- @@ -38,8 +40,8 @@ index 063279400262..949f6fd8ba94 100644 +++ b/scrub/Makefile @@ -70,7 +70,7 @@ xfs_scrub.c - LLDLIBS += $(LIBHANDLE) $(LIBFROG) $(LIBPTHREAD) $(LIBUNISTRING) $(LIBRT) - LTDEPENDENCIES += $(LIBHANDLE) $(LIBFROG) $(LIBUNISTRING) $(LIBRT) + LLDLIBS += $(LIBHANDLE) $(LIBFROG) $(LIBPTHREAD) $(LIBICU_LIBS) $(LIBRT) + LTDEPENDENCIES += $(LIBHANDLE) $(LIBFROG) -LLDFLAGS = -static +LLDFLAGS = -static-libtool-libs diff --git a/buildroot/package/xfsprogs/0003-workqueue-add-missing-pthreads-header.patch b/buildroot/package/xfsprogs/0003-workqueue-add-missing-pthreads-header.patch deleted file mode 100644 index e19261f03..000000000 --- a/buildroot/package/xfsprogs/0003-workqueue-add-missing-pthreads-header.patch +++ /dev/null @@ -1,41 +0,0 @@ -From c05fc32d43b3870b63539c57428e1c52e3e7c3cd Mon Sep 17 00:00:00 2001 -From: Baruch Siach -Date: Fri, 16 Mar 2018 07:14:56 +0200 -Subject: [PATCH] workqueue: add missing pthreads header - -Fix the following build failure with musl libc: - -In file included from read_verify.c:25:0: -../include/workqueue.h:39:2: error: unknown type name 'pthread_t' - pthread_t *threads; - ^~~~~~~~~ -../include/workqueue.h:42:2: error: unknown type name 'pthread_mutex_t' - pthread_mutex_t lock; - ^~~~~~~~~~~~~~~ -../include/workqueue.h:43:2: error: unknown type name 'pthread_cond_t' - pthread_cond_t wakeup; - ^~~~~~~~~~~~~~ - -Signed-off-by: Baruch Siach ---- -Upstream status: https://marc.info/?l=linux-xfs&m=152117771313565&w=2 - - include/workqueue.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/include/workqueue.h b/include/workqueue.h -index b4b3541701df..edb2f8ac5991 100644 ---- a/include/workqueue.h -+++ b/include/workqueue.h -@@ -22,6 +22,8 @@ - #ifndef _WORKQUEUE_H_ - #define _WORKQUEUE_H_ - -+#include -+ - struct workqueue; - - typedef void workqueue_func_t(struct workqueue *wq, uint32_t index, void *arg); --- -2.16.2 - diff --git a/buildroot/package/xfsprogs/0004-xfs_scrub-add-missing-paths-header.patch b/buildroot/package/xfsprogs/0004-xfs_scrub-add-missing-paths-header.patch deleted file mode 100644 index 7695cf35a..000000000 --- a/buildroot/package/xfsprogs/0004-xfs_scrub-add-missing-paths-header.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 27747dcbfbde8a767b1a873716fce1d3aaf17c2f Mon Sep 17 00:00:00 2001 -From: Baruch Siach -Date: Fri, 16 Mar 2018 07:16:19 +0200 -Subject: [PATCH] xfs_scrub: add missing paths header -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fix the following build failure with musl libc: - -xfs_scrub.c: In function ‘main’: -xfs_scrub.c:670:11: error: ‘_PATH_MOUNTED’ undeclared (first use in this function) - mtab = _PATH_MOUNTED; - ^~~~~~~~~~~~~ - -Signed-off-by: Baruch Siach ---- -Upstream status: https://marc.info/?l=linux-xfs&m=152117771313566&w=2 - - scrub/xfs_scrub.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c -index ab26e6335948..eedbe34ec7b3 100644 ---- a/scrub/xfs_scrub.c -+++ b/scrub/xfs_scrub.c -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - #include - #include - #include --- -2.16.2 - diff --git a/buildroot/package/xfsprogs/0005-xfs_scrub-fix-cross-compile-with-libunistring.patch b/buildroot/package/xfsprogs/0005-xfs_scrub-fix-cross-compile-with-libunistring.patch deleted file mode 100644 index dfb66c663..000000000 --- a/buildroot/package/xfsprogs/0005-xfs_scrub-fix-cross-compile-with-libunistring.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 45d9ba0f01cceb75f72d157a9e4d9aaeb753a9c4 Mon Sep 17 00:00:00 2001 -From: Baruch Siach -Date: Tue, 20 Mar 2018 14:13:28 +0200 -Subject: [PATCH] xfs_scrub: fix cross compile with libunistring - -Commit 4bbed4ecc2a (xfs_scrub: warn about normalized Unicode name collisions) -added -lunistring to the list of the xfs_scrub dependencies. When cross -compiling make fails to find the library on the target sysroot: - -make[3]: *** No rule to make target `-lunistring', needed by `xfs_scrub'. Stop. - -Remove -lunistring from make dependencies of xfs_scrub to fix that. - -Cc: Darrick J. Wong -Signed-off-by: Baruch Siach ---- -Upstream status: https://patchwork.kernel.org/patch/10296957/ - - scrub/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scrub/Makefile b/scrub/Makefile -index 949f6fd8ba94..979603f524ff 100644 ---- a/scrub/Makefile -+++ b/scrub/Makefile -@@ -69,7 +69,7 @@ vfs.c \ - xfs_scrub.c - - LLDLIBS += $(LIBHANDLE) $(LIBFROG) $(LIBPTHREAD) $(LIBUNISTRING) $(LIBRT) --LTDEPENDENCIES += $(LIBHANDLE) $(LIBFROG) $(LIBUNISTRING) $(LIBRT) -+LTDEPENDENCIES += $(LIBHANDLE) $(LIBFROG) $(LIBRT) - LLDFLAGS = -static-libtool-libs - - ifeq ($(HAVE_MALLINFO),yes) --- -2.16.2 - diff --git a/buildroot/package/xfsprogs/0006-xfs_scrub-fix-build-with-older-kernel-headers.patch b/buildroot/package/xfsprogs/0006-xfs_scrub-fix-build-with-older-kernel-headers.patch deleted file mode 100644 index 9e1300d0c..000000000 --- a/buildroot/package/xfsprogs/0006-xfs_scrub-fix-build-with-older-kernel-headers.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 7ea1df02d0f2549b6249c8bee1f6ae02bf1251a9 Mon Sep 17 00:00:00 2001 -From: Baruch Siach -Date: Sun, 25 Mar 2018 00:01:23 +0300 -Subject: [PATCH] xfs_scrub: fix build with older kernel headers - -The OVERRIDE_SYSTEM_FSXATTR macro in include/linux.h is meant to -override the linux/fs.h kernel header provided struct fsxattr for -kernels older than v4.7. A few source files include linux/fs.h before -the local linux.h, making this override ineffective. Remove these header -includes from the source files, and rely on the linux.h include alone. - -This fixes the following build failures: - -In file included from ../include/xfs.h:37:0, - from disk.c:40: -../include/xfs/linux.h:185:8: error: redefinition of 'struct fsxattr' - struct fsxattr { - ^~~~~~~ - -In file included from ../include/xfs.h:37:0, - from ../include/project.h:22, - from ../include/input.h:24, - from phase1.c:38: -../include/xfs/linux.h:185:8: error: redefinition of 'struct fsxattr' - struct fsxattr { - ^~~~~~~ - -Cc: Darrick J. Wong -Signed-off-by: Baruch Siach ---- -Upstream status: https://patchwork.kernel.org/patch/10306419/ - - scrub/disk.c | 1 - - scrub/phase1.c | 1 - - 2 files changed, 2 deletions(-) - -diff --git a/scrub/disk.c b/scrub/disk.c -index e12175c8656c..54d7a2a77c45 100644 ---- a/scrub/disk.c -+++ b/scrub/disk.c -@@ -28,7 +28,6 @@ - #include - #include - #include --#include - #ifdef HAVE_SG_IO - # include - #endif -diff --git a/scrub/phase1.c b/scrub/phase1.c -index 6cd544233c94..d15689e1b544 100644 ---- a/scrub/phase1.c -+++ b/scrub/phase1.c -@@ -32,7 +32,6 @@ - #include - #include - #include --#include - #include "libfrog.h" - #include "workqueue.h" - #include "input.h" --- -2.16.2 - diff --git a/buildroot/package/xfsprogs/xfsprogs.hash b/buildroot/package/xfsprogs/xfsprogs.hash index c58dbb076..4df2e8d9e 100644 --- a/buildroot/package/xfsprogs/xfsprogs.hash +++ b/buildroot/package/xfsprogs/xfsprogs.hash @@ -1,3 +1,3 @@ # From https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/sha256sums.asc -sha256 27c36de9346a274143ad06c65b2fdbafd2806f3f37fa2c1235a08ed920d2bf3c xfsprogs-4.15.1.tar.xz +sha256 3d5c2da46112b86cbd967fee43cea731d38a1b2aaf601b57674ed34e808652df xfsprogs-4.16.1.tar.xz sha256 ee304b1b1da08b261f1d1f31d229fc70d2d0c552c7429e9e84c0fac878d94209 doc/COPYING diff --git a/buildroot/package/xfsprogs/xfsprogs.mk b/buildroot/package/xfsprogs/xfsprogs.mk index dffcc28ab..814e0cf21 100644 --- a/buildroot/package/xfsprogs/xfsprogs.mk +++ b/buildroot/package/xfsprogs/xfsprogs.mk @@ -4,7 +4,7 @@ # ################################################################################ -XFSPROGS_VERSION = 4.15.1 +XFSPROGS_VERSION = 4.16.1 XFSPROGS_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/fs/xfs/xfsprogs XFSPROGS_SOURCE = xfsprogs-$(XFSPROGS_VERSION).tar.xz XFSPROGS_LICENSE = GPL-2.0, GPL-2.0+, LGPL-2.1 (libhandle, few headers) @@ -20,8 +20,11 @@ XFSPROGS_CONF_OPTS = \ INSTALL_GROUP=root \ --enable-static -ifeq ($(BR2_PACKAGE_LIBUNISTRING),y) -XFSPROGS_DEPENDENCIES += libunistring +ifeq ($(BR2_PACKAGE_ICU),y) +XFSPROGS_DEPENDENCIES += icu +XFSPROGS_CONF_OPTS += --enable-libicu +else +XFSPROGS_CONF_OPTS += --disable-libicu endif XFSPROGS_INSTALL_TARGET_OPTS = DIST_ROOT=$(TARGET_DIR) install diff --git a/buildroot/support/download/cvs b/buildroot/support/download/cvs index 3f77b849e..9d0dc3cb3 100755 --- a/buildroot/support/download/cvs +++ b/buildroot/support/download/cvs @@ -33,9 +33,13 @@ done shift $((OPTIND-1)) # Get rid of our options # Caller needs to single-quote its arguments to prevent them from -# being expanded a second time (in case there are spaces in them) +# being expanded a second time (in case there are spaces in them). +# If the CVS server is deadlocked, the client will never return (cfr. +# http://autobuild.buildroot.net/results/23d/23d1034b33d0354de15de2ec4a8ccd0603e8db78/build-end.log +# ). Since nobody sane will put large code bases in CVS, a timeout of +# 10 minutes should do the trick. _cvs() { - eval ${CVS} "${@}" + eval timeout 10m ${CVS} "${@}" } if [[ ${rev} =~ ^[0-9] ]]; then diff --git a/buildroot/support/misc/Vagrantfile b/buildroot/support/misc/Vagrantfile index 54b45da69..cca0a3db3 100644 --- a/buildroot/support/misc/Vagrantfile +++ b/buildroot/support/misc/Vagrantfile @@ -5,7 +5,7 @@ ################################################################################ # Buildroot version to use -RELEASE='2018.02' +RELEASE='2018.05' ### Change here for more memory/cores ### VM_MEMORY=2048 diff --git a/buildroot/toolchain/Config.in b/buildroot/toolchain/Config.in index 2479a6587..ebd84509f 100644 --- a/buildroot/toolchain/Config.in +++ b/buildroot/toolchain/Config.in @@ -84,6 +84,12 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_64735 default y if BR2_m68k_cf5208 depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_7 +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180. This bug no +# longer exists in gcc 8.x. +config BR2_TOOLCHAIN_HAS_GCC_BUG_85180 + bool + default y if BR2_microblaze + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85862 # An infinite loop exists in the find_base_term() logic of 6.x # on microblaze. http://autobuild.buildroot.net/results/158e8ebb39713e1b436a5cc1a1916f46c30694df/