annotate sources/sections/uClibc.build @ 1719:78050a31d1ee draft

Sigh. Checked in the wrong version of the patch (typo fix).
author Rob Landley <rob@landley.net>
date Tue, 06 Jan 2015 13:15:33 -0600
parents 012df19f8569
children acaa88463c0c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 # Build and install uClibc
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
1340
5e22b534839a Switch to from pthreads.old to NPTL.
Rob Landley <rob@landley.net>
parents: 1207
diff changeset
3 # Work around a uClibc bug: it tries to use assembly directives on binutils
5e22b534839a Switch to from pthreads.old to NPTL.
Rob Landley <rob@landley.net>
parents: 1207
diff changeset
4 # versions that don't have them.
5e22b534839a Switch to from pthreads.old to NPTL.
Rob Landley <rob@landley.net>
parents: 1207
diff changeset
5
5e22b534839a Switch to from pthreads.old to NPTL.
Rob Landley <rob@landley.net>
parents: 1207
diff changeset
6 find . -name uClibc_arch_features.h | xargs sed -i 's/\#define \(__UCLIBC_HAVE_ASM_CFI_DIRECTIVES__\)/#undef \1/'
5e22b534839a Switch to from pthreads.old to NPTL.
Rob Landley <rob@landley.net>
parents: 1207
diff changeset
7
5e22b534839a Switch to from pthreads.old to NPTL.
Rob Landley <rob@landley.net>
parents: 1207
diff changeset
8 [ ! -z "$BUILD_VERBOSE" ] && VERBOSITY=V=2
5e22b534839a Switch to from pthreads.old to NPTL.
Rob Landley <rob@landley.net>
parents: 1207
diff changeset
9
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
10 make_uClibc()
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
11 {
1090
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
12 make -j $CPUS $VERBOSITY CROSS="${ARCH}-" \
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
13 UCLIBC_LDSO_NAME=ld-uClibc KERNEL_HEADERS="$STAGE_DIR/include" \
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
14 PREFIX="$STAGE_DIR/" RUNTIME_PREFIX=/ DEVEL_PREFIX=/ $1
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
15 }
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
16
938
609bc05b0d6a Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
17 # Configure
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
18
1152
2f39d1bfb2fd Add baseconfig-linux, the infrastructure to use it, and move over the arm targets. (You can override with a miniconfig-linux or miniconfig-uClibc in the appropriate target directory.)
Rob Landley <rob@landley.net>
parents: 1136
diff changeset
19 getconfig uClibc > "$WORK/mini.conf" || dienow
938
609bc05b0d6a Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
20
609bc05b0d6a Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
21 # Build and install
609bc05b0d6a Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
22
871
b274eb556b50 Merge common uclibc miniconfig stuff into baseconfig-uClibc, and add the few lines that vary per target to each target's settings file.
Rob Landley <rob@landley.net>
parents: 821
diff changeset
23 make KCONFIG_ALLCONFIG="$WORK/mini.conf" allnoconfig &&
1065
1d776e44b908 Save the uClibc and linux .config files in the native toolchain, and install them with the rest of the native toolchain. Don't bother extracting and configuring the kernel if we don't need to.
Rob Landley <rob@landley.net>
parents: 964
diff changeset
24 mkdir -p "$STAGE_DIR/src" &&
1d776e44b908 Save the uClibc and linux .config files in the native toolchain, and install them with the rest of the native toolchain. Don't bother extracting and configuring the kernel if we don't need to.
Rob Landley <rob@landley.net>
parents: 964
diff changeset
25 cp .config "$STAGE_DIR/src/config-uClibc" &&
938
609bc05b0d6a Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
26 make_uClibc install || dienow
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
27
1340
5e22b534839a Switch to from pthreads.old to NPTL.
Rob Landley <rob@landley.net>
parents: 1207
diff changeset
28 # Old versions of uClibc (0.9.30-ish) couldn't be told not to hardwire absolute
5e22b534839a Switch to from pthreads.old to NPTL.
Rob Landley <rob@landley.net>
parents: 1207
diff changeset
29 # paths into their linker scripts. This isn't needed for current versions, and
1136
fb05d8a5fd77 Oops, a debug bit leaked. Keep it in but make it not fail when HAVE_SHARED=n.
Rob Landley <rob@landley.net>
parents: 1130
diff changeset
30 # is allowed to fail if HAVE_SHARED=n
fb05d8a5fd77 Oops, a debug bit leaked. Keep it in but make it not fail when HAVE_SHARED=n.
Rob Landley <rob@landley.net>
parents: 1130
diff changeset
31
1705
012df19f8569 Only edit linker script when it exists.
Rob Landley <rob@landley.net>
parents: 1443
diff changeset
32 [ -e "$STAGE_DIR/lib/libc.so" ] &&
012df19f8569 Only edit linker script when it exists.
Rob Landley <rob@landley.net>
parents: 1443
diff changeset
33 sed -i 's@/lib/@@g' "$STAGE_DIR/lib/libc.so" 2>/dev/null
1130
c222ae88733a Add NO_CPLUSPLUS config option, to skip c++ support entirely.
Rob Landley <rob@landley.net>
parents: 1090
diff changeset
34
1090
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
35 # Build ldd and friends
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
36
1090
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
37 if [ ! -z "$HOST_ARCH" ]
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
38 then
1090
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
39 # The uClibc utils/Makefile.in is crazy. There's no way to specify a prefix,
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
40 # or to pass in --static via CFLAGS. Just build 'em by hand.
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
41
1443
923dbb2a8f19 Build the cross compiler's ldd/ldconfig for the correct architecture. (Sigh.)
Rob Landley <rob@landley.net>
parents: 1340
diff changeset
42 "$HOST_ARCH-cc" utils/ldd.c -o "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}ldd" \
923dbb2a8f19 Build the cross compiler's ldd/ldconfig for the correct architecture. (Sigh.)
Rob Landley <rob@landley.net>
parents: 1340
diff changeset
43 --static -I ldso/include -DBUILDING_LINKAGE &&
923dbb2a8f19 Build the cross compiler's ldd/ldconfig for the correct architecture. (Sigh.)
Rob Landley <rob@landley.net>
parents: 1340
diff changeset
44 "$HOST_ARCH-cc" utils/ldconfig.c utils/chroot_realpath.c \
1207
4021fb1183d7 Environment sanitizing screwed up the cross-compiler.sh wrapper. Fix it, rename PROGRAM_PREFIX to TOOLCHAIN_PREFIX, and put a guard around sources/include.sh so it's safe to include multiple times.
Rob Landley <rob@landley.net>
parents: 1152
diff changeset
45 -o "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}ldconfig" --static -I ldso/include \
1090
affef1edbdba Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents: 1082
diff changeset
46 -DUCLIBC_RUNTIME_PREFIX='"/"' -DBUILDING_LINKAGE || dienow
819
da1ebb2e22d3 Part one of the great refactoring, breaking out the uClibc build so it isn't repeated in two places.
Rob Landley <rob@landley.net>
parents:
diff changeset
47 fi