Current-Users archive

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

Re: gcc 5.3 version of libasan is broken



On Jun 8,  1:03am, rokuyama%rk.phys.keio.ac.jp@localhost (Rin Okuyama) wrote:
-- Subject: Re: gcc 5.3 version of libasan is broken

| On 2016/06/07 23:42, Christos Zoulas wrote:
| > I think it is better to do what linux does and write an internal_syscall()
| > macro that just DTRT's instead of special-casing each syscall.
| 
| Sorry, I cannot grasp what you mean. Let me explain more in details what I
| did. First, I defined three macros:

I am trying to avoid having all these ifdefs in the common code, so that
the upstream has a better chance to accept them. My idea was to do something
like it is done in sanitizer_syscall_linux_x86_64.inc (but differently)
In our case I think we could provide a varyadic macro that switched on
the syscall number and DTRT...

static inline uptr netbsd_lseek(int fd, OFF_T offset, int whence) {
	return internal_syscall64(SYS_lseek, fd, 0, offset, whence);
}

#define internal_syscall(sys...) \
	switch (sys) { \
	case SYS_fork: \
		return syscall(sys); \
	case SYS_lseek: \
		return netbsd_lseek(__VA_ARGS__); \

This could all go in a separate header for NetBSD.  Alternatively,
we just provide a separate header for all the syscall interception
function that is NetBSD-specific, instead of sprinkling ifdefs in
the common code (sanitizer_syscall_netbsd.inc).

christos


Home | Main Index | Thread Index | Old Index