lol

treewide: Remove gnat support.

See discussion in https://github.com/NixOS/nixpkgs/commit/6ac7b19c978e951c124c5ea434c94f95f593888e.

+13 -2184
-5
pkgs/build-support/cc-wrapper/add-flags.sh
··· 9 9 NIX+CFLAGS_LINK 10 10 NIX+CXXSTDLIB_COMPILE 11 11 NIX+CXXSTDLIB_LINK 12 - NIX+GNATFLAGS_COMPILE 13 12 ) 14 13 var_templates_bool=( 15 14 NIX+ENFORCE_NO_NATIVE ··· 49 48 50 49 if [ -e @out@/nix-support/cc-cflags ]; then 51 50 NIX_@infixSalt@_CFLAGS_COMPILE="$(< @out@/nix-support/cc-cflags) $NIX_@infixSalt@_CFLAGS_COMPILE" 52 - fi 53 - 54 - if [ -e @out@/nix-support/gnat-cflags ]; then 55 - NIX_@infixSalt@_GNATFLAGS_COMPILE="$(< @out@/nix-support/gnat-cflags) $NIX_@infixSalt@_GNATFLAGS_COMPILE" 56 51 fi 57 52 58 53 if [ -e @out@/nix-support/cc-ldflags ]; then
+1 -27
pkgs/build-support/cc-wrapper/default.nix
··· 8 8 { name ? "" 9 9 , stdenvNoCC, nativeTools, propagateDoc ? !nativeTools, noLibc ? false, nativeLibc, nativePrefix ? "" 10 10 , cc ? null, libc ? null, bintools, coreutils ? null, shell ? stdenvNoCC.shell 11 - , zlib ? null, extraPackages ? [], extraBuildCommands ? "" 11 + , extraPackages ? [], extraBuildCommands ? "" 12 12 , isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null 13 13 , buildPackages ? {} 14 14 }: ··· 20 20 cc != null && coreutils != null && gnugrep != null; 21 21 assert !(nativeLibc && noLibc); 22 22 assert (noLibc || nativeLibc) == (libc == null); 23 - 24 - # For ghdl (the vhdl language provider to gcc) we need zlib in the wrapper. 25 - assert cc.langVhdl or false -> zlib != null; 26 23 27 24 let 28 25 stdenv = stdenvNoCC; ··· 189 186 190 187 + optionalString cc.langGo or false '' 191 188 wrap ${targetPrefix}gccgo ${./cc-wrapper.sh} $ccPath/${targetPrefix}gccgo 192 - '' 193 - 194 - + optionalString cc.langAda or false '' 195 - wrap ${targetPrefix}gnatgcc ${./cc-wrapper.sh} $ccPath/${targetPrefix}gnatgcc 196 - wrap ${targetPrefix}gnatmake ${./gnat-wrapper.sh} $ccPath/${targetPrefix}gnatmake 197 - wrap ${targetPrefix}gnatbind ${./gnat-wrapper.sh} $ccPath/${targetPrefix}gnatbind 198 - wrap ${targetPrefix}gnatlink ${./gnatlink-wrapper.sh} $ccPath/${targetPrefix}gnatlink 199 - '' 200 - 201 - + optionalString cc.langVhdl or false '' 202 - ln -s $ccPath/${targetPrefix}ghdl $out/bin/${targetPrefix}ghdl 203 189 ''; 204 190 205 191 propagatedBuildInputs = [ bintools ]; ··· 261 247 fi 262 248 ccLDFlags+=" -L${cc_solib}/lib" 263 249 ccCFlags+=" -B${cc_solib}/lib" 264 - 265 - ${optionalString cc.langVhdl or false '' 266 - ccLDFlags+=" -L${zlib.out}/lib" 267 - ''} 268 - 269 - # Find the gcc libraries path (may work only without multilib). 270 - ${optionalString cc.langAda or false '' 271 - basePath=`echo ${cc_solib}/lib/*/*/*` 272 - ccCFlags+=" -B$basePath -I$basePath/adainclude" 273 - gnatCFlags="-aI$basePath/adainclude -aO$basePath/adalib" 274 - echo "$gnatCFlags" > $out/nix-support/gnat-cflags 275 - ''} 276 250 277 251 echo "$ccLDFlags" > $out/nix-support/cc-ldflags 278 252 echo "$ccCFlags" > $out/nix-support/cc-cflags
-122
pkgs/build-support/cc-wrapper/gnat-wrapper.sh
··· 1 - #! @shell@ 2 - set -eu -o pipefail +o posix 3 - shopt -s nullglob 4 - 5 - if (( "${NIX_DEBUG:-0}" >= 7 )); then 6 - set -x 7 - fi 8 - 9 - # N.B. Gnat is not used during bootstrapping, so we don't need to 10 - # worry about the old bash empty array `set -u` workarounds. 11 - 12 - path_backup="$PATH" 13 - 14 - # phase separation makes this look useless 15 - # shellcheck disable=SC2157 16 - if [ -n "@coreutils_bin@" ]; then 17 - PATH="@coreutils_bin@/bin" 18 - fi 19 - 20 - source @out@/nix-support/utils.sh 21 - 22 - if [ -z "${NIX_@infixSalt@_GNAT_WRAPPER_FLAGS_SET:-}" ]; then 23 - source @out@/nix-support/add-flags.sh 24 - fi 25 - 26 - 27 - # Figure out if linker flags should be passed. GCC prints annoying 28 - # warnings when they are not needed. 29 - dontLink=0 30 - nonFlagArgs=0 31 - 32 - for i in "$@"; do 33 - if [ "$i" = -c ]; then 34 - dontLink=1 35 - elif [ "$i" = -M ]; then 36 - dontLink=1 37 - elif [ "${i:0:1}" != - ]; then 38 - nonFlagArgs=1 39 - fi 40 - done 41 - 42 - # If we pass a flag like -Wl, then gcc will call the linker unless it 43 - # can figure out that it has to do something else (e.g., because of a 44 - # "-c" flag). So if no non-flag arguments are given, don't pass any 45 - # linker flags. This catches cases like "gcc" (should just print 46 - # "gcc: no input files") and "gcc -v" (should print the version). 47 - if [ "$nonFlagArgs" = 0 ]; then 48 - dontLink=1 49 - fi 50 - 51 - 52 - # Optionally filter out paths not refering to the store. 53 - params=("$@") 54 - if [[ "${NIX_ENFORCE_PURITY:-}" = 1 && -n "$NIX_STORE" ]]; then 55 - rest=() 56 - for p in "${params[@]}"; do 57 - if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then 58 - skip "${p:2}" 59 - elif [ "${p:0:3}" = -I/ ] && badPath "${p:2}"; then 60 - skip "${p:2}" 61 - elif [ "${p:0:4}" = -aI/ ] && badPath "${p:3}"; then 62 - skip "${p:2}" 63 - elif [ "${p:0:4}" = -aO/ ] && badPath "${p:3}"; then 64 - skip "${p:2}" 65 - else 66 - rest+=("$p") 67 - fi 68 - done 69 - params=("${rest[@]}") 70 - fi 71 - 72 - 73 - # Clear march/mtune=native -- they bring impurity. 74 - if [ "$NIX_@infixSalt@_ENFORCE_NO_NATIVE" = 1 ]; then 75 - rest=() 76 - for p in "${params[@]}"; do 77 - if [[ "$p" = -m*=native ]]; then 78 - skip "$p" 79 - else 80 - rest+=("$p") 81 - fi 82 - done 83 - params=("${rest[@]}") 84 - fi 85 - 86 - 87 - # Add the flags for the GNAT compiler proper. 88 - extraAfter=($NIX_@infixSalt@_GNATFLAGS_COMPILE) 89 - extraBefore=() 90 - 91 - if [ "$(basename "$0")x" = "gnatmakex" ]; then 92 - extraBefore=("--GNATBIND=@out@/bin/gnatbind" "--GNATLINK=@out@/bin/gnatlink ") 93 - fi 94 - 95 - #if [ "$dontLink" != 1 ]; then 96 - # # Add the flags that should be passed to the linker (and prevent 97 - # # `ld-wrapper' from adding NIX_@infixSalt@_LDFLAGS again). 98 - # for i in $NIX_@infixSalt@_LDFLAGS_BEFORE; do 99 - # extraBefore+=("-largs" "$i") 100 - # done 101 - # for i in $NIX_@infixSalt@_LDFLAGS; do 102 - # if [ "${i:0:3}" = -L/ ]; then 103 - # extraAfter+=("$i") 104 - # else 105 - # extraAfter+=("-largs" "$i") 106 - # fi 107 - # done 108 - # export NIX_@infixSalt@_LDFLAGS_SET=1 109 - #fi 110 - 111 - # Optionally print debug info. 112 - if (( "${NIX_DEBUG:-0}" >= 1 )); then 113 - echo "extra flags before to @prog@:" >&2 114 - printf " %q\n" "${extraBefore[@]}" >&2 115 - echo "original flags to @prog@:" >&2 116 - printf " %q\n" "${params[@]}" >&2 117 - echo "extra flags after to @prog@:" >&2 118 - printf " %q\n" "${extraAfter[@]}" >&2 119 - fi 120 - 121 - PATH="$path_backup" 122 - exec @prog@ "${extraBefore[@]}" "${params[@]}" "${extraAfter[@]}"
-28
pkgs/build-support/gcc-wrapper-old/add-flags
··· 1 - # `-B@out@/bin' forces cc to use ld-wrapper.sh when calling ld. 2 - export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE" 3 - 4 - if test -e @out@/nix-support/libc-cflags; then 5 - export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE" 6 - fi 7 - 8 - if test -e @out@/nix-support/cc-cflags; then 9 - export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/cc-cflags) $NIX_CFLAGS_COMPILE" 10 - fi 11 - 12 - if test -e @out@/nix-support/gnat-cflags; then 13 - export NIX_GNATFLAGS_COMPILE="$(cat @out@/nix-support/gnat-cflags) $NIX_GNATFLAGS_COMPILE" 14 - fi 15 - 16 - if test -e @out@/nix-support/libc-ldflags; then 17 - export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/libc-ldflags)" 18 - fi 19 - 20 - if test -e @out@/nix-support/cc-ldflags; then 21 - export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/cc-ldflags)" 22 - fi 23 - 24 - if test -e @out@/nix-support/libc-ldflags-before; then 25 - export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE" 26 - fi 27 - 28 - export NIX_CC_WRAPPER_FLAGS_SET=1
-215
pkgs/build-support/gcc-wrapper-old/builder.sh
··· 1 - source $stdenv/setup 2 - 3 - 4 - mkdir -p $out/bin 5 - mkdir -p $out/nix-support 6 - 7 - 8 - if test -z "$nativeLibc"; then 9 - dynamicLinker="$libc/lib/$dynamicLinker" 10 - echo $dynamicLinker > $out/nix-support/dynamic-linker 11 - 12 - if test -e $libc/lib/32/ld-linux.so.2; then 13 - echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32 14 - fi 15 - 16 - # The "-B$libc/lib/" flag is a quick hack to force gcc to link 17 - # against the crt1.o from our own glibc, rather than the one in 18 - # /usr/lib. (This is only an issue when using an `impure' 19 - # compiler/linker, i.e., one that searches /usr/lib and so on.) 20 - # 21 - # Unfortunately, setting -B appears to override the default search 22 - # path. Thus, the gcc-specific "../includes-fixed" directory is 23 - # now longer searched and glibc's <limits.h> header fails to 24 - # compile, because it uses "#include_next <limits.h>" to find the 25 - # limits.h file in ../includes-fixed. To remedy the problem, 26 - # another -idirafter is necessary to add that directory again. 27 - echo "-B$libc/lib/ -idirafter $libc_dev/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags 28 - 29 - echo "-L$libc/lib" > $out/nix-support/libc-ldflags 30 - 31 - # The dynamic linker is passed in `ldflagsBefore' to allow 32 - # explicit overrides of the dynamic linker by callers to gcc/ld 33 - # (the *last* value counts, so ours should come first). 34 - echo "-dynamic-linker" $dynamicLinker > $out/nix-support/libc-ldflags-before 35 - fi 36 - 37 - if test -n "$nativeTools"; then 38 - gccPath="$nativePrefix/bin" 39 - ldPath="$nativePrefix/bin" 40 - else 41 - if test -e "$gcc/lib64"; then 42 - gccLDFlags="$gccLDFlags -L$gcc_lib/lib64" 43 - fi 44 - gccLDFlags="$gccLDFlags -L$gcc_lib/lib" 45 - if [ -n "$langVhdl" ]; then 46 - gccLDFlags="$gccLDFlags -L$zlib/lib" 47 - fi 48 - echo "$gccLDFlags" > $out/nix-support/cc-ldflags 49 - 50 - # GCC shows $gcc/lib in `gcc -print-search-dirs', but not 51 - # $gcc/lib64 (even though it does actually search there...).. 52 - # This confuses libtool. So add it to the compiler tool search 53 - # path explicitly. 54 - if test -e "$gcc/lib64"; then 55 - gccCFlags="$gccCFlags -B$gcc/lib64" 56 - fi 57 - 58 - # Find the gcc libraries path (may work only without multilib) 59 - if [ -n "$langAda" ]; then 60 - basePath=`echo $gcc/lib/*/*/*` 61 - gccCFlags="$gccCFlags -B$basePath -I$basePath/adainclude" 62 - 63 - gnatCFlags="-aI$basePath/adainclude -aO$basePath/adalib" 64 - echo "$gnatCFlags" > $out/nix-support/gnat-cflags 65 - fi 66 - echo "$gccCFlags" > $out/nix-support/cc-cflags 67 - 68 - gccPath="$gcc/bin" 69 - # On Illumos/Solaris we might prefer native ld 70 - if test -n "$nativePrefix"; then 71 - ldPath="$nativePrefix/bin" 72 - else 73 - ldPath="$binutils/bin" 74 - fi; 75 - fi 76 - 77 - 78 - doSubstitute() { 79 - local src=$1 80 - local dst=$2 81 - local ld="$ldPath/ld" 82 - if $ld -V 2>&1 |grep Solaris; then 83 - # Use Solaris specific linker wrapper 84 - ld="$out/bin/ld-solaris" 85 - fi 86 - # Can't use substitute() here, because replace may not have been 87 - # built yet (in the bootstrap). 88 - sed \ 89 - -e "s^@out@^$out^g" \ 90 - -e "s^@shell@^$shell^g" \ 91 - -e "s^@gcc@^$gcc^g" \ 92 - -e "s^@gccProg@^$gccProg^g" \ 93 - -e "s^@gnatProg@^$gnatProg^g" \ 94 - -e "s^@gnatlinkProg@^$gnatlinkProg^g" \ 95 - -e "s^@binutils@^$binutils^g" \ 96 - -e "s^@coreutils@^$coreutils^g" \ 97 - -e "s^@libc@^$libc^g" \ 98 - -e "s^@libc_bin@^$libc_bin^g" \ 99 - -e "s^@ld@^$ld^g" \ 100 - < "$src" > "$dst" 101 - } 102 - 103 - 104 - # Make wrapper scripts around gcc, g++, and gfortran. Also make symlinks 105 - # cc, c++, and f77. 106 - mkGccWrapper() { 107 - local dst=$1 108 - local src=$2 109 - 110 - if ! test -f "$src"; then 111 - echo "$src does not exist (skipping)" 112 - return 1 113 - fi 114 - 115 - gccProg="$src" 116 - doSubstitute "$gccWrapper" "$dst" 117 - chmod +x "$dst" 118 - } 119 - 120 - mkGnatWrapper() { 121 - local dst=$1 122 - local src=$2 123 - 124 - if ! test -f "$src"; then 125 - echo "$src does not exist (skipping)" 126 - return 1 127 - fi 128 - 129 - gnatProg="$src" 130 - doSubstitute "$gnatWrapper" "$dst" 131 - chmod +x "$dst" 132 - } 133 - 134 - mkGnatLinkWrapper() { 135 - local dst=$1 136 - local src=$2 137 - 138 - if ! test -f "$src"; then 139 - echo "$src does not exist (skipping)" 140 - return 1 141 - fi 142 - 143 - gnatlinkProg="$src" 144 - doSubstitute "$gnatlinkWrapper" "$dst" 145 - chmod +x "$dst" 146 - } 147 - 148 - if mkGccWrapper $out/bin/gcc $gccPath/gcc 149 - then 150 - ln -sv gcc $out/bin/cc 151 - fi 152 - 153 - if mkGccWrapper $out/bin/g++ $gccPath/g++ 154 - then 155 - ln -sv g++ $out/bin/c++ 156 - fi 157 - 158 - mkGccWrapper $out/bin/cpp $gccPath/cpp || true 159 - 160 - if mkGccWrapper $out/bin/gfortran $gccPath/gfortran 161 - then 162 - ln -sv gfortran $out/bin/g77 163 - ln -sv gfortran $out/bin/f77 164 - fi 165 - 166 - mkGccWrapper $out/bin/gcj $gccPath/gcj || true 167 - 168 - mkGccWrapper $out/bin/gccgo $gccPath/gccgo || true 169 - 170 - mkGccWrapper $out/bin/gnatgcc $gccPath/gnatgcc || true 171 - mkGnatWrapper $out/bin/gnatmake $gccPath/gnatmake || true 172 - mkGnatWrapper $out/bin/gnatbind $gccPath/gnatbind || true 173 - mkGnatLinkWrapper $out/bin/gnatlink $gccPath/gnatlink || true 174 - 175 - if [ -f $gccPath/ghdl ]; then 176 - ln -sf $gccPath/ghdl $out/bin/ghdl 177 - fi 178 - 179 - 180 - # Create a symlink to as (the assembler). This is useful when a 181 - # gcc-wrapper is installed in a user environment, as it ensures that 182 - # the right assembler is called. 183 - ln -s $ldPath/as $out/bin/as 184 - 185 - 186 - # Make a wrapper around the linker. 187 - doSubstitute "$ldWrapper" "$out/bin/ld" 188 - chmod +x "$out/bin/ld" 189 - 190 - # Copy solaris ld wrapper if needed 191 - if $ldPath/ld -V 2>&1 |grep Solaris; then 192 - # Use Solaris specific linker wrapper 193 - sed -e "s^@ld@^$ldPath/ld^g" < "$ldSolarisWrapper" > "$out/bin/ld-solaris" 194 - chmod +x "$out/bin/ld-solaris" 195 - fi 196 - 197 - 198 - # Emit a setup hook. Also store the path to the original GCC and 199 - # Glibc. 200 - test -n "$gcc" && echo $gcc > $out/nix-support/orig-cc 201 - test -n "$libc" && echo $libc > $out/nix-support/orig-libc 202 - 203 - doSubstitute "$addFlags" "$out/nix-support/add-flags.sh" 204 - 205 - doSubstitute "$setupHook" "$out/nix-support/setup-hook" 206 - 207 - cp -p $utils $out/nix-support/utils.sh 208 - 209 - 210 - # Propagate the wrapped gcc so that if you install the wrapper, you get 211 - # tools like gcov, the manpages, etc. as well (including for binutils 212 - # and Glibc). 213 - if test -z "$nativeTools"; then 214 - printWords $gcc $binutils $libc $libc_bin > $out/nix-support/propagated-user-env-packages 215 - fi
-76
pkgs/build-support/gcc-wrapper-old/default.nix
··· 1 - # The Nix `gcc' stdenv.mkDerivation is not directly usable, since it doesn't 2 - # know where the C library and standard header files are. Therefore 3 - # the compiler produced by that package cannot be installed directly 4 - # in a user environment and used from the command line. This 5 - # stdenv.mkDerivation provides a wrapper that sets up the right environment 6 - # variables so that the compiler and the linker just "work". 7 - 8 - { name ? "", stdenv, lib, nativeTools, nativeLibc, nativePrefix ? "" 9 - , gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenv.shell 10 - , zlib ? null 11 - , hostPlatform, targetPlatform, targetPackages 12 - }: 13 - 14 - assert nativeTools -> nativePrefix != ""; 15 - assert !nativeTools -> gcc != null && binutils != null && coreutils != null; 16 - assert !nativeLibc -> libc != null; 17 - 18 - # For ghdl (the vhdl language provider to gcc) we need zlib in the wrapper 19 - assert (gcc != null && gcc ? langVhdl && gcc.langVhdl) -> zlib != null; 20 - 21 - let 22 - 23 - gccVersion = (builtins.parseDrvName gcc.name).version; 24 - gccName = (builtins.parseDrvName gcc.name).name; 25 - 26 - langGo = if nativeTools then false else gcc ? langGo && gcc.langGo; 27 - in 28 - 29 - stdenv.mkDerivation { 30 - name = 31 - (if name != "" then name else gccName + "-wrapper") + 32 - (if gcc != null && gccVersion != "" then "-" + gccVersion else ""); 33 - 34 - builder = ./builder.sh; 35 - setupHook = ./setup-hook.sh; 36 - gccWrapper = ./gcc-wrapper.sh; 37 - gnatWrapper = ./gnat-wrapper.sh; 38 - gnatlinkWrapper = ./gnatlink-wrapper.sh; 39 - ldWrapper = ./ld-wrapper.sh; 40 - ldSolarisWrapper = ./ld-solaris-wrapper.sh; 41 - utils = ./utils.sh; 42 - addFlags = ./add-flags; 43 - 44 - inherit nativeTools nativeLibc nativePrefix gcc; 45 - gcc_lib = lib.getLib gcc; 46 - libc = if nativeLibc then null else libc; 47 - libc_dev = if nativeLibc then null else lib.getDev libc; 48 - libc_bin = if nativeLibc then null else lib.getBin libc; 49 - binutils = if nativeTools then null else lib.getBin binutils; 50 - # The wrapper scripts use 'cat', so we may need coreutils 51 - coreutils = if nativeTools then null else lib.getBin coreutils; 52 - 53 - langC = if nativeTools then true else gcc.langC; 54 - langCC = if nativeTools then true else gcc.langCC; 55 - langFortran = if nativeTools then false else gcc ? langFortran; 56 - langAda = if nativeTools then false else gcc ? langAda && gcc.langAda; 57 - langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl; 58 - zlib = if gcc != null && gcc ? langVhdl then zlib else null; 59 - shell = shell + shell.shellPath or ""; 60 - 61 - preferLocalBuild = true; 62 - 63 - meta = 64 - let gcc_ = if gcc != null then gcc else {}; in 65 - (if gcc_ ? meta then removeAttrs gcc.meta ["priority"] else {}) // 66 - { description = 67 - stdenv.lib.attrByPath ["meta" "description"] "System C compiler" gcc_ 68 - + " (wrapper script)"; 69 - }; 70 - 71 - # The dynamic linker has different names on different platforms. 72 - dynamicLinker = 73 - if !nativeLibc then 74 - targetPackages.stdenv.cc.bintools.dynamicLinker 75 - else ""; 76 - }
-146
pkgs/build-support/gcc-wrapper-old/gcc-wrapper-old.sh
··· 1 - #! @shell@ -e 2 - 3 - if [ -n "$NIX_CC_WRAPPER_START_HOOK" ]; then 4 - source "$NIX_CC_WRAPPER_START_HOOK" 5 - fi 6 - 7 - if [ -z "$NIX_CC_WRAPPER_FLAGS_SET" ]; then 8 - source @out@/nix-support/add-flags.sh 9 - fi 10 - 11 - source @out@/nix-support/utils.sh 12 - 13 - 14 - # Figure out if linker flags should be passed. GCC prints annoying 15 - # warnings when they are not needed. 16 - dontLink=0 17 - getVersion=0 18 - nonFlagArgs=0 19 - 20 - for i in "$@"; do 21 - if [ "$i" = -c ]; then 22 - dontLink=1 23 - elif [ "$i" = -S ]; then 24 - dontLink=1 25 - elif [ "$i" = -E ]; then 26 - dontLink=1 27 - elif [ "$i" = -E ]; then 28 - dontLink=1 29 - elif [ "$i" = -M ]; then 30 - dontLink=1 31 - elif [ "$i" = -MM ]; then 32 - dontLink=1 33 - elif [ "$i" = -x ]; then 34 - # At least for the cases c-header or c++-header we should set dontLink. 35 - # I expect no one use -x other than making precompiled headers. 36 - dontLink=1 37 - elif [ "${i:0:1}" != - ]; then 38 - nonFlagArgs=1 39 - elif [ "$i" = -m32 ]; then 40 - if [ -e @out@/nix-support/dynamic-linker-m32 ]; then 41 - NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" 42 - fi 43 - fi 44 - done 45 - 46 - # If we pass a flag like -Wl, then gcc will call the linker unless it 47 - # can figure out that it has to do something else (e.g., because of a 48 - # "-c" flag). So if no non-flag arguments are given, don't pass any 49 - # linker flags. This catches cases like "gcc" (should just print 50 - # "gcc: no input files") and "gcc -v" (should print the version). 51 - if [ "$nonFlagArgs" = 0 ]; then 52 - dontLink=1 53 - fi 54 - 55 - 56 - # Optionally filter out paths not refering to the store. 57 - params=("$@") 58 - if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then 59 - rest=() 60 - n=0 61 - while [ $n -lt ${#params[*]} ]; do 62 - p=${params[n]} 63 - p2=${params[$((n+1))]} 64 - if [ "${p:0:3}" = -L/ ] && badPath "${p:2}"; then 65 - skip $p 66 - elif [ "$p" = -L ] && badPath "$p2"; then 67 - n=$((n + 1)); skip $p2 68 - elif [ "${p:0:3}" = -I/ ] && badPath "${p:2}"; then 69 - skip $p 70 - elif [ "$p" = -I ] && badPath "$p2"; then 71 - n=$((n + 1)); skip $p2 72 - elif [ "$p" = -isystem ] && badPath "$p2"; then 73 - n=$((n + 1)); skip $p2 74 - else 75 - rest=("${rest[@]}" "$p") 76 - fi 77 - n=$((n + 1)) 78 - done 79 - params=("${rest[@]}") 80 - fi 81 - 82 - 83 - # Add the flags for the C compiler proper. 84 - extraAfter=($NIX_CFLAGS_COMPILE) 85 - extraBefore=() 86 - 87 - # When enforcing purity, pretend gcc can't find the current date and 88 - # time 89 - if [ "$NIX_ENFORCE_PURITY" = 1 ]; then 90 - extraAfter+=('-D__DATE__="Jan 01 1970"' 91 - '-D__TIME__="00:00:01"' 92 - ) 93 - fi 94 - 95 - 96 - if [ "$dontLink" != 1 ]; then 97 - 98 - # Add the flags that should only be passed to the compiler when 99 - # linking. 100 - extraAfter+=($NIX_CFLAGS_LINK) 101 - 102 - # Add the flags that should be passed to the linker (and prevent 103 - # `ld-wrapper' from adding NIX_LDFLAGS again). 104 - for i in $NIX_LDFLAGS_BEFORE; do 105 - extraBefore=(${extraBefore[@]} "-Wl,$i") 106 - done 107 - for i in $NIX_LDFLAGS; do 108 - if [ "${i:0:3}" = -L/ ]; then 109 - extraAfter+=("$i") 110 - else 111 - extraAfter+=("-Wl,$i") 112 - fi 113 - done 114 - export NIX_LDFLAGS_SET=1 115 - fi 116 - 117 - # As a very special hack, if the arguments are just `-v', then don't 118 - # add anything. This is to prevent `gcc -v' (which normally prints 119 - # out the version number and returns exit code 0) from printing out 120 - # `No input files specified' and returning exit code 1. 121 - if [ "$*" = -v ]; then 122 - extraAfter=() 123 - extraBefore=() 124 - fi 125 - 126 - # Optionally print debug info. 127 - if [ -n "$NIX_DEBUG" ]; then 128 - echo "original flags to @prog@:" >&2 129 - for i in "${params[@]}"; do 130 - echo " $i" >&2 131 - done 132 - echo "extraBefore flags to @prog@:" >&2 133 - for i in ${extraBefore[@]}; do 134 - echo " $i" >&2 135 - done 136 - echo "extraAfter flags to @prog@:" >&2 137 - for i in ${extraAfter[@]}; do 138 - echo " $i" >&2 139 - done 140 - fi 141 - 142 - if [ -n "$NIX_CC_WRAPPER_EXEC_HOOK" ]; then 143 - source "$NIX_CC_WRAPPER_EXEC_HOOK" 144 - fi 145 - 146 - exec @prog@ ${extraBefore[@]} "${params[@]}" "${extraAfter[@]}"
-147
pkgs/build-support/gcc-wrapper-old/gcc-wrapper.sh
··· 1 - #! @shell@ -e 2 - 3 - if test -n "$NIX_CC_WRAPPER_START_HOOK"; then 4 - source "$NIX_CC_WRAPPER_START_HOOK" 5 - fi 6 - 7 - if test -z "$NIX_CC_WRAPPER_FLAGS_SET"; then 8 - source @out@/nix-support/add-flags.sh 9 - fi 10 - 11 - source @out@/nix-support/utils.sh 12 - 13 - 14 - # Figure out if linker flags should be passed. GCC prints annoying 15 - # warnings when they are not needed. 16 - dontLink=0 17 - getVersion=0 18 - nonFlagArgs=0 19 - 20 - for i in "$@"; do 21 - if test "$i" = "-c"; then 22 - dontLink=1 23 - elif test "$i" = "-S"; then 24 - dontLink=1 25 - elif test "$i" = "-E"; then 26 - dontLink=1 27 - elif test "$i" = "-E"; then 28 - dontLink=1 29 - elif test "$i" = "-M"; then 30 - dontLink=1 31 - elif test "$i" = "-MM"; then 32 - dontLink=1 33 - elif test "$i" = "-x"; then 34 - # At least for the cases c-header or c++-header we should set dontLink. 35 - # I expect no one use -x other than making precompiled headers. 36 - dontLink=1 37 - elif test "${i:0:1}" != "-"; then 38 - nonFlagArgs=1 39 - elif test "$i" = "-m32"; then 40 - if test -e @out@/nix-support/dynamic-linker-m32; then 41 - NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" 42 - fi 43 - fi 44 - done 45 - 46 - # If we pass a flag like -Wl, then gcc will call the linker unless it 47 - # can figure out that it has to do something else (e.g., because of a 48 - # "-c" flag). So if no non-flag arguments are given, don't pass any 49 - # linker flags. This catches cases like "gcc" (should just print 50 - # "gcc: no input files") and "gcc -v" (should print the version). 51 - if test "$nonFlagArgs" = "0"; then 52 - dontLink=1 53 - fi 54 - 55 - 56 - # Optionally filter out paths not refering to the store. 57 - params=("$@") 58 - if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then 59 - rest=() 60 - n=0 61 - while test $n -lt ${#params[*]}; do 62 - p=${params[n]} 63 - p2=${params[$((n+1))]} 64 - if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then 65 - skip $p 66 - elif test "$p" = "-L" && badPath "$p2"; then 67 - n=$((n + 1)); skip $p2 68 - elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then 69 - skip $p 70 - elif test "$p" = "-I" && badPath "$p2"; then 71 - n=$((n + 1)); skip $p2 72 - elif test "$p" = "-isystem" && badPath "$p2"; then 73 - n=$((n + 1)); skip $p2 74 - else 75 - rest=("${rest[@]}" "$p") 76 - fi 77 - n=$((n + 1)) 78 - done 79 - params=("${rest[@]}") 80 - fi 81 - 82 - 83 - # Add the flags for the C compiler proper. 84 - extraAfter=($NIX_CFLAGS_COMPILE) 85 - extraBefore=() 86 - 87 - if test "$dontLink" != "1"; then 88 - 89 - # Add the flags that should only be passed to the compiler when 90 - # linking. 91 - extraAfter=(${extraAfter[@]} $NIX_CFLAGS_LINK) 92 - 93 - # Add the flags that should be passed to the linker (and prevent 94 - # `ld-wrapper' from adding NIX_LDFLAGS again). 95 - for i in $NIX_LDFLAGS_BEFORE; do 96 - extraBefore=(${extraBefore[@]} "-Wl,$i") 97 - done 98 - for i in $NIX_LDFLAGS; do 99 - if test "${i:0:3}" = "-L/"; then 100 - extraAfter=(${extraAfter[@]} "$i") 101 - else 102 - extraAfter=(${extraAfter[@]} "-Wl,$i") 103 - fi 104 - done 105 - export NIX_LDFLAGS_SET=1 106 - fi 107 - 108 - # As a very special hack, if the arguments are just `-v', then don't 109 - # add anything. This is to prevent `gcc -v' (which normally prints 110 - # out the version number and returns exit code 0) from printing out 111 - # `No input files specified' and returning exit code 1. 112 - if test "$*" = "-v"; then 113 - extraAfter=() 114 - extraBefore=() 115 - fi 116 - 117 - # Optionally print debug info. 118 - if test "$NIX_DEBUG" = "1"; then 119 - echo "original flags to @gccProg@:" >&2 120 - for i in "${params[@]}"; do 121 - echo " $i" >&2 122 - done 123 - echo "extraBefore flags to @gccProg@:" >&2 124 - for i in ${extraBefore[@]}; do 125 - echo " $i" >&2 126 - done 127 - echo "extraAfter flags to @gccProg@:" >&2 128 - for i in ${extraAfter[@]}; do 129 - echo " $i" >&2 130 - done 131 - fi 132 - 133 - if test -n "$NIX_CC_WRAPPER_EXEC_HOOK"; then 134 - source "$NIX_CC_WRAPPER_EXEC_HOOK" 135 - fi 136 - 137 - 138 - # Call the real `gcc'. Filter out warnings from stderr about unused 139 - # `-B' flags, since they confuse some programs. Deep bash magic to 140 - # apply grep to stderr (by swapping stdin/stderr twice). 141 - if test -z "$NIX_CC_NEEDS_GREP"; then 142 - @gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 143 - else 144 - (@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \ 145 - | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3- 146 - exit $? 147 - fi
-113
pkgs/build-support/gcc-wrapper-old/gnat-wrapper.sh
··· 1 - #! @shell@ -e 2 - 3 - if test -n "$NIX_GNAT_WRAPPER_START_HOOK"; then 4 - source "$NIX_GNAT_WRAPPER_START_HOOK" 5 - fi 6 - 7 - if test -z "$NIX_GNAT_WRAPPER_FLAGS_SET"; then 8 - source @out@/nix-support/add-flags.sh 9 - fi 10 - 11 - source @out@/nix-support/utils.sh 12 - 13 - 14 - # Figure out if linker flags should be passed. GCC prints annoying 15 - # warnings when they are not needed. 16 - dontLink=0 17 - getVersion=0 18 - nonFlagArgs=0 19 - 20 - for i in "$@"; do 21 - if test "$i" = "-c"; then 22 - dontLink=1 23 - elif test "$i" = "-M"; then 24 - dontLink=1 25 - elif test "${i:0:1}" != "-"; then 26 - nonFlagArgs=1 27 - elif test "$i" = "-m32"; then 28 - if test -e @out@/nix-support/dynamic-linker-m32; then 29 - NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)" 30 - fi 31 - fi 32 - done 33 - 34 - # If we pass a flag like -Wl, then gcc will call the linker unless it 35 - # can figure out that it has to do something else (e.g., because of a 36 - # "-c" flag). So if no non-flag arguments are given, don't pass any 37 - # linker flags. This catches cases like "gcc" (should just print 38 - # "gcc: no input files") and "gcc -v" (should print the version). 39 - if test "$nonFlagArgs" = "0"; then 40 - dontLink=1 41 - fi 42 - 43 - 44 - # Optionally filter out paths not refering to the store. 45 - params=("$@") 46 - if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then 47 - rest=() 48 - n=0 49 - while test $n -lt ${#params[*]}; do 50 - p=${params[n]} 51 - p2=${params[$((n+1))]} 52 - if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then 53 - skip $p 54 - elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then 55 - skip $p 56 - elif test "${p:0:4}" = "-aI/" && badPath "${p:3}"; then 57 - skip $p 58 - elif test "${p:0:4}" = "-aO/" && badPath "${p:3}"; then 59 - skip $p 60 - else 61 - rest=("${rest[@]}" "$p") 62 - fi 63 - n=$((n + 1)) 64 - done 65 - params=("${rest[@]}") 66 - fi 67 - 68 - 69 - # Add the flags for the GNAT compiler proper. 70 - extraAfter=($NIX_GNATFLAGS_COMPILE) 71 - extraBefore=() 72 - 73 - if [ "`basename $0`x" = "gnatmakex" ]; then 74 - extraBefore=("--GNATBIND=@out@/bin/gnatbind --GNATLINK=@out@/bin/gnatlink ") 75 - fi 76 - 77 - # Add the flags that should be passed to the linker (and prevent 78 - # `ld-wrapper' from adding NIX_LDFLAGS again). 79 - #for i in $NIX_LDFLAGS_BEFORE; do 80 - # extraBefore=(${extraBefore[@]} "-largs $i") 81 - #done 82 - 83 - # Optionally print debug info. 84 - if test "$NIX_DEBUG" = "1"; then 85 - echo "original flags to @gnatProg@:" >&2 86 - for i in "${params[@]}"; do 87 - echo " $i" >&2 88 - done 89 - echo "extraBefore flags to @gnatProg@:" >&2 90 - for i in ${extraBefore[@]}; do 91 - echo " $i" >&2 92 - done 93 - echo "extraAfter flags to @gnatProg@:" >&2 94 - for i in ${extraAfter[@]}; do 95 - echo " $i" >&2 96 - done 97 - fi 98 - 99 - if test -n "$NIX_GNAT_WRAPPER_EXEC_HOOK"; then 100 - source "$NIX_GNAT_WRAPPER_EXEC_HOOK" 101 - fi 102 - 103 - 104 - # Call the real `gcc'. Filter out warnings from stderr about unused 105 - # `-B' flags, since they confuse some programs. Deep bash magic to 106 - # apply grep to stderr (by swapping stdin/stderr twice). 107 - if test -z "$NIX_GNAT_NEEDS_GREP"; then 108 - @gnatProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 109 - else 110 - (@gnatProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \ 111 - | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3- 112 - exit $? 113 - fi
-40
pkgs/build-support/gcc-wrapper-old/ld-solaris-wrapper.sh
··· 1 - #!@shell@ 2 - 3 - set -e 4 - set -u 5 - 6 - # I've also tried adding -z direct and -z lazyload, but it gave too many problems with C++ exceptions :'( 7 - # Also made sure libgcc would not be lazy-loaded, as suggested here: https://www.illumos.org/issues/2534#note-3 8 - # but still no success. 9 - cmd="@ld@ -z ignore" 10 - 11 - args=("$@"); 12 - 13 - # This loop makes sure all -L arguments are before -l arguments, or ld may complain it cannot find a library. 14 - # GNU binutils does not have this problem: 15 - # http://stackoverflow.com/questions/5817269/does-the-order-of-l-and-l-options-in-the-gnu-linker-matter 16 - i=0; 17 - while [[ $i -lt $# ]]; do 18 - case "${args[$i]}" in 19 - -L) cmd="$cmd ${args[$i]} ${args[($i+1)]}"; i=($i+1); ;; 20 - -L*) cmd="$cmd ${args[$i]}" ;; 21 - *) ;; 22 - esac 23 - i=($i+1); 24 - done 25 - 26 - i=0; 27 - while [[ $i -lt $# ]]; do 28 - case "${args[$i]}" in 29 - -L) i=($i+1); ;; 30 - -L*) ;; 31 - *) cmd="$cmd ${args[$i]}" ;; 32 - esac 33 - i=($i+1); 34 - done 35 - 36 - # Trace: 37 - set -x 38 - exec $cmd 39 - 40 - exit 0
-166
pkgs/build-support/gcc-wrapper-old/ld-wrapper.sh
··· 1 - #! @shell@ -e 2 - 3 - if test -n "$NIX_LD_WRAPPER_START_HOOK"; then 4 - source "$NIX_LD_WRAPPER_START_HOOK" 5 - fi 6 - 7 - if test -z "$NIX_CC_WRAPPER_FLAGS_SET"; then 8 - source @out@/nix-support/add-flags.sh 9 - fi 10 - 11 - source @out@/nix-support/utils.sh 12 - 13 - 14 - # Optionally filter out paths not refering to the store. 15 - params=("$@") 16 - if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE" \ 17 - -a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \); then 18 - rest=() 19 - n=0 20 - while test $n -lt ${#params[*]}; do 21 - p=${params[n]} 22 - p2=${params[$((n+1))]} 23 - if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then 24 - skip $p 25 - elif test "$p" = "-L" && badPath "$p2"; then 26 - n=$((n + 1)); skip $p2 27 - elif test "$p" = "-rpath" && badPath "$p2"; then 28 - n=$((n + 1)); skip $p2 29 - elif test "$p" = "-dynamic-linker" && badPath "$p2"; then 30 - n=$((n + 1)); skip $p2 31 - elif test "${p:0:1}" = "/" && badPath "$p"; then 32 - # We cannot skip this; barf. 33 - echo "impure path \`$p' used in link" >&2 34 - exit 1 35 - elif test "${p:0:9}" = "--sysroot"; then 36 - # Our ld is not built with sysroot support (Can we fix that?) 37 - : 38 - else 39 - rest=("${rest[@]}" "$p") 40 - fi 41 - n=$((n + 1)) 42 - done 43 - params=("${rest[@]}") 44 - fi 45 - 46 - 47 - extra=() 48 - extraBefore=() 49 - 50 - if test -z "$NIX_LDFLAGS_SET"; then 51 - extra+=($NIX_LDFLAGS) 52 - extraBefore+=($NIX_LDFLAGS_BEFORE) 53 - fi 54 - 55 - extra+=($NIX_LDFLAGS_AFTER) 56 - 57 - 58 - # Add all used dynamic libraries to the rpath. 59 - if test "$NIX_DONT_SET_RPATH" != "1"; then 60 - 61 - libPath="" 62 - addToLibPath() { 63 - local path="$1" 64 - if test "${path:0:1}" != "/"; then return 0; fi 65 - case "$path" in 66 - *..*|*./*|*/.*|*//*) 67 - local path2 68 - if path2=$(readlink -f "$path"); then 69 - path="$path2" 70 - fi 71 - ;; 72 - esac 73 - case $libPath in 74 - *\ $path\ *) return 0 ;; 75 - esac 76 - libPath="$libPath $path " 77 - } 78 - 79 - addToRPath() { 80 - # If the path is not in the store, don't add it to the rpath. 81 - # This typically happens for libraries in /tmp that are later 82 - # copied to $out/lib. If not, we're screwed. 83 - if test "${1:0:${#NIX_STORE}}" != "$NIX_STORE"; then return 0; fi 84 - case $rpath in 85 - *\ $1\ *) return 0 ;; 86 - esac 87 - rpath="$rpath $1 " 88 - } 89 - 90 - libs="" 91 - addToLibs() { 92 - libs="$libs $1" 93 - } 94 - 95 - rpath="" 96 - 97 - # First, find all -L... switches. 98 - allParams=("${params[@]}" ${extra[@]}) 99 - n=0 100 - while test $n -lt ${#allParams[*]}; do 101 - p=${allParams[n]} 102 - p2=${allParams[$((n+1))]} 103 - if test "${p:0:3}" = "-L/"; then 104 - addToLibPath ${p:2} 105 - elif test "$p" = "-L"; then 106 - addToLibPath ${p2} 107 - n=$((n + 1)) 108 - elif test "$p" = "-l"; then 109 - addToLibs ${p2} 110 - n=$((n + 1)) 111 - elif test "${p:0:2}" = "-l"; then 112 - addToLibs ${p:2} 113 - elif test "$p" = "-dynamic-linker"; then 114 - # Ignore the dynamic linker argument, or it 115 - # will get into the next 'elif'. We don't want 116 - # the dynamic linker path rpath to go always first. 117 - n=$((n + 1)) 118 - elif [[ "$p" =~ ^[^-].*\.so($|\.) ]]; then 119 - # This is a direct reference to a shared library, so add 120 - # its directory to the rpath. 121 - path="$(dirname "$p")"; 122 - addToRPath "${path}" 123 - fi 124 - n=$((n + 1)) 125 - done 126 - 127 - # Second, for each directory in the library search path (-L...), 128 - # see if it contains a dynamic library used by a -l... flag. If 129 - # so, add the directory to the rpath. 130 - # It's important to add the rpath in the order of -L..., so 131 - # the link time chosen objects will be those of runtime linking. 132 - 133 - for i in $libPath; do 134 - for j in $libs; do 135 - if test -f "$i/lib$j.so"; then 136 - addToRPath $i 137 - break 138 - fi 139 - done 140 - done 141 - 142 - 143 - # Finally, add `-rpath' switches. 144 - for i in $rpath; do 145 - extra=(${extra[@]} -rpath $i) 146 - done 147 - fi 148 - 149 - 150 - # Optionally print debug info. 151 - if test "$NIX_DEBUG" = "1"; then 152 - echo "original flags to @ld@:" >&2 153 - for i in "${params[@]}"; do 154 - echo " $i" >&2 155 - done 156 - echo "extra flags to @ld@:" >&2 157 - for i in ${extra[@]}; do 158 - echo " $i" >&2 159 - done 160 - fi 161 - 162 - if test -n "$NIX_LD_WRAPPER_EXEC_HOOK"; then 163 - source "$NIX_LD_WRAPPER_EXEC_HOOK" 164 - fi 165 - 166 - exec @ld@ ${extraBefore[@]} "${params[@]}" ${extra[@]}
-33
pkgs/build-support/gcc-wrapper-old/setup-hook.sh
··· 1 - gccWrapperOld_addCVars () { 2 - if test -d $1/include; then 3 - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem $1/include" 4 - fi 5 - 6 - if test -d $1/lib64; then 7 - export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib64" 8 - fi 9 - 10 - if test -d $1/lib; then 11 - export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib" 12 - fi 13 - } 14 - 15 - envBuildBuildHooks+=(gccWrapperOld_addCVars) 16 - 17 - # Note: these come *after* $out in the PATH (see setup.sh). 18 - 19 - if test -n "@gcc@"; then 20 - addToSearchPath PATH @gcc@/bin 21 - fi 22 - 23 - if test -n "@binutils@"; then 24 - addToSearchPath PATH @binutils@/bin 25 - fi 26 - 27 - if test -n "@libc@"; then 28 - addToSearchPath PATH @libc_bin@/bin 29 - fi 30 - 31 - if test -n "@coreutils@"; then 32 - addToSearchPath PATH @coreutils@/bin 33 - fi
-26
pkgs/build-support/gcc-wrapper-old/utils.sh
··· 1 - skip () { 2 - if test "$NIX_DEBUG" = "1"; then 3 - echo "skipping impure path $1" >&2 4 - fi 5 - } 6 - 7 - 8 - # Checks whether a path is impure. E.g., `/lib/foo.so' is impure, but 9 - # `/nix/store/.../lib/foo.so' isn't. 10 - badPath() { 11 - local p=$1 12 - 13 - # Relative paths are okay (since they're presumably relative to 14 - # the temporary build directory). 15 - if test "${p:0:1}" != "/"; then return 1; fi 16 - 17 - @extraPathTests@ 18 - 19 - # Otherwise, the path should refer to the store or some temporary 20 - # directory (including the build directory). 21 - test \ 22 - "$p" != "/dev/null" -a \ 23 - "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \ 24 - "${p:0:4}" != "/tmp" -a \ 25 - "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP" 26 - }
-472
pkgs/development/compilers/gcc/4.5/default.nix
··· 1 - { stdenv, targetPackages, fetchurl, noSysDirs 2 - , langC ? true, langCC ? true, langFortran ? false 3 - , langJava ? false 4 - , langAda ? false 5 - , langVhdl ? false 6 - , profiledCompiler ? false 7 - , staticCompiler ? false 8 - , enableShared ? true 9 - , texinfo ? null 10 - , perl ? null # optional, for texi2pod (then pod2man); required for Java 11 - , gmp, mpfr, libmpc, gettext, which 12 - , libelf # optional, for link-time optimizations (LTO) 13 - , ppl ? null, cloogppl ? null # optional, for the Graphite optimization framework 14 - , zlib ? null, boehmgc ? null 15 - , zip ? null, unzip ? null, pkgconfig ? null, gtk2 ? null, libart_lgpl ? null 16 - , libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null 17 - , libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null 18 - , libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null 19 - , gnatboot ? null 20 - , enableMultilib ? false 21 - , name ? "gcc" 22 - , libcCross ? null 23 - , crossStageStatic ? false 24 - , gnat ? null 25 - , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd 26 - , stripped ? true 27 - , buildPlatform, hostPlatform, targetPlatform 28 - , buildPackages 29 - }: 30 - 31 - assert langJava -> zip != null && unzip != null 32 - && zlib != null && boehmgc != null 33 - && perl != null; # for `--enable-java-home' 34 - assert langAda -> gnatboot != null; 35 - assert langVhdl -> gnat != null; 36 - 37 - # LTO needs libelf and zlib. 38 - assert libelf != null -> zlib != null; 39 - 40 - with stdenv.lib; 41 - with builtins; 42 - 43 - let version = "4.5.4"; 44 - javaEcj = fetchurl { 45 - # The `$(top_srcdir)/ecj.jar' file is automatically picked up at 46 - # `configure' time. 47 - 48 - # XXX: Eventually we might want to take it from upstream. 49 - url = "ftp://sourceware.org/pub/java/ecj-4.3.jar"; 50 - sha256 = "0jz7hvc0s6iydmhgh5h2m15yza7p2rlss2vkif30vm9y77m97qcx"; 51 - }; 52 - 53 - # Antlr (optional) allows the Java `gjdoc' tool to be built. We want a 54 - # binary distribution here to allow the whole chain to be bootstrapped. 55 - javaAntlr = fetchurl { 56 - url = http://www.antlr.org/download/antlr-3.1.3.jar; 57 - sha256 = "1f41j0y4kjydl71lqlvr73yagrs2jsg1fjymzjz66mjy7al5lh09"; 58 - }; 59 - 60 - xlibs = [ 61 - libX11 libXt libSM libICE libXtst libXrender libXrandr libXi 62 - xproto renderproto xextproto inputproto randrproto 63 - ]; 64 - 65 - javaAwtGtk = langJava && gtk2 != null; 66 - 67 - /* Platform flags */ 68 - platformFlags = let 69 - gccArch = targetPlatform.platform.gcc.arch or null; 70 - gccCpu = targetPlatform.platform.gcc.cpu or null; 71 - gccAbi = targetPlatform.platform.gcc.abi or null; 72 - gccFpu = targetPlatform.platform.gcc.fpu or null; 73 - gccFloat = targetPlatform.platform.gcc.float or null; 74 - gccMode = targetPlatform.platform.gcc.mode or null; 75 - in 76 - optional (gccArch != null) "--with-arch=${gccArch}" ++ 77 - optional (gccCpu != null) "--with-cpu=${gccCpu}" ++ 78 - optional (gccAbi != null) "--with-abi=${gccAbi}" ++ 79 - optional (gccFpu != null) "--with-fpu=${gccFpu}" ++ 80 - optional (gccFloat != null) "--with-float=${gccFloat}" ++ 81 - optional (gccMode != null) "--with-mode=${gccMode}"; 82 - 83 - /* Cross-gcc settings */ 84 - crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"); 85 - 86 - crossConfigureFlags = 87 - # Ensure that -print-prog-name is able to find the correct programs. 88 - [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" 89 - "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ 90 - (if crossMingw && crossStageStatic then [ 91 - "--with-headers=${libcCross}/include" 92 - "--with-gcc" 93 - "--with-gnu-as" 94 - "--with-gnu-ld" 95 - "--with-gnu-ld" 96 - "--disable-shared" 97 - "--disable-nls" 98 - "--disable-debug" 99 - "--enable-sjlj-exceptions" 100 - "--enable-threads=win32" 101 - "--disable-win32-registry" 102 - ] else if crossStageStatic then [ 103 - "--disable-libssp" 104 - "--disable-nls" 105 - "--without-headers" 106 - "--disable-threads" 107 - "--disable-libmudflap" 108 - "--disable-libgomp" 109 - "--disable-shared" 110 - "--disable-decimal-float" # libdecnumber requires libc 111 - ] else [ 112 - "--with-headers=${libcCross}/include" 113 - "--enable-__cxa_atexit" 114 - "--enable-long-long" 115 - ] ++ 116 - (if crossMingw then [ 117 - "--enable-threads=win32" 118 - "--enable-sjlj-exceptions" 119 - "--enable-hash-synchronization" 120 - "--enable-version-specific-runtime-libs" 121 - "--enable-libssp" 122 - "--disable-nls" 123 - "--with-dwarf2" 124 - ] else [ 125 - "--enable-threads=posix" 126 - "--enable-nls" 127 - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) 128 - ])); 129 - stageNameAddon = if crossStageStatic then "-stage-static" else 130 - "-stage-final"; 131 - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; 132 - 133 - in 134 - 135 - # We need all these X libraries when building AWT with GTK+. 136 - assert gtk2 != null -> (filter (x: x == null) xlibs) == []; 137 - 138 - stdenv.mkDerivation ({ 139 - name = "${name}-${version}" + crossNameAddon; 140 - 141 - builder = ../builder.sh; 142 - 143 - src = (import ./sources.nix) { 144 - inherit fetchurl optional version; 145 - inherit langC langCC langFortran langJava langAda; 146 - }; 147 - 148 - hardeningDisable = [ "format" ] ++ optional (name != "gnat") "all"; 149 - 150 - outputs = [ "out" "man" "info" ] 151 - ++ optional (!(hostPlatform.is64bit && langAda)) "lib"; 152 - 153 - setOutputFlags = false; 154 - NIX_NO_SELF_RPATH = true; 155 - 156 - libc_dev = stdenv.cc.libc_dev; 157 - 158 - patches = 159 - [ ] 160 - ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch 161 - ++ optional noSysDirs ./no-sys-dirs.patch 162 - # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its 163 - # target libraries and tools. 164 - ++ optional langAda ../gnat-cflags.patch 165 - ++ optional langVhdl ./ghdl-ortho-cflags.patch 166 - ++ [ ../struct-ucontext-4.5.patch ] # glibc-2.26 167 - ; 168 - 169 - postPatch = 170 - if (stdenv.system == "i586-pc-gnu" 171 - || (libcCross != null # e.g., building `gcc.crossDrv' 172 - && libcCross ? crossConfig 173 - && libcCross.crossConfig == "i586-pc-gnu") 174 - || (targetPlatform != hostPlatform && targetPlatform.config == "i586-pc-gnu" 175 - && libcCross != null)) 176 - then 177 - # On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not 178 - # in glibc, so add the right `-I' flags to the default spec string. 179 - assert libcCross != null -> libpthreadCross != null; 180 - let 181 - libc = if libcCross != null then libcCross else stdenv.glibc; 182 - gnu_h = "gcc/config/gnu.h"; 183 - i386_gnu_h = "gcc/config/i386/gnu.h"; 184 - extraCPPDeps = 185 - libc.propagatedBuildInputs 186 - ++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross 187 - ++ stdenv.lib.optional (libpthread != null) libpthread; 188 - extraCPPSpec = 189 - concatStrings (intersperse " " 190 - (map (x: "-I${x.dev or x}/include") extraCPPDeps)); 191 - extraLibSpec = 192 - if libpthreadCross != null 193 - then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}" 194 - else "-L${libpthread}/lib"; 195 - in 196 - '' echo "augmenting \`CPP_SPEC' in \`${i386_gnu_h}' with \`${extraCPPSpec}'..." 197 - sed -i "${i386_gnu_h}" \ 198 - -es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g' 199 - 200 - echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..." 201 - sed -i "${gnu_h}" \ 202 - -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g' 203 - 204 - echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..." 205 - sed -i "${gnu_h}" \ 206 - -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g' 207 - sed -i gcc/config/t-gnu \ 208 - -es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc.dev}/include|g' 209 - '' 210 - else if targetPlatform != hostPlatform || stdenv.cc.libc != null then 211 - # On NixOS, use the right path to the dynamic linker instead of 212 - # `/lib/ld*.so'. 213 - let 214 - libc = if libcCross != null then libcCross else stdenv.cc.libc; 215 - in 216 - '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..." 217 - for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h 218 - do 219 - grep -q LIBC_DYNAMIC_LINKER "$header" || continue 220 - echo " fixing \`$header'..." 221 - sed -i "$header" \ 222 - -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' 223 - done 224 - '' 225 - else null; 226 - 227 - # TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild, 228 - crossStageStatic = targetPlatform == hostPlatform || crossStageStatic; 229 - inherit noSysDirs profiledCompiler staticCompiler langJava 230 - libcCross crossMingw; 231 - 232 - depsBuildBuild = [ buildPackages.stdenv.cc ]; 233 - nativeBuildInputs = [ texinfo which gettext ] 234 - ++ optional (perl != null) perl; 235 - 236 - # For building runtime libs 237 - depsBuildTarget = 238 - if hostPlatform == buildPlatform then [ 239 - targetPackages.stdenv.cc.bintools # newly-built gcc will be used 240 - ] else assert targetPlatform == hostPlatform; [ # build != host == target 241 - stdenv.cc 242 - ]; 243 - 244 - buildInputs = [ 245 - gmp mpfr libmpc libelf 246 - targetPackages.stdenv.cc.bintools # For linking code at run-time 247 - ] ++ (optional (ppl != null) ppl) 248 - ++ (optional (cloogppl != null) cloogppl) 249 - ++ (optional (zlib != null) zlib) 250 - ++ (optional langJava boehmgc) 251 - ++ (optionals langJava [zip unzip]) 252 - ++ (optionals javaAwtGtk ([gtk2 pkgconfig libart_lgpl] ++ xlibs)) 253 - ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools]) 254 - ++ (optionals langAda [gnatboot]) 255 - ++ (optionals langVhdl [gnat]) 256 - ; 257 - 258 - # TODO(@Ericson2314): Always pass "--target" and always prefix. 259 - configurePlatforms = 260 - # TODO(@Ericson2314): Figure out what's going wrong with Arm 261 - if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm 262 - then [] 263 - else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 264 - 265 - configureFlags = 266 - # Basic dependencies 267 - [ 268 - "--with-gmp=${gmp.dev}" 269 - "--with-mpfr=${mpfr.dev}" 270 - "--with-mpc=${libmpc}" 271 - ] ++ 272 - optional (libelf != null) "--with-libelf=${libelf}" ++ 273 - optional (!(crossMingw && crossStageStatic)) 274 - "--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++ 275 - 276 - # Basic configuration 277 - [ 278 - "--disable-libstdcxx-pch" 279 - "--without-included-gettext" 280 - "--with-system-zlib" 281 - "--enable-languages=${ 282 - concatStrings (intersperse "," 283 - ( optional langC "c" 284 - ++ optional langCC "c++" 285 - ++ optional langFortran "fortran" 286 - ++ optional langJava "java" 287 - ++ optional langAda "ada" 288 - ++ optional langVhdl "vhdl" 289 - ) 290 - ) 291 - }" 292 - ] ++ 293 - optional (!enableMultilib) "--disable-multilib" ++ 294 - optional (!enableShared) "--disable-shared" ++ 295 - 296 - # Optional features 297 - optional (cloogppl != null) "--with-cloog=${cloogppl}" ++ 298 - optional (ppl != null) "--with-ppl=${ppl}" ++ 299 - 300 - # Java options 301 - optionals langJava [ 302 - "--with-ecj-jar=${javaEcj}" 303 - 304 - # Follow Sun's layout for the convenience of IcedTea/OpenJDK. See 305 - # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>. 306 - "--enable-java-home" 307 - "--with-java-home=\${prefix}/lib/jvm/jre" 308 - ] ++ 309 - optional javaAwtGtk "--enable-java-awt=gtk" ++ 310 - optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ 311 - 312 - # Ada 313 - optional langAda "--enable-libada" ++ 314 - 315 - platformFlags ++ 316 - optional (targetPlatform != hostPlatform) crossConfigureFlags ++ 317 - 318 - # Platform-specific flags 319 - optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++ 320 - # Trick that should be taken out once we have a mipsel-linux not loongson2f 321 - optional (targetPlatform == hostPlatform && stdenv.system == "mipsel-linux") "--with-arch=loongson2f" 322 - ; 323 - 324 - targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; 325 - 326 - /* For cross-built gcc (build != host == target) */ 327 - crossAttrs = { 328 - dontStrip = true; 329 - }; 330 - 331 - # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the 332 - # library headers and binaries, regarless of the language being compiled. 333 - # 334 - # Note: When building the Java AWT GTK+ peer, the build system doesn't honor 335 - # `--with-gmp' et al., e.g., when building 336 - # `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add 337 - # them to $CPATH and $LIBRARY_PATH in this case. 338 - # 339 - # Likewise, the LTO code doesn't find zlib. 340 - # 341 - # Cross-compiling, we need gcc not to read ./specs in order to build the g++ 342 - # compiler (after the specs for the cross-gcc are created). Having 343 - # LIBRARY_PATH= makes gcc read the specs from ., and the build breaks. 344 - 345 - CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([] 346 - ++ optional (zlib != null) zlib 347 - ++ optional langJava boehmgc 348 - ++ optionals javaAwtGtk xlibs 349 - ++ optionals javaAwtGtk [ gmp mpfr ] 350 - ++ optional (libpthread != null) libpthread 351 - ++ optional (libpthreadCross != null) libpthreadCross 352 - 353 - # On GNU/Hurd glibc refers to Mach & Hurd 354 - # headers. 355 - ++ optionals (libcCross != null && libcCross ? propagatedBuildInputs) 356 - libcCross.propagatedBuildInputs 357 - )); 358 - 359 - LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([] 360 - ++ optional (zlib != null) zlib 361 - ++ optional langJava boehmgc 362 - ++ optionals javaAwtGtk xlibs 363 - ++ optionals javaAwtGtk [ gmp mpfr ] 364 - ++ optional (libpthread != null) libpthread) 365 - ); 366 - 367 - EXTRA_TARGET_FLAGS = optionals 368 - (targetPlatform != hostPlatform && libcCross != null) 369 - ([ 370 - "-idirafter ${libcCross.dev}/include" 371 - ] ++ optionals (! crossStageStatic) [ 372 - "-B${libcCross.out}/lib" 373 - ]); 374 - 375 - EXTRA_TARGET_LDFLAGS = optionals 376 - (targetPlatform != hostPlatform && libcCross != null) 377 - ([ 378 - "-Wl,-L${libcCross.out}/lib" 379 - ] ++ (if crossStageStatic then [ 380 - "-B${libcCross.out}/lib" 381 - ] else [ 382 - "-Wl,-rpath,${libcCross.out}/lib" 383 - "-Wl,-rpath-link,${libcCross.out}/lib" 384 - ]) ++ optionals (libpthreadCross != null) [ 385 - "-L${libpthreadCross}/lib" 386 - "-Wl,${libpthreadCross.TARGET_LDFLAGS}" 387 - ]); 388 - 389 - passthru = { 390 - inherit langC langCC langAda langFortran langVhdl enableMultilib version; 391 - isGNU = true; 392 - hardeningUnsupportedFlags = [ "stackprotector" ]; 393 - }; 394 - 395 - enableParallelBuilding = !langAda; 396 - 397 - meta = { 398 - homepage = http://gcc.gnu.org/; 399 - license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ 400 - description = "GNU Compiler Collection, version ${version}" 401 - + (if stripped then "" else " (with debugging info)"); 402 - 403 - longDescription = '' 404 - The GNU Compiler Collection includes compiler front ends for C, C++, 405 - Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well 406 - as libraries for these languages (libstdc++, libgcj, libgomp,...). 407 - 408 - GCC development is a part of the GNU Project, aiming to improve the 409 - compiler used in the GNU system including the GNU/Linux variant. 410 - ''; 411 - 412 - maintainers = [ 413 - stdenv.lib.maintainers.viric 414 - ]; 415 - 416 - # Volunteers needed for the {Cyg,Dar}win ports of *PPL. 417 - # gnatboot is not available out of linux platforms, so we disable the darwin build 418 - # for the gnat (ada compiler). 419 - platforms = stdenv.lib.platforms.linux ++ optionals (langAda == false) [ "i686-darwin" ]; 420 - }; 421 - } 422 - 423 - // optionalAttrs (targetPlatform != hostPlatform || libcCross != null) { 424 - # `builder.sh' sets $CPP, which leads configure to use "gcc -E" instead of, 425 - # say, "i586-pc-gnu-gcc -E" when building `gcc.crossDrv'. 426 - # FIXME: Fix `builder.sh' directly in the next stdenv-update. 427 - postUnpack = "unset CPP"; 428 - } 429 - 430 - // optionalAttrs (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt" && crossStageStatic) { 431 - makeFlags = [ "all-gcc" "all-target-libgcc" ]; 432 - installTargets = "install-gcc install-target-libgcc"; 433 - } 434 - 435 - # GCC 4.5.2 doesn't support the `install-strip' target, so let `stdenv' do 436 - # the stripping by default. 437 - // optionalAttrs (!stripped) { dontStrip = true; } 438 - 439 - // optionalAttrs langVhdl rec { 440 - name = "ghdl-0.29"; 441 - 442 - ghdlSrc = fetchurl { 443 - url = "http://ghdl.free.fr/ghdl-0.29.tar.bz2"; 444 - sha256 = "15mlinr1lwljwll9ampzcfcrk9bk0qpdks1kxlvb70xf9zhh2jva"; 445 - }; 446 - 447 - # Ghdl has some timestamps checks, storing file timestamps in '.cf' files. 448 - # As we will change the timestamps to 1970-01-01 00:00:01, we also set the 449 - # content of that .cf to that value. This way ghdl does not complain on 450 - # the installed object files from the basic libraries (ieee, ...) 451 - postInstallGhdl = '' 452 - pushd $out 453 - find . -name "*.cf" -exec \ 454 - sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \; 455 - popd 456 - ''; 457 - 458 - postUnpack = '' 459 - tar xvf ${ghdlSrc} 460 - mv ghdl-*/vhdl gcc*/gcc 461 - rm -Rf ghdl-* 462 - ''; 463 - 464 - meta = { 465 - homepage = http://ghdl.free.fr/; 466 - license = stdenv.lib.licenses.gpl2Plus; 467 - description = "Complete VHDL simulator, using the GCC technology (gcc ${version})"; 468 - maintainers = with stdenv.lib.maintainers; [viric]; 469 - platforms = with stdenv.lib.platforms; linux; 470 - }; 471 - 472 - })
-111
pkgs/development/compilers/gcc/4.5/ghdl-ortho-cflags.patch
··· 1 - diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in 2 - index 8f481df..681ac59 100644 3 - --- a/gcc/vhdl/Make-lang.in 4 - +++ b/gcc/vhdl/Make-lang.in 5 - @@ -96,7 +96,7 @@ AGCC_GCCOBJ_DIR=../ 6 - AGCC_INC_FLAGS=-I$(AGCC_GCCOBJ_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/include \ 7 - -I$(AGCC_GCCSRC_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/gcc/config \ 8 - -I$(AGCC_GCCSRC_DIR)/libcpp/include 9 - -AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) 10 - +AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) $(CFLAGS) $(INCLUDES) 11 - 12 - AGCC_LOCAL_OBJS=ortho-lang.o 13 - 14 - @@ -140,7 +140,7 @@ ghdl$(exeext): force 15 - 16 - # Ghdl libraries. 17 - ghdllib: ghdl$(exeext) $(GCC_PASSES) force 18 - - $(MAKE_IN_VHDL) GRT_FLAGS="-O -g" ghdllib 19 - + $(MAKE_IN_VHDL) GRT_FLAGS="-O -g $(CFLAGS)" ghdllib 20 - 21 - # Build hooks: 22 - 23 - diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in 24 - index d754c6c..07abc4a 100644 25 - --- a/gcc/vhdl/Makefile.in 26 - +++ b/gcc/vhdl/Makefile.in 27 - @@ -80,7 +80,8 @@ T_CPPFLAGS = 28 - X_ADAFLAGS = 29 - T_ADAFLAGS = 30 - 31 - -ADAC = $(CC) 32 - +# Never use the bootstrapped compiler, as it may not be built for ada 33 - +ADAC = gcc 34 - 35 - ECHO = echo 36 - CHMOD = chmod 37 - diff --git a/gcc/vhdl/ortho-lang.c b/gcc/vhdl/ortho-lang.c 38 - index 84aeb92..8eddd42 100644 39 - --- a/gcc/vhdl/ortho-lang.c 40 - +++ b/gcc/vhdl/ortho-lang.c 41 - @@ -16,6 +16,7 @@ 42 - #include "options.h" 43 - #include "real.h" 44 - -#include "tree-gimple.h" 45 - +#include "gimple.h" 46 - +#include "tree.h" 47 - #include "function.h" 48 - #include "cgraph.h" 49 - #include "target.h" 50 - @@ -680,38 +681,10 @@ type_for_mode (enum machine_mode mode, int unsignedp) 51 - 52 - const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; 53 - 54 - -/* Tree code classes. */ 55 - - 56 - -#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, 57 - - 58 - -const enum tree_code_class tree_code_type[] = { 59 - -#include "tree.def" 60 - - 'x' 61 - -}; 62 - -#undef DEFTREECODE 63 - - 64 - -/* Table indexed by tree code giving number of expression 65 - - operands beyond the fixed part of the node structure. 66 - - Not used for types or decls. */ 67 - - 68 - -#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH, 69 - - 70 - -const unsigned char tree_code_length[] = { 71 - -#include "tree.def" 72 - - 0 73 - -}; 74 - -#undef DEFTREECODE 75 - - 76 - -#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) NAME, 77 - -const char * const tree_code_name[] = { 78 - -#include "tree.def" 79 - - "@@dummy" 80 - -}; 81 - -#undef DEFTREECODE 82 - 83 - union lang_tree_node 84 - GTY((desc ("0"), 85 - - chain_next ("(union lang_tree_node *) GENERIC_NEXT (&%h.generic)"))) 86 - + chain_next ("(union lang_tree_node *) TREE_CHAIN (&%h.generic)"))) 87 - { 88 - union tree_node GTY ((tag ("0"))) generic; 89 - }; 90 - @@ -1162,7 +1135,7 @@ new_access_type (tree dtype) 91 - res = make_node (POINTER_TYPE); 92 - TREE_TYPE (res) = NULL_TREE; 93 - /* Seems necessary. */ 94 - - TYPE_MODE (res) = Pmode; 95 - + SET_TYPE_MODE (res, Pmode); 96 - layout_type (res); 97 - return res; 98 - } 99 - diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in 100 - index e201f64..f36fb97 100644 101 - --- a/gcc/vhdl/Make-lang.in 102 - +++ b/gcc/vhdl/Make-lang.in 103 - @@ -132,7 +132,7 @@ ghdl1$(exeext): $(AGCC_OBJS) $(AGCC_DEPS) force 104 - -cargs $(CFLAGS) $(GHDL_ADAFLAGS) 105 - $(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aOvhdl ortho_gcc-main \ 106 - -bargs -E -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \ 107 - - -largs $(AGCC_OBJS) $(LIBS) $(GMPLIBS) 108 - + -largs $(AGCC_OBJS) $(LIBS) $(GMPLIBS) $(CLOOGLIBS) $(PPLLIBS) 109 - 110 - # The driver for ghdl. 111 - ghdl$(exeext): force
-54
pkgs/development/compilers/gcc/4.5/no-sys-dirs.patch
··· 1 - diff -ru gcc-4.3.1-orig/gcc/cppdefault.c gcc-4.3.1/gcc/cppdefault.c 2 - --- gcc-4.3.1-orig/gcc/cppdefault.c 2007-07-26 10:37:01.000000000 +0200 3 - +++ gcc-4.3.1/gcc/cppdefault.c 2008-06-25 17:48:23.000000000 +0200 4 - @@ -41,6 +41,10 @@ 5 - # undef CROSS_INCLUDE_DIR 6 - #endif 7 - 8 - +#undef LOCAL_INCLUDE_DIR 9 - +#undef SYSTEM_INCLUDE_DIR 10 - +#undef STANDARD_INCLUDE_DIR 11 - + 12 - const struct default_include cpp_include_defaults[] 13 - #ifdef INCLUDE_DEFAULTS 14 - = INCLUDE_DEFAULTS; 15 - diff -ru gcc-4.3.1-orig/gcc/gcc.c gcc-4.3.1/gcc/gcc.c 16 - --- gcc-4.3.1-orig/gcc/gcc.c 2008-03-02 23:55:19.000000000 +0100 17 - +++ gcc-4.3.1/gcc/gcc.c 2008-06-25 17:52:53.000000000 +0200 18 - @@ -1478,10 +1478,10 @@ 19 - /* Default prefixes to attach to command names. */ 20 - 21 - #ifndef STANDARD_STARTFILE_PREFIX_1 22 - -#define STANDARD_STARTFILE_PREFIX_1 "/lib/" 23 - +#define STANDARD_STARTFILE_PREFIX_1 "" 24 - #endif 25 - #ifndef STANDARD_STARTFILE_PREFIX_2 26 - -#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" 27 - +#define STANDARD_STARTFILE_PREFIX_2 "" 28 - #endif 29 - 30 - #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */ 31 - --- gcc-4.3.1-orig/gcc/Makefile.in 2008-05-11 20:54:15.000000000 +0200 32 - +++ gcc-4.3.1/gcc/Makefile.in 2008-06-25 17:48:23.000000000 +0200 33 - @@ -378,7 +378,11 @@ 34 - MD5_H = $(srcdir)/../include/md5.h 35 - 36 - # Default native SYSTEM_HEADER_DIR, to be overridden by targets. 37 - -NATIVE_SYSTEM_HEADER_DIR = /usr/include 38 - +# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent 39 - +# `fixinc' from fixing header files in /usr/include. However, 40 - +# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set 41 - +# it to some dummy directory. 42 - +NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY) 43 - # Default cross SYSTEM_HEADER_DIR, to be overridden by targets. 44 - CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ 45 - 46 - @@ -3277,7 +3281,7 @@ 47 - -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ 48 - -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \ 49 - -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \ 50 - - -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \ 51 - + -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \ 52 - -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \ 53 - -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \ 54 - -DPREFIX=\"$(prefix)/\" \
-26
pkgs/development/compilers/gcc/4.5/sources.nix
··· 1 - /* Automatically generated by `update-gcc.sh', do not edit. 2 - For GCC 4.5.4. */ 3 - { fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda }: 4 - 5 - assert version == "4.5.4"; 6 - optional /* langC */ true (fetchurl { 7 - url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2"; 8 - sha256 = "894d90f72cbfc8707e330fa2b1847c443fa97cf9b7f26e86be554709510e624a"; 9 - }) ++ 10 - optional langCC (fetchurl { 11 - url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2"; 12 - sha256 = "f7e3bab5e22713fbce46c2acb35fb727748473a34a942ce00393d75e1b09b6b9"; 13 - }) ++ 14 - optional langFortran (fetchurl { 15 - url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2"; 16 - sha256 = "cf0803b4f5334a526dd8da1b2171d6724f50c17346b2d5c509b6abc973d2ef34"; 17 - }) ++ 18 - optional langJava (fetchurl { 19 - url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2"; 20 - sha256 = "c98398da6f8c4c7d1758e291089d99853fdd27112cd3f146b7a8c26e6d762a23"; 21 - }) ++ 22 - optional langAda (fetchurl { 23 - url = "mirror://gcc/releases/gcc-${version}/gcc-ada-${version}.tar.bz2"; 24 - sha256 = "8abddae15be65572b4d639bd9818057019bb4a45da4decfc6451511c8d580c5e"; 25 - }) ++ 26 - []
+2 -20
pkgs/development/compilers/gcc/4.8/default.nix
··· 3 3 , langObjC ? targetPlatform.isDarwin 4 4 , langObjCpp ? targetPlatform.isDarwin 5 5 , langJava ? false 6 - , langAda ? false 7 - , langVhdl ? false 8 6 , langGo ? false 9 7 , profiledCompiler ? false 10 8 , staticCompiler ? false ··· 21 19 , libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null 22 20 , libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null 23 21 , x11Support ? langJava 24 - , gnatboot ? null 25 22 , enableMultilib ? false 26 23 , enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins 27 24 , name ? "gcc" 28 25 , libcCross ? null 29 26 , crossStageStatic ? false 30 - , gnat ? null 31 27 , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd 32 28 , stripped ? true 33 29 , gnused ? null ··· 39 35 assert langJava -> zip != null && unzip != null 40 36 && zlib != null && boehmgc != null 41 37 && perl != null; # for `--enable-java-home' 42 - assert langAda -> gnatboot != null; 43 - assert langVhdl -> gnat != null; 44 38 45 39 # We enable the isl cloog backend. 46 40 assert cloog != null -> isl != null; ··· 68 62 ++ optional enableParallelBuilding ../parallel-bconfig.patch 69 63 ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch 70 64 ++ optional noSysDirs ../no-sys-dirs.patch 71 - # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its 72 - # target libraries and tools. 73 - ++ optional langAda ../gnat-cflags.patch 74 65 ++ optional langFortran ../gfortran-driving.patch 75 66 ++ optional hostPlatform.isDarwin ../gfortran-darwin-NXConstStr.patch 76 67 ++ [(fetchpatch { ··· 279 270 ++ (optionals langJava [ boehmgc zip unzip ]) 280 271 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 281 272 ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools]) 282 - ++ (optionals langAda [gnatboot]) 283 - ++ (optionals langVhdl [gnat]) 284 273 285 274 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with 286 275 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. ··· 330 319 ++ optional langCC "c++" 331 320 ++ optional langFortran "fortran" 332 321 ++ optional langJava "java" 333 - ++ optional langAda "ada" 334 - ++ optional langVhdl "vhdl" 335 322 ++ optional langGo "go" 336 323 ++ optional langObjC "objc" 337 324 ++ optional langObjCpp "obj-c++" ··· 368 355 ] ++ 369 356 optional javaAwtGtk "--enable-java-awt=gtk" ++ 370 357 optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ 371 - 372 - # Ada 373 - optional langAda "--enable-libada" ++ 374 358 375 359 platformFlags ++ 376 360 optional (targetPlatform != hostPlatform) crossConfigureFlags ++ ··· 464 448 ]); 465 449 466 450 passthru = { 467 - inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; 451 + inherit langC langCC langObjC langObjCpp langFortran langGo version; 468 452 isGNU = true; 469 453 hardeningUnsupportedFlags = [ "stackprotector" ]; 470 454 }; ··· 490 474 491 475 maintainers = with stdenv.lib.maintainers; [ viric peti ]; 492 476 493 - # gnatboot is not available out of linux platforms, so we disable the darwin build 494 - # for the gnat (ada compiler). 495 477 platforms = 496 478 stdenv.lib.platforms.linux ++ 497 479 stdenv.lib.platforms.freebsd ++ 498 480 stdenv.lib.platforms.illumos ++ 499 - optionals (langAda == false) stdenv.lib.platforms.darwin; 481 + stdenv.lib.platforms.darwin; 500 482 }; 501 483 } 502 484
+2 -20
pkgs/development/compilers/gcc/4.9/default.nix
··· 3 3 , langObjC ? targetPlatform.isDarwin 4 4 , langObjCpp ? targetPlatform.isDarwin 5 5 , langJava ? false 6 - , langAda ? false 7 - , langVhdl ? false 8 6 , langGo ? false 9 7 , profiledCompiler ? false 10 8 , staticCompiler ? false ··· 21 19 , libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null 22 20 , libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null 23 21 , x11Support ? langJava 24 - , gnatboot ? null 25 22 , enableMultilib ? false 26 23 , enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins 27 24 , name ? "gcc" 28 25 , libcCross ? null 29 26 , crossStageStatic ? false 30 - , gnat ? null 31 27 , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd 32 28 , stripped ? true 33 29 , gnused ? null ··· 39 35 assert langJava -> zip != null && unzip != null 40 36 && zlib != null && boehmgc != null 41 37 && perl != null; # for `--enable-java-home' 42 - assert langAda -> gnatboot != null; 43 - assert langVhdl -> gnat != null; 44 38 45 39 # We enable the isl cloog backend. 46 40 assert cloog != null -> isl != null; ··· 69 63 ++ optionals enableParallelBuilding [ ../parallel-bconfig.patch ./parallel-strsignal.patch ] 70 64 ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch 71 65 ++ optional noSysDirs ../no-sys-dirs.patch 72 - # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its 73 - # target libraries and tools. 74 - ++ optional langAda ../gnat-cflags.patch 75 66 ++ optional langFortran ../gfortran-driving.patch 76 67 ++ [ ../struct-ucontext.patch ../struct-sigaltstack-4.9.patch ] # glibc-2.26 77 68 ; ··· 284 275 ++ (optionals langJava [ boehmgc zip unzip ]) 285 276 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 286 277 ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools]) 287 - ++ (optionals langAda [gnatboot]) 288 - ++ (optionals langVhdl [gnat]) 289 278 290 279 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with 291 280 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. ··· 338 327 ++ optional langCC "c++" 339 328 ++ optional langFortran "fortran" 340 329 ++ optional langJava "java" 341 - ++ optional langAda "ada" 342 - ++ optional langVhdl "vhdl" 343 330 ++ optional langGo "go" 344 331 ++ optional langObjC "objc" 345 332 ++ optional langObjCpp "obj-c++" ··· 376 363 ] ++ 377 364 optional javaAwtGtk "--enable-java-awt=gtk" ++ 378 365 optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ 379 - 380 - # Ada 381 - optional langAda "--enable-libada" ++ 382 366 383 367 platformFlags ++ 384 368 optional (targetPlatform != hostPlatform) crossConfigureFlags ++ ··· 472 456 ]); 473 457 474 458 passthru = 475 - { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; 459 + { inherit langC langCC langObjC langObjCpp langFortran langGo version; isGNU = true; }; 476 460 477 461 inherit enableParallelBuilding enableMultilib; 478 462 ··· 495 479 496 480 maintainers = with stdenv.lib.maintainers; [ viric peti ]; 497 481 498 - # gnatboot is not available out of linux platforms, so we disable the darwin build 499 - # for the gnat (ada compiler). 500 482 platforms = 501 483 stdenv.lib.platforms.linux ++ 502 484 stdenv.lib.platforms.freebsd ++ 503 485 stdenv.lib.platforms.illumos ++ 504 - optionals (langAda == false) stdenv.lib.platforms.darwin; 486 + stdenv.lib.platforms.darwin; 505 487 }; 506 488 } 507 489
+2 -20
pkgs/development/compilers/gcc/5/default.nix
··· 3 3 , langObjC ? targetPlatform.isDarwin 4 4 , langObjCpp ? targetPlatform.isDarwin 5 5 , langJava ? false 6 - , langAda ? false 7 - , langVhdl ? false 8 6 , langGo ? false 9 7 , profiledCompiler ? false 10 8 , staticCompiler ? false ··· 21 19 , libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null 22 20 , libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null 23 21 , x11Support ? langJava 24 - , gnatboot ? null 25 22 , enableMultilib ? false 26 23 , enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins 27 24 , name ? "gcc" 28 25 , libcCross ? null 29 26 , crossStageStatic ? false 30 - , gnat ? null 31 27 , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd 32 28 , stripped ? true 33 29 , gnused ? null ··· 40 36 assert langJava -> zip != null && unzip != null 41 37 && zlib != null && boehmgc != null 42 38 && perl != null; # for `--enable-java-home' 43 - assert langAda -> gnatboot != null; 44 - assert langVhdl -> gnat != null; 45 39 46 40 # LTO needs libelf and zlib. 47 41 assert libelf != null -> zlib != null; ··· 67 61 [ ../use-source-date-epoch.patch ] 68 62 ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch 69 63 ++ optional noSysDirs ../no-sys-dirs.patch 70 - # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its 71 - # target libraries and tools. 72 - ++ optional langAda ../gnat-cflags.patch 73 64 ++ optional langFortran ../gfortran-driving.patch 74 65 75 66 # This could be applied unconditionally but I don't want to cause a full ··· 306 297 ++ (optionals langJava [ boehmgc zip unzip ]) 307 298 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 308 299 ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools]) 309 - ++ (optionals langAda [gnatboot]) 310 - ++ (optionals langVhdl [gnat]) 311 300 312 301 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with 313 302 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. ··· 359 348 ++ optional langCC "c++" 360 349 ++ optional langFortran "fortran" 361 350 ++ optional langJava "java" 362 - ++ optional langAda "ada" 363 - ++ optional langVhdl "vhdl" 364 351 ++ optional langGo "go" 365 352 ++ optional langObjC "objc" 366 353 ++ optional langObjCpp "obj-c++" ··· 392 379 ] ++ 393 380 optional javaAwtGtk "--enable-java-awt=gtk" ++ 394 381 optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ 395 - 396 - # Ada 397 - optional langAda "--enable-libada" ++ 398 382 399 383 platformFlags ++ 400 384 optional (targetPlatform != hostPlatform) crossConfigureFlags ++ ··· 489 473 ]); 490 474 491 475 passthru = 492 - { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; 476 + { inherit langC langCC langObjC langObjCpp langFortran langGo version; isGNU = true; }; 493 477 494 478 inherit enableParallelBuilding enableMultilib; 495 479 ··· 512 496 513 497 maintainers = with stdenv.lib.maintainers; [ viric peti ]; 514 498 515 - # gnatboot is not available out of linux platforms, so we disable the darwin build 516 - # for the gnat (ada compiler). 517 499 platforms = 518 500 stdenv.lib.platforms.linux ++ 519 501 stdenv.lib.platforms.freebsd ++ 520 - optionals (langAda == false) stdenv.lib.platforms.darwin; 502 + stdenv.lib.platforms.darwin; 521 503 }; 522 504 } 523 505
+2 -20
pkgs/development/compilers/gcc/6/default.nix
··· 3 3 , langObjC ? targetPlatform.isDarwin 4 4 , langObjCpp ? targetPlatform.isDarwin 5 5 , langJava ? false 6 - , langAda ? false 7 - , langVhdl ? false 8 6 , langGo ? false 9 7 , profiledCompiler ? false 10 8 , staticCompiler ? false ··· 21 19 , libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null 22 20 , libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null 23 21 , x11Support ? langJava 24 - , gnatboot ? null 25 22 , enableMultilib ? false 26 23 , enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins 27 24 , name ? "gcc" 28 25 , libcCross ? null 29 26 , crossStageStatic ? false 30 - , gnat ? null 31 27 , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd 32 28 , stripped ? true 33 29 , gnused ? null ··· 40 36 assert langJava -> zip != null && unzip != null 41 37 && zlib != null && boehmgc != null 42 38 && perl != null; # for `--enable-java-home' 43 - assert langAda -> gnatboot != null; 44 - assert langVhdl -> gnat != null; 45 39 46 40 # LTO needs libelf and zlib. 47 41 assert libelf != null -> zlib != null; ··· 66 60 [ ../use-source-date-epoch.patch ] 67 61 ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch 68 62 ++ optional noSysDirs ../no-sys-dirs.patch 69 - # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its 70 - # target libraries and tools. 71 - ++ optional langAda ../gnat-cflags.patch 72 63 ++ optional langFortran ../gfortran-driving.patch 73 64 ++ [ ../struct-ucontext.patch ../struct-sigaltstack.patch ] # glibc-2.26 74 65 ++ optional langJava [ ../struct-ucontext-libjava.patch ] # glibc-2.26 ··· 306 297 ++ (optionals langJava [ boehmgc zip unzip ]) 307 298 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 308 299 ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools]) 309 - ++ (optionals langAda [gnatboot]) 310 - ++ (optionals langVhdl [gnat]) 311 300 312 301 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with 313 302 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. ··· 363 352 ++ optional langCC "c++" 364 353 ++ optional langFortran "fortran" 365 354 ++ optional langJava "java" 366 - ++ optional langAda "ada" 367 - ++ optional langVhdl "vhdl" 368 355 ++ optional langGo "go" 369 356 ++ optional langObjC "objc" 370 357 ++ optional langObjCpp "obj-c++" ··· 396 383 ] ++ 397 384 optional javaAwtGtk "--enable-java-awt=gtk" ++ 398 385 optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ 399 - 400 - # Ada 401 - optional langAda "--enable-libada" ++ 402 386 403 387 platformFlags ++ 404 388 optional (targetPlatform != hostPlatform) crossConfigureFlags ++ ··· 492 476 ]); 493 477 494 478 passthru = 495 - { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; 479 + { inherit langC langCC langObjC langObjCpp langFortran langGo version; isGNU = true; }; 496 480 497 481 inherit enableParallelBuilding enableMultilib; 498 482 ··· 515 499 516 500 maintainers = with stdenv.lib.maintainers; [ viric peti ]; 517 501 518 - # gnatboot is not available out of linux platforms, so we disable the darwin build 519 - # for the gnat (ada compiler). 520 502 platforms = 521 503 stdenv.lib.platforms.linux ++ 522 504 stdenv.lib.platforms.freebsd ++ 523 - optionals (langAda == false) stdenv.lib.platforms.darwin; 505 + stdenv.lib.platforms.darwin; 524 506 }; 525 507 } 526 508
+2 -19
pkgs/development/compilers/gcc/7/default.nix
··· 3 3 , langObjC ? targetPlatform.isDarwin 4 4 , langObjCpp ? targetPlatform.isDarwin 5 5 , langJava ? false 6 - , langAda ? false 7 - , langVhdl ? false 8 6 , langGo ? false 9 7 , profiledCompiler ? false 10 8 , staticCompiler ? false ··· 21 19 , libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null 22 20 , libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null 23 21 , x11Support ? langJava 24 - , gnatboot ? null 25 22 , enableMultilib ? false 26 23 , enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins 27 24 , name ? "gcc" 28 25 , libcCross ? null 29 26 , crossStageStatic ? false 30 - , gnat ? null 31 27 , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd 32 28 , stripped ? true 33 29 , gnused ? null ··· 40 36 assert langJava -> zip != null && unzip != null 41 37 && zlib != null && boehmgc != null 42 38 && perl != null; # for `--enable-java-home' 43 - assert langAda -> gnatboot != null; 44 - assert langVhdl -> gnat != null; 45 39 46 40 # LTO needs libelf and zlib. 47 41 assert libelf != null -> zlib != null; ··· 70 64 url = "https://git.busybox.net/buildroot/plain/package/gcc/7.1.0/0900-remove-selftests.patch?id=11271540bfe6adafbc133caf6b5b902a816f5f02"; 71 65 sha256 = "0mrvxsdwip2p3l17dscpc1x8vhdsciqw1z5q9i6p5g9yg1cqnmgs"; 72 66 }) 73 - # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its 74 - # target libraries and tools. 75 - ++ optional langAda ../gnat-cflags.patch 76 67 ++ optional langFortran ../gfortran-driving.patch 77 68 # https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00633.html 78 69 ++ optional targetPlatform.isRiscV ./riscv-pthread-reentrant.patch; ··· 308 299 ++ (optionals langJava [ boehmgc zip unzip ]) 309 300 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 310 301 ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools]) 311 - ++ (optionals langAda [gnatboot]) 312 - ++ (optionals langVhdl [gnat]) 313 302 314 303 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with 315 304 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. ··· 361 350 ++ optional langCC "c++" 362 351 ++ optional langFortran "fortran" 363 352 ++ optional langJava "java" 364 - ++ optional langAda "ada" 365 - ++ optional langVhdl "vhdl" 366 353 ++ optional langGo "go" 367 354 ++ optional langObjC "objc" 368 355 ++ optional langObjCpp "obj-c++" ··· 395 382 optional javaAwtGtk "--enable-java-awt=gtk" ++ 396 383 optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ 397 384 398 - # Ada 399 - optional langAda "--enable-libada" ++ 400 385 401 386 platformFlags ++ 402 387 optional (targetPlatform != hostPlatform) crossConfigureFlags ++ ··· 490 475 ]); 491 476 492 477 passthru = 493 - { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; 478 + { inherit langC langCC langObjC langObjCpp langFortran langGo version; isGNU = true; }; 494 479 495 480 inherit enableParallelBuilding enableMultilib; 496 481 ··· 513 498 514 499 maintainers = with stdenv.lib.maintainers; [ ]; 515 500 516 - # gnatboot is not available out of linux platforms, so we disable the darwin build 517 - # for the gnat (ada compiler). 518 501 platforms = 519 502 stdenv.lib.platforms.linux ++ 520 503 stdenv.lib.platforms.freebsd ++ 521 - optionals (langAda == false) stdenv.lib.platforms.darwin; 504 + stdenv.lib.platforms.darwin; 522 505 }; 523 506 } 524 507
-2
pkgs/development/compilers/gcc/builder.sh
··· 287 287 # See https://bugs.gentoo.org/show_bug.cgi?id=301299#c31 288 288 paxmark r $out/libexec/gcc/*/*/{cc1,cc1plus} 289 289 290 - eval "$postInstallGhdl" 291 - 292 290 # Two identical man pages are shipped (moving and compressing is done later) 293 291 ln -sf gcc.1 "$out"/share/man/man1/g++.1 294 292 }
-33
pkgs/development/compilers/gcc/gnat-cflags.patch
··· 1 - diff --git a/libada/Makefile.in b/libada/Makefile.in 2 - index f5057a0..337e0c6 100644 3 - --- a/libada/Makefile.in 4 - +++ b/libada/Makefile.in 5 - @@ -55,7 +55,7 @@ GCC_WARN_CFLAGS = $(LOOSE_WARN) 6 - WARN_CFLAGS = @warn_cflags@ 7 - 8 - TARGET_LIBGCC2_CFLAGS= 9 - -GNATLIBCFLAGS= -g -O2 10 - +GNATLIBCFLAGS= -g -O2 $(CFLAGS) 11 - GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \ 12 - -DIN_RTS @have_getipinfo@ 13 - 14 - --- a/gcc/ada/gcc-interface/Makefile.in 15 - +++ b/gcc/ada/gcc-interface/Makefile.in 16 - @@ -105,7 +105,7 @@ ADAFLAGS = -W -Wall -gnatpg -gnata 17 - SOME_ADAFLAGS =-gnata 18 - FORCE_DEBUG_ADAFLAGS = -g 19 - GNATLIBFLAGS = -gnatpg -nostdinc 20 - -GNATLIBCFLAGS = -g -O2 21 - +GNATLIBCFLAGS = -g -O2 $(CFLAGS_FOR_TARGET) 22 - # Pretend that _Unwind_GetIPInfo is available for the target by default. This 23 - # should be autodetected during the configuration of libada and passed down to 24 - # here, but we need something for --disable-libada and hope for the best. 25 - @@ -193,7 +193,7 @@ RTSDIR = rts$(subst /,_,$(MULTISUBDIR)) 26 - # Link flags used to build gnat tools. By default we prefer to statically 27 - # link with libgcc to avoid a dependency on shared libgcc (which is tricky 28 - # to deal with as it may conflict with the libgcc provided by the system). 29 - -GCC_LINK_FLAGS=-static-libgcc 30 - +GCC_LINK_FLAGS=-static-libgcc $(CFLAGS_FOR_TARGET) 31 - 32 - # End of variables for you to override. 33 -
+2 -20
pkgs/development/compilers/gcc/snapshot/default.nix
··· 3 3 , langObjC ? targetPlatform.isDarwin 4 4 , langObjCpp ? targetPlatform.isDarwin 5 5 , langJava ? false 6 - , langAda ? false 7 - , langVhdl ? false 8 6 , langGo ? false 9 7 , profiledCompiler ? false 10 8 , staticCompiler ? false ··· 21 19 , libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null 22 20 , libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null 23 21 , x11Support ? langJava 24 - , gnatboot ? null 25 22 , enableMultilib ? false 26 23 , enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins 27 24 , name ? "gcc" 28 25 , libcCross ? null 29 26 , crossStageStatic ? false 30 - , gnat ? null 31 27 , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd 32 28 , stripped ? true 33 29 , gnused ? null ··· 41 37 assert langJava -> zip != null && unzip != null 42 38 && zlib != null && boehmgc != null 43 39 && perl != null; # for `--enable-java-home' 44 - assert langAda -> gnatboot != null; 45 - assert langVhdl -> gnat != null; 46 40 47 41 # LTO needs libelf and zlib. 48 42 assert libelf != null -> zlib != null; ··· 67 61 [ ] 68 62 ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch 69 63 ++ optional noSysDirs ../no-sys-dirs.patch 70 - # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its 71 - # target libraries and tools. 72 - ++ optional langAda ../gnat-cflags.patch 73 64 ++ optional langFortran ../gfortran-driving.patch; 74 65 75 66 javaEcj = fetchurl { ··· 278 269 ++ (optionals langJava [ boehmgc zip unzip ]) 279 270 ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) 280 271 ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools]) 281 - ++ (optionals langAda [gnatboot]) 282 - ++ (optionals langVhdl [gnat]) 283 272 284 273 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with 285 274 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. ··· 331 320 ++ optional langCC "c++" 332 321 ++ optional langFortran "fortran" 333 322 ++ optional langJava "java" 334 - ++ optional langAda "ada" 335 - ++ optional langVhdl "vhdl" 336 323 ++ optional langGo "go" 337 324 ++ optional langObjC "objc" 338 325 ++ optional langObjCpp "obj-c++" ··· 364 351 ] ++ 365 352 optional javaAwtGtk "--enable-java-awt=gtk" ++ 366 353 optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ 367 - 368 - # Ada 369 - optional langAda "--enable-libada" ++ 370 354 371 355 platformFlags ++ 372 356 optional (targetPlatform != hostPlatform) crossConfigureFlags ++ ··· 460 444 ]); 461 445 462 446 passthru = 463 - { inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; }; 447 + { inherit langC langCC langObjC langObjCpp langFortran langGo version; isGNU = true; }; 464 448 465 449 inherit enableParallelBuilding enableMultilib; 466 450 ··· 483 467 484 468 maintainers = with stdenv.lib.maintainers; [ ]; 485 469 486 - # gnatboot is not available out of linux platforms, so we disable the darwin build 487 - # for the gnat (ada compiler). 488 470 platforms = 489 471 stdenv.lib.platforms.linux ++ 490 472 stdenv.lib.platforms.freebsd ++ 491 - optionals (langAda == false) stdenv.lib.platforms.darwin; 473 + stdenv.lib.platforms.darwin; 492 474 493 475 broken = true; 494 476 };
-44
pkgs/development/compilers/ghdl/default.nix
··· 1 - { stdenv, fetchFromGitHub, gnat, zlib, llvm_35, ncurses, clang, flavour ? "mcode" }: 2 - 3 - # mcode only works on x86, while the llvm flavour works on both x86 and x86_64. 4 - 5 - 6 - assert flavour == "llvm" || flavour == "mcode"; 7 - 8 - let 9 - inherit (stdenv.lib) optional; 10 - inherit (stdenv.lib) optionals; 11 - version = "0.33"; 12 - in 13 - stdenv.mkDerivation rec { 14 - name = "ghdl-${flavour}-${version}"; 15 - 16 - src = fetchFromGitHub { 17 - owner = "tgingold"; 18 - repo = "ghdl"; 19 - rev = "v${version}"; 20 - sha256 = "0g72rk2yzr0lrpncq2c1qcv71w3mi2hjq84r1yzgjr6d0qm87r2a"; 21 - }; 22 - 23 - buildInputs = [ gnat zlib ] ++ optionals (flavour == "llvm") [ clang ncurses ]; 24 - 25 - configureFlags = optional (flavour == "llvm") "--with-llvm=${llvm_35}"; 26 - 27 - patchPhase = '' 28 - # Disable warnings-as-errors, because there are warnings (unused things) 29 - sed -i s/-gnatwae/-gnatwa/ Makefile.in ghdl.gpr.in 30 - ''; 31 - 32 - hardeningDisable = [ "all" ]; 33 - 34 - enableParallelBuilding = true; 35 - 36 - meta = { 37 - homepage = https://sourceforge.net/p/ghdl-updates/wiki/Home/; 38 - description = "Free VHDL simulator"; 39 - maintainers = with stdenv.lib.maintainers; [viric]; 40 - platforms = with stdenv.lib.platforms; (if flavour == "llvm" then [ "i686-linux" "x86_64-linux" ] 41 - else [ "i686-linux" ]); 42 - license = stdenv.lib.licenses.gpl2Plus; 43 - }; 44 - }
-48
pkgs/development/compilers/gnatboot/default.nix
··· 1 - {stdenv, fetchurl}: 2 - 3 - stdenv.mkDerivation { 4 - name = "gentoo-gnatboot-4.1"; 5 - 6 - src = if stdenv.system == "i686-linux" then 7 - fetchurl { 8 - url = "mirror://gentoo/distfiles/gnatboot-4.1-i386.tar.bz2"; 9 - sha256 = "0665zk71598204bf521vw68i5y6ccqarq9fcxsqp7ccgycb4lysr"; 10 - } 11 - else if stdenv.system == "x86_64-linux" then 12 - fetchurl { 13 - url = "mirror://gentoo/distfiles/gnatboot-4.1-amd64.tar.bz2"; 14 - sha256 = "1li4d52lmbnfs6llcshlbqyik2q2q4bvpir0f7n38nagp0h6j0d4"; 15 - } else throw "Platform not supported"; 16 - 17 - dontStrip=1; 18 - 19 - installPhase = '' 20 - mkdir -p $out 21 - cp -R * $out 22 - set +e 23 - for a in $out/bin/* ; do 24 - patchelf --interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 25 - --set-rpath $(cat $NIX_CC/nix-support/orig-libc)/lib:$(cat $NIX_CC/nix-support/orig-cc)/lib64:$(cat $NIX_CC/nix-support/orig-cc)/lib $a 26 - done 27 - set -e 28 - mv $out/bin/gnatgcc_2wrap $out/bin/gnatgcc 29 - ln -s $out/bin/gnatgcc $out/bin/gcc 30 - ''; 31 - 32 - passthru = { 33 - langC = true; /* TRICK for gcc-wrapper to wrap it */ 34 - langCC = false; 35 - langFortran = false; 36 - langAda = true; 37 - }; 38 - 39 - meta = { 40 - homepage = http://gentoo.org; 41 - license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ 42 - maintainers = [ 43 - stdenv.lib.maintainers.viric 44 - ]; 45 - 46 - platforms = stdenv.lib.platforms.linux; 47 - }; 48 - }
-47
pkgs/top-level/all-packages.nix
··· 5958 5958 inherit binutils; 5959 5959 }; 5960 5960 5961 - gcc45 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.5 { 5962 - inherit noSysDirs; 5963 - texinfo = texinfo4; 5964 - 5965 - ppl = null; 5966 - cloogppl = null; 5967 - 5968 - # bootstrapping a profiled compiler does not work in the sheevaplug: 5969 - # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944 5970 - profiledCompiler = !stdenv.isArm; 5971 - 5972 - libcCross = if targetPlatform != buildPlatform then libcCross else null; 5973 - })); 5974 - 5975 5961 gcc48 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.8 { 5976 5962 inherit noSysDirs; 5977 5963 ··· 6096 6082 inherit (gnome2) libart_lgpl; 6097 6083 }); 6098 6084 6099 - gnat = gnat45; # failed to make 4.6 or 4.8 build 6100 - 6101 - gnat45 = wrapCC (gcc45.cc.override { 6102 - name = "gnat"; 6103 - langCC = false; 6104 - langC = true; 6105 - langAda = true; 6106 - profiledCompiler = false; 6107 - inherit gnatboot; 6108 - # We can't use the ppl stuff, because we would have 6109 - # libstdc++ problems. 6110 - cloogppl = null; 6111 - ppl = null; 6112 - }); 6113 - 6114 - gnatboot = wrapGCC-old (callPackage ../development/compilers/gnatboot {}); 6115 - 6116 6085 gnu-smalltalk = callPackage ../development/compilers/gnu-smalltalk { 6117 6086 emacsSupport = config.emacsSupport or false; 6118 6087 }; ··· 6125 6094 langGo = true; 6126 6095 profiledCompiler = false; 6127 6096 }); 6128 - 6129 - ghdl_mcode = callPackage_i686 ../development/compilers/ghdl { 6130 - flavour = "mcode"; 6131 - }; 6132 - 6133 - ghdl_llvm = callPackage ../development/compilers/ghdl { 6134 - flavour = "llvm"; 6135 - }; 6136 6097 6137 6098 gcl = callPackage ../development/compilers/gcl { 6138 6099 gmp = gmp4; ··· 6790 6751 # provide the default choice, avoiding infinite recursion. 6791 6752 bintools = if targetPlatform.isDarwin then darwin.binutils else binutils; 6792 6753 libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc; 6793 - }; 6794 - # legacy version, used for gnat bootstrapping 6795 - wrapGCC-old = baseGCC: callPackage ../build-support/gcc-wrapper-old { 6796 - nativeTools = stdenv.cc.nativeTools or false; 6797 - nativeLibc = stdenv.cc.nativeLibc or false; 6798 - nativePrefix = stdenv.cc.nativePrefix or ""; 6799 - gcc = baseGCC; 6800 - libc = glibc; 6801 6754 }; 6802 6755 6803 6756 wrapBintoolsWith = { bintools, libc }: bintoolsWrapperFun {
-1
pkgs/top-level/release-small.nix
··· 48 48 gcj = linux; 49 49 glibc = linux; 50 50 glibcLocales = linux; 51 - gnat = linux; 52 51 gnugrep = all; 53 52 gnum4 = all; 54 53 gnumake = all;