cocaine/cocaine-core

Can not build v0.11 on Fedora19

bioothod opened this issue · 5 comments

/usr/bin/c++ -Dcocaine_core_EXPORTS -O2 -g -fPIC -I/home/zbr/rpmbuild/BUILD/libcocaine-core2-0.11.2.3/include -I/home/zbr/rpmbuild/BUILD/libcocaine-core2-0.11.2.3/foreign/backward-cpp -I/home/zbr/rpmbuild/BUILD/libcocaine-core2-0.11.2.3/foreign/jsoncpp-0.6.0-rc2/include -I/usr/include/libev -std=c++0x -W -Wall -Werror -pedantic -o CMakeFiles/cocaine-core.dir/src/drivers/fs.cpp.o -c /home/zbr/rpmbuild/BUILD/libcocaine-core2-0.11.2.3/src/drivers/fs.cpp
In file included from /home/zbr/rpmbuild/BUILD/libcocaine-core2-0.11.2.3/include/cocaine/detail/actor.hpp:24:0,
from /home/zbr/rpmbuild/BUILD/libcocaine-core2-0.11.2.3/src/actor.cpp:21:
/home/zbr/rpmbuild/BUILD/libcocaine-core2-0.11.2.3/include/cocaine/common.hpp:52:16: error: operator '||' has no left operand
#if HAVE_GCC47 || TARGET_OS_MAC
^
In file included from /home/zbr/rpmbuild/BUILD/libcocaine-core2-0.11.2.3/include/cocaine/app.hpp:24:0,
from /home/zbr/rpmbuild/BUILD/libcocaine-core2-0.11.2.3/src/app.cpp:21:
/home/zbr/rpmbuild/BUILD/libcocaine-core2-0.11.2.3/include/cocaine/common.hpp:52:16: error: operator '||' has no left operand
#if HAVE_GCC47 || TARGET_OS_MAC
^

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.3/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-isl=/builddir/build/BUILD/gcc-4.8.3-20140624/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140624/obj-x86_64-redhat-linux/cloog-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.3 20140624 (Red Hat 4.8.3-1) (GCC)

$ git branch -v | grep v0.11

  • v0.11 399ce63 Merge pull request #124 from diunko/feature/hostname-option
include/cocaine/common.hpp:52:16: error: operator '||' has no left operand
#if HAVE_GCC47 || TARGET_OS_MAC
^

I've seen the very same thing once on precise (on the branch parent to my commit), but have not currenty the environment to reproduce.

I would suggest something like

#if defined(HAVE_GCC47) || TARGET_OS_MAC

but currently I have no environment to test it.
Does it help?

Yes, it fixed this issue.
Does it need to same fix for TARGET_OS_MAC option?

I don't know, how it's defined and where. Mac guys should know for sure, I suppose, if it's 0/1 or def/undef.

Tested on:

  • lucid (GCC 4.4)
  • precise (GCC 4.6)
  • trusty (GCC 4.8)
  • OSX (clang 3.4)

FIxed in #127