[m-rev.] diff: pass /nodefaultlib:libc when linking against the MSVCRT.

Peter Ross pro at missioncriticalit.com
Wed Apr 7 18:23:27 AEST 2004


Hi,


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


Estimated hours taken: 0.25
Branches: main

scripts/ml.in:
	When linking with the MSVCRT we also need to pass /nodefaultlib:libc to
	the linker, so that it doesn't also try and link with the standard C
	library and have duplicate symbol errors.

Index: scripts/ml.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/ml.in,v
retrieving revision 1.108
diff -u -r1.108 ml.in
--- scripts/ml.in	2 Apr 2004 08:53:40 -0000	1.108
+++ scripts/ml.in	7 Apr 2004 08:20:29 -0000
@@ -260,8 +260,10 @@
 use_msvcrt=@USE_MSVCRT@
 if test $use_msvcrt = "yes"; then
 	MSVCRT_OPTS="/MD" # enable linking with the MS Visual C runtime
+	NODEFAULTLIB_FLAG="/nodefaultlib:libc"
 else
 	MSVCRT_OPTS=""
+	NODEFAULTLIB_FLAG=""
 fi
 
 case $make_shared_lib in
@@ -374,7 +376,7 @@
 esac
 
 LINKER_PRE_FLAGS="$MSVCRT_OPTS $UNDEF_OPT $STRIP_OPTS $MAYBE_STATIC_OPT $ARCH_OPTS"
-LINKER_POST_FLAGS="@LINK_OPT_SEP@ $DEBUG_FLAG $LIBDIR_OPTS $RPATH_OPT_LIST $LIBS"
+LINKER_POST_FLAGS="@LINK_OPT_SEP@ $NODEFAULTLIB_FLAG $DEBUG_FLAG $LIBDIR_OPTS $RPATH_OPT_LIST $LIBS"
 
 case $verbose in
     true)


-- 
Peter Ross		
Software Engineer                                (Work)   +32 2 757 10 15
Mission Critical                                 (Mobile) +32 485 482 559
--------------------------------------------------------------------------
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