日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 人文社科 > 生活经验 >内容正文

生活经验

+z +Z compiler flag for HP

發(fā)布時(shí)間:2023/11/27 生活经验 52 豆豆
生活随笔 收集整理的這篇文章主要介紹了 +z +Z compiler flag for HP 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1.??????今天遇到一問題,在sles11/vxworks下編譯通過,但是在hpux下失敗

2.??????編譯錯(cuò)誤:

/usr/ccs/bin/ld:DP relative code in file /projects/xxx/DERIVED/tfa_pa32-hpux.a(tfa02_pa32-hpux.o) -shared library must be position

??? independent.? Use +z or +Z to recompile.

3.????修改makefile,添加+z選項(xiàng)

ifeq($(BLD_TARGET_ARCH),pa32-hpux)

TS_LOGLIB_OPTS.o+= +z

endif

4.????重新編譯

5.????報(bào)新的錯(cuò)誤如下:

/usr/ccs/bin/ld:Data Linkage Table (+z) overflow in file /projects/xxx/loglib_pa32-hpux-mt.a(a7ts_log_pa32-hpux-mt.o)- use +Z option to recompile

?? Reference from:? /projects/xxx/loglib_pa32-hpux-mt.a(a7ts_log_pa32-hpux-mt.o)(0x604)

6.????查詢+z 和 +Z 的區(qū)別,如下:

+z,+Z Both ofthese options cause the compiler to generate?position independent code(PIC) for use in building?shared libraries. +Z is the default in 64-bitmode.?The -G and -p options are ignored if +z or +Z is used.?Normally,+z should be used to generate PIC; however,?when certain limits areexceeded, +Z is required to?generate PIC. The ld linker issues theerror?indicating when +Z is required. If both +z and +Z are?
specified, only the last one encountered applies. For?a more completediscussion regarding PIC and these?
options, see HP-UX Linker and Libraries Online User's?Guide and the manualProgramming on HP-UX.??

7.??????修改makefile,添加+Z選項(xiàng):

ifeq($(BLD_TARGET_ARCH),pa32-hpux)

TS_LOGLIB_OPTS.o+= +Z

endif

8.????編譯通過。

9.????結(jié)論:

9.1??+z/+Z 相當(dāng)于gcc 中的-fPIC;

(The '+Z' refers to *compiler* flag for HP cc/CC, which isequivalent to '-fPIC' for gcc.)

9.2??+z +Z有區(qū)別;

9.3??這個(gè)選項(xiàng)是編譯(compile)選項(xiàng),而不是鏈接(ld)選項(xiàng);


總結(jié)

以上是生活随笔為你收集整理的+z +Z compiler flag for HP的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。