From dunstan@freebsd.czest.pl  Sun May  8 12:20:07 2005
Return-Path: <dunstan@freebsd.czest.pl>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 658F116A4E1
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  8 May 2005 12:20:07 +0000 (GMT)
Received: from freebsd.czest.pl (silver.iplus.pl [80.48.250.4])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3AC0943D99
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  8 May 2005 12:20:05 +0000 (GMT)
	(envelope-from dunstan@freebsd.czest.pl)
Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4])
	by freebsd.czest.pl (8.12.10/8.12.9) with ESMTP id j48CUEvr045662
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 8 May 2005 12:30:14 GMT
	(envelope-from dunstan@freebsd.czest.pl)
Received: (from dunstan@localhost)
	by freebsd.czest.pl (8.12.10/8.12.9/Submit) id j48CUDw2045661;
	Sun, 8 May 2005 12:30:14 GMT
	(envelope-from dunstan)
Message-Id: <200505081230.j48CUDw2045661@freebsd.czest.pl>
Date: Sun, 8 May 2005 12:30:14 GMT
From: "Wojciech A. Koszek" <dunstan@freebsd.czest.pl>
Reply-To: "Wojciech A. Koszek" <dunstan@freebsd.czest.pl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] svr4.ko should depend on sysv(msg|sem).
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         80760
>Category:       kern
>Synopsis:       [PATCH] svr4.ko should depend on sysv(msg|sem).
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 08 12:30:08 GMT 2005
>Closed-Date:    Tue Aug 16 20:55:34 GMT 2005
>Last-Modified:  Tue Aug 16 20:55:34 GMT 2005
>Originator:     Wojciech A. Koszek
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD dunstan.freebsd.czest.pl 5.4-STABLE FreeBSD 5.4-STABLE #5: Sun May 8 11:57:11 CEST 2005 dunstan@dunstan.freebsd.czest.pl:/usr/obj/usr/src/sys/HOME8 i386


>Description:
SVRv4 code depends on System V IPC primitives, which might be loaded as
KLDs. If they're not loaded before svr4.ko, its loading procedure will fail.
>How-To-Repeat:
SystemV options needs to be disabled in your kernel configuration:
[..]
#options 	SYSVSHM			# SYSV-style shared memory
#options 	SYSVMSG			# SYSV-style message queues
#options 	SYSVSEM			# SYSV-style semaphores

# kldstat | grep sysv
# cd /usr/src/sys/modules/svr4
# make load
[..]
objcopy --strip-debug svr4.ko
/sbin/kldload -v /usr/src/sys/modules/svr4/svr4.ko
kldload: can't load /usr/src/sys/modules/svr4/svr4.ko: No such file or directory
*** Error code 1

Stop in /usr/src/sys/modules/svr4.
[..]

# dmesg | tail -1
link_elf: symbol msginfo undefined


>Fix:
Patch [diff.0.svr4_sysvec.c] adds MODULE_DEPEND macros.

--- diff.0.svr4_sysvec.c begins here ---
Patch against FreeBSD 5.4-STABLE, kern.osreldate: 504100.

diff -uprP /usr/src/sys/compat/svr4/svr4_sysvec.c src/sys/compat/svr4/svr4_sysvec.c
--- /usr/src/sys/compat/svr4/svr4_sysvec.c	Sat Feb 12 09:36:02 2005
+++ src/sys/compat/svr4/svr4_sysvec.c	Sun May  8 14:24:32 2005
@@ -424,3 +424,5 @@ static moduledata_t svr4_elf_mod = {
 };
 DECLARE_MODULE(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
 MODULE_DEPEND(svr4elf, streams, 1, 1, 1);
+MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1);
+MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1);
--- diff.0.svr4_sysvec.c ends here ---

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jhb 
State-Changed-When: Tue Aug 16 20:55:00 GMT 2005 
State-Changed-Why:  
This bug is only fixex in 6.x and forward, but the submitter states that it 
can be closed. 

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