This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Ada: ugly patch to get successful build on GNU/Linux x86


You still need to generate sinfo.h and einfo.h by hand in the source
directory (with xeinfo einfo.h; xsinfo sinfo.h). If I followed
correctly the discussion Geert is supposed to commit those so it
shouldn't be a requirement for long. (My patch still have some
Makefile leftover but they're commented out so harmless.)

Apply the patch, then:

make bootstrap # ignore compare failure
(cd gcc; make gnat_lib_and_tools)
make install

Should install a compiler able to build a few things.

The patch is obviously incorrect but
- workarounds probable backend numerical attribute problem
- workarounds gnatlib_and_tools dependency problem
- workarounds gnatmem tool not building because of lib missing
- workarounds -Wno-long-long

I'm running the validation suite with the installed compiler, things
seem to go well so far (no bug box or failure, but the first tests
are quite simple :).

-- 
Laurent Guerby <guerby@acm.org>

Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.747
diff -c -3 -p -r1.747 Makefile.in
*** Makefile.in	2001/10/05 04:20:26	1.747
--- Makefile.in	2001/10/05 20:58:38
*************** BOOT_CFLAGS = -g -O2
*** 88,94 ****
  # stage1, as not all versions of gcc understand -Wno-long-long.
  LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
  STRICT_WARN = -Wtraditional @strict1_warn@
! STRICT2_WARN = -Wtraditional -pedantic -Wno-long-long
  
  # This is how we control whether or not the additional warnings are applied.
  .-warn = $(STRICT_WARN)
--- 88,94 ----
  # stage1, as not all versions of gcc understand -Wno-long-long.
  LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
  STRICT_WARN = -Wtraditional @strict1_warn@
! STRICT2_WARN = -Wtraditional -pedantic
  
  # This is how we control whether or not the additional warnings are applied.
  .-warn = $(STRICT_WARN)
Index: gcc/ada/86numaux.adb
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ada/86numaux.adb,v
retrieving revision 1.1
diff -c -3 -p -r1.1 86numaux.adb
*** 86numaux.adb	2001/10/02 13:42:29	1.1
--- 86numaux.adb	2001/10/05 20:58:40
*************** package body Ada.Numerics.Aux is
*** 365,371 ****
  
        Base : Double := X;
  
!       Exp_High : Double := Double'Floor (Abs_Y);
        Exp_Mid  : Double;
        Exp_Low  : Double;
        Exp_Int  : Mantissa_Type;
--- 365,371 ----
  
        Base : Double := X;
  
!       Exp_High : Double := Abs_Y; -- Double'Floor (Abs_Y);
        Exp_Mid  : Double;
        Exp_Low  : Double;
        Exp_Int  : Mantissa_Type;
*************** package body Ada.Numerics.Aux is
*** 585,591 ****
        --                                   e  + e
  
        if abs X > 23.0 then
!          return Double'Copy_Sign (1.0, X);
        end if;
  
        return 1.0 / (1.0 + Exp (-2.0 * X)) - 1.0 / (1.0 + Exp (2.0 * X));
--- 585,591 ----
        --                                   e  + e
  
        if abs X > 23.0 then
!          return 1.0; -- Double'Copy_Sign (1.0, X);
        end if;
  
        return 1.0 / (1.0 + Exp (-2.0 * X)) - 1.0 / (1.0 + Exp (2.0 * X));
Index: gcc/ada/Make-lang.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ada/Make-lang.in,v
retrieving revision 1.1
diff -c -3 -p -r1.1 Make-lang.in
*** Make-lang.in	2001/10/02 13:46:42	1.1
--- Make-lang.in	2001/10/05 20:58:48
*************** gnatlbr$(exeext): force
*** 137,148 ****
  		../gnatlbr$(exeext)
  
  # use target-gcc
! gnattools: $(GCC_PARTS) force
  	$(MAKE) $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
  	   CC="../xgcc -B../" STAGE_PREFIX=../ \
  	   gnatbl$(exeext) gnatchop$(exeext) gnatcmd$(exeext) \
  	   gnatkr$(exeext) gnatlink$(exeext) \
! 	   gnatls$(exeext) gnatmake$(exeext) gnatmem$(exeext) \
  	   gnatprep$(exeext) gnatpsta$(exeext) gnatpsys$(exeext) \
         gnatxref$(exeext) gnatfind$(exeext) $(EXTRA_GNATTOOLS)
  
--- 137,148 ----
  		../gnatlbr$(exeext)
  
  # use target-gcc
! gnattools: force
  	$(MAKE) $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
  	   CC="../xgcc -B../" STAGE_PREFIX=../ \
  	   gnatbl$(exeext) gnatchop$(exeext) gnatcmd$(exeext) \
  	   gnatkr$(exeext) gnatlink$(exeext) \
! 	   gnatls$(exeext) gnatmake$(exeext) \
  	   gnatprep$(exeext) gnatpsta$(exeext) gnatpsys$(exeext) \
         gnatxref$(exeext) gnatfind$(exeext) $(EXTRA_GNATTOOLS)
  
*************** ada.uninstall:
*** 555,560 ****
--- 555,561 ----
  ada.mostlyclean:
  	-$(RM) ada/*$(objext) ada/*.ali ada/b_*.c
  	-$(RM) ada/sdefault.adb ada/stamp-sdefault
+ 	-$(RMDIR) ada/tmp-dir
  	-$(RMDIR) ada/tools
  ada.clean:
  ada.distclean:
Index: gcc/ada/Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ada/Makefile.in,v
retrieving revision 1.1
diff -c -3 -p -r1.1 Makefile.in
*** Makefile.in	2001/10/02 13:46:42	1.1
--- Makefile.in	2001/10/05 20:58:50
*************** exeext =
*** 119,125 ****
--- 119,128 ----
  arext  = .a
  soext  = .so
  shext  =
+ build_exeext = @build_exeext@
  
+ BUILD_GNATMAKE=gnatmake
+ 
  HOST_CC=$(CC)
  HOST_CFLAGS=$(ALL_CFLAGS)
  HOST_CLIB=$(CLIB)
*************** b_gnatfind.o : b_gnatfind.c
*** 2408,2428 ****
  b_gnatdll.c : $(GNATDLL_OBJS)
  	$(GNATBIND) $(ADA_INCLUDES) -o b_gnatdll.c gnatdll.ali
  b_gnatdll.o : b_gnatdll.c
- 
- $(srcdir)/treeprs.ads : treeprs.adt sinfo.ads xtreeprs.spt
- 	(cd $(srcdir); xtreeprs)
- 
- $(srcdir)/einfo.h : einfo.ads einfo.adb xeinfo.spt
- 	(cd $(srcdir); xeinfo einfo.h)
- 
- $(srcdir)/sinfo.h : sinfo.ads xsinfo.spt
- 	(cd $(srcdir); xsinfo sinfo.h)
- 
- $(srcdir)/nmake.adb : nmake.adt sinfo.ads xnmake.spt
- 	(cd $(srcdir); xnmake)
  
! $(srcdir)/nmake.ads :  nmake.adt sinfo.ads xnmake.spt
! 	(cd $(srcdir); xnmake)
  
  ADA_INCLUDE_DIR = $(libsubdir)/adainclude
  ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
--- 2411,2460 ----
  b_gnatdll.c : $(GNATDLL_OBJS)
  	$(GNATBIND) $(ADA_INCLUDES) -o b_gnatdll.c gnatdll.ali
  b_gnatdll.o : b_gnatdll.c
  
! # xtreeprs, xeinfo, xsinfo and xnmake are four tools that need to be
! # built on the build machine in order to generate various host and
! # target independant source files. They are built with the gnatmake
! # provided by the build compiler. Their sources in a separate
! # directory to avoid any interference with the new objects. They are
! # put in the build directory.
! 
! tmp-dir:
! 	mkdir tmp-dir
! 
! xtreeprs$(build_ext) : tmp-dir xtreeprs.adb
! 	cp $(srcdir)/xtreeprs.adb tmp-dir
! 	cd tmp-dir && $(BUILD_GNATMAKE) -g -o ../$@ xtreeprs.adb
! 
! xeinfo$(build_ext) : tmp-dir xeinfo.adb
! 	cp $(srcdir)/xeinfo.adb tmp-dir
! 	cd tmp-dir && $(BUILD_GNATMAKE) -g -o ../$@ xeinfo.adb
! 
! xsinfo$(build_ext) : tmp-dir xsinfo.adb
! 	cp $(srcdir)/xsinfo.adb tmp-dir
! 	cd tmp-dir && $(BUILD_GNATMAKE) -g -o ../$@ xsinfo.adb
! 
! xnmake$(build_ext) : tmp-dir xnmake.adb
! 	cp $(srcdir)/xnmake.adb tmp-dir
! 	cd tmp-dir && $(BUILD_GNATMAKE) -g -o ../$@ xnmake.adb
! 
! # treeprs.ads, einfo.h, sinfo.h, nmake.ads and nmake.adb are generated
! # in the build directory using the previously build tools.
! 
! # treeprs.ads : xtreeprs$(build_ext) treeprs.adt sinfo.ads
! # 	  ./xtreeprs$(build_ext) $(srcdir)/sinfo.ads $(srcdir)/treeprs.adt $@
! # 
! # einfo.h : xeinfo$(build_ext) einfo.ads einfo.adb
! # 	  ./xeinfo$(build_ext) $(srcdir)/einfo.ads $(srcdir)/einfo.adb $@
! # 
! # sinfo.h : xsinfo$(build_ext) sinfo.ads
! # 	  ./xsinfo$(build_ext) $(srcdir)/sinfo.ads $@
! # 
! # nmake.adb : xnmake$(build_ext) nmake.adt sinfo.ads
! # 	  ./xnmake$(build_ext) -b $(srcdir)/sinfo.ads $(srcdir)/nmake.adt nmake.adb
! # 
! # nmake.ads : xnmake$(build_ext) nmake.adt sinfo.ads
! # 	  ./xnmake$(build_ext) -s $(srcdir)/sinfo.ads $(srcdir)/nmake.adt nmake.ads
  
  ADA_INCLUDE_DIR = $(libsubdir)/adainclude
  ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
Index: gcc/ada/a-ngcefu.adb
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ada/a-ngcefu.adb,v
retrieving revision 1.1
diff -c -3 -p -r1.1 a-ngcefu.adb
*** a-ngcefu.adb	2001/10/02 13:51:52	1.1
--- a-ngcefu.adb	2001/10/05 20:58:51
*************** package body Ada.Numerics.Generic_Comple
*** 598,604 ****
           else
              return
                Compose_From_Cartesian
!                 (0.0, Real'Copy_Sign (Sqrt (-ReX), ImX));
           end if;
  
        elsif ReX = 0.0 then
--- 598,604 ----
           else
              return
                Compose_From_Cartesian
!                 (0.0, 0.0); --Real'Copy_Sign (Sqrt (-ReX), ImX));
           end if;
  
        elsif ReX = 0.0 then
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]