This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem with latest setup-x86.exe


On only one of my Windows 7 machines the latest setup-x86.exe
works but always exits with an Access Violation.

So, I downloaded the source to setup and built it.

But in order to make the build work, I had to remove -Werror
from the Makefile and add a definition for ARRAYSIZE to main.cc.

The fix to the Access violation was to remove an extra "_" in
the code for the argv handling in main.cc

This is just FWIW -- but it fixed my problem. The patches
I used follow:



*** ./setup/Makefile.orig	2013-11-12 10:27:00.812425300 -0700
--- ./setup/Makefile	2013-11-12 10:28:53.698882000 -0700
***************
*** 462,468 ****
  BASECXXFLAGS = -Wall -Wno-uninitialized -Wpointer-arith -Wcomments \
  	       -Wcast-align -Wwrite-strings -fno-builtin-sscanf

! AM_CXXFLAGS = -Werror $(BASECXXFLAGS) ${$(*F)_CXXFLAGS}
  AM_CFLAGS = $(AM_CXXFLAGS) -Wmissing-declarations -Winline \
  	    -Wstrict-prototypes -Wmissing-prototypes

--- 462,468 ----
  BASECXXFLAGS = -Wall -Wno-uninitialized -Wpointer-arith -Wcomments \
  	       -Wcast-align -Wwrite-strings -fno-builtin-sscanf

! AM_CXXFLAGS = $(BASECXXFLAGS) ${$(*F)_CXXFLAGS}
  AM_CFLAGS = $(AM_CXXFLAGS) -Wmissing-declarations -Winline \
  	    -Wstrict-prototypes -Wmissing-prototypes

*** ./setup/main.cc.orig	2013-11-07 06:14:18.000000000 -0700
--- ./setup/main.cc	2013-11-12 10:29:06.907637500 -0700
***************
*** 85,90 ****
--- 85,94 ----
  extern char **_argv;
  #endif

+ #ifndef ARRAYSIZE
+ #define ARRAYSIZE(_ar) (sizeof (_ar) / sizeof (_ar[0]))
+ #endif
+
  bool is_64bit;

  using namespace std;
***************
*** 233,250 ****
    snprintf(locale, sizeof locale, ".%u", GetACP());
    setlocale(LC_ALL, locale);

!   char **_argv;
    int argc;
!   for (argc = 0, _argv = __argv; *_argv; _argv++)
      ++argc;
!   _argv = __argv;

    try {
      char cwd[MAX_PATH];
      GetCurrentDirectory (MAX_PATH, cwd);
      local_dir = std::string (cwd);

!     if (!GetOption::GetInstance ().Process (argc,_argv, NULL))
        exit (1);

      if (!((string) Arch).size ())
--- 237,254 ----
    snprintf(locale, sizeof locale, ".%u", GetACP());
    setlocale(LC_ALL, locale);

!   char **argv;
    int argc;
!   for (argc = 0, argv = _argv; *argv; argv++)
      ++argc;
!   argv = _argv;

    try {
      char cwd[MAX_PATH];
      GetCurrentDirectory (MAX_PATH, cwd);
      local_dir = std::string (cwd);

!     if (!GetOption::GetInstance ().Process (argc,argv, NULL))
        exit (1);

      if (!((string) Arch).size ())


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]