[m-rev.] diff: fix bugs with mmc -c --target asm --pic

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Dec 2 02:44:13 AEDT 2002


Estimated ours taken: 0.5
Branches: main, release

compiler/compile_target_code.m:
	Fix bugs where `mmc --target asm --pic' was not passing the
	correct options to gcc.

Workspace: /home/ceres/fjh/mercury
Index: compiler/compile_target_code.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.29
diff -u -d -r1.29 compile_target_code.m
--- compiler/compile_target_code.m	30 Nov 2002 14:32:42 -0000	1.29
+++ compiler/compile_target_code.m	1 Dec 2002 15:41:15 -0000
@@ -636,10 +636,12 @@
 	globals__io_lookup_bool_option(pic, Pic),
 	{ ( Pic = yes ; PIC = pic ) ->
 		AsmExt = ".pic_s",
-		GCCFLAGS_FOR_PIC = ""
+		GCCFLAGS_FOR_ASM = "-x assembler ",
+		GCCFLAGS_FOR_PIC = "-fpic "
 	;
 		AsmExt = ".s",
-		GCCFLAGS_FOR_PIC = "-fpic"
+		GCCFLAGS_FOR_ASM = "",
+		GCCFLAGS_FOR_PIC = ""
 	},
 	module_name_to_file_name(ModuleName, AsmExt, no, AsmFile),
 	globals__io_lookup_string_option(object_file_extension, Obj),
@@ -659,7 +661,8 @@
 	% Be careful with the order here.
 	% Also be careful that each option is separated by spaces.
 	{ string__append_list([CC, " ", CFLAGS, " ", GCCFLAGS_FOR_PIC,
-		" -c ", AsmFile, " ", NameObjectFile, ObjFile], Command) },
+		GCCFLAGS_FOR_ASM, "-c ", AsmFile, " ",
+		NameObjectFile, ObjFile], Command) },
 	invoke_system_command(ErrorStream, verbose_commands,
 		Command, Succeeded).
 

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