[m-rev.] diff: fix bug with --target asm & --use-subdirs
Fergus Henderson
fjh at cs.mu.OZ.AU
Sat Jul 28 01:39:50 AEST 2001
While investigating a different bug, I noticed that there was a bug when
combining --target asm and --use-subdirs, since the compiler put the
.pic_s files in the `Mercury/pic_ss' subdirectory, but Mmake expected
them to be in the `Mercury/ss' subdirectory.
I started fixing it by modifying the Mmake support, so that Mmake
expects them to go in the `.pic_ss' directory (see attached file diff3).
However, after completing that, I though that it might be simpler
to just modify the compiler to put the files in the `.ss' directory.
So I tried that as well (see diff2). But in the end, I decided to go
with the original approach.
When testing this, I also found another bug, a typo in scripts/Mmake.vars.in
(see diff1).
I'll commit diff1 and diff3.
--
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.
-------------- next part --------------
Estimated hours taken: 0.1
Branches: main, release
scripts/Mmake.vars.in:
Fix a typo in the definition of ss_subdir.
This broke things if you tried to use --target asm with --use-subdirs.
Workspace: /mnt/mars/home/mars/fjh/ws1/mercury
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.51
diff -u -d -r1.51 Mmake.vars.in
--- scripts/Mmake.vars.in 2001/07/18 08:13:46 1.51
+++ scripts/Mmake.vars.in 2001/07/27 15:29:46
@@ -422,7 +422,7 @@
trans_opt_dates_subdir=$(SUBDIR)trans_opt_dates/
cs_subdir=$(SUBDIR)cs/
dlls_subdir=$(SUBDIR)dlls/
-ss_subdir=$(SUBDIR)cs/
+ss_subdir=$(SUBDIR)ss/
os_subdir=$(SUBDIR)os/
rlos_subdir=$(SUBDIR)rlos/
ils_subdir=$(SUBDIR)ils/
-------------- next part --------------
Branches: main, release
Estimated hours taken: 0.5
Fix a bug which occurred when combining --target asm with --use-subdirs.
compiler/modules.m:
Put the .pic_s files go in the `ss' subdirectory,
not in the `ss' subdirectory, to match what Mmake expects.
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.182
diff -u -d -u -r1.182 modules.m
--- modules.m 2001/07/24 14:19:19 1.182
+++ modules.m 2001/07/27 15:19:29
@@ -810,6 +810,15 @@
->
SubDirName = "os"
;
+ % .s and .pic_s files go in the same directory
+ % (there's no particular reason that means it has to be
+ % done this way, but that just happens to be how it
+ % was done, perhaps for consistency with what we do
+ % with .o and .pic_o)
+ Ext = ".pic_s"
+ ->
+ SubDirName = "ss"
+ ;
% _init.c, _init.s, _init.o etc. files
% go in the cs, ss, os etc. subdirectories
string__append("_init.", ExtName, Ext)
-------------- next part --------------
Branches: main, release
Estimated hours taken: 0.5
Fix a bug which occurred when combining --target asm with --use-subdirs.
scripts/Mmake.rules:
compiler/modules.m:
The .pic_s files go in the `pic_ss' subdirectory,
not in the `ss' subdirectory.
scripts/Mmake.vars.in:
Add `pic_ss_subdir' variable.
Workspace: /mnt/mars/home/mars/fjh/ws3/mercury
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.104
diff -u -d -r1.104 Mmake.rules
--- scripts/Mmake.rules 2001/07/27 06:12:31 1.104
+++ scripts/Mmake.rules 2001/07/27 15:12:10
@@ -192,7 +192,7 @@
$(ss_subdir)%.s : $(s_dates_subdir)%.s_date
@:
-$(ss_subdir)%.pic_s : $(pic_s_dates_subdir)%.pic_s_date
+$(pic_ss_subdir)%.pic_s : $(pic_s_dates_subdir)%.pic_s_date
@:
$(s_dates_subdir)%.s_date : %.m
@@ -206,7 +206,7 @@
$(os_subdir)%.$O : $(ss_subdir)%.s
$(AS) $< $(OBJFILE_OPT)$@
-$(os_subdir)%.pic_o : $(ss_subdir)%.pic_s
+$(os_subdir)%.pic_o : $(pic_ss_subdir)%.pic_s
$(AS) $< $(OBJFILE_OPT)$@
# For *__c_code.{o,pic_o}, we depend on the .s or .pic_s file rather
@@ -217,7 +217,7 @@
$(MGNUC) $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS) \
-c $(cs_subdir)$*.c $(OBJFILE_OPT)$@
-$(os_subdir)%__c_code.pic_o : $(ss_subdir)%.pic_s
+$(os_subdir)%__c_code.pic_o : $(pic_ss_subdir)%.pic_s
$(MGNUC) $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS) $(CFLAGS_FOR_PIC) \
-c $(cs_subdir)$*.c $(OBJFILE_OPT)$@
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.51
diff -u -d -r1.51 Mmake.vars.in
--- scripts/Mmake.vars.in 2001/07/18 08:13:46 1.51
+++ scripts/Mmake.vars.in 2001/07/27 15:11:32
@@ -423,6 +423,7 @@
cs_subdir=$(SUBDIR)cs/
dlls_subdir=$(SUBDIR)dlls/
ss_subdir=$(SUBDIR)cs/
+pic_ss_subdir=$(SUBDIR)pic_ss/
os_subdir=$(SUBDIR)os/
rlos_subdir=$(SUBDIR)rlos/
ils_subdir=$(SUBDIR)ils/
@@ -454,6 +455,7 @@
cs_subdir=
dlls_subdir=
ss_subdir=
+pic_ss_subdir=
os_subdir=
rlos_subdir=
ils_subdir=
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.182
diff -u -d -u -r1.182 modules.m
--- compiler/modules.m 2001/07/24 14:19:19 1.182
+++ compiler/modules.m 2001/07/27 15:22:33
@@ -3028,7 +3028,7 @@
io__write_string(DepStream, MakeVarName),
io__write_string(DepStream, ".all_pic_ss = "),
- write_compact_dependencies_list(Modules, "$(ss_subdir)", ".pic_s",
+ write_compact_dependencies_list(Modules, "$(pic_ss_subdir)", ".pic_s",
Basis, DepStream),
io__write_string(DepStream, "\n"),
More information about the reviews
mailing list