I want to try compiling and optimizing Apache httpd, as well as adding some pass processing. My compilation command is as follows:
CC=/opt/aflpp/afl-clang-lto \
CXX=/opt/aflpp/afl-clang-lto++ \
LD=/usr/lib/llvm-12/bin/ld.lld \
CFLAGS='-g -w -flto \
CXXFLAGS='-g -w -flto -std=c++11 -stdlib=libc++' \
LDFLAGS='-flto -fuse-ld=gold -Wl,-plugin-opt=save-temps' \
RANLIB=llvm-ranlib-12 \
./configure --with-apr="/usr/local/apache_lab/apr/" \
--with-apr-util="/usr/local/apache_lab/apr-util/" \
--with-expat="/usr/local/apache_lab/expat/" \
--with-pcre="/usr/local/apache_lab/pcre/" \
--disable-pie \
--disable-so \
--disable-example-ipc \
--disable-example-hooks \
--disable-optional-hook-export \
--disable-optional-hook-import \
--disable-optional-fn-export \
--disable-optional-fn-import \
--with-mpm=prefork \
--enable-static-support \
--enable-mods-static=reallyall \
--enable-debugger-mode \
--with-crypto --with-openssl \
--disable-shared
-Wl,-plugin-opt=save-temps
can generate some intermediate bitcode files, such as the one I generated, httpd.0.0.preopt.bc
. At this point, I use the first pass for optimization:
opt-12 -load libAssignEdges.so -assign-edge-ids -o httpd.bc httpd.0.0.preopt.bc
to get httpd.bc
How can I link the pass-processed httpd.bc to the executable program httpd?