[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Link flags for aCC on HP-UX
From: |
Ludovic Courtès |
Subject: |
Link flags for aCC on HP-UX |
Date: |
Wed, 11 Aug 2004 12:02:20 +0200 |
User-agent: |
Mutt/1.5.4i [Guile enabled] |
Hi,
I recently ran into trouble while trying to build C++ libraries and
programs using aCC A.03.37 on HP-UX B.11.11 with Libtool 1.5.6. aCC
allows to use a C++ library that conforms to the C++ standard instead of
a pre-standard implementation by adding the `-AA' flag on both the
compilation command line _and_ linker's command line. However, Libtool
removes (almost) any user-specified LDFLAGS as evidenced by the
generated `libtool' script:
archive_cmds="\$CC -b \${wl}+h \${wl}\$soname \${wl}+b \${wl}\$install_libdir
-o \$lib \$predep_objects \$libobjs \$deplibs \$postdep_objects
\$compiler_flags"
Programs and libraries compiled with `-AA' and linked without it do link
successfully but won't run (they just abort() before `main' is called,
see [0] for details). Note that the same applies to the `-mt' flag
which is used for multi-threaded programs.
The patch below against `ltmain.sh' fixes the problem for me. However,
I'm not sure that adding these flags to `compiler_flags' is the right
way to do this; also, looking at `$host' in order to guess whether aCC
is being used isn't "clean" but I couldn't find any other way to do that
and it probably doesn't harm much anyway.
Thanks,
Ludovic.
[0]
http://h21007.www2.hp.com/dspp/ml/showArchiveMessage/1,,24!04!03!0011,00.html
--- /usr/local/share/libtool/ltmain.sh Fri Jul 30 09:29:01 2004
+++ /net/dali/matisse/DiSCo-3.1/ltmain.sh Wed Aug 11 11:36:02 2004
@@ -1367,7 +1367,16 @@
;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
- deplibs="$deplibs $arg"
+ case "$host" in
+ *-hpux*)
+ # When HP's aCC C++ compiler is used (on HP-UX), the `-AA'
+ # and `-mt' flags also need to be passed on the
+ # command-line that links shared libraries and
+ # executables.
+ compiler_flags="$compiler_flags $arg";;
+ *)
+ deplibs="$deplibs $arg";;
+ esac
continue
;;
@@ -1399,6 +1408,15 @@
continue
;;
+ -AA)
+ # When HP's aCC C++ compiler is used (on HP-UX), the `-AA' and `-mt'
+ # flags also need to be passed on the command-line that links shared
+ # libraries and executables.
+ case "$host" in
+ *-hpux*) compiler_flags="$compiler_flags $arg";;
+ esac
+ ;;
+
-shrext)
prev=shrext
continue
- Link flags for aCC on HP-UX,
Ludovic Courtès <=
- Additional link flags for HP aCC and SGI CC, Ludovic Courtès, 2004/08/23
- Re: Additional link flags for HP aCC and SGI CC, Gary V. Vaughan, 2004/08/23
- Re: Additional link flags for HP aCC and SGI CC, Ludovic Courtès, 2004/08/24
- Re: Additional link flags for HP aCC and SGI CC, Gary V . Vaughan, 2004/08/24
- Re: Additional link flags for HP aCC and SGI CC, Ludovic Courtès, 2004/08/24
- Re: Additional link flags for HP aCC and SGI CC, Gary V. Vaughan, 2004/08/24
- Re: Additional link flags for HP aCC and SGI CC, Ludovic Courtès, 2004/08/24
- Re: Additional link flags for HP aCC and SGI CC, Gary V. Vaughan, 2004/08/24
- Re: Additional link flags for HP aCC and SGI CC, Gary V. Vaughan, 2004/08/24
- Re: Additional link flags for HP aCC and SGI CC, Bob Friesenhahn, 2004/08/24