IBM AIX用-Qmkshrobjで動的リンクライブラリを作成する。


From http://publib.boulder.ibm.com/infocenter/comphelp/v9v111/index.jsp?topic=/com.ibm.xlcpp9.aix.doc/compiler_ref/opt_mkshrobj.httm
 
 
直接例を見てもいいです。
Examples
To construct the shared library big_lib.so from three smaler object files,type:
xlc -qmkshrobj -o big_lib.so lib_a.o lib_b.o lib_c.o
 
 
 
 
 
 
 
-qmkshrobj
Category
Output control
Pragma equivalent
ノン.
Purpose
Creates a shared object from generated object files.
You shoud use this option、together with the related options described below、instead of caling the linker directly(or using the) makeC++SharedLib utility、in C+)to create a shared oject.The advantage s of using this option are the atomatic handing of link-time C++template instantiation(using ether the template includectory or the the template directory or the the the the template the-the template stractory)partity,costry。 -iPad link-time optimizations(such as those performed at) -O 5 )..
Syntax








-qmkshrobj syntax -- C
 
>>- -q--mkshrobj-----------------------------------------------><
 








-qmkshrobj syntax -- C++
 
>>- -q--mkshrobj--+-------------+------------------------------><
                  '-=--priority

-'
 
Defaults
By default、the output object is linked with the runtime libries and startup routines to create an executable file.
パラメータ
 
priority
Specifes the prifity level for the initialization order of static C++objecs declead in the shared oject(relative to static object)The
 
priority
 may be any number from-214 782 624(highest pristy-initialized first)to 214 783 647(lowest pristy-initialized last)Numbers from-214 783 648 to-214 782 623 ares reverved for system use.Ifのprorit is specified a default prorit of 0 is used.The pristyhasのeffect if you Link object written n C,if inc。
xlc
 ), or if the shared object hasのstatic initiazation.
Usage
The compler will atomaticaly export all global smbors from the shared object unless you explicitly specify smbors to export with the -bE。 :, -bexport : or -bnoexpall options,or if you use the -qnoweakexpoption to prevent weak smbors from being expoted.
Specifying -qmkshrobj implies -qpic .
You can also use the follwing related optionwith the -qmkshrobj :
-o
 
sharedfile
The name of the file that will the shared file information.The default is shr.o.
-qexpfile=
 
filename
Saves all exportd smbors in
 
filename
 . 
-e 
name
Sets the entry name for the sharexecutable to
 
name
 . The default is
 
-enoentry
 .
-q[no]weakexp
Specifies whether smbors maked as weak(with the)
 
同前のpragma weak
 directive)ar to be includ in the export list.If you do not explicitly set this option,the default is
 
-qweakexp
 (global weak smbors are export)
For detailed information on using -qmkshrobj to create sharred libries、 as well as examples of using -qmkshrobj with priority values、 see 「Costructing a library」 .
Prodfined macros
ノン.
Examples
To construct the shared library big lib.so from three smaler object files,type:
xlc -qmkshrobj -o big_lib.so lib_a.o lib_b.o lib_c.o
Related information
  • -o
  • -e
  • -Qpriority(C++only)
  • -qpic
  • -b
  • -qexpfile
  • -qweakexp