pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/ghc7 patches/patch-rts_ghc.mk: dtrace hack is no ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/79df4eed0815
branches:  trunk
changeset: 646250:79df4eed0815
user:      pho <pho%pkgsrc.org@localhost>
date:      Fri Feb 06 01:24:48 2015 +0000

description:
patches/patch-rts_ghc.mk: dtrace hack is no longer needed

The problem only occurs when $(WhatGccIsCalled) is an absolute path to
the "real" gcc (e.g. "/usr/bin/gcc"), which happens if we run
${WRKSRC}/configure with an option something like
"--with-gcc=/usr/bin/gcc". As long as we use "--with-gcc" with a
command name (i.e. ${CC}, not ${CCPATH}), everything works fine
without any problems.

This is because dtrace(1) executes cpp in a rather weird way: it calls
execvp("/usr/bin/gcc", argv) with argv set to {"gcc", "-E", "-xc",
...}, not {"/usr/bin/gcc", "-E", "-xc", ...}.

When GCC is called that way, it needs to find platform-specific
subprograms by walking through ${PATH}. And if it sees an executable
named "gcc" which in fact isn't actually gcc, it gets confused and
dies with an error:

  % cat dtrace-emu.c
  #include <unistd.h>
  #include <stdio.h>
  int main() {
      char *argv[] = {"gcc", "-E", NULL};
      execvp("/usr/bin/gcc", argv);
      return 0;
  }
  % gcc dtrace-emu.c -o /tmp/gcc
  % /tmp/gcc
  powerpc-apple-darwin9-gcc-4.0.1: no input files
  % PATH=/tmp/gcc /tmp/gcc
  gcc: installation problem, cannot exec '/tmp/powerpc-apple-darwin9-gcc-4.0.1':
  No such file or directory

And even if the problem should really be addressed, it should be done
in the wrapper framework because dtrace(1) is actually a part of
compiler toolchain.

diffstat:

 lang/ghc7/distinfo                 |   4 ++--
 lang/ghc7/patches/patch-rts_ghc.mk |  27 ++++-----------------------
 2 files changed, 6 insertions(+), 25 deletions(-)

diffs (64 lines):

diff -r 77a28ff7fc64 -r 79df4eed0815 lang/ghc7/distinfo
--- a/lang/ghc7/distinfo        Thu Feb 05 22:40:07 2015 +0000
+++ b/lang/ghc7/distinfo        Fri Feb 06 01:24:48 2015 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2015/02/05 17:45:20 pho Exp $
+$NetBSD: distinfo,v 1.8 2015/02/06 01:24:48 pho Exp $
 
 SHA1 (ghc-7.6.3-src.tar.bz2) = 8938e1ef08b37a4caa071fa169e79a3001d065ff
 RMD160 (ghc-7.6.3-src.tar.bz2) = 82a673ed38b7cf9a59afeb01057625fc761a822b
@@ -13,4 +13,4 @@
 SHA1 (patch-mk_config.mk.in) = 90a156f6c455d4b2c5d10fdf65b3a170dcfc4892
 SHA1 (patch-rts_Linker.c) = 39d1ca7a856a3ec25e493e97832ef255562c0719
 SHA1 (patch-rts_StgCRun.c) = 5d4010dc250af25db0b5b2717c510752f4813e73
-SHA1 (patch-rts_ghc.mk) = 8e9c3a6a2585f0c753f37c00c8991f2fd8524570
+SHA1 (patch-rts_ghc.mk) = 3ef8635ad954df9149aa90046de3a73de186c280
diff -r 77a28ff7fc64 -r 79df4eed0815 lang/ghc7/patches/patch-rts_ghc.mk
--- a/lang/ghc7/patches/patch-rts_ghc.mk        Thu Feb 05 22:40:07 2015 +0000
+++ b/lang/ghc7/patches/patch-rts_ghc.mk        Fri Feb 06 01:24:48 2015 +0000
@@ -1,16 +1,6 @@
-$NetBSD: patch-rts_ghc.mk,v 1.4 2015/02/05 17:45:20 pho Exp $
-
-Hunk #2:
-
-This is pkgsrc specific: dtrace(1) gets confused when we have gcc
-wrappers in the PATH so we have to hide them:
+$NetBSD: patch-rts_ghc.mk,v 1.5 2015/02/06 01:24:48 pho Exp $
 
-  gcc: installation problem, cannot exec '/usr/pkgsrc/wip/ghc/work/.gcc/bin/p
-  owerpc-apple-darwin9-gcc-4.0.1': No such file or directory
-  dtrace: failed to compile script rts/RtsProbes.d: Preprocessor failed to pr
-  ocess input program
-
-Hunk #1, #3:
+This is pkgsrc specific:
 
 Install libffi.{a,la} too, so that the plist framework can deal with
 .so name being different between platforms. Note that
@@ -27,8 +17,8 @@
 can't be achieved without a major refactoring of the GHC build system.
 And for that matter, GHC shouldn't install a local copy of libffi in
 the first place. In fact GHC 7.8 seems to have a configure option
-"--with-system-libffi" so we can hopefully remove these unpleasant
-hunks in the future.
+"--with-system-libffi" so we can hopefully remove this rather
+unpleasant patch in the future.
 
 --- rts/ghc.mk.orig    2013-04-18 21:22:47.000000000 +0000
 +++ rts/ghc.mk
@@ -42,15 +32,6 @@
  
  rts/dist/build/$(LIBFFI_DLL): libffi/build/inst/bin/$(LIBFFI_DLL)
        cp $< $@
-@@ -484,7 +485,7 @@ endif
- 
- DTRACEPROBES_SRC = rts/RtsProbes.d
- $(DTRACEPROBES_H): $(DTRACEPROBES_SRC) includes/ghcplatform.h | $$(dir $$@)/.
--      "$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $<
-+      env PATH="/usr/bin" "$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $<
- endif
- 
- # -----------------------------------------------------------------------------
 @@ -509,7 +510,8 @@ endif
  # installing
  



Home | Main Index | Thread Index | Old Index