[m-rev.] diff: another GCC back-end Mmake fix

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Jul 28 06:32:01 AEST 2001


On 27-Jul-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Fix another problem with the GCC back-end Mmake support that seems to have been
> caused by stayl's .c_date changes.
> 
> library/Mmakefile:
> 	Add a pic_ss target.  We need to explicitly mention
> 	$(library.pic_ss) somewhere in the Mmakefile, otherwise it
> 	won't build properly with --target asm: GNU Make's pattern rule
> 	algorithm will try to use the .m -> .c -> .pic_o rule chain
> 	rather than the .m -> .pic_s_date -> .pic_s -> .pic_o chain.

It turns out that this is a more general problem which affects all
programs, not just the standard library.  So we need to fix it in
the automatically generated Makefile fragments.  Hence the following
patch.

----------

Estimated hours taken: 2
Branches: main

compiler/modules.m:
	In the generated `.dep' files, add phony targets `<module>.ss'
	and `<module>.pic_ss'.	We need to explicitly mention the `.s'
	and `.pic_s' files in the Makefile to ensure that GNU Make will build
	the object files from the `.s'/`.pic_s' files rather than trying
	to go via C.

Workspace: /mnt/mars/home/mars/fjh/ws1/mercury
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.185
diff -u -d -r1.185 modules.m
--- compiler/modules.m	2001/07/27 17:50:13	1.185
+++ compiler/modules.m	2001/07/27 18:04:46
@@ -767,6 +767,8 @@
 			; Ext = ".ints"
 			; Ext = ".int3s"
 			; Ext = ".rlos"
+			; Ext = ".ss"
+			; Ext = ".pic_ss"
 			; Ext = ".ils"
 			; Ext = ".opts"
 			; Ext = ".trans_opts"
@@ -3613,11 +3615,22 @@
 	module_name_to_file_name(ModuleName, ".opts", no, OptsTargetName),
 	module_name_to_file_name(ModuleName, ".trans_opts", no,
 						TransOptsTargetName),
+	module_name_to_file_name(ModuleName, ".ss", no,
+						SsTargetName),
+	module_name_to_file_name(ModuleName, ".pic_ss", no,
+						PicSsTargetName),
 	module_name_to_file_name(ModuleName, ".rlos", no,
 						RLOsTargetName),
 	module_name_to_file_name(ModuleName, ".ils", no,
 						ILsTargetName),
 
+	% We need to explicitly mention
+	% $(foo.pic_ss) somewhere in the Mmakefile, otherwise it
+	% won't build properly with --target asm: GNU Make's pattern rule
+	% algorithm will try to use the .m -> .c_date -> .c -> .pic_o rule chain
+	% rather than the .m -> .pic_s_date -> .pic_s -> .pic_o chain.
+	% So don't remove the pic_ss target here.
+
 	io__write_strings(DepStream, [
 		".PHONY : ", CheckTargetName, "\n",
 		CheckTargetName, " : $(", MakeVarName, ".errs)\n\n",
@@ -3630,6 +3643,10 @@
 		".PHONY : ", TransOptsTargetName, "\n",
 		TransOptsTargetName, " : $(", MakeVarName,
 						".trans_opt_dates)\n\n",
+		".PHONY : ", SsTargetName, "\n",
+		SsTargetName, " : $(", MakeVarName, ".ss)\n\n",
+		".PHONY : ", PicSsTargetName, "\n",
+		PicSsTargetName, " : $(", MakeVarName, ".pic_ss)\n\n",
 		".PHONY : ", RLOsTargetName, "\n",
 		RLOsTargetName, " : $(", MakeVarName, ".rlos)\n\n",
 		".PHONY : ", ILsTargetName, "\n",
-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list