From davids@freebsd4.build.webmaster.com  Wed May 16 20:42:58 2001
Return-Path: <davids@freebsd4.build.webmaster.com>
Received: from freebsd4.build.webmaster.com (freebsd4.build.webmaster.com [216.152.64.229])
	by hub.freebsd.org (Postfix) with ESMTP id 14C6837B422
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 16 May 2001 20:42:57 -0700 (PDT)
	(envelope-from davids@freebsd4.build.webmaster.com)
Received: (from davids@localhost)
	by freebsd4.build.webmaster.com (8.11.3/8.11.1) id f4H3gnl12391;
	Wed, 16 May 2001 20:42:49 -0700 (PDT)
	(envelope-from davids)
Message-Id: <200105170342.f4H3gnl12391@freebsd4.build.webmaster.com>
Date: Wed, 16 May 2001 20:42:49 -0700 (PDT)
From: davids@webmaster.com
Reply-To: davids@webmaster.com
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: LinuxThreads ports fails to statically link (size changed)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         27402
>Category:       ports
>Synopsis:       Static linking problems with time functinos from LinuxThreads port
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    tegge
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 16 20:50:00 PDT 2001
>Closed-Date:    Wed Jun 13 19:05:58 2001
>Last-Modified:  Wed Jun 13 19:09:33 PDT 2001
>Originator:     David Schwartz
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
WebMaster, Incorporated
>Environment:
System: FreeBSD freebsd4.build.webmaster.com 4.3-STABLE FreeBSD 4.3-STABLE #10: Wed May 16 12:22:09 PDT 2001 davids@freebsd4.build.webmaster.com:/usr/src/sys/compile/DAVIDS i386

LinuxThreads port

>Description:

Attemping to statically link causes problems with functions like localtime,
gtime, and so on. Problem is that the symbols size has changed, causing
fatal linker errors:

/usr/lib/libc.a(localtime.o): In function ctime':
localtime.o(.text+0x160c): multiple definition of ctime'
/usr/local/lib/liblthread.a(libc_calls.o)(.text+0x60):/usr/ports/devel/
 linuxthreads/work/linuxthreads-2.1.3_2/libc_calls.c:
first defined here
/usr/libexec/elf/ld: Warning: size of symbol ctime' changed from 93 to 28 in
localtime.o
/usr/lib/libc.a(localtime.o): In function localtime':
localtime.o(.text+0x11cc): multiple definition of localtime'
/usr/local/lib/liblthread.a(libc_calls.o)(.text+0xc0):/usr/ports/devel/
 linuxthreads/work/linuxthreads-2.1.3_2/libc_calls.c:
first defined here
/usr/libexec/elf/ld: Warning: size of symbol localtime' changed from 93 to
41 in localtime.o
/usr/lib/libc.a(localtime.o): In function gmtime':
localtime.o(.text+0x1258): multiple definition of gmtime'
/usr/local/lib/liblthread.a(libc_calls.o)(.text+0x120):/usr/ports/devel/
 linuxthreads/work/linuxthreads-2.1.3_2/libc_calls.c:
first defined here
/usr/libexec/elf/ld: Warning: size of symbol gmtime' changed from 93 to 31
in localtime.o
/usr/lib/libc.a(asctime.o): In function asctime':
asctime.o(.text+0x0): multiple definition of asctime'
/usr/local/lib/liblthread.a(libc_calls.o)(.text+0x0):/usr/ports/devel/
 linuxthreads/work/linuxthreads-2.1.3_2/libc_calls.c:
first defined here
/usr/libexec/elf/ld: Warning: size of symbol asctime' changed from 93 to 24
in asctime.o

>How-To-Repeat:

Unfortunately, I'm not sure exactly what combination of circumstances
triggers this problem. I'm working on the simplest possible code that
triggers this. Perhaps something in my code grabs a header file that manages
to pull in the wrong prototypes for these functions? I'm not really sure.

>Fix:

I'm not sure what the right fix is. Removing the code for 'ctime' 'asctime'
'gmtime', and 'localtime' from the LinuxThreads port works. Well-behaved
multithreaded programs don't call these functions anyway.

David Schwartz
<davids@webmaster.com>
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->tegge 
Responsible-Changed-By: ijliao 
Responsible-Changed-When: Fri May 18 09:18:48 PDT 2001 
Responsible-Changed-Why:  
over to maintainer 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27402

State-Changed-From-To: open->closed
State-Changed-By: tegge
State-Changed-When: Wed Jun 13 19:05:58 2001
State-Changed-Why:
Fixed in the upgrade to LinuxThreads 2.2.3 by using a slightly modified
version of localtime.c from libc in FreeBSD 5.0-CURRENT and defining
NEWLIBC when compiling libc_calls.c.
>Unformatted:
