When encountering a duplicate symbol, show source of the first symbol
authorReid Barton <rwbarton@gmail.com>
Mon, 1 Feb 2016 00:10:29 +0000 (19:10 -0500)
committerReid Barton <rwbarton@gmail.com>
Mon, 1 Feb 2016 00:10:29 +0000 (19:10 -0500)
Test Plan: Used this to track down an issue I was having.

Reviewers: simonmar, austin, erikd, bgamari

Reviewed By: erikd, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1863

rts/Linker.c

index b9a1d34..29bd5d8 100644 (file)
@@ -430,13 +430,17 @@ static int ghciInsertSymbolTable(
       "   %s\n"
       "whilst processing object file\n"
       "   %" PATH_FMT "\n"
+      "The symbol was previously defined in\n"
+      "   %" PATH_FMT "\n"
       "This could be caused by:\n"
       "   * Loading two different object files which export the same symbol\n"
       "   * Specifying the same object file twice on the GHCi command line\n"
       "   * An incorrect `package.conf' entry, causing some object to be\n"
       "     loaded twice.\n",
       (char*)key,
-      obj_name
+      obj_name,
+      pinfo->owner->archiveMemberName ? pinfo->owner->archiveMemberName
+      : pinfo->owner->fileName
    );
    return 0;
 }