我想使用clang将httpd编译成 LLVM 字节码。首先,我尝试使用gcc对其进行编译,为此我执行了以下操作:
./configure --prefix=/home/varun/apache/httpd/gcc --with-included-apr
make
sudo make install
并且安装成功!
现在,我尝试使用 clang 编译它,为此我执行以下操作:
CC="clang" CFLAGS="-O4" ./configure --prefix=/home/varun/apache/httpd/clang --with-included-apr
make # didn't come to this step
sudo make install # didn't come to this step
而且,配置本身失败。我选择了-O4,因为我读到 LLVM 输出字节码,如果你使用 -O4 或 -emit-llvm 作为 CFLAGS(它们都不工作)。
这是我得到的错误:
checking whether the C compiler works... no
configure: error: in `/home/varun/apache/httpd/httpd-2.4.3/srclib/apr':
configure: error: C compiler cannot create executables
这与链接器无法链接 LLVM 字节码文件有关吗?