mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-24 07:46:48 +00:00
build: bundle-libraries.sh: do not override argv[0] in inner exec calls
Only mangle argv[0] of the first executed process and leave the argument vector of subsequent invocations as-is to allow child programs to properly discover resources relative to their binary locations. Fixes "cc1" discovery when executing the host gcc through the bundled "ccache" executable. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
22a74ed310
commit
9e64874fb2
@ -79,8 +79,10 @@ _runas_so() {
|
|||||||
int mangle_arg0(int argc, char **argv, char **env) {
|
int mangle_arg0(int argc, char **argv, char **env) {
|
||||||
char *arg0 = getenv("RUNAS_ARG0");
|
char *arg0 = getenv("RUNAS_ARG0");
|
||||||
|
|
||||||
if (arg0)
|
if (arg0) {
|
||||||
argv[0] = arg0;
|
argv[0] = arg0;
|
||||||
|
unsetenv("RUNAS_ARG0");
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user