Skip to content

Conversation

@llvmbot
Copy link
Member

@llvmbot llvmbot commented Jan 29, 2025

Backport 9326633

Requested by: @brad0

@llvmbot llvmbot requested a review from JDevlieghere as a code owner January 29, 2025 08:37
@llvmbot llvmbot added this to the LLVM 20.X Release milestone Jan 29, 2025
@llvmbot
Copy link
Member Author

llvmbot commented Jan 29, 2025

@labath What do you think about merging this PR to the release branch?

@llvmbot
Copy link
Member Author

llvmbot commented Jan 29, 2025

@llvm/pr-subscribers-lldb

Author: None (llvmbot)

Changes

Backport 9326633

Requested by: @brad0


Full diff: https://github.com/llvm/llvm-project/pull/124898.diff

1 Files Affected:

  • (modified) lldb/source/Host/posix/ProcessLauncherPosixFork.cpp (+1-12)
diff --git a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
index 7d856954684c49..3e956290c3055a 100644
--- a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
+++ b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
@@ -230,16 +230,6 @@ MakeForkActions(const ProcessLaunchInfo &info) {
   return result;
 }
 
-static Environment::Envp FixupEnvironment(Environment env) {
-#ifdef __ANDROID__
-  // If there is no PATH variable specified inside the environment then set the
-  // path to /system/bin. It is required because the default path used by
-  // execve() is wrong on android.
-  env.try_emplace("PATH", "/system/bin");
-#endif
-  return env.getEnvp();
-}
-
 ForkLaunchInfo::ForkLaunchInfo(const ProcessLaunchInfo &info)
     : separate_process_group(
           info.GetFlags().Test(eLaunchFlagLaunchInSeparateProcessGroup)),
@@ -247,8 +237,7 @@ ForkLaunchInfo::ForkLaunchInfo(const ProcessLaunchInfo &info)
       disable_aslr(info.GetFlags().Test(eLaunchFlagDisableASLR)),
       wd(info.GetWorkingDirectory().GetPath()),
       argv(info.GetArguments().GetConstArgumentVector()),
-      envp(FixupEnvironment(info.GetEnvironment())),
-      actions(MakeForkActions(info)) {}
+      envp(info.GetEnvironment().getEnvp()), actions(MakeForkActions(info)) {}
 
 HostProcess
 ProcessLauncherPosixFork::LaunchProcess(const ProcessLaunchInfo &launch_info,

@labath
Copy link
Collaborator

labath commented Jan 29, 2025

What's the motivation? It's very early in the release cycle, so I guess it'd be fine, but it might also be fine to let this bake in trunk, just in case it does turn out breaking something...

@brad0
Copy link
Contributor

brad0 commented Feb 1, 2025

What's the motivation? It's very early in the release cycle, so I guess it'd be fine, but it might also be fine to let this bake in trunk, just in case it does turn out breaking something...

Just because it was early in the cycle, but you have a point. I'll leave it for now.

@brad0 brad0 closed this Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.

3 participants