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

Code improvement #379

Merged
merged 3 commits into from
Feb 28, 2021
Merged

Code improvement #379

merged 3 commits into from
Feb 28, 2021

Conversation

benquike
Copy link
Contributor

  1. Remove unneeded Makefiles
  2. Factor out llvm_libs setup
  3. cleanup CXX_FLAGS setup

CMakeLists.txt Outdated
# add -std=gnu++14
set(CMAKE_CXX_EXTENSIONS ON)

add_compile_definitions(HAVE_IEEE_754)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution:) Could this be moved to the CMakeList under CUDD since these marcos are only used there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, please have a look.

else()
set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++14 -O3 -fno-rtti -Wno-deprecated -DHAVE_IEEE_754 -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8")
endif()
set(CMAKE_C_FLAGS "-fPIC")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we still keep -fPIC or did I miss anything in your patch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PIC is enabled by default on recent Linux distributions, to support ASLR.
So it is duplicated.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case, someone is built on an old version of Linux.

Copy link
Contributor Author

@benquike benquike Feb 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Update.
Please have a look.
Also, I have removed -Wno-deprecated, as the current code can be built now without it.

CMakeLists.txt Outdated
Comment on lines 28 to 30
if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
endif()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to adjust these indents.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is ready to merge once you fix these indents. It looks not properly aligned. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

set(CMAKE_CXX_EXTENSIONS ON)

set(COMMON_FLAGS "-fPIC -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} -fno-rtti")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for one more thing here. Lines 20-21 seems redundant if we have Lines 25-29. Could you merge them to make it compact?

Copy link
Contributor Author

@benquike benquike Feb 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. They are not redundant.
25-29 are only for setting up -Ox under different building modes, while 21-22 are for setting up options for C and CXX sources in common.

@yuleisui yuleisui merged commit 5f5bf80 into SVF-tools:master Feb 28, 2021
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

Successfully merging this pull request may close these issues.

2 participants