diff --git a/conts/posix/SConstruct b/conts/posix/SConstruct index baf0b34..5fb264b 100644 --- a/conts/posix/SConstruct +++ b/conts/posix/SConstruct @@ -56,8 +56,10 @@ env = Environment(CC = 'arm-none-linux-gnueabi-gcc', contid = ARGUMENTS.get('cont', '0') +libposix_env = env.Clone() +libposix_env.Replace(CPPPATH = [LIBPOSIX_INCLUDE_USERSPACE, 'include', KERNEL_INCLUDE, LIBL4_INCLUDE, LIBMEM_INCLUDE]) libposix = SConscript('libposix/SConscript', \ - exports = { 'config' : config, 'env' : env, 'contid' : contid}, duplicate = 0, \ + exports = { 'config' : config, 'env' : libposix_env, 'contid' : contid}, duplicate = 0, \ variant_dir = join(BUILDDIR, 'conts' + '/posix' + '/libposix')) mm0_env = env.Clone() @@ -73,8 +75,9 @@ fs0 = SConscript('fs0/SConscript', \ variant_dir = join(BUILDDIR, 'cont' + str(contid) + '/posix' + '/fs0')) test0_env = env.Clone() -test0_env.Replace(CPPPATH = [LIBPOSIX_INCLUDE_USERSPACE, 'include', LIBC_INCLUDE, KERNEL_INCLUDE, LIBL4_INCLUDE, LIBMEM_INCLUDE]) -test0_env.Append(CCFLAGS = '-nostdinc') +test0_env.Replace(CPPPATH = ['include', KERNEL_INCLUDE, LIBL4_INCLUDE, LIBMEM_INCLUDE]) +#test0_env.Replace(CPPPATH = [LIBPOSIX_INCLUDE_USERSPACE, 'include', LIBC_INCLUDE, KERNEL_INCLUDE, LIBL4_INCLUDE, LIBMEM_INCLUDE]) +#test0_env.Append(CCFLAGS = '-nostdinc') test0 = SConscript('test0/SConscript', \ exports = { 'config' : config, 'environment' : test0_env, 'contid' : contid}, duplicate = 0, \ variant_dir = join(BUILDDIR, 'cont' + str(contid) + '/posix' + '/test0')) diff --git a/conts/posix/test0/SConscript b/conts/posix/test0/SConscript index bdcdfa6..1fd4759 100644 --- a/conts/posix/test0/SConscript +++ b/conts/posix/test0/SConscript @@ -10,12 +10,13 @@ src = [Glob('*.[cS]') + Glob('src/*.c') + Glob('src/arch/arm/*.c')] env = environment.Clone() test_env = environment.Clone() -env.Append(LIBS = 'posix') +env.Append(LIBS = ['posix', 'c-userspace']) env.Append(LINKFLAGS = ['-T' + "test0/include/linker.lds", '-u_start']) env.Append(CPPFLAGS = ' -D__USERSPACE__') objs = env.Object(src) test0 = env.Program('test0.elf', objs) +test_env.Append(LIBS = ['posix', 'c-userspace']) test_env.Append(LINKFLAGS = ['-T' + "test0/include/test_exec_linker.lds", '-u_start']) test_env.Append(CPPFLAGS = ' -D__USERSPACE__') test_src = Glob('src/test_exec/*.[cS]') diff --git a/conts/posix/test0/include/test_exec_linker.lds b/conts/posix/test0/include/test_exec_linker.lds new file mode 100644 index 0000000..0725dcf --- /dev/null +++ b/conts/posix/test0/include/test_exec_linker.lds @@ -0,0 +1,21 @@ +/* + * Simple linker script for userspace or svc tasks. + * + * Copyright (C) 2007 Bahadir Balban + */ + +virtual_base = 0x10000000; +__stack = (0x20000000 - 0x1000 - 8); /* First page before the env/args */ + + +ENTRY(_start) + +SECTIONS +{ + . = virtual_base; + .text : { *(.text.head) *(.text) } + .rodata : { *(.rodata) } + .rodata1 : { *(.rodata1) } + .data : { *(.data) } + .bss : { *(.bss) } +}