Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jan 1999 15:04:30 +0900
From:      Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To:        freebsd-alpha@FreeBSD.ORG
Subject:   fix for unaligned access
Message-ID:  <19990113150430Q.simokawa@sat.t.u-tokyo.ac.jp>

next in thread | raw e-mail | index | archive | help
Here is a fix for mail and traceroute not to do unaligned access.
A fix for mail is obtained from NetBSD and that I posted before, but
it has not been commited yet.

Can I commit these two patch before branch?

/\ Hidetoshi Shimokawa
\/  simokawa@sat.t.u-tokyo.ac.jp
PGP public key: finger -l simokawa@sat.t.u-tokyo.ac.jp


Index: usr.bin/mail/strings.c
===================================================================
RCS file: /pub/FreeBSD-CVS/src/usr.bin/mail/strings.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 strings.c
--- strings.c	1994/05/27 12:32:07	1.1.1.1
+++ strings.c	1998/11/29 06:41:14
@@ -64,8 +64,8 @@
 	int index;
 
 	s = size;
-	s += 3;
-	s &= ~03;
+	s += (sizeof (char *) - 1);
+	s &= ~(sizeof (char *) - 1);
 	index = 0;
 	for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) {
 		if (sp->s_topFree == NOSTR && (STRINGSIZE << index) >= s)
Index: usr.sbin/traceroute/Makefile
===================================================================
RCS file: /pub/FreeBSD-CVS/src/usr.sbin/traceroute/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- Makefile	1998/09/19 22:42:13	1.9
+++ Makefile	1999/01/13 05:58:10
@@ -14,6 +14,12 @@
 CLEANFILES+=	version.c
 
 TRACEROUTE_DISTDIR?= ${.CURDIR}/../../contrib/traceroute
+
+.if ${MACHINE_ARCH} == "alpha"
+# gcc builtin memcpy causes unaligned access
+CFLAGS+=	-fno-builtin
+.endif
+
 CFLAGS+=	-I${TRACEROUTE_DISTDIR}/lbl
 .PATH:	${TRACEROUTE_DISTDIR}
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990113150430Q.simokawa>