Added separate toolchains for userspace and kernel.

This commit is contained in:
Amit Mahajan
2010-03-30 20:15:39 +05:30
parent 2b340c9f2f
commit ab728dd1d5
32 changed files with 72 additions and 56 deletions

View File

@@ -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', \

View File

@@ -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', \

View File

@@ -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', \

View File

@@ -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', \

View File

@@ -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', \

View File

@@ -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', \

View File

@@ -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', \

View File

@@ -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'],

View File

@@ -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'],

View File

@@ -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'],

View File

@@ -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'],

View File

@@ -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'],

View File

@@ -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)

View File

@@ -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__'],

View File

@@ -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'],

View File

@@ -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', \

View File

@@ -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")

View File

@@ -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'],

View File

@@ -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],