Announcement

Collapse
No announcement yet.

Building libs for uClinux (eg. libxml2)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Building libs for uClinux (eg. libxml2)

    I am trying to figure out how to build a library on the Xport Pro and thought I could start with libxml2, which his included in the Linux SDK and can be selected using menuconfig (Kconfig).
    When I attempt to build initially, I get a linker error (see below for a full output listing):
    "./.libs/libxml2.so: file not recognized: File format not recognized".

    From what I have seen in other posts, this means the library build as a shared library instead of a static one. For example, the net-snmp stuff passes in "--enable-shared=no" to the configure script.
    Provided this is correct, how do I get this to work in my setup? The automake build environment is very confusing to me..... From what I have seen, most libraries are configured using the configure script. Eg, If I am not mistaken, the user\net-snmp folder has a makefile which calls configure to generate the actual make files (in the build folder).

    For Expat a makefile which was originally produced by automake was modified and provides the building rules. Interestingly this file contains "DISABLE_SHARED_LIBS = 1" which causes the -fPIC (presumably "position independent code" to NOT be passed into the compiler).

    For libxml2 there is no (final) makefile present yet but it is generated by automake using a standard template (from /linux/tools/automake.inc). I am now trying to see if I can modify this makefile to generate a static lib....but this turns out to be quite a tricky operation....

    Any help is hugely appreciated!

    Cheers,
    Dirk


    Executing: touch testdso.la
    ucfront-gcc m68k-uclinux-gcc -mcpu=5208 -DCONFIG_COLDFIRE -DHAVE_CONFIG_H -I. -I./include -I./include -D_REENTRANT -O2 -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -DEMBED -fno-dwarf2-cfi-asm -msep-data -Dlinux -D__linux__ -Dunix -D__uClinux__ -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -MT xmllint.o -MD -MP -MF .deps/xmllint.Tpo -c -o xmllint.o xmllint.c
    In file included from libxml.h:33,
    from xmllint.c:9:
    ./include/libxml/xmlversion.h:429: warning: "ATTRIBUTE_PRINTF" redefined
    /home/lantronix/linuxsdk/linux/include/ansidecl.h:307: note: this is the location of the previous definition
    mv -f .deps/xmllint.Tpo .deps/xmllint.Po
    jlibtool --tag=CC --mode=link ucfront-gcc m68k-uclinux-gcc -mcpu=5208 -DCONFIG_COLDFIRE -O2 -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -DEMBED -fno-dwarf2-cfi-asm -msep-data -Dlinux -D__linux__ -Dunix -D__uClinux__ -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wl,-elf2flt -Wl,-move-rodata -msep-data -Wl,-elf2flt -Wl,-move-rodata -msep-data -Wl,-L/home/lantronix/linuxsdk/linux/lib -Wl,-rpath-link -Wl,/home/lantronix/linuxsdk/linux/lib -o xmllint xmllint.o ./libxml2.la -lz -lm
    ./.libs/libxml2.so: file not recognized: File format not recognized
    collect2: ld returned 1 exit status
    Sorry. Don't care about tags.
    Checking: ./.libs/libxml2.so
    Executing: /bin/sh -c 'ucfront-gcc' 'm68k-uclinux-gcc' '-mcpu=5208' '-DCONFIG_COLDFIRE' '-O2' '-g' '-fomit-frame-pointer' '-pipe' '-fno-common' '-fno-builtin' '-Wall' '-DEMBED' '-fno-dwarf2-cfi-asm' '-msep-data' '-Dlinux' '-D__linux__' '-Dunix' '-D__uClinux__' '-pedantic' '-W' '-Wformat' '-Wunused' '-Wimplicit' '-Wreturn-type' '-Wswitch' '-Wcomment' '-Wtrigraphs' '-Wformat' '-Wchar-subscripts' '-Wuninitialized' '-Wparentheses' '-Wshadow' '-Wpointer-arith' '-Wcast-align' '-Wwrite-strings' '-Waggregate-return' '-Wstrict-prototypes' '-Wmissing-prototypes' '-Wnested-externs' '-Winline' '-Wredundant-decls' '-Wl,-elf2flt' '-Wl,-move-rodata' '-msep-data' '-Wl,-elf2flt' '-Wl,-move-rodata' '-msep-data' '-Wl,-L/home/lantronix/linuxsdk/linux/lib' '-Wl,-rpath-link' '-Wl,/home/lantronix/linuxsdk/linux/lib' 'xmllint.o' '-o' 'xmllint' './.libs/libxml2.so' '-lz' '-lm'
    make[7]: *** [xmllint] Error 1
    make[7]: Leaving directory `/home/lantronix/linuxsdk/linux/lib/libxml2/build/libxml2-2.7.3'
Working...
X