[m-rev.] diff: fix MC++ compilation rule

Peter Ross pro at missioncriticalit.com
Tue Nov 5 23:08:54 AEDT 2002


On Fri, Nov 15, 2002 at 09:27:52PM +1100, Simon Taylor wrote:
> On 05-Nov-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> > scripts/Mmake.rules:
> > 	'-o' is the flag for naming the output file for the C compiler.
> > 
> > Index: scripts/Mmake.rules
> > ===================================================================
> > RCS file: /home/mercury1/repository/mercury/scripts/Mmake.rules,v
> > retrieving revision 1.138
> > diff -u -r1.138 Mmake.rules
> > --- scripts/Mmake.rules	6 Nov 2002 04:24:22 -0000	1.138
> > +++ scripts/Mmake.rules	15 Nov 2002 10:03:48 -0000
> > @@ -271,7 +271,7 @@
> >  	$(MS_CL) -CLR$(MS_CL_NOASM) $(ALL_MS_CLFLAGS) \
> >  		-I`$(FIX_PATH_FOR_CL) $(MERC_C_INCL_DIR)` \
> >  		-AI`$(FIX_PATH_FOR_CL) $(MERC_DLL_DIR)` $< \
> > -		/LD $(MS_CL_LIBS) -out:$@
> > +		/LD $(MS_CL_LIBS) -o $@
> >  	rm -f $*.obj
> >  
> >  $(os_subdir)%.dll : %.cs
> 
> This will also need to be done in compiler/compile_target_code.m.
> 
Thanks for spotting this.


===================================================================


Estimated hours taken: 0.5
Branches: main

Fix a bug in my previous change to fix a bug in fjh's previous change.
Revert back to using '/out:', and instead add the flag '/link' so that '/out:'
is passed to the linker instead to avoid problems compiling the library.

scripts/Mmake.rules:
compiler/compile_target_code.m:
	Add '/link' before the '/out:'.

scripts/Mmake.rules:
	Also add fjh's change for /LD to other rules building .dlls.

Index: compiler/compile_target_code.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.26
diff -u -r1.26 compile_target_code.m
--- compiler/compile_target_code.m	13 Nov 2002 08:39:13 -0000	1.26
+++ compiler/compile_target_code.m	15 Nov 2002 12:02:51 -0000
@@ -230,7 +230,7 @@
 
 	{ string__append_list([MCPP, " -CLR ", DebugOpt, InclOpts,
 		DLLDirOpts, MCPPFlags, " ", MCPPFileName,
-		" /LD -out:", DLLFileName],
+		" /LD /link -out:", DLLFileName],
 		Command) },
 	invoke_system_command(ErrorStream, verbose_commands,
 		Command, Succeeded).
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.139
diff -u -r1.139 Mmake.rules
--- scripts/Mmake.rules	15 Nov 2002 10:11:02 -0000	1.139
+++ scripts/Mmake.rules	15 Nov 2002 12:02:51 -0000
@@ -271,7 +271,7 @@
 	$(MS_CL) -CLR$(MS_CL_NOASM) $(ALL_MS_CLFLAGS) \
 		-I`$(FIX_PATH_FOR_CL) $(MERC_C_INCL_DIR)` \
 		-AI`$(FIX_PATH_FOR_CL) $(MERC_DLL_DIR)` $< \
-		/LD $(MS_CL_LIBS) -o $@
+		/LD /link $(MS_CL_LIBS) -out:$@
 	rm -f $*.obj
 
 $(os_subdir)%.dll : %.cs
@@ -380,7 +380,7 @@
 	$(MS_CL) -CLR$(MS_CL_NOASM) $(ALL_MS_CLFLAGS) \
 		-I`$(FIX_PATH_FOR_CL) $(MERC_C_INCL_DIR)` \
 		-AI`$(FIX_PATH_FOR_CL) $(MERC_DLL_DIR)` $< \
-		-link -noentry mscoree.lib -dll $(MS_CL_LIBS) -out:$@
+		-LD -link $(MS_CL_LIBS) -out:$@
 	rm -f $*.obj
 
 .cs.dll:

--------------------------------------------------------------------------
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