mirror of
https://github.com/Relintai/osxcross.git
synced 2025-02-03 22:45:56 +01:00
Revert "wrap dsymutil to llvm-dsymutil (#1)"
This reverts commit 7e9f856e6a
.
it's too early, llvm-dsymutil still has a lot of issues
This commit is contained in:
parent
7e9f856e6a
commit
7734f4f0ed
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
changed:
|
changed:
|
||||||
* improved and colorized wrapper error/warning/debug/info messages
|
* improved and colorized wrapper error/warning/debug/info messages
|
||||||
* dsymutil is now wrapped to llvm-dsymutil (LLVM >= 3.7 only)
|
|
||||||
|
|
||||||
added:
|
added:
|
||||||
* support for ccache symlinks
|
* support for ccache symlinks
|
||||||
|
@ -43,8 +43,7 @@ SRCS= \
|
|||||||
programs/osxcross-conf.cpp \
|
programs/osxcross-conf.cpp \
|
||||||
programs/osxcross-cmp.cpp \
|
programs/osxcross-cmp.cpp \
|
||||||
programs/sw_vers.cpp \
|
programs/sw_vers.cpp \
|
||||||
programs/pkg-config.cpp \
|
programs/pkg-config.cpp
|
||||||
programs/dsymutil.cpp
|
|
||||||
|
|
||||||
OBJS=$(subst .cpp,.o,$(SRCS))
|
OBJS=$(subst .cpp,.o,$(SRCS))
|
||||||
|
|
||||||
|
@ -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 <unistd.h>
|
|
||||||
#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
|
|
@ -75,7 +75,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
int sw_vers(int argc, char **argv, target::Target &target);
|
int sw_vers(int argc, char **argv, target::Target &target);
|
||||||
int dsymutil(int argc, char **argv);
|
|
||||||
|
|
||||||
namespace osxcross {
|
namespace osxcross {
|
||||||
int version();
|
int version();
|
||||||
@ -88,7 +87,7 @@ int pkg_config(int argc, char **argv, Target &target);
|
|||||||
static int dummy() { return 0; }
|
static int dummy() { return 0; }
|
||||||
|
|
||||||
constexpr prog programs[] = { { "sw_vers", sw_vers },
|
constexpr prog programs[] = { { "sw_vers", sw_vers },
|
||||||
{ "dsymutil", dsymutil },
|
{ "dsymutil", dummy },
|
||||||
{ "osxcross", osxcross::version },
|
{ "osxcross", osxcross::version },
|
||||||
{ "osxcross-env", osxcross::env },
|
{ "osxcross-env", osxcross::env },
|
||||||
{ "osxcross-conf", osxcross::conf },
|
{ "osxcross-conf", osxcross::conf },
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstdio>
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <climits>
|
#include <climits>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@ -444,36 +443,6 @@ const char *getFileExtension(const char *file) {
|
|||||||
return p;
|
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
|
// Time
|
||||||
//
|
//
|
||||||
|
@ -163,14 +163,6 @@ inline const char *getFileExtension(const std::string &file) {
|
|||||||
return getFileExtension(file.c_str());
|
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
|
// Time
|
||||||
//
|
//
|
||||||
@ -283,13 +275,10 @@ static_assert(OSVersion(10, 6) != OSVersion(10, 5), "");
|
|||||||
OSVersion parseOSVersion(const char *OSVer);
|
OSVersion parseOSVersion(const char *OSVer);
|
||||||
|
|
||||||
typedef OSVersion GCCVersion;
|
typedef OSVersion GCCVersion;
|
||||||
static const auto &parseGCCVersion = parseOSVersion;
|
#define parseGCCVersion parseOSVersion
|
||||||
|
|
||||||
typedef OSVersion ClangVersion;
|
typedef OSVersion ClangVersion;
|
||||||
static const auto &parseClangVersion = parseOSVersion;
|
#define parseClangVersion parseOSVersion
|
||||||
|
|
||||||
typedef OSVersion LLVMVersion;
|
|
||||||
static const auto &parseLLVMVersion = parseOSVersion;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// OS Compat
|
// OS Compat
|
||||||
|
Loading…
Reference in New Issue
Block a user