NetBSD Problem Report #39964

From www@NetBSD.org  Thu Nov 20 03:16:59 2008
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 9968263BE1E
	for <gnats-bugs@gnats.netbsd.org>; Thu, 20 Nov 2008 03:16:59 +0000 (UTC)
Message-Id: <20081120031658.6727263B8BD@narn.NetBSD.org>
Date: Thu, 20 Nov 2008 03:16:58 +0000 (UTC)
From: xtraeme@gmail.com
Reply-To: xtraeme@gmail.com
To: gnats-bugs@NetBSD.org
Subject: modules/compat_linux: missing symbols on amd64
X-Send-Pr-Version: www-1.0

>Number:         39964
>Category:       port-amd64
>Synopsis:       modules/compat_linux: missing symbols on amd64
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-amd64-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 20 03:20:00 +0000 2008
>Closed-Date:    Thu Nov 20 09:27:00 +0000 2008
>Last-Modified:  Thu Nov 20 09:30:03 +0000 2008
>Originator:     Juan RP
>Release:        Latest
>Organization:
>Environment:
>Description:
compat_linux module gives some warnings that doesn't allow to load
the module successfully:

WARNING: linker error: symbol `linux_sysent' not found
WARNING: linker error: symbol `linux_trapsignal' not found
WARNING: linker error: symbol `linux_sendsig' not found
WARNING: linker error: symbol `linux_machdepioctl' not found
WARNING: linker error: symbol `release_futexes' not found
WARNING: linker error: symbol `linux_set_newtls' not found
WARNING: linker error: symbol `linux_syscallnames' not found
WARNING: linker error: symbol `linux_esigcode' not found
WARNING: linker error: symbol `linux_init_thread_area' not found
WARNING: linker error: symbol `linux_syscall_intern' not found
WARNING: linker error: symbol `linux_get_newtls' not found
WARNING: linker error: symbol `linux_sigcode' not found
WARNING: linker error: symbol `linux_sys_futex' not found
WARNING: linker error: symbol `linux_setregs' not found
WARNING: linker error: symbol `linux_usertrap' not found
WARNING: module error: unable to affix module

>How-To-Repeat:

>Fix:
The following patch seems to allow to load the module and run correctly
some binaries from pkgsrc/emulators/suse100_<blah>.

$ modstat|grep compat_linux
compat_linux    misc    filesys 0       77948   compat,compat_ossaudio,exec_elf64
$ /emul/linux/bin/uname -a                       
Linux sasha 2.4.18 #0 Wed Feb 20 20:00:02 CET 2002 x86_64 x86_64 x86_64 GNU/Linux
$ /emul/linux/usr/bin/ldd /emul/linux/bin/uname
        libc.so.6 => /lib64/libc.so.6 (0x00007f7ffdbd7000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f7ffde00000)
$

Index: modules/compat_linux/Makefile
===================================================================
RCS file: /cvsroot/src/sys/modules/compat_linux/Makefile,v
retrieving revision 1.1
diff -b -u -p -r1.1 Makefile
--- modules/compat_linux/Makefile       19 Nov 2008 18:36:08 -0000      1.1
+++ modules/compat_linux/Makefile       20 Nov 2008 03:07:41 -0000
@@ -25,13 +25,13 @@ SRCS+=      linux_exec_aout.c linux_sigcode.S
 SRCS+= linux_uselib.c
 .endif

-.if ${MACHINE} == "x86_64"
+.if ${MACHINE} == "amd64"
 CPPFLAGS+=     -DEXEC_ELF64
 .PATH: ${S}/compat/linux/arch/amd64
 .PATH: ${S}/arch/amd64/amd64
 .PATH: ${S}/arch/x86/x86
 SRCS+= linux_machdep.c linux_syscalls.c linux_sysent.c linux_commons.c
-SRCS+= linux_ptrace.c linux_exec_machdep.c linux_support.S linux_exec_elf64.c
+SRCS+= linux_exec_machdep.c linux_support.S linux_exec_elf64.c
 SRCS+= linux_sigcode.S linux_syscall.c linux_trap.c
 .endif

Index: compat/linux/arch/amd64/linux_exec_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/arch/amd64/linux_exec_machdep.c,v
retrieving revision 1.13
diff -b -u -p -r1.13 linux_exec_machdep.c
--- compat/linux/arch/amd64/linux_exec_machdep.c        28 Oct 2008 18:37:41 -0000      1.13
+++ compat/linux/arch/amd64/linux_exec_machdep.c        20 Nov 2008 03:07:41 -0000
@@ -67,6 +67,9 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec_m
 #include <compat/linux/common/linux_exec.h>
 #include <compat/linux/common/linux_errno.h>
 #include <compat/linux/common/linux_prctl.h>
+#include <compat/linux/common/linux_ipc.h>
+#include <compat/linux/common/linux_sem.h>
+
 #include <compat/linux/linux_syscallargs.h>

 int
Index: compat/linux/arch/amd64/linux_support.S
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/arch/amd64/linux_support.S,v
retrieving revision 1.1
diff -b -u -p -r1.1 linux_support.S
--- compat/linux/arch/amd64/linux_support.S     26 Oct 2008 20:25:49 -0000      1.1
+++ compat/linux/arch/amd64/linux_support.S     20 Nov 2008 03:07:41 -0000
@@ -30,7 +30,9 @@
  *
  * $FreeBSD: src/sys/amd64/linux32/linux32_support.s,v 1.1 2007/05/23 08:33:05 kib Exp $
  */
+#ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
+#endif
 #include <machine/asm.h>

 #include "assym.h"
Index: compat/linux/common/linux_exec_elf32.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/common/linux_exec_elf32.c,v
retrieving revision 1.81
diff -b -u -p -r1.81 linux_exec_elf32.c
--- compat/linux/common/linux_exec_elf32.c      28 Apr 2008 20:23:43 -0000      1.81
+++ compat/linux/common/linux_exec_elf32.c      20 Nov 2008 03:07:43 -0000
@@ -66,6 +66,8 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec_e
 #include <compat/linux/common/linux_util.h>
 #include <compat/linux/common/linux_exec.h>
 #include <compat/linux/common/linux_machdep.h>
+#include <compat/linux/common/linux_ipc.h>
+#include <compat/linux/common/linux_sem.h>

 #include <compat/linux/linux_syscallargs.h>
 #include <compat/linux/linux_syscall.h>

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: ad@NetBSD.org
State-Changed-When: Thu, 20 Nov 2008 09:27:00 +0000
State-Changed-Why:
fixed, thanks


From: Andrew Doran <ad@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39964 CVS commit: src/sys
Date: Thu, 20 Nov 2008 09:26:06 +0000 (UTC)

 Module Name:	src
 Committed By:	ad
 Date:		Thu Nov 20 09:26:06 UTC 2008

 Modified Files:
 	src/sys/compat/linux/arch/amd64: linux_exec_machdep.c linux_support.S
 	src/sys/compat/linux/common: linux_exec_elf32.c
 	src/sys/modules/compat_linux: Makefile

 Log Message:
 PR port-amd64/39964 modules/compat_linux: missing symbols on amd64


 To generate a diff of this commit:
 cvs rdiff -r1.13 -r1.14 src/sys/compat/linux/arch/amd64/linux_exec_machdep.c
 cvs rdiff -r1.1 -r1.2 src/sys/compat/linux/arch/amd64/linux_support.S
 cvs rdiff -r1.81 -r1.82 src/sys/compat/linux/common/linux_exec_elf32.c
 cvs rdiff -r1.1 -r1.2 src/sys/modules/compat_linux/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.