This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Hints for cross-compiling staprun?


On 2010-08-27, Grant Edwards <grant.b.edwards@gmail.com> wrote:

> How does one cross-compile staprun without dragging in all of the
> baggage required for a full-up systemtap install?

I've hit a few glitches, but I'm making progress.  One issue is that
the configure script refuses to check for the existence of files when
cross-compiling.  I'm not sure why that is, but you can short-circuit
that by setting some environment variables:

   ac_cv_file__usr_include_nspr=no
   ac_cv_file__usr_include_nspr4=no
   ac_cv_file__usr_include_nss=no
   ac_cv_file__usr_include_nss3=no
   ac_cv_file__usr_include_avahi_client=no
   ac_cv_file__usr_include_avahi_common=no

The other problem is that the sources use a number of non-standard
APIs without checking to see if they are, in fact, supported by the
build environment.  The ones that I tripped over are:

   index,rindex   obsolete and not present in POSIX.1-2008.
   
   __progname     doesn't seem to be part of any standard, and isn't
                  present in any headers on any Linux system I've got.

   wordexp        actually, I think this one is in POSIX.1-2008 -- it
                  just wasn't enabled in my build of libc.

It would result in a more graceful failure, if the configure script
checked for those.
                  
I've rebuilt my libc with support for those API's, and now the
systemtap runtime stuff compiles, but fails to install because the
systemtap's version of install-sh doesn't support the '-D' option, but
systemtap's Makefile uses that option.  ("make" output attached
below.)

If the systemtap Makefile.in is going to use "install-sh -D",
shouldn't it come with an install-sh that supports "-D"?

[...]
>>> systemtap 1.3 Installing to target
/usr/bin/make -j2 DESTDIR=/home/nextgen/buildroot/buildroot/output/target  install-strip -C /home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/
make[1]: Entering directory `/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3'
/usr/bin/make  INSTALL_PROGRAM="/bin/sh /home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh -c -s" \
	  install_sh_PROGRAM="/bin/sh /home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh -c -s" INSTALL_STRIP_FLAG=-s \
	  `test -z '/home/nextgen/toolchain/bin/arm-linux-strip' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='/home/nextgen/toolchain/bin/arm-linux-strip'"` install
make[2]: Entering directory `/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3'
/bin/sh ./git_version.sh -k -s . -o git_version.h
git_version.sh: Not a git repo, keeping existing git_version.h
/usr/bin/make  install-recursive
[...]
make[5]: Entering directory `/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3'
[...]
/usr/bin/make  install-exec-hook
make[6]: Entering directory `/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3'
if [ `id -u` -eq 0 ]; then chmod 04111 "/home/nextgen/buildroot/buildroot/output/target/usr/bin/staprun"; fi
make[6]: Leaving directory `/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3'
(cd ./runtime/unwind; find . \( -name '*.[ch]' \) -print \
		| while read f; do /usr/bin/install -c -m 644 -D $f /home/nextgen/buildroot/buildroot/output/target/usr/share/systemtap/runtime/unwind/$f; done)
(cd ./runtime/transport; for f in *.[ch]; \
		do /usr/bin/install -c -m 644 -D $f /home/nextgen/buildroot/buildroot/output/target/usr/share/systemtap/runtime/transport/$f; done)
(cd ./runtime/uprobes; for f in Makefile *.[ch]; \
		do /usr/bin/install -c -m 644 -D $f /home/nextgen/buildroot/buildroot/output/target/usr/share/systemtap/runtime/uprobes/$f; done)
(cd ./runtime/uprobes2; for f in *.[ch]; \
		do /usr/bin/install -c -m 644 -D $f /home/nextgen/buildroot/buildroot/output/target/usr/share/systemtap/runtime/uprobes2/$f; done)
(cd ./tapset; find . \( -name '*.stp' -o -name README \) -print \
		| while read f; do /usr/bin/install -c -m 644 -D $f /home/nextgen/buildroot/buildroot/output/target/usr/share/systemtap/tapset/$f; done)
(cd ./testsuite/systemtap.examples; find . -type f -print \
		| egrep -v 'check.exp|ChangeLog|examples-index-gen.pl' \
		| while read f; do if test -x $f; then \
			i_cmd="/bin/sh /home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh -c -s"; else \
			i_cmd="/usr/bin/install -c -m 644"; fi; \
			$i_cmd -D $f /home/nextgen/buildroot/buildroot/output/target/usr/share/doc/systemtap/examples/$f; done)
/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh: invalid option: -D
/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh: invalid option: -D
/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh: invalid option: -D
/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh: invalid option: -D
/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh: invalid option: -D
/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh: invalid option: -D
[ 70 identical lines deleted ]
/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh: invalid option: -D
/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh: invalid option: -D
/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh: invalid option: -D
/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh: invalid option: -D
/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/install-sh: invalid option: -D
make[5]: *** [install-data-local] Error 1
make[5]: Leaving directory `/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3'
make[4]: *** [install-am] Error 2
make[4]: Leaving directory `/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3'
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory `/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3'
make[2]: *** [install] Error 2
make[2]: Leaving directory `/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3'
make[1]: *** [install-strip] Error 2
make[1]: Leaving directory `/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3'
make: *** [/home/nextgen/buildroot/buildroot/output/build/systemtap-1.3/.stamp_target_installed] Error 2
make: Leaving directory `/home/nextgen/buildroot/buildroot'

   
-- 
Grant Edwards               grant.b.edwards        Yow! I request a weekend in
                                  at               Havana with Phil Silvers!
                              gmail.com            


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]