summaryrefslogtreecommitdiff
path: root/rules/distdir-way-opts.mk
Commit message (Collapse)AuthorAgeFilesLines
* Drop duplicate -optl's from GHC invocationsBen Gamari2019-10-231-2/+2
| | | | | | | | | | | | | Previously the make build system would pass things like `-optl-optl-Wl,-x -optl-optl-Wl,noexecstack` to GHC. This would naturally result in mass confusion as GHC would pass `-optl-Wl,-x` to GCC. GCC would in turn interpret this as `-o ptl-Wl,-x`, setting the output pass of the invocation. The problem that `-optl` was added to the command-line in two places in the build system. Fix this. Fixes #17385.
* Update Wiki URLs to point to GitLabTakenobu Tani2019-03-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This moves all URL references to Trac Wiki to their corresponding GitLab counterparts. This substitution is classified as follows: 1. Automated substitution using sed with Ben's mapping rule [1] Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy... New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy... 2. Manual substitution for URLs containing `#` index Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz 3. Manual substitution for strings starting with `Commentary` Old: Commentary/XxxYyy... New: commentary/xxx-yyy... See also !539 [1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
* Rip out object splittingBen Gamari2019-03-051-1/+0
| | | | | | | | | | | | | | | The splitter is an evil Perl script that processes assembler code. Its job can be done better by the linker's --gc-sections flag. GHC passes this flag to the linker whenever -split-sections is passed on the command line. This is based on @DemiMarie's D2768. Fixes Trac #11315 Fixes Trac #9832 Fixes Trac #8964 Fixes Trac #8685 Fixes Trac #8629
* Support generating HIE filesAlec Theriault2018-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | Adds a `-fenable-ide-info` flag which instructs GHC to generate `.hie` files (see the wiki page: https://ghc.haskell.org/trac/ghc/wiki/HIEFiles). This is a rebased version of Zubin Duggal's (@wz1000) GHC changes for his GSOC project, as posted here: https://gist.github.com/wz1000/5ed4ddd0d3e96d6bc75e095cef95363d. Test Plan: ./validate Reviewers: bgamari, gershomb, nomeata, alanz, sjakobi Reviewed By: alanz, sjakobi Subscribers: alanz, hvr, sjakobi, rwbarton, wz1000, carter Differential Revision: https://phabricator.haskell.org/D5239
* Remove makefile logic for legacy -this-package-keyHerbert Valerio Riedel2017-09-091-10/+0
| | | | | | This isn't needed anymore as we don't support GHC < 8 anymore. This is a follow-up to 122f183
* Remove dll-split.Tamar Christina2017-08-291-8/+0
| | | | | | | | | | | | | | | | | | | | This patch removes dll-split from the code base, the reason is dll-split no longer makes any sense. It was designed to split a dll in two, but we now already have many more symbols than would fit inside two dlls. So we need a third one. This means there's no point in having to maintain this list as it'll never work anyway and the solution isn't scalable. Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, #ghc_windows_task_force GHC Trac Issues: #5987 Differential Revision: https://phabricator.haskell.org/D3882
* rules: add per-library EXTRA_HC_OPTSSergei Trofimovich2017-05-251-0/+1
| | | | | | | | | | | | | | | | Sometimes it's handy to change a compiler flag for a library in stage{0,1,2}. Usage example: libraries/binary_EXTRA_HC_OPTS += -O1 libraries/containers_EXTRA_HC_OPTS += -O1 libraries/bytestring_EXTRA_HC_OPTS += -O1 Here override default -O2 defined in .cabal files for these libraries to speed build up. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Apply SplitSections to all C compilationsSimon Brenner2017-02-111-1/+2
| | | | | | | | | | | | | | | | | | | Previously this was added only to the RTS's C files (those are the bulk of it though), but there are C bits in ghc-prim, integer-gmp and base too. Followup for #8405, allows the large table of character properties in base to be stripped when not used. Test Plan: validate Reviewers: austin, bgamari, simonmar Reviewed By: bgamari Subscribers: thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3121
* fix OpenBSD linkage (wxneeded)Sergei Trofimovich2016-12-171-2/+3
| | | | | | | | | | | | | | | | | | | | There is two types of options passed directly to 'ld' (and not to 'gcc' driver): - CONF_LD_LINKER_OPTS_STAGE$4 - EXTRA_LD_OPTS This changedoes two things: - split 'EXTRA_LD_OPTS' into two variables: - EXTRA_LD_OPTS (accepts 'gcc' wrapper options) - EXTRA_LD_LINKER_OPTS (accepts raw 'ld' options) - wraps all LD_LINKER options as '-Wl,' when passed to 'gcc' driver. Fixes https://phabricator.haskell.org/D2776 Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* revert '-Wl' prefixing to *_LD_OPTSSergei Trofimovich2016-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts f48f5a9ebf384e1e157b7b413e1d779f4289ddd2 The prefixing does not work as comma is stripped by $(addprefix) macro: The following call $$(addprefix -optl-Wl, $$($1_$2_$3_ALL_LD_OPTS)) prefixes options with "-optl-Wl" not with "-optl-Wl," The simplest breakage can be seen by adding SRC_LD_OPTS += -O1 to mk/build.mk: <no location info>: error: Warning: Couldn't figure out linker information! Make sure you're using GNU ld, GNU gold or the built in OS X linker, etc. gcc: error: unrecognized command line option '-Wl-O1' Another problem with original change is loss of ability to pass options to gcc as a linker driver, for example: SRC_LD_OPTS += -flto Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* Ensure flags destined for ld are properly passedBen Gamari2016-12-011-1/+1
| | | | | | | | | | | | | | | | GHC uses gcc, not ld, for linking. Consequently all flags to be interpreted by ld need to be prefixed by -optl,-Wl on the GHC command line. Test Plan: Validate on OpenBSD Reviewers: austin, rwbarton Reviewed By: rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2776
* build system: Include CONF_LD_LINKER_OPTS in ALL_LD_OPTSBen Gamari2016-11-101-7/+17
| | | | | | | | | | | | | | | This ensures that artifacts built with build-prog see these options. Also spruce up comments. Test Plan: Carefully read it. Reviewers: austin, hvr, erikd Reviewed By: erikd Subscribers: thomie, erikd Differential Revision: https://phabricator.haskell.org/D2673
* Updates to handle new CabalEdward Z. Yang2016-06-301-3/+14
| | | | | | | | | | | | | | | | | | Specifically per-component macros and multiple libraries. Contains Cabal submodule update. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin, bgamari Reviewed By: austin, bgamari Subscribers: hvr, thomie Differential Revision: https://phabricator.haskell.org/D2059
* Switch from -this-package-key to -this-unit-id.Edward Z. Yang2016-01-191-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A small cosmetic change, but we have to do a bit of work to actually support it: - Cabal submodule update, so that Cabal passes us -this-unit-id when we ask for it. This includes a Cabal renaming to be consistent with Unit ID, which makes ghc-pkg a bit more scrutable. - Build system is updated to use -this-unit-id rather than -this-package-key, to avoid deprecation warnings. Needs a version test so I resurrected the old test we had (sorry rwbarton!) - I've *undeprecated* -package-name, so that we are in the same state as GHC 7.10, since the "correct" flag will have only entered circulation in GHC 8.0. - I removed -package-key. Since we didn't deprecate -package-id I think this should not cause any problems for users; they can just change their code to use -package-id. - The package database is indexed by UNIT IDs, not component IDs. I updated the naming here. - I dropped the signatures field from ExposedModule; nothing was using it, and instantiatedWith from the package database field. - ghc-pkg was updated to use unit ID nomenclature, I removed the -package-key flags but I decided not to add any new flags for now. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: 23Skidoo, thomie, erikd Differential Revision: https://phabricator.haskell.org/D1780
* Remove ghc-7.8 `-package-name`-compat handlingHerbert Valerio Riedel2015-12-311-13/+1
| | | | | | This code was introduced in 66218d15b7c27a4a38992003bd761f60bae84b1f to use `-package-name` for GHC 7.8, whereas GHC 7.10 needs the new `-this-package-key` flag.
* Build system: Add stage specific SRC_HC_(WARNING_)OPTSThomas Miedema2015-12-011-2/+19
| | | | | | | | | | | | | | | | | | * Add stage specific versions of SRC_HC_OPTS. These are currently only used for -Werror. The previous combination of GhcStage2HcOpts and GhcLibHcOpts didn't apply to utils/*. * Add stage specific versions of SRC_HC_WARNING_OPTS. These will later be used for new warning supression flags that should not be passed to the bootstrap compiler. * Move -Wall (and -Werror) related code back to mk/warnings.mk, where it was before 987d54274. Now all warning related code is nicely together. Include mk/warnings.mk after mk/custom-settings.mk to make this work. Reviewed By: bgamari, hvr Differential Revision: https://phabricator.haskell.org/D1536
* Implement function-sections for Haskell code, #8405Simon Brenner2015-11-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a flag -split-sections that does similar things to -split-objs, but using sections in single object files instead of relying on the Satanic Splitter and other abominations. This is very similar to the GCC flags -ffunction-sections and -fdata-sections. The --gc-sections linker flag, which allows unused sections to actually be removed, is added to all link commands (if the linker supports it) so that space savings from having base compiled with sections can be realized. Supported both in LLVM and the native code-gen, in theory for all architectures, but really tested on x86 only. In the GHC build, a new SplitSections variable enables -split-sections for relevant parts of the build. Test Plan: validate with both settings of SplitSections Reviewers: dterei, Phyx, austin, simonmar, thomie, bgamari Reviewed By: simonmar, thomie, bgamari Subscribers: hsyl20, erikd, kgardas, thomie Differential Revision: https://phabricator.haskell.org/D1242 GHC Trac Issues: #8405
* Revert "Build system: don't add ALL_HC_OPTS when linking"Ben Gamari2015-10-291-1/+1
| | | | | | | This reverts commit 9fc2d777f53110040f48ab27643a16888fa377f5. This appears to cause interface file issues during rebuilds. Punting back to @thomie for further investigation.
* Build system: don't add ALL_HC_OPTS when linkingThomas Miedema2015-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The current scheme in rules/distdir-way-opts.mk is something like this: GHC_LD_OPTS = MOST_HC_OPTS + ALL_LD_OPTS MOST_DIR_HC_OPTS = MOST_HC_OPTS + -odir,-hidir,-stubdir ALL_HC_OPTS = MOST_DIR_HC_OPTS + -hisuf,-osuf,-hcsuf,-split-objs,-dynamic-too Notice that both ALL_HC_OPTS and GHC_LD_OPTS include MOST_HC_OPTS, and currently both got added when linking. Adding MOST_HC_OPTS twice results in overly long and hard to decipher command lines (and build logs). This commit fixes that. Afaik, -odir,-hidir,-stubdir,-hisuf,-osuf,-hcsuf,-spit-objs,-dynamic-too are all not needed when linking, so this change should be safe to make. GHC_LD_OPTS is for linking, ALL_HC_OPTS is for compiling. ALL_HC_OPTS was added to the linking commands in 37a6a52facd1c3999ce4472c50b0030568be1e04, to make sure -no-user-package-conf would be in the options list. It still is after this change. Reviewers: austin, bgamari Differential Revision: https://phabricator.haskell.org/D1379
* Rename PACKAGE_KEY and LIB_NAME in build system.Edward Z. Yang2015-10-141-8/+8
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Use -package-id to specify libraries on command line.Edward Z. Yang2015-06-221-4/+3
| | | | | | | | | | | | | | | | Summary: There's not really any good reason to use -package-key over -package-id, so use the latter as standard practice. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1000
* Make GHC install libraries to e.g. xhtml-3000.2.1-0ACfOp3hebWD9jGWE4v4Gh.Edward Z. Yang2015-06-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, we'd install them to something like xhtml_0ACfOp3hebWD9jGWE4v4G which was fairly ugly; this commit changes the default install path to contain the full package name and version, as well as the package key. Needs a Cabal submodule update for the commit for install paths support "Add libname install-dirs variable, use it by default. Fixes #2437". It also contains some miscellaneous fixes for Cabal HEAD. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin Subscribers: bgamari, thomie Trac Issues: #10479 Differential Revision: https://phabricator.haskell.org/D922
* Remove out of date TODOEdward Z. Yang2014-08-131-2/+0
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Explicitly version test for package key support.Edward Z. Yang2014-08-131-1/+7
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Package keys (for linking/type equality) separated from package IDs.Edward Z. Yang2014-08-051-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch set makes us no longer assume that a package key is a human readable string, leaving Cabal free to "do whatever it wants" to allocate keys; we'll look up the PackageId in the database to display to the user. This also means we have a new level of qualifier decisions to make at the package level, and rewriting some Safe Haskell error reporting code to DTRT. Additionally, we adjust the build system to use a new ghc-cabal output Make variable PACKAGE_KEY to determine library names and other things, rather than concatenating PACKAGE/VERSION as before. Adds a new `-this-package-key` flag to subsume the old, erroneously named `-package-name` flag, and `-package-key` to select packages by package key. RFC: The md5 hashes are pretty tough on the eye, as far as the file system is concerned :( ToDo: safePkg01 test had its output updated, but the fix is not really right: the rest of the dependencies are truncated due to the fact the we're only grepping a single line, but ghc-pkg is wrapping its output. ToDo: In a later commit, update all submodules to stop using -package-name and use -this-package-key. For now, we don't do it to avoid submodule explosion. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D80
* Include EXTRA_LD_OPTS (amongst other things) when linking programsSimon Marlow2014-03-271-21/+28
| | | | | | | | | | One problem was that we weren't including $1_$2_DIST_LD_OPTS when linking a program, which looks to be accidental: it was being defined but not used anywhere. This meant that setting $1_$2_EXTRA_LD_OPTS, for example, had no effect. This commit straightens out the handling of LD_OPTS to be consistent with the way we handle CC_OPTS and HC_OPTS.
* Fix inplace dynamic linking on OS X (#8266)Christiaan Baaj2014-01-281-1/+3
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix specification of -z origin for gold.Austin Seipp2014-01-071-1/+1
| | | | | | | Gold apparently doesn't recognize `-z origin`, only `-zorigin` it seems. Authored-by: Ben Gamari <bgamari.foss@gmail.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Globally replace "hackage.haskell.org" with "ghc.haskell.org"Simon Marlow2013-10-011-2/+2
|
* Link to the right RTS whenever we build a .dll on WindowsIan Lynagh2013-05-151-12/+0
| | | | | When GHCi makes temporary DLLs, those also need to be linked against the right RTS, or we won't be able to load them.
* Fix the GHC package DLL-splittingIan Lynagh2013-05-141-0/+8
| | | | | | | There's now an internal -dll-split flag, which we use to tell GHC how the GHC package is split into 2 separate DLLs. This is used by Packages.isDllName to determine whether a call is within the same DLL, or whether it is a call to another DLL.
* We actually need to use -threaded/-debug when linking /all/ DLLsIan Lynagh2013-05-121-0/+12
| | | | Not just base, integer-gmp and ghc-prim.
* Use -rpath flags on all Elf OSes, not just LinuxIan Lynagh2013-04-271-1/+1
| | | | Patch from pgj; part of #7819.
* When linking with $ORIGIN rpaths, use the "-z origin" linker flag tooIan Lynagh2013-04-271-1/+1
| | | | | On FreeBSD, one needs use "-z origin" in order to enable resolution of $ORIGIN in RPATH. Part of #7819.
* Follow build system changes in integer-gmpIan Lynagh2013-04-201-0/+2
| | | | Also a couple of other fixes and sanity checks along the way.
* Tweak the _HC_OPTS variablesIan Lynagh2013-03-231-5/+8
| | | | | We no longer pass -hisuf/-osuf flags to "ghc -M". Doing so didn't really make sense with the way the -dep-suffix flags now work.
* Fix construction of ALL_ALEX_OPTS and ALL_AS_OPTSMax Bolingbroke2013-03-101-1/+1
| | | | Signed-off-by: David Waern <david.waern@gmail.com>
* Don't pass -dynamic-too to GHC when compiling C filesIan Lynagh2013-03-091-1/+1
|
* Make the build system use -dynamic-too if both way v and dyn are being builtIan Lynagh2013-02-221-0/+1
|
* Split non-way-specific variables off from distdir-way-opts into distdir-optsIan Lynagh2013-02-211-97/+0
| | | | | The hsc2hs, alex and happy options variables are now also non-way-specific, as the files are shared between all ways.
* Give dynamic libraries, as well as programs, RPATHsIan Lynagh2012-11-081-0/+12
| | | | Based on a patch from markwright in #3072.
* Tweak the HC_OPTS generationIan Lynagh2012-07-241-1/+1
| | | | | | | | | libraries/base/GHC/Base_HC_OPTS wasn't getting included, because we were using libraries/base/./GHC/Base.lhs as the path, and the ./ meant we got the wrong filename. I didn't use $(realpath ...) as the .hs file may be generated by hsc2hs or similar, so may not exist when the HC_OPTS are constructed.
* Rename package-conf flags to package-db.Paolo Capriotti2012-05-151-1/+1
| | | | | | | | Rename package database flags in both GHC and ghc-pkg so that they are consistent with Cabal nomenclature. Add a version check to the build system so that the correct set of package db flags are used when the bootstrapping GHC has version < 7.5.
* Define _HOST_OS and _HOST_ARCH when calling hsc2hsIan Lynagh2012-05-011-0/+2
| | | | | | In particular, old-time assumes that mingw32_HOST_OS is set when we are on Windows, and was going wrong on Win64 because it wasn't defined.
* Add SRC_[CH]C_WARNING_OPTSIan Lynagh2012-04-261-1/+7
| | | | | | | | | | | This allows you to say things like SRC_HC_WARNING_OPTS += -fno-warn-unsupported-calling-conventions in mk/validate.mk. Unfortunately, we can't just use SRC_HC_OPTS, as that gets put before the more specific options (e.g. ghc-options in a .cabal file), many of which include -Wall. So now we have: ghc $(SRC_HC_OPTS) ... options from .cabal etc ... $(SRC_HC_WARNING_OPTS)
* Remove tabs, so that I can push.Iavor S. Diatchki2011-12-181-17/+17
|
* Build system commentarySimon Marlow2011-10-051-16/+66
| | | | | | | | | Add documentation describing all the variables that contain options for Haskell compilations, what they mean and where they are (or can be) defined. In due course we should expand this to cover all the build system variables, and move it to the wiki, but this is a start.
* workaround for #5485: use -fno-full-laziness with 7.2.1Simon Marlow2011-10-051-0/+1
|
* Use the correct __GLASGOW_HASKELL__ value when invoking hsc2hs onSimon Marlow2011-08-081-1/+1
| | | | | source code to be compiled with the stage 0 compiler. (bug noticed by David Terei - thanks!)
* Build system: Tell hsc2hs where to find cabal_macros.hIan Lynagh2011-04-271-0/+2
|