NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/53125: sys/timevar.h is absent in installed systems.



The following reply was made to PR lib/53125; it has been noted by GNATS.

From: Utkarsh Anand <utkarsh009%yandex.com@localhost>
To: "gnats-bugs%NetBSD.org@localhost" <gnats-bugs%netbsd.org@localhost>
Cc: 
Subject: Re: lib/53125: sys/timevar.h is absent in installed systems.
Date: Wed, 28 Mar 2018 10:33:52 +0530

 Not sure what's happening when I try to compile this:
 //#define _KMEMUSER
 #include <stdio.h>
 #include <kvm.h>
 #include <sys/sysctl.h>
 #include <sys/param.h>
 #include <sys/fcntl.h>
 
 int main(){
 const char t[1] = {'\0'};
 kvm_t *kd = kvm_open(NULL,NULL,NULL,O_RDWR,t);
 int b;
 int *c = &b;
 struct kinfo_proc2 *a = kvm_getproc2(kd,KERN_PROC_ALL,0,9999999,c);
 printf("%d\n",a[0].p_pid);
 return 0;
 }
 
 Error:
 /var/tmp/temp-eb1f46.o: In function `main':
 temp.c:(.text+0x2e): undefined reference to `kvm_open'
 temp.c:(.text+0x5e): undefined reference to `kvm_getproc2'
 clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
 
 With -v:
 clang version 5.0.0 (tags/RELEASE_500/final)
 Target: x86_64-unknown-netbsd8.0
 Thread model: posix
 InstalledDir: /usr/pkg/bin
  "/usr/pkg/bin/clang-5.0" -cc1 -triple x86_64-unknown-netbsd8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name temp.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -dwarf-column-info -debugger-tuning=gdb -resource-dir /usr/pkg/lib/clang/5.0.0 -fdebug-compilation-dir /root/neovim -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gnustep -fdiagnostics-show-option -o /var/tmp/temp-07c81f.o -x c temp.c
 clang -cc1 version 5.0.0 based upon LLVM 5.0.0 default target x86_64-unknown-netbsd8.0
 #include "..." search starts here:
 #include <...> search starts here:
  /usr/pkg/lib/clang/5.0.0/include
  /usr/include
 End of search list.
  "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld.elf_so -o temp /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbegin.o /var/tmp/temp-07c81f.o -lc /usr/lib/crtend.o /usr/lib/crtn.o
 /var/tmp/temp-07c81f.o: In function `main':
 temp.c:(.text+0x2e): undefined reference to `kvm_open'
 temp.c:(.text+0x5e): undefined reference to `kvm_getproc2'
 clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
 


Home | Main Index | Thread Index | Old Index