<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Support/Threading.h on Haiku 'once_flag' does not name a type"
href="https://bugs.llvm.org/show_bug.cgi?id=34333">34333</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Support/Threading.h on Haiku 'once_flag' does not name a type
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>4.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>other
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Support Libraries
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>kallisti5@unixzen.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Cross compiling Rust for Haiku, running into this issue:
running: "x86_64-unknown-haiku-g++" "-O2" "-ffunction-sections"
"-fdata-sections" "-fPIC" "-m64"
"-I/home/kallisti5/Code/haiku/generated/cross-tools-x86_64/sysroot/boot/system/develop/headers"
"-fPIC" "-fvisibility-inlines-hidden" "-Wall" "-W" "-Wno-unused-parameter"
"-Wwrite-strings" "-Wcast-qual" "-Wno-missing-field-initializers" "-pedantic"
"-Wno-long-long" "-Wno-maybe-uninitialized" "-Wdelete-non-virtual-dtor"
"-Wno-comment" "-Werror=date-time" "-std=c++11" "-ffunction-sections"
"-fdata-sections" "-O3" "-DNDEBUG" "-fno-exceptions" "-D__STDC_CONSTANT_MACROS"
"-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AARCH64"
"-DLLVM_COMPONENT_ARM" "-DLLVM_COMPONENT_ASMPARSER"
"-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER"
"-DLLVM_COMPONENT_HEXAGON" "-DLLVM_COMPONENT_INSTRUMENTATION"
"-DLLVM_COMPONENT_INTERPRETER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER"
"-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430"
"-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_SPARC"
"-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_X86" "-o"
"/home/kallisti5/Code/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-haiku/release/build/rustc_llvm-e6802492b9663172/out/../rustllvm/PassWrapper.o"
"-c" "../rustllvm/PassWrapper.cpp"
cargo:warning=In file included from
/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/Support/RWMutex.h:18:0,
cargo:warning= from
/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/PassRegistry.h:25,
cargo:warning= from
/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/PassSupport.h:27,
cargo:warning= from
/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/Pass.h:387,
cargo:warning= from
/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/IR/DataLayout.h:27,
cargo:warning= from
/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/IR/Module.h:20,
cargo:warning= from
/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/ExecutionEngine/ExecutionEngine.h:22,
cargo:warning= from ../rustllvm/rustllvm.h:20,
cargo:warning= from ../rustllvm/PassWrapper.cpp:15:
cargo:warning=/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/Support/Threading.h:61:16:
error: 'once_flag' in namespace 'std' does not name a type
cargo:warning= typedef std::once_flag once_flag;
cargo:warning= ^
cargo:warning=/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/Support/Threading.h:91:18:
error: variable or field 'call_once' declared void
cargo:warning= void call_once(once_flag &flag, Function &&F, Args &&...
ArgList) {
cargo:warning= ^
cargo:warning=/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/Support/Threading.h:91:18:
error: 'once_flag' was not declared in this scope
cargo:warning=/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/Support/Threading.h:91:29:
error: 'flag' was not declared in this scope
cargo:warning= void call_once(once_flag &flag, Function &&F, Args &&...
ArgList) {
cargo:warning= ^
cargo:warning=/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/Support/Threading.h:91:44:
error: expected primary-expression before '&&' token
cargo:warning= void call_once(once_flag &flag, Function &&F, Args &&...
ArgList) {
cargo:warning= ^
cargo:warning=/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/Support/Threading.h:91:46:
error: 'F' was not declared in this scope
cargo:warning= void call_once(once_flag &flag, Function &&F, Args &&...
ArgList) {
cargo:warning= ^
cargo:warning=/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/Support/Threading.h:91:54:
error: expected primary-expression before '&&' token
cargo:warning= void call_once(once_flag &flag, Function &&F, Args &&...
ArgList) {
cargo:warning= ^
cargo:warning=/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/Support/Threading.h:91:56:
error: expected primary-expression before '...' token
cargo:warning= void call_once(once_flag &flag, Function &&F, Args &&...
ArgList) {
cargo:warning= ^
cargo:warning=../rustllvm/PassWrapper.cpp:623:1: error: 'once_flag' does not
name a type
cargo:warning= INITIALIZE_PASS(RustPrintModulePass, "print-rust-module",
cargo:warning= ^
cargo:warning=In file included from
/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/Pass.h:387:0,
cargo:warning= from
/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/IR/DataLayout.h:27,
cargo:warning= from
/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/IR/Module.h:20,
cargo:warning= from
/home/kallisti5/Code/haiku/generated.x86_64/cross-tools-x86_64/sysroot/boot/system/develop/headers/llvm/ExecutionEngine/ExecutionEngine.h:22,
cargo:warning= from ../rustllvm/rustllvm.h:20,
cargo:warning= from ../rustllvm/PassWrapper.cpp:15:
cargo:warning=../rustllvm/PassWrapper.cpp: In function 'void
llvm::initializeRustPrintModulePassPass(llvm::PassRegistry&)':
cargo:warning=../rustllvm/PassWrapper.cpp:623:1: error: 'call_once' is not a
member of 'llvm'
cargo:warning= INITIALIZE_PASS(RustPrintModulePass, "print-rust-module",
cargo:warning= ^
cargo:warning=../rustllvm/PassWrapper.cpp:623:1: error:
'InitializeRustPrintModulePassPassFlag' was not declared in this scope
cargo:warning= INITIALIZE_PASS(RustPrintModulePass, "print-rust-module",
cargo:warning= ^
exit code: 1
I *think* this is due to a misconfiguration in llvm/Support/Threading.h.
Adding __HAIKU__ to the checks for LLVM_THREADING_USE_STD_CALL_ONCE ~seems~ to
fix the problem... but i'm not 100% sure it is the correct solution.
// std::call_once from libc++ is used on all Unix platforms. Other
// implementations like libstdc++ are known to have problems on NetBSD,
// OpenBSD and PowerPC.
#if defined(LLVM_ON_UNIX) && (defined(_LIBCPP_VERSION) ||
\
!(defined(__NetBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || \
defined(__ppc__)))
#define LLVM_THREADING_USE_STD_CALL_ONCE 1
#else
#define LLVM_THREADING_USE_STD_CALL_ONCE 0
#endif
#if LLVM_THREADING_USE_STD_CALL_ONCE
#include <mutex>
#else
#include "llvm/Support/Atomic.h"
#endif</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>