diff mbox series

[RFC,3/3] toolchain/toolchain-wrapper: add BR2_RELRO_FULL support

Message ID 1534220803-26737-4-git-send-email-matthew.weber@rockwellcollins.com
State Superseded
Headers show
Series Hardening Wrapper Support | expand

Commit Message

Matt Weber Aug. 14, 2018, 4:26 a.m. UTC
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
 toolchain/toolchain-wrapper.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

Comments

Jan Kundrát Aug. 21, 2018, 7:53 a.m. UTC | #1
On úterý 14. srpna 2018 6:26:43 CEST, Matt Weber wrote:
> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
> ---
>  toolchain/toolchain-wrapper.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
> index c5eb813..d36771c 100644
> --- a/toolchain/toolchain-wrapper.c
> +++ b/toolchain/toolchain-wrapper.c
> @@ -49,8 +49,9 @@ static char _date_[sizeof("-D__DATE__=\"MMM DD YYYY\"")];
>   * 	-D__TIME__=
>   * 	-D__DATE__=
>   * 	-Wno-builtin-macro-redefined
> + *      -fPIE

nit: this looks like a whitespace error (one too many spaces)

>   */
> -#define EXCLUSIVE_ARGS	6
> +#define EXCLUSIVE_ARGS	7
>  
>  static char *predef_args[] = {
>  #ifdef BR_CCACHE
> @@ -363,6 +364,22 @@ int main(int argc, char **argv)
>  		*cur++ = "-Wno-builtin-macro-redefined";
>  	}
>  
> +#ifdef BR2_RELRO_FULL
> +	/* Combinations of PIE and pic */
> +	for (i = 1; i < argc; i++) {
> +		if (!strcmp(argv[i], "-r") ||
> +		    !strcmp(argv[i], "-fpie") ||
> +		    !strcmp(argv[i], "-fPIE") ||
> +		    !strcmp(argv[i], "-fpic") ||
> +		    !strcmp(argv[i], "-fPIC") ||
> +		    !strcmp(argv[i], "-fno-pic"))
> +			break;
> +	}
> +
> +	if (i == argc)
> +		*cur++ = "-fPIE";
> +#endif
> +
>  	paranoid_wrapper = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH");
>  	if (paranoid_wrapper && strlen(paranoid_wrapper) > 0)
>  		paranoid = 1;

I needed some more patches to build with the following hardening settings:

BR2_SSP_STRONG=y
BR2_RELRO_FULL=y
BR2_FORTIFY_SOURCE_2=y

- https://patchwork.ozlabs.org/patch/865166/
- https://patchwork.ozlabs.org/patch/865168/ (this one need changes so that 
it touches packages/libzlib/ now)

Then my build failed when building util-linux, see the attached log.

Cheers,
Jan
>>> util-linux 2.32.1 Extracting
xzcat /home/jkt/work/cesnet/gerrit/github/buildroot/buildroot/dl/util-linux/util-linux-2.32.1.tar.xz | tar --strip-components=1 -C /home/jkt/work/prog/_build/br-cfb/build/util-linux-2.32.1   -xf -
>>> util-linux 2.32.1 Patching
>>> util-linux 2.32.1 Updating config.sub and config.guess
for file in config.guess config.sub; do for i in $(find /home/jkt/work/prog/_build/br-cfb/build/util-linux-2.32.1 -name $file); do cp support/gnuconfig/$file $i; done; done
>>> util-linux 2.32.1 Patching libtool
patching file /home/jkt/work/prog/_build/br-cfb/build/util-linux-2.32.1/config/ltmain.sh
Hunk #1 succeeded at 2694 (offset 7 lines).
Hunk #2 succeeded at 4284 (offset 7 lines).
Hunk #3 succeeded at 6579 (offset 25 lines).
Hunk #4 succeeded at 6589 (offset 25 lines).
Hunk #5 succeeded at 6882 (offset 25 lines).
Hunk #6 succeeded at 7174 (offset 25 lines).
Hunk #7 succeeded at 8140 (offset 28 lines).
Hunk #8 succeeded at 10769 (offset 59 lines).
>>> util-linux 2.32.1 Configuring
(cd /home/jkt/work/prog/_build/br-cfb/build/util-linux-2.32.1/ && rm -rf config.cache && PATH="/home/jkt/work/prog/_build/br-cfb/host/bin:/home/jkt/work/prog/_build/br-cfb/host/sbin:/home/jkt/.local/bin:/home/jkt/bin/:/opt/qtc/bin:/opt/darktable/bin:/home/jkt/.local/bin:/home/jkt/bin/:/opt/qtc/bin:/opt/darktable/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/8.1.0:/usr/lib/llvm/6/bin:/usr/lib/llvm/4/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/games/bin" AR="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ar" AS="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-as" LD="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ld" NM="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-nm" CC="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc" GCC="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc" CPP="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-cpp" CXX="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-g++" FC="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gfortran" F77="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gfortran" RANLIB="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ranlib" READELF="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-readelf" STRIP="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-strip" OBJCOPY="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-objcopy" OBJDUMP="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-objdump" AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as" CC_FOR_BUILD="/usr/x86_64-pc-linux-gnu/gcc-bin/8.1.0/gcc" GCC_FOR_BUILD="/usr/x86_64-pc-linux-gnu/gcc-bin/8.1.0/gcc" CXX_FOR_BUILD="/usr/x86_64-pc-linux-gnu/gcc-bin/8.1.0/g++" LD_FOR_BUILD="/usr/bin/ld" CPPFLAGS_FOR_BUILD="-I/home/jkt/work/prog/_build/br-cfb/host/include" CFLAGS_FOR_BUILD="-O2 -I/home/jkt/work/prog/_build/br-cfb/host/include" CXXFLAGS_FOR_BUILD="-O2 -I/home/jkt/work/prog/_build/br-cfb/host/include" LDFLAGS_FOR_BUILD="-L/home/jkt/work/prog/_build/br-cfb/host/lib -Wl,-rpath,/home/jkt/work/prog/_build/br-cfb/host/lib" FCFLAGS_FOR_BUILD="" DEFAULT_ASSEMBLER="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-as" DEFAULT_LINKER="/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ld" CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O3 -g2 -fstack-protector-strong -fPIE -Wl,-z,now -Wl,-z,relro -D_FORTIFY_SOURCE=2" CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O3 -g2 -fstack-protector-strong -fPIE -Wl,-z,now -Wl,-z,relro -D_FORTIFY_SOURCE=2" LDFLAGS=" -pie -Wl,-z,now -Wl,-z,relro" FCFLAGS=" -O3 -g2" FFLAGS=" -O3 -g2" PKG_CONFIG="/home/jkt/work/prog/_build/br-cfb/host/bin/pkg-config" STAGING_DIR="/home/jkt/work/prog/_build/br-cfb/host/arm-buildroot-linux-gnueabihf/sysroot" INTLTOOL_PERL=/usr/bin/perl ac_cv_lbl_unaligned_fail=yes ac_cv_func_mmap_fixed_mapped=yes ac_cv_func_memcmp_working=yes ac_cv_have_decl_malloc=yes gl_cv_func_malloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes ac_cv_func_calloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes lt_cv_sys_lib_search_path_spec="" ac_cv_c_bigendian=no  NCURSES6_CONFIG=/home/jkt/work/prog/_build/br-cfb/host/arm-buildroot-linux-gnueabihf/sysroot/usr/bin/ncurses6-config LIBS=" " CONFIG_SITE=/dev/null ./configure --target=arm-buildroot-linux-gnueabihf --host=arm-buildroot-linux-gnueabihf --build=x86_64-pc-linux-gnu --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --localstatedir=/var --program-prefix="" --disable-gtk-doc --disable-gtk-doc-html --disable-doc --disable-docs --disable-documentation --with-xmlto=no --with-fop=no --disable-dependency-tracking --enable-ipv6 --disable-nls --disable-static --enable-shared  --disable-rpath --disable-makeinstall-chown --without-systemd --with-systemdsystemunitdir=no --bindir=/usr/bin --sbindir=/usr/sbin --libdir=/usr/lib --without-ncursesw --with-ncurses --disable-widechar --without-selinux --enable-all-programs --disable-agetty --disable-bfs --disable-cal --disable-chfn-chsh --disable-chmem --disable-cramfs --disable-eject --disable-fallocate --disable-fdformat --enable-fsck --disable-hwclock --disable-ipcrm --disable-ipcs --disable-kill --disable-last --enable-libblkid --enable-libfdisk --enable-libmount --enable-libsmartcols --enable-libuuid --disable-line --disable-logger --disable-login --disable-losetup --disable-lslogins --disable-lsmem --disable-mesg --disable-minix --disable-more --enable-mount --disable-mountpoint --disable-newgrp --enable-nologin --disable-nsenter --disable-partx --disable-pg --disable-pivot_root --disable-raw --disable-rename --disable-rfkill --disable-runuser --disable-schedutils --disable-setpriv --disable-setterm --disable-su --disable-sulogin --disable-switch_root --disable-tunelp --disable-ul --disable-unshare --disable-utmpdump --disable-uuidd --disable-vipw --disable-wall --disable-wdctl --disable-write --disable-zramctl --without-python --with-readline --without-audit )
configure: WARNING: unrecognized options: --disable-gtk-doc-html, --disable-doc, --disable-docs, --disable-documentation, --with-xmlto, --with-fop, --enable-ipv6
checking for arm-buildroot-linux-gnueabihf-gcc... /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc accepts -g... yes
checking for /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc option to accept ISO C89... none needed
checking whether /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc understands -c and -o together... yes
checking how to run the C preprocessor... /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-cpp
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-buildroot-linux-gnueabihf-strip... /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking dependency style of /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc... none
checking whether make supports nested variables... (cached) yes
checking for arm-buildroot-linux-gnueabihf-ar... /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ar
checking the archiver (/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ar) interface... ar
configure: Default --exec-prefix detected.
configure:   --runstatedir defaults to /run
checking for /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc option to accept ISO C99... none needed
checking for /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc option to accept ISO Standard C... (cached) none needed
checking for bison... bison -y
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-buildroot-linux-gnueabihf
checking for an ANSI C-conforming const... yes
checking for working volatile... yes
checking whether byte ordering is bigendian... (cached) no
checking whether compiler handles -fno-common... yes
checking whether compiler handles -Wall... yes
checking whether compiler handles -Werror=sequence-point... yes
checking whether compiler handles -Wextra... yes
checking whether compiler handles -Wextra-semi... no
checking whether compiler handles -Wembedded-directive... no
checking whether compiler handles -Wmissing-declarations... yes
checking whether compiler handles -Wmissing-parameter-type... yes
checking whether compiler handles -Wmissing-prototypes... yes
checking whether compiler handles -Wno-missing-field-initializers... yes
checking whether compiler handles -Wredundant-decls... yes
checking whether compiler handles -Wsign-compare... yes
checking whether compiler handles -Wtype-limits... yes
checking whether compiler handles -Wuninitialized... yes
checking whether compiler handles -Wunused-but-set-parameter... yes
checking whether compiler handles -Wunused-but-set-variable... yes
checking whether compiler handles -Wunused-parameter... yes
checking whether compiler handles -Wunused-result... yes
checking whether compiler handles -Wunused-variable... yes
checking whether compiler handles -Wnested-externs... yes
checking whether compiler handles -Wpointer-arith... yes
checking whether compiler handles -Wstrict-prototypes... yes
checking whether compiler handles -Wformat-security... no
checking whether compiler handles -Wimplicit-function-declaration... yes
checking whether compiler handles -Wno-clobbered... yes
checking whether compiler handles -Wno-unused-parameter... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc... /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ld
checking if the linker (/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-nm
checking the name lister (/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to arm-buildroot-linux-gnueabihf format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ld option to reload object files... -r
checking for arm-buildroot-linux-gnueabihf-objdump... /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-objdump
checking how to recognize dependent libraries... pass_all
checking for arm-buildroot-linux-gnueabihf-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for arm-buildroot-linux-gnueabihf-ar... (cached) /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ar
checking for archiver @FILE support... @
checking for arm-buildroot-linux-gnueabihf-strip... (cached) /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-strip
checking for arm-buildroot-linux-gnueabihf-ranlib... /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ranlib
checking command to parse /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-nm output from /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for arm-buildroot-linux-gnueabihf-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc supports -fno-rtti -fno-exceptions... no
checking for /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc option to produce PIC... -fPIC -DPIC
checking if /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc PIC flag -fPIC -DPIC works... yes
checking if /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc static flag -static works... yes
checking if /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc supports -c -o file.o... yes
checking if /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc supports -c -o file.o... (cached) yes
checking whether the /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc linker (/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... unsupported
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking linker version script flag... --version-script
checking if version scripts can use complex wildcards... yes
checking pkg-config is at least version 0.9.0... yes
checking whether to build gtk-doc documentation... no
checking for gtkdoc-check... /usr/bin/gtkdoc-check
checking for xsltproc... /usr/bin/xsltproc
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether to enable assertions... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... yes
checking whether NLS is requested... no
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/gmsgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for ld used by /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc... /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ld
checking if the linker (/home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-ld) is GNU ld... no
checking for shared library run path origin... done
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking whether to use NLS... no
checking for linux/compiler.h... no
checking for linux/blkpg.h... yes
checking for linux/major.h... yes
checking asm/io.h usability... no
checking asm/io.h presence... no
checking for asm/io.h... no
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking for inttypes.h... (cached) yes
checking lastlog.h usability... yes
checking lastlog.h presence... yes
checking for lastlog.h... yes
checking libutil.h usability... no
checking libutil.h presence... no
checking for libutil.h... no
checking linux/btrfs.h usability... yes
checking linux/btrfs.h presence... yes
checking for linux/btrfs.h... yes
checking linux/cdrom.h usability... yes
checking linux/cdrom.h presence... yes
checking for linux/cdrom.h... yes
checking linux/falloc.h usability... yes
checking linux/falloc.h presence... yes
checking for linux/falloc.h... yes
checking linux/watchdog.h usability... yes
checking linux/watchdog.h presence... yes
checking for linux/watchdog.h... yes
checking linux/fd.h usability... yes
checking linux/fd.h presence... yes
checking for linux/fd.h... yes
checking linux/raw.h usability... yes
checking linux/raw.h presence... yes
checking for linux/raw.h... yes
checking linux/tiocl.h usability... yes
checking linux/tiocl.h presence... yes
checking for linux/tiocl.h... yes
checking linux/version.h usability... yes
checking linux/version.h presence... yes
checking for linux/version.h... yes
checking linux/securebits.h usability... yes
checking linux/securebits.h presence... yes
checking for linux/securebits.h... yes
checking linux/net_namespace.h usability... yes
checking linux/net_namespace.h presence... yes
checking for linux/net_namespace.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking mntent.h usability... yes
checking mntent.h presence... yes
checking for mntent.h... yes
checking net/if.h usability... yes
checking net/if.h presence... yes
checking for net/if.h... yes
checking net/if_dl.h usability... no
checking net/if_dl.h presence... no
checking for net/if_dl.h... no
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking pty.h usability... yes
checking pty.h presence... yes
checking for pty.h... yes
checking security/pam_appl.h usability... no
checking security/pam_appl.h presence... no
checking for security/pam_appl.h... no
checking for stdint.h... (cached) yes
checking stdio_ext.h usability... yes
checking stdio_ext.h presence... yes
checking for stdio_ext.h... yes
checking for stdlib.h... (cached) yes
checking endian.h usability... yes
checking endian.h presence... yes
checking for endian.h... yes
checking byteswap.h usability... yes
checking byteswap.h presence... yes
checking for byteswap.h... yes
checking sys/endian.h usability... no
checking sys/endian.h presence... no
checking for sys/endian.h... no
checking sys/disk.h usability... no
checking sys/disk.h presence... no
checking for sys/disk.h... no
checking sys/disklabel.h usability... no
checking sys/disklabel.h presence... no
checking for sys/disklabel.h... no
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/io.h usability... yes
checking sys/io.h presence... yes
checking for sys/io.h... yes
checking sys/ioccom.h usability... no
checking sys/ioccom.h presence... no
checking for sys/ioccom.h... no
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/mkdev.h usability... no
checking sys/mkdev.h presence... no
checking for sys/mkdev.h... no
checking sys/mount.h usability... yes
checking sys/mount.h presence... yes
checking for sys/mount.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/prctl.h usability... yes
checking sys/prctl.h presence... yes
checking for sys/prctl.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/signalfd.h usability... yes
checking sys/signalfd.h presence... yes
checking for sys/signalfd.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking for sys/stat.h... (cached) yes
checking sys/sysmacros.h usability... yes
checking sys/sysmacros.h presence... yes
checking for sys/sysmacros.h... yes
checking sys/swap.h usability... yes
checking sys/swap.h presence... yes
checking for sys/swap.h... yes
checking sys/syscall.h usability... yes
checking sys/syscall.h presence... yes
checking for sys/syscall.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/timex.h usability... yes
checking sys/timex.h presence... yes
checking for sys/timex.h... yes
checking sys/ttydefaults.h usability... yes
checking sys/ttydefaults.h presence... yes
checking for sys/ttydefaults.h... yes
checking for sys/types.h... (cached) yes
checking sys/ucred.h usability... no
checking sys/ucred.h presence... no
checking for sys/ucred.h... no
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking for unistd.h... (cached) yes
checking shadow.h usability... yes
checking shadow.h presence... yes
checking for shadow.h... yes
checking utmp.h usability... yes
checking utmp.h presence... yes
checking for utmp.h... yes
checking utmpx.h usability... yes
checking utmpx.h presence... yes
checking for utmpx.h... yes
checking for linux/fs.h... no
checking for linux/gsmmux.h... no
checking for security/pam_misc.h... no
checking linux/blkzoned.h usability... yes
checking linux/blkzoned.h presence... yes
checking for linux/blkzoned.h... yes
checking for security/openpam.h... no
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking whether langinfo.h defines ALTMON_x constants... no
checking whether langinfo.h defines _NL_ABALTMON_x constants... no
checking for struct termios.c_line... yes
checking for struct stat.st_mtim.tv_nsec... yes
checking whether _NL_TIME_WEEK_1STDAY is declared... yes
checking whether llseek is declared... no
checking whether lseek64 is declared... yes
checking whether environ is declared... yes
checking whether strsignal is declared... yes
checking whether TIOCGLCKTRMIOS is declared... yes
checking whether SOCK_CLOEXEC is declared... yes
checking whether SOCK_NONBLOCK is declared... yes
checking whether SO_PASSCRED is declared... yes
checking for __fpending... yes
checking for secure_getenv... yes
checking for __secure_getenv... no
checking for eaccess... yes
checking for err... yes
checking for errx... yes
checking for explicit_bzero... yes
checking for fsync... yes
checking for utimensat... yes
checking for getdomainname... yes
checking for getdtablesize... yes
checking for getexecname... no
checking for getmntinfo... no
checking for getrandom... yes
checking for getrlimit... yes
checking for getsgnam... yes
checking for inotify_init... yes
checking for jrand48... yes
checking for lchown... yes
checking for llseek... yes
checking for lseek64... yes
checking for mempcpy... yes
checking for mkostemp... yes
checking for nanosleep... yes
checking for ntp_gettime... yes
checking for personality... yes
checking for posix_fadvise... yes
checking for prctl... yes
checking for qsort_r... yes
checking for rpmatch... yes
checking for scandirat... yes
checking for setprogname... no
checking for setresgid... yes
checking for setresuid... yes
checking for sched_setattr... no
checking for sched_setscheduler... yes
checking for sigqueue... yes
checking for srandom... yes
checking for strnchr... no
checking for strndup... yes
checking for strnlen... yes
checking for sysconf... yes
checking for sysinfo... yes
checking for timegm... yes
checking for usleep... yes
checking for vwarnx... yes
checking for warn... yes
checking for warnx... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for openat... yes
checking for fstatat... yes
checking for unlinkat... yes
checking for ioperm... yes
checking for iopl... yes
checking for futimens... yes
checking for inotify_init1... yes
checking for open_memstream... yes
checking for reboot... yes
checking for updwtmpx... yes
checking for updwtmpx... (cached) yes
checking for getusershell... yes
checking for isnan... yes
checking for clock_gettime... yes
checking for timer_create... no
checking for timer_create in -lrt... yes
checking for rtas_get_sysparm in -lrtas... no
checking for struct sockaddr.sa_len... no
checking for library containing socket... none required
checking for dirfd... yes
checking whether program_invocation_short_name is defined... yes
checking whether __progname is defined... yes
configure: WARNING: force to build all programs by default
checking whether the target supports thread-local storage... yes
checking scanf string alloc modifiers... (%ms) yes
checking for openpty in -lutil... yes
checking for union semun... no
checking for loff_t... yes
checking for cpu_set_t... yes
checking for sighandler_t... yes
checking whether CPU_ALLOC is declared... yes
checking crypt.h usability... yes
checking crypt.h presence... yes
checking for crypt.h... yes
checking for udev_new in -ludev... no
checking for arm-buildroot-linux-gnueabihf-ncurses6-config... /home/jkt/work/prog/_build/br-cfb/host/arm-buildroot-linux-gnueabihf/sysroot/usr/bin/ncurses6-config
checking ncurses/ncurses.h usability... no
checking ncurses/ncurses.h presence... no
checking for ncurses/ncurses.h... no
checking ncurses/term.h usability... no
checking ncurses/term.h presence... no
checking for ncurses/term.h... no
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking term.h usability... yes
checking term.h presence... yes
checking for term.h... yes
checking for use_default_colors in -lncurses... yes
checking for resizeterm in -lncurses... yes
checking for TINFO... no
checking for tgetent in -ltinfo... no
checking for readline in -lreadline... yes
checking for unshare... yes
checking for setns... yes
checking for capng_apply in -lcap-ng... no
checking for crc32 in -lz... yes
checking for syscall swapon... SYS_swapon
checking for syscall swapoff... SYS_swapoff
checking for swapon... yes
checking for swapoff... yes
checking for syscall prlimit64... SYS_prlimit64
checking for prlimit... yes
checking for LIBUSER... no
configure: WARNING: libpython not found; not building pylibmount
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libblkid/docs/Makefile
config.status: creating libblkid/docs/version.xml
config.status: creating libblkid/src/blkid.h
config.status: creating libfdisk/docs/Makefile
config.status: creating libfdisk/docs/version.xml
config.status: creating libfdisk/src/libfdisk.h
config.status: creating libmount/docs/Makefile
config.status: creating libmount/docs/version.xml
config.status: creating libmount/src/libmount.h
config.status: creating libsmartcols/docs/Makefile
config.status: creating libsmartcols/docs/version.xml
config.status: creating libsmartcols/src/libsmartcols.h
config.status: creating po/Makefile.in
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
configure: WARNING: unrecognized options: --disable-gtk-doc-html, --disable-doc, --disable-docs, --disable-documentation, --with-xmlto, --with-fop, --enable-ipv6

        util-linux  2.32.1

        prefix:            /usr
        exec prefix:       /usr

        runstatedir:       /run
        bindir:            /usr/bin
        sbindir:           /usr/sbin
        libdir:            /usr/lib
        includedir:        ${prefix}/include
        usrbin_execdir:    ${exec_prefix}/bin
        usrsbin_execdir:   ${exec_prefix}/sbin
        usrlib_execdir:    /usr/lib

        compiler:          /home/jkt/work/prog/_build/br-cfb/host/bin/arm-linux-gnueabihf-gcc
        cflags:            -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O3 -g2 -fstack-protector-strong -fPIE -Wl,-z,now -Wl,-z,relro -D_FORTIFY_SOURCE=2
        suid cflags:       
        ldflags:            -pie -Wl,-z,now -Wl,-z,relro
        suid ldflags:      

        Python:            
        Python version:    
        Python libs:       

        Bash completions:  ${datarootdir}/bash-completion/completions
        Systemd support:   no
        Btrfs support:     yes
        Wide-char support: no

        warnings:

 -fno-common -Wall -Werror=sequence-point -Wextra -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wno-missing-field-initializers -Wredundant-decls -Wsign-compare -Wtype-limits -Wuninitialized -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-parameter -Wunused-result -Wunused-variable -Wnested-externs -Wpointer-arith -Wstrict-prototypes -Wimplicit-function-declaration

        Type 'make' or 'make <utilname>' to compile.

>>> util-linux 2.32.1 Building
PATH="/home/jkt/work/prog/_build/br-cfb/host/bin:/home/jkt/work/prog/_build/br-cfb/host/sbin:/home/jkt/.local/bin:/home/jkt/bin/:/opt/qtc/bin:/opt/darktable/bin:/home/jkt/.local/bin:/home/jkt/bin/:/opt/qtc/bin:/opt/darktable/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/8.1.0:/usr/lib/llvm/6/bin:/usr/lib/llvm/4/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/games/bin"  /usr/bin/make -j5 LIBS=" " -C /home/jkt/work/prog/_build/br-cfb/build/util-linux-2.32.1/
/usr/bin/make  all-recursive
Making all in po
make[4]: Nothing to be done for 'all'.
  CC       lib/libmount_la-monotonic.lo
  CC       lib/dmesg-monotonic.o
  CC       sys-utils/fstrim-fstrim.o
  CC       sys-utils/ctrlaltdel.o
  CC       sys-utils/fsfreeze.o
  CC       sys-utils/blkdiscard.o
  CC       lib/monotonic.o
  CC       sys-utils/blkzone.o
  CC       sys-utils/swapon-swapon.o
  CC       sys-utils/swapon-swapon-common.o
  CC       lib/swapon-swapprober.o
  CC       sys-utils/swapoff-swapoff.o
  CC       sys-utils/swapoff-swapon-common.o
  CC       lib/swapoff-swapprober.o
  CC       sys-utils/chcpu.o
  CC       misc-utils/blkid-blkid.o
  CC       misc-utils/findfs-findfs.o
  CC       misc-utils/wipefs-wipefs.o
  CC       lib/swaplabel-swapprober.o
  CC       disk-utils/fsck-fsck.o
  CC       lib/fsck-monotonic.o
  CC       disk-utils/blockdev.o
  CC       disk-utils/fdisk-fdisk.o
  CC       disk-utils/fdisk-fdisk-menu.o
  CC       disk-utils/fdisk-fdisk-list.o
  CC       disk-utils/sfdisk-sfdisk.o
  CC       disk-utils/sfdisk-fdisk-list.o
  CC       disk-utils/cfdisk-cfdisk.o
  CC       lib/script-monotonic.o
  CC       term-utils/scriptreplay.o
  CC       sys-utils/flock.o
  CC       lib/timer.o
  CC       sys-utils/ipcmk.o
  CC       sys-utils/lsipc-lsipc.o
  CC       sys-utils/lsipc-ipcutils.o
  CC       sys-utils/renice.o
  CC       sys-utils/setsid.o
  CC       sys-utils/setarch.o
  CC       sys-utils/prlimit-prlimit.o
  CC       sys-utils/lsns-lsns.o
  CC       sys-utils/lscpu-lscpu.o
  CC       sys-utils/lscpu-lscpu-arm.o
  CC       sys-utils/lscpu-lscpu-dmi.o
  CC       misc-utils/look.o
  CC       misc-utils/mcookie.o
  CC       lib/md5.o
  CC       misc-utils/namei.o
  CC       lib/strutils.o
  CC       lib/idcache.o
  CC       misc-utils/whereis.o
  CC       misc-utils/lslocks-lslocks.o
  CC       misc-utils/uuidgen-uuidgen.o
  CC       misc-utils/uuidparse-uuidparse.o
  CC       misc-utils/getopt.o
misc-utils/uuidparse.c: In function ‘fill_table_row’:
misc-utils/uuidparse.c:225:44: warning: ‘type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (variant == UUID_VARIANT_DCE && type == 1) {
                                       ~~~~~^~~~
misc-utils/uuidparse.c:225:16: warning: ‘variant’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (variant == UUID_VARIANT_DCE && type == 1) {
  CC       misc-utils/fincore-fincore.o
  CC       disk-utils/isosize.o
  CC       sys-utils/readprofile.o
  CC       sys-utils/ldattach.o
  CC       sys-utils/rtcwake.o
  GEN      sys-utils/uname26.8
  GEN      sys-utils/linux32.8
  GEN      sys-utils/rtcwake.8
  GEN      sys-utils/linux64.8
  GEN      libblkid/blkid.pc
  GEN      libuuid/uuid.pc
  GEN      libmount/mount.pc
  GEN      libsmartcols/smartcols.pc
  GEN      libfdisk/fdisk.pc
  CC       lib/libcommon_la-blkdev.lo
  CC       lib/libcommon_la-canonicalize.lo
  CC       lib/libcommon_la-crc32.lo
  CC       lib/libcommon_la-crc32c.lo
  CC       lib/libcommon_la-env.lo
  CC       lib/libcommon_la-idcache.lo
  CC       lib/libcommon_la-fileutils.lo
  CC       lib/libcommon_la-ismounted.lo
  CC       lib/libcommon_la-color-names.lo
  CC       lib/libcommon_la-mangle.lo
  CC       lib/libcommon_la-match.lo
  CC       lib/libcommon_la-mbsalign.lo
  CC       lib/libcommon_la-mbsedit.lo
  CC       lib/libcommon_la-md5.lo
  CC       lib/libcommon_la-pager.lo
  CC       lib/libcommon_la-parse-date.lo
  CC       lib/libcommon_la-path.lo
  CC       lib/libcommon_la-pwdutils.lo
  CC       lib/libcommon_la-randutils.lo
  CC       lib/libcommon_la-setproctitle.lo
  CC       lib/libcommon_la-strutils.lo
  CC       lib/libcommon_la-timeutils.lo
  CC       lib/libcommon_la-ttyutils.lo
  CC       lib/libcommon_la-exec_shell.lo
  CC       lib/libcommon_la-strv.lo
  CC       lib/libcommon_la-sha1.lo
  CC       lib/libcommon_la-signames.lo
  CC       lib/libcommon_la-linux_version.lo
  CC       lib/libcommon_la-loopdev.lo
  CC       lib/libcommon_la-plymouth-ctrl.lo
  CC       lib/libcommon_la-cpuset.lo
  CC       lib/libcommon_la-procutils.lo
  CC       lib/libcommon_la-sysfs.lo
  CC       lib/libtcolors_la-colors.lo
  CC       lib/libtcolors_la-color-names.lo
  CC       libuuid/src/libuuid_la-clear.lo
  CC       libuuid/src/libuuid_la-compare.lo
  CC       libuuid/src/libuuid_la-copy.lo
  CC       libuuid/src/libuuid_la-gen_uuid.lo
  CC       libuuid/src/libuuid_la-isnull.lo
  CC       libuuid/src/libuuid_la-pack.lo
  CC       libuuid/src/libuuid_la-parse.lo
  CC       libuuid/src/libuuid_la-unpack.lo
  CC       libuuid/src/libuuid_la-unparse.lo
  CC       libuuid/src/libuuid_la-uuid_time.lo
  CC       libuuid/src/libuuid_la-predefined.lo
  CC       lib/libuuid_la-randutils.lo
  CC       lib/libuuid_la-md5.lo
  CC       lib/libuuid_la-sha1.lo
  CC       libblkid/src/libblkid_la-init.lo
  CC       libblkid/src/libblkid_la-cache.lo
  CC       libblkid/src/libblkid_la-config.lo
  CC       libblkid/src/libblkid_la-dev.lo
  CC       libblkid/src/libblkid_la-devname.lo
  CC       libblkid/src/libblkid_la-devno.lo
  CC       libblkid/src/libblkid_la-encode.lo
  CC       libblkid/src/libblkid_la-evaluate.lo
  CC       libblkid/src/libblkid_la-getsize.lo
  CC       libblkid/src/libblkid_la-llseek.lo
  CC       libblkid/src/libblkid_la-probe.lo
  CC       libblkid/src/libblkid_la-read.lo
  CC       libblkid/src/libblkid_la-resolve.lo
  CC       libblkid/src/libblkid_la-save.lo
  CC       libblkid/src/libblkid_la-tag.lo
  CC       libblkid/src/libblkid_la-verify.lo
  CC       libblkid/src/libblkid_la-version.lo
  CC       libblkid/src/partitions/libblkid_la-aix.lo
  CC       libblkid/src/partitions/libblkid_la-atari.lo
  CC       libblkid/src/partitions/libblkid_la-bsd.lo
  CC       libblkid/src/partitions/libblkid_la-dos.lo
  CC       libblkid/src/partitions/libblkid_la-gpt.lo
  CC       libblkid/src/partitions/libblkid_la-mac.lo
  CC       libblkid/src/partitions/libblkid_la-minix.lo
  CC       libblkid/src/partitions/libblkid_la-partitions.lo
  CC       libblkid/src/partitions/libblkid_la-sgi.lo
  CC       libblkid/src/partitions/libblkid_la-solaris_x86.lo
  CC       libblkid/src/partitions/libblkid_la-sun.lo
  CC       libblkid/src/partitions/libblkid_la-ultrix.lo
  CC       libblkid/src/partitions/libblkid_la-unixware.lo
  CC       libblkid/src/superblocks/libblkid_la-adaptec_raid.lo
  CC       libblkid/src/superblocks/libblkid_la-bcache.lo
  CC       libblkid/src/superblocks/libblkid_la-befs.lo
  CC       libblkid/src/superblocks/libblkid_la-bfs.lo
  CC       libblkid/src/superblocks/libblkid_la-btrfs.lo
  CC       libblkid/src/superblocks/libblkid_la-cramfs.lo
  CC       libblkid/src/superblocks/libblkid_la-ddf_raid.lo
  CC       libblkid/src/superblocks/libblkid_la-drbd.lo
  CC       libblkid/src/superblocks/libblkid_la-drbdproxy_datalog.lo
  CC       libblkid/src/superblocks/libblkid_la-drbdmanage.lo
  CC       libblkid/src/superblocks/libblkid_la-exfat.lo
  CC       libblkid/src/superblocks/libblkid_la-exfs.lo
  CC       libblkid/src/superblocks/libblkid_la-ext.lo
  CC       libblkid/src/superblocks/libblkid_la-f2fs.lo
  CC       libblkid/src/superblocks/libblkid_la-gfs.lo
  CC       libblkid/src/superblocks/libblkid_la-hfs.lo
  CC       libblkid/src/superblocks/libblkid_la-highpoint_raid.lo
  CC       libblkid/src/superblocks/libblkid_la-hpfs.lo
  CC       libblkid/src/superblocks/libblkid_la-iso9660.lo
  CC       libblkid/src/superblocks/libblkid_la-isw_raid.lo
  CC       libblkid/src/superblocks/libblkid_la-jfs.lo
  CC       libblkid/src/superblocks/libblkid_la-jmicron_raid.lo
  CC       libblkid/src/superblocks/libblkid_la-linux_raid.lo
  CC       libblkid/src/superblocks/libblkid_la-luks.lo
  CC       libblkid/src/superblocks/libblkid_la-lsi_raid.lo
  CC       libblkid/src/superblocks/libblkid_la-lvm.lo
  CC       libblkid/src/superblocks/libblkid_la-minix.lo
  CC       libblkid/src/superblocks/libblkid_la-mpool.lo
  CC       libblkid/src/superblocks/libblkid_la-netware.lo
  CC       libblkid/src/superblocks/libblkid_la-nilfs.lo
  CC       libblkid/src/superblocks/libblkid_la-ntfs.lo
  CC       libblkid/src/superblocks/libblkid_la-refs.lo
  CC       libblkid/src/superblocks/libblkid_la-nvidia_raid.lo
  CC       libblkid/src/superblocks/libblkid_la-ocfs.lo
  CC       libblkid/src/superblocks/libblkid_la-promise_raid.lo
  CC       libblkid/src/superblocks/libblkid_la-reiserfs.lo
  CC       libblkid/src/superblocks/libblkid_la-romfs.lo
  CC       libblkid/src/superblocks/libblkid_la-silicon_raid.lo
  CC       libblkid/src/superblocks/libblkid_la-squashfs.lo
  CC       libblkid/src/superblocks/libblkid_la-stratis.lo
  CC       libblkid/src/superblocks/libblkid_la-superblocks.lo
  CC       libblkid/src/superblocks/libblkid_la-swap.lo
  CC       libblkid/src/superblocks/libblkid_la-sysv.lo
  CC       libblkid/src/superblocks/libblkid_la-ubi.lo
  CC       libblkid/src/superblocks/libblkid_la-ubifs.lo
  CC       libblkid/src/superblocks/libblkid_la-udf.lo
  CC       libblkid/src/superblocks/libblkid_la-ufs.lo
  CC       libblkid/src/superblocks/libblkid_la-vdo.lo
  CC       libblkid/src/superblocks/libblkid_la-vfat.lo
  CC       libblkid/src/superblocks/libblkid_la-via_raid.lo
  CC       libblkid/src/superblocks/libblkid_la-vmfs.lo
  CC       libblkid/src/superblocks/libblkid_la-vxfs.lo
  CC       libblkid/src/superblocks/libblkid_la-xfs.lo
  CC       libblkid/src/superblocks/libblkid_la-zfs.lo
  CC       libblkid/src/topology/libblkid_la-topology.lo
  CC       libblkid/src/topology/libblkid_la-dm.lo
  CC       libblkid/src/topology/libblkid_la-evms.lo
  CC       libblkid/src/topology/libblkid_la-ioctl.lo
  CC       libblkid/src/topology/libblkid_la-lvm.lo
  CC       libblkid/src/topology/libblkid_la-md.lo
  CC       libblkid/src/topology/libblkid_la-sysfs.lo
  CC       libmount/src/libmount_la-cache.lo
  CC       libmount/src/libmount_la-fs.lo
  CC       libmount/src/libmount_la-init.lo
  CC       libmount/src/libmount_la-iter.lo
  CC       libmount/src/libmount_la-lock.lo
  CC       libmount/src/libmount_la-optmap.lo
  CC       libmount/src/libmount_la-optstr.lo
  CC       libmount/src/libmount_la-tab.lo
  CC       libmount/src/libmount_la-tab_diff.lo
  CC       libmount/src/libmount_la-tab_parse.lo
  CC       libmount/src/libmount_la-tab_update.lo
  CC       libmount/src/libmount_la-test.lo
  CC       libmount/src/libmount_la-utils.lo
  CC       libmount/src/libmount_la-version.lo
  CC       libmount/src/libmount_la-context.lo
  CC       libmount/src/libmount_la-context_loopdev.lo
  CC       libmount/src/libmount_la-context_mount.lo
  CC       libmount/src/libmount_la-context_umount.lo
  CC       libmount/src/libmount_la-monitor.lo
  CC       libmount/src/libmount_la-btrfs.lo
  CC       libsmartcols/src/libsmartcols_la-iter.lo
  CC       libsmartcols/src/libsmartcols_la-symbols.lo
  CC       libsmartcols/src/libsmartcols_la-cell.lo
  CC       libsmartcols/src/libsmartcols_la-column.lo
  CC       libsmartcols/src/libsmartcols_la-line.lo
  CC       libsmartcols/src/libsmartcols_la-table.lo
  CC       libsmartcols/src/libsmartcols_la-table_print.lo
  CC       libsmartcols/src/libsmartcols_la-version.lo
  CC       libsmartcols/src/libsmartcols_la-init.lo
  CC       libfdisk/src/libfdisk_la-init.lo
  CC       libfdisk/src/libfdisk_la-field.lo
  CC       libfdisk/src/libfdisk_la-item.lo
  CC       libfdisk/src/libfdisk_la-test.lo
  CC       libfdisk/src/libfdisk_la-ask.lo
  CC       libfdisk/src/libfdisk_la-alignment.lo
  CC       libfdisk/src/libfdisk_la-label.lo
  CC       libfdisk/src/libfdisk_la-utils.lo
  CC       libfdisk/src/libfdisk_la-context.lo
  CC       libfdisk/src/libfdisk_la-parttype.lo
  CC       libfdisk/src/libfdisk_la-partition.lo
  CC       libfdisk/src/libfdisk_la-table.lo
  CC       libfdisk/src/libfdisk_la-iter.lo
  CC       libfdisk/src/libfdisk_la-script.lo
  CC       libfdisk/src/libfdisk_la-version.lo
  CC       libfdisk/src/libfdisk_la-wipe.lo
  CC       libfdisk/src/libfdisk_la-sun.lo
  CC       libfdisk/src/libfdisk_la-sgi.lo
  CC       libfdisk/src/libfdisk_la-dos.lo
  CC       libfdisk/src/libfdisk_la-bsd.lo
  CC       libfdisk/src/libfdisk_la-gpt.lo
  CC       sys-utils/dmesg-dmesg.o
  CC       sys-utils/mount-mount.o
  CC       sys-utils/umount-umount.o
  CC       misc-utils/lsblk-lsblk.o
  CC       misc-utils/findmnt-findmnt.o
  CC       misc-utils/findmnt-findmnt-verify.o
  CC       login-utils/nologin.o
  CCLD     fsfreeze
  CC       disk-utils/mkfs.o
  CC       disk-utils/mkswap-mkswap.o
  CC       disk-utils/swaplabel-swaplabel.o
  CC       text-utils/col.o
  CC       text-utils/colcrt.o
  CC       text-utils/colrm.o
  CC       text-utils/column-column.o
  CC       text-utils/hexdump-conv.o
  CC       text-utils/hexdump-display.o
  CC       text-utils/hexdump.o
  CC       text-utils/hexdump-parse.o
  CC       text-utils/rev.o
  CC       term-utils/script-script.o
  CCLD     renice
  CCLD     setsid
  CCLD     setarch
  CCLD     look
  CCLD     namei
  CCLD     getopt
  CCLD     readprofile
  CCLD     libcommon.la
  CCLD     libtcolors.la
  CCLD     libuuid.la
  CCLD     nologin
  CCLD     mkfs
  CCLD     colcrt
  CCLD     colrm
  CCLD     hexdump
  CCLD     rev
  CCLD     script
  CCLD     scriptreplay
  CCLD     flock
  CCLD     ipcmk
  CCLD     mcookie
  CCLD     whereis
  CCLD     uuidgen
  CCLD     isosize
  CCLD     ldattach
  CCLD     rtcwake
  CCLD     libblkid.la
arm-linux-gnueabihf-gcc: error: ./.libs/libuuid.so: No such file or directory
make[4]: *** [Makefile:7297: uuidgen] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:12106: all-recursive] Error 1
make[2]: *** [Makefile:5009: all] Error 2
make[1]: *** [package/pkg-generic.mk:232: /home/jkt/work/prog/_build/br-cfb/build/util-linux-2.32.1/.stamp_built] Error 2
make: *** [Makefile:16: _all] Error 2
Matt Weber Aug. 21, 2018, 12:40 p.m. UTC | #2
Jan,
On Tue, Aug 21, 2018 at 2:53 AM Jan Kundrát <jan.kundrat@cesnet.cz> wrote:
>
> On úterý 14. srpna 2018 6:26:43 CEST, Matt Weber wrote:
> > Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
> > ---
> >  toolchain/toolchain-wrapper.c | 19 ++++++++++++++++++-
> >  1 file changed, 18 insertions(+), 1 deletion(-)
> >
> > diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
> > index c5eb813..d36771c 100644
> > --- a/toolchain/toolchain-wrapper.c
> > +++ b/toolchain/toolchain-wrapper.c
> > @@ -49,8 +49,9 @@ static char _date_[sizeof("-D__DATE__=\"MMM DD YYYY\"")];
> >   *   -D__TIME__=
> >   *   -D__DATE__=
> >   *   -Wno-builtin-macro-redefined
> > + *      -fPIE
>
> nit: this looks like a whitespace error (one too many spaces)
>
> >   */
> > -#define EXCLUSIVE_ARGS       6
> > +#define EXCLUSIVE_ARGS       7
> >
> >  static char *predef_args[] = {
> >  #ifdef BR_CCACHE
> > @@ -363,6 +364,22 @@ int main(int argc, char **argv)
> >               *cur++ = "-Wno-builtin-macro-redefined";
> >       }
> >
> > +#ifdef BR2_RELRO_FULL
> > +     /* Combinations of PIE and pic */
> > +     for (i = 1; i < argc; i++) {
> > +             if (!strcmp(argv[i], "-r") ||
> > +                 !strcmp(argv[i], "-fpie") ||
> > +                 !strcmp(argv[i], "-fPIE") ||
> > +                 !strcmp(argv[i], "-fpic") ||
> > +                 !strcmp(argv[i], "-fPIC") ||
> > +                 !strcmp(argv[i], "-fno-pic"))
> > +                     break;
> > +     }
> > +
> > +     if (i == argc)
> > +             *cur++ = "-fPIE";
> > +#endif
> > +
> >       paranoid_wrapper = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH");
> >       if (paranoid_wrapper && strlen(paranoid_wrapper) > 0)
> >               paranoid = 1;
>
> I needed some more patches to build with the following hardening settings:
>
> BR2_SSP_STRONG=y
> BR2_RELRO_FULL=y
> BR2_FORTIFY_SOURCE_2=y
>
> - https://patchwork.ozlabs.org/patch/865166/
> - https://patchwork.ozlabs.org/patch/865168/ (this one need changes so that
> it touches packages/libzlib/ now)
>
> Then my build failed when building util-linux, see the attached log.

Thanks for the feedback.  Sorry this topic has some loose ends at this
point with a couple un-applied patches and this RFC.

I'll send out a full patchset this week once I get past some
external/internal toolchain symlnk issues with *.br_real.

If you wouldn't mind sharing your defconfig, I'll give it a test
before I sent out the next series.

Matt
diff mbox series

Patch

diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
index c5eb813..d36771c 100644
--- a/toolchain/toolchain-wrapper.c
+++ b/toolchain/toolchain-wrapper.c
@@ -49,8 +49,9 @@  static char _date_[sizeof("-D__DATE__=\"MMM DD YYYY\"")];
  * 	-D__TIME__=
  * 	-D__DATE__=
  * 	-Wno-builtin-macro-redefined
+ *      -fPIE
  */
-#define EXCLUSIVE_ARGS	6
+#define EXCLUSIVE_ARGS	7
 
 static char *predef_args[] = {
 #ifdef BR_CCACHE
@@ -363,6 +364,22 @@  int main(int argc, char **argv)
 		*cur++ = "-Wno-builtin-macro-redefined";
 	}
 
+#ifdef BR2_RELRO_FULL
+	/* Combinations of PIE and pic */
+	for (i = 1; i < argc; i++) {
+		if (!strcmp(argv[i], "-r") ||
+		    !strcmp(argv[i], "-fpie") ||
+		    !strcmp(argv[i], "-fPIE") ||
+		    !strcmp(argv[i], "-fpic") ||
+		    !strcmp(argv[i], "-fPIC") ||
+		    !strcmp(argv[i], "-fno-pic"))
+			break;
+	}
+
+	if (i == argc)
+		*cur++ = "-fPIE";
+#endif
+
 	paranoid_wrapper = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH");
 	if (paranoid_wrapper && strlen(paranoid_wrapper) > 0)
 		paranoid = 1;