patch-gcc_ada_osint_adb 881 B

12345678910111213141516171819202122232425
  1. $OpenBSD: patch-gcc_ada_osint_adb,v 1.1 2015/02/17 12:04:44 tobiasu Exp $
  2. GNAT tools try to guess the name of the gcc binary by looking at their
  3. own prefix and suffix. Subsequently they're trying to compile code using
  4. the base gcc if argv[0] does't start with "e".
  5. This hack to their name-guessing hack fixes the problem while touching the
  6. least amount of files.
  7. --- gcc/ada/osint.adb.orig Tue Feb 25 16:02:01 2014
  8. +++ gcc/ada/osint.adb Sat Feb 14 18:33:49 2015
  9. @@ -2272,6 +2272,13 @@ package body Osint is
  10. Start_Of_Suffix := End_Of_Prefix + Prog'Length + 1;
  11. end if;
  12. + if Nam = "gcc" and then
  13. + Name_Buffer (Start_Of_Prefix .. End_Of_Prefix) = "" and then
  14. + Name_Buffer (Start_Of_Suffix .. Name_Len) = ""
  15. + then
  16. + return new String'("egcc");
  17. + end if;
  18. +
  19. -- Create the new program name
  20. return new String'