中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

在Solaris 10 x86下用gcc編譯Poco 1.4.6

發布時間:2020-08-15 15:25:35 來源:網絡 閱讀:747 作者:al0n9 欄目:編程語言

一、 系統環境

操作系統原始環境如下:

$ uname -a 

SunOS sol10u6 5.10 Generic_137138-09 i86pc i386 i86pc

$ /usr/sfw/bin/gcc -v

Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/specs

Configured with: /builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --enable-shared

Thread model: posix

gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)

$ /usr/ccs/bin/ld -V

ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.490

$ gmake --version

GNU Make 3.80

Copyright (C) 2002  Free Software Foundation, Inc.

This is free software; see the source for copying conditions.

There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

PARTICULAR PURPOSE.

$ /usr/sfw/bin/gld --version

GNU ld version 2.15

Copyright 2002 Free Software Foundation, Inc.

This program is free software; you may redistribute it under the terms of

the GNU General Public License.  This program has absolutely no warranty.

二、 安裝補丁包

Solaris 10 x86自帶的gcc版本為3,4.3,指定鏈接器為/usr/ccs/bin/ld,但是在poco對應gcc編譯器的配置文件build/config/SunOS-GCC中,指定的鏈接器參數是GNU ld格式的,編譯時會報出許多跟鏈接器有關的警告及錯誤,所以,必須強制gcc使用GNU ld。我不知道gcc是不是可以通過命令行參數來指定所使用的鏈接器,我是通過重命名系統自帶的/usr/ccs/bin/ld文件,然后在/usr/ccs/bin/下建立一個符號連接,指向GNU ld來達到這一目的的。

系統自帶的GNU ld版本為2.15,此版本的GNU ld有一個bug,在Solaris 10中,將許多在Solaris 9中原本處于.bbs段的符號移到了.abs段,而GNU ld不會處理.abs中導出的符號,導致在鏈接時報許多符號找不到的錯誤。在GNU binutils 2006年的bug郵件列表里詳細討論了此問題及解決方法。我不太確定GNU ld具體是在哪一個版本里修正了此bug,我下載的2.21.1版本的binutil二進制包中已經修正了此bug。binutils依賴于以下的包:libiconv,libintl,zlib,libgcc-3.4.6或者c-3.4.6。必須安裝這些包才能順利編譯poco,各個包安裝的先后次序沒有要求。安裝完各個包之后,先將系統自帶的/usr/ccs/bin/ld重命名,然后ln -s /usr/local/bin/ld  ld建議一個符號連接。

www.sourceware.org/bugzilla/show_bug.cgi?id=1021

通過命令pkgadd -d filename安裝以下包:

binutils-2.21.1a-sol10-x86-local

gcc-3.4.6-sol10-x86-local

libiconv-1.14-sol10-x86-local

libintl-3.4.0-sol10-x86-local

zlib-1.2.7-sol10-x86-local

安裝完成后環境如下:

$ which gcc

/usr/local/bin/gcc

$ /usr/local/bin/gcc -v

Reading specs from /usr/local/lib/gcc/i386-pc-solaris2.10/3.4.6/specs

Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,f77

Thread model: posix

gcc version 3.4.6

$ ls -l /usr/ccs/bin/ld  

lrwxrwxrwx   1 root     root          17 Jan 25 11:15 /usr/ccs/bin/ld -> /usr/local/bin/ld

$ /usr/local/bin/ld --version

GNU ld (GNU Binutils) 2.21.1

Copyright 2011 Free Software Foundation, Inc.

This program is free software; you may redistribute it under the terms of

the GNU General Public License version 3 or (at your option) a later version.

This program has absolutely no warranty.

三、 修改poco配置文件

1.編輯build/config/SunOS-GCC文件,找到以下行:

#

# System Specific Libraries

#

SYSLIBS  = -lpthread -ldl -lrt

修改為:

#

# System Specific Libraries

#

SYSLIBS  = -lrt -lsocket -lnls

On S10 libpthread is an empty filter on libc, which is a fancy way of saying that all of the code in libthread moved to libc and libpthread is just a shell saying as much so that older programs linked with libpthread can still run.

gld is choking on Solaris libraries that are filters. 

http://www.mentby.com/Group/sqlite-users/build-problem-of-sqlite-36142-on-solaris-10-with-gcc-440.html

2.編輯build/rules/global文件,找到以下行:

#

# Build Include directory List

#

INCLUDE = $(foreach p,$(POCO_ADD_INCLUDE),-I$(p)) -Iinclude $(foreach p,$(COMPONENTS),-I$(POCO_BASE)/$(p)/$(INCDIR))


#

# Build Library Directory List

#

LIBRARY = $(foreach p,$(POCO_ADD_LIBRARY),-L$(p)) -L$(LIBPATH:) $(POCO_LIBRARY)

修改為:

#

# Build Include directory List

#

INCLUDE = $(foreach p,$(POCO_ADD_INCLUDE),-I$(p)) -Iinclude -I/usr/sfw/include -

I/usr/sfw/include/mysql $(foreach p,$(COMPONENTS),-I$(POCO_BASE)/$(p)/$(INCDIR))


#

# Build Library Directory List

#

LIBRARY = $(foreach p,$(POCO_ADD_LIBRARY),-L$(p)) -L/usr/sfw/lib -L$(LIBPATH) $(

POCO_LIBRARY)


======



3.運行configure生成配置文件:

$ ./configure --prefix=$HOME/poco --config=SunOS-GCC --omit=Data/ODBC,Data/MySQL

Configured for SunOS-GCC



向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

临沧市| 南丰县| 西平县| 沁水县| 上林县| 通江县| 大方县| 锦屏县| 沂源县| 建湖县| 泰宁县| 锡林浩特市| 聂荣县| 南城县| 海城市| 中宁县| 九寨沟县| 东莞市| 睢宁县| 彩票| 松阳县| 景宁| 长乐市| 山东| 长岭县| 晋州市| 德惠市| 弥渡县| 刚察县| 阜城县| 青州市| 安康市| 夏河县| 伊吾县| 长治县| 建湖县| 垣曲县| 韩城市| 景洪市| 三明市| 陈巴尔虎旗|