Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: install: illegal option -- T #1222

Closed
bostick opened this issue Dec 20, 2021 · 6 comments
Closed

macOS: install: illegal option -- T #1222

bostick opened this issue Dec 20, 2021 · 6 comments

Comments

@bostick
Copy link
Contributor

bostick commented Dec 20, 2021

make distrib runs fine, but then make install gives this error:

install: illegal option -- T

The install command has different options apparently.

Note that -T flag appears in a few different places.

M1 with macOS Monterey

brenton@Brentons-M1-MacBook-Pro AFLplusplus % sudo make install      
[*] Compiling afl++ for OS Darwin on ARCH arm64
[!] Note: skipping x86 compilation checks (AFL_NO_X86 set).
[+] shmat seems to be working.
[+] Python 3.9.9 support seems to be working.
[+] Everything seems to be working, ready to compile.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -j4 -f GNUmakefile.llvm
GNUmakefile.llvm:60: [!] llvm_mode needs llvm-config, which was not found. Set LLVM_CONFIG to its path and retry.
[!] llvm_mode detected an old version of llvm, upgrade to at least 9 or preferable 11!
[+] llvm_mode detected llvm < 11, afl-lto LTO will not be build.
GNUmakefile.llvm:100: llvm_mode will not compile with Xcode clang...
GNUmakefile.llvm:120: we have trouble finding clang - llvm-config is not helping us
GNUmakefile.llvm:135: we have trouble finding clang++ - llvm-config is not helping us
make[1]: llvm-config: Command not found
[+] shmat seems to be working.
make[1]: llvm-config: Command not found
[*] Building 32-bit variant of the runtime (-m32)... failed (that's fine)
[!] Note: skipping build tests (you may need to use LLVM or QEMU mode).
[+] Main compiler 'afl-cc' successfully built!
[-] LLVM mode for 'afl-cc'  failed to build, likely you either don't have llvm installed, or you need to set LLVM_CONFIG, to point to e.g. llvm-config-11. See instrumentation/README.llvm.md how to do this. Highly recommended!
[-] LLVM LTO mode for 'afl-cc'  failed to build, this would need LLVM 11+, see instrumentation/README.lto.md how to build it
[-] gcc_plugin for 'afl-cc'  failed to build, unless you really need it that is fine - or read instrumentation/README.gcc_plugin.md how to build it
[+] All done! Be sure to review the README.md - it's pretty short and useful.

WARNING: Fuzzing on MacOS X is slow because of the unusually high overhead of
fork() on this OS. Consider using Linux or *BSD for fuzzing software not
specifically for MacOS.

NOTE: If you can read this, your terminal probably uses white background.
This will make the UI hard to read. See docs/status_screen.md for advice.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C utils/aflpp_driver
make[1]: Nothing to be done for `all'.
install -m 755 afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze afl-plot afl-cmin afl-cmin.bash afl-whatsup afl-system-config afl-persistent-config afl-cc ${DESTDIR}/usr/local/bin
install -d -m 755 ${DESTDIR}/usr/local/bin ${DESTDIR}/usr/local/share/doc/afl
install -m 755 afl-network-client afl-network-server ${DESTDIR}/usr/local/bin
install -T -m 644 README.md ${DESTDIR}/usr/local/share/doc/afl/README.network_proxy.md
install: illegal option -- T
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...
make[1]: *** [install] Error 64
make: *** [install] Error 2
brenton@Brentons-M1-MacBook-Pro AFLplusplus % 
@bostick
Copy link
Contributor Author

bostick commented Dec 20, 2021

I think this is from coreutils not being installed

@vanhauser-thc
Copy link
Member

@bostick so did you install coreutils now? did it work?

@bostick
Copy link
Contributor Author

bostick commented Dec 21, 2021

Yes, ensuring that coreutils was being used fixed everything.

And I verified that the install: illegal option -- T error is the only difference.

I'm not sure what best practice is, i.e., detect coreutils and complain if not being used, or rewriting commands to work with lowest common denominator, etc.

@vanhauser-thc
Copy link
Member

I want to update the INSTALL.md

is what is needed "brew install coreutils" ?

@bostick
Copy link
Contributor Author

bostick commented Dec 21, 2021

Installing, and also pointing PATH to new commands is needed.

For example, after running brew install coreutils, you get these caveats printed:

==> Caveats
Commands also provided by macOS and the commands dir, dircolors, vdir have been installed with the prefix "g".
If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH with:
  PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"

So, also doing PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" is needed.

@vanhauser-thc
Copy link
Member

updated the docs, thank you!

abertschi pushed a commit to mattweingarten/AFLplusplus that referenced this issue Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants