If object is not built pic, trying to link it into libshr.so fails:
[6/8] Linking target libshr.so.
FAILED: libshr.so
gcc -o libshr.so 'shr@sha/source2.o' -Wl,--no-undefined -Wl,--as-needed -shared -fPIC -Wl,--start-group -Wl,-soname,libshr.so -Wl,--end-group
Text relocation remains referenced
against symbol offset in file
.text (section) 0x20 shr@sha/source2.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Since mesonbuild/environment.py doesn't recognize Studio compilers,
force use of gcc on Solaris for now.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Solaris linker added support for GNU-style --version-script in Solaris 11.4,
but requires adding the -z gnu-version-script-compat flag to enable it.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Accept Solaris linker in addition to GNU linker. Previously using the
system provided gcc (which calls the Solaris linker) caused it to fail with:
======================================================================
FAIL: test_compiler_detection (__main__.AllPlatformTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "run_unittests.py", line 2525, in test_compiler_detection
self.assertIsInstance(cc.linker, mesonbuild.linkers.GnuLikeDynamicLinkerMixin)
AssertionError: <SolarisDynamicLinker: v9.2.0 `gcc`> is not an instance of <class 'mesonbuild.linkers.GnuLikeDynamicLinkerMixin'>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
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.
on some systems, tests may take over an hour to run--only to find
you might have used an unintended Meson version (e.g. release instead
of dev). This change prints the Meson version at the start of the
run_*tests*.py scripts.
Also, raise SystemExit(main()) is preferred in general over
sys.exit(main())
When changing meson option cpp_eh, it was passed to cl with AdditionalOptions and resulted in unsuppressable warning "cl : command line warning D9025: overriding '/EHs' with '/EHa'"