3.11.2 has issues along these lines: cmQtAutoGeneratorMocUic.cxx:(.text+0x8e8b): undefined reference to `operator new(unsigned long, std::align_val_t)' cmQtAutoGeneratorMocUic.cxx:(.text+0x8ebf): undefined reference to `operator delete(void*, std::align_val_t)'
145 lines
5.6 KiB
Plaintext
145 lines
5.6 KiB
Plaintext
$OpenBSD: patch-Source_cmComputeLinkInformation_cxx,v 1.22 2018/06/14 17:04:45 sthen Exp $
|
|
Index: Source/cmComputeLinkInformation.cxx
|
|
--- Source/cmComputeLinkInformation.cxx.orig
|
|
+++ Source/cmComputeLinkInformation.cxx
|
|
@@ -366,8 +366,9 @@ cmComputeLinkInformation::cmComputeLinkInformation(
|
|
this->Target->GetLinkDirectories());
|
|
|
|
// Set up the implicit link directories.
|
|
- this->LoadImplicitLinkInfo();
|
|
+ this->LoadImplicitLinkInfoOpenBSD();
|
|
this->OrderLinkerSearchPath->SetImplicitDirectories(this->ImplicitLinkDirs);
|
|
+ this->LoadImplicitLinkInfo();
|
|
this->OrderRuntimeSearchPath->SetImplicitDirectories(this->ImplicitLinkDirs);
|
|
if (this->OrderDependentRPath) {
|
|
this->OrderDependentRPath->SetImplicitDirectories(this->ImplicitLinkDirs);
|
|
@@ -446,6 +447,8 @@ cmComputeLinkInformation::GetSharedLibrariesLinked()
|
|
|
|
bool cmComputeLinkInformation::Compute()
|
|
{
|
|
+ bool use_wxneeded = false;
|
|
+
|
|
// Skip targets that do not link.
|
|
if (!(this->Target->GetType() == cmStateEnums::EXECUTABLE ||
|
|
this->Target->GetType() == cmStateEnums::SHARED_LIBRARY ||
|
|
@@ -472,10 +475,17 @@ bool cmComputeLinkInformation::Compute()
|
|
if (linkEntry.IsSharedDep) {
|
|
this->AddSharedDepItem(linkEntry.Item, linkEntry.Target);
|
|
} else {
|
|
+ std::string litem_tolower = linkEntry.Item;
|
|
+ transform(litem_tolower.begin(), litem_tolower.end(), litem_tolower.begin(), ::tolower);
|
|
+ if (litem_tolower.find("webkit") != std::string::npos || litem_tolower.find("webengine") != std::string::npos)
|
|
+ use_wxneeded = true;
|
|
this->AddItem(linkEntry.Item, linkEntry.Target);
|
|
}
|
|
}
|
|
|
|
+ if (use_wxneeded == true)
|
|
+ this->AddUserItem("-Wl,-z,wxneeded", false);
|
|
+
|
|
// Restore the target link type so the correct system runtime
|
|
// libraries are found.
|
|
const char* lss = this->Target->GetProperty("LINK_SEARCH_END_STATIC");
|
|
@@ -637,10 +647,16 @@ void cmComputeLinkInformation::AddItem(std::string con
|
|
// This is a directory.
|
|
this->AddDirectoryItem(item);
|
|
} else {
|
|
- // Use the full path given to the library file.
|
|
this->Depends.push_back(item);
|
|
- this->AddFullItem(item);
|
|
- this->AddLibraryRuntimeInfo(item);
|
|
+ if (!this->OpenBSD) {
|
|
+ // Use the full path given to the library file.
|
|
+ this->AddFullItem(item);
|
|
+ this->AddLibraryRuntimeInfo(item);
|
|
+ } else {
|
|
+ std::string file = cmSystemTools::GetFilenameName(item);
|
|
+ this->AddUserItem(file, false);
|
|
+ this->OrderLinkerSearchPath->AddLinkLibrary(item);
|
|
+ }
|
|
}
|
|
} else {
|
|
// This is a library or option specified by the user.
|
|
@@ -982,11 +998,18 @@ void cmComputeLinkInformation::AddTargetItem(std::stri
|
|
this->SharedLibrariesLinked.insert(target);
|
|
}
|
|
|
|
- // Handle case of an imported shared library with no soname.
|
|
- if (this->NoSONameUsesPath &&
|
|
- target->IsImportedSharedLibWithoutSOName(this->Config)) {
|
|
- this->AddSharedLibNoSOName(item);
|
|
- return;
|
|
+ if (this->OpenBSD) {
|
|
+ if (target->GetType() == cmStateEnums::SHARED_LIBRARY) {
|
|
+ this->AddSharedLibNoSOName(item);
|
|
+ return;
|
|
+ }
|
|
+ } else {
|
|
+ // Handle case of an imported shared library with no soname.
|
|
+ if (this->NoSONameUsesPath &&
|
|
+ target->IsImportedSharedLibWithoutSOName(this->Config)) {
|
|
+ this->AddSharedLibNoSOName(item);
|
|
+ return;
|
|
+ }
|
|
}
|
|
|
|
// If this platform wants a flag before the full path, add it.
|
|
@@ -1539,6 +1562,57 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
|
|
if (const char* implicitDirs =
|
|
this->Makefile->GetDefinition(implicitDirVar)) {
|
|
cmSystemTools::ExpandListArgument(implicitDirs, implicitDirVec);
|
|
+ }
|
|
+
|
|
+ // Store implicit link directories.
|
|
+ this->ImplicitLinkDirs.insert(implicitDirVec.begin(), implicitDirVec.end());
|
|
+
|
|
+ // Get language-specific implicit libraries.
|
|
+ std::vector<std::string> implicitLibVec;
|
|
+ std::string implicitLibVar = "CMAKE_";
|
|
+ implicitLibVar += this->LinkLanguage;
|
|
+ implicitLibVar += "_IMPLICIT_LINK_LIBRARIES";
|
|
+ if (const char* implicitLibs =
|
|
+ this->Makefile->GetDefinition(implicitLibVar)) {
|
|
+ cmSystemTools::ExpandListArgument(implicitLibs, implicitLibVec);
|
|
+ }
|
|
+
|
|
+ // Store implicit link libraries.
|
|
+ for (std::vector<std::string>::const_iterator i = implicitLibVec.begin();
|
|
+ i != implicitLibVec.end(); ++i) {
|
|
+ // Items starting in '-' but not '-l' are flags, not libraries,
|
|
+ // and should not be filtered by this implicit list.
|
|
+ std::string const& item = *i;
|
|
+ if (item[0] != '-' || item[1] == 'l') {
|
|
+ this->ImplicitLinkLibs.insert(item);
|
|
+ }
|
|
+ }
|
|
+
|
|
+ // Get platform specific rpath link directories
|
|
+ if (const char* rpathDirs =
|
|
+ (this->Makefile->GetDefinition("CMAKE_PLATFORM_RUNTIME_PATH"))) {
|
|
+ cmSystemTools::ExpandListArgument(rpathDirs, this->RuntimeLinkDirs);
|
|
+ }
|
|
+}
|
|
+
|
|
+void cmComputeLinkInformation::LoadImplicitLinkInfoOpenBSD()
|
|
+{
|
|
+ std::vector<std::string> implicitDirVec;
|
|
+
|
|
+ // Get platform-wide implicit directories.
|
|
+ if (const char* implicitLinks = (this->Makefile->GetDefinition(
|
|
+ "CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES"))) {
|
|
+ cmSystemTools::ExpandListArgument(implicitLinks, implicitDirVec);
|
|
+ }
|
|
+
|
|
+ // Append library architecture to all implicit platform directories
|
|
+ // and add them to the set
|
|
+ if (const char* libraryArch =
|
|
+ this->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE")) {
|
|
+ for (std::vector<std::string>::const_iterator i = implicitDirVec.begin();
|
|
+ i != implicitDirVec.end(); ++i) {
|
|
+ this->ImplicitLinkDirs.insert(*i + "/" + libraryArch);
|
|
+ }
|
|
}
|
|
|
|
// Store implicit link directories.
|