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

Bug#750836: machine/atomic.h broken, missing __compiler_membar macro



Package: kfreebsd-kernel-headers
Version: 10.0~5
Severity: serious

libpcap is broken on kfreebsd since kfreebsd-kernel-headers was updated
to the FreeBSD 10 headers, which apparently include this change:

 http://svnweb.freebsd.org/base?view=revision&revision=241374

The sys/cdefs.h file shipped in libc0.1-dev doesn't include the
__compiler_membar macro, so anything that uses the atomic functions will
get a spurious undefined reference. Here's a quick test program:

| #include <sys/types.h>
| #include <sys/cdefs.h>
| #include <machine/atomic.h>
|
| int main(int argc, char **argv)
| {
| 	unsigned int p, v = 0;
| 	atomic_store_rel_int(&p, v);
| 	return 0;
| }

this gives:

| rfrancoise@falla ~ % gcc -Wall -o test test.c
| /tmp/cczzxYAr.o: In function `atomic_store_rel_int':
| test.c:(.text+0x15): undefined reference to `__compiler_membar'
| collect2: error: ld returned 1 exit status
| rfrancoise@falla ~ %

Thanks,
-- 
Romain Francoise <rfrancoise@debian.org>
http://people.debian.org/~rfrancoise/


Reply to: