This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][Revised] Enable libsanitizer on darwin


Hi Alex,

>> thanks, that's certainly helpful.  I'm primarily interested in porting
>> to Solaris, both SPARC and x86.  Several things should be similar to
>> Linux (both being ELF systems), while other areas are certainly
>> different (syscalls implementation etc.).
> We don't wrap the syscalls in ASan, if you're speaking about that.

I'm talking about the internal_* wrappers e.g. in sanitizer_linux.cc.
For Linux, they use syscall directly, for Mac OS, they call the
underlying function.

>> I'll certainly be looking around.  One problem I see with the current
>> code organization is duplication between different platforms:
>> e.g. considerable parts of sanitizer_mac.cc and a new
>> sanitizer_solaris.cc are identical.  Perhaps we need more granularity in
>> the future, but that can be decided once an initial port (with
>> duplication to avoid treading on other port's feet) is done.  At the
>> same time, we should add infrastructure (like libffi) to only compile
>> target-specific code on the relevant platforms, instead of wrapping
>> every source file in #ifdef __linux__ or similar and extending the
>> conditionals once a new platform is added.
> Yes, this might be a problem. I also wonder how much Solaris is like
> FreeBSD, which users are also interested in ASan.

That's hard to tell: all of Linux, FreeBSD and Solaris are Unix/ELF
systems, but apart from the resulting similarities there will be many
differences like details how to implement stuff like GetEnv, ReExec or
MemoryMappingLayout which rely on /proc details on Linux.

I guess this will have to be checked on a case-by-case basis to
determine areas that can be handled identically across several different
Unix OSes and those that are highly system-specific.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]