Wed Aug 22 12:14:29 2018 UTC ()
Temporarily disable the dummy inline funcs, and replace them with
__nothing until maxv sorts out the type issues - kern_malloc()
(for historical reasons) takes an unsigned long parameter, not a
size_t - on 64 bit arch's this makes no difference (size_t is unsigned
long) but that's not true on 32 bit archs (or not all of them anyway).

This should unbreak the i386 build (others?) - hopefully without
damaging anything too badly.    Note the type issues need fixing,
just making this change permanent is not the solution.


(kre)
diff -r1.4 -r1.5 src/sys/sys/asan.h

cvs diff -r1.4 -r1.5 src/sys/sys/asan.h (expand / switch to unified diff)

--- src/sys/sys/asan.h 2018/08/22 11:55:28 1.4
+++ src/sys/sys/asan.h 2018/08/22 12:14:29 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: asan.h,v 1.4 2018/08/22 11:55:28 martin Exp $ */ 1/* $NetBSD: asan.h,v 1.5 2018/08/22 12:14:29 kre Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2018 The NetBSD Foundation, Inc. 4 * Copyright (c) 2018 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Maxime Villard. 8 * by Maxime Villard.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -29,34 +29,41 @@ @@ -29,34 +29,41 @@
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#ifndef _SYS_ASAN_H_ 32#ifndef _SYS_ASAN_H_
33#define _SYS_ASAN_H_ 33#define _SYS_ASAN_H_
34 34
35#include <sys/types.h> 35#include <sys/types.h>
36 36
37#ifdef KASAN 37#ifdef KASAN
38void kasan_add_redzone(size_t *); 38void kasan_add_redzone(size_t *);
39void kasan_alloc(const void *, size_t, size_t); 39void kasan_alloc(const void *, size_t, size_t);
40void kasan_free(const void *, size_t); 40void kasan_free(const void *, size_t);
41#else 41#else
 42#if 0
 43/* there are type issues - kmem_alloc() takes a u_long size not size_t */
42static void __inline __unused 44static void __inline __unused
43kasan_add_redzone(size_t *size __unused) 45kasan_add_redzone(size_t *size __unused)
44{ 46{
45 /* nothing */ 47 /* nothing */
46} 48}
47 49
48static void __inline __unused 50static void __inline __unused
49kasan_alloc(const void *addr __unused, size_t size __unused, 51kasan_alloc(const void *addr __unused, size_t size __unused,
50 size_t sz_with_redz __unused) 52 size_t sz_with_redz __unused)
51{ 53{
52 /* nothing */ 54 /* nothing */
53} 55}
54 56
55static void __inline __unused 57static void __inline __unused
56kasan_free(const void *addr __unused, size_t sz_with_redz __unused) 58kasan_free(const void *addr __unused, size_t sz_with_redz __unused)
57{ 59{
58 /* nothing */ 60 /* nothing */
59} 61}
 62#else
 63#define kasan_add_redzone(SP) __nothing
 64#define kasan_alloc(P, S1, S2) __nothing
 65#define kasan_free(P, S) __nothing
 66#endif
60#endif 67#endif
61 68
62#endif /* !_SYS_ASAN_H_ */ 69#endif /* !_SYS_ASAN_H_ */