Re: git build on msys fails (and fix)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Dec 1, 2008 at 3:02 PM, dhruva <dhruvakm@xxxxxxxxx> wrote:
> On Mon, Dec 1, 2008 at 2:36 PM, Johannes Sixt <j.sixt@xxxxxxxxxxxxx> wrote:
>> dhruva schrieb:
>>> Hello,
>>>  I build git on msys environment regularly. With the recent changes to
>>> add cache preload facility (commit ID:
>>> 671c9b7e315db89081cc69f83a8f405e4aca37bc) brings in dependency on
>>> pthreads. This is not available in the msys distribution which was
>>> part of the git build distro. I installed libpthread for mingw to get
>>> the related headers and libraries. I had to make some minor changes to
>>> libpthread installation. I copied the 'setjmp.h' from my other mingw
>>> installation and had to had edit it to remove some mingw specific
>>> macros.
>>>
>>> @:/e/users/dhruva/stub/repo/git/git
>>> [520]$ diff -u /e/tools/gnu/include/setjmp.h /mingw/include/setjmp.h
>>> --- /e/tools/gnu/include/setjmp.h       Sun Oct  5 04:01:15 2008
>>> +++ /mingw/include/setjmp.h     Sun Nov 30 16:18:00 2008
>>> @@ -36,7 +36,7 @@
>>>   * The function provided by CRTDLL which appears to do the actual work
>>>   * of setjmp.
>>>   */
>>> -_CRTIMP int __cdecl __MINGW_NOTHROW _setjmp (jmp_buf);
>>> +int __cdecl _setjmp (jmp_buf);
>>>
>>>  #define        setjmp(x)       _setjmp(x)
>>>
>>> @@ -44,7 +44,7 @@
>>>   * Return to the last setjmp call and act as if setjmp had returned
>>>   * nVal (which had better be non-zero!).
>>>   */
>>> -_CRTIMP void __cdecl __MINGW_NOTHROW longjmp (jmp_buf, int)
>>> __MINGW_ATTRIB_NORETURN;
>>> +void __cdecl longjmp (jmp_buf, int);
>>>
>>>  #ifdef __cplusplus
>>>  }
>>>
>>> Also,
>>>  had to copy a pthread library with a dfferent name to the standard name:
>>> $cp libpthreadGC2.a libpthread.a
>>>
>>> The build went fine and am using the new binaries.
>>
>> Would you please push your addition to the mob branch of
>> git://repo.or.cz/msysgit.git? The push URL is repo.or.cz:/srv/git/msysgit.git
>>
>> (But notice that some commits are on the mob branch currently that are not
>> in any other branch; hence, you better build on top of them so that they
>> are not lost when you push to mob.)
>>
>> -- Hannes
>>
>
> I am not using git from the above repo. I am using it from:
> git://git2.kernel.org/pub/scm/git/git.git
>
> I will clone from the repo you have mentioned and push my changes,
> that will take some time. I have started the clone now...

I added a new remote to pull changes from the msys repo and it is
taking a long time (bad network). In the meantime for some wanting to
play:

1. I downloaded pthreads for windows from:
ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe
2. Extracted and copied the headers, libraries to
msysgit/mingw/include and msysgit/mingw/lib folders. I made a copy of
DLL in bin folder too so that runtime can pick it.
3. I copied msysgit/mingw/lib/libpthreadGC2.a as
msysgit/mingw/lib/libpthread.a as -lpthread needs a lib with that name
4. Copied the setjmp.h header referred by pthread.h from my native
mingw installation and modified it (refer my earlier mail). The
modified contents of the new file that needs to go under
msysgit/mingw/include/setjmp.h:

/*
 * setjmp.h
 * This file has no copyright assigned and is placed in the Public Domain.
 * This file is a part of the mingw-runtime package.
 * No warranty is given; refer to the file DISCLAIMER within the package.
 *
 * Declarations supporting setjmp and longjump, a method for avoiding
 * the normal function call return sequence. (Bleah!)
 *
 */

#ifndef _SETJMP_H_
#define _SETJMP_H_

/* All the headers include this file. */
#include <_mingw.h>

#ifndef RC_INVOKED

#ifdef __cplusplus
extern "C" {
#endif

/*
 * The buffer used by setjmp to store the information used by longjmp
 * to perform it's evil goto-like work. The size of this buffer was
 * determined through experimentation; it's contents are a mystery.
 * NOTE: This was determined on an i386 (actually a Pentium). The
 *       contents could be different on an Alpha or something else.
 */
#define _JBLEN 16
#define _JBTYPE int
typedef _JBTYPE jmp_buf[_JBLEN];

/*
 * The function provided by CRTDLL which appears to do the actual work
 * of setjmp.
 */
int __cdecl _setjmp (jmp_buf);

#define setjmp(x)       _setjmp(x)

/*
 * Return to the last setjmp call and act as if setjmp had returned
 * nVal (which had better be non-zero!).
 */
void __cdecl longjmp (jmp_buf, int);

#ifdef __cplusplus
}
#endif

#endif  /* Not RC_INVOKED */

#endif  /* Not _SETJMP_H_ */

5. I modified git Makefile as:
diff --git a/Makefile b/Makefile
index 649cfb8..71f995d 100644
--- a/Makefile
+++ b/Makefile
@@ -776,6 +776,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
        NO_PERL_MAKEMAKER = YesPlease
        NO_POSIX_ONLY_PROGRAMS = YesPlease
        NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
+       THREADED_DELTA_SEARCH = YesPlease
        COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat
-Icompat/regex -Icompat/fnmatch
        COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1
        COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"

-dhruva

-- 
Contents reflect my personal views only!
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux