Hello community, here is the log from the commit of package iucode-tool for openSUSE:Factory checked in at 2017-10-27 14:00:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/iucode-tool (Old) and /work/SRC/openSUSE:Factory/.iucode-tool.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "iucode-tool" Fri Oct 27 14:00:20 2017 rev:5 rq:535176 version:2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/iucode-tool/iucode-tool.changes 2017-04-12 18:11:44.207961821 +0200 +++ /work/SRC/openSUSE:Factory/.iucode-tool.new/iucode-tool.changes 2017-10-27 14:00:22.314960804 +0200 @@ -1,0 +2,21 @@ +Thu Oct 19 10:22:46 UTC 2017 - [email protected] + +- Update to version 2.2: + * configure.ac: whitespace fixes + * configure: minor cosmetic fixes + * configure: default build to hardened -O3 PIE with lots of warnings + * configure.ac: add --enable-extend-flags to change default build flags + * README: add an example of microcode with multiple sigs + * iucode_tool: ensure printf %x args are unsigned + * intel_microcode: declare intel_ucode_errstr() as const + * iucode_tool: use fprintf(stdout) instead of printf() + * intel_microcode: do not request inlining for is_zero_checksum() + * configure.ac: support libargp as an alternative to glibc argp + * iucode_tool: rename and document some xx_xtsdeduplist* functions + * iucode_tool: fix microcode count when selecting extended signatures + * intel_microcode: fast-track intel_ucode_compare(a, a) + * configure.ac: fix handling of --without-foo/--disable-bar + * README: update for mixed dat and bin Intel releases + * Ready for release: v2.2 + +------------------------------------------------------------------- Old: ---- iucode-tool-2.1.2.tar.xz New: ---- iucode-tool-2.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ iucode-tool.spec ++++++ --- /var/tmp/diff_new_pack.uuVYNx/_old 2017-10-27 14:00:24.454860773 +0200 +++ /var/tmp/diff_new_pack.uuVYNx/_new 2017-10-27 14:00:24.458860586 +0200 @@ -17,7 +17,7 @@ Name: iucode-tool -Version: 2.1.2 +Version: 2.2 Release: 0 Summary: A program to manipulate Intel microcode update collections License: GPL-2.0 @@ -27,7 +27,6 @@ BuildRequires: autoconf BuildRequires: automake BuildRequires: xz -BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: %{ix86} x86_64 %description @@ -47,7 +46,6 @@ %make_install %files -%defattr(-,root,root) %doc COPYING README %{_sbindir}/iucode_tool %{_mandir}/man8/iucode_tool.8%{ext_man} ++++++ _service ++++++ --- /var/tmp/diff_new_pack.uuVYNx/_old 2017-10-27 14:00:24.490859090 +0200 +++ /var/tmp/diff_new_pack.uuVYNx/_new 2017-10-27 14:00:24.494858903 +0200 @@ -4,8 +4,8 @@ <param name="scm">git</param> <param name="changesgenerate">enable</param> <param name="filename">iucode-tool</param> - <param name="revision">refs/tags/v2.1.2</param> - <param name="version">2.1.2</param> + <param name="revision">refs/tags/v2.2</param> + <param name="version">2.2</param> </service> <service mode="disabled" name="recompress"> <param name="file">*.tar</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.uuVYNx/_old 2017-10-27 14:00:24.514857968 +0200 +++ /var/tmp/diff_new_pack.uuVYNx/_new 2017-10-27 14:00:24.514857968 +0200 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">https://gitlab.com/iucode-tool/iucode-tool.git</param> - <param name="changesrevision">ff3f90f4855dacfe22727d100e7abe0a7a68c7cc</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">3d05f5b913703893795fe04338285444b8e7ebe1</param></service></servicedata> \ No newline at end of file ++++++ iucode-tool-2.1.2.tar.xz -> iucode-tool-2.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/ChangeLog new/iucode-tool-2.2/ChangeLog --- old/iucode-tool-2.1.2/ChangeLog 2017-02-15 23:34:22.000000000 +0100 +++ new/iucode-tool-2.2/ChangeLog 2017-08-28 16:40:04.000000000 +0200 @@ -1,3 +1,35 @@ +2017-08-28, iucode_tool v2.2 + + * README: update for mixed dat and bin Intel releases + * configure: fix handling of --without-foo/--disable-bar + * intel_microcode: fast-track intel_ucode_compare(a, a) + * iucode_tool: fix microcode count when selecting extended signatures + * iucode_tool: rename and document some xx_xtsdeduplist* functions + * configure: support libargp as an alternative to glibc argp + * intel_microcode: do not request inlining for is_zero_checksum() + * iucode_tool: use fprintf(stdout) instead of printf() + * intel_microcode: declare intel_ucode_errstr() as const + * iucode_tool: ensure printf %x args are unsigned + * README: add an example of microcode with multiple sigs + * configure: add --enable-extend-flags to change default build flags + Add a way to not completely override the C/CPP/LDFLAGS configure.ac + would like to set. + * configure: default build to hardened -O3 PIE with lots of warnings + Override the autoconf default CFLAGS, CPPFLAGS and LDFLAGS for a more + optimized, hardened build by default. Also, print the value of these + variables in configure output. The standard methods to override the + default CFLAGS, CPPFLAGS and LDFLAGS in configure still work, and will + bypass the new defaults. Linux distros that override these on every build + should not see any changes. Should the compiler not be detected as + gcc-compatible, no change to CFLAGS/CPPFLAGS/LDFLAGS will be made. Note + that clang is explicitly supported, and works just fine. The build will + default to a baseline of "-O3 -g" and will attempt to selectively enable + several warning options, and several hardening options. configure will + attempt to detect the set of compiler and linker driver flags that would + work. Caveats: autoconf 2.69 and automake 1.13 or later are now + required. + * configure: whitespace fixes and minor cosmetic fixes + 2017-02-15, iucode_tool v2.1.2 * iucode_tool: compare payloads of similar (not just duplicate) MCUs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/NEWS new/iucode-tool-2.2/NEWS --- old/iucode-tool-2.1.2/NEWS 2017-02-15 23:34:22.000000000 +0100 +++ new/iucode-tool-2.2/NEWS 2017-08-28 16:40:04.000000000 +0200 @@ -1,3 +1,12 @@ +v2.2: + * build infrastructure changes: autoconf 2.69 or later, and + automake 1.13 or later are now required. The configure script + will attempt to auto-detect and enable several warning and + hardening options by default if CFLAGS/LDFLAGS are *unset*, or if + given the new --enable-extend-flags option. "-O3" optimization + mode will be used by default. The usual ways to override *FLAGS + are respected by configure and the Makefile. + v2.1.1: * Fix CVE-2017-0357: iucode_tool: heap buffer overflow on -tr loader diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/README new/iucode-tool-2.2/README --- old/iucode-tool-2.1.2/README 2017-02-15 23:34:22.000000000 +0100 +++ new/iucode-tool-2.2/README 2017-08-28 16:40:04.000000000 +0200 @@ -2,8 +2,8 @@ iucode_tool - IntelĀ® 64 and IA-32 processor microcode tool - Version 2.1.2 - February 15th, 2017 + Version 2.2 + August 28th, 2017 https://gitlab.com/iucode-tool @@ -41,9 +41,11 @@ Updating the system processor microcode: The Intel-distributed microcode bundle contains microcode update data for -several processor models. It uses a text format which is unsuitable to be -used directly by the Linux kernel: it must be converted by an utility like -iucode_tool before Linux can use it. +several processor models. Older microcode releases used a text format +which is unsuitable to be used directly by the Linux kernel: it must be +converted by an utility like iucode_tool before Linux can use it. Newer +releases have the same microcode update content both in the legacy text +format, and in binary format. Updating the processor microcode is a process that can be done at any time (even with the system at full load), and as many times as required. It is @@ -227,17 +229,30 @@ iucode_tool -L /usr/share/misc/intel-microcode.dat microcode bundle 1: /usr/share/misc/intel-microcode.dat - 01/001: sig 0x00000683, pf_mask 0x01, 2001-02-06, rev 0x0013, size 2048 - 01/002: sig 0x00000f4a, pf_mask 0x5c, 2005-12-14, rev 0x0004, size 2048 - 01/003: sig 0x00000653, pf_mask 0x04, 1999-05-20, rev 0x000b, size 2048 + 001/001: sig 0x00000683, pf_mask 0x01, 2001-02-06, rev 0x0013, size 2048 + 001/002: sig 0x00000f4a, pf_mask 0x5c, 2005-12-14, rev 0x0004, size 2048 + 001/003: sig 0x00000653, pf_mask 0x04, 1999-05-20, rev 0x000b, size 2048 ... The first and third microcode updates are for very specific processor models (a single combination of processor flags, each, as they only have -one bit set in the pf_mask field). The second microcode update applies -to several processors that share the same family, model and stepping, but -have different processor flags (more than one bit set in the pf_mask -field). The processor flags and pf_mask field are explained below. +one bit set in the pf_mask field). The second microcode update applies to +several processors that share the same family, model and stepping, but have +different processor flags (more than one bit set in the pf_mask field). The +processor flags and pf_mask field are explained below. + +iucode_tool -L s000406A8_m00000001_r0000081F.fw + +microcode bundle 1: s000406A8_m00000001_r0000081F.fw + 001/001: sig 0x000406a8, pf_mask 0x01, 2014-08-12, rev 0x081f, size 38912 + sig 0x000406a8, pf_mask 0x01, 2014-08-12, rev 0x081f + sig 0x000406a9, pf_mask 0x01, 2014-08-12, rev 0x081f + +This is a microcode update with multiple signatures. At least one of the +signatures will typically be a duplicate. iucode_tool will act on each +signature (list, select, etc) as if they were independent, but when writing +out the microcode, all of its signatures will be included. It will not +output more than a single copy of the microcode to the same output file. Microcode revisions: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/configure.ac new/iucode-tool-2.2/configure.ac --- old/iucode-tool-2.1.2/configure.ac 2017-02-15 23:34:22.000000000 +0100 +++ new/iucode-tool-2.2/configure.ac 2017-08-28 16:40:04.000000000 +0200 @@ -1,4 +1,4 @@ -dnl Process this file with autoconf to produce a configure script. +dnl Process this file with autoconf 2.69+ to produce a configure script. dnl dnl Copyright (c) 2010-2017 Henrique de Moraes Holschuh dnl @@ -17,16 +17,54 @@ dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA AC_PREREQ([2.69]) -AC_INIT([iucode_tool], [2.1.2], - [https://gitlab.com/iucode-tool/iucode-tool/issues], - [iucode-tool], - [https://gitlab.com/iucode-tool/iucode-tool/wikis/home]) +AC_INIT([iucode_tool], [2.2], + [https://gitlab.com/iucode-tool/iucode-tool/issues], + [iucode-tool], + [https://gitlab.com/iucode-tool/iucode-tool/wikis/home]) AC_COPYRIGHT([Copyright (c) 2010-2017 Henrique de Moraes Holschuh]) AC_CONFIG_SRCDIR([iucode_tool.c]) AC_CANONICAL_HOST -AM_INIT_AUTOMAKE([1.11 gnu no-dist-gzip dist-xz -Wall]) +AM_INIT_AUTOMAKE([1.13 gnu no-dist-gzip dist-xz -Wall]) AC_CONFIG_HEADERS([iucode_tool_config.h]) +AC_CONFIG_MACRO_DIR([m4]) + +dnl Work around the lack of a way to set preferred *FLAGS +AC_ARG_ENABLE([extend-flags], + [AC_HELP_STRING([--enable-extend-flags], + [force configure to extend already-defined C/CPP/LDFLAGS])], + [ + AC_MSG_NOTICE([will extend C/CPP/LDFLAGS]) + enable_cflags_setting=yes + enable_cppflags_setting=yes + enable_ldflags_setting=yes + enable_extend_flags=yes + ], + [ + AC_MSG_CHECKING([whether configure.ac should try to override CFLAGS]) + if test "x${CFLAGS+set}" = xset; then + enable_cflags_setting=no + else + enable_cflags_setting=yes + fi + AC_MSG_RESULT($enable_cflags_setting) + + dnl AC_MSG_CHECKING([whether configure.ac should try to override CPPFLAGS]) + dnl if test "x${CPPFLAGS+set}" = xset; then + dnl enable_cppflags_setting=no + dnl else + dnl enable_cppflags_setting=yes + dnl fi + dnl AC_MSG_RESULT($enable_cppflags_setting) + + AC_MSG_CHECKING([whether configure.ac should try to override LDFLAGS]) + if test "x${LDFLAGS+set}" = xset; then + enable_ldflags_setting=no + else + enable_ldflags_setting=yes + fi + AC_MSG_RESULT($enable_ldflags_setting) + ]) dnl Before we get to the C compiler... AC_USE_SYSTEM_EXTENSIONS @@ -56,6 +94,10 @@ AC_FUNC_STAT AC_CHECK_FUNCS([memset strcasecmp strdup strerror strrchr strtoul timegm]) +# Allow GNU Argp as a standalone lib, as an alternative to glibc +AC_SEARCH_LIBS([argp_parse], [argp], [], + [AC_ERROR([An implementation of GNU Argp was not found, please install libargp])]) + dnl important system extensions AC_SYS_LARGEFILE AC_CHECK_FUNCS([flockfile fgets_unlocked]) @@ -67,40 +109,217 @@ AC_ARG_WITH([default-kernel-device], [AS_HELP_STRING([--with-default-kernel-device=PATH], [default microcode device (/dev/cpu/microcode)])], - [MICROCODE_DEVICE_DEFAULT="$withval"], + [AS_IF([test "x$withval" = "x" || test "x$withval" = "xno"], + [AC_ERROR([--without-kernel-device build unsupported])], + [MICROCODE_DEVICE_DEFAULT="$withval"])], [MICROCODE_DEVICE_DEFAULT="/dev/cpu/microcode"]) -AC_DEFINE_UNQUOTED(MICROCODE_DEVICE_DEFAULT, "$MICROCODE_DEVICE_DEFAULT",[Path to kernel microcode device]) +AC_DEFINE_UNQUOTED(MICROCODE_DEVICE_DEFAULT, "$MICROCODE_DEVICE_DEFAULT", + [Path to kernel microcode device]) AC_SUBST(MICROCODE_DEVICE_DEFAULT) AC_ARG_WITH([default-firmware-dir], [AS_HELP_STRING([--with-default-firmware-dir=PATH], [default firmware loader directory (/lib/firmware/intel-ucode)])], - [MICROCODE_DIR_DEFAULT="$withval"], + [AS_IF([test "x$withval" = "x" || test "x$withval" = "xno"], + [AC_ERROR([--without-default-firmware-dir build unsupported])], + [MICROCODE_DIR_DEFAULT="$withval"])], [MICROCODE_DIR_DEFAULT="/lib/firmware/intel-ucode"]) -AC_DEFINE_UNQUOTED(MICROCODE_DIR_DEFAULT, "$MICROCODE_DIR_DEFAULT",[Path to the kernel microcode firmware directory]) +AC_DEFINE_UNQUOTED(MICROCODE_DIR_DEFAULT, "$MICROCODE_DIR_DEFAULT", + [Path to the kernel microcode firmware directory]) AC_SUBST(MICROCODE_DIR_DEFAULT) AC_ARG_WITH([cpuid-device-base], [AS_HELP_STRING([--with-cpuid-device-base=PATH_FORMAT], [per-cpu cpuid device path (/dev/cpu/%u/cpuid)])], - [CPUID_DEVICE_BASE="$withval"], + [AS_IF([test "x$withval" = "x" || test "x$withval" = "xno"], + [AC_ERROR([use --disable-cpuid-device instead of --without-cpuid-device-base])], + [CPUID_DEVICE_BASE="$withval"])], [CPUID_DEVICE_BASE="/dev/cpu/%u/cpuid"]) -AC_DEFINE_UNQUOTED(CPUID_DEVICE_BASE, "$CPUID_DEVICE_BASE",[fprintf base string to the per-cpu cpuid device]) +AC_DEFINE_UNQUOTED(CPUID_DEVICE_BASE, "$CPUID_DEVICE_BASE", + [fprintf base string to the per-cpu cpuid device]) AC_SUBST(CPUID_DEVICE_BASE) AC_ARG_ENABLE([cpuid-device], [AS_HELP_STRING([--enable-cpuid-device], [use Linux cpuid device and check all cores])], - [AC_DEFINE(USE_CPUID_DEVICE, [], [Scan every core using Linux cpuid device])]) + [AS_IF([test "x$enableval" != "xno"], + [AC_DEFINE(USE_CPUID_DEVICE, [], [Scan every core using Linux cpuid device])]) + ]) AC_ARG_ENABLE([valgrind-build], [AS_HELP_STRING([--enable-valgrind-build], [build for valgrind testing])], - [AC_DEFINE(VALGRIND_BUILD, [], [Valgrind-friendly build])]) + [AS_IF([test "x$enableval" != "xno"], + [AC_DEFINE(VALGRIND_BUILD, [], [Valgrind-friendly build])]) + ]) + +dnl ------------------------------------------- +dnl Override hardcoded *FLAGS for GCC and Clang +dnl If this breaks your platform, file a bug +dnl ------------------------------------------- + +dnl Do it after most of the autoconf crap, as they tend to screw +dnl up when you have anything more complex than -O2 -g for CFLAGS. + +dnl We could do most of these overrides through AM_*FLAGS, but +dnl that's a pain for distros and users to override (as in it breaks +dnl 'make CFLAGS="-O0"') and only to be used for stuff that is +dnl absolutely essential to the build. + +dnl if test "${GCC}${enable_cppflags_setting}" = "yesyes" ; then +dnl CPPFLAGS="<whatever>" +dnl fi +if test "x${GCC}${enable_cflags_setting}" = "xyesyes" ; then + dnl in "extend mode", we will get either user-supplied, + dnl or the autoconf-default CFLAGS + if test "x${enable_extend_flags}" != "xyes"; then + CFLAGS="-O3 -g" + fi + + dnl We need to detect -Wunknown-warning without the use of -Werror. + dnl -Werror would be unsafe, as it might eventually trigger on the + dnl test source code. + dnl + dnl clang needs "-Werror=unknown-warning-option". + dnl gcc exits with an error when trying to enable unknown warnings. + AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option], + [CFLAGSERRUW="-Werror=unknown-warning-option"], + [], + [], + [AC_LANG_SOURCE([[ + int + main(void) + { + + ; + return 0; + } + ]])]) + + dnl gcc and clang warnings the code is not supposed to trigger... + AX_APPEND_COMPILE_FLAGS( + [-Wall -Wextra -Wformat=2 -Werror=format-security dnl + -Wformat-signedness -Wformat-overflow=2 -Wformat-truncation=2 dnl + -Wtrampolines -Wcast-align -Wsign-conversion -Wnull-dereference dnl + -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations dnl + -Wredundant-decls -Wstrict-overflow -Winit-self -Wshadow dnl + -Wrestrict -Wpointer-arith -Wlogical-op -Wbad-function-cast dnl + -Wwrite-strings -Wduplicated-branches -Wduplicated-cond dnl + -Walloca -Wvla -Walloc-zero -Walloc-size-larger-than=1073741824], + [], + [${CFLAGSERRUW}], + [AC_LANG_SOURCE([[ + int + main(void) + { + + ; + return 0; + } + ]])]) + + dnl Do not move _FORTIFY_SOURCE to CPPFLAGS, otherwise bad things + dnl happen when the user does 'make CFLAGS="-O0 -g"'. Debian/Ubuntu + dnl have fixes for this, but others don't. We keep it in CFLAGS + dnl where it will get overriden along with -O3/-O2. + AC_MSG_CHECKING([whether _FORTIFY_SOURCE is already enabled]) + AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ + int + main(void) { + #ifndef _FORTIFY_SOURCE + return 0; + #else + #error _FORTIFY_SOURCE already defined + #endif + } + ]])], + [ + AC_MSG_RESULT([no]) + dnl gcc manual says to avoid -Wp,-D like the plague and use + dnl -D/-U directly. + AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2], [], [], + [AC_LANG_SOURCE([[ + int + main(int argc, char *argv[]) + { + char arr[64], *dst = arr, *src = argv[0]; + if (argc && src) { while (*src) { *dst++ = *src++; } } + return 0; + } + ]])]) + ], + [ + AC_MSG_RESULT([yes]) + ]) + + AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong -Wstack-protector], + [], + [], + [AC_LANG_SOURCE([[ + int + main(int argc, char *argv[]) + { + char arr[64], *dst = arr, *src = argv[0]; + if (argc && src) { while (*src) { *dst++ = *src++; } } + return 0; + } + ]])]) +fi +if test "x${GCC}${enable_ldflags_setting}" = "xyesyes" ; then + AX_APPEND_LINK_FLAGS([-Wl,-z,relro -Wl,-z,now], [], [], + [AC_LANG_SOURCE([[ + int + main(int argc, char *argv[]) + { + char arr[64], *dst = arr, *src = argv[0]; + if (argc && src) { while (*src) { *dst++ = *src++; } } + return 0; + } + ]])]) +fi +if test "x${GCC}${enable_ldflags_setting}${enable_cflags_setting}" = "xyesyesyes" ; then + AC_MSG_NOTICE([checking for Position Independent Executables (PIE) support]) + OCFLAGS="${CFLAGS}" + AX_CHECK_COMPILE_FLAG([-fPIE], + [ + CFLAGS="${CFLAGS} -fPIE" + AX_CHECK_LINK_FLAG([-fPIE -pie], + [LDFLAGS="${LDFLAGS} -fPIE -pie" + AC_MSG_NOTICE([PIE generation enabled])], + [CFLAGS="${OCFLAGS}" + AC_MSG_NOTICE([PIE generation not supported by linker])], + [], + [AC_LANG_SOURCE([[ + int + main(void) + { + + ; + return 0; + } + ]])]) + ], + [AC_MSG_NOTICE([PIE generation not supported by compiler])], + [], + [AC_LANG_SOURCE([[ + int + main(void) + { + + ; + return 0; + } + ]])]) +fi dnl -------------------------- dnl autoconf output generation dnl -------------------------- +AC_MSG_NOTICE([project-wide base CPPFLAGS: $CPPFLAGS]) +AC_MSG_NOTICE([project-wide base CFLAGS: $CFLAGS]) +AC_MSG_NOTICE([project-wide base LDFLAGS: $LDFLAGS]) + AC_CONFIG_FILES([Makefile iucode_tool.8]) AC_OUTPUT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/intel_microcode.c new/iucode-tool-2.2/intel_microcode.c --- old/iucode-tool-2.1.2/intel_microcode.c 2017-02-15 23:34:22.000000000 +0100 +++ new/iucode-tool-2.2/intel_microcode.c 2017-08-28 16:40:04.000000000 +0200 @@ -244,6 +244,9 @@ if (unlikely((hdr1->hdrver != 1) || (hdr2->hdrver != 1))) return -EINVAL; + if (unlikely(uc1 == uc2)) + return 2; + ts1 = intel_ucode_v1_get_totalsize(hdr1); ts2 = intel_ucode_v1_get_totalsize(hdr2); if (ts1 != ts2) @@ -285,6 +288,7 @@ */ const char * intel_ucode_errstr(const intel_ucode_status_t status) { + /* warning: this is an __attribute__((const)) function! */ switch (status) { case INTEL_UCODE_INVALID_DATA: return "invalid microcode data"; @@ -311,7 +315,7 @@ } } -static inline int is_zero_checksum(const uint8_t *data, uint32_t dwords) +static int is_zero_checksum(const uint8_t *data, uint32_t dwords) { uint32_t s = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/intel_microcode.h new/iucode-tool-2.2/intel_microcode.h --- old/iucode-tool-2.1.2/intel_microcode.h 2017-02-15 23:34:22.000000000 +0100 +++ new/iucode-tool-2.2/intel_microcode.h 2017-08-28 16:40:04.000000000 +0200 @@ -73,7 +73,7 @@ #define intel_ucode_sigmatch(s1, s2, p1, p2) \ (((s1) == (s2)) && (((p1) & (p2)) || (((p1) == 0) && ((p2) == 0)))) -const char * intel_ucode_errstr(const intel_ucode_status_t status); +const char * intel_ucode_errstr(const intel_ucode_status_t status) __attribute__((const)); intel_ucode_status_t intel_ucode_check_microcode(const void * const uc, const size_t maxlen, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/iucode_tool.c new/iucode-tool-2.2/iucode_tool.c --- old/iucode-tool-2.1.2/iucode_tool.c 2017-02-15 23:34:22.000000000 +0100 +++ new/iucode-tool-2.2/iucode_tool.c 2017-08-28 16:40:04.000000000 +0200 @@ -1405,7 +1405,7 @@ print_msg_u("%s: %s microcode " UCODE_ID_FMT_UU " (sig 0x%08x, pf_mask 0x%02x, rev 0x%04x)", devname, action, uce->gid, uce->id, - uce->cpuid, uce->pfm, uce->uc_rev); + uce->cpuid, uce->pfm, (uint32_t) uce->uc_rev); } /** @@ -1550,9 +1550,9 @@ "%08X%08X%08X%08X%08X%08X%08zX%08X%08X%08X%08X%08zX%08X%s", ino, /* inode */ size ? LINUX_CPIO_FILE_MODE : LINUX_CPIO_DIR_MODE, /* mode */ - 0, 0, /* uid, gid */ - size ? 1 : 2, t, size, /* nlink, mtime, size */ - 3, 1, 0, 0, nsize, 0, /* devj, devm, nsize, CRC */ + 0U, 0U, /* uid, gid */ + size ? 1U : 2U, t, size, /* nlink, mtime, size */ + 3U, 1U, 0U, 0U, nsize, 0U, /* devj, devm, nsize, CRC */ name); /* name, pad */ return write_data(fd, buf, bufsize); @@ -2030,8 +2030,34 @@ return 0; } -static int xx_xtsdeduplist_check_and_add(struct intel_uclist_entry * const e, - struct microcode_id_entry **list) +/** + * xtsdeduplist_check_and_add() - track mcu objects for dedup + * + * @e: entry to add signature from to the list + * @list: pointer to the head of the list used to track duplicates + * + * Duplicate tracking is done by storing and comparing struct + * intel_uclist_entry->uc pointers. This will work _only_ to dedup + * several instances of the same microcode due to extended signature + * processing. + * + * It cannot detect multiple copies of the same data stored in + * multiple objects. + * + * To use: + * Init the list head to NULL. Call xtsdeduplist_check_and_add() for + * every struct intel_uclist_entry element you want to track. + * + * One should use free_xtsdeduplist() to free the tracking list after + * use. + * + * Returns: + * ENOMEM: cannot allocate memory to add entry to list + * EEXIST: entry is a duplicate + * 0: entry is not a duplicate + */ +static int xtsdeduplist_check_and_add(struct intel_uclist_entry * const e, + struct microcode_id_entry **list) { const void *id = e->uc; @@ -2043,7 +2069,14 @@ return xx_xtsdeduplist_add(e, list); } -static void xx_free_xtsdeduplist(struct microcode_id_entry *list) +/** + * free_xtsdeduplist() - frees mcu dedup tracking list + * @list: head of the list to be freed + * + * Frees every element of the list. @list will be invalid + * after this function returns. + */ +static void free_xtsdeduplist(struct microcode_id_entry *list) { struct microcode_id_entry *e; @@ -2066,7 +2099,7 @@ e = uclist; while (e) { if (unlikely(e->flags & INTEL_UCLE_HASXST)) { - rc = xx_xtsdeduplist_check_and_add(e, &dlist); + rc = xtsdeduplist_check_and_add(e, &dlist); if (rc == EEXIST) { e->flags |= INTEL_UCLE_NOWR; } else if (!rc) { @@ -2078,7 +2111,7 @@ e = e->next; } - xx_free_xtsdeduplist(dlist); + free_xtsdeduplist(dlist); return (rc != EEXIST) ? rc : 0; } @@ -2151,7 +2184,8 @@ "pf_mask 0x%02x (entries: " UCODE_ID_FMT_UU " rev 0x%x, and " UCODE_ID_FMT_UU " rev 0x%x)", sig, (pfm & e->pfm), - gid, uclist->id, rev, e->gid, e->id, e->uc_rev); + gid, uclist->id, (uint32_t) rev, + e->gid, e->id, (uint32_t) e->uc_rev); res = EEXIST; } e = e->next; @@ -2202,18 +2236,20 @@ if (list_all_microcodes) { if (!sig_count) - printf(" " UCODE_ID_FMT_UU ": sig 0x%08x, pf_mask 0x%02x, " + fprintf(stdout, + " " UCODE_ID_FMT_UU ": sig 0x%08x, pf_mask 0x%02x, " "%04x-%02x-%02x, rev 0x%04x, size %u\n", ctx->current_bundle->id, ctx->current_uc, cpuid, pf_mask, m.date_year, m.date_month, m.date_day, - m.revision, uc_size); + (uint32_t) m.revision, uc_size); else - printf(" sig 0x%08x, pf_mask 0x%02x, " + fprintf(stdout, + " sig 0x%08x, pf_mask 0x%02x, " "%04x-%02x-%02x, rev 0x%04x\n", cpuid, pf_mask, m.date_year, m.date_month, m.date_day, - m.revision); + (uint32_t) m.revision); } add_status = uclist_add_signature(ctx->current_uc, @@ -2300,7 +2336,7 @@ while (mcb) { if ((list_all_microcodes || list_sel_microcodes) && verbosity > 0) - printf("microcode bundle %u: %s\n", mcb->id, + fprintf(stdout, "microcode bundle %u: %s\n", mcb->id, mcb->filename ? mcb->filename : ""); microcode_iterator_data.current_bundle = mcb; @@ -2334,11 +2370,12 @@ if (list_sel_microcodes || datefilter_loose || verbosity >= 2) { struct intel_uclist_entry *uce = microcodes; struct intel_uclist_entry *ucl = all_microcodes; + struct microcode_id_entry *dl = NULL; unsigned long int uccount = 0; unsigned long int sigcount = 0; if (list_sel_microcodes) - printf("selected microcodes:\n"); + fprintf(stdout, "selected microcodes:\n"); while (uce) { /* @@ -2349,8 +2386,10 @@ xx_datefilter_loose_inplaceinsert(&uce, &ucl))) return 1; - if (likely(!(uce->flags & INTEL_UCLE_EXTSIG))) - uccount++; + /* note: we ignore ENOMEM results for performance */ + if (likely(!(uce->flags & INTEL_UCLE_HASXST) || + !xtsdeduplist_check_and_add(uce, &dl))) + uccount++; sigcount++; @@ -2359,15 +2398,18 @@ if (unlikely(intel_ucode_getmetadata(uce->uc, &m) != INTEL_UCODE_NOERROR)) exit(EXIT_SWFAILURE); /* memory corruption */ - printf(" " UCODE_ID_FMT_UU ": sig 0x%08x, pf_mask 0x%02x, " + fprintf(stdout, + " " UCODE_ID_FMT_UU ": sig 0x%08x, pf_mask 0x%02x, " "%04x-%02x-%02x, rev 0x%04x, size %u\n", uce->gid, uce->id, uce->cpuid, uce->pfm, m.date_year, m.date_month, m.date_day, - m.revision, uce->uc_size); + (uint32_t) m.revision, uce->uc_size); } uce = uce->next; } + + free_xtsdeduplist(dl); print_msg(2, "selected %lu microcode(s), %lu signature(s)", uccount, sigcount); } @@ -2449,7 +2491,7 @@ while (p && !rc) { if (!(p->flags & INTEL_UCLE_DUPSIG)) { snprintf(fn, sizeof(fn), "s%08X_m%08X_r%08X.fw", - p->cpuid, p->pfm, p->uc_rev); + p->cpuid, p->pfm, (uint32_t) p->uc_rev); memcpy(&e, p, sizeof(e)); e.next = NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/m4/ax_append_compile_flags.m4 new/iucode-tool-2.2/m4/ax_append_compile_flags.m4 --- old/iucode-tool-2.1.2/m4/ax_append_compile_flags.m4 1970-01-01 01:00:00.000000000 +0100 +++ new/iucode-tool-2.2/m4/ax_append_compile_flags.m4 2017-08-28 16:40:04.000000000 +0200 @@ -0,0 +1,67 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# For every FLAG1, FLAG2 it is checked whether the compiler works with the +# flag. If it does, the flag is added FLAGS-VARIABLE +# +# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. +# CFLAGS) is used. During the check the flag is always added to the +# current language's flags. +# +# If EXTRA-FLAGS is defined, it is added to the current language's default +# flags (e.g. CFLAGS) when the check is done. The check is thus made with +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to +# force the compiler to issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. +# +# NOTE: This macro depends on the AX_APPEND_FLAG and +# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with +# AX_APPEND_LINK_FLAGS. +# +# LICENSE +# +# Copyright (c) 2011 Maarten Bosmans <[email protected]> +# +# 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 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 5 + +AC_DEFUN([AX_APPEND_COMPILE_FLAGS], +[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) +AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) +for flag in $1; do + AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4]) +done +])dnl AX_APPEND_COMPILE_FLAGS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/m4/ax_append_flag.m4 new/iucode-tool-2.2/m4/ax_append_flag.m4 --- old/iucode-tool-2.1.2/m4/ax_append_flag.m4 1970-01-01 01:00:00.000000000 +0100 +++ new/iucode-tool-2.2/m4/ax_append_flag.m4 2017-08-28 16:40:04.000000000 +0200 @@ -0,0 +1,71 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) +# +# DESCRIPTION +# +# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space +# added in between. +# +# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. +# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains +# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly +# FLAG. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim <[email protected]> +# Copyright (c) 2011 Maarten Bosmans <[email protected]> +# +# 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 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 6 + +AC_DEFUN([AX_APPEND_FLAG], +[dnl +AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF +AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) +AS_VAR_SET_IF(FLAGS,[ + AS_CASE([" AS_VAR_GET(FLAGS) "], + [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], + [ + AS_VAR_APPEND(FLAGS,[" $1"]) + AC_RUN_LOG([: FLAGS="$FLAGS"]) + ]) + ], + [ + AS_VAR_SET(FLAGS,[$1]) + AC_RUN_LOG([: FLAGS="$FLAGS"]) + ]) +AS_VAR_POPDEF([FLAGS])dnl +])dnl AX_APPEND_FLAG diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/m4/ax_append_link_flags.m4 new/iucode-tool-2.2/m4/ax_append_link_flags.m4 --- old/iucode-tool-2.1.2/m4/ax_append_link_flags.m4 1970-01-01 01:00:00.000000000 +0100 +++ new/iucode-tool-2.2/m4/ax_append_link_flags.m4 2017-08-28 16:40:04.000000000 +0200 @@ -0,0 +1,65 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# For every FLAG1, FLAG2 it is checked whether the linker works with the +# flag. If it does, the flag is added FLAGS-VARIABLE +# +# If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is +# used. During the check the flag is always added to the linker's flags. +# +# If EXTRA-FLAGS is defined, it is added to the linker's default flags +# when the check is done. The check is thus made with the flags: "LDFLAGS +# EXTRA-FLAGS FLAG". This can for example be used to force the linker to +# issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. +# +# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG. +# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS. +# +# LICENSE +# +# Copyright (c) 2011 Maarten Bosmans <[email protected]> +# +# 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 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 5 + +AC_DEFUN([AX_APPEND_LINK_FLAGS], +[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) +AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) +for flag in $1; do + AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4]) +done +])dnl AX_APPEND_LINK_FLAGS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/m4/ax_check_compile_flag.m4 new/iucode-tool-2.2/m4/ax_check_compile_flag.m4 --- old/iucode-tool-2.1.2/m4/ax_check_compile_flag.m4 1970-01-01 01:00:00.000000000 +0100 +++ new/iucode-tool-2.2/m4/ax_check_compile_flag.m4 2017-08-28 16:40:04.000000000 +0200 @@ -0,0 +1,74 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the current language's compiler +# or gives an error. (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the current language's default +# flags (e.g. CFLAGS) when the check is done. The check is thus made with +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to +# force the compiler to issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim <[email protected]> +# Copyright (c) 2011 Maarten Bosmans <[email protected]> +# +# 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 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 4 + +AC_DEFUN([AX_CHECK_COMPILE_FLAG], +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" + AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) +AS_VAR_IF(CACHEVAR,yes, + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_COMPILE_FLAGS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/m4/ax_check_link_flag.m4 new/iucode-tool-2.2/m4/ax_check_link_flag.m4 --- old/iucode-tool-2.1.2/m4/ax_check_link_flag.m4 1970-01-01 01:00:00.000000000 +0100 +++ new/iucode-tool-2.2/m4/ax_check_link_flag.m4 2017-08-28 16:40:04.000000000 +0200 @@ -0,0 +1,74 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the linker or gives an error. +# (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the linker's default flags +# when the check is done. The check is thus made with the flags: "LDFLAGS +# EXTRA-FLAGS FLAG". This can for example be used to force the linker to +# issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_LINK_IFELSE. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim <[email protected]> +# Copyright (c) 2011 Maarten Bosmans <[email protected]> +# +# 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 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 4 + +AC_DEFUN([AX_CHECK_LINK_FLAG], +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl +AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS $4 $1" + AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + LDFLAGS=$ax_check_save_flags]) +AS_VAR_IF(CACHEVAR,yes, + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_LINK_FLAGS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iucode-tool-2.1.2/m4/ax_require_defined.m4 new/iucode-tool-2.2/m4/ax_require_defined.m4 --- old/iucode-tool-2.1.2/m4/ax_require_defined.m4 1970-01-01 01:00:00.000000000 +0100 +++ new/iucode-tool-2.2/m4/ax_require_defined.m4 2017-08-28 16:40:04.000000000 +0200 @@ -0,0 +1,37 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_REQUIRE_DEFINED(MACRO) +# +# DESCRIPTION +# +# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have +# been defined and thus are available for use. This avoids random issues +# where a macro isn't expanded. Instead the configure script emits a +# non-fatal: +# +# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found +# +# It's like AC_REQUIRE except it doesn't expand the required macro. +# +# Here's an example: +# +# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) +# +# LICENSE +# +# Copyright (c) 2014 Mike Frysinger <[email protected]> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 1 + +AC_DEFUN([AX_REQUIRE_DEFINED], [dnl + m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) +])dnl AX_REQUIRE_DEFINED
