Brian,

Including "linux/kernel.h" header solves my sprintf/vsprintf problem and
that's great -- THANKS!

Note however that the "multiple definition" problem that occurs when I try
to build 2 of my drivers into streams.a remains unresolved. I can summarize
this problem as follows:

1. I have a kernel space library called libcmn.a and one of the functions
listed in this library is cmn_func().
2. There are references to cmn_func() from multiple drivers; therefore, I
link libcmn.a with each driver at compile/link time.
3. I create appropriate /usr/src/LiS/pkg subdirectories for my drivers
(e.g., one, two).
4. I copy Config, Makefile, driver.o files under appropriate subdirectories.
5. I invoke 'make install' under /usr/src/LiS and that's when I get the
following complaints:

make[2]: Entering directory '/usr/src/LiS-2.16/pkg'
ld -r -o drivers.o */*.o
one/streams-one.o: In function 'cmn_func':
one/streams-one.o(.text+0x1439c): multiple definition of 'cmn_func'
two/streams-two.o(.text+0x19b4c): first defined here

... (similar complaints for other common functions follow)

I'd think the LiS framework would allow multiple drivers to share functions
defined in a common library. Can you pls confirm whether this is really the
case? And if so, what could possibly be causing my "multiple definition"
complaints? Thanks,

Gurol

-----Original Message-----
From: Brian F. G. Bidulock [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 02, 2003 9:54 AM
To: Gurol Akman
Cc: '[EMAIL PROTECTED]'
Subject: Re: [Linux-streams] dynamically loadable drivers


Gurol,

Ok.  Just checking.

On Mon, 01 Sep 2003, Gurol Akman wrote:

> Brian,
> 
> I have gcc 2.95.4, make 3.79.1, binutils 2.12.90.0.1, util-linux 2.11n,
> modutils 2.4.15. So, I should be OK.
> 
> Do you have any thoughts on the 2nd part of my e-mail? Thanks,
> 
> Gurol
> 
> -----Original Message-----
> From: Brian F. G. Bidulock [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 01, 2003 7:10 PM
> To: Gurol Akman
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: [Linux-streams] dynamically loadable drivers
> 
> 
> Gurol,
> 
> On Mon, 01 Sep 2003, Gurol Akman wrote:
> 
> > my attempts to use 'insmod' i.s.o. 'modprobe' also fail. 'insmod -f'
> doesn't
> > help either... i know that i update my kernel image from 2.2.20 to
2.4.20
> 
> Stop right there.  You upgraded a kernel on a 2.2 system to 2.4.20?  You
> need gcc 2.95.3, make 3.77, binutils 2.9.1.0.25, util-linux 2.10o, and
> -- perhaps most important to your situation -- modutils 2.4.2.  An old
> modutils would never load the newer module.
> 
> Did you upgraed your tool chain as described in
> linux-2.4/Documentation/Changes?
> 
> --brian
> 
> 
> > properly and boot from the new image but perhaps i need to do additional
> > things re: header files, etc. i'll check the debian forum re: kernel
> > upgrades. so let's put this problem on hold for the moment.
> > 
> > to be able to continue my work for now, i switched from 'loadable' to
> > 'linked in' drivers and was able to install my streams-xyz driver w/o
any
> > problems. but then i hit on another problem as follows...
> > 
> > i have an internal library (e.g., libcmn.a) which contains a set of
> > kernel-space functions. since these functions are used by many of my
> > drivers, i link all my drivers with this library at compile/link time.
if
> i
> > try to configure 2 of my drivers (i.e., streams-abc, streams-xyz) as
> linked
> > in drivers (i.e., by creating the appropriate /usr/src/LiS/pkg
> > sub-directories and Config, Makefile, driver.o files), and do a 'make
> > install' i run into multiple definition problems re: some functions
listed
> > in the libcmn.a library. i also get additional complaints re: multiple
> > definition of vsprintf and sprintf functions. as a result, i'm unable to
> get
> > my 2 drivers installed at the same time. 
> > 
> > 1. how can resolve multiple definition problems caused by libcmn.a
> routines?
> > 
> > 2. what causes sprintf/vsprintf multiple definition problems & how can i
> > alleviate them?

sprintf and vsprintf already exist in the kernel.

#include <linux/kernel.h>

--brian

-- 
Brian F. G. Bidulock    � The reasonable man adapts himself to the �
[EMAIL PROTECTED]    � world; the unreasonable one persists in  �
http://www.openss7.org/ � trying  to adapt the  world  to himself. �
                        � Therefore  all  progress  depends on the �
                        � unreasonable man. -- George Bernard Shaw �

_______________________________________________
Linux-streams mailing list
[EMAIL PROTECTED]
http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams

Reply via email to