[m-dev.] diff: GCC back-end: fix Mmake bug with `.pic_s' files

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jan 24 03:12:41 AEDT 2001


Estimated hours taken: 0.5

Fix a bug where the Mmake rule for making `.pic_s' files didn't work,
because it was passing $(CFLAGS_FOR_PIC), i.e. `-fpic -DPIC',
to the GCC back-end, but the GCC back-end didn't understand `-DPIC'.
(The GCC *driver* understands `-D', as does the GCC C front-end,
but the back-end doesn't.)

scripts/Mmake.vars.in:
	Define new variable GCCFLAGS_FOR_PIC, and set it to `-fpic'.

scripts/Mmake.rules:
	In the rule for making `.pic_s' files, use $(GCCFLAGS_FOR_PIC)
	instead of $(CFLAGS_FOR_PIC).

XXX remember to check that this diff includes all
    the relevant files that have been changed!

Workspace: /home/hg/fjh/gcc-cvs/gcc/mercury
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.87
diff -u -d -r1.87 Mmake.rules
--- scripts/Mmake.rules	2001/01/17 02:45:05	1.87
+++ scripts/Mmake.rules	2001/01/23 16:03:05
@@ -177,7 +177,7 @@
 
 $(ss_subdir)%.pic_s : %.m
 	$(MCG) $(ALL_GRADEFLAGS) --target-code-only $(ALL_MCGFLAGS) \
-		--cflags "$(CFLAGS_FOR_PIC)" $< > $*.err 2>&1
+		--cflags "$(GCCFLAGS_FOR_PIC)" $< > $*.err 2>&1
 
 $(os_subdir)%.$O : $(ss_subdir)%.s
 	$(AS) $< $(OBJFILE_OPT)$@
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.39
diff -u -d -r1.39 Mmake.vars.in
--- scripts/Mmake.vars.in	2001/01/17 02:45:06	1.39
+++ scripts/Mmake.vars.in	2001/01/23 16:04:24
@@ -242,6 +242,10 @@
 # position-independent code.)
 CFLAGS_FOR_PIC		= @CFLAGS_FOR_PIC@
 
+# $(GCCFLAGS_FOR_PIC) is passed to the GCC back-end when creating
+# `.pic_s' files.
+GCCFLAGS_FOR_PIC	= -fpic
+
 # $(EXT_FOR_PIC_OBJECTS) will be either `.o', if $(CFLAGS_FOR_PIC) is empty,
 # or `.pic_o', if special flags are required for compiling files that
 # will be put in shared libraries.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list