diff options
author | shannonjr <shannonjr@pkgsrc.org> | 2004-05-28 22:28:09 +0000 |
---|---|---|
committer | shannonjr <shannonjr@pkgsrc.org> | 2004-05-28 22:28:09 +0000 |
commit | 5090ffc5c258976df94545dda1b62fb4b6ade298 (patch) | |
tree | 5cca70e32d5235b629b05cfa3d1bb3e7b6f67352 /lang | |
parent | 39441ba61a7868b473dc902b601ad6219ce8ec4d (diff) | |
download | pkgsrc-5090ffc5c258976df94545dda1b62fb4b6ade298.tar.gz |
pkg/23871 Ada runtime is not relocatable (same as gcc Bug ada/12950)
part 1/2
Diffstat (limited to 'lang')
-rw-r--r-- | lang/gcc3/distinfo | 9 | ||||
-rw-r--r-- | lang/gcc3/patches/patch-aj | 45 | ||||
-rw-r--r-- | lang/gcc3/patches/patch-ak | 46 | ||||
-rw-r--r-- | lang/gcc3/patches/patch-ap | 15 | ||||
-rw-r--r-- | lang/gcc3/patches/patch-aq | 185 | ||||
-rw-r--r-- | lang/gcc3/patches/patch-ar | 22 |
6 files changed, 313 insertions, 9 deletions
diff --git a/lang/gcc3/distinfo b/lang/gcc3/distinfo index e123c5852e7..63c494f1a59 100644 --- a/lang/gcc3/distinfo +++ b/lang/gcc3/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.17 2004/05/23 14:25:54 tron Exp $ +$NetBSD: distinfo,v 1.18 2004/05/28 22:28:09 shannonjr Exp $ SHA1 (gcc-3.3.3.tar.bz2) = a9efbc34c5dd7fc48f7d700461de4fc014968cab Size (gcc-3.3.3.tar.bz2) = 23279245 bytes @@ -9,9 +9,12 @@ SHA1 (patch-ae) = e5dd184ca1b0c415215e82d0250469792a432741 SHA1 (patch-af) = ee41c43dbb6e710a9399954793c6ff7c4274e515 SHA1 (patch-ag) = 23fecd85ddca19a2c543827b60ea555ffbdcaa6c SHA1 (patch-ai) = bb9f4975769cd104b25b4609a1d4c888bb147bb1 -SHA1 (patch-aj) = 80fead3fdfba3f93a89a7294b45f9633454d35fb -SHA1 (patch-ak) = 9df2be9ed9f92218efce073ed0a727c0311630d0 +SHA1 (patch-aj) = bfbf65150fd6f0eaa50af68bb8e892fff4a2051e +SHA1 (patch-ak) = 53b91c8315e5e2ccb5d74058bdfd33c6f8431ad6 SHA1 (patch-al) = 6294061358e2b618a980e77cbf7bad6231feacbe SHA1 (patch-am) = 8eff72d76b135a9b0318de651341cb08976758b5 SHA1 (patch-an) = c0795339102b4608a3813c3a2d488c71ea972d6f SHA1 (patch-ao) = b02a4bcf07d67511a337165164e8f344c3303fb7 +SHA1 (patch-ap) = d2f55ff6992f6afb106b3c861a8eee0a5b7bd70e +SHA1 (patch-aq) = 1ee8d951e464a154c4f2a3f48d4c2101c2f3d79d +SHA1 (patch-ar) = 1ed0338bde1e863ddcfbc0bdfb77aeafdbef7220 diff --git a/lang/gcc3/patches/patch-aj b/lang/gcc3/patches/patch-aj index a186a5488e9..4a8393bc431 100644 --- a/lang/gcc3/patches/patch-aj +++ b/lang/gcc3/patches/patch-aj @@ -1,8 +1,8 @@ -$NetBSD: patch-aj,v 1.1 2004/04/10 15:47:08 seb Exp $ +$NetBSD: patch-aj,v 1.2 2004/05/28 22:28:09 shannonjr Exp $ ---- gcc/ada/Make-lang.in.orig 2003-07-06 11:48:22.000000000 +0200 -+++ gcc/ada/Make-lang.in 2003-07-06 11:48:44.000000000 +0200 -@@ -210,7 +210,7 @@ +--- gcc/ada/Make-lang.in.orig 2003-07-04 13:53:53.000000000 -0600 ++++ gcc/ada/Make-lang.in +@@ -210,7 +210,7 @@ gnatbind$(exeext): ada/b_gnatb.o $(CONFI $(LIBIBERTY) $(LIBS) $(SYSLIBS) # use target-gcc target-gnatmake target-gnatbind target-gnatlink @@ -11,3 +11,40 @@ $NetBSD: patch-aj,v 1.1 2004/04/10 15:47:08 seb Exp $ $(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \ ADA_INCLUDES="-I- -I../rts"\ CC="../../xgcc -B../../" STAGE_PREFIX=../../ gnattools1 +@@ -904,26 +904,28 @@ ada/sdefault.adb: ada/stamp-sdefault ; @ + ada/stamp-sdefault : $(srcdir)/version.c $(srcdir)/move-if-change \ + Makefile + $(ECHO) "pragma Style_Checks (Off);" >tmp-sdefault.adb ++ $(ECHO) "with Osint; use Osint;" >>tmp-sdefault.adb + $(ECHO) "package body Sdefault is" >>tmp-sdefault.adb +- $(ECHO) " S1 : aliased constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb +- $(ECHO) " S2 : aliased constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb +- $(ECHO) " S3 : aliased constant String := \"$(target)/\";" >>tmp-sdefault.adb +- $(ECHO) " S4 : aliased constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb ++ $(ECHO) " S0 : constant String := \"$(prefix)/\";" >>tmp-sdefault.adb ++ $(ECHO) " S1 : constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb ++ $(ECHO) " S2 : constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb ++ $(ECHO) " S3 : constant String := \"$(target)/\";" >>tmp-sdefault.adb ++ $(ECHO) " S4 : constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb + $(ECHO) " function Include_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb + $(ECHO) " begin" >>tmp-sdefault.adb +- $(ECHO) " return new String'(S1);" >>tmp-sdefault.adb ++ $(ECHO) " return Relocate_Path (S0, S1);" >>tmp-sdefault.adb + $(ECHO) " end Include_Dir_Default_Name;" >>tmp-sdefault.adb + $(ECHO) " function Object_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb + $(ECHO) " begin" >>tmp-sdefault.adb +- $(ECHO) " return new String'(S2);" >>tmp-sdefault.adb ++ $(ECHO) " return Relocate_Path (S0, S2);" >>tmp-sdefault.adb + $(ECHO) " end Object_Dir_Default_Name;" >>tmp-sdefault.adb + $(ECHO) " function Target_Name return String_Ptr is" >>tmp-sdefault.adb + $(ECHO) " begin" >>tmp-sdefault.adb +- $(ECHO) " return new String'(S3);" >>tmp-sdefault.adb ++ $(ECHO) " return Relocate_Path (S0, S3);" >>tmp-sdefault.adb + $(ECHO) " end Target_Name;" >>tmp-sdefault.adb + $(ECHO) " function Search_Dir_Prefix return String_Ptr is" >>tmp-sdefault.adb + $(ECHO) " begin" >>tmp-sdefault.adb +- $(ECHO) " return new String'(S4);" >>tmp-sdefault.adb ++ $(ECHO) " return Relocate_Path (S0, S4);" >>tmp-sdefault.adb + $(ECHO) " end Search_Dir_Prefix;" >>tmp-sdefault.adb + $(ECHO) "end Sdefault;" >> tmp-sdefault.adb + $(srcdir)/move-if-change tmp-sdefault.adb ada/sdefault.adb diff --git a/lang/gcc3/patches/patch-ak b/lang/gcc3/patches/patch-ak index 0242f0ad2f1..79bccebcf8f 100644 --- a/lang/gcc3/patches/patch-ak +++ b/lang/gcc3/patches/patch-ak @@ -1,4 +1,4 @@ -$NetBSD: patch-ak,v 1.1 2004/04/10 15:47:08 seb Exp $ +$NetBSD: patch-ak,v 1.2 2004/05/28 22:28:09 shannonjr Exp $ --- gcc/ada/Makefile.in.orig 2003-07-04 13:53:53.000000000 -0600 +++ gcc/ada/Makefile.in @@ -33,7 +33,49 @@ $NetBSD: patch-ak,v 1.1 2004/04/10 15:47:08 seb Exp $ # The runtime library for gnat comprises two directories. One contains the # Ada source files that the compiler (gnat1) needs -- these files are listed # by ADA_INCLUDE_SRCS -- and the other contains the object files and their -@@ -1609,7 +1633,7 @@ gnattools2: ../stamp-tools +@@ -1585,6 +1609,41 @@ ifeq ($(TOOLSCASE),cross) + vpath %.h ../ + endif + ++ada/sdefault.adb: ada/stamp-sdefault ; @true ++ada/stamp-sdefault : $(srcdir)/version.c $(srcdir)/move-if-change \ ++ Makefile ++ $(ECHO) "pragma Style_Checks (Off);" >tmp-sdefault.adb ++ $(ECHO) "with Osint; use Osint;" >>tmp-sdefault.adb ++ $(ECHO) "package body Sdefault is" >>tmp-sdefault.adb ++ $(ECHO) " S0 : constant String := \"$(prefix)/\";" >>tmp-sdefault.adb ++ $(ECHO) " S1 : constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb ++ $(ECHO) " S2 : constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb ++ $(ECHO) " S3 : constant String := \"$(target)/\";" >>tmp-sdefault.adb ++ $(ECHO) " S4 : constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb ++ $(ECHO) " function Include_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb ++ $(ECHO) " begin" >>tmp-sdefault.adb ++ $(ECHO) " return Relocate_Path (S0, S1);" >>tmp-sdefault.adb ++ $(ECHO) " end Include_Dir_Default_Name;" >>tmp-sdefault.adb ++ $(ECHO) " function Object_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb ++ $(ECHO) " begin" >>tmp-sdefault.adb ++ $(ECHO) " return Relocate_Path (S0, S2);" >>tmp-sdefault.adb ++ $(ECHO) " end Object_Dir_Default_Name;" >>tmp-sdefault.adb ++ $(ECHO) " function Target_Name return String_Ptr is" >>tmp-sdefault.adb ++ $(ECHO) " begin" >>tmp-sdefault.adb ++ $(ECHO) " return Relocate_Path (S0, S3);" >>tmp-sdefault.adb ++ $(ECHO) " end Target_Name;" >>tmp-sdefault.adb ++ $(ECHO) " function Search_Dir_Prefix return String_Ptr is" >>tmp-sdefault.adb ++ $(ECHO) " begin" >>tmp-sdefault.adb ++ $(ECHO) " return Relocate_Path (S0, S4);" >>tmp-sdefault.adb ++ $(ECHO) " end Search_Dir_Prefix;" >>tmp-sdefault.adb ++ $(ECHO) "end Sdefault;" >> tmp-sdefault.adb ++ $(srcdir)/move-if-change tmp-sdefault.adb ada/sdefault.adb ++ touch ada/stamp-sdefault ++ ++ada/sdefault.o : ada/sdefault.ads ada/sdefault.adb ada/types.ads \ ++ ada/unchdeal.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \ ++ ada/unchconv.ads ada/osint.ads ++ + # gnatmake/link tools cannot always be built with gnatmake/link for bootstrap + # reasons: gnatmake should be built with a recent compiler, a recent compiler + # may not generate ALI files compatible with an old gnatmake so it is important +@@ -1609,7 +1668,7 @@ gnattools2: ../stamp-tools TOOLSCASE=native \ ../../gnatchop$(exeext) ../../gnat$(exeext) ../../gnatkr$(exeext) \ ../../gnatls$(exeext) ../../gnatprep$(exeext) \ diff --git a/lang/gcc3/patches/patch-ap b/lang/gcc3/patches/patch-ap new file mode 100644 index 00000000000..ae0c2216f4d --- /dev/null +++ b/lang/gcc3/patches/patch-ap @@ -0,0 +1,15 @@ +$NetBSD: patch-ap,v 1.1 2004/05/28 22:28:09 shannonjr Exp $ + +--- gcc/ada/opt.ads.orig 2002-10-23 01:33:27.000000000 -0600 ++++ gcc/ada/opt.ads +@@ -92,6 +92,10 @@ package Opt is + -- The name of the Ada package generated by the binder (when in Ada mode). + -- This variable may be modified by Gnatbind.Scan_Bind_Arg. + ++ RTS_Lib_Path_Name : String_Ptr := null; ++ RTS_Src_Path_Name : String_Ptr := null; ++ -- Backported from 3.4 ++ + Address_Clause_Overlay_Warnings : Boolean := True; + -- GNAT + -- Set False to disable address clause warnings diff --git a/lang/gcc3/patches/patch-aq b/lang/gcc3/patches/patch-aq new file mode 100644 index 00000000000..79c90acb22c --- /dev/null +++ b/lang/gcc3/patches/patch-aq @@ -0,0 +1,185 @@ +$NetBSD: patch-aq,v 1.1 2004/05/28 22:28:09 shannonjr Exp $ + +--- gcc/ada/osint.adb.orig 2002-10-23 01:33:27.000000000 -0600 ++++ gcc/ada/osint.adb +@@ -25,12 +25,12 @@ + -- -- + ------------------------------------------------------------------------------ + +-with Fmap; use Fmap; ++with Fmap; use Fmap; + with Hostparm; +-with Namet; use Namet; +-with Opt; use Opt; +-with Output; use Output; +-with Sdefault; use Sdefault; ++with Namet; use Namet; ++with Opt; use Opt; ++with Output; use Output; ++with Sdefault; use Sdefault; + with Table; + + with Unchecked_Conversion; +@@ -43,6 +43,10 @@ package body Osint is + Running_Program : Program_Type := Unspecified; + Program_Set : Boolean := False; + ++ Std_Prefix : String_Ptr; ++ -- Standard prefix, computed dynamically the first time Relocate_Path ++ -- is called, and cached for subsequent calls. ++ + ------------------------------------- + -- Use of Name_Find and Name_Enter -- + ------------------------------------- +@@ -72,6 +76,14 @@ package body Osint is + function Concat (String_One : String; String_Two : String) return String; + -- Concatenates 2 strings and returns the result of the concatenation + ++ function Executable_Prefix return String_Ptr; ++ -- Returns the name of the root directory where the executable is stored. ++ -- The executable must be located in a directory called "bin", or ++ -- under root/lib/gcc-lib/..., or under root/libexec/gcc/... Thus, if ++ -- the executable is stored in directory "/foo/bar/bin", this routine ++ -- returns "/foo/bar/". ++ -- Return "" if the location is not recognized as described above. ++ + function Update_Path (Path : String_Ptr) return String_Ptr; + -- Update the specified path to replace the prefix with the location + -- where GNAT is installed. See the file prefix.c in GCC for details. +@@ -607,6 +619,82 @@ package body Osint is + return Name_Enter; + end Executable_Name; + ++ ------------------------- ++ -- Executable_Prefix -- ++ ------------------------- ++ ++ function Executable_Prefix return String_Ptr is ++ Exec_Name : String (1 .. Len_Arg (0)); ++ ++ function Get_Install_Dir (Exec : String) return String_Ptr; ++ -- S is the executable name preceeded by the absolute or relative ++ -- path, e.g. "c:\usr\bin\gcc.exe" or "..\bin\gcc". ++ ++ function To_Lower (C : Character) return Character; ++ -- Converts C to lower case ++ ++ --------------------- ++ -- To_Lower -- ++ --------------------- ++ ++ function To_Lower (C : Character) return Character is ++ type Lowers_Arr is array (Character range 'A' .. 'Z') of Character; ++ Lowers : constant Lowers_Arr := "abcdefghijklmnopqrstuvwxyz"; ++ begin ++ case C is ++ when 'A' .. 'Z' => ++ return Lowers (C); ++ when others => ++ return C; ++ end case; ++ end To_Lower; ++ ++ --------------------- ++ -- Get_Install_Dir -- ++ --------------------- ++ ++ function Get_Install_Dir (Exec : String) return String_Ptr is ++ begin ++ for J in reverse Exec'Range loop ++ if Is_Directory_Separator (Exec (J)) then ++ if J < Exec'Last - 5 then ++ if (To_Lower (Exec (J + 1)) = 'l' ++ and then To_Lower (Exec (J + 2)) = 'i' ++ and then To_Lower (Exec (J + 3)) = 'b') ++ or else ++ (To_Lower (Exec (J + 1)) = 'b' ++ and then To_Lower (Exec (J + 2)) = 'i' ++ and then To_Lower (Exec (J + 3)) = 'n') ++ then ++ return new String'(Exec (Exec'First .. J)); ++ end if; ++ end if; ++ end if; ++ end loop; ++ ++ return new String'(""); ++ end Get_Install_Dir; ++ ++ -- Beginning of Executable_Prefix ++ ++ begin ++ Osint.Fill_Arg (Exec_Name'Address, 0); ++ ++ -- First determine if a path prefix was placed in front of the ++ -- executable name. ++ ++ for J in reverse Exec_Name'Range loop ++ if Is_Directory_Separator (Exec_Name (J)) then ++ return Get_Install_Dir (Exec_Name); ++ end if; ++ end loop; ++ ++ -- If you are here, the user has typed the executable name with no ++ -- directory prefix. ++ ++ return Get_Install_Dir (GNAT.OS_Lib.Locate_Exec_On_Path (Exec_Name).all); ++ end Executable_Prefix; ++ + ------------------ + -- Exit_Program -- + ------------------ +@@ -1851,6 +1939,44 @@ package body Osint is + + end Read_Source_File; + ++ ------------------- ++ -- Relocate_Path -- ++ ------------------- ++ ++ function Relocate_Path ++ (Prefix : String; ++ Path : String) return String_Ptr ++ is ++ S : String_Ptr; ++ ++ procedure set_std_prefix (S : String; Len : Integer); ++ pragma Import (C, set_std_prefix); ++ ++ begin ++ if Std_Prefix = null then ++ Std_Prefix := Executable_Prefix; ++ ++ if Std_Prefix.all /= "" then ++ -- Remove trailing directory separator when calling set_std_prefix ++ ++ set_std_prefix (Std_Prefix.all, Std_Prefix'Length - 1); ++ end if; ++ end if; ++ ++ if Path (Prefix'Range) = Prefix then ++ if Std_Prefix.all /= "" then ++ S := new String ++ (1 .. Std_Prefix'Length + Path'Last - Prefix'Last); ++ S (1 .. Std_Prefix'Length) := Std_Prefix.all; ++ S (Std_Prefix'Length + 1 .. S'Last) := ++ Path (Prefix'Last + 1 .. Path'Last); ++ return S; ++ end if; ++ end if; ++ ++ return new String'(Path); ++ end Relocate_Path; ++ + ----------------- + -- Set_Program -- + ----------------- +@@ -2269,7 +2395,7 @@ package body Osint is + + In_Length : constant Integer := Path'Length; + In_String : String (1 .. In_Length + 1); +- Component_Name : aliased String := "GNAT" & ASCII.NUL; ++ Component_Name : aliased String := "GCC" & ASCII.NUL; + Result_Ptr : Address; + Result_Length : Integer; + Out_String : String_Ptr; diff --git a/lang/gcc3/patches/patch-ar b/lang/gcc3/patches/patch-ar new file mode 100644 index 00000000000..28912f166af --- /dev/null +++ b/lang/gcc3/patches/patch-ar @@ -0,0 +1,22 @@ +$NetBSD: patch-ar,v 1.1 2004/05/28 22:28:09 shannonjr Exp $ + +--- gcc/ada/osint.ads.orig 2002-10-23 01:33:27.000000000 -0600 ++++ gcc/ada/osint.ads +@@ -195,6 +195,17 @@ package Osint is + return String_Access; + -- Convert a canonical syntax file specification to host syntax. + ++ function Relocate_Path ++ (Prefix : String; ++ Path : String) return String_Ptr; ++ -- Given an absolute path and a prefix, if Path starts with Prefix, ++ -- replace the Prefix substring with the root installation directory. ++ -- By default, try to compute the root installation directory by looking ++ -- at the executable name as it was typed on the command line and, if ++ -- needed, use the PATH environment variable. ++ -- If the above computation fails, return Path. ++ -- This function assumes that Prefix'First = Path'First ++ + ------------------------- + -- Search Dir Routines -- + ------------------------- |