Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm having trouble compiling with qnx #566

Closed
ApacheWang opened this issue Nov 24, 2019 · 7 comments
Closed

I'm having trouble compiling with qnx #566

ApacheWang opened this issue Nov 24, 2019 · 7 comments

Comments

@ApacheWang
Copy link

I modified the compiler in the CMakeList file to point to q++ and qcc, but got the following error during compilation.

`/home/user/abseil-cpp/absl/synchronization/mutex.cc:545:66: error: no 'void absl::Mutex::IncrementSynchSem(absl::Mutex*, absl::base_internal::PerThreadSynch*)' member function declared in class 'absl::Mutex'
inline void Mutex::IncrementSynchSem(Mutex mu, PerThreadSynch w) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:556:76: error: no 'bool absl::Mutex::DecrementSynchSem(absl::Mutex
, absl::base_internal::PerThreadSynch
, absl::synchronization_internal::KernelTimeout)' member function declared in class 'absl::Mutex'
bool Mutex::DecrementSynchSem(Mutex mu, PerThreadSynch w, KernelTimeout t) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In destructor 'absl::Mutex::~Mutex()':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:714:16: error: 'mu_' was not declared in this scope
intptr_t v = mu_.load(std::memory_order_relaxed);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:716:29: error: 'class absl::Mutex' has no member named 'mu_'
ForgetSynchEvent(&this->mu_, kMuEvent, kMuSpin);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::Mutex::EnableDebugLog(const char
)':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:725:43: error: 'class absl::Mutex' has no member named 'mu_'
SynchEvent e = EnsureSynchEvent(&this->mu_, name, kMuEvent, kMuSpin);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::Mutex::EnableInvariantDebugging(void (
)(void
), void*)':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:738:45: error: 'class absl::Mutex' has no member named 'mu_'
SynchEvent e = EnsureSynchEvent(&this->mu_, nullptr, kMuEvent, kMuSpin);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: At global scope:
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1053:40: error: no 'void absl::Mutex::TryRemove(absl::base_internal::PerThreadSynch
)' member function declared in class 'absl::Mutex'
void Mutex::TryRemove(PerThreadSynch s) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1107:58: error: no 'void absl::Mutex::Block(absl::base_internal::PerThreadSynch
)' member function declared in class 'absl::Mutex'
ABSL_XRAY_LOG_ARGS(1) void Mutex::Block(PerThreadSynch s) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1136:48: error: no 'absl::base_internal::PerThreadSynch
absl::Mutex::Wakeup(absl::base_internal::PerThreadSynch*)' member function declared in class 'absl::Mutex'
PerThreadSynch Mutex::Wakeup(PerThreadSynch w) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::Mutex::AssertNotHeld() const':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1418:8: error: 'mu_' was not declared in this scope
(mu_.load(std::memory_order_relaxed) & (kMuWriter | kMuReader)) != 0 &&
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::Mutex::Lock()':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1457:16: error: 'mu_' was not declared in this scope
intptr_t v = mu_.load(std::memory_order_relaxed);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1464:40: error: 'class absl::Mutex' has no member named 'mu_'
if (!TryAcquireWithSpinning(&this->mu_)) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1465:13: error: 'class absl::Mutex' has no member named 'LockSlow'
this->LockSlow(kExclusive, nullptr, 0);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::Mutex::ReaderLock()':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1475:16: error: 'mu_' was not declared in this scope
intptr_t v = mu_.load(std::memory_order_relaxed);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1481:11: error: 'class absl::Mutex' has no member named 'LockSlow'
this->LockSlow(kShared, nullptr, 0);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::Mutex::LockWhen(const absl::Condition&)':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1490:9: error: 'class absl::Mutex' has no member named 'LockSlow'
this->LockSlow(kExclusive, &cond, 0);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'bool absl::Mutex::LockWhenWithDeadline(const absl::Condition&, absl::Time)':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1503:61: error: 'LockSlowWithDeadline' was not declared in this scope
KernelTimeout(deadline), 0);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::Mutex::ReaderLockWhen(const absl::Condition&)':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1512:9: error: 'class absl::Mutex' has no member named 'LockSlow'
this->LockSlow(kShared, &cond, 0);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'bool absl::Mutex::ReaderLockWhenWithDeadline(const absl::Condition&, absl::Time)':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1526:77: error: 'LockSlowWithDeadline' was not declared in this scope
bool res = LockSlowWithDeadline(kShared, &cond, KernelTimeout(deadline), 0);
^
In file included from /home/user/abseil-cpp/absl/base/port.h:24:0,
from /home/user/abseil-cpp/absl/base/internal/low_level_alloc.h:55,
from /home/user/abseil-cpp/absl/synchronization/mutex.h:66,
from /home/user/abseil-cpp/absl/synchronization/mutex.cc:15:
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::Mutex::Await(const absl::Condition&)':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1538:26: error: 'class absl::Mutex' has no member named 'AwaitCommon'
ABSL_RAW_CHECK(this->AwaitCommon(cond, KernelTimeout::Never()),
^
/home/user/abseil-cpp/absl/base/optimization.h:174:49: note: in definition of macro 'ABSL_PREDICT_FALSE'
#define ABSL_PREDICT_FALSE(x) (builtin_expect(x, 0))
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1538:5: note: in expansion of macro 'ABSL_RAW_CHECK'
ABSL_RAW_CHECK(this->AwaitCommon(cond, KernelTimeout::Never()),
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'bool absl::Mutex::AwaitWithDeadline(const absl::Condition&, absl::Time)':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1556:20: error: 'class absl::Mutex' has no member named 'AwaitCommon'
bool res = this->AwaitCommon(cond, t);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: At global scope:
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1562:63: error: no 'bool absl::Mutex::AwaitCommon(const absl::Condition&, absl::synchronization_internal::KernelTimeout)' member function declared in class 'absl::Mutex'
bool Mutex::AwaitCommon(const Condition &cond, KernelTimeout t) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'bool absl::Mutex::TryLock()':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1587:16: error: 'mu
' was not declared in this scope
intptr_t v = mu
.load(std::memory_order_relaxed);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'bool absl::Mutex::ReaderTryLock()':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1617:16: error: 'mu_' was not declared in this scope
intptr_t v = mu_.load(std::memory_order_relaxed);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::Mutex::Unlock()':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1663:16: error: 'mu_' was not declared in this scope
intptr_t v = mu_.load(std::memory_order_relaxed);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1696:11: error: 'class absl::Mutex' has no member named 'UnlockSlow'
this->UnlockSlow(nullptr /no waitp/); // take slow path
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::Mutex::ReaderUnlock()':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1715:16: error: 'mu_' was not declared in this scope
intptr_t v = mu_.load(std::memory_order_relaxed);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1727:9: error: 'class absl::Mutex' has no member named 'UnlockSlow'
this->UnlockSlow(nullptr /no waitp/); // take slow path
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: At global scope:
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1750:65: error: no 'void absl::Mutex::LockSlow(absl::Mutex::MuHow, const absl::Condition
, int)' member function declared in class 'absl::Mutex'
void Mutex::LockSlow(MuHow how, const Condition cond, int flags) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1833:60: error: no 'bool absl::Mutex::LockSlowWithDeadline(absl::Mutex::MuHow, const absl::Condition
, absl::synchronization_internal::KernelTimeout, int)' member function declared in class 'absl::Mutex'
KernelTimeout t, int flags) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:1897:59: error: no 'void absl::Mutex::LockSlowLoop(absl::SynchWaitParams
, int)' member function declared in class 'absl::Mutex'
void Mutex::LockSlowLoop(SynchWaitParams waitp, int flags) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2016:46: error: no 'void absl::Mutex::UnlockSlow(absl::SynchWaitParams
)' member function declared in class 'absl::Mutex'
void Mutex::UnlockSlow(SynchWaitParams waitp) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2323:28: error: no 'void absl::Mutex::Trans(absl::Mutex::MuHow)' member function declared in class 'absl::Mutex'
void Mutex::Trans(MuHow how) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2331:34: error: no 'void absl::Mutex::Fer(absl::base_internal::PerThreadSynch
)' member function declared in class 'absl::Mutex'
void Mutex::Fer(PerThreadSynch w) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::Mutex::AssertHeld() const':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2386:8: error: 'mu_' was not declared in this scope
if ((mu_.load(std::memory_order_relaxed) & kMuWriter) == 0) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::Mutex::AssertReaderHeld() const':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2395:8: error: 'mu_' was not declared in this scope
if ((mu_.load(std::memory_order_relaxed) & (kMuReader | kMuWriter)) == 0) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::CondVar::EnableDebugLog(const char
)':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2416:43: error: 'class absl::CondVar' has no member named 'cv_'
SynchEvent e = EnsureSynchEvent(&this->cv_, name, kCvEvent, kCvSpin);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In destructor 'absl::CondVar::~CondVar()':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2422:8: error: 'cv_' was not declared in this scope
if ((cv_.load(std::memory_order_relaxed) & kCvEvent) != 0) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2423:29: error: 'class absl::CondVar' has no member named 'cv_'
ForgetSynchEvent(&this->cv_, kCvEvent, kCvSpin);
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: At global scope:
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2429:39: error: no 'void absl::CondVar::Remove(absl::base_internal::PerThreadSynch
)' member function declared in class 'absl::CondVar'
void CondVar::Remove(PerThreadSynch s) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2509:55: error: no 'bool absl::CondVar::WaitCommon(absl::Mutex
, absl::synchronization_internal::KernelTimeout)' member function declared in class 'absl::CondVar'
bool CondVar::WaitCommon(Mutex mutex, KernelTimeout t) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'bool absl::CondVar::WaitWithDeadline(absl::Mutex
, absl::Time)':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2565:48: error: 'WaitCommon' was not declared in this scope
return WaitCommon(mu, KernelTimeout(deadline));
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::CondVar::Wait(absl::Mutex*)':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2569:40: error: 'WaitCommon' was not declared in this scope
WaitCommon(mu, KernelTimeout::Never());
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: At global scope:
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2576:39: error: no 'void absl::CondVar::Wakeup(absl::base_internal::PerThreadSynch*)' member function declared in class 'absl::CondVar'
void CondVar::Wakeup(PerThreadSynch *w) {
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::CondVar::Signal()':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2593:12: error: 'cv_' was not declared in this scope
for (v = cv_.load(std::memory_order_relaxed); v != 0;
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2613:9: error: 'Wakeup' is not a member of 'absl::CondVar'
CondVar::Wakeup(w); // wake waiter, if there was one
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc: In member function 'void absl::CondVar::SignalAll()':
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2632:12: error: 'cv_' was not declared in this scope
for (v = cv_.load(std::memory_order_relaxed); v != 0;
^
/home/user/abseil-cpp/absl/synchronization/mutex.cc:2649:11: error: 'Wakeup' is not a member of 'absl::CondVar'
CondVar::Wakeup(w);
^
cc: /home/user/qnx700/host/linux/x86_64/usr/lib/gcc/i586-pc-nto-qnx7.0.0/5.4.0/cc1plus error 1
absl/synchronization/CMakeFiles/synchronization.dir/build.make:206: recipe for target 'absl/synchronization/CMakeFiles/synchronization.dir/mutex.cc.o' failed
make[2]: *** [absl/synchronization/CMakeFiles/synchronization.dir/mutex.cc.o] Error 1
CMakeFiles/Makefile2:1908: recipe for target 'absl/synchronization/CMakeFiles/synchronization.dir/all' failed
make[1]: *** [absl/synchronization/CMakeFiles/synchronization.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

`

@derekmauro
Copy link
Member

We don't support the compiler you are using. We might accept a patch if it is simple enough.

@terrisgit
Copy link

Same issue. Seems weird for Google to not support the automotive market.

@derekmauro
Copy link
Member

I don't have the compiler or a machine to run it on. The compile error above is in absl::Mutex. I would strongly caution anyone against using absl::Mutex on a real-time operating system. absl::Mutex was not designed with real-time operating systems in mind and hasn't been tested on one. Other pieces of Abseil probably work.

@terrisgit
Copy link

terrisgit commented Nov 29, 2019

Interesting. Well, I guess we are willing to test it for you - otherwise we will have to abandon abseil's awesome conditional critical sections. I noticed that dragonflybsd is having the same problem using gcc 8.0 with -std=gnu++11 http://muscles.dragonflybsd.org/synth/logs/devel___abseil.log

@derekmauro
Copy link
Member

Try adding a condition for your platform to ABSL_HAVE_MMAP and let us know how it goes:

#ifdef ABSL_HAVE_MMAP
#error ABSL_HAVE_MMAP cannot be directly set
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
defined(__ros__) || defined(__native_client__) || defined(__asmjs__) || \
defined(__wasm__) || defined(__Fuchsia__) || defined(__sun) || \
defined(__ASYLO__)
#define ABSL_HAVE_MMAP 1
#endif

This might be all you need.

@district10
Copy link

I don't have the compiler or a machine to run it on. The compile error above is in absl::Mutex. I would strongly caution anyone against using absl::Mutex on a real-time operating system. absl::Mutex was not designed with real-time operating systems in mind and hasn't been tested on one. Other pieces of Abseil probably work.

Agreed. But... for me, I'm not using it on QNX, I just want some parts of absl like string-view. I'd like to compile only these revevant modules, but found it very hard. (You can see the dependency graph between absl modules: https://gist.githubusercontent.com/district10/ec85779895f3d838d57ee3a8275b65b1/raw/7ccd020f8fcc0d18ce8f6ca1fd6477db81bfea9b/absl_module_deps.svg )

So I tried compile it under QNX, make some functions dummy so to compile. Here's my patch: https://gist.github.com/district10/9937754bdcdd5321a56430f491088de9

Simple unit tests pass under QNX (and some other platforms planned to support).

@district10
Copy link

test_utils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants