diff --git a/CMakeLists.txt b/CMakeLists.txt index 85b2787a09..d3c10128de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,26 +197,6 @@ set(ZIG_SOURCES "${CMAKE_SOURCE_DIR}/src/zig_llvm.cpp" ) -set(ZIG_HOST_LINK_VERSION) -if (APPLE) - set(LD_V_OUTPUT) - execute_process( - COMMAND sh -c "${CMAKE_LINKER} -v 2>&1 | head -1" - RESULT_VARIABLE HAD_ERROR - OUTPUT_VARIABLE LD_V_OUTPUT - ) - if (NOT HAD_ERROR) - if ("${LD_V_OUTPUT}" MATCHES ".*ld64-([0-9.]+).*") - string(REGEX REPLACE ".*ld64-([0-9.]+).*" "\\1" ZIG_HOST_LINK_VERSION ${LD_V_OUTPUT}) - elseif ("${LD_V_OUTPUT}" MATCHES "[^0-9]*([0-9.]+).*") - string(REGEX REPLACE "[^0-9]*([0-9.]+).*" "\\1" ZIG_HOST_LINK_VERSION ${LD_V_OUTPUT}) - endif() - else() - message(FATAL_ERROR "${CMAKE_LINKER} failed with status ${HAD_ERROR}") - endif() -endif() - - set(C_HEADERS_DEST "lib/zig/include") set(ZIG_STD_DEST "lib/zig/std") set(CONFIGURE_OUT_FILE "${CMAKE_BINARY_DIR}/config.h") diff --git a/src/all_types.hpp b/src/all_types.hpp index 834024e5cf..01d14a75f7 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -1465,7 +1465,6 @@ struct CodeGen { bool windows_subsystem_windows; bool windows_subsystem_console; bool windows_linker_unicode; - Buf *darwin_linker_version; Buf *mmacosx_version_min; Buf *mios_version_min; bool linker_rdynamic; diff --git a/src/codegen.cpp b/src/codegen.cpp index 7ca8abfc5d..61ec3260d1 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -108,7 +108,6 @@ CodeGen *codegen_create(Buf *root_src_path, const ZigTarget *target, OutType out g->libc_lib_dir = buf_create_from_str(""); g->libc_static_lib_dir = buf_create_from_str(""); g->libc_include_dir = buf_create_from_str(""); - g->darwin_linker_version = buf_create_from_str(""); g->each_lib_rpath = false; } else { // native compilation, we can rely on the configuration stuff @@ -119,7 +118,6 @@ CodeGen *codegen_create(Buf *root_src_path, const ZigTarget *target, OutType out g->libc_lib_dir = buf_create_from_str(ZIG_LIBC_LIB_DIR); g->libc_static_lib_dir = buf_create_from_str(ZIG_LIBC_STATIC_LIB_DIR); g->libc_include_dir = buf_create_from_str(ZIG_LIBC_INCLUDE_DIR); - g->darwin_linker_version = buf_create_from_str(ZIG_HOST_LINK_VERSION); #ifdef ZIG_EACH_LIB_RPATH g->each_lib_rpath = true; #endif @@ -251,10 +249,6 @@ void codegen_set_windows_unicode(CodeGen *g, bool municode) { g->windows_linker_unicode = municode; } -void codegen_set_mlinker_version(CodeGen *g, Buf *darwin_linker_version) { - g->darwin_linker_version = darwin_linker_version; -} - void codegen_set_mmacosx_version_min(CodeGen *g, Buf *mmacosx_version_min) { g->mmacosx_version_min = mmacosx_version_min; } diff --git a/src/codegen.hpp b/src/codegen.hpp index 0a4b2db09e..74f3be1658 100644 --- a/src/codegen.hpp +++ b/src/codegen.hpp @@ -36,7 +36,6 @@ void codegen_add_lib_dir(CodeGen *codegen, const char *dir); LinkLib *codegen_add_link_lib(CodeGen *codegen, Buf *lib); void codegen_add_framework(CodeGen *codegen, const char *name); void codegen_add_rpath(CodeGen *codegen, const char *name); -void codegen_set_mlinker_version(CodeGen *g, Buf *darwin_linker_version); void codegen_set_rdynamic(CodeGen *g, bool rdynamic); void codegen_set_mmacosx_version_min(CodeGen *g, Buf *mmacosx_version_min); void codegen_set_mios_version_min(CodeGen *g, Buf *mios_version_min); diff --git a/src/config.h.in b/src/config.h.in index 1018ec4e78..7fec876dc0 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -19,7 +19,6 @@ #define ZIG_LIBC_LIB_DIR "@ZIG_LIBC_LIB_DIR@" #define ZIG_LIBC_STATIC_LIB_DIR "@ZIG_LIBC_STATIC_LIB_DIR@" #define ZIG_DYNAMIC_LINKER "@ZIG_DYNAMIC_LINKER@" -#define ZIG_HOST_LINK_VERSION "@ZIG_HOST_LINK_VERSION@" #cmakedefine ZIG_EACH_LIB_RPATH #cmakedefine ZIG_LLVM_OLD_CXX_ABI diff --git a/src/main.cpp b/src/main.cpp index df25555381..b3fa234740 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -68,7 +68,6 @@ static int usage(const char *arg0) { " -municode (windows) link with unicode\n" " -framework [name] (darwin) link against framework\n" " -mios-version-min [ver] (darwin) set iOS deployment target\n" - " -mlinker-version [ver] (darwin) override linker version\n" " -mmacosx-version-min [ver] (darwin) set Mac OS X deployment target\n" " --ver-major [ver] dynamic library semver major version\n" " --ver-minor [ver] dynamic library semver minor version\n" @@ -199,7 +198,6 @@ int main(int argc, char **argv) { bool mwindows = false; bool mconsole = false; bool municode = false; - const char *mlinker_version = nullptr; bool rdynamic = false; const char *mmacosx_version_min = nullptr; const char *mios_version_min = nullptr; @@ -433,8 +431,6 @@ int main(int argc, char **argv) { target_os = argv[i]; } else if (strcmp(arg, "--target-environ") == 0) { target_environ = argv[i]; - } else if (strcmp(arg, "-mlinker-version") == 0) { - mlinker_version = argv[i]; } else if (strcmp(arg, "-mmacosx-version-min") == 0) { mmacosx_version_min = argv[i]; } else if (strcmp(arg, "-mios-version-min") == 0) { @@ -632,9 +628,6 @@ int main(int argc, char **argv) { codegen_set_windows_subsystem(g, mwindows, mconsole); codegen_set_windows_unicode(g, municode); codegen_set_rdynamic(g, rdynamic); - if (mlinker_version) { - codegen_set_mlinker_version(g, buf_create_from_str(mlinker_version)); - } if (mmacosx_version_min && mios_version_min) { fprintf(stderr, "-mmacosx-version-min and -mios-version-min options not allowed together\n"); return EXIT_FAILURE;