[cfe-dev] build error in git master

Alexey Samsonov samsonov at google.com
Tue Oct 9 09:11:48 PDT 2012


On Tue, Oct 9, 2012 at 3:45 AM, kapamaroo <kapamaroo at gmail.com> wrote:

> > Could you test if CMake build of LLVM (http://llvm.org/docs/CMake.html)
> > would work on your platform?
> > You'd need to install cmake 2.8.8 and follow the build instructions.
> >
> > $ mkdir mybuilddir
> > $ cd mybuilddir
> > $ cmake path/to/llvm/source/root
> > $ make
> >
> > I'm specifically interested in the contents
> > of mybuilddir/lib/clang/3.2/lib/linux
>
> Yes, CMake build completes without errors for me, no need for i386 headers
> :)
>

Thanks for this test! I've submitted some checks to compiler-rt build
system.
Could you check if configure+make build doesn't attempt to build 32-bit
libraries on your systems now (r165504 or later)?



>
> $ cmake --version
> cmake version 2.8.9
>
> $ ls -1 lib/clang/3.2/lib/linux/
> libclang_rt.asan-x86_64.a
> libclang_rt.tsan-x86_64.a
> libclang_rt.x86_64.a
>
> $ ./bin/clang -v
> clang version 3.2 (trunk 165441)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
>
>
> > > On Fri, Oct 5, 2012 at 11:05 PM, Stephen Street <
> > >
> > > sgs at redrocketcomputing.com> wrote:
> > >> Hello,
> > >>
> > >> I'm getting the same type of error:
> > >>
> > >> COMPILE:   clang_linux/asan-i386/i386:
> > >>
> /home/stephen/Workspace/clang-standalone-workspace/build/project/clang-s
> > >>
> tandalone/bootstrap/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_m
> > >> ac.cc
> > >>
> /home/stephen/Workspace/clang-standalone-workspace/build/project/clang-
> > >>
> standalone/bootstrap/src/llvm/projects/compiler-rt/lib/asan/asan_linux.c
> > >> c:24:10:
> > >>
> > >> fatal error:
> > >>       'sys/time.h' file not found
> > >>
> > >> #include <sys/time.h>
> > >>
> > >> which seems confusing as I configured my LLVM build with ./configure
> > >> --enable-targets=x86_64 (I also tried this with --enable-targets=host
> on
> > >> a Ubuntu 12.04 64 bit system) which should not have included the i386
> > >> support and thus not need the multiarch support...
> > >>
> > >> Any suggestion on how to constrain the compiler-rt build to x86_64
> > >> target only?
> > >>
> > >> Thanks!
> > >> Stephen
> > >>
> > >> On Oct 5, 2012, at 9:37 AM, kapamaroo <kapamaroo at gmail.com> wrote:
> > >> >> Yes, it looks like you're missing system headers for 32-bit builds.
> > >> >> Is there any way/package you can use to get them? (probably there
> > >>
> > >> should be
> > >>
> > >> >> folder /usr/include/i386-linux-gnu/
> > >> >> as well as /usr/include/x86_64-linux-gnu).
> > >> >> In the meantime, we should think on how to test presence of
> necessary
> > >> >> headers while configuring the build...
> > >> >
> > >> > I installed this package through multiarch
> > >> >
> > >> > linux-libc-dev:i386    :/usr/include/i386-linux-gnu/asm/unistd.h
> > >> >
> > >> > and now I get this error:
> > >> >  COMPILE:   clang_linux/asan-i386/i386:
> > >> /opt/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc
> > >>
> > >> > /opt/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:20:10:
> > >> > fatal
> > >>
> > >> error: 'new' file not found
> > >>
> > >> > #include <new>
> > >> >
> > >> >         ^
> > >> >
> > >> > 1 error generated.
> > >> >
> > >> >
> > >> >
> > >> > Searching for 'new' I get the following results:
> > >> >
> > >> > $ mlocate new |grep /usr/include |grep new$
> > >> > /usr/include/boost/tr1/tr1/new
> > >> > /usr/include/c++/4.6/new
> > >> > /usr/include/c++/4.7/new
> > >> >
> > >> > I have libstdc++6-4.7-dev installed on my system which provides
> > >>
> > >> /usr/include/c++/4.7/new.
> > >>
> > >> > Trying to install libstdc++6-4.7-dev:i386 conflicts with the already
> > >>
> > >> installed version of the package for amd64.
> > >>
> > >> > If I change the previous line to
> > >> >
> > >> > #include <c++/4.7/new>
> > >> >
> > >> > I get
> > >> >
> > >> >  COMPILE:   clang_linux/asan-i386/i386:
> > >> /opt/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc
> > >>
> > >> > In file included from
> > >>
> > >> /opt/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:21:
> > >> > /usr/include/c++/4.7/new:40:10: fatal error: 'bits/c++config.h' file
> > >>
> > >> not found
> > >>
> > >> > #include <bits/c++config.h>
> > >> >
> > >> >         ^
> > >> >
> > >> > 1 error generated.
> > >> >
> > >> >
> > >> > yet another search this time for 'bits/c++config.h' returns:
> > >> >
> > >> > $ mlocate bits/c++config.h
> > >> > /usr/include/c++/4.6/x86_64-linux-gnu/32/bits/c++config.h
> > >> > /usr/include/c++/4.6/x86_64-linux-gnu/bits/c++config.h
> > >> > /usr/include/c++/4.7/x86_64-linux-gnu/32/bits/c++config.h
> > >> > /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h
> > >> >
> > >> >
> > >> > I think this has to do with the debian way of installing header
> files
> > >>
> > >> (and libraries) in order to offer multiarch
> > >>
> > >> > support.
> > >> >
> > >> > The only workaround for me at the moment is to build without the
> > >>
> > >> changes introduced by commits r165096 and r165097
> > >>
> > >> > which is something I am trying to avoid.
> > >> >
> > >> > Any help would be appreciated.
> > >> >
> > >> > Thanks,
> > >> >
> > >> > Maroudas Manolis
> > >> >
> > >> >> On Fri, Oct 5, 2012 at 12:11 AM, kapamaroo <kapamaroo at gmail.com>
> > >>
> > >> wrote:
> > >> >>> Hello,
> > >> >>>
> > >> >>> I get this error in debian unstable (arch amd64).
> > >> >>>
> > >> >>>  COMPILE:   clang_linux/asan-i386/i386:
> > >> >>> /opt/llvm/projects/compiler-rt/lib/asan/asan_linux.cc
> > >> >>> In file included from
> > >> >>> /opt/llvm/projects/compiler-rt/lib/asan/asan_linux.cc:27:
> > >> >>> /usr/include/sys/syscall.h:25:10: fatal error: 'asm/unistd.h' file
> > >> >>> not found
> > >> >>> #include <asm/unistd.h>
> > >> >>>
> > >> >>>         ^
> > >> >>>
> > >> >>> 1 error generated.
> > >> >>>
> > >> >>>
> > >> >>> configure options:
> > >> >>>
> > >> >>> $ ../configure \
> > >> >>>
> > >> >>>  --disable-assertions \
> > >> >>>  --enable-optimized \
> > >> >>>  --disable-debug-symbols \
> > >> >>>  --disable-debug-runtime \
> > >> >>>  --enable-targets=host-only
> > >> >>>
> > >> >>> same with --enable-targets=all
> > >> >>>
> > >> >>> installed packages:
> > >> >>>
> > >> >>> linux-libc-dev    :/usr/include/x86_64-linux-gnu/asm/unistd.h
> > >> >>> libc6-dev
> > >> >>> libc6-dev-i386
> > >> >>>
> > >> >>> Build fails after the following changes
> > >> >>>
> > >> >>> r165096    "Build ASan runtime on Linux for both x86_64 and i386,
> > >>
> > >> same as
> > >>
> > >> >>> we do with full compiler_rt and
> > >> >>> libprofile"
> > >> >>> r165097    "Make sure 32-bit ASan runtime is available on 64-bit
> > >> >>> Linux platforms"
> > >> >>>
> > >> >>> I cannot test it with another linux distribution, so maybe it is
> > >>
> > >> debian
> > >>
> > >> >>> related or just me.
> > >> >>> Maybe I need to enable multiarch support for i386. Anyone with the
> > >>
> > >> same
> > >>
> > >> >>> problem?
> > >> >>>
> > >> >>> Thanks,
> > >> >>>
> > >> >>> Maroudas Manolis
> > >> >>>
> > >> >>>> I think your build script is OK.
> > >> >>>> r165222 should fix the problem for you.
> > >> >>>>
> > >> >>>> On Thu, Oct 4, 2012 at 4:15 PM, Carsten Mattner <
> > >> >>>
> > >> >>> carstenmattner at gmail.com>wrote:
> > >> >>>>> On Thu, Oct 4, 2012 at 2:10 PM, Дмитрий Дьяченко
> > >> >>>>> <dimhen at gmail.com>
> > >> >>>
> > >> >>> wrote:
> > >> >>>>>> few days ago i saw similar on Linux-x86_64
> > >> >>>>>> with slightly different err "fatal error: 'gnu/stubs-32.h' file
> > >> >>>>>> not
> > >> >>>>>
> > >> >>>>> found"
> > >> >>>>>
> > >> >>>>>> --> after glibc-devel-i386 installation err go away
> > >> >>>>>>
> > >> >>>>>> llvm/clang were configured with --enable-targets=host
> > >> >>>>>
> > >> >>>>> Anything wrong or improvable in the way I configure and build:
> > >> >>>>> CC=gcc CXX=g++ \
> > >> >>>>>
> > >> >>>>>    ../llvm/configure \
> > >> >>>>>    --prefix=$PREFIX \
> > >> >>>>>    --libdir=$PREFIX/lib/llvm \
> > >> >>>>>    --sysconfdir=$PREFIX/etc \
> > >> >>>>>    --enable-shared \
> > >> >>>>>    --enable-targets=all \
> > >> >>>>>    --disable-expensive-checks \
> > >> >>>>>    --disable-debug-runtime \
> > >> >>>>>    --disable-assertions \
> > >> >>>>>    --with-binutils-include=/usr/include \
> > >> >>>>>    --enable-optimized
> > >> >>>>>
> > >> >>>>> Is --enable-targets=all a bad idea? I think I copied the flags
> > >> >>>>> from a distro package.
> > >> >>>>>
> > >> >>>>> After configure is done I call "make REQUIRES_RTTI=1" also
> > >> >>>>> inspired by a distro package build script.
> > >> >>>>>
> > >> >>>>>> Dmitry
> > >> >>>>>>
> > >> >>>>>> 2012/10/4 Carsten Mattner <carstenmattner at gmail.com>:
> > >> >>>>>>> Does anybody else see the following build-error on linux-386?
> > >> >>>>>>>
> > >> >>>>>>>  COMPILE:   clang_linux/asan-x86_64/x86_64:
> > >> >>>>>>>
>  /tmp/src/llvm/llvm/projects/compiler-rt/lib/asan/asan_linux.c
> > >> >>>>>>>    c
> > >> >>>>>>>
> > >> >>>>>>> In file included from
> > >> >>>>>>>
> /tmp/src/llvm/llvm/projects/compiler-rt/lib/asan/asan_linux.cc:2
> > >> >>>>>>> 4: In file included from /usr/include/sys/time.h:22:
> > >> >>>>>>> In file included from /usr/include/features.h:399:
> > >> >>>>>>> /usr/include/gnu/stubs.h:10:11: fatal error: 'gnu/stubs-64.h'
> > >> >>>>>>> file
> > >> >>>
> > >> >>> not
> > >> >>>
> > >> >>>>> found
> > >> >>>>>
> > >> >>>>>>> # include <gnu/stubs-64.h>
> > >> >>>>>>>
> > >> >>>>>>>          ^
> > >> >>>>>>>
> > >> >>>>>>> 1 error generated.
> > >> >>>>>>> _______________________________________________
> > >> >>>>>>> cfe-dev mailing list
> > >> >>>>>>> cfe-dev at cs.uiuc.edu
> > >> >>>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> > >> >>>>>
> > >> >>>>> _______________________________________________
> > >> >>>>> cfe-dev mailing list
> > >> >>>>> cfe-dev at cs.uiuc.edu
> > >> >>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> > >> >
> > >> > _______________________________________________
> > >> > cfe-dev mailing list
> > >> > cfe-dev at cs.uiuc.edu
> > >> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>



-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121009/bd237901/attachment.html>


More information about the cfe-dev mailing list