0001-Convert-argument-to-sysroot-option-to-relative-path.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From fe42d6f7b739e8d42811bf46bcccfafa728847a2 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Mathias=20De=20Mar=C3=A9?= <mathias.de_mare@nokia.com>
  3. Date: Mon, 19 Sep 2016 10:38:13 +0200
  4. Subject: [PATCH] Convert argument to '--sysroot' option to relative path
  5. Previously, only the argument to '--sysroot=' was converted.
  6. This changeset adds support for '--sysroot'.
  7. Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>
  8. Signed-off-by: Matt Weber <matthew.weber@rockwellcollins.com>
  9. ---
  10. ccache.c | 15 +++++++++++++++
  11. 1 file changed, 15 insertions(+)
  12. diff --git a/ccache.c b/ccache.c
  13. index 8ffadcc..76139b9 100644
  14. --- a/ccache.c
  15. +++ b/ccache.c
  16. @@ -2407,6 +2407,21 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
  17. free(option);
  18. continue;
  19. }
  20. + // Alternate form of specifying sysroot without =
  21. + if (str_eq(argv[i], "--sysroot")) {
  22. + if (i == argc-1) {
  23. + cc_log("Missing argument to %s", argv[i]);
  24. + stats_update(STATS_ARGS);
  25. + result = false;
  26. + goto out;
  27. + }
  28. + args_add(stripped_args, argv[i]);
  29. + char *relpath = make_relative_path(x_strdup(argv[i+1]));
  30. + args_add(stripped_args, relpath);
  31. + i++;
  32. + free(relpath);
  33. + continue;
  34. + }
  35. if (str_startswith(argv[i], "-Wp,")) {
  36. if (str_eq(argv[i], "-Wp,-P")
  37. || strstr(argv[i], ",-P,")
  38. --
  39. 2.8.3