Commit Graph

673 Commits

Author SHA1 Message Date
Jussi Pakkanen 3a25efc056
Merge pull request #7581 from peterh/aix
Add AIX support
2020-08-25 23:58:17 +03:00
Jussi Pakkanen fc13c90de3
Merge pull request #7600 from alexrp/master
Add C2x option support.
2020-08-23 00:26:44 +03:00
Jussi Pakkanen a9f33d96c6
Merge pull request #7609 from dcbaker/submit/2020-08/cmake-fix-apple-clang
Fix mapping of apple compilers in cmake
2020-08-22 22:40:44 +03:00
Dylan Baker b6c28d282c compilers: Add Apple subclasses for ObjC and ObjC++
These are needed because in some cases we need to be able to know if
we're using vanilla clang or Apple's clang.
2020-08-22 10:49:35 -07:00
Alex Rønne Petersen 450155110c Add C2x option support. 2020-08-22 18:57:05 +02:00
Jussi Pakkanen e9a71ebf60
Merge pull request #7607 from bonzini/speedup
Various speedups from profiling QEMU's meson.build
2020-08-22 18:40:03 +03:00
Jussi Pakkanen c42298e146
Merge pull request #7447 from scivision/nvc
Add support for NVidia HPC SDK compilers
2020-08-22 18:31:56 +03:00
makise-homura 1f2150fe49 Correctly determine C++ stds for Elbrus compiler 2020-08-20 23:49:18 +03:00
Paolo Bonzini 847bb43470 clike: optimize to_native
Look for group-able flags with a single regex match, since we are already using
regexes for .so files.  Also weed out flags other than -isystem very quickly
with a single startswith call.

On a QEMU build, the time spent in to_native goes from 2.279s to 1.322s.
2020-08-18 08:11:25 +02:00
Peter Harris 7b0c1e2349 find_library: include get_linker_always_args in link args
The linker always args, as the name implies, should always be included. For
example, the AIX get_allow_undefined_link_args are a syntax error unless
the AIX get_linker_always_args are also used.
2020-08-17 21:21:33 -04:00
Michael Hirsch f2890cbf97 msvc: enable /std:c11 flag 2020-08-09 11:48:41 -07:00
Antony Chan 70edf82c6c Make meson recognize the Qualcomm LLVM toolchain
Meson calls `path/to/clang++ --version` to guess which build toolchain the
user has picked to build the source code. For the Qualcomm LLVM toolchain,
the output have an unusual output as shown below:

```
clang version 8.0.12
Snapdragon LLVM ARM Compiler 8.0.12 (based on llvm.org 7.0+)
Target: arm-unknown-linux-gnueabi
Thread model: posix
Repository: (ssh://git-hexagon-aus.qualcomm.com:...)
InstalledDir: /pkg/qct/software/llvm/release/arm/8.0.12/bin
```

Another unusual pattern is the output of `path/to/ld.qcld --version`:

```
ARM Linker from Snapdragon LLVM ARM Compiler Version 8.0.12
ARM Linker based on LLVM version: 8.0
```

The Meson logic is modified accordingly so that Meson can correctly
determine toolchain as "LLVM aarch64 cross-compiler on GNU/Linux64 OS".

This is the expected output of
`meson --native-file native_file.ini --cross-file cross_file.ini build/aarch64-debug/`:

```
...
C++ compiler for the host machine: ... (clang 8.0.12 "clang version 8.0.12")
C++ linker for the host machine: ... ld.lld 8.0.12
...
```
2020-08-02 10:39:44 -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
Xavier Claessens 6bf61b2a38 visualstudio: warning_level 0 should not map to /W1
In every other compilers level 0 maps to no argument at all.
2020-07-22 15:54:13 -04:00
Elliot Haisley 063b74ebba fix msvc not recognising b_ndebug
fixes #7404
2020-07-19 15:26:30 +03:00
Nirbheek Chauhan 21da2c9040 Fix native builds on Windows ARM64 machines
I made the mistake of always selecting the debug CRT for compiler
checks on Windows 4 years ago:
https://github.com/mesonbuild/meson/pull/543
https://github.com/mesonbuild/meson/pull/614

The idea was to always build the tests with debugging enabled so that
the compiler doesn't optimize the tests away. But we stopped doing
that a while ago, and also the debug CRT has no relation to that.

We should select the CRT in the same way that we do for building
targets: based on the options.

On Windows ARM64, the debug CRT for ARM64 isn't always available, and
the release CRT is available only after installing the runtime
package. Without this, we will always try to pick the debug CRT even
when --buildtype=debugoptimized or release.
2020-07-13 15:28:38 +00:00
Michael Hirsch, Ph.D f985bb7383
add Nvidia HPC SDK compilers 2020-07-13 00:16:52 -04:00
Dylan Baker 4f6bd29ac9 arglist: Split the C/C++ specifics parts into a subclass for CLike
This means that we don't need work arounds for D-like compilers, as the
special c-like hanlding wont be used for D compilers.
2020-06-22 12:06:10 -07:00
Dylan Baker 93c3ec7e2d compilers: Return CompilerArgs from compiler instance
Since the CompileArgs class already needs to know about the compiler,
and we really need at least per-lanaguage if not per-compiler
CompilerArgs classes, let's get the CompilerArgs instance from the
compiler using a method.
2020-06-22 12:06:10 -07:00
Dylan Baker 9d0ad66c29 compilers: Split CompilerArgs into a separate module
I've also moved this out of the compilers pacakge because we're soon
going to need it in linkers, and that creates some serious spagetti
2020-06-22 12:06:10 -07:00
Dylan Baker 386721f7fd compilers: Add missing annotations to CompilerArgs class 2020-06-22 12:06:10 -07:00
Dylan Baker b887212bee compilers: Use enum for for deupdlication returns in CompilerArgs 2020-06-22 12:06:10 -07:00
Tim-Philipp Müller 246e5437aa compiler: add 'force_align_arg_pointer' function attribute 2020-06-21 23:34:11 +03:00
Nirbheek Chauhan 47c477711b apple: -headerpad args are ignored when bitcode is enabled
Causes spammy warnings from the linker:

ld: warning: -headerpad_max_install_names is ignored when used with -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES)
2020-06-11 07:10:43 +00:00
Marcel Hollerbach 18b99b3bc3 compilers: corretify deduplication direction
so: when building compile args, meson is deduplicating flags. When a
compiler argument is appended, a later appearance of a dedup'ed is going
to remove a earlier one. If the argument is prepended, the element
*before* the new one is going to be removed. And that is where the
problem reported in https://github.com/mesonbuild/meson/pull/7119 is
coming in. In the revision linked there, the order of replacement in the
prepend case was revesered.

With this patch, we restore this behaviour again.
2020-06-11 01:42:59 +03:00
Seungha Yang 8edbb2859c compilers: Add UNIX large file support for MinGW
MinGW gcc supports _FILE_OFFSET_BITS=64 and we need to set it for
MinGW as well
2020-06-09 12:49:11 +00:00
Jussi Pakkanen 7e1bef6959
Merge pull request #7119 from marcelhollerbach/master
Performance optimize ninja backend
2020-06-07 22:33:04 +03:00
Jussi Pakkanen 508a0d6073
Merge pull request #7256 from peterh/openmp
Fix OpenMP on Visual Studio
2020-06-07 22:24:40 +03:00
Jussi Pakkanen 86df85d511 Remove warnings from sample code. Closes #7248. 2020-06-07 20:27:18 +03:00
Jussi Pakkanen fd0ad977a6 End test code with a newline. Closes #7247. 2020-06-07 20:20:31 +03:00
Peter Harris 9462f0c7bc msvc: Avoid spurious openmp link warnings
The linker that comes with MSVC does not understand the /openmp flag.
This results in a string of

    LINK : warning LNK4044: unrecognized option '/openmp'; ignored

warnings, one for each static_library linked with an executable.

Avoid this by only setting the linker openmp flag when the compiler is
not MSVC.
2020-06-06 12:04:28 -04:00
Marcel Hollerbach 032ab3606d CompilerArgs: refactor __iadd__
the previous optimizations from 4524088d38
were not relaly good, and not really scaleable, since only the lookup
was improved. However, the really heavy calls to remove have not been
improved.

With this commit we are refactoring CompilerArgs into a data structure
which does not use remove at all. This works that we are building a pre
and post list, which gets flushed into __container at some point.
However, we build pre and post by deduplicating forward. Later on, when
we are flushing pre and post into __container, we are deduplicating
backwards the list, so we are not changing behaviour here.

This overall cuts off 10s of the efl configuration time. Further more
this improves configure times on arm devices a lot more, since remove
does seem to be a lot slower there. In general this results in the fact
that __iadd__ is not within the top 5 of costly functions in
generate_single_complie.
2020-06-05 09:21:23 +02:00
Marcel Hollerbach ba8e838dcf Revert "CompilerArgs: make lookup faster"
This was a not so nice solution, and should be replaced with something
better.

This reverts commit 4524088d38.
2020-06-05 09:04:04 +02:00
Marcel Hollerbach 256e910dee cache up regex mathings
the names passed in here are often the same. We should ensure that we
cache the regex match, as this will speed up our runtime a lot.
2020-06-05 09:02:23 +02:00
Mike Gilbert 5b3bed525d Ignore file access errors when scanning .so files in system libdirs
Bug: https://bugs.gentoo.org/726524
2020-06-02 20:50:36 +03:00
Michael Hirsch, Ph.D e2c475939e add type anno: compilers/clike 2020-05-27 20:24:21 +03:00
Phillip Johnston bdfd46e579 Recognize Arduino .ino files as C++
Renaming .ino files is not an option when working with the IDE. Meson should recognize it as C++ however.
2020-05-27 20:17:26 +03:00
Drew Reed 9a94ffe061 Modifed buildtypes and armclang compiler flags to match documented results 2020-05-22 18:28:09 +03:00
georgev93 eee117aa24 Allow building with b_coverage set to true when clang is being used regardless of linker selection. 2020-05-22 17:18:54 +03:00
Yevhenii Kolesnikov 9dc3ca2c1c compilers: add fetching of define list for clang
Simmilar to gcc, the list of pre-processor defines can be fetched with
`-dM -E` option. The way cpu_family is determined on linux relies on
this list.

Fixes incorrect value of cpu_family on linux, when crosscompiling:

```
CC="clang -m32" meson ./build
```

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2020-05-22 16:58:12 +03:00
Dylan Baker 29ef4478df compilers/d: Add b_ndebug support
D lang compilers have an option -release (or similar) which turns off
asserts, contracts, and other runtime type checking. This patch wires
that up to the b_ndebug flag.

Fixes #7082
2020-05-20 14:20:26 -07:00
Dylan Baker d04e2c2f1f compilers: Move b_ndebug into the compiler classes
Right now we hardcode -DNDEBUG as the value to be added for b_ndebug.
Which is a not the correct behavior for non C/C++ languages. By pushing
this back into the compiler classes we can change this for other
languages.
2020-05-20 14:20:26 -07:00
Jussi Pakkanen 751ea3df72
Merge pull request #7103 from dankegel/bug4027-rpath-remember
Let .pc files and LDFLAGS provide rpaths.
2020-05-18 23:17:34 +03:00
Dylan Baker 6fe68edbf8 compilers/d: Enable pgo for GDC 2020-05-18 19:29:18 +03:00
Dan Kegel d7235c5905 Let .pc files specify rpath.
Fixes #4027
2020-05-16 20:25:58 +00:00
Drew Reed 3d41fa9b1e Add flags to support generation of dependency files with armclang 2020-05-16 16:37:09 +03:00
Drew Reed cce5f860b9 Modifed buildtypes and armcc compiler flags to match documented results 2020-05-16 16:36:47 +03:00
Drew Reed 697bb28084 Call to CPPCompilers initilisation function was missing the info parameter during ArmClangCPPCompiler initialisation 2020-05-16 16:35:32 +03:00
Nirbheek Chauhan 37bade6f87 gfortran: Fix has_header implementation with GCC 10
__has_include is not accepted as a pre-processor directive in Fortran
code since GCC 10.

Closes https://github.com/mesonbuild/meson/issues/7017
2020-05-14 09:31:16 +00:00
Eric Lemanissier ab6a410426 macos: Remove framwork linkerlike args
fixes-up 33fbc548ab
2020-05-13 15:55:07 +00:00