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

[ Available lists | Index of svn-src-all | Month of Oct 2010 | Week of 4 Oct 2010 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Anonymous <swell.k@gmail.com>
Date
4 Oct 2010 21:42:03
Subject
Re: svn commit: r212979 - in head: gnu/lib/libobjc sys/boot/i386/boot2 sys/boot/pc98/boot2
Message-ID
8639sl7i3w.fsf@gmail.com


[ Hide this part ]
Dimitry Andric <dim@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
%%


Elapsed time: 0.117 seconds