Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Packet filter compilation in Momentics: (7 Items)
   
Packet filter compilation in Momentics  
Hi,

I had compile the lsm packet filter code in QNX momentics,compilation is successful but while linking the following are 
the  errors 

ake[2]: Entering directory `D:/Paticla/Compilation_check/lsm/x86/dll'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `D:/Paticla/Compilation_check/lsm/x86/dll'
C:/QNX641/host/win32/x86/usr/bin/make -j 1 -Co -fMakefile all  
make[2]: Entering directory `D:/Paticla/Compilation_check/lsm/x86/o'
C:/QNX641/host/win32/x86/usr/bin/qcc -Vgcc_ntox86 -c -Wc,-Wall -Wc,-Wno-parentheses  -O          -DNDEBUG   -I. -ID:/
Paticla/Compilation_check/lsm/x86/o -ID:/Paticla/Compilation_check/lsm/x86 -ID:/Paticla/Compilation_check/lsm -IC:/
QNX641/target/qnx6/usr/include     -DBUILDENV_qss  D:/Paticla/Compilation_check/lsm/packfil.c 
C:/QNX641/host/win32/x86/usr/bin/rm -f  D:/Paticla/Compilation_check/lsm/x86/o/lsm
C:/QNX641/host/win32/x86/usr/bin/qcc -Vgcc_ntox86     -oD:/Paticla/Compilation_check/lsm/x86/o/lsm    lsm.o    packfil.o
   -L . -L C:/QNX641/target/qnx6/x86/lib -L C:/QNX641/target/qnx6/x86/usr/lib  -Wl,--rpath-link . -Wl,--rpath-link C:/
QNX641/target/qnx6/x86/lib -Wl,--rpath-link C:/QNX641/target/qnx6/x86/usr/lib      
packfil.o: In function `pfil_entry':
packfil.c:(.text+0x264): undefined reference to `pfil_head_get'
packfil.c:(.text+0x28e): undefined reference to `pfil_add_hook'
packfil.c:(.text+0x2ae): undefined reference to `pfil_add_hook'
make[2]: Leaving directory `D:/Paticla/Compilation_check/lsm/x86/o'
packfil.c:(.text+0x2c2): undefined reference to `pfil_head_get'
C:/QNX641/host/win32/x86/usr/bin/make -j 1 -Co-g -fMakefile all
packfil.c:(.text+0x2e8): undefined reference to `pfil_add_hook'
packfil.c:(.text+0x308): undefined reference to `pfil_add_hook'
packfil.o: In function `iface_hook':
packfil.c:(.text+0x416): undefined reference to `pfil_head_get'
packfil.c:(.text+0x440): undefined reference to `pfil_remove_hook'
packfil.c:(.text+0x460): undefined reference to `pfil_remove_hook'
packfil.c:(.text+0x474): undefined reference to `pfil_head_get'
packfil.c:(.text+0x49a): undefined reference to `pfil_remove_hook'
packfil.c:(.text+0x4ba): undefined reference to `pfil_remove_hook'
cc: C:/QNX641/host/win32/x86/usr/bin/ntox86-ld caught signal 1
make[2]: *** [D:/Paticla/Compilation_check/lsm/x86/o/lsm] Error 1
make[2]: Target `all' not remade because of errors.


Please help me on this...

Thanks and Regards
K.Senthil
Re: Packet filter compilation in Momentics  
On Mon, Nov 16, 2009 at 12:01:50PM -0500, Senthil K wrote:
> Hi,
> 
> I had compile the lsm packet filter code in QNX momentics,compilation is successful but while linking the following 
are the  errors 
> 
> ake[2]: Entering directory `D:/Paticla/Compilation_check/lsm/x86/dll'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `D:/Paticla/Compilation_check/lsm/x86/dll'
> C:/QNX641/host/win32/x86/usr/bin/make -j 1 -Co -fMakefile all  
> make[2]: Entering directory `D:/Paticla/Compilation_check/lsm/x86/o'
> C:/QNX641/host/win32/x86/usr/bin/qcc -Vgcc_ntox86 -c -Wc,-Wall -Wc,-Wno-parentheses  -O          -DNDEBUG   -I. -ID:/
Paticla/Compilation_check/lsm/x86/o -ID:/Paticla/Compilation_check/lsm/x86 -ID:/Paticla/Compilation_check/lsm -IC:/
QNX641/target/qnx6/usr/include     -DBUILDENV_qss  D:/Paticla/Compilation_check/lsm/packfil.c 
> C:/QNX641/host/win32/x86/usr/bin/rm -f  D:/Paticla/Compilation_check/lsm/x86/o/lsm
> C:/QNX641/host/win32/x86/usr/bin/qcc -Vgcc_ntox86     -oD:/Paticla/Compilation_check/lsm/x86/o/lsm    lsm.o    packfil
.o   -L . -L C:/QNX641/target/qnx6/x86/lib -L C:/QNX641/target/qnx6/x86/usr/lib  -Wl,--rpath-link . -Wl,--rpath-link C:/
QNX641/target/qnx6/x86/lib -Wl,--rpath-link C:/QNX641/target/qnx6/x86/usr/lib      
> packfil.o: In function `pfil_entry':
> packfil.c:(.text+0x264): undefined reference to `pfil_head_get'

This is probably fine.  These will be resolved in
io-pkt itself.  Our drivers and lsms have the
following in their Makefile to suppress these.

LDFLAGS+=-Wl,--allow-shlib-undefined

-seanb
Re: Packet filter compilation in Momentics  
Hi,

where i have  to add,there are common.mk file and make file.

Thanks and Regards
K.Senthil
Re: Packet filter compilation in Momentics  
AFAIK packfil.c is not QNX supported code so I have no idea what you're 
trying to do. But those symbols are in the stack. Did you want to build 
a dll or link your code in statically?

I see below that your x86/dll build is either not happening, or has 
happened successfully before. Note: With a dll you'll leave those 
symbols to resolve with the stack at load. You'll need to build with 
shared library options (see also Sean's post...).

As it is, looks like your x86/o build is trying to link a final 
executable "lsm" and is failing because it would need to link with the 
stack.

Hope this helps!
/P

Senthil K wrote:
> Hi,
>
> I had compile the lsm packet filter code in QNX momentics,compilation is successful but while linking the following 
are the  errors 
>
> ake[2]: Entering directory `D:/Paticla/Compilation_check/lsm/x86/dll'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `D:/Paticla/Compilation_check/lsm/x86/dll'
> C:/QNX641/host/win32/x86/usr/bin/make -j 1 -Co -fMakefile all  
> make[2]: Entering directory `D:/Paticla/Compilation_check/lsm/x86/o'
> C:/QNX641/host/win32/x86/usr/bin/qcc -Vgcc_ntox86 -c -Wc,-Wall -Wc,-Wno-parentheses  -O          -DNDEBUG   -I. -ID:/
Paticla/Compilation_check/lsm/x86/o -ID:/Paticla/Compilation_check/lsm/x86 -ID:/Paticla/Compilation_check/lsm -IC:/
QNX641/target/qnx6/usr/include     -DBUILDENV_qss  D:/Paticla/Compilation_check/lsm/packfil.c 
> C:/QNX641/host/win32/x86/usr/bin/rm -f  D:/Paticla/Compilation_check/lsm/x86/o/lsm
> C:/QNX641/host/win32/x86/usr/bin/qcc -Vgcc_ntox86     -oD:/Paticla/Compilation_check/lsm/x86/o/lsm    lsm.o    packfil
.o   -L . -L C:/QNX641/target/qnx6/x86/lib -L C:/QNX641/target/qnx6/x86/usr/lib  -Wl,--rpath-link . -Wl,--rpath-link C:/
QNX641/target/qnx6/x86/lib -Wl,--rpath-link C:/QNX641/target/qnx6/x86/usr/lib      
> packfil.o: In function `pfil_entry':
> packfil.c:(.text+0x264): undefined reference to `pfil_head_get'
> packfil.c:(.text+0x28e): undefined reference to `pfil_add_hook'
> packfil.c:(.text+0x2ae): undefined reference to `pfil_add_hook'
> make[2]: Leaving directory `D:/Paticla/Compilation_check/lsm/x86/o'
> packfil.c:(.text+0x2c2): undefined reference to `pfil_head_get'
> C:/QNX641/host/win32/x86/usr/bin/make -j 1 -Co-g -fMakefile all
> packfil.c:(.text+0x2e8): undefined reference to `pfil_add_hook'
> packfil.c:(.text+0x308): undefined reference to `pfil_add_hook'
> packfil.o: In function `iface_hook':
> packfil.c:(.text+0x416): undefined reference to `pfil_head_get'
> packfil.c:(.text+0x440): undefined reference to `pfil_remove_hook'
> packfil.c:(.text+0x460): undefined reference to `pfil_remove_hook'
> packfil.c:(.text+0x474): undefined reference to `pfil_head_get'
> packfil.c:(.text+0x49a): undefined reference to `pfil_remove_hook'
> packfil.c:(.text+0x4ba): undefined reference to `pfil_remove_hook'
> cc: C:/QNX641/host/win32/x86/usr/bin/ntox86-ld caught signal 1
> make[2]: *** [D:/Paticla/Compilation_check/lsm/x86/o/lsm] Error 1
> make[2]: Target `all' not remade because of errors.
>
>
> Please help me on this...
>
> Thanks and Regards
> K.Senthil
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post42027
>
>   
Re: Packet filter compilation in Momentics  
Hi,

Now i tried in QNX host machine,instead of momentics here also same problem.
I added "LDFLAGS+=-Wl,--allow-shlib-undefined" in .qnx_internal.mk file but still i m getting.

make -j 1 -Co -fMakefile
make[2]: Entering directory `/home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o'
/usr/qnx641/host/qnx6/x86/usr/bin/qcc -Vgcc_ntox86 -c -Wc,-Wall -Wc,-Wno-parentheses  -O          -DNDEBUG   -I. -I/home
/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o -I/home/senthil/QNX_6.4.1/sys/cpss-packfil/x86 -I/home/senthil/QNX_6.4.1/sys/
cpss-packfil -I/usr/qnx641/target/qnx6/usr/include/io-pkt -I/usr/qnx641/target/qnx6/usr/include     -DBUILDENV_qss  /
home/senthil/QNX_6.4.1/sys/cpss-packfil/packfil.c
/bin/rm -f  /home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o/cpss-packfil
/usr/qnx641/host/qnx6/x86/usr/bin/qcc -Vgcc_ntox86     -o/home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o/cpss-packfil    
packfil.o   -L . -L /usr/qnx641/target/qnx6/x86/lib -L /usr/qnx641/target/qnx6/x86/usr/lib  -Wl,--rpath-link . -Wl,--
rpath-link /usr/qnx641/target/qnx6/x86/lib -Wl,--rpath-link /usr/qnx641/target/qnx6/x86/usr/lib
/usr/qnx641/target/qnx6/x86/lib/crt1.o:(.text+0x4): undefined reference to `main'
/usr/qnx641/target/qnx6/x86/lib/crt1.o: In function `_start':
(.text+0x86): undefined reference to `main'
packfil.o: In function `packetFilterEntry':
packfil.c:(.text+0xa): undefined reference to `eth_input_pfil_hook'
packfil.c:(.text+0x26): undefined reference to `pfil_add_hook'
packfil.o: In function `receivePacketHandler':
packfil.c:(.text+0x138): undefined reference to `stk_ctl'
packfil.c:(.text+0x14a): undefined reference to `m_free_wtp'
packfil.c:(.text+0x176): undefined reference to `stk_ctl'
packfil.c:(.text+0x188): undefined reference to `m_free_wtp'
cc: /usr/qnx641/host/qnx6/x86/usr/bin/ntox86-ld error 1
make[2]: *** [/home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o/cpss-packfil] Error 1
make[2]: Leaving directory `/home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/senthil/QNX_6.4.1/sys/cpss-packfil/x86'
make: *** [all] Error 2


Please help me.

Thanks and Regards
K.Senthil
Re: Packet filter compilation in Momentics  
On Tue, Nov 17, 2009 at 02:02:50AM -0500, Senthil K wrote:
> Hi,
> 
> Now i tried in QNX host machine,instead of momentics here also same problem.
> I added "LDFLAGS+=-Wl,--allow-shlib-undefined" in .qnx_internal.mk file but still i m getting.
> 
> make -j 1 -Co -fMakefile
> make[2]: Entering directory `/home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o'
> /usr/qnx641/host/qnx6/x86/usr/bin/qcc -Vgcc_ntox86 -c -Wc,-Wall -Wc,-Wno-parentheses  -O          -DNDEBUG   -I. -I/
home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o -I/home/senthil/QNX_6.4.1/sys/cpss-packfil/x86 -I/home/senthil/QNX_6.4.1/
sys/cpss-packfil -I/usr/qnx641/target/qnx6/usr/include/io-pkt -I/usr/qnx641/target/qnx6/usr/include     -DBUILDENV_qss  
/home/senthil/QNX_6.4.1/sys/cpss-packfil/packfil.c
> /bin/rm -f  /home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o/cpss-packfil
> /usr/qnx641/host/qnx6/x86/usr/bin/qcc -Vgcc_ntox86     -o/home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o/cpss-packfil  
  packfil.o   -L . -L /usr/qnx641/target/qnx6/x86/lib -L /usr/qnx641/target/qnx6/x86/usr/lib  -Wl,--rpath-link . -Wl,--
rpath-link /usr/qnx641/target/qnx6/x86/lib -Wl,--rpath-link /usr/qnx641/target/qnx6/x86/usr/lib
> /usr/qnx641/target/qnx6/x86/lib/crt1.o:(.text+0x4): undefined reference to `main'
> /usr/qnx641/target/qnx6/x86/lib/crt1.o: In function `_start':
> (.text+0x86): undefined reference to `main'
> packfil.o: In function `packetFilterEntry':
> packfil.c:(.text+0xa): undefined reference to `eth_input_pfil_hook'
> packfil.c:(.text+0x26): undefined reference to `pfil_add_hook'
> packfil.o: In function `receivePacketHandler':
> packfil.c:(.text+0x138): undefined reference to `stk_ctl'
> packfil.c:(.text+0x14a): undefined reference to `m_free_wtp'
> packfil.c:(.text+0x176): undefined reference to `stk_ctl'
> packfil.c:(.text+0x188): undefined reference to `m_free_wtp'

That option isn't being passed to your link so it wasn't
added to the correct spot.

They're just warnings so you can ignore them.

-seanb
Re: Packet filter compilation in Momentics  
On Tue, Nov 17, 2009 at 02:02:50AM -0500, Senthil K wrote:
> Hi,
> 
> Now i tried in QNX host machine,instead of momentics here also same problem.
> I added "LDFLAGS+=-Wl,--allow-shlib-undefined" in .qnx_internal.mk file but still i m getting.
> 
> make -j 1 -Co -fMakefile
> make[2]: Entering directory `/home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o'
> /usr/qnx641/host/qnx6/x86/usr/bin/qcc -Vgcc_ntox86 -c -Wc,-Wall -Wc,-Wno-parentheses  -O          -DNDEBUG   -I. -I/
home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o -I/home/senthil/QNX_6.4.1/sys/cpss-packfil/x86 -I/home/senthil/QNX_6.4.1/
sys/cpss-packfil -I/usr/qnx641/target/qnx6/usr/include/io-pkt -I/usr/qnx641/target/qnx6/usr/include     -DBUILDENV_qss  
/home/senthil/QNX_6.4.1/sys/cpss-packfil/packfil.c
> /bin/rm -f  /home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o/cpss-packfil
> /usr/qnx641/host/qnx6/x86/usr/bin/qcc -Vgcc_ntox86     -o/home/senthil/QNX_6.4.1/sys/cpss-packfil/x86/o/cpss-packfil  
  packfil.o   -L . -L /usr/qnx641/target/qnx6/x86/lib -L /usr/qnx641/target/qnx6/x86/usr/lib  -Wl,--rpath-link . -Wl,--
rpath-link /usr/qnx641/target/qnx6/x86/lib -Wl,--rpath-link /usr/qnx641/target/qnx6/x86/usr/lib
> /usr/qnx641/target/qnx6/x86/lib/crt1.o:(.text+0x4): undefined reference to `main'
> /usr/qnx641/target/qnx6/x86/lib/crt1.o: In function `_start':
> (.text+0x86): undefined reference to `main'
> packfil.o: In function `packetFilterEntry':
> packfil.c:(.text+0xa): undefined reference to `eth_input_pfil_hook'
> packfil.c:(.text+0x26): undefined reference to `pfil_add_hook'
> packfil.o: In function `receivePacketHandler':
> packfil.c:(.text+0x138): undefined reference to `stk_ctl'
> packfil.c:(.text+0x14a): undefined reference to `m_free_wtp'
> packfil.c:(.text+0x176): undefined reference to `stk_ctl'
> packfil.c:(.text+0x188): undefined reference to `m_free_wtp'

I just noticed you're now making an x86/o variant.  At the
start of this thread it was a dll which  is what it should
be for a lsm.  In the dll case the references beginning at
eth_input_pfil_hook above are resolved in io-pkt itself.

-seanb