Skip to content

Enable dynamic linking MLIR and LLVM #66

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

Merged
merged 20 commits into from
May 15, 2024
Merged

Enable dynamic linking MLIR and LLVM #66

merged 20 commits into from
May 15, 2024

Conversation

Menooker
Copy link

@Menooker Menooker commented May 13, 2024

Added a cmake option GC_DEV_LINK_DYN_LLVM for developer. It reduces binary sizes of gc-cpu-runner and gc-opt from 36MB and 85MB to 0.2MB and 2MB. This helps to reduce the link time and the loading time of debuggers like gdb. This option is by default off.

@Menooker
Copy link
Author

depends on #65

CMakeLists.txt Outdated
@@ -10,6 +10,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

option(GC_LEGACY_ENABLE ON)
option(GC_TEST_ENABLE "Build the tests" ON)
option(GC_DEV_LINK_DYN_LLVM "Link dynamic libraries of LLVM and MLIR. For developers only. Do not use it in packing the library." OFF)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest to change the option name to GC_DEV_LINK_LLVM_DYLIB which is more align with LLVM's LLVM_LINK_LLVM_DYLIB?

Copy link
Author

Choose a reason for hiding this comment

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

I agree with you. I will change that.

Copy link
Contributor

@kurapov-peter kurapov-peter left a comment

Choose a reason for hiding this comment

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

Looks good, just on minor comment

@@ -2,5 +2,7 @@ if(GC_MLIR_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GC_MLIR_CXX_FLAGS}")
endif()

include(../../cmake/functions.cmake)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably unnecessary, the functions should be available globally.

Copy link
Author

Choose a reason for hiding this comment

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

After removing it, cmake complains missing command. Let's keep it for now.

@Menooker Menooker merged commit 720af95 into main May 15, 2024
2 checks passed
@Menooker Menooker deleted the yijie/dyn_link branch May 15, 2024 03:57
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.

3 participants