| Age | Commit message (Collapse) | Author |
|
This used to be
if for_machine is MachineChoice.BUILD and not is_cross:
so it needed to be negated. This is also clearly wrong because
"env.is_cross_build(for_machine)" has no effect - it is only true
if for_machine is MachineChoice.HOST, in which case key.as_host()
does nothing.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
|
|
For the same reason that the StaticLinker needs this, we need it in the
DynamicLinker as well.
|
|
There are a number of places where we treat StaticLinker and Compiler as
polymorphic, as such the StaticLinker cannot need extra parameters.
|
|
This is calculated by `Environment().is_cross_build(for_machine)`. Since
we have that in the Compiler class, just calculate it in the Compiler
initializer
|
|
We end up needing it everywhere, so just store it. This patch is huge
already, so it's just the conversion to passing Environment, more
cleanups to come.
|
|
1. Generate OMF objs with `-Zomf' compiler flags
2. Generate OMF libs with `.lib' suffix using `emxomfar' as a librarian
|
|
Intel's oneAPI installation, as of 2025.3, no longer provides the
classic ifort compiler, only the newer llvm-based ifx compiler.
|
|
The Microchip XC32 compiler is a GCC-based compiler implemented using
existing GNU compiler classes. As the XC32 version and GCC version do
not match mixins have been implemented to override versions used in
versions checks where applicable.
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
It really isn't a sanity check that a specific compiler doesn't work on
a specific platform. This re-implements the check as a shared component
in the ASMCompiler base class, which has the advantage of code sharing.
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This reverts commit 8847c938dd1c9e2c6e64e3050eb58f7ec54fccb3.
|
|
Such as NASM and MASM. These compilers don't actually do any linking,
the just produce object files. As such, we need the C compiler to link
the program in order to make things like sanity_check work.
|
|
ccache has been for a long time compatible with MSVC (since 4.6)
but when using debug mode, the /Z7 flag must be passed instead of
/Zi.
See https://ccache.dev/releasenotes.html#_ccache_4_6
|
|
That is where env_opts are stored, so make the compiler call back directly
into the environment.
Suggested-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Apple linkers need to use different arguments on macOS and iOS-like platforms.
Pass the system to the constructor so that it can be examined.
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This will be used by rustdoc tests because the Test objects takes a
single string for the command and everything else goes in the args.
But apart from this, the need to split the executable from the
arguments is common so create new methods to do it.
While at it, fix brokenness in the handling of the zig compiler, which
is checking against "zig" but failing to detect e.g. "/usr/bin/zig".
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
|
|
Store both a full version with the nightly and beta suffixes, and the
version as just X.Y.Z. This sort of distinction is why full_version
exists.
This fixes an issue with the bindgen module where we pass invalid
version of X.Y.Z-beta and X.Y.Z-nightly.
|
|
Since this is optional, we should not accept that GCC is a valid ObjC or
G++ is a valid ObjC++ Compiler unless we've tested that they can
actually do a basic compile.
This requires fixing a number of tests that have broken assumptions. In
some cases I've split tests where issues with one language would hide
the other. It would be great if we had a competent test framework that
allowed subtests to skip, unfortunately we have python's unittest
instead. Because of that we can't avoid extra tests by use of subtests.
|
|
Fix #13670
|
|
|
|
|
|
clippy-driver is not meant to be a general-purpose compiler front-end.
Since Meson can now provide natively the ability to invoke clippy,
raise a warning if someone uses it that way.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Clang's resource files, e.g. /usr/share/clang/clang++.cfg, can be used to bump the default standard level across the system.
However due to llvm/llvm-project#61641 `clang++ -std=c++17 -E -dM -` doesn't work. The workaround is to pass the language explicitly.
4ad792e158b6059eb847dd0562aff9bd7029981f fixed the issue by passing the language explicitly, but started passing the `-cpp` flag, which Clang doesn't support.
Basically Clang would always fallback to the second detection attempt as a result. Remove the unsupported flag and the above scenarios works now too. 🙂
See-also: https://github.com/llvm/llvm-project/issues/61641
Fixes: 4ad792e158b6059eb847dd0562aff9bd7029981f
|
|
These errors can make reading comments and documentation
unnecessarily confusing for users and contributors who
do not speak English as their first language.
|
|
|
|
LDFLAGS may contain flags that nvcc is unable to handle and these flags
need to be processed before we pass them to nvcc
|
|
|
|
"swiftc -Xlinker -v tmp.swift" command used to detect swift linker
creates junk files in working directory. This fix forwards output to
/dev/null
|
|
Co-Authored-By: L. E. Segovia <amy@amyspark.me>
|
|
|
|
|
|
_get_gnu_compiler_defines and _get_clang_compiler_defines were broken
by not defining the language they used.
Neither GCC nor Clang infer the language based on the driver name which means
`self.defines` isn't populated correctly in compilers/cpp.py.
e.g.
```
$ echo "" | g++ -E -dM - | grep -i cplus
$ echo "" | g++ -x c++ -E -dM - | grep -i cplus
#define __cplusplus 201703L
```
Fix that by passing '-cpp -x LANGUAGE' as a first pass. If it fails, try
again without '-cpp -x LANGUAGE' as before, as its portability isn't
certain. We do '-cpp' because during testing, I found Fortran needs this,
although per below, I had to drop Fortran in the end and leave it to the
fallback (existing) path.
Without this change, a63739d394dd77314270f5a46f79171a8c544e77 is only
partially effective. It works if the system has injected Clang options
via /etc/clang configuration files, but not by e.g. patching the driver
(or for GCC there too).
Unfortunately, we have to wimp out for Fortran and fallback to the
old method because you need the language standard (e.g. -x f95).
|
|
Make the debug & error message strings consistent between the GCC and Clang probes.
Copy-paste error. Here, we're scraping pre-processor tokens, not checking
for the compiler type.
|
|
|
|
|
|
|
|
Basic support for TI Arm Clang toolchain
|
|
GCC only has very limited support for Objective-C and doesn't support
any of the modern features, so whenever Clang is available, it should be
used instead. Essentially, the only reason to ever use GCC for
Objective-C is that Clang simply does not support the target system.
|
|
If nasm is not defined in cross file binaries we can fallback to build
machine nasm.
When cross compiling C code we need a different gcc binary for native
and cross targets, e.g. `gcc` and `x86_64-w64-mingw32-gcc`. But when
cross compiling NASM code the compiler is the same, it is the source
code that has to be made for the target platform. We can thus use nasm
from build machine's PATH to cross compile for Windows on Linux for
example. The difference is the arguments Meson will pass when invoking
nasm e.g. `-fwin64`. That is already handled by NasmCompiler class.
|
|
unsupported cl clones.
|
|
When C6000 support was added in #12246, TI compilers were given the correct version argument.
This broke the previous check which relied on an error being thrown by the compiler.
|
|
Places where compiler needs it already have access to Environment object
and can use it directly.
This fixes mypy complaining that not all compilers have self.exe_wrapper
in run() method that got moved to base class.
|
|
|
|
|
|
Fixes #12920.
|