Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbound 1.13.2rc1 fails to build python module #520

Closed
bleve opened this issue Aug 5, 2021 · 5 comments
Closed

Unbound 1.13.2rc1 fails to build python module #520

bleve opened this issue Aug 5, 2021 · 5 comments

Comments

@bleve
Copy link

bleve commented Aug 5, 2021

  • : python3-unbound install
  • cd unbound-1.13.2rc1_python3
  • make DESTDIR=/builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo8.x86_64 install
    /bin/sh ./install-sh -m 755 -d /builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo8.x86_64/usr/lib64/python3.6/site-packages
    /bin/sh ./install-sh -c -m 644 pythonmod/unboundmodule.py /builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo8.x86_64/usr/lib64/python3.6/site-packages/unboundmodule.py
    /bin/sh ./install-sh -m 755 -d /builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo8.x86_64/usr/lib64/python3.6/site-packages
    /bin/sh ./install-sh -c -m 644 ./libunbound/python/unbound.py /builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo8.x86_64/usr/lib64/python3.6/site-packages/unbound.py
    ./libtool --mode=install cp _unbound.la /builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo8.x86_64/usr/lib64/python3.6/site-packages
    libtool: warning: relinking '_unbound.la'
    libtool: install: (cd /builddir/build/BUILD/unbound-1.13.2rc1/unbound-1.13.2rc1_python3; /bin/sh "/builddir/build/BUILD/unbound-1.13.2rc1/unbound-1.13.2rc1_python3/libtool" --tag CC --mode=relink gcc -I. -I/usr/include/python3.6m -DSRCDIR=. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIE -pie -pthread -Wl,-z,relro,-z,now -pie -module -avoid-version -no-undefined -shared -o _unbound.la libunbound_wrap.lo -rpath /usr/lib64/python3.6/site-packages libunbound.la -levent -L/usr/lib64 -L/usr/lib64/python3.6 -L. -lpython3.6m -ldl -lcrypto -inst-prefix-dir /builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo8.x86_64)
    libtool: relink: gcc -shared -fPIC -DPIC .libs/libunbound_wrap.o -L/builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo8.x86_64/usr/lib64 -L/usr/lib64 -lunbound -L/usr/lib64/python3.6 -L. -lssl -levent -lpython3.6m -ldl -lcrypto -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -O2 -g -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -pthread -Wl,-z -Wl,relro -Wl,-z -Wl,now -pthread -Wl,-soname -Wl,_unbound.so -o .libs/_unbound.so
    /usr/bin/ld: cannot find -lunbound
    collect2: error: ld returned 1 exit status
    libtool: error: error: relink '_unbound.la' with the above command before installing it
    make: *** [Makefile:557: pyunbound-install] Error 1

Build system is rhel8 based.

@bleve
Copy link
Author

bleve commented Aug 5, 2021

Here is similar error fron rhel7 based system, here is happens on unbound daemon install:

  • : unbound daemon install
  • make DESTDIR=/builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo7.x86_64 install
    /bin/sh ./install-sh -m 755 -d /builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo7.x86_64/usr/lib64/python2.7/site-packages
    /bin/sh ./install-sh -c -m 644 pythonmod/unboundmodule.py /builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo7.x86_64/usr/lib64/python2.7/site-packages/unboundmodule.py
    /bin/sh ./install-sh -m 755 -d /builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo7.x86_64/usr/lib64/python2.7/site-packages
    /bin/sh ./install-sh -c -m 644 ./libunbound/python/unbound.py /builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo7.x86_64/usr/lib64/python2.7/site-packages/unbound.py
    ./libtool --mode=install cp _unbound.la /builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo7.x86_64/usr/lib64/python2.7/site-packages
    libtool: warning: relinking '_unbound.la'
    libtool: install: (cd /builddir/build/BUILD/unbound-1.13.2rc1/unbound-1.13.2rc1; /bin/sh "/builddir/build/BUILD/unbound-1.13.2rc1/unbound-1.13.2rc1/libtool" --tag CC --mode=relink gcc -I. -I/usr/include/python2.7 -DSRCDIR=. -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fPIE -pie -pthread -Wl,-z,relro,-z,now -pie -module -avoid-version -no-undefined -shared -o _unbound.la libunbound_wrap.lo -rpath /usr/lib64/python2.7/site-packages libunbound.la -levent -L/usr/lib64 -L/usr/lib64/python2.7 -L. -lpython2.7 -lsystemd -lcrypto -inst-prefix-dir /builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo7.x86_64)
    libtool: relink: gcc -shared -fPIC -DPIC .libs/libunbound_wrap.o -L/builddir/build/BUILDROOT/unbound-1.13.2-0.1.rc1.foo7.x86_64/usr/lib64 -L/usr/lib64 -lunbound -L/usr/lib64/python2.7 -L. -lssl -levent -lpython2.7 -lsystemd -lcrypto -O2 -g -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -pthread -Wl,-z -Wl,relro -Wl,-z -Wl,now -pthread -Wl,-soname -Wl,_unbound.so -o .libs/_unbound.so
    /usr/bin/ld: cannot find -lunbound

@wcawijngaards
Copy link
Member

The issue was caused by #460 that removed the -L. -L.libs from the commandline. If I re-add those flags then the relink works for me, and it also uses the better libunbound.la for linking with the not-yet-installed library.

@bleve
Copy link
Author

bleve commented Aug 5, 2021

Fix confirmed.

@orbea
Copy link
Contributor

orbea commented Aug 6, 2021

Does it work with only the -L.? The .libs directory ideally is for libtool internal usage only.

@bleve
Copy link
Author

bleve commented Aug 6, 2021

No it won't work that way.

jedisct1 added a commit to jedisct1/unbound that referenced this issue Aug 12, 2021
* nlnet/master: (37 commits)
  - Fix to print error from unbound-anchor for writing to the key   file, also when not verbose.
  - For NLnetLabs#519: fix comments for doxygen.
  - For NLnetLabs#519: yacc and lex. And fix python bindings, and test program   unbound-dnstap-socket.
  Changelog note for NLnetLabs#519 and example.conf edit - Merge NLnetLabs#519: Support for selective enabling tcp-upstream for   stub/forward zones. - For NLnetLabs#519: note stub-tcp-upstream and forward-tcp-upstream in   the example configuration file.
  Changelog note for NLnetLabs#523 - Merge NLnetLabs#523: fix: free() call more than once with the same pointer.
  Changelog note for NLnetLabs#521 - Merge NLnetLabs#521: Update mini_event.c.
  - Add test tool readzone to .gitignore.
  - And 1.13.2rc1 became the 1.13.2 with the fix for the python module   build. The current code repository continues with version 1.13.3.
  fix: free() call more than once with the same pointer
  Update mini_event.c
  - Fix NLnetLabs#520: Unbound 1.13.2rc1 fails to build python module.
  Add (stub|forward)-tcp-upstream options which enable using tcp transport only for specified stub/forward zones
  For 1.13.2rc1.
  - Tag for 1.13.2 release.
  - Fix unit test zonemd_reload for use in run_vm.
  - Fix libnettle zonemd unit test.
  - Fix out of sourcedir run of zonemd unit tests.
  - Fix readzone compile under debug config.
  - Fix missing locks in zonemd unit test.
  - Fix static analysis warnings about localzone locks that are unused.
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants