diff --git a/Makefile.in b/Makefile.in index 71fa5cf76..df7d6f942 100644 --- a/Makefile.in +++ b/Makefile.in @@ -146,7 +146,6 @@ $(CILLY): $(CILLY_EXE_BIN) $(CILLYDIR)/Makefile $(MAKE) -C $(CILLYDIR) # Create the machine dependency module -# If the cl command cannot be run then the MSVC part will be identical to GCC .PHONY : machdep machdep: $(OBJDIR)/machdep.ml $(OBJDIR)/machdep.ml : src/machdep-ml.c configure.ac Makefile.in @@ -204,15 +203,6 @@ $(OBJDIR)/machdep.ml : src/machdep-ml.c configure.ac Makefile.in @echo "let gcc = {" >>$@ @$(OBJDIR)/machdep-ml.exe >>$@ @echo "}" >>$@ - @if cl -D_MSVC $< -Fe$(OBJDIR)/machdep-ml.exe -Fo$(OBJDIR)/machdep-ml.obj ;then \ - echo "let hasMSVC = true" >>$@ ;\ - echo "let msvc = {" >>$@ ;\ - $(OBJDIR)/machdep-ml.exe >>$@ ;\ - echo "}" >>$@ \ - ;else \ - echo "let hasMSVC = false" >>$@ ;\ - echo "let msvc = gcc" >> $@ \ - ;fi @echo "let theMachine : mach ref = ref gcc" >>$@ $(CILLYDIR)/App/$(CILLYMOD).pm: $(CILLYDIR)/App/$(CILLYMOD).pm.in src/machdep-ml.c configure.ac Makefile.in diff --git a/config.mk.in b/config.mk.in index f1e189255..365f4282a 100644 --- a/config.mk.in +++ b/config.mk.in @@ -1,3 +1,2 @@ # A bunch of variables -*- Mode: makefile -*- -export HAS_MSVC=@HAS_MSVC@ export @DEFAULT_COMPILER@=1 diff --git a/configure b/configure index a8c36fef5..30fca34ee 100755 --- a/configure +++ b/configure @@ -655,7 +655,6 @@ CIL_VERSION_MINOR CIL_VERSION_MAJOR DEFAULT_CIL_MODE DEFAULT_COMPILER -HAS_MSVC EMUL LIBOBJS CYGPATH @@ -3470,7 +3469,6 @@ test -n "$target_alias" && DEFAULT_COMPILER=_GNUCC DEFAULT_CIL_MODE=GNUCC -HAS_MSVC=no # ------------------- OCaml ---------------- @@ -5243,7 +5241,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "$THREAD_IS_KEYWORD" >&6; } # Does gcc add underscores to identifiers to make assembly labels? -# (I think MSVC always does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gcc adds underscores to assembly labels." >&5 printf %s "checking if gcc adds underscores to assembly labels.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6023,7 +6020,6 @@ printf "%s\n" "$real_type" >&6; } - # finish the configure script and generate various files; ./configure # will apply variable substitutions to .in to generate ; diff --git a/configure.ac b/configure.ac index c15dcb983..948e0f911 100644 --- a/configure.ac +++ b/configure.ac @@ -82,7 +82,6 @@ AC_EXEEXT DEFAULT_COMPILER=_GNUCC DEFAULT_CIL_MODE=GNUCC -HAS_MSVC=no # ------------------- OCaml ---------------- @@ -136,7 +135,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(int __thread) { return 0; }])], AC_MSG_RESULT($THREAD_IS_KEYWORD) # Does gcc add underscores to identifiers to make assembly labels? -# (I think MSVC always does) AC_MSG_CHECKING([if gcc adds underscores to assembly labels.]) AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { __asm__("jmp _main"); }])], UNDERSCORE_NAME=true, @@ -167,7 +165,6 @@ CIL_CHECK_INTEGER_TYPE(wchar_t, TYPE_WCHAR_T) # names of the variables that get substituted in files; for example, # write @CIL_VERSION@ somewhere in a written file to get it substituted AC_SUBST(EMUL) -AC_SUBST(HAS_MSVC) AC_SUBST(DEFAULT_COMPILER) AC_SUBST(DEFAULT_CIL_MODE) AC_SUBST(CIL_VERSION_MAJOR) diff --git a/lib/perl5/patcher b/lib/perl5/patcher index 166a9bf93..da85c348b 100755 --- a/lib/perl5/patcher +++ b/lib/perl5/patcher @@ -66,7 +66,6 @@ options: --verbose Prints a lot of information about what is being done --mode=xxx What tool to emulate: GNUCC - GNU CC - MSVC - MS VC cl compiler EDG - EDG front end --dest=xxx The destination directory. Will make one if it does not exist @@ -77,9 +76,6 @@ options: --clean Remove all files in the destination directory --skipmissing Skip patches for files whose original cannot be found - --stdoutpp For MSVC only, use the "preprocess to stdout" mode. This - is for some versions of MSVC that do not support - well the /P file --dumpversion Print the version name used for the current compiler All of the other arguments are passed to the preprocessor. @@ -97,7 +93,7 @@ my %option; (\%option, "--help", # Display help information "--verbose|v", # Display information about programs invoked - "--mode=s", # The mode (GNUCC, MSVC) + "--mode=s", # The mode (GNUCC) "--dest=s", # The destination directory "--patch=s@", # Patch files "--ufile=s@", # User include files @@ -204,36 +200,22 @@ exit $hadError; sub findCompilerVersion { $cname = ""; $cversion = 0; - if($option{mode} eq "GNUCC") { - $cname = "GNU CC"; - open(VER, "$::cc -dumpversion $ppargs|") - || die "Cannot start $cname"; - while() { - # sm: had to modify this to match "egcs-2.91.66", which is - # how egcs responds to the -dumpversion request - if($_ =~ m|^(\d+\S+)| || - $_ =~ m|^(egcs-\d+\S+)|) { - $cversion = "gcc_$1"; - close(VER) || die "Cannot start $cname\n"; - return; - } - } - die "Cannot find the version for GCC\n"; - } - if($option{mode} eq "MSVC") { - $cname = "Microsoft cl"; - $ppargs =~ s|/nologo||g; - open(VER, "cl $ppargs 2>&1|") || die "Cannot start $cname: cl $ppargs\n"; - while() { - if($_ =~ m|Compiler Version (\S+) |) { - $cversion = "cl_$1"; - close(VER); - return; - } + $cname = "GNU CC"; + open(VER, "$::cc -dumpversion $ppargs|") + || die "Cannot start $cname"; + while() { + # sm: had to modify this to match "egcs-2.91.66", which is + # how egcs responds to the -dumpversion request + if($_ =~ m|^(\d+\S+)| || + $_ =~ m|^(egcs-\d+\S+)|) { + $cversion = "gcc_$1"; + close(VER) || die "Cannot start $cname\n"; + return; } - die "Cannot find the version for Microsoft CL\n"; } - die "You must specify a --mode (either GNUCC or MSVC)"; + die "Cannot find the version for GCC\n"; + + die "You must specify a --mode (GNUCC)"; } sub lineDirective { @@ -241,7 +223,7 @@ sub lineDirective { if($::iswin32) { $fileName =~ s|\\|/|g; } - if($option{mode} eq "GNUCC" || $option{mode} eq "MSVC") { + if($option{mode} eq "GNUCC") { return "#line $lineno \"$fileName\"\n"; } if($option{mode} eq "EDG") { @@ -269,18 +251,7 @@ sub patchOneFile { # ignore stderr (e.g. #error directives) $preproccmd .= " 2>/dev/null"; } - } elsif($option{mode} eq "MSVC") { - if($option{stdoutpp}) { - $preproccmd = "cl /nologo /E $ppargs >$preprocfile.i"; - } else { - $preproccmd = "cl /nologo /P $ppargs $preprocfile.c"; - } } else { die "Invalid --mode"; } - - if(system($preproccmd) && $option{mode} eq "MSVC" ) { - # For some reason the gcc returns spurious error codes - die "Error running preprocessor: $preproccmd" - } # Now scan the resulting file and get the real name of the file my $absname = ""; diff --git a/src/cil.ml b/src/cil.ml index f8bc1d894..9e5d9286b 100755 --- a/src/cil.ml +++ b/src/cil.ml @@ -672,8 +672,7 @@ and init = * initializers; the rest are 0-initialized. * For unions there must be exactly one initializer. If * the initializer is not for the first field then a field - * designator is printed, so you better be on GCC since MSVC does - * not understand this. You can scan an initializer list with + * designator is printed. You can scan an initializer list with * {!Cil.foldLeftCompound}. *) (** We want to be able to update an initializer in a global variable, so we diff --git a/src/cil.mli b/src/cil.mli index 4786544e0..110efc7f6 100644 --- a/src/cil.mli +++ b/src/cil.mli @@ -820,7 +820,7 @@ and init = * bitfields), in the proper order. This is necessary since the offsets * are not printed. For unions there must be exactly one initializer. If * the initializer is not for the first field then a field designator is - * printed, so you better be on GCC since MSVC does not understand this. + * printed. * For arrays, however, we allow you to give only a prefix of the * initializers. You can scan an initializer list with * {!Cil.foldLeftCompound}. *) diff --git a/test/Makefile.msvc b/test/Makefile.msvc deleted file mode 100644 index 40dd27f20..000000000 --- a/test/Makefile.msvc +++ /dev/null @@ -1,42 +0,0 @@ -# -# Makefile for CCured. The Microsoft Visual C part -# -COMPILERNAME=MSVC - -CC:=cl -nologo -ifdef RELEASELIB -#matth: we need the frame pointer for CHECK_GETFRAME, so -# use -Oy- to prevent that optimization. - CFLAGS:=-DRELEASE -D_MSVC -Ox -Ob2 -G6 -Oy- -else - CFLAGS:=-D_DEBUG -D_MSVC -Zi -MLd -endif -CONLY:=-c - -OPT_O2:= -Ox -Ob2 -G6 - -OBJOUT:=-Fo -OBJEXT:=obj - -EXEOUT:=-Fe -LIBEXT:=lib -LDEXT:=.exe - -DEF:=-D -ASMONLY:=-Fa -INC:=-I - -CPPSTART:=cl -Dx86_WIN32 -D_MSVC -E -TC -I./lib -DCCURED -CPPOUT:= >%o -CPP:=$(CPPSTART) -FI fixup.h %i $(CPPOUT) - -PATCHECHO:=echo - -AR:=lib -LIBOUT:=-OUT: - -# The system include files to be patched -PATCH_SYSINCLUDES:=stdio.h ctype.h string.h io.h stdarg.h crtdbg.h \ - varargs.h stdlib.h time.h malloc.h - -