diff --git a/CHANGELOG b/CHANGELOG index 1cec3d4..05efaa3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,7 +2,6 @@ changed: * improved and colorized wrapper error/warning/debug/info messages -* dsymutil is now wrapped to llvm-dsymutil (LLVM >= 3.7 only) added: * support for ccache symlinks diff --git a/wrapper/Makefile b/wrapper/Makefile index 7ab36f6..de59a58 100644 --- a/wrapper/Makefile +++ b/wrapper/Makefile @@ -43,8 +43,7 @@ SRCS= \ programs/osxcross-conf.cpp \ programs/osxcross-cmp.cpp \ programs/sw_vers.cpp \ - programs/pkg-config.cpp \ - programs/dsymutil.cpp + programs/pkg-config.cpp OBJS=$(subst .cpp,.o,$(SRCS)) diff --git a/wrapper/programs/dsymutil.cpp b/wrapper/programs/dsymutil.cpp deleted file mode 100644 index ca7cb01..0000000 --- a/wrapper/programs/dsymutil.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/*********************************************************************** - * OSXCross Compiler Wrapper * - * Copyright (C) 2014, 2015 by Thomas Poechtrager * - * t.poechtrager@gmail.com * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***********************************************************************/ - -#include "proginc.h" - -#ifndef _WIN32 -#include -#endif - -using namespace tools; - -namespace program { - -int dsymutil(int argc, char **argv) { - (void)argc; - - std::string dsymutil; - char llvmveroutput[1024]; - const char *verstr; - LLVMVersion llvmver; - - if (!realPath("llvm-dsymutil", dsymutil)) - return 0; - - std::string command = dsymutil + " -version"; - - if (runcommand(command.c_str(), llvmveroutput, sizeof(llvmveroutput)) == - RUNCOMMAND_ERROR) - return 0; - - verstr = strstr(llvmveroutput, "LLVM version "); - - if (!verstr) - return 0; - - verstr += 13; // strlen("LLVM version "); - - llvmver = parseLLVMVersion(verstr); - - // LLVM <= 3.6 is too old - if (llvmver <= LLVMVersion(3, 6)) - return 0; - - if (execvp(dsymutil.c_str(), argv)) - err << "cannot execute '" << dsymutil << "'" << err.endl(); - - return 1; -} - -} // namespace program diff --git a/wrapper/progs.h b/wrapper/progs.h index 1a6bb1b..d62cbfb 100644 --- a/wrapper/progs.h +++ b/wrapper/progs.h @@ -75,7 +75,6 @@ private: }; int sw_vers(int argc, char **argv, target::Target &target); -int dsymutil(int argc, char **argv); namespace osxcross { int version(); @@ -88,7 +87,7 @@ int pkg_config(int argc, char **argv, Target &target); static int dummy() { return 0; } constexpr prog programs[] = { { "sw_vers", sw_vers }, - { "dsymutil", dsymutil }, + { "dsymutil", dummy }, { "osxcross", osxcross::version }, { "osxcross-env", osxcross::env }, { "osxcross-conf", osxcross::conf }, diff --git a/wrapper/tools.cpp b/wrapper/tools.cpp index f76e9b6..1f87308 100644 --- a/wrapper/tools.cpp +++ b/wrapper/tools.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -444,36 +443,6 @@ const char *getFileExtension(const char *file) { return p; } -// -// Shell Commands -// - -size_t runcommand(const char *command, char *buf, size_t len) { -#define RETURN(v) \ - do { \ - if (p) \ - pclose(p); \ - return (v); \ - } while (0) - - if (!len) - return RUNCOMMAND_ERROR; - - FILE *p; - size_t outputlen; - - if (!(p = popen(command, "r"))) - RETURN(RUNCOMMAND_ERROR); - - if (!(outputlen = fread(buf, sizeof(char), len - 1, p))) - RETURN(RUNCOMMAND_ERROR); - - buf[outputlen] = '\0'; - - RETURN(outputlen); -#undef RETURN -} - // // Time // diff --git a/wrapper/tools.h b/wrapper/tools.h index 541863e..ddf87ee 100644 --- a/wrapper/tools.h +++ b/wrapper/tools.h @@ -163,14 +163,6 @@ inline const char *getFileExtension(const std::string &file) { return getFileExtension(file.c_str()); } -// -// Shell Commands -// - -constexpr size_t RUNCOMMAND_ERROR = -1; - -size_t runcommand(const char *command, char *buf, size_t len); - // // Time // @@ -283,13 +275,10 @@ static_assert(OSVersion(10, 6) != OSVersion(10, 5), ""); OSVersion parseOSVersion(const char *OSVer); typedef OSVersion GCCVersion; -static const auto &parseGCCVersion = parseOSVersion; +#define parseGCCVersion parseOSVersion typedef OSVersion ClangVersion; -static const auto &parseClangVersion = parseOSVersion; - -typedef OSVersion LLVMVersion; -static const auto &parseLLVMVersion = parseOSVersion; +#define parseClangVersion parseOSVersion // // OS Compat