Subject: lib/7301: ELF csu files were compiled without `-fPIC' options
To: None <gnats-bugs@gnats.netbsd.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: netbsd-bugs
Date: 04/02/1999 17:58:31
>Number:         7301
>Category:       lib
>Synopsis:       ELF csu files were compiled without `-fPIC' options
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr  2 01:05:01 1999
>Last-Modified:
>Originator:     Izumi Tsutsui
>Organization:
Izumi Tsutsui	Himeji City, Japan
>Release:        NetBSD-current supped on 19990324
>Environment:
System: NetBSD/macppc 1.3K, probably all elf systems.

>Description:
On ELF systems, shared libraries are compiled without
-fPIC option, then they cause some problems.

>How-To-Repeat:
Build shared libraries and make some dinamically linked command
on ELF system. On my macppc, ld complained as
"Unsupported relocation type 4 in non-PLT relocations"
on linking commands.

>Fix:
There is a typo in lib/csu/common_elf/Makefile.inc.

--- lib/csu/common_elf/Makefile.inc.orig	Sat Mar 20 09:32:40 1999
+++ lib/csu/common_elf/Makefile.inc	Wed Mar 24 18:33:06 1999
@@ -7,7 +7,7 @@
 CPPFLAGS+=	-DLIBC_SCCS -DPIC -DDYNAMIC -DELFSIZE=${ELFSIZE}
 CPPFLAGS+=	-I${.CURDIR}/../../../libexec/ld.elf_so
 CPPFLAGS+=	-I${.CURDIR}/../common_elf
-COPT+=		-fPIC
+COPTS+=		-fPIC
 
 .PATH:		${.CURDIR}/../common_elf
 


>Audit-Trail:
>Unformatted: