【问题标题】:Issue with net-snmp build on Solaris 11Solaris 11 上的 net-snmp 构建问题
【发布时间】:2018-05-17 09:08:24
【问题描述】:

我正在 Solaris11 sparc 上构建 net-snmp 5.7.3。我的路径设置为:

/usr/local/lib:/bin:/usr/bin:/usr/dev_infra/platform/bin:/usr/dev_infra/generic/bin:/usr/local/bin:/usr/X11R6/bin: /usr/local/ade/bin:/usr/sfw/bin:/usr/ccs/bin:/opt/csw/bin:/opt/csw/gnu:/usr/sbin:/usr/bin:/usr/ ccs/bin/ar

我使用默认选项运行 ./configure --prefix=/opt 并且成功。之后,当我做时,我收到以下错误消息,感谢任何帮助。

libtool: compile:  gcc -I../include -I. -I../snmplib -fno-strict-aliasing -g -O2 -Usolaris2 -Dsolaris2=solaris2 -c keytools.c  -fPIC -DPIC -o .libs/keytools.o
keytools.c: In function ‘generate_Ku’:
keytools.c:153:9: warning: assignment makes pointer from integer without a cast
keytools.c:161:9: error: invalid use of void expression
keytools.c:166:13: error: invalid use of void expression
*** Error code 1
make: Fatal error: Command failed for target `keytools.lo'
Current working directory /scratch/kkumsati/net-snmp/snmplib
*** Error code 1
The following command caused the error:
if test "snmplib  agent apps man local mibs" != ""; then \
        it="snmplib  agent apps man local mibs" ; \
        for i in $it ; do \
                echo "making all in `pwd`/$i"; \
                ( cd $i ; make ) ; \
                if test $? != 0 ; then \
                        exit 1 ; \
                fi  \
        done \
fi
make: Fatal error: Command failed for target `subdirs'

【问题讨论】:

    标签: solaris net-snmp


    【解决方案1】:

    在源文件夹中查找 README.solaris 文件。它有“编译 net-snmp”部分。 在 README 中,您可以找到以下内容:

    You need to set your $PATH.  This is extremely important
    because otherwise there may be conflicts between the various
    components of the development environment.
    

    错误的路径是你的问题。

    另一个可能的问题是您系统中的旧 openssl 标头。 您对函数 EVP_MD_CTX_create() 有错误(keytools.c:153:9 中的错误),此函数在 Solaris 文件 /usr/include/openssl/evp.h 中声明,包含此文件在包 pkg:/library/security/openssl 中。我的操作系统上这个包的版本是 1.0.1.18-0.175.3.5.0.5.0。 我建议您更新操作系统,或打包 pkg:/library/security/openssl 或尝试使用 --with-openssl=internal 选项运行配置脚本。

    也更新gcc,我用的是这个版本

    pkg install developer/gcc-48 
    
    export PATH=/usr/sbin:/usr/local/bin:/usr/ccs/bin:/usr/bin:
    ./configure --prefix=/opt --with-mib-modules="ucd-snmp/lmSensors \
                ucd-snmp/diskio smux mibII/mta_sendmail" --with-cc=gcc
    gmake
    

    在这里我收到一个错误:

    /usr/include/sys/processor.h:188:45: error: unknown type name 'kthread_t'
     extern boolean_t i_processor_affinity_check(kthread_t *, struct cpu *);
                                             ^
    /usr/include/sys/processor.h:189:37: error: unknown type name 'kthread_t'
     extern int i_processor_affinity_one(kthread_t *, id_t, boolean_t);
                                     ^
    /usr/include/sys/processor.h:190:33: error: unknown type name 'kthread_t'
     extern int i_processor_affinity(kthread_t *, uint_t *, id_t *, uint32_t *,
                                 ^
    

    解决这个编辑文件agent/mibgroup/host/data_access/swrun_procfs_psinfo.c并添加到它的标题第26行(问题行之前):

    #include <sys/processor.h>
    #include <sys/procset.h>
    #include <thread.h>
    

    链接bug

    然后重复

    gmake
    gmake test
    gmake install;  #this command with root permissons 
    

    我在 SPARC 上成功了。

    【讨论】:

    • 我的路径:-bash-4.1$ echo $PATH /usr/sbin:/usr/local/bin:/usr/ccs/bin:/usr/bin 我使用的 GCC 版本是 gcc 版本4.5.2 (GCC) ./configure 命令成功但产生错误:keytools.c: In function 'generate_Ku': keytools.c:153:9: warning: assignment makes pointer from integer without a cast keytools.c:161 :9: 错误: 无效表达式 keytools.c:166:13: 错误: 无效表达式 make[1]: *** [keytools.lo] 错误 1 ​​make[1]: 离开目录`/scratch /kkumsati/net-snmp/snmplib' make: *** [子目录] 错误 1
    • uname -a o/p : SunOS blr222 5.11 11.1 sun4v sparc sun4v
    • 亲爱的@skm_satish,你能把你的操作系统更新到实际版本吗?可能是问题所在。我收到此结果的系统更新。 pkg list entire 显示 0.5.11-0.175.3.6.0.5.0(它是 11.3.6)。但是你有 11.1。
    • 我调查了您关于 EVP_MD_CTX_create() 的错误(位于 keytools.c:153:9 中),此函数在 Solaris 文件 /usr/include/openssl/evp.h 中声明。该文件包含在包 pkg:/library/security/openssl 中。我的操作系统上这个包的版本是 1.0.1.18-0.175.3.5.0.5.0。如果您在更新整个系统时遇到问题,请尝试使用 pkg:/library/security/openssl 开始更新。
    • 您也可以尝试使用--with-openssl=internal 选项运行配置脚本以跳过系统openssl 标头。
    猜你喜欢
    • 2012-05-30
    • 1970-01-01
    • 2010-09-23
    • 1970-01-01
    • 1970-01-01
    • 2011-02-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多