| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The clang based toolchain uses ucrt as its math library
and so mingwex is no longer needed. In fact using mingwex
will cause incompatibilities as the default routines in both
have differing ULPs and string formatting modifiers.
```
$ LIBRARY_PATH=/mingw64/lib ghc/_build/stage1/bin/ghc Bug.hs -fforce-recomp && ./Bug.exe
[1 of 2] Compiling Main ( Bug.hs, Bug.o )
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `__imp___p__environ'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `__hscore_get_errno'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_ForeignziCziError_errnoToIOError_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziWindows_failIf2_closure'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziIOziEncodingziCodePageziAPI_mkCodePageEncoding_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziIOziEncodingziCodePage_currentCodePage_closure'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziIOziEncoding_getForeignEncoding_closure'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_ForeignziCziString_withCStringLen1_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziIOziHandleziInternals_zdwflushCharReadBuffer_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziIOziHandleziText_hGetBuf1_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziFingerprint_fingerprintString_closure'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_DataziTypeableziInternal_mkTrCon_closure'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziException_errorCallWithCallStackException_closure'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\base-4.17.0.0\libHSbase-4.17.0.0.a: unknown symbol `base_GHCziErr_error_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\template-haskell-2.19.0.0\libHStemplate-haskell-2.19.0.0.a: unknown symbol `base_DataziMaybe_fromJust1_info'
ghc.exe: | C:\Users\winferno\Software\ghc\_build\stage1\lib\x86_64-windows-ghc-9.5.20220908\template-haskell-2.19.0.0\libHStemplate-haskell-2.19.0.0.a: unknown symbol `templatezmhaskell_LanguageziHaskellziTHziSyntax_IntPrimL_con_info'
ghc.exe: ^^ Could not load 'templatezmhaskell_LanguageziHaskellziTHziLibziInternal_stringL_closure', dependency unresolved. See top entry above.
<no location info>: error:
GHC.ByteCode.Linker.lookupCE
During interactive linking, GHCi couldn't find the following symbol:
templatezmhaskell_LanguageziHaskellziTHziLibziInternal_stringL_closure
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session. Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please report this as a GHC bug:
https://www.haskell.org/ghc/reportabug
```
|
|
|
|
| |
These are not present in wasi-libc. Required for fixing #22589
|
|
|
|
|
|
| |
This patch adds more autoconf checks to base, since those functions
and headers may exist on other POSIX systems but don't exist on
wasm32.
|
|
|
|
|
| |
On wasm32, we have to fall back to using monotonic clock to emulate
cputime, since there's no native support for cputime as a clock id.
|
| |
|
|
|
|
|
| |
Some platforms (e.g. Windows/clang64) declare `environ` in `<stdlib.h>`,
not `<unistd.h>`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Many small things to fix:
* Hadrian: platform triple is "x86_64-w64-mingw32" and this wasn't recognized by
Hadrian (note "w64" instead of "unknown")
* Hadrian was using the build platform ("isWindowsHost") to detect
the use of the Windows toolchain, which was wrong. We now use the
"targetOs" setting.
* Hadrian was doing the same thing for Darwin so we fixed both at once,
even if cross-compilation to Darwin is unlikely to happen afaik (cf
"osxHost" vs "osxTarget" changes)
* Hadrian: libffi name was computed in two different places and one of
them wasn't taking the different naming on Windows into account.
* Hadrian was passing "-Irts/include" when building the stage1 compiler
leading to the same error as in #18143 (which is using make).
stage1's RTS is stage0's one so mustn't do this.
* Hadrian: Windows linker doesn't seem to support "-zorigin" so we
don't pass it (similarly to Darwin)
* Hadrian: hsc2hs in cross-compilation mode uses a trick (taken from
autoconf): it defines "static int test_array[SOME_EXPR]" where
SOME_EXPR is a constant expression. However GCC reports an error
because SOME_EXPR is supposedly not constant. This is fixed by using
another method enabled with the `--via-asm` flag of hsc2hs. It has been
fixed in `make` build system (5f6fcf7808b16d066ad0fb2068225b3f2e8363f7)
but not in Hadrian.
* Hadrian: some packages are specifically built only on Windows but they
shouldn't be when building a cross-compiler (`touchy` and
`ghci-wrapper`). We now correctly detect this case and disable these
packages.
* Base: we use `iNVALID_HANDLE_VALUE` in a few places. It fixed some
hsc2hs issues before we switched to `--via-asm` (see above). I've kept
these changes are they make the code nicer.
* Base: `base`'s configure tries to detect if it is building for Windows
but for some reason the `$host_alias` value is `x86_64-windows` in my
case and it wasn't properly detected.
* Base: libraries/base/include/winio_structs.h imported "Windows.h" with
a leading uppercase. It doesn't work on case-sensitive systems when
cross-compiling so we have to use "windows.h".
* RTS: rts/win32/ThrIOManager.c was importin "rts\OSThreads.h" but this
path isn't valid when cross-compiling. We replaced "\" with "/".
* DeriveConstants: this tool derives the constants from the target
RTS header files. However these header files define `StgAsyncIOResult`
only when `mingw32_HOST_OS` is set hence it seems we have to set it
explicitly.
Note that deriveConstants is called more than once (why? there is
only one target for now so it shouldn't) and in the second case this
value is correctly defined (probably coming indirectly from the import
of "rts/PosixSource.h"). A better fix would probably be to disable the
unneeded first run of deriveconstants.
|
|
|
|
|
|
|
|
|
| |
This regressed in 544414ba604b13e0992ad87e90b8bdf45c43011c causing
configure: error: iconv is required on non-Windows platforms
More details:
https://gitlab.haskell.org/ghc/ghc/-/commit/544414ba604b13e0992ad87e90b8bdf45c43011c#3bae3b74ae866493bd6b79df16cb638a5f2e0f87_106_106
|
|
|
|
| |
Also make sure to be able to build with non-apple-clang, while using apple's SDK on macOS
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
The OFD locking path introduced in
3b784d440d4b01b4c549df7c9a3ed2058edfc780 due to #13945 appears to have
never actually worked but we never noticed due to an oversight in the
autoconf check. Fix it.
Thanks to Oleg Grenrus for noticing this.
|
|
|
|
|
|
| |
Metric Increase:
haddock.base
T4029
|
|
|
|
| |
Define MD5Context in terms of `uint*_t` and don't use `HsFFI.h`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Requires some ghc-cabal changes as well.
Test Plan: ./validate
Reviewers: hvr, bgamari
Reviewed By: bgamari
Subscribers: hsyl20, erikd, alpmestan, rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4453
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hopefully these are more robust to NFS malfunction than BSD flock-style
locks. See #13945.
Test Plan: Validate via @simonpj
Reviewers: austin, hvr
Subscribers: rwbarton, thomie, erikd, simonpj
GHC Trac Issues: #13945
Differential Revision: https://phabricator.haskell.org/D4129
|
|
|
|
|
|
|
|
|
|
| |
Trac issues: #13194
Reviewers: austin, hvr, erikd, bgamari, dfeuer, duncan
Subscribers: DemiMarie, dfeuer, thomie
Differential Revision: https://phabricator.haskell.org/D3090
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: GHC CI
Reviewers: austin, hvr, bgamari
Reviewed By: bgamari
Subscribers: thomie, erikd
Differential Revision: https://phabricator.haskell.org/D2993
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a `CBool` type wrapping C99's `bool`, i.e., an `unsigned
char`.
Fixes #13136.
Test Plan: ./validate on Tier-1 platforms
Reviewers: austin, hvr, simonmar, bgamari
Reviewed By: simonmar, bgamari
Subscribers: thomie, erikd
Differential Revision: https://phabricator.haskell.org/D2982
GHC Trac Issues: #13136
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
In ffc2327070dbb664bdb407a804121eacb2a7c734, an attempt was made at
adding a Haskell wrapper around the C `timer_t` type. Unfortunately, GHC's
autoconf macros weren't sophisticated enough at the time to properly detect
that `timer_t` is represented by a `void *` (i.e., a pointer) on most OSes.
This is a second attempt at `CTimer`, this time using `AC_COMPILE_IFELSE` to
detect if a type is a pointer type by compiling the following program:
```
type val;
*val;
```
This also only derives a small subset of class instances for `CTimer` that are
known to be compatible with `Ptr` using a new `OPAQUE_TYPE_WITH_CTYPE` macro.
Test Plan: ./validate
Reviewers: erikd, hvr, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2952
GHC Trac Issues: #12795, #12998
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
CTimer is a wrapper around `timer_t`, which is a typedef for `void*`
on most platforms. The issue is that GHC's `FPTOOLS_CHECK_HTYPE` is not robust
enough to discern pointer types from non-pointer types, so it mistakenly labels
`timer_t` as a `Double` or `Int32` (depending on how many bits a pointer takes
up on your platform). This wreaks havoc when trying to give it certain type
class instances, as noted in
https://phabricator.haskell.org/rGHCffc2327070dbb664bdb407a804121eacb2a7c734.
For now, the simplest thing to do would be removing `CTimer`, since:
1. The original author (@DanielG) didn't have a particular use in mind for
`timer_t` when he fixed #12795.
2. `CTimer` hasn't appeared in a release of `base` yet.
Fixes #12998.
Reviewers: austin, hvr, bgamari, DanielG, trofi
Reviewed By: bgamari, trofi
Subscribers: thomie, DanielG, erikd
Differential Revision: https://phabricator.haskell.org/D2876
GHC Trac Issues: #12795, #12998
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: hvr, austin, RyanGlScott, bgamari
Reviewed By: RyanGlScott, bgamari
Subscribers: RyanGlScott, thomie, erikd
Differential Revision: https://phabricator.haskell.org/D2664
GHC Trac Issues: #12795
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The non-idiomatic `--with-cc` flag was added via
5c789e424c1461c1dadfd38c44fcb9e8f38bf755
However, `--with-cc` seems rather fragile and support for `--with-cc` needs
to be added explicitly to autoconf-based Cabal packages. The `CC=` flag, however,
is supported natively by GNU Autoconf, so let's use the standard facility for that.
Relatedly, Cabal prior to version 1.24 used a similiar flag `--with-gcc=...`,
but starting with Cabal-1.24 this has been changed to use `CC=...` instead as well
(see https://github.com/haskell/cabal/pull/2946)
This also updates a few submodules removing the now obsolete `--with-cc` flag
support.
Reviewed By: trofi, thomie, erikd
Differential Revision: https://phabricator.haskell.org/D1608
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes sure that `AC_USE_SYSTEM_EXTENSIONS` (which
implies `AC_PROG_CC`) is called after the
`AC_ARG_WITH([cc],,)` invocation, so that the proper
CC setting is in scope. Otherwise this can break cross-compilation.
This also needs to pull in a submodule update for `unix`
This is a follow-up commit to
7af29da05d2e5a5e311a5f73f20d0f232035973b
which hopefully fixes #11168
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This takes care of setting feature test macros (i.e. let Autoconf decide when
those can be set safely) to allow subsequent Autoconf tests to better detect
available OS features.
This also includes a submodule update of unix which enables the use of
`AC_USE_SYSTEM_EXTENSIONS` in there as well.
Specifically, this takes care of setting `_GNU_SOURCE` (which allows to remove
two occurences where it's set manually) and `_ALL_SOURCE` (which fixes issues
on AIX).
See also
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Posix-Variants.html
for details.
At some point we may want to reconsider the purpose of "rts/PosixSource.h" and
rely more on Autoconf instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Append -I/-L flags to CPPFLAGS/LDFLAGS instead of clobbering.
Test Plan: Install libiconv into /some/non-standard/path. Set CONF_GCC_LINKER_OPTS_STAGE{0,1,2} to -Wl,-rpath,/some/non-standard/path/lib. And then run ./configure with arguments --with-iconv-includes=/some/non-standard/path/include and --with-iconv-libraries=/some/non-standard/path/lib
Reviewers: hvr, austin
Reviewed By: austin
Subscribers: thomie, PHO
Differential Revision: https://phabricator.haskell.org/D663
GHC Trac Issues: #10093
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
I'm building ghc on windows x86 under msys2, and found that libraries/base/configure isn't able to detect msys as windows platform.
I'm not 100% sure it is the right solution. Probably I have local misconfiguration somewhere. So feel free to reject.
Test Plan: not necessary
Reviewers: austin
Reviewed By: austin
Subscribers: simonmar, ezyang, carter, thomie
Projects: #ghc
Differential Revision: https://phabricator.haskell.org/D305
|
|
|
|
| |
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
| |
Patch from Simon Hengel.
|
|
|
|
|
|
| |
previous IO manager.
This patch affects the IO manager using kqueue. See issue #7773. If the kqueue backend cannot wait for events on a file, it will simply call the registered callback for the file immediately. This is the behavior of the previous IO manager. This is not ideal, but it is an initial step toward dealing with the problem properly. Ideally, we would use a non-kqueue mechanism for waiting on files (select seems most reliable) that cannot be waited on with kqueue.
|
|
|
|
|
|
| |
Fixed bootstrap failure on linux for --target=mingw32
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We don't use iconv or libcharset on Windows, but if configure finds
them then it can cause problems. So we don't even try looking if
we are on Windows.
See http://www.haskell.org/pipermail/cvs-ghc/2011-September/065980.html
Patch from Bill Tutt.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instances of Typeable used to call mkTyCon:
mkTyCon :: String -> TyCon
which internally kept a table mapping Strings to Ints, so that each
TyCon could be given a unique Int for fast comparison. This meant the
String has to be unique across all types in the program. However,
derived instances of typeable used the qualified original
name (e.g. "GHC.Types.Int") which is not necessarily unique, is
non-portable, and exposes implementation details.
The String passed to mkTyCon is returned by
tyConString :: TyCon -> String
which let the user get at this non-portable representation (also the
Show instance returns this String).
Now we store three Strings in TyCon. The internal representation is
this:
data TyCon = TyCon {
tyConHash :: {-# UNPACK #-} !Fingerprint,
tyConPackage :: String,
tyConModule :: String,
tyConName :: String
}
(internal representations are now provided by Data.Typeable.Internal)
The fields of TyCon are not exposed via the public API. Together the
three fields tyConPackage, tyConModule and tyConName uniquely identify
a TyCon, and the Fingerprint is a hash of the concatenation of these
three Strings (so no more internal cache to map strings to unique
Ids). tyConString now returns the value of tyConName only, so is
therefore portable (but the String returned does not uniquely
identify the TyCon).
I've measured the performance impact of this change, and performance
seems to be uniformly better. This should improve things for SYB in
particular. Also, the size of the code generated for deriving
Typeable is less than half as much as before.
== API changes ==
=== mkTyCon is DEPRECATED ==
mkTyCon is used by some hand-written instances of Typeable. It still
works as before, but is deprecated in favour of...
=== Add mkTyCon3 ===
mkTyCon3 :: String -> String -> String -> TyCon
mkTyCon3 takes the package, module, and name of the TyCon respectively.
Most users can just derive Typeable, there's no need to use mkTyCon3.
In due course we can rename mkTyCon3 back to mkTyCon.
=== typeRepKey changed ===
Previously we had
typeRepKey :: TypeRep -> IO Int
but since we don't assign unique Ints to TypeReps any more, this is
difficult to implement. Instead we provide an abstract key type which
is an instance of Eq and Ord, and internally is implemented by the
fingerprint:
data TypeRepKey -- abstract, instance of Eq, Ord
typeRepKey :: TypeRep -> IO TypeRepKey
typeRepKey is still in the IO monad, because the Ord instance is
implementation-defined.
|
| |
|
|
|
|
| |
On Windows we use Int32.
|
|
|
|
| |
rather than inlining the implementation of the test.
|
|
|
|
| |
The macro was just ignoring the defaults.
|
|
|
|
|
| |
We didn't actually use the result, and my Linux box doesn't have
wint_t.
|
|
|
|
|
|
| |
respectively CUSeconds and CSUSeconds.
The tv_usec field of struct timeval was incorrectly used as C type time_t; the actual C type is suseconds_t. On OS X, time_t is longer than suseconds_t, which caused garbage bits to be copied as reported in trac #4247 and #4970. This patch is part 1 of 4 to fix those tickets.
|
|
|
|
|
|
| |
There is little benefit to using epoll_create1 (especially if we still
have the epoll_create code too), and it cuases problems if people build
a GHC binary on one machine and try to use it on another.
|
|
|
|
| |
(patch originally by Johan Tibell <johan.tibell@gmail.com>, minor merging by me)
|
|
|
|
| |
nl_langinfo(CODESET) doesn't always return standardized variations of the encoding names. Use libcharset if possible, which is shipped together with GNU libiconv.
|
|
|
|
| |
This should help to fix the build on OpenBSD.
|
|
|
|
| |
now that it isn't used on Windows any more.
|