From eugen@grosbein.pp.ru  Tue Apr 15 08:21:38 2003
Return-Path: <eugen@grosbein.pp.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 5520B37B404; Tue, 15 Apr 2003 08:21:38 -0700 (PDT)
Received: from grosbein.pp.ru (www2.svzserv.kemerovo.su [213.184.65.86])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id BB96643FB1; Tue, 15 Apr 2003 08:21:17 -0700 (PDT)
	(envelope-from eugen@grosbein.pp.ru)
Received: from grosbein.pp.ru (smmsp@localhost [127.0.0.1])
	by grosbein.pp.ru (8.12.9/8.12.7) with ESMTP id h3FFKHEc034867;
	Tue, 15 Apr 2003 23:20:17 +0800 (KRAST)
	(envelope-from eugen@grosbein.pp.ru)
Received: (from eugen@localhost)
	by grosbein.pp.ru (8.12.9/8.12.9/Submit) id h3FFGDL4034790;
	Tue, 15 Apr 2003 23:16:13 +0800 (KRAST)
Message-Id: <200304151516.h3FFGDL4034790@grosbein.pp.ru>
Date: Tue, 15 Apr 2003 23:16:13 +0800 (KRAST)
From: Eugene Grosbein <eugen@grosbein.pp.ru>
Reply-To: Eugene Grosbein <eugen@grosbein.pp.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: ru@freebsd.org
Subject: miniperl is linked with system libraries that breaks cross-build
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         50994
>Category:       misc
>Synopsis:       miniperl is linked with system libraries that breaks cross-build
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 15 08:30:11 PDT 2003
>Closed-Date:    Thu Apr 17 08:05:12 PDT 2003
>Last-Modified:  Thu Apr 17 08:05:12 PDT 2003
>Originator:     Eugene Grosbein
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
Svyaz Service JSC
>Environment:
System: FreeBSD grosbein.pp.ru 4.8-STABLE FreeBSD 4.8-STABLE #3: Sun Apr 6 23:20:11 KRAST 2003 eu@grosbein.pp.ru:/usr/local/obj/usr/local/src/sys/DADV i386

>Description:
	I've build a world for i586 using a power build machine 
	(its world itself is optimised for i686).
	miniperl is statically linked with system binaries.
	Here is link command in my case (long line is broken here):

cc -O -pipe -march=pentiumpro -I/usr/local/src/gnu/usr.bin/perl/miniperl
 -I/usr/local/src/gnu/usr.bin/perl/miniperl/../../../../contrib/perl5
 -L/usr/local/src/gnu/usr.bin/perl/miniperl/../libperl -static -o miniperl
 miniperlmain.o perl.o gv.o toke.o perly.o op.o regcomp.o dump.o util.o mg.o
 hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o
 regexec.o taint.o universal.o globals.o perlio.o -lm -lcrypt

	miniperl crashes with SIGILL later when i586 tries to run
	installworld from NFS-mounted src and obj.

>How-To-Repeat:
	Make build machine with world optimized for i686.
	Make world for i586. Try to install it using i586 from NFS.
	Here are last lines from installworld (cut-n-paste):

===> gnu/usr.bin/perl/library/B
Illegal instruction
*** Error code 132
Stop in /usr/local/obj/usr/local/src/gnu/usr.bin/perl/library/B/ext/B.
*** Error code 1
Stop in /usr/local/src/gnu/usr.bin/perl/library/B.
*** Error code 1
Stop in /usr/local/src/gnu/usr.bin/perl/library.
*** Error code 1
Stop in /usr/local/src/gnu/usr.bin/perl.
*** Error code 1
Stop in /usr/local/src/gnu/usr.bin.
*** Error code 1
Stop in /usr/local/src/gnu.
*** Error code 1
Stop in /usr/local/src.
*** Error code 1
Stop in /usr/local/src.
*** Error code 1
Stop in /usr/local/src.
*** Error code 1
Stop in /usr/local/src.

>Fix:

	I guess, needed statis libraries (*.a) must be 
	included in a link command in src/gnu/usr.bin/perl/miniperl/Makefile
	to allow cross-installation.

Eugene Grosbein
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: ru 
State-Changed-When: Wed Apr 16 00:33:59 PDT 2003 
State-Changed-Why:  
Patch has been sent to originator. 


Responsible-Changed-From-To: freebsd-bugs->ru 
Responsible-Changed-By: ru 
Responsible-Changed-When: Wed Apr 16 00:33:59 PDT 2003 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=50994 
State-Changed-From-To: feedback->closed 
State-Changed-By: ru 
State-Changed-When: Thu Apr 17 08:03:23 PDT 2003 
State-Changed-Why:  
Unfortunately, we don't support building world with CPUTYPE=i686 
and the installing it on Pentium with /usr/obj and /usr/src NFS 
mounted.  OTOH, NFS-mounting file systems of the Pentium machine 
and running ``make installworld DESTDIR=/pentium'' works. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=50994 
>Unformatted:
