Description
I am trying to compile maloader using clang-3.4 on Ubuntu 12.04 (precise) amd64. Previously, when I compile maloader using gcc-4.6, all went well. The clang-3.4 were installed by apt as instructed http://llvm.org/apt/. Here is my building process.
$ git clone https://github.com/shinh/maloader.git
$ cd maloader
$ export USE_LIBCXX=1
$ make
clang -g -Iinclude -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -fPIC -c -o libmac/mac.o libmac/mac.c
clang: warning: argument unused during compilation: '-stdlib=libc++'
clang -shared libmac/mac.o libmac/strmode.c -g -Iinclude -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -fPIC -o libmac.so -m64
clang: warning: argument unused during compilation: '-stdlib=libc++'
clang++ -g -Iinclude -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -W -Werror -c -o extract.o extract.cc
extract.cc:38:10: fatal error: 'map' file not found
include
^
1 error generated.
make: *** [extract.o] Error 1
I have installed gcc-4.8, which has the correspondent header at /usr/include/c++/4.8/profile/map.h
But when I modified the CFLAGS from
GCCFLAGS+=-g -Iinclude -Wall -MMD -fno-omit-frame-pointer -O $(GCC_EXTRA_FLAGS)
to
GCCFLAGS+=-g -Iinclude -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -Wall -MMD -fno-omit-frame-pointer -O $(GCC_EXTRA_FLAGS)
It cannot be linked:
$ make clean
rm -f .o *.d */.o /.d libmac.so extract macho2elf ld-mac
$ make
clang -g -Iinclude -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -fPIC -c -o libmac/mac.o libmac/mac.c
clang: warning: argument unused during compilation: '-stdlib=libc++'
clang -shared libmac/mac.o libmac/strmode.c -g -Iinclude -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -fPIC -o libmac.so -m64
clang: warning: argument unused during compilation: '-stdlib=libc++'
clang++ -g -Iinclude -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -W -Werror -c -o extract.o extract.cc
clang++ -g -Iinclude -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -Wall -MMD -fno-omit-frame-pointer -O -m64 -stdlib=libc++ -DUSE_LIBCXX -W -Werror -c -o fat.o fat.cc
clang++ extract.o fat.o -o extract -g -I. -W -Wall -m64 -lc++ -lsupc++
/usr/bin/ld: cannot find -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [extract] Error 1
So I wander what had happened and how should I specify LDFLAGS
Activity