Skip to content

cmake : build static linked executable failed #118

@leleliu008

Description

@leleliu008

I add /etc/mk.conf to LDFLAGS+= -static -pthread to build static linked executable,but it failed and report following:

...
ols.o EncodingC.o ProcessUNIX.o String.o System.o Terminal.o  -lkvm -luv -lrhash -lcrypto -o cmake
ld: /home/vagrant/pkgsrc/devel/cmake/work/.buildlink/lib/libuv.a(libuv_la-netbsd.o): in function `uv_resident_set_memory':
/home/vagrant/pkgsrc/devel/libuv/work/libuv-1.44.2/src/unix/netbsd.c:162: undefined reference to `kvm_open'
ld: /home/vagrant/pkgsrc/devel/libuv/work/libuv-1.44.2/src/unix/netbsd.c:166: undefined reference to `kvm_getproc2'
ld: /home/vagrant/pkgsrc/devel/libuv/work/libuv-1.44.2/src/unix/netbsd.c:176: undefined reference to `kvm_close'
ld: /home/vagrant/pkgsrc/devel/libuv/work/libuv-1.44.2/src/unix/netbsd.c:171: undefined reference to `kvm_close'
make: *** [Makefile:2: cmake] Error 1
---------------------------------------------
Error when bootstrapping CMake:
Problem while running make
---------------------------------------------
Log of errors: /home/vagrant/pkgsrc/devel/cmake/work/cmake-3.25.1/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------
*** Error code 9

Stop.
bmake[1]: stopped in /home/vagrant/pkgsrc/devel/cmake
*** Error code 1

Stop.
bmake: stopped in /home/vagrant/pkgsrc/devel/cmake

The reason is -lkvm -luv should be changed to -luv -lkvm. how should I do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions