| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
In a statically linked GHCi symbol `environ` resolves to NULL when
called from a Haskell script.
When resolving symbols in a Haskell script we need to search the
executable program and its dependent (DT_NEEDED) shared libraries
first and then search the loaded libraries.
We want to be able to override functions in loaded libraries later.
Libraries must be opened with local scope (RTLD_LOCAL) and not global.
The latter adds all symbols to the executable program's symbols where
they are then searched in loading order. We want reverse loading order.
When libraries are loaded with local scope the dynamic linker
cannot use symbols in that library when resolving the dependencies
in another shared library. This changes the way files compiled to
object code must be linked into temporary shared libraries. We link
with the last temporary shared library created so far if it exists.
Since each temporary shared library is linked to the previous temporary
shared library the dynamic linker finds the latest definition of a
symbol by following the dependency chain.
See also Note [RTLD_LOCAL] for a summary of the problem and solution.
Cherry-picked commit 2f8b4c
Changed linker argument ordering
On some ELF systems GNU ld (and others?) default to
--as-needed and the order of libraries in the link
matters.
The last temporary shared library, must appear
before all other libraries. Switching the position
of extra_ld_inputs and lib_path_objs does that.
Fixes #8935 and #9186
Reviewers: austin, hvr, rwbarton, simonmar
Reviewed By: simonmar
Subscribers: thomie, carter, simonmar
Differential Revision: https://phabricator.haskell.org/D349
GHC Trac Issues: #8935, #9186, #9480
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the linker was called without any commandline parameters to
detect whether bfd or gold is used. However the -fuse-ld parameter can
be used to switch between gold and bfd and should be taken into account
here.
Trac #9336
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
ghc runs 'gcc -v' to check if we run under vanilla gcc
or disaguised clang by checking for string
"gcc version <something>"
But this check does not always work as gcc has that string
localized via gettext mechanism:
(some gcc's locale strings)
be.po-msgstr "версія gcc %s\n"
da.po-msgstr "GCC version %s\n"
de.po-msgstr "gcc-Version %s %s\n"
el.po-msgstr "έκδοση gcc %s\n"
...
To ping gcc to English locale we now override environment
variable with 'LANGUAGE=en' value.
Fixes Issue #8825
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: validate
Reviewers: austin
Reviewed By: austin
Subscribers: simonmar, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D185
GHC Trac Issues: #8825
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: build-tested
Reviewers: austin
Reviewed By: austin
Subscribers: phaskell, simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D132
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Solaris ld emits harmless warning messages about unresolved
symbol in case of compiling into shared library when we do not
link against all the required libs. That is the case of GHC which
does not link against RTS library explicitly in order to be able to
chose the library later based on binary application linking
parameters. The warnings look like:
Undefined first referenced
symbol in file
stg_ap_n_fast ./T2386_Lib.o
stg_upd_frame_info ./T2386_Lib.o
templatezmhaskell_LanguageziHaskellziTHziLib_litE_closure ./T2386_Lib.o
templatezmhaskell_LanguageziHaskellziTHziLib_appE_closure ./T2386_Lib.o
templatezmhaskell_LanguageziHaskellziTHziLib_conE_closure ./T2386_Lib.o
templatezmhaskell_LanguageziHaskellziTHziSyntax_mkNameGzud_closure ./T2386_Lib.o
newCAF ./T2386_Lib.o
stg_bh_upd_frame_info ./T2386_Lib.o
stg_ap_ppp_fast ./T2386_Lib.o
templatezmhaskell_LanguageziHaskellziTHziLib_stringL_closure ./T2386_Lib.o
stg_ap_p_fast ./T2386_Lib.o
stg_ap_pp_fast ./T2386_Lib.o
ld: warning: symbol referencing errors
this is actually coming from T2386 testcase. The emitting of those
warnings is also a reason why so many TH testcases fail on Solaris.
The patch provides filter which filters out only linker warnings.
Test Plan: validate
Reviewers: austin
Reviewed By: austin
Subscribers: phaskell, simonmar, relrod, carter
Differential Revision: https://phabricator.haskell.org/D94
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, both Cabal and GHC defined the type PackageId, and we expected
them to be roughly equivalent (but represented differently). This refactoring
separates these two notions.
A package ID is a user-visible identifier; it's the thing you write in a
Cabal file, e.g. containers-0.9. The components of this ID are semantically
meaningful, and decompose into a package name and a package vrsion.
A package key is an opaque identifier used by GHC to generate linking symbols.
Presently, it just consists of a package name and a package version, but
pursuant to #9265 we are planning to extend it to record other information.
Within a single executable, it uniquely identifies a package. It is *not* an
InstalledPackageId, as the choice of a package key affects the ABI of a package
(whereas an InstalledPackageId is computed after compilation.) Cabal computes
a package key for the package and passes it to GHC using -package-name (now
*extremely* misnamed).
As an added bonus, we don't have to worry about shadowing anymore.
As a follow on, we should introduce -current-package-key having the same role as
-package-name, and deprecate the old flag. This commit is just renaming.
The haddock submodule needed to be updated.
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/D79
Conflicts:
compiler/main/HscTypes.lhs
compiler/main/Packages.lhs
utils/haddock
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Allow the CPP program and flag choices for GHC
be configured via the the ghc settings file
Test Plan: ran validate yesterday
Reviewers: hvr, austin, mzero, simonmar
Reviewed By: austin, mzero, simonmar
Subscribers: mzero, simonmar, relrod, carter
Differential Revision: https://phabricator.haskell.org/D26
|
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been
reorganized, while following the convention, to
- place `{-# LANGUAGE #-}` pragmas at the top of the source file, before
any `{-# OPTIONS_GHC #-}`-lines.
- Moreover, if the list of language extensions fit into a single
`{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one
line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each
individual language extension. In both cases, try to keep the
enumeration alphabetically ordered.
(The latter layout is preferable as it's more diff-friendly)
While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma
occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
|
|
|
|
|
|
|
|
|
|
| |
This bumps the amount of default reserved and committed stack for GHC
executables to 8mb, to work around #8870. A proper fix should happen in
7.8.2
See note [Windows stack usage] in SysTools for the details.
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
| |
|
|
|
|
| |
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
|
| |
The section of the User Guide in reference is 4.12.4
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, a command like
$ ghc -tmpdir blah Foo
where the directory blah/ does not exist, would loop forever: getTempDir
would repeatedly try to create a temporary subdirectory inside blah/,
catching the does-not-exist error thrown by createDirectory and
retrying, in vain, with another suffix.
Now instead the above compiler invocation will fail with an error:
blah/ghc25781_0: createDirectory: does not exist (No such file or directory)
|
|\ |
|
| |
| |
| |
| |
| | |
Authored-by: Luke Iannini <lukexi@me.com>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|\ \
| |/
| |
| |
| |
| | |
Conflicts:
compiler/main/DynFlags.hs
compiler/utils/FastString.lhs
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
iOS has some particular constraints about how applications can be built:
* We must generate a static library (.a) since XCode does the final
link.
* We need to carefully give the right set of arguments to libtool in
the case we're generating an archive.
* Dynamic linking isn't supported.
* It can only be done on OS X.
This patch cleans up all of the above. We add a new flag `-staticlib`
(only supported on Darwin) that allows us to produce archive files using
libtool, and a -pgmlibtool flag to control which 'libtool' executable to
use.
This fixes #8127. I believe this is the last piece missing from the iOS
cross compiler.
Authored-by: Luke Iannini <lukexi@me.com>
Authored-by: Maxwell Swadling <maxwellswadling@gmail.com>
Authored-by: Stephen Blackheath <...@blacksapphire.com>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we did ./configure time checks to see if 'GNU ld' supported
certain options. If it does, we bake those options into the link step.
See Trac #5240.
Unfortunately, the linker we use at runtime can change for several
reasons. One is that the user specifies -pgml 'foo'. The other is if
/usr/bin/ld or whatnot changes from when GHC was built. Those options
mentioned earlier are specific to GNU ld, but many systems support GNU
gold too. This is Trac #6063.
So we need to check at runtime what linker we're using. This is actually
a little bit complicated because we normally use the C compiler as our
linker. Windows and OS X are also special here.
Finally, this patch also unconditionally gives '--hash-size=31' and
'--reduce-memory-overheads' to the system linker if it's GNU ld. These
options have been supported for 8+ years from what I can see, and there
are probably a lot of other reasons why GHC would not work with such an
ancient binutils, all things considered.
See Note [Run-time linker info] in SysTools for details. There are
plenty of comments as well in the surrounding code.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
| |
Now these are always added by the run<blah> functions in SysTools, so
we never miss any out. Several cleanups resulted.
|
|
|
|
|
| |
When GHCi makes temporary DLLs, those also need to be linked against
the right RTS, or we won't be able to load them.
|
|
|
|
|
| |
Without it, when linking the split objects for Language.Haskell.TH.Syntax,
the commandline was too long when listing all the files directly.
|
|
|
|
|
|
|
|
|
| |
This fixes certain older GCCs which do not accept link options when assembling or compiling:
ppc_85xx-gcc: --hash-size=31: linker input file unused because linking not done
ppc_85xx-gcc: --reduce-memory-overheads: linker input file unused because linking not done
and diagnose this to stderr.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Mostly d -> g (matching DynFlag -> GeneralFlag).
Also renamed if* to when*, matching the Haskell if/when names
|
|
|
|
| |
We instead link objects into a temporary DLL and dlopen that
|
|
|
|
| |
We now generate a platformConstants file that we can read at runtime.
|
|
|
|
|
|
| |
To explicitly choose whether you want an unregisterised build you now
need to use the "--enable-unregisterised"/"--disable-unregisterised"
configure flags.
|
|
|
|
|
| |
This is a bit odd by itself, but it's a stepping stone on the way to
putting "target unregisterised" into the settings file.
|
|
|
|
| |
Related to #4862
|
| |
|
| |
|
|
|
|
|
| |
We now handle the preprocessor options the same way as the gcc options
(picCCOpts).
|
| |
|
| |
|
|
|
|
|
|
|
| |
A side-effect is that we can no longer use the LogAction in
defaultErrorHandler, as we don't have DynFlags at that point.
But all that defaultErrorHandler did is to print Strings as
SevFatal, so now it takes a 'FatalMessager' instead.
|
| |
|
|
|
|
|
|
| |
stdout/stderr might be closed, so we can't just hFlush them.
So we instead allow configuration in the same way that log_action
is configurable.
|
|
|
|
| |
Patch from Karel Gardas!
|
|
|
|
|
| |
Now target32bit works for all targets without any manual intervention,
as it should do. #5735 was a portability regression.
|
|
|
|
| |
.ident directives are usually ignored by as(1), and in some cases (like Darwin/PPC) they even raise an error.
|
| |
|