> -----Original Message----- > From: H.J. Lu [mailto:hjl.to...@gmail.com] > Sent: Monday, July 22, 2013 5:08 PM > To: Iyer, Balaji V > Cc: Ian Lance Taylor; gcc@gcc.gnu.org > Subject: Re: Help with using multilib for Cilk Library > > On Mon, Jul 22, 2013 at 9:27 AM, Iyer, Balaji V <balaji.v.i...@intel.com> > wrote: > > > > > >> -----Original Message----- > >> From: H.J. Lu [mailto:hjl.to...@gmail.com] > >> Sent: Friday, July 19, 2013 6:56 PM > >> To: Iyer, Balaji V > >> Cc: Ian Lance Taylor; gcc@gcc.gnu.org > >> Subject: Re: Help with using multilib for Cilk Library > >> > >> On Fri, Jul 19, 2013 at 3:53 PM, Iyer, Balaji V <balaji.v.i...@intel.com> > >> wrote: > >> > > >> > > >> >> -----Original Message----- > >> >> From: Ian Lance Taylor [mailto:i...@google.com] > >> >> Sent: Friday, July 19, 2013 6:26 PM > >> >> To: Iyer, Balaji V > >> >> Cc: gcc@gcc.gnu.org > >> >> Subject: Re: Help with using multilib for Cilk Library > >> >> > >> >> On Fri, Jul 19, 2013 at 11:22 AM, Iyer, Balaji V > >> >> <balaji.v.i...@intel.com> > >> wrote: > >> >> > Hello Everyone, > >> >> > I am trying to use Multilib on Cilk Library. I looked at > >> >> > this website > >> >> (http://www.airs.com/ian/configure/configure_8.html) and used > >> >> libsanitizer and libgo as samples to model after. It is currently > >> >> failing with the following error > >> >> message: > >> >> > > >> >> > libtool: link: /export/users/my-files/b-gcc-multilib/./gcc/xg++ > >> >> > - > >> >> B/export/users/my-files/b-gcc-multilib/./gcc/ -nostdinc++ > >> >> -nostdinc++ > >> >> - > >> >> I/export/users/my-files/b-gcc-multilib/x86_64-unknown-linux-gnu/32 > >> >> /li > >> >> bstdc++- v3/include/x86_64-unknown-linux-gnu > >> >> -I/export/users/my-files/b-gcc- > >> >> multilib/x86_64-unknown-linux-gnu/32/libstdc++-v3/include - > >> >> I/export/users/my-files/gcc/libstdc++-v3/libsupc++ > >> >> -I/export/users/my- files/gcc/libstdc++-v3/include/backward > >> >> -I/export/users/my-files/gcc/libstdc++- > >> >> v3/testsuite/util > >> >> -L/export/users/my-files/b-gcc-multilib/x86_64-unknown-linux- > >> >> gnu/32/libstdc++-v3/src > >> >> -L/export/users/my-files/b-gcc-multilib/x86_64- > >> >> unknown-linux-gnu/32/libstdc++-v3/src/.libs > >> >> -B/export/users/my-files/install- > >> >> gcc-multilib/x86_64-unknown-linux-gnu/bin/ > >> >> -B/export/users/my-files/install- > >> >> gcc-multilib/x86_64-unknown-linux-gnu/lib/ -isystem > >> >> /export/users/my- > >> >> files/install-gcc-multilib/x86_64-unknown-linux-gnu/include > >> >> -isystem > >> >> /export/users/my-files/install-gcc-multilib/x86_64-unknown-linux-g > >> >> nu/ > >> >> sys- include -m32 -shared -nostdlib /usr/lib/../lib/crti.o > >> >> /export/users/my-files/b- gcc-multilib/./gcc/32/crtbeginS.o > >> >> .libs/bug.o .libs/cilk-abi.o .libs/cilk-abi-cilk- for.o > >> >> .libs/cilk-abi-vla.o .libs/cilk-abi-vla-internal.o > >> >> .libs/cilk_api.o .libs/cilk_fiber.o .libs/cilk_fiber-unix.o > >> >> .libs/cilk_malloc.o .libs/c_reducers.o .libs/except-gcc.o > >> >> .libs/frame_malloc.o .libs/full_frame.o .libs/global_state.o > >> >> .libs/jmpbuf.o .libs/local_state.o .libs/metacall_impl.o > >> >> .libs/os_mutex-unix.o .libs/os-unix.o .libs/pedigrees.o > >> >> .libs/record-replay.o .libs/reducer_impl.o > >> .libs/scheduler.o .libs/signal_node.o .libs/spin_mutex.o > >> .libs/stats.o > >> >> .libs/symbol_test.o .libs/sysdep-unix.o .libs/worker_mutex.o > >> >> -Wl,-rpath - > >> >> Wl,/export/users/my-files/b-gcc-multilib/x86_64-unknown-linux-gnu/ > >> >> lib > >> >> stdc++- v3/src/.libs -Wl,-rpath > >> >> -Wl,/export/users/my-files/install-gcc-multilib/lib/../lib64 > >> >> -L/export/users/my-files/b-gcc-multilib/x86_64-unknown-linux-gnu/l > >> >> ibs > >> >> tdc++- v3/src/.libs > >> >> -L/export/users/my-files/b-gcc-multilib/x86_64-unknown-linux- > >> >> gnu/libstdc++-v3/src -lpthread -ldl > >> >> -L/export/users/my-files/b-gcc- > >> >> multilib/x86_64-unknown-linux-gnu/32/libstdc++-v3/src > >> >> -L/export/users/my- > >> >> files/b-gcc-multilib/x86_64-unknown-linux-gnu/32/libstdc++-v3/src/ > >> >> .li > >> >> bs - > >> >> L/export/users/my-files/b-gcc-multilib/./gcc/32 -L/lib/../lib > >> >> -L/usr/lib/../lib - L/export/users/my-files/b-gcc-multilib/./gcc > >> >> /export/users/my-files/b-gcc- > >> >> multilib/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++ > >> >> .so -lm -lc > >> - lgcc_s /export/users/my-files/b-gcc-multilib/./gcc/32/crtendS.o > >> >> /usr/lib/../lib/crtn.o -m32 -m32 -Wl,-soname -Wl,libcilkrts.so.5 -o > >> >> .libs/libcilkrts.so.5.0.3511 > >> >> > /export/users/my-files/b-gcc-multilib/x86_64-unknown-linux-gnu/l > >> >> > ibs > >> >> > tdc > >> >> > ++-v3/src/.libs/libstdc++.so: could not read symbols: File in > >> >> > ++wrong > >> >> > format > >> >> > collect2: error: ld returned 1 exit status > >> >> > make[4]: *** [libcilkrts.la] Error 1 > >> >> > make[4]: Leaving directory > >> >> > `/export/users/my-files/b-gcc-multilib/x86_64- > >> >> unknown-linux-gnu/32/libcilkrts' > >> >> > make[3]: *** [multi-do] Error 1 > >> >> > make[3]: Leaving directory `/export/users/my-files/b-gcc > >> >> > > >> >> > > >> >> > From what it looks like, it is reading the 64 bit library for > >> >> > the > >> >> > 32 bit mode (or > >> >> vice-versa). How do I fix this? I am also attaching my > >> >> configure.ac and Makefile.am. Please note that it is not fully > >> >> cleaned up (e.g. I have stuff commented out etc). Can someone > >> >> please tell me what I am doing > >> wrong? > >> >> > >> >> When building the 32bit libcillkrts you are linking against the > >> >> 64-bit > >> >> libstdc++. It's right there on your command line: > >> >> /export/users/my-files/b-gcc-multilib/x86_64-unknown-linux-gnu/lib > >> >> std > >> >> c++- > >> >> v3/src/.libs/libstdc++.so. > >> >> If that argument is needed at all, it needs to be > >> >> /export/users/my-files/b-gcc- > >> >> multilib/x86_64-unknown-linux-gnu/32/libstdc++-v3/src/.libs/libstd > >> >> c++ .so (note added /32 in there). I guess the question is where > >> >> the argument is coming from. I must admit that I don't know. Is > >> >> it in some environment variable? > >> > > >> > I am not setting any environment variable that weren't set > >> > automatically in my > >> SUSE machine. Also, all the other libs are working correctly for 32 and 64 > >> bit. > >> > > >> > >> If you can create a git branch, others can take a look to see what is > >> going on. > >> There isn't sufficient info to tell. > > > > Hello H. J. and Ian, > > I have posted what I have in bviyer/cilkplus-multilib-test. To > > build the > compiler, I used the following configure command: > > > > ../cilkplus-multilib-test/configure --prefix=<INSTALL_DIR> > > > > Any help is greatly appreciated! > > > > Thanks, > > > > Balaji V. Iyer. > > Here is a patch: > > 1. Add target dependency on C++ for parallel build. > 2. Remove hardcoded -O3 -fpic. libtool takes care of it. > 3. Work around MAKEFLAGS for multilib build. >
Hi H.J., Thank you! This patch got rid of all the errors for me. When I do make install, it is installing both the 32 bit one and 64 bit one in $INSTALL_DIR/lib. How can I make the 32 bit one write to $INSTALL_DIR/lib and the 64-bit one write to $INSTALL_DIR/lib64? Thanks, Balaji V. Iyer. > > -- > H.J.