Removed hard coded values of toolchain and gcc cpu flags

This commit is contained in:
Amit Mahajan
2009-10-27 15:35:37 +05:30
parent 2b29170633
commit 91c617d0b2
26 changed files with 162 additions and 89 deletions

View File

@@ -13,11 +13,11 @@ sys.path.append(PROJRELROOT)
from config.projpaths import *
from config.configuration import *
from configure import *
config = configuration_retrieve()
arch = config.arch
gcc_cpu_flag = config.gcc_cpu_flag
# Wrapper library for system calls
LIBL4_RELDIR = 'conts/libl4'
@@ -38,20 +38,20 @@ LIBMEM_DIR = join(PROJROOT, LIBMEM_RELDIR)
LIBMEM_LIBPATH = join(BUILDDIR, LIBMEM_RELDIR)
LIBMEM_INCLUDE = LIBMEM_DIR
env = Environment(CC = 'arm-none-linux-gnueabi-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', '-mcpu=arm926ej-s', '-nostdlib', '-ffreestanding', \
'-std=gnu99', '-Wall', '-Werror'],
LINKFLAGS = ['-nostdlib', '-T' + "include/linker.lds", "-u_start"],
ASFLAGS = ['-D__ASSEMBLY__'],
PROGSUFFIX = '.elf', # The suffix to use for final executable
ENV = {'PATH' : os.environ['PATH']}, # Inherit shell path
LIBS = ['gcc', 'libl4', 'c-userspace', 'libmm', 'libmc', 'libmalloc', \
'gcc', 'c-userspace'], # libgcc.a - This is required for division routines.
CPPPATH = ["#include", KERNEL_INCLUDE, LIBL4_INCLUDE, LIBC_INCLUDE, LIBMEM_INCLUDE],
LIBPATH = [LIBL4_LIBPATH, LIBC_LIBPATH, LIBMEM_LIBPATH],
CPPFLAGS = '-include l4/config.h -include l4/macros.h -include l4/types.h')
env = Environment(CC = config.user_toolchain + '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', ('-mcpu=' + gcc_cpu_flag)], \
LINKFLAGS = ['-nostdlib', '-T' + "include/linker.lds", "-u_start"],\
ASFLAGS = ['-D__ASSEMBLY__'], \
PROGSUFFIX = '.elf', # The suffix to use for final executable
ENV = {'PATH' : os.environ['PATH']}, # Inherit shell path
LIBS = ['gcc', 'libl4', 'c-userspace', 'libmm', 'libmc', 'libmalloc', \
'gcc', 'c-userspace'], # libgcc.a - This is required for division routines.
CPPPATH = ["#include", KERNEL_INCLUDE, LIBL4_INCLUDE, LIBC_INCLUDE, LIBMEM_INCLUDE],
LIBPATH = [LIBL4_LIBPATH, LIBC_LIBPATH, LIBMEM_LIBPATH],
CPPFLAGS = '-include l4/config.h -include l4/macros.h -include l4/types.h')
src = Glob('*.[cS]')
src += Glob('src/*.[cS]')

View File

@@ -24,10 +24,13 @@ PROJRELROOT = '../..'
sys.path.append(PROJRELROOT)
from config.projpaths import *
from configure import *
Import('arch')
env = Environment(CC = 'arm-none-linux-gnueabi-gcc',
config = configuration_retrieve()
env = Environment(CC = config.user_toolchain + 'gcc',
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding'],
LINKFLAGS = ['-nostdlib'],
ASFLAGS = ['-D__ASSEMBLY__'],

View File

@@ -14,10 +14,9 @@ from config.projpaths import *
from config.configuration import *
config = configuration_retrieve()
arch = config.arch
env = Environment(CC = 'arm-none-linux-gnueabi-gcc',
env = Environment(CC = config.user_toolchain + 'gcc',
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding'],
LINKFLAGS = ['-nostdlib'],
ASFLAGS = ['-D__ASSEMBLY__'],

View File

@@ -10,6 +10,9 @@ PROJRELROOT = '../..'
sys.path.append(PROJRELROOT)
from config.projpaths import *
from configure import *
config = configuration_retrieve()
KERNEL_INCLUDE = join(PROJROOT, 'include')
LIBL4_RELDIR = 'conts/libl4'
@@ -17,7 +20,7 @@ LIBL4_DIR = join(PROJROOT, LIBL4_RELDIR)
LIBL4_INCLUDE = join(LIBL4_DIR, 'include')
LIBL4_LIBPATH = join(BUILDDIR, LIBL4_RELDIR)
env = Environment(CC = 'arm-none-linux-gnueabi-gcc',
env = Environment(CC = config.user_toolchain + 'gcc',
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding'],
LINKFLAGS = ['-nostdlib'],
ASFLAGS = ['-D__ASSEMBLY__'],

View File

@@ -7,6 +7,9 @@ import glob
import sys
from os.path import join
from string import split
from configure import *
config = configuration_retrieve()
project_root = "../.."
headers_root = join(project_root, "include/l4")
@@ -33,8 +36,7 @@ test_env = Environment(CC = 'gcc -m32',
LIBPATH = ['#'],
CPPPATH = ['#include', join(project_root, "include"), "#", libl4_headers])
env = Environment(CC = 'arm-none-linux-gnueabi-gcc',
env = Environment(CC = config.user_toolchain + 'gcc',
CCFLAGS = ['-g', '-nostdlib', '-Wall', '-Werror', '-ffreestanding', '-std=gnu99'],
LINKFLAGS = ['-nostdlib'],
ENV = {'PATH' : os.environ['PATH']},

View File

@@ -19,7 +19,6 @@ from config.lib import *
config = configuration_retrieve()
arch = config.arch
LIBL4_RELDIR = 'conts/libl4'
KERNEL_INCLUDE = join(PROJROOT, 'include')
LIBL4_DIR = join(PROJROOT, LIBL4_RELDIR)
@@ -44,7 +43,7 @@ LIBPOSIX_INCLUDE_SERVER = join(LIBPOSIX_DIR, 'include')
LIBPOSIX_INCLUDE_USERSPACE = join(LIBPOSIX_DIR, 'include/posix')
LIBPOSIX_LIBPATH = join(BUILDDIR, LIBPOSIX_RELDIR)
env = Environment(CC = 'arm-none-linux-gnueabi-gcc',
env = Environment(CC = config.user_toolchain + 'gcc',
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', \
'-std=gnu99', '-Wall', '-Werror'],
LINKFLAGS = ['-nostdlib'],

View File

@@ -23,6 +23,8 @@ from config.projpaths import *
from config.configuration import *
from tools.pyelf import elf
config = configuration_retrieve()
bootdesc_template = \
'''
/* This file is autogenerated, do not edit by hand. */
@@ -95,8 +97,8 @@ def relocate_bootdesc(target, source, env):
images = source[1:]
mm0 = images[0]
start, end = image_lma_start_end(mm0.path)
print "arm-none-linux-gnueabi-objcopy --adjust-section-vma .data=" + conv_hex(end) + " " + bootdesc_raw.path
os.system("arm-none-linux-gnueabi-objcopy --adjust-section-vma .data=" + conv_hex(end) + " " + bootdesc_raw.path)
print config.user_toolchain + "objcopy --adjust-section-vma .data=" + conv_hex(end) + " " + bootdesc_raw.path
os.system(config.user_toolchain + "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

@@ -7,10 +7,12 @@ import os
import sys
import shutil
from os.path import join
from configure import *
config = configuration_retrieve()
builddir = ARGUMENTS.get('builddir', 'build/conts/posix')
env = Environment(CC = 'arm-none-linux-gnueabi-gcc',
env = Environment(CC = config.user_toolchain + 'gcc',
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', '-Werror'],
LINKFLAGS = ['-nostdlib','-Tlinker.lds'],
ASFLAGS = ['-D__ASSEMBLY__'],

View File

@@ -7,13 +7,16 @@ import glob
import sys
from os.path import join
from string import split
from configure import *
config = configuration_retrieve()
project_root = "../.."
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 = 'arm-none-linux-gnueabi-gcc',
env = Environment(CC = config.user_toolchain + 'gcc',
CCFLAGS = ['-g', '-std=gnu99', '-nostdlib', '-ffreestanding'],
LINKFLAGS = ['-nostdlib'],
CPPPATH = ['#include'],

View File

@@ -14,7 +14,6 @@ sys.path.append(PROJRELROOT)
from config.projpaths import *
from config.configuration import *
config = configuration_retrieve()
arch = config.arch
@@ -31,8 +30,7 @@ LIBC_LIBPATH = join(BUILDDIR, LIBC_RELDIR)
LIBC_INCLUDE = [join(LIBC_DIR, 'include'), \
join(LIBC_DIR, 'include/arch' + '/' + arch)]
env = Environment(CC = 'arm-none-linux-gnueabi-gcc',
env = Environment(CC = config.user_toolchain + '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

@@ -2,7 +2,9 @@
import os
import sys
compiler_prefix = "arm-none-linux-gnueabi-"
from configure import *
config = configuration_retrieve()
objdump = "objdump"
command = "-t"
image_name = "inittask.axf"
@@ -10,7 +12,7 @@ linkoutput_file_suffix = "-linkinfo.txt"
linkoutput_file = image_name + linkoutput_file_suffix
def generate_bootdesc():
command = compiler_prefix + objdump + " -t " + image_name + " > " + linkoutput_file
command = config.user_toolchain + objdump + " -t " + image_name + " > " + linkoutput_file
print command
os.system(command)
f = open(linkoutput_file, "r")

View File

@@ -8,6 +8,9 @@ import sys
import shutil
from os.path import join
from glob import glob
from configure import *
config = configuration_retrieve()
task_name = "test0"
@@ -54,8 +57,8 @@ def get_physical_base(source, target, env):
os.system(join(tools_root, "pyelf/readelf.py --first-free-page " + \
prev_image + " >> " + physical_base_ld_script))
# The kernel build environment:
env = Environment(CC = 'arm-none-linux-gnueabi-gcc',
# The kernel build environment
env = Environment(CC = config.user_toolchain + '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'],
@@ -71,7 +74,7 @@ env = Environment(CC = 'arm-none-linux-gnueabi-gcc',
test_exec_ld_script = "include/test_exec_linker.lds"
# The kernel build environment:
test_exec_env = Environment(CC = 'arm-none-linux-gnueabi-gcc',
test_exec_env = Environment(CC = config.user_toolchain + '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'],