* cygload/README: Delete.
* cygload/cygload.cc: Move to winsup.api. Add comments from README. * cygload/cygload.h: Move to winsup.api. * cygload/cygload.exp: Move to winsup.api. * Makefile.in: Remove cygload. * winsup.api/winsup.exp: If a .exp file is detected, run it rather than using standard compile. * winsup.api/resethand.c (main): Use printf to print status or expect thinks something is wrong.
This commit is contained in:
parent
b0b9ccf618
commit
7f9832e774
|
@ -1,3 +1,16 @@
|
||||||
|
2006-01-02 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* cygload/README: Delete.
|
||||||
|
* cygload/cygload.cc: Move to winsup.api. Add comments from README.
|
||||||
|
* cygload/cygload.h: Move to winsup.api.
|
||||||
|
* cygload/cygload.exp: Move to winsup.api.
|
||||||
|
* Makefile.in: Remove cygload.
|
||||||
|
* winsup.api/winsup.exp: If a .exp file is detected, run it rather than
|
||||||
|
using standard compile.
|
||||||
|
|
||||||
|
* winsup.api/resethand.c (main): Use printf to print status or expect
|
||||||
|
thinks something is wrong.
|
||||||
|
|
||||||
2006-01-01 Christopher Faylor <cgf@timesys.com>
|
2006-01-01 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
* winsup.api/resethand.c (main): Remove core dump flag from exit
|
* winsup.api/resethand.c (main): Remove core dump flag from exit
|
||||||
|
|
|
@ -187,7 +187,6 @@ check: $(TESTSUP_LIB_NAME) $(RUNTIME) cygrun.exe testsuite/site.exp
|
||||||
export TCL_LIBRARY ; fi ; \
|
export TCL_LIBRARY ; fi ; \
|
||||||
PATH=$(bupdir)/cygwin:$${PATH} ;\
|
PATH=$(bupdir)/cygwin:$${PATH} ;\
|
||||||
$(RUNTEST) --tool winsup $(RUNTESTFLAGS) ;\
|
$(RUNTEST) --tool winsup $(RUNTESTFLAGS) ;\
|
||||||
$(RUNTEST) --tool cygload $(RUNTESTFLAGS)
|
|
||||||
|
|
||||||
cygrun.o: cygrun.c
|
cygrun.o: cygrun.c
|
||||||
$(CC) $(MINGW_CFLAGS) -o $@ -c $<
|
$(CC) $(MINGW_CFLAGS) -o $@ -c $<
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
# Makefile for cygload
|
|
||||||
|
|
||||||
###
|
|
||||||
### MinGW options
|
|
||||||
###
|
|
||||||
CC = gcc
|
|
||||||
CFLAGS = -mno-cygwin -Wall
|
|
||||||
LINKFLAGS = -lstdc++ -Wl,-e,_cygloadCRTStartup@0
|
|
||||||
|
|
||||||
###
|
|
||||||
### MSVC options
|
|
||||||
###
|
|
||||||
ifndef MSVCDir
|
|
||||||
MSVCDir = C:/cygwin/usr/local/tools/i686_win32/vc7/Vc7
|
|
||||||
endif
|
|
||||||
|
|
||||||
CL = $(MSVCDir)/bin/cl
|
|
||||||
# If you want to look at the assembly, add "/Famsvc-cygload.asm /FAs".
|
|
||||||
MSVCCFLAGS = /nologo /GX /MDd /Zi /W4 /TP
|
|
||||||
MSVCINCLUDES = /I $(MSVCDir)/include /I $(MSVCDir)/PlatformSDK/Include
|
|
||||||
# Using /ENTRY seems to automatically invoke /NODEFAULTLIBS.
|
|
||||||
MSVCLIBS = /link /LIBPATH:$(MSVCDir)/lib /LIBPATH:$(MSVCDir)/PlatformSDK/lib \
|
|
||||||
/ENTRY:cygloadCRTStartup uuid.lib msvcprtd.lib msvcrtd.lib \
|
|
||||||
oldnames.lib kernel32.lib
|
|
||||||
|
|
||||||
all: mingw-cygload.exe
|
|
||||||
|
|
||||||
mingw-cygload.exe: cygload.cc cygload.h
|
|
||||||
$(CC) $(CFLAGS) $< -o $@ $(LINKFLAGS)
|
|
||||||
|
|
||||||
msvc-cygload.exe: cygload.cc cygload.h
|
|
||||||
$(CL) $(MSVCCFLAGS) $(MSVCINCLUDES) $< /o $@ $(MSVCLIBS)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f msvc-cygload.exe msvc-cygload.ilk cygload.obj \
|
|
||||||
msvc-cygload.pdb vc70.pdb mingw-cygload.exe
|
|
|
@ -1,18 +0,0 @@
|
||||||
cygload demonstrates how to dynamically load cygwin1.dll. The default
|
|
||||||
build uses MinGW to compile it; the Makefile also shows how to build
|
|
||||||
it using the Microsoft compiler.
|
|
||||||
|
|
||||||
By default, the program will silently test basic functionality:
|
|
||||||
* Making space on the stack for cygtls
|
|
||||||
* Loading and initializing cygwin1.dll
|
|
||||||
* Path translation
|
|
||||||
* Error handling
|
|
||||||
* Signal handling
|
|
||||||
|
|
||||||
Command line parameters are:
|
|
||||||
|
|
||||||
-v Verbose output
|
|
||||||
-testinterrupts Pause for 30 seconds to allow testing command line
|
|
||||||
interrupts (^C)
|
|
||||||
-cygwin xxx Specifies an alternative DLL to load instead of
|
|
||||||
cygwin1.dll.
|
|
|
@ -1,23 +1,33 @@
|
||||||
// cygload.cpp
|
/* cygload.cc
|
||||||
//
|
|
||||||
// Copyright 2005, Red Hat, Inc.
|
|
||||||
//
|
|
||||||
// Written by Max Kaehn <slothman@electric-cloud.com>
|
|
||||||
//
|
|
||||||
// This software is a copyrighted work licensed under the terms of the
|
|
||||||
// Cygwin license. Please consult the file "CYGWIN_LICENSE" for details.
|
|
||||||
//
|
|
||||||
// Note that dynamically linking to cygwin1.dll automatically places your code
|
|
||||||
// under the GPL unless you purchase a Cygwin Contract with Red Hat, Inc.
|
|
||||||
// See http://www.redhat.com/software/cygwin/ for more information.
|
|
||||||
|
|
||||||
|
Copyright 2005, 2006 Red Hat, Inc.
|
||||||
|
|
||||||
// Options for this program:
|
Written by Max Kaehn <slothman@electric-cloud.com>
|
||||||
// -v Verbose output. Normal operation is entirely silent,
|
|
||||||
// save for errors.
|
This software is a copyrighted work licensed under the terms of the
|
||||||
// -testinterrupts Pauses the program for 30 seconds so you can demonstrate
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for details.
|
||||||
// that it handles ^C properly.
|
|
||||||
// -cygwin Name of DLL to load. Defaults to "cygwin1.dll".
|
Note that dynamically linking to cygwin1.dll automatically places your code
|
||||||
|
under the GPL unless you purchase a Cygwin Contract with Red Hat, Inc.
|
||||||
|
See http://www.redhat.com/software/cygwin/ for more information.
|
||||||
|
|
||||||
|
cygload demonstrates how to dynamically load cygwin1.dll. The default
|
||||||
|
build uses MinGW to compile it; the Makefile also shows how to build
|
||||||
|
it using the Microsoft compiler.
|
||||||
|
|
||||||
|
By default, the program will silently test basic functionality:
|
||||||
|
* Making space on the stack for cygtls
|
||||||
|
* Loading and initializing cygwin1.dll
|
||||||
|
* Path translation
|
||||||
|
* Error handling
|
||||||
|
* Signal handling
|
||||||
|
|
||||||
|
Options for this program:
|
||||||
|
-v Verbose output. Normal operation is entirely silent,
|
||||||
|
save for errors.
|
||||||
|
-testinterrupts Pauses the program for 30 seconds so you can demonstrate
|
||||||
|
that it handles ^C properly.
|
||||||
|
-cygwin Name of DLL to load. Defaults to "cygwin1.dll". */
|
||||||
|
|
||||||
#include "cygload.h"
|
#include "cygload.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
|
@ -66,7 +66,7 @@ namespace cygwin
|
||||||
// gdb reports sizeof(_cygtls) == 3964 at the time of this writing.
|
// gdb reports sizeof(_cygtls) == 3964 at the time of this writing.
|
||||||
// This is at the end of the object so it'll be toward the bottom
|
// This is at the end of the object so it'll be toward the bottom
|
||||||
// of the stack when it gets declared.
|
// of the stack when it gets declared.
|
||||||
char _padding[4096];
|
char _padding[8192];
|
||||||
|
|
||||||
static padding *_main;
|
static padding *_main;
|
||||||
static DWORD _mainTID;
|
static DWORD _mainTID;
|
|
@ -8,7 +8,6 @@ int doit = 0;
|
||||||
void
|
void
|
||||||
ouch (int sig)
|
ouch (int sig)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "ouch %d\n", sig);
|
|
||||||
if (doit++ > 0)
|
if (doit++ > 0)
|
||||||
kill (getpid (), SIGTERM);
|
kill (getpid (), SIGTERM);
|
||||||
}
|
}
|
||||||
|
@ -32,6 +31,6 @@ main (int argc, char **argv)
|
||||||
exit (0x42);
|
exit (0x42);
|
||||||
}
|
}
|
||||||
status &= ~0x80; // remove core dump flag
|
status &= ~0x80; // remove core dump flag
|
||||||
fprintf (stderr, "pid %d exited with status %p\n", pid, (void *) status);
|
printf ("pid %d exited with status %p\n", pid, (void *) status);
|
||||||
exit (argc == 1 ? !(status == SIGSEGV) : !(status == SIGTERM));
|
exit (argc == 1 ? !(status == SIGSEGV) : !(status == SIGTERM));
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ proc ws_spawn {cmd args} {
|
||||||
|
|
||||||
verbose "Filter: $test_filter"
|
verbose "Filter: $test_filter"
|
||||||
|
|
||||||
foreach src [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.c] {
|
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.{cc,c}]] {
|
||||||
if { $test_filter != "" && ! [regexp $test_filter $src] } {
|
if { $test_filter != "" && ! [regexp $test_filter $src] } {
|
||||||
verbose -log "Skipping $src"
|
verbose -log "Skipping $src"
|
||||||
continue
|
continue
|
||||||
|
@ -48,6 +48,9 @@ foreach src [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.c] {
|
||||||
clear_xfail
|
clear_xfail
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ file exists "$srcdir/$subdir/$basename.exp" ] then {
|
||||||
|
source "$srcdir/$subdir/$basename.exp"
|
||||||
|
} else {
|
||||||
ws_spawn "$CC -nodefaultlibs -mwin32 $CFLAGS $src $add_includes $add_libs $runtime_root/binmode.o -lgcc $runtime_root/libcygwin0.a -lkernel32 -luser32 -o $base.exe"
|
ws_spawn "$CC -nodefaultlibs -mwin32 $CFLAGS $src $add_includes $add_libs $runtime_root/binmode.o -lgcc $runtime_root/libcygwin0.a -lkernel32 -luser32 -o $base.exe"
|
||||||
if { $rv != "" } {
|
if { $rv != "" } {
|
||||||
verbose -log "$rv"
|
verbose -log "$rv"
|
||||||
|
@ -78,4 +81,5 @@ foreach src [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.c] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue