1. 14 Jan, 2005 1 commit
    • wolfgang's avatar
      [project @ 2005-01-14 08:01:26 by wolfgang] · 4f457f34
      wolfgang authored
      Dynamic Linking, Part 2:
      
      Hack the Makefiles to build dynamic libraries.
      This allows you to actually use dynamic libraries to greatly reduce binary
      sizes on Darwin/PowerPC and on powerpc64-linux (for now).
      
      To use this, add the following to your build.mk
      
      SplitObjs=NO
      GhcBuildDylibs=YES
      GhcStage2HcOpts=-dynamic
      GhcLibHcOpts+=-fPIC -dynamic
      GhcRtsHcOpts+=-fPIC -dynamic
      GHC_CC_OPTS+=-fPIC
      
      (You can leave out the last three lines on powerpc64-linux).
      
      Then, to compile a program using dynamic libraries, pass the -dynamic option to GHC.
      To make GHCi use the dynamic libraries instead of .o files, just delete the HS*.o files.
      
      The dynamic library files are named libHSfoo_dyn.dylib or libHSfoo_dyn.so.
      
      Note that the dynamic and static libraries are build from the same .o files,
      but we really want to build the static libraries with SplitObjs and without
      -fPIC -dynamic to achieve better code size and performance.
      
      ghc/compiler/ghci/Linker.lhs:
          When looking for a library, look for HSfoo.o first (as before),
          then look for libHSfoo_dyn.[so/dylib] before looking for
          libHSfoo.[so/dylib].
      
      ghc/compiler/main/DriverPipeline.hs:
          Main.dll_o and PrelMain.dll_o are dead, at least for now.
      
      ghc/compiler/main/Packages.lhs:
          When -dynamic is specified, add "_dyn" to all libraries specified in
          hs-libraries (not to the extra-libs).
      
      ghc/lib/compat/Makefile:
          Never build libghccompat as a dynamic lib.
      
      mk/package.mk:
          if GhcBuildDylibs is set to YES, build dynamic libraries.
      
      mk/target.mk:
          When installing .dylibs (Darwin only), update the install_name to point
          to the final location.
          (Somebody please read Apple's documentation on what install_names are,
          and then comment on whether this is a useful feature or whether it should
          be done the "normal" unix way).
      4f457f34
  2. 13 Jan, 2005 10 commits
  3. 12 Jan, 2005 12 commits
  4. 11 Jan, 2005 9 commits
  5. 10 Jan, 2005 8 commits
    • krasimir's avatar
      [project @ 2005-01-10 23:48:07 by krasimir] · 3410e077
      krasimir authored
      createDirectoryIfMissing is added to Compat.Directory and is used in ghc-pkg.
      The mingw32_HOST_OS is replaced with mingw32_TARGET_OS. I don't know why but
      prior the last commit the tool was working with mingw32_HOST_OS fine but not
      it isn't. Maybe I miss something. Simon, could you check whether the patch is
      fine?
      3410e077
    • wolfgang's avatar
      [project @ 2005-01-10 23:00:53 by wolfgang] · 55c60479
      wolfgang authored
      Fix for AIX-like ABIs.
      55c60479
    • panne's avatar
      [project @ 2005-01-10 19:01:27 by panne] · 7a8bd246
      panne authored
      Refactored and cleaned up ld-related tests. Only tested mildly under Linux.
      7a8bd246
    • wolfgang's avatar
      [project @ 2005-01-10 18:44:38 by wolfgang] · 0aca2f00
      wolfgang authored
      Handle foreign import wrapper properly for MacOS X, powerpc64-linux and AIX.
      Only Mac OS X tested so far.
      Pass information about argument types from DsForeign to createAdjustor encoded
      as a string ('i' for integers, 'f' for floats, 'd' for doubles and 'l' for
      long [64bit] integers).
      0aca2f00
    • simonmar's avatar
      [project @ 2005-01-10 16:24:16 by simonmar] · 5908f01a
      simonmar authored
      Add *.S to $(C_SRCS).  Seems to do the right thing, including  mkdependC.
      5908f01a
    • simonmar's avatar
      [project @ 2005-01-10 13:53:14 by simonmar] · cad81487
      simonmar authored
      Obscure bugfix affecting foreign import "wrapper" with non-word-sized
      argument types (eg. Double) on Windows.  The list of arguments types
      returned by dsFExport was the boxed types, rather than the unboxed
      types, so dsFExportDynamic couldn't get the correct sizes of the
      argument types to the stub function.
      
      It's more correct now, but not totally correct (see the comment for
      details).
      
      Noticed by: Wolfgang Thaller.
      cad81487
    • simonmar's avatar
      [project @ 2005-01-10 12:34:21 by simonmar] · 038f8bb5
      simonmar authored
      Remove copied definitions for joinFileName, splitFileName:
      System.FilePath is in libghccompat now.
      038f8bb5
    • simonmar's avatar
      [project @ 2005-01-10 11:45:19 by simonmar] · f13895fc
      simonmar authored
      Work around problems caused by limit on the length of the command line
      in ld, which shows up when building OpenGL on Windows with SplitObjs=YES.
      
      We now pass the names of the input files to ld via a linker script.
      This is (probably) only supported by GNU ld, so we now have to detect
      GNU ld in the configure script (yawn) and back off to the old method
      if we don't have it.
      f13895fc