diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2013-08-23 14:40:50 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2013-08-23 14:40:50 +0000 |
commit | f06c6df4db836f9a6acd0bf6da05649b089cd44f (patch) | |
tree | 94121b4458d6a881e983ded9475b54ea90b2ab32 | |
parent | f9e4890cfc655355226285812da74e0d04ed7f63 (diff) | |
parent | 9ac501477bd7539a2bf0fa0cf8c541ef1e505e17 (diff) | |
download | eglibc2-f06c6df4db836f9a6acd0bf6da05649b089cd44f.tar.gz |
Merge branch 'baserock/richardmaw/S8564/ro-staging-area' into baserock/2.15-build-essential
Reviewed-by: Lars Wirzenius
-rw-r--r-- | eglibc.morph | 44 | ||||
-rw-r--r-- | eglibc.morph.yaml | 27 | ||||
-rw-r--r-- | nsswitch.conf | 2 | ||||
-rw-r--r-- | stage2-eglibc-fix-specs | 18 | ||||
-rw-r--r-- | stage2-eglibc.morph | 70 | ||||
-rw-r--r-- | stage2-eglibc.morph.yaml | 52 | ||||
-rw-r--r-- | stage2-reset-specs.morph | 21 |
7 files changed, 116 insertions, 118 deletions
diff --git a/eglibc.morph b/eglibc.morph index 1ea68ce68..4efd311a9 100644 --- a/eglibc.morph +++ b/eglibc.morph @@ -1,17 +1,27 @@ -{ - "name": "eglibc", - "kind": "chunk", - "configure-commands": [ - "mkdir o", - "cd libc && ln -s ../ports ports", - "export CFLAGS=\"-O2 $CFLAGS\"; cd o &&\n../libc/configure \\\n $(../morph-arch-config) \\\n --prefix=\"$PREFIX\" \\\n --disable-profile \\\n --enable-kernel=2.6.25 \\\n --enable-add-ons=nptl,ports \\\n --without-cvs \\\n --without-selinux\n" - ], - "build-commands": [ - "cd o && make localtime=UTC" - ], - "install-commands": [ - "cd o && make install_root=\"$DESTDIR\" localtime=UTC install", - "mkdir -p \"$DESTDIR/etc\"", - "install -m 644 -o root -g root nsswitch.conf \"$DESTDIR/etc/nsswitch.conf\"" - ] -} +name: eglibc +kind: chunk + +configure-commands: + - mkdir o + + # Necessary for ARM port + - cd libc && ln -s ../ports ports + + - | + export CFLAGS="-O2 $CFLAGS"; cd o && + ../libc/configure \ + $(../morph-arch-config) \ + --prefix="$PREFIX" \ + --disable-profile \ + --enable-kernel=2.6.25 \ + --enable-add-ons=nptl,ports \ + --without-cvs \ + --without-selinux + +build-commands: + - cd o && make localtime=UTC + +install-commands: + - cd o && make install_root="$DESTDIR" localtime=UTC install + - mkdir -p "$DESTDIR/etc" + - install -m 644 -o root -g root nsswitch.conf "$DESTDIR/etc/nsswitch.conf" diff --git a/eglibc.morph.yaml b/eglibc.morph.yaml deleted file mode 100644 index 4efd311a9..000000000 --- a/eglibc.morph.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: eglibc -kind: chunk - -configure-commands: - - mkdir o - - # Necessary for ARM port - - cd libc && ln -s ../ports ports - - - | - export CFLAGS="-O2 $CFLAGS"; cd o && - ../libc/configure \ - $(../morph-arch-config) \ - --prefix="$PREFIX" \ - --disable-profile \ - --enable-kernel=2.6.25 \ - --enable-add-ons=nptl,ports \ - --without-cvs \ - --without-selinux - -build-commands: - - cd o && make localtime=UTC - -install-commands: - - cd o && make install_root="$DESTDIR" localtime=UTC install - - mkdir -p "$DESTDIR/etc" - - install -m 644 -o root -g root nsswitch.conf "$DESTDIR/etc/nsswitch.conf" diff --git a/nsswitch.conf b/nsswitch.conf index c786e6bd0..adc9c86f8 100644 --- a/nsswitch.conf +++ b/nsswitch.conf @@ -2,7 +2,7 @@ passwd: compat group: compat shadow: compat -hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 +hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 myhostname networks: files protocols: db files diff --git a/stage2-eglibc-fix-specs b/stage2-eglibc-fix-specs index 82e292036..fec0d08d0 100644 --- a/stage2-eglibc-fix-specs +++ b/stage2-eglibc-fix-specs @@ -16,11 +16,23 @@ set -eu +sysroot="$(dirname "$(pwd)")" specs_dir="$(dirname $($TARGET_STAGE1-gcc --print-libgcc-file-name))" -mkdir -p "$specs_dir" +target_specs_dir="$DESTDIR/${specs_dir#$sysroot}" +mkdir -p "$target_specs_dir" -$TARGET_STAGE1-gcc -dumpspecs | \ +$TARGET_STAGE1-gcc -dumpspecs | sed -e "s@[gMS]\?crt[1in].o%s@%:getenv(STAGE2_SYSROOT $PREFIX/lib/&)@g" \ -e "s@/lib\(64\)\?/ld@$PREFIX/lib/ld@g" \ - > "$specs_dir/specs" + > "$target_specs_dir/specs-for-sysroot" +# NASTY HACK # +# We create a symlink to the actual specs here, so that later the +# symlink can be replaced with a dangling link. +# +# This is necessary as we need to have gcc use its internal specs, +# which can differ to the specs generated by `gcc -dumpspecs`. +# +# The dangling symlink will not make it onto the final system, just +# like all other bootstrap only components. +ln -s specs-for-sysroot "$target_specs_dir/specs" diff --git a/stage2-eglibc.morph b/stage2-eglibc.morph index 48cb8a100..8041821a0 100644 --- a/stage2-eglibc.morph +++ b/stage2-eglibc.morph @@ -1,18 +1,52 @@ -{ - "name": "stage2-eglibc", - "kind": "chunk", - "configure-commands": [ - "mkdir o", - "cd libc && ln -s ../ports ports", - "export CFLAGS=\"-O2 $CFLAGS\"; export CXX=false; \\\ncd o && ../libc/configure \\\n $(../morph-arch-config) \\\n --build=$(../libc/scripts/config.guess) --host=$TARGET_STAGE1 \\\n --prefix=\"$PREFIX\" \\\n `# [1]` --libdir=\"$PREFIX/lib\" \\\n `# [2]` --with-headers=\"$(pwd)/../../$PREFIX/include\" \\\n `# [3]` --disable-profile --enable-kernel=2.6.25 \\\n --enable-add-ons=nptl,ports --without-cvs --without-selinux \\\n `# [4]` libc_cv_c_cleanup=yes libc_cv_ctors_header=yes \\\n libc_cv_forced_unwind=yes libc_cv_ssp=no\n" - ], - "build-commands": [ - "cd o && make localtime=UTC" - ], - "install-commands": [ - "cd o && make install_root=\"$DESTDIR\" localtime=UTC install", - "install -m 755 stage2-eglibc-fix-specs $DESTDIR$PREFIX/bin", - "install -d $DESTDIR/lib", - "cpu=$(echo $TARGET | cut -d '-' -f 1)\nif [ \"$cpu\" == \"x86_64\" ]; then\n install -d \"$DESTDIR/lib64\"\n ln -s \"$PREFIX/lib/ld-linux-x86-64.so.2\" \\\n \"$DESTDIR/lib64/ld-linux-x86-64.so.2\"\nelse\n loader=$(basename $(ls \"$DESTDIR$PREFIX\"/lib/ld-linux*))\n ln -s \"$PREFIX/lib/$loader\" \"$DESTDIR/lib/$loader\"\nfi\n" - ] -} +name: stage2-eglibc +kind: chunk + +configure-commands: + - mkdir o + + # Necessary for ARM port + - cd libc && ln -s ../ports ports + + # Configure flag notes: + # 1. Avoid installing to PREFIX/lib64 on x86_64. + # 2. Location of linux-api-headers. + # 3. Normal flags. See eglibc.morph. + # 4. Force configuration values of certain things that can't be detected + # in a cross-compile. + - | + export CFLAGS="-O2 $CFLAGS"; export CXX=false; \ + cd o && ../libc/configure \ + $(../morph-arch-config) \ + --build=$(../libc/scripts/config.guess) --host=$TARGET_STAGE1 \ + --prefix="$PREFIX" \ + `# [1]` --libdir="$PREFIX/lib" \ + `# [2]` --with-headers="$(pwd)/../../$PREFIX/include" \ + `# [3]` --disable-profile --enable-kernel=2.6.25 \ + --enable-add-ons=nptl,ports --without-cvs --without-selinux \ + `# [4]` libc_cv_c_cleanup=yes libc_cv_ctors_header=yes \ + libc_cv_forced_unwind=yes libc_cv_ssp=no + +build-commands: + - cd o && make localtime=UTC + +install-commands: + - cd o && make install_root="$DESTDIR" localtime=UTC install + - sh stage2-eglibc-fix-specs + + # Install a symlink for the program interpreter (ld.so) so that binaries + # built in stage 3 before the stage 3 eglibc is built can use it. + # FIXME: get a better way of finding the name of the loader. The lib64 + # path is hardcoded into eglibc in the file + # sysdeps/unix/sysv/linux/configure. + - install -d $DESTDIR/lib + - | + cpu=$(echo $TARGET | cut -d '-' -f 1) + if [ "$cpu" == "x86_64" ]; then + install -d "$DESTDIR/lib64" + ln -s "$PREFIX/lib/ld-linux-x86-64.so.2" \ + "$DESTDIR/lib64/ld-linux-x86-64.so.2" + else + loader=$(basename $(ls "$DESTDIR$PREFIX"/lib/ld-linux*)) + ln -s "$PREFIX/lib/$loader" "$DESTDIR/lib/$loader" + fi + diff --git a/stage2-eglibc.morph.yaml b/stage2-eglibc.morph.yaml deleted file mode 100644 index 85b448533..000000000 --- a/stage2-eglibc.morph.yaml +++ /dev/null @@ -1,52 +0,0 @@ -name: stage2-eglibc -kind: chunk - -configure-commands: - - mkdir o - - # Necessary for ARM port - - cd libc && ln -s ../ports ports - - # Configure flag notes: - # 1. Avoid installing to PREFIX/lib64 on x86_64. - # 2. Location of linux-api-headers. - # 3. Normal flags. See eglibc.morph. - # 4. Force configuration values of certain things that can't be detected - # in a cross-compile. - - | - export CFLAGS="-O2 $CFLAGS"; export CXX=false; \ - cd o && ../libc/configure \ - $(../morph-arch-config) \ - --build=$(../libc/scripts/config.guess) --host=$TARGET_STAGE1 \ - --prefix="$PREFIX" \ - `# [1]` --libdir="$PREFIX/lib" \ - `# [2]` --with-headers="$(pwd)/../../$PREFIX/include" \ - `# [3]` --disable-profile --enable-kernel=2.6.25 \ - --enable-add-ons=nptl,ports --without-cvs --without-selinux \ - `# [4]` libc_cv_c_cleanup=yes libc_cv_ctors_header=yes \ - libc_cv_forced_unwind=yes libc_cv_ssp=no - -build-commands: - - cd o && make localtime=UTC - -install-commands: - - cd o && make install_root="$DESTDIR" localtime=UTC install - - install -m 755 stage2-eglibc-fix-specs $DESTDIR$PREFIX/bin - - # Install a symlink for the program interpreter (ld.so) so that binaries - # built in stage 3 before the stage 3 eglibc is built can use it. - # FIXME: get a better way of finding the name of the loader. The lib64 - # path is hardcoded into eglibc in the file - # sysdeps/unix/sysv/linux/configure. - - install -d $DESTDIR/lib - - | - cpu=$(echo $TARGET | cut -d '-' -f 1) - if [ "$cpu" == "x86_64" ]; then - install -d "$DESTDIR/lib64" - ln -s "$PREFIX/lib/ld-linux-x86-64.so.2" \ - "$DESTDIR/lib64/ld-linux-x86-64.so.2" - else - loader=$(basename $(ls "$DESTDIR$PREFIX"/lib/ld-linux*)) - ln -s "$PREFIX/lib/$loader" "$DESTDIR/lib/$loader" - fi - diff --git a/stage2-reset-specs.morph b/stage2-reset-specs.morph new file mode 100644 index 000000000..387ef835d --- /dev/null +++ b/stage2-reset-specs.morph @@ -0,0 +1,21 @@ +name: stage2-reset-specs +kind: chunk + +# Nasty hack to get around being unable to reliably add configuration to gcc, +# hence the gcc specs are modified, combined with Baserock's rootfs protection +# preventing specs being modified before builds. +# The limitation is overcome by installing files as part of a chunk, which +# overwrites previous files. +# New specs were added for the bootstrap builds, but after stage2 we start +# having chrooted builds, so the old specs need to be replaced. +# Unfortunately we can't just replace the specs with the ones gcc produces, +# since gcc behaves differently without specs to with specs it produces! +# So we use a **NASTY HACK** to replace the specs symlink with one that +# points to a file that doesn't exist. +install-commands: + - | + STAGE2_SYSROOT="$(dirname "$(pwd)")" + specs_dir="$(dirname $($TARGET_STAGE1-gcc -print-libgcc-file-name))" + target_specs_dir="$DESTDIR/${specs_dir#$STAGE2_SYSROOT}" + mkdir -p "$target_specs_dir" + ln -s "temporary specs removed by baserock bootstrap" "$target_specs_dir/specs" |