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

clang: error: cannot user typeid with -fno-rtti in node/RingBuffer.hpp #886

Closed
dch opened this issue Nov 29, 2018 · 1 comment
Closed

clang: error: cannot user typeid with -fno-rtti in node/RingBuffer.hpp #886

dch opened this issue Nov 29, 2018 · 1 comment
Labels
Type: CI / Build problem Developer/build issues with the codebase

Comments

@dch
Copy link
Contributor

dch commented Nov 29, 2018

Describe the bug

Build fails with default options on FreeBSD 12.0-RC2 with current clang (v6).

node/RingBuffer.hpp:333:8: error: cannot use typeid with -fno-rtti
                        if (typeid(T) == typeid(int)) {
                            ^
node/RingBuffer.hpp:333:21: error: cannot use typeid with -fno-rtti
                        if (typeid(T) == typeid(int)) {

To Reproduce

$ gsh
commit 9d2bc9bf4e2c0be7f763297c5509e995703747d0 (HEAD -> dev, upstream/dev)
Merge: 5da7d6d1 52c4385c
Author: Adam Ierymenko <adam.ierymenko@gmail.com>
Date:   Wed Nov 28 08:44:45 2018 -0800

    Merge branch 'master' into dev

dch@wintermute /r/zt> uname -a
FreeBSD wintermute.skunkwerks.at 12.0-PRERELEASE FreeBSD 12.0-PRERELEASE r340921+548174329ec8(stable/12) GENERIC  amd64

dch@wintermute /r/zt> clang -v
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
Target: x86_64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin

dch@wintermute /r/zt> gmake
clang++ -O3 -fstack-protector -Wall -fPIE -fvisibility=hidden -fstack-protector -pthread  -DNDEBUG  -DZT_USE_X64_ASM_SALSA2012 -DZT_BUILD_PLATFORM=7 -DZT_BUILD_ARCHITECTURE=2 -DZT_SOFTWARE_UPDATE_DEFAULT="\"disable\"" -fno-rtti -std=c++11    -c -o node/C25519.o node/C25519.cpp
clang++ -O3 -fstack-protector -Wall -fPIE -fvisibility=hidden -fstack-protector -pthread  -DNDEBUG  -DZT_USE_X64_ASM_SALSA2012 -DZT_BUILD_PLATFORM=7 -DZT_BUILD_ARCHITECTURE=2 -DZT_SOFTWARE_UPDATE_DEFAULT="\"disable\"" -fno-rtti -std=c++11    -c -o node/Capability.o node/Capability.cpp
In file included from node/Capability.cpp:30:
In file included from node/Topology.hpp:43:
In file included from node/Peer.hpp:36:
In file included from node/Node.hpp:46:
In file included from node/Path.hpp:42:
node/RingBuffer.hpp:333:8: error: cannot use typeid with -fno-rtti
                        if (typeid(T) == typeid(int)) {
                            ^
node/RingBuffer.hpp:333:21: error: cannot use typeid with -fno-rtti
                        if (typeid(T) == typeid(int)) {
                                         ^
2 errors generated.
gmake: *** [<builtin>: node/Capability.o] Error 1

Expected behavior

Build compiles OOTB

Screenshots

Desktop (please complete the following information):

  • OS: FreeBSD 12.0-RC2 (almost the real thing now!)
  • ZeroTier Version: dev branch 9d2bc9b
  • Hardware: Intel Xeon v2667v4 😁
@dch dch changed the title clang cannot user typeid with -fno-rtti in node/RingBuffer.hpp clang: error: cannot user typeid with -fno-rtti in node/RingBuffer.hpp Nov 29, 2018
@adamierymenko adamierymenko added the Type: CI / Build problem Developer/build issues with the codebase label Feb 1, 2019
@Crest
Copy link

Crest commented Jun 2, 2019

This is caused by invoking the compiler with -fno-rtti in make-bsd.mk. Removing it from CXXFLAGS+= allows the default gmake targets to build.

adamierymenko added a commit that referenced this issue Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: CI / Build problem Developer/build issues with the codebase
Projects
None yet
Development

No branches or pull requests

3 participants