mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
We have all posix programs getting compiled.
A lot of hassles on standard c library, mock-up libc, and libposix headers taken from uClibc clashing has been worked around. Next: - Linker scripts need fixing and adjusting. - Bootdesc needs to be generated. - Per-container compilation scripts need connecting.
This commit is contained in:
@@ -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'))
|
||||
|
||||
@@ -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]')
|
||||
|
||||
21
conts/posix/test0/include/test_exec_linker.lds
Normal file
21
conts/posix/test0/include/test_exec_linker.lds
Normal file
@@ -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) }
|
||||
}
|
||||
Reference in New Issue
Block a user