diff --git a/CMakeLists.txt b/CMakeLists.txt index b990261d08..a9dec50193 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -434,8 +434,8 @@ find_package(Threads) # CMake doesn't let us create an empty executable, so we hang on to this one separately. set(ZIG_MAIN_SRC "${CMAKE_SOURCE_DIR}/src/main.cpp") -# This is our shim which will be replaced by libuserland written in Zig. -set(ZIG0_SHIM_SRC "${CMAKE_SOURCE_DIR}/src/userland.cpp") +# This is our shim which will be replaced by libstage2 written in Zig. +set(ZIG0_SHIM_SRC "${CMAKE_SOURCE_DIR}/src/stage2.cpp") if(ZIG_ENABLE_MEM_PROFILE) set(ZIG_SOURCES_MEM_PROFILE "${CMAKE_SOURCE_DIR}/src/mem_profile.cpp") @@ -599,38 +599,38 @@ set_target_properties(zig0 PROPERTIES target_link_libraries(zig0 compiler) if(MSVC) - set(LIBUSERLAND "${CMAKE_BINARY_DIR}/userland.lib") + set(LIBSTAGE2 "${CMAKE_BINARY_DIR}/stage2.lib") else() - set(LIBUSERLAND "${CMAKE_BINARY_DIR}/libuserland.a") + set(LIBSTAGE2 "${CMAKE_BINARY_DIR}/libstage2.a") endif() if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - set(LIBUSERLAND_RELEASE_ARG "") + set(LIBSTAGE2_RELEASE_ARG "") else() - set(LIBUSERLAND_RELEASE_ARG --release-fast --strip) + set(LIBSTAGE2_RELEASE_ARG --release-fast --strip) endif() if(WIN32) - set(LIBUSERLAND_WINDOWS_ARGS "-lntdll") + set(LIBSTAGE2_WINDOWS_ARGS "-lntdll") else() - set(LIBUSERLAND_WINDOWS_ARGS "") + set(LIBSTAGE2_WINDOWS_ARGS "") endif() -set(BUILD_LIBUSERLAND_ARGS "build-lib" +set(BUILD_LIBSTAGE2_ARGS "build-lib" --override-lib-dir "${CMAKE_SOURCE_DIR}/lib" --cache on --output-dir "${CMAKE_BINARY_DIR}" - ${LIBUSERLAND_RELEASE_ARG} - "src-self-hosted/stage1.zig" + ${LIBSTAGE2_RELEASE_ARG} + "src-self-hosted/stage2.zig" --disable-gen-h --bundle-compiler-rt -fPIC -lc - ${LIBUSERLAND_WINDOWS_ARGS} + ${LIBSTAGE2_WINDOWS_ARGS} ) -add_custom_target(zig_build_libuserland ALL - COMMAND zig0 ${BUILD_LIBUSERLAND_ARGS} +add_custom_target(zig_build_libstage2 ALL + COMMAND zig0 ${BUILD_LIBSTAGE2_ARGS} DEPENDS zig0 - BYPRODUCTS "${LIBUSERLAND}" + BYPRODUCTS "${LIBSTAGE2}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ) add_executable(zig "${ZIG_MAIN_SRC}") @@ -639,13 +639,13 @@ set_target_properties(zig PROPERTIES COMPILE_FLAGS ${EXE_CFLAGS} LINK_FLAGS ${EXE_LDFLAGS} ) -target_link_libraries(zig compiler "${LIBUSERLAND}") +target_link_libraries(zig compiler "${LIBSTAGE2}") if(MSVC) target_link_libraries(zig ntdll.lib) elseif(MINGW) target_link_libraries(zig ntdll) endif() -add_dependencies(zig zig_build_libuserland) +add_dependencies(zig zig_build_libstage2) install(TARGETS zig DESTINATION bin) diff --git a/cmake/install.cmake b/cmake/install.cmake index e485652a05..386773e30c 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -19,9 +19,9 @@ if(_result) message(":: ERROR: ${_result}") message(":: (execute_process)") - string(REPLACE ";" " " s_INSTALL_LIBUSERLAND_ARGS "${ZIG_INSTALL_ARGS}") + string(REPLACE ";" " " s_INSTALL_LIBSTAGE2_ARGS "${ZIG_INSTALL_ARGS}") message("::") - message(":: argv: ${zig_EXE} ${s_INSTALL_LIBUSERLAND_ARGS}") + message(":: argv: ${zig_EXE} ${s_INSTALL_LIBSTAGE2_ARGS}") set(_args ${zig_EXE} ${ZIG_INSTALL_ARGS}) list(LENGTH _args _len) diff --git a/src-self-hosted/stage1.zig b/src-self-hosted/stage2.zig similarity index 100% rename from src-self-hosted/stage1.zig rename to src-self-hosted/stage2.zig diff --git a/src/cache_hash.cpp b/src/cache_hash.cpp index 714b9b4c18..35b05a1ddf 100644 --- a/src/cache_hash.cpp +++ b/src/cache_hash.cpp @@ -5,7 +5,7 @@ * See http://opensource.org/licenses/MIT */ -#include "userland.h" +#include "stage2.h" #include "cache_hash.hpp" #include "all_types.hpp" #include "buffer.hpp" diff --git a/src/codegen.cpp b/src/codegen.cpp index 22d76c1372..0b5d2e82f1 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -18,7 +18,7 @@ #include "target.hpp" #include "util.hpp" #include "zig_llvm.h" -#include "userland.h" +#include "stage2.h" #include "dump_analysis.hpp" #include "softfloat.hpp" #include "mem_profile.hpp" diff --git a/src/codegen.hpp b/src/codegen.hpp index 623ae12fef..f8be29494a 100644 --- a/src/codegen.hpp +++ b/src/codegen.hpp @@ -11,7 +11,7 @@ #include "parser.hpp" #include "errmsg.hpp" #include "target.hpp" -#include "userland.h" +#include "stage2.h" #include diff --git a/src/error.hpp b/src/error.hpp index 3ff36e1a5f..90772df108 100644 --- a/src/error.hpp +++ b/src/error.hpp @@ -8,7 +8,7 @@ #ifndef ERROR_HPP #define ERROR_HPP -#include "userland.h" +#include "stage2.h" const char *err_str(Error err); diff --git a/src/main.cpp b/src/main.cpp index 4f5367be7b..df6e07a5a7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,7 +14,7 @@ #include "heap.hpp" #include "os.hpp" #include "target.hpp" -#include "userland.h" +#include "stage2.h" #include "glibc.hpp" #include "dump_analysis.hpp" #include "mem_profile.hpp" diff --git a/src/userland.cpp b/src/stage2.cpp similarity index 99% rename from src/userland.cpp rename to src/stage2.cpp index 2be97f22d6..db4f529c68 100644 --- a/src/userland.cpp +++ b/src/stage2.cpp @@ -1,7 +1,7 @@ // This file is a shim for zig1. The real implementations of these are in // src-self-hosted/stage1.zig -#include "userland.h" +#include "stage2.h" #include "util.hpp" #include "zig_llvm.h" #include diff --git a/src/userland.h b/src/stage2.h similarity index 98% rename from src/userland.h rename to src/stage2.h index 7903dc8fe4..f6bb17c884 100644 --- a/src/userland.h +++ b/src/stage2.h @@ -5,8 +5,8 @@ * See http://opensource.org/licenses/MIT */ -#ifndef ZIG_USERLAND_H -#define ZIG_USERLAND_H +#ifndef ZIG_STAGE2_H +#define ZIG_STAGE2_H #include #include @@ -25,7 +25,7 @@ #endif // ABI warning: the types and declarations in this file must match both those in -// userland.cpp and src-self-hosted/stage1.zig. +// stage2.cpp and src-self-hosted/stage2.zig. // ABI warning enum Error { diff --git a/src/util.cpp b/src/util.cpp index 56f1de9839..2de09df808 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6,7 +6,7 @@ */ #include "util.hpp" -#include "userland.h" +#include "stage2.h" #include #include diff --git a/src/zig_clang.h b/src/zig_clang.h index f7de9c2cee..2d9485ae9b 100644 --- a/src/zig_clang.h +++ b/src/zig_clang.h @@ -8,7 +8,7 @@ #ifndef ZIG_ZIG_CLANG_H #define ZIG_ZIG_CLANG_H -#include "userland.h" +#include "stage2.h" #include #include