Remove jerry-libc (#2332)

Rationale:
- There is no port under targets/ that would use it. All of them
  turn it off when building.
- That's no surprise, as jerry-libc supports no barebone MCUs but
  posix targets with syscalls only. Actually, that's Linux only,
  because macOS builds have turned off the use of jerry-libc a
  while ago.
- And there is no point in maintaining a highly restricted set of
  libc functions: as soon as someone wants to use JerryScript in a
  scenario that needs more functions than jerry-main, they have to
  choose a different libc (most problably the compiler's default
  one).

I think that we should not keep supporting an otherwise unused
library for the purposes of jerry-main on arm/x86/x64-linux  only.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2018-08-21 09:26:53 +02:00
committed by GitHub
parent 851f4f0b89
commit 7639e613a4
40 changed files with 21 additions and 2687 deletions
+1 -16
View File
@@ -13,7 +13,7 @@
# limitations under the License.
cmake_minimum_required (VERSION 2.8.12)
project (Jerry C ASM)
project (Jerry C)
# Determining platform
set(PLATFORM "${CMAKE_SYSTEM_NAME}")
@@ -47,7 +47,6 @@ set(JERRY_CMDLINE_TEST OFF CACHE BOOL "Build jerry test command line tool?"
set(JERRY_CMDLINE_SNAPSHOT OFF CACHE BOOL "Build jerry snapshot command line tool?")
set(JERRY_PORT_DEFAULT ON CACHE BOOL "Build default jerry port implementation?")
set(JERRY_EXT ON CACHE BOOL "Build jerry-ext?")
set(JERRY_LIBC ON CACHE BOOL "Build and use jerry-libc?")
set(JERRY_LIBM ON CACHE BOOL "Build and use jerry-libm?")
set(UNITTESTS OFF CACHE BOOL "Build unit tests?")
set(DOCTESTS OFF CACHE BOOL "Build doc tests?")
@@ -74,12 +73,10 @@ if(JERRY_CMDLINE OR DOCTESTS)
endif()
if("${PLATFORM}" STREQUAL "DARWIN")
set(JERRY_LIBC OFF)
set(JERRY_LIBM OFF)
set(ENABLE_LTO OFF)
set(ENABLE_STRIP OFF)
set(JERRY_LIBC_MESSAGE " (FORCED BY PLATFORM)")
set(JERRY_LIBM_MESSAGE " (FORCED BY PLATFORM)")
set(ENABLE_LTO_MESSAGE " (FORCED BY PLATFORM)")
set(ENABLE_STRIP_MESSAGE " (FORCED BY PLATFORM)")
@@ -92,11 +89,9 @@ if(USING_TI)
endif()
if(USING_MSVC)
set(JERRY_LIBC OFF)
set(JERRY_LIBM OFF)
set(ENABLE_STRIP OFF)
set(JERRY_LIBC_MESSAGE " (FORCED BY COMPILER)")
set(JERRY_LIBM_MESSAGE " (FORCED BY COMPILER)")
set(ENABLE_STRIP_MESSAGE " (FORCED BY COMPILER)")
endif()
@@ -114,7 +109,6 @@ message(STATUS "JERRY_CMDLINE_TEST " ${JERRY_CMDLINE_TEST})
message(STATUS "JERRY_CMDLINE_SNAPSHOT " ${JERRY_CMDLINE_SNAPSHOT})
message(STATUS "JERRY_PORT_DEFAULT " ${JERRY_PORT_DEFAULT} ${JERRY_PORT_DEFAULT_MESSAGE})
message(STATUS "JERRY_EXT " ${JERRY_EXT} ${JERRY_EXT_MESSAGE})
message(STATUS "JERRY_LIBC " ${JERRY_LIBC} ${JERRY_LIBC_MESSAGE})
message(STATUS "JERRY_LIBM " ${JERRY_LIBM} ${JERRY_LIBM_MESSAGE})
message(STATUS "UNITTESTS " ${UNITTESTS})
message(STATUS "DOCTESTS " ${DOCTESTS})
@@ -223,21 +217,12 @@ endif()
# External compiler & linker flags
if(DEFINED EXTERNAL_COMPILE_FLAGS)
jerry_add_compile_flags(${EXTERNAL_COMPILE_FLAGS})
jerry_add_flags(CMAKE_ASM_FLAGS "${EXTERNAL_COMPILE_FLAGS}")
endif()
if(DEFINED EXTERNAL_LINKER_FLAGS)
jerry_add_link_flags(${EXTERNAL_LINKER_FLAGS})
endif()
# Jerry's libc
if(JERRY_LIBC)
# Turn off linking to compiler's default libc, in case jerry-libc is used
jerry_add_link_flags(-nostdlib)
add_subdirectory(jerry-libc)
endif()
# Jerry's libm
if(JERRY_LIBM)
add_subdirectory(jerry-libm)