summaryrefslogtreecommitdiff
path: root/src/compile.c
diff options
context:
space:
mode:
authorAlexey Sheplyakov <asheplyakov@altlinux.org>2021-07-11 18:57:00 +0400
committerAlexey Sheplyakov <asheplyakov@altlinux.org>2021-09-30 17:05:18 +0400
commit850db9eec0d5dd7f47ade8ffca91b679081f6d85 (patch)
tree0db95c8b7e5e3c14e51e453d232988b7460a5cd3 /src/compile.c
parent3d543c06263744452d099e2b1860052ab061a842 (diff)
downloaddistcc-git-850db9eec0d5dd7f47ade8ffca91b679081f6d85.tar.gz
Improved cross-rewriting on non-x86 systems
Unfortunately autoconf and GCC don't agree on the system name: - On arm (aarch64): `GNU_HOST` is `aarch64-unknown-linux-gnu`, and GCC triple is `aarch64-linux-gnu` instead. - On rpm-based x86_64 distros: `GNU_HOST` is `x86_64-pc-linux-gnu`, and GCC triple is `x86_64-redhat-linux` Therefore ask the compiler (when running distcc configure script) how to correctly identify it. Closes: #440 ALTBUG: 40425
Diffstat (limited to 'src/compile.c')
-rw-r--r--src/compile.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/compile.c b/src/compile.c
index 1b2b080..e6ef9b9 100644
--- a/src/compile.c
+++ b/src/compile.c
@@ -549,7 +549,7 @@ static void dcc_rewrite_generic_compiler(char **argv)
static void dcc_add_clang_target(char **argv)
{
/* defined by autoheader */
- const char *target = GNU_HOST;
+ const char *target = NATIVE_COMPILER_TRIPLE;
if (strcmp(argv[0], "clang") == 0 || strncmp(argv[0], "clang-", strlen("clang-")) == 0 ||
strcmp(argv[0], "clang++") == 0 || strncmp(argv[0], "clang++-", strlen("clang++-")) == 0)
@@ -577,7 +577,7 @@ static void dcc_add_clang_target(char **argv)
static int dcc_gcc_rewrite_fqn(char **argv)
{
/* defined by autoheader */
- const char *target_with_vendor = GNU_HOST;
+ const char *target_with_vendor = NATIVE_COMPILER_TRIPLE;
char *newcmd, *t, *path;
int pathlen = 0;
int newcmd_len = 0;
@@ -595,11 +595,7 @@ static int dcc_gcc_rewrite_fqn(char **argv)
return -ENOMEM;
memset(newcmd, 0, newcmd_len);
- if ((t = strstr(target_with_vendor, "-pc-"))) {
- memcpy(newcmd, target_with_vendor, t - target_with_vendor);
- strcat(newcmd, t + strlen("-pc"));
- } else
- strcpy(newcmd, target_with_vendor);
+ strcpy(newcmd, target_with_vendor);
strcat(newcmd, "-");