summaryrefslogtreecommitdiff
path: root/strata/build-essential/stage2-gcc-fixed-headers.morph
blob: 9e77c67f9afcd68ec58bf90c792175c5241f1332 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
name: stage2-gcc-fixed-headers
kind: chunk

pre-configure-commands:
- |
  case "$MORPH_ARCH" in
      mips64*)  sed -i "s/^\(\#define\s\+MIPS_ABI_DEFAULT\s\+\)ABI_32/\1ABI_64/" gcc/config/mips/mips.h ;;
  esac

install-commands:
# Stage 1 GCC's fixincludes process created a limits.h before there was
# a real limits.h available for the target. This step (taken from Linux
# Linux From Scratch) creates a better one so that stage 2 GCC can compile.
#
# THIS IS A FRAGILE HACK! We need to replace the headers. The only way to
# overwrite files in a staging area is to install a new chunk.
# This is undesired behaviour in the long term, as we want to never
# have overlaps, so this functionality may go away.
- |
  TARGET_STAGE1=`echo $TARGET_STAGE1 | sed -e 's/bootstrap-linux-gnu/linux-musl/'`
  libgcc_dir=$(dirname $($TARGET_STAGE1-gcc -print-libgcc-file-name))
  sysroot="$(dirname "$(pwd)")"
  target_libgcc_dir="${libgcc_dir#$sysroot}"
  mkdir -p "$DESTDIR/$target_libgcc_dir/include-fixed"
  cat "gcc/limitx.h" "gcc/glimits.h" "gcc/limity.h" \
      >"$DESTDIR/$target_libgcc_dir/include-fixed/limits.h"