diff --git a/.gitignore b/.gitignore
index 02a7a19..e3a12ae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-SOURCES/hwloc-1.11.2.tar.bz2
+SOURCES/hwloc-1.11.8.tar.bz2
diff --git a/.hwloc.metadata b/.hwloc.metadata
index 1008f3f..192c95a 100644
--- a/.hwloc.metadata
+++ b/.hwloc.metadata
@@ -1 +1 @@
-3d68de060808f04349538be4e63cde501cd53b0a SOURCES/hwloc-1.11.2.tar.bz2
+5d6164400a49e2c77a7e1e98dd0247a1f7e6d4cf SOURCES/hwloc-1.11.8.tar.bz2
diff --git a/SOURCES/0001-Avoid-letting-snprintf-interpret-process-name-as-for.patch b/SOURCES/0001-Avoid-letting-snprintf-interpret-process-name-as-for.patch
new file mode 100644
index 0000000..74cf3bb
--- /dev/null
+++ b/SOURCES/0001-Avoid-letting-snprintf-interpret-process-name-as-for.patch
@@ -0,0 +1,25 @@
+From 9d6e8bfe26c24df8272d6af782ebbde9ef62acb0 Mon Sep 17 00:00:00 2001
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Wed, 6 Sep 2017 17:35:56 +0200
+Subject: [PATCH] Avoid letting snprintf interpret process name as format
+
+---
+ utils/lstopo/lstopo.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/lstopo/lstopo.c b/utils/lstopo/lstopo.c
+index a23980010d..e9d600d457 100644
+--- a/utils/lstopo/lstopo.c
++++ b/utils/lstopo/lstopo.c
+@@ -229,7 +229,7 @@ static void add_process_objects(hwloc_topology_t topology)
+           if (!parenl) {
+             snprintf(comm, sizeof(comm), "(unknown)");
+           } else {
+-            snprintf(comm, sizeof(comm), parenl+1);
++            snprintf(comm, sizeof(comm), "%s", parenl+1);
+           }
+         }
+ 
+-- 
+2.13.6
+
diff --git a/SOURCES/hwloc-1.11.2-dump-cleanups.patch b/SOURCES/hwloc-1.11.2-dump-cleanups.patch
deleted file mode 100644
index 9c5da11..0000000
--- a/SOURCES/hwloc-1.11.2-dump-cleanups.patch
+++ /dev/null
@@ -1,212 +0,0 @@
-diff -Nrup hwloc-1.11.2.orig/config/hwloc_internal.m4 hwloc-1.11.2/config/hwloc_internal.m4
---- hwloc-1.11.2.orig/config/hwloc_internal.m4	2016-06-06 13:45:07.591491542 -0400
-+++ hwloc-1.11.2/config/hwloc_internal.m4	2016-06-06 14:11:17.698625007 -0400
-@@ -1,6 +1,6 @@
- dnl -*- Autoconf -*-
- dnl
--dnl Copyright © 2009-2014 Inria.  All rights reserved.
-+dnl Copyright © 2009-2016 Inria.  All rights reserved.
- dnl Copyright © 2009, 2011 Université Bordeaux
- dnl Copyright © 2004-2005 The Trustees of Indiana University and Indiana
- dnl                         University Research and Technology
-@@ -247,6 +247,14 @@ EOF
- 
-     AC_REQUIRE([AC_PROG_SED])
- 
-+    # runstatedir only supported in autoconf >= 2.70 and in some backports
-+    if test "x${runstatedir}" != "x"; then
-+      HWLOC_runstatedir=${runstatedir}
-+    else
-+      HWLOC_runstatedir='${localstatedir}/run'
-+    fi
-+    AC_SUBST([HWLOC_runstatedir])
-+
-     # Cairo support
-     hwloc_cairo_happy=no
-     if test "x$enable_cairo" != "xno"; then
-diff -Nrup hwloc-1.11.2.orig/doc/hwloc.doxy hwloc-1.11.2/doc/hwloc.doxy
---- hwloc-1.11.2.orig/doc/hwloc.doxy	2015-12-17 05:05:59.000000000 -0500
-+++ hwloc-1.11.2/doc/hwloc.doxy	2016-06-06 14:10:34.211094730 -0400
-@@ -816,6 +816,9 @@ assembling them with hwloc-assembler.
- 
- 
- 
-+See <tt>HWLOC_DUMPED_HWDATA_DIR</tt> in \ref envvar for details
-+about the location of dumped files.
-+
- 
- \page envvar Environment Variables
- 
-@@ -963,7 +966,12 @@ following environment variables.
- 
- <dt>HWLOC_DUMPED_HWDATA_DIR=/path/to/dumped/files/</dt>
-   <dd>loads files dumped by <tt>hwloc-dump-hwdata</tt> (on Linux)
--  from the given directory instead of <tt>/var/run/hwloc/</tt>.
-+  from the given directory.
-+  The default dump/load directory is configured during build based
-+  on \--runstatedir, \--localstatedir, and \--prefix options.
-+  It usually points to <tt>/var/run/hwloc/</tt> in Linux distribution
-+  packages, but it may also point to <tt>$prefix/var/run/hwloc/</tt>
-+  when manually installing and only specifying \--prefix.
-   </dd>
- 
- <dt>HWLOC_COMPONENTS=list,of,components</dt>
-@@ -2777,6 +2785,8 @@ The utility <tt>hwloc-dump-hwdata</tt> i
- privileged information at boot time and making it available to
- non-privileged users. However it only applies to Intel Knights Landing
- Xeon Phi for now (see \ref faq_knl_dump).
-+See also <tt>HWLOC_DUMPED_HWDATA_DIR</tt> in \ref envvar for details
-+about the location of dumped files.
- 
- 
- \section faq_onedim hwloc only has a one-dimensional view of the architecture, it ignores distances
-@@ -3149,6 +3159,9 @@ hwloc-dump-hwdata requires <tt>dmi-sysfs
- 
- The utility is currently unneeded on non-KNL platforms.
- 
-+See <tt>HWLOC_DUMPED_HWDATA_DIR</tt> in \ref envvar for details
-+about the location of dumped files.
-+
- 
- \section faq_phi How do I build for Intel Xeon Phi coprocessor?
- 
-diff -Nrup hwloc-1.11.2.orig/NEWS hwloc-1.11.2/NEWS
---- hwloc-1.11.2.orig/NEWS	2016-06-06 13:45:54.947068832 -0400
-+++ hwloc-1.11.2/NEWS	2016-06-06 14:11:52.160045046 -0400
-@@ -60,6 +60,8 @@ Version 1.11.2
- * Add systemd service template contrib/systemd/hwloc-dump-hwdata.service
-   for launching hwloc-dump-hwdata at boot on Linux.
-   Thanks to Grzegorz Andrejczuk.
-+* Make the hwloc-dump-hwdata dump directory configurable through configure
-+  options such as --runstatedir or --localstatedir.
- 
- 
- Version 1.11.1
-diff -Nrup hwloc-1.11.2.orig/src/Makefile.am hwloc-1.11.2/src/Makefile.am
---- hwloc-1.11.2.orig/src/Makefile.am	2015-10-06 13:06:45.000000000 -0400
-+++ hwloc-1.11.2/src/Makefile.am	2016-06-06 14:10:34.212094742 -0400
-@@ -1,4 +1,4 @@
--# Copyright © 2009-2014 Inria.  All rights reserved.
-+# Copyright © 2009-2016 Inria.  All rights reserved.
- # Copyright © 2009-2012 Université Bordeaux
- # Copyright © 2009-2014 Cisco Systems, Inc.  All rights reserved.
- # Copyright © 2011-2012 Oracle and/or its affiliates.  All rights reserved.
-@@ -22,7 +22,8 @@ endif
- pluginsdir = @HWLOC_PLUGINS_DIR@
- plugins_LTLIBRARIES =
- plugins_ldflags = -module -avoid-version -lltdl
--AM_CPPFLAGS += -DHWLOC_PLUGINS_PATH=\"$(HWLOC_PLUGINS_PATH)\"
-+# Beware that files are not rebuilt automatically when reconfiguring with different paths in these flags.
-+AM_CPPFLAGS += -DHWLOC_PLUGINS_PATH=\"$(HWLOC_PLUGINS_PATH)\" -DRUNSTATEDIR=\"$(HWLOC_runstatedir)\"
- 
- # Sources and ldflags
- 
-diff -Nrup hwloc-1.11.2.orig/src/topology-linux.c hwloc-1.11.2/src/topology-linux.c
---- hwloc-1.11.2.orig/src/topology-linux.c	2015-12-10 07:09:45.000000000 -0500
-+++ hwloc-1.11.2/src/topology-linux.c	2016-06-06 14:10:34.214094766 -0400
-@@ -5237,7 +5237,7 @@ hwloc_linux_component_instantiate(struct
- 
-   data->dumped_hwdata_dirname = getenv("HWLOC_DUMPED_HWDATA_DIR");
-   if (!data->dumped_hwdata_dirname)
--    data->dumped_hwdata_dirname = "/var/run/hwloc/";
-+    data->dumped_hwdata_dirname = RUNSTATEDIR "/hwloc/";
- 
-   data->deprecated_classlinks_model = -2; /* never tried */
-   data->mic_need_directlookup = -1; /* not initialized */
-diff -Nrup hwloc-1.11.2.orig/utils/hwloc/hwloc-dump-hwdata.1in hwloc-1.11.2/utils/hwloc/hwloc-dump-hwdata.1in
---- hwloc-1.11.2.orig/utils/hwloc/hwloc-dump-hwdata.1in	2015-12-10 07:09:45.000000000 -0500
-+++ hwloc-1.11.2/utils/hwloc/hwloc-dump-hwdata.1in	2016-06-06 14:10:34.216094790 -0400
-@@ -1,5 +1,5 @@
- .\" -*- nroff -*-
--.\" Copyright © 2015 Inria.  All rights reserved.
-+.\" Copyright © 2015-2016 Inria.  All rights reserved.
- .\" See COPYING in top-level directory.
- .TH HWLOC-DUMP-HWDATA "1" "#HWLOC_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
- .SH NAME
-@@ -21,7 +21,11 @@ hwloc-dump-hwdata \- Dump topology and l
- .TP 10
- \fB\-o <dir>\fR
- save output files to directory <dir> instead of the default
--\fI/var/run/hwloc/\fR.
-+\fI#RUNSTATEDIR#/hwloc/\fR that was specified at configure time.
-+
-+You may want to set the HWLOC_DUMPED_HWDATA_DIR environment variable
-+as well so that the hwloc library looks for dumped files in that same
-+directory.
- .
- .\" **************************
- .\"    Description Section
-@@ -54,11 +58,6 @@ gathered from specific SMBIOS entries su
- \fI/sys/firmware/dmi/entries/160-*\fR,
- and saved in file \fIknl_memoryside_cache\fR.
- .
--.PP
--If the output directory is changed, you may want to set the
--HWLOC_DUMPED_HWDATA_DIR environment variable accordingly so that
--the hwloc library finds the dumped files.
--.
- .\" **************************
- .\"    See also section
- .\" **************************
-diff -Nrup hwloc-1.11.2.orig/utils/hwloc/hwloc-dump-hwdata.c hwloc-1.11.2/utils/hwloc/hwloc-dump-hwdata.c
---- hwloc-1.11.2.orig/utils/hwloc/hwloc-dump-hwdata.c	2016-06-06 14:08:17.576429196 -0400
-+++ hwloc-1.11.2/utils/hwloc/hwloc-dump-hwdata.c	2016-06-06 14:10:34.216094790 -0400
-@@ -23,7 +23,7 @@ static void usage(const char *name, FILE
- {
-     fprintf (where, "Usage: %s [ options ] ...\n", name);
-     fprintf (where, "Options:\n");
--    fprintf (where, "  -o <dir>      Output files to directory <dir> instead of /var/run/hwloc/\n");
-+    fprintf (where, "  -o <dir>      Output files to directory <dir> instead of " DEFAULT_DUMP_DIR "\n");
- }
- 
- int main(int argc, char *argv[])
-diff -Nrup hwloc-1.11.2.orig/utils/hwloc/hwloc-gather-topology.in hwloc-1.11.2/utils/hwloc/hwloc-gather-topology.in
---- hwloc-1.11.2.orig/utils/hwloc/hwloc-gather-topology.in	2015-12-10 07:09:45.000000000 -0500
-+++ hwloc-1.11.2/utils/hwloc/hwloc-gather-topology.in	2016-06-06 14:10:34.216094790 -0400
-@@ -3,7 +3,7 @@
- 
- #
- # Copyright © 2009 CNRS
--# Copyright © 2009-2015 Inria.  All rights reserved.
-+# Copyright © 2009-2016 Inria.  All rights reserved.
- # Copyright © 2009-2012 Université Bordeaux
- # See COPYING in top-level directory.
- #
-@@ -12,6 +12,8 @@ HWLOC_top_builddir="@HWLOC_top_builddir@
- prefix="@prefix@"
- exec_prefix="@exec_prefix@"
- bindir="@bindir@"
-+localstatedir="@localstatedir@"
-+runstatedir="@HWLOC_runstatedir@"
- # this will be changed into $bindir/lstopo during make install
- lstopo="$HWLOC_top_builddir/utils/lstopo/lstopo-no-graphics"
- 
-@@ -138,7 +140,7 @@ cat << EOF | while read -r path ; do sav
- EOF
- 
- if test "x$HWLOC_DUMPED_HWDATA_DIR" = x; then
--  savedir "$destdir/$basename" /var/run/hwloc/
-+  savedir "$destdir/$basename" "$runstatedir"/hwloc/
- else
-   savedir "$destdir/$basename" "$HWLOC_DUMPED_HWDATA_DIR"
- fi
-diff -Nrup hwloc-1.11.2.orig/utils/hwloc/Makefile.am hwloc-1.11.2/utils/hwloc/Makefile.am
---- hwloc-1.11.2.orig/utils/hwloc/Makefile.am	2016-06-06 14:08:17.575429209 -0400
-+++ hwloc-1.11.2/utils/hwloc/Makefile.am	2016-06-06 14:10:34.215094778 -0400
-@@ -45,7 +45,7 @@ endif HWLOC_HAVE_LINUX
- hwloc_dump_hwdata_SOURCES = \
- 	hwloc-dump-hwdata.c \
- 	hwloc-dump-hwdata-knl.c
--hwloc_dump_hwdata_CPPFLAGS = $(AM_CPPFLAGS) -DRUNSTATEDIR=\"@runstatedir@\"
-+hwloc_dump_hwdata_CPPFLAGS = $(AM_CPPFLAGS) -DRUNSTATEDIR=\"$(HWLOC_runstatedir)\"
- 
- hwloc_calc_SOURCES = \
-         hwloc-calc.h \
-@@ -123,6 +123,7 @@ endif HWLOC_HAVE_LINUX
- 	@ $(SED) -e 's/#PACKAGE_NAME#/@PACKAGE_NAME@/g' \
- 	  -e 's/#PACKAGE_VERSION#/@PACKAGE_VERSION@/g' \
- 	  -e 's/#HWLOC_DATE#/@HWLOC_RELEASE_DATE@/g' \
-+	  -e 's@#RUNSTATEDIR#@'$(HWLOC_runstatedir)'@g' \
- 	  > $@ < $<
- 
- .3in.3:
diff --git a/SOURCES/hwloc-1.11.2-dump-remove-hardwire.patch b/SOURCES/hwloc-1.11.2-dump-remove-hardwire.patch
deleted file mode 100644
index 042ba3b..0000000
--- a/SOURCES/hwloc-1.11.2-dump-remove-hardwire.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-commit 8058411358c8ae9c4066f672c24e6012348415ec
-Author: Brice Goglin <Brice.Goglin@inria.fr>
-Date:   Fri Mar 18 20:23:41 2016 +0100
-
-    hwloc_dump_hwdata: don't hardwire /var/run, use @runstatedir@
-
-diff --git a/utils/hwloc/Makefile.am b/utils/hwloc/Makefile.am
-index 868ea3a..0486a7a 100644
---- a/utils/hwloc/Makefile.am
-+++ b/utils/hwloc/Makefile.am
-@@ -1,4 +1,4 @@
--# Copyright © 2009-2015 Inria.  All rights reserved.
-+# Copyright © 2009-2016 Inria.  All rights reserved.
- # Copyright © 2009-2012, 2014 Université Bordeaux
- # Copyright © 2009-2014 Cisco Systems, Inc.  All rights reserved.
- #
-@@ -47,6 +47,7 @@ endif HWLOC_HAVE_LINUX
- hwloc_dump_hwdata_SOURCES = \
- 	hwloc-dump-hwdata.c \
- 	hwloc-dump-hwdata-knl.c
-+hwloc_dump_hwdata_CPPFLAGS = $(AM_CPPFLAGS) -DRUNSTATEDIR=\"@runstatedir@\"
- 
- hwloc_calc_SOURCES = \
-         hwloc-calc.h \
-diff --git a/utils/hwloc/hwloc-dump-hwdata.c b/utils/hwloc/hwloc-dump-hwdata.c
-index b372c1f..844dfef 100644
---- a/utils/hwloc/hwloc-dump-hwdata.c
-+++ b/utils/hwloc/hwloc-dump-hwdata.c
-@@ -1,6 +1,6 @@
- /*
-  * Copyright © 2015 Intel, Inc.  All rights reserved.
-- * Copyright © 2015 Inria.  All rights reserved.
-+ * Copyright © 2015-2016 Inria.  All rights reserved.
-  * See COPYING in top-level directory.
-  */
- 
-@@ -15,7 +15,7 @@
- #include <errno.h>
- #include <assert.h>
- 
--#define DEFAULT_DUMP_DIR "/var/run/hwloc"
-+#define DEFAULT_DUMP_DIR RUNSTATEDIR "/hwloc"
- 
- extern int hwloc_dump_hwdata_knl_smbios(const char *input_fsroot, const char *filename);
- 
diff --git a/SOURCES/hwloc-1.11.2-dump-remove-stop.patch b/SOURCES/hwloc-1.11.2-dump-remove-stop.patch
deleted file mode 100644
index 6b94b6a..0000000
--- a/SOURCES/hwloc-1.11.2-dump-remove-stop.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-diff -Nrup hwloc-1.11.2.orig/config/hwloc_internal.m4 hwloc-1.11.2/config/hwloc_internal.m4
---- hwloc-1.11.2.orig/config/hwloc_internal.m4	2016-06-06 14:11:17.698625007 -0400
-+++ hwloc-1.11.2/config/hwloc_internal.m4	2016-06-06 14:29:58.381286828 -0400
-@@ -315,8 +315,6 @@ EOF
-     LIBS="$hwloc_old_LIBS"
-     unset hwloc_old_LIBS
- 
--    AC_PATH_TOOL(RMPATH, rm)
--
-     _HWLOC_CHECK_DIFF_U
-     _HWLOC_CHECK_DIFF_W
- 
-diff -Nrup hwloc-1.11.2.orig/contrib/systemd/hwloc-dump-hwdata.service.in hwloc-1.11.2/contrib/systemd/hwloc-dump-hwdata.service.in
---- hwloc-1.11.2.orig/contrib/systemd/hwloc-dump-hwdata.service.in	2016-06-06 13:45:07.593491515 -0400
-+++ hwloc-1.11.2/contrib/systemd/hwloc-dump-hwdata.service.in	2016-06-06 14:29:58.382286835 -0400
-@@ -16,7 +16,6 @@ Description=Dump hardware topology and l
- Type=oneshot
- RemainAfterExit=yes
- ExecStart=#SBINDIR#/hwloc-dump-hwdata -o #RUNSTATEDIR#/hwloc
--ExecStop=#RMPATH# -rf #RUNSTATEDIR#/hwloc
- 
- [Install]
- WantedBy=multi-user.target
-diff -Nrup hwloc-1.11.2.orig/contrib/systemd/Makefile.am hwloc-1.11.2/contrib/systemd/Makefile.am
---- hwloc-1.11.2.orig/contrib/systemd/Makefile.am	2016-06-06 13:45:07.592491525 -0400
-+++ hwloc-1.11.2/contrib/systemd/Makefile.am	2016-06-06 14:29:58.382286835 -0400
-@@ -14,7 +14,6 @@ hwloc-dump-hwdata.service: hwloc-dump-hw
- 	@ $(SED) \
- 	  -e 's@#SBINDIR#@'$(sbindir)'@g' \
- 	  -e 's@#RUNSTATEDIR#@'$(HWLOC_runstatedir)'@g' \
--	  -e 's@#RMPATH#@'$(RMPATH)'@g' \
- 	  > $@ < $<
- 
- distclean-local:
diff --git a/SOURCES/hwloc-1.11.2-dump-service.patch b/SOURCES/hwloc-1.11.2-dump-service.patch
deleted file mode 100644
index 7e932fa..0000000
--- a/SOURCES/hwloc-1.11.2-dump-service.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-diff -Nrup hwloc-1.11.2.orig/config/hwloc_internal.m4 hwloc-1.11.2/config/hwloc_internal.m4
---- hwloc-1.11.2.orig/config/hwloc_internal.m4	2015-06-02 05:12:40.000000000 -0400
-+++ hwloc-1.11.2/config/hwloc_internal.m4	2016-06-06 13:45:07.591491542 -0400
-@@ -307,6 +307,8 @@ EOF
-     LIBS="$hwloc_old_LIBS"
-     unset hwloc_old_LIBS
- 
-+    AC_PATH_TOOL(RMPATH, rm)
-+
-     _HWLOC_CHECK_DIFF_U
-     _HWLOC_CHECK_DIFF_W
- 
-@@ -394,7 +396,8 @@ int foo(void) {
-         hwloc_config_prefix[utils/hwloc/test-hwloc-distrib.sh]
-         hwloc_config_prefix[utils/hwloc/test-hwloc-info.sh]
-         hwloc_config_prefix[utils/hwloc/test-fake-plugin.sh]
--        hwloc_config_prefix[utils/lstopo/test-hwloc-ls.sh])
-+        hwloc_config_prefix[utils/lstopo/test-hwloc-ls.sh]
-+        hwloc_config_prefix[contrib/systemd/Makefile])
- 
-     AC_CONFIG_COMMANDS([chmoding-scripts], [chmod +x ]hwloc_config_prefix[tests/linux/test-topology.sh ]hwloc_config_prefix[tests/xml/test-topology.sh ]hwloc_config_prefix[tests/linux/gather/test-gather-topology.sh ]hwloc_config_prefix[tests/wrapper.sh ]hwloc_config_prefix[utils/hwloc/hwloc-assembler-remote ]hwloc_config_prefix[utils/hwloc/hwloc-compress-dir ]hwloc_config_prefix[utils/hwloc/hwloc-gather-topology ]hwloc_config_prefix[utils/hwloc/test-hwloc-annotate.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-assembler.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-calc.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-compress-dir.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-diffpatch.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-distances.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-distrib.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-info.sh ]hwloc_config_prefix[utils/hwloc/test-fake-plugin.sh ]hwloc_config_prefix[utils/lstopo/test-hwloc-ls.sh])
- 
-diff -Nrup hwloc-1.11.2.orig/contrib/systemd/hwloc-dump-hwdata.service.in hwloc-1.11.2/contrib/systemd/hwloc-dump-hwdata.service.in
---- hwloc-1.11.2.orig/contrib/systemd/hwloc-dump-hwdata.service.in	1969-12-31 19:00:00.000000000 -0500
-+++ hwloc-1.11.2/contrib/systemd/hwloc-dump-hwdata.service.in	2016-06-06 13:45:07.593491515 -0400
-@@ -0,0 +1,22 @@
-+#
-+# Copyright © 2015-2016 Intel, Inc.  All rights reserved.
-+# Copyright © 2016 Inria.  All rights reserved.
-+# See COPYING in top-level directory.
-+#
-+# #RUNSTATEDIR#/hwloc was specified at configure time.
-+# It may be changed by passing configure options such as --runstatedir,
-+# --localstatedir or --prefix.
-+# It may also be manually changed before installing this file in systemd directories.
-+#
-+
-+[Unit]
-+Description=Dump hardware topology and locality information to #RUNSTATEDIR#/hwloc
-+
-+[Service]
-+Type=oneshot
-+RemainAfterExit=yes
-+ExecStart=#SBINDIR#/hwloc-dump-hwdata -o #RUNSTATEDIR#/hwloc
-+ExecStop=#RMPATH# -rf #RUNSTATEDIR#/hwloc
-+
-+[Install]
-+WantedBy=multi-user.target
-diff -Nrup hwloc-1.11.2.orig/contrib/systemd/Makefile.am hwloc-1.11.2/contrib/systemd/Makefile.am
---- hwloc-1.11.2.orig/contrib/systemd/Makefile.am	1969-12-31 19:00:00.000000000 -0500
-+++ hwloc-1.11.2/contrib/systemd/Makefile.am	2016-06-06 13:45:07.592491525 -0400
-@@ -0,0 +1,22 @@
-+# Copyright © 2016 Inria.  All rights reserved.
-+# See COPYING in top-level directory.
-+
-+# We can't use autoconf because we don't want $sbindir to be replaced with ${exec_prefix}/sbin
-+# Also don't install since , let the packagers do it.
-+
-+EXTRA_DIST = hwloc-dump-hwdata.service.in
-+
-+if HWLOC_HAVE_LINUX
-+nodist_pkgdata_DATA = hwloc-dump-hwdata.service
-+# depend on Makefile in case we rerun configure with different directory arguments
-+hwloc-dump-hwdata.service: hwloc-dump-hwdata.service.in Makefile
-+	@echo Creating $@...
-+	@ $(SED) \
-+	  -e 's@#SBINDIR#@'$(sbindir)'@g' \
-+	  -e 's@#RUNSTATEDIR#@'$(HWLOC_runstatedir)'@g' \
-+	  -e 's@#RMPATH#@'$(RMPATH)'@g' \
-+	  > $@ < $<
-+
-+distclean-local:
-+	rm -f hwloc-dump-hwdata.service
-+endif
-diff -Nrup hwloc-1.11.2.orig/Makefile.am hwloc-1.11.2/Makefile.am
---- hwloc-1.11.2.orig/Makefile.am	2015-06-02 05:12:40.000000000 -0400
-+++ hwloc-1.11.2/Makefile.am	2016-06-06 13:45:07.588491592 -0400
-@@ -1,4 +1,4 @@
--# Copyright © 2009-2015 Inria.  All rights reserved.
-+# Copyright © 2009-2016 Inria.  All rights reserved.
- # Copyright © 2009      Université Bordeaux
- # Copyright © 2009-2014 Cisco Systems, Inc.  All rights reserved.
- # See COPYING in top-level directory.
-@@ -9,7 +9,7 @@ ACLOCAL_AMFLAGS = -I ./config
- 
- SUBDIRS = src include
- if HWLOC_BUILD_STANDALONE
--SUBDIRS += tests utils
-+SUBDIRS += tests utils contrib/systemd
- # We need doc/ if HWLOC_BUILD_DOXYGEN, or during make install if HWLOC_INSTALL_DOXYGEN.
- # There's no INSTALL_SUBDIRS, so always enter doc/ and check HWLOC_BUILD/INSTALL_DOXYGEN there
- SUBDIRS += doc
-diff -Nrup hwloc-1.11.2.orig/NEWS hwloc-1.11.2/NEWS
---- hwloc-1.11.2.orig/NEWS	2015-12-17 05:05:59.000000000 -0500
-+++ hwloc-1.11.2/NEWS	2016-06-06 13:45:54.947068832 -0400
-@@ -57,6 +57,9 @@ Version 1.11.2
- * Debug messages may be disabled at runtime by passing HWLOC_DEBUG_VERBOSE=0
-   in the environment when --enable-debug was passed to configure.
- * Add a FAQ entry "What are these Group objects in my topology?".
-+* Add systemd service template contrib/systemd/hwloc-dump-hwdata.service
-+  for launching hwloc-dump-hwdata at boot on Linux.
-+  Thanks to Grzegorz Andrejczuk.
- 
- 
- Version 1.11.1
diff --git a/SOURCES/hwloc-1.11.2-hwloc-dump-x86-only.patch b/SOURCES/hwloc-1.11.2-hwloc-dump-x86-only.patch
deleted file mode 100644
index d537d71..0000000
--- a/SOURCES/hwloc-1.11.2-hwloc-dump-x86-only.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -Nrup hwloc-1.11.2.orig/contrib/systemd/Makefile.am hwloc-1.11.2/contrib/systemd/Makefile.am
---- hwloc-1.11.2.orig/contrib/systemd/Makefile.am	2016-06-06 14:40:16.698823658 -0400
-+++ hwloc-1.11.2/contrib/systemd/Makefile.am	2016-06-06 17:19:50.456582250 -0400
-@@ -7,7 +7,10 @@
- EXTRA_DIST = hwloc-dump-hwdata.service.in
- 
- if HWLOC_HAVE_LINUX
-+if HWLOC_HAVE_X86
- nodist_pkgdata_DATA = hwloc-dump-hwdata.service
-+endif HWLOC_HAVE_X86
-+
- # depend on Makefile in case we rerun configure with different directory arguments
- hwloc-dump-hwdata.service: hwloc-dump-hwdata.service.in Makefile
- 	@echo Creating $@...
diff --git a/SOURCES/hwloc-1.11.2-x2apic.patch b/SOURCES/hwloc-1.11.2-x2apic.patch
deleted file mode 100644
index 35d791e..0000000
--- a/SOURCES/hwloc-1.11.2-x2apic.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-commit aeee8a0c1f603beb8a69f94ed36b69c887ab3b2f
-Author: Brice Goglin <Brice.Goglin@inria.fr>
-Date:   Wed Feb 3 07:10:48 2016 +0100
-
-    x86: fix infinite loop on VMWare when x2apic feature is reported without CPUID 0xb leaf support
-    
-    Don't use x2APIC unless supported and CPUID 0xb is supported too.
-    
-    This is likely a VMware bug since CPUID 0xb support seems
-    to be required when x2APIC feature is reported.
-    
-    Thanks to Jianjun Wen for reporting the problem and testing the patch.
-
-diff -rup hwloc-1.7.orig/src/topology-x86.c hwloc-1.7/src/topology-x86.c
---- hwloc-1.7.orig/src/topology-x86.c	2016-05-18 16:12:38.859470713 -0400
-+++ hwloc-1.7/src/topology-x86.c	2016-05-18 16:50:57.382272906 -0400
-@@ -302,7 +302,7 @@ static void look_proc(struct procinfo *i
-   /* Get package/core/thread information from cpuid 0x0b
-    * (Intel x2APIC)
-    */
--  if (cpuid_type == intel && has_x2apic(features)) {
-+  if (cpuid_type == intel && highest_cpuid >= 0x0b && has_x2apic(features)) {
-     unsigned level, apic_nextshift, apic_number, apic_type, apic_id = 0, apic_shift = 0, id;
-     for (level = 0; ; level++) {
-       ecx = level;
diff --git a/SOURCES/hwloc-1.11.5-Add-Knights-Mill-KNM-CPUID.patch b/SOURCES/hwloc-1.11.5-Add-Knights-Mill-KNM-CPUID.patch
deleted file mode 100644
index 6e973fe..0000000
--- a/SOURCES/hwloc-1.11.5-Add-Knights-Mill-KNM-CPUID.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -rup hwloc-1.11.2.bk/src/topology-linux.c hwloc-1.11.2/src/topology-linux.c
---- hwloc-1.11.2.bk/src/topology-linux.c	2017-03-24 13:34:08.369114722 -0400
-+++ hwloc-1.11.2/src/topology-linux.c	2017-03-24 13:34:34.530388408 -0400
-@@ -4122,7 +4122,8 @@ hwloc_look_linuxfs(struct hwloc_backend
-       }
-       if (cpuvendor && !strcmp(cpuvendor, "GenuineIntel")
- 	  && cpufamilynumber && !strcmp(cpufamilynumber, "6")
--	  && cpumodelnumber && !strcmp(cpumodelnumber, "87"))
-+	  && cpumodelnumber && (!strcmp(cpumodelnumber, "87")
-+	  || !strcmp(cpumodelnumber, "133")))
- 	data->is_knl = 1;
-     }
-   }
-Only in hwloc-1.11.2/src: topology-linux.c.orig
-diff -rup hwloc-1.11.2.bk/src/topology-x86.c hwloc-1.11.2/src/topology-x86.c
---- hwloc-1.11.2.bk/src/topology-x86.c	2017-03-24 13:34:08.363114659 -0400
-+++ hwloc-1.11.2/src/topology-x86.c	2017-03-24 13:34:34.530388408 -0400
-@@ -174,8 +174,9 @@ static void look_proc(struct hwloc_backe
-   }
-   infos->cpustepping = eax & 0xf;
- 
--  if (cpuid_type == intel && infos->cpufamilynumber == 0x6 && infos->cpumodelnumber == 0x57)
--    data->is_knl = 1;
-+  if (cpuid_type == intel && infos->cpufamilynumber == 0x6 &&
-+      (infos->cpumodelnumber == 0x57 || infos->cpumodelnumber == 0x85))
-+    data->is_knl = 1; /* KNM is the same as KNL */
- 
-   /* Get cpu vendor string from cpuid 0x00 */
-   memset(regs, 0, sizeof(regs));
-Only in hwloc-1.11.2/src: topology-x86.c.orig
diff --git a/SPECS/hwloc.spec b/SPECS/hwloc.spec
index 71369f7..d99a192 100644
--- a/SPECS/hwloc.spec
+++ b/SPECS/hwloc.spec
@@ -1,29 +1,33 @@
 Summary:   Portable Hardware Locality - portable abstraction of hierarchical architectures
 Name:      hwloc
-Version:   1.11.2
-Release:   2%{?dist}
+Version:   1.11.8
+Release:   4%{?dist}
 License:   BSD
 Group:     Applications/System
 URL:       http://www.open-mpi.org/projects/hwloc/
 Source0:   http://www.open-mpi.org/software/hwloc/v1.11/downloads/%{name}-%{version}.tar.bz2
-Patch0:    hwloc-1.11.2-x2apic.patch
-Patch1:    hwloc-1.11.2-dump-service.patch
-Patch2:    hwloc-1.11.2-dump-remove-hardwire.patch
-Patch3:    hwloc-1.11.2-dump-cleanups.patch
-Patch4:    hwloc-1.11.2-dump-remove-stop.patch
-Patch5:    hwloc-1.11.2-hwloc-dump-x86-only.patch
-Patch6:    hwloc-1.11.5-Add-Knights-Mill-KNM-CPUID.patch
-
-Requires:  %{name}-libs = %{version}-%{release} 
-
-BuildRequires: libX11-devel libxml2-devel cairo-devel ncurses-devel libpciaccess-devel transfig doxygen texlive-latex texlive-makeindex libtool-ltdl-devel autoconf automake libtool
+# fix build with -Werror=format-security
+Patch0:    0001-Avoid-letting-snprintf-interpret-process-name-as-for.patch
+Requires:  %{name}-libs%{?_isa} = %{version}-%{release}
+
+BuildRequires: cairo-devel
+BuildRequires: libpciaccess-devel
+BuildRequires: libtool-ltdl-devel
+BuildRequires: libX11-devel
+BuildRequires: libxml2-devel
+BuildRequires: ncurses-devel
+BuildRequires: transfig doxygen
+BuildRequires: texlive-latex texlive-makeindex
 BuildRequires: desktop-file-utils
-%ifnarch s390 s390x
-BuildRequires: libibverbs-devel
-%endif
 %ifnarch s390 s390x %{arm}
 BuildRequires: numactl-devel
-##Requires: numactl-libs
+%endif
+%ifnarch %{arm}
+BuildRequires: rdma-core-devel
+%endif
+%ifarch %{ix86} x86_64
+%{?systemd_requires}
+BuildRequires: systemd
 %endif
 
 %description
@@ -43,7 +47,10 @@ about the hardware, bind processes, and much more.
 %package devel
 Summary:   Headers and shared development libraries for hwloc
 Group:     Development/Libraries
-Requires:  %{name}-libs = %{version}-%{release}
+Requires:  %{name}-libs%{?_isa} = %{version}-%{release}
+%ifnarch %{arm}
+Requires:  rdma-core-devel%{?_isa}
+%endif
 
 %description devel
 Headers and shared object symbolic links for the hwloc.
@@ -58,7 +65,7 @@ Run time libraries for the hwloc
 %package gui
 Summary:   The gui-based hwloc program(s)
 Group:     Development/Libraries
-Requires:  %{name}-libs = %{version}-%{release}
+Requires:  %{name}-libs%{?_isa} = %{version}-%{release}
 
 %description gui
 GUI-based tool for displaying system topology information.
@@ -66,7 +73,7 @@ GUI-based tool for displaying system topology information.
 %package plugins
 Summary:   Plugins for hwloc
 Group:     Development/Libraries
-Requires:  %{name}-plugins = %{version}-%{release}
+Requires:  %{name}-plugins%{?_isa} = %{version}-%{release}
 
 %description plugins
  This package contains plugins for hwloc. This includes
@@ -75,50 +82,56 @@ Requires:  %{name}-plugins = %{version}-%{release}
   - libxml support
 
 %prep
-%setup -q
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
+%autosetup -p1
 
 %build
-autoreconf --force --install
-%configure --enable-plugins --disable-silent-rules
-##sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
-##sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
-%{__make} %{?_smp_mflags} V=1
+# The ./configure script will support --runstatedir= when generated with
+# autoconf 2.70. Until then, tell it about /run using the export:
+export runstatedir=/run
+%configure --enable-plugins --disable-silent-rules --docdir=%{_pkgdocdir}
+# Remove rpaths
+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+make %{?_smp_mflags}
 
 %install
-%{__make} install DESTDIR=%{buildroot} INSTALL="%{__install} -p"
-
-#Fix wrong permition on file hwloc-assembler-remote => I have reported this to upstream already
-%{__chmod} 0755 %{buildroot}%{_bindir}/hwloc-assembler-remote
+make install DESTDIR=%{buildroot} INSTALL="%{__install} -p"
 
 # We don't ship .la files.
 find %{buildroot} -name '*.la' -exec rm -f {} ';'
 
-%{__mv} %{buildroot}%{_defaultdocdir}/%{name} %{buildroot}%{_defaultdocdir}/%{name}-%{version}
-%{__cp} -p AUTHORS COPYING NEWS README VERSION %{buildroot}%{_defaultdocdir}/%{name}-%{version}
-%{__cp} -rp doc/examples %{buildroot}%{_defaultdocdir}/%{name}-%{version}
-mv  %{buildroot}%{_defaultdocdir}/%{name}-%{version}/examples/Makefile  %{buildroot}%{_defaultdocdir}/%{name}-%{version}/examples/Makefile_%{_arch}
+cp -p AUTHORS COPYING NEWS README VERSION %{buildroot}%{_pkgdocdir}
+cp -pr doc/examples %{buildroot}%{_pkgdocdir}
+# Fix for BZ1253977
+mv  %{buildroot}%{_pkgdocdir}/examples/Makefile  %{buildroot}%{_pkgdocdir}/examples/Makefile_%{_arch}
+
 desktop-file-validate %{buildroot}/%{_datadir}/applications/lstopo.desktop
-%ifarch x86_64 i686
+
+# Avoid making hwloc-gui depend on hwloc
+rm %{buildroot}%{_mandir}/man1/lstopo.1
+ln %{buildroot}%{_mandir}/man1/lstopo-no-graphics.1 %{buildroot}%{_mandir}/man1/lstopo.1
+
+# Deal with service file
+# https://github.com/open-mpi/hwloc/issues/221
+%ifarch %{ix86} x86_64
 mkdir -p %{buildroot}%{_unitdir}
-%{__mv} %{buildroot}/usr/share/hwloc/hwloc-dump-hwdata.service %{buildroot}%{_unitdir}/hwloc-dump-hwdata.service
+mv %{buildroot}%{_datadir}/%{name}/hwloc-dump-hwdata.service %{buildroot}%{_unitdir}/
+%else
+rm %{buildroot}%{_datadir}/%{name}/hwloc-dump-hwdata.service
 %endif
 
 %check
-%{__make} check
+LD_LIBRARY_PATH=$PWD/src/.libs make check
 
-%ifarch x86_64 i686
+%ifarch %{ix86} x86_64
 %post
 %systemd_post hwloc-dump-hwdata.service
 
 %preun
 %systemd_preun hwloc-dump-hwdata.service
+
+%postun
+%systemd_postun_with_restart hwloc-dump-hwdata.service
 %endif
 
 %post libs -p /sbin/ldconfig
@@ -126,47 +139,60 @@ mkdir -p %{buildroot}%{_unitdir}
 %postun libs -p /sbin/ldconfig
 
 %files
-%defattr(-, root, root, -)
-%ifarch x86_64 i686
-%{_sbindir}/%{name}*
-%{_unitdir}/hwloc-dump-hwdata.service
-%endif
 %{_bindir}/%{name}*
 %{_bindir}/lstopo-no-graphics
 %{_mandir}/man1/%{name}*
 %{_mandir}/man1/lstopo-no-graphics*
+%ifarch %{ix86} x86_64
+%{_sbindir}/hwloc-dump-hwdata
+%{_unitdir}/hwloc-dump-hwdata.service
+%endif
 
 %files devel
-%defattr(-, root, root, -)
 %{_libdir}/pkgconfig/*
 %{_mandir}/man3/*
 %dir %{_includedir}/%{name}
 %{_includedir}/%{name}/*
 %{_includedir}/%{name}.h
-%{_defaultdocdir}/%{name}-%{version}/examples
+%{_pkgdocdir}/examples
 %{_libdir}/*.so
 
 %files libs
-%defattr(-, root, root, -)
 %{_mandir}/man7/%{name}*
 %dir %{_datadir}/%{name}
 %{_datadir}/%{name}/%{name}.dtd
 %{_datadir}/%{name}/%{name}-valgrind.supp
-%dir %{_defaultdocdir}/%{name}-%{version}
-%{_defaultdocdir}/%{name}-%{version}/*[^c]
-%{_libdir}/libhwloc*so.*
+%dir %{_pkgdocdir}/
+%{_pkgdocdir}/*[^c]
+%{_libdir}/libhwloc*so.5*
 
 %files gui
 %{_bindir}/lstopo
-%{_mandir}/man1/lstopo.*
+%{_mandir}/man1/lstopo.1*
 %{_datadir}/applications/lstopo.desktop
 
 %files plugins
 %dir %{_libdir}/%{name}
 %{_libdir}/%{name}/hwloc*
 
-
 %changelog
+* Thu Nov 16 2017 Michal Schmidt <mschmidt@redhat.com> - 1.11.8-4
+- Rebase to 1.11.8.
+- Deal with rpaths using the method from Packaging Guidelines.
+- BuildRequire rdma-core-devel on s390(x).
+- Fix scriptlets related to hwloc-dump-hwdata.service.
+- Configure with /run as runstatedir.
+- Spec file cleanup.
+- Related: rhbz1482585
+
+* Tue Nov 7 2017 Don Zickus <dzickus@redhat.com> - 1.11.5-2
+- Build failure due to extra service file
+- Resolves: rhbz1482585
+
+* Fri Oct 27 2017 Don Zickus <dzickus@redhat.com> - 1.11.5-1
+- Rebase to 1.11.5
+- Resolves: rhbz1482585
+
 * Fri Mar 24 2017 Don Zickus <dzickus@redhat.com> - 1.11.2-2
 - Add support for Knights Mill
   Resolves: rhbz1381313