From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 4 08:32:30 2014 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7013817 for ; Tue, 4 Nov 2014 08:32:30 +0000 (UTC) Received: from CMEXEDGE1.ext.emulex.com (cmexedge1.emulex.com [138.239.224.99]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "CMEXEDGE1", Issuer "CMEXEDGE1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C7621659 for ; Tue, 4 Nov 2014 08:32:30 +0000 (UTC) Received: from CMEXHTCAS1.ad.emulex.com (138.239.115.217) by CMEXEDGE1.ext.emulex.com (138.239.224.99) with Microsoft SMTP Server (TLS) id 14.3.174.1; Tue, 4 Nov 2014 00:32:37 -0800 Received: from CMEXMB1.ad.emulex.com ([169.254.1.58]) by CMEXHTCAS1.ad.emulex.com ([2002:8aef:71b7::8aef:71b7]) with mapi id 14.03.0174.001; Tue, 4 Nov 2014 00:32:11 -0800 From: Nagesh Akula To: John-Mark Gurney Subject: RE: ZLIB FreeBSD 9.1 version + deflateInit_ Symbol not found Thread-Topic: ZLIB FreeBSD 9.1 version + deflateInit_ Symbol not found Thread-Index: Ac/3LabexlXkZ/khQJuvvxhc0zsvIAAr+hcAAAqO8WA= Date: Tue, 4 Nov 2014 08:32:09 +0000 Message-ID: <383FAC81A1B4D54E8BF7C31A699555FF11DE4A2B@CMEXMB1.ad.emulex.com> References: <383FAC81A1B4D54E8BF7C31A699555FF11DE48DA@CMEXMB1.ad.emulex.com> <20141103191517.GE8852@funkthat.com> In-Reply-To: <20141103191517.GE8852@funkthat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [138.239.140.58] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-drivers@freebsd.org" X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 08:32:31 -0000 Hi John, We are compiling our driver as a module, not as a built-in. =20 When we load our module (.ko that uses zlib), we were hitting at symbol not= found. As you said, DDB_CTF is added by default in BSD 10.0 kernel configuration, = but not there in 9.1 kernel. So, I have added DDB_CTF config option manually, recompiled the kernel. On = this booted kernel, our module is loading file with zlib.=20 No issue. Is it suggestible to have DDB_CTF config option ? If so, is it a 9.0 kerne= l limitation to not to have DDB_CTF by default (in GENERIC) configuration. = ? -Nagesh A -----Original Message----- From: John-Mark Gurney [mailto:jmg@funkthat.com]=20 Sent: Tuesday, November 04, 2014 12:45 AM To: Nagesh Akula Cc: freebsd-drivers@freebsd.org Subject: Re: ZLIB FreeBSD 9.1 version + deflateInit_ Symbol not found Nagesh Akula wrote this message on Mon, Nov 03, 2014 at 06:28 +0000: > I am trying to add compression algorithm within the kernel module. >=20 > For this, I have included library calls. >=20 > With this getting an linker error, > in FreeBSD 9.1 OS version, getting kldload linker error on deflateInit_ s= ymbol. >=20 > link_elf_obj: symbol deflateInit_ undefined > linker_load_file: Unsupported file type >=20 > But, in FreeBSD 10.0 version, the zlib library is able to link properly, = and module is working fine. >=20 > Please let me know, if there is any way to link ZLIB with our module in F= reeBSD 9.1 ? This is probably because zlib is only compiled when using one of the follow= ing device/options in FreeBSD: crypto, geom_uzip, ipsec, mxge, netgraph_def= late, ddb_ctf, gzio, or geom_uncompress... Are you trying to compile you're code as a module or as a static part of th= e kernel? If you're doing it as a part of the kernel, then you need to update sys/con= f/files to include your device/option on the line that has net/zlib.c on it= ... As for why it works on 10, but not 9, is that DDB_CTF was added to GENERIC,= and DDB_CTF forces the inclusion of zlib... So, you could possibly load a= module that uses zlib, or if that doesn't work, recomile your kernel to in= clude such a device... Let me know if you have any more questions.. --=20 John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."