Date: Sat, 2 Jul 2011 17:22:15 +0200 From: Robert Millan <rmh@debian.org> To: freebsd-hackers@freebsd.org, Ed Maste <emaste@freebsd.org> Subject: [PATCH] bogus use of __linux__ in aicasm Message-ID: <CAOfDtXN3Ox5jAYKoDmZQJGNyW5EF3UmnyR_ARGNhFNRWbechRQ@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
--bcaec520f191f5b3db04a717b22c Content-Type: text/plain; charset=UTF-8 Code in sys/dev/aic7xxx/aicasm/ contains a few checks on the __linux__ macro that actually break build on GNU systems (including Linux-based ones but also GNU/kFreeBSD). Some of them use __linux__ to include an alternate version of <sys/queue.h> that would be placed in "../queue.h". However that file isn't present, which causes build failure. However, this isn't needed anyway, because non-BSD systems can use libbsd [1] to override the GNU version of <sys/queue.h> with a suitable one (Debian uses this method extensively). Hence I propose simply including <sys/queue.h>. In aicasm_symbol.c the __linux__ case again tries to include a non-existant file. As solution I propose assuming that non-BSD systems have installed the 1.85 version of Sleepycat library, which attempts to provide the same API as the BSD native libdb. aicasm.c wants to include <endian.h> only on Linux-based systems, but actually any system with Glibc would provide this file. Proposing fix to use __GLIBC__ instead. Thanks [1] http://libbsd.freedesktop.org/wiki/ -- Robert Millan --bcaec520f191f5b3db04a717b22c Content-Type: text/plain; charset=US-ASCII; name="aicasm_linux.diff" Content-Disposition: attachment; filename="aicasm_linux.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gpmpzdq70 SW5kZXg6IHN5cy9kZXYvYWljN3h4eC9haWNhc20vYWljYXNtLmgKPT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lz L2Rldi9haWM3eHh4L2FpY2FzbS9haWNhc20uaAkocmV2aXNpb24gMjIzNzIxKQorKysgc3lzL2Rl di9haWM3eHh4L2FpY2FzbS9haWNhc20uaAkod29ya2luZyBjb3B5KQpAQCAtNDIsMTEgKzQyLDcg QEAKICAqICRGcmVlQlNEJ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T09PT09 PT09PT09PT09PQotLS0gc3lzL2Rldi9haWM3eHh4L2FpY2FzbS9haWNhc21fbWFjcm9fc2Nhbi5s CShyZXZpc2lvbiAyMjM3MjEpCisrKyBzeXMvZGV2L2FpYzd4eHgvYWljYXNtL2FpY2FzbV9tYWNy b19zY2FuLmwJKHdvcmtpbmcgY29weSkKQEAgLTUxLDExICs1MSw3IEBACiAjaW5jbHVkZSA8c3Rk aW8uaD4KICNpbmNsdWRlIDxzdHJpbmcuaD4KICNpbmNsdWRlIDxzeXNleGl0cy5oPgotI2lmZGVm IF9fbGludXhfXwotI2luY2x1ZGUgIi4uL3F1ZXVlLmgiCi0jZWxzZQogI2luY2x1ZGUgPHN5cy9x dWV1ZS5oPgotI2VuZGlmCiAKICNpbmNsdWRlICJhaWNhc20uaCIKICNpbmNsdWRlICJhaWNhc21f c3ltYm9sLmgiCkluZGV4OiBzeXMvZGV2L2FpYzd4eHgvYWljYXNtL2FpY2FzbS5jCj09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT0KLS0tIHN5cy9kZXYvYWljN3h4eC9haWNhc20vYWljYXNtLmMJKHJldmlzaW9uIDIyMzcyMSkK KysrIHN5cy9kZXYvYWljN3h4eC9haWNhc20vYWljYXNtLmMJKHdvcmtpbmcgY29weSkKQEAgLTUz LDcgKzUzLDcgQEAKICNpbmNsdWRlIDxzeXNleGl0cy5oPgogI2luY2x1ZGUgPHVuaXN0ZC5oPgog Ci0jaWYgbGludXgKKyNpZmRlZiBfX0dMSUJDX18KICNpbmNsdWRlIDxlbmRpYW4uaD4KICNlbHNl CiAjaW5jbHVkZSA8bWFjaGluZS9lbmRpYW4uaD4K --bcaec520f191f5b3db04a717b22c--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOfDtXN3Ox5jAYKoDmZQJGNyW5EF3UmnyR_ARGNhFNRWbechRQ>