[Pkg-haskell-commits] darcs: ghc: Import patch forgotten by Iain

Joachim Breitner mail at joachim-breitner.de
Tue Oct 18 21:43:26 UTC 2011


Tue Oct 18 20:21:07 UTC 2011  Joachim Breitner <mail at joachim-breitner.de>
  * Import patch forgotten by Iain
  Ignore-this: 9d336128fa60b28a759622beb7ad3917

    A ./patches/improve_linker_script_handling

Tue Oct 18 20:21:07 UTC 2011  Joachim Breitner <mail at joachim-breitner.de>
  * Import patch forgotten by Iain
  Ignore-this: 9d336128fa60b28a759622beb7ad3917
diff -rN -u old-ghc//patches/improve_linker_script_handling new-ghc//patches/improve_linker_script_handling
--- old-ghc//patches/improve_linker_script_handling	1970-01-01 00:00:00.000000000 +0000
+++ new-ghc//patches/improve_linker_script_handling	2011-10-18 21:43:25.707671946 +0000
@@ -0,0 +1,37 @@
+* Handle linker scripts for which dlopen returns "file too short" (for
+  example libncurses.so). Also support INPUT commands in linker scripts.
+
+  Taken from upstream commits 44315e136cf9bc994185e689babec649c127e045 and
+  a8c51c335cfa5201acf80a8d57d0d19b2779d5bc
+
+Iain Lane <laney at debian.org>
+
+Index: ghc-7.0.3/rts/Linker.c
+===================================================================
+--- ghc-7.0.3.orig/rts/Linker.c	2011-09-06 00:09:58.486412360 +0100
++++ ghc-7.0.3/rts/Linker.c	2011-09-06 00:10:10.721919762 +0100
+@@ -1182,11 +1182,11 @@
+ #   endif /* RTLD_DEFAULT */
+ 
+     compileResult = regcomp(&re_invalid,
+-           "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*invalid ELF header",
++           "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short)",
+            REG_EXTENDED);
+     ASSERT( compileResult == 0 );
+     compileResult = regcomp(&re_realso,
+-           "GROUP *\\( *(([^ )])+)",
++           "(GROUP|INPUT) *\\( *(([^ )])+)",
+            REG_EXTENDED);
+     ASSERT( compileResult == 0 );
+ #   endif
+@@ -1357,8 +1357,8 @@
+          if (regexec(&re_realso, line, (size_t) NMATCH, match, 0) == 0) {
+             // success -- try to dlopen the first named file
+             IF_DEBUG(linker, debugBelch("match%s\n",""));
+-            line[match[1].rm_eo] = '\0';
+-            errmsg = internal_dlopen(line+match[1].rm_so);
++            line[match[2].rm_eo] = '\0';
++            errmsg = internal_dlopen(line+match[2].rm_so);
+             break;
+          }
+          // if control reaches here, no GROUP ( ... ) directive was found





More information about the Pkg-haskell-commits mailing list