From: Christopher Key on
Hello,

I've recently been experimenting with building ports for i386 and amd64
using tinderbox on an amd64 machine. Most ports aren't architecture
specific, and just use the toolchain provided within the tinderbox jail,
blindly producing i386/amd64 binaries as appropriate. However, some
ports are architecture specific, e.g. those that have assembler
optimised routines, and they cause problems when compiling for i386 on
my amd64 machine. Generally, they detect their host environment using
uname, and get amd64 back from the kernel. They then proceeed to build,
passing amd64 code the the i386 assembler, and fail.

I'm not sure what the best solution is to this problem. The purist
approach would be to have tinderbox work harder to emulate the target
environment, and patch uname to return the appropriate answer. An
alternative solutions seems to be to try to get ports to prevent
autodetection of the architecture, and use ARCH instead. This can be
set in make.conf within the tinderbox jail, overriding the autodetection
performed by the port build system. For most ports, the should be
fairly straightforward. For example the only change needed in
qt4-corelib is [1]

Is this something that should be fixed? Do either of the above
solutions make sense? It certainly seems desirable to be able to cross
compile ports like this, both for testing and for producing packages.


Kind regards,

Christopher Key




[1]
--- devel/qt4-corelib/Makefile 2010-03-25 14:52:17.000000000 +0000
+++ devel/qt4-corelib/Makefile 2010-04-21 11:35:20.000000000 +0100
@@ -27,6 +27,7 @@

ALL_TARGET= first
CONFIGURE_ENV?= QTDIR=${WRKSRC} PATH=${WRKSRC}/bin:$$PATH
+CONFIGURE_ARGS?= -arch ${ARCH:S/amd64/x86_64/}
MAKE_ENV?= QTDIR=${WRKSRC} LD_LIBRARY_PATH=${WRKSRC}/lib \
PATH=${WRKSRC}/bin:$$PATH


_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"

From: Gabor PALI on
Hej,

On Wed, Apr 21, 2010 at 1:07 PM, Christopher Key <cjk32(a)cam.ac.uk> wrote:
> patch uname to return the appropriate answer

I do not think you will need this since answers returned by uname(1)
can be customized easily, just check its manual page to see how to do
that.

Cheers,
:g
_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"

From: Christopher Key on
> On Wed, Apr 21, 2010 at 1:07 PM, Christopher Key <cjk32 at cam.ac.uk <http://lists.freebsd.org/mailman/listinfo/freebsd-ports>> wrote:
> >/ patch uname to return the appropriate answer
/>
> I do not think you will need this since answers returned by uname(1)
> can be customized easily, just check its manual page to see how to do
> that.
> /

Thanks,

Setting ARCH, UNAME_m and UNAME_n in ${tb}/scripts/etc/env/jail.* did the trick. I wonder if tinderbox should instead be setting these values automatically based upon the arch supplied to createJail.

Chris
/

_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"

From: Gabor PALI on
On Wed, Apr 21, 2010 at 3:13 PM, Christopher Key <cjk32(a)cam.ac.uk> wrote:
> Setting ARCH, UNAME_m and UNAME_n [..] did the trick.  I wonder if tinderbox should instead be setting these values automatically [..]

Ask/request it on the Tinderbox mailing list :)

:g
_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"

From: Emanuel Haupt on
Gabor PALI <pgj(a)freebsd.org> wrote:
> On Wed, Apr 21, 2010 at 3:13 PM, Christopher Key <cjk32(a)cam.ac.uk>
> wrote:
> > Setting ARCH, UNAME_m and UNAME_n [..] did the trick.  I wonder if
> > tinderbox should instead be setting these values automatically [..]
>
> Ask/request it on the Tinderbox mailing list :)

Or even better, send patches :-)

Emanuel
_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"