Blame VxWorks/README

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