tech-pkg archive

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

Re: Cross-compilation problems



A final point on this thread, for me.

Taylor R. Campbell suggested me to add:
> 2. Try setting USE_CWRAPPERS=no.
> 

Note: the 1. was fixing the conditional.

I need to set USE_CWRAPPERS=no or the compilation fails for the same
reason as before.

With USE_CWRAPPERS=no, then it succeeds when it can succeed. The
/etc/mk.conf is then this:

Note: contrary to the howto, I revert the logic: explicitely tell to
cross compile with this at the very beginning of /et/mk.conf:

USE_CROSS_COMPILE?= no

#========== XCOMPBEGIN
# (From Taylor R. Campbell Cross-compilation in pkgsrc (user's guide).)

.if ${USE_CROSS_COMPILE:M[yY][eE][sS]}

PKG_DEVELOPER=yes
X11_TYPE=native

# This is a kludge for cross-libtool.
#
CROSSBASE= ${LOCALBASE}/cross-${TARGET_ARCH:U${MACHINE_ARCH}}

USE_CWRAPPERS=no

# Can't be set on cmd line.
MACHINE_ARCH= earmv7hf

# Matrix binaries for target binaries (target not mentioned).
#
TOOLDIR= /data/m/tmp/olimex/tooldir.NetBSD-8.0-amd64
CROSS_DESTDIR= /data/m/tmp/olimex/destdir.evbarm

PACKAGES= /data/m/telegstn/${MACHINE_ARCH}
WRKDIR_BASENAME= work.${MACHINE_ARCH}

.endif

#========== XCOMPEND

with the following caveats:

cross-libtool-base depends on checkperms. But I haven't had it, so it
tried to compile it for the TARGET (while it is used on the MATRIX). So
one has to compile it natively, so that the dependency is satisfied.

This done, this time cross-libtool-base compiled.

I then switched to compile packages I needed:

sendmail: OK
	(not a surprise but a good thing for me since it allows to have
	a totally cross-compiled base OS, with my MTA of choice)

procmail: FAILED
	fails because it tries to execute a test program it compiles.

motif: FAILED
	fails because it searches natively for X11R6 (while I have on
	the target X cross-compiled by NetBSD under X11R7; making a symlink
	on the destdir doesn't help since motif doesn't look there;
	shouldn't be a lot of work to fix since the OpenGroup sources were
	clean)

samba: FAILED
	not a surprise since it depends on a lot of things
	particularily Perl which compiles a test program and tries to run it;
	typical situation where cross-compilation can't work.

So despite the work done by Taylor R. Campbell I maintain my judgement
that this is hopeless since it can't be solved downstream but has to be
solved upstream, by splitting between programs they have to run on
the host for building purposes and programs they compile for the
target and that will not obviously not run on a host they are not built
for.

The fact too that a huge number of sources depend unnecessarily of a
bunch of extra things (Perl to replace a magic string in a file because
people don't know about ed(1) or because some systems don't provide
ed(1) because it is POSIX and Gnu is Not Unix...) is no help at all.

Thanks to all that try to help.
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                     http://www.kergis.com/
                       http://www.sbfa.fr/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index