Changes between Version 2 and Version 3 of PortingSoftware


Ignore:
Timestamp:
2014-03-07T13:46:51Z (10 years ago)
Author:
Vojtech Horky
Comment:

Few notes about porting (still WIP)

Legend:

Unmodified
Added
Removed
Modified
  • PortingSoftware

    v2 v3  
    2222//Implementation detail//: some of the functions in `libc` have the same name as standard POSIX ones or they offer slightly different behaviour.
    2323To prevent naming clashes, symbols in `libc.a` are renamed to avoid the need to rename the POSIX versions (which was an older approach where renaming was done during preprocessing, however this approach has various disadvantages).
     24
     25
     26
     27== General approach ==
     28
     29For most (reasonable) GNU/Linux programs, we can assume that they are distributed with a `./configure` script.
     30The purpose of this script is to check the environment and prepare `Makefile`s needed for actual compilation.
     31In order to build the application for HelenOS we "only" need to persuade the `configure` script to cross-compile it and use HelenOS specific compiler flags and link with `libposix`.
     32
     33
     34Although this seems as a simple task because `configure` offers parameters/variables for exactly this, there are several obstacles.
     35
     36 * HelenOS currently uses Linux ABI and thus the cross-compiler used gives the impression that the target is GNU/Linux system. This could lead to some false expectations.
     37 * There is a lot of compiler/linker flags that are passed. The amount itself obscures a reasonable editing of the command line.
     38 * HelenOS works mostly with static libraries. When linking with static libraries, their order is important and they typically need to come after object files for proper linking. That is not always possible to specify with plain `LDFLAGS` or `CFLAGS` settings.
     39
     40The above means that either patching or some build scripts is sometimes necessary or that the invocation line for `configure` is rather complex (or both).
     41To simplify the above and, foremost, to allow repeatable builds, the so called Coastline was created.
     42
     43== Coastline ==
     44
     45Currently, Coastline is hosted as a separate Git [https://github.com/vhotspur/coastline repository on GitHub].
     46
     47TODO:
     48
     49 * principles
     50   * extracting the flags
     51   * caching built libraries
     52   * harbours
     53 * usage
     54 * writing harbour files