public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Edelsohn <dje@watson.ibm.com>
To: Markus.Schaeffer@np-gmbh.com
Cc: gcc-help@gcc.gnu.org
Subject: Re: Threadiing Problems on AIX 4.3.3 ML-11 with gcc 3.2.3 (g++)
Date: Wed, 06 Aug 2003 18:52:00 -0000	[thread overview]
Message-ID: <200308061852.OAA29480@makai.watson.ibm.com> (raw)
In-Reply-To: <OFA4DFEAE1.D5913927-ONC1256D7A.0048A21D@np-gmbh.com>

>>>>> Mattey writes: 

> CXX:  gcc 3.2.3 (I'am using g++)
> LD:   /usr/ccs/bin/ld

	I assume you mean that you are using the native AIX linker, but
invoking "g++" to perform the link, not invoking "ld" directly.
Otherwise, using "-Wl," in the LDFLAGS could not possibly work.

> CXXFLAGS=   -c -g \
>             -Wno-deprecated \
>             -D_AIX \
>             -fpic \
>             -pthread \
>             -fexceptions

	Why are you adding "-fexceptions"?  The GNU C++ Compiler defaults
to exceptions on.  This is CXXFLAGS, not CFLAGS.

> LDFLAGS=    -pthread \
>             -Wl,-brtl \
>             -Wl,-bnoquiet \
>             -Wl,-bh:5 \
>             ${XERCESC_LDFLAGS}

> SHARED_LDFLAGS=   -pthread -shared \
>                   -Wl,-bE:symbols.exp \
>                   -Wl,-binitfini:init:fini:0 \
>                   -bM:SRE \
>                   -Wl,-bnoquiet \
>                   -Wl,-bh:5 \
>                   ${XERCESC_LDFLAGS}

	I assume LDFLAGS is for the application and SHARED_LDFLAGS is for
the shared library.

	Why does LDFLAGS contain "-Wl,-brtl", but SHARED_LDFLAGS does not
contain "-Wl,-G"?  Does the application use some other shared library with
System-V semantics?  Not all shared libraries need to be linked with
"-Wl,-G", but "-Wl,-brtl" serves no purpose unless the shared library was
linked with "-Wl,-G".  If you are using "-Wl,-brtl" for the linker to
notice shared libraries with the file suffix ".so", don't do that.  AIX
shared libraries normally are archives (ar command) of shared objects.
You can use the ".a" suffix directly on the shared object instead of
creating an archive.  Using the ".so" suffix for non-System-V semantics
shared objects just creates confusion.

	Also, I am concerned that you need to add "-Wl,-bh:5" to your link
line.  If you need to change the linker halt level from the default,
something is wrong.

	You have not mentioned what errors are produced by the AIX linker
requiring raising the halt level and you have not mentioned what "problem"
you encounter if your server does many calls.

	While AIX provides a thread-safe C library and GCC libstdc++-v3
strives to be thread safe, libstdc++-v3 may not interact with AIX libc in
a thread-safe manner.  libstdc++-v3 makes assumptions based on GNU libc
that are not correct on all platforms.  For instance, there are known
issues with libstdc++-v3 use of setlocale() in I/O functions.  Does your
shared library perform threaded I/O?

	User-written code interacting with libstdc++-v3 must follow the
SGI thread-safety rule, which basically says that the direct use of any
global library object (e.g. std::cout is global) or non-local object
returned from the library shared amongst user threads, must be protected
by a mutex or similar by the user.

David

  reply	other threads:[~2003-08-06 18:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-06 13:28 Markus.Schaeffer
2003-08-06 18:52 ` David Edelsohn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-08-07 12:47 Markus.Schaeffer
2003-08-05 15:55 Markus.Schaeffer
2003-08-05 17:41 ` David Edelsohn
2003-08-05 17:44 ` David Edelsohn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200308061852.OAA29480@makai.watson.ibm.com \
    --to=dje@watson.ibm.com \
    --cc=Markus.Schaeffer@np-gmbh.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).