Tier 2 BSDs have fallen behind over last year or so and PR #13699 aims to make general progress.
status (updated as the PR makes progress)
| ARCH |
OS |
VERSIONS |
STAGE2 |
STAGE3 |
NOTES |
| x86_64 |
freebsd |
13.1, 13.0, 12.4, 12.3 |
yes |
yes |
|
|
openbsd |
7.2, 7.1 |
yes |
yes |
|
|
netbsd |
10.0, 9.3, 9.2 |
yes |
yes |
|
|
dragonfly |
6.4, 6.2, 6.0 |
yes |
yes |
|
| aarch64 |
freebsd |
13.1 |
yes |
yes |
|
| riscv64 |
freebsd |
13.1 |
yes |
yes |
|
openbsd special instructions
- default stack size of 4MB fails with various errors like SIGSEG, SIGILL when building stage3
- set
LIBRARY_PATH for extra libdir if your llvm dep was built with libzstd
limit stacksize 32M
export LIBRARY_PATH=/usr/local/lib
- this patch is required against llvm-project otherwise finding dynamic libraries fails:
diff
diff --git a/lld/ELF/DriverUtils.cpp b/lld/ELF/DriverUtils.cpp
index 51f3dc3a056e..eea7d5b10d4a 100644
--- a/lld/ELF/DriverUtils.cpp
+++ b/lld/ELF/DriverUtils.cpp
@@ -224,11 +224,38 @@ Optional<std::string> elf::findFromSearchPaths(StringRef path) {
// search paths.
Optional<std::string> elf::searchLibraryBaseName(StringRef name) {
for (StringRef dir : config->searchPaths) {
- if (!config->isStatic)
+ if (!config->isStatic) {
if (Optional<std::string> s = findFile(dir, "lib" + name + ".so"))
return s;
- if (Optional<std::string> s = findFile(dir, "lib" + name + ".a"))
- return s;
+
+ // Handle OpenBSD-style maj/min shlib scheme
+ llvm::SmallString<128> Scratch;
+ const StringRef LibName = ("lib" + name + ".so.").toStringRef(Scratch);
+ int MaxMaj = -1, MaxMin = -1;
+ std::error_code EC;
+ for (fs::directory_iterator LI(dir, EC), LE;
+ LI != LE; LI = LI.increment(EC)) {
+ StringRef FilePath = LI->path();
+ StringRef FileName = path::filename(FilePath);
+ if (!(FileName.startswith(LibName)))
+ continue;
+ std::pair<StringRef, StringRef> MajMin =
+ FileName.substr(LibName.size()).split('.');
+ int Maj, Min;
+ if (MajMin.first.getAsInteger(10, Maj) || Maj < 0)
+ continue;
+ if (MajMin.second.getAsInteger(10, Min) || Min < 0)
+ continue;
+ if (Maj > MaxMaj)
+ MaxMaj = Maj, MaxMin = Min;
+ if (MaxMaj == Maj && Min > MaxMin)
+ MaxMin = Min;
+ }
+ if (MaxMaj >= 0)
+ return findFile(dir, LibName + Twine(MaxMaj) + "." + Twine(MaxMin));
+ }
+ if (Optional<std::string> s = findFile(dir, "lib" + name + ".a"))
+ return s;
}
return None;
}
diff --git a/llvm/cmake/modules/GetLibraryName.cmake b/llvm/cmake/modules/GetLibraryName.cmake
index 13c0080671a3..c226b57dc8ac 100644
--- a/llvm/cmake/modules/GetLibraryName.cmake
+++ b/llvm/cmake/modules/GetLibraryName.cmake
@@ -2,7 +2,7 @@
function(get_library_name path name)
get_filename_component(path ${path} NAME)
set(prefixes ${CMAKE_FIND_LIBRARY_PREFIXES})
- set(suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ set(suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES} ".so.[0-9]+.[0-9]+")
list(FILTER prefixes EXCLUDE REGEX "^\\s*$")
list(FILTER suffixes EXCLUDE REGEX "^\\s*$")
if(prefixes)
netbsd special instructions
- default stack size of 4MB fails with various errors like SIGSEGV when building stage3
- set
LIBRARY_PATH for extra libdir if your llvm dep was built with libzstd
limit stacksize 32M
export LIBRARY_PATH=/usr/pkg/lib
- for netbsd < 10.0 this patch is required against llvm-project otherwise building clang fails:
diff
diff --git a/clang/lib/Interpreter/IncrementalParser.cpp b/clang/lib/Interpreter/IncrementalParser.cpp
index db854c4161b4..88f22e2347f2 100644
--- a/clang/lib/Interpreter/IncrementalParser.cpp
+++ b/clang/lib/Interpreter/IncrementalParser.cpp
@@ -53,7 +53,7 @@ public:
switch (CI.getFrontendOpts().ProgramAction) {
default:
Err = llvm::createStringError(
- std::errc::state_not_recoverable,
+ clang::errc::state_not_recoverable,
"Driver initialization failed. "
"Incremental mode for action %d is not supported",
CI.getFrontendOpts().ProgramAction);
diff --git a/clang/lib/Interpreter/IncrementalParser.h b/clang/lib/Interpreter/IncrementalParser.h
index 8e45d6b5931b..885ce4596ff1 100644
--- a/clang/lib/Interpreter/IncrementalParser.h
+++ b/clang/lib/Interpreter/IncrementalParser.h
@@ -79,6 +79,14 @@ public:
private:
llvm::Expected<PartialTranslationUnit &> ParseOrWrapTopLevelDecl();
};
+
+ namespace errc {
+#if defined(ENOTRECOVERABLE)
+ const std::errc state_not_recoverable = std:errc::state_not_recoverable;
+#else
+ const std::errc state_not_recoverable = static_cast<std::errc>(ELAST + 1000);
+#endif
+ }
} // end namespace clang
#endif // LLVM_CLANG_LIB_INTERPRETER_INCREMENTALPARSER_H
dragonfly special instructions
- set
LIBRARY_PATH for extra libdir if your llvm dep was built with libzstd
export LIBRARY_PATH=/usr/local/lib
related:
Tier 2 BSDs have fallen behind over last year or so and PR #13699 aims to make general progress.
status (updated as the PR makes progress)
zig build test docszig build test docszig build test docszig build test docsbehavior test: 2 failsbehavior test: 2 failsopenbsd special instructions
LIBRARY_PATHfor extra libdir if your llvm dep was built withlibzstddiff
netbsd special instructions
LIBRARY_PATHfor extra libdir if your llvm dep was built withlibzstddiff
dragonfly special instructions
LIBRARY_PATHfor extra libdir if your llvm dep was built withlibzstdrelated:
MAXNAMLEN#13684 (similar fix forMAXNAMLEN; better namespace choice)build teststatus after llvm 13 bump #9964 (reminder of limits and workarounds for some platforms)