README 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. libxml2 on VxWorks 6.4+
  2. Here are my instructions for building on VxWorks.... I am very ashamed of
  3. how I did this because it is a complete hack, but it works great, so I
  4. can't complain too much.
  5. General Information
  6. 1. The only way to build for VxWorks is to cross compile from a windows or
  7. linux system. We use a RedHat 5.1 workstation system as our build
  8. environment.
  9. 2. VxWorks 6.X has two main types of executable, DKMs (dynamic kernel
  10. modules), and RTPs (real-time processes). Kernel modules are the bread
  11. and butter of VxWorks, but they look nothing like processes/threads in
  12. normal UNIX/Windows systems. RTPs are more like processes that have
  13. memory protection, threads, etc. VxWorks 6.X also introduces some level
  14. of POSIX conformance to their environment. The POSIX conformance was the
  15. key for us to be able to port libxml2. We support accessing libxml2 from
  16. both DKMs and RTPs.
  17. 3. There are 2 compilers for VxWorks, the WindRiver compiler, and a port
  18. of the GNU toolchain, we have only tested and built with the GNU
  19. toolchain.
  20. How To Build
  21. 1. Run the configure on your native linux system (this is the cheesy
  22. hack). Since the VxWorks GNU toolchain is very close in version to the
  23. one in red hat, it generates a good config.h file. We configured libxml2
  24. with the following to keep the size down, (but we have done basic testing
  25. with everything compiled in).
  26. ./configure --with-minimum --with-reader --with-writer --with-regexps
  27. --with-threads --with-thread-alloc
  28. 2. Rename the libxml2 folder to "src". This step is required for our
  29. replacement makefile to work.
  30. 3. Run the replacement makefile. I wrote a new makefile that sets all the
  31. proper vxworks defines and uses the correct compilers. The two defines on
  32. the make command line are to tell it which VxWorks Target (SH3.2 little
  33. endian), and the executable type. We have tested this code on PENTIUM2gnu
  34. and SH32gnule.
  35. This makefile creates a shared library that runs on VxWorks: (libxml2.so)
  36. make -f Makefile.vxworks clean all VXCPU=SH32gnule VXTYPE=RTP
  37. This makefile creates a kernel module that runs on VxWorks: (xml2.out)
  38. make -f Makefile.vxworks clean all VXCPU=SH32gnule VXTYPE=DKM
  39. Important Notes
  40. 1. There are several ways that this process could be improved, but at the
  41. end of the day, we make products, not port libraries, so we did a meets
  42. minimum for our needs.
  43. 2. VxWorks is the devil, give me embedded linux every day.
  44. 3. No matter what I tried, I couldn't get the configure to pick up the
  45. VxWorks toolchain, and in my investigation, it has something to do with
  46. automake/autoconf, not any individual package. VxWorks doesn't play by
  47. the normal rules for building toolchains.
  48. 4. The PIC flag in VxWorks (especially for SH processors) is very
  49. important, and very troublesome. On linux, you can liberally use the PIC
  50. flag when compiling and the compiler/linker will ignore it as needed, on
  51. VxWorks if must always be on for shared libraries, and always be off for
  52. static libraries and executables.
  53. 5. If anyone wants to work on a better way to do the build of libxml2 for
  54. VxWorks, I'm happy to help as much as I can, but I'm not looking to
  55. support it myself.
  56. Attached Files
  57. 1. To use my Makefile for vxworks, you should enter the vxworks
  58. environment (/opt/windriver/wrenv.linux -p vxworks-6.4 for me).
  59. 2. Run: build.sh libxml2-2.6.32 SH32gnule RTP (where you have
  60. libxml2-2.6.32.tar.gz and the Makefile in the same directory as the script
  61. file).
  62. Thanks,
  63. Jim Wert Jr.
  64. JWert@ILSTechnology.com