Commit Graph

303 Commits

Author SHA1 Message Date
Nirbheek Chauhan 50b863032e find_library: Check arch of libraries on Darwin
macOS provides the tool `lipo` to check the archs supported by an
object (executable, static library, dylib, etc). This is especially
useful for fat archives, but it also helps with thin archives.

Without this, the linker will fail to link to the library we mistakenly
'found' like so:

ld: warning: ignoring file /path/to/libfoo.a, missing required architecture armv7 in file /path/to/libfoo.a
2019-01-31 20:36:49 +00:00
Nirbheek Chauhan c0166355ce Rewrite appleframework and extraframework dependency classes
Instead of only doing a naive filesystem search, also run the linker
so that it can tell us whether the -F path specified actually contains
the framework we're looking for.

Unfortunately, `extraframework` searching is still not 100% correct in
the case when since we want to search in either /Library/Frameworks or
in /System/Library/Frameworks but not in both. The -Z flag disables
searching in those prefixes and would in theory allow this, but then
you cannot force the linker to look in those by manually adding -F
args, so that doesn't work.
2019-02-01 00:14:09 +05:30
Michael Hirsch, Ph.D cccffaa29d BUGFIX: allow fc.run(code) to work, pick only Fortran module 2019-01-29 23:25:23 +02:00
Michael Hirsch, Ph.D 4e31ca3abe correct naming to CudaCompiler, pep8 2019-01-29 22:06:11 +02:00
Michael Hirsch, Ph.D 8636f31d9c BUGFIX: broken/missing Fortran code/unit tests 2019-01-27 20:57:21 +02:00
Jussi Pakkanen e1b50309df All the fixes needed to make work against current master. 2019-01-21 23:59:20 +02:00
Jussi Pakkanen 8eca221aac More tests and pic. 2019-01-21 23:35:38 +02:00
Jussi Pakkanen 396e355c94 Clean up minor issues. 2019-01-21 23:35:38 +02:00
Beau Johnston 54b6afa675 added cuda compiler 2019-01-21 23:35:38 +02:00
Michael Hirsch, Ph.D 72486afd08 Add PGI C and C++ compilers (#4803) 2019-01-21 20:09:36 +02:00
Michael Hirsch, Ph.D 9bb21be59b
FlangFortranCompiler inherit ClangCompiler 2019-01-16 17:06:44 -05:00
Michael Hirsch, Ph.D 9a318d3d5a
better handle link args: PGI and Flang
correct flang, pgi options
2019-01-16 17:06:44 -05:00
Michael Hirsch, Ph.D b40c1af900
Flang Fortran compiler added. 2019-01-16 17:06:43 -05:00
Michael Hirsch, Ph.D fff88b354a restore PGI compile functioning 2019-01-15 20:27:31 +02:00
Phillip Cao 13fe2e40eb Add get_werror_args for CCRX C compiler 2019-01-10 22:56:47 +02:00
Daniel Mensinger ca808a0702
More os.pathsep 2019-01-06 12:19:33 +01:00
Daniel Mensinger 477b69b505
Use os.pathsep 2019-01-06 12:19:33 +01:00
Daniel Mensinger 681532452c
Handle java correct 2019-01-06 12:19:33 +01:00
Daniel Mensinger 9eca2e46a0
Added more compiler option support 2019-01-06 12:19:33 +01:00
Daniel Mensinger 9742927903
Absolute path generation refactoring 2019-01-06 12:19:32 +01:00
Daniel Mensinger c4eb5c79fe
Added unit test 2019-01-06 12:19:28 +01:00
Daniel Mensinger 71d17b44e4
Fixed list_target_files and list_targets 2019-01-06 12:19:28 +01:00
John Ericson 2b22576fb6 Remove cross_info; cross file is parsed up front and discarded 2019-01-02 16:22:47 -05:00
Jussi Pakkanen 6c76ac8017 Handle strings in cross file args. Closes #4671. 2019-01-02 22:28:22 +02:00
Jussi Pakkanen 3d7c32a34e
Merge pull request #4451 from jon-turney/simplify-x86-msvc-test
Simplify x86 msvc test
2018-12-29 18:43:13 +02:00
Jussi Pakkanen c220816350
Merge pull request #4573 from jon-turney/msys2-clang
More clang for Windows support
2018-12-21 00:01:31 +02:00
Dylan Baker b335ca2818 compilers/icc: Add even more diag-errors to actually error on
This is a classy compiler.
2018-12-16 16:42:25 +02:00
Jon Turney 541307a426
Windows clang supports `-mwindows` to set subsystem
Promote get_gui_app_args from class GnuCompiler to GnuLikeCompiler
2018-12-09 20:40:24 +00:00
Martin Storsjö 05e75ab3e7 Reinstate "compilers/c: Fix allow undefined link arg for PE/COFF"
This reinstates 2256e6314b, which was
lost in refactoring in 9f9cfd2139.
2018-12-09 16:24:58 +02:00
Jussi Pakkanen c44a5a1aec Deduplicate export-dynamic and pthread. Closes #4567. 2018-12-06 16:20:54 +02:00
Jon Turney a872b925ea
Store the target architecture for CL-like compilers
Store the MSVC compiler target architecture ('x86', 'x64' or 'ARM' (this
is ARM64, I believe)), rather than just if it's x64 or not.

The regex used for target architecture should be ok, based on this list
of [1] version outputs, but we assume x86 if no match, for safety's
sake.

[1] https://stackoverflow.com/a/1233332/1951600

Also detect arch even if cl outputs version to stdout.

Ditto for clang-cl

Future work: is_64 is now only used in get_instruction_set_args()
2018-12-06 13:25:16 +00:00
Jussi Pakkanen 2c91ca3d6a Remove linkerlike args from compile checks. Closes #4542. 2018-11-27 22:17:38 +02:00
Jon Turney a33acd31da Fix flake8 'imported but unused' reports
$ flake8 | grep F401
./run_unittests.py:43:1: F401 'mesonbuild.mesonlib.is_linux' imported but unused
./mesonbuild/compilers/c.py:32:1: F401 '.compilers.CompilerType' imported but unused
./mesonbuild/compilers/cpp.py:23:1: F401 '.compilers.CompilerType' imported but unused
2018-11-19 21:07:37 +02:00
Dylan Baker 0092a7d3f9
Merge pull request #4359 from dcbaker/icc-fixes
ICC fixes for Linux and MacOS
2018-11-17 06:57:07 -08:00
Jussi Pakkanen aa20c91e6e Guard against broken lib paths returned by gcc. 2018-11-17 16:26:02 +02:00
Dylan Baker 842d8556ec compilers: quiet ICC messages about pch
These are useful for debugging, but not interesting for end users, where
it just adds lines between ninja jobs without adding value.
2018-11-15 19:07:28 -08:00
Dylan Baker b17ab09eaf compilers/fortran: pass -module ${path} instead of -module${path}
ifort doesn't like the latter, and gfortran seems happy with the former.
I don't have any of the other supported fortran compilers to test with.
2018-11-15 18:42:25 -08:00
Dylan Baker a7845d91aa ifort: ifort needs to have -lifcore like gfotran needs -lgfortran 2018-11-15 18:42:25 -08:00
Dylan Baker 9f9cfd2139 compilers: Move get_allow_undefined_link_args to Compiler
This allows each implementation (gnu-like) and msvc to be implemented in
their respective classes rather than through an if tree in the CCompiler
class. This is cleaner abstraction and allows us to clean up the Fortran
compiler, which was calling CCompiler bound methods without an instance.
2018-11-15 18:42:25 -08:00
Dylan Baker a480de1cb5 compilers: ICC should error when an unknown __attribute__ is tested 2018-11-15 18:42:25 -08:00
Dylan Baker 315d07d306 compilers: Set the correct values for undefined modules on apple with icc 2018-11-15 18:42:25 -08:00
Dylan Baker 3ab9620180 compilers: Add ICC setting for get_allow_undefined_link_args 2018-11-15 18:42:25 -08:00
Dylan Baker f46adb44bf compilers: Enable PGO for ICC
ICC doesn't use the same -fprofile-generate/-fprofile-use that GCC and
Clang use, instead it has -prof-gen and -prof-use. I've gone ahead and
added the threadsafe option to -prof-gen, as meson currently doesn't
have a way to specify that level of granularity and GCC and Clang's
profiles are threadsafe.
2018-11-15 18:42:25 -08:00
Dylan Baker 7329ae3ce6 fortran: ifort doesn't have -pipe 2018-11-15 18:42:25 -08:00
Dylan Baker 28fd725d61 compilers: fix compiler.compile for Intel Compilers
has_arguments is the wrong thing to fix, since all checks that require
compiler options are based on compiles, it's the right thing to modify.
2018-11-15 18:42:25 -08:00
Dylan Baker 21a7528b2f compilers/c_function_attributes: fix for ICC
ICC doesn't like the extra set of parens, GCC 8.2.1 and Clang 6.0.1
don't have a problem with this.
2018-11-15 18:42:25 -08:00
Dylan Baker 484fca9866 compilers: Fix the set of features that ICC exposes 2018-11-15 18:34:12 -08:00
Jussi Pakkanen 6a2dc7576e Store unexpanded library directory paths. Closes #4392. 2018-11-15 21:10:16 +02:00
Dylan Baker de175aac00 compilers: Use keyword only arguments for compiler interfaces
Because we need to inherit them in some cases, and python's
keyword-or-positional arguments make this really painful, especially
with inheritance. They do this in two ways:

1) If you want to intercept the arguments you need to check for both a
   keyword and a positional argument, because you could get either. Then
   you need to make sure that you only pass one of those down to the
   next layer.

2) After you do that, if the layer below you decides to do the same
   thing, but uses the other form (you used keyword by the lower level
   uses positional or vice versa), then you'll get a TypeError since two
   layers down got the argument as both a positional and a keyword.

All of this is bad. Fortunately python 3.x provides a mechanism to solve
this, keyword only arguments. These arguments cannot be based
positionally, the interpreter will give us an error in that case.

I have made a best effort to do this correctly, and I've verified it
with GCC, Clang, ICC, and MSVC, but there are other compilers like Arm
and Elbrus that I don't have access to.
2018-11-13 00:40:13 +02:00
Phillip Cao 76333d2a1e Add prefix option for link args 2018-11-08 00:02:24 +13:00