[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: predep_objects & postdep_objects with Intel 8.1
From: |
Gary Kumfert |
Subject: |
Re: predep_objects & postdep_objects with Intel 8.1 |
Date: |
Thu, 16 Dec 2004 15:17:17 -0800 (PST) |
I think I found the problem. When I upgraded with libtoolize.
"libtoolize -f -c" it copied things like config.guess, config.sub,
and ltmain.sh correctly into my AC_CONFIG_AUX_DIR.
But, it did *not* update my libtool.m4 in AC_CONFIG_MACRO_DIR.
After copying by hand, I saw that indeed the version of icpc is
checked and different flags are selected.
Wasn't libtoolize supposed to update the libtool.m4 file?
Gary
------------------------------------------------------------------------
Gary Kumfert, Ph.D. <address@hidden>
Center for Applied Scientific Computing phone: 925-424-2580
Lawrence Livermore National Laboratory fax: 925-424-2477
P.O. Box 808, L-365
Livermore, CA 94551-0808
On Thu, 16 Dec 2004, Gary Kumfert wrote:
>
> Hi,
>
> I'm tracking down an issue between Intel 8.1 and libtool 1.5.10.
> It seems that libtool adds and crtbeginS.o crtendS.o files to
> the link line for shared libraries... then icpc does the same..
> then ld complains about multiply defined symbols! Eeek!
>
> Shouldn't libtool (or libtool.m4) detect these object files
> already appear in the link line and not add them directly?
> Interestingly libtool (correctly) does not insert crtbeginS.o and
> crtendS.o into shared library link lines with icc or ifort.
> Why icpc?
>
> Here's some of the differences in what Intel 7.0, 8.0, and 8.1
> pass to ld. Note that the differences between 8.0 and 8.1 seem
> to be significant! In particular 8.1 seems to use GNU's crtbeginS.o and
> crtendS.o. 7.0 & 8.0 seems to rely on intel's crtxi.o and crtxn.o files
> instead.
>
> I admit that I don't really understand what low-level linker trickery
> these files accomplish. (A pointer to some literature would be helpful.)
>
> Help?
>
> Gary
>
> ------------------------------------------------------------------------
> Gary Kumfert, Ph.D. <address@hidden>
> Center for Applied Scientific Computing phone: 925-424-2580
> Lawrence Livermore National Laboratory fax: 925-424-2477
> P.O. Box 808, L-365
> Livermore, CA 94551-0808
>
>
>
> % cat foo.c
> int blah() {
> return 1;
> }
>
>
> #
> # First I verify the versions of these compilers...
> #
>
> % /usr/local/intel/compiler70/ia32/bin/icc -V
> Intel(R) C++ Compiler for 32-bit applications, Version 7.1 Build 20030701Z
> Copyright (C) 1985-2003 Intel Corporation. All rights reserved.
>
> GNU ld version 2.14.90.0.4 20030523
> Supported emulations:
> elf_i386
> i386linux
>
>
> % /usr/local/intel/compiler80/bin/icc -V
> Intel(R) C++ Compiler for 32-bit applications, Version 8.0 Build 20040520Z
> Package ID: l_cc_pc_8.0.066_pe067.1
> Copyright (C) 1985-2004 Intel Corporation. All rights reserved.
>
> GNU ld version 2.14.90.0.4 20030523
> Supported emulations:
> elf_i386
> i386linux
>
> % icc -V
> Intel(R) C++ Compiler for 32-bit applications, Version 8.1 Build 20040921Z
> Package ID: l_cc_pc_8.1.022
> Copyright (C) 1985-2004 Intel Corporation. All rights reserved.
>
> GNU ld version 2.14.90.0.4 20030523
> Supported emulations:
> elf_i386
> i386linux
>
> #
> # Next I see what gets passed to the GNU ld.
> #
>
> % /usr/local/intel/compiler70/ia32/bin/icc -shared -v foo.o -o libfoo.so
> ld \
> /usr/lib/crti.o \
> /opt/intel/compiler70/ia32/lib/crtxi.o \
> -shared \
> --version-script \
> /opt/intel/compiler70/ia32/lib/icrt.internal.map \
> -u \
> ___get_intrinsics \
> -o \
> libfoo.so \
> -rpath \
> /usr/local/intel/compiler70/ia32/lib \
> foo.o \
> -Qy \
> -L/opt/intel/compiler70/ia32/lib \
> -L/usr/lib \
> -Bstatic \
> -limf \
> -Bdynamic \
> -lm \
> -Bstatic \
> -lirc \
> -Bstatic \
> -lcprts \
> -Bdynamic \
> -lcxa \
> -Bstatic \
> -lunwind \
> -Bdynamic \
> -lc \
> /opt/intel/compiler70/ia32/lib/crtxn.o \
> /usr/lib/crtn.o
>
> % /usr/local/intel/compiler80/bin/icc -shared -v foo.o -o libfoo.so
> Version 8.0
> ld /usr/lib/crti.o /usr/local/intel/compiler80/lib/crtxi.o -shared
> --version-script /usr/local/intel/compiler80/lib/icrt.internal.map -m elf_i386
> -o libfoo.so -rpath /usr/local/intel/compiler80/lib foo.o -Qy
> -L/usr/local/intel/compiler80/lib -L/usr/lib -limf -lm -lcprts -lcxa -lunwind
> -lirc -lc -lirc /usr/local/intel/compiler80/lib/crtxn.o /usr/lib/crtn.o
>
> % icc -shared -v foo.o -o libfoo.so
> Version 8.1
> ld /usr/lib/crti.o
> /usr/local/tools/gnu/gcc/3.3.3_chaos_2_ia32/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/crtbeginS.o
> --eh-frame-hdr -shared -m elf_i386 -o libfoo.so -rpath
> /usr/local/intel/compiler81/lib foo.o -Qy -L/usr/local/intel/compiler81/lib
> -L/usr/local/tools/gnu/gcc/3.3.3_chaos_2_ia32/lib/gcc-lib/i686-pc-linux-gnu/3.3.3
> -L/usr/local/tools/gnu/gcc/3.3.3_chaos_2_ia32/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/../../..
> -L/usr/lib -limf -lm -lirc -lc -lgcc_s -lirc_s
> /usr/local/tools/gnu/gcc/3.3.3_chaos_2_ia32/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/crtendS.o
> /usr/lib/crtn.o
>
>