[PATCH] D33171: Fix DynamicLibraryTest.cpp on FreeBSD

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 14 07:20:57 PDT 2017


krytarowski added inline comments.


================
Comment at: lib/Support/Unix/Path.inc:185
   }
-#elif defined(__FreeBSD__) || defined (__NetBSD__) || defined(__Bitrig__) || \
-      defined(__OpenBSD__) || defined(__minix) || defined(__DragonFly__) || \
-      defined(__FreeBSD_kernel__) || defined(_AIX)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+  int mib[4];
----------------
krytarowski wrote:
> `|| defined(__NetBSD__)`
|| (defined (__NetBSD__) && defined(KERN_PROC_PATHNAME))


================
Comment at: lib/Support/Unix/Path.inc:187
+  int mib[4];
+  mib[0] = CTL_KERN;
+  mib[1] = KERN_PROC;
----------------
krytarowski wrote:
> dim wrote:
> > krytarowski wrote:
> > > ```
> > > #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> > >  mib[0] = CTL_KERN;
> > >   mib[1] = KERN_PROC;
> > >   mib[2] = KERN_PROC_PATHNAME;
> > >   mib[3] = -1;
> > > #else
> > >  mib[0] = CTL_KERN;
> > >   mib[1] = KERN_PROC_ARGS;
> > >   mib[2] = -1;
> > >   mib[3] = KERN_PROC_PATHNAME;
> > > #endif
> > > ```
> > Ah, I wasn't aware that NetBSD already supported `KERN_PROC_PATHNAME`.  I downloaded NetBSD 7.1, and couldn't find the define in sys/sysctl.h, but I see it has been added recently.
> It was added after the `-7` branch a year ago or so. In my opinion no point to support here in upstream sources fallback, better to handle it downstream. By the time of 5.0.0 release we might have 8.0 out (and almost surely branched).
However the fallback isn't that difficult, I will propose a code for it.


https://reviews.llvm.org/D33171





More information about the llvm-commits mailing list