I am currently porting my compiler from AIX XLC compiler to GCC compiler on AIX.
I want to know if there is an GCC equivalent compiler option available for the -qthreaded (XLC).
I am currently porting my compiler from AIX XLC compiler to GCC compiler on AIX.
I want to know if there is an GCC equivalent compiler option available for the -qthreaded (XLC).
Copyright © 2021 Jogjafile Inc.
-pthreadis the closest GCC option for use cases where-qthreadedis applied for XL; however, it is not equivalent to the-qthreadedoption for IBM XL.The GCC documentation for
-pthreadmerely states that it sets macros (http://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-pthread) and modifies the link step (http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#index-pthread-1).-qthreadeddoes not cause_THREAD_SAFEto be defined as a macro, nor does it cause-lpthreadsto be present in the link step. GCC's-pthreadis more like XL's_rinvocations (which does set the macro and modify the link step).What
-qthreadeddoes is to disable optimizations that are unsafe for multithreaded programs. It appears that, at least historically,-fno-tree-loop-if-convert-storeswould at least partially be a GCC equivalent to-qthreaded.