* Re: sparse, gcc 4.6 and a few build changes
[not found] <1302226355.2407.7.camel@raven.home.flameeyes.eu>
@ 2011-04-13 8:53 ` Christopher Li
2011-04-13 11:06 ` Diego Elio Pettenò
0 siblings, 1 reply; 4+ messages in thread
From: Christopher Li @ 2011-04-13 8:53 UTC (permalink / raw)
To: Diego Elio Pettenò; +Cc: Linux-Sparse
Hi Diego,
The series looks good except the CFLAGS over ride change.
The CFLAGS obvious have two parts. Some of it can be savely
overwrite. Some of shouldn't be overwrite otherwise sparse can't
compile correctly.
I think it'd better seperate out the overwrite part of CFLAGS with
the rest of CFLAGS, just like the git makefile.
Some thing like the patch I attached. You might need to make some
changes to merge with your branch.
Can you rebase your series on the sparse chrisl branch?
http://git.kernel.org/?p=devel/sparse/chrisl/sparse.git;a=summary
Thanks
Chris
On Thu, Apr 7, 2011 at 6:32 PM, Diego Elio Pettenò <flameeyes@gmail.com> wrote:
> Hello Christopher,
>
> I'm a Gentoo developer and I went to look at sparse today since it
> failed to build with the new GCC 4.6 version. I've fixed the build
> issue, but since I was looking at it I also made a number of changes
> that makes it much easier to build in Gentoo.
>
> If you could look at the patches and merge those that makes sense, it'd
> be lovely:
>
> http://git.overlays.gentoo.org/gitweb/?p=proj/sparse.git;a=summary
>
> Thanks in advance,
> --
> Diego Elio Pettenò — Flameeyes
> http://blog.flameeyes.eu/
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sparse, gcc 4.6 and a few build changes
2011-04-13 8:53 ` sparse, gcc 4.6 and a few build changes Christopher Li
@ 2011-04-13 11:06 ` Diego Elio Pettenò
2011-04-13 16:58 ` Christopher Li
2011-04-26 0:58 ` Christopher Li
0 siblings, 2 replies; 4+ messages in thread
From: Diego Elio Pettenò @ 2011-04-13 11:06 UTC (permalink / raw)
To: Christopher Li; +Cc: Linux-Sparse
Hi Chris,
Il giorno mer, 13/04/2011 alle 01.53 -0700, Christopher Li ha scritto:
> The series looks good except the CFLAGS over ride change.
>
> The CFLAGS obvious have two parts. Some of it can be savely
> overwrite. Some of shouldn't be overwrite otherwise sparse can't
> compile correctly.
Yes I know — that's why I used the "?=" setter: if CFLAGS is set in the
environment, it'll be used instead of the "CFLAGS ?=" line; all the +=
lines will be maintained instead. This does obviously not work if you
use "make CFLAGS=$something".
> I think it'd better seperate out the overwrite part of CFLAGS with
> the rest of CFLAGS, just like the git makefile.
I don't know much the git Makefiles, but I'll look into it; in the mean
time the other three patches should work fine by themselves.
> Some thing like the patch I attached. You might need to make some
> changes to merge with your branch.
Attachment is missing ;)
> Can you rebase your series on the sparse chrisl branch?
> http://git.kernel.org/?p=devel/sparse/chrisl/sparse.git;a=summary
It looks like no changes are needed for that at least, I'll send the
remaining three patches for now then.
--
Diego Elio Pettenò — Flameeyes
http://blog.flameeyes.eu/
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sparse, gcc 4.6 and a few build changes
2011-04-13 11:06 ` Diego Elio Pettenò
@ 2011-04-13 16:58 ` Christopher Li
2011-04-26 0:58 ` Christopher Li
1 sibling, 0 replies; 4+ messages in thread
From: Christopher Li @ 2011-04-13 16:58 UTC (permalink / raw)
To: Diego Elio Pettenò; +Cc: Linux-Sparse
[-- Attachment #1: Type: text/plain, Size: 889 bytes --]
On Wed, Apr 13, 2011 at 4:06 AM, Diego Elio Pettenò <flameeyes@gmail.com> wrote:
> Yes I know — that's why I used the "?=" setter: if CFLAGS is set in the
> environment, it'll be used instead of the "CFLAGS ?=" line; all the +=
> lines will be maintained instead. This does obviously not work if you
> use "make CFLAGS=$something".
That is my point. It force the user set CFLAGS in enviroment
but not work the same way if you do "make CFLAGS=$something".
I want "make CFLAGS=$something" works the same way as
you set it in environment.
>
> Attachment is missing ;)
Oops, I forget to attach. Here we go again.
> It looks like no changes are needed for that at least, I'll send the
> remaining three patches for now then.
Ha, I am hoping that is my learning case to pull from some one else's
git tree. Using git tree or patches are both fine.
Thanks
Chris
[-- Attachment #2: cflags.patch --]
[-- Type: application/octet-stream, Size: 2355 bytes --]
diff --git a/Makefile b/Makefile
index 701cdc9..eec5daa 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ CFLAGS += -Wall -Wwrite-strings
LDFLAGS += -g
AR = ar
+ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS)
#
# For debugging, put this in local.mk:
#
@@ -21,10 +22,10 @@ HAVE_GCC_DEP:=$(shell touch .gcc-test.c && \
echo 'yes'; rm -f .gcc-test.d .gcc-test.o .gcc-test.c)
HAVE_GTK2:=$(shell pkg-config --exists gtk+-2.0 2>/dev/null && echo 'yes')
-CFLAGS += -DGCC_BASE=\"$(shell $(CC) --print-file-name=)\"
+BASIC_CFLAGS = -DGCC_BASE=\"$(shell $(CC) --print-file-name=)\"
ifeq ($(HAVE_GCC_DEP),yes)
-CFLAGS += -Wp,-MD,$(@D)/.$(@F).d
+BASIC_CFLAGS += -Wp,-MD,$(@D)/.$(@F).d
endif
DESTDIR=
@@ -55,7 +56,7 @@ GTK2_LIBS := $(shell pkg-config --libs gtk+-2.0)
PROGRAMS += test-inspect
INST_PROGRAMS += test-inspect
test-inspect_EXTRA_DEPS := ast-model.o ast-view.o ast-inspect.o
-test-inspect.o $(test-inspect_EXTRA_DEPS): CFLAGS += $(GTK2_CFLAGS)
+test-inspect.o $(test-inspect_EXTRA_DEPS): BASIC_CFLAGS += $(GTK2_CFLAGS)
test-inspect_EXTRA_OBJS := $(GTK2_LIBS)
else
$(warning Your system does not have libgtk2, disabling test-inspect)
@@ -73,7 +74,7 @@ LIB_OBJS= target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \
LIB_FILE= libsparse.a
SLIB_FILE= libsparse.so
-# If you add $(SLIB_FILE) to this, you also need to add -fpic to CFLAGS above.
+# If you add $(SLIB_FILE) to this, you also need to add -fpic to BASIC_CFLAGS above.
# Doing so incurs a noticeable performance hit, and Sparse does not have a
# stable shared library interface, so this does not occur by default. If you
# really want a shared library, you may want to build Sparse twice: once
@@ -149,7 +150,7 @@ DEP_FILES := $(wildcard .*.o.d)
$(if $(DEP_FILES),$(eval include $(DEP_FILES)))
c2xml.o: c2xml.c $(LIB_H)
- $(QUIET_CC)$(CC) `pkg-config --cflags libxml-2.0` -o $@ -c $(CFLAGS) $<
+ $(QUIET_CC)$(CC) `pkg-config --cflags libxml-2.0` -o $@ -c $(ALL_CFLAGS) $<
compat-linux.o: compat/strtold.c compat/mmap-blob.c $(LIB_H)
compat-solaris.o: compat/mmap-blob.c $(LIB_H)
@@ -157,7 +158,7 @@ compat-mingw.o: $(LIB_H)
compat-cygwin.o: $(LIB_H)
%.o: %.c
- $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
+ $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
clean: clean-check
rm -f *.[oa] .*.d *.so $(PROGRAMS) $(SLIB_FILE) pre-process.h sparse.pc
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: sparse, gcc 4.6 and a few build changes
2011-04-13 11:06 ` Diego Elio Pettenò
2011-04-13 16:58 ` Christopher Li
@ 2011-04-26 0:58 ` Christopher Li
1 sibling, 0 replies; 4+ messages in thread
From: Christopher Li @ 2011-04-26 0:58 UTC (permalink / raw)
To: Diego Elio Pettenò; +Cc: Linux-Sparse
Hi Diego,
More sparse hacking time. I just push a version with CFLAGS overwrite
in chrisl repository.
Please check if that works for you.
Thanks
Chris
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-26 0:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1302226355.2407.7.camel@raven.home.flameeyes.eu>
2011-04-13 8:53 ` sparse, gcc 4.6 and a few build changes Christopher Li
2011-04-13 11:06 ` Diego Elio Pettenò
2011-04-13 16:58 ` Christopher Li
2011-04-26 0:58 ` Christopher Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).