Commit Graph

1078 Commits

Author SHA1 Message Date
Eli Schwartz d87d912e5d
compilers: fix detection of ifx compiler
The version output scraping for identifying strings checked for "IFORT"
in parentheses after the executable name, which is probably a mistake by
Intel. Current versions of ifx have "IFX" in parentheses there.

Detect both.

Fixes #11873
2023-06-14 01:04:55 -04:00
Eli Schwartz a6bf2c1e2c
compilers: add logging for non c_or_cpp language detection 2023-06-14 01:04:55 -04:00
Eli Schwartz aa13c46822
WIP: refactor loggable popen calls for consistency 2023-06-14 01:04:55 -04:00
Xavier Claessens 6c480085d5 rust: PIC is always enabled
rustc enables PIC by default and Meson currently has no way to force
disabling PIC, it can only force enable or use compiler's default.
2023-06-07 13:18:58 -04:00
Dylan Baker 73c054ced6
mlog: remove direct calls to log_once
This was never meant to be public API, log(once=True) is for that.
2023-05-31 17:19:45 -04:00
Xavier Claessens c6db870fc7 rust: Add system libs used by rust std to staticlib external deps 2023-05-20 10:35:42 -04:00
Xavier Claessens 01bb756484 rust: Use Popen_safe() for sanity checks 2023-05-20 10:35:42 -04:00
Eli Schwartz 057ac1f576 rust compiler: use better sanity check logging comparable to the clike one
Don't spew debug-level info. Log the actual command line run.
2023-05-16 11:19:43 -04:00
Volker Weißmann 2699fd4b8a During reconfigure, show that no compiler was found, if compiler fails sanity check. 2023-05-13 11:06:24 +03:00
Nomura c1fce8f60f Initial support for Metrowerks Assembler 2023-05-06 19:57:06 +03:00
L. E. Segovia e1de1bae09 yasm: Fix usage of incompatible optimization flags
Fixes #11726
2023-04-24 21:09:15 -04:00
Nomura 18cfa545f0 Initial support for Metrowerks C/C++ compiler 2023-04-24 09:07:37 -04:00
Dylan Baker c62989ce80 rust: add support for b_ndebug
Rust has a `debug_assert!()` macro, which is designed to be toggled on
the command line. It is on by default in debug builds, and off by
default in release builds, in cargo. This matches what meson's b_ndebug
option does in `if-release` mode.
2023-04-21 15:18:56 +05:30
Dylan Baker f80f40fa4f compilers: split code for deciding if debug is needed into a helper 2023-04-21 15:18:56 +05:30
Dylan Baker bfce5c45a4 compilers: convert method to get assert control to a boolean
C like compilers only off `-DNDEBUG` to disable asserts. This is not a
universal paradigm however. Rust, for example has an argument that takes
a boolean. To better represent this, we allow passing a `disable`
boolean. `disable` was chosen rather than `enable` because it allowed
all existing logic to be left in place
2023-04-21 15:18:56 +05:30
Charles Brunet 5eb55075ba intro: add more details to generated json files
This will help with the writing of tools to generate
VisualStudio project and solution files, and possibly
for other IDEs as well.

- Used compilers a about `host`, `build` and `target` machines
  arere listed in `intro-compilers.json`
- Informations lister in `intro-machines.json`
- `intro-dependencies.json` now includes internal dependencies,
  and relations between dependencies.
- `intro-targets.json` now includes dependencies, `vs_module_defs`,
  `win_subsystem`, and linker parameters.
2023-04-20 18:31:39 +03:00
Jussi Pakkanen 5a34505b18 Add c++23 to the list of C++ standards. 2023-04-17 13:56:31 +03:00
Sebastian Dröge 22960758aa rust: Use the corresponding rustc version when clippy-driver is chosen as Rust compiler
By default clippy-driver will report its own version, which is not very
useful to check the toolchain version. Instead make sure to extract the
actual toolchain version here.
2023-04-14 15:52:54 +05:30
Sebastian Dröge 49e62877d1 rust: Don't pass dependency compile arguments to the compiler
Rust doesn't have a concept of dependency compile arguments, i.e.
something like headers. Dependencies are linked in and all required
metadata is provided by the linker flags.
2023-04-14 06:11:44 -04:00
Josh Soref cf9fd56bc9 fix various spelling issues
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-11 19:21:05 -04:00
HiPhish 439a61affa Change "can not" to "cannot" throughout project
The word "cannot" expresses inability to do something whereas "can not"
expresses the ability to refrain from doing something.
2023-04-11 17:10:01 +03:00
Renan Lavarec 4fedf19f41 asm: Add sx extension
docs: gcc https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html
      scons: https://scons.org/doc/3.0.5/HTML/scons-user/apb.html

  .S      Windows:  assembly language file
          ARM: CodeSourcery Sourcery Lite
  .sx     assembly language file + C pre-processor
          POSIX:  assembly language file + C pre-processor
2023-03-23 12:22:12 -04:00
Volker Weißmann 193a12e366 Small fix on how cc.sizeof (and similar functions) use the 'prefix' kwarg 2023-03-18 09:47:05 -04:00
Charles Brunet a5a7b29a66 prevent lib prefix warning from pkg-config 2023-03-16 08:27:06 -04:00
David Robillard 535498d367 Fix warning_level=everything with GCC 8
This option was introduced with GCC 8.1.0 as in the original commit, but the
value wasn't right initially and was volatile during the 8 series.

To avoid this, this commit moves the warning to 9.1.0 (the next version we
generally care about), since we don't want to get too deep into the weeds of
point releases, and a warning not being used yet in some particular version of
GCC isn't a big deal.
2023-03-12 19:51:56 -04:00
Khem Raj 24ea1d3f19 detect.py: Be more precise about detecting xtensa gcc toolchains
clang --version can yield a string like below when its installed into
such a directory

clang version 14.0.0 (https://github.com/llvm/llvm-project 3f43d803382d57e3fc010ca19833077d1023e9c9)
Target: aarch64-yoe-linux
Thread model: posix
InstalledDir: /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux/gnome-text-editor/42.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux

as you can see InstallDir has 'xt-' subtring and this trips the check to
guess gcc

if 'Free Software Foundation' in out or 'xt-' in out:

Therefore, check if compiler output starts with xt- then assume
it to be gcc

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-03-09 21:38:13 -08:00
Andres Freund 808d5934dd Use caching in Compiler.sizeof() and Compiler.alignment() 2023-02-27 20:09:32 -05:00
Andres Freund 9a41ce58d6 Add Compiler.cached_run()
Caching Compiler.run() seems likely to cause problems, but some users, like
.sizeof(), we know enough about the program run to make it safe.

This commit just adds the Compiler.cached_run(), a subsequent commit makes use
of it.
2023-02-27 20:09:32 -05:00
mtribiere b80f8456ec Misleading comment
Code moved to detect.py in recent version
2023-02-25 08:50:07 -05:00
L. E. Segovia c2b0ca0fb9 nasm: Detect and use MSVC linker if present
Fixes #11082
2023-02-20 09:58:34 -05:00
Xavier Claessens 744e6ebe1d nasm: Link with windows CRT libs when nasm is used as linker language 2023-02-20 09:58:34 -05:00
Luke Elliott 8fdb8b01ad compilers: -fprofile-correction is only a valid switch with gcc itself.
clang++ main.cpp -fprofile-correction
clang-15: warning: optimization flag '-fprofile-correction' is not supported
 [-Wignored-optimization-argument]
2023-02-17 09:34:32 -05:00
Simon McVittie 70286a93b0 asm: Use more backward-compatible invocation syntax for nasm
Before version 2.14.01, -MD required an output filename argument, with
`-MD outfile` equivalent to later versions' `-MD -MF outfile`. The older
syntax is still supported, and is still listed as the preferred syntax
in documentation.

Reference: https://github.com/netwide-assembler/nasm/commit/3475462e
Resolves: https://github.com/mesonbuild/meson/issues/11395
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-14 08:34:57 -05:00
Eli Schwartz 84dd78e80d
cython: wire up support for emitting and using depfiles
This solves rebuild issues when e.g. importing a .pxd header from a .pyx
file, just like C/C++ source headers. The transpiler needs to run again
in this case.

This functionality is present in the 3.0.0 alphas of cython, and is also
backported to 0.29.33.

Fixes #9049
2023-02-10 02:16:53 -05:00
Dylan Baker f06c0e9409 compilers: Optimize the /Zc:__cplusplus code
This could also be handled once, in the initializer
2023-02-08 15:31:58 +05:30
Dylan Baker d55d7bc45d compilers: Remove /utf-8 from Visual Studio command args once
Instead of looking at it each time get_always_args() is called, do it
once. Also avoid mutating global state.
2023-02-08 15:31:58 +05:30
Dylan Baker ee8e7ada1d compilers: Copy const always_args before returning
Eventually we would probably be better served (to avoid unnecessary
copies) to use the ImmutableListProtocol here, but for the moment this
is effective, it's also what we do in every other case.
2023-02-08 15:31:58 +05:30
Chun-wei Fan 9bbceeee06 Visual Studio: Drop /utf-8 if it is not supported
We assume /utf-8 for all C builds unless /source-charset or
/execution-charset is specified, but then this will cause trouble for
Visual Studio 2013 or earler since the /utf-8 flag is only supported
since Visual Studio 2015.  Specifically, if we try to check whether
compiler flags are supported, those checks will fail since /utf-8 is
never supported on these older Visual Studio versions.

Drop /utf-8 from get_always_args() if we are using Visual Studio 2013
or earlier.
2023-02-07 15:32:22 +05:30
Eli Schwartz 0a6e485d92
pylint 2.16: join iterables without repeated append
We do += style joining in a loop, but we could just join with
`''.join()` which is faster, neater, and simpler.
2023-02-01 17:01:31 -05:00
Eli Schwartz 1000246d07
remove unneeded type comment 2023-02-01 17:01:30 -05:00
Eli Schwartz 680b5ff819
treewide: add future annotations import 2023-02-01 17:01:30 -05:00
Dudemanguy f2cb8e2ad5 add cc.has_function_attribute('vector_size') 2023-02-01 13:26:09 -08:00
Charles Brunet 3729b6bcd4 remove /utf-8 option when /validate-charset- is present 2023-02-01 11:33:17 -05:00
David Seifert 9e9fa8f820 cuda: enable C++20 for CUDA 12
https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#cuda-compilers
2023-01-31 17:54:43 -05:00
Gijs Peskens 5a4168c410 Fix nasm when target has threads as added dependency 2023-01-18 10:05:33 -05:00
Luke Elliott d573db77bc clang-cl: supports /std:c++20 now.
See https://github.com/llvm/llvm-project/commit/a8f75d49
2023-01-04 09:47:13 -08:00
Dylan Baker f7cde8d3f6 Add fatal=False to many mlog.warnings()
There are lots of warnings that become fatal, that are simply unfixable
by the end user. Things like using old versions of software (because
they're using some kind of LTS release), warnings about compilers not
supporting certain kinds of checks, or standards being upgraded due to
skipped implementations (MSVC has c++98 and c++14, but not c++11). None
of these should be fatal, they're informative, and too important to
reduce to notices, but not important enough to stop meson if they're
printed.
2023-01-03 14:49:02 -05:00
Dylan Baker b9ef662926 reformat some warnings for better code readability 2023-01-03 14:49:02 -05:00
Kleis Auke Wolthuizen 18d2431685 emscripten: remove no longer relevant comment
This was fixed in Emscripten 1.39.16, see:
d4fabf3da4
2022-12-27 06:59:55 -05:00
Kleis Auke Wolthuizen cd6b67dea8 emscripten: enforce version 1.39.19 or higher 2022-12-27 06:59:55 -05:00