This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch]why not follow CFLAGS when using $CC in some packages of frysk?


hi,

In frysk, no CFLAGS is followed in some packages, such as elfutils and
libunwind, when the $(CC) is used.  This may be not so preferable.  If
we want to compile these packages using -O3 or some other options, we
won't get what we expect because all they will be compiled by using no
options or some fixed options in the make rules.  Thus, we can pass
CFLAGS into all packages, but CFLAGS won't take effect in some pacakges!
This goes worse if the "-m64" is given as one CFLAGS in PPC64. 

We write one patch to fix this problem. The patch is split into two
parts: frysk-CFLAGS-common.patch and frysk-CFLAGS-supplement.patch.
The former should be applied to $FRYSK and $FRYSK-<module>; The latter
is for $FRYSK.

	2006-09-19  Yong Zheng  <zhengyo@cn.ibm.com>

		* common/Makefile.rules: Add $(CFLAGS) for .a.so rules.
		* frysk-gtk/tlwidgets/Makefile.am: Add $(CFLAGS)
		for .a.so rules.
		* frysk-imports/elfutils/src/Makefile.am: Add $(CFLAGS)
		for libld_elf_i386.so.
		* frysk-imports/libunwind/src/Makefile.in: Add $(CFLAGS)
		to $(LINK).

Please review.

Best regards
Yong Zheng
--- common/Makefile.rules	2006-09-18 10:33:08.000000000 +0800
+++ ../common/Makefile.rules	2006-09-18 21:08:39.000000000 +0800
@@ -333,7 +333,8 @@
 SUFFIXES += .so
 .a.so:
 	soname=`basename $@` ; \
-	$(CC) -shared -o $@.tmp \
+	$(CC) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) \
+		$(CFLAGS) -shared -o $@.tmp \
 		-Wl,--whole-archive,$<,--no-whole-archive \
 		-Wl,--soname,$$soname,-z,-defs
 	if readelf -d $@.tmp | fgrep -q TEXTREL; then exit 1; fi
--- frysk-imports/elfutils/src/Makefile.am	2006-08-08 06:11:09.000000000 +0800
+++ frysk-imports/elfutils/src/Makefile.am.edited	2006-09-18 20:24:48.000000000 +0800
@@ -133,7 +133,7 @@
 
 libld_elf_i386_so_SOURCES =
 libld_elf_i386.so: libld_elf_i386_pic.a libld_elf_i386.map
-	$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
+	$(COMPILE) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
 	      $(libelf) $(libeu) \
 	      -Wl,--version-script,$(srcdir)/libld_elf_i386.map
 	$(textrel_check)
--- frysk-imports/libunwind/src/Makefile.in	2006-09-18 21:04:56.000000000 +0800
+++ frysk-imports/libunwind/src/Makefile.in.edited	2006-09-18 21:04:44.000000000 +0800
@@ -205,7 +205,7 @@
 
 ### 
 
-LINK = $(CC) -shared -nostartfiles $(LDFLAGS) -Wl,-soname,$@.$($@_major) \
+LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) -shared -nostartfiles $(LDFLAGS) -Wl,-soname,$@.$($@_major) \
 	-o $@.$($@_major).$($@_minor) $^ $(LIBS) 
 POSTLINK = $(LN_S) $@.$($@_major).$($@_minor) $@.$($@_major) && \
 	$(LN_S) $@.$($@_major).$($@_minor) $@
--- frysk-gtk/tlwidgets/Makefile.am	2006-08-31 10:48:52.000000000 +0800
+++ frysk-gtk/tlwidgets/Makefile.am.edited	2006-09-18 21:33:02.000000000 +0800
@@ -73,7 +73,8 @@
 
 .a.so:
 	soname=`basename $@` ; \
-	$(CC) -shared -o $@.tmp \
+	$(CC) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) \
+                $(CFLAGS) -shared -o $@.tmp \
 		-Wl,--whole-archive,$<,--no-whole-archive \
 		-Wl,--soname,$$soname,-z,-defs
 	if readelf -d $@.tmp | fgrep -q TEXTREL; then exit 1; fi

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]