2020-11-23 17:01:57 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8.12)
|
2015-08-05 22:23:15 +00:00
|
|
|
|
2020-05-26 13:36:55 +00:00
|
|
|
# Use ccache if possible
|
|
|
|
FIND_PROGRAM(CCACHE_PROGRAM ccache)
|
|
|
|
IF(CCACHE_PROGRAM)
|
|
|
|
MESSAGE(STATUS "Found ccache ${CCACHE_PROGRAM}")
|
|
|
|
ENDIF()
|
|
|
|
|
2016-02-01 22:26:01 +00:00
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
|
2020-02-05 13:24:50 +00:00
|
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
|
2016-02-01 22:26:01 +00:00
|
|
|
endif()
|
2015-08-05 22:23:15 +00:00
|
|
|
|
2018-04-11 00:57:37 +00:00
|
|
|
if(NOT CMAKE_INSTALL_PREFIX)
|
2022-08-20 05:06:15 +00:00
|
|
|
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/stage3" CACHE STRING
|
2018-04-11 00:57:37 +00:00
|
|
|
"Directory to install zig to" FORCE)
|
|
|
|
endif()
|
|
|
|
|
CMake: detect use of CMAKE_PREFIX_PATH env var
CMake recognizes the CMAKE_PREFIX_PATH environment variable for some
things, and also the CMAKE_PREFIX_PATH cache variable for other things.
However, it does not relate these two things, i.e. if the environment
variable is set, CMake does not populate the cache variable in a
corresponding manner. Some package systems, such as Homebrew, set the
environment variable but not the cache variable. Furthermore, the
environment variable follows the system path separator, such as ':' on
POSIX and ';' on Windows, but the cache variable follows CMake's array
behavior, i.e. always ';' for a separator.
Closes #13242
2022-10-23 00:46:25 +00:00
|
|
|
# CMake recognizes the CMAKE_PREFIX_PATH environment variable for some things,
|
|
|
|
# and also the CMAKE_PREFIX_PATH cache variable for other things. However, it
|
|
|
|
# does not relate these two things, i.e. if the environment variable is set,
|
|
|
|
# CMake does not populate the cache variable in a corresponding manner. Some
|
|
|
|
# package systems, such as Homebrew, set the environment variable but not the
|
|
|
|
# cache variable. Furthermore, the environment variable follows the system path
|
|
|
|
# separator, such as ':' on POSIX and ';' on Windows, but the cache variable
|
|
|
|
# follows CMake's array behavior, i.e. always ';' for a separator.
|
|
|
|
list(APPEND ZIG_CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}")
|
|
|
|
if(WIN32)
|
|
|
|
list(APPEND ZIG_CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
|
|
|
|
else()
|
|
|
|
string(REGEX REPLACE ":" ";" ZIG_CMAKE_PREFIX_PATH_STRING "$ENV{CMAKE_PREFIX_PATH}")
|
|
|
|
list(APPEND ZIG_CMAKE_PREFIX_PATH "${ZIG_CMAKE_PREFIX_PATH_STRING}")
|
|
|
|
endif()
|
|
|
|
|
2019-10-10 20:44:52 +00:00
|
|
|
set(CMAKE_USER_MAKE_RULES_OVERRIDE
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/c_flag_overrides.cmake)
|
|
|
|
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxx_flag_overrides.cmake)
|
|
|
|
|
2017-04-21 15:06:15 +00:00
|
|
|
project(zig C CXX)
|
2015-08-05 22:23:15 +00:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
|
|
|
|
|
2020-12-08 00:23:17 +00:00
|
|
|
set(ZIG_VERSION_MAJOR 0)
|
2021-12-20 20:13:48 +00:00
|
|
|
set(ZIG_VERSION_MINOR 10)
|
2021-01-02 04:01:51 +00:00
|
|
|
set(ZIG_VERSION_PATCH 0)
|
2020-12-08 00:23:17 +00:00
|
|
|
set(ZIG_VERSION "" CACHE STRING "Override Zig version string. Default is to find out with git.")
|
|
|
|
|
|
|
|
if("${ZIG_VERSION}" STREQUAL "")
|
|
|
|
set(ZIG_VERSION "${ZIG_VERSION_MAJOR}.${ZIG_VERSION_MINOR}.${ZIG_VERSION_PATCH}")
|
2022-07-13 17:36:25 +00:00
|
|
|
find_program(GIT_EXE NAMES git NAMES_PER_DIR)
|
2020-12-08 00:23:17 +00:00
|
|
|
if(GIT_EXE)
|
|
|
|
execute_process(
|
2021-01-02 04:01:51 +00:00
|
|
|
COMMAND ${GIT_EXE} -C ${CMAKE_SOURCE_DIR} describe --match *.*.* --tags
|
2020-12-08 00:23:17 +00:00
|
|
|
RESULT_VARIABLE EXIT_STATUS
|
2021-01-02 04:01:51 +00:00
|
|
|
OUTPUT_VARIABLE GIT_DESCRIBE
|
2020-12-08 00:23:17 +00:00
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
ERROR_QUIET)
|
|
|
|
if(EXIT_STATUS EQUAL "0")
|
2021-01-02 04:01:51 +00:00
|
|
|
if(GIT_DESCRIBE MATCHES "^v?([0-9]+\\.[0-9]+\\.[0-9]+)$")
|
|
|
|
# Tagged release version.
|
|
|
|
set(GIT_TAG ${CMAKE_MATCH_1})
|
|
|
|
if(NOT GIT_TAG VERSION_EQUAL ZIG_VERSION)
|
|
|
|
message(SEND_ERROR "Zig version (${ZIG_VERSION}) does not match Git tag (${GIT_TAG}).")
|
2020-12-08 00:23:17 +00:00
|
|
|
endif()
|
2021-01-02 04:01:51 +00:00
|
|
|
elseif(GIT_DESCRIBE MATCHES "^v?([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-g(.+)$")
|
|
|
|
# Untagged pre-release. The Zig version is updated to include the number of commits
|
|
|
|
# since the last tagged version and the commit hash. The version is formatted in
|
|
|
|
# accordance with the https://semver.org specification.
|
|
|
|
set(GIT_TAG ${CMAKE_MATCH_1})
|
|
|
|
set(GIT_COMMITS_AFTER_TAG ${CMAKE_MATCH_2})
|
|
|
|
set(GIT_COMMIT ${CMAKE_MATCH_3})
|
|
|
|
if(NOT ZIG_VERSION VERSION_GREATER GIT_TAG)
|
|
|
|
message(SEND_ERROR "Zig version (${ZIG_VERSION}) must be greater than tagged ancestor (${GIT_TAG}).")
|
|
|
|
endif()
|
|
|
|
set(ZIG_VERSION "${ZIG_VERSION}-dev.${GIT_COMMITS_AFTER_TAG}+${GIT_COMMIT}")
|
2020-12-08 00:23:17 +00:00
|
|
|
else()
|
2021-01-02 04:01:51 +00:00
|
|
|
message(WARNING "Failed to parse version from output of `git describe`.")
|
2020-12-08 00:23:17 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
2022-02-17 03:33:08 +00:00
|
|
|
message(STATUS "Configuring zig version ${ZIG_VERSION}")
|
2020-12-08 00:23:17 +00:00
|
|
|
|
2022-08-20 05:06:15 +00:00
|
|
|
set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL
|
|
|
|
"Disable copying lib/ files to install prefix during the build phase")
|
|
|
|
|
2018-03-30 17:20:13 +00:00
|
|
|
set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not compatible with glibc)")
|
2022-07-16 01:51:41 +00:00
|
|
|
set(ZIG_SHARED_LLVM off CACHE BOOL "Prefer linking against shared LLVM libraries")
|
2019-07-09 09:03:57 +00:00
|
|
|
set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries")
|
2021-05-29 03:51:18 +00:00
|
|
|
set(ZIG_STATIC_ZLIB off CACHE BOOL "Prefer linking against static zlib")
|
2022-10-26 01:29:39 +00:00
|
|
|
set(ZIG_STATIC_ZSTD off CACHE BOOL "Prefer linking against static zstd")
|
2020-05-26 13:36:55 +00:00
|
|
|
set(ZIG_USE_CCACHE off CACHE BOOL "Use ccache if available")
|
|
|
|
|
|
|
|
if(CCACHE_PROGRAM AND ZIG_USE_CCACHE)
|
|
|
|
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
|
|
|
endif()
|
2019-07-09 09:03:57 +00:00
|
|
|
|
|
|
|
if(ZIG_STATIC)
|
2021-05-29 03:51:18 +00:00
|
|
|
set(ZIG_STATIC_LLVM ON)
|
|
|
|
set(ZIG_STATIC_ZLIB ON)
|
2022-10-26 01:29:39 +00:00
|
|
|
set(ZIG_STATIC_ZSTD ON)
|
2019-07-09 09:03:57 +00:00
|
|
|
endif()
|
2016-02-11 08:33:27 +00:00
|
|
|
|
2022-07-16 01:51:41 +00:00
|
|
|
if (ZIG_SHARED_LLVM AND ZIG_STATIC_LLVM)
|
|
|
|
message(SEND_ERROR "-DZIG_SHARED_LLVM and -DZIG_STATIC_LLVM cannot both be enabled simultaneously")
|
|
|
|
endif()
|
|
|
|
|
2017-10-01 20:10:05 +00:00
|
|
|
string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_LIBC_LIB_DIR_ESCAPED "${ZIG_LIBC_LIB_DIR}")
|
|
|
|
string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_LIBC_STATIC_LIB_DIR_ESCAPED "${ZIG_LIBC_STATIC_LIB_DIR}")
|
|
|
|
string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_LIBC_INCLUDE_DIR_ESCAPED "${ZIG_LIBC_INCLUDE_DIR}")
|
2017-10-01 18:01:18 +00:00
|
|
|
|
2016-04-23 16:57:38 +00:00
|
|
|
option(ZIG_TEST_COVERAGE "Build Zig with test coverage instrumentation" OFF)
|
|
|
|
|
2020-03-28 03:43:21 +00:00
|
|
|
set(ZIG_TARGET_TRIPLE "native" CACHE STRING "arch-os-abi to output binaries for")
|
2020-04-08 21:41:51 +00:00
|
|
|
set(ZIG_TARGET_MCPU "baseline" CACHE STRING "-mcpu parameter to output binaries for")
|
2020-03-28 03:43:21 +00:00
|
|
|
set(ZIG_EXECUTABLE "" CACHE STRING "(when cross compiling) path to already-built zig binary")
|
2020-12-20 22:37:58 +00:00
|
|
|
set(ZIG_SINGLE_THREADED off CACHE BOOL "limit the zig compiler to use only 1 thread")
|
2021-01-04 21:59:18 +00:00
|
|
|
set(ZIG_OMIT_STAGE2 off CACHE BOOL "omit the stage2 backend from stage1")
|
2021-06-22 19:11:28 +00:00
|
|
|
|
|
|
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
|
|
|
set(ZIG_ENABLE_LOGGING ON CACHE BOOL "enable logging")
|
|
|
|
else()
|
|
|
|
set(ZIG_ENABLE_LOGGING OFF CACHE BOOL "enable logging")
|
|
|
|
endif()
|
2020-03-28 03:43:21 +00:00
|
|
|
|
2021-03-13 21:30:56 +00:00
|
|
|
if("${ZIG_TARGET_TRIPLE}" STREQUAL "native")
|
|
|
|
set(ZIG_USE_LLVM_CONFIG ON CACHE BOOL "use llvm-config to find LLVM libraries")
|
|
|
|
else()
|
|
|
|
set(ZIG_USE_LLVM_CONFIG OFF CACHE BOOL "use llvm-config to find LLVM libraries")
|
|
|
|
endif()
|
|
|
|
|
2022-07-28 18:53:25 +00:00
|
|
|
find_package(llvm 15)
|
|
|
|
find_package(clang 15)
|
|
|
|
find_package(lld 15)
|
2016-01-19 04:28:54 +00:00
|
|
|
|
2021-05-29 03:51:18 +00:00
|
|
|
if(ZIG_STATIC_ZLIB)
|
2018-09-30 20:45:33 +00:00
|
|
|
list(REMOVE_ITEM LLVM_LIBRARIES "-lz")
|
2022-07-13 17:36:25 +00:00
|
|
|
find_library(ZLIB NAMES libz.a libzlibstatic.a z zlib libz NAMES_PER_DIR)
|
2019-03-18 22:36:35 +00:00
|
|
|
list(APPEND LLVM_LIBRARIES "${ZLIB}")
|
2021-05-29 03:51:18 +00:00
|
|
|
endif()
|
2020-10-15 00:36:43 +00:00
|
|
|
|
2022-10-26 01:29:39 +00:00
|
|
|
if(ZIG_STATIC_ZSTD)
|
|
|
|
list(REMOVE_ITEM LLVM_LIBRARIES "-lzstd")
|
|
|
|
find_library(ZSTD NAMES libzstd.a libzstdstatic.a zstd NAMES_PER_DIR)
|
|
|
|
list(APPEND LLVM_LIBRARIES "${ZSTD}")
|
|
|
|
endif()
|
|
|
|
|
2021-05-29 03:51:18 +00:00
|
|
|
if(APPLE AND ZIG_STATIC)
|
2020-10-15 00:36:43 +00:00
|
|
|
list(REMOVE_ITEM LLVM_LIBRARIES "-lcurses")
|
2022-07-13 17:36:25 +00:00
|
|
|
find_library(CURSES NAMES libcurses.a libncurses.a NAMES_PER_DIR
|
2021-11-28 10:07:19 +00:00
|
|
|
PATHS
|
|
|
|
/usr/local/opt/ncurses/lib
|
|
|
|
/opt/homebrew/opt/ncurses/lib)
|
2020-10-15 00:36:43 +00:00
|
|
|
list(APPEND LLVM_LIBRARIES "${CURSES}")
|
2018-03-20 11:46:31 +00:00
|
|
|
endif()
|
|
|
|
|
2020-09-23 07:00:24 +00:00
|
|
|
set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zigcpp")
|
2017-12-27 00:44:08 +00:00
|
|
|
|
2019-04-18 06:58:12 +00:00
|
|
|
# Handle multi-config builds and place each into a common lib. The VS generator
|
|
|
|
# for example will append a Debug folder by default if not explicitly specified.
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ZIG_CPP_LIB_DIR})
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ZIG_CPP_LIB_DIR})
|
|
|
|
foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES})
|
|
|
|
string(TOUPPER ${CONFIG_TYPE} CONFIG_TYPE)
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_TYPE} ${ZIG_CPP_LIB_DIR})
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONFIG_TYPE} ${ZIG_CPP_LIB_DIR})
|
|
|
|
endforeach(CONFIG_TYPE CMAKE_CONFIGURATION_TYPES)
|
|
|
|
|
2020-01-16 18:09:45 +00:00
|
|
|
include_directories(${LLVM_INCLUDE_DIRS})
|
|
|
|
include_directories(${LLD_INCLUDE_DIRS})
|
|
|
|
include_directories(${CLANG_INCLUDE_DIRS})
|
2017-03-13 15:54:56 +00:00
|
|
|
|
2018-03-09 20:06:06 +00:00
|
|
|
# No patches have been applied to SoftFloat-3e
|
2017-09-14 05:44:22 +00:00
|
|
|
set(EMBEDDED_SOFTFLOAT_SOURCES
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/f128M_isSignalingNaN.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/extF80M_isSignalingNaN.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_commonNaNToF128M.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_commonNaNToExtF80M.c"
|
2018-06-27 14:20:04 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_commonNaNToF16UI.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_commonNaNToF32UI.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_commonNaNToF64UI.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_f128MToCommonNaN.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_extF80MToCommonNaN.c"
|
2018-06-27 14:20:04 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_f16UIToCommonNaN.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_f32UIToCommonNaN.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_f64UIToCommonNaN.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_propagateNaNF128M.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_propagateNaNExtF80M.c"
|
2018-06-27 14:20:04 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/s_propagateNaNF16UI.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086/softfloat_raiseFlags.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_add.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_div.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_eq.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_eq_signaling.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_le.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_le_quiet.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_lt.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_lt_quiet.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_mul.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_mulAdd.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_rem.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_roundToInt.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_sqrt.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_sub.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_f16.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_f32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_f64.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_extF80M.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_i32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_i32_r_minMag.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_i64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_i64_r_minMag.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_ui32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_ui32_r_minMag.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_ui64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_to_ui64_r_minMag.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_add.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_div.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_eq.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_le.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_lt.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_mul.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_rem.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_roundToInt.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_sqrt.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_sub.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_to_f16.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_to_f32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_to_f64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/extF80M_to_f128M.c"
|
2018-06-27 14:20:04 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_add.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_div.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_eq.c"
|
2019-04-05 02:07:15 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_isSignalingNaN.c"
|
2018-06-27 14:20:04 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_lt.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_mul.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_rem.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_roundToInt.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_sqrt.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_sub.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_to_extF80M.c"
|
2018-06-27 14:20:04 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_to_f128M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_to_f64.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f32_to_extF80M.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f32_to_f128M.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f64_to_extF80M.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f64_to_f128M.c"
|
2018-06-27 14:20:04 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f64_to_f16.c"
|
2019-03-22 18:56:03 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/i32_to_f128M.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_add256M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addCarryM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addComplCarryM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addF128M.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addExtF80M.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addMagsF16.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addMagsF32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_addMagsF64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_approxRecip32_1.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_approxRecipSqrt32_1.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_approxRecipSqrt_1Ks.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_approxRecip_1Ks.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_compare128M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_compare96M.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_compareNonnormExtF80M.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_countLeadingZeros16.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_countLeadingZeros32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_countLeadingZeros64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_countLeadingZeros8.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_eq128.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_invalidF128M.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_invalidExtF80M.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_isNaNF128M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_le128.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_lt128.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_mul128MTo256M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_mul64To128M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_mulAddF128M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_mulAddF16.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_mulAddF32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_mulAddF64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_negXM.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normExtF80SigM.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normRoundPackMToF128M.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normRoundPackMToExtF80M.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normRoundPackToF16.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normRoundPackToF32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normRoundPackToF64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normSubnormalF128SigM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normSubnormalF16Sig.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normSubnormalF32Sig.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_normSubnormalF64Sig.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_remStepMBy32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundMToI64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundMToUI64.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundPackMToExtF80M.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundPackMToF128M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundPackToF16.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundPackToF32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundPackToF64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundToI32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundToI64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundToUI32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_roundToUI64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftLeftM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftNormSigF128M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftRightJam256M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftRightJam32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftRightJam64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftRightJamM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shiftRightM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shortShiftLeft64To96M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shortShiftLeftM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shortShiftRightExtendM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shortShiftRightJam64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shortShiftRightJamM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_shortShiftRightM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_sub1XM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_sub256M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_subM.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_subMagsF16.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_subMagsF32.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_subMagsF64.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_tryPropagateNaNF128M.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/s_tryPropagateNaNExtF80M.c"
|
2019-06-18 22:28:49 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f16_mulAdd.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/f128M_mulAdd.c"
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/softfloat_state.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/ui32_to_f128M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/ui64_to_f128M.c"
|
2022-01-19 10:26:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/ui32_to_extF80M.c"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/ui64_to_extF80M.c"
|
2017-09-14 05:44:22 +00:00
|
|
|
)
|
2019-08-15 18:34:52 +00:00
|
|
|
add_library(embedded_softfloat STATIC ${EMBEDDED_SOFTFLOAT_SOURCES})
|
2017-09-14 05:44:22 +00:00
|
|
|
if(MSVC)
|
2022-09-04 17:26:03 +00:00
|
|
|
set(SOFTFLOAT_CFLAGS "/w")
|
|
|
|
|
|
|
|
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
|
|
|
set(SOFTFLOAT_CFLAGS "${SOFTFLOAT_CFLAGS} /O2")
|
|
|
|
endif()
|
|
|
|
|
2017-09-14 05:44:22 +00:00
|
|
|
set_target_properties(embedded_softfloat PROPERTIES
|
2022-09-04 17:26:03 +00:00
|
|
|
COMPILE_FLAGS ${SOFTFLOAT_CFLAGS}
|
2017-09-14 05:44:22 +00:00
|
|
|
)
|
|
|
|
else()
|
|
|
|
set_target_properties(embedded_softfloat PROPERTIES
|
2018-09-10 13:46:15 +00:00
|
|
|
COMPILE_FLAGS "-std=c99 -O3"
|
2017-09-14 05:44:22 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
target_include_directories(embedded_softfloat PUBLIC
|
2018-03-09 20:06:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e-prebuilt"
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/8086"
|
2015-08-05 22:46:40 +00:00
|
|
|
)
|
2018-03-09 20:06:06 +00:00
|
|
|
include_directories("${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e/source/include")
|
2017-09-14 05:44:22 +00:00
|
|
|
set(SOFTFLOAT_LIBRARIES embedded_softfloat)
|
|
|
|
|
|
|
|
find_package(Threads)
|
2015-08-05 22:46:40 +00:00
|
|
|
|
2020-11-17 00:57:22 +00:00
|
|
|
set(ZIG_LIB_DIR "lib/zig")
|
|
|
|
set(C_HEADERS_DEST "${ZIG_LIB_DIR}/include")
|
|
|
|
set(LIBC_FILES_DEST "${ZIG_LIB_DIR}/libc")
|
|
|
|
set(LIBUNWIND_FILES_DEST "${ZIG_LIB_DIR}/libunwind")
|
|
|
|
set(LIBCXX_FILES_DEST "${ZIG_LIB_DIR}/libcxx")
|
|
|
|
set(ZIG_STD_DEST "${ZIG_LIB_DIR}/std")
|
2020-12-08 00:23:17 +00:00
|
|
|
set(ZIG_CONFIG_H_OUT "${CMAKE_BINARY_DIR}/config.h")
|
|
|
|
set(ZIG_CONFIG_ZIG_OUT "${CMAKE_BINARY_DIR}/config.zig")
|
2020-11-17 00:57:22 +00:00
|
|
|
|
delete all stage1 c++ code not directly related to compiling stage2
Deleted 16,000+ lines of c++ code, including:
* an implementation of blake hashing
* the cache hash system
* compiler.cpp
* all the linking code, and everything having to do with building
glibc, musl, and mingw-w64
* much of the stage1 compiler internals got slimmed down since it
now assumes it is always outputting an object file.
More stuff:
* stage1 is now built with a different strategy: we have a tiny
zig0.cpp which is a slimmed down version of what stage1 main.cpp used
to be. Its only purpose is to build stage2 zig code into an object
file, which is then linked by the host build system (cmake) into
stage1. zig0.cpp uses the same C API that stage2 now has access to,
so that stage2 zig code can call into stage1 c++ code.
- stage1.h is
- stage2.h is
- stage1.zig is the main entry point for the Zig/C++
hybrid compiler. It has the functions exported from Zig, called
in C++, and bindings for the functions exported from C++, called
from Zig.
* removed the memory profiling instrumentation from stage1.
Abandon ship!
* Re-added the sections to the README about how to build stage2 and
stage3.
* stage2 now knows as a comptime boolean whether it is being compiled
as part of stage1 or as stage2.
- TODO use this flag to call into stage1 for compiling zig code.
* introduce -fdll-export-fns and -fno-dll-export-fns and clarify
its relationship to link_mode (static/dynamic)
* implement depending on LLVM to detect native target cpu features when
LLVM extensions are enabled and zig lacks CPU feature detection for
that target architecture.
* C importing is broken, will need some stage2 support to function
again.
2020-09-18 01:29:38 +00:00
|
|
|
# This is our shim which will be replaced by stage1.zig.
|
2022-08-20 05:06:15 +00:00
|
|
|
set(ZIG1_SOURCES
|
2020-09-22 01:38:55 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/zig0.cpp"
|
delete all stage1 c++ code not directly related to compiling stage2
Deleted 16,000+ lines of c++ code, including:
* an implementation of blake hashing
* the cache hash system
* compiler.cpp
* all the linking code, and everything having to do with building
glibc, musl, and mingw-w64
* much of the stage1 compiler internals got slimmed down since it
now assumes it is always outputting an object file.
More stuff:
* stage1 is now built with a different strategy: we have a tiny
zig0.cpp which is a slimmed down version of what stage1 main.cpp used
to be. Its only purpose is to build stage2 zig code into an object
file, which is then linked by the host build system (cmake) into
stage1. zig0.cpp uses the same C API that stage2 now has access to,
so that stage2 zig code can call into stage1 c++ code.
- stage1.h is
- stage2.h is
- stage1.zig is the main entry point for the Zig/C++
hybrid compiler. It has the functions exported from Zig, called
in C++, and bindings for the functions exported from C++, called
from Zig.
* removed the memory profiling instrumentation from stage1.
Abandon ship!
* Re-added the sections to the README about how to build stage2 and
stage3.
* stage2 now knows as a comptime boolean whether it is being compiled
as part of stage1 or as stage2.
- TODO use this flag to call into stage1 for compiling zig code.
* introduce -fdll-export-fns and -fno-dll-export-fns and clarify
its relationship to link_mode (static/dynamic)
* implement depending on LLVM to detect native target cpu features when
LLVM extensions are enabled and zig lacks CPU feature detection for
that target architecture.
* C importing is broken, will need some stage2 support to function
again.
2020-09-18 01:29:38 +00:00
|
|
|
)
|
2019-11-24 20:29:43 +00:00
|
|
|
|
2020-09-23 07:00:24 +00:00
|
|
|
set(STAGE1_SOURCES
|
2020-09-22 01:38:55 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/analyze.cpp"
|
stage1: rework tokenizer to match stage2
* Extracts AstGen logic from ir.cpp into astgen.cpp. Reduces the
largest file of stage1 from 33,551 lines to 25,510.
* tokenizer: rework it completely to match the stage2 tokenizer logic.
They can now be maintained together; when one is changed, the other
can be changed in the same way.
- Each token now takes up 13 bytes instead of 64 bytes. The tokenizer
does not parse char literals, string literals, integer literals,
etc into meaningful data. Instead, that happens during parsing or
astgen.
- no longer store line offsets. Error messages scan source
files to find the line/column as needed (same as stage2).
- main loop: instead of checking the loop, handle a null byte
explicitly in the switch statements. This is a nice improvement
that we may want to backport to stage2.
- delete some dead tokens, artifacts of past syntax that no longer
exists.
* Parser: fix a TODO by parsing builtin functions as tokens rather than
`@` as a separate token. This is how stage2 does it.
* Remove some debugging infrastructure. These will need to be redone,
if at all, as the code migrates to match stage2.
- remove the ast_render code.
- remove the IR debugging stuff
- remove teh token printing code
2021-05-27 23:32:35 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/astgen.cpp"
|
2020-09-22 01:38:55 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/bigfloat.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/bigint.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/buffer.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/codegen.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/errmsg.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/error.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/heap.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/ir.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/ir_print.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/mem.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/os.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/parser.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/range_set.cpp"
|
stage1: rework tokenizer to match stage2
* Extracts AstGen logic from ir.cpp into astgen.cpp. Reduces the
largest file of stage1 from 33,551 lines to 25,510.
* tokenizer: rework it completely to match the stage2 tokenizer logic.
They can now be maintained together; when one is changed, the other
can be changed in the same way.
- Each token now takes up 13 bytes instead of 64 bytes. The tokenizer
does not parse char literals, string literals, integer literals,
etc into meaningful data. Instead, that happens during parsing or
astgen.
- no longer store line offsets. Error messages scan source
files to find the line/column as needed (same as stage2).
- main loop: instead of checking the loop, handle a null byte
explicitly in the switch statements. This is a nice improvement
that we may want to backport to stage2.
- delete some dead tokens, artifacts of past syntax that no longer
exists.
* Parser: fix a TODO by parsing builtin functions as tokens rather than
`@` as a separate token. This is how stage2 does it.
* Remove some debugging infrastructure. These will need to be redone,
if at all, as the code migrates to match stage2.
- remove the ast_render code.
- remove the IR debugging stuff
- remove teh token printing code
2021-05-27 23:32:35 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/softfloat_ext.cpp"
|
2020-09-22 01:38:55 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/stage1.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/target.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/tokenizer.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/util.cpp"
|
2017-12-27 00:44:08 +00:00
|
|
|
)
|
2019-03-22 18:56:03 +00:00
|
|
|
set(OPTIMIZED_C_SOURCES
|
2020-09-22 01:38:55 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/parse_f128.c"
|
2018-09-10 13:46:15 +00:00
|
|
|
)
|
2017-12-27 00:44:08 +00:00
|
|
|
set(ZIG_CPP_SOURCES
|
delete all stage1 c++ code not directly related to compiling stage2
Deleted 16,000+ lines of c++ code, including:
* an implementation of blake hashing
* the cache hash system
* compiler.cpp
* all the linking code, and everything having to do with building
glibc, musl, and mingw-w64
* much of the stage1 compiler internals got slimmed down since it
now assumes it is always outputting an object file.
More stuff:
* stage1 is now built with a different strategy: we have a tiny
zig0.cpp which is a slimmed down version of what stage1 main.cpp used
to be. Its only purpose is to build stage2 zig code into an object
file, which is then linked by the host build system (cmake) into
stage1. zig0.cpp uses the same C API that stage2 now has access to,
so that stage2 zig code can call into stage1 c++ code.
- stage1.h is
- stage2.h is
- stage1.zig is the main entry point for the Zig/C++
hybrid compiler. It has the functions exported from Zig, called
in C++, and bindings for the functions exported from C++, called
from Zig.
* removed the memory profiling instrumentation from stage1.
Abandon ship!
* Re-added the sections to the README about how to build stage2 and
stage3.
* stage2 now knows as a comptime boolean whether it is being compiled
as part of stage1 or as stage2.
- TODO use this flag to call into stage1 for compiling zig code.
* introduce -fdll-export-fns and -fno-dll-export-fns and clarify
its relationship to link_mode (static/dynamic)
* implement depending on LLVM to detect native target cpu features when
LLVM extensions are enabled and zig lacks CPU feature detection for
that target architecture.
* C importing is broken, will need some stage2 support to function
again.
2020-09-18 01:29:38 +00:00
|
|
|
# These are planned to stay even when we are self-hosted.
|
2015-11-24 20:00:38 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/zig_llvm.cpp"
|
2021-05-29 03:54:11 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/zig_llvm-ar.cpp"
|
2019-02-16 20:14:51 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/zig_clang.cpp"
|
2019-02-24 17:53:28 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/zig_clang_driver.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/zig_clang_cc1_main.cpp"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/zig_clang_cc1as_main.cpp"
|
delete all stage1 c++ code not directly related to compiling stage2
Deleted 16,000+ lines of c++ code, including:
* an implementation of blake hashing
* the cache hash system
* compiler.cpp
* all the linking code, and everything having to do with building
glibc, musl, and mingw-w64
* much of the stage1 compiler internals got slimmed down since it
now assumes it is always outputting an object file.
More stuff:
* stage1 is now built with a different strategy: we have a tiny
zig0.cpp which is a slimmed down version of what stage1 main.cpp used
to be. Its only purpose is to build stage2 zig code into an object
file, which is then linked by the host build system (cmake) into
stage1. zig0.cpp uses the same C API that stage2 now has access to,
so that stage2 zig code can call into stage1 c++ code.
- stage1.h is
- stage2.h is
- stage1.zig is the main entry point for the Zig/C++
hybrid compiler. It has the functions exported from Zig, called
in C++, and bindings for the functions exported from C++, called
from Zig.
* removed the memory profiling instrumentation from stage1.
Abandon ship!
* Re-added the sections to the README about how to build stage2 and
stage3.
* stage2 now knows as a comptime boolean whether it is being compiled
as part of stage1 or as stage2.
- TODO use this flag to call into stage1 for compiling zig code.
* introduce -fdll-export-fns and -fno-dll-export-fns and clarify
its relationship to link_mode (static/dynamic)
* implement depending on LLVM to detect native target cpu features when
LLVM extensions are enabled and zig lacks CPU feature detection for
that target architecture.
* C importing is broken, will need some stage2 support to function
again.
2020-09-18 01:29:38 +00:00
|
|
|
# https://github.com/ziglang/zig/issues/6363
|
2018-07-21 03:37:37 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/windows_sdk.cpp"
|
2015-08-05 22:23:15 +00:00
|
|
|
)
|
2022-08-20 05:06:15 +00:00
|
|
|
# Needed because we use cmake, not the zig build system, to build zig2.o.
|
2020-11-17 00:57:22 +00:00
|
|
|
# This list is generated by building zig and then clearing the zig-cache directory,
|
2022-08-20 05:06:15 +00:00
|
|
|
# then manually running the build-obj command (see BUILD_ZIG2_ARGS), and then looking
|
2020-11-17 00:57:22 +00:00
|
|
|
# in the zig-cache directory for the compiler-generated list of zig file dependencies.
|
2020-11-11 15:12:17 +00:00
|
|
|
set(ZIG_STAGE2_SOURCES
|
2020-12-08 00:23:17 +00:00
|
|
|
"${ZIG_CONFIG_ZIG_OUT}"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/array_hash_map.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/array_list.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/ascii.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/atomic.zig"
|
2021-05-31 16:11:30 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/atomic/Atomic.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/atomic/queue.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/atomic/stack.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/base64.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/buf_map.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/builtin.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/c.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/c/linux.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/c/tokenizer.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/child_process.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/coff.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/comptime_string_map.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/crypto.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/crypto/blake3.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/crypto/siphash.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/debug.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/dwarf.zig"
|
2021-08-30 21:31:47 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/dwarf/AT.zig"
|
2022-03-20 00:37:05 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/dwarf/ATE.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/dwarf/FORM.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/dwarf/LANG.zig"
|
2021-08-30 21:31:47 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/dwarf/OP.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/dwarf/TAG.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/elf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/event.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/event/batch.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/event/loop.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/fifo.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/fmt.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/fmt/errol.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/fmt/errol/enum3.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/fmt/errol/lookup.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/fmt/parse_float.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/fs.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/fs/file.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/fs/get_app_data_dir.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/fs/path.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/hash.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/hash/auto_hash.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/hash/wyhash.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/hash_map.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/heap.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/heap/arena_allocator.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/io.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/io/buffered_atomic_file.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/io/buffered_writer.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/io/change_detection_stream.zig"
|
2020-12-22 14:30:48 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/io/counting_reader.zig"
|
2020-11-18 15:26:31 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/io/counting_writer.zig"
|
2021-01-08 20:57:39 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/io/find_byte_writer.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/io/fixed_buffer_stream.zig"
|
2021-01-11 23:51:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/io/limited_reader.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/io/reader.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/io/seekable_stream.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/io/writer.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/json.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/json/write_stream.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/leb128.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/linked_list.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/log.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/macho.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/big.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/big/int.zig"
|
2022-04-07 08:34:10 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/float.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/frexp.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/isinf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/isnan.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/ln.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/log.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/log10.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/log2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/nan.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/signbit.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/math/sqrt.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/mem.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/mem/Allocator.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/meta.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/meta/trailer_flags.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/meta/trait.zig"
|
2021-02-24 19:49:12 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/multi_array_list.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/os.zig"
|
2022-03-13 12:35:37 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/os/darwin.zig"
|
2021-08-24 20:43:41 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/os/linux.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/errno/generic.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/x86_64.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/os/linux.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/io_uring.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/x86_64.zig"
|
2022-03-14 19:41:28 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/os/posix_spawn.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/os/windows.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/os/windows/ntstatus.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/os/windows/win32error.zig"
|
2020-12-24 00:57:18 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/Progress.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/pdb.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/process.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/rand.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/sort.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/absv.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/absvdi2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/absvsi2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/absvti2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/adddf3.zig"
|
2022-06-16 06:09:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/addf3.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/addo.zig"
|
2022-06-16 06:09:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/addsf3.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/addtf3.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/addxf3.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/arm.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/atomics.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/aulldiv.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/aullrem.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/bswap.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/ceil.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/clear_cache.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/cmp.zig"
|
2022-06-16 06:09:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/cmpdf2.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/cmpsf2.zig"
|
2022-06-16 06:09:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/cmptf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/cmpxf2.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/common.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/comparef.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/cos.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/count0bits.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/divdf3.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/divsf3.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/divtf3.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/divti3.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/divxf3.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/emutls.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/exp.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/exp2.zig"
|
2022-06-16 06:09:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/extenddftf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/extenddfxf2.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/extendf.zig"
|
2022-06-16 06:09:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/extendhfsf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/extendhftf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/extendhfxf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/extendsfdf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/extendsftf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/extendsfxf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/extendxftf2.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fabs.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixdfdi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixdfsi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixdfti.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixhfdi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixhfsi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixhfti.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixsfdi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixsfsi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixsfti.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixtfdi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixtfsi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixtfti.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunsdfdi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunsdfsi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunsdfti.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunshfdi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunshfsi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunshfti.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunssfdi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunssfsi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunssfti.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunstfdi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunstfsi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunstfti.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunsxfdi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunsxfsi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixunsxfti.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixxfdi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixxfsi.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixxfti.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/float_to_int.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatdidf.zig"
|
2022-06-16 06:09:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatdihf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatdisf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatditf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatdixf.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatsidf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatsihf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatsisf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatsitf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatsixf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floattidf.zig"
|
2022-06-16 06:09:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floattihf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floattisf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floattitf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floattixf.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatundidf.zig"
|
2022-06-16 06:09:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatundihf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatundisf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatunditf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatundixf.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatunsidf.zig"
|
2022-06-16 06:09:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatunsihf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatunsisf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatunsitf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatunsixf.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatuntidf.zig"
|
2022-06-16 06:09:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatuntihf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatuntisf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatuntitf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatuntixf.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floor.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fma.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fmax.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fmin.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fmod.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/gedf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/gesf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/getf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/gexf2.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/int.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/int_to_float.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/log.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/log10.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/log2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/modti3.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/muldf3.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/muldi3.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/mulf3.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/mulo.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/mulsf3.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/multf3.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/multi3.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/mulxf3.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/negXi2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/negv.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/os_version_check.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/parity.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/popcount.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/rem_pio2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/rem_pio2_large.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/rem_pio2f.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/round.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/shift.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/sin.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/sincos.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/sqrt.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/stack_probe.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/subo.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/subsf3.zig"
|
2022-06-30 07:02:00 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/subdf3.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/subtf3.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/subxf3.zig"
|
2022-06-30 07:02:00 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/negsf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/negdf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/negtf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/negxf2.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/tan.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/trig.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/trunc.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/truncdfhf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/truncdfsf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/truncf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/truncsfhf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/trunctfdf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/trunctfhf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/trunctfsf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/trunctfxf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/truncxfdf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/truncxfhf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/truncxfsf2.zig"
|
2022-05-07 02:22:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/udivmod.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/udivmodti4.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/udivti3.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/umodti3.zig"
|
2022-06-18 01:24:57 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/unorddf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/unordsf2.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/unordtf2.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/start.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/std.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/aarch64.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/amdgpu.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/arm.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/avr.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/bpf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/hexagon.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/mips.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/msp430.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/nvptx.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/powerpc.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/riscv.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/sparc.zig"
|
2022-07-28 20:47:29 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/s390x.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/wasm.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/target/x86.zig"
|
2021-01-15 03:41:37 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/Thread.zig"
|
2021-06-12 13:51:37 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/Thread/Futex.zig"
|
2021-01-15 03:41:37 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/Thread/Mutex.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/Thread/ResetEvent.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/time.zig"
|
2022-04-15 20:26:51 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/treap.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/unicode.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/zig.zig"
|
2021-08-31 02:22:04 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/zig/Ast.zig"
|
2021-11-30 07:13:07 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/zig/CrossTarget.zig"
|
2022-03-19 17:08:17 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/zig/c_builtins.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/zig/parse.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/zig/render.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/zig/string_literal.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/zig/system.zig"
|
2021-12-03 04:51:14 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/zig/system/NativePaths.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/zig/system/NativeTargetInfo.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/zig/system/x86.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/lib/std/zig/tokenizer.zig"
|
2021-09-20 21:45:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/Air.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/AstGen.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/Cache.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/Compilation.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/DepTokenizer.zig"
|
2021-09-20 21:45:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/Liveness.zig"
|
2020-11-11 15:12:17 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/Module.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/Package.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/RangeSet.zig"
|
2021-09-20 21:45:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/Sema.zig"
|
2020-12-20 22:37:58 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/ThreadPool.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/TypedValue.zig"
|
2020-12-20 22:37:58 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/WaitGroup.zig"
|
2021-09-20 21:45:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/Zir.zig"
|
2021-12-24 00:48:58 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/aarch64/CodeGen.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/aarch64/Emit.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/aarch64/Mir.zig"
|
2021-09-23 20:47:12 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/aarch64/bits.zig"
|
2022-03-10 22:14:28 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/aarch64/abi.zig"
|
2021-12-24 00:48:58 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/arm/CodeGen.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/arm/Emit.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/arm/Mir.zig"
|
2021-09-23 20:47:12 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/arm/bits.zig"
|
2022-03-10 22:14:28 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/arm/abi.zig"
|
2021-12-24 00:48:58 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/riscv64/CodeGen.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/riscv64/Emit.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/riscv64/Mir.zig"
|
2021-09-23 20:47:12 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/riscv64/bits.zig"
|
2022-03-10 22:14:28 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/riscv64/abi.zig"
|
2022-05-13 15:59:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/sparc64/CodeGen.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/sparc64/Emit.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/sparc64/Mir.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/sparc64/bits.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/sparc64/abi.zig"
|
2021-11-15 17:02:24 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/wasm/CodeGen.zig"
|
2021-12-24 00:48:58 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/wasm/Emit.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/wasm/Mir.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/x86_64/CodeGen.zig"
|
2022-01-15 17:36:13 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/x86_64/Emit.zig"
|
2021-12-24 00:48:58 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/x86_64/Mir.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/x86_64/bits.zig"
|
2022-03-10 22:14:28 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/arch/x86_64/abi.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/clang.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/clang_options.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/clang_options_data.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/codegen.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/codegen/c.zig"
|
2021-01-06 00:27:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/codegen/llvm.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/codegen/llvm/bindings.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/glibc.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/introspect.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/libc_installation.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/libcxx.zig"
|
2020-12-22 05:18:19 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/libtsan.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/libunwind.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/link.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/C.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/Coff.zig"
|
2022-08-26 12:11:14 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/Coff/Atom.zig"
|
2022-08-29 22:45:01 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/Coff/Object.zig"
|
2022-08-26 12:11:14 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/Coff/lld.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/Elf.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO.zig"
|
2021-03-17 21:14:55 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/Archive.zig"
|
2021-09-09 16:32:03 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/Atom.zig"
|
2021-03-17 21:14:55 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/CodeSignature.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/DebugSymbols.zig"
|
2022-10-18 20:10:00 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/DwarfInfo.zig"
|
2021-05-16 14:32:27 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/Dylib.zig"
|
2021-03-17 21:14:55 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/Object.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/Trie.zig"
|
2022-10-18 20:10:00 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/ZldAtom.zig"
|
2021-03-17 21:14:55 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/bind.zig"
|
2022-07-21 11:30:15 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/dead_strip.zig"
|
2022-10-18 20:10:00 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/thunks.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/MachO/zld.zig"
|
2021-09-20 21:45:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/Plan9.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/Plan9/aout.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/Wasm.zig"
|
2021-09-20 21:45:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/msdos-stub.bin"
|
2022-07-21 11:30:15 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/strtab.zig"
|
2021-06-19 08:45:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/tapi.zig"
|
2021-09-20 21:45:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/tapi/Tokenizer.zig"
|
2021-06-19 08:45:56 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/tapi/parse.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/tapi/parse/test.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/link/tapi/yaml.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/main.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/mingw.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/musl.zig"
|
2021-09-20 21:45:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/print_air.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/print_env.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/print_targets.zig"
|
2021-09-20 21:45:40 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/print_zir.zig"
|
2022-02-14 19:26:15 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/register_manager.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/target.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/tracy.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/translate_c.zig"
|
2021-02-23 20:55:12 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/translate_c/ast.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/type.zig"
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/value.zig"
|
2021-05-18 14:00:06 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/wasi_libc.zig"
|
2020-11-17 00:57:22 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/windows_sdk.zig"
|
2020-11-11 15:12:17 +00:00
|
|
|
)
|
2015-08-05 22:23:15 +00:00
|
|
|
|
2018-01-05 03:46:26 +00:00
|
|
|
if(MSVC)
|
|
|
|
set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK")
|
2019-06-23 01:21:48 +00:00
|
|
|
if(IS_DIRECTORY ${MSVC_DIA_SDK_DIR})
|
2018-01-05 03:46:26 +00:00
|
|
|
set(ZIG_DIA_GUIDS_LIB "${MSVC_DIA_SDK_DIR}/lib/amd64/diaguids.lib")
|
|
|
|
string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_DIA_GUIDS_LIB_ESCAPED "${ZIG_DIA_GUIDS_LIB}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2021-01-04 21:59:18 +00:00
|
|
|
if(ZIG_OMIT_STAGE2)
|
|
|
|
set(ZIG_OMIT_STAGE2_BOOL "true")
|
|
|
|
else()
|
|
|
|
set(ZIG_OMIT_STAGE2_BOOL "false")
|
|
|
|
endif()
|
|
|
|
|
2021-03-21 09:56:41 +00:00
|
|
|
if(ZIG_ENABLE_LOGGING)
|
|
|
|
set(ZIG_ENABLE_LOGGING_BOOL "true")
|
|
|
|
else()
|
|
|
|
set(ZIG_ENABLE_LOGGING_BOOL "false")
|
|
|
|
endif()
|
|
|
|
|
2020-12-08 00:23:17 +00:00
|
|
|
configure_file (
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1/config.h.in"
|
|
|
|
"${ZIG_CONFIG_H_OUT}"
|
|
|
|
)
|
|
|
|
configure_file (
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/config.zig.in"
|
|
|
|
"${ZIG_CONFIG_ZIG_OUT}"
|
|
|
|
)
|
|
|
|
|
2015-11-26 08:29:52 +00:00
|
|
|
include_directories(
|
|
|
|
${CMAKE_SOURCE_DIR}
|
|
|
|
${CMAKE_BINARY_DIR}
|
|
|
|
"${CMAKE_SOURCE_DIR}/src"
|
2020-09-22 01:38:55 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/stage1"
|
2015-11-26 08:29:52 +00:00
|
|
|
)
|
|
|
|
|
2018-09-05 16:10:53 +00:00
|
|
|
# These have to go before the -Wno- flags
|
2020-03-31 14:13:31 +00:00
|
|
|
if(MSVC)
|
|
|
|
set(EXE_CFLAGS "/std:c++14")
|
|
|
|
else(MSVC)
|
|
|
|
set(EXE_CFLAGS "-std=c++14")
|
|
|
|
endif(MSVC)
|
|
|
|
|
ability to build stage1 using only a zig tarball
The main idea here is that there are now 2 ways to get a stage1 zig
binary:
* The cmake path. Requirements: cmake, system C++ compiler, system
LLVM, LLD, Clang libraries, compiled by the system C++ compiler.
* The zig path. Requirements: a zig installation, system LLVM, LLD,
Clang libraries, compiled by the zig installation.
Note that the former can be used to now take the latter path.
Removed config.h.in and config.zig.in. The build.zig script no longer is
coupled to the cmake script.
cmake no longer tries to determine the zig version. A build with cmake
will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to
get reverted.
`zig build` now accepts `-Dstage1` which will build the stage1 compiler,
and put the stage2 backend behind a feature flag.
build.zig is simplified to only support the use case of enabling LLVM
support when the LLVM, LLD, and Clang libraries were built by zig. This
part is probably sadly going to have to get reverted to make package
maintainers happy.
Zig build system addBuildOption supports a couple new types.
The biggest reason to make this change is that the zig path is an
attractive option for doing compiler development work on Windows. It
allows people to work on the compiler without having MSVC installed,
using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-05 04:33:29 +00:00
|
|
|
if(ZIG_STATIC)
|
|
|
|
set(EXE_CFLAGS "${EXE_CFLAGS} -DZIG_LINK_MODE=Static")
|
|
|
|
else()
|
|
|
|
set(EXE_CFLAGS "${EXE_CFLAGS} -DZIG_LINK_MODE=Dynamic")
|
|
|
|
endif()
|
|
|
|
|
2018-09-05 14:18:12 +00:00
|
|
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
|
|
|
if(MSVC)
|
|
|
|
set(EXE_CFLAGS "${EXE_CFLAGS} /w")
|
|
|
|
else()
|
2020-05-17 08:31:19 +00:00
|
|
|
set(EXE_CFLAGS "${EXE_CFLAGS} -Werror -Wall")
|
2020-05-17 20:38:26 +00:00
|
|
|
# fallthrough support was added in GCC 7.0
|
|
|
|
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0)
|
2020-05-17 08:31:19 +00:00
|
|
|
set(EXE_CFLAGS "${EXE_CFLAGS} -Werror=implicit-fallthrough")
|
|
|
|
endif()
|
2020-11-23 17:04:00 +00:00
|
|
|
# GCC 9.2 and older are unable to detect valid variable initialization in some cases
|
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 9.2)
|
|
|
|
set(EXE_CFLAGS "${EXE_CFLAGS} -Wno-maybe-uninitialized")
|
|
|
|
endif()
|
2018-09-05 14:18:12 +00:00
|
|
|
endif()
|
2016-02-17 03:34:45 +00:00
|
|
|
endif()
|
|
|
|
|
2017-09-13 04:17:19 +00:00
|
|
|
if(MSVC)
|
2019-06-23 01:21:48 +00:00
|
|
|
set(EXE_CFLAGS "${EXE_CFLAGS}")
|
2017-09-13 04:17:19 +00:00
|
|
|
else()
|
2022-08-02 01:16:52 +00:00
|
|
|
set(EXE_CFLAGS "${EXE_CFLAGS} -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Werror=type-limits -Wno-missing-braces -Wno-comment")
|
2019-06-23 01:21:48 +00:00
|
|
|
if(MINGW)
|
|
|
|
set(EXE_CFLAGS "${EXE_CFLAGS} -Wno-format")
|
|
|
|
endif()
|
2017-09-10 20:05:18 +00:00
|
|
|
endif()
|
2017-09-13 04:17:19 +00:00
|
|
|
|
2020-03-31 14:13:31 +00:00
|
|
|
if(MSVC)
|
2022-09-04 17:26:03 +00:00
|
|
|
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
|
|
|
set(OPTIMIZED_C_FLAGS "/O2")
|
|
|
|
endif()
|
2020-03-31 14:13:31 +00:00
|
|
|
else(MSVC)
|
|
|
|
set(OPTIMIZED_C_FLAGS "-std=c99 -O3")
|
|
|
|
endif(MSVC)
|
2018-09-05 14:18:12 +00:00
|
|
|
|
2016-04-23 16:57:38 +00:00
|
|
|
set(EXE_LDFLAGS " ")
|
2019-03-27 05:54:46 +00:00
|
|
|
if(MSVC)
|
2019-07-26 21:26:01 +00:00
|
|
|
set(EXE_LDFLAGS "${EXE_LDFLAGS} /STACK:16777216")
|
2019-09-08 10:07:23 +00:00
|
|
|
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
|
|
|
|
set(EXE_LDFLAGS "${EXE_LDFLAGS} /debug:fastlink")
|
|
|
|
endif()
|
2020-03-28 03:43:21 +00:00
|
|
|
elseif(MINGW)
|
2019-06-23 06:15:04 +00:00
|
|
|
set(EXE_LDFLAGS "${EXE_LDFLAGS} -Wl,--stack,16777216")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ZIG_STATIC)
|
2018-09-27 19:07:51 +00:00
|
|
|
if(APPLE)
|
2019-07-26 21:26:01 +00:00
|
|
|
set(EXE_LDFLAGS "${EXE_LDFLAGS} -static-libgcc -static-libstdc++")
|
2019-07-13 22:44:05 +00:00
|
|
|
elseif(MINGW)
|
2019-07-26 21:26:01 +00:00
|
|
|
set(EXE_LDFLAGS "${EXE_LDFLAGS} -static-libgcc -static-libstdc++ -Wl,-Bstatic, -lwinpthread -lz3 -lz -lgomp")
|
2019-07-27 22:54:20 +00:00
|
|
|
elseif(NOT MSVC)
|
2019-07-26 21:26:01 +00:00
|
|
|
set(EXE_LDFLAGS "${EXE_LDFLAGS} -static")
|
2018-09-27 19:07:51 +00:00
|
|
|
endif()
|
2019-07-26 21:26:01 +00:00
|
|
|
else()
|
|
|
|
if(MINGW)
|
2020-04-06 19:42:04 +00:00
|
|
|
set(EXE_LDFLAGS "${EXE_LDFLAGS}")
|
2020-03-28 03:43:21 +00:00
|
|
|
endif()
|
2017-09-23 22:46:03 +00:00
|
|
|
endif()
|
2019-06-23 06:15:04 +00:00
|
|
|
|
2016-04-23 16:57:38 +00:00
|
|
|
if(ZIG_TEST_COVERAGE)
|
|
|
|
set(EXE_CFLAGS "${EXE_CFLAGS} -fprofile-arcs -ftest-coverage")
|
2017-09-23 22:46:03 +00:00
|
|
|
set(EXE_LDFLAGS "${EXE_LDFLAGS} -fprofile-arcs -ftest-coverage")
|
2016-04-23 16:57:38 +00:00
|
|
|
endif()
|
2015-08-05 22:23:15 +00:00
|
|
|
|
2020-09-23 07:00:24 +00:00
|
|
|
add_library(zigcpp STATIC ${ZIG_CPP_SOURCES})
|
|
|
|
set_target_properties(zigcpp PROPERTIES
|
2017-12-27 01:04:09 +00:00
|
|
|
COMPILE_FLAGS ${EXE_CFLAGS}
|
|
|
|
)
|
2020-04-18 00:22:00 +00:00
|
|
|
|
2020-09-23 07:00:24 +00:00
|
|
|
target_link_libraries(zigcpp LINK_PUBLIC
|
2020-02-04 08:39:20 +00:00
|
|
|
${CLANG_LIBRARIES}
|
|
|
|
${LLD_LIBRARIES}
|
|
|
|
${LLVM_LIBRARIES}
|
2020-09-18 08:33:32 +00:00
|
|
|
${CMAKE_THREAD_LIBS_INIT}
|
2020-02-04 08:39:20 +00:00
|
|
|
)
|
2017-12-27 00:44:08 +00:00
|
|
|
|
2019-03-22 18:56:03 +00:00
|
|
|
add_library(opt_c_util STATIC ${OPTIMIZED_C_SOURCES})
|
|
|
|
set_target_properties(opt_c_util PROPERTIES
|
|
|
|
COMPILE_FLAGS "${OPTIMIZED_C_FLAGS}"
|
2018-09-10 13:46:15 +00:00
|
|
|
)
|
2022-02-11 04:47:18 +00:00
|
|
|
target_include_directories(opt_c_util PRIVATE
|
|
|
|
"${CMAKE_SOURCE_DIR}/deps/SoftFloat-3e-prebuilt"
|
|
|
|
)
|
2018-09-10 13:46:15 +00:00
|
|
|
|
2020-09-23 07:00:24 +00:00
|
|
|
add_library(zigstage1 STATIC ${STAGE1_SOURCES})
|
|
|
|
set_target_properties(zigstage1 PROPERTIES
|
2016-04-23 16:57:38 +00:00
|
|
|
COMPILE_FLAGS ${EXE_CFLAGS}
|
|
|
|
LINK_FLAGS ${EXE_LDFLAGS}
|
|
|
|
)
|
2020-09-23 07:00:24 +00:00
|
|
|
target_link_libraries(zigstage1 LINK_PUBLIC
|
2019-03-22 18:56:03 +00:00
|
|
|
opt_c_util
|
2017-09-14 05:44:22 +00:00
|
|
|
${SOFTFLOAT_LIBRARIES}
|
2020-09-23 07:00:24 +00:00
|
|
|
zigcpp
|
2015-08-05 22:23:15 +00:00
|
|
|
)
|
2018-03-10 23:23:08 +00:00
|
|
|
if(NOT MSVC)
|
2020-09-23 07:00:24 +00:00
|
|
|
target_link_libraries(zigstage1 LINK_PUBLIC ${LIBXML2})
|
2018-03-10 19:48:41 +00:00
|
|
|
endif()
|
2019-03-09 23:54:34 +00:00
|
|
|
|
2018-01-05 03:46:26 +00:00
|
|
|
if(ZIG_DIA_GUIDS_LIB)
|
2020-09-23 07:00:24 +00:00
|
|
|
target_link_libraries(zigstage1 LINK_PUBLIC ${ZIG_DIA_GUIDS_LIB})
|
2018-01-05 03:46:26 +00:00
|
|
|
endif()
|
|
|
|
|
2017-09-14 05:44:22 +00:00
|
|
|
if(MSVC OR MINGW)
|
2020-09-23 07:00:24 +00:00
|
|
|
target_link_libraries(zigstage1 LINK_PUBLIC version)
|
stage1 is now a hybrid of C++ and Zig
This modifies the build process of Zig to put all of the source files
into libcompiler.a, except main.cpp and userland.cpp.
Next, the build process links main.cpp, userland.cpp, and libcompiler.a
into zig1. userland.cpp is a shim for functions that will later be
replaced with self-hosted implementations.
Next, the build process uses zig1 to build src-self-hosted/stage1.zig
into libuserland.a, which does not depend on any of the things that
are shimmed in userland.cpp, such as translate-c.
Finally, the build process re-links main.cpp and libcompiler.a, except
with libuserland.a instead of userland.cpp. Now the shims are replaced
with .zig code. This provides all of the Zig standard library to the
stage1 C++ compiler, and enables us to move certain things to userland,
such as translate-c.
As a proof of concept I have made the `zig zen` command use text defined
in userland. I added `zig translate-c-2` which is a work-in-progress
reimplementation of translate-c in userland, which currently calls
`std.debug.panic("unimplemented")` and you can see the stack trace makes
it all the way back into the C++ main() function (Thanks LemonBoy for
improving that!).
This could potentially let us move other things into userland, such as
hashing algorithms, the entire cache system, .d file parsing, pretty
much anything that libuserland.a itself doesn't need to depend on.
This can also let us have `zig fmt` in stage1 without the overhead
of child process execution, and without the initial compilation delay
before it gets cached.
See #1964
2019-04-16 20:47:47 +00:00
|
|
|
endif()
|
|
|
|
|
2021-03-18 22:25:17 +00:00
|
|
|
if("${ZIG_EXECUTABLE}" STREQUAL "")
|
2022-08-20 05:06:15 +00:00
|
|
|
add_executable(zig1 ${ZIG1_SOURCES})
|
|
|
|
set_target_properties(zig1 PROPERTIES
|
2021-03-18 22:25:17 +00:00
|
|
|
COMPILE_FLAGS ${EXE_CFLAGS}
|
|
|
|
LINK_FLAGS ${EXE_LDFLAGS}
|
|
|
|
)
|
2022-08-20 05:06:15 +00:00
|
|
|
target_link_libraries(zig1 zigstage1)
|
2021-03-18 22:25:17 +00:00
|
|
|
endif()
|
stage1 is now a hybrid of C++ and Zig
This modifies the build process of Zig to put all of the source files
into libcompiler.a, except main.cpp and userland.cpp.
Next, the build process links main.cpp, userland.cpp, and libcompiler.a
into zig1. userland.cpp is a shim for functions that will later be
replaced with self-hosted implementations.
Next, the build process uses zig1 to build src-self-hosted/stage1.zig
into libuserland.a, which does not depend on any of the things that
are shimmed in userland.cpp, such as translate-c.
Finally, the build process re-links main.cpp and libcompiler.a, except
with libuserland.a instead of userland.cpp. Now the shims are replaced
with .zig code. This provides all of the Zig standard library to the
stage1 C++ compiler, and enables us to move certain things to userland,
such as translate-c.
As a proof of concept I have made the `zig zen` command use text defined
in userland. I added `zig translate-c-2` which is a work-in-progress
reimplementation of translate-c in userland, which currently calls
`std.debug.panic("unimplemented")` and you can see the stack trace makes
it all the way back into the C++ main() function (Thanks LemonBoy for
improving that!).
This could potentially let us move other things into userland, such as
hashing algorithms, the entire cache system, .d file parsing, pretty
much anything that libuserland.a itself doesn't need to depend on.
This can also let us have `zig fmt` in stage1 without the overhead
of child process execution, and without the initial compilation delay
before it gets cached.
See #1964
2019-04-16 20:47:47 +00:00
|
|
|
|
2019-07-12 23:28:28 +00:00
|
|
|
if(MSVC)
|
2022-08-20 05:06:15 +00:00
|
|
|
set(ZIG2_OBJECT "${CMAKE_BINARY_DIR}/zig2.obj")
|
stage1 is now a hybrid of C++ and Zig
This modifies the build process of Zig to put all of the source files
into libcompiler.a, except main.cpp and userland.cpp.
Next, the build process links main.cpp, userland.cpp, and libcompiler.a
into zig1. userland.cpp is a shim for functions that will later be
replaced with self-hosted implementations.
Next, the build process uses zig1 to build src-self-hosted/stage1.zig
into libuserland.a, which does not depend on any of the things that
are shimmed in userland.cpp, such as translate-c.
Finally, the build process re-links main.cpp and libcompiler.a, except
with libuserland.a instead of userland.cpp. Now the shims are replaced
with .zig code. This provides all of the Zig standard library to the
stage1 C++ compiler, and enables us to move certain things to userland,
such as translate-c.
As a proof of concept I have made the `zig zen` command use text defined
in userland. I added `zig translate-c-2` which is a work-in-progress
reimplementation of translate-c in userland, which currently calls
`std.debug.panic("unimplemented")` and you can see the stack trace makes
it all the way back into the C++ main() function (Thanks LemonBoy for
improving that!).
This could potentially let us move other things into userland, such as
hashing algorithms, the entire cache system, .d file parsing, pretty
much anything that libuserland.a itself doesn't need to depend on.
This can also let us have `zig fmt` in stage1 without the overhead
of child process execution, and without the initial compilation delay
before it gets cached.
See #1964
2019-04-16 20:47:47 +00:00
|
|
|
else()
|
2022-08-20 05:06:15 +00:00
|
|
|
set(ZIG2_OBJECT "${CMAKE_BINARY_DIR}/zig2.o")
|
2017-09-10 20:05:18 +00:00
|
|
|
endif()
|
2019-09-09 13:33:33 +00:00
|
|
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
2022-08-26 01:12:35 +00:00
|
|
|
set(ZIG_RELEASE_ARG "")
|
|
|
|
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
|
|
|
set(ZIG_RELEASE_ARG -Drelease)
|
2019-09-09 13:33:33 +00:00
|
|
|
else()
|
2022-08-26 01:12:35 +00:00
|
|
|
set(ZIG_RELEASE_ARG -Drelease -Dstrip)
|
2022-08-20 05:06:15 +00:00
|
|
|
endif()
|
|
|
|
if(ZIG_SKIP_INSTALL_LIB_FILES)
|
|
|
|
set(ZIG_SKIP_INSTALL_LIB_FILES_ARG "-Dskip-install-lib-files")
|
2019-09-09 13:33:33 +00:00
|
|
|
else()
|
2022-08-20 05:06:15 +00:00
|
|
|
set(ZIG_SKIP_INSTALL_LIB_FILES_ARG "-Dskip-install-lib-files=false")
|
2020-02-16 23:57:34 +00:00
|
|
|
endif()
|
2020-12-20 22:37:58 +00:00
|
|
|
if(ZIG_SINGLE_THREADED)
|
2022-08-20 05:06:15 +00:00
|
|
|
set(ZIG_SINGLE_THREADED_ARG "-fsingle-threaded")
|
2020-12-20 22:37:58 +00:00
|
|
|
else()
|
2022-08-20 05:06:15 +00:00
|
|
|
set(ZIG_SINGLE_THREADED_ARG "")
|
|
|
|
endif()
|
|
|
|
if(ZIG_STATIC)
|
|
|
|
set(ZIG_STATIC_ARG "-Duse-zig-libcxx")
|
2020-12-20 22:37:58 +00:00
|
|
|
else()
|
2022-08-20 05:06:15 +00:00
|
|
|
set(ZIG_STATIC_ARG "")
|
2020-12-20 22:37:58 +00:00
|
|
|
endif()
|
2020-01-18 00:39:43 +00:00
|
|
|
|
2022-08-20 05:06:15 +00:00
|
|
|
set(BUILD_ZIG2_ARGS
|
2020-09-22 01:38:55 +00:00
|
|
|
"src/stage1.zig"
|
2022-08-20 05:06:15 +00:00
|
|
|
--name zig2
|
2021-06-14 18:33:27 +00:00
|
|
|
--zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
|
2022-08-20 05:06:15 +00:00
|
|
|
"-femit-bin=${ZIG2_OBJECT}"
|
2021-07-22 23:37:38 +00:00
|
|
|
-fcompiler-rt
|
2022-08-26 01:12:35 +00:00
|
|
|
${ZIG_SINGLE_THREADED_ARG}
|
|
|
|
-target "${ZIG_TARGET_TRIPLE}"
|
|
|
|
-mcpu "${ZIG_TARGET_MCPU}"
|
2020-02-16 23:57:34 +00:00
|
|
|
-lc
|
2020-12-08 00:23:17 +00:00
|
|
|
--pkg-begin build_options "${ZIG_CONFIG_ZIG_OUT}"
|
2020-08-18 00:06:23 +00:00
|
|
|
--pkg-end
|
2022-05-07 02:22:40 +00:00
|
|
|
--pkg-begin compiler_rt "${CMAKE_SOURCE_DIR}/lib/compiler_rt.zig"
|
delete all stage1 c++ code not directly related to compiling stage2
Deleted 16,000+ lines of c++ code, including:
* an implementation of blake hashing
* the cache hash system
* compiler.cpp
* all the linking code, and everything having to do with building
glibc, musl, and mingw-w64
* much of the stage1 compiler internals got slimmed down since it
now assumes it is always outputting an object file.
More stuff:
* stage1 is now built with a different strategy: we have a tiny
zig0.cpp which is a slimmed down version of what stage1 main.cpp used
to be. Its only purpose is to build stage2 zig code into an object
file, which is then linked by the host build system (cmake) into
stage1. zig0.cpp uses the same C API that stage2 now has access to,
so that stage2 zig code can call into stage1 c++ code.
- stage1.h is
- stage2.h is
- stage1.zig is the main entry point for the Zig/C++
hybrid compiler. It has the functions exported from Zig, called
in C++, and bindings for the functions exported from C++, called
from Zig.
* removed the memory profiling instrumentation from stage1.
Abandon ship!
* Re-added the sections to the README about how to build stage2 and
stage3.
* stage2 now knows as a comptime boolean whether it is being compiled
as part of stage1 or as stage2.
- TODO use this flag to call into stage1 for compiling zig code.
* introduce -fdll-export-fns and -fno-dll-export-fns and clarify
its relationship to link_mode (static/dynamic)
* implement depending on LLVM to detect native target cpu features when
LLVM extensions are enabled and zig lacks CPU feature detection for
that target architecture.
* C importing is broken, will need some stage2 support to function
again.
2020-09-18 01:29:38 +00:00
|
|
|
--pkg-end
|
2020-01-18 00:39:43 +00:00
|
|
|
)
|
|
|
|
|
2020-10-26 17:50:43 +00:00
|
|
|
if("${ZIG_EXECUTABLE}" STREQUAL "")
|
2020-11-11 15:12:17 +00:00
|
|
|
add_custom_command(
|
2022-08-20 05:06:15 +00:00
|
|
|
OUTPUT "${ZIG2_OBJECT}"
|
|
|
|
COMMAND zig1 ${BUILD_ZIG2_ARGS}
|
|
|
|
DEPENDS zig1 "${ZIG_STAGE2_SOURCES}"
|
|
|
|
COMMENT STATUS "Building stage2 object ${ZIG2_OBJECT}"
|
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
2020-03-28 03:43:21 +00:00
|
|
|
)
|
2020-04-11 20:18:54 +00:00
|
|
|
if (WIN32)
|
2022-10-01 16:58:09 +00:00
|
|
|
set(ZIG_EXECUTABLE "${CMAKE_BINARY_DIR}/zig2.exe")
|
2022-08-20 05:06:15 +00:00
|
|
|
else()
|
2022-10-01 16:58:09 +00:00
|
|
|
set(ZIG_EXECUTABLE "${CMAKE_BINARY_DIR}/zig2")
|
2020-04-11 20:18:54 +00:00
|
|
|
endif()
|
2020-03-28 03:43:21 +00:00
|
|
|
else()
|
2020-11-11 15:12:17 +00:00
|
|
|
add_custom_command(
|
2022-08-20 05:06:15 +00:00
|
|
|
OUTPUT "${ZIG2_OBJECT}"
|
|
|
|
COMMAND "${ZIG_EXECUTABLE}" "build-obj" ${BUILD_ZIG2_ARGS}
|
|
|
|
DEPENDS ${ZIG_STAGE2_SOURCES}
|
|
|
|
COMMENT STATUS "Building stage2 component ${ZIG2_OBJECT}"
|
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
2020-03-28 03:43:21 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
delete all stage1 c++ code not directly related to compiling stage2
Deleted 16,000+ lines of c++ code, including:
* an implementation of blake hashing
* the cache hash system
* compiler.cpp
* all the linking code, and everything having to do with building
glibc, musl, and mingw-w64
* much of the stage1 compiler internals got slimmed down since it
now assumes it is always outputting an object file.
More stuff:
* stage1 is now built with a different strategy: we have a tiny
zig0.cpp which is a slimmed down version of what stage1 main.cpp used
to be. Its only purpose is to build stage2 zig code into an object
file, which is then linked by the host build system (cmake) into
stage1. zig0.cpp uses the same C API that stage2 now has access to,
so that stage2 zig code can call into stage1 c++ code.
- stage1.h is
- stage2.h is
- stage1.zig is the main entry point for the Zig/C++
hybrid compiler. It has the functions exported from Zig, called
in C++, and bindings for the functions exported from C++, called
from Zig.
* removed the memory profiling instrumentation from stage1.
Abandon ship!
* Re-added the sections to the README about how to build stage2 and
stage3.
* stage2 now knows as a comptime boolean whether it is being compiled
as part of stage1 or as stage2.
- TODO use this flag to call into stage1 for compiling zig code.
* introduce -fdll-export-fns and -fno-dll-export-fns and clarify
its relationship to link_mode (static/dynamic)
* implement depending on LLVM to detect native target cpu features when
LLVM extensions are enabled and zig lacks CPU feature detection for
that target architecture.
* C importing is broken, will need some stage2 support to function
again.
2020-09-18 01:29:38 +00:00
|
|
|
# cmake won't let us configure an executable without C sources.
|
2022-08-20 05:06:15 +00:00
|
|
|
add_executable(zig2 "${CMAKE_SOURCE_DIR}/src/stage1/empty.cpp" "${ZIG2_OBJECT}")
|
2019-07-12 23:28:28 +00:00
|
|
|
|
2022-08-20 05:06:15 +00:00
|
|
|
set_target_properties(zig2 PROPERTIES
|
stage1 is now a hybrid of C++ and Zig
This modifies the build process of Zig to put all of the source files
into libcompiler.a, except main.cpp and userland.cpp.
Next, the build process links main.cpp, userland.cpp, and libcompiler.a
into zig1. userland.cpp is a shim for functions that will later be
replaced with self-hosted implementations.
Next, the build process uses zig1 to build src-self-hosted/stage1.zig
into libuserland.a, which does not depend on any of the things that
are shimmed in userland.cpp, such as translate-c.
Finally, the build process re-links main.cpp and libcompiler.a, except
with libuserland.a instead of userland.cpp. Now the shims are replaced
with .zig code. This provides all of the Zig standard library to the
stage1 C++ compiler, and enables us to move certain things to userland,
such as translate-c.
As a proof of concept I have made the `zig zen` command use text defined
in userland. I added `zig translate-c-2` which is a work-in-progress
reimplementation of translate-c in userland, which currently calls
`std.debug.panic("unimplemented")` and you can see the stack trace makes
it all the way back into the C++ main() function (Thanks LemonBoy for
improving that!).
This could potentially let us move other things into userland, such as
hashing algorithms, the entire cache system, .d file parsing, pretty
much anything that libuserland.a itself doesn't need to depend on.
This can also let us have `zig fmt` in stage1 without the overhead
of child process execution, and without the initial compilation delay
before it gets cached.
See #1964
2019-04-16 20:47:47 +00:00
|
|
|
COMPILE_FLAGS ${EXE_CFLAGS}
|
|
|
|
LINK_FLAGS ${EXE_LDFLAGS}
|
|
|
|
)
|
2022-08-20 05:06:15 +00:00
|
|
|
target_link_libraries(zig2 zigstage1)
|
2019-10-21 23:17:33 +00:00
|
|
|
if(MSVC)
|
2022-08-20 05:06:15 +00:00
|
|
|
target_link_libraries(zig2 ntdll.lib)
|
2020-03-28 03:43:21 +00:00
|
|
|
elseif(MINGW)
|
2022-08-20 05:06:15 +00:00
|
|
|
target_link_libraries(zig2 ntdll)
|
2019-10-21 23:17:33 +00:00
|
|
|
endif()
|
2020-01-18 00:39:43 +00:00
|
|
|
|
2022-10-16 19:46:39 +00:00
|
|
|
set(ZIG_BUILD_ARGS
|
2022-08-20 05:06:15 +00:00
|
|
|
--zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
|
|
|
|
"-Dconfig_h=${ZIG_CONFIG_H_OUT}"
|
|
|
|
"-Denable-llvm"
|
|
|
|
"-Denable-stage1"
|
2022-08-26 01:12:35 +00:00
|
|
|
${ZIG_RELEASE_ARG}
|
|
|
|
${ZIG_STATIC_ARG}
|
|
|
|
${ZIG_SKIP_INSTALL_LIB_FILES_ARG}
|
|
|
|
${ZIG_SINGLE_THREADED_ARG}
|
2022-08-20 05:06:15 +00:00
|
|
|
"-Dtarget=${ZIG_TARGET_TRIPLE}"
|
|
|
|
"-Dcpu=${ZIG_TARGET_MCPU}"
|
2022-09-13 03:13:00 +00:00
|
|
|
"-Dversion-string=${ZIG_VERSION}"
|
2022-08-20 05:06:15 +00:00
|
|
|
)
|
2020-02-16 23:57:34 +00:00
|
|
|
|
2022-08-20 05:06:15 +00:00
|
|
|
add_custom_target(stage3 ALL
|
2022-10-16 19:46:39 +00:00
|
|
|
COMMAND zig2 build compile ${ZIG_BUILD_ARGS}
|
2022-08-20 05:06:15 +00:00
|
|
|
DEPENDS zig2
|
|
|
|
COMMENT STATUS "Building stage3"
|
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
)
|
2022-10-01 16:58:09 +00:00
|
|
|
|
|
|
|
install(CODE "set(ZIG_EXECUTABLE \"${ZIG_EXECUTABLE}\")")
|
|
|
|
install(CODE "set(ZIG_BUILD_ARGS \"${ZIG_BUILD_ARGS}\")")
|
|
|
|
install(CODE "set(CMAKE_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")")
|
|
|
|
install(CODE "set(CMAKE_SOURCE_DIR \"${CMAKE_SOURCE_DIR}\")")
|
|
|
|
install(SCRIPT "${CMAKE_SOURCE_DIR}/cmake/install.cmake")
|