Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Nov 2014 08:32:09 +0000
From:      Nagesh Akula <Nagesh.Akula@Emulex.Com>
To:        John-Mark Gurney <jmg@funkthat.com>
Cc:        "freebsd-drivers@freebsd.org" <freebsd-drivers@freebsd.org>
Subject:   RE: ZLIB FreeBSD 9.1 version + deflateInit_ Symbol not found
Message-ID:  <383FAC81A1B4D54E8BF7C31A699555FF11DE4A2B@CMEXMB1.ad.emulex.com>
In-Reply-To: <20141103191517.GE8852@funkthat.com>
References:  <383FAC81A1B4D54E8BF7C31A699555FF11DE48DA@CMEXMB1.ad.emulex.com> <20141103191517.GE8852@funkthat.com>

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



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