Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Nov 2014 11:15:18 -0800
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Nagesh Akula <Nagesh.Akula@Emulex.Com>
Cc:        "freebsd-drivers@freebsd.org" <freebsd-drivers@freebsd.org>
Subject:   Re: ZLIB FreeBSD 9.1 version + deflateInit_ Symbol not found
Message-ID:  <20141103191517.GE8852@funkthat.com>
In-Reply-To: <383FAC81A1B4D54E8BF7C31A699555FF11DE48DA@CMEXMB1.ad.emulex.com>
References:  <383FAC81A1B4D54E8BF7C31A699555FF11DE48DA@CMEXMB1.ad.emulex.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <net/zlib.h> 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."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141103191517.GE8852>