2

Yesterday i was working on FreeBSD jails. According to the documentation, I ran command make buildworld and it compiled lots of files using cc.
In logs i saw something like:

cc ... -pipe ... file.c

Now I'm curious about -pipe flag. I also searched in manual page but did not find anything about this flag.
Do you know what this flag exactly does?

Pouriya
  • 1,626
  • 11
  • 19

2 Answers2

1

Assuming your cc is Clang, a detailed man page was added in later versions of Clang that are not available on your FreeBSD version. The -pipe is described as:

-pipe, --pipe
Use pipes between commands, when possible

See https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-pipe

Erik Cederstrand
  • 9,643
  • 8
  • 39
  • 63
  • Thank you. but do you know what this exactly does in compilation ? – Pouriya Jun 13 '18 at 12:21
  • I have no special knowledge about that. GCC has the same switch, and I assume they are equivalent. There's an excellent explanation for GCC here: https://stackoverflow.com/questions/1512933/when-should-i-use-gccs-pipe-option – Erik Cederstrand Jun 13 '18 at 14:10
0

I sent an Email to Salvatore Sanfilippo (author of Redis) and asked above question and he replied with:

Hello, it simply will use Unix pipes instead of files in order to "chain" the different stages needed for the compilation process. When -pipe is used, as GCC starts to emit the assembler code, the assembler will start to read from the pipe and emit the machine code and so forth. It should optimize compilation speed, but in practice it helps very little AFAIK.

Thanks to him.

Pouriya
  • 1,626
  • 11
  • 19