Subject: Re: libgcc.a (Undefined Reference to VirtualProtect)
From: [email-masked] (Scott Christley)

17 Dec 1996 11:18:31 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Sender: [email-masked]
X-Mailer: Windows Eudora Light Version 1.5.2
Original-To: Raja <[email-masked]>, [email-masked]
Original-Cc: [email-masked]
Original-Sender: [email-masked]

Raja,

You need to apply this patch to libgcc2.c and recompile libgcc.a within GCC;
the program does not get the proper prototype for VirtualProtect().

Index: libgcc2.c
===================================================================
RCS file: /MBCD/Repository/gcc-cygnus/libgcc2.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 libgcc2.c
*** libgcc2.c   1996/12/10 15:42:43     1.1.1.1
--- libgcc2.c   1996/12/12 15:05:44
***************
*** 2781,2787 ****
  /* Jump to a trampoline, loading the static chain address.  */

  #ifdef WINNT
!
  long getpagesize()
  {
  #ifdef _ALPHA_
--- 2781,2787 ----
  /* Jump to a trampoline, loading the static chain address.  */

  #ifdef WINNT
! #include <windows.h>
  long getpagesize()
  {
  #ifdef _ALPHA_

Scott

At 10:28 PM 12/16/96 -0800, Raja wrote:
>HI all,
>I am trying to build binutils-2.6 with new beta17.1 Cygnus Toolkit.
>When it is trying to link  I am getting some error like this.
>I am linking my own built libraries for my assembler. I use the same 
>makefile with DJGPP and it seemed to compiled and linked fine atleast.
>Am I missing something here? 
>Any help would be greatly appreciated.
>
>****This is the make command*****
>
>gcc   -g    -o as.new targ-cpu.o obj-format.o atof-targ.o app.o as.o 
>atof-generic.o bignum-copy.o cond.o expr.o flonum-konst.o flonum-copy.o 
>flonum-mult.o frags.o hash.o input-file.o input-scrub.o literal.o
messages.o output-file.o 
>read.o subsegs.o symbols.o write.o listing.o ecoff.o stabs.o sb.o macro.o  
>../opcodes/libopcodes.a ../bfd/libbfd.a  ../libiberty/libiberty.a
>*****
>
>***This is the error I got****
>beta17.1.C:\CYGNUS\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32/cygnus-2.7.2-9
61023/libgcc.a
>(_trampoline.o): In function `mprotect':
>/pizza/mushroom/noer/beta17/src/gcc/libgcc2.c(.text+0x67): undefined 
>reference t
>o `VirtualProtect'
>MAKE.EXE: *** [as.new] Error 1
>
>
>
>Thanks in Advance,
>Raja
>-
>For help on using this list, send a message to
>"[email-masked]" with one line of text: "help".
>

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".