diff options
Diffstat (limited to 'meta/files/rust-ccld-wrapper.c')
| -rw-r--r-- | meta/files/rust-ccld-wrapper.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/meta/files/rust-ccld-wrapper.c b/meta/files/rust-ccld-wrapper.c deleted file mode 100644 index 6bc9958b90..0000000000 --- a/meta/files/rust-ccld-wrapper.c +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2021 Richard Purdie | ||
| 3 | * | ||
| 4 | * SPDX-License-Identifier: GPL-2.0-only | ||
| 5 | */ | ||
| 6 | |||
| 7 | #include <errno.h> | ||
| 8 | #include <stdio.h> | ||
| 9 | #include <stdlib.h> | ||
| 10 | #include <string.h> | ||
| 11 | #include <unistd.h> | ||
| 12 | |||
| 13 | /* | ||
| 14 | * Run the original script (argv[0] + ".real") with LD_LIBRARY_PATH unset | ||
| 15 | * This avoids issues where cargo is running a wrapper script using /bin/sh from the host | ||
| 16 | * which links to something which has an incompatible version in in recipe-sysroot-native | ||
| 17 | * such as libtinfo on centos 7. | ||
| 18 | */ | ||
| 19 | |||
| 20 | int main(int argc, char* argv[]) { | ||
| 21 | char *real = malloc(strlen(argv[0] + 5)); | ||
| 22 | strcpy(real, argv[0]); | ||
| 23 | strcpy(real + strlen(argv[0]), ".real"); | ||
| 24 | putenv("LD_LIBRARY_PATH="); | ||
| 25 | if(execv(real, argv) == -1) { | ||
| 26 | printf("Wrapper failed to execute, error: %s\n", strerror(errno)); | ||
| 27 | return -1; | ||
| 28 | } | ||
| 29 | } | ||
