[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] Problem building some softwares included in Petalinux dist.




Nicolas

I've been beating my head against the wall for some time with userland
apps and libraries. Currently the only way I can get things to work is
ugly but it works so things can move forward. In the meantime, I keep
trying to find a better answer. But to try and help you at least get a
working app/lib here are my UGLY(!!) steps:

1. Get the application source tree you want but some apps require match
up to the kernel release, aka 2.6.20. A good example app needing a
match up is IPRoute2. NOTE, this does require having a system running
under the 2.6.20 release as well in some real nasty cases, aka IPRoute
again, having an old laptop around has been a very useful treat for me
on this.
2. Try using the example "makefile" below when building within the
petalinux cross-compile environment. (note the small "m"akefile)
3. But if this fails, then, using your current source system's
environment (not the Petatlinux cross-compile environment) issue the
configure command. Yes, this may require some options be disabled.
Also, pre-compile everything with the desired options prior to moving
into the petalinux environment.
4. Then using your preferred editor or sed edit the generated Makefile
contents, prefixing all gcc, ar, ranlib and ld with "mb-linux-". You
also may have to change or add include and library references. For
example, -I/root/petalinux/userland/include{s) or
-L/root/petalinux/lib/libraries. Worse yet, put includes into the paths
specifically specified by the app. (yeah the real ugly part)
5. Then add the romfs: etc etc etc stuff at the end of the Makefile.
6. Put into the user or lib directory as appropriate making sure "not"
to run make distclean or its back up to step 3 you go. Make the
necessary changes to the petalinux build files to build the new
userland/lib directories (I can send examples if needed).
7. TEST! the app within the source system (not petatlinux target
system), it should barks like "bash: ./app: cannot execute binary
file". This assures it was cross compiled.
8. Another trick is to go to maemo.org and find the app or libraries
sources there and use those. Those folks have done a great job porting
things to that embedded linux environment. For example, I'm currently
able to at least get a build openssh version now, not tested, but it
builds at least now, from the garage.maemo.org distro tree.

Some really ugly challenges are with apps like MySQL which build
programs which compiles programs to build compiletime apps. Of course
they crash because they get cross-compiled then the build process tries
executing them to build the eventual program, nasty.

I have the following userland and libraries built:,
IPRoute2(iproute2-2.6.19-061214), XML2(lib), OpenVPN, OpenSSL,
MPLS-Linux, Sofia-SIP(lib) and my own app.

If you have a specific app I will help you.

Example makefile:
CONFOPTS=

all: build/build
$(MAKE) -C build

build/build: makefile
rm -rf build
mkdir build
(cd build; ac_cv_func_setpgrp_void=yes sh ../configure
$(CONFIGURE_OPTS) $(CONFOPTS))
touch build/build

clean:
rm -rf build

romfs:
$(ROMFSINST) -e CONFIG_USER_NETPERF_CLIENT build/src/netperf
/bin/netperf
$(ROMFSINST) -e CONFIG_USER_NETPERF_SERVER build/src/netserver
/bin/netserver


...Chris

Nicolas Herve wrote:
> Hi all !
>
> After configuring the kernel with minimum software (only init and some
> basics, from busybox), I am iteratively adding some more applications
> to the target, with `make config_menuconfig`, because unfortunately
> lots of application and also libraries simply do not compile.
>
> I tried to force building of all libraries (iteratively), just to see
> what could be compiled on my system.
> Libraries I cannot compile are :
> libDES, libGMP, libldap, libnet, libPAM, libBZIP2, libATM, STLsupport,
> expat, adns, libares, libidn and curl.
> They may is kernel requirements from some builds, that I am not aware
> of ...
> I'd like to open discussion here to help in building some software.
>
> Because of this, I have desisted in installing some packages, for
> which I can do without, but there is some I really would like to install.
> One such package is the gdb server. I noticed that it is indicated
> that PTHREADS_DEBUG_SUPPORT has to be enabled for uclib but I am using
> the C libc in my configuration.
>
> From a allready compiled and tested config I simply add the "gdb
> server" in the config_menuconfig and run `make`.
> Then I have the compiling error included at end of mail.
>
> some ideas ?
>
> I have other cross compile issue for non-Petalinux dist softwares, I
> will report it in other post.
>
> Regards,
> Nicolas
>
>
> ----
>
> make[2]: Entering directory
> `/home/users/nicolas/xilinx/petalinux/software/petalinux-dist/user/gdb'
> make -C build
> make[3]: Entering directory
> `/home/users/nicolas/xilinx/petalinux/software/petalinux-dist/user/gdb/build'
> mb-linux-gcc -c -Wall -Os -g -fomit-frame-pointer -pipe -fno-common
> -fno-builtin -Wall -mno-xl-soft-mul -mcpu=v7.10.d -DEMBED
> -I/home/users/nicolas/xilinx/petalinux/software/petalinux-dist
> -I/home/users/nicolas/xilinx/petalinux/software/petalinux-dist/include
> -I/home/users/nicolas/xilinx/petalinux/software/petalinux-dist/include
> -Dlinux -D__linux__ -Dunix -DLINUX -I. -I../gdb/gdbserver
> -I../gdb/gdbserver/../regformats -I../gdb/gdbserver/../../include
> -I../../bfd -I../gdb/gdbserver/../../bfd ../gdb/gdbserver/thread-db.c
> In file included from
> /home/users/nicolas/xilinx/petalinux/tools/linux-i386/microblaze-glibc-root/bin/../microblaze-linux-elf/usr/include/thread_db.h:29,
> from ../gdb/gdbserver/thread-db.c:31:
> /home/users/nicolas/xilinx/petalinux/tools/linux-i386/microblaze-glibc-root/bin/../microblaze-linux-elf/usr/include/sys/procfs.h:76:
> error: expected specifier-qualifier-list before ‘elf_gregset_t’
> /home/users/nicolas/xilinx/petalinux/tools/linux-i386/microblaze-glibc-root/bin/../microblaze-linux-elf/usr/include/sys/procfs.h:102:
> error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
> ‘prgregset_t’
> /home/users/nicolas/xilinx/petalinux/tools/linux-i386/microblaze-glibc-root/bin/../microblaze-linux-elf/usr/include/sys/procfs.h:103:
> error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
> ‘prfpregset_t’
> In file included from ../gdb/gdbserver/thread-db.c:31:
> /home/users/nicolas/xilinx/petalinux/tools/linux-i386/microblaze-glibc-root/bin/../microblaze-linux-elf/usr/include/thread_db.h:383:
> error: expected declaration specifiers or ‘...’ before ‘prfpregset_t’
> /home/users/nicolas/xilinx/petalinux/tools/linux-i386/microblaze-glibc-root/bin/../microblaze-linux-elf/usr/include/thread_db.h:387:
> error: expected declaration specifiers or ‘...’ before ‘prgregset_t’
> /home/users/nicolas/xilinx/petalinux/tools/linux-i386/microblaze-glibc-root/bin/../microblaze-linux-elf/usr/include/thread_db.h:397:
> error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
> /home/users/nicolas/xilinx/petalinux/tools/linux-i386/microblaze-glibc-root/bin/../microblaze-linux-elf/usr/include/thread_db.h:401:
> error: expected declaration specifiers or ‘...’ before ‘prgregset_t’
> In file included from ../gdb/gdbserver/../gdb_proc_service.h:34,
> from ../gdb/gdbserver/thread-db.c:46:
> ../gdb/gdbserver/../gregset.h:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’
> or ‘__attribute__’ before ‘gdb_gregset_t’
> ../gdb/gdbserver/../gregset.h:33: error: expected ‘=’, ‘,’, ‘;’, ‘asm’
> or ‘__attribute__’ before ‘gdb_fpregset_t’
> ../gdb/gdbserver/../gregset.h:45: error: expected ‘)’ before ‘*’ token
> ../gdb/gdbserver/../gregset.h:46: error: expected ‘)’ before ‘*’ token
> ../gdb/gdbserver/../gregset.h:52: error: expected ‘)’ before ‘*’ token
> ../gdb/gdbserver/../gregset.h:53: error: expected ‘)’ before ‘*’ token
> In file included from ../gdb/gdbserver/thread-db.c:46:
> ../gdb/gdbserver/../gdb_proc_service.h:48: error: conflicting types
> for ‘lwpid_t’
> /home/users/nicolas/xilinx/petalinux/tools/linux-i386/microblaze-glibc-root/bin/../microblaze-linux-elf/usr/include/sys/procfs.h:107:
> error: previous declaration of ‘lwpid_t’ was here
> ../gdb/gdbserver/../gdb_proc_service.h:54: error: conflicting types
> for ‘psaddr_t’
> /home/users/nicolas/xilinx/petalinux/tools/linux-i386/microblaze-glibc-root/bin/../microblaze-linux-elf/usr/include/sys/procfs.h:99:
> error: previous declaration of ‘psaddr_t’ was here
> ../gdb/gdbserver/../gdb_proc_service.h:58: error: expected ‘=’, ‘,’,
> ‘;’, ‘asm’ or ‘__attribute__’ before ‘prgregset_t’
> ../gdb/gdbserver/../gdb_proc_service.h:62: error: expected ‘=’, ‘,’,
> ‘;’, ‘asm’ or ‘__attribute__’ before ‘prfpregset_t’
> ../gdb/gdbserver/../gdb_proc_service.h:76: error: expected ‘=’, ‘,’,
> ‘;’, ‘asm’ or ‘__attribute__’ before ‘gdb_prfpregset_t’
> make[3]: *** [thread-db.o] Error 1
> make[3]: Leaving directory
> `/home/users/nicolas/xilinx/petalinux/software/petalinux-dist/user/gdb/build'
>
>




Hotmail® goes with you. Get it on your BlackBerry or iPhone.