From owner-freebsd-drivers@FreeBSD.ORG Mon Nov 3 06:43:48 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 A1B1725C for ; Mon, 3 Nov 2014 06:43:48 +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 7B166F5A for ; Mon, 3 Nov 2014 06:43:47 +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; Sun, 2 Nov 2014 22:28:51 -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; Sun, 2 Nov 2014 22:28:27 -0800 From: Nagesh Akula To: "freebsd-drivers@freebsd.org" Subject: ZLIB FreeBSD 9.1 version + deflateInit_ Symbol not found Thread-Topic: ZLIB FreeBSD 9.1 version + deflateInit_ Symbol not found Thread-Index: Ac/3LabexlXkZ/khQJuvvxhc0zsvIA== Date: Mon, 3 Nov 2014 06:28:26 +0000 Message-ID: <383FAC81A1B4D54E8BF7C31A699555FF11DE48DA@CMEXMB1.ad.emulex.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [138.239.140.58] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 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: Mon, 03 Nov 2014 06:43:48 -0000 Hi, I am trying to add compression algorithm within the kernel module. For this, I have included library calls. With this getting an linker error, in FreeBSD 9.1 OS version, getting kldload linker error on deflateInit_ sym= bol. link_elf_obj: symbol deflateInit_ undefined linker_load_file: Unsupported file type But, in FreeBSD 10.0 version, the zlib library is able to link properly, an= d module is working fine. Please let me know, if there is any way to link ZLIB with our module in Fre= eBSD 9.1 ? Thank you. -NAKULA. Below are additional details: Tested OS revision: # uname -a FreeBSD FreeBSD-170 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec 4 = 09:23:10 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GEN= ERIC amd64 Tested module file used for ZLIB issue reproduction: #include #include #include /* uprintf */ #include #include /* defines used in kernel.h */ #include /* types used in module initialization */ #include #include #include void skel_zlib_test(void); static void * z_alloc(void *unused, uint32_t items, uint32_t size) { void *ptr; ptr =3D malloc(items * size, M_DEVBUF, M_NOWAIT|M_ZERO); return ptr; } static void z_free(void *opaque, void *ptr) { free(ptr, M_DEVBUF); } void skel_zlib_test(void) { z_stream zInfo; int rc; zInfo.zalloc =3D (alloc_func)z_alloc; zInfo.zfree =3D (free_func)z_free; zInfo.opaque =3D NULL; rc =3D deflateInit(&zInfo, Z_DEFAULT_COMPRESSION); deflateEnd(&zInfo); } /* * Load handler that deals with the loading and unloading of a KLD. */ static int skel_loader(struct module *m, int what, void *arg) { int err =3D 0; switch (what) { case MOD_LOAD: /* kldload */ uprintf("Skeleton KLD loaded.\n"); skel_zlib_test(); break; case MOD_UNLOAD: uprintf("Skeleton KLD unloaded.\n"); break; default: err =3D EOPNOTSUPP; break; } return(err); } /* Declare this module to the rest of the kernel */ static moduledata_t skel_mod =3D { "skel", skel_loader, NULL }; DECLARE_MODULE(skeleton, skel_mod, SI_SUB_KLD, SI_ORDER_ANY); --- Makefile: SRCS=3Dskel.c KMOD=3Dskel .include Error: # kldload ./skel.ko # dmesg link_elf_obj: symbol deflateInit_ undefined linker_load_file: Unsupported file type From owner-freebsd-drivers@FreeBSD.ORG Mon Nov 3 19:15:20 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 DDE80F79 for ; Mon, 3 Nov 2014 19:15:20 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CD14CB6 for ; Mon, 3 Nov 2014 19:15:20 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id sA3JFIV4090600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Nov 2014 11:15:18 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id sA3JFI5q090599; Mon, 3 Nov 2014 11:15:18 -0800 (PST) (envelope-from jmg) Date: Mon, 3 Nov 2014 11:15:18 -0800 From: John-Mark Gurney To: Nagesh Akula Subject: Re: ZLIB FreeBSD 9.1 version + deflateInit_ Symbol not found Message-ID: <20141103191517.GE8852@funkthat.com> Mail-Followup-To: Nagesh Akula , "freebsd-drivers@freebsd.org" References: <383FAC81A1B4D54E8BF7C31A699555FF11DE48DA@CMEXMB1.ad.emulex.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <383FAC81A1B4D54E8BF7C31A699555FF11DE48DA@CMEXMB1.ad.emulex.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 03 Nov 2014 11:15:18 -0800 (PST) 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: Mon, 03 Nov 2014 19:15:21 -0000 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. > > For this, I have included library calls. > > With this getting an linker error, > in FreeBSD 9.1 OS version, getting kldload linker error on deflateInit_ symbol. > > link_elf_obj: symbol deflateInit_ undefined > linker_load_file: Unsupported file type > > But, in FreeBSD 10.0 version, the zlib library is able to link properly, and module is working fine. > > Please let me know, if there is any way to link ZLIB with our module in FreeBSD 9.1 ? This is probably because zlib is only compiled when using one of the following device/options in FreeBSD: crypto, geom_uzip, ipsec, mxge, netgraph_deflate, ddb_ctf, gzio, or geom_uncompress... Are you trying to compile you're code as a module or as a static part of the kernel? If you're doing it as a part of the kernel, then you need to update sys/conf/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 include such a device... Let me know if you have any more questions.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 4 04:09:58 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 95D1B626 for ; Tue, 4 Nov 2014 04:09:58 +0000 (UTC) Received: from homiemail-a103.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by mx1.freebsd.org (Postfix) with ESMTP id 7D99AA09 for ; Tue, 4 Nov 2014 04:09:57 +0000 (UTC) Received: from homiemail-a103.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a103.g.dreamhost.com (Postfix) with ESMTP id BD93820047B83 for ; Mon, 3 Nov 2014 20:09:56 -0800 (PST) Received: from [192.168.1.254] (43.211.dsl.mel.iprimus.net.au [58.178.232.43]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: orthogonal@librewrt.org) by homiemail-a103.g.dreamhost.com (Postfix) with ESMTPSA id 4E84A20047B80 for ; Mon, 3 Nov 2014 20:09:56 -0800 (PST) Message-ID: <54585191.4090703@bitmessage.ch> Date: Tue, 04 Nov 2014 15:09:53 +1100 From: Riley Baird User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: freebsd-drivers@freebsd.org Subject: ar9300_devid.h license restricts modification Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 04:09:58 -0000 Hi! The license of two files in the ath_hal driver appears to restrict modification. The two files are: /sys/dev/ath/ath_hal/ar9003/ar9300_devid.h /sys/contrib/dev/ath/ath_hal/ar9300/ar9300_devid.h The license of these files is: * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting, Atheros * Communications, Inc. All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the following conditions are met: * 1. The materials contained herein are unmodified and are used * unmodified. * 2. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following NO * ''WARRANTY'' disclaimer below (''Disclaimer''), without * modification. * 3. Redistributions in binary form must reproduce at minimum a * disclaimer similar to the Disclaimer below and any redistribution * must be conditioned upon including a substantially similar * Disclaimer requirement for further binary redistribution. * 4. Neither the names of the above-listed copyright holders nor the * names of any contributors may be used to endorse or promote * product derived from this software without specific prior written * permission. * * NO WARRANTY * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE * FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGES. * * $FreeBSD$ There is a discussion about this going on at Debian: https://bugs.debian.org/767583 Thanks for reading, Riley Baird From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 4 05:19:20 2014 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04B13FF7; Tue, 4 Nov 2014 05:19:20 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DC8E8F67; Tue, 4 Nov 2014 05:19:19 +0000 (UTC) Received: from delphij-macbook.home.us.delphij.net (c-24-5-244-32.hsd1.ca.comcast.net [24.5.244.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 25D421AD4B; Mon, 3 Nov 2014 21:19:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1415078353; x=1415092753; bh=pk3mq0DM+tmeTLZcZubsF/U1YhbbtcifN9qdE4tyYUY=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=p1MLdNf7smtUv8WRA9VRayQteoViO06JVh3qqxHzIlY5AzjKrVoPaMSOdu4EcbvUq xRaK/1GB0o3CAASeDYwtQawIz9l+LMzr/7Ysj+o4RM/DyYQbrv2gr4DK1pjKXTQkfW 5f7RwX3mKxKxs0/J/6EkOrmHJZTtgi4mCgFR6tLU= Message-ID: <545861D0.8030607@delphij.net> Date: Mon, 03 Nov 2014 21:19:12 -0800 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Riley Baird , freebsd-drivers@freebsd.org Subject: Re: ar9300_devid.h license restricts modification References: <54585191.4090703@bitmessage.ch> In-Reply-To: <54585191.4090703@bitmessage.ch> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: adrian Chadd , sam@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 05:19:20 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Adding Adrian Chadd (who imported the file into FreeBSD) and Sam Leffler to Cc. On 11/3/14 8:09 PM, Riley Baird wrote: > Hi! > > The license of two files in the ath_hal driver appears to restrict > modification. The two files are: > /sys/dev/ath/ath_hal/ar9003/ar9300_devid.h > /sys/contrib/dev/ath/ath_hal/ar9300/ar9300_devid.h > [...] > > There is a discussion about this going on at Debian: > https://bugs.debian.org/767583 A quick glance of the two files suggests that they are not (disclaimer: I am not a lawyer and this is purely layman opinion) copyrightable because they are purely constant definitions, which are non-copyrightable _facts_ after all. However, it would be nice if we can confirm with Qualcomm. Cheers, -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJUWGHQAAoJEJW2GBstM+nsr5EP/3MxQ2AV7dPH1q4H/PsT9faL 4NDF9/8ri7NCrFAZSR4XzdCijpVvtCn895bNetwz0DnO/wZmaEHC7W5n7ut1K+O1 dYclu2woM1NLM74kyFIpey2GguP1xM3oh9c6GNML1PtcWLZojdGAu88P+R2a0nv6 gXbq9DPByDTUR6Ws4fxq/wD7YN3ShCTrItxsN/lbgnyu1NMtJlN1DBt+RRqTSm+h ZgxUS+qDTm7eLXVewTLOfeOHX0Lyu+hUNve63DMafxzJ+thnHwroEJFljnjoKyQN HnJXGrQbvK5Tp/8VqFt3CFrDU5vv4//Tn8BDd1mMls8Z7qxe5Z7DWag1xqhiTV1w aVlu8IaHMT9py/YPggCf9WL+MCff7i56PyI2xTHkQYFEtsRKLWInqFKBFkhkj2y5 NU+son/ApKNN5IpzS9DlHVdYf19/SLhVelGumtYcp0hS9rZaJhzKuOD2VqPawAG3 mYUWsEXcpsVi/y1F7pDVUZCbsHsK2Ic2r8W3BmWFwSqf3VNJMkJ3V6bf5eW6aXbp sWiX4W3z9i35ejmcKElynWKTxZBUzoTWGplyQoCKaV5YTEDfuEZ+qTI/E/lkGYOS v2rwDeWDbPZex+tDWTtU0M3ssNoQh/QmynpEVFD2RPrTKBUkR4/D4HSbHD8MoSqo kmO2oYFEvbt3+7L3Ucrg =RV/2 -----END PGP SIGNATURE----- From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 4 05:21:03 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 4999DBC; Tue, 4 Nov 2014 05:21:03 +0000 (UTC) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3B7AF78; Tue, 4 Nov 2014 05:21:02 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id a1so12674154wgh.34 for ; Mon, 03 Nov 2014 21:21:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=2Do+IHqnHIp8gFO7anOOV5bHYZQatxW25MtRHr9XoT0=; b=yNGb3rO7AhZQuFY8tjY01oWktcr2gTa49pZb6JxpcOTfygIzF0guxdzoFBj9uKeDxv HV7QR7LLRZwcqWUFPywmHqGD8PqUfez0OzEk7rfYmUyXzLs3XgzoIaJHbwZ829GLsv/I bIrqL/whnJxlEjRATkMYYamNc3WDsR3dIBh8umiXyT3t96+8mIBjoYpzvLvMm3Oc0Hwt UUj6RPZL6x22WLj7hQ8BHfinLcBnpCddkflIMVMljG5DCpP6tpf9OUMPh5FBAkdplcC+ uZQvJBCMwlFjKPOrjFXc8s0+K0WYHV4USo9Ib0t/344ZjgPLtuYyCjQsKKq8vuez2Ga/ Tlmw== MIME-Version: 1.0 X-Received: by 10.180.73.212 with SMTP id n20mr20751763wiv.59.1415078460120; Mon, 03 Nov 2014 21:21:00 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Mon, 3 Nov 2014 21:21:00 -0800 (PST) In-Reply-To: <545861D0.8030607@delphij.net> References: <54585191.4090703@bitmessage.ch> <545861D0.8030607@delphij.net> Date: Mon, 3 Nov 2014 21:21:00 -0800 X-Google-Sender-Auth: yzXd4lVhzSUDp5y81VuZh_YxZjA Message-ID: Subject: Re: ar9300_devid.h license restricts modification From: Adrian Chadd To: Xin LI Content-Type: text/plain; charset=UTF-8 Cc: Riley Baird , Sam Leffler , "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 05:21:03 -0000 I missed these; they're BSD licenced. -adrian On 3 November 2014 21:19, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > Adding Adrian Chadd (who imported the file into FreeBSD) and Sam > Leffler to Cc. > > On 11/3/14 8:09 PM, Riley Baird wrote: >> Hi! >> >> The license of two files in the ath_hal driver appears to restrict >> modification. The two files are: >> /sys/dev/ath/ath_hal/ar9003/ar9300_devid.h >> /sys/contrib/dev/ath/ath_hal/ar9300/ar9300_devid.h >> > [...] >> >> There is a discussion about this going on at Debian: >> https://bugs.debian.org/767583 > > A quick glance of the two files suggests that they are not > (disclaimer: I am not a lawyer and this is purely layman opinion) > copyrightable because they are purely constant definitions, which are > non-copyrightable _facts_ after all. > > However, it would be nice if we can confirm with Qualcomm. > > Cheers, > -----BEGIN PGP SIGNATURE----- > > iQIcBAEBCgAGBQJUWGHQAAoJEJW2GBstM+nsr5EP/3MxQ2AV7dPH1q4H/PsT9faL > 4NDF9/8ri7NCrFAZSR4XzdCijpVvtCn895bNetwz0DnO/wZmaEHC7W5n7ut1K+O1 > dYclu2woM1NLM74kyFIpey2GguP1xM3oh9c6GNML1PtcWLZojdGAu88P+R2a0nv6 > gXbq9DPByDTUR6Ws4fxq/wD7YN3ShCTrItxsN/lbgnyu1NMtJlN1DBt+RRqTSm+h > ZgxUS+qDTm7eLXVewTLOfeOHX0Lyu+hUNve63DMafxzJ+thnHwroEJFljnjoKyQN > HnJXGrQbvK5Tp/8VqFt3CFrDU5vv4//Tn8BDd1mMls8Z7qxe5Z7DWag1xqhiTV1w > aVlu8IaHMT9py/YPggCf9WL+MCff7i56PyI2xTHkQYFEtsRKLWInqFKBFkhkj2y5 > NU+son/ApKNN5IpzS9DlHVdYf19/SLhVelGumtYcp0hS9rZaJhzKuOD2VqPawAG3 > mYUWsEXcpsVi/y1F7pDVUZCbsHsK2Ic2r8W3BmWFwSqf3VNJMkJ3V6bf5eW6aXbp > sWiX4W3z9i35ejmcKElynWKTxZBUzoTWGplyQoCKaV5YTEDfuEZ+qTI/E/lkGYOS > v2rwDeWDbPZex+tDWTtU0M3ssNoQh/QmynpEVFD2RPrTKBUkR4/D4HSbHD8MoSqo > kmO2oYFEvbt3+7L3Ucrg > =RV/2 > -----END PGP SIGNATURE----- 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."