| @@ -1,39 +1,63 @@ | | | @@ -1,39 +1,63 @@ |
1 | $NetBSD: patch-rts_ghc.mk,v 1.3 2014/05/24 04:49:40 obache Exp $ | | 1 | $NetBSD: patch-rts_ghc.mk,v 1.4 2015/02/05 17:45:20 pho Exp $ |
| | | 2 | |
| | | 3 | Hunk #2: |
2 | | | 4 | |
3 | This is pkgsrc specific: dtrace(1) gets confused when we have gcc | | 5 | This is pkgsrc specific: dtrace(1) gets confused when we have gcc |
4 | wrappers in the PATH so we have to hide them: | | 6 | wrappers in the PATH so we have to hide them: |
5 | | | 7 | |
6 | gcc: installation problem, cannot exec '/usr/pkgsrc/wip/ghc/work/.gcc/bin/p | | 8 | gcc: installation problem, cannot exec '/usr/pkgsrc/wip/ghc/work/.gcc/bin/p |
7 | owerpc-apple-darwin9-gcc-4.0.1': No such file or directory | | 9 | owerpc-apple-darwin9-gcc-4.0.1': No such file or directory |
8 | dtrace: failed to compile script rts/RtsProbes.d: Preprocessor failed to pr | | 10 | dtrace: failed to compile script rts/RtsProbes.d: Preprocessor failed to pr |
9 | ocess input program | | 11 | ocess input program |
10 | | | 12 | |
11 | Also install libffi.{a,la} so we can expand to figure out .so extensions. | | 13 | Hunk #1, #3: |
| | | 14 | |
| | | 15 | Install libffi.{a,la} too, so that the plist framework can deal with |
| | | 16 | .so name being different between platforms. Note that |
| | | 17 | "libffi$(soext)*" matches to libffi.{so,so.6,so.6.0} but not to |
| | | 18 | libffi.6.dylib so the pattern must be corrected to "libffi*$(soext)*", |
| | | 19 | otherwise libtool-expand will emit the following error on Mach-O |
| | | 20 | platforms: |
| | | 21 | |
| | | 22 | libtool-expand: `lib/ghc-7.6.3/libffi.6.dylib' was not found |
| | | 23 | |
| | | 24 | For what it's worth, this ain't the right way to install libtool |
| | | 25 | libraries. They should always be installed by running |
| | | 26 | "libtool --mode=install install -c foo.la /path/to/destination", which |
| | | 27 | can't be achieved without a major refactoring of the GHC build system. |
| | | 28 | And for that matter, GHC shouldn't install a local copy of libffi in |
| | | 29 | the first place. In fact GHC 7.8 seems to have a configure option |
| | | 30 | "--with-system-libffi" so we can hopefully remove these unpleasant |
| | | 31 | hunks in the future. |
12 | | | 32 | |
13 | --- rts/ghc.mk.orig 2013-04-18 21:22:47.000000000 +0000 | | 33 | --- rts/ghc.mk.orig 2013-04-18 21:22:47.000000000 +0000 |
14 | +++ rts/ghc.mk | | 34 | +++ rts/ghc.mk |
15 | @@ -114,6 +114,7 @@ $(rts_ffi_objs_stamp): $(libffi_STATIC_L | | 35 | @@ -113,7 +113,8 @@ $(rts_ffi_objs_stamp): $(libffi_STATIC_L |
| | | 36 | # This is a little hacky. We don't know the SO version, so we only |
16 | # depend on libffi.so, but copy libffi.so* | | 37 | # depend on libffi.so, but copy libffi.so* |
17 | rts/dist/build/libffi$(soext): libffi/build/inst/lib/libffi$(soext) | | 38 | rts/dist/build/libffi$(soext): libffi/build/inst/lib/libffi$(soext) |
18 | cp libffi/build/inst/lib/libffi$(soext)* rts/dist/build | | 39 | - cp libffi/build/inst/lib/libffi$(soext)* rts/dist/build |
| | | 40 | + cp libffi/build/inst/lib/libffi*$(soext)* rts/dist/build |
19 | + cp libffi/build/inst/lib/libffi.*a rts/dist/build | | 41 | + cp libffi/build/inst/lib/libffi.*a rts/dist/build |
20 | | | 42 | |
21 | rts/dist/build/$(LIBFFI_DLL): libffi/build/inst/bin/$(LIBFFI_DLL) | | 43 | rts/dist/build/$(LIBFFI_DLL): libffi/build/inst/bin/$(LIBFFI_DLL) |
22 | cp $< $@ | | 44 | cp $< $@ |
23 | @@ -484,7 +485,7 @@ endif | | 45 | @@ -484,7 +485,7 @@ endif |
24 | | | 46 | |
25 | DTRACEPROBES_SRC = rts/RtsProbes.d | | 47 | DTRACEPROBES_SRC = rts/RtsProbes.d |
26 | $(DTRACEPROBES_H): $(DTRACEPROBES_SRC) includes/ghcplatform.h | $$(dir $$@)/. | | 48 | $(DTRACEPROBES_H): $(DTRACEPROBES_SRC) includes/ghcplatform.h | $$(dir $$@)/. |
27 | - "$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $< | | 49 | - "$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $< |
28 | + env PATH="/usr/bin" "$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $< | | 50 | + env PATH="/usr/bin" "$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $< |
29 | endif | | 51 | endif |
30 | | | 52 | |
31 | # ----------------------------------------------------------------------------- | | 53 | # ----------------------------------------------------------------------------- |
32 | @@ -510,6 +511,7 @@ endif | | 54 | @@ -509,7 +510,8 @@ endif |
| | | 55 | # installing |
33 | | | 56 | |
34 | INSTALL_LIBS += $(ALL_RTS_LIBS) | | 57 | INSTALL_LIBS += $(ALL_RTS_LIBS) |
35 | INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*) | | 58 | -INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*) |
| | | 59 | +INSTALL_LIBS += $(wildcard rts/dist/build/libffi*$(soext)*) |
36 | +INSTALL_LIBS += $(wildcard rts/dist/build/libffi.*a) | | 60 | +INSTALL_LIBS += $(wildcard rts/dist/build/libffi.*a) |
37 | INSTALL_LIBS += $(wildcard rts/dist/build/$(LIBFFI_DLL)) | | 61 | INSTALL_LIBS += $(wildcard rts/dist/build/$(LIBFFI_DLL)) |
38 | | | 62 | |
39 | install: install_libffi_headers | | 63 | install: install_libffi_headers |