diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 9ff5e3d7c0..8969fefd84 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -530,6 +530,12 @@ Go. It also includes runtime support libraries for these languages.") (patches (search-patches "gcc-strmov-store-file-names.patch" "gcc-7-libsanitizer-mode-size.patch" "gcc-5.0-libvtv-runpath.patch")))) + (inputs + ;; XXX: This gross hack allows us to have libstdc++'s + ;; in the search path, thereby avoiding misconfiguration of libstdc++: + ;; . + `(("libstdc++" ,libstdc++-headers) + ,@(package-inputs gcc-6))) (description "GCC is the GNU Compiler Collection. It provides compiler front-ends for several languages, including C, C++, Objective-C, Fortran, Ada, and Go. @@ -607,6 +613,31 @@ using compilers other than GCC." (propagated-inputs '()) (synopsis "GNU C++ standard library"))) +(define libstdc++ + ;; Libstdc++ matching the default GCC. + (make-libstdc++ gcc)) + +(define libstdc++-headers + ;; XXX: This package is for internal use to work around + ;; (see above). The main difference compared + ;; to the libstdc++ headers that come with 'gcc' is that + ;; is right under include/c++ and not under + ;; include/c++/x86_64-unknown-linux-gnu (aka. GPLUSPLUS_TOOL_INCLUDE_DIR). + (package + (inherit libstdc++) + (name "libstdc++-headers") + (outputs '("out")) + (build-system trivial-build-system) + (arguments + '(#:builder (let* ((out (assoc-ref %outputs "out")) + (libstdc++ (assoc-ref %build-inputs "libstdc++"))) + (mkdir out) + (mkdir (string-append out "/include")) + (symlink (string-append libstdc++ "/include") + (string-append out "/include/c++"))))) + (inputs `(("libstdc++" ,libstdc++))) + (synopsis "Headers of GNU libstdc++"))) + (define-public libstdc++-4.9 (make-libstdc++ gcc-4.9))