Closed vbmithr closed 11 years ago
Actually, the problem is not related at all to the implementation (or absence of) of pcap_opendev, but it is a link problem (the C .o objects are not linked to oS.cma). Trying to solve this…
Well, or it might be that utop (via the META file) do not load libunixrun.a. Not sure how is this supposed to work though…
It's normally the -cclib or -ccopt passed during compilation. I wouldn't be surprised if the cmd script gets this wrong!
Here is what happens exactly:
/usr/bin/ocamlopt.opt -a -I /usr/lib/ocaml -I /usr/lib/ocaml -I /usr/lib/ocaml/camlp4 -I /home/vb/.opam/system/lib/optcomp -I /home/vb/.opam/system/lib/ocplib-endian -I /home/vb/.opam/system/lib/ocplib-endian -I /home/vb/.opam/system/lib/cstruct -I /home/vb/.opam/system/lib/lwt -I /home/vb/.opam/system/lib/lwt -cclib -lunixrun lib/oS.cmx -o lib/oS.cmxa
cc -I/home/vb/code/mirage-platform/unix/lib -c -Wall -O3 -fPIC -I/usr/lib/ocaml -o lib/checksum_stubs.o lib/checksum_stubs.c
cc -I/home/vb/code/mirage-platform/unix/lib -c -Wall -O3 -fPIC -I/usr/lib/ocaml -o lib/tap_stubs_os.o lib/tap_stubs_os.c
/usr/bin/ocamlc.opt -a -I /usr/lib/ocaml -I /usr/lib/ocaml -I /usr/lib/ocaml/camlp4 -I /home/vb/.opam/system/lib/optcomp -I /home/vb/.opam/system/lib/ocplib-endian -I /home/vb/.opam/system/lib/ocplib-endian -I /home/vb/.opam/system/lib/cstruct -I /home/vb/.opam/system/lib/lwt -I /home/vb/.opam/system/lib/lwt lib/oS.cmo -o lib/oS.cma
/usr/bin/ocamlmklib -o lib/unixrun lib/checksum_stubs.o lib/tap_stubs_os.o
# Parallel statistics: { count(total): 4(35), max: 8, min: 2, average(total): 4.500(1.400) }
Do you want to try this under obuild and see how far you can get? The CFLAGS are large but static...
(it's ok to break NS3 for the moment; Xen and UNIX are the important ones for a first cut)
On 28 Feb 2013, at 14:43, Vincent Bernardoff notifications@github.com wrote:
Here is what happens exactly:
/usr/bin/ocamlopt.opt -a -I /usr/lib/ocaml -I /usr/lib/ocaml -I /usr/lib/ocaml/camlp4 -I /home/vb/.opam/system/lib/optcomp -I /home/vb/.opam/system/lib/ocplib-endian -I /home/vb/.opam/system/lib/ocplib-endian -I /home/vb/.opam/system/lib/cstruct -I /home/vb/.opam/system/lib/lwt -I /home/vb/.opam/system/lib/lwt -cclib -lunixrun lib/oS.cmx -o lib/oS.cmxa cc -I/home/vb/code/mirage-platform/unix/lib -c -Wall -O3 -fPIC -I/usr/lib/ocaml -o lib/checksum_stubs.o lib/checksum_stubs.c cc -I/home/vb/code/mirage-platform/unix/lib -c -Wall -O3 -fPIC -I/usr/lib/ocaml -o lib/tap_stubs_os.o lib/tap_stubs_os.c /usr/bin/ocamlc.opt -a -I /usr/lib/ocaml -I /usr/lib/ocaml -I /usr/lib/ocaml/camlp4 -I /home/vb/.opam/system/lib/optcomp -I /home/vb/.opam/system/lib/ocplib-endian -I /home/vb/.opam/system/lib/ocplib-endian -I /home/vb/.opam/system/lib/cstruct -I /home/vb/.opam/system/lib/lwt -I /home/vb/.opam/system/lib/lwt lib/oS.cmo -o lib/oS.cma /usr/bin/ocamlmklib -o lib/unixrun lib/checksum_stubs.o lib/tap_stubs_os.o
Parallel statistics: { count(total): 4(35), max: 8, min: 2, average(total): 4.500(1.400) }
— Reply to this email directly or view it on GitHub.
Just so that we keep a track of this somewhere:
And here is Haris answer:
This is something I did a while back in order to allow interfaces to open in Mac environments. It was the only way to open raw ethernet sockets in MacOSX. The equivalent action in Linux should open a raw ethernet socket using Libc (Something along this lines http://aschauf.landshut.org/fh/linux/udp_vs_raw/ch01s03.html). At the moment I haven't fixed the Linux code to work. In the case of Linux I had an ifdef function which implements an empty function for this.
It is a bit complicated to handle this case because there is a different approach on how to read packets from pcap fd in Macosx and from raw ethernet sockets in Linux. The difference is that in pcap you need to skip the pcap header. This is not the case in Linux. I can fix quickly the code if you could give me some hint on how I could detect in Ocaml the OS type.