Commit edc4543b authored by dterei's avatar dterei
Browse files

Merge branch 'master' of http://darcs.haskell.org/ghc

parents 72bfc815 4bc413de
......@@ -251,6 +251,16 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
[HaskellHaveSubsectionsViaSymbols=False
AC_MSG_RESULT(no)])
dnl ** check for .ident assembler directive
AC_MSG_CHECKING(whether your assembler supports .ident directive)
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([__asm__ (".ident \"GHC x.y.z\"");])],
[AC_MSG_RESULT(yes)
HaskellHaveIdentDirective=True],
[AC_MSG_RESULT(no)
HaskellHaveIdentDirective=False])
dnl *** check for GNU non-executable stack note support (ELF only)
dnl (.section .note.GNU-stack,"",@progbits)
......@@ -283,6 +293,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
AC_SUBST(HaskellTargetArch)
AC_SUBST(HaskellTargetOs)
AC_SUBST(HaskellHaveSubsectionsViaSymbols)
AC_SUBST(HaskellHaveIdentDirective)
AC_SUBST(HaskellHaveGnuNonexecStack)
])
......
......@@ -497,7 +497,7 @@ compiler/hsSyn/HsLit_HC_OPTS += -fomit-interface-pragmas
endif
# LibFFI.hs #includes ffi.h
compiler/stage2/build/LibFFI.hs : $(ffi_HEADER)
compiler/stage2/build/LibFFI.hs : $(libffi_HEADERS)
# On Windows it seems we also need to link directly to libffi
ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
define windowsDynLinkToFfi
......
......@@ -193,6 +193,7 @@ initSysTools mbMinusB
; targetArch <- readSetting "target arch"
; targetOS <- readSetting "target os"
; targetHasGnuNonexecStack <- readSetting "target has GNU nonexec stack"
; targetHasIdentDirective <- readSetting "target has .ident directive"
; targetHasSubsectionsViaSymbols <- readSetting "target has subsections via symbols"
; myExtraGccViaCFlags <- getSetting "GCC extra via C opts"
-- On Windows, mingw is distributed with GHC,
......@@ -257,6 +258,7 @@ initSysTools mbMinusB
platformArch = targetArch,
platformOS = targetOS,
platformHasGnuNonexecStack = targetHasGnuNonexecStack,
platformHasIdentDirective = targetHasIdentDirective,
platformHasSubsectionsViaSymbols = targetHasSubsectionsViaSymbols
},
sTmpDir = normalise tmpdir,
......
......@@ -525,12 +525,15 @@ makeImportsDoc dflags imports
(if platformHasGnuNonexecStack (targetPlatform dflags)
then Pretty.text ".section .note.GNU-stack,\"\",@progbits"
else Pretty.empty)
Pretty.$$
-- And just because every other compiler does, lets stick in
-- an identifier directive: .ident "GHC x.y.z"
Pretty.$$ let compilerIdent = Pretty.text "GHC" Pretty.<+>
Pretty.text cProjectVersion
in Pretty.text ".ident" Pretty.<+>
Pretty.doubleQuotes compilerIdent
(if platformHasIdentDirective (targetPlatform dflags)
then let compilerIdent = Pretty.text "GHC" Pretty.<+>
Pretty.text cProjectVersion
in Pretty.text ".ident" Pretty.<+>
Pretty.doubleQuotes compilerIdent
else Pretty.empty)
where
-- Generate "symbol stubs" for all external symbols that might
......
......@@ -23,6 +23,7 @@ data Platform
platformArch :: Arch,
platformOS :: OS,
platformHasGnuNonexecStack :: Bool,
platformHasIdentDirective :: Bool,
platformHasSubsectionsViaSymbols :: Bool
}
deriving (Read, Show, Eq)
......
......@@ -929,6 +929,7 @@ $(eval $(call bindist,.,\
$(includes_H_FILES) \
$(includes_DERIVEDCONSTANTS) \
$(includes_GHCCONSTANTS) \
$(libffi_HEADERS) \
$(INSTALL_LIBEXECS) \
$(INSTALL_LIBEXEC_SCRIPTS) \
$(INSTALL_TOPDIRS) \
......@@ -1207,9 +1208,10 @@ maintainer-clean : distclean
.PHONY: all_libraries
.PHONY: bootstrapping-files
bootstrapping-files: includes/ghcautoconf.h
bootstrapping-files: includes/DerivedConstants.h
bootstrapping-files: includes/GHCConstants.h
bootstrapping-files: $(includes_H_CONFIG)
bootstrapping-files: $(includes_DERIVEDCONSTANTS)
bootstrapping-files: $(includes_GHCCONSTANTS)
bootstrapping-files: $(libffi_HEADERS)
.DELETE_ON_ERROR:
......
......@@ -32,7 +32,8 @@ libffi_EnableShared = no
endif
libffi_STATIC_LIB = libffi/build/inst/lib/libffi.a
ffi_HEADER = rts/dist/build/ffi.h
libffi_HEADERS = rts/dist/build/ffi.h \
rts/dist/build/ffitarget.h
ifeq "$(OSTYPE)" "cygwin"
LIBFFI_PATH_MANGLE = PATH=$$(cygpath "$(TOP)")/libffi:$$PATH; export PATH;
......@@ -101,9 +102,8 @@ $(libffi_STAMP_INSTALL): $(libffi_STAMP_BUILD) $(TOUCH_DEP)
$(libffi_STATIC_LIB): $(libffi_STAMP_INSTALL)
@test -f $@ || { echo "$< exists, but $@ does not."; echo "Suggest removing $<."; exit 1; }
$(ffi_HEADER): $(libffi_STAMP_INSTALL) | $$(dir $$@)/.
cp libffi/build/inst/lib/libffi-*/include/ffitarget.h $(dir $@)
cp libffi/build/inst/lib/libffi-*/include/ffi.h $@
$(libffi_HEADERS): $(libffi_STAMP_INSTALL) | $$(dir $$@)/.
cp -f libffi/build/inst/lib/libffi-*/include/$(notdir $@) $@
$(eval $(call clean-target,libffi,, \
libffi/build $(wildcard libffi/stamp.ffi.*) libffi/dist-install))
......
......@@ -284,6 +284,9 @@ stg_casMutVarzh
if (h != old) {
RET_NP(1,h);
} else {
if (GET_INFO(mv) == stg_MUT_VAR_CLEAN_info) {
foreign "C" dirty_MUT_VAR(BaseReg "ptr", mv "ptr") [];
}
RET_NP(0,h);
}
}
......
......@@ -455,7 +455,7 @@ endif
$(eval $(call dependencies,rts,dist,1))
$(rts_dist_depfile_c_asm) : $(ffi_HEADER) $(DTRACEPROBES_H)
$(rts_dist_depfile_c_asm) : $(libffi_HEADERS) $(DTRACEPROBES_H)
# -----------------------------------------------------------------------------
# compile dtrace probes if dtrace is supported
......@@ -507,6 +507,13 @@ INSTALL_LIBS += $(ALL_RTS_LIBS)
INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*)
INSTALL_LIBS += $(wildcard rts/dist/build/libffi-5.dll)
install: install_libffi_headers
.PHONY: install_libffi_headers
install_libffi_headers :
$(call INSTALL_DIR,"$(DESTDIR)$(ghcheaderdir)")
$(call INSTALL_HEADER,$(INSTALL_OPTS),$(libffi_HEADERS),"$(DESTDIR)$(ghcheaderdir)/")
# -----------------------------------------------------------------------------
# cleaning
......
......@@ -51,7 +51,7 @@ extra-libraries:
#ifdef INSTALLING
include-dirs: INCLUDE_DIR PAPI_INCLUDE_DIR
#else /* !INSTALLING */
include-dirs: TOP"/includes" TOP"/includes/dist-ghcconstants/header" TOP"/includes/dist-derivedconstants/header"
include-dirs: TOP"/rts/dist/build" TOP"/includes" TOP"/includes/dist-ghcconstants/header" TOP"/includes/dist-derivedconstants/header"
#endif
includes: Stg.h
......
......@@ -226,7 +226,7 @@ forkOS_createThreadWrapper ( void * entry )
{
Capability *cap;
cap = rts_lock();
cap = rts_evalStableIO(cap, (HsStablePtr) entry, NULL);
rts_evalStableIO(&cap, (HsStablePtr) entry, NULL);
rts_unlock(cap);
return 0;
}
......
......@@ -153,9 +153,9 @@ ioManagerStart (void)
if (io_manager_event == INVALID_HANDLE_VALUE) {
cap = rts_lock();
#if defined(mingw32_HOST_OS) && defined(__PIC__)
rts_evalIO(cap,_imp__base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);
rts_evalIO(&cap,_imp__base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);
#else
rts_evalIO(cap,&base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);
rts_evalIO(&cap,&base_GHCziConcziIO_ensureIOManagerIsRunning_closure,NULL);
#endif
rts_unlock(cap);
}
......
......@@ -11,6 +11,7 @@
("target os", "@HaskellTargetOs@"),
("target arch", "@HaskellTargetArch@"),
("target has GNU nonexec stack", "@HaskellHaveGnuNonexecStack@"),
("target has .ident directive", "@HaskellHaveIdentDirective@"),
("target has subsections via symbols", "@HaskellHaveSubsectionsViaSymbols@")
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment