gnu: gcc-4.7: Hide package.

* gnu/packages/gcc.scm (gcc-4.7): Wrap in "hidden-package" expression.
This commit is contained in:
Ricardo Wurmus 2019-02-12 23:21:48 +01:00
parent 935568d5ce
commit d78010b81e
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 185 additions and 184 deletions

View File

@ -139,220 +139,221 @@ where the OS part is overloaded to denote a specific ABI---into GCC
(gcc-configure-flags-for-triplet triplet)) (gcc-configure-flags-for-triplet triplet))
(maybe-target-tools)))))) (maybe-target-tools))))))
(package (hidden-package
(name "gcc") (package
(version "4.7.4") (name "gcc")
(source (origin (version "4.7.4")
(method url-fetch) (source (origin
(uri (string-append "mirror://gnu/gcc/gcc-" (method url-fetch)
version "/gcc-" version ".tar.bz2")) (uri (string-append "mirror://gnu/gcc/gcc-"
(sha256 version "/gcc-" version ".tar.bz2"))
(base32 (sha256
"10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj")) (base32
(patches (search-patches "gcc-4-compile-with-gcc-5.patch" "10k2k71kxgay283ylbbhhs51cl55zn2q38vj5pk4k950qdnirrlj"))
"gcc-fix-texi2pod.patch")))) (patches (search-patches "gcc-4-compile-with-gcc-5.patch"
(build-system gnu-build-system) "gcc-fix-texi2pod.patch"))))
(build-system gnu-build-system)
;; Separate out the run-time support libraries because all the ;; Separate out the run-time support libraries because all the
;; dynamic-linked objects depend on it. ;; dynamic-linked objects depend on it.
(outputs '("out" ;commands, etc. (60+ MiB) (outputs '("out" ;commands, etc. (60+ MiB)
"lib" ;libgcc_s, libgomp, etc. (15+ MiB) "lib" ;libgcc_s, libgomp, etc. (15+ MiB)
"debug")) ;debug symbols of run-time libraries "debug")) ;debug symbols of run-time libraries
(inputs `(("gmp" ,gmp) (inputs `(("gmp" ,gmp)
("mpfr" ,mpfr) ("mpfr" ,mpfr)
("mpc" ,mpc) ("mpc" ,mpc)
("libelf" ,libelf) ("libelf" ,libelf)
("zlib" ,zlib))) ("zlib" ,zlib)))
;; GCC < 5 is one of the few packages that doesn't ship .info files. ;; GCC < 5 is one of the few packages that doesn't ship .info files.
;; Newer texinfos fail to build the manual, so we use an older one. ;; Newer texinfos fail to build the manual, so we use an older one.
(native-inputs `(("perl" ,perl) ;for manpages (native-inputs `(("perl" ,perl) ;for manpages
("texinfo" ,texinfo-5))) ("texinfo" ,texinfo-5)))
(arguments (arguments
`(#:out-of-source? #t `(#:out-of-source? #t
#:configure-flags ,(configure-flags) #:configure-flags ,(configure-flags)
#:make-flags #:make-flags
;; None of the flags below are needed when doing a Canadian cross. ;; None of the flags below are needed when doing a Canadian cross.
;; TODO: Simplify this. ;; TODO: Simplify this.
,(if (%current-target-system) ,(if (%current-target-system)
(if stripped? (if stripped?
''("CFLAGS=-g0 -O2") ''("CFLAGS=-g0 -O2")
''()) ''())
`(let* ((libc (assoc-ref %build-inputs "libc")) `(let* ((libc (assoc-ref %build-inputs "libc"))
(libc-native (or (assoc-ref %build-inputs "libc-native") (libc-native (or (assoc-ref %build-inputs "libc-native")
libc))) libc)))
`(,@(if libc `(,@(if libc
(list (string-append "LDFLAGS_FOR_TARGET=" (list (string-append "LDFLAGS_FOR_TARGET="
"-B" libc "/lib " "-B" libc "/lib "
"-Wl,-dynamic-linker " "-Wl,-dynamic-linker "
"-Wl," libc "-Wl," libc
,(glibc-dynamic-linker))) ,(glibc-dynamic-linker)))
'()) '())
;; Native programs like 'genhooks' also need that right. ;; Native programs like 'genhooks' also need that right.
,(string-append "LDFLAGS=" ,(string-append "LDFLAGS="
"-Wl,-rpath=" libc-native "/lib " "-Wl,-rpath=" libc-native "/lib "
"-Wl,-dynamic-linker " "-Wl,-dynamic-linker "
"-Wl," libc-native ,(glibc-dynamic-linker)) "-Wl," libc-native ,(glibc-dynamic-linker))
,(string-append "BOOT_CFLAGS=-O2 " ,(string-append "BOOT_CFLAGS=-O2 "
,(if stripped? "-g0" "-g"))))) ,(if stripped? "-g0" "-g")))))
#:tests? #f #:tests? #f
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-before 'configure 'pre-configure (add-before 'configure 'pre-configure
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((libdir ,(libdir)) (let ((libdir ,(libdir))
(libc (assoc-ref inputs "libc"))) (libc (assoc-ref inputs "libc")))
(when libc (when libc
;; The following is not performed for `--without-headers' ;; The following is not performed for `--without-headers'
;; cross-compiler builds. ;; cross-compiler builds.
;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a ;; Join multi-line definitions of GLIBC_DYNAMIC_LINKER* into a
;; single line, to allow the next step to work properly. ;; single line, to allow the next step to work properly.
(for-each (for-each
(lambda (x) (lambda (x)
(substitute* (find-files "gcc/config"
"^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
(("(#define (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$" _ line)
line)))
'(1 2 3))
;; Fix the dynamic linker's file name.
(substitute* (find-files "gcc/config" (substitute* (find-files "gcc/config"
"^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$") "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
(("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$" (("(#define (GLIBC|GNU_USER)_DYNAMIC_LINKER.*)\\\\\n$" _ line)
_ gnu-user suffix) line)))
(format #f "#define ~a_DYNAMIC_LINKER~a \"~a\"~%" '(1 2 3))
gnu-user suffix
(string-append libc ,(glibc-dynamic-linker)))))
;; Tell where to find libstdc++, libc, and `?crt*.o', except ;; Fix the dynamic linker's file name.
;; `crt{begin,end}.o', which come with GCC. (substitute* (find-files "gcc/config"
(substitute* (find-files "gcc/config" "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
"^gnu-user.*\\.h$") (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$"
(("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix) _ gnu-user suffix)
;; Help libgcc_s.so be found (see also below.) Always use (format #f "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
;; '-lgcc_s' so that libgcc_s.so is always found by those gnu-user suffix
;; programs that use 'pthread_cancel' (glibc dlopens (string-append libc ,(glibc-dynamic-linker)))))
;; libgcc_s.so when pthread_cancel support is needed, but
;; having it in the application's RUNPATH isn't enough; see ;; Tell where to find libstdc++, libc, and `?crt*.o', except
;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.) ;; `crt{begin,end}.o', which come with GCC.
;; (substitute* (find-files "gcc/config"
;; NOTE: The '-lgcc_s' added below needs to be removed in a "^gnu-user.*\\.h$")
;; later phase of %gcc-static. If you change the string (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
;; below, make sure to update the relevant code in ;; Help libgcc_s.so be found (see also below.) Always use
;; %gcc-static package as needed. ;; '-lgcc_s' so that libgcc_s.so is always found by those
(format #f "#define GNU_USER_TARGET_LIB_SPEC \ ;; programs that use 'pthread_cancel' (glibc dlopens
;; libgcc_s.so when pthread_cancel support is needed, but
;; having it in the application's RUNPATH isn't enough; see
;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
;;
;; NOTE: The '-lgcc_s' added below needs to be removed in a
;; later phase of %gcc-static. If you change the string
;; below, make sure to update the relevant code in
;; %gcc-static package as needed.
(format #f "#define GNU_USER_TARGET_LIB_SPEC \
\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a" \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
libc libc libdir suffix)) libc libc libdir suffix))
(("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line) (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
(format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
#define STANDARD_STARTFILE_PREFIX_2 \"\" #define STANDARD_STARTFILE_PREFIX_2 \"\"
~a" ~a"
libc line))) libc line)))
;; The rs6000 (a.k.a. powerpc) config in GCC does not use ;; The rs6000 (a.k.a. powerpc) config in GCC does not use
;; GNU_USER_* defines. Do the above for this case. ;; GNU_USER_* defines. Do the above for this case.
(substitute* (substitute*
"gcc/config/rs6000/sysv4.h" "gcc/config/rs6000/sysv4.h"
(("#define LIB_LINUX_SPEC (.*)$" _ suffix) (("#define LIB_LINUX_SPEC (.*)$" _ suffix)
(format #f "#define LIB_LINUX_SPEC \ (format #f "#define LIB_LINUX_SPEC \
\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a" \"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
libc libc libdir suffix)) libc libc libdir suffix))
(("#define STARTFILE_LINUX_SPEC.*$" line) (("#define STARTFILE_LINUX_SPEC.*$" line)
(format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\" (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
#define STANDARD_STARTFILE_PREFIX_2 \"\" #define STANDARD_STARTFILE_PREFIX_2 \"\"
~a" ~a"
libc line)))) libc line))))
;; Don't retain a dependency on the build-time sed. ;; Don't retain a dependency on the build-time sed.
(substitute* "fixincludes/fixincl.x" (substitute* "fixincludes/fixincl.x"
(("static char const sed_cmd_z\\[\\] =.*;") (("static char const sed_cmd_z\\[\\] =.*;")
"static char const sed_cmd_z[] = \"sed\";")) "static char const sed_cmd_z[] = \"sed\";"))
;; Aarch64 support didn't land in GCC until the 4.8 series. ;; Aarch64 support didn't land in GCC until the 4.8 series.
(when (file-exists? "gcc/config/aarch64") (when (file-exists? "gcc/config/aarch64")
;; Force Aarch64 libdir to be /lib and not /lib64 ;; Force Aarch64 libdir to be /lib and not /lib64
(substitute* "gcc/config/aarch64/t-aarch64-linux" (substitute* "gcc/config/aarch64/t-aarch64-linux"
(("lib64") "lib"))) (("lib64") "lib")))
(when (file-exists? "libbacktrace") (when (file-exists? "libbacktrace")
;; GCC 4.8+ comes with libbacktrace. By default it builds ;; GCC 4.8+ comes with libbacktrace. By default it builds
;; with -Werror, which fails with a -Wcast-qual error in glibc ;; with -Werror, which fails with a -Wcast-qual error in glibc
;; 2.21's stdlib-bsearch.h. Remove -Werror. ;; 2.21's stdlib-bsearch.h. Remove -Werror.
(substitute* "libbacktrace/configure" (substitute* "libbacktrace/configure"
(("WARN_FLAGS=(.*)-Werror" _ flags) (("WARN_FLAGS=(.*)-Werror" _ flags)
(string-append "WARN_FLAGS=" flags))) (string-append "WARN_FLAGS=" flags)))
(when (file-exists? "libsanitizer/libbacktrace") (when (file-exists? "libsanitizer/libbacktrace")
;; Same in libsanitizer's bundled copy (!) found in 4.9+. ;; Same in libsanitizer's bundled copy (!) found in 4.9+.
(substitute* "libsanitizer/libbacktrace/Makefile.in" (substitute* "libsanitizer/libbacktrace/Makefile.in"
(("-Werror") (("-Werror")
"")))) ""))))
;; Add a RUNPATH to libstdc++.so so that it finds libgcc_s. ;; Add a RUNPATH to libstdc++.so so that it finds libgcc_s.
;; See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354> ;; See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32354>
;; and <http://bugs.gnu.org/20358>. ;; and <http://bugs.gnu.org/20358>.
(substitute* "libstdc++-v3/src/Makefile.in" (substitute* "libstdc++-v3/src/Makefile.in"
(("^OPT_LDFLAGS = ") (("^OPT_LDFLAGS = ")
"OPT_LDFLAGS = -Wl,-rpath=$(libdir) ")) "OPT_LDFLAGS = -Wl,-rpath=$(libdir) "))
;; Move libstdc++*-gdb.py to the "lib" output to avoid a ;; Move libstdc++*-gdb.py to the "lib" output to avoid a
;; circularity between "out" and "lib". (Note: ;; circularity between "out" and "lib". (Note:
;; --with-python-dir is useless because it imposes $(prefix) as ;; --with-python-dir is useless because it imposes $(prefix) as
;; the parent directory.) ;; the parent directory.)
(substitute* "libstdc++-v3/python/Makefile.in" (substitute* "libstdc++-v3/python/Makefile.in"
(("pythondir = .*$") (("pythondir = .*$")
(string-append "pythondir = " libdir "/share" (string-append "pythondir = " libdir "/share"
"/gcc-$(gcc_version)/python\n"))) "/gcc-$(gcc_version)/python\n")))
;; Avoid another circularity between the outputs: this #define ;; Avoid another circularity between the outputs: this #define
;; ends up in auto-host.h in the "lib" output, referring to ;; ends up in auto-host.h in the "lib" output, referring to
;; "out". (This variable is used to augment cpp's search path, ;; "out". (This variable is used to augment cpp's search path,
;; but there's nothing useful to look for here.) ;; but there's nothing useful to look for here.)
(substitute* "gcc/config.in" (substitute* "gcc/config.in"
(("PREFIX_INCLUDE_DIR") (("PREFIX_INCLUDE_DIR")
"PREFIX_INCLUDE_DIR_isnt_necessary_here")) "PREFIX_INCLUDE_DIR_isnt_necessary_here"))
#t))) #t)))
(add-after 'configure 'post-configure (add-after 'configure 'post-configure
(lambda _ (lambda _
;; Don't store configure flags, to avoid retaining references to ;; Don't store configure flags, to avoid retaining references to
;; build-time dependencies---e.g., `--with-ppl=/gnu/store/xxx'. ;; build-time dependencies---e.g., `--with-ppl=/gnu/store/xxx'.
(substitute* "Makefile" (substitute* "Makefile"
(("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest) (("^TOPLEVEL_CONFIGURE_ARGUMENTS=(.*)$" _ rest)
"TOPLEVEL_CONFIGURE_ARGUMENTS=\n")) "TOPLEVEL_CONFIGURE_ARGUMENTS=\n"))
#t))))) #t)))))
(native-search-paths (native-search-paths
;; Use the language-specific variables rather than 'CPATH' because they ;; Use the language-specific variables rather than 'CPATH' because they
;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'. ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.
;; The intent is to allow headers that are in the search path to be ;; The intent is to allow headers that are in the search path to be
;; treated as "system headers" (headers exempt from warnings) just like ;; treated as "system headers" (headers exempt from warnings) just like
;; the typical /usr/include headers on an FHS system. ;; the typical /usr/include headers on an FHS system.
(list (search-path-specification (list (search-path-specification
(variable "C_INCLUDE_PATH") (variable "C_INCLUDE_PATH")
(files '("include"))) (files '("include")))
(search-path-specification (search-path-specification
(variable "CPLUS_INCLUDE_PATH") (variable "CPLUS_INCLUDE_PATH")
(files '("include"))) (files '("include")))
(search-path-specification (search-path-specification
(variable "LIBRARY_PATH") (variable "LIBRARY_PATH")
(files '("lib" "lib64"))))) (files '("lib" "lib64")))))
(properties `((gcc-libc . ,(assoc-ref inputs "libc")))) (properties `((gcc-libc . ,(assoc-ref inputs "libc"))))
(synopsis "GNU Compiler Collection") (synopsis "GNU Compiler Collection")
(description (description
"GCC is the GNU Compiler Collection. It provides compiler front-ends "GCC is the GNU Compiler Collection. It provides compiler front-ends
for several languages, including C, C++, Objective-C, Fortran, Java, Ada, and for several languages, including C, C++, Objective-C, Fortran, Java, Ada, and
Go. It also includes runtime support libraries for these languages.") Go. It also includes runtime support libraries for these languages.")
(license gpl3+) (license gpl3+)
(supported-systems (delete "aarch64-linux" %supported-systems)) (supported-systems (delete "aarch64-linux" %supported-systems))
(home-page "https://gcc.gnu.org/")))) (home-page "https://gcc.gnu.org/")))))
(define-public gcc-4.8 (define-public gcc-4.8
(package (inherit gcc-4.7) (package (inherit gcc-4.7)