Build fixes for ARMv7.
authorGerd Zellweger <mail@gerdzellweger.com>
Thu, 6 Jun 2013 15:12:44 +0000 (17:12 +0200)
committerGerd Zellweger <mail@gerdzellweger.com>
Tue, 16 Jul 2013 12:54:59 +0000 (14:54 +0200)
Make choice about GCC binary. Fixed typos in usbconf mackerel file.
Remove MMU from kernel Hakefile because it is not needed.
Don't do stack protection (leads to compiler errors on newer versions).
Don't add build-id when linking on ARMv7. This screwed up ELF loading in our
kernel when it tried to load a section at 0x8000 -- which is not a valid
virtual address -- for the init binary. For some reason
stripping the section manually did not help.

devices/omap/omap44xx_usbconf.dev
hake/ARMv7.hs
hake/symbolic_targets.mk
kernel/Hakefile
tools/arm_molly/build_data_files.sh

index 99328bf..2416759 100644 (file)
@@ -123,12 +123,12 @@ device omap44xx_usbconf msbfirst ( addr base ) "OMAP44xx USB host subsystem" {
        tllfullspeed    1       "PHY speed emul. in TLL (full/slow)";
        tllconnect      1       "Emulate Full/Low-Speed connect";
        tllattach       1       "Emulate cable attach/detach";
-       utmiisadev      1       "Select cable end "seen" by UTMI side of TLL";
+       utmiisadev      1       "Select cable end seen by UTMI side of TLL";
        chanmode        2       "Main channel mode selection";
        chanen          1       "Active-high channel enable";
     };
 
-    regarray sar_cntx rw  rw addr(base, 0x0400)[7] 
+    regarray sar_cntx rw addr(base, 0x0400)[7] 
        "Save and restore context array" 
        type(uint32);
 };
index 29f3d15..8f33ae0 100644 (file)
@@ -39,6 +39,7 @@ cxxcompiler = "arm-linux-gnueabi-g++"
 ourCommonFlags = [ Str "-fno-unwind-tables",
                    Str "-Wno-packed-bitfield-compat",
                    Str "-marm",
+                   Str "-fno-stack-protector",
                    Str "-mcpu=cortex-a9",
                    Str "-march=armv7-a",
                    Str "-mapcs",
@@ -67,7 +68,8 @@ cxxFlags = ArchDefaults.commonCxxFlags
 cDefines = ArchDefaults.cDefines options
 
 ourLdFlags = [ Str "-Wl,-section-start,.text=0x400000",
-               Str "-Wl,-section-start,.data=0x600000" ]
+               Str "-Wl,-section-start,.data=0x600000",
+               Str "-Wl,--build-id=none" ]
 
 ldFlags = ArchDefaults.ldFlags arch ++ ourLdFlags
 ldCxxFlags = ArchDefaults.ldCxxFlags arch ++ ourLdFlags
@@ -79,9 +81,11 @@ options = (ArchDefaults.options arch archFamily) {
             optCxxFlags = cxxFlags,
             optDefines = cDefines,
             optDependencies = 
-                [ PreDep InstallTree arch "/include/errors/errno.h",
+                [ PreDep InstallTree arch "/include/trace_definitions/trace_defs.h",
+                  PreDep InstallTree arch "/include/errors/errno.h",
                   PreDep InstallTree arch "/include/barrelfish_kpi/capbits.h",
-                  PreDep InstallTree arch "/include/asmoffsets.h" ],
+                  PreDep InstallTree arch "/include/asmoffsets.h"
+                   ],
             optLdFlags = ldFlags,
             optLdCxxFlags = ldCxxFlags,
             optLibs = stdLibs,
index eef18fa..ce6a7cf 100644 (file)
@@ -476,7 +476,7 @@ pandaboard_image: $(PANDABOARD_MODULES) \
        # bootloader
        tools/bin/arm_molly menu.lst.pandaboard panda_mbi.c
        # Compile the complete boot image into a single executable
-       $(ARM_PREFIX)gcc -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
+       $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
                -nostdlib -march=armv7-a -mapcs -fno-unwind-tables \
                -Tmolly_panda/molly_ld_script \
                -I$(SRCDIR)/include \
@@ -532,7 +532,7 @@ arm_gem5_image: $(GEM5_MODULES) \
        # bootloader
        tools/bin/arm_molly menu.lst.arm_gem5 arm_mbi.c
        # Compile the complete boot image into a single executable
-       $(ARM_PREFIX)gcc -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
+       $(ARM_GCC)gcc -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
                -nostdlib -march=armv7-a -mapcs -fno-unwind-tables \
                -Tmolly_gem5/molly_ld_script \
                -I$(SRCDIR)/include \
@@ -550,7 +550,7 @@ arm_gem5_image: $(GEM5_MODULES) \
                -o arm_gem5_image
 
 # ARM GEM5 Simulation Targets
-ARM_PREFIX=arm-none-linux-gnueabi-
+ARM_GCC=$(which arm-none-linux-gnueabi-gcc || which arm-linux-gnueabi-gcc)
 ARM_FLAGS=$(SRCDIR)/tools/arm_gem5/gem5script.py --caches --l2cache --n=2 --kernel=arm_gem5_image
 
 arm_gem5: arm_gem5_image $(SRCDIR)/tools/arm_gem5/gem5script.py
index 2a8db39..14e0813 100644 (file)
@@ -365,8 +365,7 @@ let
                          "omap/omap_uart", 
                          "omap/omap44xx_id", 
                          "omap/omap44xx_emif",
-                         "omap/omap44xx_gpio",
-                         "omap/omap44xx_mmu"],
+                         "omap/omap44xx_gpio"],
      addLibraries = [ "elf", "cpio" ]
      }                            
   
index 1e12b9b..b7951c6 100755 (executable)
@@ -31,6 +31,7 @@ fi
 
 # Get list of binaries to translate
 BINS=$(awk '/^kernel/ || /^module/ {print $2}' $MENU_LST)
+OBJCOPY=$(which arm-none-linux-gnueabi-objcopy || which arm-linux-gnueabi-objcopy)
 
 # For each binary generate an object file in the output directory.
 # The flags to objcopy cause it to place the binary image of the input
@@ -41,7 +42,7 @@ for BIN in $BINS; do
   SLASH=${BIN////_}
   BIN_OUT="$OUTPUT_PREFIX/${FILE_PREFIX}_$SLASH"
   echo $BIN '->' $BIN_OUT
-  arm-none-linux-gnueabi-objcopy -I binary -O elf32-littlearm -B arm --rename-section .data=.rodata$IDX,alloc,load,readonly,data,contents .$BIN $BIN_OUT
+  $(OBJCOPY) -I binary -O elf32-littlearm -B arm --rename-section .data=.rodata$IDX,alloc,load,readonly,data,contents .$BIN $BIN_OUT
   IDX=$(($IDX+1))
   if [ $IDX = 17 ]; then
       echo Error: linker script cannot handle $IDX modules