The llvm-symbolizer patch in D5610 needs to call getMainExecutable without argv0.
Today this works on Linux, which reads /proc/self/exe, but does not on FreeBSD and other operating systems, which determine the exe name from argv0.
On FreeBSD the exe name can be found from the kern.proc.pathname sysctl. This probably works on other BSDs as well; others can confirm and update the #ifdefs.
Add || defined(__DragonFly__) as it has KERN_PROC_PATHNAME.