Commit Graph

252 Commits

Author SHA1 Message Date
Dylan Baker 64f3174daa compilers/emcc: Fix inheritance order
Sot hat the BasicLinkerIsCompilerMixin comes before ClangCCompiler,
which hides its "call the linker" methods, as emcc doesn't have a
separate linker.
2020-02-27 16:35:02 -08:00
alanNz 1682058dec -Fixed Renesas RX Family compiler to work with latest meson, updated cross-file, fixed assembly file use 2020-01-30 22:11:26 +02:00
Dylan Baker 0f47ca95c1 compilers: Split ClangCL and MSVC mixins
Instead of checking the compiler id inside the VisualStudioLikeCompiler
class, this creates two subclasses that each represent the divergent
behavior of the two compilers
2020-01-28 10:52:00 -08:00
makise-homura ee6c2c87fc Bringing back defines in Elbrus C compiler to simplify environment.py 2020-01-27 22:37:21 +03:00
makise-homura 7321cc776a Fix missing 'defines' argumet for Elbrus compiler
...But somehow it still remains in C++ compiler.
2020-01-27 22:35:26 +03:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Jussi Pakkanen 7ec3af95e5
Updated linker MR (#6407)
* environment: Fix passing always args to a number of less common linkers

These are mostly (oops xilink) proprietary linkers I can't use for
various reasons.

Fixes: #6332

* Add intelfix from scivision.

* Ifort fix from scivision.

* PGI fix from scivision.

* Cuda fix from scivision.

* Fix linker passing for armclang.
2020-01-06 16:49:34 +02:00
Jussi Pakkanen a2a9611e1d
Merge pull request #6065 from dcbaker/pass-options-to-linker-detection
Pass options to linker detection
2019-12-17 21:09:26 +02:00
Dylan Baker 7f0224fb88 compilers: make use of mlog.log_once
I'm sure there are other places that could use this, but I didn't see
any right off that bat.
2019-12-13 09:57:05 -05:00
Dylan Baker ee6e249f65 compilers: move language attribute to the class level
We know that if a compiler class inherits CCompiler it's language will
be C, so doing this at the class level makes more sense.
2019-12-12 09:35:30 -08:00
Michael Hirsch, Ph.D 83b4e981c4 Use strict function prototypes 2019-11-18 22:21:36 +02:00
Andrei Alexeyev 50646a8723 Refactor duplicate Emscripten code into a mixin 2019-10-18 00:31:57 +03:00
Andrei Alexeyev bd42cb965a Fix emscripten C compiler initialization 2019-10-15 21:52:35 +03:00
Andrei Alexeyev dd162dccaa Implement get_linker_output_args in Emscripten compilers 2019-10-14 13:04:34 -07:00
Andrei Alexeyev 31b8ddab51 Implement get_allow_undefined_link_args in EmscriptenCCompiler 2019-10-14 13:04:34 -07:00
Ting-Wei Lan 9f0f595b35 compilers: Fix version requirements for ClangC and AppleClangC
Commit ff4a17dbef modified the version
requirements wrongly. AppleClangC should be the one with higher version
numbers. Exchange them to fix the check.
2019-10-11 10:03:35 -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
Dylan Baker ff4a17dbef compilers: Add a specific type for AppleClangC
This allows us to detect use classes rather than methods to determine
what C standards are available.
2019-10-07 10:44:56 -07: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 18b1bf9292 compilers: Make MSVClike compilers proxy extra keyword arguments 2019-08-14 13:13:23 -07:00
Jussi Pakkanen f41bdae368 Add basic Webassembly support via Emscripten. 2019-08-05 19:31:32 +03:00
Martin Liska c1870889b1 Fix missing return statements that are seen with -Werror=return-type.
Error example:

Code:

        #include <locale.h>
        int main () {
            /* If it's not defined as a macro, try to use as a symbol */
            #ifndef LC_MESSAGES
                LC_MESSAGES;
            #endif
        }
Compiler stdout:

Compiler stderr:
 In file included from /usr/include/locale.h:25,
                 from /tmp/tmpep_i4iwg/testfile.c:2:
/usr/include/features.h:382:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  382 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
/tmp/tmpep_i4iwg/testfile.c: In function 'main':
/tmp/tmpep_i4iwg/testfile.c:8:9: error: control reaches end of non-void function [-Werror=return-type]
    8 |         }
      |         ^
cc1: some warnings being treated as errors
2019-07-16 09:49:03 +02:00
Dylan Baker fab47c5680 compilers: split pgi compiler out of compilers module 2019-07-15 10:59:22 -07:00
Dylan Baker 5d685e7a5c compilers: put elbrus in mixins 2019-07-15 10:59:22 -07:00
Dylan Baker bc4438b34f compilers: Put clang mixin in a module 2019-07-15 10:59:22 -07:00
Dylan Baker e879992114 compilers: move ArmClang into mixins/arm.py 2019-07-15 10:59:22 -07:00
Dylan Baker b8368c1617 compilers: Put Intel compiler classes into the mixins folder 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
Dylan Baker 214ab455d3 compilers: Move the VisualStudioLikeCompiler class into mixins 2019-07-15 10:59:22 -07:00
Dylan Baker ef448b95ae compilers: Move ArmCompiler to a mixin module 2019-07-15 10:59:22 -07:00
Dylan Baker 4d5c745bdc compilers: move ccrx compiler abstraction into mixins 2019-07-15 10:59:22 -07:00
Dylan Baker d483da46a9 compilers: Move clike into a mixins directory
The compilers module is rather large and confusing, with spaghetti
dependencies going every which way. I'm planning to start breaking out
the internal representations into a mixins submodule, for things that
shouldn't be required outside of the compilers module itself.
2019-07-15 10:59:22 -07:00
David Seifert fcf27c2a2d Do not fail on passing `-Werror=unused-parameter` from environment 2019-07-14 15:12:16 +00:00
Michael Hirsch, Ph.D c756d06fbb
add clang c_std=c18 alias
fix unit test skips for clang c18

correct unittests clang minimum version

cleanup unittest clang skip c_std

finesse unittest vs. clang version
2019-07-08 22:27:35 -04:00
John Ericson 07777e15d4 Purge `is_cross` and friends without changing user interfaces
In most cases instead pass `for_machine`, the name of the relevant
machines (what compilers target, what targets run on, etc). This allows
us to use the cross code path in the native case, deduplicating the
code.

As one can see, environment got bigger as more information is kept
structured there, while ninjabackend got a smaller. Overall a few amount
of lines were added, but the hope is what's added is a lot simpler than
what's removed.
2019-06-09 13:13:25 -04:00
Dylan Baker 5065db86f2 compilers/c: Fix removal of name from Combo options for ICL 2019-06-06 01:57:13 +03:00
John Ericson 4030e7cb7a UserOption no longer has a name field.
This avoids the duplication where the option is stored in a dict at its
name, and also contains its own name. In general, the maxim in
programming is things shouldn't know their own name, so removed the name
field just leaving the option's position in the dictionary as its name.
2019-05-15 14:21:47 +03:00
Dylan Baker fa54f05f09 compilers: Add basic ICL abstractions 2019-05-13 11:22:31 -07:00
Dylan Baker 080f59cf43 compilers: rename IntelCompiler to IntelGnuLikeCompiler
The Intel compiler is strange. On Linux and macOS it's called ICC, and
it tries to mostly behave like gcc/clang. On Windows it's called ICL,
and tries to behave like MSVC. This makes the code that's used to
implement ICC support useless for supporting ICL, because their command
line interfaces are completely different.
2019-05-13 11:22:31 -07:00
Dylan Baker 541523eeba compilers: Split C-Like functionality into a mixin classes
Currently C++ inherits C, which can lead to diamond problems. By pulling
the code out into a standalone mixin class that the C, C++, ObjC, and
Objc++ compilers can inherit and override as necessary we remove one
source of diamonding. I've chosen to split this out into it's own file
as the CLikeCompiler class is over 1000 lines by itself. This also
breaks the VisualStudio derived classes inheriting from each other, to
avoid the same C -> CPP inheritance problems. This is all one giant
patch because there just isn't a clean way to separate this.

I've done the same for Fortran since it effectively inherits the
CCompiler (I say effectively because was it actually did was gross
beyond explanation), it's probably not correct, but it seems to work for
now. There really is a lot of layering violation going on in the
Compilers, and a really good scrubbing would do this code a lot of good.
2019-05-03 10:36:50 -07:00
Dylan Baker da5f07cf39 Revert "detect Intel ICL on windows"
This reverts commit 3a75bb5259.
2019-05-02 14:56:23 -07:00
Dylan Baker c0aa89e57f
Merge pull request #4952 from mensinda/cacheCompiles
Cache compilers.compile() in coredata
2019-05-02 14:54:02 -07:00
Daniel Mensinger bf98ffca9e
Fix blind exceptions 2019-04-29 12:16:06 +02:00
Daniel Mensinger c61ae46461
Moved caching into a seperate function 2019-04-28 14:33:22 +02:00
Daniel Mensinger 8a32fc8dbe
Disable cache for dependencies 2019-04-28 14:33:22 +02:00
Daniel Mensinger 210fe5bf40
Add option to disable the cache 2019-04-28 14:33:21 +02:00
Daniel Mensinger 6969772a3e
Changing cached flag from True to False 2019-04-28 14:33:21 +02:00
Daniel Mensinger 971dfd664b
Added some cahced values 2019-04-28 14:33:21 +02:00
Daniel Mensinger dfe3d56bfd
Print '(cached)' when compiler result was cached 2019-04-28 14:33:21 +02:00
Daniel Mensinger c9bd84fd25
Cache compile results in coredata 2019-04-28 14:31:49 +02:00
Michael Hirsch, Ph.D 3a75bb5259 detect Intel ICL on windows
ICL CPP working
2019-04-27 23:19:01 -04:00
Michael Hirsch, Ph.D ee40533b61 better default order for fotran compiler search
correct PGI windows detection

doc

cleanup PGI detect
2019-04-27 23:19:01 -04:00
Dylan Baker 5678468c2c Don't use len() to test for container emptiness
I ran the numbers once before (it's in the meson history) but it's
*much* faster to *not* use len for testing if a container is empty or
not.
2019-04-25 12:28:51 -07:00
Nirbheek Chauhan 7654db511c vs: Update toolset table for VS 2019
Also add a test to ensure that we don't forget it in the future.
2019-04-18 09:01:23 +00:00
jrl64 a2d222c383 Update Built-in Option c_std for C17. Closes #4842. 2019-04-10 23:14:51 +03:00
Dylan Baker 6ad7fbf950 dependencies/misc: don't special case threads
Instad of having special casing of threads in the backends and
everywehre else, do what we did for openmp, create a real
dependency. Then make use of the fact that dependencies can now have
sub dependencies to add threads.
2019-04-05 16:41:08 -07:00
John Ericson f4da210f46 Sanity check with external args
Previously cross, but not native, external args were used. Then in
d451a4bd97 the cross special cases were
removed, so external args are never used.

This commit switches that so they are always used. Sanity checking works
just the same as compiler checks like has header / has library.
2019-03-27 10:54:56 -04:00
John Ericson e677704d21 Don't collect preprocssor flags separately from compiler flags
I recall that @jpakkane never wanted this, but @nirbheek did, but then
@nirbheek changed his mind.

I am fine either way except for the cross inconsistency that exists
today: There is no `c_preproc_args` or similar one can put in the cross
file, so no way to replicate the effect of CPPFLAGS during cross
compilation.
2019-03-27 14:45:42 +00:00
Jussi Pakkanen 3a613564d3
Merge pull request #5116 from dcbaker/openmp-de-specialize
dependencies/openmp: Don't special case OpenMP
2019-03-21 01:21:37 +02:00
Dylan Baker ac627bcea7 replace library type strings with an enum
This patch creates an enum for selecting libtype as static, shared,
prefer-static, or prefer-shared. This also renames 'static-shared'
with 'prefer_static' and 'shared-static' with 'prefer_shared'. This is
just a refactor with no behavioral changes or user facing changes.
2019-03-20 18:45:56 +02:00
Dylan Baker 1f342a2081 dependencies/openmp: Don't special case OpenMP
Currently we specialcase OpenMP like we do threads, with a special
`need_openmp` method. This seems like a great idea, but doesn't work
out in practice, as well as it complicates the opemp
implementation. If GCC is built without opemp support for example, we
still add -fopenmp to the the command line, which results in
compilation errors.

This patch discards that and treats it like a normal dependency,
removes the need_openmp() method, and sets the compile_args attributes
from the compiler.

Fixes #5115
2019-03-19 12:48:22 -07:00
Jussi Pakkanen 44dd5535f0
Merge pull request #4724 from jon-turney/lib-machine-always
Fix linking when cross-compiling and a windows resource is first object
2019-03-19 20:39:34 +02:00
Nirbheek Chauhan bcee8fb8ca compilers: Update comment about library search patterns 2019-03-14 12:21:05 +00:00
Nirbheek Chauhan 07818dac6a compilers: Try harder to dedup builtin libs
Compiler internal libs should always be de-duplicated, no matter what.

Closes https://github.com/mesonbuild/meson/issues/2150

Test case is by Bruce Richardson in the issue.
2019-03-14 12:21:05 +00:00
Niklas Claesson dd2c44cdf6 Add static as keyword to find_library 2019-03-11 20:56:52 +02:00
Antoine Jacoutot 03c0c3a8f4 Fix _get_patterns on OpenBSD
We need to account to the possible prefixes (empty or 'lib').
This allows both to work:
cc.find_library('foo')
cc.find_library('libfoo')
2019-03-11 06:02:17 +00:00
jml1795 a9e63568fe Add warning level zero 2019-02-19 00:06:27 +02:00
John Ericson d451a4bd97 Remove get_cross_extra_flags
This is no longer needed, we just remove conditionals around it.
2019-02-15 09:17:24 -08:00
John Ericson 19f81d3e33 Never access environment.properties downstream
Instead use coredata.compiler_options.<machine>. This brings the cross
and native code paths closer together, since both now use that.

Command line options are interpreted just as before, for backwards
compatibility. This does introduce some funny conditionals. In the
future, I'd like to change the interpretation of command line options so

 - The logic is cross-agnostic, i.e. there are no conditions affected by
   `is_cross_build()`.

 - Compiler args for both the build and host machines can always be
   controlled by the command line.

 - Compiler args for both machines can always be controlled separately.
2019-02-02 13:59:14 -05:00
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 8636f31d9c BUGFIX: broken/missing Fortran code/unit tests 2019-01-27 20:57:21 +02:00
Michael Hirsch, Ph.D 72486afd08 Add PGI C and C++ compilers (#4803) 2019-01-21 20:09:36 +02:00
Phillip Cao 13fe2e40eb Add get_werror_args for CCRX C compiler 2019-01-10 22:56:47 +02:00
Daniel Mensinger 9742927903
Absolute path generation refactoring 2019-01-06 12:19:32 +01:00
Jon Turney a223b20bb6
Fix linking when cross-compiling and a windows resource is first object
It appears that LIB/LINK default to the host architecture if they can't
guess it from the first object.  With the MSVC toolchain, resource files
are (usually) compiled to an arch-neutral .res format.  Always
explicitly provide a '/MACHINE:' argument to avoid it guessing
incorrectly when cross-compiling.
2019-01-05 20:22:13 +00:00
John Ericson 2b22576fb6 Remove cross_info; cross file is parsed up front and discarded 2019-01-02 16:22:47 -05: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 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 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 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
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 68c83cb213 Add support for Renesas CC-RX toolchain 2018-11-08 00:02:22 +13:00
Jon Turney c789efb8c8
Use lld-link with clang-cl
Use lld-link dynamic linker with clang-cl
Don't hardcode dynamic linker name in tests
2018-11-04 15:42:06 +00:00
Jon Turney a025c98d30
Qualify checks of self.version by self.id in VisualStudioC/CPPCompiler 2018-11-04 15:42:06 +00:00
Jon Turney e820c66a4c
Teach VisualStudioCCompiler.get_pch_use_args() to handle clang-cl
It seems that clang-cl isn't quite compatible with cl in the way it handles
pch, and when the precompiled header is used, the pathname of the header is
needed, not just its filename.

This fixes test\common\13 pch with clang-cl
2018-11-04 15:42:06 +00:00
Jon Turney b5b7e5b94a
Teach VisualStudioCCompiler.has_arguments() about clang-cl
When invoked as clang-cl to compile, it doesn't emit cl-compatible D9002
warnings about unknown options, but fortunately also supports
-Werror-unknown-argument instead.

When invoked to link, and using LINK, it does emit cl-compatible LNK4044
warnings about unknown options.
2018-11-04 15:42:06 +00:00
Jon Turney bb31a8c1c7
Only add link arguments when needed in Compiler object methods
Currently, ComplierHolder.determine_args() unconditionally adds the link
arguments to the commmand, even if we aren't linking, because it doesn't
have access to the mode (preprocess, compile, link) that
_get_compiler_check_args() will use.

This leads to command lines like:

'cl testfile.c /nologo /showIncludes /c /Fooutput.obj /Od kernel32.lib
user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib
uuid.lib comdlg32.lib advapi32.lib'

which clang-cl considers invalid; MSVS cl accepts this, ignoring the
unneeded libraries

Change from passing extra_args down to _get_compiler_check_args(), to
passing down a callback to CompilerHolder.determine_args() (with a bound
kwargs argument), so it can consult mode and kwargs to determine the args to
use.
2018-11-04 15:42:06 +00:00
Jon Turney 64edfd5069
Detect clang-cl as msvc-like, not clang-like
Handle clang's cl or clang-cl being in PATH, or set in CC/CXX

Future work: checking the name of the executable here seems like a bad idea.
These compilers will fail to be detected if they are renamed.

v2:
Update compiler.get_argument_type() test
Fix comparisons of id inside CCompiler, backends and elsewhere

v3:
ClangClCPPCompiler should be a subclass of ClangClCCompier, as well

Future work: mocking in test_find_library_patterns() is effected, as we
now test for a subclass, rather than self.id in CCompiler.get_library_naming()
2018-11-04 15:42:00 +00:00
Dylan Baker 63f4f9481e Add new compiler.get_argument_syntax method
Some compilers try very had to pretend they're another compiler (ICC
pretends to be GCC and Linux and MacOS, and MSVC on windows), Clang
behaves much like GCC, but now also has clang-cl, which behaves like MSVC.

This method provides an easy way to determine whether testing for MSVC
like arguments `/w1234` or gcc like arguments `-Wfoo` are likely to
succeed, without having to check for dozens of compilers and the host
operating system, (as you would otherwise have to do with ICC).
2018-11-03 18:10:36 +02:00
Josh Gao edda80cc75 Generalize gnulike-targeting-windows checks.
Replace several checks against GCC_MINGW or (GCC_MINGW, GCC_CYGWIN) with
is_windows_compiler instead, so that clang and other gcc-like compilers
using MinGW work appropriately with vs_module_defs, c_winlibs, and
cpp_winlibs.

Fixes #4434.
2018-10-30 20:25:32 +02:00
Marvin Scholz 2256e6314b compilers/c: Fix allow undefined link arg for PE/COFF
For PE/COFF it is not possible to allow undefined symbols, so do not
try to use the option to do so.

While gcc ld silently ignores it, this is not the case for the llvm
linker.

Fix #4415
2018-10-25 19:30:42 +03:00
David Seifert a28eddb822 Use relative build-tree RPATHs on macOS
* This helps with reproducibility on macOS in the same way
  `$ORIGIN` improves reproducibility on Linux-like systems.
* This makes the build-tree more resilient to users injecting
  rpaths via `LDFLAGS`. Currently Meson on macOS crashes when
  a build-tree rpath and a user-provided `-Wl,-rpath` in
  LDFLAGS collide, leading to `install_name_tool` failures.
  While this still does not solve the root cause, it makes
  the occurrence much less likely, as users will generally
  pass absolute `-Wl,-rpath` arguments into Meson.
2018-10-14 23:56:59 +03:00