[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SCO/bugfix patch 5 of 10: exclude -lc on SCO platforms

From: Kean Johnston
Subject: Re: SCO/bugfix patch 5 of 10: exclude -lc on SCO platforms
Date: Sun, 30 Oct 2005 20:09:31 -0800
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Kean Johnston wrote:
Patch 5 of 10 attached ...

Tim caught a small ommission. A corrected patch is attached.

On some releases of OpenServer 5, libc was poorly constructed and had
static versions of __ctype. Due to a bug with copy relocations, linking
a shared library with -lc would result in a shared library having one
notion of __ctype, and the a.out having another. Thus, things like
atoi() would behave differently inside the shared library versus the a.out.
This is really bad. Also, there is no need to link in -lc, as it is always
loaded by definition, as that is the RTLD and you cant have any form of
dynamic ELF program without it.

On OpenServer 6 and UnixWare, explicitly linking with -lc is even worse.
The threads library is constructed in such a way that it provides several
of the same functions that appear in libc. The version for
are the real, threads-safe versions. The versions that are in libc are
stub versions that are present to allow programs to link, while still using
simpler versions of things like mutexes and condition variables. In order
for threads to work correctly, libc *must* be the very last library in the
load order, so that those symbols that need it are resolved out of the
threads library. If you explicitly link with -lc when creating a shared
library, then libc is processed as a dependency when the shared library
is loaded, and appears too early in the dependency chain.

2005-10-24  Kean Johnston  <address@hidden>

        **-*-sco3.2v5*): Dont pass through -lc.
        (*-*-sysv5*): Ditto.

RCS file: /cvsroot/libtool/libtool/Attic/,v
retrieving revision 1.334.2.91
diff -u -3 -p -r1.334.2.91
---   18 Oct 2005 07:26:05 -0000      1.334.2.91
+++   30 Oct 2005 21:22:25 -0000
@@ -1494,6 +1495,15 @@ EOF
            # Rhapsody C and math libraries are in the System framework
            deplibs="$deplibs -framework System"
+           ;;
+         *-*-sco3.2v5* | *-*-sco5v6*)
+           # Causes problems with __ctype
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+           # Compiler inserts libc in the correct place for threads to work
+           test "X$arg" = "X-lc" && continue
+           ;;
        elif test "X$arg" = "X-lc_r"; then
         case $host in

reply via email to

[Prev in Thread] Current Thread [Next in Thread]