mirror of
https://github.com/Relintai/osxcross.git
synced 2025-03-09 07:46:59 +01:00
fix finding intrinsic headers on freebsd
fix an unwind issue with gcc + OS X <= 10.5
This commit is contained in:
parent
59f5a220b7
commit
ef6bfe6952
@ -46,7 +46,7 @@ if [ -n "$BWPLATFORM" ]; then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
PLATFORM=$(uname -s)
|
PLATFORM=$(uname -s)
|
||||||
FLAGS="-march=native "
|
FLAGS="-march=native $CXXFLAGS "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$BWCXX" ]; then
|
if [ -n "$BWCXX" ]; then
|
||||||
|
@ -255,6 +255,11 @@ void concatEnvVariable(const char *var, const std::string val) {
|
|||||||
setenv(var, nval.c_str(), 1);
|
setenv(var, nval.c_str(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool fileExists(const std::string &dir) {
|
||||||
|
struct stat st;
|
||||||
|
return !stat(dir.c_str(), &st);
|
||||||
|
}
|
||||||
|
|
||||||
bool dirExists(const std::string &dir) {
|
bool dirExists(const std::string &dir) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
return !stat(dir.c_str(), &st) && S_ISDIR(st.st_mode);
|
return !stat(dir.c_str(), &st) && S_ISDIR(st.st_mode);
|
||||||
@ -832,13 +837,31 @@ struct Target {
|
|||||||
static std::stringstream tmp;
|
static std::stringstream tmp;
|
||||||
tmp.str(std::string());
|
tmp.str(std::string());
|
||||||
|
|
||||||
|
auto checkDir = [&](std::stringstream &dir)
|
||||||
|
{
|
||||||
|
static std::string intrindir;
|
||||||
|
auto &file = dir;
|
||||||
|
|
||||||
|
intrindir = dir.str();
|
||||||
|
file << "/xmmintrin.h";
|
||||||
|
|
||||||
|
if (fileExists(file.str())) {
|
||||||
|
if (cv > clangversion) {
|
||||||
|
clangversion = cv;
|
||||||
|
pathtmp.swap(intrindir);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
tmp << dir.str() << "/" << file << "/include";
|
tmp << dir.str() << "/" << file << "/include";
|
||||||
|
|
||||||
if (dirExists(tmp.str())) {
|
if (!checkDir(tmp)) {
|
||||||
if (cv > clangversion) {
|
tmp.str(std::string());
|
||||||
clangversion = cv;
|
tmp << dir.str() << "/" << file;
|
||||||
pathtmp = tmp.str();
|
checkDir(tmp);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1176,6 +1199,9 @@ struct Target {
|
|||||||
fargs.push_back("-static-libgcc");
|
fargs.push_back("-static-libgcc");
|
||||||
fargs.push_back("-static-libstdc++");
|
fargs.push_back("-static-libstdc++");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OSNum <= OSVersion(10, 5))
|
||||||
|
fargs.push_back("-Wl,-no_compact_unwind");
|
||||||
}
|
}
|
||||||
|
|
||||||
auto addCXXHeaderPath = [&](const std::string &path) {
|
auto addCXXHeaderPath = [&](const std::string &path) {
|
||||||
|
Loading…
Reference in New Issue
Block a user