* Makefile.in: Accomodate newer gcc's which require linking of c++ programs

with g++.  Fixup output for some compilations.
* cygcheck.cc: Respond to compiler warnings.
* dumper.cc (main): Ditto.
* parse_pe.cc (exclusion::sort_and_check): Ditto.
* setfacl.cc (getaclentry): Ditto.
This commit is contained in:
Christopher Faylor 2000-10-28 05:39:38 +00:00
parent eedc36cb12
commit ce475802f8
6 changed files with 63 additions and 53 deletions

View File

@ -1,3 +1,12 @@
Sat Oct 28 01:37:55 2000 Christopher Faylor <cgf@cygnus.com>
* Makefile.in: Accomodate newer gcc's which require linking of c++
programs with g++. Fixup output for some compilations.
* cygcheck.cc: Respond to compiler warnings.
* dumper.cc (main): Ditto.
* parse_pe.cc (exclusion::sort_and_check): Ditto.
* setfacl.cc (getaclentry): Ditto.
Fri Oct 27 20:20:29 2000 Christopher Faylor <cgf@cygnus.com> Fri Oct 27 20:20:29 2000 Christopher Faylor <cgf@cygnus.com>
* strace.cc (main): Add a '-b' option. * strace.cc (main): Add a '-b' option.

View File

@ -27,6 +27,8 @@ EXEEXT_FOR_BUILD:=@EXEEXT_FOR_BUILD@
CC:=@CC@ CC:=@CC@
CC_FOR_TARGET:=$(CC) CC_FOR_TARGET:=$(CC)
CXX:=${subst gcc,g++,$(CC)}
CXX_FOR_TARGET:=$(CXX)
CFLAGS:=@CFLAGS@ CFLAGS:=@CFLAGS@
CXXFLAGS:=@CXXFLAGS@ -fno-exceptions -nostdinc++ -fno-rtti CXXFLAGS:=@CXXFLAGS@ -fno-exceptions -nostdinc++ -fno-rtti
@ -42,9 +44,7 @@ build_dumper:=${shell test -r $(libbfd) -a -r $(libintl) -a -d $(updir1)/include
DUMPER_INCLUDES:=-I$(bupdir2)/bfd -I$(updir1)/include DUMPER_INCLUDES:=-I$(bupdir2)/bfd -I$(updir1)/include
MINGW_CXXFLAGS:=$(CXXFLAGS) -mno-cygwin $(MINGW_INCLUDES) MINGW_CXXFLAGS:=$(CXXFLAGS) -mno-cygwin $(MINGW_INCLUDES)
MINGW_CFLAGS:=$(CFLAGS) -mno-cygwin $(MINGW_INCLUDES) MINGW_CFLAGS:=-mno-cygwin $(MINGW_INCLUDES)
DUMPER_CFLAGS:=$(CFLAGS) $(INCLUDES) $(DUMPER_INCLUDES)
libcygwin:=$(cygwin_build)/libcygwin.a libcygwin:=$(cygwin_build)/libcygwin.a
libuser32:=$(w32api_lib)/libuser32.a libuser32:=$(w32api_lib)/libuser32.a
@ -89,23 +89,44 @@ all: Makefile $(PROGS)
strace.exe: strace.cc mingw_getopt.o $(MINGW_DEP_LDLIBS) strace.exe: strace.cc mingw_getopt.o $(MINGW_DEP_LDLIBS)
ifdef VERBOSE ifdef VERBOSE
$(CC) $(MINGW_CXXFLAGS) -o $@ ${wordlist 1,2,$^} -B$(mingw_build)/ $(MINGW_LDFLAGS) $(CXX) $(MINGW_CXXFLAGS) -o $@ ${wordlist 1,2,$^} -B$(mingw_build)/ $(MINGW_LDFLAGS)
else else
@echo $(CC) -o $@ ${wordlist 1,2,$^} ${filter-out -B%, $(MINGW_CXXFLAGS) $(MINGW_LDFLAGS)};\ @echo $(CXX) -o $@ ${wordlist 1,2,$^} ${filter-out -B%, $(MINGW_CXXFLAGS) $(MINGW_LDFLAGS)};\
$(CC) $(MINGW_CXXFLAGS) -o $@ ${wordlist 1,2,$^} -B$(mingw_build)/ $(MINGW_LDFLAGS) $(CXX) $(MINGW_CXXFLAGS) -o $@ ${wordlist 1,2,$^} -B$(mingw_build)/ $(MINGW_LDFLAGS)
endif endif
dumper.o: dumper.cc dumper.h dumper.o: dumper.cc dumper.h
$(CC) -c -o $@ $(DUMPER_CFLAGS) ${firstword $^} ifdef VERBOSE
$(COMPILE_CC) $c -o $@ $(DUMPER_INCLUDES) ${firstword $^}
else
@echo $(CC) $c $(CFLAGS) $(DUMPER_INCLUDES) ... $(basename $@).cc;\
$(COMPILE_CC) $c -o $(@D)/$(basename $@)$o $(DUMPER_INCLUDES) $<
endif
module_info.o: module_info.cc module_info.o: module_info.cc
$(CC) -c -o $@ $(DUMPER_CFLAGS) $^ ifdef VERBOSE
$(COMPILE_CC) $c -o $@ $(DUMPER_INCLUDES) ${firstword $^}
else
@echo $(CC) $c $(CFLAGS) $(DUMPER_INCLUDES) ... $(basename $@).cc;\
$(COMPILE_CC) $c -o $(@D)/$(basename $@)$o $(DUMPER_INCLUDES) $<
endif
parse_pe.o: parse_pe.cc dumper.h parse_pe.o: parse_pe.cc dumper.h
$(CC) -c -o $@ $(DUMPER_CFLAGS) ${firstword $^} ifdef VERBOSE
$(COMPILE_CC) $c -o $@ $(DUMPER_INCLUDES) ${firstword $^}
else
@echo $(CC) $c $(CFLAGS) $(DUMPER_INCLUDES) ... $(basename $@).cc;\
$(COMPILE_CC) $c -o $(@D)/$(basename $@)$o $(DUMPER_INCLUDES) $<
endif
mingw_getopt.o: $(cygwin_source)/lib/getopt.c mingw_getopt.o: $(cygwin_source)/lib/getopt.c
$(CC) -c -o $@ $(MINGW_CFLAGS) $^ ifdef VERBOSE
$(COMPILE_CC) $c -o $(@D)/$(basename $@)$o $(MINGW_CFLAGS) $<
else
@echo $(CC) $c -o $(@D)/$(basename $@)$o $(MINGW_CFLAGS) ... $^;\
$(COMPILE_CC) $c -o $(@D)/$(basename $@)$o $(MINGW_CFLAGS) $<
endif
clean: clean:
rm -f *.o $(CLEAN_PROGS) rm -f *.o $(CLEAN_PROGS)
@ -135,16 +156,16 @@ warn_dumper:
dumper.exe: module_info.o parse_pe.o dumper.o $(ALL_DEP_LDLIBS) dumper.exe: module_info.o parse_pe.o dumper.o $(ALL_DEP_LDLIBS)
ifdef VERBOSE ifdef VERBOSE
$(CC) -o $@ ${wordlist 1,3,$^} -B$(cygwin_build)/ $(DUMPER_LDFLAGS) $(CXX) -o $@ ${wordlist 1,3,$^} -B$(cygwin_build)/ $(DUMPER_LDFLAGS)
else else
@echo $(CC) -o $@ ${wordlist 1,3,$^} ${filter-out -B%, $(DUMPER_LDFLAGS)};\ @echo $(CXX) -o $@ ${wordlist 1,3,$^} ${filter-out -B%, $(DUMPER_LDFLAGS)};\
$(CC) -o $@ ${wordlist 1,3,$^} -B$(cygwin_build)/ $(DUMPER_LDFLAGS) $(CXX) -o $@ ${wordlist 1,3,$^} -B$(cygwin_build)/ $(DUMPER_LDFLAGS)
endif endif
%.exe: %.o $(ALL_DEP_LDLIBS) %.exe: %.o $(ALL_DEP_LDLIBS)
ifdef VERBOSE ifdef VERBOSE
$(CC) -o $@ ${firstword $^} -B$(cygwin_build)/ $(ALL_LDFLAGS) $(CXX) -o $@ ${firstword $^} -B$(cygwin_build)/ $(ALL_LDFLAGS)
else else
@echo $(CC) -o $@ ${firstword $^} ${filter-out -B%, $(ALL_LDFLAGS)};\ @echo $(CXX) -o $@ ${firstword $^} ${filter-out -B%, $(ALL_LDFLAGS)};\
$(CC) -o $@ ${firstword $^} -B$(cygwin_build)/ $(ALL_LDFLAGS) $(CXX) -o $@ ${firstword $^} -B$(cygwin_build)/ $(ALL_LDFLAGS)
endif endif

View File

@ -61,38 +61,17 @@ struct
} }
common_apps[] = common_apps[] =
{ {
{ {"bash", 0},
"bash", 0} {"cat", 0},
, {"cpp", 1},
{ {"find", 0},
"cat", 0} {"gcc", 0},
, {"gdb", 0},
{ {"ld", 0},
"cpp", 1} {"ls", 0},
, {"make", 0},
{ {"sh", 0},
"find", 0} {0, 0}
,
{
"gcc", 0}
,
{
"gdb", 0}
,
{
"ld", 0}
,
{
"ls", 0}
,
{
"make", 0}
,
{
"sh", 0}
,
{
0, 0}
}; };
int num_paths = 0, max_paths = 0; int num_paths = 0, max_paths = 0;
@ -1038,7 +1017,8 @@ struct option longopts[] = {
{"help", no_argument, NULL, 'h'}, {"help", no_argument, NULL, 'h'},
{0, no_argument, NULL, 0} {0, no_argument, NULL, 0}
}; };
char *opts = "srvkh";
char opts[] = "srvkh";
int int
main (int argc, char **argv) main (int argc, char **argv)

View File

@ -79,7 +79,7 @@ dumper::dumper (DWORD pid, DWORD tid, const char *file_name)
dumper_abort (); dumper_abort ();
} }
dumper: :~dumper () dumper::~dumper ()
{ {
close (); close ();
free (file_name); free (file_name);
@ -740,7 +740,7 @@ int
main (int argc, char **argv) main (int argc, char **argv)
{ {
int opt; int opt;
char *p = ""; const char *p = "";
DWORD pid; DWORD pid;
while ((opt = getopt (argc, argv, "dc:")) != EOF) while ((opt = getopt (argc, argv, "dc:")) != EOF)

View File

@ -49,7 +49,7 @@ exclusion::sort_and_check ()
process_mem_region *q = p + 1; process_mem_region *q = p + 1;
if (p->base + size > q->base) if (p->base + size > q->base)
{ {
fprintf (stderr, "region error @ %08x", p->base); fprintf (stderr, "region error @ %08x", (unsigned) p->base);
return 0; return 0;
} }
} }

View File

@ -112,7 +112,7 @@ getaclentry (action_t action, char *c, aclent_t *ace)
return FALSE; return FALSE;
if (ace->a_type & (USER_OBJ | GROUP_OBJ)) if (ace->a_type & (USER_OBJ | GROUP_OBJ))
{ {
if (c2 = strchr (c, ':')) if ((c2 = strchr (c, ':')))
{ {
if (action == Delete) if (action == Delete)
return FALSE; return FALSE;