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
changes for Clang and yasm #10417
changes for Clang and yasm #10417
Conversation
wjwithagen
commented
Jul 24, 2016
•
edited
edited
- Clang does not need all flags and options
- uname -m on FreeBSD returns amd64
@tchaikov |
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Default BUILD_TYPE is RelWithDebInfo, other options are: Debug, Release, and MinSizeRel." FORCE) | ||
endif() | ||
|
||
if(NOT CMAKE_BUILD_TYPE STREQUAL Debug) | ||
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjwithagen would you please move this change out of this commit? you can always override the CFLAGS
, CXXFLAGS
and CMAKE_CXX_FLAGS_DEBUG
when launching cmake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tchaikov
I only added the part where we'd like to run debug, and then these flags look rather appropriate.
But you ar right that they could be set from outside of Cmake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you revert this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjwithagen ping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tchaikov
It should be out by a long time, but I'll check and otehrwise fix
822ba42
to
8ce01d1
Compare
set(EXTRA_CXXFLAGS -fPIC -Wno-unused-variable -DNDEBUG) | ||
if(FREEBSD) | ||
# set(EXTRA_CXXFLAGS ${EXTRA_CXXFLAGS} -I/usr/local/include) | ||
set(MAKEFLAGS ${MAKEFLAGS}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, what is this for? it's just a no-op, imo.
8472ac7
to
7a1b044
Compare
d4f98b5
to
c31f58e
Compare
@@ -35,19 +51,21 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL Debug) | |||
CMAKE_C_FLAGS_${build_type_upper}) | |||
string(REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " " "${flags}" "${${flags}}") | |||
endforeach() | |||
endif() | |||
endif(NOT CMAKE_BUILD_TYPE STREQUAL Debug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you drop unrelated changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tchaikov
I was under the impression that "while there" one is allowed to fix imperfacetions in
code?
But I'll take it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, 1) but i don't think we need to "fix" it. the if
block is smaller enough, that we know where it starts. 2) and you are not changing the if
block, so i don't really think you were there.
$<TARGET_OBJECTS:krbd_objs>) | ||
endif(LINUX) | ||
endif(WITH_RBD) | ||
if(WITH_KVS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i still don't understand the relation between WITH_KVS
and parse_secret_objs
. could you enlighten me on it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tchaikov
Could be that I'm misinterpreting things. But the KeyValue store seems to use the file common/secret.c which includes keyutils.h.
And that we don't have in FreeBSD.
And I have not figured out how to patch this up: either write a replacement, and/or stub it up.
I'll take a note of this and put it at least in my freebsd-todo.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the KeyValue store seems to use the file common/secret.c which includes keyutils.h.
i am not sure how you come to this. secret.c
is used by mount.ceph.c
and krbd.cc
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On 2-8-2016 09:58, Kefu Chai wrote:
In src/CMakeLists.txt
#10417 (comment):set(DENCODER_EXTRALIBS
${DENCODER_EXTRALIBS}
rbd_replay_types)
-endif(${WITH_RBD})
- if(LINUX)
- list(APPEND dencoder_srcs
$<TARGET_OBJECTS:krbd_objs>)
- endif(LINUX)
+endif(WITH_RBD)
+if(WITH_KVS)But the KeyValue store seems to use the file common/secret.c which includes keyutils.h.
|secret.c| is used by |mount.ceph.c| and |krbd.cc| also. i am not sure
how you come to this.
I just looked at the source of secret.c. :)
Perhaps it can be removed, but have not yet dared to do so.
KV exclusion for this also seems to work.
@tchaikov |
1e6eb4a
to
9e05d20
Compare
could you address the comments? they are dropped on the floor, i guess. |
9e05d20
to
d5cafc0
Compare
@tchaikov |
d5cafc0
to
4b14fbc
Compare
@tchaikov |
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -ftemplate-depth-1024 -Wnon-virtual-dtor -Wno-invalid-offsetof -Wstrict-null-sentinel -Woverloaded-virtual") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -ftemplate-depth-1024 -Wno-invalid-offsetof") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Woverloaded-virtual") | ||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be better if we can be consistent regarding to the use of MATCHES "GNU"
and STREQUAL GNU
?
please ping me once all comments addressed, thanks. |
4b14fbc
to
271e71d
Compare
- Added a lot more Clang flags to supress warnings, since Clang is way much more verbose. And while there rearranged the layout. - Move Linking flags to correct Cmake variables, so Clang does not complain about flags that are not appropriate - Clang/Cmake debugging: use CMAKE_CXX_FLAGS_DEBUG in buildscript - Move Linux specifics to if-endif blocks - -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
- uname onf freebsd returns amd64 Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
- On FreeBSD libuuid, libresolv, libdl are all in libc. So do not use them while linking, otherwise missing lib errors will result - libdl is sorted out by stdard CMake functionality Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
271e71d
to
b175a86
Compare
@tchaikov |
lgtm. |
@tchaikov |
@wjwithagen lemme push this change to gb to get it tested. then i guess it's good to merge. |
pushed to wip-kefu-testing. |
@tchaikov |