NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/45098: Cross build on Mac OS X 10.7.0 fails



>Number:         45098
>Category:       toolchain
>Synopsis:       Cross build on Mac OS X 10.7.0 fails
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 23 15:45:00 +0000 2011
>Originator:     Paul Ripke
>Release:        Darwin 10.7.0
>Organization:
Paul Ripke
I love deadlines. I like the whooshing sound they make as they fly by.
-- Douglas Adams
>Environment:
Darwin stix-macbookair.local 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 29 
15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386
Host compiler is:
bash$ gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~13/src/configure 
--disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 
--mandir=/share/man --enable-languages=c,objc,c++,obj-c++ 
--program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ 
--with-slibdir=/usr/lib --build=i686-apple-darwin10 
--enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~13/dst-llvmCore/Developer/usr/local
 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 
--target=i686-apple-darwin10 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)

Architecture: i386
Machine: i386
>Description:
Attempting to cross-build a NetBSD release (i386 at least, probably any target),
results in a SEGV running the toolchain lint1. Debugging, this is due to the
union assignment in:

src/usr.bin/xlint/lint1/tree.c: getcnode():
        n->tn_val->v_ansiu = v->v_ansiu;
        n->tn_val->v_u = v->v_u;        /* crash */
        free(v);

The host compiler generates a pair of movaps instructions, which require 16
byte alignment, the code defaults to an 8 byte alignment.

>How-To-Repeat:
Attempt to build NetBSD on Mac OS X 10.7.0.
>Fix:
Following hacky patch works:

Index: usr.bin/xlint/lint1/lint1.h
===================================================================
RCS file: /Volumes/netbsd/cvsroot/src/usr.bin/xlint/lint1/lint1.h,v
retrieving revision 1.24
diff -u -d -r1.24 lint1.h
--- usr.bin/xlint/lint1/lint1.h 2 Oct 2009 19:01:14 -0000       1.24
+++ usr.bin/xlint/lint1/lint1.h 23 Jun 2011 07:35:01 -0000
@@ -40,6 +40,11 @@
 #define ALIGN(x) (((x) + 7) & ~7)
 #endif
 
+#ifdef __APPLE__
+#undef ALIGN
+#define ALIGN(x) (((x) + 15) & ~15)
+#endif
+
 /*
  * Describes the position of a declaration or anything else.
  */



Home | Main Index | Thread Index | Old Index