lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

gcc: if atLeast 4.8, use deduplicated version

+34 -340
-325
pkgs/development/compilers/gcc/4.8/default.nix
··· 1 - { lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs 2 - , langC ? true, langCC ? true, langFortran ? false 3 - , langObjC ? stdenv.targetPlatform.isDarwin 4 - , langObjCpp ? stdenv.targetPlatform.isDarwin 5 - , langJava ? false 6 - , langGo ? false 7 - , reproducibleBuild ? true 8 - , profiledCompiler ? false 9 - , langJit ? false 10 - , staticCompiler ? false 11 - , enableShared ? stdenv.targetPlatform.hasSharedLibraries 12 - , enableLTO ? stdenv.hostPlatform.hasSharedLibraries 13 - , texinfo ? null 14 - , perl ? null # optional, for texi2pod (then pod2man); required for Java 15 - , gmp, mpfr, libmpc, gettext, which, patchelf, binutils 16 - , cloog ? null, isl ? null # optional, for the Graphite optimization framework. 17 - , zlib ? null, boehmgc ? null 18 - , zip ? null, unzip ? null, pkg-config ? null 19 - , gtk2 ? null, libart_lgpl ? null 20 - , libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null 21 - , libXrender ? null, xorgproto ? null 22 - , libXrandr ? null, libXi ? null 23 - , x11Support ? langJava 24 - , enableMultilib ? false 25 - , enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins 26 - , name ? "gcc" 27 - , libcCross ? null 28 - , threadsCross ? null # for MinGW 29 - , withoutTargetLibc ? false 30 - , gnused ? null 31 - , buildPackages 32 - , callPackage 33 - }: 34 - 35 - assert langJava -> zip != null && unzip != null 36 - && zlib != null && boehmgc != null 37 - && perl != null; # for `--enable-java-home' 38 - 39 - # We enable the isl cloog backend. 40 - assert cloog != null -> isl != null; 41 - 42 - # Make sure we get GNU sed. 43 - assert stdenv.buildPlatform.isDarwin -> gnused != null; 44 - 45 - # The go frontend is written in c++ 46 - assert langGo -> langCC; 47 - 48 - # threadsCross is just for MinGW 49 - assert threadsCross != {} -> stdenv.targetPlatform.isWindows; 50 - 51 - # profiledCompiler builds inject non-determinism in one of the compilation stages. 52 - # If turned on, we can't provide reproducible builds anymore 53 - assert reproducibleBuild -> profiledCompiler == false; 54 - 55 - with lib; 56 - with builtins; 57 - 58 - let majorVersion = "4"; 59 - version = "${majorVersion}.8.5"; 60 - 61 - inherit (stdenv) buildPlatform hostPlatform targetPlatform; 62 - 63 - patches = [ ../parallel-bconfig.patch ] 64 - ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch 65 - ++ optional noSysDirs ../no-sys-dirs.patch 66 - ++ optional langFortran ../gfortran-driving.patch 67 - ++ optional hostPlatform.isDarwin ../gfortran-darwin-NXConstStr.patch 68 - ++ [(fetchpatch { 69 - name = "libc_name_p.diff"; # needed to build with gcc6 70 - url = "https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=ec1cc0263f1"; 71 - sha256 = "01jd7pdarh54ki498g6sz64ijl9a1l5f9v8q2696aaxalvh2vwzl"; 72 - excludes = [ "gcc/cp/ChangeLog" ]; 73 - })] 74 - ++ [ # glibc-2.26 75 - ../struct-ucontext-4.8.patch 76 - ../sigsegv-not-declared.patch 77 - ../res_state-not-declared.patch 78 - # gcc-11 compatibility 79 - (fetchpatch { 80 - name = "gcc4-char-reload.patch"; 81 - url = "https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=d57c99458933a21fdf94f508191f145ad8d5ec58"; 82 - includes = [ "gcc/reload.h" ]; 83 - sha256 = "sha256-66AMP7/ajunGKAN5WJz/yPn42URZ2KN51yPrFdsxEuM="; 84 - }) 85 - ]; 86 - 87 - javaEcj = fetchurl { 88 - # The `$(top_srcdir)/ecj.jar' file is automatically picked up at 89 - # `configure' time. 90 - 91 - # XXX: Eventually we might want to take it from upstream. 92 - url = "ftp://sourceware.org/pub/java/ecj-4.3.jar"; 93 - sha256 = "0jz7hvc0s6iydmhgh5h2m15yza7p2rlss2vkif30vm9y77m97qcx"; 94 - }; 95 - 96 - # Antlr (optional) allows the Java `gjdoc' tool to be built. We want a 97 - # binary distribution here to allow the whole chain to be bootstrapped. 98 - javaAntlr = fetchurl { 99 - url = "https://www.antlr.org/download/antlr-4.4-complete.jar"; 100 - sha256 = "02lda2imivsvsis8rnzmbrbp8rh1kb8vmq4i67pqhkwz7lf8y6dz"; 101 - }; 102 - 103 - xlibs = [ 104 - libX11 libXt libSM libICE libXtst libXrender libXrandr libXi 105 - xorgproto 106 - ]; 107 - 108 - javaAwtGtk = langJava && x11Support; 109 - 110 - /* Cross-gcc settings (build == host != target) */ 111 - crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; 112 - stageNameAddon = if withoutTargetLibc then "stage-static" else "stage-final"; 113 - crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-"; 114 - 115 - callFile = lib.callPackageWith { 116 - # lets 117 - inherit 118 - majorVersion 119 - version 120 - buildPlatform 121 - hostPlatform 122 - targetPlatform 123 - patches 124 - javaEcj 125 - javaAntlr 126 - xlibs 127 - javaAwtGtk 128 - crossMingw 129 - stageNameAddon 130 - crossNameAddon 131 - ; 132 - # inherit generated with 'nix eval --json --impure --expr "with import ./. {}; lib.attrNames (lib.functionArgs gcc48.cc.override)" | jq '.[]' --raw-output' 133 - inherit 134 - binutils 135 - boehmgc 136 - buildPackages 137 - cloog 138 - withoutTargetLibc 139 - enableLTO 140 - enableMultilib 141 - enablePlugin 142 - enableShared 143 - fetchpatch 144 - fetchurl 145 - gettext 146 - gmp 147 - gnused 148 - gtk2 149 - isl 150 - langC 151 - langCC 152 - langFortran 153 - langGo 154 - langJava 155 - langJit 156 - langObjC 157 - langObjCpp 158 - lib 159 - libICE 160 - libSM 161 - libX11 162 - libXi 163 - libXrandr 164 - libXrender 165 - libXt 166 - libXtst 167 - libart_lgpl 168 - libcCross threadsCross 169 - libmpc 170 - mpfr 171 - name 172 - noSysDirs 173 - patchelf 174 - perl 175 - pkg-config 176 - profiledCompiler 177 - reproducibleBuild 178 - staticCompiler 179 - stdenv 180 - targetPackages 181 - texinfo 182 - unzip 183 - which 184 - x11Support 185 - xorgproto 186 - zip 187 - zlib 188 - ; 189 - }; 190 - 191 - in 192 - 193 - # We need all these X libraries when building AWT with GTK. 194 - assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == []; 195 - 196 - lib.pipe ((callFile ../common/builder.nix {}) ({ 197 - pname = "${crossNameAddon}${name}"; 198 - inherit version; 199 - 200 - src = fetchurl { 201 - url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2"; 202 - sha256 = "08yggr18v373a1ihj0rg2vd6psnic42b518xcgp3r9k81xz1xyr2"; 203 - }; 204 - 205 - inherit patches; 206 - 207 - hardeningDisable = [ "format" "pie" ]; 208 - 209 - outputs = [ "out" "lib" "man" "info" ]; 210 - setOutputFlags = false; 211 - NIX_NO_SELF_RPATH = true; 212 - 213 - libc_dev = stdenv.cc.libc_dev; 214 - 215 - postPatch = 216 - if targetPlatform != hostPlatform || stdenv.cc.libc != null then 217 - # On NixOS, use the right path to the dynamic linker instead of 218 - # `/lib/ld*.so'. 219 - let 220 - libc = if libcCross != null then libcCross else stdenv.cc.libc; 221 - in 222 - '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..." 223 - for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h 224 - do 225 - grep -q LIBC_DYNAMIC_LINKER "$header" || continue 226 - echo " fixing \`$header'..." 227 - sed -i "$header" \ 228 - -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' 229 - done 230 - '' 231 - else null; 232 - 233 - inherit noSysDirs staticCompiler langJava withoutTargetLibc 234 - libcCross crossMingw; 235 - 236 - inherit (callFile ../common/dependencies.nix { }) 237 - depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget; 238 - 239 - preConfigure = callFile ../common/pre-configure.nix { }; 240 - 241 - dontDisableStatic = true; 242 - 243 - configurePlatforms = [ "build" "host" "target" ]; 244 - 245 - configureFlags = callFile ../common/configure-flags.nix { }; 246 - 247 - targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; 248 - 249 - buildFlags = optional 250 - (targetPlatform == hostPlatform && hostPlatform == buildPlatform) 251 - (if profiledCompiler then "profiledbootstrap" else "bootstrap"); 252 - 253 - inherit (callFile ../common/strip-attributes.nix { }) 254 - stripDebugList 255 - stripDebugListTarget 256 - preFixup; 257 - 258 - # https://gcc.gnu.org/PR109898 259 - enableParallelInstalling = false; 260 - 261 - doCheck = false; # requires a lot of tools, causes a dependency cycle for stdenv 262 - 263 - # https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 264 - ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; 265 - 266 - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the 267 - # library headers and binaries, regarless of the language being compiled. 268 - # 269 - # Note: When building the Java AWT GTK peer, the build system doesn't honor 270 - # `--with-gmp' et al., e.g., when building 271 - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add 272 - # them to $CPATH and $LIBRARY_PATH in this case. 273 - # 274 - # Likewise, the LTO code doesn't find zlib. 275 - # 276 - # Cross-compiling, we need gcc not to read ./specs in order to build the g++ 277 - # compiler (after the specs for the cross-gcc are created). Having 278 - # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. 279 - 280 - CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] 281 - ++ optional (zlib != null) zlib 282 - ++ optional langJava boehmgc 283 - ++ optionals javaAwtGtk xlibs 284 - ++ optionals javaAwtGtk [ gmp mpfr ] 285 - )); 286 - 287 - LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] 288 - ++ optional (zlib != null) zlib 289 - ++ optional langJava boehmgc 290 - ++ optionals javaAwtGtk xlibs 291 - ++ optionals javaAwtGtk [ gmp mpfr ] 292 - )); 293 - 294 - inherit (callFile ../common/extra-target-flags.nix { }) 295 - EXTRA_FLAGS_FOR_TARGET 296 - EXTRA_LDFLAGS_FOR_TARGET 297 - ; 298 - 299 - passthru = { 300 - inherit langC langCC langObjC langObjCpp langFortran langGo version; 301 - isGNU = true; 302 - hardeningUnsupportedFlags = [ "stackprotector" "fortify3" ]; 303 - }; 304 - 305 - enableParallelBuilding = true; 306 - inherit enableShared enableMultilib; 307 - 308 - meta = { 309 - inherit (callFile ../common/meta.nix { }) 310 - homepage 311 - license 312 - description 313 - longDescription 314 - platforms 315 - maintainers 316 - ; 317 - badPlatforms = lib.platforms.darwin; 318 - }; 319 - } 320 - 321 - // optionalAttrs (enableMultilib) { dontMoveLib64 = true; } 322 - )) 323 - [ 324 - (callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc enableShared; }) 325 - ]
+33 -14
pkgs/development/compilers/gcc/default.nix
··· 54 54 atLeast8 = lib.versionAtLeast version "8"; 55 55 atLeast7 = lib.versionAtLeast version "7"; 56 56 atLeast6 = lib.versionAtLeast version "6"; 57 + atLeast49 = lib.versionAtLeast version "4.9"; 57 58 in 58 59 59 60 # We enable the isl cloog backend. 60 61 assert !atLeast6 -> (cloog != null -> isl != null); 61 62 62 63 assert langJava -> !atLeast7 && zip != null && unzip != null && zlib != null && boehmgc != null && perl != null; # for `--enable-java-home' 63 - 64 - # only gcc>=4.9 is currently supported 65 - assert lib.versionAtLeast version "4.9"; 66 64 67 65 # Make sure we get GNU sed. 68 66 assert stdenv.buildPlatform.isDarwin -> gnused != null; ··· 92 90 inherit (stdenv) buildPlatform hostPlatform targetPlatform; 93 91 94 92 patches = 95 - optionals (!atLeast7) [ 93 + optionals (atLeast49 && !atLeast7) [ 96 94 ./9/fix-struct-redefinition-on-glibc-2.36.patch 97 - ] ++ optionals ((!atLeast7 && !stdenv.targetPlatform.isRedox) || !atLeast6) [ 95 + ] ++ optionals (atLeast49 && ((!atLeast7 && !stdenv.targetPlatform.isRedox) || !atLeast6)) [ 98 96 ./use-source-date-epoch.patch 99 97 ] ++ optionals (atLeast6 && !atLeast7 && !stdenv.targetPlatform.isRedox) [ 100 98 ./6/0001-Fix-build-for-glibc-2.31.patch 101 99 ] ++ optionals (!atLeast6) [ 102 100 ./parallel-bconfig.patch 101 + ] ++ optionals (atLeast49 && !atLeast6) [ 103 102 (./. + "/${lib.versions.major version}.${lib.versions.minor version}/parallel-strsignal.patch") 104 103 (./. + "/${lib.versions.major version}.${lib.versions.minor version}/libsanitizer.patch") 105 104 (fetchpatch { ··· 160 159 sha256 = "0mrvxsdwip2p3l17dscpc1x8vhdsciqw1z5q9i6p5g9yg1cqnmgs"; 161 160 }) 162 161 ++ optional langFortran ../gfortran-driving.patch 163 - ++ optionals (!atLeast6) [ 162 + ++ optional (!atLeast49 && hostPlatform.isDarwin) ../gfortran-darwin-NXConstStr.patch 163 + ++ optionals (atLeast49 && !atLeast6) [ 164 164 # glibc-2.26 165 165 ./struct-ucontext.patch 166 166 ./struct-sigaltstack-4.9.patch ··· 234 234 ./Added-mcf-thread-model-support-from-mcfgthread.patch 235 235 236 236 # Retpoline patches pulled from the branch hjl/indirect/gcc-4_9-branch (by H.J. Lu, the author of GCC upstream retpoline commits) 237 - ++ optionals (!atLeast6) (builtins.map ({commit, sha256}: fetchpatch {url = "https://github.com/hjl-tools/gcc/commit/${commit}.patch"; inherit sha256;}) 237 + ++ optionals (atLeast49 && !atLeast6) (builtins.map ({commit, sha256}: fetchpatch {url = "https://github.com/hjl-tools/gcc/commit/${commit}.patch"; inherit sha256;}) 238 238 [{ commit = "e623d21608e96ecd6b65f0d06312117d20488a38"; sha256 = "1ix8i4d2r3ygbv7npmsdj790rhxqrnfwcqzv48b090r9c3ij8ay3"; } 239 239 { commit = "2015a09e332309f12de1dadfe179afa6a29368b8"; sha256 = "0xcfs0cbb63llj2gbcdrvxim79ax4k4aswn0a3yjavxsj71s1n91"; } 240 240 { commit = "6b11591f4494f705e8746e7d58b7f423191f4e92"; sha256 = "0aydyhsm2ig0khgbp27am7vq7liyqrq6kfhfi2ki0ij0ab1hfbga"; } ··· 249 249 { commit = "1e961ed49b18e176c7457f53df2433421387c23b"; sha256 = "04dnqqs4qsvz4g8cq6db5id41kzys7hzhcaycwmc9rpqygs2ajwz"; } 250 250 { commit = "e137c72d099f9b3b47f4cc718aa11eab14df1a9c"; sha256 = "1ms0dmz74yf6kwgjfs4d2fhj8y6mcp2n184r3jk44wx2xc24vgb2"; }]) 251 251 252 - ++ optional (!atLeast9) ./libsanitizer-no-cyclades-9.patch 253 - ++ optional (!atLeast6) [ 252 + ++ optional (atLeast49 && !atLeast9) ./libsanitizer-no-cyclades-9.patch 253 + ++ optional (atLeast49 && !atLeast6) [ 254 254 # gcc-11 compatibility 255 255 (fetchpatch { 256 256 name = "gcc4-char-reload.patch"; ··· 266 266 ++ optional (majorVersion == "10" && buildPlatform.system == "aarch64-darwin" && targetPlatform != buildPlatform) (fetchpatch { 267 267 url = "https://raw.githubusercontent.com/richard-vd/musl-cross-make/5e9e87f06fc3220e102c29d3413fbbffa456fcd6/patches/gcc-${version}/0008-darwin-aarch64-self-host-driver.patch"; 268 268 sha256 = "sha256-XtykrPd5h/tsnjY1wGjzSOJ+AyyNLsfnjuOZ5Ryq9vA="; 269 - }); 269 + }) 270 + ++ lib.optionals (!atLeast49) [ 271 + (fetchpatch { 272 + name = "libc_name_p.diff"; # needed to build with gcc6 273 + url = "https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=ec1cc0263f1"; 274 + sha256 = "01jd7pdarh54ki498g6sz64ijl9a1l5f9v8q2696aaxalvh2vwzl"; 275 + excludes = [ "gcc/cp/ChangeLog" ]; 276 + }) 277 + # glibc-2.26 278 + ./struct-ucontext-4.8.patch 279 + ./sigsegv-not-declared.patch 280 + ./res_state-not-declared.patch 281 + # gcc-11 compatibility 282 + (fetchpatch { 283 + name = "gcc4-char-reload.patch"; 284 + url = "https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=d57c99458933a21fdf94f508191f145ad8d5ec58"; 285 + includes = [ "gcc/reload.h" ]; 286 + sha256 = "sha256-66AMP7/ajunGKAN5WJz/yPn42URZ2KN51yPrFdsxEuM="; 287 + }) 288 + ]; 270 289 271 290 /* Cross-gcc settings (build == host != target) */ 272 291 crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; ··· 426 445 outputs = 427 446 if atLeast7 428 447 then [ "out" "man" "info" ] ++ lib.optional (!langJit) "lib" 429 - else if langJava || langGo || (if atLeast6 then langJit else targetPlatform.isDarwin) then ["out" "man" "info"] 448 + else if atLeast49 && (langJava || langGo || (if atLeast6 then langJit else targetPlatform.isDarwin)) then ["out" "man" "info"] 430 449 else [ "out" "lib" "man" "info" ]; 431 450 432 451 setOutputFlags = false; ··· 568 587 inherit langC langCC langObjC langObjCpp langAda langFortran langGo langD version; 569 588 isGNU = true; 570 589 } // lib.optionalAttrs (!atLeast12) { 571 - hardeningUnsupportedFlags = [ "fortify3" ]; 590 + hardeningUnsupportedFlags = lib.optionals (!atLeast49) [ "stackprotector" ] ++ [ "fortify3" ]; 572 591 }; 573 592 574 593 enableParallelBuilding = true; ··· 584 603 maintainers 585 604 ; 586 605 } // lib.optionalAttrs (!atLeast11) { 587 - badPlatforms = [ "aarch64-darwin" ]; 606 + badPlatforms = if atLeast49 then [ "aarch64-darwin" ] else lib.platforms.darwin; 588 607 }; 589 608 } // optionalAttrs (atLeast7 && !atLeast8) { 590 609 env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument"; ··· 596 615 doCheck = false; # requires a lot of tools, causes a dependency cycle for stdenv 597 616 } // optionalAttrs (enableMultilib) { 598 617 dontMoveLib64 = true; 599 - } // optionalAttrs (!atLeast7 && langJava && (!atLeast6 || !stdenv.hostPlatform.isDarwin)) { 618 + } // optionalAttrs (atLeast49 && !atLeast7 && langJava && (!atLeast6 || !stdenv.hostPlatform.isDarwin)) { 600 619 postFixup = '' 601 620 target="$(echo "$out/libexec/gcc"/*/*/ecj*)" 602 621 patchelf --set-rpath "$(patchelf --print-rpath "$target"):$out/lib" "$target"
+1 -1
pkgs/top-level/all-packages.nix
··· 15808 15808 "7" = "7.5.0"; 15809 15809 "6" = "6.5.0"; 15810 15810 "4.9"= "4.9.4"; 15811 - #"4.8"= "4.8.5"; 15811 + "4.8"= "4.8.5"; 15812 15812 }; 15813 15813 deduplicated = deduplicatedVersions ? "${version}"; 15814 15814 path = if deduplicated