Skip to content

Commit 5966995

Browse files
authored
Remove setting $ORIGIN/netcoredeps rpath (#114512)
The original use case for setting the RPATH was self-contained Linux apps. Some time between .NET 6 and .NET 8, we started using a newer linker, such that this setting sets RUNPATH instead of RPATH. This meant it only applied to the host executable, not the runtime libraries (like coreclr). The netcoredeps behaviour was from a time when our dependencies were more complicated and even its intended use case has no support story.
1 parent 982912a commit 5966995

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

src/native/corehost/apphost/standalone/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
# Licensed to the .NET Foundation under one or more agreements.
22
# The .NET Foundation licenses this file to you under the MIT license.
33

4-
# Add RPATH to the apphost binary that allows using local copies of shared libraries
5-
# dotnet core depends on for special scenarios when system wide installation of such
6-
# dependencies is not possible for some reason.
7-
# This cannot be enabled for MacOS (Darwin) since its RPATH works in a different way,
8-
# doesn't apply to libraries loaded via dlopen and most importantly, it is not transitive.
9-
if (NOT CLR_CMAKE_TARGET_OSX)
10-
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
11-
set(CMAKE_INSTALL_RPATH "\$ORIGIN/netcoredeps")
12-
endif()
13-
144
include_directories(..)
155

166
set(SOURCES

src/native/corehost/apphost/static/CMakeLists.txt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@
44
project(singlefilehost)
55
set(DOTNET_PROJECT_NAME "singlefilehost")
66

7-
# Add RPATH to the apphost binary that allows using local copies of shared libraries
8-
# dotnet core depends on for special scenarios when system wide installation of such
9-
# dependencies is not possible for some reason.
10-
# This cannot be enabled for MacOS (Darwin) since its RPATH works in a different way,
11-
# doesn't apply to libraries loaded via dlopen and most importantly, it is not transitive.
12-
if (NOT CLR_CMAKE_TARGET_APPLE)
13-
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
14-
set(CMAKE_INSTALL_RPATH "\$ORIGIN/netcoredeps")
15-
endif()
16-
177
include_directories(..)
188
include_directories(../..)
199
include_directories(../../hostmisc)
@@ -195,7 +185,7 @@ else()
195185
LIST(APPEND NATIVE_LIBS
196186
eventprovider
197187
)
198-
endif(FEATURE_EVENT_TRACE)
188+
endif(FEATURE_EVENT_TRACE)
199189
LIST(APPEND NATIVE_LIBS
200190
nativeresourcestring
201191
)

0 commit comments

Comments
 (0)