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

Exception specification in declaration does not match previous declaration #976

Open
aqjune opened this issue Nov 28, 2018 · 9 comments
Open

Comments

@aqjune
Copy link

aqjune commented Nov 28, 2018

When I compile folly (commit 689ef9, Nov 17 2018) with Clang 6.0.0 on Ubuntu 16.04, I get this error:

$ make
Scanning dependencies of target folly_base
[  0%] Building CXX object CMakeFiles/folly_base.dir/folly/IPAddressV6.cpp.o
In file included from /mnt/freezedisk/conmemssa/folly/folly/IPAddressV6.cpp:17:
In file included from /mnt/freezedisk/conmemssa/folly/folly/IPAddressV6.h:28:
In file included from /mnt/freezedisk/conmemssa/folly/folly/FBString.h:61:
In file included from /mnt/freezedisk/conmemssa/folly/folly/memory/Malloc.h:100:
/usr/include/malloc.h:59:14: error: exception specification in declaration does not match previous declaration
extern void *memalign (size_t __alignment, size_t __size)
             ^
/usr/include/jemalloc/jemalloc.h:167:24: note: previous declaration is here
JEMALLOC_EXPORT void *  je_memalign(size_t alignment, size_t size)
                        ^
/usr/include/jemalloc/jemalloc.h:57:23: note: expanded from macro 'je_memalign'
#  define je_memalign memalign
                      ^

cmake was done with CMAKE_CXX_COMPILER and DCMAKE_C_COMPILER parameters set as clang++/clang but no other additional options set.

@tongzhipeng
Copy link

how did you solve it , dude, i come to the same problem.

@aqjune
Copy link
Author

aqjune commented Jan 19, 2019 via email

@tongzhipeng
Copy link

Well, I couldn't solve the problem :/ 2019년 1월 18일 (금) 오후 4:06에 Tony Tong notifications@github.com님이 작성:

how did you solve it , dude, i come to the same problem. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#976 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AGLzmXxx5MF1bum1aMHLILi7kaUO6XR4ks5vEeMQgaJpZM4Y4C6E .

OK thank you for the reply, I switch to gcc to compile the project, that's what i can only do for now.

@akshayknarayan
Copy link

I think there is a workaround by setting FOLLY_USE_JEMALLOC=0 here: https://github.com/facebook/folly/blob/master/CMake/folly-config.h.cmake#L38

facebook-github-bot pushed a commit to facebook/mvfst that referenced this issue May 29, 2019
Summary:
As a workaround for facebook/folly#976, modify build_helper.sh to allow disabling jemalloc use by passing the appropriate argument to the cmake invocation on folly.
Pull Request resolved: #14

Reviewed By: mjoras

Differential Revision: D15521328

Pulled By: udippant

fbshipit-source-id: 75a5f5abd99fd50fa939d32da99153ede9d8804e
@xgdgsc
Copy link

xgdgsc commented May 31, 2019

Also seeing this with clang 8 on ubuntu 16.04.

@xinnjie
Copy link

xinnjie commented Aug 12, 2019

using gcc instead solve this problem

@blockspacer
Copy link

build with clang is broken

facebook-github-bot pushed a commit to facebookarchive/LogDevice that referenced this issue Jul 29, 2020
Summary:
Switch compiler to clang instead of gcc to enable using coroutines. This diff:
1. Adding clang-9 as a build dependency.
2. Switches the compiler in circleci by setting the env variables `CC` and `CXX` to clang-9.
3. Fixes build configuration to build in clang. This includes:
   1. Disabling some warnings because they are super noisy.
   2. Disabling jemalloc in folly as it doesn't build under clang (facebook/folly#976)
   3. Dropping LibLZMA as it's no longer needed under clang.
4. Updates the documentation to state that we currently only support clang.
5. Which is kind of unrelated but needed to fix compilation problems is dropping linking thrift compiler's shared libs as they are not needed.
6. Fixing fbcode builder to build all deps using clang.

Reviewed By: AhmedSoliman

Differential Revision: D19498055

fbshipit-source-id: d59ab31892f9b4e8f3c259bf6a66709da4ff397a
@maxirmx
Copy link

maxirmx commented Dec 22, 2021

jemalloc 5.x is required

@383316862
Copy link

maybe use gcc's low version can solve this error,well,i have not solve.

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

8 participants