Merge darwin and linux jerry-libc targets into a single posix target

The two target implementations are very close clones of each other.
The only known differences are the following:

* The asm component of the linux target has `.type` and `.size`
  declarations for the functions defined therein, while the darwin
  target doesn't support those.

* Linux uses `__NR_xxx` mnemonics for syscall numbers, while darwin
  uses `SYS_xxx` format.

* Darwin does not have `exit_group` syscall but `exit` only.

* The linux target has a commented out `jrt_set_mem_limits` fuction
  declaration at the end of the C source. (Based on its name, this
  function does not really belong here.)

Simple preprocessor macros can unify the first three differences.
While for the sake of legacy, we can keep the fourth commented-out
code in the code base; it might turn out to be useful elsewhere in
the future. Since it remains commented out it wont cause any
problems on any OSs.

So, this patch gets rid of a lot of duplication.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2016-04-14 14:06:09 +02:00
parent 7a88ddec08
commit 4b0b8f3d4f
6 changed files with 109 additions and 474 deletions
+2 -2
View File
@@ -77,10 +77,10 @@ set(COMPILE_FLAGS_LIBC "${COMPILE_FLAGS_JERRY} ${C_FLAGS_JERRY}")
# Platform-specific
# Linux
file(GLOB SOURCE_LIBC_LINUX target/linux/*.c target/linux/*.S)
file(GLOB SOURCE_LIBC_LINUX target/posix/*.c target/posix/*.S)
# Darwin
file(GLOB SOURCE_LIBC_DARWIN target/darwin/*.c target/darwin/*.S)
file(GLOB SOURCE_LIBC_DARWIN target/posix/*.c target/posix/*.S)
# MCU
# stm32f3