ソースを参照

Some minor updates. Looked pretty good as-is.

Eric Andersen 20 年 前
コミット
c58831a976
1 ファイル変更15 行追加11 行削除
  1. 15 11
      docs/PORTING

+ 15 - 11
docs/PORTING

@@ -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.
 you are hacking on.
 
 
 ====================
 ====================
 === Config Files ===
 === Config Files ===
 ====================
 ====================
 - create extra/Configs/Config.ARCH
 - 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.
    should be pretty simple templates.
 - add ARCH to the 'Target Architecture' list in extra/Configs/Config.in
 - 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 ===
 === 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)
        copy a lot of files from them rather than coding from scratch)
 - create libc/sysdeps/linux/ARCH
 - create libc/sysdeps/linux/ARCH
 - copy Makefile and Makefile.arch from libc/sysdeps/linux/i386/
 - 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
   to clear the frame pointer to make gdb happy, and then you will want to call
   the funcion __uClibc_main() which takes these parameters:
   the funcion __uClibc_main() which takes these parameters:
    __uClibc_main(main(), argc, argv, _init(), _fini())
    __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/
 - 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
   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
   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
 - at this point, you should have enough to generate a working HELLO WORLD
   static binary (see test/silly/*.c files)
   static binary (see test/silly/*.c files)
 
 
 - if you want UCLIBC_CTOR_DTOR support, you will need to create crti.S and
 - 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
 - for a more stable static port, you will need to create these files (and
   update the Makefile.arch values accordingly)
   update the Makefile.arch values accordingly)
@@ -62,7 +66,7 @@ TODO: nptl / linuxthreads / linuxthreads.old
 === ldso sysdeps ===
 === ldso sysdeps ===
 ====================
 ====================
 - enable ldso/shared options in your extra/Configs/Config.ARCH file
 - 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  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
 - dl-debug.h: define string versions of all the relocations of your arch in the