On Mar 25, 2013, at 7:22 AM, Michael Richardson <m...@sandelman.ca> wrote:

>>>>>> "wen" == wen lui <esolvepol...@gmail.com> writes:
>    wen> I want to compile a `.c` file to 32-bit executable using `gcc`
>    wen> option `-m32` with libpcap the machine is linux 64bit fedora 16
> 
>    wen> how to solve this problem? thanks!
> 
> install a 32-bit libpcap.
> I don't know how to do this on Fedora, but I'm sure it is possible.

This post:

        http://forums.fedoraforum.org/showpost.php?p=1486052&postcount=2

says

        I'm far a linux guru myself, but I'll tell you how stumbled onto 
installing the 32-bit libraries. Some other distros have an obvious option to 
add it, but Fedora doesn't make it obvious. 

        Go into the GUI add/remove software app and, in the options somwhere, 
uncheck the option to only show "native packages", which will then allow the 
.i686 32-bit packages to become visible from the repos. 

        Now, search for "libc" or "glibc" (I can't remember which I used) and 
choose the 32-bit, i686 library package. That should bring in most of the 
core/base stuff. You may need some more packages after that for whatever you're 
trying to do, but that will get you started.

The original question for that post was asked about Fedora 15, but 
experimenting with my Fedora 16 with KDE seems to indicate that it applies 
there as well.  In its add/remove software app (Apper), the instruction set 
architecture for a package ("i686" for 32-bit and "x86_64" for 64-bit; your 
mileage may vary if you're not using an x86 machine) only shows up, in a 
tooltip, when you hover the mouse pointer over an item.

I didn't try installing any of the 32-bit packages (you'd need both the "user" 
and "developer" packages), but I presume that installing 32-bit versions of all 
the "core/base stuff", along with 32-bit versions of libpcap and libpcap-devel, 
should do the job.

Note, by the way, that 32-bit libpcap will *NOT* work atop a 64-bit kernel if 
your kernel version is less than 2.6.27 and greater than whatever version first 
included the memory-mapping support for PF_PACKET sockets - those kernel 
versions only have the TPACKET_V1 layout for the memory-mapped buffer, and that 
one is different in 32-bit and 64-bit kernels.  2.6.27 introduces TPACKET_V2, 
in which the layout is the same for 32-bit and 64-bit kernels, and 32-bit code 
dealing with memory-mapped PF_PACKET sockets works fine atop 32-bit or 64-bit 
kernels.
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Reply via email to