3.21.46 Solaris 2 Options

These options are supported on Solaris 2:

-mclear-hwcap
-mno-clear-hwcap

-mclear-hwcap tells the compiler to remove the hardware capabilities generated by the Solaris assembler. This is only necessary when object files use ISA extensions not supported by the current machine, but check at runtime whether or not to use them.

-mimpure-text
-mno-impure-text

-mimpure-text, used in addition to -shared, tells the compiler to not pass -z text to the linker when linking a shared object. Using this option, you can link position-dependent code into a shared object.

-mimpure-text suppresses the “relocations remain against allocatable but non-writable sections” linker error message. However, the necessary relocations trigger copy-on-write, and the shared object is not actually shared across processes. Instead of using -mimpure-text, you should compile all source code with -fpic or -fPIC.

-gsctf

Generate Solaris CTF. Needs to be used both for compilation and linking. See ctf(7) for more information. This is only supported since Solaris 11.4 SRU 84 where the necessary toolchain support was added.

-pthread
-pthreads

On Solaris targets, these both options define the preprocessor symbols _REENTRANT and _PTHREADS. In modern versions of Solaris these symbols are no longer used in system headers and these options are unnecessary unless user code references them. Additionally, since POSIX thread support is provided directly by the Solaris C library, it is not necessary to use -pthread for linking.