Why doesn't cabal install use the flag --enable-shared by default? I've notice that trivial programs when compiled without this flag, get huge in file size. Is there a connection? Is this a design choice related to how Haskell programs are ment to be easily deployed in a single self-contained binary?
Haskell Static vs Dynamic Linking in Deployment
2k Views Asked by Nordlöw At
1
There are 1 best solutions below
Related Questions in DEPLOYMENT
- Can I deploy multiple instances of my application on the same windows phone?
- Deploy enterprise (in-house) application on windows phone without developer unlocking the phone?
- uninitialized constant ActiveMerchant::Billing::CreditCard::Validateable (NameError) - in Spree shop
- How to Continuously Develop and Deploy an Access 2010 Database Application
- Efficient way of organizaing mail sending from Rails app
- Deployment over GPRS to embedded devices
- Weblogic 12c web application not start properly after server reboot
- Deployment in Weblogic 10.3, how to change properties
- Deployed Version of MVC Site Not Working
- Laravel 5 on shared hosting getting internal server error
- Integration between Java Applets and .Net dll
- Capistrano Rails deploy with new migration files
- EF Code First - Multiple Application Versions Sharing A Database
- Docker: How to create a stack, multiple images or one base image?
- Slow wpf startup due to publish policy... maybe
Related Questions in HASKELL
- Cabal sandbox is using a global dependency. Could not resolve
- Haskell lens: let binding of Traversal'
- How can I parse fixed-length, non-delimited integers with attoparsec?
- Pipeline-like operation using TChan
- compile-time vs. run-time cost of Hamlet templates
- Date-time package in haskell - error in the current one, can't find an analog
- How does one debug infinite recursion in Haskell?
- Force GHC using local files
- List with random numbers in Haskell
- Changes in other elements based on listbox selections in threepenny-gui
- Multithreading and gtk2hs
- Operator section for applicative with <$> and <*>
- Unable to create a custom header to use it in "withManager"
- How do I reuse an intermediate value in chain of Haskell Either binds?
- Haskell, Tree problems
Related Questions in DYNAMIC-LINKING
- CMake `link_directories` for libstdc++.so
- Contiki - Run-time linking of a loadable module containing reference to another loadable module is possible?
- Turning a statically linked library into a dynamic one
- Boost unit test dynamic linking on Ubuntu
- arm-linux libstdc++ difference in debug and release
- loading shared library into shared memory
- Can a UWP program load plugin?
- library not found although I use ldconfig and /etc/ld.so.conf.d/lib.conf
- How do I implement Android Firebase dynamic links without a website?
- g++ -fPIC not producing position independent code
- Finding virtual memory address of variable on osx
- How can I "register" my library libfoo.so to link it with `-lfoo`?
- Resolving symbols differently in different dynamically loaded objects
- g++ linking a static library into a dynamic library (without -fPIC)
- cmake linking shared libraries on ubuntu
Related Questions in STATIC-LINKING
- How do i use a bunch of .h and .cpp files to create a static library that can be used in another c++ Project
- error lnk2019 unresolved external symbol public __thiscall sfml audio module
- Turning a statically linked library into a dynamic one
- Link errors during Static linking of OCCI/ OCI programs in Oracle 12c
- Go program not statically linked using 1.4.2
- Statically link OpenSSL in XCode
- Unreal Engine 4 linking static 3rd party library/SDK (libZPlay)
- How to know which 'sin' function does my program invoke when running?
- How to force libraries to link statically in qt creator
- Singleton across compilation units: linking library vs linking objects
- Is it possible to artificially induce object file extraction for a given static library?
- why executable is smaller than the library which is statically linked with application project?
- "Undefined reference to dlopen" when statically linking with gcc
- '-l' flag makes no difference in linking
- g++ linking a static library into a dynamic library (without -fPIC)
Related Questions in CODE-SIZE
- Static Library; Unused Symbols; Definitions in Header
- What does the compiler optimization "constant propagation" mean?
- Haskell Static vs Dynamic Linking in Deployment
- How to compress or do size optimization for large static sparse array in C
- compress or size optimization for large sparse array in C
- Which GCC optimization flags affect binary size the most?
- What are some techniques or tools for profiling excessive code size in C/C++ applications?
- How to measure Code Size?
- Reducing Compiled Code Size Dramatically by Factoring-Out a void Pointer
- Open Source or Freeware C Code Metrics tools?
- Why does a simple C program consumes a lot of disk space?
- Should I define constants for repeating literals in the code?
- Do trait default function implementations cause code bloat the same way generics do?
- C++ Templates - code usage, size of binary
- Assembly “Hello world” execution file less than 20 bytes
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I think it has to do with lack of support. However, I can't get a straight answer as to whether or not GHC currently supports dynamic linking. The GHC wiki page SharedLibraries/PlatformSupport is two years old.
On Windows, I tried building a whole bunch of packages with
--enable-shared, including a simple program I wrote that uses http-enumerator to download from a URL every 30 seconds. When I ran the program (after putting all the DLLs in a folder with my program), it segfaulted after a few seconds. When I compiled with--threaded, it segfaulted immediately.I tried this in GHC 7.0.3. A documentation page for that version says:
This notice does not appear in later versions.
By the way there's another hassle to static binaries besides code size. GHC uses GMP for its big integer support. GMP is licensed under the LGPL. This means that if you need to distribute a proprietary binary, or if you have a dependency that is not GPL-compatible (e.g. OpenSSL), you will need to distribute your object files to comply with GMP's license. Either that, or find a way to get libgmp to be dynamically linked. I would like to know how to do that.