diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 9487ac9238..6e64450b13 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2019, 2020, 2021 Marius Bakke ;;; Copyright © 2019 Carl Dong ;;; Copyright © 2020 Mathieu Othacehe +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -169,12 +170,23 @@ base compiler and using LIBC (which may be either a libc package or #f.)" )) ;; Install cross-built libraries such as libgcc_s.so in - ;; the "lib" output. + ;; the "lib" output. (But see below.) ,@(if libc `((string-append "--with-toolexeclibdir=" (assoc-ref %outputs "lib") "/" ,target "/lib")) '()) + ;; At least for GCC 8.0, libgcc_s.so and libstdc++.so + ;; are not installed in the location specified in + ;; --with-toolexeclibdir so GCC will not find it + ;; when cross-compiling, say, GNU Hello. + ;; + ;; Work-around by specifying slibdir. + ,@(if (and libc (version>=? (package-version xgcc) "8.0")) + `((string-append "--with-slibdir=" + (assoc-ref %outputs "lib") + "/" ,target "/lib")) + '()) ;; For a newlib (non-glibc) target ,@(if (cross-newlib? target) '("--with-newlib")