Current-Users archive

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

building under OS X 10.7



On a Mac running 10.7, building -current fails, as does a locally
modified netbsd-5.  The problem is early on, with the (netbsd-built
cross) lint getting a SEGV.

Mac OS 10.7 (as they seem to call it now) has 3 compilers:

cc/gcc:
  gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
gcc-4.2:
  gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
clang:
  Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)

If I set HOST_{CC,CXX,CPP} to {gcc,g++,cpp},-4.2, then the build seems
to run ok.

I'm also having trouble building things from pkgsrc (migrated from an
older machine with 10.6), but haven't tracked that down.

Is this a known issue?  I'm guessing it's a bug in the Apple gcc/clang
hybrid that miscompiles our lint.

If so, I wonder if we should choose the HOST_CC default by OS/version,
or if people should set it manually.

Here's what I did (yes, I know I should use mk.conf instead).

diff --git a/netbsd/src/share/mk/bsd.sys.mk b/netbsd/src/share/mk/bsd.sys.mk
index d9b3aef..8487a0e 100644
--- a/netbsd/src/share/mk/bsd.sys.mk
+++ b/netbsd/src/share/mk/bsd.sys.mk
@@ -94,7 +94,7 @@ PIE_LDFLAGS?=       -Wl,-pie -shared-libgcc
 PIE_AFLAGS?=       -fPIC -DPIC
 
 # Helpers for cross-compiling
-HOST_CC?=      cc
+HOST_CC?=      gcc-4.2
 HOST_CFLAGS?=  -O
 HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c
 HOST_COMPILE.cc?=      ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} -c
@@ -104,10 +104,10 @@ HOST_LINK.c?=     ${HOST_CXX} ${HOST_CXXFLAGS} 
${HOST_CPPFLAGS} ${HOST_LDFLAGS}
 HOST_LINK.c?=  ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
 .endif
 
-HOST_CXX?=     c++
+HOST_CXX?=     g++-4.2
 HOST_CXXFLAGS?=        -O
 
-HOST_CPP?=     cpp
+HOST_CPP?=     cpp-4.2
 HOST_CPPFLAGS?=
 
 HOST_LD?=      ld



Attachment: pgpNmDb7aF9Gl.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index