]> rtime.felk.cvut.cz Git - jailhouse-test.git/blobdiff - bootstrap-relink/link_objects.sh
fiasco: bootstrap: some other tries to link it all together.
[jailhouse-test.git] / bootstrap-relink / link_objects.sh
index 7456e8dd4387d06130295fd685d6d20db5e86d83..7bc23b427bc33f582b5fe56a5612cb96ff7697fb 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 BUILD_DIR=$PWD/build
 #LD_SCRIPT64=$PWD/bootstrap.ld
-LD_SCRIPT32=$PWD/bootstrap32.ld
+LD_SCRIPT32=$PWD/all-linked-try.ld
 SNAP_DIR=$1
 
 set -e;
@@ -56,6 +56,22 @@ BOOTST_OBJ_DIR=$SNAP_DIR/obj/l4/amd64/pkg/bootstrap/server/src/OBJ-amd64_K8
 # objdump -D $BUILD_DIR/bootstrap.elf > disasms/bootstrap64.elf.s
 # chmod -x $BUILD_DIR/bootstrap64.bin
 # objcopy -B i386 -I binary -O elf32-i386 $BUILD_DIR/bootstrap64.bin $BUILD_DIR/bootstrap32.bin
+cd ../
+JAIL_DIR=$PWD/jailhouse/inmates
+cd $START_DIR
+echo "[inmate-header] Compiling..."
+  gcc-4.8 -Wp,-MD,$BUILD_DIR/.header-32.o.d  -nostdinc \
+  -isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/include   \
+  -D__KERNEL__ -D__ASSEMBLY__ -m64 -DCONFIG_X86_X32_ABI \
+  -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 \
+  -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 \
+  -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 \
+  -Wa,-gdwarf-2 -mfentry -DCC_USING_FENTRY   \
+  -I$JAIL_DIR/lib/x86   \
+  -I$JAIL_DIR/../hypervisor/arch/x86/include   \
+  -I$JAIL_DIR../hypervisor/include -m32   \
+  -c -o $BUILD_DIR/header-32-inmate.o \
+  ./header-32-inmate.S
 
 echo "[boot.S] Compiling the header of image.."
 gcc -m32 -o $BUILD_DIR/boot.o32 -c  \
@@ -98,6 +114,7 @@ gcc -m32 -o $BUILD_DIR/bootstrap32.elf -nostdlib -static \
                $BOOTST_OBJ_DIR/load_elf.o32 \
                $BOOTST_OBJ_DIR/minilibc_support.o32 \
                $BOOTST_OBJ_DIR/bootstrap32.bin \
+    $BUILD_DIR/header-32-inmate.o\
                $LD_SCRIPT32 \
                $SNAP_DIR/obj/l4/amd64/pkg/bootstrap/server/src/ARCH-amd64/libc32/OBJ-amd64_K8/libc32.a \
        -lgcc