[Openmcl-cvs-notifications] r14930 - in /trunk/source/lisp-kernel: threads.h win32/Makefile win32/Makefile.mingw win64/Makefile win64/pei-x86-64.x
rme at clozure.com
rme at clozure.com
Fri Aug 5 14:52:39 CDT 2011
Author: rme
Date: Fri Aug 5 14:52:39 2011
New Revision: 14930
Log:
Update Windows lisp kernel makefiles to use mingw64 Cygwin packages.
Update the win64 linker script. In threads.h, make the definition of
struct timespec conditional on NEEDS_TIMESPEC. (The mingw64 headers
end up defining struct timespec, so nothing defines NEEDS_TIMESPEC,
but I'm leaving it in there for now anyway.)
To build the lisp kernel on Windows, go to cygwin.com, download
setup.exe, and use it install the following packages:
* make
* m4
If you want to build the 32-bit lisp kernel, add these packages:
* mingw64-i686-binutils
* mingw64-i686-gcc-core
* mingw64-i686-headers
* mingw64-i686-pthreads
* mingw64-i686-runtime
If you want to build the 64-bit lisp kernel, add these packages:
* mingw64-x86_64-binutils
* mingw64-x86_64-gcc-core
* mingw64-x86_64-headers
* mingw64-x86_64-pthreads
* mingw64-x86_64-runtime
Accept the dependencies (a handful of libraries). Note that you
can install all of these packages if you want to build both 32-
and 64-bit lisp kernels.
Removed:
trunk/source/lisp-kernel/win32/Makefile.mingw
Modified:
trunk/source/lisp-kernel/threads.h
trunk/source/lisp-kernel/win32/Makefile
trunk/source/lisp-kernel/win64/Makefile
trunk/source/lisp-kernel/win64/pei-x86-64.x
Modified: trunk/source/lisp-kernel/threads.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/threads.h (original)
+++ trunk/source/lisp-kernel/threads.h Fri Aug 5 14:52:39 2011
@@ -51,7 +51,7 @@
#ifdef WINDOWS
#define USE_WINDOWS_SEMAPHORES 1
#undef USE_POSIX_SEMAPHORES
-#ifdef WIN_32
+#ifdef NEED_TIMESPEC
struct timespec {
int tv_sec;
int tv_nsec;
Modified: trunk/source/lisp-kernel/win32/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/win32/Makefile (original)
+++ trunk/source/lisp-kernel/win32/Makefile Fri Aug 5 14:52:39 2011
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2008 Clozure Associates
+# Copyright (C) 2008-2011 Clozure Associates
# This file is part of Clozure CL. =
#
# Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
@@ -13,14 +13,28 @@
# The LLGPL is also available online at
# http://opensource.franz.com/preamble.html
=
+# This makefile is written to be used with the mingw toolchain
+# running in the Cygwin environment.
+#
+# Install the following Cygwin packages:
+# * make
+# * m4
+# * mingw64-i686-binutils
+# * mingw64-i686-gcc-core
+# * mingw64-i686-headers
+# * mingw64-i686-pthreads
+# * mingw64-i686-runtime
+#
+# Accept the dependencies the installation tool may add.
+
SVN_REVISION=3D$(shell svnversion || echo "unknown")
=
VPATH =3D ../
-RM =3D /bin/rm
-CC =3D gcc
-AS =3D as
+RM =3D rm
+CC =3D i686-w64-mingw32-gcc
+AS =3D i686-w64-mingw32-as
M4 =3D m4
-LD =3D ld
+LD =3D i686-w64-mingw32-ld
ASFLAGS =3D -g --32
M4FLAGS =3D -DWIN_32 -DWINDOWS -DX86 -DX8632
CDEFINES =3D -DWIN_32 -DWINDOWS -D_REENTRANT -DX86 -DX8632 -D_GNU_SOURCE =
-D__MSVCRT__ -D__MSVCRT_VERSION__=3D0x700 -D_WIN32_WINNT=3D0x0502 -DSVN_REV=
ISION=3D$(SVN_REVISION)
@@ -41,8 +55,6 @@
HASH_STYLE=3D"-Wl,--hash-style=3Dsysv"
endif
=
-CRT2 =3D $(shell $(CC) -mno-cygwin -print-file-name=3Dcrt2.o)
-
# There may be some confusion about whether or not C symbols have
# leading underscores or not. The assembler sources seem to
# expect them to and mingw import libs seem to use them, but
@@ -57,7 +69,7 @@
.s.o:
$(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
.c.o:
- $(CC) -include ../$(PLATFORM_H) -c $< $(CDEFINES) $(CDEBUG) $(COPT) $(WFO=
RMAT) ${SUPPRESS_UNDERSCORES} -mno-cygwin -o $@
+ $(CC) -m32 -include ../$(PLATFORM_H) -c $< $(CDEFINES) $(CDEBUG) $(COPT) =
$(WFORMAT) ${SUPPRESS_UNDERSCORES} -o $@
=
# order matters: x86-spjump32.o must be first.
SPOBJ =3D x86-spjump32.o x86-spentry32.o x86-subprims32.o
@@ -81,22 +93,13 @@
KSPOBJ =3D $(SPOBJ)
all: ../../wx86cl.exe
=
-# Order matters: libs that provide definitions must follow libs that
-# reference them. (It's legal to use -lfoo multiple times to try to
-# work around this.)
-LIBGCC =3D $(shell $(CC) -mno-cygwin -print-libgcc-file-name)
-OSLIBS =3D -L/usr/lib/w32api -L/mingw/lib -L/usr/lib/mingw\
- -lm -lpsapi -lws2_32 -lmingw32 $(LIBGCC) -lmoldname -lmingwex \
- -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 $(GCCLIB) \
- -lmoldname -lmingwex -lmsvcrt
-
-
+OSLIBS =3D -lpsapi -lws2_32
=
IMAGE_BASE =3D--image-base=3D0x10000
=
../../wx86cl.exe: $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
- ld -o ../../wx86cl.exe $(IMAGE_BASE) --enable-auto-import \
- $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(CRT2) $(OSLIBS) $(LIBGCC) $(LATELIBS)
+ $(CC) -m32 -o ../../wx86cl.exe $(IMAGE_BASE) --enable-auto-import \
+ $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(OSLIBS)
=
=
$(SPOBJ): $(SPINC)
Removed: trunk/source/lisp-kernel/win32/Makefile.mingw
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/win32/Makefile.mingw (original)
+++ trunk/source/lisp-kernel/win32/Makefile.mingw (removed)
@@ -1,121 +1,0 @@
-#
-# Copyright (C) 2008 Clozure Associates
-# This file is part of Clozure CL. =
-#
-# Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
-# License , known as the LLGPL and distributed with Clozure CL as the
-# file "LICENSE". The LLGPL consists of a preamble and the LGPL,
-# which is distributed with Clozure CL as the file "LGPL". Where these
-# conflict, the preamble takes precedence. =
-#
-# Clozure CL is referenced in the preamble as the "LIBRARY."
-#
-# The LLGPL is also available online at
-# http://opensource.franz.com/preamble.html
-
-# This makefile is written to be used with the mingw toolchain
-# running in the Cygwin environment.
-#
-# Install the following Cygwin packages:
-# make, m4, mingw-gcc-core, mingw-runtime, mingw-pthreads, mingw-w32-api
-# mingw-binutils
-#
-# Accept any dependencies the installation tool adds.
-
-SVN_REVISION=3D$(shell svnversion || echo "unknown")
-
-VPATH =3D ../
-RM =3D /bin/rm
-CC =3D i686-pc-mingw32-gcc
-AS =3D i686-pc-mingw32-as
-M4 =3D m4
-LD =3D i686-pc-mingw32-ld
-ASFLAGS =3D -g --32
-M4FLAGS =3D -DWIN_32 -DWINDOWS -DX86 -DX8632
-CDEFINES =3D -DWIN_32 -DWINDOWS -D_REENTRANT -DX86 -DX8632 -D_GNU_SOURCE =
-D__MSVCRT__ -D__MSVCRT_VERSION__=3D0x700 -D_WIN32_WINNT=3D0x0502 -DSVN_REV=
ISION=3D$(SVN_REVISION)
-CDEBUG =3D -g
-COPT =3D -O
-# Once in a while, -Wformat says something useful. The odds are against t=
hat,
-# however.
-WFORMAT =3D -Wno-format
-PLATFORM_H =3D platform-win32.h
-
-# If the linker supports a "--hash-style=3D" option, use traditional
-# SysV hash tables. (If it doesn't support that option, assume
-# that traditional hash tables will be used by default.)
-ld_has_hash_style =3D $(shell $(LD) --help | grep "hash-style=3D")
-ifeq ($(ld_has_hash_style),)
-HASH_STYLE=3D
-else
-HASH_STYLE=3D"-Wl,--hash-style=3Dsysv"
-endif
-
-# There may be some confusion about whether or not C symbols have
-# leading underscores or not. The assembler sources seem to
-# expect them to and mingw import libs seem to use them, but
-# it's not clear whether or not native win64 libraries use this
-# convention (and I'm not sure whether the Cygwin-hosted win64
-# toolchain behaves the same way as when hosted on Linux ...
-# The compiler default seems to be to use them; if we want to
-# suppress their use, uncomment the following:
-
-SUPPRESS_UNDERSCORES=3D#-fno-leading-underscore
-
-.s.o:
- $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
-.c.o:
- $(CC) -include ../$(PLATFORM_H) -c $< $(CDEFINES) $(CDEBUG) $(COPT) $(WFO=
RMAT) ${SUPPRESS_UNDERSCORES} -o $@
-
-# order matters: x86-spjump32.o must be first.
-SPOBJ =3D x86-spjump32.o x86-spentry32.o x86-subprims32.o
-ASMOBJ =3D x86-asmutils32.o imports.o
-
-COBJ =3D pmcl-kernel.o gc-common.o x86-gc.o bits.o x86-exceptions.o \
- image.o thread_manager.o lisp-debug.o memory.o windows-calls.o
-
-DEBUGOBJ =3D lispdcmd.o plprint.o plsym.o xlbt.o x86_print.o
-KERNELOBJ=3D $(COBJ) x86-asmutils32.o imports.o
-
-SPINC =3D lisp.s m4macros.m4 x86-constants.s x86-macros.s errors.s x86-uuo=
.s \
- x86-constants32.s
-
-CHEADERS =3D area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \
- lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
- threads.h x86-constants32.h x86-exceptions.h lisptypes.h \
- $(PLATFORM_H) constants.h os-windows.h
-
-
-KSPOBJ =3D $(SPOBJ)
-all: ../../wx86cl.exe
-
-CRT2 =3D $(shell $(CC) -mno-cygwin -print-file-name=3Dcrt2.o)
-LIBGCC =3D $(shell $(CC) -print-libgcc-file-name)
-# Order matters: libs that provide definitions must follow libs that
-# reference them. (It's legal to use -lfoo multiple times to try to
-# work around this.)
-OSLIBS =3D -L/usr/i686-pc-mingw32/sys-root/mingw/lib \
- -lm -lpsapi -lws2_32 -lmingw32 -lmoldname -lmingwex \
- -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 \
- -lmoldname -lmingwex -lmsvcrt $(LIBGCC)
-
-IMAGE_BASE =3D--image-base=3D0x10000
-
-../../wx86cl.exe: $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile
- $(LD) -o ../../wx86cl.exe $(IMAGE_BASE) --enable-auto-import \
- $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(CRT2) $(OSLIBS) $(LIBGCC) $(LATELIBS)
-
-
-$(SPOBJ): $(SPINC)
-$(ASMOBJ): $(SPINC)
-$(COBJ): $(CHEADERS)
-$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
-
-
-cclean:
- $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../wx86cl.exe
-
-clean: cclean
- $(RM) -f $(SPOBJ)
-
-strip: ../../wx86cl.exe
- strip -g ../../wx86cl.exe
Modified: trunk/source/lisp-kernel/win64/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/win64/Makefile (original)
+++ trunk/source/lisp-kernel/win64/Makefile Fri Aug 5 14:52:39 2011
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2007 Clozure Associates
+# Copyright (C) 2007-2011 Clozure Associates
# This file is part of Clozure CL. =
#
# Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
@@ -13,10 +13,24 @@
# The LLGPL is also available online at
# http://opensource.franz.com/preamble.html
=
+# This makefile is written to be used with the mingw toolchain
+# running in the Cygwin environment.
+#
+# Install the following Cygwin packages:
+# * make
+# * m4
+# * mingw64-x86_64-binutils
+# * mingw64-x86_64-gcc-core
+# * mingw64-x86_64-headers
+# * mingw64-x86_64-pthreads
+# * mingw64-x86_64-runtime
+#
+# Accept the dependencies the installation tool may add.
+
SVN_REVISION=3D$(shell svnversion || echo "unknown")
=
VPATH =3D ../
-RM =3D /bin/rm
+RM =3D rm
# gcc64, as64: until there's a real win64 gcc, assume that gcc and gas
# are installed under these names
CC =3D x86_64-w64-mingw32-gcc
Modified: trunk/source/lisp-kernel/win64/pei-x86-64.x
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/win64/pei-x86-64.x (original)
+++ trunk/source/lisp-kernel/win64/pei-x86-64.x Fri Aug 5 14:52:39 2011
@@ -2,21 +2,27 @@
SEARCH_DIR("=3D/usr/local/lib"); SEARCH_DIR("=3D/lib"); SEARCH_DIR("=3D/us=
r/lib");
SECTIONS
{
+ /* Make the virtual address and file offset synced if the alignment is
+ lower than the target page size. */
. =3D SIZEOF_HEADERS;
. =3D ALIGN(__section_alignment__);
+
.spfoo __image_base__ + __section_alignment__ :
{
__spfoo_start__ =3D . ;
. =3D __spfoo_start__ + 0x10000 ;
__spfoo_end__ =3D . ;
}
+
.text BLOCK(__section_alignment__) :
{
*(.init)
*(.text)
*(SORT(.text$*))
+ *(.text.*)
*(.glue_7t)
*(.glue_7)
+ . =3D ALIGN(8);
___CTOR_LIST__ =3D .; __CTOR_LIST__ =3D . ;
LONG (-1); LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*)); LONG (0);=
LONG (0);
___DTOR_LIST__ =3D .; __DTOR_LIST__ =3D . ;
@@ -31,7 +37,7 @@
on fork. This used to be named ".data". The linker used
to include this between __data_start__ and __data_end__, but that
breaks building the cygwin32 dll. Instead, we name the section
- ".data_cygwin_nocopy" and explictly include it after __data_end__. */
+ ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
.data BLOCK(__section_alignment__) :
{
__data_start__ =3D . ;
@@ -46,16 +52,26 @@
{
*(.rdata)
*(SORT(.rdata$*))
- *(.eh_frame)
- ___RUNTIME_PSEUDO_RELOC_LIST__ =3D .;
- __RUNTIME_PSEUDO_RELOC_LIST__ =3D .;
+ __rt_psrelocs_start =3D .;
*(.rdata_runtime_pseudo_reloc)
- ___RUNTIME_PSEUDO_RELOC_LIST_END__ =3D .;
- __RUNTIME_PSEUDO_RELOC_LIST_END__ =3D .;
+ __rt_psrelocs_end =3D .;
+ }
+ __rt_psrelocs_size =3D __rt_psrelocs_end - __rt_psrelocs_start;
+ ___RUNTIME_PSEUDO_RELOC_LIST_END__ =3D .;
+ __RUNTIME_PSEUDO_RELOC_LIST_END__ =3D .;
+ ___RUNTIME_PSEUDO_RELOC_LIST__ =3D . - __rt_psrelocs_size;
+ __RUNTIME_PSEUDO_RELOC_LIST__ =3D . - __rt_psrelocs_size;
+ .eh_frame BLOCK(__section_alignment__) :
+ {
+ *(.eh_frame*)
}
.pdata BLOCK(__section_alignment__) :
{
- *(.pdata)
+ *(.pdata*)
+ }
+ .xdata BLOCK(__section_alignment__) :
+ {
+ *(.xdata*)
}
.bss BLOCK(__section_alignment__) :
{
@@ -74,6 +90,8 @@
*(.debug$T)
*(.debug$F)
*(.drectve)
+ *(.note.GNU-stack)
+ *(.gnu.lto_*)
}
.idata BLOCK(__section_alignment__) :
{
@@ -84,7 +102,9 @@
/* These zeroes mark the end of the import list. */
LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
SORT(*)(.idata$4)
+ __IAT_start__ =3D .;
SORT(*)(.idata$5)
+ __IAT_end__ =3D .;
SORT(*)(.idata$6)
SORT(*)(.idata$7)
}
@@ -151,6 +171,10 @@
{
*(.debug_pubnames)
}
+ .debug_pubtypes BLOCK(__section_alignment__) (NOLOAD) :
+ {
+ *(.debug_pubtypes)
+ }
/* DWARF 2. */
.debug_info BLOCK(__section_alignment__) (NOLOAD) :
{
@@ -166,7 +190,7 @@
}
.debug_frame BLOCK(__section_alignment__) (NOLOAD) :
{
- *(.debug_frame)
+ *(.debug_frame*)
}
.debug_str BLOCK(__section_alignment__) (NOLOAD) :
{
@@ -202,4 +226,9 @@
{
*(.debug_ranges)
}
+ /* DWARF 4. */
+ .debug_types BLOCK(__section_alignment__) (NOLOAD) :
+ {
+ *(.debug_types) *(.gnu.linkonce.wt.*)
+ }
}
More information about the Openmcl-cvs-notifications
mailing list