summaryrefslogtreecommitdiff
path: root/src/bootstrap/stage-0-binutils.TARGETS
blob: c3529c7faef4429c33df61cde778dd1332f0b377 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{ "bootstrap":
  { "type": "export"
  , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"]
  , "target": "bootstrap-ar"
  }
, "toolchain":
  { "type": "export"
  , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"]
  , "target": "binutils"
  }
, "files": {"type": "install", "deps": [["TREE", null, "."]]}
, "bootstrap-ar":
  { "type": ["@", "rules", "CC/foreign/shell", "data"]
  , "project": ["files"]
  , "localbase":
    [["@", "busybox", "", "bootstrap"], ["@", "make", "", "bootstrap"]]
  , "cmds":
    [ "export LD=${CC}"
    , "export AR=true"
    , "export RANLIB=true"
    , "export MAKE=${LOCALBASE}/bin/make"
    , "export PATH=${LOCALBASE}/bin:$PATH"
    , "unset LDFLAGS"
    , "export SHELL=${LOCALBASE}/bin/sh"
    , "export CONFIG_SHELL=${LOCALBASE}/bin/sh"
    , "mv install-sh install-sh.orig"
    , "echo '#!'\"${SHELL}\" > install-sh"
    , "cat install-sh.orig >> install-sh"
    , "chmod 755 install-sh"
    , "sh ./configure --prefix=/ --disable-nls --enable-shared=no --enable-plugins=no --enable-gprofng=no --disable-werror --enable-deterministic-archives --without-zstd >configure.log 2>&1 || (cat configure.log && exit 1)"
    , "${MAKE} MAKEINFO=true all-binutils >build.log 2>&1 || true"
    , "cd binutils"
    , "AR_SRCS='ar.c arparse.c arlex.c arsup.c not-ranlib.c rename.c binemul.c emul_vanilla.c bucomm.c version.c filemode.c'"
    , "AR_DEPS=\"$(ls ../bfd/*.o ../libiberty/*.o ../zlib/*.o ../libsframe/*.o | LC_ALL=C sort)\""
    , "AR_CFLAGS=\"${CFLAGS} -DDEFAULT_AR_DETERMINISTIC=1 -Dbin_dummy_emulation=bin_vanilla_emulation -I../include -I../bfd\""
    , "${CC} ${AR_CFLAGS} -o ${DESTDIR}/bin/ar ${AR_SRCS} ${AR_DEPS} >../build.log 2>&1 || (cat ../configure.log ../build.log && exit 1)"
    ]
  , "outs": ["bin/ar"]
  }
, "binutils":
  { "type": ["@", "rules", "CC/foreign/shell", "data"]
  , "project": ["files"]
  , "localbase":
    [ ["@", "busybox", "", "bootstrap"]
    , ["@", "make", "", "bootstrap"]
    , "bootstrap"
    ]
  , "cmds":
    [ "export LD=${CC}"
    , "export RANLIB=true"
    , "export AR=${LOCALBASE}/bin/ar"
    , "export MAKE=${LOCALBASE}/bin/make"
    , "export PATH=${LOCALBASE}/bin:$PATH"
    , "export SHELL=${LOCALBASE}/bin/sh"
    , "export CONFIG_SHELL=${LOCALBASE}/bin/sh"
    , "mv install-sh install-sh.orig"
    , "echo '#!'\"${SHELL}\" > install-sh"
    , "cat install-sh.orig >> install-sh"
    , "chmod 755 install-sh"
    , "unset LDFLAGS"
    , "if [ -f /lib/ld-musl-$(uname -m).so.1 ]; then"
    , "  ln -s /lib/ld-musl-$(uname -m).so.1 ${TMPDIR}/ldd"
    , "  export PATH=$PATH:${TMPDIR}"
    , "fi"
    , "export CXX=no"
    , "mkdir build"
    , "cd build"
    , "sh ../configure --prefix=/ --disable-nls --enable-gprofng=no --disable-werror --enable-deterministic-archives >configure.log 2>&1 || (cat configure.log && exit 1)"
    , "${MAKE} -j1 MAKEINFO=true >build.log 2>&1 || (cat configure.log build.log && exit 1)"
    , "${MAKE} -j1 MAKEINFO=true DESTDIR=${DESTDIR} install-strip >>build.log 2>&1 || (cat configure.log build.log && exit 1)"
    , "for f in $(find ${DESTDIR} -type f -name '*.la'); do sed -i 's|'$(pwd)'|/build|g' $f; done"
    ]
  , "out_dirs": ["."]
  }
}