[Llvm-bgq-discuss] clang/bgclang

Hal Finkel hfinkel at anl.gov
Tue May 6 11:15:17 CDT 2014


----- Original Message -----
> From: "John A. Biddiscombe" <biddisco at cscs.ch>
> To: llvm-bgq-discuss at lists.alcf.anl.gov
> Sent: Tuesday, May 6, 2014 11:11:37 AM
> Subject: [Llvm-bgq-discuss] clang/bgclang
> 
> 
> 
> 
> 
> Hal,
> 
> 
> 
> In my ongoing struggle to succeed despite my repeated failures, I
> have successfully compiled boost/hpx/otherstuff with just clang++
> and linked to libc++ from the c++11 toolchain. However, when I
> startup programs compiled as part of HPX, I get a segfault in some _
> dl _fixup going on during the initialization of a static path/dir
> object in boost filesystem.
> 
> 
> 
> The best explanation I’ve found from stackoverflow says
> (http://stackoverflow.com/questions/10578315/segmentation-fault-in-dl-runtime-resolve)
> 
>     1. Heap corruption (overflow) or
>     2. Mismatched parts of glibc itself.
> 
> 
> and 2) is clearly a possibility in my case since we’re using
> 
> libc.so.6 =>
> /bgsys/drivers/ppcfloor/gnu-linux-4.7.2/powerpc64-bgq-linux/lib/libc.so.6
> (0x00000fff78420000)
> 
> which is non-standard.

Yes, but you're linking to the libc++ that I compiled, dynamically, that likely pulls in the libc from /bgsys. You might just want to compiler libc++ yourself (or, if you have a gcc 4.8 build, just use the libstdc++ from that (by passing --gcc-toolchain /dir/to/gcc-4.8) to clang).

 -Hal

> 
> 
> 
> Question: Is there anything in the bgclang script that does important
> setting of any var/flag which might influence how the exes get
> linked. I see stuff in particular that sets
> 
> BGCLANG_TARGET_INC="-Xclang -isystem -Xclang
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/bgclang/r206161-20140414/libc++/include
> $BGCLANG_TARGET_INC"
> 
> and also
> 
> BGCLANG_TARGET_FLAGS="$BGCLANG_TARGET_FLAGS
> -L$BGSYS_FLOOR/$GNU_LINUX/powerpc64-bgq-linux/lib"
> 
> and I wonder about the -Xclang items which I understand to be
> instructions to clang plugins.
> 
> 
> 
> If I have my system configured as follows
> 
> CFLAGS="-mcpu=a2"
> 
> CXXFLAGS="-mcpu=a2 -std=c++11 -stdlib=libc++ -D_bgq_linux
> -I/gpfs/bbp.cscs.ch/home/biddisco/apps/clang/bgclang/r206161-20140414/libc++/include
> -I/bgsys/drivers/ppcfloor"
> 
> LDFLAGS="-dynamic
> -L/gpfs/bbp.cscs.ch/home/biddisco/apps/clang/bgclang/r206161-20140414/libc++/lib
> -L/bgsys/drivers/ppcfloor/gnu-linux-4.7.2/powerpc64-bgq-linux/lib"
> 
> (the -D_bgq_linux is mine and used by certain cpp files to #include
> stuff)
> 
> 
> 
> can you imagine what might be going wrong with my build/link to munge
> my libc initialization in any way? Have I linked to the wrong
> libc/c++ stuff perhaps?
> 
> Typically my exes come out looking like this (ldd below) as far as
> libs are used, which seems ok, but they do segfault on start which
> is really annoying me a lot (understatement).
> 
> 
> 
> thanks
> 
> 
> 
> JB
> 
> 
> 
> bbpbg2:~/bgas/clang/build/cpp$ ldd ../hpx/bin/network_storage
> 
> linux-vdso64.so.1 => (0x00000fff7d580000)
> 
> libhpxd.so.0 =>
> /gpfs/bbp.cscs.ch/home/biddisco/bgas/clang/build/hpx/lib/hpx/libhpxd.so.0
> (0x00000fff79b00000)
> 
> libhpx_serializationd.so.0 =>
> /gpfs/bbp.cscs.ch/home/biddisco/bgas/clang/build/hpx/lib/hpx/libhpx_serializationd.so.0
> (0x00000fff79ac0000)
> 
> libboost_date_time-clang35-mt-d-1_55.so.1.55.0 =>
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/boost_1_55_0/lib/libboost_date_time-clang35-mt-d-1_55.so.1.55.0
> (0x00000fff79a90000)
> 
> libboost_filesystem-clang35-mt-d-1_55.so.1.55.0 =>
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/boost_1_55_0/lib/libboost_filesystem-clang35-mt-d-1_55.so.1.55.0
> (0x00000fff79a40000)
> 
> libboost_program_options-clang35-mt-d-1_55.so.1.55.0 =>
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/boost_1_55_0/lib/libboost_program_options-clang35-mt-d-1_55.so.1.55.0
> (0x00000fff79920000)
> 
> libboost_regex-clang35-mt-d-1_55.so.1.55.0 =>
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/boost_1_55_0/lib/libboost_regex-clang35-mt-d-1_55.so.1.55.0
> (0x00000fff79710000)
> 
> libboost_serialization-clang35-mt-d-1_55.so.1.55.0 =>
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/boost_1_55_0/lib/libboost_serialization-clang35-mt-d-1_55.so.1.55.0
> (0x00000fff79530000)
> 
> libboost_system-clang35-mt-d-1_55.so.1.55.0 =>
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/boost_1_55_0/lib/libboost_system-clang35-mt-d-1_55.so.1.55.0
> (0x00000fff79510000)
> 
> libboost_thread-clang35-mt-d-1_55.so.1.55.0 =>
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/boost_1_55_0/lib/libboost_thread-clang35-mt-d-1_55.so.1.55.0
> (0x00000fff794c0000)
> 
> libboost_atomic-clang35-mt-d-1_55.so.1.55.0 =>
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/boost_1_55_0/lib/libboost_atomic-clang35-mt-d-1_55.so.1.55.0
> (0x00000fff794a0000)
> 
> libboost_chrono-clang35-mt-d-1_55.so.1.55.0 =>
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/boost_1_55_0/lib/libboost_chrono-clang35-mt-d-1_55.so.1.55.0
> (0x00000fff79480000)
> 
> libboost_context-clang35-mt-d-1_55.so.1.55.0 =>
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/boost_1_55_0/lib/libboost_context-clang35-mt-d-1_55.so.1.55.0
> (0x00000fff79460000)
> 
> libmpich.so.3 => /usr/lib64/mvapich2/lib/libmpich.so.3
> (0x00000fff790f0000)
> 
> libibverbs.so.1 => /usr/lib64/libibverbs.so.1 (0x000000808dbe0000)
> 
> libopa.so.1 => /usr/lib64/mvapich2/lib/libopa.so.1
> (0x00000fff790a0000)
> 
> libmpl.so.1 => /usr/lib64/mvapich2/lib/libmpl.so.1
> (0x00000080afc00000)
> 
> librt.so.1 =>
> /bgsys/drivers/ppcfloor/gnu-linux-4.7.2/powerpc64-bgq-linux/lib/librt.so.1
> (0x00000fff78f70000)
> 
> libpthread.so.0 =>
> /bgsys/drivers/ppcfloor/gnu-linux-4.7.2/powerpc64-bgq-linux/lib/libpthread.so.0
> (0x00000fff78e50000)
> 
> librdmacm.so.1 => /usr/lib64/librdmacm.so.1 (0x000000808dc10000)
> 
> libhwloc.so.5 =>
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/hwloc-1.8.1/lib/libhwloc.so.5
> (0x00000fff78df0000)
> 
> libdl.so.2 =>
> /bgsys/drivers/ppcfloor/gnu-linux-4.7.2/powerpc64-bgq-linux/lib/libdl.so.2
> (0x00000fff78cd0000)
> 
> libc++.so.1 =>
> /gpfs/bbp.cscs.ch/home/biddisco/apps/clang/bgclang/libc++/lib/libc++.so.1
> (0x00000fff78ab0000)
> 
> libstdc++.so.6 =>
> /bgsys/drivers/ppcfloor/gnu-linux-4.7.2/powerpc64-bgq-linux/lib/libstdc++.so.6
> (0x00000fff78880000)
> 
> libm.so.6 =>
> /bgsys/drivers/ppcfloor/gnu-linux-4.7.2/powerpc64-bgq-linux/lib/libm.so.6
> (0x00000fff78760000)
> 
> libgcc_s.so.1 =>
> /bgsys/drivers/ppcfloor/gnu-linux-4.7.2/powerpc64-bgq-linux/lib/libgcc_s.so.1
> (0x00000fff78650000)
> 
> libc.so.6 =>
> /bgsys/drivers/ppcfloor/gnu-linux-4.7.2/powerpc64-bgq-linux/lib/libc.so.6
> (0x00000fff78420000)
> 
> libibumad.so.3 => /usr/lib64/libibumad.so.3 (0x00000080a0b60000)
> 
> /lib64/ld64.so.1 (0x0000000020a80000)
> 
> 
> 
> 
> _______________________________________________
> llvm-bgq-discuss mailing list
> llvm-bgq-discuss at lists.alcf.anl.gov
> https://lists.alcf.anl.gov/mailman/listinfo/llvm-bgq-discuss
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-bgq-discuss mailing list