Subject: port-macppc/33196: cannot crossbuild macppc from Solaris
To: None <port-macppc-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <gdamore@netbsd.org>
List: netbsd-bugs
Date: 04/05/2006 06:35:00
>Number: 33196
>Category: port-macppc
>Synopsis: cannot crossbuild macppc from Solaris
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-macppc-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Apr 05 06:35:00 +0000 2006
>Originator: Garrett D'Amore
>Release: -current (3.99.17)
>Organization:
Tadpole Computer, Inc.
>Environment:
build machine is Solaris, cross building latest (update as of 4/4/2006) -current.
>Description:
cross build fails due to #include <sys/endian.h> in macppc-fixcoff, which doesn't exist in a non-NetBSD cross-build environment.
>How-To-Repeat:
Try ./build.sh -m macppc tools
from a Solaris 10 machine.
>Fix:
Diffs below. I would commit it myself, but need a reviewer. Or portmaster can just make this change (or similiar) him/herself and commit as appropriate.
*** fixcoff.c.~1.9.~ Sun Dec 11 04:18:06 2005
--- fixcoff.c Tue Apr 4 23:24:03 2006
***************
*** 49,55 ****
--- 49,70 ----
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
+
+ #if HAVE_NBTOOL_CONFIG_H
+
+ #if WORDS_BIGENDIAN
+ #define htobe16(x) (x)
+ #else
+ unsigned short
+ htobe16(unsigned short x)
+ {
+ return (((x & 0xff00) >> 8) | ((x & 0xff) << 8));
+ }
+ #endif /* WORDS_BIGENDIN */
+
+ #else /* HAVE_NBTOOL_CONFIG_H */
#include <sys/endian.h>
+ #endif /* HAVE_NBTOOL_CONFIG_H */
struct filehdr {
#define U802WRMAGIC 0730