summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2018-01-21 10:41:25 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2018-01-21 10:41:25 +0000
commitaa2ab120411cb6db9f19af7469576239a4e98a9c (patch)
tree241ca8567db7cc07327c56734347b80a2a2c40a3
parent9754ee0f2a14dbcbb5fe9eac33519a0afd516163 (diff)
downloadtoolchains-aa2ab120411cb6db9f19af7469576239a4e98a9c.tar.gz
toolchains-aa2ab120411cb6db9f19af7469576239a4e98a9c.tar.bz2
Revert removal of path code
-rw-r--r--m68k-unknown-amigaos/recipes/patches/gcc/gcc6.p53
1 files changed, 49 insertions, 4 deletions
diff --git a/m68k-unknown-amigaos/recipes/patches/gcc/gcc6.p b/m68k-unknown-amigaos/recipes/patches/gcc/gcc6.p
index 86e283b..a727fd3 100644
--- a/m68k-unknown-amigaos/recipes/patches/gcc/gcc6.p
+++ b/m68k-unknown-amigaos/recipes/patches/gcc/gcc6.p
@@ -8848,7 +8848,7 @@ index 000000000000..3f3aafc5f254
+ "%{mcrt=nix*:%(lib_libnix)} " \
+ "%{mcrt=ixemul:%(lib_ixemul)} " \
+ "%{mcrt=clib2:%(lib_clib2)} " \
-+ "%{!noixemul:%{!mcrt*:%(lib_libnix)}}"
++ "%{!noixemul:%{!mcrt*:%(lib_clib2)}}"
+#endif
+
+#define LIBGCC_IXEMUL_SPEC ""
@@ -8975,10 +8975,10 @@ index 000000000000..3f3aafc5f254
+ "%{T*} }}}}}} "
+#endif
+
-+/*extern const char * amiga_m68k_prefix_func(int, const char **);*/
++extern const char * amiga_m68k_prefix_func(int, const char **);
+
-+/*#define EXTRA_SPEC_FUNCTIONS \
-+ { "sdk_root", amiga_m68k_prefix_func },*/
++#define EXTRA_SPEC_FUNCTIONS \
++ { "sdk_root", amiga_m68k_prefix_func },
+
+/* This macro defines names of additional specifications to put in the specs
+ that can be used in various specifications like CC1_SPEC. Its definition
@@ -9821,6 +9821,51 @@ index 6942a504127f..ebe3e1c37121 100644
#include "stringpool.h"
#include "expmed.h"
#include "optabs.h"
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 85ea19bd3a09..a4da7d515ce5 100644
+--- gcc/gcc.c
++++ gcc/gcc.c
+@@ -10107,3 +10107,40 @@ driver_get_configure_time_options (void (*cb) (const char *option,
+ obstack_free (&obstack, NULL);
+ n_switches = 0;
+ }
++
++#ifdef TARGET_AMIGA
++const char * amiga_m68k_prefix_func(int argc, const char ** argv) {
++ char * p = 0;
++ if (standard_libexec_prefix)
++ {
++ char * glp = concat(standard_libexec_prefix, "", NULL);
++ p = strrchr(glp, '/');
++ if (p)
++ {
++ *p = 0;
++ p = strrchr(glp, '/');
++ if (p)
++ {
++ *p = 0;
++ p = strrchr(glp, '/');
++ if (p)
++ {
++ p[1] = 0;
++ p = concat(glp, "m68k-amigaos/", NULL);
++ }
++ }
++ }
++ free(glp);
++ }
++ if (!p)
++ p = concat("../../../../", "", NULL);
++
++ for (int i = 0; i < argc; ++i) {
++ char * q = concat(p, argv[i], NULL);
++ free(p);
++ p = q;
++ }
++// printf("amiga_m68k_prefix_func='%s'\n", p);
++ return p;
++}
++#endif
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 5b2c96ecb5a6..f74e733f9337 100644
--- gcc/gcse.c