From dcdedf8d8460a032c0333f6050626a41b39ff461 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Thu, 6 Jun 2019 19:33:05 +0200 Subject: [PATCH] gnu: cross-base: Fix C++ cross-compilation problems with GCC 7. * gnu/packages/cross-base.scm (cross-gcc-arguments)[#:configure-flags]: Add "--with-sysroot=/". --- gnu/packages/cross-base.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 9fcf3bd780..0bd0cb3987 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -120,7 +120,15 @@ base compiler and using LIBC (which may be either a libc package or #f.)" ,@(if libc `( ;; Disable libcilkrts because it is not ;; ported to GNU/Hurd. - "--disable-libcilkrts") + "--disable-libcilkrts" + ;; When building a cross compiler, --with-sysroot is + ;; implicitly set to "$gcc_tooldir/sys-root". This does + ;; not work for us, because --with-native-system-header-dir + ;; is searched for relative to this location. Thus, we set + ;; it to "/" so GCC is able to find the target libc headers. + ;; This is safe because in practice GCC uses CROSS_CPATH + ;; & co to separate target and host libraries. + "--with-sysroot=/") `( ;; Disable features not needed at this stage. "--disable-shared" "--enable-static" "--enable-languages=c,c++" -- 2.21.0