|
@@ -1,20 +1,22 @@
|
|
|
-Some notes to help future porters. Replace 'ARCH' with whatever arch
|
|
|
+Some notes to help future porters. Replace 'ARCH' with whatever arch
|
|
|
you are hacking on.
|
|
|
|
|
|
====================
|
|
|
=== Config Files ===
|
|
|
====================
|
|
|
- create extra/Configs/Config.ARCH
|
|
|
- See the other arch files for some good examples. powerpc/sparc/alpha
|
|
|
+ See the other arch files for some good examples. powerpc/sparc/alpha
|
|
|
should be pretty simple templates.
|
|
|
- add ARCH to the 'Target Architecture' list in extra/Configs/Config.in
|
|
|
-- for now, disable shared libraries
|
|
|
- add HAVE_NO_SHARED and ARCH_HAS_NO_LDSO to Config.ARCH's HAVE_ELF
|
|
|
+- Initially you will want to disable shared libraries, since making
|
|
|
+ the shared library loader work requires you first have basic architecture
|
|
|
+ support working. Thus you should add HAVE_NO_SHARED and ARCH_HAS_NO_LDSO
|
|
|
+ to Config.ARCH's HAVE_ELF
|
|
|
|
|
|
====================
|
|
|
=== libc sysdeps ===
|
|
|
====================
|
|
|
-(note: if glibc has already been ported to your arch, you can usually just
|
|
|
+(note: if glibc has already been ported to your arch, you can usually just
|
|
|
copy a lot of files from them rather than coding from scratch)
|
|
|
- create libc/sysdeps/linux/ARCH
|
|
|
- copy Makefile and Makefile.arch from libc/sysdeps/linux/i386/
|
|
@@ -24,9 +26,9 @@ you are hacking on.
|
|
|
to clear the frame pointer to make gdb happy, and then you will want to call
|
|
|
the funcion __uClibc_main() which takes these parameters:
|
|
|
__uClibc_main(main(), argc, argv, _init(), _fini())
|
|
|
- for now, you can disable the UCLIBC_CTOR_DTOR option and just set those two
|
|
|
- arguments to NULL
|
|
|
- glibc stores this function in libc/sysdeps/ARCH/elf/start.S
|
|
|
+ Initially if you wish to make things easier on yourself, you can disable the
|
|
|
+ UCLIBC_CTOR_DTOR option and just set those two arguments to NULL
|
|
|
+ glibc generally stores this function in libc/sysdeps/ARCH/elf/start.S
|
|
|
|
|
|
- create these additional files in ARCH/bits/
|
|
|
|
|
@@ -38,13 +40,15 @@ you are hacking on.
|
|
|
copy linux asm-ARCH/stat.h to bits/kernel_stat.h
|
|
|
|
|
|
create syscalls.h based upon linux's unistd.h / glibc's sysdeps.h ... really
|
|
|
- you just want to define the _syscall[0-6] macros
|
|
|
+ you just want to define the _syscall[0-6] macros. It is important that
|
|
|
+ these syscalls should be PIC safe (or you should provide a PIC and non-PIC
|
|
|
+ version) if you wish to properly support shared libraries.
|
|
|
|
|
|
- at this point, you should have enough to generate a working HELLO WORLD
|
|
|
static binary (see test/silly/*.c files)
|
|
|
|
|
|
- if you want UCLIBC_CTOR_DTOR support, you will need to create crti.S and
|
|
|
- crtn.S files which define function prologues/epilogues
|
|
|
+ crtn.S files which define function prologues/epilogues.
|
|
|
|
|
|
- for a more stable static port, you will need to create these files (and
|
|
|
update the Makefile.arch values accordingly)
|
|
@@ -62,7 +66,7 @@ TODO: nptl / linuxthreads / linuxthreads.old
|
|
|
=== ldso sysdeps ===
|
|
|
====================
|
|
|
- enable ldso/shared options in your extra/Configs/Config.ARCH file
|
|
|
-- you'll need to create these files in ldso/ldso/ARCH/
|
|
|
+- you will need to create the following files in ldso/ldso/ARCH/
|
|
|
dl-debug.h dl-startup.h dl-syscalls.h dl-sysdep.h elfinterp.c resolve.S
|
|
|
|
|
|
- dl-debug.h: define string versions of all the relocations of your arch in the
|