diff --git a/SConstruct b/SConstruct index e401731..a408669 100644 --- a/SConstruct +++ b/SConstruct @@ -22,7 +22,7 @@ def generate_kernel_linker_script(target, source, env): linker_in = source[0] linker_out = target[0] - cmd = config.toolchain + "cpp -D__CPP__ " + \ + cmd = config.toolchain_kernel + "cpp -D__CPP__ " + \ "-I%s -imacros l4/macros.h -imacros %s -imacros %s -C -P %s -o %s" % \ ('include', 'l4/platform/'+ platform + '/offsets.h', \ 'l4/glue/' + arch + '/memlayout.h', linker_in, linker_out) @@ -39,7 +39,7 @@ def generate_kernel_phys_linker_script(target, source, env): phys_linker_in = source[0] phys_linker_out = target[0] - cmd = config.toolchain + "cpp -D__CPP__ " + \ + cmd = config.toolchain_kernel + "cpp -D__CPP__ " + \ "-I%s -imacros l4/macros.h -imacros %s -imacros %s -C -P %s -o %s" % \ ('include', 'l4/platform/'+ platform + '/offsets.h', \ 'l4/glue/' + arch + '/memlayout.h', phys_linker_in, phys_linker_out) @@ -50,9 +50,9 @@ create_kernel_phys_linker = Command(join(builddir, 'include/physlink.lds'), \ join(PROJROOT, 'include/physlink.lds.in'), \ generate_kernel_phys_linker_script) ''' -env = Environment(CC = config.toolchain + 'gcc', - AR = config.toolchain + 'ar', - RANLIB = config.toolchain + 'ranlib', +env = Environment(CC = config.toolchain_kernel + 'gcc', + AR = config.toolchain_kernel + 'ar', + RANLIB = config.toolchain_kernel + 'ranlib', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \ diff --git a/SConstruct.loader b/SConstruct.loader index 15fcf47..6f4a7c4 100644 --- a/SConstruct.loader +++ b/SConstruct.loader @@ -30,9 +30,9 @@ LIBELF_PATH = 'loader/libs/elf' LIBELF_LIBPATH = LIBELF_PATH LIBELF_INCPATH = '#' + join(LIBELF_PATH, 'include') -env = Environment(CC = config.toolchain + 'gcc', - AR = config.toolchain + 'ar', - RANLIB = config.toolchain + 'ranlib', +env = Environment(CC = config.toolchain_kernel + 'gcc', + AR = config.toolchain_kernel + 'ar', + RANLIB = config.toolchain_kernel + 'ranlib', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \ diff --git a/SConstruct.userlibs b/SConstruct.userlibs index 762ad15..29a2997 100644 --- a/SConstruct.userlibs +++ b/SConstruct.userlibs @@ -16,9 +16,9 @@ platform = config.platform gcc_arch_flag = config.gcc_arch_flag all_syms = config.all -env = Environment(CC = config.toolchain + 'gcc', - AR = config.toolchain + 'ar', - RANLIB = config.toolchain + 'ranlib', +env = Environment(CC = config.toolchain_userspace + 'gcc', + AR = config.toolchain_userspace + 'ar', + RANLIB = config.toolchain_userspace + 'ranlib', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', diff --git a/config/cml/arm.ruleset b/config/cml/arm.ruleset index c98b3e0..7bf4736 100644 --- a/config/cml/arm.ruleset +++ b/config/cml/arm.ruleset @@ -42,7 +42,8 @@ SCHED_TICKS 'Scheduler ticks per second' ICACHE_DISABLE 'Disable the L1 instruction cache' DCACHE_DISABLE 'Disable the L1 data cache' PREEMPT_DISABLE 'Disable Kernel Preemption' -TOOLCHAIN 'Toolchain prefix for kernel' +TOOLCHAIN_USERSPACE 'Toolchain prefix for userspace' +TOOLCHAIN_KERNEL 'Toolchain prefix for kernel' CAPABILITIES 'Enable capability checking' @@ -100,7 +101,8 @@ menu kernel_generic_options SCHED_TICKS% menu toolchain_menu - TOOLCHAIN$ + TOOLCHAIN_USERSPACE$ + TOOLCHAIN_KERNEL$ menu main_menu arch_type @@ -194,7 +196,8 @@ require NCPU <= 4 derive RAM_BASE_PLAT from PLATFORM_BEAGLE ? 0x80000000 : 0x00000000 # Toolchains: -default TOOLCHAIN from 'arm-none-eabi-' +default TOOLCHAIN_USERSPACE from 'arm-none-linux-gnueabi-' +default TOOLCHAIN_KERNEL from 'arm-none-eabi-' prefix CONFIG_ diff --git a/config/configuration.py b/config/configuration.py index b6dda1b..6443353 100644 --- a/config/configuration.py +++ b/config/configuration.py @@ -69,7 +69,8 @@ class configuration: self.platform = None self.cpu = None self.gcc_arch_flag = None - self.toolchain = None + self.toolchain_userspace = None + self.toolchain_kernel = None self.all = [] self.containers = [] self.ncontainers = 0 @@ -117,9 +118,16 @@ class configuration: # Extract kernel space toolchain from a name value pair def get_toolchain(self, name, val): - if name[:len("CONFIG_TOOLCHAIN")] == "CONFIG_TOOLCHAIN": + if name[:len("CONFIG_TOOLCHAIN_USERSPACE")] == \ + "CONFIG_TOOLCHAIN_USERSPACE": parts = val.split("\"", 2) - self.toolchain = parts[1] + self.toolchain_userspace = parts[1] + + if name[:len("CONFIG_TOOLCHAIN_KERNEL")] == \ + "CONFIG_TOOLCHAIN_KERNEL": + parts = val.split("\"", 2) + self.toolchain_kernel = parts[1] + # Extract number of containers def get_ncontainers(self, name, val): diff --git a/conts/baremetal/empty/SConstruct b/conts/baremetal/empty/SConstruct index 3a65e11..6b408f3 100644 --- a/conts/baremetal/empty/SConstruct +++ b/conts/baremetal/empty/SConstruct @@ -42,7 +42,7 @@ LIBMEM_DIR = join(PROJROOT, LIBMEM_RELDIR) LIBMEM_LIBPATH = join(BUILDDIR, LIBMEM_RELDIR) LIBMEM_INCLUDE = LIBMEM_DIR -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \ diff --git a/conts/baremetal/hello_world/SConstruct b/conts/baremetal/hello_world/SConstruct index 5d0435a..4730433 100644 --- a/conts/baremetal/hello_world/SConstruct +++ b/conts/baremetal/hello_world/SConstruct @@ -42,7 +42,7 @@ LIBMEM_DIR = join(PROJROOT, LIBMEM_RELDIR) LIBMEM_LIBPATH = join(BUILDDIR, LIBMEM_RELDIR) LIBMEM_INCLUDE = LIBMEM_DIR -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \ diff --git a/conts/baremetal/kmi_service/SConstruct b/conts/baremetal/kmi_service/SConstruct index 707fb8a..7fed797 100755 --- a/conts/baremetal/kmi_service/SConstruct +++ b/conts/baremetal/kmi_service/SConstruct @@ -44,7 +44,7 @@ LIBMEM_DIR = join(PROJROOT, LIBMEM_RELDIR) LIBMEM_LIBPATH = join(BUILDDIR, LIBMEM_RELDIR) LIBMEM_INCLUDE = LIBMEM_DIR -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \ diff --git a/conts/baremetal/test_suite/SConstruct b/conts/baremetal/test_suite/SConstruct index b4e2216..556b3eb 100644 --- a/conts/baremetal/test_suite/SConstruct +++ b/conts/baremetal/test_suite/SConstruct @@ -43,7 +43,7 @@ LIBMEM_DIR = join(PROJROOT, LIBMEM_RELDIR) LIBMEM_LIBPATH = join(BUILDDIR, LIBMEM_RELDIR) LIBMEM_INCLUDE = LIBMEM_DIR -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \ diff --git a/conts/baremetal/threads_demo/SConstruct b/conts/baremetal/threads_demo/SConstruct index 923a918..01d8caf 100644 --- a/conts/baremetal/threads_demo/SConstruct +++ b/conts/baremetal/threads_demo/SConstruct @@ -42,7 +42,7 @@ LIBMEM_DIR = join(PROJROOT, LIBMEM_RELDIR) LIBMEM_LIBPATH = join(BUILDDIR, LIBMEM_RELDIR) LIBMEM_INCLUDE = LIBMEM_DIR -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \ diff --git a/conts/baremetal/timer_service/SConstruct b/conts/baremetal/timer_service/SConstruct index 707fb8a..7fed797 100644 --- a/conts/baremetal/timer_service/SConstruct +++ b/conts/baremetal/timer_service/SConstruct @@ -44,7 +44,7 @@ LIBMEM_DIR = join(PROJROOT, LIBMEM_RELDIR) LIBMEM_LIBPATH = join(BUILDDIR, LIBMEM_RELDIR) LIBMEM_INCLUDE = LIBMEM_DIR -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \ diff --git a/conts/baremetal/uart_service/SConstruct b/conts/baremetal/uart_service/SConstruct index 19e4a56..32cc880 100644 --- a/conts/baremetal/uart_service/SConstruct +++ b/conts/baremetal/uart_service/SConstruct @@ -43,7 +43,7 @@ LIBMEM_DIR = join(PROJROOT, LIBMEM_RELDIR) LIBMEM_LIBPATH = join(BUILDDIR, LIBMEM_RELDIR) LIBMEM_INCLUDE = LIBMEM_DIR -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \ diff --git a/conts/libc/SConstruct b/conts/libc/SConstruct index ac379f2..e1b8aa5 100644 --- a/conts/libc/SConstruct +++ b/conts/libc/SConstruct @@ -28,7 +28,7 @@ LIBDEV_RELDIR = 'conts/libdev' LIBDEV_DIR = join(PROJROOT, LIBDEV_RELDIR) LIBDEV_INC = join(LIBDEV_DIR, 'include') -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', \ '-nostdinc', '-Wall', '-Werror', '-march=' + gcc_arch_flag], LINKFLAGS = ['-nostdlib'], diff --git a/conts/libdev/SConstruct b/conts/libdev/SConstruct index 97e5e76..a083b9e 100644 --- a/conts/libdev/SConstruct +++ b/conts/libdev/SConstruct @@ -32,7 +32,7 @@ LIBC_RELDIR = 'conts/libc' LIBC_DIR = join(PROJROOT, LIBC_RELDIR) LIBC_INC = join(LIBC_DIR, 'include') -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', \ '-nostdinc', '-Wall', '-DVARIANT_' + variant.upper(), \ '-march=' + gcc_arch_flag, '-Werror'], diff --git a/conts/libl4/SConstruct b/conts/libl4/SConstruct index 191b007..a1ad865 100644 --- a/conts/libl4/SConstruct +++ b/conts/libl4/SConstruct @@ -25,7 +25,7 @@ LIBC_RELDIR = 'conts/libc' LIBC_DIR = join(PROJROOT, LIBC_RELDIR) LIBC_INC = join(LIBC_DIR, 'include') -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', \ '-nostdinc', '-Wall', '-Werror', '-march=' + gcc_arch_flag], LINKFLAGS = ['-nostdlib'], diff --git a/conts/libmem/SConstruct b/conts/libmem/SConstruct index a579c79..2fadeff 100644 --- a/conts/libmem/SConstruct +++ b/conts/libmem/SConstruct @@ -32,7 +32,7 @@ LIBL4_DIR = join(PROJROOT, LIBL4_RELDIR) LIBL4_INCLUDE = join(LIBL4_DIR, 'include') # This does not work, need to check -test_env = Environment(CC = config.toolchain + 'gcc', +test_env = Environment(CC = config.toolchain_userspace + 'gcc', CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \ '-nostdinc', '-Werror', '-march=' + gcc_arch_flag], ENV = {'PATH' : os.environ['PATH']}, @@ -40,7 +40,7 @@ test_env = Environment(CC = config.toolchain + 'gcc', LIBPATH = ['#'], CPPPATH = ['#include', join(PROJRELROOT, "include"), "#", LIBL4_INCLUDE]) -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', \ '-Wall', '-Werror', '-march=' + gcc_arch_flag], LINKFLAGS = ['-nostdlib'], diff --git a/conts/posix/SConstruct b/conts/posix/SConstruct index 90cc306..4869f32 100644 --- a/conts/posix/SConstruct +++ b/conts/posix/SConstruct @@ -49,9 +49,9 @@ LIBPOSIX_INCLUDE_SERVER = join(LIBPOSIX_DIR, 'include') LIBPOSIX_INCLUDE_USERSPACE = join(LIBPOSIX_DIR, 'include/posix') LIBPOSIX_LIBPATH = join(BUILDDIR, LIBPOSIX_RELDIR) -env = Environment(CC = config.toolchain + 'gcc', - AR = config.toolchain + 'ar', - RANLIB = config.toolchain + 'ranlib', +env = Environment(CC = config.toolchain_userspace + 'gcc', + AR = config.toolchain_userspace + 'ar', + RANLIB = config.toolchain_userspace + 'ranlib', CCFLAGS = ['-g','-nostdinc', '-nostdlib', '-ffreestanding', '-march=' + gcc_arch_flag, '-std=gnu99', '-Wall', '-Werror'], LINKFLAGS = ['-nostdlib'], diff --git a/conts/posix/bootdesc/SConscript b/conts/posix/bootdesc/SConscript index 5e4eed9..7af88ed 100644 --- a/conts/posix/bootdesc/SConscript +++ b/conts/posix/bootdesc/SConscript @@ -97,8 +97,10 @@ def relocate_bootdesc(target, source, env): images = source[1:] mm0 = images[0] start, end = image_lma_start_end(mm0.path) - print config.toolchain + "objcopy --adjust-section-vma .data=" + conv_hex(end) + " " + bootdesc_raw.path - os.system(config.toolchain + "objcopy --adjust-section-vma .data=" + conv_hex(end) + " " + bootdesc_raw.path) + print config.toolchain_userspace + "objcopy --adjust-section-vma .data=" \ + + conv_hex(end) + " " + bootdesc_raw.path + os.system(config.toolchain_userspace + "objcopy --adjust-section-vma .data=" \ + + conv_hex(end) + " " + bootdesc_raw.path) shutil.copyfile(bootdesc_raw.path, target[0].path) bootdesc_c = e.Command('bootdesc.c', images, generate_bootdesc) diff --git a/conts/posix/bootdesc/SConstruct b/conts/posix/bootdesc/SConstruct index 8fbecac..bf505e5 100644 --- a/conts/posix/bootdesc/SConstruct +++ b/conts/posix/bootdesc/SConstruct @@ -12,7 +12,7 @@ from configure import * config = configuration_retrieve() builddir = ARGUMENTS.get('builddir', 'build/conts/posix') -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', '-Werror'], LINKFLAGS = ['-nostdlib','-Tlinker.lds'], ASFLAGS = ['-D__ASSEMBLY__'], diff --git a/conts/posix/libposix/SConstruct b/conts/posix/libposix/SConstruct index 8e11147..5c27f94 100644 --- a/conts/posix/libposix/SConstruct +++ b/conts/posix/libposix/SConstruct @@ -16,7 +16,7 @@ kernel_headers = join(project_root, "include") l4lib_headers = join(project_root, "tasks/libl4/include") config_h = join(project_root, "include/l4/config.h") -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', CCFLAGS = ['-g', '-std=gnu99', '-nostdlib', '-ffreestanding'], LINKFLAGS = ['-nostdlib'], CPPPATH = ['#include'], diff --git a/conts/posix/mm0/SConstruct b/conts/posix/mm0/SConstruct index fa724aa..d5fbd5b 100644 --- a/conts/posix/mm0/SConstruct +++ b/conts/posix/mm0/SConstruct @@ -30,7 +30,7 @@ LIBC_LIBPATH = join(BUILDDIR, LIBC_RELDIR) LIBC_INCLUDE = [join(LIBC_DIR, 'include'), \ join(LIBC_DIR, 'include/arch' + '/' + arch)] -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', \ diff --git a/conts/posix/mm0/tools/generate_bootdesc.py b/conts/posix/mm0/tools/generate_bootdesc.py index 45f1b62..2028540 100755 --- a/conts/posix/mm0/tools/generate_bootdesc.py +++ b/conts/posix/mm0/tools/generate_bootdesc.py @@ -12,7 +12,8 @@ linkoutput_file_suffix = "-linkinfo.txt" linkoutput_file = image_name + linkoutput_file_suffix def generate_bootdesc(): - command = config.toolchain + objdump + " -t " + image_name + " > " + linkoutput_file + command = config.toolchain_userspace + objdump + \ + " -t " + image_name + " > " + linkoutput_file print command os.system(command) f = open(linkoutput_file, "r") diff --git a/conts/posix/test0/SConstruct b/conts/posix/test0/SConstruct index ea6a5ee..076657c 100644 --- a/conts/posix/test0/SConstruct +++ b/conts/posix/test0/SConstruct @@ -58,7 +58,7 @@ def get_physical_base(source, target, env): prev_image + " >> " + physical_base_ld_script)) # The kernel build environment -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', '-Werror'], @@ -74,7 +74,7 @@ env = Environment(CC = config.toolchain + 'gcc', test_exec_ld_script = "include/test_exec_linker.lds" # The kernel build environment: -test_exec_env = Environment(CC = config.toolchain + 'gcc', +test_exec_env = Environment(CC = config.toolchain_userspace + 'gcc', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-O3', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', '-Werror'], diff --git a/conts/test_suite0/SConstruct b/conts/test_suite0/SConstruct index e48f2ae..7abd41f 100644 --- a/conts/test_suite0/SConstruct +++ b/conts/test_suite0/SConstruct @@ -44,7 +44,7 @@ LIBMEM_DIR = join(PROJROOT, LIBMEM_RELDIR) LIBMEM_LIBPATH = join(BUILDDIR, LIBMEM_RELDIR) LIBMEM_INCLUDE = LIBMEM_DIR -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_userspace + 'gcc', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', '-march=' + gcc_arch_flag], diff --git a/loader/libs/c/SConstruct b/loader/libs/c/SConstruct index b671e99..79caa14 100644 --- a/loader/libs/c/SConstruct +++ b/loader/libs/c/SConstruct @@ -13,7 +13,7 @@ arch = config.arch subarch = config.subarch gcc_arch_flag = config.gcc_arch_flag -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_kernel + 'gcc', # We don't use -nostdinc because sometimes we need standard headers, # such as stdarg.h e.g. for variable args, as in printk(). CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \ diff --git a/loader/libs/elf/SConstruct b/loader/libs/elf/SConstruct index 47fe2d2..e464c5f 100644 --- a/loader/libs/elf/SConstruct +++ b/loader/libs/elf/SConstruct @@ -21,7 +21,7 @@ LIBC_LIBPATH = LIBC_PATH LIBC_INCPATH = [join(LIBC_PATH, 'include'), \ join(LIBC_PATH, 'include/arch/' + arch)] -env = Environment(CC = config.toolchain + 'gcc', +env = Environment(CC = config.toolchain_kernel + 'gcc', CCFLAGS = ['-g', '-nostdinc', '-nostdlib', '-ffreestanding'], LINKFLAGS = ['-nostdlib'], ENV = {'PATH' : os.environ['PATH']}, diff --git a/scripts/conts/pack.py b/scripts/conts/pack.py index b2c8af9..d4cae25 100755 --- a/scripts/conts/pack.py +++ b/scripts/conts/pack.py @@ -96,7 +96,7 @@ class LinuxContainerPacker: self.atags_elf_in]) self.generate_container_assembler([self.kernel_image_in, self.rootfs_elf_in, \ self.atags_elf_in]) - os.system(config.toolchain + "gcc " + "-nostdlib -o %s -T%s %s" \ + os.system(config.toolchain_kernel + "gcc " + "-nostdlib -o %s -T%s %s" \ % (self.container_elf_out, self.container_lds_out, \ self.container_S_out)) # Final file is returned so that the final packer needn't @@ -155,7 +155,7 @@ class DefaultContainerPacker: def pack_container(self, config): self.generate_container_lds(self.images_in) self.generate_container_assembler(self.images_in) - os.system(config.toolchain + "gcc " + "-nostdlib -o %s -T%s %s" \ + os.system(config.toolchain_kernel + "gcc " + "-nostdlib -o %s -T%s %s" \ % (self.container_elf_out, self.container_lds_out, \ self.container_S_out)) # Final file is returned so that the final packer needn't diff --git a/scripts/conts/packall.py b/scripts/conts/packall.py index 7a609c3..5cf6ed5 100755 --- a/scripts/conts/packall.py +++ b/scripts/conts/packall.py @@ -79,7 +79,7 @@ class AllContainerPacker: def pack_all(self, config): self.generate_container_lds(self.containers_lds_out) self.generate_container_S(self.containers_S_out) - os.system(config.toolchain + "gcc " + "-nostdlib -o %s -T%s %s" \ + os.system(config.toolchain_kernel + "gcc " + "-nostdlib -o %s -T%s %s" \ % (self.containers_elf_out, self.containers_lds_out, \ self.containers_S_out)) diff --git a/scripts/linux/build_atags.py b/scripts/linux/build_atags.py index f3c059a..928c3a5 100755 --- a/scripts/linux/build_atags.py +++ b/scripts/linux/build_atags.py @@ -64,7 +64,7 @@ class AtagsBuilder: with open(self.atags_h_in, 'r') as input: output.write(input.read() % {'cn' : self.cont_id}) - os.system(config.toolchain + "cpp -I%s -P %s > %s" % \ + os.system(config.toolchain_userspace + "cpp -I%s -P %s > %s" % \ (self.LINUX_ATAGS_BUILDDIR, self.atags_lds_in, \ self.atags_lds_out)) @@ -72,7 +72,7 @@ class AtagsBuilder: with open(self.atags_c_in, 'r') as input: output.write(input.read() % {'cn' : self.cont_id}) - os.system(config.toolchain + "gcc " + \ + os.system(config.toolchain_userspace + "gcc " + \ "-g -ffreestanding -std=gnu99 -Wall -Werror " + \ "-nostdlib -o %s -T%s %s" % \ (self.atags_elf_out, self.atags_lds_out, self.atags_c_out)) diff --git a/scripts/linux/build_linux.py b/scripts/linux/build_linux.py index 95cd1b3..d692398 100755 --- a/scripts/linux/build_linux.py +++ b/scripts/linux/build_linux.py @@ -189,20 +189,22 @@ class LinuxBuilder: for platform, config_file in self.platform_config_file: if platform == config.platform.upper(): configuration_file = config_file - os.system("make ARCH=codezero CROSS_COMPILE=" + config.toolchain + \ + os.system("make ARCH=codezero CROSS_COMPILE=" + \ + config.toolchain_userspace + \ " O=" + self.LINUX_KERNEL_BUILDDIR + " " + configuration_file) self.kernel_updater.modify_kernel_config(self.LINUX_KERNEL_BUILDDIR) self.kernel_updater.update_kernel_params(config, self.container) - os.system("make ARCH=codezero CROSS_COMPILE=" + config.toolchain + \ + os.system("make ARCH=codezero CROSS_COMPILE=" + \ + config.toolchain_userspace + \ " O=" + self.LINUX_KERNEL_BUILDDIR + " menuconfig") os.system("make ARCH=codezero " + \ - "CROSS_COMPILE=" + config.toolchain + " O=" + \ - self.LINUX_KERNEL_BUILDDIR) + "CROSS_COMPILE=" + config.toolchain_userspace + \ + " O=" + self.LINUX_KERNEL_BUILDDIR) # Generate kernel_image, elf to be used by codezero - linux_elf_gen_cmd = (config.toolchain + "objcopy -R .note \ + linux_elf_gen_cmd = (config.toolchain_userspace + "objcopy -R .note \ -R .note.gnu.build-id -R .comment -S --change-addresses " + \ str(conv_hex(-self.container.linux_page_offset + self.container.linux_phys_offset)) + \ " " + self.kernel_binary_image + " " + self.kernel_image) diff --git a/scripts/linux/build_rootfs.py b/scripts/linux/build_rootfs.py index 8c11b77..4a1d3eb 100755 --- a/scripts/linux/build_rootfs.py +++ b/scripts/linux/build_rootfs.py @@ -51,10 +51,10 @@ class RootfsBuilder: with open(self.rootfs_h_in, 'r') as input: output.write(input.read() % {'cn' : self.cont_id}) - os.system(config.toolchain + "cpp -I%s -P %s > %s" % \ + os.system(config.toolchain_userspace + "cpp -I%s -P %s > %s" % \ (self.LINUX_ROOTFS_BUILDDIR, self.rootfs_lds_in, \ self.rootfs_lds_out)) - os.system(config.toolchain + "gcc " + \ + os.system(config.toolchain_userspace + "gcc " + \ "-nostdlib -o %s -T%s rootfs.S" % (self.rootfs_elf_out, \ self.rootfs_lds_out)) print "Done..." diff --git a/scripts/loader/generate_loader_asm.py b/scripts/loader/generate_loader_asm.py index 796c6df..4bb5acb 100755 --- a/scripts/loader/generate_loader_asm.py +++ b/scripts/loader/generate_loader_asm.py @@ -53,7 +53,7 @@ def generate_ksym_to_loader(target_path, source_path): asm_file.write(ksym_header % (target_path, source_path, sys.argv[0])) for symbol in symbols: process = \ - subprocess.Popen(config.toolchain + 'objdump -d ' + \ + subprocess.Popen(config.toolchain_kernel + 'objdump -d ' + \ source_path + ' | grep "<' + \ symbol + '>"', shell=True, \ stdout=subprocess.PIPE)