[PATCH] D41642: lib Fuzzer FreeBSD support

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 12:48:09 PST 2018


krytarowski added inline comments.


================
Comment at: lib/fuzzer/build.sh:1
-#!/bin/bash
+#!/usr/bin/env bash
 LIBFUZZER_SRC_DIR=$(dirname $0)
----------------
dim wrote:
> krytarowski wrote:
> > morehouse wrote:
> > > Is this change necessary?  All our shell scripts use `#!/bin/sh` or `#!/bin/bash`.
> > This is necessary, better to rewrite it to /bin/sh (POSIX shell) if possible. The env fallback is usually good enough for scripts with bash-specific features.
> > 
> > There is no bash in the basesystem of BSD. It can be installed optionally and if so, it's located in a different location dedicated for external software - in the NetBSD case, it's /usr/pkg/bin/bash.
> I see nothing in this script that requires bash.  Maybe just use `/bin/sh` here?
> 
> But indeed, `/bin/bash` is normally only available on Linux.  BSDs put it in a ports or pkgsrc specific installation directory, and that directory will be in the user's `PATH`.
> 
> Something similar goes for e.g. perl and python, one should *never* use `/usr/bin/perl` or `/usr/bin/python`, always `/usr/bin/env perl` and `/usr/bin/env python`.
Can you prepare a patch please?


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D41642





More information about the llvm-commits mailing list