Skip to content

Commit 1e7d33f

Browse files
authored
remove libstdc++ runtime dependency from cython modules (#717)
* remove libstdc++ runtime dependency from cython modules
1 parent 3144b99 commit 1e7d33f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

dpnp/backend/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ endif()
144144
add_definitions(-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security)
145145
if(NOT WIN32)
146146
add_compile_options(-fno-delete-null-pointer-checks -fstack-protector-strong -fno-strict-overflow)
147+
# add_link_options(-static-libstdc++ -static-libgcc)
147148
add_link_options(-Wl,-z,noexecstack,-z,relro,-z,now)
148149
endif()
149150

utils/command_build_clib.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
_project_linker = "dpcpp"
6565
_project_cmplr_flag_sycl_devel = ["-fsycl-device-code-split=per_kernel"]
6666
_project_cmplr_flag_sycl = ["-fsycl"]
67+
_project_cmplr_flag_stdcpp_static = ["-static-libstdc++", "-static-libgcc"]
6768
_project_cmplr_flag_compatibility = ["-Wl,--enable-new-dtags"]
6869
_project_cmplr_flag_lib = ["-shared"]
6970
_project_cmplr_flag_release_build = ["-O3", "-DNDEBUG", "-fPIC"]
@@ -112,6 +113,7 @@
112113
_project_compiler = "dpcpp"
113114
_project_linker = "lld-link"
114115
_project_cmplr_flag_sycl = []
116+
_project_cmplr_flag_stdcpp_static = []
115117
_project_cmplr_flag_compatibility = []
116118
_project_cmplr_flag_lib = ["/DLL"]
117119
_project_cmplr_macro += [("_WIN", "1")]
@@ -150,7 +152,7 @@
150152
"""
151153
Final set of arguments for extentions
152154
"""
153-
_project_extra_link_args = _project_cmplr_flag_compatibility + \
155+
_project_extra_link_args = _project_cmplr_flag_compatibility + _project_cmplr_flag_stdcpp_static + \
154156
["-Wl,-rpath," + x for x in _project_rpath] + _sdl_ldflags
155157
_project_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
156158
_project_backend_dir = [os.path.join(_project_dir, "dpnp", "backend", "include"),

0 commit comments

Comments
 (0)