Commit Graph

27 Commits

Author SHA1 Message Date
Jussi Pakkanen 3e6fbde94c Add thinlto support. Closes #7493. 2020-11-08 16:00:05 +02:00
Jussi Pakkanen 1a0603835e Add win_subsystem kwarg. Closes #7765. 2020-10-07 18:55:25 +03:00
Dylan Baker 6eb981e0c0 compilers/gnu: Don't pretend to inherit CLike
We don't need it anymore, and it would be problematic for the D
compilers.
2020-10-01 15:05:01 -07:00
Dylan Baker 682d22129c compilers: Tell mypy that the compiler mixins are just that
We do this by making the mixins inherit the Compiler class only when
mypy is examining the code (using some clever inheritance shenanigans).
This caught a bunch of issues, and also lets us delete a ton of code.
2020-09-24 12:14:13 -07:00
Dylan Baker 4b52184dc6 compilers/mixings/gnu: make type safe 2020-09-24 12:14:13 -07:00
Dylan Baker d326c87fe2 compilers: Use a distinct type for compile/link results
Currently we do some crazy hackery where we add extra properties to a
Popen object and return that. That's crazy. Especially since some of our
hackery is to delete attributes off of the Popen we don't want. Instead,
let's just have a discrete type that has exactly the properties we want.
2020-09-24 12:14:13 -07:00
Nirbheek Chauhan 6e7d548b11 compilers: Cache gnu-mixins has_arguments() checks
want_output gives us the output file. We don't need the file. We just
need the compiler stderr, which is always stored.
2020-07-23 07:39:59 +00:00
Nirbheek Chauhan dc19b13202 compilers: Silence warning about gnu_inline with clang
The warning is due to a change in behaviour in Clang 10 and newer:

https://releases.llvm.org/10.0.0/tools/clang/docs/ReleaseNotes.html#c-language-changes-in-clang

This was already fixed for clang++, but not for clang for some reason.
It was also fixed incorrectly; by adding `extern` instead of moving
from `-Werror` to `-Werror=attributes`.
2020-04-20 19:30:57 +03:00
Dylan Baker b5e077fce8 compilers: Move things out of clike
One method belongs in the base Compiler class, the other belongs in
the GnuLikeCompiler class.
2020-04-10 12:33:34 -07:00
Pino Toscano a33f20b9a4 compilers: disable b_sanitize on hurd
ASAN is not supported on the Hurd yet.
2020-04-10 11:29:35 -07:00
Dylan Baker b8294b4436 compilers: Error if invalid linker selected 2020-03-17 10:40:39 -07:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Daniel Mensinger eb67fb1d97 default inc dirs: Fix warning on MSYS (fixes #6336) 2019-12-15 13:25:16 +02:00
Dylan Baker ef9aeb188e Allow selecting the dynamic linker
This uses the normal meson mechanisms, an LD environment variable or via
cross/native files.

Fixes: #6057
2019-12-02 16:39:06 -08:00
Daniel Mensinger 8b8f14c4dd default inc dirs: fix warning for unsupporte lang (fixes #6050) 2019-10-18 00:45:03 +03:00
Michael Lenczewski 763c1e3280 Fix for issue 5355
compiler.get_supported_arguments reports success for certain unsupported
   flags when using the gnu C/ObjC, C++/ObjC++ compilers.  This fix reads
   the stderr on the has_arguments check to ensure the arguments really are
   supported and not valid for the language selection
2019-10-09 14:24:37 -07:00
Dylan Baker 0c22798b1a compilers: replace CompilerType with MachineInfo
Now that the linkers are split out of the compilers this enum is
only used to know what platform we're compiling for. Which is
what the MachineInfo class is for
2019-10-07 12:08:20 -07:00
Daniel Mensinger 66c129c52f
cache all gnulike_default_include_dirs invocations 2019-10-03 17:04:44 +02:00
Dylan Baker 0efab591da compilers: Move the compiler argument to proxy linker flags to the compiler class
Instead of the DynamicLinker returning a hardcoded value like
`-Wl,-foo`, it now is passed a value that could be '-Wl,', or could be
something '-Xlinker='

This makes a few things cleaner, and will make it possible to fix using
clang (not clang-cl) on windows, where it invokes either link.exe or
lld-link.exe instead of a gnu-ld compatible linker.
2019-08-30 00:01:32 +03:00
Dylan Baker ba4324ab9d Fix gcc include dot 2019-08-28 22:20:00 +03:00
Dylan Baker 06dcbd50ee compilers: Dispatch to dynamic linker class
Most of the cuda code is from Olexa Bilaniuk.
Most of the PGI code is from Michael Hirsc
2019-08-14 13:13:23 -07:00
Dylan Baker c8a6a44850 compilers: pull sanitzier args into compiler classes
This simplifies and cleans things up.
2019-07-23 09:58:24 +00:00
Dylan Baker 5d7395673d compilers: return as-needed args as a list 2019-07-23 09:58:24 +00:00
Dylan Baker 7eb1d89095 compilers: Move lto args into compiler class
There are two problems, one is that it assumes -flto is the argument
to do LTO/WPO, which isn't true of ICC and MSVC (and presumably)
others. It's also incorrect because it assumes that the compiler and
linker will always be the same, which isn't necessarily true. You
could combine GCC with Apple's linker, or clang with link.exe, which
use different arguments.
2019-07-23 09:58:24 +00:00
Dylan Baker f574beffb4 compilers/mixins/elbrus: add type annotations and fix types
There is a pretty big error in here, trying to return a tuple
comperhension: (a for a in []) is not a tuple, it's a generator. This
has profound type annotations: generators don't support most tuple or
list methods, and they can only be iterated once. Beyond that tuples are
meant for heterogenous types, ie, position matters for types. I've
converted the output to a list in all cases.
2019-07-15 10:59:22 -07:00
Dylan Baker 488e852e70 compilers/mixins/gnu: Add type annotations 2019-07-15 10:59:22 -07:00
Dylan Baker cd5360821a compilers: split gnu and gnulike compilers out of compilers
I debated a bit whether both classes really belong in the same module,
and decided that they do because the share a number of helpers.
2019-07-15 10:59:22 -07:00