weixin_39843338
2020-12-26 18:58 阅读 16

lock.c:286:16: warning: implicit declaration of function ‘pthread_mutexattr_init’ [-Wimplicit-function-declaration]

version 4.3.0 from source code. More infos: https://paste.pound-python.org/show/cu5UHVEnWptHqg1ru6SJ/

x86_64-pc-linux-gnu-gcc -march=ivybridge -O2 -pipe -fPIC -fno-strict-aliasing -D_GNU_SOURCE -Wall -O2 -g -DPCP_VERSION=\"4.3.0\" -I./src/include -I./src/include/pcp -fPIC -fno-strict-aliasing -D_GNU_SOURCE -Wall -O2 -g -DPCP_VERSION=\"4.3.0\" -I../src/include -I../src/include/pcp -fPIC -fno-strict-aliasing -D_GNU_SOURCE -Wall -O2 -g -DPCP_VERSION=\"4.3.0\" -I../../src/include -I../../src/include/pcp -fPIC -fno-strict-aliasing -D_GNU_SOURCE '-DEXEC_SUFFIX=""' '-DDSO_SUFFIX="so"' -I/usr/include/nss -I/usr/include/nspr -I/usr/include/sasl -DPCP_INTERNAL -Wall -O2 -g -DPCP_VERSION=\"4.3.0\" -I../../../src/include -I../../../src/include/pcp -c -o lock.o lock.c lock.c: In function ‘__pmInitMutex’: lock.c:286:16: warning: implicit declaration of function ‘pthread_mutexattr_init’ [-Wimplicit-function-declaration] if ((sts = pthread_mutexattr_init(&attr)) != 0) { ^~~~~~~~~~~~~~~~~~~~~~ lock.c:297:16: warning: implicit declaration of function ‘pthread_mutexattr_settype’ [-Wimplicit-function-declaration] if ((sts = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK)) != 0) { ^~~~~~~~~~~~~~~~~~~~~~~~~ lock.c:297:49: error: ‘PTHREAD_MUTEX_ERRORCHECK’ undeclared (first use in this function) if ((sts = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK)) != 0) { ^~~~~~~~~~~~~~~~~~~~~~~~ lock.c:297:49: note: each undeclared identifier is reported only once for each function it appears in lock.c:308:16: warning: implicit declaration of function ‘pthread_mutex_init’; did you mean ‘pthread_kill’? [-Wimplicit-function-declaration] if ((sts = pthread_mutex_init(lock, &attr)) != 0) { ^~~~~~~~~~~~~~~~~~ pthread_kill lock.c:319:5: warning: implicit declaration of function ‘pthread_mutexattr_destroy’ [-Wimplicit-function-declaration] pthread_mutexattr_destroy(&attr); ^~~~~~~~~~~~~~~~~~~~~~~~~ lock.c: In function ‘__pmDestroyMutex’: lock.c:338:16: warning: implicit declaration of function ‘pthread_mutex_destroy’ [-Wimplicit-function-declaration] if ((sts = pthread_mutex_destroy(lock)) != 0) { ^~~~~~~~~~~~~~~~~~~~~ make[3]: [: lock.o] Error 1 make[2]: [GNUmakefile:24: default] Error 2 make[1]: [GNUmakefile:135: default_pcp] Error 2 make[1]: Leaving directory '/var/tmp/portage/sys-apps/pcp-4.3.0/work/pcp-4.3.0/src' make: [GNUmakefile:49: default_pcp] Error 2

该提问来源于开源项目:performancecopilot/pcp

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

5条回答 默认 最新

  • weixin_39932479 weixin_39932479 2020-12-26 18:58

    This looks like Gentoo, correct? We have a Gentoo platform in the PCP QA Farm and builds there are working fine, but we build outside emerge (we have not done that integration yet, 'cause no one in the PCP dev team understands how to do it) ...

    I wonder where the options to configure are coming from?

    In particular --without-threads is causing this problem. We always enable threads in all PCP builds, and although there is support for this being conditional, as you've seen, that is unfortunately busted in lock.c.

    If you want a drop-in replacement for lock.c that fixes this issue, send me email and I'll forward it to you. But I'd strongly recommend the non-emerge build path (unless you'd like to help make the emerge build and packaging work ... nudge, nudge, wink, wink):

    
    # unpack the src tarball
    $ cd to the root of the unpacked tarball
    $ ./Makeimages
    

    this will leave a tarball of installable bits that you can extract as root by the following recipe (that can be found buried in qa/admin/pcp-daily) ...

    
    # here=`pwd`
    # buildversion=4.3.1 # or whatever
    # tarball=$here/pcp-$buildversion/build/tar/pcp-[0-9]*[0-9].tar.gz
    # cd pcp-$buildversion/build/tar
    # ./preinstall
    # cd /
    # tar -zxpf $tarball 
    # cd $here
    # cd pcp-$buildversion/build/tar
    ./postinstall
    
    点赞 评论 复制链接分享
  • weixin_39843338 weixin_39843338 2020-12-26 18:58

    yo, thanks! After enable threads useflag, compile and work like a charm! I will force to use this always. Thanks again!

    ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/pcp-4.3.0 --htmldir=/usr/share/doc/pcp-4.3.0/html --libdir=/usr/lib64 --localstatedir=//var --enable-ssp --enable-pie --with-threads --without-infiniband --without-discovery --without-systemd --without-papi --without-perfevent --without-manager --without-webapi --with-python --with-x

    点赞 评论 复制链接分享
  • weixin_39843338 weixin_39843338 2020-12-26 18:58

    (funtoo) sirius /var/overlay/overlay-local/sys-apps/pcp # genlop -i pcp * sys-apps/pcp

    Total builds: 1 Global build time: 18 minutes.

    Info about currently installed ebuild:

    • sys-apps/pcp-4.3.0 Install date: Thu Dec 27 21:18:15 2018 USE="threads X python -+ssp -+pie -infiniband -discovery -systemd -qt4 -papi -perfevent -manager -webapi -doc" CFLAGS="-march=ivybridge -O2 -pipe" CXXFLAGS="-march=ivybridge -O2 -pipe" LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
    点赞 评论 复制链接分享
  • weixin_39843338 weixin_39843338 2020-12-26 18:58

    my ebuild: https://bugs.funtoo.org/browse/FL-6086

    点赞 评论 复制链接分享
  • weixin_39843338 weixin_39843338 2020-12-26 18:58

    how to obtain files in dir /usr/share/pcp/webapps ? i use funtoo linux

    点赞 评论 复制链接分享

相关推荐