svn commit: r212979 - in head: gnu/lib/libobjc sys/boot/i386/boot2 sys/boot/pc98/boot2

Anonymous swell.k at gmail.com
Mon Oct 4 21:42:03 UTC 2010


Dimitry Andric <dim at FreeBSD.org> writes:

> The particular case of libobjc is special, because it is the only
> Makefile that both modifies CC, and takes the default CFLAGS from
> make.conf.  The only other cases where we *must* compile with gcc for
> now, are boot2 for i386 and pc98, but these set their CFLAGS to a
> hardcoded value.
>
> A solution could be to always use hardcoded CFLAGS for libobjc.
> Otherwise, we could check for a GCC_CFLAGS in libobjc's Makefile, and
> substitute these for the regular CFLAGS, iff clang is used to build
> world.  Does that sound acceptable?

What are GCC_CFLAGS and "regular CFLAGS"?

And note, you haven't explained why CLANG_FLAGS is bad. I've compiled
the world with below src.conf a few times without issues

>>    CC = clang ${CLANG_FLAGS}
>>    CLANG_FLAGS = -Qunused-arguments # too much noise for `make -s' build

No need to document the variable, it's temporary as the workaround.

%%
diff --git a/gnu/lib/libobjc/Makefile b/gnu/lib/libobjc/Makefile
index 80d0240..b61bf91 100644
--- a/gnu/lib/libobjc/Makefile
+++ b/gnu/lib/libobjc/Makefile
@@ -16,6 +16,7 @@ SRCS=	archive.c class.c encoding.c gc.c hash.c init.c linking.m misc.c \
 	selector.c sendmsg.c thr.c thr-objc.c exception.c
 
 # XXX: clang cannot compile libobjc yet
+CLANG_FLAGS= # clear clang-specific user cflags
 CC:=${CC:C/^(.*\/)?clang$/gcc/1}
 
 INCS=	encoding.h hash.h objc-api.h objc-decls.h objc-list.h objc.h runtime.h \
diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile
index b91a43b..ed5727e 100644
--- a/sys/boot/i386/boot2/Makefile
+++ b/sys/boot/i386/boot2/Makefile
@@ -3,6 +3,7 @@
 .include <bsd.own.mk>
 
 # XXX: clang can compile the boot code just fine, but boot2 gets too big
+CLANG_FLAGS= # clear clang-specific user cflags
 CC:=${CC:C/^(.*\/)?clang$/gcc/1}
 
 FILES=		boot boot1 boot2
diff --git a/sys/boot/pc98/boot2/Makefile b/sys/boot/pc98/boot2/Makefile
index dfd8607..e605c8a 100644
--- a/sys/boot/pc98/boot2/Makefile
+++ b/sys/boot/pc98/boot2/Makefile
@@ -3,6 +3,7 @@
 .include <bsd.own.mk>
 
 # XXX: clang can compile the boot code just fine, but boot2 gets too big
+CLANG_FLAGS= # clear clang-specific user cflags
 CC:=${CC:C/^(.*\/)?clang$/gcc/1}
 
 FILES=		boot boot1 boot2
%%


More information about the svn-src-head mailing list