[LLVMbugs] [Bug 19839] New: cannot find map header on ubuntu12.04 using clang3.4

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 23 07:21:57 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19839

            Bug ID: 19839
           Summary: cannot find map header on ubuntu12.04 using clang3.4
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Headers
          Assignee: unassignedclangbugs at nondot.org
          Reporter: gdsyzxzcx at 126.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I am trying to compile maloader <https://github.com/shinh/maloader> using
clang-3.4 on Ubuntu 12.04 (precise) amd64. 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 <map>
         ^
1 error generated.
make: *** [extract.o] Error 1
#################################################

I don't think this is related to the upstream maloader source, since map.h
should be in path. 

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
################################################

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140523/7587c380/attachment.html>


More information about the llvm-bugs mailing list