NetBSD Problem Report #48823
From www@NetBSD.org Tue May 20 10:48:43 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id BEF5FA64F0
for <gnats-bugs@gnats.NetBSD.org>; Tue, 20 May 2014 10:48:42 +0000 (UTC)
Message-Id: <20140520104841.BD4ACA64F3@mollari.NetBSD.org>
Date: Tue, 20 May 2014 10:48:41 +0000 (UTC)
From: netbsd@i3enedek.neomailbox.net
Reply-To: netbsd@i3enedek.neomailbox.net
To: gnats-bugs@NetBSD.org
Subject: building xtrs on big endian arch's fails; requires var to be set
X-Send-Pr-Version: www-1.0
>Number: 48823
>Category: pkg
>Synopsis: building xtrs on big endian arch's fails; requires var to be set
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue May 20 10:50:00 +0000 2014
>Closed-Date: Wed May 21 14:08:38 +0000 2014
>Last-Modified: Wed May 21 14:08:38 +0000 2014
>Originator: Ben Gergely
>Release: current Tue May 20 10:42:50 UTC 2014
>Organization:
>Environment:
NetBSD Spackintosh 6.99.41 NetBSD 6.99.41 (PISMO) #2: Fri May 16 03:17:59 UTC 2014 root@Spackintosh:/usr/src/sys/arch/macppc/compile/PISMO macppc
>Description:
When building on a big endian arch the package builds/installs fine but the user is greeted with: xtrs fatal error: Program compiled with wrong ENDIAN value -- adjust the Makefile.local, type "rm *.o", recompile, and try again.
>How-To-Repeat:
cd /usr/pkgsrc/emulators/xtrs ; make ; ./work/xtrs-4.9d/xtrs
>Fix:
$NetBSD$: Makefile.local
--- Makefile.local 2014-05-20 09:45:37.000000000 +0000
+++ /tmp/Makefile.local
@@ -7,7 +7,9 @@
# if the processor has big-endian byte ordering. If you're not sure what
# to do, don't worry -- the program will complain if it's not right.
-# ENDIAN = -Dbig_endian
+.if (${MACHINE_ARCH} == powerpc) || (${MACHINE_ARCH} == sparc)
+ ENDIAN = -Dbig_endian
+.endif
# If you would like the TRS-80 ROM to be built into the application,
# use the following lines (with the appropriate file names). You can
>Release-Note:
>Audit-Trail:
From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/48823 CVS commit: pkgsrc/emulators/xtrs
Date: Tue, 20 May 2014 12:38:25 +0000
Module Name: pkgsrc
Committed By: obache
Date: Tue May 20 12:38:25 UTC 2014
Modified Files:
pkgsrc/emulators/xtrs: Makefile
Log Message:
Set big_endian flag for the case MACHINE_ENDIAN=big.
Fixes big-endian runtime failure, PR pkg/48823.
Bump PKGREVISION.
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 pkgsrc/emulators/xtrs/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->feedback
State-Changed-By: obache@NetBSD.org
State-Changed-When: Tue, 20 May 2014 12:43:38 +0000
State-Changed-Why:
Fixes should be committed. Please confirm it and feedback.
From: Benedek Gergely <i3enedek@neomailbox.net>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/48823 (building xtrs on big endian arch's fails; requires
var to be set)
Date: Tue, 20 May 2014 15:39:48 +0000
It does not work:
===> Building for xtrs-4.9dnb3
gcc -O2 -I/usr/pkg/include -I/usr/include -I/usr/X11R7/include
-DDEFAULT_ROM='"/usr/pkg/lib/xtrs/level2rom.hex"'
-DDEFAULT_ROM3='"/usr/pkg/lib/xtrs/romimage.m3"'
-DDEFAULT_ROM4P='"/usr/pkg/lib/xtrs/romimage.m4p"' -DREADLINE
-DDISKDIR='"."' -DAPPDEFAULTS='"/usr/pkg/lib/X11/app-defaults"'
-DKBWAIT -I/usr/pkg/include -I/usr/include -I/usr/X11R7/include -c z80.c
/usr/pkgsrc/mk/endian.mk needs a poke:
--- ./endian.mk 2014-05-20 15:26:52.000000000 +0000
+++ /root/endian.mk
@@ -32,13 +32,11 @@ MACHINE_ENDIAN!= \
${ECHO} "\# include <standards.h>"; \
${ECHO} "\#endif"; \
${ECHO} "\#include <${_ENDIAN_H}>"; \
- ${ECHO} "\#ifndef BYTE_ORDER"; \
- ${ECHO} "\#ifdef _BIG_ENDIAN"; \
+ ${ECHO} "\#if BYTE_ORDER == BIG_ENDIAN"; \
${ECHO} "\#define BYTE_ORDER 4321"; \
${ECHO} "\#else"; \
${ECHO} "\#define BYTE_ORDER 1234"; \
${ECHO} "\#endif"; \
- ${ECHO} "\#endif"; \
${ECHO} "BYTE_ORDER"; } | ${CCPATH:U${CC}} -E - | \
{ while read line; do \
case $$line in \
Then it works:
===> Building for xtrs-4.9dnb3
gcc -O2 -I/usr/pkg/include -I/usr/include -I/usr/X11R7/include
-Dbig_endian -DDEFAULT_ROM='"/usr/pkg/lib/xtrs/level2rom.hex"'
-DDEFAULT_ROM3='"/usr/pkg/lib/xtrs/romimage.m3"'
-DDEFAULT_ROM4P='"/usr/pkg/lib/xtrs/romimage.m4p"' -DREADLINE
-DDISKDIR='"."' -DAPPDEFAULTS='"/usr/pkg/lib/X11/app-defaults"'
-DKBWAIT -I/usr/pkg/include -I/usr/include -I/usr/X11R7/include -c z80.c
From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/48823 CVS commit: pkgsrc/mk
Date: Wed, 21 May 2014 01:43:50 +0000
Module Name: pkgsrc
Committed By: obache
Date: Wed May 21 01:43:50 UTC 2014
Modified Files:
pkgsrc/mk: endian.mk
Log Message:
Fixes system endian header detection.
PR pkg/48823
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 pkgsrc/mk/endian.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "OBATA Akio" <obata@lins.jp>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/48823 (building xtrs on big endian arch's fails; requires var
to be set)
Date: Wed, 21 May 2014 10:55:11 +0900
endian.h detection in mk/endian.mk was being broken over a half year,
and always fail-back to little-endian.
It should be fixed now, please confirm again.
--
OBATA Akio / obata@lins.jp
From: Benedek Gergely <i3enedek@neomailbox.net>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/48823 (building xtrs on big endian arch's fails; requires
var to be set)
Date: Wed, 21 May 2014 13:58:30 +0000
Verified; Fixed.
Cheers,
State-Changed-From-To: feedback->closed
State-Changed-By: obache@NetBSD.org
State-Changed-When: Wed, 21 May 2014 14:08:38 +0000
State-Changed-Why:
Confirmed fixed. Thanks!
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.