NetBSD Problem Report #6287
Received: (qmail 5701 invoked from network); 13 Oct 1998 21:36:04 -0000
Message-Id: <199810132135.RAA02245@borg.cmf.nrl.navy.mil>
Date: Tue, 13 Oct 1998 17:35:59 -0400 (EDT)
From: Chas Williams <chas@cmf.nrl.navy.mil>
Reply-To: chas@cmf.nrl.navy.mil
To: gnats-bugs@gnats.netbsd.org
Subject: egcs for m68k needs to use different default alignment
X-Send-Pr-Version: 3.95
>Number: 6287
>Category: port-m68k
>Synopsis: egcs for m68k needs to use different default alignment
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: gnats-admin
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Oct 13 14:50:00 +0000 1998
>Closed-Date: Wed Oct 14 04:11:42 +0000 1998
>Last-Modified: Sun Feb 28 12:26:19 +0000 1999
>Originator:
>Release: 11 OCT 1998
>Organization:
Naval Research Laboratory, Washington, DC
>Environment:
thirdoffive, NetBSD 1.3H
>Description:
egcs fails to compile some source files on the mac68k/m68k platform.
for example when building ifconfig.c, it aborts will the following
error:
% make
cc -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror -c ifconfig.c
cc1: warnings being treated as errors
ifconfig.c:118: warning: alignment of `addreq' is greater than maximum object file alignment. Using 2.
*** Error code 1
apparently egcs can align on 16 bit and 32 bit boundaries while
old gcc could only align on 32 bit boundaries. the default appears
to be 16 bit for egcs.
from m68k.h in dist/gcc/config/m68k:
/* No data type wants to be aligned rounder than this.
Most published ABIs say that ints should be aligned on 16 bit
boundaries, but cpus with 32 bit busses get better performance
aligned on 32 bit boundaries. Coldfires without a misalignment
module require 32 bit alignment. */
#define BIGGEST_ALIGNMENT (TARGET_ALIGN_INT ? 32 : 16)
apparently the abi for netbsd is 32 bit.
>How-To-Repeat:
try building ifconfig.c on a m68k using egcs.
>Fix:
change the default to be -malign-int by modifying
/usr/src/gnu/dist/gcc/config/m68k/netbsd.h as follows:
--- netbsd.h.000 Tue Oct 13 14:20:01 1998
+++ netbsd.h Tue Oct 13 14:20:03 1998
@@ -4,7 +4,7 @@
#include <netbsd.h>
-#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020)
+#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020|TARGET_ALIGN_INT)
/* Define __HAVE_68881__ in preprocessor, unless -msoft-float is specified.
This will control the use of inline 68881 insns in certain macros. */
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: scottr
State-Changed-When: Tue Oct 13 21:11:42 PDT 1998
State-Changed-Why:
In PR 6288, originator notes that the patch is incorrect.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.