From owner-freebsd-current Fri Jan 7 14:20: 7 2000 Delivered-To: freebsd-current@freebsd.org Received: from canonware.com (canonware.com [207.20.242.18]) by hub.freebsd.org (Postfix) with SMTP id 422F314BD5 for ; Fri, 7 Jan 2000 14:20:04 -0800 (PST) (envelope-from jasone@canonware.com) Received: (qmail 17416 invoked by uid 1001); 7 Jan 2000 22:19:20 -0000 Date: Fri, 7 Jan 2000 14:19:20 -0800 From: Jason Evans To: current@freebsd.org Subject: __sigisempty() undefined if "cc -g" used. Message-ID: <20000107141920.J4938@sturm.canonware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In an effort to chase down a libc_r bug, I compiled libc_r with CFLAGS=-g (and later CFLAGS=-g3), but ran into linker problems as a result. blitz:~> gcc poll.c -pthread /usr/lib/libc_r.so: undefined reference to `__sigisempty' Even the simplest of C programs will get this linker error if using the -pthread option. So, __sigisempty is an inline function, defined in /usr/include/sys/signalvar.h: extern __inline int __sigisempty(sigset_t *set) { int i; for (i = 0; i < _SIG_WORDS; i++) { if (set->__bits[i]) return (0); } return (1); } __sigisempty() is used in the expansion of SIGNOTEMPTY in /usr/src/lib/libc_r/uthread/uthread_sig[wait].c. SIGNOTEMPTY is: #define SIGNOTEMPTY(set) (!__sigisempty(&(set))) Both of those files correctly #include . If I compile those two files without the -g flag, the linker error goes away. In summary, it seems that using the -g flag to gcc can cause inline functions to be ignored. Can anyone shed some light on this? Thanks, Jason To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message