View Revisions: Issue #4616

Summary 0004616: Build error with GCC 8.2.0 within libarchive
Revision 2018-10-16 06:49 by jcfr
Description

Hi!

I saw 0004558, and this seems very similar, but apparently not exactly the same since that one was supposedly fixed.

While attempting a Debug build of Slicer Git Master using GCC 8.2.0, I'm getting a build error within the compilation of libarchive:

<pre>
[ 1%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_pack_dev.c.o
cd /home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive-build/libarchive && /usr/bin/cc -DHAVE_CONFIG_H -DLIBARCHIVE_STATIC -I/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive/libarchive -I/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive-build -I/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/zlib-install/include -Wall -Wformat -Wformat-security -g -Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -o CMakeFiles/archive_static.dir/archive_pack_dev.c.o -c /home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive/libarchive/archive_pack_dev.c
/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive/libarchive/archive_pack_dev.c: In function ‘pack_native’:
/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive/libarchive/archive_pack_dev.c:111:13: error: In the GNU C Library, "makedev" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "makedev", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"makedev", you should undefine it after including <sys/types.h>. [-Werror]
dev = apd_makedev(numbers[0], numbers[1]);
^~~~~~~~
/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive/libarchive/archive_pack_dev.c:112:13: error: In the GNU C Library, "major" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "major", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"major", you should undefine it after including <sys/types.h>. [-Werror]
if ((unsigned long)major(dev) != numbers[0])
^~~~~~~~~~
/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive/libarchive/archive_pack_dev.c:114:13: error: In the GNU C Library, "minor" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "minor", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"minor", you should undefine it after including <sys/types.h>. [-Werror]
else if ((unsigned long)minor(dev) != numbers[1])
^~~~~~~~~~~
cc1: all warnings being treated as errors
make[5]: [libarchive/CMakeFiles/archive_static.dir/build.make:271: libarchive/CMakeFiles/archive_static.dir/archive_pack_dev.c.o] Error 1
make[5]: Leaving directory '/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive-build'
make[4]:
[CMakeFiles/Makefile2:95: libarchive/CMakeFiles/archive_static.dir/all] Error 2
make[4]: Leaving directory '/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive-build'
make[3]: [Makefile:130: all] Error 2
make[3]: Leaving directory '/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive-build'
make[2]:
[CMakeFiles/LibArchive.dir/build.make:116: LibArchive-prefix/src/LibArchive-stamp/LibArchive-build] Error 2
make[2]: Leaving directory '/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug'
make[1]: [CMakeFiles/Makefile2:1805: CMakeFiles/LibArchive.dir/all] Error 2
make[1]: Leaving directory '/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug'
make:
[Makefile:98: all] Error 2
</pre>

I will try the workaround mentioned in 0004558 for now.

Revision 2018-09-20 05:01 by torquil
Description

Hi!

I saw 0004558, and this seems very similar, but apparently not exactly the same since that one was supposedly fixed.

While attempting a Debug build of Slicer Git Master using GCC 8.2.0, I'm getting a build error within the compilation of libarchive:

[ 1%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_pack_dev.c.o
cd /home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive-build/libarchive && /usr/bin/cc -DHAVE_CONFIG_H -DLIBARCHIVE_STATIC -I/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive/libarchive -I/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive-build -I/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/zlib-install/include -Wall -Wformat -Wformat-security -g -Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -o CMakeFiles/archive_static.dir/archive_pack_dev.c.o -c /home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive/libarchive/archive_pack_dev.c
/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive/libarchive/archive_pack_dev.c: In function ‘pack_native’:
/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive/libarchive/archive_pack_dev.c:111:13: error: In the GNU C Library, "makedev" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "makedev", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"makedev", you should undefine it after including <sys/types.h>. [-Werror]
dev = apd_makedev(numbers[0], numbers[1]);
^~~~~~~~
/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive/libarchive/archive_pack_dev.c:112:13: error: In the GNU C Library, "major" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "major", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"major", you should undefine it after including <sys/types.h>. [-Werror]
if ((unsigned long)major(dev) != numbers[0])
^~~~~~~~~~
/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive/libarchive/archive_pack_dev.c:114:13: error: In the GNU C Library, "minor" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "minor", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"minor", you should undefine it after including <sys/types.h>. [-Werror]
else if ((unsigned long)minor(dev) != numbers[1])
^~~~~~~~~~~
cc1: all warnings being treated as errors
make[5]: [libarchive/CMakeFiles/archive_static.dir/build.make:271: libarchive/CMakeFiles/archive_static.dir/archive_pack_dev.c.o] Error 1
make[5]: Leaving directory '/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive-build'
make[4]:
[CMakeFiles/Makefile2:95: libarchive/CMakeFiles/archive_static.dir/all] Error 2
make[4]: Leaving directory '/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive-build'
make[3]: [Makefile:130: all] Error 2
make[3]: Leaving directory '/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/LibArchive-build'
make[2]:
[CMakeFiles/LibArchive.dir/build.make:116: LibArchive-prefix/src/LibArchive-stamp/LibArchive-build] Error 2
make[2]: Leaving directory '/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug'
make[1]: [CMakeFiles/Makefile2:1805: CMakeFiles/LibArchive.dir/all] Error 2
make[1]: Leaving directory '/home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug'
make:
[Makefile:98: all] Error 2

I will try the workaround mentioned in 0004558 for now.